合同提交erp功能编写
This commit is contained in:
@@ -27,6 +27,7 @@ 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.controller.admin.erp.vo.ErpContractSaveReqVO;
|
||||
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;
|
||||
@@ -838,9 +839,9 @@ public class ContractServiceImpl implements ContractService {
|
||||
if (contractMainDO != null) {
|
||||
|
||||
// 生成ERP合同映射表
|
||||
ErpContractDO erpContractDO = new ErpContractDO();
|
||||
ErpContractSaveReqVO erpContractVO = new ErpContractSaveReqVO();
|
||||
// 合同主信息表主键:BSE_CTRT_MAIN
|
||||
erpContractDO.setContractMainId(id);
|
||||
erpContractVO.setContractMainId(id);
|
||||
// 操作标识:OPTN_ID
|
||||
// 1、先调用009ERP接口查询合同信息
|
||||
ErpContractPageReqVO pageReqVO = new ErpContractPageReqVO();
|
||||
@@ -863,111 +864,126 @@ public class ContractServiceImpl implements ContractService {
|
||||
PageResult<ErpContractDO> erpContractPage = erpContractService.getErpContractPage(pageReqVO);
|
||||
if (erpContractPage.getTotal() > 0) {
|
||||
// 2、如果009接口返回值中“合同编号”字段存在值,并且与传入的相同,则OPTN_ID值为“1”
|
||||
erpContractDO.setOperationId("1");
|
||||
erpContractVO.setOperationId("1");
|
||||
} else {
|
||||
// 3、如果009接口返回值中“合同编号”字段不存在值,根据合同主键查询映射表中是否存在没有删除的数据,如果有,值为“1”,如果没有,值为“0”
|
||||
/*ErpContractDO erpContract = erpContractService.getErpContractByMainId(id);
|
||||
ErpContractDO erpContract = erpContractService.getErpContractByMainId(id);
|
||||
if (erpContract != null) {
|
||||
erpContractDO.setOperationId("1");
|
||||
erpContractVO.setOperationId("1");
|
||||
} else {
|
||||
erpContractDO.setOperationId("0");
|
||||
}*/
|
||||
erpContractVO.setOperationId("0");
|
||||
}
|
||||
}
|
||||
// erpContractDO.setOperationId();
|
||||
// 合同编号:CTRT_PPR_NUM
|
||||
erpContractDO.setContractPaperNumber(contractMainDO.getContractPaperNumber());
|
||||
erpContractVO.setContractPaperNumber(contractMainDO.getContractPaperNumber());
|
||||
// 合同名称:CTRT_NAME
|
||||
erpContractDO.setContractName(contractMainDO.getContractName());
|
||||
erpContractVO.setContractName(contractMainDO.getContractName());
|
||||
// 合同类型编号:CTRT_TP_NUM
|
||||
erpContractDO.setContractTypeNumber(contractMainDO.getConstructionTypeNumber());
|
||||
erpContractVO.setContractTypeNumber(contractMainDO.getConstructionTypeNumber());
|
||||
// 合同类型名称:CTRT_TP_NAME
|
||||
erpContractDO.setContractTypeName(contractMainDO.getConstructionTypeName());
|
||||
erpContractVO.setContractTypeName(contractMainDO.getConstructionTypeName());
|
||||
// 合同类别:CTRT_CTGR
|
||||
erpContractDO.setContractCategory(contractMainDO.getCategory());
|
||||
erpContractVO.setContractCategory(contractMainDO.getCategory());
|
||||
// 是否虚拟合同:IS_VRTL_CTRT
|
||||
erpContractDO.setIsVirtualContract(contractMainDO.getContractVirtual());
|
||||
erpContractVO.setIsVirtualContract(contractMainDO.getContractVirtual());
|
||||
// 客商编号:SPLR_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司编码”,反之为“ERP甲方公司编码”
|
||||
// 客商名称:SPLR_NAME 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司名称”,反之为“ERP甲方公司名称”
|
||||
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractDO.setSupplierNumber(contractMainDO.getSalesCompanyNumber());
|
||||
erpContractDO.setSupplierName(contractMainDO.getSalesCompanyName());
|
||||
erpContractVO.setSupplierNumber(contractMainDO.getSalesCompanyNumber());
|
||||
erpContractVO.setSupplierName(contractMainDO.getSalesCompanyName());
|
||||
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractDO.setSupplierNumber(contractMainDO.getPurchaseCompanyNumber());
|
||||
erpContractDO.setSupplierName(contractMainDO.getPurchaseCompanyName());
|
||||
erpContractVO.setSupplierNumber(contractMainDO.getPurchaseCompanyNumber());
|
||||
erpContractVO.setSupplierName(contractMainDO.getPurchaseCompanyName());
|
||||
}
|
||||
// 代理方:AGT
|
||||
erpContractDO.setAgent(contractMainDO.getAgent());
|
||||
erpContractVO.setAgent(contractMainDO.getAgent());
|
||||
// 合同实施主体编号:CTRT_IMPL_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司编码”,反之为“ERP乙方公司编码”
|
||||
// 合同签订主体编号:CTRT_SGN_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司名称”,反之为“ERP乙方公司名称”
|
||||
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractDO.setContractImplementNumber(contractMainDO.getPurchaseCompanyNumber());
|
||||
erpContractDO.setContractSignNumber(contractMainDO.getPurchaseCompanyName());
|
||||
erpContractVO.setContractImplementNumber(contractMainDO.getPurchaseCompanyNumber());
|
||||
erpContractVO.setContractSignNumber(contractMainDO.getPurchaseCompanyName());
|
||||
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractDO.setContractImplementNumber(contractMainDO.getSalesCompanyNumber());
|
||||
erpContractDO.setContractSignNumber(contractMainDO.getSalesCompanyName());
|
||||
erpContractVO.setContractImplementNumber(contractMainDO.getSalesCompanyNumber());
|
||||
erpContractVO.setContractSignNumber(contractMainDO.getSalesCompanyName());
|
||||
}
|
||||
// 合同签订日期:SGN_DT
|
||||
if (contractMainDO.getSignDate() != null) {
|
||||
erpContractDO.setSignDate(contractMainDO.getSignDate().toLocalDate());
|
||||
erpContractVO.setSignDate(contractMainDO.getSignDate().toLocalDate());
|
||||
}
|
||||
// 合同起始日期:STRT_DT
|
||||
if (contractMainDO.getStartDate() != null) {
|
||||
erpContractDO.setStartDate(contractMainDO.getStartDate().toLocalDate());
|
||||
erpContractVO.setStartDate(contractMainDO.getStartDate().toLocalDate());
|
||||
}
|
||||
// 合同终止日期:STOP_DT
|
||||
if (contractMainDO.getEndDate() != null) {
|
||||
erpContractDO.setStopDate(contractMainDO.getEndDate().toLocalDate());
|
||||
erpContractVO.setStopDate(contractMainDO.getEndDate().toLocalDate());
|
||||
}
|
||||
// 币种编号:CUR
|
||||
erpContractDO.setCurrency(contractMainDO.getCurrency());
|
||||
erpContractVO.setCurrency(contractMainDO.getCurrency());
|
||||
// 合同总金额(原币-含税):SRC_AMT
|
||||
erpContractDO.setSourceAmount(contractMainDO.getCooAmount());
|
||||
erpContractVO.setSourceAmount(contractMainDO.getCooAmount());
|
||||
// 合同总金额(本位币-含税):BSC_AMT
|
||||
erpContractDO.setBasicAmount(contractMainDO.getBasicAmount());
|
||||
erpContractVO.setBasicAmount(contractMainDO.getBasicAmount());
|
||||
// 变更后合同总金额(原币-含税):CHG_SRC_AMT
|
||||
erpContractDO.setChangeSourceAmount(contractMainDO.getChangeCooAmount());
|
||||
erpContractVO.setChangeSourceAmount(contractMainDO.getChangeCooAmount());
|
||||
// 变更后合同总金额(本位币-含税):CHG_BSC_AMT
|
||||
erpContractDO.setChangeBasicAmount(contractMainDO.getChangeBasicAmount());
|
||||
erpContractVO.setChangeBasicAmount(contractMainDO.getChangeBasicAmount());
|
||||
// 合同状态编号:STS_NUM 参照060接口
|
||||
erpContractDO.setStatusNumber(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getCode());
|
||||
erpContractVO.setStatusNumber(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getCode());
|
||||
// 合同状态名称:STS_NAME 参照060接口
|
||||
erpContractDO.setStatusName(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getLabel());
|
||||
erpContractVO.setStatusName(DictEnum.SUBMIT_ERP_CTRT_STS_EF.getLabel());
|
||||
// 是否有预付款:IS_PPYM
|
||||
erpContractDO.setIsPrepayment(contractMainDO.getHasPrepayment());
|
||||
erpContractVO.setIsPrepayment(contractMainDO.getHasPrepayment());
|
||||
// 预付款比例:PPYM_RTIO
|
||||
erpContractDO.setPrepaymentRatio(contractMainDO.getPrepaymentRatio());
|
||||
erpContractVO.setPrepaymentRatio(contractMainDO.getPrepaymentRatio());
|
||||
// 预付款金额:PPYM_AMT
|
||||
erpContractDO.setPrepaymentAmount(contractMainDO.getPrepaymentAmount());
|
||||
erpContractVO.setPrepaymentAmount(contractMainDO.getPrepaymentAmount());
|
||||
// 履约保证金-变更前(原币):SRC_BFR_BND
|
||||
erpContractDO.setSourceBeforeBond(contractMainDO.getChangeCooAmountDeposit());
|
||||
erpContractVO.setSourceBeforeBond(contractMainDO.getChangeCooAmountDeposit());
|
||||
// 履约保证金-变更前(本位币):BSC_BFR_BND
|
||||
erpContractDO.setBasicBeforeBond(contractMainDO.getChangeBasicAmountDeposit());
|
||||
erpContractVO.setBasicBeforeBond(contractMainDO.getChangeBasicAmountDeposit());
|
||||
// 履约保证金-变更后(原币):SRC_AFT_BND
|
||||
erpContractDO.setSourceAfterBond(contractMainDO.getChangeCooAmountDeposit());
|
||||
erpContractVO.setSourceAfterBond(contractMainDO.getChangeCooAmountDeposit());
|
||||
// 履约保证金-变更后(本位币):BSC_AFT_BND
|
||||
erpContractDO.setBasicAfterBond(contractMainDO.getChangeBasicAmountDeposit());
|
||||
erpContractVO.setBasicAfterBond(contractMainDO.getChangeBasicAmountDeposit());
|
||||
// 是否含质保金:IS_QUA_AMT
|
||||
erpContractDO.setIsQualityassuranceAmount(contractMainDO.getHasQualityAmount());
|
||||
erpContractVO.setIsQualityassuranceAmount(contractMainDO.getHasQualityAmount());
|
||||
// 质保金比例:QUA_RTIO
|
||||
erpContractDO.setQualityassuranceRatio(contractMainDO.getQualityRatio());
|
||||
erpContractVO.setQualityassuranceRatio(contractMainDO.getQualityRatio());
|
||||
// 质保金金额:QUA_AMT
|
||||
erpContractDO.setQualityassuranceAmount(contractMainDO.getQualityAmount());
|
||||
erpContractVO.setQualityassuranceAmount(contractMainDO.getQualityAmount());
|
||||
// 是否内部企业:IS_INTL
|
||||
erpContractDO.setIsInternal(contractMainDO.getIsInternal());
|
||||
erpContractVO.setIsInternal(contractMainDO.getIsInternal());
|
||||
// 收支性质:NTR
|
||||
erpContractDO.setNature(contractMainDO.getDirection());
|
||||
erpContractVO.setNature(contractMainDO.getDirection());
|
||||
// 备注信息:RMK
|
||||
erpContractDO.setRemark(contractMainDO.getRemark());
|
||||
erpContractVO.setRemark(contractMainDO.getRemark());
|
||||
// 是否框架合同:IS_FMWK
|
||||
erpContractDO.setIsFramework(contractMainDO.getIsFramework());
|
||||
erpContractVO.setIsFramework(contractMainDO.getIsFramework());
|
||||
// 境内/境外:IS_DOM
|
||||
erpContractDO.setIsDomestic(contractMainDO.getIsDomestic());
|
||||
erpContractVO.setIsDomestic(contractMainDO.getIsDomestic());
|
||||
// 达到收款条件金额:PYEE_CND_AMT
|
||||
erpContractDO.setPayeeConditionAmount(contractMainDO.getPayeeConditionAmount());
|
||||
erpContractVO.setPayeeConditionAmount(contractMainDO.getPayeeConditionAmount());
|
||||
// 建筑服务发生地:ARCH_SVC_PLCE
|
||||
erpContractDO.setArchitectureServicePlace(contractMainDO.getArchitectureServicePlace());
|
||||
erpContractVO.setArchitectureServicePlace(contractMainDO.getArchitectureServicePlace());
|
||||
|
||||
// 公司编号
|
||||
erpContractVO.setCompanyId(contractMainDO.getCompanyId());
|
||||
// 公司名称
|
||||
erpContractVO.setCompanyName(contractMainDO.getCompanyName());
|
||||
// 部门编号
|
||||
erpContractVO.setDeptId(contractMainDO.getDeptId());
|
||||
// 部门名称
|
||||
erpContractVO.setDeptName(contractMainDO.getDeptName());
|
||||
// 岗位编号
|
||||
erpContractVO.setPostId(contractMainDO.getPostId());
|
||||
// 创建者
|
||||
erpContractVO.setCreatorName(contractMainDO.getCreatorName());
|
||||
// 更新者
|
||||
erpContractVO.setUpdaterName(contractMainDO.getUpdaterName());
|
||||
|
||||
// 调用ERP模块
|
||||
erpContractService.submitErp(erpContractVO);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user