Commit c3dba3ac authored by zhangyingbin's avatar zhangyingbin

修改存短信接口

parent 8f9a08d4
...@@ -57,4 +57,8 @@ public class InstallNoticeDto extends BaseDto { ...@@ -57,4 +57,8 @@ public class InstallNoticeDto extends BaseDto {
@ApiModelProperty(value = "安装负责人") @ApiModelProperty(value = "安装负责人")
private String installPri; private String installPri;
private String projectName;
private String companyName;
} }
...@@ -104,6 +104,8 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -104,6 +104,8 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
InstallNoticeDto installNoticeDto = new InstallNoticeDto(); InstallNoticeDto installNoticeDto = new InstallNoticeDto();
final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name")); final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name"));
installNoticeDto.setProjectId(object.getLong("name")); installNoticeDto.setProjectId(object.getLong("name"));
installNoticeDto.setProjectName(projectDto.getName());
installNoticeDto.setCompanyName(projectDto.getInstallationUnit());
installNoticeDto.setNoticeStatus(noticeStatus); installNoticeDto.setNoticeStatus(noticeStatus);
installNoticeDto.setNoticeDate(new Date()); installNoticeDto.setNoticeDate(new Date());
installNoticeDto.setApproved(false); installNoticeDto.setApproved(false);
......
...@@ -156,7 +156,7 @@ public class ProblemInitiationServiceImpl { ...@@ -156,7 +156,7 @@ public class ProblemInitiationServiceImpl {
HashMap<String, String> smsParams = new HashMap(); HashMap<String, String> smsParams = new HashMap();
smsParams.put("smsCode", smsCode); smsParams.put("smsCode", smsCode);
smsParams.put("projectName", object.getString("projectName")); smsParams.put("projectName", object.getString("projectName"));
smsParams.put("problemDesc", object.getString("problemDesc")); smsParams.put("CompanyName", object.getString("CompanyName"));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id拿到平台的监察部门id //条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id拿到平台的监察部门id
LambdaQueryWrapper<SuperviseRule> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SuperviseRule> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SuperviseRule::getAdminRegionCode, projectServiceImpl.getById(object.getLong("projectId")).getInstallRegionCode()); wrapper.eq(SuperviseRule::getAdminRegionCode, projectServiceImpl.getById(object.getLong("projectId")).getInstallRegionCode());
...@@ -211,7 +211,7 @@ public class ProblemInitiationServiceImpl { ...@@ -211,7 +211,7 @@ 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); saveProjectSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel,object,smsCode);
}else { }else {
saveProblemSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel); saveProblemSmsLog(smsRecordModel,sequenceNbr,noticeUnitId,agencyUserModel);
} }
...@@ -220,11 +220,32 @@ public class ProblemInitiationServiceImpl { ...@@ -220,11 +220,32 @@ public class ProblemInitiationServiceImpl {
} }
} }
public void saveProjectSmsLog(SmsRecordModel smsRecordModel,Long sequenceNbr,String noticeUnitId,AgencyUserModel agencyUserModel,JSONObject object){ 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<>(); LambdaQueryWrapper<OrgUsr> wrapperQueryWrapper = new LambdaQueryWrapper<>();
wrapperQueryWrapper.eq(OrgUsr::getAmosOrgId,agencyUserModel.getSequenceNbr()); wrapperQueryWrapper.eq(OrgUsr::getAmosOrgId,agencyUserModel.getSequenceNbr());
InstallNoticeMsg installNoticeMsg = new InstallNoticeMsg(); InstallNoticeMsg installNoticeMsg = new InstallNoticeMsg();
installNoticeMsg.setContent(smsRecordModel.getSmsContent()); installNoticeMsg.setContent(content);
installNoticeMsg.setInstallNoticeId(object.getLong("sequenceNbr")); installNoticeMsg.setInstallNoticeId(object.getLong("sequenceNbr"));
installNoticeMsg.setTargetUnitId(Long.valueOf(noticeUnitId)); installNoticeMsg.setTargetUnitId(Long.valueOf(noticeUnitId));
installNoticeMsg.setTargetPersonId(orgUsrServiceImpl.getOne(wrapperQueryWrapper).getSequenceNbr()); installNoticeMsg.setTargetPersonId(orgUsrServiceImpl.getOne(wrapperQueryWrapper).getSequenceNbr());
......
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