租赁推送到bms合同查询查不到就查通用
This commit is contained in:
+4
-4
@@ -472,7 +472,7 @@ public class LeaseApplicationService {
|
||||
jsonObject.put("lease_area",leasePO.getLeaseArea());//租赁面积
|
||||
jsonObject.put("jiecun_cbm",0);//结存体积
|
||||
businessDataPushDTO.setDocumentFormJson(jsonObject.toJSONString());
|
||||
businessDataPushDTO.setDocumentTypeCode("ckzld");
|
||||
businessDataPushDTO.setDocumentTypeCode("仓库租赁单");
|
||||
businessDataPushDTO.setSettlementEntityId(leasePO.getShipperId());
|
||||
businessDataPushDTO.setSecondSubjectCode(leasePO.getSecondSubjectCode());
|
||||
businessDataPushDTO.setServiceItemsCode(leasePO.getServiceItemsCode());
|
||||
@@ -518,10 +518,10 @@ public class LeaseApplicationService {
|
||||
jsonObject.put("lease_area",0);//租赁面积
|
||||
jsonObject.put("jiecun_cbm",totalVolume);//结存体积
|
||||
businessDataPushDTO.setDocumentFormJson(jsonObject.toJSONString());
|
||||
businessDataPushDTO.setDocumentTypeCode("ckzld");
|
||||
businessDataPushDTO.setDocumentTypeCode("仓库租赁单");
|
||||
businessDataPushDTO.setSettlementEntityId(leasePO.getShipperId());
|
||||
businessDataPushDTO.setSecondSubjectCode("26WMS01");
|
||||
businessDataPushDTO.setServiceItemsCode("26WMS费用");
|
||||
businessDataPushDTO.setSecondSubjectCode(leasePO.getSecondSubjectCode());
|
||||
businessDataPushDTO.setServiceItemsCode(leasePO.getServiceItemsCode());
|
||||
businessDataPushDTO.setDataSources(1);
|
||||
bmsServiceFeign.businessDocumentApiSave(businessDataPushDTO);
|
||||
}
|
||||
|
||||
+3
-1
@@ -478,5 +478,7 @@ public class ContractManageApplicationService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ContractManagePO getGeneralContract() {
|
||||
return contractManageDomainService.getGeneralContract();
|
||||
}
|
||||
}
|
||||
|
||||
+35
-9
@@ -155,13 +155,39 @@ public class ContractManageDomainService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public ContractManagePO getGeneralContract() {
|
||||
ContractManagePO contractManagePO = new ContractManagePO();
|
||||
LambdaQueryWrapper<ContractManage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ContractManage::getCommonContractFlag,1);
|
||||
queryWrapper.eq(ContractManage::getDelFlag,1);
|
||||
ContractManage contractManage = contractManageService.getOne(queryWrapper);
|
||||
if(null != contractManage){
|
||||
BeanUtils.copyProperties(contractManage,contractManagePO);
|
||||
//得到合同后,查询合同明细
|
||||
List<ContractManageDetailPO> contractManageDetailPOList = contractManageDetailDomainService.queryListByManageId(contractManagePO.getContractManageId());
|
||||
List<ContractManageDetailPO> contractManageDetailSaveList = new ArrayList<>();
|
||||
if(contractManageDetailPOList != null && contractManageDetailPOList.size()>0){
|
||||
//将临时合同中没有,但是通用合同中有的数据过滤出(使用 ObjectUtil.equal 避免 firstSubjectCode/secondSubjectCode 为 null 时 NPE)
|
||||
contractManageDetailSaveList = contractManageDetailPOList.stream().filter(item -> contractManageDetailPOList.stream().anyMatch(item1 -> ObjectUtil.equal(item1.getFirstSubjectCode(), item.getFirstSubjectCode()) && ObjectUtil.equal(item1.getSecondSubjectCode(), item.getSecondSubjectCode()) && item1.getSubjectType()==1)).collect(Collectors.toList());
|
||||
//首先根据结算科目类型将临时合同过滤出
|
||||
List<ContractManageDetailPO> tempContractManageDetailPOList = contractManageDetailPOList.stream().filter(item -> item.getSubjectType()==2).collect(Collectors.toList());
|
||||
//遍历两个集合,将相同费用科目code的数据,进行比较,如果结算科目类型是临时且合同有效期有效,则使用该条数据,将另一条移除
|
||||
for (ContractManageDetailPO manageDetailPO : tempContractManageDetailPOList) {
|
||||
for (ContractManageDetailPO contractManageDetailPO : contractManageDetailPOList) {
|
||||
if(ObjectUtil.equal(contractManageDetailPO.getFirstSubjectCode(), manageDetailPO.getFirstSubjectCode()) && ObjectUtil.equal(contractManageDetailPO.getSecondSubjectCode(), manageDetailPO.getSecondSubjectCode())){
|
||||
//判断如果是临时合同在有效期内,则将该条数据保存到集合contractManageDetailSaveList
|
||||
DateTime start = DateUtil.parseDate(DateUtil.format(manageDetailPO.getSubjectEffectiveDate(),"yyyy-MM-dd"));
|
||||
DateTime end = DateUtil.parseDateTime(DateUtil.format(manageDetailPO.getSubjectEffectiveDate(),"yyyy-MM-dd"));
|
||||
DateTime now = DateUtil.beginOfDay(DateUtil.date());
|
||||
if (now.isAfterOrEquals(start) && now.isBefore(end)) {
|
||||
contractManageDetailSaveList.add(manageDetailPO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
contractManagePO.setContractManageDetailPOList(contractManageDetailSaveList);
|
||||
}
|
||||
return contractManagePO;
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -126,6 +126,13 @@ public class ContractManageApi extends BaseController{
|
||||
return AjaxResult.success(contractManageApplicationService.getInfoByCode(contractNumber));
|
||||
}
|
||||
|
||||
@ApiOperation("查询通用合同")
|
||||
@GetMapping(value = "/getGeneralContract")
|
||||
public AjaxResult getGeneralContract()
|
||||
{
|
||||
return AjaxResult.success(contractManageApplicationService.getGeneralContract());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询所有合同管理")
|
||||
@GetMapping("/queryList")
|
||||
|
||||
Reference in New Issue
Block a user