From e29e9691a5110cb52c43e6ecf82175f923b33893 Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 28 Dec 2021 18:32:35 +0800 Subject: [PATCH] =?UTF-8?q?/=E3=80=81update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/market/WxCouponController.java | 3 +++ .../db/migration/V2021122800001__add_type.sql | 15 +++++++++++++++ .../main/java/com/iformall/common/ErrorCode.java | 1 + .../main/java/com/iformall/enums/EnumFlowKey.java | 7 +++++-- .../iformall/service/impl/WxFlowServiceImpl.java | 9 ++++++--- .../iformall/service/impl/WxTopicServiceImpl.java | 11 ++++++++--- 6 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V2021122800001__add_type.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 83375226b..6db793090 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -261,6 +261,9 @@ public class WxCouponController extends BaseController { if (coupon == null) { return new ResultData(ErrorCode.COUPON_IS_EMPTY); } + if(EnumCouponSendType.GIFT.getCode().equals(coupon.getSendType())){ + return new ResultData(ErrorCode.COUPON_GIFT_NOTUPD_INVENTORY); + } if ((wxCoupon.getValidEndDate() != null && coupon.getValidEndDate() != null && DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) && wxCoupon.getInventory().equals(coupon.getInventory())) || diff --git a/mallinkAdmin/src/main/resources/db/migration/V2021122800001__add_type.sql b/mallinkAdmin/src/main/resources/db/migration/V2021122800001__add_type.sql new file mode 100644 index 000000000..a6d393a8c --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2021122800001__add_type.sql @@ -0,0 +1,15 @@ + +UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 211, 212, 221, 222, 251, 409, 411, 416, 500, 502, 504, 505, 506, 507, 508, 511, 512, 521, 522, 523, 531, 532, 533, 591, 592, 595, 602, 605, 606, 610, 641, 671, 674, 680, 711, 901, 902, 904, 907]' WHERE `id` = 11; + + + + +INSERT INTO `wx_flow_config`(`id`, `parent_id`, `tenant_id`, `parent_tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +select CEILING(RAND()*90000000000+20000000000) ,id,tenant_id,parent_tenant_id, '商品预购审批',24,0,'2021-12-28 18:27:18', '2021-12-28 18:27:18', 5 +from wx_flow_config where parent_id = 0 and type = 0 and name = '营销审批'; +INSERT INTO `wx_flow_config`(`id`, `parent_id`, `tenant_id`, `parent_tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +select CEILING(RAND()*90000000000+20000000000) ,id,tenant_id,parent_tenant_id, '配送商品审批',25,0,'2021-12-28 18:27:18', '2021-12-28 18:27:18', 5 +from wx_flow_config where parent_id = 0 and type = 0 and name = '营销审批'; +INSERT INTO `wx_flow_config`(`id`, `parent_id`, `tenant_id`, `parent_tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +select CEILING(RAND()*90000000000+20000000000) ,id,tenant_id,parent_tenant_id, '积分券审批',26,0,'2021-12-28 18:27:18', '2021-12-28 18:27:18', 5 +from wx_flow_config where parent_id = 0 and type = 0 and name = '营销审批'; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java index c67981d48..4f8999fbe 100644 --- a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java +++ b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java @@ -149,6 +149,7 @@ public enum ErrorCode{ COUPON_IS_EMPTY_GIFT(2120, "子券不存在"), COUPON_IS_TAKE_OFF_GIFT(2122, "子券存在作废券"), COUPON_VALID_DATE_ERR_GIFT(2135, "存在子券有效期在券包有效期之前"), + COUPON_GIFT_NOTUPD_INVENTORY(2136, "子券没有库存"), /** * 车流 2040 */ diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java b/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java index f56b31deb..16655c8a1 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java @@ -16,12 +16,15 @@ public enum EnumFlowKey { NEW_BILL_CHANGE(8, "账单应收金额变更"), - NEW_COUPON_UPLINE(9, "有价券审批"), + NEW_COUPON_UPLINE(9, "券审批"), NEW_CARD_UPLINE(10, "卡审批"), NEW_GROUP_UPLINE(11, "拼团"), NEW_PRESS_UPLINE(12, "砍价审批"), - B_COUPON_MERCHANT_CREATE(22,"B端创建券"), + B_COUPON_MERCHANT_CREATE(22,"B端创建券审批"), + NEW_COUPON_PREORDER_UPLINE(24,"商品预购审批"), + NEW_COUPON_DISTRIBUTION_UPLINE(25,"配送商品审批"), + NEW_COUPON_CREDIT_UPLINE(26,"积分券审批"), NEW_PRO_CONTRACT(13, "商铺物业合同签约"), NEW_PRO_END(14, "商铺物业合同终止"), 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 7c3a7b94f..a1d0a397b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -114,12 +114,15 @@ public class WxFlowServiceImpl implements WxFlowService { " ( '" + id1 + "', '0', '" + tenantId + "', '营销审批', '0', '0', '" + nowTimestr + "', '" + nowTimestr + "', '3')," + " ( '" + id2 + "', '0', '" + tenantId + "', '合同审批', '0', '0', '" + nowTimestr + "', '" + nowTimestr + "', '1')," + " ( '" + id3 + "', '0', '" + tenantId + "', '账单审批', '0', '0', '" + nowTimestr + "', '" + nowTimestr + "', '2')," + - " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '拼团审批', '11', '0', '" + nowTimestr + "', '" + nowTimestr + "', '3')," + - " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '有价券审批', '9', '0', '" + nowTimestr + "', '" + nowTimestr + "', '1')," + + " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '券审批', '9', '0', '" + nowTimestr + "', '" + nowTimestr + "', '1')," + " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '卡审批', '10', '0', '" + nowTimestr + "', '" + nowTimestr + "', '2')," + + " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '拼团审批', '11', '0', '" + nowTimestr + "', '" + nowTimestr + "', '3')," + " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '砍价审批', '12', '0', '" + nowTimestr + "', '" + nowTimestr + "', '4')," + - " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', 'B端创建券', '22', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + + " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', 'B端创建券审批', '22', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '商户提现审批', '23', '0', '" + nowTimestr + "', '" + nowTimestr + "', '6')," + + " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '商品预购审批', '24', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + + " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '配送商品审批', '25', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + + " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '积分券审批', '26', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '多经点位租金+物业合同签约', '19', '0', '" + nowTimestr + "', '" + nowTimestr + "', '11')," + " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '商铺租金+物业合同终止', '18', '0', '" + nowTimestr + "', '" + nowTimestr + "', '10')," + " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '商铺物业合同签约', '13', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java index 37ba40770..8a94377ac 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java @@ -122,9 +122,12 @@ public class WxTopicServiceImpl implements WxTopicService { record.setId(idWorker.nextId()); wxTopicMapper.insert(record); - if(EnumWxTopicType.SPECIAL_TOPIC.getCode().equals(record.getTopicType()) - && StringUtils.isNotBlank(record.getCouponIds())) { - addCouponTopic(record); + if(EnumWxTopicType.SPECIAL_TOPIC.getCode().equals(record.getTopicType())){ + if(StringUtils.isNotBlank(record.getCouponIds())){ + addCouponTopic(record); + }else{ + record.setIsOnlyAd(EnumYesOrNo.YES.getCode()); + } } return new ResultData(Result.SUCCESS,"添加成功"); } else { @@ -135,6 +138,8 @@ public class WxTopicServiceImpl implements WxTopicService { //优化:区分添加的和删除的 wxCouponChannelMapper.delByTopic(record); addCouponTopic(record); + }else{ + record.setIsOnlyAd(EnumYesOrNo.YES.getCode()); } wxTopicMapper.couponDownLine(record); }