Merge branch 'refs/heads/dev' into test
This commit is contained in:
@@ -2,12 +2,15 @@ package com.zt.plat.module.contractorder.api;
|
||||
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.contractorder.api.dto.ContractFormulaRespDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.PurchaseOrderWithDetailsDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO;
|
||||
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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
@@ -17,10 +20,15 @@ import java.util.List;
|
||||
public interface ContractApi {
|
||||
String PREFIX = ApiConstants.PREFIX + "/contract";
|
||||
|
||||
@GetMapping(PREFIX + "/formulas")
|
||||
@Operation(summary = "通过合同编号获取对应的结算条款数据")
|
||||
List<ContractFormulaRespDTO> getFormulas(@RequestParam("contractPaperNumber") String contractPaperNumber);
|
||||
@GetMapping(PREFIX + "/get/by-paper-number")
|
||||
@Operation(summary = "通过合同编号获取对应的合同信息")
|
||||
ContractRespDTO getContractByPaperNumber(@RequestParam("contractPaperNumber") String contractPaperNumber);
|
||||
|
||||
@GetMapping(PREFIX + "/updateOrderStatus")
|
||||
@Operation(summary = "更新订单状态")
|
||||
CommonResult<Boolean> updateOrderStatus(@RequestParam("orderId") Long orderId, @RequestParam("status") String status);
|
||||
|
||||
@PostMapping(PREFIX + "/order-by-order-no")
|
||||
@Operation(summary = "更新订单状态", description = "通过订单编号获取订单信息")
|
||||
CommonResult<List<PurchaseOrderWithDetailsDTO>> getOrderByOrderNo(@RequestBody List<String> orderNoS);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
package com.zt.plat.module.contractorder.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class PrchOrdDtlDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 采购订单主键
|
||||
*/
|
||||
|
||||
private Long ordId;
|
||||
/**
|
||||
* 行项目;推送ERP(必须)
|
||||
*/
|
||||
private Long lineNum;
|
||||
/**
|
||||
* 物料编码;推送ERP
|
||||
*/
|
||||
|
||||
private String mtrlNum;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
|
||||
private String mtrlName;
|
||||
/**
|
||||
* 收货工厂名称
|
||||
*/
|
||||
|
||||
private String rcvFactName;
|
||||
/**
|
||||
* 收货工厂编码;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String rcvFactNum;
|
||||
/**
|
||||
* 收货库位名称
|
||||
*/
|
||||
|
||||
private String rcvWrhName;
|
||||
/**
|
||||
* 收货库位编码;推送ERP
|
||||
*/
|
||||
|
||||
private String rcvWrhNum;
|
||||
/**
|
||||
* 暂估数量;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String qty;
|
||||
/**
|
||||
* 计量单位;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private BigDecimal unt;
|
||||
/**
|
||||
* 含税单价;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private BigDecimal inTaxUprc;
|
||||
/**
|
||||
* 价格单位;推送ERP
|
||||
*/
|
||||
|
||||
private BigDecimal prcUnt;
|
||||
/**
|
||||
* 税码(字典: PRCH_TAX);推送ERP
|
||||
*/
|
||||
|
||||
private BigDecimal taxNum;
|
||||
/**
|
||||
* 是否基于GR的发票校验;推送ERP
|
||||
*/
|
||||
|
||||
private String isGrInv;
|
||||
/**
|
||||
* 是否允许无限制收货;推送ERP
|
||||
*/
|
||||
|
||||
private String isUnlRcv;
|
||||
/**
|
||||
* 批次;推送ERP
|
||||
*/
|
||||
|
||||
private String bat;
|
||||
/**
|
||||
* 项目类别;推送ERP:委托加工L
|
||||
*/
|
||||
|
||||
private String prjCtgr;
|
||||
/**
|
||||
* 科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型,固定资产订单A,服务订单S-销售服务费K-成本中心F-订单
|
||||
*/
|
||||
|
||||
private String actsCtgr;
|
||||
/**
|
||||
* 物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传
|
||||
*/
|
||||
|
||||
private String mtrlCpntNum;
|
||||
/**
|
||||
* 物料组描述;推送ERP:联动订单类型,服务订单必传
|
||||
*/
|
||||
|
||||
private String mtrlCpntDsp;
|
||||
/**
|
||||
* 短文本
|
||||
*/
|
||||
|
||||
private String shrtTxt;
|
||||
/**
|
||||
* 退货标识X标识退货;推送ERP
|
||||
*/
|
||||
|
||||
private String isRlbkCgo;
|
||||
/**
|
||||
* 是否免费收货标识X;推送ERP
|
||||
*/
|
||||
|
||||
private String isFreeRcv;
|
||||
/**
|
||||
* 外部行项目号;推送ERP
|
||||
*/
|
||||
|
||||
private Long outLineNum;
|
||||
/**
|
||||
* 备注信息-需求单位;推送ERP
|
||||
*/
|
||||
|
||||
private String rmkUnt;
|
||||
/**
|
||||
* 备注信息-物料详细;推送ERP
|
||||
*/
|
||||
|
||||
private String rmkMtrl;
|
||||
/**
|
||||
* 交货起始日期;推送ERP
|
||||
*/
|
||||
|
||||
private LocalDateTime bgnDt;
|
||||
/**
|
||||
* 交货截止日期;推送ERP
|
||||
*/
|
||||
|
||||
private LocalDateTime ddlDt;
|
||||
/**
|
||||
* 已收货量
|
||||
*/
|
||||
|
||||
private BigDecimal lstQty;
|
||||
/**
|
||||
* 已移库量库;存针对该订单产生的移库量
|
||||
*/
|
||||
|
||||
private BigDecimal trfQty;
|
||||
/**
|
||||
* 小协议号
|
||||
*/
|
||||
|
||||
private String agrNum;
|
||||
/**
|
||||
* 移库工厂名称
|
||||
*/
|
||||
|
||||
private String trfFactName;
|
||||
/**
|
||||
* 移库工厂编码
|
||||
*/
|
||||
|
||||
private String trfFactNum;
|
||||
/**
|
||||
* 移库库位名称
|
||||
*/
|
||||
|
||||
private String trfWrhName;
|
||||
/**
|
||||
* 移库库位编码
|
||||
*/
|
||||
|
||||
private String trfWrhNum;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
private String rmk;
|
||||
/**
|
||||
* 原料湿重;推送ERP
|
||||
*/
|
||||
|
||||
private BigDecimal origWet;
|
||||
/**
|
||||
* 销售物料号;推送ERP:科目分配类别为S时必填
|
||||
*/
|
||||
|
||||
private String saleMtrlNum;
|
||||
/**
|
||||
* 统计型内部订单;推送ERP
|
||||
*/
|
||||
|
||||
private String inOrd;
|
||||
/**
|
||||
* 采购类别;推送ERP:0-生产性物资类1-项目投资类
|
||||
*/
|
||||
|
||||
private String prchCtgr;
|
||||
/**
|
||||
* 是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用
|
||||
*/
|
||||
|
||||
private String isEnb;
|
||||
/**
|
||||
* 科目分配详情;科目分配类别为K或P时使用(JSON)
|
||||
*/
|
||||
|
||||
private String actsCtgrDtl;
|
||||
/**
|
||||
* 委托加工详情;委托加工订单使用(JSON)
|
||||
*/
|
||||
|
||||
private String enttDtl;
|
||||
/**
|
||||
* 金属元素缩写
|
||||
*/
|
||||
|
||||
private String elemAbbr;
|
||||
/**
|
||||
* 金属元素名称
|
||||
*/
|
||||
|
||||
private String elemName;
|
||||
/**
|
||||
* 金属元素编码
|
||||
*/
|
||||
|
||||
private String elemCdg;
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.zt.plat.module.contractorder.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PurchaseOrderWithDetailsDTO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* ERP订单号
|
||||
*/
|
||||
private String orderSAPNumber;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String systemOrderNumber;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String cpName;
|
||||
/**
|
||||
* 公司编码;推送ERP(必须)
|
||||
*/
|
||||
private String companyNumber;
|
||||
/**
|
||||
* 客商编码;推送ERP(必须)
|
||||
*/
|
||||
private String supplierNumber;
|
||||
/**
|
||||
* 客商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
/**
|
||||
* 订单类型(字典:PRCH_ORD_TP);推送ERP(必须)
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 凭证日期;推送ERP(必须)
|
||||
*/
|
||||
private LocalDateTime voucherDate;
|
||||
/**
|
||||
* 采购组织编码;推送ERP(必须)
|
||||
*/
|
||||
private String purchaseOrganizationCustomsDeclaration;
|
||||
/**
|
||||
* 收货工厂名称
|
||||
*/
|
||||
private String receiveFactoryName;
|
||||
/**
|
||||
* 收货工厂编码;推送ERP(必须)
|
||||
*/
|
||||
private String receiveFactoryNumber;
|
||||
/**
|
||||
* 收货库位名称
|
||||
*/
|
||||
private String receiveWarehouseName;
|
||||
/**
|
||||
* 收货库位编码;推送ERP
|
||||
*/
|
||||
private String receiveWarehouseNumber;
|
||||
/**
|
||||
* 采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)
|
||||
*/
|
||||
private String purchaseGroup;
|
||||
/**
|
||||
* 货币码(字典:CUR);推送ERP(必须)
|
||||
*/
|
||||
private String currencyNumber;
|
||||
/**
|
||||
* 汇率;推送ERP
|
||||
*/
|
||||
private BigDecimal exchangeRate;
|
||||
/**
|
||||
* 合同纸质合同号;推送ERP(必须)
|
||||
*/
|
||||
private String paperContractNumber;
|
||||
/**
|
||||
* 小协议号;推送ERP
|
||||
*/
|
||||
private String agreementNumber;
|
||||
/**
|
||||
* 备注;推送ERP
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 代理方编码;推送ERP
|
||||
*/
|
||||
private String agentNumber;
|
||||
/**
|
||||
* 代理方名称
|
||||
*/
|
||||
private String agentName;
|
||||
/**
|
||||
* 订单编码
|
||||
*/
|
||||
private String orderNumber;
|
||||
/**
|
||||
* 系统合同编号
|
||||
*/
|
||||
private String contractNumber;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialNumber;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String materialName;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
/**
|
||||
* 小户头号
|
||||
*/
|
||||
private String tenantNumber;
|
||||
/**
|
||||
* ERP公司编号
|
||||
*/
|
||||
private String erpPurchaseCompanyNumber;
|
||||
/**
|
||||
* ERP公司名称
|
||||
*/
|
||||
private String erpPurchaseCompanyName;
|
||||
/**
|
||||
* ERP客商公司编码
|
||||
*/
|
||||
private String erpSalesCompanyNumber;
|
||||
/**
|
||||
* ERP客商公司名称
|
||||
*/
|
||||
private String erpSalesCompanyName;
|
||||
/**
|
||||
* 采购组织名称
|
||||
*/
|
||||
private String purchaseOrganizationName;
|
||||
/**
|
||||
* ERP状态(字典: ERP_REQ_STS)
|
||||
*/
|
||||
private String erpStatus;
|
||||
/**
|
||||
* 请求ERP失败原因
|
||||
*/
|
||||
private String cause;
|
||||
/**
|
||||
* 订单状态(字典:PRCH_ORD_STS)
|
||||
*/
|
||||
|
||||
private String status;
|
||||
/**
|
||||
* 采购组名称
|
||||
*/
|
||||
private String purchaseGroupName;
|
||||
|
||||
/**
|
||||
* 流程实例编号
|
||||
*/
|
||||
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 流程当前任务节点id
|
||||
*/
|
||||
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
|
||||
private String reviewOpinion;
|
||||
|
||||
/**
|
||||
* 是否需要审批
|
||||
*/
|
||||
private int isPush;
|
||||
/**
|
||||
* 物料类型
|
||||
*/
|
||||
private String mtrlTp;
|
||||
|
||||
private List<PrchOrdDtlDTO> orderDetails;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zt.plat.module.contractorder.api.dto;
|
||||
package com.zt.plat.module.contractorder.api.dto.contract;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -7,7 +7,7 @@ import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "RPC 服务 - 基础系数配置 Response DTO")
|
||||
@Data
|
||||
public class ContractCoefficientRespDTO {
|
||||
public class CoefficientRespDTO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
@@ -0,0 +1,238 @@
|
||||
package com.zt.plat.module.contractorder.api.dto.contract;
|
||||
|
||||
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
|
||||
public class ContractRespDTO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模板实例主键")
|
||||
private Long instanceId;
|
||||
|
||||
@Schema(description = "系统合同编号;自动生成,校验唯一")
|
||||
private String systemContractNumber;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "合同名称;与ERP(HTMC)对应,校验唯一")
|
||||
private String contractName;
|
||||
|
||||
@Schema(description = "合同编号;与ERP(HTBH)对应,校验唯一")
|
||||
private String contractPaperNumber;
|
||||
|
||||
@Schema(description = "是否虚拟合同;与ERP(SFXNHT)对应")
|
||||
private String contractVirtual;
|
||||
|
||||
@Schema(description = "是否先款后货")
|
||||
private String hasPayable;
|
||||
|
||||
@Schema(description = "收支性质;与ERP(SZXZ)对应")
|
||||
private String direction;
|
||||
|
||||
@Schema(description = "合同类型")
|
||||
private String contractType;
|
||||
|
||||
@Schema(description = "签署日期;与ERP(HTQDRQ)对应")
|
||||
private LocalDateTime signDate;
|
||||
|
||||
@Schema(description = "开始日期;与ERP(HTQSRQ)对应")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@Schema(description = "结束日期;与ERP(HTZZRQ)对应")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
@Schema(description = "签署地")
|
||||
private String signPlace;
|
||||
|
||||
@Schema(description = "甲方公司编号;如果是采购合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是销售合同,手动选择,且与ERP(WLDWBH)对应。")
|
||||
private String purchaseCompanyNumber;
|
||||
|
||||
@Schema(description = "甲方公司名称")
|
||||
private String purchaseCompanyName;
|
||||
|
||||
@Schema(description = "甲方地址")
|
||||
private String purchaseAddress;
|
||||
|
||||
@Schema(description = "甲方法定代表人")
|
||||
private String purchaseLeader;
|
||||
|
||||
@Schema(description = "乙方公司编号;如果是销售合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是采购合同,手动选择,且与ERP(WLDWBH)对应。")
|
||||
private String salesCompanyNumber;
|
||||
|
||||
@Schema(description = "乙方公司名称")
|
||||
private String salesCompanyName;
|
||||
|
||||
@Schema(description = "乙方地址")
|
||||
private String salesAddress;
|
||||
|
||||
@Schema(description = "乙方企业负责人")
|
||||
private String salesPurchaseLeader;
|
||||
|
||||
@Schema(description = "币种;与ERP(BZBH)对应")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "原币金额;与ERP(HTYBZJE)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
|
||||
private BigDecimal cooAmount;
|
||||
|
||||
@Schema(description = "本币金额;与ERP(HTBWBZJE)对应")
|
||||
private BigDecimal basicAmount;
|
||||
|
||||
@Schema(description = "是否有履约保证金;为是,则保证金必填。")
|
||||
private String hasDeposit;
|
||||
|
||||
@Schema(description = "原币履约保证金;与ERP(LYBZJBGQYB)对应,币种不是人民币时,显示并手动填写,如果是人民币,隐藏且等于本币金额")
|
||||
private BigDecimal cooAmountDeposit;
|
||||
|
||||
@Schema(description = "本币履约保证金;与ERP(LYBZJBGQBWB)对应")
|
||||
private BigDecimal basicAmountDeposit;
|
||||
|
||||
@Schema(description = "是否有预付款;与ERP(SFYYFK)对应")
|
||||
private String hasPrepayment;
|
||||
|
||||
@Schema(description = "预付款比例;与ERP(YFKBL)对应")
|
||||
private BigDecimal prepaymentRatio;
|
||||
|
||||
@Schema(description = "预付款金额;与ERP(YFKJE)对应")
|
||||
private BigDecimal prepaymentAmount;
|
||||
|
||||
@Schema(description = "是否有质保金;与ERP(SFHZBJ)对应")
|
||||
private String hasQualityAmount;
|
||||
|
||||
@Schema(description = "质保金比例;与ERP(ZBJBL)对应")
|
||||
private BigDecimal qualityRatio;
|
||||
|
||||
@Schema(description = "质保金金额;与ERP(BZJJE)对应")
|
||||
private BigDecimal qualityAmount;
|
||||
|
||||
@Schema(description = "补充协议类型;变更协议/增加条款")
|
||||
private String replenishAgreementType;
|
||||
|
||||
@Schema(description = "备注;与ERP(BZXX)对应")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "施工类型编号;与ERP(HTLXBH)对应,拓展信息")
|
||||
private String constructionTypeNumber;
|
||||
|
||||
@Schema(description = "施工类型名称;与ERP(HTLXMC)对应,拓展信息")
|
||||
private String constructionTypeName;
|
||||
|
||||
@Schema(description = "代理方;与ERP(ZLIFNR)对应,拓展信息")
|
||||
private String agent;
|
||||
|
||||
@Schema(description = "类别;与ERP(HTLB)对应,拓展信息")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "原币金额-变更后;与ERP(BGHHTYBZJE)对应,拓展信息")
|
||||
private BigDecimal changeCooAmount;
|
||||
|
||||
@Schema(description = "本币金额-变更后;与ERP(BGHHTBWBZJE)对应,拓展信息")
|
||||
private BigDecimal changeBasicAmount;
|
||||
|
||||
@Schema(description = "原币履约保证金-变更后;与ERP(LYBZJBGHYB)对应,拓展信息")
|
||||
private BigDecimal changeCooAmountDeposit;
|
||||
|
||||
@Schema(description = "本币履约保证金-变更后;与ERP(LYBZJBGHBWB)对应,拓展信息")
|
||||
private BigDecimal changeBasicAmountDeposit;
|
||||
|
||||
@Schema(description = "是否框架合同;与ERP(SFKJHT)对应,拓展信息")
|
||||
private String isFramework;
|
||||
|
||||
@Schema(description = "境内/境外;与ERP(JNJW)对应,拓展信息")
|
||||
private String isDomestic;
|
||||
|
||||
@Schema(description = "建筑服务发生地;与ERP(JZFWFSD)对应,拓展信息,销售合同,且类型为SAP02COSR必填")
|
||||
private String architectureServicePlace;
|
||||
|
||||
@Schema(description = "达到收款条件金额;与ERP(DDSKJE)对应,拓展信息,销售合同,且类型为SAP02COSR必填")
|
||||
private BigDecimal payeeConditionAmount;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "步骤")
|
||||
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<DetailRespDTO> detail;
|
||||
|
||||
// 合同动态表单
|
||||
// private List<TemplateInstanceDataRespDTO> dynamicsFields;
|
||||
|
||||
// 合同动态条款
|
||||
// private List<TemplateInstanceItemRespDTO> dynamicsItems;
|
||||
|
||||
// 价款结算条款
|
||||
private List<FormulaRespDTO> formulas;
|
||||
|
||||
// 参数降级规则
|
||||
private List<DemoteRespDTO> demotes;
|
||||
|
||||
// 品位不计价规则
|
||||
private List<NotRespDTO> nots;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zt.plat.module.contractorder.api.dto;
|
||||
package com.zt.plat.module.contractorder.api.dto.contract;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -8,7 +8,7 @@ import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "RPC 服务 - 调整价配置 Response DTO")
|
||||
@Data
|
||||
public class ContractDeductRespDTO {
|
||||
public class DeductRespDTO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.contractorder.api.dto.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 DemoteRespDTO {
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zt.plat.module.contractorder.api.dto.contract;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 合同明细 Response VO")
|
||||
@Data
|
||||
public class DetailRespDTO {
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "计量单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "含税单价")
|
||||
private BigDecimal inTaxUnitPrice;
|
||||
|
||||
@Schema(description = "金属元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
@Schema(description = "金属元素名称")
|
||||
private String elementName;
|
||||
|
||||
@Schema(description = "金属元素编码")
|
||||
private String elementNumber;
|
||||
|
||||
// 交货计划
|
||||
private List<PlanRespDTO> plans;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zt.plat.module.contractorder.api.dto;
|
||||
package com.zt.plat.module.contractorder.api.dto.contract;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -7,7 +7,7 @@ import java.util.List;
|
||||
|
||||
@Schema(description = "RPC 服务 - 价款结算条款 Response DTO")
|
||||
@Data
|
||||
public class ContractFormulaRespDTO {
|
||||
public class FormulaRespDTO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
@@ -46,11 +46,11 @@ public class ContractFormulaRespDTO {
|
||||
private String settlementType;
|
||||
|
||||
// 基础系数配置
|
||||
private List<ContractCoefficientRespDTO> coefficients;
|
||||
private List<CoefficientRespDTO> coefficients;
|
||||
// 品位等级价配置
|
||||
private List<ContractGradeRespDTO> grades;
|
||||
private List<GradeRespDTO> grades;
|
||||
// 调整价配置
|
||||
private List<ContractDeductRespDTO> deducts;
|
||||
private List<DeductRespDTO> deducts;
|
||||
// 市场价配置
|
||||
private List<ContractPriceRespDTO> prices;
|
||||
private List<PriceRespDTO> prices;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zt.plat.module.contractorder.api.dto;
|
||||
package com.zt.plat.module.contractorder.api.dto.contract;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -8,7 +8,7 @@ import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "RPC 服务 - 品位等级价配置 Response DTO")
|
||||
@Data
|
||||
public class ContractGradeRespDTO {
|
||||
public class GradeRespDTO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.contractorder.api.dto.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 NotRespDTO {
|
||||
|
||||
@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 = "下限")
|
||||
private BigDecimal gradeDown;
|
||||
|
||||
@Schema(description = "区间方式(字典:STLM_RNG_WY)")
|
||||
private String rangeWay;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialNumber;
|
||||
|
||||
@Schema(description = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
@Schema(description = "合同编码")
|
||||
private String contractPaperNumber;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zt.plat.module.contractorder.api.dto.contract;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 交货计划 Response VO")
|
||||
@Data
|
||||
public class PlanRespDTO {
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "交货年份")
|
||||
private Long contractDeliveryYear;
|
||||
|
||||
@Schema(description = "交货月份")
|
||||
private Long contractPlanDeliveryMonth;
|
||||
|
||||
@Schema(description = "计划交货数量")
|
||||
private BigDecimal contractPlanDeliveryQuantity;
|
||||
|
||||
@Schema(description = "交货开始日期")
|
||||
private String contractDeliveryStartDate;
|
||||
|
||||
@Schema(description = "交货结束日期")
|
||||
private String contractDeliveryEndDate;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zt.plat.module.contractorder.api.dto;
|
||||
package com.zt.plat.module.contractorder.api.dto.contract;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -8,7 +8,7 @@ import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "RPC 服务 - 市场价配置 Response DTO")
|
||||
@Data
|
||||
public class ContractPriceRespDTO {
|
||||
public class PriceRespDTO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
@@ -5,38 +5,31 @@ package com.zt.plat.module.contractorder.enums.contract;
|
||||
*/
|
||||
public enum DictEnum {
|
||||
|
||||
/** 提交ERP合同状态 */
|
||||
SUBMIT_ERP_CTRT_STS_EF("正在执行","EF","其它所有状态"),
|
||||
SUBMIT_ERP_CTRT_STS_BFZT("部分暂停","BFZT",null),
|
||||
SUBMIT_ERP_CTRT_STS_QBZT("全部暂停","QBZT",null),
|
||||
SUBMIT_ERP_CTRT_STS_HHZZ("合同中止","HHZZ",null),
|
||||
SUBMIT_ERP_CTRT_STS_CA("作废","CA","对应合同中的“已作废”"),
|
||||
SUBMIT_ERP_CTRT_STS_HTZZ("合同终止","HTZZ",null),
|
||||
SUBMIT_ERP_CTRT_STS_ZXWB("执行完毕","ZXWB","对应合同中的“已完结”"),
|
||||
/** ERP收支方向 */
|
||||
// 支出
|
||||
ERP_RCV_DLVY_EXPENSES("支出","2","对应采购"),
|
||||
// 收入
|
||||
ERP_RCV_DLVY_INCOME("收入","1","对应销售"),
|
||||
/** ERP是否 */
|
||||
// 是
|
||||
ERP_CTRT_YN_YES("是","1",null),
|
||||
// 否
|
||||
ERP_CTRT_YN_NO("否","0",null),
|
||||
/** 合同状态 */
|
||||
// 草稿
|
||||
BSE_CTRT_STS_DRAFT("草稿","DRAFT","可以删除"),
|
||||
// 正在审核
|
||||
BSE_CTRT_STS_UNDER_REVIEW("正在审核","UNDER_REVIEW","不允许任何操作"),
|
||||
// 已驳回
|
||||
BSE_CTRT_STS_REJECTED("已驳回","REJECTED","可以删除"),
|
||||
// 待推送
|
||||
BSE_CTRT_STS_WAIT_PUSH("待推送","WAIT_PUSH",null),
|
||||
// 推送失败
|
||||
BSE_CTRT_STS_PUSH_ERROR("推送失败","PUSH_ERROR",null),
|
||||
// 执行中
|
||||
BSE_CTRT_STS_IN_PROGRESS("执行中","IN_PROGRESS","可以终止、归档"),
|
||||
// 已删除
|
||||
BSE_CTRT_STS_DELETED("已删除","DELETED","不允许任何操作"),
|
||||
// 已归档
|
||||
BSE_CTRT_STS_ARCHIVED("已归档","ARCHIVED","不允许任何操作"),
|
||||
// 已完结
|
||||
BSE_CTRT_STS_TERMINATED("已完结","TERMINATED","只允许归档"),
|
||||
// 待审核
|
||||
BSE_CTRT_STS_WAIT_AUDIT("待审核","WAIT_AUDIT",null),
|
||||
// 已作废
|
||||
BSE_CTRT_STS_VOID("已作废","VOID",null);
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.zt.plat.module.contractorder.api;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.contractorder.api.dto.ContractFormulaRespDTO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.contractorder.api.dto.PrchOrdDtlDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.PurchaseOrderWithDetailsDTO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderDetailsRespVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderWithDetailsVO;
|
||||
import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO;
|
||||
import com.zt.plat.module.contractorder.service.contract.ContractService;
|
||||
import com.zt.plat.module.contractorder.service.purchaseorder.PurchaseOrderService;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -9,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
@@ -24,7 +30,7 @@ public class ContractApiImpl implements ContractApi {
|
||||
private PurchaseOrderService purchaseOrderService;
|
||||
|
||||
@Override
|
||||
public List<ContractFormulaRespDTO> getFormulas(String contractPaperNumber) {
|
||||
public ContractRespDTO getContractByPaperNumber(String contractPaperNumber) {
|
||||
return contractService.getFormulasByPaperNumber(contractPaperNumber);
|
||||
}
|
||||
|
||||
@@ -32,4 +38,23 @@ public class ContractApiImpl implements ContractApi {
|
||||
public CommonResult<Boolean> updateOrderStatus(Long orderId, String status) {
|
||||
return success(purchaseOrderService.updateOrderStatus(orderId, status));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<PurchaseOrderWithDetailsDTO>> getOrderByOrderNo(List<String> orderNoS) {
|
||||
List<PurchaseOrderWithDetailsDTO> purchaseOrderWithDetailsDTOS = new ArrayList<>();
|
||||
List<PurchaseOrderDetailsRespVO> purchaseOrderWithDetailsVOS = purchaseOrderService.getOrderByOrderNo(orderNoS);
|
||||
purchaseOrderWithDetailsVOS.forEach(purchaseOrderWithDetailsVO -> {
|
||||
if (purchaseOrderWithDetailsVO!= null) {
|
||||
PurchaseOrderWithDetailsDTO purchaseOrderWithDetailsDTO = BeanUtils.toBean(purchaseOrderWithDetailsVO,
|
||||
PurchaseOrderWithDetailsDTO.class);
|
||||
if (purchaseOrderWithDetailsVO.getOrderDetails().isEmpty()) {
|
||||
purchaseOrderWithDetailsDTO.setOrderDetails(new ArrayList<>());
|
||||
} else {
|
||||
purchaseOrderWithDetailsDTO.setOrderDetails(BeanUtils.toBean(purchaseOrderWithDetailsVO.getOrderDetails(), PrchOrdDtlDTO.class));
|
||||
}
|
||||
purchaseOrderWithDetailsDTOS.add(purchaseOrderWithDetailsDTO);
|
||||
}
|
||||
});
|
||||
return success(purchaseOrderWithDetailsDTOS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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.api.ContractApiImpl;
|
||||
import com.zt.plat.module.contractorder.api.dto.PurchaseOrderWithDetailsDTO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
||||
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.*;
|
||||
@@ -43,6 +43,9 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
||||
|
||||
@Resource
|
||||
private PurchaseOrderService purchaseOrderService;
|
||||
@Resource
|
||||
private ContractApiImpl contractApi;
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采购订单")
|
||||
@@ -117,10 +120,24 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
||||
}
|
||||
|
||||
//提交ERP订单
|
||||
@PostMapping("/submit-erp")
|
||||
@Operation(summary = "提交ERP订单", description = "bse:purchase-order:update')")
|
||||
public CommonResult<?> submitErp(@RequestBody List<Long> ids) {
|
||||
return success( purchaseOrderService.submitErp(ids));
|
||||
@PostMapping("/submit-erp061")
|
||||
@Operation(summary = "推送ERP订单", description = "061')")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||
public CommonResult<?> submitErp061(@RequestBody @Validated @NotNull(message = "采购订单id不能为空") List<Long> ids) {
|
||||
return success( purchaseOrderService.submitErp061(ids));
|
||||
}
|
||||
@PostMapping("/submit-erp062")
|
||||
@Operation(summary = "推送ERP订单", description = "062当每次调更新接口后都需要调此接口")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||
public CommonResult<?> submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") Long id) {
|
||||
return success( purchaseOrderService.submitErp062(id));
|
||||
}
|
||||
|
||||
//通过订单号查询订单信息
|
||||
@PostMapping("/get-order-by-order-no")
|
||||
@Operation(summary = "通过订单号查询订单信息")
|
||||
public CommonResult<List<PurchaseOrderDetailsRespVO>> getOrderByOrderNo(@RequestBody @Validated @NotEmpty(message = "采购订单不能为空") List<String> orderNos){
|
||||
return success(purchaseOrderService.getOrderByOrderNo(orderNos));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class PrchOrdDtlDetailsRespVO {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 采购订单主键
|
||||
*/
|
||||
|
||||
private Long ordId;
|
||||
/**
|
||||
* 行项目;推送ERP(必须)
|
||||
*/
|
||||
private Long lineNum;
|
||||
/**
|
||||
* 物料编码;推送ERP
|
||||
*/
|
||||
|
||||
private String mtrlNum;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
|
||||
private String mtrlName;
|
||||
/**
|
||||
* 收货工厂名称
|
||||
*/
|
||||
|
||||
private String rcvFactName;
|
||||
/**
|
||||
* 收货工厂编码;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String rcvFactNum;
|
||||
/**
|
||||
* 收货库位名称
|
||||
*/
|
||||
|
||||
private String rcvWrhName;
|
||||
/**
|
||||
* 收货库位编码;推送ERP
|
||||
*/
|
||||
|
||||
private String rcvWrhNum;
|
||||
/**
|
||||
* 暂估数量;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String qty;
|
||||
/**
|
||||
* 计量单位;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private BigDecimal unt;
|
||||
/**
|
||||
* 含税单价;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private BigDecimal inTaxUprc;
|
||||
/**
|
||||
* 价格单位;推送ERP
|
||||
*/
|
||||
|
||||
private BigDecimal prcUnt;
|
||||
/**
|
||||
* 税码(字典: PRCH_TAX);推送ERP
|
||||
*/
|
||||
|
||||
private BigDecimal taxNum;
|
||||
/**
|
||||
* 是否基于GR的发票校验;推送ERP
|
||||
*/
|
||||
|
||||
private String isGrInv;
|
||||
/**
|
||||
* 是否允许无限制收货;推送ERP
|
||||
*/
|
||||
|
||||
private String isUnlRcv;
|
||||
/**
|
||||
* 批次;推送ERP
|
||||
*/
|
||||
|
||||
private String bat;
|
||||
/**
|
||||
* 项目类别;推送ERP:委托加工L
|
||||
*/
|
||||
|
||||
private String prjCtgr;
|
||||
/**
|
||||
* 科目分配类别(字典: PRCH_ACTS_CTGR);推送ERP:联动订单类型,固定资产订单A,服务订单S-销售服务费K-成本中心F-订单
|
||||
*/
|
||||
|
||||
private String actsCtgr;
|
||||
/**
|
||||
* 物料组编码(字典: PRCH_MATERIAL_GROUP);推送ERP:联动订单类型,服务订单必传
|
||||
*/
|
||||
|
||||
private String mtrlCpntNum;
|
||||
/**
|
||||
* 物料组描述;推送ERP:联动订单类型,服务订单必传
|
||||
*/
|
||||
|
||||
private String mtrlCpntDsp;
|
||||
/**
|
||||
* 短文本
|
||||
*/
|
||||
|
||||
private String shrtTxt;
|
||||
/**
|
||||
* 退货标识X标识退货;推送ERP
|
||||
*/
|
||||
|
||||
private String isRlbkCgo;
|
||||
/**
|
||||
* 是否免费收货标识X;推送ERP
|
||||
*/
|
||||
|
||||
private String isFreeRcv;
|
||||
/**
|
||||
* 外部行项目号;推送ERP
|
||||
*/
|
||||
|
||||
private Long outLineNum;
|
||||
/**
|
||||
* 备注信息-需求单位;推送ERP
|
||||
*/
|
||||
|
||||
private String rmkUnt;
|
||||
/**
|
||||
* 备注信息-物料详细;推送ERP
|
||||
*/
|
||||
|
||||
private String rmkMtrl;
|
||||
/**
|
||||
* 交货起始日期;推送ERP
|
||||
*/
|
||||
|
||||
private LocalDateTime bgnDt;
|
||||
/**
|
||||
* 交货截止日期;推送ERP
|
||||
*/
|
||||
|
||||
private LocalDateTime ddlDt;
|
||||
/**
|
||||
* 已收货量
|
||||
*/
|
||||
|
||||
private BigDecimal lstQty;
|
||||
/**
|
||||
* 已移库量库;存针对该订单产生的移库量
|
||||
*/
|
||||
|
||||
private BigDecimal trfQty;
|
||||
/**
|
||||
* 小协议号
|
||||
*/
|
||||
|
||||
private String agrNum;
|
||||
/**
|
||||
* 移库工厂名称
|
||||
*/
|
||||
|
||||
private String trfFactName;
|
||||
/**
|
||||
* 移库工厂编码
|
||||
*/
|
||||
|
||||
private String trfFactNum;
|
||||
/**
|
||||
* 移库库位名称
|
||||
*/
|
||||
|
||||
private String trfWrhName;
|
||||
/**
|
||||
* 移库库位编码
|
||||
*/
|
||||
|
||||
private String trfWrhNum;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
private String rmk;
|
||||
/**
|
||||
* 原料湿重;推送ERP
|
||||
*/
|
||||
|
||||
private BigDecimal origWet;
|
||||
/**
|
||||
* 销售物料号;推送ERP:科目分配类别为S时必填
|
||||
*/
|
||||
|
||||
private String saleMtrlNum;
|
||||
/**
|
||||
* 统计型内部订单;推送ERP
|
||||
*/
|
||||
|
||||
private String inOrd;
|
||||
/**
|
||||
* 采购类别;推送ERP:0-生产性物资类1-项目投资类
|
||||
*/
|
||||
|
||||
private String prchCtgr;
|
||||
/**
|
||||
* 是否启用(字典:ERP_CTRT_YN);处理明细中多个相同物料,只能允许一种物料启用
|
||||
*/
|
||||
|
||||
private String isEnb;
|
||||
/**
|
||||
* 科目分配详情;科目分配类别为K或P时使用(JSON)
|
||||
*/
|
||||
|
||||
private String actsCtgrDtl;
|
||||
/**
|
||||
* 委托加工详情;委托加工订单使用(JSON)
|
||||
*/
|
||||
|
||||
private String enttDtl;
|
||||
/**
|
||||
* 金属元素缩写
|
||||
*/
|
||||
|
||||
private String elemAbbr;
|
||||
/**
|
||||
* 金属元素名称
|
||||
*/
|
||||
|
||||
private String elemName;
|
||||
/**
|
||||
* 金属元素编码
|
||||
*/
|
||||
|
||||
private String elemCdg;
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
|
||||
|
||||
import com.zt.plat.module.contractorder.api.dto.PrchOrdDtlDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PurchaseOrderDetailsRespVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* ERP订单号
|
||||
*/
|
||||
private String orderSAPNumber;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String systemOrderNumber;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String cpName;
|
||||
/**
|
||||
* 公司编码;推送ERP(必须)
|
||||
*/
|
||||
private String companyNumber;
|
||||
/**
|
||||
* 客商编码;推送ERP(必须)
|
||||
*/
|
||||
private String supplierNumber;
|
||||
/**
|
||||
* 客商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
/**
|
||||
* 订单类型(字典:PRCH_ORD_TP);推送ERP(必须)
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 凭证日期;推送ERP(必须)
|
||||
*/
|
||||
private LocalDateTime voucherDate;
|
||||
/**
|
||||
* 采购组织编码;推送ERP(必须)
|
||||
*/
|
||||
private String purchaseOrganizationCustomsDeclaration;
|
||||
/**
|
||||
* 收货工厂名称
|
||||
*/
|
||||
private String receiveFactoryName;
|
||||
/**
|
||||
* 收货工厂编码;推送ERP(必须)
|
||||
*/
|
||||
private String receiveFactoryNumber;
|
||||
/**
|
||||
* 收货库位名称
|
||||
*/
|
||||
private String receiveWarehouseName;
|
||||
/**
|
||||
* 收货库位编码;推送ERP
|
||||
*/
|
||||
private String receiveWarehouseNumber;
|
||||
/**
|
||||
* 采购组编码(字典:PRCH_GRP_TP);推送ERP(必须)
|
||||
*/
|
||||
private String purchaseGroup;
|
||||
/**
|
||||
* 货币码(字典:CUR);推送ERP(必须)
|
||||
*/
|
||||
private String currencyNumber;
|
||||
/**
|
||||
* 汇率;推送ERP
|
||||
*/
|
||||
private BigDecimal exchangeRate;
|
||||
/**
|
||||
* 合同纸质合同号;推送ERP(必须)
|
||||
*/
|
||||
private String paperContractNumber;
|
||||
/**
|
||||
* 小协议号;推送ERP
|
||||
*/
|
||||
private String agreementNumber;
|
||||
/**
|
||||
* 备注;推送ERP
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 代理方编码;推送ERP
|
||||
*/
|
||||
private String agentNumber;
|
||||
/**
|
||||
* 代理方名称
|
||||
*/
|
||||
private String agentName;
|
||||
/**
|
||||
* 订单编码
|
||||
*/
|
||||
private String orderNumber;
|
||||
/**
|
||||
* 系统合同编号
|
||||
*/
|
||||
private String contractNumber;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialNumber;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String materialName;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
/**
|
||||
* 小户头号
|
||||
*/
|
||||
private String tenantNumber;
|
||||
/**
|
||||
* ERP公司编号
|
||||
*/
|
||||
private String erpPurchaseCompanyNumber;
|
||||
/**
|
||||
* ERP公司名称
|
||||
*/
|
||||
private String erpPurchaseCompanyName;
|
||||
/**
|
||||
* ERP客商公司编码
|
||||
*/
|
||||
private String erpSalesCompanyNumber;
|
||||
/**
|
||||
* ERP客商公司名称
|
||||
*/
|
||||
private String erpSalesCompanyName;
|
||||
/**
|
||||
* 采购组织名称
|
||||
*/
|
||||
private String purchaseOrganizationName;
|
||||
/**
|
||||
* ERP状态(字典: ERP_REQ_STS)
|
||||
*/
|
||||
private String erpStatus;
|
||||
/**
|
||||
* 请求ERP失败原因
|
||||
*/
|
||||
private String cause;
|
||||
/**
|
||||
* 订单状态(字典:PRCH_ORD_STS)
|
||||
*/
|
||||
|
||||
private String status;
|
||||
/**
|
||||
* 采购组名称
|
||||
*/
|
||||
private String purchaseGroupName;
|
||||
|
||||
/**
|
||||
* 流程实例编号
|
||||
*/
|
||||
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 流程当前任务节点id
|
||||
*/
|
||||
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
|
||||
private String reviewOpinion;
|
||||
|
||||
/**
|
||||
* 是否需要审批
|
||||
*/
|
||||
private int isPush;
|
||||
|
||||
/**
|
||||
* 物料类型
|
||||
*/
|
||||
private String mtrlTp;
|
||||
|
||||
/**
|
||||
* 采购订单行项目
|
||||
*/
|
||||
private List<PrchOrdDtlDetailsRespVO> orderDetails;
|
||||
|
||||
}
|
||||
@@ -124,4 +124,7 @@ public class PurchaseOrderPageReqVO extends PageParam {
|
||||
@Schema(description = "采购组名称", example = "张三")
|
||||
private String purchaseGroupName;
|
||||
|
||||
@Schema(description = "物料类型(字典:MTRL_TP)", example = "2")
|
||||
private String mtrlTp;
|
||||
|
||||
}
|
||||
|
||||
@@ -164,5 +164,7 @@ public class PurchaseOrderRespVO {
|
||||
@Schema(description = "订单明细")
|
||||
@ExcelProperty("订单明细")
|
||||
private List<PrchOrdDtlRespVO> prchOrdDtlRespVOS;
|
||||
|
||||
@Schema(description = "物料类型(字典:MTRL_TP)", example = "2")
|
||||
@ExcelProperty("物料类型(字典:MTRL_TP)")
|
||||
private String mtrlTp;
|
||||
}
|
||||
|
||||
@@ -167,4 +167,7 @@ public class PurchaseOrderSaveReqVO {
|
||||
@Schema(description = "是否提交审核,value为0或1")
|
||||
@ExcelProperty("是否提交审核")
|
||||
private int isPush;
|
||||
@Schema(description = "物料类别(字典:MTRL_TP)", example = "1")
|
||||
@ExcelProperty("物料类别")
|
||||
private String mtrlTp;
|
||||
}
|
||||
|
||||
@@ -271,4 +271,11 @@ public class PrchOrdDtlDO extends BusinessBaseDO {
|
||||
@TableField("ELEM_CDG")
|
||||
private String elemCdg;
|
||||
|
||||
/**
|
||||
* 物料字典
|
||||
*
|
||||
*/
|
||||
@TableField("MTRL_TP")
|
||||
private String mtrlTp;
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
|
||||
.likeIfPresent(PurchaseOrderDO::getPurchaseGroupName, reqVO.getPurchaseGroupName())
|
||||
.orderByDesc(PurchaseOrderDO::getId));
|
||||
}
|
||||
|
||||
List<PurchaseOrderWithDetailsVO> selectOrderById(@Param("ids") List<Long> id);
|
||||
List<PurchaseOrderWithDetailsVO> selectOrderByOrderNos(@Param("orderNos") List<String> orderNos);
|
||||
List<PurchaseOrderWithDetailsVO> selectOrderByIds(@Param("ids") List<Long> id);
|
||||
PurchaseOrderDO selectByOrderId(@Param("orderId") Long orderId);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.zt.plat.module.contractorder.service.contract;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.contractorder.api.dto.ContractFormulaRespDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO;
|
||||
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;
|
||||
@@ -88,12 +88,12 @@ public interface ContractService {
|
||||
List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO);
|
||||
|
||||
/**
|
||||
* 通过合同编号获取对应的结算条款数据
|
||||
* 通过合同编号获取对应的合同信息
|
||||
*
|
||||
* @param contractPaperNumber 合同编号
|
||||
* @return 结算条款数据
|
||||
*/
|
||||
List<ContractFormulaRespDTO> getFormulasByPaperNumber(String contractPaperNumber);
|
||||
ContractRespDTO getFormulasByPaperNumber(String contractPaperNumber);
|
||||
|
||||
/**
|
||||
* 提交ERP
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.*;
|
||||
import com.zt.plat.module.contractorder.api.dto.contract.*;
|
||||
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.*;
|
||||
@@ -26,8 +26,10 @@ 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.DictEnum;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpContractPageReqVO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpContractDO;
|
||||
import com.zt.plat.module.erp.service.erp.ErpCompanyService;
|
||||
import com.zt.plat.module.erp.service.erp.ErpContractService;
|
||||
import com.zt.plat.module.system.api.user.AdminUserApi;
|
||||
import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -90,6 +92,8 @@ public class ContractServiceImpl implements ContractService {
|
||||
private ContractDemoteMapper contractDemoteMapper;
|
||||
@Resource
|
||||
private ErpCompanyService erpCompanyService;
|
||||
@Resource
|
||||
private ErpContractService erpContractService;
|
||||
|
||||
@Override
|
||||
public PageResult<ContractMainDO> getContractPage(ContractPageReqVO pageReqVO) {
|
||||
@@ -736,7 +740,7 @@ public class ContractServiceImpl implements ContractService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ContractFormulaRespDTO> getFormulasByPaperNumber(String contractPaperNumber) {
|
||||
public ContractRespDTO getFormulasByPaperNumber(String contractPaperNumber) {
|
||||
|
||||
// 通过合同编号查询合同信息
|
||||
ContractMainDO contractMainDO = contractMainMapper
|
||||
@@ -750,43 +754,76 @@ public class ContractServiceImpl implements ContractService {
|
||||
// 合同ID
|
||||
Long contractId = contractMainDO.getId();
|
||||
|
||||
// 返回结果
|
||||
ContractRespDTO respDTO = new ContractRespDTO();
|
||||
BeanUtils.copyProperties(contractMainDO, respDTO);
|
||||
|
||||
// 查询并设置合同明细
|
||||
List<ContractDetailDO> detailDOS = contractDetailMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_DTL_CTRT_MAIN_ID, contractMainDO.getId());
|
||||
if (detailDOS != null && !detailDOS.isEmpty()) {
|
||||
respDTO.setDetail(BeanUtils.toBean(detailDOS, DetailRespDTO.class));
|
||||
respDTO.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, PlanRespDTO.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 查询并设置价款结算条款
|
||||
List<ContractFormulaRespDTO> formulas = new ArrayList<>();
|
||||
List<ContractFormulaDO> formulaDOS = contractFormulaMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_FMU_CTRT_ID, contractId);
|
||||
if (formulaDOS != null && !formulaDOS.isEmpty()) {
|
||||
formulas = BeanUtils.toBean(formulaDOS, ContractFormulaRespDTO.class);
|
||||
respDTO.setFormulas(BeanUtils.toBean(formulaDOS, FormulaRespDTO.class));
|
||||
|
||||
formulas.forEach(formula -> {
|
||||
respDTO.getFormulas().forEach(formula -> {
|
||||
|
||||
// 查询并设置基础系数配置
|
||||
List<ContractCoefficientDO> coefficientDOS = contractCoefficientMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_COEF_FMU_ID, formula.getId());
|
||||
if (coefficientDOS != null && !coefficientDOS.isEmpty()) {
|
||||
formula.setCoefficients(BeanUtils.toBean(coefficientDOS, ContractCoefficientRespDTO.class));
|
||||
formula.setCoefficients(BeanUtils.toBean(coefficientDOS, CoefficientRespDTO.class));
|
||||
}
|
||||
// 查询并设置品位等级价配置
|
||||
List<ContractGradeDO> gradeDOS = contractGradeMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_GRD_FMU_ID, formula.getId());
|
||||
if (gradeDOS != null && !gradeDOS.isEmpty()) {
|
||||
formula.setGrades(BeanUtils.toBean(gradeDOS, ContractGradeRespDTO.class));
|
||||
formula.setGrades(BeanUtils.toBean(gradeDOS, GradeRespDTO.class));
|
||||
}
|
||||
// 查询并设置调整价配置
|
||||
List<ContractDeductDO> deductDOS = contractDeductMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_DDCT_FMU_ID, formula.getId());
|
||||
if (deductDOS != null && !deductDOS.isEmpty()) {
|
||||
formula.setDeducts(BeanUtils.toBean(deductDOS, ContractDeductRespDTO.class));
|
||||
formula.setDeducts(BeanUtils.toBean(deductDOS, DeductRespDTO.class));
|
||||
}
|
||||
// 查询并设置市场价配置
|
||||
List<ContractPriceDO> priceDOS = contractPriceMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_PRC_FMU_ID, formula.getId());
|
||||
if (priceDOS != null && !priceDOS.isEmpty()) {
|
||||
formula.setPrices(BeanUtils.toBean(priceDOS, ContractPriceRespDTO.class));
|
||||
formula.setPrices(BeanUtils.toBean(priceDOS, PriceRespDTO.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return formulas;
|
||||
// 查询并设置参数降级规则
|
||||
List<ContractDemoteDO> demoteDOS = contractDemoteMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_DMOT_CTRT_ID, contractMainDO.getId());
|
||||
if (demoteDOS != null && !demoteDOS.isEmpty()) {
|
||||
respDTO.setDemotes(BeanUtils.toBean(demoteDOS, DemoteRespDTO.class));
|
||||
}
|
||||
|
||||
// 查询并设置品位不计价规则
|
||||
List<ContractNotDO> notDOS = contractNotMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_NT_CTRT_ID, contractMainDO.getId());
|
||||
if (notDOS != null && !notDOS.isEmpty()) {
|
||||
respDTO.setNots(BeanUtils.toBean(notDOS, NotRespDTO.class));
|
||||
}
|
||||
|
||||
return respDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -804,12 +841,39 @@ public class ContractServiceImpl implements ContractService {
|
||||
ErpContractDO erpContractDO = new ErpContractDO();
|
||||
// 合同主信息表主键:BSE_CTRT_MAIN
|
||||
erpContractDO.setContractMainId(id);
|
||||
// 操作标识:OPTN_ID TODO
|
||||
/*
|
||||
1、先调用009ERP接口查询合同信息
|
||||
2、如果009接口返回值中“合同编号”字段存在值,并且与传入的相同,则OPTN_ID值为“1”
|
||||
3、如果009接口返回值中“合同编号”字段不存在值,根据合同主键查询映射表中是否存在没有删除的数据,如果有,值为“1”,如果没有,值为“0”
|
||||
*/
|
||||
// 操作标识:OPTN_ID
|
||||
// 1、先调用009ERP接口查询合同信息
|
||||
ErpContractPageReqVO pageReqVO = new ErpContractPageReqVO();
|
||||
// BUKRS 合同签订主体公司代码 收支方向判断,如果为“支出”,传“ERP甲方公司编码”,反之传“ERP乙方公司编码”
|
||||
// PARTNER 对方客商编号 收支方向判断,如果为“支出”,传“ERP乙方公司编码”,反之传“ERP甲方公司编码”
|
||||
// INEDR 1-借(销售合同),2-贷(采购合同) 收支方向判断,如果为“支出”,传“2”,反之传“1”
|
||||
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
||||
pageReqVO.setContractSignNumber(contractMainDO.getSalesCompanyNumber());
|
||||
pageReqVO.setSupplierNumber(contractMainDO.getSalesCompanyNumber());
|
||||
pageReqVO.setContractCategory("2");
|
||||
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
||||
pageReqVO.setContractSignNumber(contractMainDO.getSalesCompanyNumber());
|
||||
pageReqVO.setSupplierNumber(contractMainDO.getSalesCompanyNumber());
|
||||
pageReqVO.setContractCategory("1");
|
||||
}
|
||||
// ZHTBH 合同编号 合同编号:CTRT_PPR_NUM
|
||||
pageReqVO.setContractTypeNumber(contractMainDO.getContractPaperNumber());
|
||||
// ZHTMC 合同名称 合同名称:CTRT_NAME
|
||||
pageReqVO.setContractName(contractMainDO.getContractName());
|
||||
PageResult<ErpContractDO> erpContractPage = erpContractService.getErpContractPage(pageReqVO);
|
||||
if (erpContractPage.getTotal() > 0) {
|
||||
// 2、如果009接口返回值中“合同编号”字段存在值,并且与传入的相同,则OPTN_ID值为“1”
|
||||
erpContractDO.setOperationId("1");
|
||||
} else {
|
||||
// 3、如果009接口返回值中“合同编号”字段不存在值,根据合同主键查询映射表中是否存在没有删除的数据,如果有,值为“1”,如果没有,值为“0”
|
||||
/*ErpContractDO erpContract = erpContractService.getErpContractByMainId(id);
|
||||
if (erpContract != null) {
|
||||
erpContractDO.setOperationId("1");
|
||||
} else {
|
||||
erpContractDO.setOperationId("0");
|
||||
}*/
|
||||
}
|
||||
// erpContractDO.setOperationId();
|
||||
// 合同编号:CTRT_PPR_NUM
|
||||
erpContractDO.setContractPaperNumber(contractMainDO.getContractPaperNumber());
|
||||
// 合同名称:CTRT_NAME
|
||||
@@ -823,15 +887,25 @@ public class ContractServiceImpl implements ContractService {
|
||||
// 是否虚拟合同:IS_VRTL_CTRT
|
||||
erpContractDO.setIsVirtualContract(contractMainDO.getContractVirtual());
|
||||
// 客商编号:SPLR_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司编码”,反之为“ERP甲方公司编码”
|
||||
// erpContractDO.setSupplierNumber();
|
||||
// 客商名称:SPLR_NAME 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司名称”,反之为“ERP甲方公司名称”
|
||||
// erpContractDO.setSupplierName();
|
||||
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractDO.setSupplierNumber(contractMainDO.getSalesCompanyNumber());
|
||||
erpContractDO.setSupplierName(contractMainDO.getSalesCompanyName());
|
||||
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractDO.setSupplierNumber(contractMainDO.getPurchaseCompanyNumber());
|
||||
erpContractDO.setSupplierName(contractMainDO.getPurchaseCompanyName());
|
||||
}
|
||||
// 代理方:AGT
|
||||
erpContractDO.setAgent(contractMainDO.getAgent());
|
||||
// 合同实施主体编号:CTRT_IMPL_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司编码”,反之为“ERP乙方公司编码”
|
||||
// erpContractDO.setContractImplementNumber();
|
||||
// 合同签订主体编号:CTRT_SGN_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司名称”,反之为“ERP乙方公司名称”
|
||||
// erpContractDO.setContractSignNumber();
|
||||
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractDO.setContractImplementNumber(contractMainDO.getPurchaseCompanyNumber());
|
||||
erpContractDO.setContractSignNumber(contractMainDO.getPurchaseCompanyName());
|
||||
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractDO.setContractImplementNumber(contractMainDO.getSalesCompanyNumber());
|
||||
erpContractDO.setContractSignNumber(contractMainDO.getSalesCompanyName());
|
||||
}
|
||||
// 合同签订日期:SGN_DT
|
||||
if (contractMainDO.getSignDate() != null) {
|
||||
erpContractDO.setSignDate(contractMainDO.getSignDate().toLocalDate());
|
||||
@@ -855,9 +929,9 @@ public class ContractServiceImpl implements ContractService {
|
||||
// 变更后合同总金额(本位币-含税):CHG_BSC_AMT
|
||||
erpContractDO.setChangeBasicAmount(contractMainDO.getChangeBasicAmount());
|
||||
// 合同状态编号:STS_NUM 参照060接口
|
||||
// erpContractDO.setStatusNumber();
|
||||
erpContractDO.setStatusNumber(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getCode());
|
||||
// 合同状态名称:STS_NAME 参照060接口
|
||||
// erpContractDO.setStatusName();
|
||||
erpContractDO.setStatusName(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getLabel());
|
||||
// 是否有预付款:IS_PPYM
|
||||
erpContractDO.setIsPrepayment(contractMainDO.getHasPrepayment());
|
||||
// 预付款比例:PPYM_RTIO
|
||||
|
||||
@@ -2,9 +2,7 @@ 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.controller.admin.purchaseorder.vo.*;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import jakarta.validation.*;
|
||||
|
||||
@@ -65,7 +63,9 @@ public interface PurchaseOrderService {
|
||||
|
||||
String submitOrder(Long id);
|
||||
|
||||
String submitErp(List<Long> ids);
|
||||
String submitErp061(List<Long> ids);
|
||||
|
||||
boolean submitErp062(Long id);
|
||||
|
||||
/**
|
||||
* 通过订单id更新订单状态
|
||||
@@ -74,4 +74,11 @@ public interface PurchaseOrderService {
|
||||
* @return boolean
|
||||
*/
|
||||
boolean updateOrderStatus(Long orderId, String status);
|
||||
/**
|
||||
* 通过订单编号查询订单信息
|
||||
*
|
||||
* @param orderNo 订单编号
|
||||
* @return 订单信息
|
||||
*/
|
||||
List<PurchaseOrderDetailsRespVO> getOrderByOrderNo(List<String> orderNo);
|
||||
}
|
||||
|
||||
@@ -200,9 +200,9 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String submitErp(List<Long> ids) {
|
||||
public String submitErp061(List<Long> ids) {
|
||||
//通过订单号查询订单
|
||||
List<PurchaseOrderWithDetailsVO> purchaseOrderWithDetailsVOS = purchaseOrderMapper.selectOrderById(ids);
|
||||
List<PurchaseOrderWithDetailsVO> purchaseOrderWithDetailsVOS = purchaseOrderMapper.selectOrderByIds(ids);
|
||||
if (!purchaseOrderWithDetailsVOS.isEmpty()) {
|
||||
purchaseOrderWithDetailsVOS.forEach(purchaseOrderWithDetailsVO -> {
|
||||
ErpOrderSaveReqVO erpOrderSaveReqVO = new ErpOrderSaveReqVO();
|
||||
@@ -239,6 +239,17 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean submitErp062(Long id) {
|
||||
PurchaseOrderDO purchaseOrderDO = purchaseOrderMapper.selectByOrderId(id);
|
||||
if (purchaseOrderDO== null){
|
||||
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||
}
|
||||
if (purchaseOrderDO.getOrderSAPNumber().isEmpty()){ return true;}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateOrderStatus(Long orderId, String status) {
|
||||
// 校验存在
|
||||
@@ -250,5 +261,17 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
||||
return purchaseOrderMapper.updateById(new PurchaseOrderDO().setId(orderId).setStatus(status))>0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PurchaseOrderDetailsRespVO> getOrderByOrderNo(List<String> orderNos) {
|
||||
List<PurchaseOrderWithDetailsVO> purchaseOrderWithDetailsVOS = purchaseOrderMapper.selectOrderByOrderNos(orderNos);
|
||||
List<PurchaseOrderDetailsRespVO> purchaseOrderDetailsRespVOS = new ArrayList<>();
|
||||
purchaseOrderWithDetailsVOS.forEach(purchaseOrderWithDetailsVO -> {
|
||||
PurchaseOrderDetailsRespVO purchaseOrderDetailsRespVO = BeanUtils.toBean(purchaseOrderWithDetailsVO.getPurchaseOrder(), PurchaseOrderDetailsRespVO.class);
|
||||
purchaseOrderDetailsRespVO.setOrderDetails(BeanUtils.toBean(purchaseOrderWithDetailsVO.getOrderDetails(), PrchOrdDtlDetailsRespVO.class));
|
||||
purchaseOrderDetailsRespVOS.add(purchaseOrderDetailsRespVO);
|
||||
});
|
||||
return purchaseOrderDetailsRespVOS;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectOrderById" resultMap="PurchaseOrderWithDetailsResultMap">
|
||||
<select id="selectOrderByIds" resultMap="PurchaseOrderWithDetailsResultMap">
|
||||
SELECT
|
||||
po.ID as po_id,
|
||||
po.ORD_SAP_NUM,
|
||||
@@ -47,11 +47,17 @@
|
||||
po.ERP_STS,
|
||||
po.CAUS,
|
||||
po.STS,
|
||||
po.MTRL_TP,
|
||||
po.PRCH_GRP_NAME,
|
||||
po.PRCS_INSC_ID,
|
||||
po.RVW_ONN,
|
||||
po.TSK_NDE_ID,
|
||||
po.IS_PUSH,
|
||||
po.CREATE_TIME,
|
||||
po.UPDATE_TIME,
|
||||
po.CREATOR,
|
||||
po.UPDATER,
|
||||
po.DELETED,
|
||||
pod.ID as pod_id,
|
||||
pod.ORD_ID,
|
||||
pod.LINE_NUM,
|
||||
@@ -109,6 +115,118 @@
|
||||
ORDER BY po.SYS_ORD_NUM, pod.LINE_NUM
|
||||
</select>
|
||||
|
||||
<select id="selectOrderByOrderNos" resultMap="PurchaseOrderWithDetailsResultMap">
|
||||
SELECT
|
||||
po.ID as po_id,
|
||||
po.ORD_SAP_NUM,
|
||||
po.SYS_ORD_NUM,
|
||||
po.CPN_NAME,
|
||||
po.CPN_NUM,
|
||||
po.SPLR_NUM,
|
||||
po.SPLR_NAME,
|
||||
po.TP,
|
||||
po.MTRL_TP,
|
||||
po.VCHR_DT,
|
||||
po.PRCH_ORGZ_CD,
|
||||
po.RCV_FACT_NAME,
|
||||
po.RCV_FACT_NUM,
|
||||
po.RCV_WRH_NAME,
|
||||
po.RCV_WRH_NUM,
|
||||
po.PRCH_GRP,
|
||||
po.CUR_NUM,
|
||||
po.EXCH_RTE,
|
||||
po.PPR_CTRT_NUM,
|
||||
po.AGR_NUM,
|
||||
po.RMK,
|
||||
po.AGT_NUM,
|
||||
po.AGT_NAME,
|
||||
po.ORD_NUM,
|
||||
po.CTRT_NUM,
|
||||
po.MTRL_NUM,
|
||||
po.MTRL_NAME,
|
||||
po.CTRT_NAME,
|
||||
po.TNT_NUM,
|
||||
po.ERP_PRCH_CPN_NUM,
|
||||
po.ERP_PRCH_CPN_NAME,
|
||||
po.ERP_SALE_CPN_NUM,
|
||||
po.ERP_SALE_CPN_NAME,
|
||||
po.PRCH_ORGZ_NAME,
|
||||
po.ERP_STS,
|
||||
po.CAUS,
|
||||
po.STS,
|
||||
po.PRCH_GRP_NAME,
|
||||
po.PRCS_INSC_ID,
|
||||
po.RVW_ONN,
|
||||
po.TSK_NDE_ID,
|
||||
po.IS_PUSH,
|
||||
po.CREATE_TIME,
|
||||
po.UPDATE_TIME,
|
||||
po.CREATOR,
|
||||
po.UPDATER,
|
||||
po.DELETED,
|
||||
pod.ID as pod_id,
|
||||
pod.ORD_ID,
|
||||
pod.LINE_NUM,
|
||||
pod.MTRL_NUM,
|
||||
pod.MTRL_NAME,
|
||||
pod.RCV_FACT_NAME,
|
||||
pod.RCV_FACT_NUM,
|
||||
pod.RCV_WRH_NAME,
|
||||
pod.RCV_WRH_NUM,
|
||||
pod.QTY,
|
||||
pod.UNT,
|
||||
pod.IN_TAX_UPRC,
|
||||
pod.PRC_UNT,
|
||||
pod.TAX_NUM,
|
||||
pod.IS_GR_INV,
|
||||
pod.IS_UNL_RCV,
|
||||
pod.BAT,
|
||||
pod.PRJ_CTGR,
|
||||
pod.ACTS_CTGR,
|
||||
pod.MTRL_CPNT_NUM,
|
||||
pod.MTRL_CPNT_DSP,
|
||||
pod.SHRT_TXT,
|
||||
pod.IS_RLBK_CGO,
|
||||
pod.IS_FREE_RCV,
|
||||
pod.OUT_LINE_NUM,
|
||||
pod.RMK_UNT,
|
||||
pod.RMK_MTRL,
|
||||
pod.BGN_DT,
|
||||
pod.DDL_DT,
|
||||
pod.LST_QTY,
|
||||
pod.TRF_QTY,
|
||||
pod.AGR_NUM as pod_agr_num,
|
||||
pod.TRF_FACT_NAME,
|
||||
pod.TRF_FACT_NUM,
|
||||
pod.TRF_WRH_NAME,
|
||||
pod.TRF_WRH_NUM,
|
||||
pod.RMK as pod_rmk,
|
||||
pod.ORIG_WET,
|
||||
pod.SALE_MTRL_NUM,
|
||||
pod.IN_ORD,
|
||||
pod.PRCH_CTGR,
|
||||
pod.IS_ENB,
|
||||
pod.ACTS_CTGR_DTL,
|
||||
pod.ENTT_DTL,
|
||||
pod.ELEM_ABBR,
|
||||
pod.ELEM_NAME,
|
||||
pod.ELEM_CDG
|
||||
FROM BSE_PRCH_ORD po
|
||||
LEFT JOIN BSE_PRCH_ORD_DTL pod ON po.ID = pod.ORD_ID
|
||||
WHERE po.ORD_SAP_NUM IN
|
||||
<foreach collection="orderNos" item="orderNumber" open="(" separator="," close=")">
|
||||
#{orderNumber}
|
||||
</foreach>
|
||||
AND po.deleted=0
|
||||
ORDER BY po.SYS_ORD_NUM, pod.LINE_NUM
|
||||
</select>
|
||||
|
||||
<select id="selectByOrderId"
|
||||
resultType="com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO">
|
||||
select * from bse_prch_ord;
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap id="PurchaseOrderWithDetailsResultMap" type="com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderWithDetailsVO">
|
||||
<result column="SYS_ORD_NUM" property="systemOrderNumber"/>
|
||||
<association property="purchaseOrder" resultMap="PurchaseOrderResultMap"/>
|
||||
|
||||
@@ -117,4 +117,12 @@ public class ErpCompanyController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/test1")
|
||||
@Operation(summary = "获取配置")
|
||||
@PreAuthorize("@ss.hasPermission('sply:erp-company:get')")
|
||||
public CommonResult<String> test1() {
|
||||
String TEST = erpCompanyService.test1();
|
||||
return success(TEST);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
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;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* ERP采购订单保存请求VO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "ERP采购订单保存请求VO")
|
||||
public class ErpOrderUpdateReqVO {
|
||||
|
||||
|
||||
// ====================== 1. 主结构字段 ======================
|
||||
@Schema(description = "采购订单号(EBELN)", requiredMode = Schema.RequiredMode.REQUIRED, example = "4500000001")
|
||||
@NotEmpty(message = "采购订单号不能为空")
|
||||
@ExcelProperty("采购订单号")
|
||||
private String poNumber;
|
||||
|
||||
@Schema(description = "删除标识(ELOEK)", example = " ")
|
||||
@ExcelProperty("删除标识")
|
||||
private String deleteInd;
|
||||
|
||||
@Schema(description = "货币码(WAERS)", requiredMode = Schema.RequiredMode.REQUIRED, example = "CNY")
|
||||
@NotEmpty(message = "货币码不能为空")
|
||||
@ExcelProperty("货币码")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "汇率(WKURS),保留5位小数", requiredMode = Schema.RequiredMode.REQUIRED, example = "6.90000")
|
||||
@NotNull(message = "汇率不能为空")
|
||||
@ExcelProperty("汇率")
|
||||
private BigDecimal exchRate;
|
||||
|
||||
// ====================== 2. 抬头扩展字段(结构-exte) ======================
|
||||
@Schema(description = "纸质合同号(zzhth),来源于合同台账接口,已启用财务共享单位必填", example = "HT202405001")
|
||||
@ExcelProperty("纸质合同号")
|
||||
private String zzhth;
|
||||
|
||||
@Schema(description = "小协议号(zxxyh)", example = "XY202405001")
|
||||
@ExcelProperty("小协议号")
|
||||
private String zxxyh;
|
||||
|
||||
@Schema(description = "备注(znote)", example = "月度常规采购")
|
||||
@ExcelProperty("备注")
|
||||
private String znote;
|
||||
|
||||
@Schema(description = "代理方(zlifnr),使用客商编码", example = "D0010001")
|
||||
@ExcelProperty("代理方编码")
|
||||
private String zlifnr;
|
||||
|
||||
// ====================== 3. 行项目字段(列表-item) ======================
|
||||
@Schema(description = "行号(EBELP)", requiredMode = Schema.RequiredMode.REQUIRED, example = "00010")
|
||||
@NotEmpty(message = "行号不能为空")
|
||||
@ExcelProperty("行号")
|
||||
private String poItem;
|
||||
|
||||
@Schema(description = "物料号(MATNR)", example = "M0010001")
|
||||
@ExcelProperty("物料号")
|
||||
private String material;
|
||||
|
||||
@Schema(description = "工厂(WERKS)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
@NotEmpty(message = "工厂不能为空")
|
||||
@ExcelProperty("工厂")
|
||||
private String plant;
|
||||
|
||||
@Schema(description = "库存地点(LGORT)", example = "0001")
|
||||
@ExcelProperty("库存地点")
|
||||
private String stgeLoc;
|
||||
|
||||
@Schema(description = "数量(MENGE),保留3位小数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.000")
|
||||
@NotNull(message = "数量不能为空")
|
||||
@ExcelProperty("数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "计量单位(MEINS),必须与该物料基本计量单位一致", requiredMode = Schema.RequiredMode.REQUIRED, example = "PC")
|
||||
@NotEmpty(message = "计量单位不能为空")
|
||||
@ExcelProperty("计量单位")
|
||||
private String poUnit;
|
||||
|
||||
@Schema(description = "含税单价(NETPR),保留2位小数", requiredMode = Schema.RequiredMode.REQUIRED, example = "199.99")
|
||||
@NotNull(message = "含税单价不能为空")
|
||||
@ExcelProperty("含税单价")
|
||||
private BigDecimal netPrice;
|
||||
|
||||
@Schema(description = "价格单位(PEINH),固定值1", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "价格单位不能为空")
|
||||
@ExcelProperty("价格单位")
|
||||
private Integer priceUnit;
|
||||
|
||||
@Schema(description = "税码(MWSKZ)", example = "J1")
|
||||
@ExcelProperty("税码")
|
||||
private String taxCode;
|
||||
|
||||
@Schema(description = "基于GR的发票校验(WEBRE)", example = "Y")
|
||||
@ExcelProperty("基于GR发票校验")
|
||||
private String grBasediv;
|
||||
|
||||
@Schema(description = "允许无限制过量交货(UEBTK)", example = "N")
|
||||
@ExcelProperty("允许过量交货")
|
||||
private String unlimitedDlv;
|
||||
|
||||
@Schema(description = "批次(CHARG)", example = "B202405001")
|
||||
@ExcelProperty("批次")
|
||||
private String batch;
|
||||
|
||||
@Schema(description = "项目类别(PSTYP),委托加工订单时填入L", example = "L")
|
||||
@ExcelProperty("项目类别")
|
||||
private String itemCat;
|
||||
|
||||
@Schema(description = "科目分配类别(KNTTP),固定资产采购:A;服务采购:S-销售服务费/K-成本中心/F-订单", example = "K")
|
||||
@ExcelProperty("科目分配类别")
|
||||
private String acctasscat;
|
||||
|
||||
@Schema(description = "物料组(MATKL),服务采购订单必填", example = "01")
|
||||
@ExcelProperty("物料组")
|
||||
private String matlGroup;
|
||||
|
||||
@Schema(description = "短文本(TXZ01),服务采购订单必填", example = "设备维修服务")
|
||||
@ExcelProperty("短文本")
|
||||
private String shortText;
|
||||
|
||||
@Schema(description = "退货项目标识(RETPO),退货行项目填X", example = "X")
|
||||
@ExcelProperty("退货标识")
|
||||
private String retItem;
|
||||
|
||||
@Schema(description = "免费项目标识(UMSON),免费行项目填X", example = "X")
|
||||
@ExcelProperty("免费标识")
|
||||
private String freeItem;
|
||||
|
||||
@Schema(description = "外部行项目号(LICHN),绿星链通必填", example = "EXT0010")
|
||||
@ExcelProperty("外部行号")
|
||||
private String vendrbatch;
|
||||
|
||||
@Schema(description = "备注信息-需求单位(TDLINE)", example = "生产一部")
|
||||
@ExcelProperty("需求单位备注")
|
||||
private String noteXq;
|
||||
|
||||
@Schema(description = "备注信息-物料详细(TDLINE)", example = "304不锈钢,厚度2mm")
|
||||
@ExcelProperty("物料详细备注")
|
||||
private String noteWl;
|
||||
|
||||
@Schema(description = "行项目删除标识(ELOEK)", example = "N")
|
||||
@ExcelProperty("行项目删除标识")
|
||||
private String itemDeleteInd;
|
||||
|
||||
// ====================== 4. 行项目扩展字段(列表-itex) ======================
|
||||
@Schema(description = "销售物料号(zmatnr),科目分配类别为S时必填", example = "S0010001")
|
||||
@ExcelProperty("销售物料号")
|
||||
private String zmatnr;
|
||||
|
||||
@Schema(description = "统计型内部订单(zaufnr)", example = "OR0010001")
|
||||
@ExcelProperty("统计内部订单")
|
||||
private String zaufnr;
|
||||
|
||||
@Schema(description = "采购类别(zpurty),0-生产性物资类;1-项目投资类", example = "0")
|
||||
@ExcelProperty("采购类别")
|
||||
private String zpurty;
|
||||
|
||||
@Schema(description = "原料湿重(zmenge)", example = "105.500")
|
||||
@ExcelProperty("原料湿重")
|
||||
private BigDecimal zmenge;
|
||||
|
||||
// ====================== 5. 科目分配字段(列表-acct,类别为K或P时使用) ======================
|
||||
@Schema(description = "科目分配的序号(DZEKKN),从1开始编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "科目分配序号不能为空")
|
||||
@ExcelProperty("科目分配序号")
|
||||
private Integer serialNo;
|
||||
|
||||
@Schema(description = "总账科目编号(SAKNR)", example = "1001010000")
|
||||
@ExcelProperty("总账科目")
|
||||
private String glAccount;
|
||||
|
||||
@Schema(description = "成本中心(KOSTL),科目分配类别为K或F时必填", example = "C0010001")
|
||||
@ExcelProperty("成本中心")
|
||||
private String costcenter;
|
||||
|
||||
@Schema(description = "订单号(AUFNR),科目分配类别为F时必填", example = "OR0010001")
|
||||
@ExcelProperty("订单号")
|
||||
private String orderid;
|
||||
|
||||
@Schema(description = "主资产号(ANLN1),科目分配类别为A时必填", example = "AS0010001")
|
||||
@ExcelProperty("主资产号")
|
||||
private String assetNo;
|
||||
|
||||
@Schema(description = "资产子编号(ANLN2),科目分配类别为A时必填,固定值‘0’", example = "0")
|
||||
@ExcelProperty("资产子编号")
|
||||
private String subNumber;
|
||||
|
||||
// ====================== 6. 委托加工物料字段(列表-comp,委托加工订单时使用) ======================
|
||||
@Schema(description = "计划行号(ETENR),从1开始编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "计划行号不能为空")
|
||||
@ExcelProperty("计划行号")
|
||||
private Integer schedLine;
|
||||
|
||||
@Schema(description = "项目编号(RSPOS),从1开始编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "项目编号不能为空")
|
||||
@ExcelProperty("项目编号")
|
||||
private Integer itemNo;
|
||||
|
||||
@Schema(description = "加工前物料号(MATNR)", requiredMode = Schema.RequiredMode.REQUIRED, example = "M0020001")
|
||||
@NotEmpty(message = "加工前物料号不能为空")
|
||||
@ExcelProperty("加工前物料号")
|
||||
private String compMaterial;
|
||||
|
||||
@Schema(description = "委托加工发货工厂(PLANT)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
@NotEmpty(message = "委托加工发货工厂不能为空")
|
||||
@ExcelProperty("委托发货工厂")
|
||||
private String compPlant;
|
||||
|
||||
@Schema(description = "委托加工需求数量(MENGE),保留3位小数", requiredMode = Schema.RequiredMode.REQUIRED, example = "95.000")
|
||||
@NotNull(message = "委托加工需求数量不能为空")
|
||||
@ExcelProperty("委托需求数量")
|
||||
private BigDecimal entryQuantity;
|
||||
|
||||
@Schema(description = "组件计量单位(MEINS),为空使用基本计量单位", example = "PC")
|
||||
@ExcelProperty("组件计量单位")
|
||||
private String entryUom;
|
||||
}
|
||||
@@ -72,4 +72,6 @@ public interface ErpCompanyService {
|
||||
ErpCompanyDO getErpCompanyByNumber(String number);
|
||||
|
||||
void test();
|
||||
|
||||
String test1();
|
||||
}
|
||||
@@ -16,9 +16,15 @@ 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.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -29,6 +35,7 @@ import java.util.stream.Collectors;
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
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 com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_ERROR_EXISTS;
|
||||
import static dm.jdbc.util.DriverUtil.log;
|
||||
|
||||
/**
|
||||
@@ -42,11 +49,14 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
|
||||
|
||||
@Resource
|
||||
private ErpCompanyMapper erpCompanyMapper;
|
||||
|
||||
@Resource
|
||||
private MyRedisConfig myRedisConfig;
|
||||
@Resource
|
||||
private ErpConfig erpConfig;
|
||||
@Value("${erp.address}")
|
||||
private String erpAddress;
|
||||
@Value("${erp.sapsys}")
|
||||
private String sapsys;
|
||||
|
||||
@Override
|
||||
public ErpCompanyRespVO createErpCompany(ErpCompanySaveReqVO createReqVO) {
|
||||
@@ -199,7 +209,7 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
|
||||
);
|
||||
Map<String, Long> numberIdMap = insertedRecords.stream()
|
||||
.collect(Collectors.toMap(ErpCompanyDO::getNumber, ErpCompanyDO::getId));
|
||||
myRedisConfig.addRedisCacheMap(result.key,numberIdMap);
|
||||
myRedisConfig.addRedisCacheMap(result.key, numberIdMap);
|
||||
}
|
||||
if (!result.toUpdate.isEmpty()) {
|
||||
erpCompanyMapper.updateBatch(result.toUpdate);
|
||||
@@ -250,4 +260,34 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
|
||||
throw exception(ERP_COMPANY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String test1() {
|
||||
try {
|
||||
String address = erpAddress + "-" + sapsys;
|
||||
OftenEnum.FuncnrEnum funcnrEnum = OftenEnum.FuncnrEnum.公司代码;
|
||||
String funcnr = funcnrEnum.getFuncnr();
|
||||
|
||||
// 构建完整URL
|
||||
String url = "http://" + erpAddress + "/api/rfc/get";
|
||||
// 构建请求参数
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("sapsys", sapsys);
|
||||
requestBody.put("funcnr", funcnr); // 获取枚举值
|
||||
|
||||
// 设置请求头
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.valueOf(MediaType.APPLICATION_JSON_UTF8_VALUE));
|
||||
|
||||
// 创建HTTP请求实体
|
||||
HttpEntity<String> requestEntity = new HttpEntity<>(requestBody.toJSONString(), headers);
|
||||
|
||||
// 发送POST请求
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
// ResponseEntity<String> response = restTemplate.postForEntity(url, requestEntity, String.class);
|
||||
return address;
|
||||
} catch (Exception e) {
|
||||
throw exception(ERP_ERROR_EXISTS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,14 @@ public interface ErpContractService {
|
||||
*/
|
||||
ErpContractDO getErpContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP合同映射通过合同主信息主键
|
||||
*
|
||||
* @param contractMainId 合同主信息主键
|
||||
* @return ERP合同映射
|
||||
*/
|
||||
ErpContractDO getErpContractByMainId(Long contractMainId);
|
||||
|
||||
/**
|
||||
* 获得ERP合同映射分页
|
||||
*
|
||||
|
||||
@@ -6,30 +6,26 @@ 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;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpContractPageReqVO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpContractRespVO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpContractSaveReqVO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpContractDO;
|
||||
import com.zt.plat.module.erp.dal.mysql.erp.ErpContractMapper;
|
||||
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;
|
||||
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;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_COMPANY_NOT_EXISTS;
|
||||
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.ERP_CONTRACT_NOT_EXISTS;
|
||||
import static dm.jdbc.util.DriverUtil.log;
|
||||
|
||||
@@ -102,6 +98,11 @@ public class ErpContractServiceImpl implements ErpContractService {
|
||||
return erpContractMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpContractDO getErpContractByMainId(Long contractMainId) {
|
||||
return erpContractMapper.selectOne("CTRT_MAIN_ID", contractMainId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ErpContractDO> getErpContractPage(ErpContractPageReqVO pageReqVO) {
|
||||
OftenEnum.FuncnrEnum funcnrEnum = OftenEnum.FuncnrEnum.合同信息;
|
||||
|
||||
Reference in New Issue
Block a user