|
|
package com.yoho.ufo.order.controller;
|
|
|
|
|
|
import com.yoho.core.rabbitmq.YhProducer;
|
|
|
import com.yoho.order.dal.BuyerOrderMapper;
|
|
|
import com.yoho.ufo.util.DateUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/help")
|
|
|
public class OrderHelpController {
|
|
|
|
|
|
@Autowired
|
|
|
private BuyerOrderMapper buyerOrderMapper;
|
|
|
|
|
|
@Resource(name = "yhProducer")
|
|
|
private YhProducer yhProducer;
|
|
|
|
|
|
@RequestMapping(value = "/fixTimeoutNonConfirmOrder")
|
|
|
public void fixTimeoutNonConfirmOrder(String updateTime) {
|
|
|
String topic = "buyerOrder.autoConfirm";
|
|
|
int updateTimeSeconds = DateUtil.getTimeSecondsFromStr(updateTime, "yyyyMMddHHmmss");
|
|
|
int maxUpdateTimeSeconds = DateUtil.getCurrentTimeSeconds() - 7 * 24 * 3600;
|
|
|
if (updateTimeSeconds > maxUpdateTimeSeconds) {
|
|
|
return;
|
|
|
}
|
|
|
buyerOrderMapper.selectByStatusAndUpdateTimeLess(4, updateTimeSeconds)
|
|
|
.forEach(order -> yhProducer.send(topic, order));
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|