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>

View File

@@ -20,4 +20,5 @@ public class ApiConstants {
public static final String VERSION = "1.0.0";
public static final String TABLE_FIELD_SPLY_ERP_CPN_NUM = "NUM";
}

View File

@@ -13,6 +13,9 @@ public interface ErrorCodeConstants {
ErrorCode ERP_CUSTOMER_NOT_EXISTS = new ErrorCode(1_001_000_001, "ERP客商主数据不存在");
ErrorCode ERP_MATERIAL_NOT_EXISTS = new ErrorCode(1_002_000_001, "ERP物料数据不存在");
ErrorCode ERP_MATERIAL_NOT_ALLOW_UPDATE = new ErrorCode(1_002_000_001, "只允许编辑状态为“供应链”的数据");
ErrorCode ERP_MATERIAL_NOT_ALLOW_DELETE = new ErrorCode(1_002_000_001, "不允许删除状态为“ERP”的数据");
ErrorCode ERP_MATERIAL_OTHER_NOT_ALLOW_DELETE = new ErrorCode(1_002_000_001, "只允许删除不存在配置关系的数据");
ErrorCode ERP_COMPANY_NOT_EXISTS = new ErrorCode(1_003_000_001, "ERP公司数据不存在");
ErrorCode ERP_COMPANY_REDIS_NOT_EXISTS = new ErrorCode(1_003_000_002, "ERP公司代码缓存数据丢失,请重新同步公司代码");
@@ -27,6 +30,7 @@ public interface ErrorCodeConstants {
ErrorCode ERP_FACTORY_NOT_EXISTS = new ErrorCode(1_008_000_001, "ERP工厂数据不存在");
ErrorCode ERP_FACTORY_REDIS_NOT_EXISTS = new ErrorCode(1_008_000_002, "ERP工厂redis数据不存在");
ErrorCode ERP_FACTORY_NOT_ALLOW_UPDATE = new ErrorCode(1_008_000_003, "类型为ERP的数据或启用的数据不允许编辑");
ErrorCode ERP_COSTCENTER_NOT_EXISTS = new ErrorCode(1_009_000_001, "ERP成本中心数据不存在");
@@ -39,6 +43,7 @@ public interface ErrorCodeConstants {
ErrorCode ERP_SALES_ORGANIZATION_NOT_EXISTS = new ErrorCode(1_013_000_001, "ERP销售组织数据不存在");
ErrorCode ERP_WAREHOUSE_NOT_EXISTS = new ErrorCode(1_014_000_001, "ERP库位数据不存在");
ErrorCode ERP_WAREHOUSE_NOT_ALLOW_UPDATE = new ErrorCode(1_014_000_002, "只允许状态为“供应链”,且“禁用”的数据编辑");
ErrorCode ERP_ASSET_NOT_EXISTS = new ErrorCode(1_015_000_001, "ERP资产卡片数据不存在");

View File

@@ -101,6 +101,14 @@ public class ErpFactoryController {
BeanUtils.toBean(list, ErpFactoryRespVO.class));
}
@PutMapping("/enable-list")
@Operation(summary = "批量更新")
@PreAuthorize("@ss.hasPermission('base:erp-factory:update')")
public CommonResult<Boolean> enableFactoryList(@RequestBody List<ErpFactoryRespVO> saveReqVOS) {
erpFactoryService.enableFactoryList(saveReqVOS);
return success(true);
}
@PostMapping("/getErpFactoryTask")
@Operation(summary = "定时获得erp工厂数据")
@PreAuthorize("@ss.hasPermission('base:erp-factory:create')")

View File

@@ -101,6 +101,14 @@ public class ErpWarehouseController {
BeanUtils.toBean(list, ErpWarehouseRespVO.class));
}
@PutMapping("/enable-list")
@Operation(summary = "批量更新")
@PreAuthorize("@ss.hasPermission('base:warehouse:update')")
public CommonResult<Boolean> enableWarehouseList(@RequestBody List<ErpWarehouseSaveReqVO> saveReqVOS) {
erpWarehouseService.enableWarehouseList(saveReqVOS);
return success(true);
}
@PostMapping("/getErpWarehouseTask")
@Operation(summary = "定时获得erp更新库位")
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:create')")

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.erp.controller.admin.erp.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -14,4 +15,13 @@ public class ErpFactoryPageReqVO extends PageParam {
@Schema(description = "工厂编码")
private String number;
@Schema(description = "公司编号")
private String companyNumber;
@Schema(description = "公司名称")
private String companyName;
@Schema(description = "类型")
private String type;
}

View File

@@ -22,4 +22,18 @@ public class ErpFactoryRespVO {
@ExcelProperty("工厂编码")
private String number;
@Schema(description = "公司编号")
private String companyNumber;
@Schema(description = "类型")
private String type;
@Schema(description = "绑定工厂名")
private String relName;
@Schema(description = "绑定工厂编码")
private String relnumber;
@Schema(description = "是否启用")
private String isEnable;
}

View File

@@ -19,4 +19,21 @@ public class ErpFactorySaveReqVO {
@NotEmpty(message = "工厂编码不能为空")
private String number;
@Schema(description = "公司编号")
private String companyNumber;
@Schema(description = "公司编号")
private String companyName;
@Schema(description = "类型")
private String type;
@Schema(description = "绑定工厂名")
private String relName;
@Schema(description = "绑定工厂编码")
private String relnumber;
@Schema(description = "是否启用")
private String isEnable;
}

View File

@@ -55,4 +55,7 @@ public class ErpMaterialPageReqVO extends PageParam {
@Schema(description = "物料长描述")
private String materialLengthDescription;
@Schema(description = "类型")
private String type;
}

View File

@@ -68,4 +68,8 @@ public class ErpMaterialRespVO {
@ExcelProperty("物料长描述")
private String materialLengthDescription;
@Schema(description = "类型")
@ExcelProperty("类型")
private String type;
}

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.erp.controller.admin.erp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
@@ -65,4 +66,7 @@ public class ErpMaterialSaveReqVO {
@NotEmpty(message = "物料长描述不能为空")
private String materialLengthDescription;
@Schema(description = "类型")
private String type;
}

View File

@@ -8,6 +8,9 @@ import lombok.Data;
@Data
public class ErpWarehousePageReqVO extends PageParam {
@Schema(description = "工厂名称")
private String factoryName;
@Schema(description = "工厂编码;将查询参数存入")
private String factoryNumber;
@@ -17,4 +20,8 @@ public class ErpWarehousePageReqVO extends PageParam {
@Schema(description = "库位编码")
private String number;
@Schema(description = "类型")
private String type;
}

View File

@@ -26,4 +26,16 @@ public class ErpWarehouseRespVO {
@ExcelProperty("库位编码")
private String number;
@Schema(description = "类别")
private String type;
@Schema(description = "绑定库位名")
private String relName;
@Schema(description = "绑定库位编码")
private String relnumber;
@Schema(description = "是否启用")
private String isEnable;
}

View File

@@ -22,4 +22,16 @@ public class ErpWarehouseSaveReqVO {
@NotEmpty(message = "库位编码不能为空")
private String number;
@Schema(description = "类别")
private String type;
@Schema(description = "绑定库位名")
private String relName;
@Schema(description = "绑定库位编码")
private String relnumber;
@Schema(description = "是否启用")
private String isEnable;
}

View File

@@ -1,12 +1,14 @@
package com.zt.plat.module.erp.dal.dataobject.erp;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*;
/**
* ERP工厂 DO
*
* @author 后台管理
*/
* ERP工厂 DO
*
* @author 后台管理
*/
@TableName("sply_erp_fact")
@KeySequence("sply_erp_fact_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@@ -16,31 +18,58 @@ import lombok.*;
@NoArgsConstructor
@AllArgsConstructor
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class ErpFactoryDO {
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class ErpFactoryDO extends BusinessBaseDO {
/**
* 主键
*/
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 工厂名称
*/
* 工厂名称
*/
@TableField("NAME")
private String name;
/**
* 工厂编码
*/
* 工厂编码
*/
@TableField("NUM")
private String number;
/**
* 公司编号
*/
* 公司编号
*/
@TableField("CPN_ID")
private String companyId;
private String companyNumber;
/**
* 公司名称
*/
@TableField(exist = false)
private String companyName;
/**
* 类型
*/
@TableField("TP")
private String type;
/**
* 绑定工厂名
*/
@TableField("REL_NAME")
private String relName;
/**
* 绑定工厂编码
*/
@TableField("REL_NUM")
private String relnumber;
/**
* 类型
*/
@TableField("IS_ENB")
private String isEnable;
}

View File

@@ -1,6 +1,7 @@
package com.zt.plat.module.erp.dal.dataobject.erp;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*;
import java.time.LocalDateTime;
@@ -21,10 +22,8 @@ import java.time.LocalDateTime;
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
//public class ErpMaterialDO extends BaseDO {
public class ErpMaterialDO {
public class ErpMaterialDO extends BusinessBaseDO {
//public class ErpMaterialDO {
/**
* 主键
@@ -97,7 +96,7 @@ public class ErpMaterialDO {
@TableField("MTRL_LEN_DSP")
private String materialLengthDescription;
@TableField(exist = false)
private Integer TENANT_ID;
@TableField("TP")
private String type;
}

View File

@@ -1,6 +1,7 @@
package com.zt.plat.module.erp.dal.dataobject.erp;
import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*;
/**
* ERP库位 DO
@@ -18,7 +19,7 @@ import lombok.*;
/**
* 支持业务基类继承isBusiness=true 时继承 BusinessBaseDO否则继承 BaseDO
*/
public class ErpWarehouseDO {
public class ErpWarehouseDO extends BusinessBaseDO {
/**
* 主键
@@ -30,6 +31,11 @@ public class ErpWarehouseDO {
*/
@TableField("FACT_NUM")
private String factoryNumber;
/**
* 工厂名称;将查询参数存入
*/
@TableField(exist = false)
private String factoryName;
/**
* 库位描述
*/
@@ -41,4 +47,28 @@ public class ErpWarehouseDO {
@TableField("NUM")
private String number;
/**
* 类别
*/
@TableField("TP")
private String type;
/**
* 绑定库位名
*/
@TableField("REL_NAME")
private String relName;
/**
* 绑定库位编码
*/
@TableField("REL_NUM")
private String relnumber;
/**
* 类型
*/
@TableField("IS_ENB")
private String isEnable;
}

View File

@@ -25,6 +25,4 @@ public interface ErpBomMapper extends BaseMapperX<ErpBomDO> {
.eqIfPresent(ErpBomDO::getUnit, reqVO.getUnit())
.orderByDesc(ErpBomDO::getId));
}
Long insertGetId(ErpBomDO aDo);
}

View File

@@ -29,6 +29,4 @@ public interface ErpCostcenterMapper extends BaseMapperX<ErpCostcenterDO> {
.betweenIfPresent(ErpCostcenterDO::getEndDate, reqVO.getEndDate())
.orderByDesc(ErpCostcenterDO::getId));
}
void updateBatchByNumber(@Param("list") List<ErpCostcenterDO> toUpdate);
}

View File

@@ -18,13 +18,7 @@ import java.util.List;
@Mapper
public interface ErpFactoryMapper extends BaseMapperX<ErpFactoryDO> {
default PageResult<ErpFactoryDO> selectPage(ErpFactoryPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ErpFactoryDO>()
.likeIfPresent(ErpFactoryDO::getName, reqVO.getName())
.eqIfPresent(ErpFactoryDO::getNumber, reqVO.getNumber())
.orderByDesc(ErpFactoryDO::getId));
}
void updateBatch(@Param("toUpdate") List<ErpFactoryDO> toUpdate);
String selectMaxCode();
List<ErpFactoryDO> getPageByReq(ErpFactoryPageReqVO pageReqVO);
}

View File

@@ -37,4 +37,8 @@ public interface ErpMaterialMapper extends BaseMapperX<ErpMaterialDO> {
}
void updateBatchByNumber(@Param("toUpdate") List<ErpMaterialDO> toUpdate);
String selectMaxCode();
Integer selectByErpMNumbers(List<String> erpMNumber);
}

View File

@@ -7,6 +7,8 @@ import com.zt.plat.module.erp.controller.admin.erp.vo.ErpWarehousePageReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* ERP库位 Mapper
*
@@ -15,13 +17,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ErpWarehouseMapper extends BaseMapperX<ErpWarehouseDO> {
default PageResult<ErpWarehouseDO> selectPage(ErpWarehousePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ErpWarehouseDO>()
.eqIfPresent(ErpWarehouseDO::getFactoryNumber, reqVO.getFactoryNumber())
.likeIfPresent(ErpWarehouseDO::getName, reqVO.getName())
// .betweenIfPresent(ErpWarehouseDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ErpWarehouseDO::getNumber, reqVO.getNumber())
.orderByDesc(ErpWarehouseDO::getId));
}
String selectMaxCode();
List<ErpWarehouseDO> getPageByReq(ErpWarehousePageReqVO pageReqVO);
}

View File

@@ -62,4 +62,12 @@ public interface ErpCompanyService {
PageResult<ErpCompanyDO> getErpCompanyPage(ErpCompanyPageReqVO pageReqVO);
void callErpRfcInterface();
/**
* 通过公司编码获得ERP公司
*
* @param number 公司编码
* @return ERP公司
*/
ErpCompanyDO getErpCompanyByNumber(String number);
}

View File

@@ -7,14 +7,14 @@ import com.xxl.job.core.handler.annotation.XxlJob;
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.module.erp.utils.ErpConfig;
import com.zt.plat.module.erp.utils.MyRedisConfig;
import com.zt.plat.module.erp.enums.OftenEnum;
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanyPageReqVO;
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanyRespVO;
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanySaveReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpCompanyDO;
import com.zt.plat.module.erp.dal.mysql.erp.ErpCompanyMapper;
import com.zt.plat.module.erp.enums.OftenEnum;
import com.zt.plat.module.erp.utils.ErpConfig;
import com.zt.plat.module.erp.utils.MyRedisConfig;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -27,7 +27,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_BOM_NOT_EXISTS;
import static com.zt.plat.module.erp.enums.ApiConstants.TABLE_FIELD_SPLY_ERP_CPN_NUM;
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_COMPANY_NOT_EXISTS;
import static dm.jdbc.util.DriverUtil.log;
@@ -136,6 +136,11 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
}
}
@Override
public ErpCompanyDO getErpCompanyByNumber(String number) {
return erpCompanyMapper.selectOne(TABLE_FIELD_SPLY_ERP_CPN_NUM, number);
}
/**
* 处理数据,区分新增和更新
*/

View File

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpProductiveOrderDO;
import com.zt.plat.module.erp.utils.ErpConfig;
import com.zt.plat.module.erp.utils.MyRedisConfig;
import com.zt.plat.module.erp.enums.OftenEnum;
@@ -19,6 +20,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -73,12 +77,12 @@ public class ErpContractServiceImpl implements ErpContractService {
}
@Override
public void deleteErpContractListByIds(List<Long> ids) {
public void deleteErpContractListByIds(List<Long> ids) {
// 校验存在
validateErpContractExists(ids);
// 删除
erpContractMapper.deleteByIds(ids);
}
}
private void validateErpContractExists(List<Long> ids) {
List<ErpContractDO> list = erpContractMapper.selectByIds(ids);
@@ -100,7 +104,72 @@ public class ErpContractServiceImpl implements ErpContractService {
@Override
public PageResult<ErpContractDO> getErpContractPage(ErpContractPageReqVO pageReqVO) {
return erpContractMapper.selectPage(pageReqVO);
OftenEnum.FuncnrEnum funcnrEnum = OftenEnum.FuncnrEnum.合同信息;
String funcnr = funcnrEnum.getFuncnr();
Map<String, Object> req = new HashMap<>();
// 构建查询参数
req.put("BUKRS", pageReqVO.getContractSignNumber());
req.put("PARTNER", pageReqVO.getSupplierNumber());
req.put("INEDR", pageReqVO.getContractCategory());
req.put("ZHTBH", pageReqVO.getContractTypeNumber());
req.put("ZHTMC", pageReqVO.getContractName());
// 调用ERP接口获取数据
HashMap<String, Object> dataFromERP = erpConfig.fetchDataFromERP(funcnr, req);
JSONArray dataArray = (JSONArray) dataFromERP.get("E_RESP");
if (dataArray == null || dataArray.isEmpty()) {
// 返回空结果而不是抛出异常
return new PageResult<>(new ArrayList<>(), 0L);
}
List<ErpContractDO> list = new ArrayList<>();
for (int i = 0; i < dataArray.size(); i++) {
JSONObject dataJson = dataArray.getJSONObject(i);
if (dataJson != null) {
ErpContractDO contractDO = new ErpContractDO();
// 基本信息
contractDO.setContractPaperNumber(dataJson.getString("ZHTBH").trim());
contractDO.setContractName(dataJson.getString("ZHTMC"));
contractDO.setContractTypeName(dataJson.getString("TYPENM"));
contractDO.setSupplierName(dataJson.getString("ZBPNM"));
// 日期处理
String signDate = dataJson.getString("ZQDATE");
String startDate = dataJson.getString("ZSDATE");
String stopDate = dataJson.getString("ZEDATE");
if (signDate != null && !signDate.equals("0000-00-00")) {
try {
contractDO.setSignDate(LocalDate.parse(signDate));
} catch (Exception e) {
// 忽略日期解析错误
}
}
if (startDate != null && !startDate.equals("0000-00-00")) {
try {
contractDO.setStartDate(LocalDate.parse(startDate));
} catch (Exception e) {
// 忽略日期解析错误
}
}
if (stopDate != null && !stopDate.equals("0000-00-00")) {
try {
contractDO.setStopDate(LocalDate.parse(stopDate));
} catch (Exception e) {
// 忽略日期解析错误
}
}
contractDO.setBasicAmount(dataJson.getBigDecimal("ZDMBTR"));
contractDO.setRemark(dataJson.getString("ZREMARK"));
list.add(contractDO);
}
}
// 返回分页结果
return new PageResult<>(list, (long) list.size());
}
@Override
@@ -108,17 +177,44 @@ public class ErpContractServiceImpl implements ErpContractService {
@XxlJob("getErpContractTask")
public void callErpRfcInterface() {
try {
OftenEnum.FuncnrEnum funcnrEnum =OftenEnum.FuncnrEnum.合同信息;
OftenEnum.FuncnrEnum funcnrEnum = OftenEnum.FuncnrEnum.合同信息;
String funcnr = funcnrEnum.getFuncnr();
Map<String, Object> req = new HashMap<>();
JSONArray dataArrayALL = new JSONArray();
String commanyKey = "erpMap" + OftenEnum.FuncnrEnum.公司代码.getFuncnr();
Map<String, Long> redisCache = myRedisConfig.getRedisCacheMap(commanyKey);
if (CollUtil.isEmpty(redisCache)) {
return;
}
String cstmKey = "erpMap" + OftenEnum.FuncnrEnum.客商信息.getFuncnr();
Map<String, Long> redisCachecstmKey = myRedisConfig.getRedisCacheMap(cstmKey);
if (CollUtil.isEmpty(redisCachecstmKey)) {
return;
}
// 1. 调用ERP接口获取数据
HashMap<String, Object> dataFromERP = erpConfig.fetchDataFromERP(funcnr, null);
JSONArray dataArray = (JSONArray) dataFromERP.get("E_RESP");
if (CollUtil.isEmpty(dataArray)) {
for (String INEDR : new String[]{"1", "2"}) {
req.put("INEDR", INEDR);
for (String number : redisCache.keySet()) {
req.put("BUKRS", number);
for (String partner : redisCachecstmKey.keySet()) {
req.put("PARTNER", partner);
// 1. 调用ERP接口获取数据
HashMap<String, Object> dataFromERP = erpConfig.fetchDataFromERP(funcnr, null);
JSONArray dataArray = (JSONArray) dataFromERP.get("E_RESP");
if (dataArray!= null) {
dataArrayALL.addAll(dataArray);
}
}
}
}
if (CollUtil.isEmpty(dataArrayALL)) {
throw exception(ERP_CONTRACT_NOT_EXISTS);
}
// 2. 处理公司数据,区分新增和更新
ProcessingResult result = processData(dataArray,funcnrEnum);
ProcessingResult result = processData(dataArrayALL, funcnrEnum);
// 3. 批量保存数据
saveData(result);
@@ -134,7 +230,7 @@ public class ErpContractServiceImpl implements ErpContractService {
*/
private ProcessingResult processData(JSONArray dataArray, OftenEnum.FuncnrEnum funcnr) {
String key = "erp" + funcnr.getFuncnr();
Map<String,List<String>> numbers = myRedisConfig.numbers(dataArray, key,funcnr.getDatakey());
Map<String, List<String>> numbers = myRedisConfig.numbers(dataArray, key, funcnr.getDatakey());
List<String> allnumbers = numbers.get("all");
List<String> comnumbers = numbers.get("com");
List<ErpContractDO> toUpdate = new ArrayList<>();
@@ -160,7 +256,7 @@ public class ErpContractServiceImpl implements ErpContractService {
}
}
return new ProcessingResult(toUpdate, toInsert,key,allnumbers);
return new ProcessingResult(toUpdate, toInsert, key, allnumbers);
}
/**
@@ -174,7 +270,7 @@ public class ErpContractServiceImpl implements ErpContractService {
if (!result.toUpdate.isEmpty()) {
erpContractMapper.updateBatch(result.toUpdate);
}
myRedisConfig.updateRedisCache(result.key,result.allnumbers);
myRedisConfig.updateRedisCache(result.key, result.allnumbers);
}
/**
@@ -186,7 +282,7 @@ public class ErpContractServiceImpl implements ErpContractService {
private final String key;
private final List<String> allnumbers;
public ProcessingResult(List<ErpContractDO> toUpdate, List<ErpContractDO> toInsert,String key,List<String> allnumbers) {
public ProcessingResult(List<ErpContractDO> toUpdate, List<ErpContractDO> toInsert, String key, List<String> allnumbers) {
this.toUpdate = toUpdate;
this.toInsert = toInsert;
this.key = key;

View File

@@ -62,4 +62,6 @@ public interface ErpFactoryService {
PageResult<ErpFactoryDO> getErpFactoryPage(ErpFactoryPageReqVO pageReqVO);
void callErpRfcInterface();
void enableFactoryList(List<ErpFactoryRespVO> saveReqVOS);
}

View File

@@ -16,6 +16,7 @@ import com.zt.plat.module.erp.controller.admin.erp.vo.ErpFactorySaveReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpFactoryDO;
import com.zt.plat.module.erp.dal.mysql.erp.ErpFactoryMapper;
import jakarta.annotation.Resource;
import org.apache.ibatis.executor.BatchResult;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@@ -51,6 +52,21 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
public ErpFactoryRespVO createErpFactory(ErpFactorySaveReqVO createReqVO) {
// 插入
ErpFactoryDO erpFactory = BeanUtils.toBean(createReqVO, ErpFactoryDO.class);
// 工厂编码自动生成,格式 GC-0001,依次新增
if (erpFactory.getNumber() == null){
String maxCode = erpFactoryMapper.selectMaxCode();
if (maxCode == null) {
erpFactory.setNumber("GC-0001");
} else {
String prefix = "GC-";
String numberPart = maxCode.substring(prefix.length());
int nextNumber = Integer.parseInt(numberPart) + 1;
String nextCode = prefix + String.format("%04d", nextNumber);
erpFactory.setNumber(nextCode);
}
}
erpFactory.setType("供应链");
erpFactory.setIsEnable("1");
erpFactoryMapper.insert(erpFactory);
// 返回
return BeanUtils.toBean(erpFactory, ErpFactoryRespVO.class);
@@ -62,6 +78,9 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
validateErpFactoryExists(updateReqVO.getId());
// 更新
ErpFactoryDO updateObj = BeanUtils.toBean(updateReqVO, ErpFactoryDO.class);
if (updateObj.getType().equals("ERP")||updateObj.getIsEnable().equals("1")){
throw exception(ERP_FACTORY_NOT_ALLOW_UPDATE);
}
erpFactoryMapper.updateById(updateObj);
}
@@ -101,8 +120,36 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
@Override
public PageResult<ErpFactoryDO> getErpFactoryPage(ErpFactoryPageReqVO pageReqVO) {
return erpFactoryMapper.selectPage(pageReqVO);
// 获取分页数据
List<ErpFactoryDO> list = erpFactoryMapper.getPageByReq(pageReqVO);
if (list == null) {
list = CollUtil.newArrayList();
}
// 分页处理
int pageNo = pageReqVO.getPageNo();
int pageSize = pageReqVO.getPageSize();
int total = list.size();
// 计算分页起始和结束位置
int fromIndex = (pageNo - 1) * pageSize;
int toIndex = Math.min(fromIndex + pageSize, total);
// 如果起始位置超出范围,则返回空列表
if (fromIndex >= total) {
return new PageResult<>(new ArrayList<>(), (long) total);
}
// 截取当前页数据
List<ErpFactoryDO> pageList = list.subList(fromIndex, toIndex);
return new PageResult<>(pageList, (long) total);
}
@Override
public void enableFactoryList(List<ErpFactoryRespVO> saveReqVOS) {
List<ErpFactoryDO> updateObj = BeanUtils.toBean(saveReqVOS, ErpFactoryDO.class);
List<BatchResult> count = erpFactoryMapper.updateById(updateObj);
if (CollUtil.isEmpty(count)) {
throw exception(ERP_FACTORY_NOT_EXISTS);
}
}
@Override
@Transactional
@XxlJob("getErpFactoryTask")
@@ -173,7 +220,8 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
ErpFactoryDO DO = new ErpFactoryDO();
DO.setName(dataJson.getString("NAME1"));
DO.setNumber(number);
DO.setCompanyId(dataJson.getString("BUKRS"));
DO.setCompanyNumber(dataJson.getString("BUKRS"));
DO.setType("ERP");
if (numbers.get(number)!=null) {
// 更新
DO.setId(numbers.get(number));
@@ -244,7 +292,7 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
private void initializeMap(String key) {
Map<String, Long> existingNumbers = erpFactoryMapper.selectList(new LambdaQueryWrapperX<ErpFactoryDO>())
.stream()
.stream().filter(erpFactoryDO -> erpFactoryDO.getType().equals("ERP"))
.collect(Collectors.toMap(ErpFactoryDO::getNumber, ErpFactoryDO::getId));
myRedisConfig.addRedisCacheMap(key, existingNumbers);
}

View File

@@ -29,8 +29,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_INTERNAL_ORDER_NOT_EXISTS;
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_MATERIAL_NOT_EXISTS;
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.*;
import static dm.jdbc.util.DriverUtil.log;
/**
@@ -53,6 +52,19 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
public ErpMaterialRespVO createErpMaterial(ErpMaterialSaveReqVO createReqVO) {
// 插入
ErpMaterialDO erpMaterial = BeanUtils.toBean(createReqVO, ErpMaterialDO.class);
// 工厂编码自动生成,格式 GC-0001,依次新增
if (erpMaterial.getDownCenterNumber() == null) {
String maxCode = erpMaterialMapper.selectMaxCode();
if (maxCode == null) {
erpMaterial.setDownCenterNumber("WL-0001");
} else {
String prefix = "WL-";
String numberPart = maxCode.substring(prefix.length());
int nextNumber = Integer.parseInt(numberPart) + 1;
String nextCode = prefix + String.format("%04d", nextNumber);
erpMaterial.setDownCenterNumber(nextCode);
}
}
erpMaterialMapper.insert(erpMaterial);
// 返回
return BeanUtils.toBean(erpMaterial, ErpMaterialRespVO.class);
@@ -64,7 +76,11 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
validateErpMaterialExists(updateReqVO.getId());
// 更新
ErpMaterialDO updateObj = BeanUtils.toBean(updateReqVO, ErpMaterialDO.class);
erpMaterialMapper.updateById(updateObj);
if (updateObj.getType().equals("供应链")) {
erpMaterialMapper.updateById(updateObj);
} else {
throw exception(ERP_MATERIAL_NOT_ALLOW_UPDATE);
}
}
@Override
@@ -76,18 +92,34 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
}
@Override
public void deleteErpMaterialListByIds(List<Long> ids) {
public void deleteErpMaterialListByIds(List<Long> ids) {
// 校验存在
validateErpMaterialExists(ids);
// 删除
erpMaterialMapper.deleteByIds(ids);
}
}
private void validateErpMaterialExists(List<Long> ids) {
List<ErpMaterialDO> list = erpMaterialMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(ERP_MATERIAL_NOT_EXISTS);
}
List<ErpMaterialDO> erpMaterialDOList = list.stream()
.filter(erpMaterialDO -> erpMaterialDO.getType().equals("ERP"))
.collect(Collectors.toList());
if (CollUtil.isEmpty(erpMaterialDOList)) {
throw exception(ERP_MATERIAL_NOT_ALLOW_DELETE);
}
// 优化成批量查询使用IN语句
List<String> downCenterNumbers = list.stream()
.map(ErpMaterialDO::getDownCenterNumber)
.collect(Collectors.toList());
// 使用IN语句批量查询所有物料编码的数量
Integer countMap = erpMaterialMapper.selectByErpMNumbers(downCenterNumbers);
if (countMap > 1) {
throw exception(ERP_MATERIAL_OTHER_NOT_ALLOW_DELETE);
}
}
private void validateErpMaterialExists(Long id) {
@@ -111,11 +143,11 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
@XxlJob("getErpMaterialTask")
public void callErpRfcInterface() {
try {
OftenEnum.FuncnrEnum funcnrEnum =OftenEnum.FuncnrEnum.物料数据;
OftenEnum.FuncnrEnum funcnrEnum = OftenEnum.FuncnrEnum.物料数据;
String funcnr = funcnrEnum.getFuncnr();
//防止缓存数据丢失
String key = "erp" + funcnrEnum.getFuncnr();
if (myRedisConfig.getRedisCache(key)==null) {
if (myRedisConfig.getRedisCache(key) == null) {
initialize(key);
}
@@ -125,7 +157,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
Map<String, String> datumEntry = new HashMap<>();
datumEntry.put("sign", "I");
datumEntry.put("option", "EQ");
// datumEntry.put("low", "2021-05-16");
// datumEntry.put("low", "2021-05-20");
datumEntry.put("low", LocalDate.now().toString());
datumList.add(datumEntry);
req.put(funcnrEnum.getDatekey(), datumList);
@@ -138,7 +170,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
}
// 2. 处理公司数据,区分新增和更新
ProcessingResult result = processData(dataArray,funcnrEnum);
ProcessingResult result = processData(dataArray, funcnrEnum);
// 3. 批量保存数据
saveData(result);
@@ -154,7 +186,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
*/
private ProcessingResult processData(JSONArray dataArray, OftenEnum.FuncnrEnum funcnr) {
String key = "erp" + funcnr.getFuncnr();
Map<String,List<String>> numbers = myRedisConfig.numbers(dataArray, key,funcnr.getDatakey());
Map<String, List<String>> numbers = myRedisConfig.numbers(dataArray, key, funcnr.getDatakey());
List<String> allnumbers = numbers.get("all");
List<String> comnumbers = numbers.get("com");
List<ErpMaterialDO> toUpdate = new ArrayList<>();
@@ -168,7 +200,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
DO.setDownCenterNumber(number);
DO.setCenterNumber(dataJson.getString("BISMT"));
if (!dataJson.getString("ERSDA").equals("0000-00-00")) {
DO.setCreateDate(LocalDateTime.parse(dataJson.getString("ERSDA")+"T00:00:00"));
DO.setCreateDate(LocalDateTime.parse(dataJson.getString("ERSDA") + "T00:00:00"));
}
DO.setMaterialType(dataJson.getString("MTART"));
DO.setMaterialGroupDate(dataJson.getString("MATKL"));
@@ -180,6 +212,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
DO.setExternalMaterialGroupDescription(dataJson.getString("EWBEZ"));
DO.setMaterialName(dataJson.getString("MAKTX"));
DO.setMaterialLengthDescription(dataJson.getString("LDESC"));
DO.setType("ERP");
if (comnumbers.contains(number)) {
// 更新
@@ -191,7 +224,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
}
}
return new ProcessingResult(toUpdate, toInsert,key,allnumbers);
return new ProcessingResult(toUpdate, toInsert, key, allnumbers);
}
/**
@@ -205,7 +238,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
if (!result.toUpdate.isEmpty()) {
erpMaterialMapper.updateBatchByNumber(result.toUpdate);
}
myRedisConfig.updateRedisCache(result.key,result.allnumbers);
myRedisConfig.updateRedisCache(result.key, result.allnumbers);
}
/**
@@ -217,7 +250,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
private final String key;
private final List<String> allnumbers;
public ProcessingResult(List<ErpMaterialDO> toUpdate, List<ErpMaterialDO> toInsert,String key,List<String> allnumbers) {
public ProcessingResult(List<ErpMaterialDO> toUpdate, List<ErpMaterialDO> toInsert, String key, List<String> allnumbers) {
this.toUpdate = toUpdate;
this.toInsert = toInsert;
this.key = key;
@@ -228,6 +261,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
private void initialize(String key) {
List<String> existingNumbers = erpMaterialMapper.selectList(new LambdaQueryWrapperX<ErpMaterialDO>())
.stream()
.filter(ErpMaterialDO -> ErpMaterialDO.getType().equals("ERP"))
.map(ErpMaterialDO::getDownCenterNumber)
.collect(Collectors.toList());
myRedisConfig.updateRedisCache(key, existingNumbers);

View File

@@ -62,4 +62,6 @@ public interface ErpWarehouseService {
PageResult<ErpWarehouseDO> getErpWarehousePage(ErpWarehousePageReqVO pageReqVO);
void callErpRfcInterface();
void enableWarehouseList(List<ErpWarehouseSaveReqVO> saveReqVOS);
}

View File

@@ -7,6 +7,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
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.module.erp.dal.dataobject.erp.ErpFactoryDO;
import com.zt.plat.module.erp.utils.ErpConfig;
import com.zt.plat.module.erp.utils.MyRedisConfig;
import com.zt.plat.module.erp.enums.OftenEnum;
@@ -16,6 +17,7 @@ import com.zt.plat.module.erp.controller.admin.erp.vo.ErpWarehouseSaveReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO;
import com.zt.plat.module.erp.dal.mysql.erp.ErpWarehouseMapper;
import jakarta.annotation.Resource;
import org.apache.ibatis.executor.BatchResult;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@@ -50,10 +52,25 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
@Override
public ErpWarehouseRespVO createErpWarehouse(ErpWarehouseSaveReqVO createReqVO) {
// 插入
ErpWarehouseDO erpWarehouse = BeanUtils.toBean(createReqVO, ErpWarehouseDO.class);
erpWarehouseMapper.insert(erpWarehouse);
ErpWarehouseDO warehouse = BeanUtils.toBean(createReqVO, ErpWarehouseDO.class);
// 库位编码自动生成,格式 KW-0001,依次新增
String maxCode = erpWarehouseMapper.selectMaxCode();
if (warehouse.getNumber() == null){
if (maxCode == null) {
warehouse.setNumber("KW-0001");
} else {
String prefix = "KW-";
String numberPart = maxCode.substring(prefix.length());
int nextNumber = Integer.parseInt(numberPart) + 1;
String nextCode = prefix + String.format("%04d", nextNumber);
warehouse.setNumber(nextCode);
}
}
warehouse.setType("供应链");
warehouse.setIsEnable("1");
erpWarehouseMapper.insert(warehouse);
// 返回
return BeanUtils.toBean(erpWarehouse, ErpWarehouseRespVO.class);
return BeanUtils.toBean(warehouse, ErpWarehouseRespVO.class);
}
@Override
@@ -62,7 +79,11 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
validateErpWarehouseExists(updateReqVO.getId());
// 更新
ErpWarehouseDO updateObj = BeanUtils.toBean(updateReqVO, ErpWarehouseDO.class);
erpWarehouseMapper.updateById(updateObj);
if (updateObj.getType().equals("供应链")&&updateObj.getIsEnable().equals("0")){
erpWarehouseMapper.updateById(updateObj);
}else {
throw exception(ERP_WAREHOUSE_NOT_ALLOW_UPDATE);
}
}
@Override
@@ -99,9 +120,37 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
return erpWarehouseMapper.selectById(id);
}
@Override
public void enableWarehouseList(List<ErpWarehouseSaveReqVO> saveReqVOS) {
List<ErpWarehouseDO> updateObj = BeanUtils.toBean(saveReqVOS, ErpWarehouseDO.class);
List<BatchResult> count = erpWarehouseMapper.updateById(updateObj);
if (CollUtil.isEmpty(count)) {
throw exception(ERP_WAREHOUSE_NOT_EXISTS);
}
}
@Override
public PageResult<ErpWarehouseDO> getErpWarehousePage(ErpWarehousePageReqVO pageReqVO) {
return erpWarehouseMapper.selectPage(pageReqVO);
// 获取分页数据
List<ErpWarehouseDO> list = erpWarehouseMapper.getPageByReq(pageReqVO);
if (list == null) {
list = CollUtil.newArrayList();
}
// 分页处理
int pageNo = pageReqVO.getPageNo();
int pageSize = pageReqVO.getPageSize();
int total = list.size();
// 计算分页起始和结束位置
int fromIndex = (pageNo - 1) * pageSize;
int toIndex = Math.min(fromIndex + pageSize, total);
// 如果起始位置超出范围,则返回空列表
if (fromIndex >= total) {
return new PageResult<>(new ArrayList<>(), (long) total);
}
// 截取当前页数据
List<ErpWarehouseDO> pageList = list.subList(fromIndex, toIndex);
return new PageResult<>(pageList, (long) total);
}
@Override
@@ -244,7 +293,8 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService {
}
private void initializeMap(String key) {
List<ErpWarehouseDO> assets = erpWarehouseMapper.selectList(new LambdaQueryWrapperX<ErpWarehouseDO>());
List<ErpWarehouseDO> assets = erpWarehouseMapper.selectList(new LambdaQueryWrapperX<ErpWarehouseDO>()
.eq(ErpWarehouseDO::getType, "ERP"));
Map<String, Long> existingNumbers = new HashMap<>();
for (ErpWarehouseDO asset : assets) {
String mapKey = asset.getFactoryNumber() + "-" + asset.getNumber();

View File

@@ -25,6 +25,7 @@ import static dm.jdbc.util.DriverUtil.log;
@Configuration
public class ErpConfig {
@Value("${erp.address}")
private String erpAddress;

View File

@@ -8,23 +8,4 @@
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<update id="updateBatch">
UPDATE sply_erp_ast
<set>
NAME = CASE
<foreach collection="toUpdate" item="item">
WHEN CPN_NUM = #{item.companyNumber} AND MAIN_AST_NUM = #{item.mainAssetNumber} THEN #{item.name}
</foreach>
END,
CPN_ID = CASE
<foreach collection="toUpdate" item="item">
WHEN CPN_NUM = #{item.companyNumber} AND MAIN_AST_NUM = #{item.mainAssetNumber} THEN #{item.companyId}
</foreach>
END
</set>
WHERE (CPN_NUM, MAIN_AST_NUM) IN
<foreach collection="toUpdate" item="item" open="(" separator="," close=")">
#{item.companyNumber}, #{item.mainAssetNumber}
</foreach>
</update>
</mapper>

View File

@@ -9,18 +9,4 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<insert id="insertGetId">
</insert>
<update id="updateBatch">
<foreach collection="toUpdate" item="item" separator=";">
UPDATE sply_erp_fact
<set>
<if test="item.name != null">NAME = #{item.name},</if>
<if test="item.number != null">CPN_ID = #{item.companyId},</if>
</set>
WHERE NUM = #{item.number}
</foreach>
</update>
</mapper>

View File

@@ -8,15 +8,4 @@
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<update id="updateBatch">
<foreach collection="toUpdate" item="item" separator=";">
UPDATE sply_erp_fact
<set>
<if test="item.name != null">NAME = #{item.name},</if>
<if test="item.number != null">CPN_ID = #{item.companyId},</if>
</set>
WHERE NUM = #{item.number}
</foreach>
</update>
</mapper>

Some files were not shown because too many files have changed in this diff Show More