diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906271637__L_ALTER_FLOW.sql b/mallinkAdmin/src/main/resources/db/migration/V201906271637__L_ALTER_FLOW.sql new file mode 100644 index 000000000..d119acde1 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906271637__L_ALTER_FLOW.sql @@ -0,0 +1,2 @@ +ALTER TABLE `wx_coupon` +ADD COLUMN `approval_type` SMALLINT(1) NULL DEFAULT 0 COMMENT '最后一次操作类型'; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index 166a7274f..a3a33de48 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -146,6 +146,7 @@ public class WxCoupon extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="领取条件",name="condition") private String conditions; + private Integer approvalType; @Transient private String merchantParams; 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 fe7b64a4f..1e657f1ad 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -239,6 +239,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxCoupon.setStatus(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode()); } } + wxCoupon.setApprovalType(operateType); wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); } } @@ -338,7 +339,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxFlowRecord.setStartDate(startDate); wxFlowRecordService.saveOrUpdate(wxFlowRecord); - // 给审批人发送代办通知短信 + //给审批人发送代办通知短信 List mallUserInfoList = getUserByProcessInstanceId(processInstance.getId()); for (MallUserInfo mallUserInfo:mallUserInfoList) { sendAssigneeMsgAndEmail(tenantId,mallUserInfo.getPhone(),mallUserInfo.getEmail(),starterInfo.getName(),businessId,flowType); @@ -360,6 +361,9 @@ public class WxFlowServiceImpl implements WxFlowService { }else if(isBill(flowType)){ dynamicContentMap.put("bustype","账单"); dynamicContentMap.put("contract", businessId.toString()); + }else if(isCoupon(flowType)){ + dynamicContentMap.put("bustype","有价卷"); + dynamicContentMap.put("contract",businessId.toString()); } wxMsgRecord.setDynamicContentMap(dynamicContentMap); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); @@ -436,6 +440,9 @@ public class WxFlowServiceImpl implements WxFlowService { }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); + }else if(isCoupon(flowType)){ + msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("contract",businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); @@ -462,6 +469,16 @@ public class WxFlowServiceImpl implements WxFlowService { } return false; } + public boolean isCoupon(Integer flowType){ + if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) + ||EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType) + ||EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType) + ||EnumFlowKey.NEW_PRESS_UPLINE.getCode().equals(flowType) + ){ + return true; + } + return false; + } public String variablesToJson(List> variables){ HashMap map = new HashMap<>(); @@ -837,6 +854,9 @@ public class WxFlowServiceImpl implements WxFlowService { }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); + }else if(isCoupon(flowType)){ + msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("contract",businessId.toString()); } wxMsgRecord.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); @@ -856,6 +876,9 @@ public class WxFlowServiceImpl implements WxFlowService { }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); + }else if(isCoupon(flowType)){ + msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("contract",businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); @@ -885,6 +908,9 @@ public class WxFlowServiceImpl implements WxFlowService { }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); + }else if(isCoupon(flowType)){ + msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("contract",businessId.toString()); } wxMsgRecord.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); @@ -904,6 +930,9 @@ public class WxFlowServiceImpl implements WxFlowService { }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); + }else if(isCoupon(flowType)){ + msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("contract",businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); @@ -1020,6 +1049,9 @@ public class WxFlowServiceImpl implements WxFlowService { }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); + }else if(isCoupon(flowType)){ + msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("contract",businessId.toString()); } wxMsgRecord.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); @@ -1046,6 +1078,9 @@ public class WxFlowServiceImpl implements WxFlowService { }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); + }else if(isCoupon(flowType)){ + msgReplaceMap.put("bustype","有价卷"); + msgReplaceMap.put("contract",businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 7bbca4572..f08173d7e 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -42,7 +42,7 @@ - + @@ -95,7 +95,7 @@ `id`,`tenant_id`,`type`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`send_type`, `valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`, `remark`,`status`,`create_date`,`update_date`,`business`,`sub_business`,`support_transfer`,`subsidy_num`,`subsidy_type`, - `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,`put_apply_status`,`stock_apply_status`,`cancle_apply_status`,`conditions` + `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,`put_apply_status`,`stock_apply_status`,`cancle_apply_status`,`conditions`,approval_type