内部审批以后短信通知管理人员进行出库
This commit is contained in:
parent
4a8042b267
commit
357f0350c6
|
|
@ -1,20 +1,12 @@
|
||||||
package com.bonus.sgzb.app.mapper;
|
package com.bonus.sgzb.app.mapper;
|
||||||
|
|
||||||
import com.bonus.sgzb.app.domain.*;
|
import com.bonus.sgzb.app.domain.*;
|
||||||
import com.bonus.sgzb.base.domain.MaintenanceGang;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* Description:
|
|
||||||
* @Author 阮世耀
|
|
||||||
* @Create 2023/12/13 15:14
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TmTaskMapper {
|
public interface TmTaskMapper {
|
||||||
|
|
||||||
|
|
@ -151,4 +143,6 @@ public interface TmTaskMapper {
|
||||||
|
|
||||||
|
|
||||||
List<LeaseApplyDetails> getleaseDetailsStatus(TmTask task);
|
List<LeaseApplyDetails> getleaseDetailsStatus(TmTask task);
|
||||||
|
|
||||||
|
List<TmTask> getUserByParenntId(TmTask tmTask);
|
||||||
}
|
}
|
||||||
|
|
@ -17,6 +17,7 @@ import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.sgzb.system.api.RemoteUserService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -68,6 +69,9 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
@Resource
|
@Resource
|
||||||
private BmFlowRecordService bmFlowRecordService;
|
private BmFlowRecordService bmFlowRecordService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
private final static String STRING_ADMIN = "admin";
|
private final static String STRING_ADMIN = "admin";
|
||||||
private final static String STRING_SGB = "sgb";
|
private final static String STRING_SGB = "sgb";
|
||||||
private final static String STRING_AJB = "sgb";
|
private final static String STRING_AJB = "sgb";
|
||||||
|
|
@ -135,6 +139,12 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//短信通知人员进行出库
|
||||||
|
for (LeaseApplyDetails details:leaseApplyDetails) {
|
||||||
|
//内部审核以后通知机具管理人进行出库
|
||||||
|
smsNotification(details,record.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
} else if (record.getTaskStatus() == 32 && companyId != null) {
|
} else if (record.getTaskStatus() == 32 && companyId != null) {
|
||||||
// 再审核领料任务信息表
|
// 再审核领料任务信息表
|
||||||
List<LeaseApplyInfo> leaseApplyInfoList = record.getLeaseApplyInfoList();
|
List<LeaseApplyInfo> leaseApplyInfoList = record.getLeaseApplyInfoList();
|
||||||
|
|
@ -212,6 +222,28 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void smsNotification(LeaseApplyDetails details,String code) {
|
||||||
|
TmTask tmTask = new TmTask();
|
||||||
|
tmTask.setId(details.getParenntId().toString());
|
||||||
|
//获取机具所属人员
|
||||||
|
List<TmTask> leaseDetailByParent = tmTaskMapper.getUserByParenntId(tmTask);
|
||||||
|
for (TmTask tmTaskNew: leaseDetailByParent) {
|
||||||
|
//对手机号进行处理,因为存在一种类型的机具归属多个人的情况
|
||||||
|
log.info("短信通知人为:{}",tmTaskNew.getUserName());
|
||||||
|
if (tmTaskNew.getPhoneNumber()!=null){
|
||||||
|
String[] phoneNumberList = tmTaskNew.getPhoneNumber().split(",");
|
||||||
|
String message ="尊敬的用户,宁夏智慧仓储管理系统提醒您:您有一个领料单号为:"+code+"的领料申请待处理,请及时查看";
|
||||||
|
for (int i = 0; i < phoneNumberList.length; i++) {
|
||||||
|
try {
|
||||||
|
remoteUserService.send(phoneNumberList[i], message);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.info("手机号为:{}发送短信失败",phoneNumberList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateLeaseTaskAuditInfoCq(TmTask record) {
|
public int updateLeaseTaskAuditInfoCq(TmTask record) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
|
||||||
|
|
@ -1249,4 +1249,20 @@
|
||||||
WHERE
|
WHERE
|
||||||
lai.id = #{id}
|
lai.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getUserByParenntId" resultType="com.bonus.sgzb.app.domain.TmTask">
|
||||||
|
SELECT
|
||||||
|
lad.id as id,
|
||||||
|
lad.parennt_id as parentId,
|
||||||
|
GROUP_CONCAT(su.user_name) as userName,
|
||||||
|
GROUP_CONCAT(su.phonenumber) as phoneNumber,
|
||||||
|
lad.status as status,
|
||||||
|
lad.type_id as typeId
|
||||||
|
FROM
|
||||||
|
lease_apply_details lad
|
||||||
|
LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id
|
||||||
|
LEFT JOIN sys_user su on mtk.user_id = su.user_id
|
||||||
|
WHERE
|
||||||
|
lad.parennt_id = #{id}
|
||||||
|
GROUP BY lad.type_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue