|
@@ -6,6 +6,8 @@ package com.zfire.jiasm.syncdata.sendmessage;
|
|
*/
|
|
*/
|
|
|
|
|
|
import com.zfire.jiasm.syncdata.constant.TaskConfigEnum;
|
|
import com.zfire.jiasm.syncdata.constant.TaskConfigEnum;
|
|
|
|
+import com.zfire.jiasm.syncdata.plus.entity.ItfMessagehuifangentity;
|
|
|
|
+import com.zfire.jiasm.syncdata.plus.service.ItfMessagehuifangentityService;
|
|
import com.zfire.jiasm.syncdata.service.PublicService;
|
|
import com.zfire.jiasm.syncdata.service.PublicService;
|
|
import com.zfire.jiasm.syncdata.service.SMSRepairFinishService;
|
|
import com.zfire.jiasm.syncdata.service.SMSRepairFinishService;
|
|
import com.zfire.jiasm.syncdata.utils.SMSSelfManager;
|
|
import com.zfire.jiasm.syncdata.utils.SMSSelfManager;
|
|
@@ -28,12 +30,16 @@ public class SMSMessageFinish {
|
|
private String templateId;
|
|
private String templateId;
|
|
@Value("${zwgmsgsendc}")
|
|
@Value("${zwgmsgsendc}")
|
|
private String zwgmsgsendc = "";
|
|
private String zwgmsgsendc = "";
|
|
|
|
+ @Value("${FAILURE_EXE_COUNT}")
|
|
|
|
+ private String exeCount;
|
|
@Autowired
|
|
@Autowired
|
|
private SMSRepairFinishService smsRepairFinishService;
|
|
private SMSRepairFinishService smsRepairFinishService;
|
|
@Autowired
|
|
@Autowired
|
|
private SMSSelfManager smsSelfManager;
|
|
private SMSSelfManager smsSelfManager;
|
|
@Resource
|
|
@Resource
|
|
PublicService publicService;
|
|
PublicService publicService;
|
|
|
|
+ @Resource
|
|
|
|
+ ItfMessagehuifangentityService itfMessagehuifangentityService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -53,6 +59,35 @@ public class SMSMessageFinish {
|
|
try {
|
|
try {
|
|
log.info("开始自建工单评价短信发送: \uF0B7{}", sdf.format(new Date()));
|
|
log.info("开始自建工单评价短信发送: \uF0B7{}", sdf.format(new Date()));
|
|
// 从完工短信发送记录表中提取数据
|
|
// 从完工短信发送记录表中提取数据
|
|
|
|
+ List<ItfMessagehuifangentity> huifs = itfMessagehuifangentityService.lambdaQuery()
|
|
|
|
+ .eq(ItfMessagehuifangentity::getFsStatus,0)
|
|
|
|
+ // .eq(ItfMessagehuifangentity::getOrderBaseId,"B473682316009797") // 测试用
|
|
|
|
+ .eq(ItfMessagehuifangentity::getSendtype,2)
|
|
|
|
+ .lt(ItfMessagehuifangentity::getExeCount,Integer.valueOf(exeCount))
|
|
|
|
+ .orderByAsc(ItfMessagehuifangentity::getSynTaskNo)
|
|
|
|
+ .list();
|
|
|
|
+
|
|
|
|
+ //SELECT * FROM itf_messagehuifangentity where fs_status=0 and sendtype = 2 "
|
|
|
|
+ //+ " and exe_count<"+ exeCount +" and now()>plansendtime " + " order by syn_task_no");
|
|
|
|
+ for (ItfMessagehuifangentity item :huifs){
|
|
|
|
+ Date cur = new Date();
|
|
|
|
+ if (cur.compareTo(item.getPlansendtime())<=0){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ String synTaskNo = item.getSynTaskNo();
|
|
|
|
+ String[] datas = new String[1];
|
|
|
|
+ datas[0] = item.getFsnr();
|
|
|
|
+ String resultData = smsSelfManager.templateSMS(item.getSjid(), templateId,
|
|
|
|
+ item.getSynTaskNo(),item.getFsma(), datas);
|
|
|
|
+
|
|
|
|
+ if (resultData.length()>0){
|
|
|
|
+ smsRepairFinishService.failureUpdate(synTaskNo,resultData);
|
|
|
|
+ } else {
|
|
|
|
+ smsRepairFinishService.successUpdate(synTaskNo);
|
|
|
|
+ publicService.upSmsRecordSendTime(synTaskNo,item.getSjid(),new Date());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+/*
|
|
List<Map<String, Object>> result = smsRepairFinishService.getTaskData4Self();
|
|
List<Map<String, Object>> result = smsRepairFinishService.getTaskData4Self();
|
|
for (Map<String, Object> row : result) {
|
|
for (Map<String, Object> row : result) {
|
|
String synTaskNo = (String) row.get("syn_task_no");
|
|
String synTaskNo = (String) row.get("syn_task_no");
|
|
@@ -67,7 +102,7 @@ public class SMSMessageFinish {
|
|
smsRepairFinishService.successUpdate(synTaskNo);
|
|
smsRepairFinishService.successUpdate(synTaskNo);
|
|
publicService.upSmsRecordSendTime(synTaskNo,(String)row.get("sjid"),new Date());
|
|
publicService.upSmsRecordSendTime(synTaskNo,(String)row.get("sjid"),new Date());
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
log.info("开始评价短信发送结束: \uF0B7{}", sdf.format(new Date()));
|
|
log.info("开始评价短信发送结束: \uF0B7{}", sdf.format(new Date()));
|
|
|
|
|