Commit f024fa87 by jianan

电子报聘回退优化4

parent cd1b0e66
package com.yd.api.agms.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.yd.api.agms.service.AgmsHiringService;
import com.yd.api.agms.vo.hiring.*;
......@@ -567,25 +568,32 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
}
private void setRecordsRollBack(String stepsSeqBackTo, Integer stepSeq, String rejectNote, Long basicInfoId) {
String approveName;
int stepSeqStart;
switch (stepsSeqBackTo) {
case "-2":
stepSeqStart = 1;
approveName = "辅导人";
break;
case "1":
stepSeqStart = 2;
approveName = "体系负责人";
break;
case "2":
stepSeqStart = 3;
approveName = "公司运营主管";
break;
case "3":
stepSeqStart = 4;
approveName = "寿险总经理";
break;
case "4":
stepSeqStart = 5;
approveName = "公司总经理";
break;
default:
stepSeqStart = 1;
approveName = "辅导人";
break;
}
// 查询审批记录
......@@ -599,16 +607,18 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
List<PractitionerInfo> practitionerList = aclPractitionerDalService.findPractitionerInfoByIdList(practitionerIds);
// 回退提醒发消息(短信和微信推送)
this.approveRollBackNoticeSendMsg(rejectNote, practitionerList, basicInfoId);
this.approveRollBackNoticeSendMsg(approveName, rejectNote, practitionerList, basicInfoId);
}
private void approveRollBackNoticeSendMsg(String rejectNote, List<PractitionerInfo> practitionerList, Long basicInfoId) {
private void approveRollBackNoticeSendMsg(String approveName, String rejectNote, List<PractitionerInfo> practitionerList, Long basicInfoId) {
AclPractitionerHiringBasicInfo basicInfo = aclPractitionerHiringBasicInfoDalService.findById(basicInfoId);
// 查询辅导人所在S1,S2,S3
AclPractitionerHiringMembership hiringMemberShip = practitionerHiringDalService.queryHiringMemberShip(basicInfoId);
// 报聘人组织关系
String orgInfo = practitionerHiringDalService.getHiringOrganizationInfo(basicInfo, hiringMemberShip);
// 短信模板
String templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_HiringApproveNotice");
String templateCode = systemConfigService.getSingleConfigValue("ALI_SMS_HiringApproveRollBackNotice");
// 被提醒人的姓名手机号
String mobileNo;
......@@ -620,9 +630,21 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
if (StringUtils.isNotBlank(mobileNo)) {
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》电子报聘回退发送短信");
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》" + name + ": " + mobileNo);
// 发短信
String content = "{\"name\":\"" + name + "\",\"hiringName\":\"" + "已回退: " + "\"}";
sendService.sendEmailOrSMS("sms", mobileNo, "0", content, templateCode, null, null, "电子报聘审批回退", 99, basicInfoId);
// 短信内容
// String content = "{\"name\":\"" + name + "\",\"hiringName\":\"" + "已回退: " + "\"}";
JSONObject content = new JSONObject();
content.put("name", name);
content.put("hiringName", orgInfo);
if (mobileNo.equals(basicInfo.getMobileNo())) {
content.put("approveName", "公众号,退回原因<" + rejectNote + ">");
} else {
if (name.equals(approveName)) {
content.put("approveName", "您,退回原因<" + rejectNote + ">");
} else {
content.put("approveName", approveName + ",退回原因<" + rejectNote + ">");
}
}
sendService.sendEmailOrSMS("sms", mobileNo, "0", content.toJSONString(), templateCode, null, null, "电子报聘审批回退", 99, basicInfoId);
} else {
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》电子报聘审批人电话号码不存在");
logger.error("【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》" + name + ": " + mobileNo);
......@@ -632,7 +654,7 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
}
// 微信模板
String firstValue = systemConfigService.getSingleConfigValue("TENCENT_WECHAT_TEMPLATE_FIRST_HIRING");
String orgInfo = practitionerHiringDalService.getHiringOrganizationInfo(basicInfo, hiringMemberShip);
firstValue.replace("hiringName", orgInfo);
StringBuffer stringBuffer = new StringBuffer(firstValue);
stringBuffer.append(";审批回退,回退原因<").append(rejectNote).append(">");
......
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