亨通,无账号人员工资单

This commit is contained in:
钱涛 2025-12-08 15:43:14 +08:00
parent 3aa8571ec7
commit 4f29b7f753
3 changed files with 19 additions and 4 deletions

View File

@ -0,0 +1 @@
smsCode=SMS_498690413

View File

@ -1,6 +1,7 @@
package com.engine.salary.entity.salaryBill.bo;
import cn.hutool.core.io.FileUtil;
import cn.hutool.json.JSONUtil;
import com.cloudstore.dev.api.bean.MessageBean;
import com.cloudstore.dev.api.bean.MessageType;
import com.cloudstore.dev.api.util.Util_Message;
@ -348,7 +349,8 @@ public class SalaryBillBO {
return data;
}
public static void sendSMS(Map<String, Object> e, SalaryBillSendDTO salaryBillSendParam) {
public static void sendSMS(Map<String, Object> e, SalaryBillSendDTO salaryBillSendParam,boolean isLog,String smsCode) {
SalaryTemplateSMSSetDTO smsSetting = salaryBillSendParam.getSmsSetting();
@ -372,11 +374,19 @@ public class SalaryBillBO {
}
}
String salaryInfoCode = AESEncryptUtil.encrypt4SalaryBill(Util.null2String(e.get("id")));
content = content.replace("%salaryInfoCode%", salaryInfoCode);
String link_param = content.replace("%salaryInfoCode%", salaryInfoCode);
Map<String,Object> map = new HashMap<>();
map.put("name",e.getOrDefault("username", ""));
map.put("link_param",link_param);
String jsonStr = JSONUtil.toJsonStr(map);
try {
if (e.get("mobile") != null) {
MessageUtil.sendSMS(e.get("mobile").toString(), content);
if(isLog){
log.info("发送短信,{} {}",e.get("mobile").toString(), smsCode+"@"+jsonStr);
}
MessageUtil.sendSMS(e.get("mobile").toString(), smsCode+"@"+jsonStr);
} else {
log.error("发送短信失败,{}手机号为空", e.getOrDefault("username", ""));
}

View File

@ -46,6 +46,7 @@ import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.general.BaseBean;
import weaver.hrm.User;
import java.io.File;
@ -637,6 +638,7 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
.buildDetailList(list, salaryAcctEmployees, salaryAcctResultValues);
}
/**
* 发送消息
*
@ -644,6 +646,8 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
* @param salaryBillSendParam
*/
private List<Long> sendMessage(List<Map<String, Object>> enableSendList, SalaryBillSendDTO salaryBillSendParam) {
Boolean isLog = "true".equals(new BaseBean().getPropValue("hrmSalary", "log"));
String smsCode = new BaseBean().getPropValue("hrmSalaryHenTong", "smsCode");
if (CollectionUtils.isEmpty(enableSendList)) {
return Collections.emptyList();
@ -675,7 +679,7 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
//发送短信
if (sendChannels.contains(MessageChannelEnum.SMS)) {
SalaryBillBO.sendSMS(e, salaryBillSendParam);
SalaryBillBO.sendSMS(e, salaryBillSendParam,isLog,smsCode);
}
}