|
@@ -5,6 +5,7 @@ import com.iamberry.rst.core.address.City;
|
|
|
import com.iamberry.rst.core.address.District;
|
|
|
import com.iamberry.rst.core.address.Province;
|
|
|
import com.iamberry.rst.core.cm.*;
|
|
|
+import com.iamberry.rst.core.fm.ComplaintDetectInfo;
|
|
|
import com.iamberry.rst.core.order.EfastOrder;
|
|
|
import com.iamberry.rst.core.order.ProductColor;
|
|
|
import com.iamberry.rst.core.order.ProductType;
|
|
@@ -15,6 +16,7 @@ import com.iamberry.rst.core.sys.Relu;
|
|
|
import com.iamberry.rst.core.sys.SysConfig;
|
|
|
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.product.ProductService;
|
|
|
import com.iamberry.rst.faces.sms.MessageService;
|
|
@@ -23,6 +25,7 @@ import com.iamberry.rst.faces.sys.SysConfigService;
|
|
|
import com.iamberry.rst.faces.sys.SysService;
|
|
|
import com.iamberry.rst.service.cm.mapper.CustomerInfoMapper;
|
|
|
import com.iamberry.rst.service.sms.mapper.MessageMapper;
|
|
|
+import com.iamberry.rst.util.SmsConfig;
|
|
|
import com.iamberry.rst.utils.EfastUtil;
|
|
|
import com.iamberry.rst.utils.KuaiDi100;
|
|
|
import com.iamberry.wechat.tools.DateTimeUtil;
|
|
@@ -82,6 +85,8 @@ public class MQTask implements InitializingBean {
|
|
|
@Autowired
|
|
|
private CmRelationService cmRelationService;
|
|
|
@Autowired
|
|
|
+ private ComplaintDetectInfoService complaintDetectInfoService;
|
|
|
+ @Autowired
|
|
|
private EfastUtil efastUtil;
|
|
|
|
|
|
private Object lock = new Object();
|
|
@@ -554,4 +559,41 @@ public class MQTask implements InitializingBean {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询维修超时数据并短信通知
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 0 9 * * ?")//每天上午午9点触发
|
|
|
+/* @Scheduled(cron = "0 0/1 * * * ?")//每2分钟执行一次*/
|
|
|
+ public void detectTimeoutNotice() throws Exception {
|
|
|
+ logger.info("---------------- 询维修超时数据并短信通知开始 ---------------");
|
|
|
+ //待检测即将超时数据
|
|
|
+ List<ComplaintDetectInfo> listMaintenanceCut = complaintDetectInfoService.listMaintenanceCutNotice();
|
|
|
+ //待维修即将超时数据
|
|
|
+ List<ComplaintDetectInfo> listCompleteCut = complaintDetectInfoService.listCompleteCutNotice();
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ if(listMaintenanceCut != null && listMaintenanceCut.size() > 0){
|
|
|
+ for(ComplaintDetectInfo info : listMaintenanceCut){
|
|
|
+ if(info.getDetectNumber() != null && info.getMaintenanceCutTime() != null){
|
|
|
+ //发送短信通知维修检测人员
|
|
|
+ String text = MessageFormat.format(SmsConfig.DETECTION_TIMEOUT_NOTIFICATION, info.getDetectNumber(),"检测超时",format.format(info.getMaintenanceCutTime()));
|
|
|
+ String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
|
|
|
+ logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送检测即将超时数据维修人员:"+result);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(listCompleteCut != null && listCompleteCut.size() > 0){
|
|
|
+ for(ComplaintDetectInfo info : listCompleteCut){
|
|
|
+ //发送短信通知维修检测人员
|
|
|
+ if(info.getDetectNumber() != null && info.getCompleteCutTime() != null){
|
|
|
+ String text = MessageFormat.format(SmsConfig.DETECTION_TIMEOUT_NOTIFICATION, info.getDetectNumber(),"维修超时",format.format(info.getCompleteCutTime()));
|
|
|
+ String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
|
|
|
+ logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送维修即将超时数据维修人员:"+result);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ logger.info("---------------- 询维修超时数据并短信通知结束 ---------------");
|
|
|
+ }
|
|
|
+
|
|
|
}
|