From 43354a33e6a67d394d58e4741cf695a52135a236 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 22 Mar 2023 17:07:06 +0800 Subject: [PATCH] //COUPON --- .../migration/V2023032200001_coupon_press.sql | 109 ++++++++++++++++++ .../controller/WxCouponController.java | 3 + .../com/iformall/domain/po/WxCardSpend.java | 2 +- .../java/com/iformall/domain/po/WxCoupon.java | 2 +- .../service/impl/WxOrderGroupServiceImpl.java | 3 +- .../service/impl/WxOrderServiceImpl.java | 3 +- .../java/com/iformall/utils/DateUtils.java | 19 ++- 7 files changed, 133 insertions(+), 8 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V2023032200001_coupon_press.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023032200001_coupon_press.sql b/mallinkAdmin/src/main/resources/db/migration/V2023032200001_coupon_press.sql new file mode 100644 index 000000000..caf3b204f --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2023032200001_coupon_press.sql @@ -0,0 +1,109 @@ + +update wx_coupon_0 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_1 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_2 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_3 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_4 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_5 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_6 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_7 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_8 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_9 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_10 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_11 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_12 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_13 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_14 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_15 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_16 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_17 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_18 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_19 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_20 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_21 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_22 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_23 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_24 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_25 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_26 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_27 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_28 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_29 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_30 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_31 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_32 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_33 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_34 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_35 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_36 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_37 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_38 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_39 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_40 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_41 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_42 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_43 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_44 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_45 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_46 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_47 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_48 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_49 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_50 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_51 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_52 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_53 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_54 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_55 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_56 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_57 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_58 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_59 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_60 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_61 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_62 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_63 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_64 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_65 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_66 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_67 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_68 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_69 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_70 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_71 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_72 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_73 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_74 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_75 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_76 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_77 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_78 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_79 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_80 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_81 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_82 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_83 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_84 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_85 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_86 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_87 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_88 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_89 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_90 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_91 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_92 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_93 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_94 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_95 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_96 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_97 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_98 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; +update wx_coupon_99 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; + + + + + + + + diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java index 8263955c7..4ca2133a4 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java @@ -120,6 +120,8 @@ public class WxCouponController extends BaseController { @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true), @ApiImplicitParam(name = "mallTenantId", value = "mallTenantId", dataType = "String", paramType = "query", required = false)}) public ResultData couponDetail(String couponChannelId) { + logger.info("couponDetail----tenant"+JSON.toJSONString(getTenantInfo())); + if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) ) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空"); @@ -182,6 +184,7 @@ public class WxCouponController extends BaseController { @ApiImplicitParams({ @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true)}) public ResultData couponPriceAndStock(String couponChannelId) { + logger.info("couponPriceAndStock----tenant"+JSON.toJSONString(getTenantInfo())); if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED))) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空"); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java index 0a7970120..fd31e6dbf 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java @@ -19,7 +19,7 @@ public class WxCardSpend extends TenantEntity { protected Long id; - @Excel(name = "订单类型", width = 20, orderNum = "8", replace = {"付款_0", "退款_1"}) + @Excel(name = "订单类型", width = 20, orderNum = "8", replace = {"付款_0", "退款_1", "充值_1"}) @io.swagger.annotations.ApiModelProperty(value="EnumPayType",name="payType") private Integer payType; 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 8c58e357b..4c9ff5fa0 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -176,7 +176,7 @@ public class WxCoupon extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="砍价/团购限制人数",name="pressLimitNum") private Integer pressLimitNum; - @io.swagger.annotations.ApiModelProperty(value="砍价限制时间",name="pressLimitHours") + @io.swagger.annotations.ApiModelProperty(value="砍价限制时间(单位分钟)",name="pressLimitHours") private Integer pressLimitHours; @io.swagger.annotations.ApiModelProperty(value="砍价支付扣库存EnumYesOrNo",name="pressPayReduceStock") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java index c85303f7c..aba17482e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java @@ -191,7 +191,8 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { wxOrderGroup.setCreateDate(date); wxOrderGroup.setUpdateDate(date); wxOrderGroup.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode()); - Date expiredDate = DateUtils.getHourTimeAfter(wxCoupon.getPressLimitHours(), new Date()); +// Date expiredDate = DateUtils.getHourTimeAfter(wxCoupon.getPressLimitHours(), new Date()); + Date expiredDate = DateUtils.getMinuteTimeAfter(wxCoupon.getPressLimitHours(), new Date()); if (expiredDate.after(wxCoupon.getValidEndDate())) { expiredDate = wxCoupon.getValidEndDate(); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index 29e7d2dd2..525cb80a8 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -3450,7 +3450,8 @@ public class WxOrderServiceImpl implements WxOrderService { // 初始砍价信息 record.setPressCurrentNum(0); // 砍价券过期时间取券的过期时间和砍价限制时间中时间小的那个 - Date pressEndDate = DateUtils.getHourTimeAfter(coupon.getPressLimitHours(), new Date()); +// Date pressEndDate = DateUtils.getHourTimeAfter(coupon.getPressLimitHours(), new Date()); + Date pressEndDate = DateUtils.getMinuteTimeAfter(coupon.getPressLimitHours(), new Date()); if (pressEndDate.after(coupon.getValidEndDate())) pressEndDate = coupon.getValidEndDate(); record.setPressEndDate(pressEndDate); diff --git a/mallinkService/src/main/java/com/iformall/utils/DateUtils.java b/mallinkService/src/main/java/com/iformall/utils/DateUtils.java index 89b943d52..2588fa558 100755 --- a/mallinkService/src/main/java/com/iformall/utils/DateUtils.java +++ b/mallinkService/src/main/java/com/iformall/utils/DateUtils.java @@ -393,8 +393,8 @@ public class DateUtils { /** * 获得当前时间前几秒的时间 * - * @param hour - * 前几小时 + * @param + * * @return */ public static String getSecondsTimeBefore(int seconds, Date myDate) { @@ -407,8 +407,7 @@ public class DateUtils { /** * 获得当前时间后几秒的时间 * - * @param hour - * 后几小时 + * @param * @return */ public static Date getSecondsTimeAfter(int seconds, Date myDate) { @@ -416,6 +415,18 @@ public class DateUtils { Date testDate = new Date(myTime * 1000); return testDate; } + + /** + * 获得当前时间后几分钟的时间 + * + * @param + * @return + */ + public static Date getMinuteTimeAfter(int minute, Date myDate) { + long myTime = (myDate.getTime() / 1000) + 60 * minute; + Date testDate = new Date(myTime * 1000); + return testDate; + } /** * 获得当前时间后几小时的时间