Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -126,6 +126,12 @@
|
||||
<artifactId>zt-spring-boot-starter-biz-business</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-module-base-server</artifactId>
|
||||
<version>3.0.35</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.contract.vo.preparaton;
|
||||
|
||||
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 {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31657")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "配置主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6534")
|
||||
@NotNull(message = "配置主键不能为空")
|
||||
private Long parameterId;
|
||||
|
||||
@Schema(description = "条款主键", example = "29652")
|
||||
private Long formulaId;
|
||||
|
||||
@Schema(description = "金属元素编码")
|
||||
private String elementNumber;
|
||||
|
||||
@Schema(description = "金属元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
@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 = "是否包含下限")
|
||||
private String isInDown;
|
||||
|
||||
@Schema(description = "是否省内", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "是否省内不能为空")
|
||||
private String inState;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.contract.vo.preparaton;
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -10,36 +10,36 @@ import java.util.List;
|
||||
@Data
|
||||
public class ContractDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32609")
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "合同主信息主键", example = "13595")
|
||||
private Long contractMainId;
|
||||
|
||||
@Schema(description = "物料名称", example = "张三")
|
||||
@Schema(description = "物料名称", example = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
@Schema(description = "物料编码", example = "物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "计量单位")
|
||||
@Schema(description = "计量单位", example = "吨")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "含税单价", example = "28579")
|
||||
private BigDecimal inTaxUnitPrice;
|
||||
|
||||
@Schema(description = "金属元素缩写")
|
||||
@Schema(description = "金属元素缩写", example = "金属元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
@Schema(description = "金属元素名称", example = "赵六")
|
||||
@Schema(description = "金属元素名称", example = "金属元素名称")
|
||||
private String elementName;
|
||||
|
||||
@Schema(description = "金属元素编码")
|
||||
@Schema(description = "金属元素编码", example = "金属元素编码")
|
||||
private String elementNumber;
|
||||
|
||||
// 交货计划
|
||||
private List<ContractPlanSaveReqVO> plans;
|
||||
|
||||
// 价款结算条款
|
||||
private List<ContractFormulaSaveReqVO> formulas;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.contract.vo.preparaton;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 价款结算条款新增/修改 Request VO")
|
||||
@Data
|
||||
public class ContractFormulaSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28539")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "合同明细主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8181")
|
||||
@NotNull(message = "合同明细主键不能为空")
|
||||
private Long contractDetailId;
|
||||
|
||||
@Schema(description = "公式类型;单价/总价/水扣款/加工费", example = "UNIT_PRICE")
|
||||
private String formulaType;
|
||||
|
||||
@Schema(description = "公式")
|
||||
private String formulaCalculate;
|
||||
|
||||
@Schema(description = "编码公式")
|
||||
private String numberFormula;
|
||||
|
||||
@Schema(description = "物料名称", example = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "计算小数位")
|
||||
private Long decimal;
|
||||
|
||||
@Schema(description = "金属元素编码")
|
||||
private String elementNumber;
|
||||
|
||||
@Schema(description = "金属元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
@Schema(description = "金属元素名称", example = "金属元素名称")
|
||||
private String elementName;
|
||||
|
||||
// 基础系数配置
|
||||
private List<ContractCoefficientSaveReqVO> coefficients;
|
||||
// 品位等级价配置
|
||||
private List<ContractGradeSaveReqVO> grades;
|
||||
// 调整价配置
|
||||
private List<ContractDeductSaveReqVO> deducts;
|
||||
// 市场价配置
|
||||
private List<ContractPriceSaveReqVO> prices;
|
||||
// 品位不计价配置
|
||||
private List<ContractNotSaveReqVO> nots;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.contract.vo.preparaton;
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.contract.vo.preparaton;
|
||||
|
||||
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 ContractNotSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "21132")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "配置主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "3781")
|
||||
@NotNull(message = "配置主键不能为空")
|
||||
private Long parameterId;
|
||||
|
||||
@Schema(description = "条款主键", example = "5722")
|
||||
private Long formulaId;
|
||||
|
||||
@Schema(description = "金属元素编码")
|
||||
private String elementNumber;
|
||||
|
||||
@Schema(description = "金属元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
@Schema(description = "金属元素名称", example = "张三")
|
||||
private String elementName;
|
||||
|
||||
@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 = "是否省内", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "是否省内不能为空")
|
||||
private String inState;
|
||||
}
|
||||
@@ -4,30 +4,26 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 交货计划条款新增/修改 Request VO")
|
||||
@Data
|
||||
public class ContractPlanSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "27474")
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "合同明细主键", example = "32763")
|
||||
private Long contractDetailId;
|
||||
|
||||
@Schema(description = "交货年份", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "交货年份", example = "2025")
|
||||
private Long contractDeliveryYear;
|
||||
|
||||
@Schema(description = "交货月份")
|
||||
@Schema(description = "交货月份", example = "9")
|
||||
private Long contractPlanDeliveryMonth;
|
||||
|
||||
@Schema(description = "计划交货数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "计划交货数量")
|
||||
private BigDecimal contractPlanDeliveryQuantity;
|
||||
|
||||
@Schema(description = "交货开始日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime contractDeliveryStartDate;
|
||||
@Schema(description = "交货开始日期")
|
||||
private String contractDeliveryStartDate;
|
||||
|
||||
@Schema(description = "交货结束日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime contractDeliveryEndDate;
|
||||
@Schema(description = "交货结束日期")
|
||||
private String contractDeliveryEndDate;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.contract.vo.preparaton;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 市场价配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class ContractPriceSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13654")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "配置主键", example = "1590")
|
||||
private Long parameterId;
|
||||
|
||||
@Schema(description = "条款主键", example = "24677")
|
||||
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 = "品种分类", example = "1")
|
||||
private String gradeType;
|
||||
|
||||
@Schema(description = "取价方式;区间价/固定价", example = "2")
|
||||
private String averageType;
|
||||
|
||||
@Schema(description = "网价小数位")
|
||||
private BigDecimal decimal;
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public class ContractRespVO {
|
||||
|
||||
@Schema(description = "代理方;与ERP(ZLIFNR)对应,拓展信息")
|
||||
@ExcelProperty("代理方;与ERP(ZLIFNR)对应,拓展信息")
|
||||
private String zlifnr;
|
||||
private String agent;
|
||||
|
||||
@Schema(description = "类别;与ERP(HTLB)对应,拓展信息")
|
||||
@ExcelProperty("类别;与ERP(HTLB)对应,拓展信息")
|
||||
@@ -195,7 +195,7 @@ public class ContractRespVO {
|
||||
|
||||
@Schema(description = "境内/境外;与ERP(JNJW)对应,拓展信息")
|
||||
@ExcelProperty("境内/境外;与ERP(JNJW)对应,拓展信息")
|
||||
private String jnjw;
|
||||
private String isDomestic;
|
||||
|
||||
@Schema(description = "建筑服务发生地;与ERP(JZFWFSD)对应,拓展信息,销售合同,且类型为SAP02COSR必填")
|
||||
@ExcelProperty("建筑服务发生地;与ERP(JZFWFSD)对应,拓展信息,销售合同,且类型为SAP02COSR必填")
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.contract.vo.preparaton;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
|
||||
|
||||
@Schema(description = "管理后台 - 合同信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class ContractSaveReqVO {
|
||||
@@ -30,45 +25,45 @@ public class ContractSaveReqVO {
|
||||
private Integer step;
|
||||
|
||||
// 合同基本信息
|
||||
@Schema(description = "甲方公司编号;如果是采购合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是销售合同,手动选择,且与ERP(WLDWBH)对应。")
|
||||
@Schema(description = "甲方公司编号;如果是采购合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是销售合同,手动选择,且与ERP(WLDWBH)对应。", example = "甲方公司编号")
|
||||
@ExcelProperty("甲方公司编号;如果是采购合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是销售合同,手动选择,且与ERP(WLDWBH)对应。")
|
||||
private String purchaseCompanyNumber;
|
||||
|
||||
@Schema(description = "甲方公司名称", example = "王五")
|
||||
@Schema(description = "甲方公司名称", example = "甲方公司名称")
|
||||
@ExcelProperty("甲方公司名称")
|
||||
private String purchaseCompanyName;
|
||||
|
||||
@Schema(description = "甲方地址")
|
||||
@Schema(description = "甲方地址", example = "甲方地址")
|
||||
@ExcelProperty("甲方地址")
|
||||
private String purchaseAddress;
|
||||
|
||||
@Schema(description = "甲方法定代表人")
|
||||
@Schema(description = "甲方法定代表人", example = "甲方法定代表人")
|
||||
@ExcelProperty("甲方法定代表人")
|
||||
private String purchaseLeader;
|
||||
|
||||
@Schema(description = "乙方公司编号;如果是销售合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是采购合同,手动选择,且与ERP(WLDWBH)对应。")
|
||||
@Schema(description = "乙方公司编号;如果是销售合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是采购合同,手动选择,且与ERP(WLDWBH)对应。", example = "乙方公司编号")
|
||||
@ExcelProperty("乙方公司编号;如果是销售合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是采购合同,手动选择,且与ERP(WLDWBH)对应。")
|
||||
private String salesCompanyNumber;
|
||||
|
||||
@Schema(description = "乙方公司名称", example = "王五")
|
||||
@Schema(description = "乙方公司名称", example = "乙方公司名称")
|
||||
@ExcelProperty("乙方公司名称")
|
||||
private String salesCompanyName;
|
||||
|
||||
@Schema(description = "乙方地址")
|
||||
@Schema(description = "乙方地址", example = "乙方地址")
|
||||
@ExcelProperty("乙方地址")
|
||||
private String salesAddress;
|
||||
|
||||
@Schema(description = "乙方企业负责人")
|
||||
@Schema(description = "乙方企业负责人", example = "乙方企业负责人")
|
||||
@ExcelProperty("乙方企业负责人")
|
||||
private String salesPurchaseLeader;
|
||||
|
||||
@NotBlank(message = "合同名称不能为空")
|
||||
@Size(max = 90, message = "合同名称长度不能超过90个字符")
|
||||
@Schema(description = "合同名称;与ERP(HTMC)对应,校验唯一", example = "芋艿")
|
||||
@Schema(description = "合同名称;与ERP(HTMC)对应,校验唯一", example = "合同名称")
|
||||
@ExcelProperty("合同名称;与ERP(HTMC)对应,校验唯一")
|
||||
private String contractName;
|
||||
|
||||
@Schema(description = "合同编号;与ERP(HTBH)对应,校验唯一")
|
||||
@Schema(description = "合同编号;与ERP(HTBH)对应,校验唯一", example = "合同编号")
|
||||
@ExcelProperty("合同编号;与ERP(HTBH)对应,校验唯一")
|
||||
private String contractPaperNumber;
|
||||
|
||||
@@ -77,34 +72,28 @@ public class ContractSaveReqVO {
|
||||
@ExcelProperty("合同类型")
|
||||
private String contractType;
|
||||
|
||||
@Schema(description = "收支性质;与ERP(SZXZ)对应")
|
||||
@Schema(description = "收支性质;与ERP(SZXZ)对应", example = "EXPENSES")
|
||||
@ExcelProperty("收支性质;与ERP(SZXZ)对应")
|
||||
private String direction;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@Schema(description = "签署日期;与ERP(HTQDRQ)对应")
|
||||
@ExcelProperty("签署日期;与ERP(HTQDRQ)对应")
|
||||
private LocalDateTime signDate;
|
||||
private String signDate;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@Schema(description = "开始日期;与ERP(HTQSRQ)对应")
|
||||
@ExcelProperty("开始日期;与ERP(HTQSRQ)对应")
|
||||
private LocalDateTime startDate;
|
||||
private String startDate;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@Schema(description = "结束日期;与ERP(HTZZRQ)对应")
|
||||
@ExcelProperty("结束日期;与ERP(HTZZRQ)对应")
|
||||
private LocalDateTime endDate;
|
||||
private String endDate;
|
||||
|
||||
@Schema(description = "签署地")
|
||||
@Schema(description = "签署地", example = "签署地")
|
||||
@ExcelProperty("签署地")
|
||||
private String signPlace;
|
||||
|
||||
// 金额信息
|
||||
@Schema(description = "币种;与ERP(BZBH)对应")
|
||||
@Schema(description = "币种;与ERP(BZBH)对应", example = "CNY")
|
||||
@ExcelProperty("币种;与ERP(BZBH)对应")
|
||||
private String currency;
|
||||
|
||||
@@ -116,7 +105,7 @@ public class ContractSaveReqVO {
|
||||
@ExcelProperty("原币金额;与ERP(HTYBZJE)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
|
||||
private BigDecimal cooAmount;
|
||||
|
||||
@Schema(description = "是否有履约保证金;为是,则保证金必填。")
|
||||
@Schema(description = "是否有履约保证金;为是,则保证金必填。", example = "1")
|
||||
@ExcelProperty("是否有履约保证金;为是,则保证金必填。")
|
||||
private String hasDeposit;
|
||||
|
||||
@@ -128,7 +117,7 @@ public class ContractSaveReqVO {
|
||||
@ExcelProperty("本币履约保证金-变更后;与ERP(LYBZJBGHBWB)对应,拓展信息")
|
||||
private BigDecimal changeBasicAmountDeposit;
|
||||
|
||||
@Schema(description = "是否有预付款;与ERP(SFYYFK)对应")
|
||||
@Schema(description = "是否有预付款;与ERP(SFYYFK)对应", example = "1")
|
||||
@ExcelProperty("是否有预付款;与ERP(SFYYFK)对应")
|
||||
private String hasPrepayment;
|
||||
|
||||
@@ -140,7 +129,7 @@ public class ContractSaveReqVO {
|
||||
@ExcelProperty("预付款金额;与ERP(YFKJE)对应")
|
||||
private BigDecimal prepaymentAmount;
|
||||
|
||||
@Schema(description = "是否有质保金;与ERP(SFHZBJ)对应")
|
||||
@Schema(description = "是否有质保金;与ERP(SFHZBJ)对应", example = "1")
|
||||
@ExcelProperty("是否有质保金;与ERP(SFHZBJ)对应")
|
||||
private String hasQualityAmount;
|
||||
|
||||
@@ -152,11 +141,11 @@ public class ContractSaveReqVO {
|
||||
@ExcelProperty("质保金金额;与ERP(BZJJE)对应")
|
||||
private BigDecimal qualityAmount;
|
||||
|
||||
@Schema(description = "是否先款后货")
|
||||
@Schema(description = "是否先款后货", example = "1")
|
||||
@ExcelProperty("是否先款后货")
|
||||
private String hasPayable;
|
||||
|
||||
@Schema(description = "备注;与ERP(BZXX)对应")
|
||||
@Schema(description = "备注;与ERP(BZXX)对应", example = "备注")
|
||||
@ExcelProperty("备注;与ERP(BZXX)对应")
|
||||
private String remark;
|
||||
|
||||
@@ -180,51 +169,51 @@ public class ContractSaveReqVO {
|
||||
@ExcelProperty("本币履约保证金;与ERP(LYBZJBGQBWB)对应")
|
||||
private BigDecimal basicAmountDeposit;
|
||||
|
||||
@Schema(description = "是否框架合同;与ERP(SFKJHT)对应,拓展信息")
|
||||
@Schema(description = "是否框架合同;与ERP(SFKJHT)对应,拓展信息", example = "1")
|
||||
@ExcelProperty("是否框架合同;与ERP(SFKJHT)对应,拓展信息")
|
||||
private String isFramework;
|
||||
|
||||
@Schema(description = "境内/境外;与ERP(JNJW)对应,拓展信息")
|
||||
@Schema(description = "境内/境外;与ERP(JNJW)对应,拓展信息", example = "DOMESTIC")
|
||||
@ExcelProperty("境内/境外;与ERP(JNJW)对应,拓展信息")
|
||||
private String jnjw;
|
||||
private String isDomestic;
|
||||
|
||||
@Schema(description = "施工类型编号;与ERP(HTLXBH)对应,拓展信息")
|
||||
@Schema(description = "施工类型编号;与ERP(HTLXBH)对应,拓展信息", example = "施工类型编号")
|
||||
@ExcelProperty("施工类型编号;与ERP(HTLXBH)对应,拓展信息")
|
||||
private String constructionTypeNumber;
|
||||
|
||||
@Schema(description = "施工类型名称;与ERP(HTLXMC)对应,拓展信息", example = "张三")
|
||||
@Schema(description = "施工类型名称;与ERP(HTLXMC)对应,拓展信息", example = "施工类型名称")
|
||||
@ExcelProperty("施工类型名称;与ERP(HTLXMC)对应,拓展信息")
|
||||
private String constructionTypeName;
|
||||
|
||||
@Schema(description = "代理方;与ERP(ZLIFNR)对应,拓展信息")
|
||||
@Schema(description = "代理方;与ERP(ZLIFNR)对应,拓展信息", example = "代理方")
|
||||
@ExcelProperty("代理方;与ERP(ZLIFNR)对应,拓展信息")
|
||||
private String zlifnr;
|
||||
private String agent;
|
||||
|
||||
@Schema(description = "类别;与ERP(HTLB)对应,拓展信息")
|
||||
@Schema(description = "类别;与ERP(HTLB)对应,拓展信息", example = "PROCESSING")
|
||||
@ExcelProperty("类别;与ERP(HTLB)对应,拓展信息")
|
||||
private String category;
|
||||
|
||||
// 模板部分查询
|
||||
@Schema(description = "模板实例主键", example = "10196")
|
||||
@ExcelProperty("模板实例主键")
|
||||
private Long instanceId;
|
||||
// 合同动态表单
|
||||
// 合同动态条款
|
||||
|
||||
// TODO 未确认字段
|
||||
@Schema(description = "是否虚拟合同;与ERP(SFXNHT)对应")
|
||||
@Schema(description = "是否虚拟合同;与ERP(SFXNHT)对应", example = "1")
|
||||
@ExcelProperty("是否虚拟合同;与ERP(SFXNHT)对应")
|
||||
private String contractVirtual;
|
||||
|
||||
@Schema(description = "补充协议类型;变更协议/增加条款", example = "1")
|
||||
@Schema(description = "补充协议类型;变更协议/增加条款", example = "补充协议类型")
|
||||
@ExcelProperty("补充协议类型;变更协议/增加条款")
|
||||
private String replenishAgreementType;
|
||||
|
||||
@Schema(description = "建筑服务发生地;与ERP(JZFWFSD)对应,拓展信息,销售合同,且类型为SAP02COSR必填")
|
||||
@Schema(description = "建筑服务发生地;与ERP(JZFWFSD)对应,拓展信息,销售合同,且类型为SAP02COSR必填", example = "建筑服务发生地")
|
||||
@ExcelProperty("建筑服务发生地;与ERP(JZFWFSD)对应,拓展信息,销售合同,且类型为SAP02COSR必填")
|
||||
private String architectureServicePlace;
|
||||
|
||||
@Schema(description = "达到收款条件金额;与ERP(DDSKJE)对应,拓展信息,销售合同,且类型为SAP02COSR必填")
|
||||
@ExcelProperty("达到收款条件金额;与ERP(DDSKJE)对应,拓展信息,销售合同,且类型为SAP02COSR必填")
|
||||
private BigDecimal payeeConditionAmount;
|
||||
|
||||
// 模板部分查询
|
||||
@Schema(description = "模板实例主键", example = "10196")
|
||||
@ExcelProperty("模板实例主键")
|
||||
private Long instanceId;
|
||||
|
||||
// 合同动态表单
|
||||
private List<TemplateInstanceDataSaveReqVO> dynamicsFields;
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.contract;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 基础系数配置 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("bse_ctrt_coef")
|
||||
@KeySequence("bse_ctrt_coef_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ContractCoefficientDO extends BusinessBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 配置主键
|
||||
*/
|
||||
@TableField("PRM_ID")
|
||||
private Long parameterId;
|
||||
/**
|
||||
* 条款主键
|
||||
*/
|
||||
@TableField("FMU_ID")
|
||||
private Long formulaId;
|
||||
/**
|
||||
* 金属元素编码
|
||||
*/
|
||||
@TableField("ELEM_NUM")
|
||||
private String elementNumber;
|
||||
/**
|
||||
* 金属元素缩写
|
||||
*/
|
||||
@TableField("ELEM_ABBR")
|
||||
private String elementAbbreviation;
|
||||
/**
|
||||
* 金属元素名称
|
||||
*/
|
||||
@TableField("ELEM_NAME")
|
||||
private String elementName;
|
||||
/**
|
||||
* 系数值
|
||||
*/
|
||||
@TableField("STLM_COEF")
|
||||
private String settlementCoefficient;
|
||||
/**
|
||||
* 系数上限
|
||||
*/
|
||||
@TableField("COEF_UP")
|
||||
private BigDecimal coefficientUp;
|
||||
/**
|
||||
* 系数下限
|
||||
*/
|
||||
@TableField("COEF_DOWN")
|
||||
private BigDecimal coefficientDown;
|
||||
/**
|
||||
* 是否包含上限
|
||||
*/
|
||||
@TableField("IS_IN_UP")
|
||||
private String isInUp;
|
||||
/**
|
||||
* 是否包含下限
|
||||
*/
|
||||
@TableField("IS_IN_DOWN")
|
||||
private String isInDown;
|
||||
/**
|
||||
* 是否省内
|
||||
*/
|
||||
@TableField("IN_STA")
|
||||
private String inState;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("TP")
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.contract;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 调整价配置 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("bse_ctrt_ddct")
|
||||
@KeySequence("bse_ctrt_ddct_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
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
|
||||
*/
|
||||
@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("IN_STA")
|
||||
private String inState;
|
||||
/**
|
||||
* 调整价
|
||||
*/
|
||||
@TableField("GRD_AMT")
|
||||
private BigDecimal gradeAmount;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.contract;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 价款结算条款 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("bse_ctrt_fmu")
|
||||
@KeySequence("bse_ctrt_fmu_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ContractFormulaDO extends BusinessBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 合同明细主键
|
||||
*/
|
||||
@TableField("CTRT_DTL_ID")
|
||||
private Long contractDetailId;
|
||||
/**
|
||||
* 公式类型;单价/总价/水扣款/加工费
|
||||
*/
|
||||
@TableField("FMU_TP")
|
||||
private String formulaType;
|
||||
/**
|
||||
* 公式
|
||||
*/
|
||||
@TableField("FMU_CALT")
|
||||
private String formulaCalculate;
|
||||
/**
|
||||
* 编码公式
|
||||
*/
|
||||
@TableField("NUM_FMU")
|
||||
private String numberFormula;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@TableField("MTRL_NAME")
|
||||
private String materialName;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@TableField("MTRL_NUM")
|
||||
private String materialNumber;
|
||||
/**
|
||||
* 计算小数位
|
||||
*/
|
||||
@TableField("DEC")
|
||||
private Long decimal;
|
||||
/**
|
||||
* 金属元素编码
|
||||
*/
|
||||
@TableField("ELEM_NUM")
|
||||
private String elementNumber;
|
||||
/**
|
||||
* 金属元素缩写
|
||||
*/
|
||||
@TableField("ELEM_ABBR")
|
||||
private String elementAbbreviation;
|
||||
/**
|
||||
* 金属元素名称
|
||||
*/
|
||||
@TableField("ELEM_NAME")
|
||||
private String elementName;
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.contract;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 品位等级价配置 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("bse_ctrt_grd")
|
||||
@KeySequence("bse_ctrt_grd_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ContractGradeDO extends BusinessBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 配置主键
|
||||
*/
|
||||
@TableField("PRM_ID")
|
||||
private Long parameterId;
|
||||
/**
|
||||
* 条款主键
|
||||
*/
|
||||
@TableField("FMU_ID")
|
||||
private Long formulaId;
|
||||
/**
|
||||
* 金属元素编码
|
||||
*/
|
||||
@TableField("ELEM_NUM")
|
||||
private String elementNumber;
|
||||
/**
|
||||
* 金属元素缩写
|
||||
*/
|
||||
@TableField("ELEM_ABBR")
|
||||
private String elementAbbreviation;
|
||||
/**
|
||||
* 金属元素名称
|
||||
*/
|
||||
@TableField("ELEM_NAME")
|
||||
private String elementName;
|
||||
/**
|
||||
* 品位单位
|
||||
*/
|
||||
@TableField("GRD_UNT")
|
||||
private String gradeUnit;
|
||||
/**
|
||||
* 品位上限
|
||||
*/
|
||||
@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("GRD_DFT")
|
||||
private BigDecimal gradeDefault;
|
||||
/**
|
||||
* 系数;计价类型为阶梯价使用,标识没上升多少系数进行加款还是减款
|
||||
*/
|
||||
@TableField("STLM_COEF")
|
||||
private BigDecimal settlementCoefficient;
|
||||
/**
|
||||
* 不足系数值按比例计算
|
||||
*/
|
||||
@TableField("USE_COEF")
|
||||
private String useCoefficient;
|
||||
/**
|
||||
* 计价类型
|
||||
*/
|
||||
@TableField("PRC_TP")
|
||||
private String priceType;
|
||||
/**
|
||||
* 是否省内
|
||||
*/
|
||||
@TableField("IN_STA")
|
||||
private String inState;
|
||||
/**
|
||||
* 等级单价
|
||||
*/
|
||||
@TableField("UPRC")
|
||||
private BigDecimal unitPrice;
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.contract;
|
||||
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -218,8 +217,8 @@ public class ContractMainDO extends BusinessBaseDO {
|
||||
/**
|
||||
* 代理方;与ERP(ZLIFNR)对应,拓展信息
|
||||
*/
|
||||
@TableField("ZLIFNR")
|
||||
private String zlifnr;
|
||||
@TableField("AGT")
|
||||
private String agent;
|
||||
/**
|
||||
* 类别;与ERP(HTLB)对应,拓展信息
|
||||
*/
|
||||
@@ -253,8 +252,8 @@ public class ContractMainDO extends BusinessBaseDO {
|
||||
/**
|
||||
* 境内/境外;与ERP(JNJW)对应,拓展信息
|
||||
*/
|
||||
@TableField("JNJW")
|
||||
private String jnjw;
|
||||
@TableField("IS_DOM")
|
||||
private String isDomestic;
|
||||
/**
|
||||
* 建筑服务发生地;与ERP(JZFWFSD)对应,拓展信息,销售合同,且类型为SAP02COSR必填
|
||||
*/
|
||||
@@ -270,4 +269,14 @@ public class ContractMainDO extends BusinessBaseDO {
|
||||
*/
|
||||
@TableField("STP")
|
||||
private Integer step;
|
||||
/**
|
||||
* ERP请求状态
|
||||
*/
|
||||
@TableField("ERP_STS")
|
||||
private String erpStatus;
|
||||
/**
|
||||
* ERP请求失败原因
|
||||
*/
|
||||
@TableField("CAUS")
|
||||
private String cause;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.contract;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 品位不计价配置 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("bse_ctrt_nt")
|
||||
@KeySequence("bse_ctrt_nt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ContractNotDO extends BusinessBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 配置主键
|
||||
*/
|
||||
@TableField("PRM_ID")
|
||||
private Long parameterId;
|
||||
/**
|
||||
* 条款主键
|
||||
*/
|
||||
@TableField("FMU_ID")
|
||||
private Long formulaId;
|
||||
/**
|
||||
* 金属元素编码
|
||||
*/
|
||||
@TableField("ELEM_NUM")
|
||||
private String elementNumber;
|
||||
/**
|
||||
* 金属元素缩写
|
||||
*/
|
||||
@TableField("ELEM_ABBR")
|
||||
private String elementAbbreviation;
|
||||
/**
|
||||
* 金属元素名称
|
||||
*/
|
||||
@TableField("ELEM_NAME")
|
||||
private String elementName;
|
||||
/**
|
||||
* 上限
|
||||
*/
|
||||
@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("IN_STA")
|
||||
private String inState;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.contract;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 市场价配置 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("bse_ctrt_prc")
|
||||
@KeySequence("bse_ctrt_prc_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ContractPriceDO extends BusinessBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 配置主键
|
||||
*/
|
||||
@TableField("PRM_ID")
|
||||
private Long parameterId;
|
||||
/**
|
||||
* 条款主键
|
||||
*/
|
||||
@TableField("FMU_ID")
|
||||
private Long formulaId;
|
||||
/**
|
||||
* 市场价
|
||||
*/
|
||||
@TableField("VAL")
|
||||
private BigDecimal value;
|
||||
/**
|
||||
* 计算方式;均价/高位价/地位价
|
||||
*/
|
||||
@TableField("CALT_WY")
|
||||
private String calculateWay;
|
||||
/**
|
||||
* 数据来源网价代码;数据字典
|
||||
*/
|
||||
@TableField("DAT_ORGN")
|
||||
private String dataOrigin;
|
||||
/**
|
||||
* 计价开始日期
|
||||
*/
|
||||
@TableField("CALT_STRT_DT")
|
||||
private LocalDateTime calculateStartDate;
|
||||
/**
|
||||
* 计价截止日期
|
||||
*/
|
||||
@TableField("CALT_END_DT")
|
||||
private LocalDateTime calculateEndDate;
|
||||
/**
|
||||
* 包含开始日期
|
||||
*/
|
||||
@TableField("IN_STRT_DT")
|
||||
private String inStartDate;
|
||||
/**
|
||||
* 包含结束日期
|
||||
*/
|
||||
@TableField("IN_END_DT")
|
||||
private String inEndDate;
|
||||
/**
|
||||
* 价格品种元素的明细分类
|
||||
*/
|
||||
@TableField("PRC_GRD")
|
||||
private String priceGrade;
|
||||
/**
|
||||
* 品种分类
|
||||
*/
|
||||
@TableField("GRD_TP")
|
||||
private String gradeType;
|
||||
/**
|
||||
* 取价方式;区间价/固定价
|
||||
*/
|
||||
@TableField("AVG_TP")
|
||||
private String averageType;
|
||||
/**
|
||||
* 网价小数位
|
||||
*/
|
||||
@TableField("DEC")
|
||||
private BigDecimal decimal;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractCoefficientDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 基础系数配置 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractCoefficientMapper extends BaseMapperX<ContractCoefficientDO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractDeductDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 调整价配置 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractDeductMapper extends BaseMapperX<ContractDeductDO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractFormulaDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 价款结算条款 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractFormulaMapper extends BaseMapperX<ContractFormulaDO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractGradeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 品位等级价配置 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractGradeMapper extends BaseMapperX<ContractGradeDO> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractNotDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 品位不计价配置 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractNotMapper extends BaseMapperX<ContractNotDO> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractPlanDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 交货计划条款 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractPlanMapper extends BaseMapperX<ContractPlanDO> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractPriceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 市场价配置 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractPriceMapper extends BaseMapperX<ContractPriceDO> {
|
||||
}
|
||||
@@ -1,22 +1,27 @@
|
||||
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.tenant.core.context.CompanyContextHolder;
|
||||
import com.zt.plat.module.base.dal.dataobject.tmpltp.TemplateInstanceDataDO;
|
||||
import com.zt.plat.module.base.service.tmpltp.TemplateInstanceDataService;
|
||||
import com.zt.plat.module.contractorder.controller.admin.contract.vo.preparaton.ContractPageReqVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.contract.vo.preparaton.ContractSaveReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.contract.ContractMainMapper;
|
||||
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.contract.ContractStatusEnum;
|
||||
import com.zt.plat.module.contractorder.enums.contract.DateConstants;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.*;
|
||||
@@ -32,12 +37,31 @@ public class ContractServiceImpl implements ContractService {
|
||||
|
||||
@Resource
|
||||
private ContractMainMapper contractMainMapper;
|
||||
@Resource
|
||||
private ContractDetailMapper contractDetailMapper;
|
||||
@Resource
|
||||
private ContractPlanMapper contractPlanMapper;
|
||||
@Resource
|
||||
private TemplateInstanceDataService templateInstanceDataService;
|
||||
@Resource
|
||||
private ContractFormulaMapper contractFormulaMapper;
|
||||
@Resource
|
||||
private ContractCoefficientMapper contractCoefficientMapper;
|
||||
@Resource
|
||||
private ContractGradeMapper contractGradeMapper;
|
||||
@Resource
|
||||
private ContractDeductMapper contractDeductMapper;
|
||||
@Resource
|
||||
private ContractPriceMapper contractPriceMapper;
|
||||
@Resource
|
||||
private ContractNotMapper contractNotMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<ContractMainDO> getContractPage(ContractPageReqVO pageReqVO) {
|
||||
return contractMainMapper.selectContractPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Long createContract(ContractSaveReqVO reqVO) {
|
||||
|
||||
@@ -65,7 +89,99 @@ public class ContractServiceImpl implements ContractService {
|
||||
// 保存合同主信息
|
||||
contractMainMapper.insert(contractMainDO);
|
||||
|
||||
System.out.println(contractMainDO);
|
||||
// 合同主信息ID
|
||||
Long contractId = contractMainDO.getId();
|
||||
// 合同明细
|
||||
reqVO.getDetail().forEach(detail -> {
|
||||
// 合同明细DO
|
||||
ContractDetailDO detailDO = BeanUtils.toBean(detail, ContractDetailDO.class);
|
||||
// 设置合同主信息ID
|
||||
detailDO.setContractMainId(contractId);
|
||||
// 保存合同明细
|
||||
contractDetailMapper.insert(detailDO);
|
||||
|
||||
// 合同明细ID
|
||||
Long detailDOId = detailDO.getId();
|
||||
// 交货计划
|
||||
detail.getPlans().forEach(plan -> {
|
||||
// 交货计划DO
|
||||
ContractPlanDO planDO = BeanUtils.toBean(plan, ContractPlanDO.class);
|
||||
// 合同明细主键
|
||||
planDO.setContractDetailId(detailDOId);
|
||||
// 保存交货计划
|
||||
contractPlanMapper.insert(planDO);
|
||||
});
|
||||
|
||||
// 价款结算条款
|
||||
detail.getFormulas().forEach(formula -> {
|
||||
// 价款结算条款DO
|
||||
ContractFormulaDO formulaDO = BeanUtils.toBean(formula, ContractFormulaDO.class);
|
||||
// 合同明细主键
|
||||
formulaDO.setContractDetailId(detailDOId);
|
||||
// 保存价款结算条款
|
||||
contractFormulaMapper.insert(formulaDO);
|
||||
|
||||
// 价款结算条款ID
|
||||
Long formulaDOId = formulaDO.getId();
|
||||
// 基础系数配置
|
||||
formula.getCoefficients().forEach(coefficient -> {
|
||||
// 基础系数配置DO
|
||||
ContractCoefficientDO coefficientDO = BeanUtils.toBean(coefficient, ContractCoefficientDO.class);
|
||||
// 条款主键
|
||||
coefficientDO.setFormulaId(formulaDOId);
|
||||
// 保存基础系数配置
|
||||
contractCoefficientMapper.insert(coefficientDO);
|
||||
});
|
||||
// 品位等级价配置
|
||||
formula.getGrades().forEach(grade -> {
|
||||
// 品位等级价配置DO
|
||||
ContractGradeDO gradeDO = BeanUtils.toBean(grade, ContractGradeDO.class);
|
||||
// 条款主键
|
||||
gradeDO.setFormulaId(formulaDOId);
|
||||
// 保存品位等级价配置
|
||||
contractGradeMapper.insert(gradeDO);
|
||||
});
|
||||
// 调整价配置
|
||||
formula.getDeducts().forEach(deduct -> {
|
||||
// 调整价配置DO
|
||||
ContractDeductDO deductDO = BeanUtils.toBean(deduct, ContractDeductDO.class);
|
||||
// 条款主键
|
||||
deductDO.setFormulaId(formulaDOId);
|
||||
// 保存品位等级价配置
|
||||
contractDeductMapper.insert(deductDO);
|
||||
});
|
||||
// 市场价配置
|
||||
formula.getPrices().forEach(price -> {
|
||||
// 市场价配置DO
|
||||
ContractPriceDO priceDO = BeanUtils.toBean(price, ContractPriceDO.class);
|
||||
// 条款主键
|
||||
priceDO.setFormulaId(formulaDOId);
|
||||
// 保存市场价配置
|
||||
contractPriceMapper.insert(priceDO);
|
||||
});
|
||||
// 品位不计价配置
|
||||
formula.getNots().forEach(not -> {
|
||||
// 品位不计价配置DO
|
||||
ContractNotDO notDO = BeanUtils.toBean(not, ContractNotDO.class);
|
||||
// 条款主键
|
||||
notDO.setFormulaId(formulaDOId);
|
||||
// 保存品位不计价配置
|
||||
contractNotMapper.insert(notDO);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 合同动态表单
|
||||
List<TemplateInstanceDataDO> templateInstanceDataDOS = new ArrayList<>();
|
||||
reqVO.getDynamicsFields().forEach(dynamicsField -> {
|
||||
TemplateInstanceDataDO templateInstanceDataDO = new TemplateInstanceDataDO();
|
||||
BeanUtils.copyProperties(dynamicsField, templateInstanceDataDO);
|
||||
templateInstanceDataDO.setInscId(reqVO.getInstanceId().toString());
|
||||
templateInstanceDataDOS.add(templateInstanceDataDO);
|
||||
});
|
||||
// 更新合同动态表单值
|
||||
templateInstanceDataService.setTemplateInstanceData(templateInstanceDataDOS);
|
||||
|
||||
return contractMainDO.getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ public class ErpSubmitReqDTO {
|
||||
* "sign": 签名,uuid+srcsys+密码,MD5 32位小写签名,密码另行约定
|
||||
* "req": {具体参数,参见RFC功能列表}
|
||||
*/
|
||||
private String srcsys;
|
||||
private String funcnr;
|
||||
private String bskey;
|
||||
private String usrid;
|
||||
|
||||
@@ -93,7 +93,7 @@ public ResponseEntity<String> pushDataToErp(ErpSubmitReqDTO reqDTO) {
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("uuid", UUID.randomUUID().toString());
|
||||
requestBody.put("sapsys", sapsys);
|
||||
requestBody.put("srcsys", reqDTO.getSrcsys());
|
||||
requestBody.put("srcsys", "DSC");
|
||||
requestBody.put("funcnr", reqDTO.getFuncnr());
|
||||
requestBody.put("bskey", reqDTO.getBskey());
|
||||
requestBody.put("usrid", reqDTO.getUsrid());
|
||||
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP资产卡片")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-asset")
|
||||
@RequestMapping("/base/erp-asset")
|
||||
@Validated
|
||||
public class ErpAssetController {
|
||||
|
||||
@@ -104,7 +104,8 @@ public class ErpAssetController {
|
||||
@PostMapping("/getErpAssetTask")
|
||||
@Operation(summary = "定时获得erp更新资产卡片")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-asset:create')")
|
||||
public void getErpCompanyTask() {
|
||||
public CommonResult<Boolean> getErpCompanyTask() {
|
||||
erpAssetService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP物料清单(BOM)")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-bom")
|
||||
@RequestMapping("/base/erp-bom")
|
||||
@Validated
|
||||
public class ErpBomController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpBomController {
|
||||
@PostMapping("/getErpBomTask")
|
||||
@Operation(summary = "定时获得erp更新物料清单(BOM)")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-bom:create')")
|
||||
public void getErpBomTask() {
|
||||
erpBomService.callErpRfcInterface();
|
||||
public CommonResult<Boolean> getErpBomTask() {
|
||||
erpBomService.callErpRfcInterface();
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/submitDataToErp")
|
||||
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP物料清单(BOM)明细")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-bom-detail")
|
||||
@RequestMapping("/base/erp-bom-detail")
|
||||
@Validated
|
||||
public class ErpBomDetailController {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP公司")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-company")
|
||||
@RequestMapping("/base/erp-company")
|
||||
@Validated
|
||||
public class ErpCompanyController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpCompanyController {
|
||||
@PostMapping("/getErpCompanyTask")
|
||||
@Operation(summary = "定时获得erp更新公司")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:create')")
|
||||
public void getErpCompanyTask() {
|
||||
public CommonResult<Boolean> getErpCompanyTask() {
|
||||
erpCompanyService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP合同映射")
|
||||
@RestController
|
||||
@RequestMapping("/bse/erp-contract")
|
||||
@RequestMapping("/base/erp-contract")
|
||||
@Validated
|
||||
public class ErpContractController {
|
||||
|
||||
@@ -104,7 +104,8 @@ public class ErpContractController {
|
||||
@PostMapping("/getErpContractTask")
|
||||
@Operation(summary = "定时获得erp更新合同")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-contract:create')")
|
||||
public void getErpContractTask() {
|
||||
public CommonResult<Boolean> getErpContractTask() {
|
||||
erpContractService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP成本中心")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-costcenter")
|
||||
@RequestMapping("/base/erp-costcenter")
|
||||
@Validated
|
||||
public class ErpCostcenterController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpCostcenterController {
|
||||
@PostMapping("/getErpCostcenterTask")
|
||||
@Operation(summary = "定时获得erp更新成本中心")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-costcenter:create')")
|
||||
public void getErpCostcenterTask() {
|
||||
public CommonResult<Boolean> getErpCostcenterTask() {
|
||||
erpCostcenterService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP客商信息")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-customer")
|
||||
@RequestMapping("/base/erp-customer")
|
||||
@Validated
|
||||
public class ErpCustomerController {
|
||||
|
||||
@@ -104,7 +104,8 @@ public class ErpCustomerController {
|
||||
@PostMapping("/getErpCustomerTask")
|
||||
@Operation(summary = "定时获得erp更新客商主数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-customer:create')")
|
||||
public void getErpCustomerTask() {
|
||||
public CommonResult<Boolean> getErpCustomerTask() {
|
||||
erpCustomerService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP工厂")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-factory")
|
||||
@RequestMapping("/base/erp-factory")
|
||||
@Validated
|
||||
public class ErpFactoryController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpFactoryController {
|
||||
@PostMapping("/getErpFactoryTask")
|
||||
@Operation(summary = "定时获得erp工厂数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-factory:create')")
|
||||
public void getErpFactoryTask() {
|
||||
public CommonResult<Boolean> getErpFactoryTask() {
|
||||
erpFactoryService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP内部订单")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-internal-order")
|
||||
@RequestMapping("/base/erp-internal-order")
|
||||
@Validated
|
||||
public class ErpInternalOrderController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpInternalOrderController {
|
||||
@PostMapping("/getErpInternalOrderTask")
|
||||
@Operation(summary = "定时获得erp更新内部订单数据")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-internal-order:create')")
|
||||
public void getErpInternalOrderTask() {
|
||||
public CommonResult<Boolean> getErpInternalOrderTask() {
|
||||
erpInternalOrderService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP物料信息")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-material")
|
||||
@RequestMapping("/base/erp-material")
|
||||
@Validated
|
||||
public class ErpMaterialController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpMaterialController {
|
||||
@PostMapping("/getErpMaterialTask")
|
||||
@Operation(summary = "定时获得erp更新物料")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-material:create')")
|
||||
public void getErpMaterialTask() {
|
||||
public CommonResult<Boolean> getErpMaterialTask() {
|
||||
erpMaterialService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP工艺路线")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-process")
|
||||
@RequestMapping("/base/erp-process")
|
||||
@Validated
|
||||
public class ErpProcessController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpProcessController {
|
||||
@PostMapping("/getErpProcessTask")
|
||||
@Operation(summary = "定时获得erp更新工艺路线")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-process:create')")
|
||||
public void getErpProcessTask() {
|
||||
public CommonResult<Boolean> getErpProcessTask() {
|
||||
erpProcessService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP工艺路线明细")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-process-detail")
|
||||
@RequestMapping("/base/erp-process-detail")
|
||||
@Validated
|
||||
public class ErpProcessDetailController {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP生产订单")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-productive-order")
|
||||
@RequestMapping("/base/erp-productive-order")
|
||||
@Validated
|
||||
public class ErpProductiveOrderController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpProductiveOrderController {
|
||||
@PostMapping("/getErpProductiveOrderTask")
|
||||
@Operation(summary = "定时获得erp更新生产订单")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-order:create')")
|
||||
public void getErpProductiveOrderTask() {
|
||||
public CommonResult<Boolean> getErpProductiveOrderTask() {
|
||||
erpProductiveOrderService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP生产版本")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-productive-version")
|
||||
@RequestMapping("/base/erp-productive-version")
|
||||
@Validated
|
||||
public class ErpProductiveVersionController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpProductiveVersionController {
|
||||
@PostMapping("/getErpProductiveVersionTask")
|
||||
@Operation(summary = "定时获得erp更新生产版本")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:create')")
|
||||
public void getErpProductiveVersionTask() {
|
||||
public CommonResult<Boolean> getErpProductiveVersionTask() {
|
||||
erpProductiveVersionService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP采购组织")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-purchase-organization")
|
||||
@RequestMapping("/base/erp-purchase-organization")
|
||||
@Validated
|
||||
public class ErpPurchaseOrganizationController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpPurchaseOrganizationController {
|
||||
@PostMapping("/getErpPurchaseOrganizationTask")
|
||||
@Operation(summary = "定时获得erp更新采购组织")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-purchase-organization:create')")
|
||||
public void getErpPurchaseOrganizationTask() {
|
||||
public CommonResult<Boolean> getErpPurchaseOrganizationTask() {
|
||||
erpPurchaseOrganizationService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP销售组织")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-sales-organization")
|
||||
@RequestMapping("/base/erp-sales-organization")
|
||||
@Validated
|
||||
public class ErpSalesOrganizationController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpSalesOrganizationController {
|
||||
@PostMapping("/getErpSalesOrganizationTask")
|
||||
@Operation(summary = "定时获得erp更新销售组织")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-sales-organization:create')")
|
||||
public void getErpSalesOrganizationTask() {
|
||||
public CommonResult<Boolean> getErpSalesOrganizationTask() {
|
||||
erpSalesOrganizationService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - ERP库位")
|
||||
@RestController
|
||||
@RequestMapping("/sply/erp-warehouse")
|
||||
@RequestMapping("/base/erp-warehouse")
|
||||
@Validated
|
||||
public class ErpWarehouseController {
|
||||
|
||||
@@ -104,8 +104,9 @@ public class ErpWarehouseController {
|
||||
@PostMapping("/getErpWarehouseTask")
|
||||
@Operation(summary = "定时获得erp更新库位")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-warehouse:create')")
|
||||
public void getErpWarehouseTask() {
|
||||
public CommonResult<Boolean> getErpWarehouseTask() {
|
||||
erpWarehouseService.callErpRfcInterface();
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class ErpBomDetailPageReqVO extends PageParam {
|
||||
private String childMaterialNumber;
|
||||
|
||||
@Schema(description = "子项物料描述")
|
||||
private BigDecimal childMaterialDescription;
|
||||
private String childMaterialDescription;
|
||||
|
||||
@Schema(description = "子项类别")
|
||||
private String category;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ErpBomDetailRespVO {
|
||||
|
||||
@Schema(description = "子项物料描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子项物料描述")
|
||||
private BigDecimal childMaterialDescription;
|
||||
private String childMaterialDescription;
|
||||
|
||||
@Schema(description = "子项类别", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("子项类别")
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ErpBomDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "子项物料描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "子项物料描述不能为空")
|
||||
private BigDecimal childMaterialDescription;
|
||||
private String childMaterialDescription;
|
||||
|
||||
@Schema(description = "子项类别", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "子项类别不能为空")
|
||||
|
||||
@@ -60,8 +60,4 @@ public class ErpBomDO {
|
||||
*/
|
||||
@TableField("UNT")
|
||||
private String unit;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private List<ErpBomDetailDO> erpBomDetailDOList;
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class ErpBomDetailDO {
|
||||
* 子项物料描述
|
||||
*/
|
||||
@TableField("CHD_MTRL_DSP")
|
||||
private BigDecimal childMaterialDescription;
|
||||
private String childMaterialDescription;
|
||||
/**
|
||||
* 子项类别
|
||||
*/
|
||||
|
||||
@@ -26,4 +26,5 @@ public interface ErpBomMapper extends BaseMapperX<ErpBomDO> {
|
||||
.orderByDesc(ErpBomDO::getId));
|
||||
}
|
||||
|
||||
Long insertGetId(ErpBomDO aDo);
|
||||
}
|
||||
@@ -61,4 +61,5 @@ public interface ErpBomDetailService {
|
||||
*/
|
||||
PageResult<ErpBomDetailDO> getErpBomDetailPage(ErpBomDetailPageReqVO pageReqVO);
|
||||
|
||||
void saveOrUpdateErpBomDetail(List<ErpBomDetailDO> updateReqVO);
|
||||
}
|
||||
@@ -1,18 +1,30 @@
|
||||
package com.zt.plat.module.erp.service.erp;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.common.conf.ErpConfig;
|
||||
import com.zt.plat.module.erp.common.enums.OftenEnum;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBomDetailPageReqVO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBomDetailRespVO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBomDetailSaveReqVO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpAssetDO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpBomDO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpBomDetailDO;
|
||||
import com.zt.plat.module.erp.dal.mysql.erp.ErpBomDetailMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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_DETAIL_NOT_EXISTS;
|
||||
@@ -29,6 +41,9 @@ public class ErpBomDetailServiceImpl implements ErpBomDetailService {
|
||||
@Resource
|
||||
private ErpBomDetailMapper erpBomDetailMapper;
|
||||
|
||||
@Resource
|
||||
private ErpConfig erpConfig;
|
||||
|
||||
@Override
|
||||
public ErpBomDetailRespVO createErpBomDetail(ErpBomDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@@ -56,12 +71,12 @@ public class ErpBomDetailServiceImpl implements ErpBomDetailService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteErpBomDetailListByIds(List<Long> ids) {
|
||||
public void deleteErpBomDetailListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateErpBomDetailExists(ids);
|
||||
// 删除
|
||||
erpBomDetailMapper.deleteByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateErpBomDetailExists(List<Long> ids) {
|
||||
List<ErpBomDetailDO> list = erpBomDetailMapper.selectByIds(ids);
|
||||
@@ -86,4 +101,93 @@ public class ErpBomDetailServiceImpl implements ErpBomDetailService {
|
||||
return erpBomDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveOrUpdateErpBomDetail(List<ErpBomDetailDO> updateReqVOS) {
|
||||
String key = "erpMap" + OftenEnum.FuncnrEnum.BOM清单.getFuncnr() + "Detail";
|
||||
// 1. 处理公司数据,区分新增和更新
|
||||
ProcessingResult result = processData(updateReqVOS, key);
|
||||
|
||||
// 2. 批量保存数据
|
||||
saveData(result);
|
||||
}
|
||||
|
||||
private ProcessingResult processData(List<ErpBomDetailDO> updateReqVOS, String key) {
|
||||
if (erpConfig.getRedisCacheMap(key).isEmpty()) {
|
||||
initializeMap(key);
|
||||
}
|
||||
List<ErpBomDetailDO> toUpdate = new ArrayList<>();
|
||||
List<ErpBomDetailDO> toInsert = new ArrayList<>();
|
||||
|
||||
List<String> dataArrayNumbers = new ArrayList<>();
|
||||
Map<String, Long> existingNumbers = erpConfig.getRedisCacheMap(key);
|
||||
for (ErpBomDetailDO updateReqVO : updateReqVOS) {
|
||||
String mapKey = updateReqVO.getBomId() + "-" + updateReqVO.getErpBomId();
|
||||
if (updateReqVO.getId() == null) {
|
||||
toInsert.add(updateReqVO);
|
||||
} else {
|
||||
toUpdate.add(updateReqVO);
|
||||
}
|
||||
dataArrayNumbers.add(mapKey);
|
||||
}
|
||||
|
||||
Map<String, Long> deleteNumbers = new HashMap<>();
|
||||
for (Map.Entry<String, Long> entry : existingNumbers.entrySet()) {
|
||||
if (!dataArrayNumbers.contains(entry.getKey())) {
|
||||
deleteNumbers.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
return new ProcessingResult(toUpdate, toInsert, deleteNumbers, key);
|
||||
}
|
||||
|
||||
private void saveData(ProcessingResult result) {
|
||||
// 批量新增和更新
|
||||
if (!result.toInsert.isEmpty()) {
|
||||
erpBomDetailMapper.insertBatch(result.toInsert);
|
||||
// 批量查询刚插入数据的id,提升效率
|
||||
List<ErpBomDetailDO> insertedRecords = erpBomDetailMapper.selectList(
|
||||
new LambdaQueryWrapperX<ErpBomDetailDO>()
|
||||
.in(ErpBomDetailDO::getBomId, result.toInsert.stream().map(ErpBomDetailDO::getBomId).distinct().collect(Collectors.toList()))
|
||||
.in(ErpBomDetailDO::getErpBomId, result.toInsert.stream().map(ErpBomDetailDO::getErpBomId).distinct().collect(Collectors.toList()))
|
||||
);
|
||||
Map<String, Long> numberIdMap = insertedRecords.stream()
|
||||
.collect(Collectors.toMap(asset -> asset.getBomId() + "-" + asset.getErpBomId(), ErpBomDetailDO::getId));
|
||||
erpConfig.addRedisCacheMap(result.key, numberIdMap);
|
||||
}
|
||||
if (!result.toUpdate.isEmpty()) {
|
||||
erpBomDetailMapper.updateBatch(result.toUpdate);
|
||||
}
|
||||
if (!result.deleteNumbers.isEmpty()) {
|
||||
// 使用流式处理和批处理优化删除逻辑
|
||||
List<Long> idsToDelete = new ArrayList<>(result.deleteNumbers.values());
|
||||
if (!idsToDelete.isEmpty()) {
|
||||
erpBomDetailMapper.deleteByIds(idsToDelete);
|
||||
}
|
||||
erpConfig.deleteRedisCacheMap(result.key, new ArrayList<>(result.deleteNumbers.keySet()));
|
||||
}
|
||||
}
|
||||
|
||||
private static class ProcessingResult {
|
||||
private final List<ErpBomDetailDO> toUpdate;
|
||||
private final List<ErpBomDetailDO> toInsert;
|
||||
private final Map<String, Long> deleteNumbers;
|
||||
private final String key;
|
||||
|
||||
public ProcessingResult(List<ErpBomDetailDO> toUpdate, List<ErpBomDetailDO> toInsert, Map<String, Long> deleteNumbers, String key) {
|
||||
this.toUpdate = toUpdate;
|
||||
this.toInsert = toInsert;
|
||||
this.deleteNumbers = deleteNumbers;
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeMap(String key) {
|
||||
List<ErpBomDetailDO> assets = erpBomDetailMapper.selectList(new LambdaQueryWrapperX<ErpBomDetailDO>());
|
||||
Map<String, Long> existingNumbers = new HashMap<>();
|
||||
for (ErpBomDetailDO asset : assets) {
|
||||
String mapKey = asset.getBomId() + "-" + asset.getErpBomId();
|
||||
existingNumbers.put(mapKey, asset.getId());
|
||||
}
|
||||
erpConfig.addRedisCacheMap(key, existingNumbers);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.zt.plat.module.erp.service.erp;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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.api.ErpExternalApi;
|
||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||
import com.zt.plat.module.erp.common.conf.ErpConfig;
|
||||
@@ -10,6 +11,7 @@ import com.zt.plat.module.erp.common.enums.OftenEnum;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBomPageReqVO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBomRespVO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBomSaveReqVO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpAssetDO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpBomDO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpBomDO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpBomDetailDO;
|
||||
@@ -48,6 +50,9 @@ public class ErpBomServiceImpl implements ErpBomService {
|
||||
@Resource
|
||||
public ErpExternalApi erpExternalApi;
|
||||
|
||||
@Resource
|
||||
private ErpBomDetailServiceImpl bomDetailService;
|
||||
|
||||
@Override
|
||||
public ErpBomRespVO createErpBom(ErpBomSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@@ -112,13 +117,18 @@ public class ErpBomServiceImpl implements ErpBomService {
|
||||
try {
|
||||
OftenEnum.FuncnrEnum funcnrEnum = OftenEnum.FuncnrEnum.BOM清单;
|
||||
String funcnr = funcnrEnum.getFuncnr();
|
||||
String key = "erpMap" + funcnr;
|
||||
if (erpConfig.getRedisCacheMap(key).isEmpty()) {
|
||||
initializeMap(key);
|
||||
}
|
||||
Map<String, Object> req = new HashMap<>();
|
||||
JSONArray dataArrayALL = new JSONArray();
|
||||
List<String> redisCache = erpConfig.getRedisCache(OftenEnum.FuncnrEnum.工厂信息.getFuncnr());
|
||||
String factKey = "erpMap" + OftenEnum.FuncnrEnum.工厂信息.getFuncnr();
|
||||
Map<String, Long> redisCache = erpConfig.getRedisCacheMap(factKey);
|
||||
if (CollUtil.isEmpty(redisCache)) {
|
||||
return;
|
||||
throw exception(ERP_BOM_NOT_EXISTS);
|
||||
}
|
||||
for (String factoryNumber : redisCache) {
|
||||
for (String factoryNumber : redisCache.keySet()) {
|
||||
req.put("WERKS", factoryNumber);
|
||||
// 1. 调用ERP接口获取数据
|
||||
JSONArray dataArray = erpConfig.fetchDataFromERP(funcnr, req);
|
||||
@@ -143,75 +153,91 @@ public class ErpBomServiceImpl implements ErpBomService {
|
||||
/**
|
||||
* 处理数据,区分新增和更新
|
||||
*/
|
||||
private ProcessingResult processData(JSONArray dataArray, OftenEnum.FuncnrEnum funcnr) {
|
||||
String key = "erp" + funcnr.getFuncnr();
|
||||
private ProcessingResult processData(JSONArray dataArray, OftenEnum.FuncnrEnum funcnrEnum) {
|
||||
String key = "erpMap" + funcnrEnum.getFuncnr();
|
||||
Map<String, Long> numbers = erpConfig.getRedisCacheMap(key);
|
||||
Map<String, Long> numberDetails = erpConfig.getRedisCacheMap(key+"details");
|
||||
List<ErpBomDO> toUpdate = new ArrayList<>();
|
||||
List<ErpBomDO> toInsert = new ArrayList<>();
|
||||
|
||||
List<String> allnumbers = new ArrayList<>();
|
||||
List<ErpBomDetailDO> erpBomDetailDOList = new ArrayList<>();
|
||||
Map<String, Long> addnumbers = new HashMap<>();
|
||||
List<String> dataArrayNumbers = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < dataArray.size(); i++) {
|
||||
JSONObject dataJson = dataArray.getJSONObject(i);
|
||||
if (dataJson != null) {
|
||||
ErpBomDO DO = new ErpBomDO();
|
||||
DO.setFactoryNumber(dataJson.getString("WERKS"));
|
||||
DO.setUpMaterial(dataJson.getString("MATNR"));
|
||||
DO.setUseItem(dataJson.getString("STLAL"));
|
||||
// DO.set(dataJson.getString("STLAN"));数据库无这个字段
|
||||
DO.setMaterialDescription(dataJson.getString("MAKTX"));
|
||||
DO.setQuantity(dataJson.getBigDecimal("BMENG"));
|
||||
DO.setUnit(dataJson.getString("BMEIN"));
|
||||
String number =DO.getUpMaterial()+"-"+DO.getUseItem()+"-"+DO.getFactoryNumber();
|
||||
if (numbers.get(number)!=null) {
|
||||
ErpBomDO bomDO = new ErpBomDO();
|
||||
bomDO.setFactoryNumber(dataJson.getString("WERKS"));
|
||||
bomDO.setUpMaterial(dataJson.getString("MATNR"));
|
||||
bomDO.setUseItem(dataJson.getString("STLAL"));
|
||||
bomDO.setMaterialDescription(dataJson.getString("MAKTX"));
|
||||
bomDO.setQuantity(dataJson.getBigDecimal("BMENG"));
|
||||
bomDO.setUnit(dataJson.getString("BMEIN"));
|
||||
|
||||
String number = bomDO.getFactoryNumber() + "-" + bomDO.getUpMaterial() + "-" + bomDO.getUseItem();
|
||||
dataArrayNumbers.add(number);
|
||||
|
||||
if (numbers.containsKey(number)) {
|
||||
// 更新
|
||||
DO.setId(numbers.get(number));
|
||||
toUpdate.add(DO);
|
||||
bomDO.setId(numbers.get(number));
|
||||
toUpdate.add(bomDO);
|
||||
} else {
|
||||
// 新增
|
||||
toInsert.add(DO);
|
||||
erpBomMapper.insert(bomDO);
|
||||
addnumbers.put(number, bomDO.getId());
|
||||
}
|
||||
|
||||
JSONArray dataJsonItem = dataJson.getJSONArray("ITEM");
|
||||
if (dataJsonItem != null) {
|
||||
List<ErpBomDetailDO> erpBomDetailDOList =new ArrayList<>();
|
||||
for (int j = 0; j < dataJsonItem.size(); j++){
|
||||
JSONObject dataJsonItemJson = dataJsonItem.getJSONObject(j);
|
||||
if (dataJsonItem != null && !dataJsonItem.isEmpty()) {
|
||||
for (int j = 0; j < dataJsonItem.size(); j++) {
|
||||
JSONObject itemJson = dataJsonItem.getJSONObject(j);
|
||||
ErpBomDetailDO detailDO = new ErpBomDetailDO();
|
||||
String numberDel = number+dataJsonItemJson.getString("STVKN");
|
||||
if (numberDetails.get( numberDel) != null){
|
||||
detailDO.setId(Long.valueOf(numberDetails.get( numberDel)));
|
||||
}
|
||||
detailDO.setBomId(String.valueOf(numbers.get(number)));
|
||||
detailDO.setErpBomId(dataJsonItemJson.getString("STVKN"));
|
||||
detailDO.setErpBomId(dataJsonItemJson.getString("IDNRK"));
|
||||
detailDO.setErpBomId(dataJsonItemJson.getString("OJTXP"));
|
||||
detailDO.setErpBomId(dataJsonItemJson.getString("POSTP"));
|
||||
detailDO.setErpBomId(dataJsonItemJson.getString("MENGE"));
|
||||
detailDO.setErpBomId(dataJsonItemJson.getString("MEINS"));
|
||||
detailDO.setErpBomId(dataJsonItemJson.getString("WLCAT"));
|
||||
detailDO.setBomId(String.valueOf(bomDO.getId()));
|
||||
detailDO.setErpBomId(itemJson.getString("STVKN"));
|
||||
detailDO.setChildMaterialNumber(itemJson.getString("IDNRK"));
|
||||
detailDO.setChildMaterialDescription(itemJson.getString("OJTXP"));
|
||||
detailDO.setCategory(itemJson.getString("POSTP"));
|
||||
detailDO.setQuantity(itemJson.getBigDecimal("MENGE"));
|
||||
detailDO.setUnit(itemJson.getString("MEINS"));
|
||||
detailDO.setIdentificationType(itemJson.getString("WLCAT"));
|
||||
erpBomDetailDOList.add(detailDO);
|
||||
}
|
||||
DO.setErpBomDetailDOList(erpBomDetailDOList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ProcessingResult(toUpdate, toInsert, key, allnumbers);
|
||||
// 识别需要删除的数据
|
||||
List<String> deleteNumbers = new ArrayList<>();
|
||||
for (String number : numbers.keySet()) {
|
||||
if (!dataArrayNumbers.contains(number)) {
|
||||
deleteNumbers.add(number);
|
||||
}
|
||||
}
|
||||
|
||||
return new ProcessingResult(toUpdate, key, addnumbers, deleteNumbers, erpBomDetailDOList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存数据
|
||||
*/
|
||||
private void saveData(ProcessingResult result) {
|
||||
// 批量新增和更新
|
||||
if (!result.toInsert.isEmpty()) {
|
||||
erpBomMapper.insertBatch(result.toInsert);
|
||||
}
|
||||
// 批量更新
|
||||
if (!result.toUpdate.isEmpty()) {
|
||||
erpBomMapper.updateBatch(result.toUpdate);
|
||||
}
|
||||
erpConfig.updateRedisCache(result.key, result.allnumbers);
|
||||
|
||||
// 保存或更新BOM详情
|
||||
if (!result.erpBomDetailDOList.isEmpty()) {
|
||||
bomDetailService.saveOrUpdateErpBomDetail(result.erpBomDetailDOList);
|
||||
}
|
||||
|
||||
// 更新Redis缓存
|
||||
if (!result.addnumbers.isEmpty()) {
|
||||
erpConfig.addRedisCacheMap(result.key, result.addnumbers);
|
||||
}
|
||||
|
||||
if (!result.deleteNumbers.isEmpty()) {
|
||||
erpConfig.deleteRedisCacheMap(result.key, result.deleteNumbers);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,34 +245,46 @@ public class ErpBomServiceImpl implements ErpBomService {
|
||||
*/
|
||||
private static class ProcessingResult {
|
||||
private final List<ErpBomDO> toUpdate;
|
||||
private final List<ErpBomDO> toInsert;
|
||||
private final String key;
|
||||
private final List<String> allnumbers;
|
||||
private final Map<String, Long> addnumbers;
|
||||
private final List<String> deleteNumbers;
|
||||
private final List<ErpBomDetailDO> erpBomDetailDOList;
|
||||
|
||||
public ProcessingResult(List<ErpBomDO> toUpdate, List<ErpBomDO> toInsert, String key, List<String> allnumbers) {
|
||||
public ProcessingResult(List<ErpBomDO> toUpdate, String key, Map<String, Long> addnumbers,
|
||||
List<String> deleteNumbers, List<ErpBomDetailDO> erpBomDetailDOList) {
|
||||
this.toUpdate = toUpdate;
|
||||
this.toInsert = toInsert;
|
||||
this.key = key;
|
||||
this.allnumbers = allnumbers;
|
||||
this.addnumbers = addnumbers;
|
||||
this.deleteNumbers = deleteNumbers;
|
||||
this.erpBomDetailDOList = erpBomDetailDOList;
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeMap(String key) {
|
||||
List<ErpBomDO> bomList = erpBomMapper.selectList(new LambdaQueryWrapperX<ErpBomDO>());
|
||||
Map<String, Long> existingNumbers = new HashMap<>();
|
||||
for (ErpBomDO bom : bomList) {
|
||||
String mapKey = bom.getFactoryNumber() + "-" + bom.getUpMaterial() + "-" + bom.getUseItem();
|
||||
existingNumbers.put(mapKey, bom.getId());
|
||||
}
|
||||
erpConfig.addRedisCacheMap(key, existingNumbers);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void submitDataToErp() {
|
||||
ErpSubmitReqDTO reqDTO = new ErpSubmitReqDTO();
|
||||
reqDTO.setSrcsys("MOM");
|
||||
ErpSubmitReqDTO reqDTO = new ErpSubmitReqDTO();
|
||||
reqDTO.setFuncnr("061");
|
||||
reqDTO.setBskey("POTEST011");
|
||||
reqDTO.setUsrid("cuibin");
|
||||
reqDTO.setUsrnm("崔斌");
|
||||
|
||||
|
||||
Map<String, Object> req = new HashMap<>();
|
||||
|
||||
|
||||
Map<String, String> exte = new HashMap<>();
|
||||
exte.put("zzhth", "成品采购合同0406-1-xt");
|
||||
req.put("exte", exte);
|
||||
|
||||
|
||||
Map<String, Object> head = new HashMap<>();
|
||||
head.put("pur_group", "120");
|
||||
head.put("purch_org", "3017");
|
||||
@@ -258,7 +296,7 @@ public class ErpBomServiceImpl implements ErpBomService {
|
||||
head.put("doc_type", "PO01");
|
||||
head.put("zzhth", "成品采购合同0406-1-xt");
|
||||
req.put("head", head);
|
||||
|
||||
|
||||
List<Map<String, Object>> items = new ArrayList<>();
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
item.put("material", "000000000000226986");
|
||||
@@ -275,7 +313,7 @@ public class ErpBomServiceImpl implements ErpBomService {
|
||||
req.put("item", items);
|
||||
reqDTO.setReq(req);
|
||||
ResponseEntity<String> response = erpExternalApi.submitDataToErp(reqDTO);
|
||||
if (response.getStatusCode() == HttpStatus.OK){
|
||||
if (response.getStatusCode() == HttpStatus.OK) {
|
||||
log.info("ERP数据提交成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<insert id="insertGetId">
|
||||
|
||||
</insert>
|
||||
|
||||
<update id="updateBatch">
|
||||
<foreach collection="toUpdate" item="item" separator=";">
|
||||
UPDATE sply_erp_fact
|
||||
|
||||
Reference in New Issue
Block a user