Merge branch 'refs/heads/dev' into test

# Conflicts:
#	zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/enums/ErrorCodeConstants.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/ContractController.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/vo/contract/ContractNotSaveReqVO.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/vo/contract/ContractSaveReqVO.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/vo/contract/ContractViewNotRespVO.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/vo/contract/ContractViewRespVO.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/vo/contract/DetailRespVO.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/vo/contract/DetailSaveReqVO.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/vo/contract/FormulaRespVO.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/vo/contract/FormulaSaveReqVO.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/dal/mysql/contract/ContractDemoteMapper.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractService.java
#	zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractServiceImpl.java
This commit is contained in:
liss
2025-10-11 09:50:49 +08:00
113 changed files with 3889 additions and 1088 deletions

View File

@@ -0,0 +1,22 @@
package com.zt.plat.module.contractorder.api;
import com.zt.plat.module.contractorder.api.dto.ContractFormulaRespDTO;
import com.zt.plat.module.contractorder.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 合同")
public interface ContractApi {
String PREFIX = ApiConstants.PREFIX + "/contract";
@GetMapping(PREFIX + "/formulas")
@Operation(summary = "通过合同编号获取对应的结算条款数据")
List<ContractFormulaRespDTO> getFormulas(@RequestParam("contractPaperNumber") String contractPaperNumber);
}

View File

@@ -1,4 +1,4 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
package com.zt.plat.module.contractorder.api.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
@@ -6,16 +6,17 @@ import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 基础系数配置 Response VO")
@Schema(description = "RPC 服务 - 基础系数配置 Response DTO")
@Data
public class ContractViewCoefficientRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31657")
public class ContractCoefficientRespDTO {
@Schema(description = "主键")
private Long id;
@Schema(description = "配置主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6534")
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键", example = "29652")
@Schema(description = "条款主键")
private Long formulaId;
@Schema(description = "金属元素编码")
@@ -24,7 +25,7 @@ public class ContractViewCoefficientRespVO {
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "芋艿")
@Schema(description = "金属元素名称")
private String elementName;
@Schema(description = "系数值")
@@ -42,10 +43,10 @@ public class ContractViewCoefficientRespVO {
@Schema(description = "是否包含下限")
private String isInDown;
@Schema(description = "是否省内", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "是否省内")
@NotEmpty(message = "是否省内不能为空")
private String inState;
@Schema(description = "类型", example = "1")
@Schema(description = "类型")
private String type;
}
}

View File

@@ -0,0 +1,50 @@
package com.zt.plat.module.contractorder.api.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "RPC 服务 - 调整价配置 Response DTO")
@Data
public class ContractDeductRespDTO {
@Schema(description = "主键")
private Long id;
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键")
private Long formulaId;
@Schema(description = "物料编码;推送ERP")
private String materialNumber;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "上限")
private BigDecimal gradeUp;
@Schema(description = "下限")
private BigDecimal gradeDown;
@Schema(description = "是否包含上限")
private String isInUp;
@Schema(description = "是否包含下限")
private String isInDown;
@Schema(description = "方式")
private String way;
@Schema(description = "类型")
private String type;
@Schema(description = "是否省内")
private String inState;
@Schema(description = "调整价")
private BigDecimal gradeAmount;
}

View File

@@ -0,0 +1,56 @@
package com.zt.plat.module.contractorder.api.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Schema(description = "RPC 服务 - 价款结算条款 Response DTO")
@Data
public class ContractFormulaRespDTO {
@Schema(description = "主键")
private Long id;
@Schema(description = "合同主键")
private Long contractId;
@Schema(description = "公式类型;单价/总价/水扣款/加工费")
private String formulaType;
@Schema(description = "公式")
private String formulaCalculate;
@Schema(description = "编码公式")
private String numberFormula;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "物料编码")
private String materialNumber;
@Schema(description = "计算小数位")
private Long decimalPoint;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称")
private String elementName;
@Schema(description = "结算类型多条使用逗号分隔字典PRCH_STLM_TP")
private String settlementType;
// 基础系数配置
private List<ContractCoefficientRespDTO> coefficients;
// 品位等级价配置
private List<ContractGradeRespDTO> grades;
// 调整价配置
private List<ContractDeductRespDTO> deducts;
// 市场价配置
private List<ContractPriceRespDTO> prices;
}

View File

@@ -1,21 +1,21 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
package com.zt.plat.module.contractorder.api.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 品位等级价配置 Response VO")
@Schema(description = "RPC 服务 - 品位等级价配置 Response DTO")
@Data
public class ContractViewGradeRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15414")
public class ContractGradeRespDTO {
@Schema(description = "主键")
private Long id;
@Schema(description = "配置主键", example = "16734")
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键", example = "15344")
@Schema(description = "条款主键")
private Long formulaId;
@Schema(description = "金属元素编码")
@@ -24,7 +24,7 @@ public class ContractViewGradeRespVO {
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "芋艿")
@Schema(description = "金属元素名称")
private String elementName;
@Schema(description = "品位单位")
@@ -51,13 +51,12 @@ public class ContractViewGradeRespVO {
@Schema(description = "不足系数值按比例计算")
private String useCoefficient;
@Schema(description = "计价类型", example = "2")
@Schema(description = "计价类型")
private String priceType;
@Schema(description = "是否省内", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "是否省内不能为空")
@Schema(description = "是否省内")
private String inState;
@Schema(description = "等级单价", example = "26237")
@Schema(description = "等级单价")
private BigDecimal unitPrice;
}
}

View File

@@ -0,0 +1,54 @@
package com.zt.plat.module.contractorder.api.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "RPC 服务 - 市场价配置 Response DTO")
@Data
public class ContractPriceRespDTO {
@Schema(description = "主键")
private Long id;
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键")
private Long formulaId;
@Schema(description = "市场价")
private BigDecimal value;
@Schema(description = "计算方式;均价/高位价/地位价")
private String calculateWay;
@Schema(description = "数据来源网价代码;数据字典")
private String dataOrigin;
@Schema(description = "计价开始日期")
private LocalDateTime calculateStartDate;
@Schema(description = "计价截止日期")
private LocalDateTime calculateEndDate;
@Schema(description = "包含开始日期")
private String inStartDate;
@Schema(description = "包含结束日期")
private String inEndDate;
@Schema(description = "价格品种元素的明细分类")
private String priceGrade;
@Schema(description = "品种分类")
private String gradeType;
@Schema(description = "取价方式;区间价/固定价")
private String averageType;
@Schema(description = "网价小数位")
private BigDecimal decimalPoint;
}

View File

@@ -20,4 +20,7 @@ public class ApiConstants {
public static final String VERSION = "1.0.0";
public static final String PURCHASE = "甲方";
public static final String SALES = "乙方";
}

View File

@@ -21,4 +21,5 @@ public interface ErrorCodeConstants {
ErrorCode CONTRACT_DATA_NOT_EXISTS = new ErrorCode(1_027_000_006, "{}不存在");
ErrorCode CONTRACT_STATUS_NOT_SUBMIT_APPROVAL = new ErrorCode(1_027_000_007, "{}状态合同不允许提交审核");
ErrorCode CONTRACT_STATUS_NOT_APPROVAL = new ErrorCode(1_027_000_008, "{}状态合同不允许审核");
ErrorCode CONTRACT_ERP_COMPANY_PLEASE_BIND = new ErrorCode(1_027_000_009, "请先绑定{}ERP公司信息");
}

View File

@@ -0,0 +1,17 @@
package com.zt.plat.module.contractorder.enums.purchaseorder;
import com.zt.plat.framework.common.exception.ErrorCode;
/**
* contract-order 错误码枚举类
*
* contract-order 系统,使用 1-xxx-xxx-xxx 段
*
* @author ZT
*/
public interface ErrorCodeConstants {
ErrorCode PURCHASE_ORDER_NOT_EXISTS = new ErrorCode(1_008_000_001, "采购订单不存在");
ErrorCode PRCH_ORD_DTL_NOT_EXISTS = new ErrorCode(1_008_001_001, "采购订单明细不存在");
}

View File

@@ -136,6 +136,11 @@
<artifactId>zt-module-bpm-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.zt.plat</groupId>
<artifactId>zt-module-erp-server</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<build>

View File

@@ -0,0 +1,25 @@
package com.zt.plat.module.contractorder.api;
import com.zt.plat.module.contractorder.api.dto.ContractFormulaRespDTO;
import com.zt.plat.module.contractorder.service.contract.ContractService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@Validated
@Slf4j
public class ContractApiImpl implements ContractApi {
@Resource
private ContractService contractService;
@Override
public List<ContractFormulaRespDTO> getFormulas(String contractPaperNumber) {
System.out.println("contract feign" + contractPaperNumber);
return List.of();
}
}

View File

@@ -18,6 +18,8 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
@Slf4j
@@ -38,9 +40,30 @@ public class ContractController implements BusinessControllerMarker {
return success(BeanUtils.toBean(pageResult, ContractRespVO.class));
}
@GetMapping("/nots")
@Operation(summary = "查询不计价规则列表")
@PreAuthorize("@ss.hasPermission('base:contract:query')")
public CommonResult<List<NotRespVO>> getNots(NotsQueryReqVO queryReqVO) {
return success(contractService.getNots(queryReqVO));
}
@GetMapping("/demotes")
@Operation(summary = "查询参数降级规则列表")
@PreAuthorize("@ss.hasPermission('base:contract:query')")
public CommonResult<List<DemoteRespVO>> getDemotes(DemotesQueryReqVO queryReqVO) {
return success(contractService.getDemotes(queryReqVO));
}
@GetMapping("/formulas")
@Operation(summary = "查询结算公式列表")
@PreAuthorize("@ss.hasPermission('base:contract:query')")
public CommonResult<List<FormulaRespVO>> getFormulas(FormulasQueryReqVO queryReqVO) {
return success(contractService.getFormulas(queryReqVO));
}
@PostMapping("/create")
@Operation(summary = "新增合同")
@PreAuthorize("@ss.hasPermission('system:contract:create')")
@PreAuthorize("@ss.hasPermission('base:contract:create')")
public CommonResult<JSONObject> create(@Valid @RequestBody ContractSaveReqVO reqVO) {
Long id = contractService.createContract(reqVO);
return success(new JSONObject().putOnce("id", id));
@@ -49,15 +72,15 @@ public class ContractController implements BusinessControllerMarker {
@GetMapping("/get")
@Operation(summary = "获得合同详情")
@Parameter(name = "id", description = "合同ID", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:contract:get')")
public CommonResult<ContractViewRespVO> get(@RequestParam("id") Long id) {
ContractViewRespVO contractViewRespVO = contractService.get(id);
return success(contractViewRespVO);
@PreAuthorize("@ss.hasPermission('base:contract:get')")
public CommonResult<ContractRespVO> get(@RequestParam("id") Long id) {
ContractRespVO contractRespVO = contractService.get(id);
return success(contractRespVO);
}
@PutMapping("update")
@Operation(summary = "修改合同")
@PreAuthorize("@ss.hasPermission('system:contract:update')")
@PreAuthorize("@ss.hasPermission('base:contract:update')")
public CommonResult<Boolean> update(@Valid @RequestBody ContractSaveReqVO reqVO) {
return success(contractService.update(reqVO));
}
@@ -66,7 +89,7 @@ public class ContractController implements BusinessControllerMarker {
@DeleteMapping("/delete")
@Operation(summary = "删除合同")
@Parameter(name = "ids", description = "合同ID集合", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:contract:delete')")
@PreAuthorize("@ss.hasPermission('base:contract:delete')")
public CommonResult<Boolean> delete(@RequestParam("ids") Long[] ids) {
return success(true);
}
@@ -74,34 +97,34 @@ public class ContractController implements BusinessControllerMarker {
// TODO
@PostMapping("/download")
@Operation(summary = "下载文件")
@PreAuthorize("@ss.hasPermission('system:contract:download')")
@PreAuthorize("@ss.hasPermission('base:contract:download')")
public void download() {
}
// TODO
@PostMapping("/preview")
@Operation(summary = "预览文件")
@PreAuthorize("@ss.hasPermission('system:contract:preview')")
@PreAuthorize("@ss.hasPermission('base:contract:preview')")
public void preview() {
}
// TODO
@PostMapping("/complete")
@Operation(summary = "完结")
@PreAuthorize("@ss.hasPermission('system:contract:complete')")
@PreAuthorize("@ss.hasPermission('base:contract:complete')")
public void complete() {
}
// TODO
@PostMapping("/archive")
@Operation(summary = "归档")
@PreAuthorize("@ss.hasPermission('system:contract:archive')")
@PreAuthorize("@ss.hasPermission('base:contract:archive')")
public void archive() {
}
@GetMapping("/submit/approval")
@Operation(summary = "合同提交审批")
@PreAuthorize("@ss.hasPermission('system:contract:approval')")
@PreAuthorize("@ss.hasPermission('base:contract:approval')")
public CommonResult<String> submitApproval(@RequestParam("id") Long id) {
return success(contractService.submitApproval(id));
}
@@ -109,22 +132,22 @@ public class ContractController implements BusinessControllerMarker {
// TODO
@PostMapping("/approval")
@Operation(summary = "合同审批")
@PreAuthorize("@ss.hasPermission('system:contract:approval')")
public CommonResult<String> approval(@Valid @RequestBody ContractApprovalReqVO reqVO) {
@PreAuthorize("@ss.hasPermission('base:contract:approval')")
public CommonResult<String> approval(@Valid @RequestBody ApprovalReqVO reqVO) {
return success(contractService.approval(reqVO));
}
// TODO
@PostMapping("/view/approval")
@Operation(summary = "查看审批")
@PreAuthorize("@ss.hasPermission('system:contract:approval')")
@PreAuthorize("@ss.hasPermission('base:contract:approval')")
public void viewApproval() {
}
// TODO
@PostMapping("/submit/erp")
@Operation(summary = "提交ERP")
@PreAuthorize("@ss.hasPermission('system:contract:erp')")
@PreAuthorize("@ss.hasPermission('base:contract:erp')")
public void submitErp() {
}
}

View File

@@ -0,0 +1,23 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 合同审核请求对象 Request VO")
@Data
public class ApprovalReqVO {
@Schema(description = "合同主键ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "合同主键ID不能为空")
private Long id;
@Schema(description = "审核结果(通过PASS驳回REJECT)", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "审核结果不能为空")
private String auditResult;
@Schema(description = "审批意见", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "审核意见不能为空")
private String reviewOpinion;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 基础系数配置 Response VO")
@Data
public class CoefficientRespVO {
@Schema(description = "主键")
private Long id;
@Schema(description = "条款主键")
private Long formulaId;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称")
private String elementName;
@Schema(description = "系数上限")
private BigDecimal coefficientUp;
@Schema(description = "系数下限")
private BigDecimal coefficientDown;
@Schema(description = "区间方式(字典STLM_RNG_WY)")
private String rangeWay;
@Schema(description = "是否省内")
private String inState;
@Schema(description = "类型")
private String type;
@Schema(description = "系数值")
private BigDecimal settlementCoefficient;
}

View File

@@ -1,23 +1,18 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 基础系数配置新增/修改 Request VO")
@Data
public class ContractCoefficientSaveReqVO {
public class CoefficientSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31657")
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "27478")
private Long id;
@Schema(description = "配置主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6534")
@NotNull(message = "配置主键不能为空")
private Long parameterId;
@Schema(description = "条款主键", example = "29652")
@Schema(description = "条款主键", example = "13898")
private Long formulaId;
@Schema(description = "金属元素编码")
@@ -29,25 +24,21 @@ public class ContractCoefficientSaveReqVO {
@Schema(description = "金属元素名称", example = "芋艿")
private String elementName;
@Schema(description = "系数值")
private String settlementCoefficient;
@Schema(description = "系数上限")
private BigDecimal coefficientUp;
@Schema(description = "系数下限")
private BigDecimal coefficientDown;
@Schema(description = "是否包含上限")
private String isInUp;
@Schema(description = "区间方式(字典STLM_RNG_WY)")
private String rangeWay;
@Schema(description = "是否包含下限")
private String isInDown;
@Schema(description = "是否省内", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "是否省内不能为空")
@Schema(description = "是否省内(字典ERP_CTRT_YN)")
private String inState;
@Schema(description = "类型", example = "1")
@Schema(description = "类型(字典STLM_COEF)", example = "1")
private String type;
@Schema(description = "系数值")
private BigDecimal settlementCoefficient;
}

View File

@@ -1,54 +0,0 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 调整价配置新增/修改 Request VO")
@Data
public class ContractDeductSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25312")
private Long id;
@Schema(description = "配置主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "21114")
@NotNull(message = "配置主键不能为空")
private Long parameterId;
@Schema(description = "条款主键", example = "29909")
private Long formulaId;
@Schema(description = "物料编码;推送ERP")
private String materialNumber;
@Schema(description = "物料名称", example = "张三")
private String materialName;
@Schema(description = "上限", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "上限不能为空")
private BigDecimal gradeUp;
@Schema(description = "下限")
private BigDecimal gradeDown;
@Schema(description = "是否包含上限")
private String isInUp;
@Schema(description = "是否包含下限")
private String isInDown;
@Schema(description = "方式")
private String way;
@Schema(description = "类型", example = "1")
private String type;
@Schema(description = "是否省内", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "是否省内不能为空")
private String inState;
@Schema(description = "调整价")
private BigDecimal gradeAmount;
}

View File

@@ -1,63 +0,0 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 品位等级价配置新增/修改 Request VO")
@Data
public class ContractGradeSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15414")
private Long id;
@Schema(description = "配置主键", example = "16734")
private Long parameterId;
@Schema(description = "条款主键", example = "15344")
private Long formulaId;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "芋艿")
private String elementName;
@Schema(description = "品位单位")
private String gradeUnit;
@Schema(description = "品位上限")
private BigDecimal gradeUp;
@Schema(description = "品位下限")
private BigDecimal gradeDown;
@Schema(description = "是否包含上限;包含则是大于等于,不包含则是大于")
private String isInUp;
@Schema(description = "是否包含下限;包含则是小于等于,不包含则是小于")
private String isInDown;
@Schema(description = "默认计价品位;计价方式为加时,默认为为下限,计价方式为减时,默认为为上限,可手动填写")
private BigDecimal gradeDefault;
@Schema(description = "系数;计价类型为阶梯价使用,标识没上升多少系数进行加款还是减款")
private BigDecimal settlementCoefficient;
@Schema(description = "不足系数值按比例计算")
private String useCoefficient;
@Schema(description = "计价类型", example = "2")
private String priceType;
@Schema(description = "是否省内", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "是否省内不能为空")
private String inState;
@Schema(description = "等级单价", example = "26237")
private BigDecimal unitPrice;
}

View File

@@ -1,215 +1,242 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataRespVO;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceItemRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 合同信息 Response VO")
@Schema(description = "管理后台 - 合同详情 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ContractRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2090")
@ExcelProperty("主键")
@Schema(description = "主键")
private Long id;
@Schema(description = "模板实例主键", example = "10196")
@ExcelProperty("模板实例主键")
@Schema(description = "模板实例主键")
private Long instanceId;
@Schema(description = "系统合同编号;自动生成,校验唯一")
@ExcelProperty("系统合同编号;自动生成,校验唯一")
private String systemContractNumber;
@Schema(description = "状态", example = "1")
@ExcelProperty("状态")
@Schema(description = "状态")
private String status;
@Schema(description = "合同名称;与ERP(HTMC)对应,校验唯一", example = "芋艿")
@ExcelProperty("合同名称;与ERP(HTMC)对应,校验唯一")
@Schema(description = "合同名称;与ERP(HTMC)对应,校验唯一")
private String contractName;
@Schema(description = "合同编号;与ERP(HTBH)对应,校验唯一")
@ExcelProperty("合同编号;与ERP(HTBH)对应,校验唯一")
private String contractPaperNumber;
@Schema(description = "是否虚拟合同;与ERP(SFXNHT)对应")
@ExcelProperty("是否虚拟合同;与ERP(SFXNHT)对应")
private String contractVirtual;
@Schema(description = "是否先款后货")
@ExcelProperty("是否先款后货")
private String hasPayable;
@Schema(description = "收支性质;与ERP(SZXZ)对应")
@ExcelProperty("收支性质;与ERP(SZXZ)对应")
private String direction;
@Schema(description = "合同类型", example = "1")
@ExcelProperty("合同类型")
@Schema(description = "合同类型")
private String contractType;
@Schema(description = "签署日期;与ERP(HTQDRQ)对应")
@ExcelProperty("签署日期;与ERP(HTQDRQ)对应")
private LocalDateTime signDate;
@Schema(description = "开始日期;与ERP(HTQSRQ)对应")
@ExcelProperty("开始日期;与ERP(HTQSRQ)对应")
private LocalDateTime startDate;
@Schema(description = "结束日期;与ERP(HTZZRQ)对应")
@ExcelProperty("结束日期;与ERP(HTZZRQ)对应")
private LocalDateTime endDate;
@Schema(description = "签署地")
@ExcelProperty("签署地")
private String signPlace;
@Schema(description = "甲方公司编号;如果是采购合同查询组织机构自动带出且与ERP(HTQDZTBH)对应如果是销售合同手动选择且与ERP(WLDWBH)对应。")
@ExcelProperty("甲方公司编号;如果是采购合同查询组织机构自动带出且与ERP(HTQDZTBH)对应如果是销售合同手动选择且与ERP(WLDWBH)对应。")
private String purchaseCompanyNumber;
@Schema(description = "甲方公司名称", example = "王五")
@ExcelProperty("甲方公司名称")
@Schema(description = "甲方公司名称")
private String purchaseCompanyName;
@Schema(description = "甲方地址")
@ExcelProperty("甲方地址")
private String purchaseAddress;
@Schema(description = "甲方法定代表人")
@ExcelProperty("甲方法定代表人")
private String purchaseLeader;
@Schema(description = "乙方公司编号;如果是销售合同查询组织机构自动带出且与ERP(HTQDZTBH)对应如果是采购合同手动选择且与ERP(WLDWBH)对应。")
@ExcelProperty("乙方公司编号;如果是销售合同查询组织机构自动带出且与ERP(HTQDZTBH)对应如果是采购合同手动选择且与ERP(WLDWBH)对应。")
private String salesCompanyNumber;
@Schema(description = "乙方公司名称", example = "王五")
@ExcelProperty("乙方公司名称")
@Schema(description = "乙方公司名称")
private String salesCompanyName;
@Schema(description = "乙方地址")
@ExcelProperty("乙方地址")
private String salesAddress;
@Schema(description = "乙方企业负责人")
@ExcelProperty("乙方企业负责人")
private String salesPurchaseLeader;
@Schema(description = "币种;与ERP(BZBH)对应")
@ExcelProperty("币种;与ERP(BZBH)对应")
private String currency;
@Schema(description = "原币金额;与ERP(HTYBZJE)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
@ExcelProperty("原币金额;与ERP(HTYBZJE)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
private BigDecimal cooAmount;
@Schema(description = "本币金额;与ERP(HTBWBZJE)对应")
@ExcelProperty("本币金额;与ERP(HTBWBZJE)对应")
private BigDecimal basicAmount;
@Schema(description = "是否有履约保证金;为是,则保证金必填。")
@ExcelProperty("是否有履约保证金;为是,则保证金必填。")
private String hasDeposit;
@Schema(description = "原币履约保证金;与ERP(LYBZJBGQYB)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
@ExcelProperty("原币履约保证金;与ERP(LYBZJBGQYB)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
private BigDecimal cooAmountDeposit;
@Schema(description = "本币履约保证金;与ERP(LYBZJBGQBWB)对应")
@ExcelProperty("本币履约保证金;与ERP(LYBZJBGQBWB)对应")
private BigDecimal basicAmountDeposit;
@Schema(description = "是否有预付款;与ERP(SFYYFK)对应")
@ExcelProperty("是否有预付款;与ERP(SFYYFK)对应")
private String hasPrepayment;
@Schema(description = "预付款比例;与ERP(YFKBL)对应")
@ExcelProperty("预付款比例;与ERP(YFKBL)对应")
private BigDecimal prepaymentRatio;
@Schema(description = "预付款金额;与ERP(YFKJE)对应")
@ExcelProperty("预付款金额;与ERP(YFKJE)对应")
private BigDecimal prepaymentAmount;
@Schema(description = "是否有质保金;与ERP(SFHZBJ)对应")
@ExcelProperty("是否有质保金;与ERP(SFHZBJ)对应")
private String hasQualityAmount;
@Schema(description = "质保金比例;与ERP(ZBJBL)对应")
@ExcelProperty("质保金比例;与ERP(ZBJBL)对应")
private BigDecimal qualityRatio;
@Schema(description = "质保金金额;与ERP(BZJJE)对应")
@ExcelProperty("质保金金额;与ERP(BZJJE)对应")
private BigDecimal qualityAmount;
@Schema(description = "补充协议类型;变更协议/增加条款", example = "1")
@ExcelProperty("补充协议类型;变更协议/增加条款")
@Schema(description = "补充协议类型;变更协议/增加条款")
private String replenishAgreementType;
@Schema(description = "备注;与ERP(BZXX)对应")
@ExcelProperty("备注;与ERP(BZXX)对应")
private String remark;
@Schema(description = "施工类型编号;与ERP(HTLXBH)对应,拓展信息")
@ExcelProperty("施工类型编号;与ERP(HTLXBH)对应,拓展信息")
private String constructionTypeNumber;
@Schema(description = "施工类型名称;与ERP(HTLXMC)对应,拓展信息", example = "张三")
@ExcelProperty("施工类型名称;与ERP(HTLXMC)对应,拓展信息")
@Schema(description = "施工类型名称;与ERP(HTLXMC)对应,拓展信息")
private String constructionTypeName;
@Schema(description = "代理方;与ERP(ZLIFNR)对应,拓展信息")
@ExcelProperty("代理方;与ERP(ZLIFNR)对应,拓展信息")
private String agent;
@Schema(description = "类别;与ERP(HTLB)对应,拓展信息")
@ExcelProperty("类别;与ERP(HTLB)对应,拓展信息")
private String category;
@Schema(description = "原币金额-变更后;与ERP(BGHHTYBZJE)对应,拓展信息")
@ExcelProperty("原币金额-变更后;与ERP(BGHHTYBZJE)对应,拓展信息")
private BigDecimal changeCooAmount;
@Schema(description = "本币金额-变更后;与ERP(BGHHTBWBZJE)对应,拓展信息")
@ExcelProperty("本币金额-变更后;与ERP(BGHHTBWBZJE)对应,拓展信息")
private BigDecimal changeBasicAmount;
@Schema(description = "原币履约保证金-变更后;与ERP(LYBZJBGHYB)对应,拓展信息")
@ExcelProperty("原币履约保证金-变更后;与ERP(LYBZJBGHYB)对应,拓展信息")
private BigDecimal changeCooAmountDeposit;
@Schema(description = "本币履约保证金-变更后;与ERP(LYBZJBGHBWB)对应,拓展信息")
@ExcelProperty("本币履约保证金-变更后;与ERP(LYBZJBGHBWB)对应,拓展信息")
private BigDecimal changeBasicAmountDeposit;
@Schema(description = "是否框架合同;与ERP(SFKJHT)对应,拓展信息")
@ExcelProperty("是否框架合同;与ERP(SFKJHT)对应,拓展信息")
private String isFramework;
@Schema(description = "境内/境外;与ERP(JNJW)对应,拓展信息")
@ExcelProperty("境内/境外;与ERP(JNJW)对应,拓展信息")
private String isDomestic;
@Schema(description = "建筑服务发生地;与ERP(JZFWFSD)对应拓展信息销售合同且类型为SAP02COSR必填")
@ExcelProperty("建筑服务发生地;与ERP(JZFWFSD)对应拓展信息销售合同且类型为SAP02COSR必填")
private String architectureServicePlace;
@Schema(description = "达到收款条件金额;与ERP(DDSKJE)对应拓展信息销售合同且类型为SAP02COSR必填")
@ExcelProperty("达到收款条件金额;与ERP(DDSKJE)对应拓展信息销售合同且类型为SAP02COSR必填")
private BigDecimal payeeConditionAmount;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "步骤")
@ExcelProperty("步骤")
private Integer step;
}
@Schema(description = "ERP请求状态")
private String erpStatus;
@Schema(description = "ERP请求失败原因")
private String cause;
@Schema(description = "流程实例编号")
private String processInstanceId;
@Schema(description = "审批意见")
private String reviewOpinion;
@Schema(description = "任务节点主键")
private String taskNodeId;
@Schema(description = "模板附件对象存储")
private String fileObject;
@Schema(description = "其它附件对象存储")
private String fileObjectOther;
@Schema(description = "交货地点")
private String deliveryAddress;
@Schema(description = "交货方式(字典:FRCST_ASN)")
private String deliveryWay;
@Schema(description = "甲方联系人")
private String purchaseHuman;
@Schema(description = "甲方电话")
private String purchaseTel;
@Schema(description = "甲方邮箱")
private String purchaseEmail;
@Schema(description = "甲方传真")
private String purchaseFax;
@Schema(description = "甲方联系地址")
private String purchaseContactAddress;
@Schema(description = "乙方联系人")
private String salesHuman;
@Schema(description = "乙方电话")
private String salesTel;
@Schema(description = "乙方邮箱")
private String salesEmail;
@Schema(description = "乙方传真")
private String salesFax;
@Schema(description = "乙方联系地址")
private String salesContactAddress;
// 物料信息
private List<DetailRespVO> detail;
// 合同动态表单
private List<TemplateInstanceDataRespVO> dynamicsFields;
// 合同动态条款
private List<TemplateInstanceItemRespVO> dynamicsItems;
// 价款结算条款
private List<FormulaRespVO> formulas;
// 参数降级规则
private List<DemoteRespVO> demotes;
// 品位不计价规则
private List<NotRespVO> nots;
}

View File

@@ -162,7 +162,7 @@ public class ContractSaveReqVO {
private String remark;
// 物料信息
private List<ContractDetailSaveReqVO> detail;
private List<DetailSaveReqVO> detail;
// 扩展信息
@Schema(description = "原币金额-变更后;与ERP(BGHHTYBZJE)对应,拓展信息")
@@ -208,6 +208,9 @@ public class ContractSaveReqVO {
@Schema(description = "达到收款条件金额;与ERP(DDSKJE)对应拓展信息销售合同且类型为SAP02COSR必填")
private BigDecimal payeeConditionAmount;
@Schema(description = "是否内部企业(字典ERP_CTRT_YN)")
private String isInternal;
// 模板部分
@Schema(description = "模板实例主键", example = "10196")
private Long instanceId;
@@ -216,11 +219,11 @@ public class ContractSaveReqVO {
private List<TemplateInstanceDataSaveReqVO> dynamicsFields;
// 价款结算条款
private List<ContractFormulaSaveReqVO> formulas;
private List<FormulaSaveReqVO> formulas;
// 参数降级规则
private List<ContractDemoteSaveReqVO> demotes;
private List<DemoteSaveReqVO> demotes;
// 品位不计价配置
private List<ContractNotSaveReqVO> nots;
// 品位不计价规则
private List<NotSaveReqVO> nots;
}

View File

@@ -1,54 +0,0 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 调整价配置 Response VO")
@Data
public class ContractViewDeductRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25312")
private Long id;
@Schema(description = "配置主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "21114")
@NotNull(message = "配置主键不能为空")
private Long parameterId;
@Schema(description = "条款主键", example = "29909")
private Long formulaId;
@Schema(description = "物料编码;推送ERP")
private String materialNumber;
@Schema(description = "物料名称", example = "张三")
private String materialName;
@Schema(description = "上限", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "上限不能为空")
private BigDecimal gradeUp;
@Schema(description = "下限")
private BigDecimal gradeDown;
@Schema(description = "是否包含上限")
private String isInUp;
@Schema(description = "是否包含下限")
private String isInDown;
@Schema(description = "方式")
private String way;
@Schema(description = "类型", example = "1")
private String type;
@Schema(description = "是否省内", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "是否省内不能为空")
private String inState;
@Schema(description = "调整价")
private BigDecimal gradeAmount;
}

View File

@@ -1,312 +0,0 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataRespVO;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceItemRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 合同详情 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ContractViewRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2476")
@ExcelProperty("主键")
private Long id;
@Schema(description = "模板实例主键", example = "5352")
@ExcelProperty("模板实例主键")
private Long instanceId;
@Schema(description = "系统合同编号;自动生成,校验唯一")
@ExcelProperty("系统合同编号;自动生成,校验唯一")
private String systemContractNumber;
@Schema(description = "状态", example = "2")
@ExcelProperty("状态")
private String status;
@Schema(description = "合同名称;与ERP(HTMC)对应,校验唯一", example = "李四")
@ExcelProperty("合同名称;与ERP(HTMC)对应,校验唯一")
private String contractName;
@Schema(description = "合同编号;与ERP(HTBH)对应,校验唯一")
@ExcelProperty("合同编号;与ERP(HTBH)对应,校验唯一")
private String contractPaperNumber;
@Schema(description = "是否虚拟合同;与ERP(SFXNHT)对应")
@ExcelProperty("是否虚拟合同;与ERP(SFXNHT)对应")
private String contractVirtual;
@Schema(description = "是否先款后货")
@ExcelProperty("是否先款后货")
private String hasPayable;
@Schema(description = "收支性质;与ERP(SZXZ)对应")
@ExcelProperty("收支性质;与ERP(SZXZ)对应")
private String direction;
@Schema(description = "合同类型", example = "2")
@ExcelProperty("合同类型")
private String contractType;
@Schema(description = "签署日期;与ERP(HTQDRQ)对应")
@ExcelProperty("签署日期;与ERP(HTQDRQ)对应")
private LocalDateTime signDate;
@Schema(description = "开始日期;与ERP(HTQSRQ)对应")
@ExcelProperty("开始日期;与ERP(HTQSRQ)对应")
private LocalDateTime startDate;
@Schema(description = "结束日期;与ERP(HTZZRQ)对应")
@ExcelProperty("结束日期;与ERP(HTZZRQ)对应")
private LocalDateTime endDate;
@Schema(description = "签署地")
@ExcelProperty("签署地")
private String signPlace;
@Schema(description = "甲方公司编号;如果是采购合同查询组织机构自动带出且与ERP(HTQDZTBH)对应如果是销售合同手动选择且与ERP(WLDWBH)对应。")
@ExcelProperty("甲方公司编号;如果是采购合同查询组织机构自动带出且与ERP(HTQDZTBH)对应如果是销售合同手动选择且与ERP(WLDWBH)对应。")
private String purchaseCompanyNumber;
@Schema(description = "甲方公司名称", example = "芋艿")
@ExcelProperty("甲方公司名称")
private String purchaseCompanyName;
@Schema(description = "甲方地址")
@ExcelProperty("甲方地址")
private String purchaseAddress;
@Schema(description = "甲方法定代表人")
@ExcelProperty("甲方法定代表人")
private String purchaseLeader;
@Schema(description = "乙方公司编号;如果是销售合同查询组织机构自动带出且与ERP(HTQDZTBH)对应如果是采购合同手动选择且与ERP(WLDWBH)对应。")
@ExcelProperty("乙方公司编号;如果是销售合同查询组织机构自动带出且与ERP(HTQDZTBH)对应如果是采购合同手动选择且与ERP(WLDWBH)对应。")
private String salesCompanyNumber;
@Schema(description = "乙方公司名称", example = "赵六")
@ExcelProperty("乙方公司名称")
private String salesCompanyName;
@Schema(description = "乙方地址")
@ExcelProperty("乙方地址")
private String salesAddress;
@Schema(description = "乙方企业负责人")
@ExcelProperty("乙方企业负责人")
private String salesPurchaseLeader;
@Schema(description = "币种;与ERP(BZBH)对应")
@ExcelProperty("币种;与ERP(BZBH)对应")
private String currency;
@Schema(description = "原币金额;与ERP(HTYBZJE)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
@ExcelProperty("原币金额;与ERP(HTYBZJE)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
private BigDecimal cooAmount;
@Schema(description = "本币金额;与ERP(HTBWBZJE)对应")
@ExcelProperty("本币金额;与ERP(HTBWBZJE)对应")
private BigDecimal basicAmount;
@Schema(description = "是否有履约保证金;为是,则保证金必填。")
@ExcelProperty("是否有履约保证金;为是,则保证金必填。")
private String hasDeposit;
@Schema(description = "原币履约保证金;与ERP(LYBZJBGQYB)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
@ExcelProperty("原币履约保证金;与ERP(LYBZJBGQYB)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
private BigDecimal cooAmountDeposit;
@Schema(description = "本币履约保证金;与ERP(LYBZJBGQBWB)对应")
@ExcelProperty("本币履约保证金;与ERP(LYBZJBGQBWB)对应")
private BigDecimal basicAmountDeposit;
@Schema(description = "是否有预付款;与ERP(SFYYFK)对应")
@ExcelProperty("是否有预付款;与ERP(SFYYFK)对应")
private String hasPrepayment;
@Schema(description = "预付款比例;与ERP(YFKBL)对应")
@ExcelProperty("预付款比例;与ERP(YFKBL)对应")
private BigDecimal prepaymentRatio;
@Schema(description = "预付款金额;与ERP(YFKJE)对应")
@ExcelProperty("预付款金额;与ERP(YFKJE)对应")
private BigDecimal prepaymentAmount;
@Schema(description = "是否有质保金;与ERP(SFHZBJ)对应")
@ExcelProperty("是否有质保金;与ERP(SFHZBJ)对应")
private String hasQualityAmount;
@Schema(description = "质保金比例;与ERP(ZBJBL)对应")
@ExcelProperty("质保金比例;与ERP(ZBJBL)对应")
private BigDecimal qualityRatio;
@Schema(description = "质保金金额;与ERP(BZJJE)对应")
@ExcelProperty("质保金金额;与ERP(BZJJE)对应")
private BigDecimal qualityAmount;
@Schema(description = "补充协议类型;变更协议/增加条款", example = "2")
@ExcelProperty("补充协议类型;变更协议/增加条款")
private String replenishAgreementType;
@Schema(description = "备注;与ERP(BZXX)对应")
@ExcelProperty("备注;与ERP(BZXX)对应")
private String remark;
@Schema(description = "施工类型编号;与ERP(HTLXBH)对应,拓展信息")
@ExcelProperty("施工类型编号;与ERP(HTLXBH)对应,拓展信息")
private String constructionTypeNumber;
@Schema(description = "施工类型名称;与ERP(HTLXMC)对应,拓展信息", example = "李四")
@ExcelProperty("施工类型名称;与ERP(HTLXMC)对应,拓展信息")
private String constructionTypeName;
@Schema(description = "代理方;与ERP(ZLIFNR)对应,拓展信息")
@ExcelProperty("代理方;与ERP(ZLIFNR)对应,拓展信息")
private String agent;
@Schema(description = "类别;与ERP(HTLB)对应,拓展信息")
@ExcelProperty("类别;与ERP(HTLB)对应,拓展信息")
private String category;
@Schema(description = "原币金额-变更后;与ERP(BGHHTYBZJE)对应,拓展信息")
@ExcelProperty("原币金额-变更后;与ERP(BGHHTYBZJE)对应,拓展信息")
private BigDecimal changeCooAmount;
@Schema(description = "本币金额-变更后;与ERP(BGHHTBWBZJE)对应,拓展信息")
@ExcelProperty("本币金额-变更后;与ERP(BGHHTBWBZJE)对应,拓展信息")
private BigDecimal changeBasicAmount;
@Schema(description = "原币履约保证金-变更后;与ERP(LYBZJBGHYB)对应,拓展信息")
@ExcelProperty("原币履约保证金-变更后;与ERP(LYBZJBGHYB)对应,拓展信息")
private BigDecimal changeCooAmountDeposit;
@Schema(description = "本币履约保证金-变更后;与ERP(LYBZJBGHBWB)对应,拓展信息")
@ExcelProperty("本币履约保证金-变更后;与ERP(LYBZJBGHBWB)对应,拓展信息")
private BigDecimal changeBasicAmountDeposit;
@Schema(description = "是否框架合同;与ERP(SFKJHT)对应,拓展信息")
@ExcelProperty("是否框架合同;与ERP(SFKJHT)对应,拓展信息")
private String isFramework;
@Schema(description = "境内/境外;与ERP(JNJW)对应,拓展信息")
@ExcelProperty("境内/境外;与ERP(JNJW)对应,拓展信息")
private String isDomestic;
@Schema(description = "建筑服务发生地;与ERP(JZFWFSD)对应拓展信息销售合同且类型为SAP02COSR必填")
@ExcelProperty("建筑服务发生地;与ERP(JZFWFSD)对应拓展信息销售合同且类型为SAP02COSR必填")
private String architectureServicePlace;
@Schema(description = "达到收款条件金额;与ERP(DDSKJE)对应拓展信息销售合同且类型为SAP02COSR必填")
@ExcelProperty("达到收款条件金额;与ERP(DDSKJE)对应拓展信息销售合同且类型为SAP02COSR必填")
private BigDecimal payeeConditionAmount;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "步骤")
@ExcelProperty("步骤")
private Integer step;
@Schema(description = "ERP请求状态", example = "1")
@ExcelProperty("ERP请求状态")
private String erpStatus;
@Schema(description = "ERP请求失败原因")
@ExcelProperty("ERP请求失败原因")
private String cause;
@Schema(description = "流程实例编号", example = "27511")
@ExcelProperty("流程实例编号")
private String processInstanceId;
@Schema(description = "审批意见")
@ExcelProperty("审批意见")
private String reviewOpinion;
@Schema(description = "任务节点主键", example = "26040")
@ExcelProperty("任务节点主键")
private String taskNodeId;
@Schema(description = "模板附件对象存储")
@ExcelProperty("模板附件对象存储")
private String fileObject;
@Schema(description = "其它附件对象存储")
@ExcelProperty("其它附件对象存储")
private String fileObjectOther;
@Schema(description = "交货地点")
@ExcelProperty("交货地点")
private String deliveryAddress;
@Schema(description = "交货方式(字典:FRCST_ASN)")
@ExcelProperty("交货方式(字典:FRCST_ASN)")
private String deliveryWay;
@Schema(description = "甲方联系人")
@ExcelProperty("甲方联系人")
private String purchaseHuman;
@Schema(description = "甲方电话")
@ExcelProperty("甲方电话")
private String purchaseTel;
@Schema(description = "甲方邮箱")
@ExcelProperty("甲方邮箱")
private String purchaseEmail;
@Schema(description = "甲方传真")
@ExcelProperty("甲方传真")
private String purchaseFax;
@Schema(description = "甲方联系地址")
@ExcelProperty("甲方联系地址")
private String purchaseContactAddress;
@Schema(description = "乙方联系人")
@ExcelProperty("乙方联系人")
private String salesHuman;
@Schema(description = "乙方电话")
@ExcelProperty("乙方电话")
private String salesTel;
@Schema(description = "乙方邮箱")
@ExcelProperty("乙方邮箱")
private String salesEmail;
@Schema(description = "乙方传真")
@ExcelProperty("乙方传真")
private String salesFax;
@Schema(description = "乙方联系地址")
@ExcelProperty("乙方联系地址")
private String salesContactAddress;
// 物料信息
private List<ContractViewDetailRespVO> detail;
// 合同动态表单
private List<TemplateInstanceDataRespVO> dynamicsFields;
// 合同动态条款
private List<TemplateInstanceItemRespVO> dynamicsItems;
// 价款结算条款
private List<ContractViewFormulaRespVO> formulas;
// 参数降级规则
private List<ContractViewDemoteRespVO> demotes;
// 品位不计价配置
private List<ContractViewNotRespVO> nots;
}

View File

@@ -0,0 +1,29 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 调整价配置 Response VO")
@Data
public class DeductRespVO {
@Schema(description = "主键")
private Long id;
@Schema(description = "条款主键")
private Long formulaId;
@Schema(description = "数据项类型(字典:GRD_CFG_TP)")
private String configType;
@Schema(description = "是否省内")
private String inState;
@Schema(description = "调整价")
private BigDecimal gradeAmount;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,26 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 调整价配置新增/修改 Request VO")
@Data
public class DeductSaveReqVO {
@Schema(description = "主键")
private Long id;
@Schema(description = "条款主键")
private Long formulaId;
@Schema(description = "数据项类型(字典:GRD_CFG_TP)")
private String configType;
@Schema(description = "是否省内")
private String inState;
@Schema(description = "调整价")
private BigDecimal gradeAmount;
}

View File

@@ -0,0 +1,53 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 参数降级规则 Response VO")
@Data
@ExcelIgnoreUnannotated
public class DemoteRespVO {
@Schema(description = "主键")
private Long id;
@Schema(description = "合同主键")
private Long contractId;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称")
private String elementName;
@Schema(description = "上限")
private BigDecimal gradeUp;
@Schema(description = "区间方式(字典STLM_RNG_WY)")
private String rangeWay;
@Schema(description = "下限")
private BigDecimal gradeDown;
@Schema(description = "降级后物料名称")
private String materialName;
@Schema(description = "降级后物料编码")
private String materialNumber;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "合同名称")
private String contractName;
@Schema(description = "合同编码")
private String contractPaperNumber;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 参数降级规则新增/修改 Request VO")
@Data
public class DemoteSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31818")
private Long id;
@Schema(description = "合同主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14971")
@NotNull(message = "合同主键不能为空")
private Long contractId;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "王五")
private String elementName;
@Schema(description = "上限")
private BigDecimal gradeUp;
@Schema(description = "区间方式(字典STLM_RNG_WY)")
private String rangeWay;
@Schema(description = "下限")
private BigDecimal gradeDown;
@Schema(description = "降级后物料名称", example = "李四")
private String materialName;
@Schema(description = "降级后物料编码")
private String materialNumber;
}

View File

@@ -0,0 +1,18 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 查询参数降级规则列表 Request VO")
@Data
public class DemotesQueryReqVO {
@Schema(description = "合同名称")
private String contractName;
@Schema(description = "合同编码")
private String contractPaperNumber;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "金属元素")
private String elementName;
}

View File

@@ -8,34 +8,34 @@ import java.util.List;
@Schema(description = "管理后台 - 合同明细 Response VO")
@Data
public class ContractViewDetailRespVO {
public class DetailRespVO {
@Schema(description = "主键")
private Long id;
@Schema(description = "物料名称", example = "物料名称")
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "物料编码", example = "物料编码")
@Schema(description = "物料编码")
private String materialNumber;
@Schema(description = "数量")
private BigDecimal quantity;
@Schema(description = "计量单位", example = "")
@Schema(description = "计量单位")
private String unit;
@Schema(description = "含税单价", example = "28579")
@Schema(description = "含税单价")
private BigDecimal inTaxUnitPrice;
@Schema(description = "金属元素缩写", example = "金属元素缩写")
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "金属元素名称")
@Schema(description = "金属元素名称")
private String elementName;
@Schema(description = "金属元素编码", example = "金属元素编码")
@Schema(description = "金属元素编码")
private String elementNumber;
// 交货计划
private List<ContractViewPlanRespVO> plans;
private List<PlanRespVO> plans;
}

View File

@@ -8,7 +8,7 @@ import java.util.List;
@Schema(description = "管理后台 - 合同明细新增/修改 Request VO")
@Data
public class ContractDetailSaveReqVO {
public class DetailSaveReqVO {
@Schema(description = "主键")
private Long id;
@@ -41,5 +41,5 @@ public class ContractDetailSaveReqVO {
private String elementNumber;
// 交货计划
private List<ContractPlanSaveReqVO> plans;
private List<PlanSaveReqVO> plans;
}

View File

@@ -7,14 +7,14 @@ import java.util.List;
@Schema(description = "管理后台 - 价款结算条款 Response VO")
@Data
public class ContractViewFormulaRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22933")
public class FormulaRespVO {
@Schema(description = "主键")
private Long id;
@Schema(description = "合同主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "9162")
@Schema(description = "合同主键")
private Long contractId;
@Schema(description = "公式类型;单价/总价/水扣款/加工费", example = "1")
@Schema(description = "公式类型;单价/总价/水扣款/加工费")
private String formulaType;
@Schema(description = "公式")
@@ -23,7 +23,7 @@ public class ContractViewFormulaRespVO {
@Schema(description = "编码公式")
private String numberFormula;
@Schema(description = "物料名称", example = "赵六")
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "物料编码")
@@ -38,18 +38,24 @@ public class ContractViewFormulaRespVO {
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "赵六")
@Schema(description = "金属元素名称")
private String elementName;
@Schema(description = "结算类型多条使用逗号分隔字典PRCH_STLM_TP", example = "1")
@Schema(description = "结算类型多条使用逗号分隔字典PRCH_STLM_TP")
private String settlementType;
@Schema(description = "合同名称")
private String contractName;
@Schema(description = "合同编码")
private String contractPaperNumber;
// 基础系数配置
private List<ContractViewCoefficientRespVO> coefficients;
private List<CoefficientRespVO> coefficients;
// 品位等级价配置
private List<ContractViewGradeRespVO> grades;
private List<GradeRespVO> grades;
// 调整价配置
private List<ContractViewDeductRespVO> deducts;
private List<DeductRespVO> deducts;
// 市场价配置
private List<ContractViewPriceRespVO> prices;
private List<PriceRespVO> prices;
}

View File

@@ -8,7 +8,7 @@ import java.util.List;
@Schema(description = "管理后台 - 价款结算条款新增/修改 Request VO")
@Data
public class ContractFormulaSaveReqVO {
public class FormulaSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22933")
private Long id;
@@ -48,11 +48,11 @@ public class ContractFormulaSaveReqVO {
private String settlementType;
// 基础系数配置
private List<ContractCoefficientSaveReqVO> coefficients;
private List<CoefficientSaveReqVO> coefficients;
// 品位等级价配置
private List<ContractGradeSaveReqVO> grades;
private List<GradeSaveReqVO> grades;
// 调整价配置
private List<ContractDeductSaveReqVO> deducts;
private List<DeductSaveReqVO> deducts;
// 市场价配置
private List<ContractPriceSaveReqVO> prices;
private List<PriceSaveReqVO> prices;
}

View File

@@ -0,0 +1,18 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 查询结算公式列表 Request VO")
@Data
public class FormulasQueryReqVO {
@Schema(description = "合同名称")
private String contractName;
@Schema(description = "合同编码")
private String contractPaperNumber;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "金属元素")
private String elementName;
}

View File

@@ -0,0 +1,65 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 品位等级价配置 Response VO")
@Data
public class GradeRespVO {
@Schema(description = "主键")
@ExcelProperty("主键")
private Long id;
@Schema(description = "条款主键")
private Long formulaId;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称")
private String elementName;
@Schema(description = "品位单位")
private String gradeUnit;
@Schema(description = "品位上限")
private BigDecimal gradeUp;
@Schema(description = "品位下限")
private BigDecimal gradeDown;
@Schema(description = "区间方式(字典:STLM_RNG_WY)")
private String rangeWay;
@Schema(description = "默认计价品位")
private BigDecimal gradeDefault;
@Schema(description = "系数值")
private BigDecimal settlementCoefficient;
@Schema(description = "是否比例计算(字典:ERP_CTRT_YN)")
private String useCoefficient;
@Schema(description = "计价类型(字典:STLM_GRD_TP)")
private String priceType;
@Schema(description = "是否省内(字典:ERP_CTRT_YN)")
private String inState;
@Schema(description = "等级单价", example = "3565")
private BigDecimal unitPrice;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "数据项类型(字典:GRD_CFG_TP)")
private String configType;
}

View File

@@ -0,0 +1,59 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 品位等级价配置新增/修改 Request VO")
@Data
public class GradeSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6211")
private Long id;
@Schema(description = "条款主键", example = "2426")
private Long formulaId;
@Schema(description = "金属元素编码")
private String elementNumber;
@Schema(description = "金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "王五")
private String elementName;
@Schema(description = "品位单位")
private String gradeUnit;
@Schema(description = "品位上限")
private BigDecimal gradeUp;
@Schema(description = "品位下限")
private BigDecimal gradeDown;
@Schema(description = "区间方式(字典:STLM_RNG_WY)")
private String rangeWay;
@Schema(description = "默认计价品位")
private BigDecimal gradeDefault;
@Schema(description = "系数值")
private BigDecimal settlementCoefficient;
@Schema(description = "是否比例计算(字典:ERP_CTRT_YN)")
private String useCoefficient;
@Schema(description = "计价类型(字典:STLM_GRD_TP)", example = "2")
private String priceType;
@Schema(description = "是否省内(字典:ERP_CTRT_YN)")
private String inState;
@Schema(description = "等级单价", example = "3565")
private BigDecimal unitPrice;
@Schema(description = "数据项类型(字典:GRD_CFG_TP)", example = "1")
private String configType;
}

View File

@@ -1,7 +1,6 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -11,49 +10,44 @@ import java.time.LocalDateTime;
@Schema(description = "管理后台 - 品位不计价规则 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ContractViewNotRespVO {
public class NotRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18545")
@ExcelProperty("主键")
@Schema(description = "主键")
private Long id;
@Schema(description = "合同主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "5333")
@ExcelProperty("合同主键")
@Schema(description = "合同主键")
private Long contractId;
@Schema(description = "金属元素编码")
@ExcelProperty("金属元素编码")
private String elementNumber;
@Schema(description = "金属元素缩写")
@ExcelProperty("金属元素缩写")
private String elementAbbreviation;
@Schema(description = "金属元素名称", example = "王五")
@ExcelProperty("金属元素名称")
@Schema(description = "金属元素名称")
private String elementName;
@Schema(description = "上限")
@ExcelProperty("上限")
private BigDecimal gradeUp;
@Schema(description = "下限")
@ExcelProperty("下限")
private BigDecimal gradeDown;
@Schema(description = "区间方式(字典STLM_RNG_WY)")
@ExcelProperty("区间方式(字典STLM_RNG_WY)")
private String rangeWay;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "物料名称", example = "芋艿")
@ExcelProperty("物料名称")
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "物料编码")
@ExcelProperty("物料编码")
private String materialNumber;
@Schema(description = "合同名称")
private String contractName;
@Schema(description = "合同编码")
private String contractPaperNumber;
}

View File

@@ -8,7 +8,7 @@ import java.math.BigDecimal;
@Schema(description = "管理后台 - 品位不计价规则新增/修改 Request VO")
@Data
public class ContractNotSaveReqVO {
public class NotSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18545")
private Long id;

View File

@@ -0,0 +1,18 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 查询不计价规则列表 Request VO")
@Data
public class NotsQueryReqVO {
@Schema(description = "合同名称")
private String contractName;
@Schema(description = "合同编码")
private String contractPaperNumber;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "金属元素")
private String elementName;
}

View File

@@ -7,14 +7,14 @@ import java.math.BigDecimal;
@Schema(description = "管理后台 - 交货计划 Response VO")
@Data
public class ContractViewPlanRespVO {
public class PlanRespVO {
@Schema(description = "主键")
private Long id;
@Schema(description = "交货年份", example = "2025")
@Schema(description = "交货年份")
private Long contractDeliveryYear;
@Schema(description = "交货月份", example = "9")
@Schema(description = "交货月份")
private Long contractPlanDeliveryMonth;
@Schema(description = "计划交货数量")

View File

@@ -7,7 +7,7 @@ import java.math.BigDecimal;
@Schema(description = "管理后台 - 交货计划条款新增/修改 Request VO")
@Data
public class ContractPlanSaveReqVO {
public class PlanSaveReqVO {
@Schema(description = "主键")
private Long id;

View File

@@ -8,14 +8,14 @@ import java.time.LocalDateTime;
@Schema(description = "管理后台 - 市场价配置新 Response VO")
@Data
public class ContractViewPriceRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13654")
public class PriceRespVO {
@Schema(description = "主键")
private Long id;
@Schema(description = "配置主键", example = "1590")
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键", example = "24677")
@Schema(description = "条款主键")
private Long formulaId;
@Schema(description = "市场价")
@@ -42,10 +42,10 @@ public class ContractViewPriceRespVO {
@Schema(description = "价格品种元素的明细分类")
private String priceGrade;
@Schema(description = "品种分类", example = "1")
@Schema(description = "品种分类")
private String gradeType;
@Schema(description = "取价方式;区间价/固定价", example = "2")
@Schema(description = "取价方式;区间价/固定价")
private String averageType;
@Schema(description = "网价小数位")

View File

@@ -7,7 +7,7 @@ import java.time.LocalDateTime;
@Schema(description = "管理后台 - 市场价配置新增/修改 Request VO")
@Data
public class ContractPriceSaveReqVO {
public class PriceSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13654")
private Long id;

View File

@@ -0,0 +1,110 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlPageReqVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlRespVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlSaveReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
import com.zt.plat.module.contractorder.service.purchaseorder.PrchOrdDtlService;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 采购订单明细")
@RestController
@RequestMapping("/base/prch-ord-dtl")
@Validated
public class PrchOrdDtlController implements BusinessControllerMarker {
@Resource
private PrchOrdDtlService prchOrdDtlService;
@PostMapping("/create")
@Operation(summary = "创建采购订单明细")
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:create')")
public CommonResult<PrchOrdDtlRespVO> createPrchOrdDtl(@Valid @RequestBody PrchOrdDtlSaveReqVO createReqVO) {
return success(prchOrdDtlService.createPrchOrdDtl(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新采购订单明细")
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:update')")
public CommonResult<Boolean> updatePrchOrdDtl(@Valid @RequestBody PrchOrdDtlSaveReqVO updateReqVO) {
prchOrdDtlService.updatePrchOrdDtl(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除采购订单明细")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:delete')")
public CommonResult<Boolean> deletePrchOrdDtl(@RequestParam("id") Long id) {
prchOrdDtlService.deletePrchOrdDtl(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除采购订单明细")
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:delete')")
public CommonResult<Boolean> deletePrchOrdDtlList(@RequestBody BatchDeleteReqVO req) {
prchOrdDtlService.deletePrchOrdDtlListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得采购订单明细")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:query')")
public CommonResult<PrchOrdDtlRespVO> getPrchOrdDtl(@RequestParam("id") Long id) {
PrchOrdDtlDO prchOrdDtl = prchOrdDtlService.getPrchOrdDtl(id);
return success(BeanUtils.toBean(prchOrdDtl, PrchOrdDtlRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得采购订单明细分页")
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:query')")
public CommonResult<PageResult<PrchOrdDtlRespVO>> getPrchOrdDtlPage(@Valid PrchOrdDtlPageReqVO pageReqVO) {
PageResult<PrchOrdDtlDO> pageResult = prchOrdDtlService.getPrchOrdDtlPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, PrchOrdDtlRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出采购订单明细 Excel")
@PreAuthorize("@ss.hasPermission('bse:prch-ord-dtl:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportPrchOrdDtlExcel(@Valid PrchOrdDtlPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<PrchOrdDtlDO> list = prchOrdDtlService.getPrchOrdDtlPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "采购订单明细.xls", "数据", PrchOrdDtlRespVO.class,
BeanUtils.toBean(list, PrchOrdDtlRespVO.class));
}
}

View File

@@ -0,0 +1,110 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderRespVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderSaveReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
import com.zt.plat.module.contractorder.service.purchaseorder.PurchaseOrderService;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 采购订单")
@RestController
@RequestMapping("/base/purchase-order")
@Validated
public class PurchaseOrderController implements BusinessControllerMarker {
@Resource
private PurchaseOrderService purchaseOrderService;
@PostMapping("/create")
@Operation(summary = "创建采购订单")
@PreAuthorize("@ss.hasPermission('bse:purchase-order:create')")
public CommonResult<PurchaseOrderRespVO> createPurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO createReqVO) {
return success(purchaseOrderService.createPurchaseOrder(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新采购订单")
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
public CommonResult<Boolean> updatePurchaseOrder(@Valid @RequestBody PurchaseOrderSaveReqVO updateReqVO) {
purchaseOrderService.updatePurchaseOrder(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除采购订单")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('bse:purchase-order:delete')")
public CommonResult<Boolean> deletePurchaseOrder(@RequestParam("id") Long id) {
purchaseOrderService.deletePurchaseOrder(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除采购订单")
@PreAuthorize("@ss.hasPermission('bse:purchase-order:delete')")
public CommonResult<Boolean> deletePurchaseOrderList(@RequestBody BatchDeleteReqVO req) {
purchaseOrderService.deletePurchaseOrderListByIds(req.getIds());
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得采购订单")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bse:purchase-order:query')")
public CommonResult<PurchaseOrderRespVO> getPurchaseOrder(@RequestParam("id") Long id) {
PurchaseOrderDO purchaseOrder = purchaseOrderService.getPurchaseOrder(id);
return success(BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得采购订单分页")
@PreAuthorize("@ss.hasPermission('bse:purchase-order:query')")
public CommonResult<PageResult<PurchaseOrderRespVO>> getPurchaseOrderPage(@Valid PurchaseOrderPageReqVO pageReqVO) {
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.getPurchaseOrderPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出采购订单 Excel")
@PreAuthorize("@ss.hasPermission('bse:purchase-order:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportPurchaseOrderExcel(@Valid PurchaseOrderPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<PurchaseOrderDO> list = purchaseOrderService.getPurchaseOrderPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "采购订单.xls", "数据", PurchaseOrderRespVO.class,
BeanUtils.toBean(list, PurchaseOrderRespVO.class));
}
}

View File

@@ -0,0 +1,159 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 采购订单明细分页 Request VO")
@Data
public class PrchOrdDtlPageReqVO extends PageParam {
@Schema(description = "采购订单主键", example = "29258")
private Long ordId;
@Schema(description = "行项目;推送ERP必须")
private Long lineNum;
@Schema(description = "物料编码;推送ERP")
private String mtrlNum;
@Schema(description = "物料名称", example = "赵六")
private String mtrlName;
@Schema(description = "收货工厂名称", example = "李四")
private String rcvFactName;
@Schema(description = "收货工厂编码;推送ERP必须")
private String rcvFactNum;
@Schema(description = "收货库位名称", example = "王五")
private String rcvWrhName;
@Schema(description = "收货库位编码;推送ERP")
private String rcvWrhNum;
@Schema(description = "暂估数量;推送ERP必须")
private String qty;
@Schema(description = "计量单位;推送ERP必须")
private BigDecimal unt;
@Schema(description = "含税单价;推送ERP必须")
private BigDecimal inTaxUprc;
@Schema(description = "价格单位;推送ERP")
private BigDecimal prcUnt;
@Schema(description = "税码(字典: PRCH_TAX);推送ERP")
private BigDecimal taxNum;
@Schema(description = "是否基于GR的发票校验;推送ERP")
private String isGrInv;
@Schema(description = "是否允许无限制收货;推送ERP")
private String isUnlRcv;
@Schema(description = "批次;推送ERP")
private String bat;
@Schema(description = "项目类别;推送ERP:委托加工L")
private String prjCtgr;
@Schema(description = "科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型固定资产订单A服务订单S-销售服务费K-成本中心F-订单")
private String actsCtgr;
@Schema(description = "物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传")
private String mtrlCpntNum;
@Schema(description = "物料组描述;推送ERP:联动订单类型,服务订单必传")
private String mtrlCpntDsp;
@Schema(description = "短文本")
private String shrtTxt;
@Schema(description = "退货标识X标识退货;推送ERP")
private String isRlbkCgo;
@Schema(description = "是否免费收货标识X;推送ERP")
private String isFreeRcv;
@Schema(description = "外部行项目号;推送ERP")
private Long outLineNum;
@Schema(description = "备注信息-需求单位;推送ERP")
private String rmkUnt;
@Schema(description = "备注信息-物料详细;推送ERP")
private String rmkMtrl;
@Schema(description = "交货起始日期;推送ERP")
private LocalDateTime bgnDt;
@Schema(description = "交货截止日期;推送ERP")
private LocalDateTime ddlDt;
@Schema(description = "已收货量")
private BigDecimal lstQty;
@Schema(description = "已移库量库;存针对该订单产生的移库量")
private BigDecimal trfQty;
@Schema(description = "小协议号")
private String agrNum;
@Schema(description = "移库工厂名称", example = "张三")
private String trfFactName;
@Schema(description = "移库工厂编码")
private String trfFactNum;
@Schema(description = "移库库位名称", example = "李四")
private String trfWrhName;
@Schema(description = "移库库位编码")
private String trfWrhNum;
@Schema(description = "备注")
private String rmk;
@Schema(description = "原料湿重;推送ERP")
private BigDecimal origWet;
@Schema(description = "销售物料号;推送ERP:科目分配类别为S时必填")
private String saleMtrlNum;
@Schema(description = "统计型内部订单;推送ERP")
private String inOrd;
@Schema(description = "采购类别;推送ERP:0-生产性物资类1-项目投资类")
private String prchCtgr;
@Schema(description = "是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用")
private String isEnb;
@Schema(description = "科目分配详情;科目分配类别为K或P时使用(JSON)")
private String actsCtgrDtl;
@Schema(description = "委托加工详情;委托加工订单使用(JSON)")
private String enttDtl;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "金属元素缩写")
private String elemAbbr;
@Schema(description = "金属元素名称", example = "李四")
private String elemName;
@Schema(description = "金属元素编码")
private String elemCdg;
}

View File

@@ -0,0 +1,208 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 采购订单明细 Response VO")
@Data
@ExcelIgnoreUnannotated
public class PrchOrdDtlRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26419")
@ExcelProperty("主键")
private Long id;
@Schema(description = "采购订单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29258")
@ExcelProperty("采购订单主键")
private Long ordId;
@Schema(description = "行项目;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("行项目;推送ERP必须")
private Long lineNum;
@Schema(description = "物料编码;推送ERP")
@ExcelProperty("物料编码;推送ERP")
private String mtrlNum;
@Schema(description = "物料名称", example = "赵六")
@ExcelProperty("物料名称")
private String mtrlName;
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
@ExcelProperty("收货工厂名称")
private String rcvFactName;
@Schema(description = "收货工厂编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("收货工厂编码;推送ERP必须")
private String rcvFactNum;
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@ExcelProperty("收货库位名称")
private String rcvWrhName;
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("收货库位编码;推送ERP")
private String rcvWrhNum;
@Schema(description = "暂估数量;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("暂估数量;推送ERP必须")
private String qty;
@Schema(description = "计量单位;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("计量单位;推送ERP必须")
private BigDecimal unt;
@Schema(description = "含税单价;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("含税单价;推送ERP必须")
private BigDecimal inTaxUprc;
@Schema(description = "价格单位;推送ERP")
@ExcelProperty("价格单位;推送ERP")
private BigDecimal prcUnt;
@Schema(description = "税码(字典: PRCH_TAX);推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("税码(字典: PRCH_TAX);推送ERP")
private BigDecimal taxNum;
@Schema(description = "是否基于GR的发票校验;推送ERP")
@ExcelProperty("是否基于GR的发票校验;推送ERP")
private String isGrInv;
@Schema(description = "是否允许无限制收货;推送ERP")
@ExcelProperty("是否允许无限制收货;推送ERP")
private String isUnlRcv;
@Schema(description = "批次;推送ERP")
@ExcelProperty("批次;推送ERP")
private String bat;
@Schema(description = "项目类别;推送ERP:委托加工L")
@ExcelProperty("项目类别;推送ERP:委托加工L")
private String prjCtgr;
@Schema(description = "科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型固定资产订单A服务订单S-销售服务费K-成本中心F-订单")
@ExcelProperty("科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型固定资产订单A服务订单S-销售服务费K-成本中心F-订单")
private String actsCtgr;
@Schema(description = "物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传")
@ExcelProperty("物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传")
private String mtrlCpntNum;
@Schema(description = "物料组描述;推送ERP:联动订单类型,服务订单必传")
@ExcelProperty("物料组描述;推送ERP:联动订单类型,服务订单必传")
private String mtrlCpntDsp;
@Schema(description = "短文本")
@ExcelProperty("短文本")
private String shrtTxt;
@Schema(description = "退货标识X标识退货;推送ERP")
@ExcelProperty("退货标识X标识退货;推送ERP")
private String isRlbkCgo;
@Schema(description = "是否免费收货标识X;推送ERP")
@ExcelProperty("是否免费收货标识X;推送ERP")
private String isFreeRcv;
@Schema(description = "外部行项目号;推送ERP")
@ExcelProperty("外部行项目号;推送ERP")
private Long outLineNum;
@Schema(description = "备注信息-需求单位;推送ERP")
@ExcelProperty("备注信息-需求单位;推送ERP")
private String rmkUnt;
@Schema(description = "备注信息-物料详细;推送ERP")
@ExcelProperty("备注信息-物料详细;推送ERP")
private String rmkMtrl;
@Schema(description = "交货起始日期;推送ERP")
@ExcelProperty("交货起始日期;推送ERP")
private LocalDateTime bgnDt;
@Schema(description = "交货截止日期;推送ERP")
@ExcelProperty("交货截止日期;推送ERP")
private LocalDateTime ddlDt;
@Schema(description = "已收货量")
@ExcelProperty("已收货量")
private BigDecimal lstQty;
@Schema(description = "已移库量库;存针对该订单产生的移库量")
@ExcelProperty("已移库量库;存针对该订单产生的移库量")
private BigDecimal trfQty;
@Schema(description = "小协议号")
@ExcelProperty("小协议号")
private String agrNum;
@Schema(description = "移库工厂名称", example = "张三")
@ExcelProperty("移库工厂名称")
private String trfFactName;
@Schema(description = "移库工厂编码")
@ExcelProperty("移库工厂编码")
private String trfFactNum;
@Schema(description = "移库库位名称", example = "李四")
@ExcelProperty("移库库位名称")
private String trfWrhName;
@Schema(description = "移库库位编码")
@ExcelProperty("移库库位编码")
private String trfWrhNum;
@Schema(description = "备注")
@ExcelProperty("备注")
private String rmk;
@Schema(description = "原料湿重;推送ERP")
@ExcelProperty("原料湿重;推送ERP")
private BigDecimal origWet;
@Schema(description = "销售物料号;推送ERP:科目分配类别为S时必填")
@ExcelProperty("销售物料号;推送ERP:科目分配类别为S时必填")
private String saleMtrlNum;
@Schema(description = "统计型内部订单;推送ERP")
@ExcelProperty("统计型内部订单;推送ERP")
private String inOrd;
@Schema(description = "采购类别;推送ERP:0-生产性物资类1-项目投资类")
@ExcelProperty("采购类别;推送ERP:0-生产性物资类1-项目投资类")
private String prchCtgr;
@Schema(description = "是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用")
@ExcelProperty("是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用")
private String isEnb;
@Schema(description = "科目分配详情;科目分配类别为K或P时使用(JSON)")
@ExcelProperty("科目分配详情;科目分配类别为K或P时使用(JSON)")
private String actsCtgrDtl;
@Schema(description = "委托加工详情;委托加工订单使用(JSON)")
@ExcelProperty("委托加工详情;委托加工订单使用(JSON)")
private String enttDtl;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "金属元素缩写")
@ExcelProperty("金属元素缩写")
private String elemAbbr;
@Schema(description = "金属元素名称", example = "李四")
@ExcelProperty("金属元素名称")
private String elemName;
@Schema(description = "金属元素编码")
@ExcelProperty("金属元素编码")
private String elemCdg;
}

View File

@@ -0,0 +1,166 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 采购订单明细新增/修改 Request VO")
@Data
public class PrchOrdDtlSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26419")
private Long id;
@Schema(description = "采购订单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29258")
@NotNull(message = "采购订单主键不能为空")
private Long ordId;
@Schema(description = "行项目;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "行项目;推送ERP必须不能为空")
private Long lineNum;
@Schema(description = "物料编码;推送ERP")
private String mtrlNum;
@Schema(description = "物料名称", example = "赵六")
private String mtrlName;
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
@NotEmpty(message = "收货工厂名称不能为空")
private String rcvFactName;
@Schema(description = "收货工厂编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "收货工厂编码;推送ERP必须不能为空")
private String rcvFactNum;
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@NotEmpty(message = "收货库位名称不能为空")
private String rcvWrhName;
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "收货库位编码;推送ERP不能为空")
private String rcvWrhNum;
@Schema(description = "暂估数量;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "暂估数量;推送ERP必须不能为空")
private String qty;
@Schema(description = "计量单位;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "计量单位;推送ERP必须不能为空")
private BigDecimal unt;
@Schema(description = "含税单价;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "含税单价;推送ERP必须不能为空")
private BigDecimal inTaxUprc;
@Schema(description = "价格单位;推送ERP")
private BigDecimal prcUnt;
@Schema(description = "税码(字典: PRCH_TAX);推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "税码(字典: PRCH_TAX);推送ERP不能为空")
private BigDecimal taxNum;
@Schema(description = "是否基于GR的发票校验;推送ERP")
private String isGrInv;
@Schema(description = "是否允许无限制收货;推送ERP")
private String isUnlRcv;
@Schema(description = "批次;推送ERP")
private String bat;
@Schema(description = "项目类别;推送ERP:委托加工L")
private String prjCtgr;
@Schema(description = "科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型固定资产订单A服务订单S-销售服务费K-成本中心F-订单")
private String actsCtgr;
@Schema(description = "物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传")
private String mtrlCpntNum;
@Schema(description = "物料组描述;推送ERP:联动订单类型,服务订单必传")
private String mtrlCpntDsp;
@Schema(description = "短文本")
private String shrtTxt;
@Schema(description = "退货标识X标识退货;推送ERP")
private String isRlbkCgo;
@Schema(description = "是否免费收货标识X;推送ERP")
private String isFreeRcv;
@Schema(description = "外部行项目号;推送ERP")
private Long outLineNum;
@Schema(description = "备注信息-需求单位;推送ERP")
private String rmkUnt;
@Schema(description = "备注信息-物料详细;推送ERP")
private String rmkMtrl;
@Schema(description = "交货起始日期;推送ERP")
private LocalDateTime bgnDt;
@Schema(description = "交货截止日期;推送ERP")
private LocalDateTime ddlDt;
@Schema(description = "已收货量")
private BigDecimal lstQty;
@Schema(description = "已移库量库;存针对该订单产生的移库量")
private BigDecimal trfQty;
@Schema(description = "小协议号")
private String agrNum;
@Schema(description = "移库工厂名称", example = "张三")
private String trfFactName;
@Schema(description = "移库工厂编码")
private String trfFactNum;
@Schema(description = "移库库位名称", example = "李四")
private String trfWrhName;
@Schema(description = "移库库位编码")
private String trfWrhNum;
@Schema(description = "备注")
private String rmk;
@Schema(description = "原料湿重;推送ERP")
private BigDecimal origWet;
@Schema(description = "销售物料号;推送ERP:科目分配类别为S时必填")
private String saleMtrlNum;
@Schema(description = "统计型内部订单;推送ERP")
private String inOrd;
@Schema(description = "采购类别;推送ERP:0-生产性物资类1-项目投资类")
private String prchCtgr;
@Schema(description = "是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用")
private String isEnb;
@Schema(description = "科目分配详情;科目分配类别为K或P时使用(JSON)")
private String actsCtgrDtl;
@Schema(description = "委托加工详情;委托加工订单使用(JSON)")
private String enttDtl;
@Schema(description = "金属元素缩写")
private String elemAbbr;
@Schema(description = "金属元素名称", example = "李四")
private String elemName;
@Schema(description = "金属元素编码")
private String elemCdg;
}

View File

@@ -0,0 +1,127 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 采购订单分页 Request VO")
@Data
public class PurchaseOrderPageReqVO extends PageParam {
@Schema(description = "ERP订单号")
private String orderSAPNumber;
@Schema(description = "订单号")
private String systemOrderNumber;
@Schema(description = "公司编码;推送ERP必须")
private String companyNumber;
@Schema(description = "客商编码;推送ERP必须")
private String supplierNumber;
@Schema(description = "客商名称", example = "芋艿")
private String supplierName;
@Schema(description = "订单类型(字典:PRCH_ORD_TP);推送ERP必须", example = "2")
private String type;
@Schema(description = "凭证日期;推送ERP必须")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] voucherDate;
@Schema(description = "采购组织编码;推送ERP必须")
private String purchaseOrganizationCustomsDeclaration;
@Schema(description = "收货工厂名称", example = "芋艿")
private String receiveFactoryName;
@Schema(description = "收货工厂编码;推送ERP必须")
private String receiveFactoryNumber;
@Schema(description = "收货库位名称", example = "王五")
private String receiveWarehouseName;
@Schema(description = "收货库位编码;推送ERP")
private String receiveWarehouseNumber;
@Schema(description = "采购组编码(字典:PRCH_GRP_TP);推送ERP必须")
private String purchaseGroup;
@Schema(description = "货币码(字典:CUR);推送ERP必须")
private String currencyNumber;
@Schema(description = "汇率;推送ERP")
private BigDecimal exchangeRate;
@Schema(description = "合同纸质合同号;推送ERP必须")
private String paperContractNumber;
@Schema(description = "小协议号;推送ERP")
private String agreementNumber;
@Schema(description = "备注;推送ERP")
private String remark;
@Schema(description = "代理方编码;推送ERP")
private String agentNumber;
@Schema(description = "代理方名称", example = "张三")
private String agentName;
@Schema(description = "订单编码")
private String orderNumber;
@Schema(description = "系统合同编号")
private String contractNumber;
@Schema(description = "物料编码")
private String materialNumber;
@Schema(description = "物料名称", example = "王五")
private String materialName;
@Schema(description = "合同名称", example = "赵六")
private String contractName;
@Schema(description = "小户头号")
private String tenantNumber;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "ERP公司编号")
private String erpPurchaseCompanyNumber;
@Schema(description = "ERP公司名称", example = "王五")
private String erpPurchaseCompanyName;
@Schema(description = "ERP客商公司编码")
private String erpSalesCompanyNumber;
@Schema(description = "ERP客商公司名称", example = "芋艿")
private String erpSalesCompanyName;
@Schema(description = "采购组织名称", example = "赵六")
private String purchaseOrganizationName;
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
private String erpStatus;
@Schema(description = "请求ERP失败原因")
private String cause;
@Schema(description = "订单状态(字典:PRCH_ORD_STS)", example = "2")
private String status;
@Schema(description = "采购组名称", example = "张三")
private String purchaseGroupName;
}

View File

@@ -0,0 +1,168 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 采购订单 Response VO")
@Data
@ExcelIgnoreUnannotated
public class PurchaseOrderRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6074")
@ExcelProperty("主键")
private Long id;
@Schema(description = "ERP订单号")
@ExcelProperty("ERP订单号")
private String orderSAPNumber;
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("订单号")
private String systemOrderNumber;
@Schema(description = "公司编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("公司编码;推送ERP必须")
private String companyNumber;
@Schema(description = "客商编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("客商编码;推送ERP必须")
private String supplierNumber;
@Schema(description = "客商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("客商名称")
private String supplierName;
@Schema(description = "订单类型(字典:PRCH_ORD_TP);推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("订单类型(字典:PRCH_ORD_TP);推送ERP必须")
private String type;
@Schema(description = "凭证日期;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("凭证日期;推送ERP必须")
private LocalDateTime voucherDate;
@Schema(description = "采购组织编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("采购组织编码;推送ERP必须")
private String purchaseOrganizationCustomsDeclaration;
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("收货工厂名称")
private String receiveFactoryName;
@Schema(description = "收货工厂编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("收货工厂编码;推送ERP必须")
private String receiveFactoryNumber;
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@ExcelProperty("收货库位名称")
private String receiveWarehouseName;
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("收货库位编码;推送ERP")
private String receiveWarehouseNumber;
@Schema(description = "采购组编码(字典:PRCH_GRP_TP);推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("采购组编码(字典:PRCH_GRP_TP);推送ERP必须")
private String purchaseGroup;
@Schema(description = "货币码(字典:CUR);推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("货币码(字典:CUR);推送ERP必须")
private String currencyNumber;
@Schema(description = "汇率;推送ERP")
@ExcelProperty("汇率;推送ERP")
private BigDecimal exchangeRate;
@Schema(description = "合同纸质合同号;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("合同纸质合同号;推送ERP必须")
private String paperContractNumber;
@Schema(description = "小协议号;推送ERP")
@ExcelProperty("小协议号;推送ERP")
private String agreementNumber;
@Schema(description = "备注;推送ERP")
@ExcelProperty("备注;推送ERP")
private String remark;
@Schema(description = "代理方编码;推送ERP")
@ExcelProperty("代理方编码;推送ERP")
private String agentNumber;
@Schema(description = "代理方名称", example = "张三")
@ExcelProperty("代理方名称")
private String agentName;
@Schema(description = "订单编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("订单编码")
private String orderNumber;
@Schema(description = "系统合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("系统合同编号")
private String contractNumber;
@Schema(description = "物料编码")
@ExcelProperty("物料编码")
private String materialNumber;
@Schema(description = "物料名称", example = "王五")
@ExcelProperty("物料名称")
private String materialName;
@Schema(description = "合同名称", example = "赵六")
@ExcelProperty("合同名称")
private String contractName;
@Schema(description = "小户头号")
@ExcelProperty("小户头号")
private String tenantNumber;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "ERP公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("ERP公司编号")
private String erpPurchaseCompanyNumber;
@Schema(description = "ERP公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@ExcelProperty("ERP公司名称")
private String erpPurchaseCompanyName;
@Schema(description = "ERP客商公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("ERP客商公司编码")
private String erpSalesCompanyNumber;
@Schema(description = "ERP客商公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("ERP客商公司名称")
private String erpSalesCompanyName;
@Schema(description = "采购组织名称", example = "赵六")
@ExcelProperty("采购组织名称")
private String purchaseOrganizationName;
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
@ExcelProperty("ERP状态(字典: ERP_REQ_STS)")
private String erpStatus;
@Schema(description = "请求ERP失败原因")
@ExcelProperty("请求ERP失败原因")
private String cause;
@Schema(description = "订单状态(字典:PRCH_ORD_STS)", example = "2")
@ExcelProperty("订单状态(字典:PRCH_ORD_STS)")
private String status;
@Schema(description = "采购组名称", example = "张三")
@ExcelProperty("采购组名称")
private String purchaseGroupName;
@Schema(description = "订单明细")
@ExcelProperty("订单明细")
private List<PrchOrdDtlRespVO> prchOrdDtlRespVOS;
}

View File

@@ -0,0 +1,151 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 采购订单新增/修改 Request VO")
@Data
public class PurchaseOrderSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6074")
private Long id;
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "公司名称不能为空")
private String cpName;
@Schema(description = "ERP订单号")
private String orderSAPNumber;
@Schema(description = "订单号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "订单号不能为空")
private String systemOrderNumber;
@Schema(description = "公司编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "公司编码;推送ERP必须不能为空")
private String companyNumber;
@Schema(description = "客商编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "客商编码;推送ERP必须不能为空")
private String supplierNumber;
@Schema(description = "客商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "客商名称不能为空")
private String supplierName;
@Schema(description = "订单类型(字典:PRCH_ORD_TP);推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "订单类型(字典:PRCH_ORD_TP);推送ERP必须不能为空")
private String type;
@Schema(description = "凭证日期;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "凭证日期;推送ERP必须不能为空")
private LocalDateTime voucherDate;
@Schema(description = "采购组织编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "采购组织编码;推送ERP必须不能为空")
private String purchaseOrganizationCustomsDeclaration;
@Schema(description = "收货工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "收货工厂名称不能为空")
private String receiveFactoryName;
@Schema(description = "收货工厂编码;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "收货工厂编码;推送ERP必须不能为空")
private String receiveFactoryNumber;
@Schema(description = "收货库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@NotEmpty(message = "收货库位名称不能为空")
private String receiveWarehouseName;
@Schema(description = "收货库位编码;推送ERP", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "收货库位编码;推送ERP不能为空")
private String receiveWarehouseNumber;
@Schema(description = "采购组编码(字典:PRCH_GRP_TP);推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "采购组编码(字典:PRCH_GRP_TP);推送ERP必须不能为空")
private String purchaseGroup;
@Schema(description = "货币码(字典:CUR);推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "货币码(字典:CUR);推送ERP必须不能为空")
private String currencyNumber;
@Schema(description = "汇率;推送ERP")
private BigDecimal exchangeRate;
@Schema(description = "合同纸质合同号;推送ERP必须", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "合同纸质合同号;推送ERP必须不能为空")
private String paperContractNumber;
@Schema(description = "小协议号;推送ERP")
private String agreementNumber;
@Schema(description = "备注;推送ERP")
private String remark;
@Schema(description = "代理方编码;推送ERP")
private String agentNumber;
@Schema(description = "代理方名称", example = "张三")
private String agentName;
@Schema(description = "订单编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "订单编码不能为空")
private String orderNumber;
@Schema(description = "系统合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "系统合同编号不能为空")
private String contractNumber;
@Schema(description = "物料编码")
private String materialNumber;
@Schema(description = "物料名称", example = "王五")
private String materialName;
@Schema(description = "合同名称", example = "赵六")
private String contractName;
@Schema(description = "小户头号")
private String tenantNumber;
@Schema(description = "ERP公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "ERP公司编号不能为空")
private String erpPurchaseCompanyNumber;
@Schema(description = "ERP公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@NotEmpty(message = "ERP公司名称不能为空")
private String erpPurchaseCompanyName;
@Schema(description = "ERP客商公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "ERP客商公司编码不能为空")
private String erpSalesCompanyNumber;
@Schema(description = "ERP客商公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "ERP客商公司名称不能为空")
private String erpSalesCompanyName;
@Schema(description = "采购组织名称", example = "赵六")
private String purchaseOrganizationName;
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
private String erpStatus;
@Schema(description = "请求ERP失败原因")
private String cause;
@Schema(description = "订单状态(字典:PRCH_ORD_STS)", example = "2")
private String status;
@Schema(description = "采购组名称", example = "张三")
private String purchaseGroupName;
@Schema(description = "订单明细")
@ExcelProperty("订单明细")
private List<PrchOrdDtlSaveReqVO> prchOrdDtlSaveReqVOS;
}

View File

@@ -29,11 +29,6 @@ public class ContractCoefficientDO extends BusinessBaseDO {
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 配置主键
*/
@TableField("PRM_ID")
private Long parameterId;
/**
* 条款主键
*/
@@ -54,11 +49,6 @@ public class ContractCoefficientDO extends BusinessBaseDO {
*/
@TableField("ELEM_NAME")
private String elementName;
/**
* 系数值
*/
@TableField("STLM_COEF")
private String settlementCoefficient;
/**
* 系数上限
*/
@@ -70,23 +60,23 @@ public class ContractCoefficientDO extends BusinessBaseDO {
@TableField("COEF_DOWN")
private BigDecimal coefficientDown;
/**
* 是否包含上限
* 区间方式(字典STLM_RNG_WY)
*/
@TableField("IS_IN_UP")
private String isInUp;
@TableField("RNG_WY")
private String rangeWay;
/**
* 是否包含下限
*/
@TableField("IS_IN_DOWN")
private String isInDown;
/**
* 是否省内
* 是否省内(字典ERP_CTRT_YN)
*/
@TableField("IN_STA")
private String inState;
/**
* 类型
* 类型(字典STLM_COEF)
*/
@TableField("TP")
private String type;
/**
* 系数值
*/
@TableField("STLM_COEF")
private BigDecimal settlementCoefficient;
}

View File

@@ -29,56 +29,16 @@ public class ContractDeductDO extends BusinessBaseDO {
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 配置主键
*/
@TableField("PRM_ID")
private Long parameterId;
/**
* 条款主键
*/
@TableField("FMU_ID")
private Long formulaId;
/**
* 物料编码;推送ERP
* 数据项类型(字典:GRD_CFG_TP)
*/
@TableField("MTRL_NUM")
private String materialNumber;
/**
* 物料名称
*/
@TableField("MTRL_NAME")
private String materialName;
/**
* 上限
*/
@TableField("GRD_UP")
private BigDecimal gradeUp;
/**
* 下限
*/
@TableField("GRD_DOWN")
private BigDecimal gradeDown;
/**
* 是否包含上限
*/
@TableField("IS_IN_UP")
private String isInUp;
/**
* 是否包含下限
*/
@TableField("IS_IN_DOWN")
private String isInDown;
/**
* 方式
*/
@TableField("WY")
private String way;
/**
* 类型
*/
@TableField("TP")
private String type;
@TableField("CFG_TP")
private String configType;
/**
* 是否省内
*/

View File

@@ -29,11 +29,6 @@ public class ContractGradeDO extends BusinessBaseDO {
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 配置主键
*/
@TableField("PRM_ID")
private Long parameterId;
/**
* 条款主键
*/
@@ -70,37 +65,32 @@ public class ContractGradeDO extends BusinessBaseDO {
@TableField("GRD_DOWN")
private BigDecimal gradeDown;
/**
* 是否包含上限;包含则是大于等于,不包含则是大于
* 区间方式(字典:STLM_RNG_WY)
*/
@TableField("IS_IN_UP")
private String isInUp;
@TableField("RNG_WY")
private String rangeWay;
/**
* 是否包含下限;包含则是小于等于,不包含则是小于
*/
@TableField("IS_IN_DOWN")
private String isInDown;
/**
* 默认计价品位;计价方式为加时,默认为为下限,计价方式为减时,默认为为上限,可手动填写
* 默认计价品位
*/
@TableField("GRD_DFT")
private BigDecimal gradeDefault;
/**
* 系数;计价类型为阶梯价使用,标识没上升多少系数进行加款还是减款
* 系数
*/
@TableField("STLM_COEF")
private BigDecimal settlementCoefficient;
/**
* 不足系数值按比例计算
* 是否比例计算(字典:ERP_CTRT_YN)
*/
@TableField("USE_COEF")
private String useCoefficient;
/**
* 计价类型
* 计价类型(字典:STLM_GRD_TP)
*/
@TableField("PRC_TP")
private String priceType;
/**
* 是否省内
* 是否省内(字典:ERP_CTRT_YN)
*/
@TableField("IN_STA")
private String inState;
@@ -109,4 +99,9 @@ public class ContractGradeDO extends BusinessBaseDO {
*/
@TableField("UPRC")
private BigDecimal unitPrice;
/**
* 数据项类型(字典:GRD_CFG_TP)
*/
@TableField("CFG_TP")
private String configType;
}

View File

@@ -40,7 +40,7 @@ public class ContractMainDO extends BusinessBaseDO {
@TableField("SYS_CTRT_NUM")
private String systemContractNumber;
/**
* 状态
* 状态(字典: BSE_CTRT_STS)
*/
@TableField("STS")
private String status;
@@ -60,7 +60,7 @@ public class ContractMainDO extends BusinessBaseDO {
@TableField("CTRT_VRTL")
private String contractVirtual;
/**
* 是否先款后货
* 交易方式(字典: HS_PYBL_TP)
*/
@TableField("HS_PYBL")
private String hasPayable;
@@ -270,7 +270,7 @@ public class ContractMainDO extends BusinessBaseDO {
@TableField("STP")
private Integer step;
/**
* ERP请求状态
* ERP请求状态(字典: ERP_REQ_STS)
*/
@TableField("ERP_STS")
private String erpStatus;
@@ -364,4 +364,29 @@ public class ContractMainDO extends BusinessBaseDO {
*/
@TableField("SALE_CTCT_ADR")
private String salesContactAddress;
/**
* ERP甲方公司编号
*/
@TableField("ERP_PRCH_CPN_NUM")
private String erpPurchaseCompanyNumber;
/**
* ERP甲方公司名称
*/
@TableField("ERP_PRCH_CPN_NAME")
private String erpPurchaseCompanyName;
/**
* ERP乙方公司编码
*/
@TableField("ERP_SALE_CPN_NUM")
private String erpSalesCompanyNumber;
/**
* ERP乙方公司名称
*/
@TableField("ERP_SALE_CPN_NAME")
private String erpSalesCompanyName;
/**
* 是否内部企业(字典ERP_CTRT_YN)
*/
@TableField("IS_INTL")
private String isInternal;
}

View File

@@ -0,0 +1,274 @@
package com.zt.plat.module.contractorder.dal.dataobject.purchaseorder;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* 采购订单明细 DO
*
* @author 后台管理-1
*/
@TableName("bse_prch_ord_dtl")
@KeySequence("bse_prch_ord_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class PrchOrdDtlDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 采购订单主键
*/
@TableField("ORD_ID")
private Long ordId;
/**
* 行项目;推送ERP必须
*/
@TableField("LINE_NUM")
private Long lineNum;
/**
* 物料编码;推送ERP
*/
@TableField("MTRL_NUM")
private String mtrlNum;
/**
* 物料名称
*/
@TableField("MTRL_NAME")
private String mtrlName;
/**
* 收货工厂名称
*/
@TableField("RCV_FACT_NAME")
private String rcvFactName;
/**
* 收货工厂编码;推送ERP必须
*/
@TableField("RCV_FACT_NUM")
private String rcvFactNum;
/**
* 收货库位名称
*/
@TableField("RCV_WRH_NAME")
private String rcvWrhName;
/**
* 收货库位编码;推送ERP
*/
@TableField("RCV_WRH_NUM")
private String rcvWrhNum;
/**
* 暂估数量;推送ERP必须
*/
@TableField("QTY")
private String qty;
/**
* 计量单位;推送ERP必须
*/
@TableField("UNT")
private BigDecimal unt;
/**
* 含税单价;推送ERP必须
*/
@TableField("IN_TAX_UPRC")
private BigDecimal inTaxUprc;
/**
* 价格单位;推送ERP
*/
@TableField("PRC_UNT")
private BigDecimal prcUnt;
/**
* 税码(字典: PRCH_TAX);推送ERP
*/
@TableField("TAX_NUM")
private BigDecimal taxNum;
/**
* 是否基于GR的发票校验;推送ERP
*/
@TableField("IS_GR_INV")
private String isGrInv;
/**
* 是否允许无限制收货;推送ERP
*/
@TableField("IS_UNL_RCV")
private String isUnlRcv;
/**
* 批次;推送ERP
*/
@TableField("BAT")
private String bat;
/**
* 项目类别;推送ERP:委托加工L
*/
@TableField("PRJ_CTGR")
private String prjCtgr;
/**
* 科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型固定资产订单A服务订单S-销售服务费K-成本中心F-订单
*/
@TableField("ACTS_CTGR")
private String actsCtgr;
/**
* 物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传
*/
@TableField("MTRL_CPNT_NUM")
private String mtrlCpntNum;
/**
* 物料组描述;推送ERP:联动订单类型,服务订单必传
*/
@TableField("MTRL_CPNT_DSP")
private String mtrlCpntDsp;
/**
* 短文本
*/
@TableField("SHRT_TXT")
private String shrtTxt;
/**
* 退货标识X标识退货;推送ERP
*/
@TableField("IS_RLBK_CGO")
private String isRlbkCgo;
/**
* 是否免费收货标识X;推送ERP
*/
@TableField("IS_FREE_RCV")
private String isFreeRcv;
/**
* 外部行项目号;推送ERP
*/
@TableField("OUT_LINE_NUM")
private Long outLineNum;
/**
* 备注信息-需求单位;推送ERP
*/
@TableField("RMK_UNT")
private String rmkUnt;
/**
* 备注信息-物料详细;推送ERP
*/
@TableField("RMK_MTRL")
private String rmkMtrl;
/**
* 交货起始日期;推送ERP
*/
@TableField("BGN_DT")
private LocalDateTime bgnDt;
/**
* 交货截止日期;推送ERP
*/
@TableField("DDL_DT")
private LocalDateTime ddlDt;
/**
* 已收货量
*/
@TableField("LST_QTY")
private BigDecimal lstQty;
/**
* 已移库量库;存针对该订单产生的移库量
*/
@TableField("TRF_QTY")
private BigDecimal trfQty;
/**
* 小协议号
*/
@TableField("AGR_NUM")
private String agrNum;
/**
* 移库工厂名称
*/
@TableField("TRF_FACT_NAME")
private String trfFactName;
/**
* 移库工厂编码
*/
@TableField("TRF_FACT_NUM")
private String trfFactNum;
/**
* 移库库位名称
*/
@TableField("TRF_WRH_NAME")
private String trfWrhName;
/**
* 移库库位编码
*/
@TableField("TRF_WRH_NUM")
private String trfWrhNum;
/**
* 备注
*/
@TableField("RMK")
private String rmk;
/**
* 原料湿重;推送ERP
*/
@TableField("ORIG_WET")
private BigDecimal origWet;
/**
* 销售物料号;推送ERP:科目分配类别为S时必填
*/
@TableField("SALE_MTRL_NUM")
private String saleMtrlNum;
/**
* 统计型内部订单;推送ERP
*/
@TableField("IN_ORD")
private String inOrd;
/**
* 采购类别;推送ERP:0-生产性物资类1-项目投资类
*/
@TableField("PRCH_CTGR")
private String prchCtgr;
/**
* 是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用
*/
@TableField("IS_ENB")
private String isEnb;
/**
* 科目分配详情;科目分配类别为K或P时使用(JSON)
*/
@TableField("ACTS_CTGR_DTL")
private String actsCtgrDtl;
/**
* 委托加工详情;委托加工订单使用(JSON)
*/
@TableField("ENTT_DTL")
private String enttDtl;
/**
* 金属元素缩写
*/
@TableField("ELEM_ABBR")
private String elemAbbr;
/**
* 金属元素名称
*/
@TableField("ELEM_NAME")
private String elemName;
/**
* 金属元素编码
*/
@TableField("ELEM_CDG")
private String elemCdg;
}

View File

@@ -0,0 +1,217 @@
package com.zt.plat.module.contractorder.dal.dataobject.purchaseorder;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
/**
* 采购订单 DO
*
* @author 后台管理-1
*/
@TableName("bse_prch_ord")
@KeySequence("bse_prch_ord_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class PurchaseOrderDO extends BusinessBaseDO {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* ERP订单号
*/
@TableField("ORD_SAP_NUM")
private String orderSAPNumber;
/**
* 订单号
*/
@TableField("SYS_ORD_NUM")
private String systemOrderNumber;
/**
* 公司名称
*/
@TableField("CPN_NAME")
private String cpName;
/**
* 公司编码;推送ERP必须
*/
@TableField("CPN_NUM")
private String companyNumber;
/**
* 客商编码;推送ERP必须
*/
@TableField("SPLR_NUM")
private String supplierNumber;
/**
* 客商名称
*/
@TableField("SPLR_NAME")
private String supplierName;
/**
* 订单类型(字典:PRCH_ORD_TP);推送ERP必须
*/
@TableField("TP")
private String type;
/**
* 凭证日期;推送ERP必须
*/
@TableField("VCHR_DT")
private LocalDateTime voucherDate;
/**
* 采购组织编码;推送ERP必须
*/
@TableField("PRCH_ORGZ_CD")
private String purchaseOrganizationCustomsDeclaration;
/**
* 收货工厂名称
*/
@TableField("RCV_FACT_NAME")
private String receiveFactoryName;
/**
* 收货工厂编码;推送ERP必须
*/
@TableField("RCV_FACT_NUM")
private String receiveFactoryNumber;
/**
* 收货库位名称
*/
@TableField("RCV_WRH_NAME")
private String receiveWarehouseName;
/**
* 收货库位编码;推送ERP
*/
@TableField("RCV_WRH_NUM")
private String receiveWarehouseNumber;
/**
* 采购组编码(字典:PRCH_GRP_TP);推送ERP必须
*/
@TableField("PRCH_GRP")
private String purchaseGroup;
/**
* 货币码(字典:CUR);推送ERP必须
*/
@TableField("CUR_NUM")
private String currencyNumber;
/**
* 汇率;推送ERP
*/
@TableField("EXCH_RTE")
private BigDecimal exchangeRate;
/**
* 合同纸质合同号;推送ERP必须
*/
@TableField("PPR_CTRT_NUM")
private String paperContractNumber;
/**
* 小协议号;推送ERP
*/
@TableField("AGR_NUM")
private String agreementNumber;
/**
* 备注;推送ERP
*/
@TableField("RMK")
private String remark;
/**
* 代理方编码;推送ERP
*/
@TableField("AGT_NUM")
private String agentNumber;
/**
* 代理方名称
*/
@TableField("AGT_NAME")
private String agentName;
/**
* 订单编码
*/
@TableField("ORD_NUM")
private String orderNumber;
/**
* 系统合同编号
*/
@TableField("CTRT_NUM")
private String contractNumber;
/**
* 物料编码
*/
@TableField("MTRL_NUM")
private String materialNumber;
/**
* 物料名称
*/
@TableField("MTRL_NAME")
private String materialName;
/**
* 合同名称
*/
@TableField("CTRT_NAME")
private String contractName;
/**
* 小户头号
*/
@TableField("TNT_NUM")
private String tenantNumber;
/**
* ERP公司编号
*/
@TableField("ERP_PRCH_CPN_NUM")
private String erpPurchaseCompanyNumber;
/**
* ERP公司名称
*/
@TableField("ERP_PRCH_CPN_NAME")
private String erpPurchaseCompanyName;
/**
* ERP客商公司编码
*/
@TableField("ERP_SALE_CPN_NUM")
private String erpSalesCompanyNumber;
/**
* ERP客商公司名称
*/
@TableField("ERP_SALE_CPN_NAME")
private String erpSalesCompanyName;
/**
* 采购组织名称
*/
@TableField("PRCH_ORGZ_NAME")
private String purchaseOrganizationName;
/**
* ERP状态(字典: ERP_REQ_STS)
*/
@TableField("ERP_STS")
private String erpStatus;
/**
* 请求ERP失败原因
*/
@TableField("CAUS")
private String cause;
/**
* 订单状态(字典:PRCH_ORD_STS)
*/
@TableField("STS")
private String status;
/**
* 采购组名称
*/
@TableField("PRCH_GRP_NAME")
private String purchaseGroupName;
}

View File

@@ -1,8 +1,12 @@
package com.zt.plat.module.contractorder.dal.mysql.contract;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.DemoteRespVO;
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractDemoteDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 参数降级规则 Mapper
@@ -12,4 +16,26 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ContractDemoteMapper extends BaseMapperX<ContractDemoteDO> {
@Select({
"<script>",
"select *",
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
"from bse_ctrt_dmot",
"where 1 = 1",
"<if test= \"contractIds != null and contractIds.size() > 0\">",
"and ctrt_id in",
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
"#{contractId}",
"</foreach>",
"</if>",
"<if test= \"materialName != null and materialName != ''\">",
"and mtrl_name like concat('%',#{materialName},'%')",
"</if>",
"<if test= \"elementName != null and elementName != ''\">",
"and mtrl_num like concat('%',#{elementName},'%')",
"</if>",
"</script>"
})
List<DemoteRespVO> selectDemotes(List<Long> contractIds, String materialName, String elementName);
}

View File

@@ -1,8 +1,12 @@
package com.zt.plat.module.contractorder.dal.mysql.contract;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.FormulaRespVO;
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractFormulaDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 价款结算条款 Mapper
@@ -12,4 +16,26 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ContractFormulaMapper extends BaseMapperX<ContractFormulaDO> {
@Select({
"<script>",
"select *",
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
"from bse_ctrt_fmu",
"where 1 = 1",
"<if test= \"contractIds != null and contractIds.size() > 0\">",
"and ctrt_id in",
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
"#{contractId}",
"</foreach>",
"</if>",
"<if test= \"materialName != null and materialName != ''\">",
"and mtrl_name like concat('%',#{materialName},'%')",
"</if>",
"<if test= \"elementName != null and elementName != ''\">",
"and mtrl_num like concat('%',#{elementName},'%')",
"</if>",
"</script>"
})
List<FormulaRespVO> selectFormulas(List<Long> contractIds, String materialName, String elementName);
}

View File

@@ -1,8 +1,12 @@
package com.zt.plat.module.contractorder.dal.mysql.contract;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.NotRespVO;
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractNotDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 品位不计价配置 Mapper
@@ -11,4 +15,27 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ContractNotMapper extends BaseMapperX<ContractNotDO> {
@Select({
"<script>",
"select *",
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
"from bse_ctrt_nt",
"where 1 = 1",
"<if test= \"contractIds != null and contractIds.size() > 0\">",
"and ctrt_id in",
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
"#{contractId}",
"</foreach>",
"</if>",
"<if test= \"materialName != null and materialName != ''\">",
"and mtrl_name like concat('%',#{materialName},'%')",
"</if>",
"<if test= \"elementName != null and elementName != ''\">",
"and elem_name like concat('%',#{elementName},'%')",
"</if>",
"</script>"
})
List<NotRespVO> selectNots(List<Long> contractIds, String materialName, String elementName);
}

View File

@@ -0,0 +1,74 @@
package com.zt.plat.module.contractorder.dal.mysql.purchaseorder;
import java.util.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlPageReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 采购订单明细 Mapper
*
* @author 后台管理-1
*/
@Mapper
public interface PrchOrdDtlMapper extends BaseMapperX<PrchOrdDtlDO> {
default PageResult<PrchOrdDtlDO> selectPage(PrchOrdDtlPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<PrchOrdDtlDO>()
.eqIfPresent(PrchOrdDtlDO::getOrdId, reqVO.getOrdId())
.eqIfPresent(PrchOrdDtlDO::getLineNum, reqVO.getLineNum())
.eqIfPresent(PrchOrdDtlDO::getMtrlNum, reqVO.getMtrlNum())
.likeIfPresent(PrchOrdDtlDO::getMtrlName, reqVO.getMtrlName())
.likeIfPresent(PrchOrdDtlDO::getRcvFactName, reqVO.getRcvFactName())
.eqIfPresent(PrchOrdDtlDO::getRcvFactNum, reqVO.getRcvFactNum())
.likeIfPresent(PrchOrdDtlDO::getRcvWrhName, reqVO.getRcvWrhName())
.eqIfPresent(PrchOrdDtlDO::getRcvWrhNum, reqVO.getRcvWrhNum())
.eqIfPresent(PrchOrdDtlDO::getQty, reqVO.getQty())
.eqIfPresent(PrchOrdDtlDO::getUnt, reqVO.getUnt())
.eqIfPresent(PrchOrdDtlDO::getInTaxUprc, reqVO.getInTaxUprc())
.eqIfPresent(PrchOrdDtlDO::getPrcUnt, reqVO.getPrcUnt())
.eqIfPresent(PrchOrdDtlDO::getTaxNum, reqVO.getTaxNum())
.eqIfPresent(PrchOrdDtlDO::getIsGrInv, reqVO.getIsGrInv())
.eqIfPresent(PrchOrdDtlDO::getIsUnlRcv, reqVO.getIsUnlRcv())
.eqIfPresent(PrchOrdDtlDO::getBat, reqVO.getBat())
.eqIfPresent(PrchOrdDtlDO::getPrjCtgr, reqVO.getPrjCtgr())
.eqIfPresent(PrchOrdDtlDO::getActsCtgr, reqVO.getActsCtgr())
.eqIfPresent(PrchOrdDtlDO::getMtrlCpntNum, reqVO.getMtrlCpntNum())
.eqIfPresent(PrchOrdDtlDO::getMtrlCpntDsp, reqVO.getMtrlCpntDsp())
.eqIfPresent(PrchOrdDtlDO::getShrtTxt, reqVO.getShrtTxt())
.eqIfPresent(PrchOrdDtlDO::getIsRlbkCgo, reqVO.getIsRlbkCgo())
.eqIfPresent(PrchOrdDtlDO::getIsFreeRcv, reqVO.getIsFreeRcv())
.eqIfPresent(PrchOrdDtlDO::getOutLineNum, reqVO.getOutLineNum())
.eqIfPresent(PrchOrdDtlDO::getRmkUnt, reqVO.getRmkUnt())
.eqIfPresent(PrchOrdDtlDO::getRmkMtrl, reqVO.getRmkMtrl())
.eqIfPresent(PrchOrdDtlDO::getBgnDt, reqVO.getBgnDt())
.eqIfPresent(PrchOrdDtlDO::getDdlDt, reqVO.getDdlDt())
.eqIfPresent(PrchOrdDtlDO::getLstQty, reqVO.getLstQty())
.eqIfPresent(PrchOrdDtlDO::getTrfQty, reqVO.getTrfQty())
.eqIfPresent(PrchOrdDtlDO::getAgrNum, reqVO.getAgrNum())
.likeIfPresent(PrchOrdDtlDO::getTrfFactName, reqVO.getTrfFactName())
.eqIfPresent(PrchOrdDtlDO::getTrfFactNum, reqVO.getTrfFactNum())
.likeIfPresent(PrchOrdDtlDO::getTrfWrhName, reqVO.getTrfWrhName())
.eqIfPresent(PrchOrdDtlDO::getTrfWrhNum, reqVO.getTrfWrhNum())
.eqIfPresent(PrchOrdDtlDO::getRmk, reqVO.getRmk())
.eqIfPresent(PrchOrdDtlDO::getOrigWet, reqVO.getOrigWet())
.eqIfPresent(PrchOrdDtlDO::getSaleMtrlNum, reqVO.getSaleMtrlNum())
.eqIfPresent(PrchOrdDtlDO::getInOrd, reqVO.getInOrd())
.eqIfPresent(PrchOrdDtlDO::getPrchCtgr, reqVO.getPrchCtgr())
.eqIfPresent(PrchOrdDtlDO::getIsEnb, reqVO.getIsEnb())
.eqIfPresent(PrchOrdDtlDO::getActsCtgrDtl, reqVO.getActsCtgrDtl())
.eqIfPresent(PrchOrdDtlDO::getEnttDtl, reqVO.getEnttDtl())
.betweenIfPresent(PrchOrdDtlDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(PrchOrdDtlDO::getElemAbbr, reqVO.getElemAbbr())
.likeIfPresent(PrchOrdDtlDO::getElemName, reqVO.getElemName())
.eqIfPresent(PrchOrdDtlDO::getElemCdg, reqVO.getElemCdg())
.orderByDesc(PrchOrdDtlDO::getId));
}
}

View File

@@ -0,0 +1,63 @@
package com.zt.plat.module.contractorder.dal.mysql.purchaseorder;
import java.util.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 采购订单 Mapper
*
* @author 后台管理-1
*/
@Mapper
public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
default PageResult<PurchaseOrderDO> selectPage(PurchaseOrderPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<PurchaseOrderDO>()
.eqIfPresent(PurchaseOrderDO::getOrderSAPNumber, reqVO.getOrderSAPNumber())
.eqIfPresent(PurchaseOrderDO::getSystemOrderNumber, reqVO.getSystemOrderNumber())
.eqIfPresent(PurchaseOrderDO::getCompanyNumber, reqVO.getCompanyNumber())
.eqIfPresent(PurchaseOrderDO::getSupplierNumber, reqVO.getSupplierNumber())
.likeIfPresent(PurchaseOrderDO::getSupplierName, reqVO.getSupplierName())
.eqIfPresent(PurchaseOrderDO::getType, reqVO.getType())
.betweenIfPresent(PurchaseOrderDO::getVoucherDate, reqVO.getVoucherDate())
.eqIfPresent(PurchaseOrderDO::getPurchaseOrganizationCustomsDeclaration, reqVO.getPurchaseOrganizationCustomsDeclaration())
.likeIfPresent(PurchaseOrderDO::getReceiveFactoryName, reqVO.getReceiveFactoryName())
.eqIfPresent(PurchaseOrderDO::getReceiveFactoryNumber, reqVO.getReceiveFactoryNumber())
.likeIfPresent(PurchaseOrderDO::getReceiveWarehouseName, reqVO.getReceiveWarehouseName())
.eqIfPresent(PurchaseOrderDO::getReceiveWarehouseNumber, reqVO.getReceiveWarehouseNumber())
.eqIfPresent(PurchaseOrderDO::getPurchaseGroup, reqVO.getPurchaseGroup())
.eqIfPresent(PurchaseOrderDO::getCurrencyNumber, reqVO.getCurrencyNumber())
.eqIfPresent(PurchaseOrderDO::getExchangeRate, reqVO.getExchangeRate())
.eqIfPresent(PurchaseOrderDO::getPaperContractNumber, reqVO.getPaperContractNumber())
.eqIfPresent(PurchaseOrderDO::getAgreementNumber, reqVO.getAgreementNumber())
.eqIfPresent(PurchaseOrderDO::getRemark, reqVO.getRemark())
.eqIfPresent(PurchaseOrderDO::getAgentNumber, reqVO.getAgentNumber())
.likeIfPresent(PurchaseOrderDO::getAgentName, reqVO.getAgentName())
.eqIfPresent(PurchaseOrderDO::getOrderNumber, reqVO.getOrderNumber())
.eqIfPresent(PurchaseOrderDO::getContractNumber, reqVO.getContractNumber())
.eqIfPresent(PurchaseOrderDO::getMaterialNumber, reqVO.getMaterialNumber())
.likeIfPresent(PurchaseOrderDO::getMaterialName, reqVO.getMaterialName())
.likeIfPresent(PurchaseOrderDO::getContractName, reqVO.getContractName())
.eqIfPresent(PurchaseOrderDO::getTenantNumber, reqVO.getTenantNumber())
.betweenIfPresent(PurchaseOrderDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(PurchaseOrderDO::getErpPurchaseCompanyNumber, reqVO.getErpPurchaseCompanyNumber())
.likeIfPresent(PurchaseOrderDO::getErpPurchaseCompanyName, reqVO.getErpPurchaseCompanyName())
.eqIfPresent(PurchaseOrderDO::getErpSalesCompanyNumber, reqVO.getErpSalesCompanyNumber())
.likeIfPresent(PurchaseOrderDO::getErpSalesCompanyName, reqVO.getErpSalesCompanyName())
.likeIfPresent(PurchaseOrderDO::getPurchaseOrganizationName, reqVO.getPurchaseOrganizationName())
.eqIfPresent(PurchaseOrderDO::getErpStatus, reqVO.getErpStatus())
.eqIfPresent(PurchaseOrderDO::getCause, reqVO.getCause())
.eqIfPresent(PurchaseOrderDO::getStatus, reqVO.getStatus())
.likeIfPresent(PurchaseOrderDO::getPurchaseGroupName, reqVO.getPurchaseGroupName())
.orderByDesc(PurchaseOrderDO::getId));
}
}

View File

@@ -1,13 +1,12 @@
package com.zt.plat.module.contractorder.service.contract;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.ContractApprovalReqVO;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.ContractPageReqVO;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.ContractSaveReqVO;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.ContractViewRespVO;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO;
import jakarta.validation.Valid;
import java.util.List;
/**
* 后台合同编制 Service 接口
*
@@ -37,7 +36,7 @@ public interface ContractService {
* @param id 合同ID
* @return 合同信息
*/
ContractViewRespVO get(Long id);
ContractRespVO get(Long id);
/**
* 修改合同
@@ -51,9 +50,39 @@ public interface ContractService {
* 合同提交审批
*
* @param id 合同ID
* @return 审批结果
* @return 提交审批结果
*/
String submitApproval(Long id);
String approval(@Valid ContractApprovalReqVO reqVO);
/**
* 合同审批
*
* @param reqVO 审批信息
* @return 审批结果
*/
String approval(@Valid ApprovalReqVO reqVO);
/**
* 查询不计价规则列表
*
* @param queryReqVO 查询参数
* @return 不计价规则列表
*/
List<NotRespVO> getNots(NotsQueryReqVO queryReqVO);
/**
* 查询参数降级规则列表
*
* @param queryReqVO 查询参数
* @return 参数降级规则列表
*/
List<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO);
/**
* 查询结算公式列表
*
* @param queryReqVO 查询参数
* @return 结算公式列表
*/
List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO);
}

View File

@@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.service.contract;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.framework.tenant.core.context.CompanyContextHolder;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataRespVO;
@@ -19,11 +20,13 @@ import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
import com.zt.plat.module.contractorder.dal.dataobject.contract.*;
import com.zt.plat.module.contractorder.dal.mysql.contract.*;
import com.zt.plat.module.contractorder.enums.ApiConstants;
import com.zt.plat.module.contractorder.enums.DateConstants;
import com.zt.plat.module.contractorder.enums.ProcessConstants;
import com.zt.plat.module.contractorder.enums.TableFieldConstants;
import com.zt.plat.module.contractorder.enums.contract.ContractStatusEnum;
import com.zt.plat.module.contractorder.enums.contract.ErpCtrtYesNoEnum;
import com.zt.plat.module.erp.service.erp.ErpCompanyService;
import com.zt.plat.module.system.api.user.AdminUserApi;
import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO;
import jakarta.annotation.Resource;
@@ -38,6 +41,7 @@ import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.*;
@@ -83,6 +87,8 @@ public class ContractServiceImpl implements ContractService {
private BpmTaskApi bpmTaskApi;
@Resource
private ContractDemoteMapper contractDemoteMapper;
@Resource
private ErpCompanyService erpCompanyService;
@Override
public PageResult<ContractMainDO> getContractPage(ContractPageReqVO pageReqVO) {
@@ -109,6 +115,21 @@ public class ContractServiceImpl implements ContractService {
}
}
// 校验ERP的公司
if (StringUtils.isNotEmpty(reqVO.getPurchaseCompanyNumber())
|| StringUtils.isNotEmpty(reqVO.getSalesCompanyNumber())) {
if (StringUtils.isNotEmpty(reqVO.getPurchaseCompanyNumber())) {
if (erpCompanyService.getErpCompanyByNumber(reqVO.getPurchaseCompanyNumber()) == null) {
throw exception(CONTRACT_ERP_COMPANY_PLEASE_BIND, ApiConstants.PURCHASE);
}
}
if (StringUtils.isNotEmpty(reqVO.getSalesCompanyNumber())) {
if (erpCompanyService.getErpCompanyByNumber(reqVO.getSalesCompanyNumber()) == null) {
throw exception(CONTRACT_ERP_COMPANY_PLEASE_BIND, ApiConstants.SALES);
}
}
}
// 合同主信息
ContractMainDO contractMainDO = BeanUtils.toBean(reqVO, ContractMainDO.class);
// 合同状态保存为草稿
@@ -249,10 +270,10 @@ public class ContractServiceImpl implements ContractService {
}
@Override
public ContractViewRespVO get(Long id) {
public ContractRespVO get(Long id) {
// 返回结果
ContractViewRespVO respVO = new ContractViewRespVO();
ContractRespVO respVO = new ContractRespVO();
// 查询并设置合同主信息
ContractMainDO contractMainDO = contractMainMapper.selectById(id);
@@ -265,14 +286,14 @@ public class ContractServiceImpl implements ContractService {
List<ContractDetailDO> detailDOS = contractDetailMapper
.selectList(TableFieldConstants.BSE_CTRT_DTL_CTRT_MAIN_ID, contractMainDO.getId());
if (detailDOS != null && !detailDOS.isEmpty()) {
respVO.setDetail(BeanUtils.toBean(detailDOS, ContractViewDetailRespVO.class));
respVO.setDetail(BeanUtils.toBean(detailDOS, DetailRespVO.class));
respVO.getDetail().forEach(detail -> {
// 查询并设置交货计划
List<ContractPlanDO> planDOS = contractPlanMapper
.selectList(TableFieldConstants.BSE_CTRT_PLN_CTRT_DTL_ID, detail.getId());
if (planDOS != null && !planDOS.isEmpty()) {
detail.setPlans(BeanUtils.toBean(planDOS, ContractViewPlanRespVO.class));
detail.setPlans(BeanUtils.toBean(planDOS, PlanRespVO.class));
}
});
}
@@ -281,7 +302,7 @@ public class ContractServiceImpl implements ContractService {
List<ContractFormulaDO> formulaDOS = contractFormulaMapper
.selectList(TableFieldConstants.BSE_CTRT_FMU_CTRT_ID, contractMainDO.getId());
if (formulaDOS != null && !formulaDOS.isEmpty()) {
respVO.setFormulas(BeanUtils.toBean(formulaDOS, ContractViewFormulaRespVO.class));
respVO.setFormulas(BeanUtils.toBean(formulaDOS, FormulaRespVO.class));
respVO.getFormulas().forEach(formula -> {
@@ -289,25 +310,25 @@ public class ContractServiceImpl implements ContractService {
List<ContractCoefficientDO> coefficientDOS = contractCoefficientMapper
.selectList(TableFieldConstants.BSE_CTRT_COEF_FMU_ID, formula.getId());
if (coefficientDOS != null && !coefficientDOS.isEmpty()) {
formula.setCoefficients(BeanUtils.toBean(coefficientDOS, ContractViewCoefficientRespVO.class));
formula.setCoefficients(BeanUtils.toBean(coefficientDOS, CoefficientRespVO.class));
}
// 查询并设置品位等级价配置
List<ContractGradeDO> gradeDOS = contractGradeMapper
.selectList(TableFieldConstants.BSE_CTRT_GRD_FMU_ID, formula.getId());
if (gradeDOS != null && !gradeDOS.isEmpty()) {
formula.setGrades(BeanUtils.toBean(gradeDOS, ContractViewGradeRespVO.class));
formula.setGrades(BeanUtils.toBean(gradeDOS, GradeRespVO.class));
}
// 查询并设置调整价配置
List<ContractDeductDO> deductDOS = contractDeductMapper
.selectList(TableFieldConstants.BSE_CTRT_DDCT_FMU_ID, formula.getId());
if (deductDOS != null && !deductDOS.isEmpty()) {
formula.setDeducts(BeanUtils.toBean(deductDOS, ContractViewDeductRespVO.class));
formula.setDeducts(BeanUtils.toBean(deductDOS, DeductRespVO.class));
}
// 查询并设置市场价配置
List<ContractPriceDO> priceDOS = contractPriceMapper
.selectList(TableFieldConstants.BSE_CTRT_PRC_FMU_ID, formula.getId());
if (priceDOS != null && !priceDOS.isEmpty()) {
formula.setPrices(BeanUtils.toBean(priceDOS, ContractViewPriceRespVO.class));
formula.setPrices(BeanUtils.toBean(priceDOS, PriceRespVO.class));
}
});
}
@@ -316,14 +337,14 @@ public class ContractServiceImpl implements ContractService {
List<ContractDemoteDO> demoteDOS = contractDemoteMapper
.selectList(TableFieldConstants.BSE_CTRT_DMOT_CTRT_ID, contractMainDO.getId());
if (demoteDOS != null && !demoteDOS.isEmpty()) {
respVO.setDemotes(BeanUtils.toBean(demoteDOS, ContractViewDemoteRespVO.class));
respVO.setDemotes(BeanUtils.toBean(demoteDOS, DemoteRespVO.class));
}
// 查询并设置品位不计价规则
List<ContractNotDO> notDOS = contractNotMapper
.selectList(TableFieldConstants.BSE_CTRT_NT_CTRT_ID, contractMainDO.getId());
if (notDOS != null && !notDOS.isEmpty()) {
respVO.setNots(BeanUtils.toBean(notDOS, ContractViewNotRespVO.class));
respVO.setNots(BeanUtils.toBean(notDOS, NotRespVO.class));
}
// 查询并设置合同动态表单
@@ -632,7 +653,7 @@ public class ContractServiceImpl implements ContractService {
}
@Override
public String approval(ContractApprovalReqVO reqVO) {
public String approval(ApprovalReqVO reqVO) {
// 合同主键ID
Long id = reqVO.getId();
@@ -663,12 +684,55 @@ public class ContractServiceImpl implements ContractService {
return "";
}
private List<Long> getContractIds(String contractName, String contractPaperNumber) {
List<Long> contractIds = new ArrayList<>();
List<ContractMainDO> contractMainDOS = contractMainMapper.selectList(new LambdaQueryWrapperX<ContractMainDO>()
.likeIfPresent(ContractMainDO::getContractName, contractName)
.likeIfPresent(ContractMainDO::getContractPaperNumber, contractPaperNumber));
if (CollectionUtils.isNotEmpty(contractMainDOS)) {
contractIds = contractMainDOS.stream()
.map(contractMainDO -> contractMainDO.getId())
.collect(Collectors.toList());
}
return contractIds;
}
@Override
public List<NotRespVO> getNots(NotsQueryReqVO queryReqVO) {
// 查合同ID集合
List<Long> contractIds = new ArrayList<>();
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
}
return contractNotMapper.selectNots(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
}
@Override
public List<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO) {
// 查合同ID集合
List<Long> contractIds = new ArrayList<>();
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
}
return contractDemoteMapper.selectDemotes(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
}
@Override
public List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO) {
// 查合同ID集合
List<Long> contractIds = new ArrayList<>();
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
}
return contractFormulaMapper.selectFormulas(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
}
/**
* 校验合同内容
*
* @param contract 合同数据
*/
private void verifyContract(ContractViewRespVO contract) {
private void verifyContract(ContractRespVO contract) {
/* 合同基本信息 */
// 甲方公司编号不能为空

View File

@@ -0,0 +1,78 @@
package com.zt.plat.module.contractorder.service.purchaseorder;
import java.util.*;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlPageReqVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlRespVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlSaveReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
import jakarta.validation.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.PageParam;
/**
* 采购订单明细 Service 接口
*
* @author 后台管理-1
*/
public interface PrchOrdDtlService {
/**
* 创建采购订单明细
*
* @param createReqVO 创建信息
* @return 编号
*/
PrchOrdDtlRespVO createPrchOrdDtl(@Valid PrchOrdDtlSaveReqVO createReqVO);
/**
* 更新采购订单明细
*
* @param updateReqVO 更新信息
*/
void updatePrchOrdDtl(@Valid PrchOrdDtlSaveReqVO updateReqVO);
/**
* 删除采购订单明细
*
* @param id 编号
*/
void deletePrchOrdDtl(Long id);
/**
* 批量删除采购订单明细
*
* @param ids 编号
*/
void deletePrchOrdDtlListByIds(List<Long> ids);
/**
* 获得采购订单明细
*
* @param id 编号
* @return 采购订单明细
*/
PrchOrdDtlDO getPrchOrdDtl(Long id);
/**
* 获得采购订单明细分页
*
* @param pageReqVO 分页查询
* @return 采购订单明细分页
*/
PageResult<PrchOrdDtlDO> getPrchOrdDtlPage(PrchOrdDtlPageReqVO pageReqVO);
/**
* 批量创建采购订单明细
*
* @param createReqVOS 创建信息
* @return List<PrchOrdDtlRespVO>
*/
List<PrchOrdDtlRespVO> batchCreatePrchOrdDtl(@Valid List<PrchOrdDtlSaveReqVO> createReqVOS);
/**
* 批量删除采购订单明细
*
* @param ordIds 编号
*/
void deletePrchOrdDtlListByOrdIds(List<Long> ordIds);
}

View File

@@ -0,0 +1,116 @@
package com.zt.plat.module.contractorder.service.purchaseorder;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlPageReqVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlRespVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlSaveReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PrchOrdDtlDO;
import com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PrchOrdDtlMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
import static com.zt.plat.module.contractorder.enums.purchaseorder.ErrorCodeConstants.PRCH_ORD_DTL_NOT_EXISTS;
/**
* 采购订单明细 Service 实现类
*
* @author 后台管理-1
*/
@Service
@Validated
@Slf4j
public class PrchOrdDtlServiceImpl implements PrchOrdDtlService {
@Resource
private PrchOrdDtlMapper prchOrdDtlMapper;
@Override
public PrchOrdDtlRespVO createPrchOrdDtl(PrchOrdDtlSaveReqVO createReqVO) {
// 插入
PrchOrdDtlDO prchOrdDtl = BeanUtils.toBean(createReqVO, PrchOrdDtlDO.class);
prchOrdDtlMapper.insert(prchOrdDtl);
// 返回
return BeanUtils.toBean(prchOrdDtl, PrchOrdDtlRespVO.class);
}
@Override
public void updatePrchOrdDtl(PrchOrdDtlSaveReqVO updateReqVO) {
// 校验存在
validatePrchOrdDtlExists(updateReqVO.getId());
// 更新
PrchOrdDtlDO updateObj = BeanUtils.toBean(updateReqVO, PrchOrdDtlDO.class);
prchOrdDtlMapper.updateById(updateObj);
}
@Override
public void deletePrchOrdDtl(Long id) {
// 校验存在
validatePrchOrdDtlExists(id);
// 删除
prchOrdDtlMapper.deleteById(id);
}
@Override
public void deletePrchOrdDtlListByIds(List<Long> ids) {
// 校验存在
validatePrchOrdDtlExists(ids);
// 删除
prchOrdDtlMapper.deleteByIds(ids);
}
private void validatePrchOrdDtlExists(List<Long> ids) {
List<PrchOrdDtlDO> list = prchOrdDtlMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(PRCH_ORD_DTL_NOT_EXISTS);
}
}
private void validatePrchOrdDtlExists(Long id) {
if (prchOrdDtlMapper.selectById(id) == null) {
throw exception(PRCH_ORD_DTL_NOT_EXISTS);
}
}
@Override
public PrchOrdDtlDO getPrchOrdDtl(Long id) {
return prchOrdDtlMapper.selectById(id);
}
@Override
public PageResult<PrchOrdDtlDO> getPrchOrdDtlPage(PrchOrdDtlPageReqVO pageReqVO) {
return prchOrdDtlMapper.selectPage(pageReqVO);
}
@Override
public List<PrchOrdDtlRespVO> batchCreatePrchOrdDtl(List<PrchOrdDtlSaveReqVO> createReqVOS) {
List<PrchOrdDtlDO> prchOrdDtlDOS = BeanUtils.toBean(createReqVOS, PrchOrdDtlDO.class);
prchOrdDtlMapper.insertBatch(prchOrdDtlDOS);
log.info("批量创建采购订单明细成功,工插入【{}】条数据", prchOrdDtlDOS.size());
return BeanUtils.toBean(prchOrdDtlDOS, PrchOrdDtlRespVO.class);
}
@Override
public void deletePrchOrdDtlListByOrdIds(List<Long> ordIds) {
//通过订单组件查询订单明细
List<PrchOrdDtlDO> prchOrdDtlDOS = prchOrdDtlMapper.selectList(new LambdaQueryWrapper<>(PrchOrdDtlDO.class).in(PrchOrdDtlDO::getOrdId, ordIds));
//删除订单明细
deletePrchOrdDtlListByIds(convertList(prchOrdDtlDOS, PrchOrdDtlDO::getId));
}
}

View File

@@ -0,0 +1,66 @@
package com.zt.plat.module.contractorder.service.purchaseorder;
import java.util.*;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderRespVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderSaveReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
import jakarta.validation.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.PageParam;
/**
* 采购订单 Service 接口
*
* @author 后台管理-1
*/
public interface PurchaseOrderService {
/**
* 创建采购订单
*
* @param createReqVO 创建信息
* @return 编号
*/
PurchaseOrderRespVO createPurchaseOrder(@Valid PurchaseOrderSaveReqVO createReqVO);
/**
* 更新采购订单
*
* @param updateReqVO 更新信息
*/
void updatePurchaseOrder(@Valid PurchaseOrderSaveReqVO updateReqVO);
/**
* 删除采购订单
*
* @param id 编号
*/
void deletePurchaseOrder(Long id);
/**
* 批量删除采购订单
*
* @param ids 编号
*/
void deletePurchaseOrderListByIds(List<Long> ids);
/**
* 获得采购订单
*
* @param id 编号
* @return 采购订单
*/
PurchaseOrderDO getPurchaseOrder(Long id);
/**
* 获得采购订单分页
*
* @param pageReqVO 分页查询
* @return 采购订单分页
*/
PageResult<PurchaseOrderDO> getPurchaseOrderPage(PurchaseOrderPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,108 @@
package com.zt.plat.module.contractorder.service.purchaseorder;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PrchOrdDtlRespVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderPageReqVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderRespVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderSaveReqVO;
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
import com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PurchaseOrderMapper;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
import static com.zt.plat.module.contractorder.enums.purchaseorder.ErrorCodeConstants.PURCHASE_ORDER_NOT_EXISTS;
/**
* 采购订单 Service 实现类
*
* @author 后台管理-1
*/
@Service
@Validated
public class PurchaseOrderServiceImpl implements PurchaseOrderService {
@Resource
private PurchaseOrderMapper purchaseOrderMapper;
@Resource
private PrchOrdDtlService prchOrdDtlService;
@Override
public PurchaseOrderRespVO createPurchaseOrder(PurchaseOrderSaveReqVO createReqVO) {
// 插入
PurchaseOrderDO purchaseOrder = BeanUtils.toBean(createReqVO, PurchaseOrderDO.class);
purchaseOrderMapper.insert(purchaseOrder);
// 返回
//批量插入订单明细
createReqVO.getPrchOrdDtlSaveReqVOS().forEach(prchOrdDtlSaveReqVO->prchOrdDtlSaveReqVO.setOrdId(purchaseOrder.getId()));
List<PrchOrdDtlRespVO> prchOrdDtlRespVOS = prchOrdDtlService.batchCreatePrchOrdDtl(createReqVO.getPrchOrdDtlSaveReqVOS());
PurchaseOrderRespVO purchaseOrderRespVO = BeanUtils.toBean(purchaseOrder, PurchaseOrderRespVO.class);
purchaseOrderRespVO.setPrchOrdDtlRespVOS(prchOrdDtlRespVOS);
return purchaseOrderRespVO;
}
@Override
public void updatePurchaseOrder(PurchaseOrderSaveReqVO updateReqVO) {
// 校验存在
validatePurchaseOrderExists(updateReqVO.getId());
// 更新
PurchaseOrderDO updateObj = BeanUtils.toBean(updateReqVO, PurchaseOrderDO.class);
purchaseOrderMapper.updateById(updateObj);
}
@Override
public void deletePurchaseOrder(Long id) {
// 校验存在
validatePurchaseOrderExists(id);
// 删除
purchaseOrderMapper.deleteById(id);
}
@Override
public void deletePurchaseOrderListByIds(List<Long> ids) {
// 校验存在
validatePurchaseOrderExists(ids);
// 删除
purchaseOrderMapper.deleteByIds(ids);
//删除根据订单号订单明细
prchOrdDtlService.deletePrchOrdDtlListByOrdIds(ids);
}
private void validatePurchaseOrderExists(List<Long> ids) {
List<PurchaseOrderDO> list = purchaseOrderMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(PURCHASE_ORDER_NOT_EXISTS);
}
}
private void validatePurchaseOrderExists(Long id) {
if (purchaseOrderMapper.selectById(id) == null) {
throw exception(PURCHASE_ORDER_NOT_EXISTS);
}
}
@Override
public PurchaseOrderDO getPurchaseOrder(Long id) {
return purchaseOrderMapper.selectById(id);
}
@Override
public PageResult<PurchaseOrderDO> getPurchaseOrderPage(PurchaseOrderPageReqVO pageReqVO) {
return purchaseOrderMapper.selectPage(pageReqVO);
}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PrchOrdDtlMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zt.plat.module.contractorder.dal.mysql.purchaseorder.PurchaseOrderMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>