From 38c20d05909ef1376a6fa580cafd58536eac3857 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Mon, 17 Jun 2019 20:21:36 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=89=A9=E4=B8=9A=E5=90=88=E5=90=8C][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E5=AE=A1=E6=89=B9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxPropertyContractServiceImpl.java | 54 ++++++++++++++----- .../impl/WxRentContractServiceImpl.java | 9 ++-- 2 files changed, 47 insertions(+), 16 deletions(-) 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 be255f2b9..17921d978 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -16,6 +16,7 @@ import com.iformall.mapper.*; import com.iformall.service.WxFlowRecordService; import com.iformall.service.WxFlowService; import com.iformall.service.WxPropertyContractService; +import com.iformall.service.WxRentContractService; import com.iformall.utils.DateUtils; import org.apache.commons.collections.map.HashedMap; import org.apache.commons.lang3.StringUtils; @@ -25,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; @@ -69,6 +71,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService @Autowired WxFlowRecordService wxFlowRecordService; + @Autowired + WxRentContractService wxRentContractService; + @Override public Map listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { //Object rentContractStatusInfo = getRentContractStatusInfo(record); @@ -325,19 +330,42 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService message = "更新物业合同信息成功"; } - if (!CollectionUtils.isEmpty(record.getFlowParams())) { - if(wxFlowService.getModelByType((Integer)record.getFlowParams().get("businessType"),record.getTenantId()) == null){ - updatePropertyContractStatus(record.getId()); - }else{ - record.getFlowParams().put("businessId", record.getId().toString()); - wxFlowService.start(record.getFlowParams(), userId, userName, record.getTenantId()); - - // 合同状态改成待签约 - WxPropertyContract updateRentContract = new WxPropertyContract(); - updateRentContract.setId(record.getId()); - updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); - wxPropertyContractMapper.updateStatus(updateRentContract); - logger.info("id:{},启动审批流成功", record.getId().toString()); + if (record.getOperationType().equals(EnumContractOperationType.PART.getCode())) { + if (!CollectionUtils.isEmpty(record.getFlowParams())) { + if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null) { + updatePropertyContractStatus(record.getId()); + } else { + record.getFlowParams().put("businessId", record.getId().toString()); + wxFlowService.start(record.getFlowParams(), userId, userName, record.getTenantId()); + + // 合同状态改成待签约 + WxPropertyContract updateRentContract = new WxPropertyContract(); + updateRentContract.setId(record.getId()); + updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); + wxPropertyContractMapper.updateStatus(updateRentContract); + logger.info("id:{},启动审批流成功", record.getId().toString()); + } + } + } else { + //有模板,启动审批流,没有,直接生产账单 + if (!CollectionUtils.isEmpty(record.getFlowParams())) { + if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null + && record.getMerchantId() != null) { + wxRentContractService.updateRentContractStatus(record.getId()); + } else { + record.getFlowParams().put("businessId", record.getId().toString()); + if (record.getMerchantId() != null) { + record.getFlowParams().put("supplement", true); //设置补录 + } + wxFlowService.start(record.getFlowParams(), userId, userName, record.getTenantId()); + + // 合同状态改成待签约 + WxRentContract updateRentContract = new WxRentContract(); + updateRentContract.setId(record.getId()); + updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); + wxRentContractMapper.updateStatus(updateRentContract); + logger.info("id:{},启动审批流成功,是否补录:{}", record.getId().toString(), record.getMerchantId() != null); + } } } 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 91e34315c..7a8ecdbd2 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -359,7 +359,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { //有模板,启动审批流,没有,直接生产账单 if (!CollectionUtils.isEmpty(record.getFlowParams())){ - if(wxFlowService.getModelByType((Integer)record.getFlowParams().get("businessType"),record.getTenantId()) == null){ + if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null + && record.getMerchantId() != null) { updateRentContractStatus(record.getId()); }else{ record.getFlowParams().put("businessId", record.getId().toString()); @@ -415,7 +416,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { //有模板,启动审批流,没有,直接生产账单 if (!CollectionUtils.isEmpty(record.getFlowParams())) { - if(wxFlowService.getModelByType((Integer)record.getFlowParams().get("businessType"),record.getTenantId()) == null){ + if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null + && record.getMerchantId() != null) { updateRentContractStatus(record.getId()); }else{ record.getFlowParams().put("businessId", record.getId().toString()); @@ -1304,7 +1306,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { //有模板,启动审批流,没有,直接生产账单 if (!CollectionUtils.isEmpty(record.getFlowParams())) { - if(wxFlowService.getModelByType((Integer)record.getFlowParams().get("businessType"),record.getTenantId()) == null){ + if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null + && record.getMerchantId() != null) { updateRentContractStatus(record.getId()); }else{ record.getFlowParams().put("businessId", record.getId().toString());