xhxu 5 лет назад
Родитель
Сommit
fdbec60741
2 измененных файлов: 29 добавлений и 10 удалений
  1. +21
    -9
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java
  2. +8
    -1
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 21
- 9
mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java Просмотреть файл

@@ -258,16 +258,28 @@ public class WxCouponOrderController extends BaseController {
}

Date now = new Date();
if (wxCouponOrderCVo.getValidType().equals(EnumCouponValidType.BETWEEN_TWO_TIME.getCode())
&& !wxCouponOrderCVo.getType().equals(EnumCouponType.COUPON_PREORDER.getCode())) {
if (wxCouponOrderCVo.getValidStartDate().after(now)) {
logger.error("此券有效期未开始:" + couponOrderIdStr);
return new ResultData(ErrorCode.COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE);
}
if (wxCouponOrderCVo.getValidEndDate().before(now)) {
logger.error("此券有效期已结束:" + couponOrderIdStr);
return new ResultData(ErrorCode.COUPON_ORDER_IS_LATER_THAN_VALIDDATE);
if (wxCouponOrderCVo.getValidType().equals(EnumCouponValidType.BETWEEN_TWO_TIME.getCode())){
// && !wxCouponOrderCVo.getType().equals(EnumCouponType.COUPON_PREORDER.getCode())) {
if(wxCouponOrderCVo.getType().equals(EnumCouponType.COUPON_PREORDER.getCode())){
if (wxCouponOrderCVo.getPickStartDate().after(now)) {
logger.error("此券有效期未开始:" + couponOrderIdStr);
return new ResultData(ErrorCode.COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE);
}
if (wxCouponOrderCVo.getPickEndDate().before(now)) {
logger.error("此券有效期已结束:" + couponOrderIdStr);
return new ResultData(ErrorCode.COUPON_ORDER_IS_LATER_THAN_VALIDDATE);
}
}else{
if (wxCouponOrderCVo.getValidStartDate().after(now)) {
logger.error("此券有效期未开始:" + couponOrderIdStr);
return new ResultData(ErrorCode.COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE);
}
if (wxCouponOrderCVo.getValidEndDate().before(now)) {
logger.error("此券有效期已结束:" + couponOrderIdStr);
return new ResultData(ErrorCode.COUPON_ORDER_IS_LATER_THAN_VALIDDATE);
}
}

} else {
if (wxCouponOrderCVo.getExpiredTime().before(now)) {
logger.error("此券已过期:" + couponOrderIdStr);


+ 8
- 1
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Просмотреть файл

@@ -1037,7 +1037,7 @@

<sql id="allCUserCouponOrderDetailColumns">
co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.pay_vendor,
c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.detail,c.remark,c.valid_type,c.valid_start_date,c.valid_end_date,c.auto_refund
c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_type,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date,c.auto_refund
</sql>

<sql id="simpleCUserCouponOrderDetailColumns">
@@ -1071,6 +1071,10 @@
<result column="use_price" jdbcType="INTEGER" property="usePrice" />
<result column="detail" jdbcType="VARCHAR" property="detail" />
<result column="price" jdbcType="INTEGER" property="price" />

<result column="tail_price" jdbcType="INTEGER" property="tailPrice"/>
<result column="orig_price" jdbcType="INTEGER" property="origPrice"/>

<result column="unit" jdbcType="INTEGER" property="unit" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="valid_type" jdbcType="INTEGER" property="validType" />
@@ -1078,6 +1082,9 @@
<result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/>
<result column="auto_refund" jdbcType="INTEGER" property="autoRefund" />

<result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/>
<result column="pick_end_date" jdbcType="TIMESTAMP" property="pickEndDate"/>

<result column="send_channel_type" jdbcType="INTEGER" property="sendChannelType" />

<collection column="{productId=coupon_id,tenantId=tenant_id}" property="merchantVoList"


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