Просмотр исходного кода

//COUPON

release_toaliyun_real
xhxu 3 лет назад
Родитель
Сommit
43354a33e6
7 измененных файлов: 133 добавлений и 8 удалений
  1. +109
    -0
      mallinkAdmin/src/main/resources/db/migration/V2023032200001_coupon_press.sql
  2. +3
    -0
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  5. +2
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java
  6. +2
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
  7. +15
    -4
      mallinkService/src/main/java/com/iformall/utils/DateUtils.java

+ 109
- 0
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;









+ 3
- 0
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 = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true),
@ApiImplicitParam(name = "mallTenantId", value = "mallTenantId", dataType = "String", paramType = "query", required = false)}) @ApiImplicitParam(name = "mallTenantId", value = "mallTenantId", dataType = "String", paramType = "query", required = false)})
public ResultData couponDetail(String couponChannelId) { public ResultData couponDetail(String couponChannelId) {
logger.info("couponDetail----tenant"+JSON.toJSONString(getTenantInfo()));

if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED))
) { ) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空"); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空");
@@ -182,6 +184,7 @@ public class WxCouponController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true)}) @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true)})
public ResultData couponPriceAndStock(String couponChannelId) { public ResultData couponPriceAndStock(String couponChannelId) {
logger.info("couponPriceAndStock----tenant"+JSON.toJSONString(getTenantInfo()));
if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED))) { if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED))) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空"); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空");
} }


+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java Просмотреть файл

@@ -19,7 +19,7 @@ public class WxCardSpend extends TenantEntity {
protected Long id; 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") @io.swagger.annotations.ApiModelProperty(value="EnumPayType",name="payType")
private Integer payType; private Integer payType;




+ 1
- 1
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") @io.swagger.annotations.ApiModelProperty(value="砍价/团购限制人数",name="pressLimitNum")
private Integer pressLimitNum; private Integer pressLimitNum;


@io.swagger.annotations.ApiModelProperty(value="砍价限制时间",name="pressLimitHours")
@io.swagger.annotations.ApiModelProperty(value="砍价限制时间(单位分钟)",name="pressLimitHours")
private Integer pressLimitHours; private Integer pressLimitHours;
@io.swagger.annotations.ApiModelProperty(value="砍价支付扣库存EnumYesOrNo",name="pressPayReduceStock") @io.swagger.annotations.ApiModelProperty(value="砍价支付扣库存EnumYesOrNo",name="pressPayReduceStock")


+ 2
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java Просмотреть файл

@@ -191,7 +191,8 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService {
wxOrderGroup.setCreateDate(date); wxOrderGroup.setCreateDate(date);
wxOrderGroup.setUpdateDate(date); wxOrderGroup.setUpdateDate(date);
wxOrderGroup.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode()); 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())) { if (expiredDate.after(wxCoupon.getValidEndDate())) {
expiredDate = wxCoupon.getValidEndDate(); expiredDate = wxCoupon.getValidEndDate();
} }


+ 2
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java Просмотреть файл

@@ -3450,7 +3450,8 @@ public class WxOrderServiceImpl implements WxOrderService {
// 初始砍价信息 // 初始砍价信息
record.setPressCurrentNum(0); 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())) if (pressEndDate.after(coupon.getValidEndDate()))
pressEndDate = coupon.getValidEndDate(); pressEndDate = coupon.getValidEndDate();
record.setPressEndDate(pressEndDate); record.setPressEndDate(pressEndDate);


+ 15
- 4
mallinkService/src/main/java/com/iformall/utils/DateUtils.java Просмотреть файл

@@ -393,8 +393,8 @@ public class DateUtils {
/** /**
* 获得当前时间前几秒的时间 * 获得当前时间前几秒的时间
* *
* @param hour
* 前几小时
* @param
*
* @return * @return
*/ */
public static String getSecondsTimeBefore(int seconds, Date myDate) { public static String getSecondsTimeBefore(int seconds, Date myDate) {
@@ -407,8 +407,7 @@ public class DateUtils {
/** /**
* 获得当前时间后几秒的时间 * 获得当前时间后几秒的时间
* *
* @param hour
* 后几小时
* @param
* @return * @return
*/ */
public static Date getSecondsTimeAfter(int seconds, Date myDate) { public static Date getSecondsTimeAfter(int seconds, Date myDate) {
@@ -416,6 +415,18 @@ public class DateUtils {
Date testDate = new Date(myTime * 1000); Date testDate = new Date(myTime * 1000);
return testDate; 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;
}
/** /**
* 获得当前时间后几小时的时间 * 获得当前时间后几小时的时间


Загрузка…
Отмена
Сохранить