diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index 39e3bf87e..831f292b4 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -155,7 +155,7 @@ public class WxFlowServiceImpl implements WxFlowService { */ @Override public void updateBusinessStatus(Map mapInfo,Integer applyStatus){ - Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); + String businessId = mapInfo.get("businessId").toString(); Integer flowType = getIngeter(mapInfo.get("flowType")); List> variables = (List)mapInfo.get("variables"); Integer contractType = 0; @@ -181,11 +181,20 @@ public class WxFlowServiceImpl implements WxFlowService { EnumFlowContractType.WHOLE_POINT.getCode().equals(contractType)) { WxRentContract rent = new WxRentContract(); - rent.setId(businessId); + //租金+合同的bussinessId 特殊 + Long bsId = 0L; + Long propetyId = 0L; + if (businessId.contains("&")) { + bsId = Long.parseLong(businessId.split("&")[0]); + propetyId = Long.parseLong(businessId.split("&")[1]); + }else { + bsId = Long.parseLong(businessId); + } + rent.setId(bsId); rent.setApplyStatus(applyStatus); rent.setBusinessType(flowType); - WxRentContract record = wxRentContractMapper.selectById(businessId); + WxRentContract record = wxRentContractMapper.selectById(bsId); boolean isrentproperty = false; Integer propertyStatus = null; @@ -193,7 +202,7 @@ public class WxFlowServiceImpl implements WxFlowService { if(record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())){ isrentproperty = true; } - String wholeProperyId = (String)mapInfo.get("wholeProperyId"); + //String wholeProperyId = (String)mapInfo.get("wholeProperyId"); //如果是提交审批 , 审批驳回状态不变 if (EnumRentContractAppStatus.APPLYING.getCode().intValue() == applyStatus.intValue()) { //如果合同的状态非正常,则不处理 @@ -206,15 +215,15 @@ public class WxFlowServiceImpl implements WxFlowService { } //如果审批完成 }else if (EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { - wxRentContractService.updateRentContractStatus(businessId); + wxRentContractService.updateRentContractStatus(bsId); if (isrentproperty) { - wxPropertyContractService.updatePropertyContractStatus(Long.parseLong(wholeProperyId)); + wxPropertyContractService.updatePropertyContractStatus(propetyId); } } wxRentContractService.updateApplyStatus(rent); if (isrentproperty) { WxPropertyContract wxPropertyContract = new WxPropertyContract(); - wxPropertyContract.setId(Long.parseLong(wholeProperyId)); + wxPropertyContract.setId(propetyId); wxPropertyContract.setRentContractId(record.getId()); wxPropertyContract.setStatus(propertyStatus); wxPropertyContract.setApplyStatus(applyStatus); @@ -224,7 +233,7 @@ public class WxFlowServiceImpl implements WxFlowService { }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType) || EnumFlowContractType.PROPERTY_POINT.getCode().equals(contractType)){ WxPropertyContract wxPropertyContract = new WxPropertyContract(); - wxPropertyContract.setId(businessId); + wxPropertyContract.setId(Long.parseLong(businessId)); wxPropertyContract.setApplyStatus(applyStatus); wxPropertyContract.setBusinessType(flowType); @@ -233,7 +242,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxPropertyContract.setStatus(EnumRentContractStatus.PERFORMANCE.getCode()); // 审批完成 }else if (EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { - wxPropertyContractService.updatePropertyContractStatus(businessId); + wxPropertyContractService.updatePropertyContractStatus(Long.parseLong(businessId)); } wxPropertyContractMapper.updateApplyStatus(wxPropertyContract); @@ -252,7 +261,17 @@ public class WxFlowServiceImpl implements WxFlowService { EnumFlowContractType.WHOLE_SHOP.getCode().equals(contractType) || EnumFlowContractType.WHOLE_POINT.getCode().equals(contractType)){ WxRentContract rent = new WxRentContract(); - rent.setId(businessId); + //租金+合同的bussinessId 特殊 + Long bsId ; + Long propetyId; + if (businessId.contains("&")) { + bsId = Long.parseLong(businessId.split("&")[0]); + propetyId = Long.parseLong(businessId.split("&")[1]); + }else { + bsId = Long.parseLong(businessId); + } + + rent.setId(bsId); rent.setApplyStatus(applyStatus); rent.setBusinessType(flowType); @@ -267,7 +286,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxRentContractService.updateApplyStatus(rent); }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType) || EnumFlowContractType.PROPERTY_POINT.getCode().equals(contractType)){ WxPropertyContract wxPropertyContract = new WxPropertyContract(); - wxPropertyContract.setId(businessId); + wxPropertyContract.setId(Long.parseLong(businessId)); wxPropertyContract.setApplyStatus(applyStatus); wxPropertyContract.setBusinessType(flowType); @@ -288,7 +307,7 @@ public class WxFlowServiceImpl implements WxFlowService { Long oldPrice = Long.parseLong(getVariableByKey(variables, "oldPrice").toString()); Long newPrice = Long.parseLong(getVariableByKey(variables, "newPrice").toString()); WxBillAll wxBillAll = new WxBillAll(); - wxBillAll.setId(businessId); + wxBillAll.setId(Long.parseLong(businessId)); wxBillAll.setBillTypeValue(billType); if(EnumBillUpdateType.LATEPAY.getCode().equals(billUpdateType)){ //修改滞纳金 wxBillAll.setOldLatePrice(oldPrice); @@ -303,7 +322,7 @@ public class WxFlowServiceImpl implements WxFlowService { List billList = new ArrayList<>(); WxBillSettleBill settleBill = new WxBillSettleBill(); settleBill.setBillType(billType); - settleBill.setBillId(businessId); + settleBill.setBillId(Long.parseLong(businessId)); billList.add(settleBill); wxBillSettleService.updateFreezeOrStatus(billList,EnumFreezeType.DEF.getCode(),null); }else if(EnumRentContractAppStatus.APPLYING.getCode().intValue() == applyStatus.intValue()) { @@ -311,7 +330,7 @@ public class WxFlowServiceImpl implements WxFlowService { List billList = new ArrayList<>(); WxBillSettleBill settleBill = new WxBillSettleBill(); settleBill.setBillType(billType); - settleBill.setBillId(businessId); + settleBill.setBillId(Long.parseLong(businessId)); billList.add(settleBill); wxBillSettleService.updateFreezeOrStatus(billList,EnumFreezeType.YES.getCode(),null); }else if(EnumRentContractAppStatus.SETBACK.getCode().intValue() == applyStatus.intValue() || EnumRentContractAppStatus.REJECT.getCode().intValue() == applyStatus.intValue()) { @@ -319,7 +338,7 @@ public class WxFlowServiceImpl implements WxFlowService { List billList = new ArrayList<>(); WxBillSettleBill settleBill = new WxBillSettleBill(); settleBill.setBillType(billType); - settleBill.setBillId(businessId); + settleBill.setBillId(Long.parseLong(businessId)); billList.add(settleBill); wxBillSettleService.updateFreezeOrStatus(billList,EnumFreezeType.DEF.getCode(),null); } @@ -328,7 +347,7 @@ public class WxFlowServiceImpl implements WxFlowService { || EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_PRESS_UPLINE.getCode().equals(flowType)) { WxCoupon wxCoupon = new WxCoupon(); - wxCoupon.setId(businessId); + wxCoupon.setId(Long.parseLong(businessId)); wxCoupon.setUpdateDate(new Date()); if(EnumCouponAppType.PUT.getCode().equals(operateType)){ @@ -380,11 +399,11 @@ public class WxFlowServiceImpl implements WxFlowService { clearCache(wxCoupon); }else if(EnumFlowKey.SETTLE.getCode().equals(flowType)){ WxBillSettle wxBillSettle = new WxBillSettle(); - wxBillSettle.setId(businessId); + wxBillSettle.setId(Long.parseLong(businessId)); wxBillSettle.setApplyStatus(applyStatus); //审批完成,账单解冻 - WxBillSettle settle = wxBillSettleService.getById(businessId, EnumFilterSettle.NO.getCode()); + WxBillSettle settle = wxBillSettleService.getById(Long.parseLong(businessId), EnumFilterSettle.NO.getCode()); if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { wxBillSettle.setStatus(EnumSettleStatus.NOT_FINISH.getCode()); wxBillSettleService.updateFreezeOrStatus(settle.getReceiveBillIds(), EnumFreezeType.DEF.getCode(),EnumBillRentStatus.PAID.getCode());