Commit 2a2ddf90 authored by DESKTOP-BQLVS7A\admin's avatar DESKTOP-BQLVS7A\admin

修改短信通知接口,将两个通知表数据合为一个,更改表中存入content字段信息未替换的问题

parent 57b497a1
...@@ -304,8 +304,8 @@ public class ProblemInitiationServiceImpl { ...@@ -304,8 +304,8 @@ public class ProblemInitiationServiceImpl {
continue; continue;
} }
if(SMSEnum.项目安装告知申请.getCode().equals(smsCode) || SMSEnum.项目立项驳回短信.getCode().equals(smsCode)){ if(SMSEnum.项目安装告知申请.getCode().equals(smsCode) || SMSEnum.项目立项驳回短信.getCode().equals(smsCode)){
saveProjectSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel,object,smsCode); // saveProjectSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel,object,smsCode);
}else { // }else {
saveProblemSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel,object,smsCode); saveProblemSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel,object,smsCode);
} }
...@@ -313,8 +313,50 @@ public class ProblemInitiationServiceImpl { ...@@ -313,8 +313,50 @@ public class ProblemInitiationServiceImpl {
} }
} }
// /**
// * 存 项目立项流程中 发送的短信信息
// * @param smsRecordModel
// * @param sequenceNbr
// * @param noticeUnitId
// * @param agencyUserModel
// * @param object
// * @param smsCode
// */
// public void saveProjectSmsLog(SmsRecordModel smsRecordModel,Long sequenceNbr,String noticeUnitId,AgencyUserModel agencyUserModel,JSONObject object,String smsCode){
// String content = Systemctl.smsTemplateClient.seleteOne(smsCode).getResult().getSmsContent();
// String projectName = object.getString("projectName");
// String companyName = object.getString("companyName");
// String reviewInfo = object.getString("reviewInfo");
//
// if(!ValidationUtil.isEmpty(projectName)){
// if(content.contains("${projectName}")) {
// content = content.replace("${projectName}", projectName);
// }
// }
// if(!ValidationUtil.isEmpty(companyName)){
// if(content.contains("${companyName}")){
// content = content.replace("${companyName}",companyName);
// }
// }
// if(!ValidationUtil.isEmpty(reviewInfo)){
// if(content.contains("${reviewInfo}")) {
// content = content.replace("${reviewInfo}", reviewInfo);
// }
// }
//
// LambdaQueryWrapper<OrgUsr> wrapperQueryWrapper = new LambdaQueryWrapper<>();
// wrapperQueryWrapper.eq(OrgUsr::getAmosOrgId,agencyUserModel.getSequenceNbr());
// InstallNoticeMsg installNoticeMsg = new InstallNoticeMsg();
// installNoticeMsg.setContent(content);
// installNoticeMsg.setInstallNoticeId(object.getLong("sequenceNbr"));
// installNoticeMsg.setTargetUnitId(Long.valueOf(noticeUnitId));
// installNoticeMsg.setTargetPersonId(orgUsrServiceImpl.getOne(wrapperQueryWrapper).getSequenceNbr());
// installNoticeMsg.setSendTime(smsRecordModel.getSendTime());
// installNoticeMsgService.save(installNoticeMsg);
// }
/** /**
* 存 项目立项流程中 发送的短信信息 * 存 质量问题以及告知申请通知短信
* @param smsRecordModel * @param smsRecordModel
* @param sequenceNbr * @param sequenceNbr
* @param noticeUnitId * @param noticeUnitId
...@@ -322,21 +364,35 @@ public class ProblemInitiationServiceImpl { ...@@ -322,21 +364,35 @@ public class ProblemInitiationServiceImpl {
* @param object * @param object
* @param smsCode * @param smsCode
*/ */
public void saveProjectSmsLog(SmsRecordModel smsRecordModel,Long sequenceNbr,String noticeUnitId,AgencyUserModel agencyUserModel,JSONObject object,String smsCode){ public void saveProblemSmsLog(SmsRecordModel smsRecordModel,Long sequenceNbr,String noticeUnitId,AgencyUserModel agencyUserModel,JSONObject object,String smsCode){
String content = Systemctl.smsTemplateClient.seleteOne(smsCode).getResult().getSmsContent(); String content = Systemctl.smsTemplateClient.seleteOne(smsCode).getResult().getSmsContent();
String projectName = object.getString("projectName"); String projectName = object.getString("projectName");
String problemDescribe = object.getString("problemDescribe");
String companyName = object.getString("companyName"); String companyName = object.getString("companyName");
String reviewInfo = object.getString("reviewInfo"); String reviewInfo = object.getString("reviewInfo");
String licenseCompany = object.getString("licenseCompany");
RectifyMsg rectifyMsg = new RectifyMsg();
if(!ValidationUtil.isEmpty(projectName)){ if(!ValidationUtil.isEmpty(projectName)){
if(content.contains("${projectName}")) { if(content.contains("${projectName}")) {
content = content.replace("${projectName}", projectName); content = content.replace("${projectName}", projectName);
} }
} }
if(!ValidationUtil.isEmpty(companyName)){ if(!ValidationUtil.isEmpty(problemDescribe)){
if(content.contains("${problemDescribe}")){
content = content.replace("${problemDescribe}",problemDescribe);
}
if(content.contains("${problemDesc}")){
content = content.replace("${problemDesc}",problemDescribe);
}
rectifyMsg.setProblemId(sequenceNbr);
rectifyMsg.setIsProblem(true);
}
if(!ValidationUtil.isEmpty(companyName) || !ValidationUtil.isEmpty(licenseCompany)){
if(content.contains("${companyName}")){ if(content.contains("${companyName}")){
content = content.replace("${companyName}",companyName); content = content.replace("${companyName}",companyName);
} }
rectifyMsg.setInstallNoticeId(object.getLong("sequenceNbr"));
rectifyMsg.setIsProblem(false);
} }
if(!ValidationUtil.isEmpty(reviewInfo)){ if(!ValidationUtil.isEmpty(reviewInfo)){
if(content.contains("${reviewInfo}")) { if(content.contains("${reviewInfo}")) {
...@@ -346,45 +402,8 @@ public class ProblemInitiationServiceImpl { ...@@ -346,45 +402,8 @@ public class ProblemInitiationServiceImpl {
LambdaQueryWrapper<OrgUsr> wrapperQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgUsr> wrapperQueryWrapper = new LambdaQueryWrapper<>();
wrapperQueryWrapper.eq(OrgUsr::getAmosOrgId,agencyUserModel.getSequenceNbr()); wrapperQueryWrapper.eq(OrgUsr::getAmosOrgId,agencyUserModel.getSequenceNbr());
InstallNoticeMsg installNoticeMsg = new InstallNoticeMsg();
installNoticeMsg.setContent(content);
installNoticeMsg.setInstallNoticeId(object.getLong("sequenceNbr"));
installNoticeMsg.setTargetUnitId(Long.valueOf(noticeUnitId));
installNoticeMsg.setTargetPersonId(orgUsrServiceImpl.getOne(wrapperQueryWrapper).getSequenceNbr());
installNoticeMsg.setSendTime(smsRecordModel.getSendTime());
installNoticeMsgService.save(installNoticeMsg);
}
/**
* 存 质量问题闭环处理流程中 发送的短信信息
* @param smsRecordModel
* @param sequenceNbr
* @param noticeUnitId
* @param agencyUserModel
* @param object
* @param smsCode
*/
public void saveProblemSmsLog(SmsRecordModel smsRecordModel,Long sequenceNbr,String noticeUnitId,AgencyUserModel agencyUserModel,JSONObject object,String smsCode){
String content = Systemctl.smsTemplateClient.seleteOne(smsCode).getResult().getSmsContent();
String projectName = object.getString("projectName");
String problemDescribe = object.getString("problemDescribe");
if(!ValidationUtil.isEmpty(projectName)){
if(content.contains("${projectName}")) {
content = content.replace("${projectName}", projectName);
}
}
if(!ValidationUtil.isEmpty(problemDescribe)){
if(content.contains("${problemDescribe}")){
content = content.replace("${problemDescribe}",problemDescribe);
}
}
LambdaQueryWrapper<OrgUsr> wrapperQueryWrapper = new LambdaQueryWrapper<>();
wrapperQueryWrapper.eq(OrgUsr::getAmosOrgId,agencyUserModel.getSequenceNbr());
RectifyMsg rectifyMsg = new RectifyMsg();
rectifyMsg.setContent(content); rectifyMsg.setContent(content);
rectifyMsg.setProblemId(sequenceNbr);
rectifyMsg.setNoticeUnitId(Long.valueOf(noticeUnitId)); rectifyMsg.setNoticeUnitId(Long.valueOf(noticeUnitId));
rectifyMsg.setMsgReceiver(orgUsrServiceImpl.getOne(wrapperQueryWrapper).getSequenceNbr()); rectifyMsg.setMsgReceiver(orgUsrServiceImpl.getOne(wrapperQueryWrapper).getSequenceNbr());
rectifyMsg.setSendTime(smsRecordModel.getSendTime()); rectifyMsg.setSendTime(smsRecordModel.getSendTime());
......
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