Explorar el Código

update gift

release_toaliyun_real
xhxu hace 4 años
padre
commit
1fcf7f555d
Se han modificado 5 ficheros con 54 adiciones y 1 borrados
  1. +5
    -0
      mallinkAdmin/src/main/resources/db/migration/V2021091500003__wx_mall_permission.sql
  2. +3
    -0
      mallinkService/src/main/java/com/iformall/common/ErrorCode.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  4. +37
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  5. +8
    -0
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 5
- 0
mallinkAdmin/src/main/resources/db/migration/V2021091500003__wx_mall_permission.sql Ver fichero

@@ -8,3 +8,8 @@ INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`,
--UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' WHERE `id` = 1;

UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' WHERE `id` = 1;




[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]

+ 3
- 0
mallinkService/src/main/java/com/iformall/common/ErrorCode.java Ver fichero

@@ -140,6 +140,9 @@ public enum ErrorCode{
COUPON_ONLY_FOR_NEW_MEMBER(2044, "您已经参加过新会员活动"),
COUPON_ALREADY_IN_NEW_MEMBER(2045, "您已经不是新用户"),
COUPON_VALID_NOT_SUPPORTED(2046, "券类型不支持"),

COUPON_IS_EMPTY_GIFT(2120, "子券不存在"),
COUPON_VALID_DATE_ERR_GIFT(2135, "子券有效期在券包有效期之前"),
/**
* 车流 2040
*/


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java Ver fichero

@@ -462,7 +462,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
logger.error("券: coupon-" + wxCoupon.getId() + "核销: couponMerchantId-" + bUser.getMerchantId());
throw new MallinkException(ErrorCode.VERIFY_COUPON_ORDER_MERCHANT_IS_NULL);
}
merchantId = bUser.getId();
merchantId = bUser.getMerchantId();
}

if(merchantId != null){


+ 37
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Ver fichero

@@ -338,6 +338,28 @@ public class WxCouponServiceImpl implements WxCouponService {
}
}

if(EnumCouponType.COUPON_GIFT.getCode().equals(record.getType())){
//券礼包时间判断
WxCoupon couponQ = new WxCoupon();
couponQ.updateTenantInfo(record);
List<Long> longs = JSON.parseArray(record.getGiftList(), Long.class);
if(longs != null && longs.size() > 0){
couponQ.setIds(longs);
List<WxCoupon> list = wxCouponMapper.findList(couponQ);
if(list != null && list.size() > 0){
for (WxCoupon wc:list) {
if(wc.getValidEndDate().before(record.getValidEndDate())){
return new ResultData(ErrorCode.COUPON_VALID_DATE_ERR_GIFT);
}
}
}else{
return new ResultData(ErrorCode.COUPON_IS_EMPTY_GIFT);
}
}else{
return new ResultData(ErrorCode.COUPON_IS_EMPTY_GIFT);
}
}

if (EnumCouponContentType.HTML.getCode().equals(record.getContentType())) {
if (StringUtils.isEmpty(record.getHtml())) {
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "请填写富文本内容");
@@ -450,6 +472,21 @@ public class WxCouponServiceImpl implements WxCouponService {
wxCouponMapper.insert(record);

} else {
if(EnumCouponSendType.GIFT.getCode().equals(record.getSendType())){
//券礼包子券类型判断时间
WxCoupon couponQ = new WxCoupon();
couponQ.updateTenantInfo(record);
couponQ.setGiftList(Long.toString(record.getId()));
List<WxCoupon> couponList = wxCouponMapper.findCouponList(couponQ);
if(couponList != null && couponList.size() > 0){
for (WxCoupon wc:couponList) {
if(EnumCouponType.COUPON_GIFT.getCode().equals(wc.getType())
&& record.getValidEndDate().before(wc.getValidEndDate())){
return new ResultData(ErrorCode.COUPON_VALID_DATE_ERR_GIFT);
}
}
}
}
if(record.getInventory() != null && record.getRemainInventory() != null) {
// 库存修改检查
WxCoupon oldCoupon = wxCouponMapper.selectById(record.getId(),record.getTenantId());


+ 8
- 0
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Ver fichero

@@ -287,6 +287,10 @@
and `source_type` = #{sourceType}
</if>

<if test=" null != giftList">
and JSON_CONTAINS(gift_list,#{giftList})
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
@@ -560,6 +564,10 @@
</if>
</if>-->

<if test=" null != giftList">
and JSON_CONTAINS(c.gift_list,#{giftList})
</if>

<if test=" null != ids ">
and c.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


Cargando…
Cancelar
Guardar