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