添加短信通知

This commit is contained in:
haozq 2025-02-14 11:08:37 +08:00
parent cec5657dec
commit 1f7624c91f
4 changed files with 108 additions and 10 deletions

View File

@ -24,4 +24,8 @@ public class ConfigurationVo {
private String version;
private String userId;
private String repeatedSubmit;
/**
* 审核状态
*/
private String type;
}

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.domain.BaseBean;
import com.bonus.common.safetycheck.NewHiddenDangerDto;
import com.bonus.common.safetycheck.SecurityCheckDto;
import com.bonus.flowable.entity.*;
import liquibase.pro.packaged.S;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -390,6 +391,7 @@ public interface BusinessMapper {
List<ConfigurationVo> approvalHistoryUser(@Param("taskId")String taskId);
String getThisCheckUser(@Param("taskId")String taskId);
List<String> getThisCheckUserStatus(@Param("taskId")String taskId);
List<String> getNickNameById(@Param("userId") List<String> userId);
/**
@ -431,4 +433,32 @@ public interface BusinessMapper {
void updateHiddenDangerStatus(@Param("checkStatus") String checkStatus, @Param("id") String id);
void updateOneConsSysUserStatus(String uuid);
/**
* 查询
* @param auditTask
* @return
*/
String getProject(AuditTask auditTask);
/**
* 查询审核发起人
* @param auditTask
* @return
*/
String getUserName(AuditTask auditTask);
/**
* 查询typeName
* @param auditTask
* @return
*/
String getTypeName(AuditTask auditTask);
/**
* 查询手机号码
* @param userList
* @return
*/
List<String> getUserPhone(@Param("list") List<String> userList);
}

View File

@ -1,5 +1,6 @@
package com.bonus.flowable.service.impl;
import cn.hutool.core.collection.ListUtil;
import com.bonus.common.core.domain.BaseBean;
import com.bonus.common.core.domain.MsgBean;
import com.bonus.common.core.utils.StaticVariableUtils;
@ -16,7 +17,9 @@ import com.bonus.flowable.service.BusinessService;
import com.bonus.system.api.RemoteUserService;
import com.bonus.system.api.domain.SysUser;
import com.bonus.system.api.model.LoginUser;
import liquibase.pro.packaged.E;
import liquibase.pro.packaged.M;
import liquibase.pro.packaged.S;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.jetbrains.annotations.Nullable;
@ -88,7 +91,7 @@ public class BusinessServiceImpl implements BusinessService {
}
}
sedPhoneMsg();
ConfigurationVo cd = null;
// if("0".equals(examineId)){
String screenExamineId = getExamineIdByProAndCheckType(auditTask.getProId(), auditTask.getTaskType());
@ -163,7 +166,6 @@ public class BusinessServiceImpl implements BusinessService {
// 将字符串按逗号拆分并转换为 List<Integer>
List<String> userList = Arrays.asList(newUser.split(","));
//newExamineType
auditTask.setTaskType(auditTask.getTaskType());
auditTask.setProId(auditTask.getProId());
auditTask.setContUuid(contUuid);
@ -259,6 +261,8 @@ public class BusinessServiceImpl implements BusinessService {
if (uuidMap.containsKey("supUuid")) {
supUserId = String.valueOf(StringUtils.isNotEmpty(uuidMap.get("supUserId") + "") ? uuidMap.get("supUserId") : null);
}
return rejectSubmit( auditTask, screenExamineId, rejectSort, rejectVersion,rejectId, userId,taskId,iaAdd,version,repeatedSubmit,supUserId,null,examineType);
}
@ -555,6 +559,8 @@ public class BusinessServiceImpl implements BusinessService {
String processType, String finalCheck, String examineId, String sort,
String processKey, boolean iaAdd, String enterStatus,String version) {
Map<String, Object> map = new HashMap<>();
//审核人员列表
map.put(ProcessConstants.USER_LIST, list);
//审核类型 人员入场机具入场等
@ -610,11 +616,11 @@ public class BusinessServiceImpl implements BusinessService {
}
//若为基础 给基础审核实例 BASE_PROCESS_KEY
String processInstanceId = service.startFlow(userId, checkUuid, map);
if (StringUtils.isNotEmpty(processInstanceId)) {
int num = addTask(auditTask.getProId(), taskId, userId, auditTask.getTaskType(),
auditTask.getParentUuid(), processInstanceId, auditTask.getUuid(), "1", sort, iaAdd,enterStatus,version,examineId);
if (num > 0) {
// sedPhoneMsg(auditTask,list);
return AjaxResult.success("审核提交成功");
} else {
return AjaxResult.error("审核提交失败");
@ -857,6 +863,10 @@ public class BusinessServiceImpl implements BusinessService {
}
}
}else{
List<String> types = mapper.getThisCheckUserStatus(taskId);
if(StringUtils.isNotEmpty(types)){
finalList.get(0).setType(types.get(0));
}
finalList.get(0).setIsActive("10");
}
return finalList;
@ -1159,22 +1169,41 @@ public class BusinessServiceImpl implements BusinessService {
}
public void sedPhoneMsg(){
public void sedPhoneMsg(AuditTask auditTask,List<String> userList){
try{
String proName=mapper.getProject(auditTask);
String userName=mapper.getUserName(auditTask);
String typeName=mapper.getTypeName(auditTask);
String msg="您有新的审核数据进行审核,工程名称为:"+proName+"发起人:"+userName+"发起了->"+typeName+"审核流程,请您及时审批";
List<String> list=mapper.getUserPhone(userList);
MsgBean bean=new MsgBean();
bean.setMsg("您有新的审核数据进行审核,");
bean.setPhone("15755022653");
bean.setMsg(msg);
for (String phone:list){
bean.setPhone("15755022653");
remoteUserService.setPhoneMsg(bean);
bean.setMsg("恭喜您已中奖,请您携带信息到宁夏办理处领取奖品,谢谢配合!");
bean.setPhone("18855456507");
remoteUserService.setPhoneMsg(bean);
bean.setPhone(phone);
// sedPhoneMsg(bean);
}
}catch (Exception e){
log.error(e.toString(),e);
}
}
public void sedPhoneMsg(MsgBean bean){
try {
remoteUserService.setPhoneMsg(bean);
}catch (Exception e){
log.error(e.toString(),e);
}
}
}

View File

@ -726,6 +726,12 @@
select proc_ins_id from nxdt_ii.pt_check_task where task_id = #{taskId}
) LIMIT 1
</select>
<select id="getThisCheckUserStatus" resultType="string">
select task_type
from nxdt_ii.pt_check_task where task_id = #{taskId}
</select>
<select id="getHiddenDangerRectificationForm" resultType="com.bonus.common.safetycheck.NewHiddenDangerDto">
SELECT ypi.pitfall_id AS id,
ypi.pitfall_code AS pitfallCode,
@ -781,5 +787,34 @@
WHERE ypi.is_active = 1
AND ypi.pitfall_id = #{id}
</select>
<select id="getProject" resultType="java.lang.String">
select pro_name
from nxdt_ii.pt_project_info
where pro_id=#{proId}
limit 1
</select>
<select id="getUserName" resultType="java.lang.String">
select su.nick_name
from nxdt_ii.pt_check_task pct
left join nxdt_ii.sys_user su on pct.create_id=su.user_id
where pct.task_id=#{taskId}
limit 1
</select>
<select id="getTypeName" resultType="java.lang.String">
select dict_label
from nxdt_ii.sys_dict_data
where dict_type='sys_approval_type'
and dict_value=#{taskType}
limit 1
</select>
<select id="getUserPhone" resultType="java.lang.String">
select user_name
from nxdt_ii.sys_user
where user_id in
<foreach item="userId" collection="list" open="(" separator="," close=")">
#{userId}
</foreach>
</select>
</mapper>