From 5d932ba305850f03db5124fa90e7ce0fb7decc0d Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 26 Feb 2019 14:51:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=93=9C=E9=94=A3=E6=B9=BE][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E9=A2=84=E8=B4=A6=E5=8D=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/service/impl/WxFlowServiceImpl.java | 13 +++++++------ .../service/impl/WxMerchantServiceImpl.java | 10 +++++++++- .../service/impl/WxPropertyContractServiceImpl.java | 5 +++-- .../service/impl/WxRentContractServiceImpl.java | 6 ++++-- .../main/resources/mapper/WxBillPropertyMapper.xml | 3 ++- .../src/main/resources/mapper/WxBillRentMapper.xml | 7 +++++-- 6 files changed, 30 insertions(+), 14 deletions(-) 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 84e170f41..473723699 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -93,17 +93,18 @@ public class WxFlowServiceImpl implements WxFlowService { */ @Override public void updateBusinessStatus(Map mapInfo,Integer applyStatus){ - Long businessId = Long.parseLong((String)mapInfo.get("businessId")); + Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); Integer flowType = (Integer)mapInfo.get("flowType"); List> variables = (List)mapInfo.get("variables"); Boolean supplement = (Boolean)mapInfo.get("supplement"); - Integer contractType = 0;// 1租赁合同2点位合同3物业合同4点位物业合同 + Integer contractType = 0; String str = (String)getVariableByKey(variables,"contractType"); if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } if(1 == flowType){ + // 1租赁合同 2点位合同 3物业 4点位物业合同 if(contractType.intValue() == 1 || contractType.intValue() == 2){ WxRentContract rent = new WxRentContract(); rent.setId(businessId); @@ -177,7 +178,7 @@ public class WxFlowServiceImpl implements WxFlowService { @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class}) public ResultData start(Map params,Long userId,String userName,String tenantId) { String remark = (String)params.get("remark"); - Long businessId = Long.parseLong((String)params.get("businessId")); + Long businessId = Long.parseLong(params.get("businessId").toString()); Integer flowType = (Integer)params.get("businessType"); List> taskAssignee = (List)params.get("taskAssignee"); List> variables = (List)params.get("variables"); @@ -438,7 +439,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgValidationcode.setTenantId(tenantId); MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); List> taskAssigneeList = (List)mapInfo.get("taskAssignee"); - Long businessId = Long.parseLong((String)mapInfo.get("businessId")); + Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); // 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 if(!isEnded(processInstanceId)){ @@ -520,7 +521,7 @@ public class WxFlowServiceImpl implements WxFlowService { Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult(); Map mapInfo = taskService.getVariables(task.getId()); - Long businessId = Long.parseLong((String)mapInfo.get("businessId")); + Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); Integer flowType = (Integer)mapInfo.get("flowType"); MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); @@ -576,7 +577,7 @@ public class WxFlowServiceImpl implements WxFlowService { Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult(); Map mapInfo = taskService.getVariables(task.getId()); - Long businessId = Long.parseLong((String)mapInfo.get("businessId")); + Long businessId = Long.parseLong(mapInfo.get("businessId").toString()); Integer flowType = (Integer)mapInfo.get("flowType"); String taskName; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java index f7f7e17fd..4e610a611 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -315,8 +315,16 @@ public class WxMerchantServiceImpl implements WxMerchantService { wxRentContract.setUpdatetime(new Date()); wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); wxRentContractMapper.updateByPrimaryKeySelective(wxRentContract); + + //预览账单改为正式,并写入商户id(租赁合同需要绑定商户才变成已签约) + WxBillRent billRent = new WxBillRent(); + billRent.setRentContractId(wxMerchant.getRentContractId()); + billRent.setIsPreview(EnumIsPreview.NO.getCode()); + billRent.setMerchantId(merchantId); + wxBillRentMapper.updatePreviewStatus(billRent); + //创建账单 - wxRentContractService.buildRent(wxMerchant, userId,null,EnumIsPreview.NO.getCode()); + //wxRentContractService.buildRent(wxMerchant, userId,null,EnumIsPreview.NO.getCode()); //创建押金 wxRentContractService.buildDeposit(wxMerchant, userId); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 8d577d801..318d87c4e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -316,10 +316,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService //wxBillProperty.setMerchantId(record.getMerchantId()); //List> billPropertyList = wxBillPropertyMapper.queryBillPropertyList(wxBillProperty); //if (billPropertyList.size() == 0) { - //发预览账单改为正式 + //预览账单改为正式,并写入商户id WxBillProperty billProperty = new WxBillProperty(); billProperty.setPropertyContractId(id); - billProperty.setIsPreview(EnumIsPreview.YES.getCode()); + billProperty.setIsPreview(EnumIsPreview.NO.getCode()); + billProperty.setMerchantId(record.getMerchantId()); wxBillPropertyMapper.updatePreviewStatus(billProperty); WxMerchant wxMerchant = new WxMerchant(); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 98643ff0b..d60091683 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -969,11 +969,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { WxBillRent wxBillRent = new WxBillRent(); wxBillRent.setMerchantId(record.getMerchantId()); - //发预览账单改为正式 + //预览账单改为正式,并写入商户id WxBillRent billRent = new WxBillRent(); billRent.setRentContractId(id); - billRent.setIsPreview(EnumIsPreview.YES.getCode()); + billRent.setIsPreview(EnumIsPreview.NO.getCode()); + billRent.setMerchantId(record.getMerchantId()); wxBillRentMapper.updatePreviewStatus(billRent); + // List> billRentList = wxBillRentMapper.queryBillRentList(wxBillRent); // if (billRentList.size() == 0) { WxMerchant wxMerchant = new WxMerchant(); diff --git a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml index 7f8583c83..b3aca8622 100644 --- a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml @@ -143,6 +143,7 @@ - update wx_bill_property set is_preview = #{isPreview} where property_contract_id = #{propertyContractId} + update wx_bill_property set is_preview = #{isPreview},merchant_id = #{merchantId} + where property_contract_id = #{propertyContractId} diff --git a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml index 132c6bc25..f60ea0291 100644 --- a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml @@ -134,10 +134,13 @@ - update wx_bill_rent set receive_pay = #{receivePay} where id = #{id} + update wx_bill_rent set updatetime = now() + ,receive_pay = #{receivePay} + where id = #{id} - update wx_bill_rent set is_preview = #{isPreview} where rent_contract_id = #{rentContractId} + update wx_bill_rent set is_preview = #{isPreview},merchant_id = #{merchantId} + where rent_contract_id = #{rentContractId}