From 81e09e31c8f025a75a901adf38ee255345725118 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 14 Jun 2019 14:53:26 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=A1=E6=89=B9][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BC=9A=E7=AD=BE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxPropertyContractServiceImpl.java | 11 ++-- .../impl/WxRentContractServiceImpl.java | 55 +++++++++---------- 2 files changed, 31 insertions(+), 35 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 524ff5c6e..fbf0aa513 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -331,11 +331,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } //启动审批流 - if(!CollectionUtils.isEmpty(record.getFlowParams())) { - Integer flowType = (Integer)record.getFlowParams().get("businessType"); - if(wxFlowService.getModelByType(flowType.intValue(),record.getTenantId()) == null){ - updatePropertyContractStatus(record.getId()); - }else{ + if(record.getFlowParams()==null || wxFlowService.getModelByType((Integer)record.getFlowParams().get("businessType"),record.getTenantId()) == null){ + updatePropertyContractStatus(record.getId()); + }else{ + if(!CollectionUtils.isEmpty(record.getFlowParams())) { record.getFlowParams().put("businessId", record.getId().toString()); wxFlowService.start(record.getFlowParams(), userId, userName, record.getTenantId()); @@ -344,7 +343,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService updateRentContract.setId(record.getId()); updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); wxPropertyContractMapper.updateStatus(updateRentContract); - logger.info("id:{},启动审批流成功",record.getId().toString()); + logger.info("id:{},启动审批流成功", record.getId().toString()); } } return new ResultData(Result.SUCCESS, message, record); 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 436066ff9..0a4ffe4d2 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -355,23 +355,22 @@ public class WxRentContractServiceImpl implements WxRentContractService { } // 启动审批流 - if(record.getFlowParams() != null){ - Integer flowType = (Integer)record.getFlowParams().get("businessType"); - if(wxFlowService.getModelByType(flowType.intValue(),record.getTenantId()) == null){ - updateRentContractStatus(record.getId()); - }else{ - record.getFlowParams().put("businessId",record.getId().toString()); - if(record.getMerchantId() != null) { + if(record.getFlowParams()==null || wxFlowService.getModelByType((Integer)record.getFlowParams().get("businessType"),record.getTenantId()) == null){ + updateRentContractStatus(record.getId()); + }else{ + if(record.getFlowParams() != null) { + record.getFlowParams().put("businessId", record.getId().toString()); + if (record.getMerchantId() != null) { record.getFlowParams().put("supplement", true); //设置补录 } - wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); + 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); + logger.info("id:{},启动审批流成功, 是否补录:{}", record.getId().toString(), record.getMerchantId() != null); } } @@ -412,23 +411,22 @@ public class WxRentContractServiceImpl implements WxRentContractService { } //启动审批流 - if(record.getFlowParams() != null){ - Integer flowType = (Integer)record.getFlowParams().get("businessType"); - if(wxFlowService.getModelByType(flowType.intValue(),record.getTenantId()) == null){ - updateRentContractStatus(record.getId()); - }else{ - record.getFlowParams().put("businessId",record.getId().toString()); - if(record.getMerchantId() != null) { + if(record.getFlowParams()==null || wxFlowService.getModelByType((Integer)record.getFlowParams().get("businessType"),record.getTenantId()) == null){ + updateRentContractStatus(record.getId()); + }else{ + if(record.getFlowParams() != null) { + record.getFlowParams().put("businessId", record.getId().toString()); + if (record.getMerchantId() != null) { record.getFlowParams().put("supplement", true); //设置补录 } - wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); + 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); + logger.info("id:{},启动审批流成功 ,是否补录:{}", record.getId().toString(), record.getMerchantId() != null); } } @@ -1299,25 +1297,24 @@ public class WxRentContractServiceImpl implements WxRentContractService { if (resultData.code != Result.SUCCESS) { return resultData; } - // 启动审批流 - if(record.getFlowParams() != null){ - //判断是否配置模板 - Integer flowType = (Integer)record.getFlowParams().get("businessType"); - if(wxFlowService.getModelByType(flowType.intValue(),record.getTenantId())==null){ - updateRentContractStatus(record.getId()); - }else{ - record.getFlowParams().put("businessId",record.getId().toString()); - if(record.getMerchantId() != null) { + //启动审批流 + //判断是否配置模板 + if(record.getFlowParams()==null || wxFlowService.getModelByType((Integer)record.getFlowParams().get("businessType"),record.getTenantId()) == null){ + updateRentContractStatus(record.getId()); + }else{ + if(record.getFlowParams() != null) { + record.getFlowParams().put("businessId", record.getId().toString()); + if (record.getMerchantId() != null) { record.getFlowParams().put("supplement", true); //设置补录 } - wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); + 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); + logger.info("id:{},启动审批流成功,是否补录:{}", record.getId().toString(), record.getMerchantId() != null); } } return resultData;