diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java
index c46ed32b1..567a2a6c7 100644
--- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java
+++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/BmsServiceFeign.java
@@ -70,6 +70,6 @@ public interface BmsServiceFeign {
@PostMapping("/businessDocumentApi/wholeRentSynchronizationZXF")
public AjaxResult wholeRentSynchronizationZXF(@RequestBody BusinessDataPushDTO businessDataPushDTO);
- @PostMapping("/businessDocumentApi/save")
+ @PostMapping("/businessDocumentApi/feignSave")
public AjaxResult feignSaveBusinessDocument(@RequestBody BusinessDocumentFeign businessDocumentFeign);
}
\ No newline at end of file
diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/BusinessDocumentFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/BusinessDocumentFeign.java
index a25cdc40c..d460e8f3f 100644
--- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/BusinessDocumentFeign.java
+++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/BusinessDocumentFeign.java
@@ -194,4 +194,10 @@ public class BusinessDocumentFeign extends BaseVOEntity{
private BigDecimal billingUnitPrice;
@ApiModelProperty("nc科目编码")
private String ncSubjectCode;
+
+ @ApiModelProperty("是否推送")
+ private Integer isPush;
+
+ @ApiModelProperty("仓库类型")
+ private String warehouseType;
}
\ No newline at end of file
diff --git a/mhd-modules/mhd-system/pom.xml b/mhd-modules/mhd-system/pom.xml
index 505d9822a..cb2dcc86f 100644
--- a/mhd-modules/mhd-system/pom.xml
+++ b/mhd-modules/mhd-system/pom.xml
@@ -111,6 +111,11 @@
2.24
+
+ com.xuxueli
+ xxl-job-core
+ 2.4.0
+
diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java
index b785649b5..ff7c71714 100644
--- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java
+++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java
@@ -18,6 +18,8 @@ import com.mhd.basic.domain.contractManageDetail.repository.po.ContractManageDet
import com.mhd.basic.domain.contractManageDetail.repository.todo.ContractManageDetailDO;
import com.mhd.basic.domain.contractManageDetail.service.ContractManageDetailDomainService;
import com.mhd.basic.domain.contractManageParameters.entity.ContractManageParameters;
+import com.mhd.basic.domain.contractManageParameters.repository.facade.IContractManageParametersService;
+import com.mhd.basic.domain.contractManageParameters.repository.mapper.ContractManageParametersMapper;
import com.mhd.basic.domain.contractManageParameters.repository.po.ContractManageParametersPO;
import com.mhd.basic.domain.contractManageParameters.repository.todo.ContractManageParametersDO;
import com.mhd.basic.domain.contractManageParameters.service.ContractManageParametersDomainService;
@@ -38,6 +40,8 @@ import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.BmsServiceFeign;
import com.mhd.system.api.SystemServiceFeign;
+import com.mhd.system.api.domain.BusinessDocumentFeign;
+import com.mhd.system.api.domain.MaterialInventoryPO;
import com.mhd.system.api.domain.SysDictData;
import com.mhd.system.api.model.LoginUser;
import com.mhd.system.service.ISysDictTypeService;
@@ -86,6 +90,10 @@ public class ContractManageApplicationService {
@Autowired
private ContractManageParametersAssembler contractManageParametersAssembler;
+ @Autowired
+ private ContractManageParametersMapper contractManageParametersMapper;
+ @Autowired
+ private IContractManageParametersService contractManageParametersService;
/**
@@ -1275,4 +1283,95 @@ public class ContractManageApplicationService {
}
return exportList;
}
+
+ /*
+ * 获取结算对象
+ * */
+ public SettlementCustomersPO getSettlementCustomers(Long shipperId) {
+ try {
+ Long topOrganizationId = null;
+ AjaxResult ajaxResult = bmsServiceFeign.getCustomersInfoBySettlementEntityId(shipperId, topOrganizationId);
+ if (ajaxResult == null || !"200".equals(String.valueOf(ajaxResult.get("code"))) || ajaxResult.get("data") == null) {
+ log.warn("按 settlementEntityId 查询结算对象未成功:shipperId={}, code={}", shipperId, ajaxResult != null ? ajaxResult.get("code") : null);
+ return null;
+ }
+ return JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")), SettlementCustomersPO.class);
+ } catch (Exception e) {
+ log.warn("按 settlementEntityId 查询结算对象异常,shipperId={}", shipperId, e);
+ return null;
+ }
+ }
+
+ public void pushContractManageToBms(String shipperId) {
+ SettlementCustomersPO settlementCustomers = getSettlementCustomers(Long.valueOf(shipperId));
+ if (settlementCustomers == null) {
+ log.warn("pushContractManageToBms 未找到结算对象,shipperId={}", shipperId);
+ return;
+ }
+ Long settlementCustomersId = settlementCustomers.getSettlementCustomersId();
+ List contractManages = contractManageMapper.selectList(new LambdaQueryWrapper()
+ .eq(ContractManage::getContractRentType, "NORMAL")
+ .eq(ContractManage::getContractState, 2)
+ .eq(ContractManage::getDelFlag, 1)
+ .eq(ContractManage::getSettlementCustomersId, settlementCustomers.getSettlementCustomersId()));
+ if (contractManages == null || contractManages.isEmpty()) {
+ log.warn("未找到正式合同");
+ return;
+ }
+ for (ContractManage contractManage : contractManages) {
+ Long contractManageId = contractManage.getContractManageId();
+ ContractManageParameters contractManageParameters = contractManageParametersService.getOne(new LambdaQueryWrapper()
+ .eq(ContractManageParameters::getContractManageId, contractManageId),false);
+ if (contractManageParameters == null) {
+ continue;
+ }
+ String parametersJson = contractManageParameters.getParametersJson();
+ Map parametersMap = JSON.parseObject(parametersJson, new TypeReference