From a1d0151dc4be97c829009ed4bff4c4e80806fb60 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Mon, 8 Jul 2019 18:38:24 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E3=80=90sql][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0ORDER=E7=B4=A2=E5=BC=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V201907081840__G_ALTER_ORDER.sql | 1 + mallinkService/src/main/resources/mapper/WxOrderMapper.xml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201907081840__G_ALTER_ORDER.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201907081840__G_ALTER_ORDER.sql b/mallinkAdmin/src/main/resources/db/migration/V201907081840__G_ALTER_ORDER.sql new file mode 100644 index 000000000..ebbc755c1 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201907081840__G_ALTER_ORDER.sql @@ -0,0 +1 @@ +alter table wx_order add index tenant_product(tenant_id,product_id); \ No newline at end of file diff --git a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml index 63ce61cf7..395d8f788 100644 --- a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml @@ -551,7 +551,7 @@ select o.* from wx_order o where o.type=0 and o.order_status in (0,2,3,1,4) and o.id in( select o.id from wx_order o left join wx_coupon_merchant cm on o.product_id=cm.product_id group by o.id having count(o.id)>1)) o - left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id + left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id where o.tenant_id =#{tenantId} union all select o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time, o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone @@ -561,13 +561,13 @@ select o.id from wx_order o left join wx_coupon_merchant cm on o.product_id=cm.product_id group by o.id having count(o.id)>1) ) o - left join wx_coupon_merchant cm on o.product_id=cm.product_id + left join wx_coupon_merchant cm on o.product_id=cm.product_id where o.tenant_id =#{tenantId} union all select o.*,mbu.merchant_id from wx_order o left join wx_merchant_b_user mbu on o.product_id=mbu.id where o.type in (1,2) and o.order_status in (0,2,3,1,4) ) o left join wx_merchant m on o.merchant_id=m.id - left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id + left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id where o.tenant_id =#{tenantId} ) o From 64974e11a37a57cced0f34d785eed8d613f58140 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Mon, 8 Jul 2019 18:43:03 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E3=80=90=E6=B4=BB=E5=8A=A8=E6=8A=A5?= =?UTF-8?q?=E5=90=8D=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E6=9B=B4=E6=96=B0=E6=8A=A5=E5=90=8D=E7=8A=B6?= =?UTF-8?q?=E6=80=81]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/WxActivityJoinMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml index 06eb2c96d..8a4cf2cd1 100644 --- a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml @@ -106,7 +106,7 @@ - update wx_activity_join set `status`=2 where `status`!=2 and activity_id in(select id from wx_activity where is_expired=1) + update wx_activity_join set `status`=2 where `status`= 0 and activity_id in(select id from wx_activity where is_expired=1) From 1d503ab3f146b7ff6816af4b44c2456355066b14 Mon Sep 17 00:00:00 2001 From: luozukai Date: Mon, 8 Jul 2019 19:26:41 +0800 Subject: [PATCH 03/10] =?UTF-8?q?[=E7=BB=9F=E8=AE=A1][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=B8=9A=E6=80=81=E5=88=86=E6=9E=90=E6=B7=BB=E5=8A=A0=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=BF=87=E6=BB=A4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/WxBusinessMapper.xml | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml index 1d0685b1f..5ef85a00e 100644 --- a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml @@ -160,15 +160,33 @@ From 2c982bcb37934a6184ee14898b23c331622f7784 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Mon, 8 Jul 2019 19:45:33 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E3=80=90sql][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E7=A7=9F=E9=87=91=E8=B4=A6=E5=8D=95=E7=B4=A2=E5=BC=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V201907081942__G_ALTER_BILL_RENT.sql | 3 +++ .../src/main/resources/mapper/WxBillRentMapper.xml | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201907081942__G_ALTER_BILL_RENT.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201907081942__G_ALTER_BILL_RENT.sql b/mallinkAdmin/src/main/resources/db/migration/V201907081942__G_ALTER_BILL_RENT.sql new file mode 100644 index 000000000..2654374d4 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201907081942__G_ALTER_BILL_RENT.sql @@ -0,0 +1,3 @@ +alter table wx_bill_rent drop index t_p, +drop index r_m, +add index t_p_r_s_c(tenant_id,is_preview,rent_shop_type,status,createtime); diff --git a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml index a33efb69e..d26360059 100644 --- a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml @@ -95,31 +95,31 @@ From 765f0dd47dc5f2a069f4ff5a093b091ddb044d62 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Tue, 9 Jul 2019 11:45:21 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E3=80=90=E6=B4=BB=E5=8A=A8=E6=8A=A5?= =?UTF-8?q?=E5=90=8D][=E4=BF=AE=E6=94=B9][=E6=9B=B4=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E9=97=B4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/WxActivityJoinMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml index 8a4cf2cd1..f0cbb1407 100644 --- a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml @@ -106,7 +106,7 @@ - update wx_activity_join set `status`=2 where `status`= 0 and activity_id in(select id from wx_activity where is_expired=1) + update wx_activity_join set `status`=2,update_time=now() where `status`= 0 and activity_id in (select id from wx_activity where is_expired=1) From 793762cb8ce9c89dec95ce5904fed08935f1d206 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 9 Jul 2019 12:36:53 +0800 Subject: [PATCH 06/10] =?UTF-8?q?[=E5=81=9C=E8=BD=A6=E8=B4=B9][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]:=E5=81=9C=E8=BD=A6=E8=B4=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BAget/post=E9=83=BD=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/iformall/controller/WxCarController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCarController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCarController.java index 48e0c359a..6e8713a5b 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCarController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCarController.java @@ -556,7 +556,7 @@ public class WxCarController extends BaseController { " \"freeMinsAmount\": \"0.00\",\n" + " \"pmParkId\": \"d49aeaedcf144f1faf569846d6b16670\"\n" + " }") - @PostMapping("/getCarStopFee") + @RequestMapping("/getCarStopFee") public ResultData getCarStopFee(@RequestBody Map paramMap) { // 1, get mall's park WxPark park = getCurrentPark(getTenantId()); From 2ae397f796f23f5949c4db6f9d45d1a2145b6e71 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 9 Jul 2019 13:37:30 +0800 Subject: [PATCH 07/10] =?UTF-8?q?[=E5=81=9C=E8=BD=A6=E8=B4=B9][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]:=E5=81=9C=E8=BD=A6=E8=B4=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E4=B8=BApost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/controller/WxCarController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCarController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCarController.java index 6e8713a5b..f95779546 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCarController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCarController.java @@ -520,7 +520,7 @@ public class WxCarController extends BaseController { * 停车费 * @param paramMap * @return - */ + */ @ApiOperation(value = "停车费", notes = "ETCP:={\"etcpToken\":\"string\",\"carNumber\":\"string\"}\n输出\n{\n" + " \"carNumber\": \"渝****87\",\n" + " \"entranceTime\": \"2017-06-11 11:19:27\",\n" + @@ -556,7 +556,7 @@ public class WxCarController extends BaseController { " \"freeMinsAmount\": \"0.00\",\n" + " \"pmParkId\": \"d49aeaedcf144f1faf569846d6b16670\"\n" + " }") - @RequestMapping("/getCarStopFee") + @PostMapping("/getCarStopFee") public ResultData getCarStopFee(@RequestBody Map paramMap) { // 1, get mall's park WxPark park = getCurrentPark(getTenantId()); From d92660596deb686e5994641c53856d32fc01bc05 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 9 Jul 2019 13:38:57 +0800 Subject: [PATCH 08/10] =?UTF-8?q?[=E5=81=9C=E8=BD=A6=E8=B4=B9][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]:=E5=81=9C=E8=BD=A6=E8=B4=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E4=B8=BApost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mallinkCApi/src/main/java/com/iformall/utils/UrlCheck.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mallinkCApi/src/main/java/com/iformall/utils/UrlCheck.java b/mallinkCApi/src/main/java/com/iformall/utils/UrlCheck.java index d2bece626..e3961ad71 100644 --- a/mallinkCApi/src/main/java/com/iformall/utils/UrlCheck.java +++ b/mallinkCApi/src/main/java/com/iformall/utils/UrlCheck.java @@ -7,7 +7,8 @@ public class UrlCheck { public static boolean checkUrl(String url) { return url.contains("awsFileUpload") - || url.contains("awsFilesUpload"); + || url.contains("awsFilesUpload") + || url.contains("getCarStopFee"); } } From 6a952e36f1c54400918ab6c86d0e84b794d8526b Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 9 Jul 2019 14:23:37 +0800 Subject: [PATCH 09/10] =?UTF-8?q?[=E5=81=9C=E8=BD=A6=E8=B4=B9][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]:=E5=81=9C=E8=BD=A6=E8=B4=B9=E6=8E=A5=E5=8F=A3=20post?= =?UTF-8?q?=E9=99=90=E5=88=B6=E6=8B=BF=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/interceptor/RequestInterceptor.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/interceptor/RequestInterceptor.java b/mallinkCApi/src/main/java/com/iformall/interceptor/RequestInterceptor.java index 0c0180ece..035f39fe1 100644 --- a/mallinkCApi/src/main/java/com/iformall/interceptor/RequestInterceptor.java +++ b/mallinkCApi/src/main/java/com/iformall/interceptor/RequestInterceptor.java @@ -2,6 +2,7 @@ package com.iformall.interceptor; import com.iformall.utils.HashUtil; import com.iformall.utils.IPUtil; +import com.iformall.utils.UrlCheck; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; @@ -46,13 +47,20 @@ public class RequestInterceptor extends HandlerInterceptorAdapter { logger.debug("preHandle start 1"); return true; } + String ipaddress = IPUtil.getIpAddr(request); + String url = request.getRequestURL().toString(); + if (UrlCheck.checkUrl(url)) { + // pvlog不检查幂等 + // awsFileUpload不检查幂等 + // stopFee + return true; + } StringBuilder sb = new StringBuilder(); - sb.append(request.getRequestURL().toString()); + sb.append(url); sb.append("method=").append(request.getMethod()).append("&"); - String ipaddress = IPUtil.getIpAddr(request); sb.append("ip=").append(ipaddress).append("&"); final Enumeration parameterNames = request.getParameterNames(); From 406fecdc08e0e2b3655120d8d50d48bec91b66b7 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 9 Jul 2019 14:54:33 +0800 Subject: [PATCH 10/10] =?UTF-8?q?[=E7=BB=9F=E8=AE=A1][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=B8=9A=E6=80=81=E5=88=86=E6=9E=90=E6=B7=BB=E5=8A=A0=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=BF=87=E6=BB=A4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/market/WxCouponController.java | 2 +- .../V201907091441__L_ADD_FLOW_DATA.sql | 115 ++++++++++++++++++ .../controller/WxCouponChannelController.java | 5 +- .../iformall/domain/po/WxCouponChannel.java | 4 + .../java/com/iformall/enums/EnumMsgModel.java | 6 + .../service/impl/WxCouponServiceImpl.java | 1 + .../service/impl/WxFlowServiceImpl.java | 62 ++++++---- .../resources/mapper/WxBusinessMapper.xml | 36 +++--- .../mapper/WxCouponChannelMapper.xml | 3 + 9 files changed, 186 insertions(+), 48 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201907091441__L_ADD_FLOW_DATA.sql diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index a6065f9ee..de7a173d8 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -188,7 +188,7 @@ public class WxCouponController extends BaseController { if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); } - if(wxCoupon.getInventory()!=null && wxCoupon.getInventory().intValue() <= coupon.getInventory().intValue() ){ + if(wxCoupon.getInventory()!=null && wxCoupon.getInventory().intValue() < coupon.getInventory().intValue() ){ return new ResultData(ErrorCode.COUPON_STOCK_INV_ERR); } diff --git a/mallinkAdmin/src/main/resources/db/migration/V201907091441__L_ADD_FLOW_DATA.sql b/mallinkAdmin/src/main/resources/db/migration/V201907091441__L_ADD_FLOW_DATA.sql new file mode 100644 index 000000000..2ef0867b4 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201907091441__L_ADD_FLOW_DATA.sql @@ -0,0 +1,115 @@ +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1001', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1001', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1001', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1001', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1002', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1002', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1002', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1002', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1003', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1003', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1003', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1003', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1004', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1004', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1004', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1004', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1005', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1005', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1005', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1005', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1006', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1006', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1006', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1006', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1007', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1007', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1007', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1007', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1008', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1008', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1008', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1008', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1009', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1009', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1009', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1009', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1010', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1010', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1010', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1010', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1011', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1011', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1011', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1011', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + + +INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) +VALUES + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1012', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1012', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1012', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1012', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); + + diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java index 85f43d823..50295db22 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -47,10 +47,9 @@ public class WxCouponChannelController extends BaseController { if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); wxCouponChannel.setTenantId(getTenantId()); wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); - wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC, WxCouponChannel.Field.Id_DESC); - //过滤已作废 - wxCouponChannel.setStatus(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()); + wxCouponChannel.setCouponStatus(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()); + wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC, WxCouponChannel.Field.Id_DESC); PageInfo page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); filterTimed(wxCouponChannel, page); return new ResultData(page); diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponChannel.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponChannel.java index c3f5d5a3a..0572938e0 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponChannel.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponChannel.java @@ -74,6 +74,10 @@ public class WxCouponChannel extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="二维码",name="qrCode") private String qrCode; + @Transient + @io.swagger.annotations.ApiModelProperty(value="卷状态 0:可投放 1:作废",name="couponStatus") + private Integer couponStatus; + @Transient @io.swagger.annotations.ApiModelProperty(value="积分售价(适用于类型10,11)",name="creditPrice") private Integer creditPrice; diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java b/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java index ae421dc72..65f7f97ca 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java @@ -24,6 +24,12 @@ public enum EnumMsgModel { DELETE_SHARING_ACCOUNT_NOTIFY_MERCHANT(16, "商户分账账户删除提醒"), TIME_LIMIT_CAMPAIGN_JOIN_SUCCESS(17, "限时活动报名成功"), TIME_LIMIT_CAMPAIGN_NOTIFY(18, "限时活动参与提醒"), + + //卷 + FLOW_C_ASSIGNEE_NODIFY(19, "待办通知"), + FLOW_C_APPLY_NODIFY(20, "审批通知"), + FLOW_C_PASS_NODIFY(21, "通过审批通知"), + FLOW_C_REJECT_NODIFY(22, "驳回通知"), ; public static EnumMsgModel getEnum(Integer code) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index a22a32763..8f9686793 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -629,6 +629,7 @@ public class WxCouponServiceImpl implements WxCouponService { public WxCoupon findById(WxCoupon wxCoupon) { WxCoupon query = new WxCoupon(); query.setId(wxCoupon.getId()); + query.setType(wxCoupon.getType()); List list = wxCouponMapper.findCouponList(query); if(CollectionUtils.isNotEmpty(list)){ return list.get(0); 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 9c6c18c05..00b5301f6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -18,6 +18,7 @@ import com.iformall.mapper.*; import com.iformall.mq.MqBaseProducer; import com.iformall.service.*; import com.iformall.utils.Constant; +import com.iformall.utils.DateUtils; import com.iformall.utils.JsonUtil; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.map.HashedMap; @@ -116,6 +117,7 @@ public class WxFlowServiceImpl implements WxFlowService { Integer contractType = 0; String str = (String)getVariableByKey(variables,"contractType"); Integer operateType = (Integer)getVariableByKey(variables,"approvalType"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } @@ -206,28 +208,33 @@ public class WxFlowServiceImpl implements WxFlowService { wxCoupon.setStockApplyStatus(applyStatus); if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { //减库存 - if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { - Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); - Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); - Integer type = getIngeter(getVariableByKey(variables, "type")); - Integer validDays = getIngeter(getVariableByKey(variables, "validDays")); - Integer validType = getIngeter(getVariableByKey(variables, "validType")); - - wxCoupon.setInventory(inventory); - wxCoupon.setRemainInventory(remainInventory); - wxCoupon.setType(type); + Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); + Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); + Integer type = getIngeter(getVariableByKey(variables, "type")); + Integer validDays = getIngeter(getVariableByKey(variables, "validDays")); + Integer validType = getIngeter(getVariableByKey(variables, "validType")); + + String validStartDate = (String) getVariableByKey(variables, "validStartDate"); + String validEndDate = (String) getVariableByKey(variables, "validEndDate"); + try { + if(validStartDate != null) { + wxCoupon.setValidStartDate(sdf.parse(validStartDate)); + } + if(validEndDate != null){ + wxCoupon.setValidEndDate(sdf.parse(validEndDate)); + } + }catch (Exception e){ + e.printStackTrace(); + } + + if(validDays != null){ wxCoupon.setValidDays(validDays); - wxCoupon.setValidType(validType); - wxCouponService.updateCouponStockAndEndTime(wxCoupon); - }else if(EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType)){ - Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); - wxCoupon.setRemainInventory(remainInventory); - wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); - }else if(EnumFlowKey.NEW_PRESS_UPLINE.getCode().equals(flowType)){ - Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); - wxCoupon.setInventory(inventory); - wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); } + wxCoupon.setInventory(inventory); + wxCoupon.setRemainInventory(remainInventory); + wxCoupon.setType(type); + wxCoupon.setValidType(validType); + wxCouponService.updateCouponStockAndEndTime(wxCoupon); } }else if(EnumCouponAppType.CANCLE.getCode().equals(operateType)){ wxCoupon.setCancleApplyStatus(applyStatus); @@ -359,8 +366,7 @@ public class WxFlowServiceImpl implements WxFlowService { dynamicContentMap.put("bustype","账单"); dynamicContentMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - dynamicContentMap.put("bustype","有价券"); - dynamicContentMap.put("contract",businessId.toString()); + wxMsgRecord.setModelType(EnumMsgModel.FLOW_C_ASSIGNEE_NODIFY.getCode()); } wxMsgRecord.setDynamicContentMap(dynamicContentMap); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); @@ -863,8 +869,10 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - msgReplaceMap.put("bustype","有价券"); - msgReplaceMap.put("contract",businessId.toString()); + wxMsgRecord.setModelType(EnumMsgModel.FLOW_C_APPLY_NODIFY.getCode()); + WxCoupon wxCoupon = this.wxCouponMapper.selectByPrimaryKey(businessId); + msgReplaceMap.put("type",EnumCouponType.getEnum(wxCoupon.getType()).getMessage()); + msgReplaceMap.put("name",wxCoupon.getTitle()); } wxMsgRecord.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); @@ -917,8 +925,10 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }else if(isCoupon(flowType)){ - msgReplaceMap.put("bustype","有价券"); - msgReplaceMap.put("contract",businessId.toString()); + wxMsgRecord.setModelType(EnumMsgModel.FLOW_C_PASS_NODIFY.getCode()); + WxCoupon wxCoupon = this.wxCouponMapper.selectByPrimaryKey(businessId); + msgReplaceMap.put("type",EnumCouponType.getEnum(wxCoupon.getType()).getMessage()); + msgReplaceMap.put("name",wxCoupon.getTitle()); } wxMsgRecord.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); diff --git a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml index 5ef85a00e..88f5ecca6 100644 --- a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml @@ -84,17 +84,17 @@ select b.id,b.title, round( - (select sum(mtd.trade_amt) + (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) from wx_merchant m left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) /100,2) volume, round( - (select sum(mtd.trade_amt) + (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) from wx_merchant m left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) / - (select sum(ws.operation_area) + (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) from wx_merchant m left join wx_merchant_shop mtd on mtd.merchant_id = m.id left join wx_shop ws on(mtd.shop_id = ws.id) @@ -103,13 +103,13 @@ round( (select - (select sum(br.receive_pay) receive_pay from wx_merchant m + (select if(sum(br.receive_pay) is null,0,sum(br.receive_pay)) receive_pay from wx_merchant m left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) + - (select sum(br.receive_pay) receive_pay from wx_merchant m + (select if(sum(br.receive_pay) is null,0,sum(br.receive_pay)) receive_pay from wx_merchant m left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) from dual) / - (select sum(ws.operation_area) + (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) from wx_merchant m left join wx_merchant_shop mtd on mtd.merchant_id = m.id left join wx_shop ws on(mtd.shop_id = ws.id) @@ -118,11 +118,11 @@ round( round( - (select sum(mtd.trade_amt) + (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) from wx_merchant m left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) / - (select sum(ws.operation_area) + (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) from wx_merchant m left join wx_merchant_shop mtd on mtd.merchant_id = m.id left join wx_shop ws on(mtd.shop_id = ws.id) @@ -131,13 +131,13 @@ / round( (select - (select sum(br.receive_pay) receive_pay from wx_merchant m + (select if(sum(br.receive_pay) is null,0,sum(br.receive_pay)) receive_pay from wx_merchant m left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) + - (select sum(br.receive_pay) receive_pay from wx_merchant m + (select if(sum(br.receive_pay) is null,0,sum(br.receive_pay)) receive_pay from wx_merchant m left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) from dual) / - (select sum(ws.operation_area) + (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) from wx_merchant m left join wx_merchant_shop mtd on mtd.merchant_id = m.id left join wx_shop ws on(mtd.shop_id = ws.id) @@ -147,7 +147,7 @@ rentSaleRate, round( - (select sum(mtd.trade_amt) + (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) from wx_merchant m left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) / (select count(mtd.id) @@ -159,13 +159,13 @@