|
@@ -6,8 +6,14 @@ import com.steerinfo.dil.mapper.UniversalMapper;
|
|
|
import com.steerinfo.dil.service.UniversalService;
|
|
|
import com.steerinfo.dil.util.ESUtil;
|
|
|
import com.steerinfo.dil.util.HTTPRequestUtils;
|
|
|
+import com.steerinfo.framework.controller.RESTfulResult;
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
+import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
+import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -22,7 +28,8 @@ import java.util.*;
|
|
|
* @ author :TXF
|
|
|
* @ time :2021/10/19 18:05
|
|
|
*/
|
|
|
-
|
|
|
+@EnableScheduling
|
|
|
+@EnableAsync
|
|
|
@Service
|
|
|
public class UniversalServiceImpl implements UniversalService {
|
|
|
|
|
@@ -227,4 +234,17 @@ public class UniversalServiceImpl implements UniversalService {
|
|
|
return 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 关闭过期运输订单
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Async
|
|
|
+ @Scheduled(cron = "0 0 8 * * ?")
|
|
|
+ public void closePassedOrder() {
|
|
|
+ List<Map<String,Object>> passedOrderList = universalMapper.findPassedOrder();
|
|
|
+ System.out.println("关闭的未出厂过期订单如下:<" + passedOrderList + ">");
|
|
|
+ int result = universalMapper.closePassedOrder();
|
|
|
+ System.out.println("订单关闭数为:" + result);
|
|
|
+ }
|
|
|
}
|