|
@@ -1,23 +1,28 @@
|
|
|
package com.iamberry.rst.controllers.mq;
|
|
|
|
|
|
import com.iamberry.rst.controllers.sys.SysController;
|
|
|
-import com.iamberry.rst.core.cm.*;
|
|
|
+import com.iamberry.rst.core.cm.CompanyInfo;
|
|
|
+import com.iamberry.rst.core.cm.Postage;
|
|
|
+import com.iamberry.rst.core.cm.PostageAuthority;
|
|
|
+import com.iamberry.rst.core.cm.SalesOrder;
|
|
|
import com.iamberry.rst.core.fm.ComplaintDetectInfo;
|
|
|
import com.iamberry.rst.core.order.ProductType;
|
|
|
import com.iamberry.rst.core.sms.OrderMessage;
|
|
|
import com.iamberry.rst.core.sms.SmsMessage;
|
|
|
import com.iamberry.rst.core.sys.Admin;
|
|
|
+import com.iamberry.rst.core.tools.KuaiDi100;
|
|
|
+import com.iamberry.rst.core.tools.LogisticsInfo;
|
|
|
import com.iamberry.rst.faces.address.AddressService;
|
|
|
import com.iamberry.rst.faces.cm.*;
|
|
|
import com.iamberry.rst.faces.fm.ComplaintDetectInfoService;
|
|
|
import com.iamberry.rst.faces.order.EfastOrderService;
|
|
|
+import com.iamberry.rst.faces.order.LogisticsInfoService;
|
|
|
import com.iamberry.rst.faces.sms.MessageService;
|
|
|
import com.iamberry.rst.faces.sms.SmsService;
|
|
|
import com.iamberry.rst.faces.sys.SysConfigService;
|
|
|
import com.iamberry.rst.faces.sys.SysService;
|
|
|
import com.iamberry.rst.util.SmsConfig;
|
|
|
import com.iamberry.rst.utils.EfastUtil;
|
|
|
-import com.iamberry.rst.core.tools.KuaiDi100;
|
|
|
import com.iamberry.wechat.tools.ResponseJson;
|
|
|
import net.sf.json.JSONArray;
|
|
|
import net.sf.json.JSONObject;
|
|
@@ -54,7 +59,6 @@ public class MQTask implements InitializingBean {
|
|
|
private SysService sysService;
|
|
|
@Autowired
|
|
|
private AddressService addressService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private CustomerService customerService;
|
|
|
@Autowired
|
|
@@ -62,6 +66,8 @@ public class MQTask implements InitializingBean {
|
|
|
@Autowired
|
|
|
private KuaiDi100 kuaidi100;
|
|
|
@Autowired
|
|
|
+ private LogisticsInfoService logisticsInfoService;
|
|
|
+ @Autowired
|
|
|
private PostageAuthorityService postageAuthorityService;
|
|
|
@Autowired
|
|
|
private PostageService postageService;
|
|
@@ -579,4 +585,34 @@ public class MQTask implements InitializingBean {
|
|
|
logger.info("---------------- 询维修超时数据并短信通知结束 ---------------");
|
|
|
}
|
|
|
|
|
|
+ //@Scheduled(cron = "*/10 * * * * ?")
|
|
|
+ //@Scheduled(cron = "0 0 9,11,14,16,18,20 * * ? ")//推送时间分别为每天早上九点、中午十一点、下午三点、下午六点、晚上八点
|
|
|
+ //@Scheduled(cron = "0 0 */1 * * ?")//每小时执行一次
|
|
|
+// @Scheduled(cron = "0 0/3 * * * ?")//每三分钟执行一次
|
|
|
+ @Scheduled(cron = "0 0/30 * * * ?")//每半个小时执行一次
|
|
|
+ public void orderCaseDate(){
|
|
|
+ logger.info("------------查询订单揽件时间 start-----------");
|
|
|
+ List<SalesOrder> salesOrderList = salesOrderService.orderAfterCaseDate();
|
|
|
+ if(salesOrderList != null && salesOrderList.size()>0){
|
|
|
+ for (SalesOrder salesOrder:salesOrderList) {
|
|
|
+ LogisticsInfo log = new LogisticsInfo();
|
|
|
+ log.setLogisticsRstCode(salesOrder.getSalesPostFirm());
|
|
|
+ List<LogisticsInfo> listlog = logisticsInfoService.getLogisticsInfoList(log);
|
|
|
+ Date date = kuaidi100.selectCourierSignCaseTime(listlog.get(0).getLogisticsOnehundredCode(),salesOrder.getSalesPostNum());
|
|
|
+ if(date != null){
|
|
|
+ SalesOrder so = new SalesOrder();
|
|
|
+ so.setSalesId(salesOrder.getSalesId());
|
|
|
+ so.setOrderCaseDate(date);
|
|
|
+ Integer flag = salesOrderService.update(so);
|
|
|
+ if(flag < 1){
|
|
|
+ logger.info("修改揽件时间异常,订单号:"+salesOrder.getSalesOrderId());
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ logger.info("查询揽件时间为空,订单号:"+salesOrder.getSalesOrderId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ logger.info("------------查询订单揽件时间 end-----------");
|
|
|
+ }
|
|
|
+
|
|
|
}
|