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

[退款][修改]:退款出错加处理,及只处理180天内的订单,时间更久的不处理了

release_toaliyun_real
Stormeye Wu 6 лет назад
Родитель
Сommit
a4d6b24b1d
2 измененных файлов: 9 добавлений и 2 удалений
  1. +7
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java
  2. +2
    -2
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 7
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java Просмотреть файл

@@ -10,6 +10,7 @@ import com.iformall.mapper.*;
import com.iformall.service.WxOrderService;
import com.iformall.service.WxProfitSharingOrderService;
import com.iformall.service.WxRefundOrderService;
import com.iformall.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -120,6 +121,12 @@ public class CouponOrderExpiringSchedule {
appinfo.setType(EnumAppType.B.getCode());
appinfo = wxAppinfoMapper.findList(appinfo).get(0);

Date limitDate = DateUtils.getTimeAfterDays(180, co.getCreateDate());
if (limitDate.before(new Date())) {
// 系统只自动处理180天内的订单
return;
}

try {
wxRefundOrderService.createRefundOrder(appinfo, co.getId(), EnumPayType.PAY_AUTO_REFUND, null);
} catch (MallinkException e) {


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

@@ -538,12 +538,12 @@

<select id="findExpiredFreeCouponOrderByValidDate" parameterType="com.iformall.domain.po.WxCouponOrder" resultMap="BaseResultMap">
select <include refid="allColumns" /> from wx_coupon_order
where expired_time &lt; now() and coupon_price = 0 and coupon_order_status = 0
where expired_time >= date_sub(curdate(),interval 180 day) and expired_time &lt; now() and coupon_price = 0 and coupon_order_status = 0
</select>

<select id="findExpiredCouponOrderByValidDate" parameterType="com.iformall.domain.po.WxCouponOrder" resultMap="BaseResultMap">
select <include refid="allColumns" /> from wx_coupon_order
where expired_time &lt; now() and coupon_price &gt; 0 and coupon_order_status = 0
where expired_time >= date_sub(curdate(),interval 180 day) and expired_time &lt; now() and coupon_price &gt; 0 and coupon_order_status = 0
</select>




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