From 250111d6e3018daf40443f0dc36de0e8671bdd6f Mon Sep 17 00:00:00 2001 From: gongbiao Date: Sat, 26 Jan 2019 12:58:11 +0800 Subject: [PATCH 01/25] =?UTF-8?q?[=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E5=8E=BB=E6=8E=89=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=90=88=E5=90=8C=E6=96=B9=E5=BC=8F=E7=8A=B6=E6=80=81]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/domain/po/WxRentContract.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java index 427009b78..06f71d46f 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -191,9 +191,6 @@ public class WxRentContract implements Serializable { @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") private Integer rentShopType; - @io.swagger.annotations.ApiModelProperty(value = "创建合同方式1新建2补录", name = "way") - private Integer way; - @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") private Map flowParams; @@ -501,14 +498,6 @@ public class WxRentContract implements Serializable { this.rentShopType = rentShopType; } - public Integer getWay() { - return way; - } - - public void setWay(Integer way) { - this.way = way; - } - public static enum Field { Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), MerchantId_ASC("`merchant_id` ASC"), MerchantId_DESC("`merchant_id` DESC"), Price_ASC("`price` ASC"), Price_DESC("`price` DESC"), RentalStartDate_ASC("`rental_start_date` ASC"), RentalStartDate_DESC("`rental_start_date` DESC"), RentalEndDate_ASC("`rental_end_date` ASC"), RentalEndDate_DESC("`rental_end_date` DESC"), SignDate_ASC("`sign_date` ASC"), SignDate_DESC("`sign_date` DESC"), ReceivePeriod_ASC("`receive_period` ASC"), ReceivePeriod_DESC("`receive_period` DESC"), TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), Filepath_ASC("`filepath` ASC"), Filepath_DESC("`filepath` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), ContractNumber_ASC("`contract_number` ASC"), ContractNumber_DESC("`contract_number` DESC"), Deposit_ASC("`deposit` ASC"), Deposit_DESC("`deposit` DESC"), PayDate_ASC("`pay_date` ASC"), PayDate_DESC("`pay_date` DESC"), IsDel_ASC("`is_del` ASC"), IsDel_DESC("`is_del` DESC"), MerchantName_ASC("`merchant_name` ASC"), MerchantName_DESC("`merchant_name` DESC"), Brand_ASC("`brand` ASC"), Brand_DESC("`brand` DESC"), BusinessId_ASC("`business_id` ASC"), BusinessId_DESC("`business_id` DESC"), ShopType_ASC("`shop_type` ASC"), ShopType_DESC("`shop_type` DESC"), ShopId_ASC("`shop_id` ASC"), ShopId_DESC("`shop_id` DESC"), Updatetime_ASC("`updatetime` ASC"), Updatetime_DESC("`updatetime` DESC"), Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC"); private String value; From 594201fcddaf401a8bc4d01188a9becab1e03bbf Mon Sep 17 00:00:00 2001 From: gongbiao Date: Sat, 26 Jan 2019 12:59:16 +0800 Subject: [PATCH 02/25] =?UTF-8?q?[=E8=B4=A6=E5=8D=95=E9=80=9A=E7=9F=A5][?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0][=E6=9F=A5=E8=AF=A2=E8=AF=AD=E5=8F=A5]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/WxBillAllMapper.xml | 75 +++++++++++++++++++ .../resources/mapper/WxRentContractMapper.xml | 7 +- 2 files changed, 77 insertions(+), 5 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index 1ca519175..7fe363119 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -212,4 +212,79 @@ + + + + + diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 58ed45e22..48bfb65d7 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -38,7 +38,6 @@ - @@ -47,7 +46,7 @@ `tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`, `brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`link_person`,`link_phone`, `pay_account`,`filename`,`lease`,`type`,`revenue`,`adjust_ratio`,`adjust_period`,`pay_ratio`, - `start_date`,`end_date`,`apply_status`,`bank_name`,`rent_shop_type`,`way` + `start_date`,`end_date`,`apply_status`,`bank_name`,`rent_shop_type` @@ -83,7 +82,6 @@ and `start_date` = #{startDate} and `end_date` = #{endDate} and `rent_shop_type` = #{rentShopType} - and `way` = #{way} and id in @@ -107,7 +105,7 @@ rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,rc.merchant_id merchantId,rc.type, rc.start_date startDate,rc.end_date endDate,br.`name` brandName,rc.apply_status applyStatus,rc.bank_name bankName, - rc.rent_shop_type rentShopType,rc.way + rc.rent_shop_type rentShopType from wx_rent_contract rc left join wx_shop s on rc.shop_id=s.id left join wx_mall_floor f on s.floor=f.id @@ -121,7 +119,6 @@ and rc.`shop_id` = #{shopId} and rc.`type` = #{type} and rc.`rent_shop_type` = #{rentShopType} - and rc.`way` = #{way} order by rc.id desc From cd483723034255eecafa11722e9b50f2aacc4e9c Mon Sep 17 00:00:00 2001 From: luozukai Date: Sat, 26 Jan 2019 13:34:34 +0800 Subject: [PATCH 03/25] =?UTF-8?q?=E8=A1=A5=E5=BD=95=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=B5=81=EF=BC=8C=E5=B9=B6=E8=B5=B0=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E4=BA=8B=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/WxFlowService.java | 2 +- .../service/impl/WxFlowServiceImpl.java | 17 +++++++++++++---- .../service/impl/WxRentContractServiceImpl.java | 3 ++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/WxFlowService.java b/mallinkService/src/main/java/com/iformall/service/WxFlowService.java index dc003f0d8..70a31ebee 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxFlowService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxFlowService.java @@ -16,7 +16,7 @@ public interface WxFlowService { * @param businessId * @param flowType */ - void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus); + void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement); ResultData getTaskStatusList(Long businessId,String tenantId); 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 d165bdbde..5a3c82c95 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -86,7 +86,7 @@ public class WxFlowServiceImpl implements WxFlowService { * @param flowType */ @Override - public void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus){ + public void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement){ if(1 == flowType){ // 1租赁合同 2点位合同wx_rent_contract 3物业wx_property_contract 4点位物业合同 if(contractType.intValue() == 1 || contractType.intValue() == 2){ @@ -94,6 +94,11 @@ public class WxFlowServiceImpl implements WxFlowService { rent.setId(businessId); rent.setApplyStatus(applyStatus); wxRentContractService.updateApplyStatus(rent); + + // 如果审批完成,而且是补录,修改状态 + if(supplement!=null && supplement && EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { + wxRentContractService.updateRentContractStatus(businessId); + } }else if(contractType.intValue() == 3 || contractType.intValue() == 4){ WxPropertyContract wxPropertyContract = new WxPropertyContract(); wxPropertyContract.setId(businessId); @@ -116,6 +121,7 @@ public class WxFlowServiceImpl implements WxFlowService { Integer flowType = (Integer)params.get("businessType"); List> taskAssignee = (List)params.get("taskAssignee"); List> variables = (List)params.get("variables"); + Boolean supplement = (Boolean)params.get("supplement"); // 设置节点处理人 HashMap map = new HashMap<>(); @@ -130,6 +136,7 @@ public class WxFlowServiceImpl implements WxFlowService { map.put("flowType",flowType); map.put("taskAssignee",taskAssignee); map.put("variables",variables); + map.put("supplement",supplement); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getFlowKeyByType(flowType), map); logger.debug("流程启动,流程id:{}",processInstance.getId()); @@ -140,7 +147,7 @@ public class WxFlowServiceImpl implements WxFlowService { if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } - updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.APPLYING.getCode()); + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.APPLYING.getCode(),supplement); // 保存wx_flow_record表审批记录 WxFlowRecord wxFlowRecord = new WxFlowRecord(); @@ -359,6 +366,7 @@ public class WxFlowServiceImpl implements WxFlowService { MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); List> taskAssigneeList = (List)mapInfo.get("taskAssignee"); Long businessId = (Long)mapInfo.get("businessId"); + Boolean supplement = (Boolean)mapInfo.get("supplement"); // 判断下个节点是否有设置审批人,没有,直接通过,有,发短信通知 if(!isEnded(processInstanceId)){ @@ -405,7 +413,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxPropertyContractService.updatePropertyContractStatus(businessId); } } - updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode()); + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode(),supplement); // 给发起人发送审批通过消息 msgReplaceMap = new HashedMap(); @@ -455,6 +463,7 @@ public class WxFlowServiceImpl implements WxFlowService { Integer flowType = (Integer)mapInfo.get("flowType"); MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); List> variables = (List)mapInfo.get("variables"); + Boolean supplement = (Boolean)mapInfo.get("supplement"); String taskName; String taskKey; @@ -473,7 +482,7 @@ public class WxFlowServiceImpl implements WxFlowService { if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } - updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.REJECT.getCode()); + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.REJECT.getCode(),supplement); //保存wx_flow_record表审批记录 WxFlowRecord wxFlowRecord = new WxFlowRecord(); 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 404a5cd95..821a9adfa 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -193,7 +193,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { try { // 如果是补录,启动审批流 if(record.getMerchantId() != null && record.getFlowParams() != null){ - record.getFlowParams().put("businessId",record.getId()); + record.getFlowParams().put("businessId",record.getId().toString()); + record.getFlowParams().put("supplement",true); wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); } } catch (Exception e) { From 522ae0994af5cf529a35a971a6c5703847aa7d05 Mon Sep 17 00:00:00 2001 From: luozukai Date: Sat, 26 Jan 2019 13:45:31 +0800 Subject: [PATCH 04/25] =?UTF-8?q?=E8=A1=A5=E5=BD=95=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=B5=81=EF=BC=8C=E5=B9=B6=E8=B5=B0=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E4=BA=8B=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/service/impl/WxFlowServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5a3c82c95..95dc023fa 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -1,6 +1,5 @@ package com.iformall.service.impl; -import com.alibaba.druid.support.json.JSONUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.iformall.common.Result; @@ -87,6 +86,7 @@ public class WxFlowServiceImpl implements WxFlowService { */ @Override public void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement){ + logger.info("businessId:{},supplement:{}",businessId.toString(),supplement); if(1 == flowType){ // 1租赁合同 2点位合同wx_rent_contract 3物业wx_property_contract 4点位物业合同 if(contractType.intValue() == 1 || contractType.intValue() == 2){ From 26dd3a70a2834d1248bc8ec31b2eb9be55f07ba6 Mon Sep 17 00:00:00 2001 From: luozukai Date: Sat, 26 Jan 2019 14:26:18 +0800 Subject: [PATCH 05/25] =?UTF-8?q?[=E7=9F=AD=E4=BF=A1][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E6=94=B9=E6=88=90type?= =?UTF-8?q?=E5=92=8Ctenant=5Fid]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/enums/EnumMsgModel.java | 39 +++++++++++++++++++ .../iformall/mapper/WxRentContractMapper.java | 1 + .../service/impl/WxFlowServiceImpl.java | 16 +++----- .../impl/WxMsgValidationcodeServiceImpl.java | 1 - .../impl/WxRentContractServiceImpl.java | 6 +++ .../resources/mapper/WxRentContractMapper.xml | 3 ++ 6 files changed, 55 insertions(+), 11 deletions(-) create mode 100644 mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java b/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java new file mode 100644 index 000000000..2dd615579 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java @@ -0,0 +1,39 @@ +package com.iformall.enums; + +/** + * Created by luozukai + * 短信模板 + */ +public enum EnumMsgModel { + // type,name + FLOW_ASSIGNEE_NODIFY(2, "代办通知"), + FLOW_APPLY_NODIFY(3, "审批通知"), + FLOW_PASS_NODIFY(4, "通过审批通知"), + FLOW_REJECT_NODIFY(5, "驳回通知") + ; + + public static EnumMsgModel getEnum(Integer code) { + for (EnumMsgModel value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumMsgModel(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java index b1b83af35..3bd4b81bc 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java @@ -41,4 +41,5 @@ public interface WxRentContractMapper extends CommonMapper getRentInvalidList(WxRentContract wxRentContract); + void updateStatus(WxRentContract wxRentContract); } 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 95dc023fa..507b1c4af 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -5,10 +5,7 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.*; -import com.iformall.enums.EnumFlowKey; -import com.iformall.enums.EnumFlowRecordStatus; -import com.iformall.enums.EnumMsgModelType; -import com.iformall.enums.EnumRentContractAppStatus; +import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxRentContractMapper; @@ -167,12 +164,11 @@ public class WxFlowServiceImpl implements WxFlowService { Map content = new HashedMap(); content.put("userName",starterInfo.getName()); content.put("page", Constant.adminPage); - content.put("modelName","代办通知"); WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setTenantId(tenantId); wxMsgValidationcode.setPhone(mallUserInfo.getPhone()); - wxMsgValidationcode.setType(EnumMsgModelType.FLOW.getCode()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,content); } @@ -377,10 +373,10 @@ public class WxFlowServiceImpl implements WxFlowService { for (MallUserInfo mallUserInfo:mallUserInfoList) { msgReplaceMap.put("userName",mallUserInfo.getName()); msgReplaceMap.put("page",Constant.adminPage); - msgReplaceMap.put("modelName","代办通知"); assignee += mallUserInfo.getName()+" "; wxMsgValidationcode.setPhone(mallUserInfo.getPhone()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); } @@ -388,12 +384,12 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap = new HashedMap(); msgReplaceMap.put("userName",userName); msgReplaceMap.put("page",Constant.adminPage); - msgReplaceMap.put("modelName","审批通知"); msgReplaceMap.put("contract",businessId+""); msgReplaceMap.put("toUserName",assignee.trim()); wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setPhone(starter.getPhone()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); }else{ //需要测下三节点 @@ -417,11 +413,11 @@ public class WxFlowServiceImpl implements WxFlowService { // 给发起人发送审批通过消息 msgReplaceMap = new HashedMap(); - msgReplaceMap.put("modelName","通过审批通知"); msgReplaceMap.put("contract",businessId+""); msgReplaceMap.put("page",Constant.adminPage); wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setPhone(starter.getPhone()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_PASS_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); } } @@ -503,12 +499,12 @@ public class WxFlowServiceImpl implements WxFlowService { WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setTenantId(tenantId); wxMsgValidationcode.setType(EnumMsgModelType.FLOW.getCode()); - msgReplaceMap.put("modelName","驳回通知"); msgReplaceMap.put("contract",businessId+""); msgReplaceMap.put("page",Constant.adminPage); wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setPhone(starter.getPhone()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_REJECT_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); return new ResultData(); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java index c675bd359..f012a334f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java @@ -60,7 +60,6 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); wxMsgValidationcodeModel.setTenantId(wxMsgConfig.getTenantId()); wxMsgValidationcodeModel.setType(wxMsgValidationcode.getType()); - wxMsgValidationcodeModel.setName(dynamicContentMap.get("modelName")); wxMsgValidationcodeModel = wxMsgValidationcodeModelMapper.findList(wxMsgValidationcodeModel).get(0); wxMsgValidationcode.setSignature(wxMsgValidationcodeModel.getSignature()); 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 821a9adfa..fa9b6c24e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -196,6 +196,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { record.getFlowParams().put("businessId",record.getId().toString()); 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); } } catch (Exception e) { logger.error("启动审批流失败,e:" + e.getMessage()); diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 48bfb65d7..7825d71c3 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -168,6 +168,9 @@ update wx_rent_contract set apply_status=#{applyStatus} where id=#{id} + + update wx_rent_contract set status=#{status} where id=#{id} + update wx_rent_contract set status=#{status} where shop_id in ( From cf39e27d2160bd8903c00cc143301e8544fcec4e Mon Sep 17 00:00:00 2001 From: luozukai Date: Sat, 26 Jan 2019 14:27:44 +0800 Subject: [PATCH 06/25] =?UTF-8?q?[=E7=9F=AD=E4=BF=A1][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E6=94=B9=E6=88=90type?= =?UTF-8?q?=E5=92=8Ctenant=5Fid]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/enums/EnumMsgModelType.java | 37 ------------------- .../service/impl/WxFlowServiceImpl.java | 2 - 2 files changed, 39 deletions(-) delete mode 100644 mallinkService/src/main/java/com/iformall/enums/EnumMsgModelType.java diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumMsgModelType.java b/mallinkService/src/main/java/com/iformall/enums/EnumMsgModelType.java deleted file mode 100644 index 1c15e6551..000000000 --- a/mallinkService/src/main/java/com/iformall/enums/EnumMsgModelType.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.iformall.enums; - -/** - * Created by luozukai - * 消息模板类型 1登录 2工作流通知 - */ -public enum EnumMsgModelType { - - LOGIN(1, "登录"), - FLOW(2, "工作流通知") - ; - - public static EnumMsgModelType getEnum(Integer code) { - for (EnumMsgModelType value : values()) { - if (value.getCode().equals(code)) { - return value; - } - } - return null; - } - - private Integer code; - private String message; - - EnumMsgModelType(Integer code, String message) { - this.code = code; - this.message = message; - } - - public Integer getCode() { - return code; - } - - public String getMessage() { - return message; - } -} 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 507b1c4af..91e391ecb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -358,7 +358,6 @@ public class WxFlowServiceImpl implements WxFlowService { Map msgReplaceMap = new HashedMap(); WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setTenantId(tenantId); - wxMsgValidationcode.setType(EnumMsgModelType.FLOW.getCode()); MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); List> taskAssigneeList = (List)mapInfo.get("taskAssignee"); Long businessId = (Long)mapInfo.get("businessId"); @@ -498,7 +497,6 @@ public class WxFlowServiceImpl implements WxFlowService { Map msgReplaceMap = new HashedMap(); WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setTenantId(tenantId); - wxMsgValidationcode.setType(EnumMsgModelType.FLOW.getCode()); msgReplaceMap.put("contract",businessId+""); msgReplaceMap.put("page",Constant.adminPage); From 344da899c19ce1112a2b75806355aff7f81eb5a6 Mon Sep 17 00:00:00 2001 From: hupeng Date: Sat, 26 Jan 2019 14:59:08 +0800 Subject: [PATCH 07/25] =?UTF-8?q?[BUG][=E4=BF=AE=E5=A4=8D]:=E5=A4=9A?= =?UTF-8?q?=E5=95=86=E6=88=B7=E9=80=9A=E7=94=A8=E5=88=B8=E4=B8=AD=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=95=86=E6=88=B7=E8=A2=AB=E7=A6=81=E7=94=A8=E6=97=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/WxCouponOrderMapper.xml | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index 5660b8578..8d28e9021 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -297,7 +297,7 @@ c.title,c.sale_price,c.use_price,c.price,c.unit, (case when com.mc=1 then (select m.name from wx_merchant m, wx_coupon_merchant cm - where m.id = cm.merchant_id and cm.product_id=co.coupon_id) else '[多商户通用]' end) as merchant_name + where m.id = cm.merchant_id and cm.product_id=co.coupon_id and m.status = 1) else '[多商户通用]' end) as merchant_name @@ -315,9 +315,9 @@ wx_coupon c, (select tco.id as tcoid, (select count(*) from wx_coupon_merchant tcm - where tcm.product_id = tco.coupon_id - and tcm.status = 0) as mc - from wx_coupon_order tco) com + where tcm.product_id = tco.coupon_id + and tcm.status = 0) as mc + from wx_coupon_order tco) com where com.tcoid = co.id and co.coupon_type < 100 and c.id = co.coupon_id @@ -330,10 +330,14 @@ - and (case when com.mc=1 then - (select m.name from wx_merchant m, wx_coupon_merchant cm - where m.id = cm.merchant_id and cm.product_id=co.coupon_id) else '[多商户通用]' end) - like concat('%', #{merchantName},'%') + and (case when com.mc=1 + then + (select m.name from wx_merchant m, wx_coupon_merchant cm + where m.id = cm.merchant_id + and cm.product_id=co.coupon_id + and m.status = 1) + else'[多商户通用]' end) + like concat('%', #{merchantName},'%') From 548e09d764c27ca7d2866c61894d751d8925efac Mon Sep 17 00:00:00 2001 From: luozukai Date: Sat, 26 Jan 2019 15:07:03 +0800 Subject: [PATCH 08/25] =?UTF-8?q?[=E5=AE=A1=E6=89=B9=E6=B5=81][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E7=89=A9=E4=B8=9A=E5=90=88=E5=90=8C=E5=8F=91?= =?UTF-8?q?=E8=B5=B7=E5=AE=A1=E6=89=B9=E5=90=88=E5=B9=B6]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WxPropertyContractController.java | 4 +-- .../domain/po/WxPropertyContract.java | 13 +++++++++ .../iformall/domain/po/WxRentContract.java | 1 + .../mapper/WxPropertyContractMapper.java | 4 +-- .../service/WxPropertyContractService.java | 13 +++++---- .../impl/WxPropertyContractServiceImpl.java | 28 +++++++++++++++++-- .../mapper/WxPropertyContractMapper.xml | 4 +++ 7 files changed, 54 insertions(+), 13 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxPropertyContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxPropertyContractController.java index c918602fa..82e3acd96 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxPropertyContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxPropertyContractController.java @@ -45,14 +45,14 @@ public class WxPropertyContractController extends BaseController public ResultData add(@RequestBody WxPropertyContract wxPropertyContract) { logger.debug("[" + getIpAddr() + "] WxPropertyContractController::add"); wxPropertyContract.setTenantId(getTenantId()); - return wxPropertyContractService.saveOrUpdate(wxPropertyContract, getUser().getId()); + return wxPropertyContractService.saveOrUpdate(wxPropertyContract, getUser().getId(),getUser().getName()); } @PostMapping("update") public ResultData update(@RequestBody WxPropertyContract wxPropertyContract) { logger.debug("[" + getIpAddr() + "] WxPropertyContractController::update"); wxPropertyContract.setTenantId(getTenantId()); - return wxPropertyContractService.saveOrUpdate(wxPropertyContract, getUser().getId()); + return wxPropertyContractService.saveOrUpdate(wxPropertyContract, getUser().getId(),getUser().getName()); } @GetMapping("/del") diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java index 83dc5e25a..987394893 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java @@ -7,6 +7,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; /** * @author gongbiao @@ -159,6 +160,18 @@ public class WxPropertyContract implements Serializable { @io.swagger.annotations.ApiModelProperty(value = "计租周期", name = "计租周期") private Integer adjustPeriod; + @Transient + @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") + private Map flowParams; + + public Map getFlowParams() { + return flowParams; + } + + public void setFlowParams(Map flowParams) { + this.flowParams = flowParams; + } + public Integer getApplyStatus() { return applyStatus; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java index 06f71d46f..0470a89bb 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -191,6 +191,7 @@ public class WxRentContract implements Serializable { @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") private Integer rentShopType; + @Transient @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") private Map flowParams; diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java index eaac4f2a9..cc0efd48a 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java @@ -37,6 +37,6 @@ public interface WxPropertyContractMapper extends CommonMapper getRentContractList(Map params); void updateApplyStatus(WxPropertyContract wxPropertyContract); - - + + void updateStatus(WxPropertyContract wxPropertyContract); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java b/mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java index b92f88249..f9e666102 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java @@ -29,13 +29,14 @@ public interface WxPropertyContractService { * @return */ ResultData getById(Long id); - - /** + + /** * 保存或更新实体 - * - * @param record - */ - ResultData saveOrUpdate(WxPropertyContract record, Long userId); + * @param record + * @param userId + * @return + */ + ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName); /** * 根据Id删除实体 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 134c9230e..c8f84ae67 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -10,6 +10,7 @@ import com.iformall.domain.po.*; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.*; +import com.iformall.service.WxFlowService; import com.iformall.service.WxPropertyContractService; import com.iformall.utils.Constant; import org.slf4j.Logger; @@ -50,6 +51,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService @Autowired WxRentContractMapper wxRentContractMapper; + @Autowired + WxFlowService wxFlowService; + @Override public Map listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { Object rentContractStatusInfo = getRentContractStatusInfo(record); @@ -96,7 +100,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } @Override - public ResultData saveOrUpdate(WxPropertyContract record, Long userId) { + @Transactional(rollbackFor = {Exception.class}) + public ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName) { if (null == record.getShopId()) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "shopId不能为空"); @@ -149,6 +154,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } //保存物业合同信息 + String message = ""; if (record.getId() == null) { final IdWorker idWorker = IdWorker.get(); record.setId(idWorker.nextId()); @@ -177,7 +183,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService logger.error("保存物业合同信息失败,e:" + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); } - return new ResultData(Result.SUCCESS, "保存物业合同信息成功", record); + message = "保存物业合同信息成功"; } else {//更新物业合同信息 WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectByPrimaryKey(record.getId()); if (wxPropertyContract == null) { @@ -207,8 +213,24 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService logger.error("更新物业合同信息失败,e:" + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); } - return new ResultData(Result.SUCCESS, "更新物业合同信息成功", record); + message = "更新物业合同信息成功"; + } + + try { + record.getFlowParams().put("businessId",record.getId().toString()); + record.getFlowParams().put("supplement",false); + 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); + } catch (Exception e) { + logger.error("启动审批流失败,e:" + e.getMessage()); + throw new MallinkException(ErrorCode.FLOW_FAIL.getCode(), "FLOW FAILD " + e.getMessage()); } + return new ResultData(Result.SUCCESS, message, record); } @Override diff --git a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml index 35352513e..1944d8556 100644 --- a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml @@ -185,4 +185,8 @@ update wx_property_contract set apply_status=#{applyStatus} where id=#{id} + + + update wx_property_contract set status=#{status} where id=#{id} + From 937ea7a186a388d553843abd24ad08f762f18a99 Mon Sep 17 00:00:00 2001 From: hupeng Date: Sat, 26 Jan 2019 15:37:57 +0800 Subject: [PATCH 09/25] =?UTF-8?q?[BUG][=E4=BF=AE=E5=A4=8D]:=E5=A4=9A?= =?UTF-8?q?=E5=95=86=E6=88=B7=E9=80=9A=E7=94=A8=E5=88=B8=E4=B8=AD=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=95=86=E6=88=B7=E8=A2=AB=E7=A6=81=E7=94=A8=E6=97=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/WxCouponOrderMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index 8d28e9021..74321a445 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -297,7 +297,7 @@ c.title,c.sale_price,c.use_price,c.price,c.unit, (case when com.mc=1 then (select m.name from wx_merchant m, wx_coupon_merchant cm - where m.id = cm.merchant_id and cm.product_id=co.coupon_id and m.status = 1) else '[多商户通用]' end) as merchant_name + where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name @@ -335,7 +335,7 @@ (select m.name from wx_merchant m, wx_coupon_merchant cm where m.id = cm.merchant_id and cm.product_id=co.coupon_id - and m.status = 1) + and cm.status = 0) else'[多商户通用]' end) like concat('%', #{merchantName},'%') From dfc897c213ab590e1a42a684c92fc9d95de26be0 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Sat, 26 Jan 2019 15:32:03 +0800 Subject: [PATCH 10/25] =?UTF-8?q?[=E8=B4=A6=E5=8D=95=E9=80=9A=E7=9F=A5][?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0][=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../schedule/BillNotificationSchedule.java | 180 ++++++++++++++++++ .../com/iformall/mapper/WxBillAllMapper.java | 4 + .../main/resources/mapper/WxBillAllMapper.xml | 18 +- 3 files changed, 195 insertions(+), 7 deletions(-) create mode 100644 mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java new file mode 100644 index 000000000..e8f28f860 --- /dev/null +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java @@ -0,0 +1,180 @@ +package com.iformall.schedule; + +import com.alibaba.fastjson.JSONObject; +import com.iformall.common.IdWorker; +import com.iformall.domain.po.WxMsgCallback; +import com.iformall.domain.po.WxMsgConfig; +import com.iformall.domain.po.WxMsgValidationcode; +import com.iformall.domain.po.WxMsgValidationcodeModel; +import com.iformall.enums.EnumMsgSendStatus; +import com.iformall.enums.EnumVerifyCode; +import com.iformall.mapper.*; +import com.iformall.utils.WiwideUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @author gongbiao + */ +@Component +public class BillNotificationSchedule { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxMsgValidationcodeMapper wxMsgValidationcodeMapper; + + @Autowired + private WxMsgConfigMapper wxMsgConfigMapper; + + @Autowired + private WxMsgValidationcodeModelMapper wxMsgValidationcodelModelMapper; + + @Autowired + private WxBillAllMapper wxBillAllMapper; + + @Autowired + private WxMsgCallbackMapper wxMsgCallbackMapper; + + + /** + * 每天9点执行 + */ + @Scheduled(cron = "0 0 9 * * ?") + public void sendMsgFromBill() { + logger.info("账单通知任务启动"); + sendWaitPayBill(); + sendOweBill(); + logger.info("账单通知任务结束"); + } + + private void sendOweBill() { + logger.info("查询欠缴账单数据"); + List> oweBillList = wxBillAllMapper.getOWeBill(); + for (Map bill : oweBillList) { + logger.info("欠缴账单:" + JSONObject.toJSONString(bill)); + String tenantId = bill.get("tenantId").toString(); + BigDecimal owe = (BigDecimal) bill.get("owe"); + BigDecimal price = owe.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); + String phone = bill.get("linkPhone").toString(); + String appname = bill.get("appname").toString(); + logger.info("欠缴账单检验短信配置信息"); + WxMsgConfig wxMsgConfig = checkMsgConfig(tenantId); + if (wxMsgConfig != null) { + logger.info("欠缴账单获取模板内容"); + WxMsgValidationcodeModel wxMsgValidationcodeModel = getMsgModel(tenantId, 7); + if (wxMsgValidationcodeModel != null) { + String signature = wxMsgValidationcodeModel.getSignature(); + String msg = wxMsgValidationcodeModel.getContent(). + replace("{price}", String.valueOf(price.doubleValue())). + replace("{app}", appname); + String notifyUrl = wxMsgConfig.getNotifyurl(); + String secret = wxMsgConfig.getSecret(); + String bid = wxMsgConfig.getBid(); + String publickey = wxMsgConfig.getPublickey(); + sendWaitPayBillMsg(phone, signature, msg, notifyUrl, secret, bid, publickey); + } + } + } + } + + private void sendWaitPayBill() { + logger.info("查询待缴账单数据"); + List> waitBillList = wxBillAllMapper.getWaitPayBill(); + for (Map bill : waitBillList) { + logger.info("待缴账单账单:" + JSONObject.toJSONString(bill)); + String tenantId = bill.get("tenantId").toString(); + String receiveDate = bill.get("receiveDate").toString(); + BigDecimal needPay = (BigDecimal) bill.get("needPay"); + BigDecimal price = needPay.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); + String phone = bill.get("linkPhone").toString(); + String appname = bill.get("appname").toString(); + logger.info("待缴账单检验短信配置信息"); + WxMsgConfig wxMsgConfig = checkMsgConfig(tenantId); + if (wxMsgConfig != null) { + logger.info("待缴账单获取模板内容"); + WxMsgValidationcodeModel wxMsgValidationcodeModel = getMsgModel(tenantId, 7); + if (wxMsgValidationcodeModel != null) { + String signature = wxMsgValidationcodeModel.getSignature(); + String msg = wxMsgValidationcodeModel.getContent(). + replace("{price}", String.valueOf(price.doubleValue())). + replace("{date}", receiveDate). + replace("{app}", appname); + String notifyUrl = wxMsgConfig.getNotifyurl(); + String secret = wxMsgConfig.getSecret(); + String bid = wxMsgConfig.getBid(); + String publickey = wxMsgConfig.getPublickey(); + sendWaitPayBillMsg(phone, signature, msg, notifyUrl, secret, bid, publickey); + } + } + } + + } + + private WxMsgConfig checkMsgConfig(String tenantId) { + WxMsgConfig wxMsgConfig = new WxMsgConfig(); + wxMsgConfig.setTenantId(tenantId); + List wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig); + if (wxMsgConfigs.size() == 0) { + logger.info("缺少系统短信配置"); + return null; + } + wxMsgConfig = wxMsgConfigs.get(0); + if (wxMsgConfig.getRemains() == 0) { + logger.info("短信数量为0"); + return null; + } + return wxMsgConfigs.get(0); + } + + private WxMsgValidationcodeModel getMsgModel(String tenantId, Integer type) { + WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); + wxMsgValidationcodeModel.setTenantId(tenantId); + wxMsgValidationcodeModel.setType(type); + return wxMsgValidationcodelModelMapper.findList(wxMsgValidationcodeModel).get(0); + } + + private void sendWaitPayBillMsg(String phone, String signature, String msg, String notifyUrl, String secret, String bid, String publickey) { + logger.info("开始调用迈外迪短信接口"); + String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.YES.getCode().toString(), null); + logger.info("迈外迪短信接口返回值:" + result); + JSONObject jsonObjectResult = JSONObject.parseObject(result); + String ret = jsonObjectResult.get("ret").toString(); + String batchNo = jsonObjectResult.get("data").toString(); + if (ret.equals(EnumMsgSendStatus.MSG_SEND_SUCCESS.getCode())) { + final IdWorker idWorker = IdWorker.get(); + WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); + wxMsgValidationcode.setId(idWorker.nextId()); + wxMsgValidationcode.setCreatetime(new Date()); + wxMsgValidationcodeMapper.insertSelective(wxMsgValidationcode); + addMsgCallback(wxMsgValidationcode, batchNo); + } + } + + public void addMsgCallback(WxMsgValidationcode wxmsg, String batchNo) { + logger.info("验证码发送时主动添加回调记录开始..."); + String phone = wxmsg.getPhone(); + final IdWorker idWorker = IdWorker.get(); + WxMsgCallback wxMsgCallback = new WxMsgCallback(); + wxMsgCallback.setId(idWorker.nextId()); + wxMsgCallback.setPhone(phone); + wxMsgCallback.setTenantId(wxmsg.getTenantId()); + wxMsgCallback.setBatchNo(batchNo); + wxMsgCallback.setMsgId(wxmsg.getId()); + wxMsgCallback.setStatus(EnumMsgSendStatus.MSG_SENDING.getCode()); + wxMsgCallback.setCreatetime(new Date()); + wxMsgCallbackMapper.insertSelective(wxMsgCallback); + logger.info("验证码发送时主动添加回调记录结束..."); + } + + +} \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java index f46073d9b..0cab07114 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java @@ -21,4 +21,8 @@ public interface WxBillAllMapper extends CommonMapper { List> listData(WxBillAll wxBillAll); + List> getWaitPayBill(); + + List> getOWeBill(); + } diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index 7fe363119..f34e25f07 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -214,8 +214,9 @@ From 80f14c00930bf711b884868aafe7d4a0d70ec34c Mon Sep 17 00:00:00 2001 From: gongbiao Date: Sat, 26 Jan 2019 15:46:00 +0800 Subject: [PATCH 11/25] =?UTF-8?q?[=E7=9F=AD=E4=BF=A1=E7=B1=BB=E5=9E=8B][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E6=B7=BB=E5=8A=A0=E7=B1=BB=E5=9E=8B],[?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E7=9F=AD=E4=BF=A1][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E4=BF=AE=E6=94=B9=E7=9F=AD=E4=BF=A1=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/schedule/BillNotificationSchedule.java | 5 +++-- .../src/main/java/com/iformall/enums/EnumMsgModel.java | 6 +++++- .../service/impl/WxMsgValidationcodeServiceImpl.java | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java index e8f28f860..302a08e28 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/BillNotificationSchedule.java @@ -6,6 +6,7 @@ import com.iformall.domain.po.WxMsgCallback; import com.iformall.domain.po.WxMsgConfig; import com.iformall.domain.po.WxMsgValidationcode; import com.iformall.domain.po.WxMsgValidationcodeModel; +import com.iformall.enums.EnumMsgModel; import com.iformall.enums.EnumMsgSendStatus; import com.iformall.enums.EnumVerifyCode; import com.iformall.mapper.*; @@ -71,7 +72,7 @@ public class BillNotificationSchedule { WxMsgConfig wxMsgConfig = checkMsgConfig(tenantId); if (wxMsgConfig != null) { logger.info("欠缴账单获取模板内容"); - WxMsgValidationcodeModel wxMsgValidationcodeModel = getMsgModel(tenantId, 7); + WxMsgValidationcodeModel wxMsgValidationcodeModel = getMsgModel(tenantId, EnumMsgModel.BILL_OWE.getCode()); if (wxMsgValidationcodeModel != null) { String signature = wxMsgValidationcodeModel.getSignature(); String msg = wxMsgValidationcodeModel.getContent(). @@ -102,7 +103,7 @@ public class BillNotificationSchedule { WxMsgConfig wxMsgConfig = checkMsgConfig(tenantId); if (wxMsgConfig != null) { logger.info("待缴账单获取模板内容"); - WxMsgValidationcodeModel wxMsgValidationcodeModel = getMsgModel(tenantId, 7); + WxMsgValidationcodeModel wxMsgValidationcodeModel = getMsgModel(tenantId, EnumMsgModel.BILL_WAIT_PAY.getCode()); if (wxMsgValidationcodeModel != null) { String signature = wxMsgValidationcodeModel.getSignature(); String msg = wxMsgValidationcodeModel.getContent(). diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java b/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java index 2dd615579..4c955d020 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java @@ -6,10 +6,14 @@ package com.iformall.enums; */ public enum EnumMsgModel { // type,name + MALL_APPLY(1, "申请试用"), FLOW_ASSIGNEE_NODIFY(2, "代办通知"), FLOW_APPLY_NODIFY(3, "审批通知"), FLOW_PASS_NODIFY(4, "通过审批通知"), - FLOW_REJECT_NODIFY(5, "驳回通知") + FLOW_REJECT_NODIFY(5, "驳回通知"), + VALIDATION_CODE(6, "B端验证码"), + BILL_WAIT_PAY(7, "账单待缴通知"), + BILL_OWE(8, "账单欠缴通知") ; public static EnumMsgModel getEnum(Integer code) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java index f012a334f..0d94b07ae 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java @@ -8,6 +8,7 @@ import com.iformall.common.IdWorker; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.*; +import com.iformall.enums.EnumMsgModel; import com.iformall.enums.EnumMsgSendStatus; import com.iformall.enums.EnumVerifyCode; import com.iformall.mapper.*; @@ -156,8 +157,7 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); wxMsgValidationcodeModel.setTenantId(wxMsgConfig.getTenantId()); - wxMsgValidationcodeModel.setType(wxMsgValidationcode.getType()); - wxMsgValidationcodeModel.setName("验证码"); + wxMsgValidationcodeModel.setType(EnumMsgModel.VALIDATION_CODE.getCode()); wxMsgValidationcodeModel = wxMsgValidationcodeModelMapper.findList(wxMsgValidationcodeModel).get(0); wxMsgValidationcode.setSignature(wxMsgValidationcodeModel.getSignature()); From abc01a85271e87de4ea9b0a0119ddb5425c25925 Mon Sep 17 00:00:00 2001 From: hupeng Date: Sat, 26 Jan 2019 16:08:52 +0800 Subject: [PATCH 12/25] =?UTF-8?q?[BUG][=E4=BF=AE=E5=A4=8D]:=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=90=A5=E9=94=80=E6=95=B0=E6=8D=AE=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index 74321a445..708c6d0c3 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -143,6 +143,7 @@ and view_coupon_data.couponTitle like concat('%', #{couponTitle},'%') + order by view_coupon_data.createTime desc From 1e985efba00a5e1b7b09222c18740baeef781a58 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Sat, 26 Jan 2019 16:59:42 +0800 Subject: [PATCH 13/25] =?UTF-8?q?[=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E6=9F=A5=E8=AF=A2=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E6=9B=B4=E6=96=B0=E5=BE=85=E7=AD=BE=E7=BA=A6]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxMerchantServiceImpl.java | 3 ++- .../service/impl/WxRentContractServiceImpl.java | 13 ++++++++----- .../main/resources/mapper/WxRentContractMapper.xml | 8 ++++---- 3 files changed, 14 insertions(+), 10 deletions(-) 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 501dcb128..7924f708b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -92,7 +92,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { for (WxMerchant merchant : merchants) { List collect = list.stream().filter(ms -> ms.getMerchantId() != null && ms.getMerchantId().equals(merchant.getId()) && !ms.getStatus().equals(EnumRentContractStatus.WAIT_SIGN.getCode()) - && !ms.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode())).collect(Collectors.toList()); + && !ms.getStatus().equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) + && !ms.getStatus().equals(EnumRentContractStatus.INTENTION.getCode())).collect(Collectors.toList()); if (collect != null && collect.size() > 0) { merchant.setRentalStartDate(collect.get(0).getRentalStartDate()); merchant.setRentalEndDate(collect.get(0).getRentalEndDate()); 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 fa9b6c24e..469ee9348 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -180,7 +180,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { filter(rc -> !rc.get("status").equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) && !rc.get("status").equals(EnumRentContractStatus.WAIT_SIGN.getCode()) && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode()) - && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode())).count(); + && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode()) + && !rc.get("status").equals(EnumRentContractStatus.INTENTION.getCode())).count(); if (count > 0) { return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); } @@ -260,6 +261,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { && !rc.get("status").equals(EnumRentContractStatus.WAIT_SIGN.getCode()) && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode()) && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode()) + && !rc.get("status").equals(EnumRentContractStatus.INTENTION.getCode()) && !rc.get("id").equals(wxRentContract.getId())).count(); if (count > 0) { return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); @@ -649,8 +651,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { } - //把状态为签约而商户未关联的数据改为待签约状态 - wxRentContractMapper.updateStatusForUnsign(wxRentContract); + //把状态为意见而商户未关联的数据改为待签约状态 + //wxRentContractMapper.updateStatusForUnsign(wxRentContract); //作废合同 wxRentContract.setStatus(EnumRentContractStatus.INVALID.getCode()); @@ -658,7 +660,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { //待签约 wxRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); - wxRentContractMapper.updateRentWaitSignStatus(wxRentContract); + //wxRentContractMapper.updateRentWaitSignStatus(wxRentContract); int waitSignCount = wxRentContractMapper.queryRentContractWaitSignStatus(wxRentContract); resultData.put("waitSignCount", waitSignCount); @@ -963,7 +965,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { .stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()) && !rc.get("status").equals(EnumRentContractStatus.WAIT_SIGN.getCode()) && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode()) - && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode())).findFirst(); + && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode()) + && !rc.get("status").equals(EnumRentContractStatus.INTENTION.getCode())).findFirst(); Map wxPropertyContract = null; if (first.isPresent()) { wxPropertyContract = first.get(); diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 7825d71c3..9c1a7dbe7 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -149,19 +149,19 @@ - update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() + update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() - update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() + update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() - update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_end_date <now() + update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=6 and status!=7 and rental_end_date <now() - update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=7 and merchant_id is null + update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=7 and merchant_id is null From 85500811c34d183cc3f82a4a32d12d9e7c03fa05 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Sat, 26 Jan 2019 17:01:50 +0800 Subject: [PATCH 14/25] =?UTF-8?q?[=E7=A7=9F=E8=B5=81=E5=90=88=E5=90=8C][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E5=90=84=E5=90=88=E5=90=8C=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=BB=9F=E8=AE=A1=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/WxRentContractMapper.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 9c1a7dbe7..cf42e17ea 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -130,19 +130,21 @@ @@ -287,7 +287,7 @@ select bill.tenant_id,bill.merchant_id,bill.receive_date,ifnull(sum(need_pay),0) where DATEDIFF(bill.receive_date,now())<0 and bill.status!=3 group by bill.tenant_id,bill.merchant_id) bill left join wx_merchant m on bill.merchant_id=m.id - left join (select tenant_id,`name` appname from wx_appinfo app where type=2) app on bill.tenant_id=app.tenant_id + left join (select tenant_id,`name` appname from wx_appinfo app where type=1) app on bill.tenant_id=app.tenant_id