bms改造;
This commit is contained in:
+99
@@ -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<ContractManage> contractManages = contractManageMapper.selectList(new LambdaQueryWrapper<ContractManage>()
|
||||
.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<ContractManageParameters>()
|
||||
.eq(ContractManageParameters::getContractManageId, contractManageId),false);
|
||||
if (contractManageParameters == null) {
|
||||
continue;
|
||||
}
|
||||
String parametersJson = contractManageParameters.getParametersJson();
|
||||
Map<String, Object> parametersMap = JSON.parseObject(parametersJson, new TypeReference<Map<String, Object>>() {});
|
||||
//合约价
|
||||
BigDecimal hyj = (BigDecimal) parametersMap.get("hyj");
|
||||
buildBusinessDocument(hyj,settlementCustomers,contractManage,"","","");
|
||||
}
|
||||
}
|
||||
|
||||
private void buildBusinessDocument(BigDecimal fee, SettlementCustomersPO settlementCustomers,ContractManage contractManage, String code, String name, String warehouseType) {
|
||||
|
||||
Long settlementCustomersId = settlementCustomers.getSettlementCustomersId();
|
||||
Long settlementEntityId = settlementCustomers.getSettlementEntityId();
|
||||
String settlementEntity = settlementCustomers.getSettlementEntity();
|
||||
String settlementCustomersCode = settlementCustomers.getSettlementCustomersCode();
|
||||
BusinessDocumentFeign businessDocumentFeign = new BusinessDocumentFeign();
|
||||
businessDocumentFeign.setBillAmount(fee);
|
||||
businessDocumentFeign.setOrganizationId(contractManage.getOrganizationId());
|
||||
businessDocumentFeign.setOrganizationName(contractManage.getOrganizationName());
|
||||
businessDocumentFeign.setTopOrganizationId(contractManage.getTopOrganizationId());
|
||||
businessDocumentFeign.setBelongModuleCode("wms");
|
||||
businessDocumentFeign.setBelongModule("WMS");
|
||||
businessDocumentFeign.setDataSources(1);
|
||||
businessDocumentFeign.setSettlementEntity(settlementEntity);
|
||||
businessDocumentFeign.setSettlementCustomersId(settlementCustomersId);
|
||||
businessDocumentFeign.setSettlementCustomersCode(settlementCustomersCode);
|
||||
businessDocumentFeign.setDocumentTypeId(4l);
|
||||
businessDocumentFeign.setDocumentTypeCode("CM_ZL");
|
||||
businessDocumentFeign.setDocumentType("仓库租赁单");
|
||||
businessDocumentFeign.setFirstSubjectCode(code);
|
||||
businessDocumentFeign.setFirstSubjectName(name);
|
||||
businessDocumentFeign.setBillingTime(new Date());
|
||||
businessDocumentFeign.setServiceItemsCode("GC_CZ");
|
||||
businessDocumentFeign.setServiceItemsName("干仓仓租费用");
|
||||
businessDocumentFeign.setSettlementWay(1);
|
||||
businessDocumentFeign.setOriginalBusinessNum(contractManage.getContractNumber());
|
||||
businessDocumentFeign.setWarehouseType(warehouseType);
|
||||
String contractName = contractManage.getContractName();
|
||||
String contractNumber = contractManage.getContractNumber();
|
||||
Long contractManageId = contractManage.getContractManageId();
|
||||
businessDocumentFeign.setContractName(contractName);
|
||||
businessDocumentFeign.setContractNumber(contractNumber);
|
||||
businessDocumentFeign.setContractManageId(contractManageId);
|
||||
businessDocumentFeign.setBusinessFlow(OrderSequence.getOrderCode("LS"));
|
||||
businessDocumentFeign.setIsPush(1);
|
||||
AjaxResult ajaxResult = bmsServiceFeign.feignSaveBusinessDocument(businessDocumentFeign);
|
||||
if (ajaxResult == null || !"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
log.error("保存业务单据失败: {}", ajaxResult != null ? ajaxResult.get("msg") : "feign调用异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-4
@@ -23,10 +23,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -244,4 +241,8 @@ public class ContractManageDomainService {
|
||||
}
|
||||
return contractManagePO;
|
||||
}
|
||||
|
||||
public Map<String,Object> getSettlementCustomers(String shipperId) {
|
||||
|
||||
}
|
||||
}
|
||||
+16
@@ -413,4 +413,20 @@ public class MaterialBaseInfo extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
}
|
||||
+16
@@ -399,4 +399,20 @@ public class MaterialBaseInfoPO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
}
|
||||
+16
@@ -405,4 +405,20 @@ public class MaterialBaseInfoDO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
}
|
||||
+16
@@ -82,4 +82,20 @@ public class MaterialClassify extends BaseVOEntity{
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
|
||||
}
|
||||
+16
@@ -89,4 +89,20 @@ public class MaterialClassifyPO extends BaseVOEntity{
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
|
||||
}
|
||||
+16
@@ -89,4 +89,20 @@ public class MaterialClassifyDO extends BaseVOEntity{
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
}
|
||||
+15
@@ -385,4 +385,19 @@ public class MaterialBaseInfoDTO extends BaseVOEntity{
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
}
|
||||
+16
@@ -89,4 +89,20 @@ public class MaterialClassifyDTO extends BaseVOEntity{
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("每月仓租")
|
||||
@Excel(name = "每月仓租")
|
||||
private BigDecimal monthlyWarehouseRent;
|
||||
|
||||
@ApiModelProperty("半月仓租")
|
||||
@Excel(name = "半月仓租")
|
||||
private BigDecimal halfMonthWarehouseRent;
|
||||
|
||||
@ApiModelProperty("每月仓租单位")
|
||||
@Excel(name = "每月仓租单位")
|
||||
private String monthlyWarehouseRentUnit;
|
||||
|
||||
@ApiModelProperty("半月仓租单位")
|
||||
@Excel(name = "半月仓租单位")
|
||||
private String halfMonthWarehouseRentUnit;
|
||||
}
|
||||
+21
@@ -9,6 +9,8 @@ import com.mhd.basic.interfaces.dto.contractManage.ContractManageExportVO;
|
||||
import com.mhd.basic.interfaces.dto.contractManage.SubjectAndPriceDTO;
|
||||
import com.mhd.basic.interfaces.dto.contractManage.SubjectAndPriceReturn;
|
||||
import com.mhd.system.api.domain.ContractManageFeignDTO;
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -250,4 +252,23 @@ public class ContractManageApi extends BaseController{
|
||||
util.exportExcel(response, list, "合同导出");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 1. 简单任务示例(Bean模式)
|
||||
* 这里的 demoJobHandler 必须和调度中心配置一致
|
||||
*/
|
||||
@XxlJob("pushContractManageToBms")
|
||||
public void pushContractManageToBms() {
|
||||
// 获取任务参数(货主id)
|
||||
String shipperId = XxlJobHelper.getJobParam();
|
||||
logger.info("XXL-JOB 开始入库业务单推送bms计费流水,货主id参数:{}", shipperId);
|
||||
try {
|
||||
// 设置任务执行结果
|
||||
XxlJobHelper.handleSuccess("入库业务单推送bms计费流水执行成功");
|
||||
} catch (Exception e) {
|
||||
logger.error("XXL-JOB 执行失败", e);
|
||||
XxlJobHelper.handleFail("入库业务单推送bms计费流水执行失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user