Commit f3aaa468 authored by 李腾威's avatar 李腾威

警情结案短信模板修改

parent 8aba8b52
......@@ -51,6 +51,7 @@ import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -270,7 +271,7 @@ public class AlertSubmittedController extends BaseController {
definitions.put("$callTime", DateUtils.convertDateToString(alertCalled.getCallTime(),DateUtils.DATE_TIME_PATTERN));
definitions.put("$replaceContent",replaceContent);
definitions.put("$address",ValidationUtil.isEmpty(alertCalled.getAddress()) ? "" : alertCalled.getAddress());
definitions.put("$recDate",DateUtils.convertDateToString(alertCalled.getRecDate(),DateUtils.DATE_TIME_PATTERN));
// definitions.put("$recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN));
definitions.put("$contactUser",ValidationUtil.isEmpty(alertCalled.getContactUser()) ? "" : alertCalled.getContactUser());
definitions.put("$trappedNum",ValidationUtil.isEmpty(alertCalledRo.getTrappedNum()) ? "" : String.valueOf(alertCalled.getTrappedNum()));
......@@ -279,6 +280,12 @@ public class AlertSubmittedController extends BaseController {
String companyName = JSONObject.parseObject(schedulingContent.getSubmissionContent()).getString("companyName") ;
JSONObject jsonObject = null;
if(!ValidationUtil.isEmpty(alertCalled.getUpdateTime())) {
jsonObject = JSONObject.parseObject(schedulingContent.getSubmissionContent());
jsonObject.put("recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN));
}
definitions.put("$companyName", null == companyName ? "" : companyName);
String content ="";
......@@ -289,6 +296,10 @@ public class AlertSubmittedController extends BaseController {
content = getTaskInformation( schedulingContent.getSubmissionTemplate(),definitions);
}
if(jsonObject != null) {
schedulingContent.setSubmissionContent(jsonObject.toJSONString());
}
schedulingContent.setSubmissionTemplate(content);
if(!ValidationUtil.isEmpty(schedulingContent.getSubmissionContent())) {
try {
......
......@@ -271,7 +271,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
definitions.put("$callTime", DateUtils.convertDateToString(alertCalled.getCallTime(),DateUtils.DATE_TIME_PATTERN));
definitions.put("$replaceContent",replaceContent);
definitions.put("$address",ValidationUtil.isEmpty(alertCalled.getAddress()) ? "" : alertCalled.getAddress());
definitions.put("$recDate",DateUtils.dateTimeToDateString(alertCalled.getRecDate()));
// definitions.put("$recDate",DateUtils.dateTimeToDateString(alertCalled.getUpdateTime()));
definitions.put("$contactUser",ValidationUtil.isEmpty(alertCalled.getContactUser()) ? "" : alertCalled.getContactUser());
definitions.put("$trappedNum",ValidationUtil.isEmpty(alertCalledRo.getTrappedNum()) ? "" : String.valueOf(alertCalled.getTrappedNum()));
......@@ -280,6 +280,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String companyName = JSONObject.parseObject(alertSubmittedExtDto.getSubmissionContent()).getString("$companyName") ;
JSONObject jsonObject = null;
if(!ValidationUtil.isEmpty(alertCalled.getUpdateTime())) {
jsonObject = JSONObject.parseObject(alertSubmittedExtDto.getSubmissionContent());
jsonObject.put("recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN));
}
if(jsonObject != null) {
alertSubmittedExtDto.setSubmissionContent(jsonObject.toJSONString());
}
definitions.put("$companyName", null == companyName ? "" : companyName);
String content = getTaskInformation( template.getRichContent(),definitions);
......@@ -289,8 +300,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} catch (JSONException e) {
alertSubmittedExtDto.setSubmissionContentValue(alertSubmittedExtDto.getSubmitContent());
} catch (ParseException e) {
e.printStackTrace();
}
});
schedulingReportingDto.setSchedulingReportingList(alertSubmittedExtDtoList);
......@@ -529,7 +538,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams.put("callTimeStr", calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress());
smsParams.put("fireLocation", calledRo.getFireLocation());
smsParams.put("endTimeStr", DateUtils.convertDateToString(alertCalled.getRecDate(),DateUtils.DATE_TIME_PATTERN));
smsParams.put("endTimeStr", DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN));
smsParams.put("burningMaterial", calledRo.getBurningMaterial());
smsParams.put("fireSituation", calledRo.getFireSituation());
smsParams.put("trappedNum", calledRo.getTrappedNum());
......@@ -591,6 +600,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
public Map<String,String> saveAlertSubmitted(AlertSubmittedDto alertSubmittedDto, String userName) {
try { Long alertSubmittedId = alertSubmittedDto.getSequenceNbr();
String alertWay = "";
Date endDate = null;
Map<String,String> map = new HashMap<>();
Set<String> mobiles = new HashSet<>();
List<Long> userIds = new ArrayList<>();
......@@ -620,6 +630,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
alertSubmitted.setBusinessTypeCode(alertSubmittedDto.getBusinessTypeCode());
alertSubmittedDto.getSubmitContent().get("recDate").toString();
endDate = DateUtils.dateParse(alertSubmittedDto.getSubmitContent().get("recDate").toString(),DateUtils.HOUR_PATTERN);
alertSubmitted.setSubmissionContent(alertSubmittedDto.getSubmitContent().toJSONString());
alertSubmitted.setSender(userName);
......@@ -1189,7 +1202,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
definitions.put("$contactPhone",ValidationUtil.isEmpty(alertCalled.getContactPhone()) ? "" : alertCalled.getContactPhone() );
// definitions.put("$recDate", DateUtils.convertDateToString(new Date(), DateUtils.DATE_TIME_PATTERN));
if(alertCalled.getAlertStatus()) {
map.put("recDate",DateUtils.convertDateToString(alertCalled.getRecDate(), DateUtils.DATE_TIME_PATTERN));
map.put("recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN));
} else {
map.put("recDate",DateUtils.convertDateToString(new Date(), DateUtils.DATE_TIME_PATTERN));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment