|
@@ -1988,7 +1988,35 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
// storeOrderDTO.setStatus(PinkOrderStatusEnum.GROUP_ORDER_TO_SHIP.getKey());
|
|
// storeOrderDTO.setStatus(PinkOrderStatusEnum.GROUP_ORDER_TO_SHIP.getKey());
|
|
// exportFile(storeOrderDTO, response);
|
|
// exportFile(storeOrderDTO, response);
|
|
// }
|
|
// }
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void orderTimeoutAutomaticCancel() {
|
|
|
|
+ Date now = DateUtil.date();
|
|
|
|
+
|
|
|
|
+ PageHelper.startPage(1, 100);
|
|
|
|
+
|
|
|
|
+ Condition condition = new Condition(StoreOrder.class);
|
|
|
|
+ Example.Criteria criteria = condition.createCriteria();
|
|
|
|
+ Date settleTime = DateUtil.offsetMinute(now,-20);
|
|
|
|
+ criteria.andLessThanOrEqualTo("createTime",settleTime);
|
|
|
|
+ criteria.andEqualTo("isDelete", 0);
|
|
|
|
+ criteria.andEqualTo("status",PinkOrderStatusEnum.GROUP_ORDER_TO_PAY.getKey());
|
|
|
|
+ List<StoreOrder> byCondition = findByCondition(condition);
|
|
|
|
+ if(!org.springframework.util.CollectionUtils.isEmpty(byCondition)){
|
|
|
|
+ try {
|
|
|
|
+ for (StoreOrder storeOrder : byCondition) {
|
|
|
|
+ cancel(storeOrder.getId());
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ log.error("orderTimeoutAutomaticCancel处理失败",e);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void importDelivery(MultipartFile file, HttpServletResponse response) {
|
|
public void importDelivery(MultipartFile file, HttpServletResponse response) {
|