Commit ef53beaa authored by huyuchen's avatar huyuchen

优化修改

parent 6a329c40
......@@ -115,7 +115,7 @@ public class YifuTokenEndpoint {
user.getNickname(),user.getSystemFlag(), SecurityConstants.BCRYPT + user.getPassword(),
user.getPhone(), true, true, true,
CommonConstants.STATUS_NORMAL.equals(user.getLockFlag()),
user.getUserGroup(),authorities, user.getLdapDn());
user.getUserGroup(),authorities, user.getLdapDn(), info.getClientRoleMap());
thisUser.setClientRoleMap(info.getClientRoleMap());
return thisUser;
}
......
package com.yifu.cloud.plus.v1.business.controller.system;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarning;
import com.yifu.cloud.plus.v1.business.service.system.TBusWarningService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* B端预警表
*
* @author hgw
* @date 2021-08-20 17:39:51
*/
@RestController
@AllArgsConstructor
@RequestMapping("/tbuswarning")
@Tag(name = "B端预警表")
public class TBusWarningController {
private final TBusWarningService tBusWarningService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tBusWarning B端预警表
* @return
*/
@Operation(summary = "简单分页查询", description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TBusWarning>> getTBusWarningPage(Page<TBusWarning> page, TBusWarning tBusWarning) {
return new R<>(tBusWarningService.getTBusWarningPage(page, tBusWarning));
}
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation(summary = "id查询", description = "id查询")
@GetMapping("/{id}")
public R<TBusWarning> getById(@PathVariable("id") String id) {
return new R<>(tBusWarningService.getById(id));
}
/**
* 获取所有要自动发送的主表,以及人员信息进行定时任务发送短信
*
* @return
* @Author:hgw
* @Date 2021-8-24 18:18:01
*/
@Operation(summary = "获取所有要自动发送的主表,以及人员信息进行定时任务发送", description = "获取所有要自动发送的主表,以及人员信息进行定时任务发送")
@PostMapping("/inner/doBatchSendBusSms")
public R<Boolean> doBatchSendBusSms() {
return tBusWarningService.doBatchSendBusSms();
}
/**
* 更新当日所有发送的短信状态
*
* @return
* @Author:hgw
* @Date 2021-8-24 18:18:06
*/
@Operation(summary = "更新当日所有发送的短信状态", description = "更新当日所有发送的短信状态")
@PostMapping("/inner/doUpdateSendBusSmsStatus")
public R<Boolean> doUpdateSendBusSmsStatus() {
return tBusWarningService.doUpdateSendBusSmsStatus(DateUtil.getCurrentDateString(DateUtil.ISO_DATE_FORMAT));
}
}
package com.yifu.cloud.plus.v1.business.controller.system;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarningEmployee;
import com.yifu.cloud.plus.v1.business.service.system.TBusWarningEmployeeService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* B端短信发送记录表
*
* @author hgw
* @date 2021-08-23 16:27:34
*/
@RestController
@AllArgsConstructor
@RequestMapping("/tbuswarningemployee")
@Tag(name = "B端短信发送记录表")
public class TBusWarningEmployeeController {
private final TBusWarningEmployeeService tBusWarningEmployeeService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tBusWarningEmployee B端短信发送记录表
* @return
*/
@Operation(summary = "简单分页查询", description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TBusWarningEmployee>> getTBusWarningEmployeePage(Page<TBusWarningEmployee> page, TBusWarningEmployee tBusWarningEmployee) {
return new R<>(tBusWarningEmployeeService.getTBusWarningEmployeePage(page, tBusWarningEmployee));
}
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation(summary = "id查询", description = "id查询")
@GetMapping("/{id}")
public R<TBusWarningEmployee> getById(@PathVariable("id") String id) {
return new R<>(tBusWarningEmployeeService.getById(id));
}
/**
* @param se
* @Description: 手动发送
* @Author: hgw
* @Date: 2021-8-23 17:15:28
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.TSmsEmployee>
**/
@Operation(summary = "手动发送-单个", description = "手动发送-单个")
@PostMapping("/sendBusSms")
public R<String> sendBusSms(@RequestBody TBusWarningEmployee se) {
return tBusWarningEmployeeService.sendBusSms(se);
}
}
package com.yifu.cloud.plus.v1.business.controller.system;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarningMessage;
import com.yifu.cloud.plus.v1.business.service.system.TBusWarningMessageService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* B端预警-系统消息表
*
* @author hgw
* @date 2021-08-20 17:39:51
*/
@RestController
@AllArgsConstructor
@RequestMapping("/tbuswarningMessage")
@Tag(name = "B端预警-系统消息表")
public class TBusWarningMessageController {
private final TBusWarningMessageService tBusWarningMessageService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tBusWarningMessage B端预警-系统消息表
* @return
*/
@Operation(summary = "简单分页查询", description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TBusWarningMessage>> getTBusWarningPage(Page<TBusWarningMessage> page, TBusWarningMessage tBusWarningMessage) {
YifuUser user = SecurityUtils.getUser();
Map<String, List<Long>> roleMap = user.getClientRoleMap();
List<Long> roleList = null;
if (roleMap != null && !roleMap.isEmpty()) {
roleList = roleMap.get(ServiceNameConstants.CLIENT_ID_HR_B);
}
return new R<>(tBusWarningMessageService.getTBusWarningMessagePage(page, tBusWarningMessage, roleList));
}
}
package com.yifu.cloud.plus.v1.business.mapper.system;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarningEmployee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* B端短信发送记录表
*
* @author hgw
* @date 2021-08-23 16:27:34
*/
@Mapper
public interface TBusWarningEmployeeMapper extends BaseMapper<TBusWarningEmployee> {
/**
* B端短信发送记录表简单分页查询
*
* @param tBusWarningEmployee B端短信发送记录表
* @return
*/
IPage<TBusWarningEmployee> getTBusWarningEmployeePage(Page<TBusWarningEmployee> page, @Param("tBusWarningEmployee") TBusWarningEmployee tBusWarningEmployee);
int saveNewEmployee(@Param("se") TBusWarningEmployee se);
/**
* 获取指定日期的发送的短信
* @Author fxj
* @Date 2021-05-11
* @param dateStr
* @return
**/
List<TBusWarningEmployee> getTBusWarningEmployeeListToday(@Param("dateStr") String dateStr);
List<TBusWarningEmployee> getByBizId(@Param("bizId") String bizId);
int updateSendStatusByBizId(@Param("sendStatus")String sendStatus,@Param("updateStatus")String updateStatus,@Param("bizId")String bizId);
/**
* @param newBizId
* @param oldBizId
* @Description: 更新
* @Author: hgw
* @Date: 2021/5/10 14:54
* @return: int
**/
int updateBizIdByBizId(@Param("newBizId") String newBizId, @Param("oldBizId") String oldBizId);
/**
* @param warningId
* @param userId
* @param bizId
* @Description: 复审到期日
* @Author: hgw
* @Date: 2021/8/24 17:51
* @return: int
**/
int insertByReviewDate(@Param("warningId") String warningId, @Param("userId") Integer userId, @Param("bizId") String bizId, @Param("days") Integer days);
/**
* @param warningId
* @param userId
* @param bizId
* @Description: 证件到期日
* @Author: hgw
* @Date: 2021/8/24 17:51
* @return: int
**/
int insertByTermValidityEnd(@Param("warningId") String warningId, @Param("userId") Integer userId, @Param("bizId") String bizId, @Param("days") Integer days);
/**
* @param warningId
* @param userId
* @param bizId
* @Description: 年假未休时长
* @Author: hgw
* @Date: 2021/8/24 17:51
* @return: int
**/
int insertByYearVacation(@Param("warningId") String warningId, @Param("userId") Integer userId, @Param("bizId") String bizId);
/**
* @Description: 获取假期结束人员姓名
* @Author: hgw
* @Date: 2021/8/25 13:13
* @return: java.lang.String
**/
String getVacationInfoEmpName();
}
package com.yifu.cloud.plus.v1.business.mapper.system;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarning;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* B端预警表
*
* @author hgw
* @date 2021-08-20 17:39:51
*/
@Mapper
public interface TBusWarningMapper extends BaseMapper<TBusWarning> {
/**
* B端预警表简单分页查询
*
* @param tBusWarning B端预警表
* @return
*/
IPage<TBusWarning> getTBusWarningPage(Page<TBusWarning> page, @Param("tBusWarning") TBusWarning tBusWarning);
/**
* @param
* @Description: 自动发送短信的list
* @Author: hgw
* @Date: 2021/8/24 11:41
* @return: java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusWarning>
**/
List<TBusWarning> getListByAutoSend();
/**
* @param
* @Description: 系统消息
* @Author: hgw
* @Date: 2021/8/25 12:53
* @return: java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusWarning>
**/
List<TBusWarning> getListBySystem();
}
package com.yifu.cloud.plus.v1.business.mapper.system;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarningMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* B端预警表
*
* @author hgw
* @date 2021-08-20 17:39:51
*/
@Mapper
public interface TBusWarningMessageMapper extends BaseMapper<TBusWarningMessage> {
/**
* B端预警表简单分页查询
*
* @param tBusWarningMessage B端预警表
* @return
*/
IPage<TBusWarningMessage> getTBusWarningMessagePage(Page<TBusWarningMessage> page
, @Param("tBusWarningMessage") TBusWarningMessage tBusWarningMessage
, @Param("roleList") List<Long> roleList);
}
package com.yifu.cloud.plus.v1.business.service.system;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarningEmployee;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
/**
* B端短信发送记录表
*
* @author hgw
* @date 2021-08-23 16:27:34
*/
public interface TBusWarningEmployeeService extends IService<TBusWarningEmployee> {
/**
* B端短信发送记录表简单分页查询
*
* @param tBusWarningEmployee B端短信发送记录表
* @return
*/
IPage<TBusWarningEmployee> getTBusWarningEmployeePage(Page<TBusWarningEmployee> page, TBusWarningEmployee tBusWarningEmployee);
/**
* @param dateStr
* @Description: 获取list
* @Author: hgw
* @Date: 2021/8/24 18:09
* @return: java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusWarningEmployee>
**/
List<TBusWarningEmployee> getTBusWarningEmployeeListToday(String dateStr);
/**
* @param bizId
* @Description: 获取list-根据bizId
* @Author: hgw
* @Date: 2021/8/24 18:08
* @return: java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusWarningEmployee>
**/
List<TBusWarningEmployee> getByBizId(String bizId);
/**
* @param smsEmployee
* @Description: 单个发送
* @Author: hgw
* @Date: 2021/5/10 10:23
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
R<String> sendBusSms(TBusWarningEmployee smsEmployee);
/**
* @param warningId
* @param userId
* @param bizId
* @Description: 复审到期日
* @Author: hgw
* @Date: 2021/8/24 17:51
* @return: int
**/
int insertByReviewDate(String warningId, Integer userId, String bizId, Integer days);
/**
* @param warningId
* @param userId
* @param bizId
* @Description: 证件到期日
* @Author: hgw
* @Date: 2021/8/24 17:51
* @return: int
**/
int insertByTermValidityEnd(String warningId, Integer userId, String bizId, Integer days);
/**
* @param warningId
* @param userId
* @param bizId
* @Description: 年假未休时长
* @Author: hgw
* @Date: 2021/8/24 17:51
* @return: int
**/
int insertByYearVacation(String warningId, Integer userId, String bizId);
/**
* @Description: 获取假期结束人员姓名
* @Author: hgw
* @Date: 2021/8/25 13:14
* @return: java.lang.String
**/
String getVacationInfoEmpName();
}
package com.yifu.cloud.plus.v1.business.service.system;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarningMessage;
import java.util.List;
/**
* B端预警表
*
* @author hgw
* @date 2021-08-20 17:39:51
*/
public interface TBusWarningMessageService extends IService<TBusWarningMessage> {
/**
* B端预警表简单分页查询
*
* @param tBusWarningMessage B端预警表
* @return
*/
IPage<TBusWarningMessage> getTBusWarningMessagePage(Page<TBusWarningMessage> page
, TBusWarningMessage tBusWarningMessage, List<Long> roleList);
}
package com.yifu.cloud.plus.v1.business.service.system;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarning;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/**
* B端预警表
*
* @author hgw
* @date 2021-08-20 17:39:51
*/
public interface TBusWarningService extends IService<TBusWarning> {
/**
* B端预警表简单分页查询
*
* @param tBusWarning B端预警表
* @return
*/
IPage<TBusWarning> getTBusWarningPage(Page<TBusWarning> page, TBusWarning tBusWarning);
/**
* @param
* @Description: 获取所有要自动发送的主表,以及人员信息进行定时任务发送短信
* @Author: hgw
* @Date: 2021/8/25 11:32
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
**/
R<Boolean> doBatchSendBusSms();
/**
* @param dateStr
* @Description: 更新当日所有发送的短信状态
* @Author: hgw
* @Date: 2021/8/25 11:32
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.Boolean>
**/
R<Boolean> doUpdateSendBusSmsStatus(String dateStr);
}
package com.yifu.cloud.plus.v1.business.service.system.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarning;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarningEmployee;
import com.yifu.cloud.plus.v1.business.mapper.system.TBusWarningEmployeeMapper;
import com.yifu.cloud.plus.v1.business.mapper.system.TBusWarningMapper;
import com.yifu.cloud.plus.v1.business.service.system.TBusWarningEmployeeService;
import com.yifu.cloud.plus.v1.business.util.SmsTaskExecute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.ParamVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsTookit;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* B端短信发送记录表
*
* @author hgw
* @date 2021-08-23 16:27:34
*/
@Service("tBusWarningEmployeeService")
public class TBusWarningEmployeeServiceImpl extends ServiceImpl<TBusWarningEmployeeMapper, TBusWarningEmployee> implements TBusWarningEmployeeService {
@Autowired
private TBusWarningMapper busWarningMapper;
@Autowired
private SmsTaskExecute smsTaskExecute;
/**
* B端短信发送记录表简单分页查询
*
* @param tBusWarningEmployee B端短信发送记录表
* @return
*/
@Override
public IPage<TBusWarningEmployee> getTBusWarningEmployeePage(Page<TBusWarningEmployee> page, TBusWarningEmployee tBusWarningEmployee) {
return baseMapper.getTBusWarningEmployeePage(page, tBusWarningEmployee);
}
@Override
public List<TBusWarningEmployee> getTBusWarningEmployeeListToday(String dateStr) {
return baseMapper.getTBusWarningEmployeeListToday(dateStr);
}
@Override
public List<TBusWarningEmployee> getByBizId(String bizId) {
return baseMapper.getByBizId(bizId);
}
/**
* @Description: 手动发送-单个
* @Author: hgw
* @Date: 2021/5/10 9:50
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.TBusWarningEmployee>
**/
@Override
public R<String> sendBusSms(TBusWarningEmployee smsEmployee) {
if (smsEmployee.getId() == null) {
return R.failed("员工列表id不可为空!");
}
if (Common.isEmpty(smsEmployee.getWarningId())) {
return R.failed("配置主表id不可为空!");
}
TBusWarning si = busWarningMapper.selectById(smsEmployee.getWarningId());
TBusWarningEmployee se = this.getById(smsEmployee.getId());
if (si == null) {
return R.failed("未找到配置主表");
}
if (se == null) {
return R.failed("未找到员工信息");
}
YifuUser user = SecurityUtils.getUser();
if (user == null || user.getId() == null) {
return R.failed("未找到登录人员信息");
}
// 暂存的毫秒数
String bizId = String.valueOf(System.currentTimeMillis());
TBusWarningEmployee newSe = new TBusWarningEmployee();
newSe.setBusinessTelecomNumber(se.getBusinessTelecomNumber());
newSe.setCertType(se.getCertType());
newSe.setNotUsedVacationDuration(se.getNotUsedVacationDuration());
newSe.setBizId(bizId);
newSe.setSendStatus(CommonConstants.ONE_STRING);
newSe.setCreateUser(String.valueOf(user.getId()));
newSe.setEmpIdcard(se.getEmpIdcard());
newSe.setEmpName(se.getEmpName());
newSe.setEmpPhone(se.getEmpPhone());
newSe.setRemark(se.getRemark());
newSe.setSendDate(LocalDateTime.now());
newSe.setWarningId(si.getId());
newSe.setBusDeptCode(se.getBusDeptCode());
newSe.setBusDeptId(se.getBusDeptId());
newSe.setBusDeptName(se.getBusDeptName());
newSe.setUpdateStatus(CommonConstants.ZERO_STRING);
// 自定义sql新增的,如果有新字段,请记得加sql(因为id是数据库自增的)
baseMapper.saveNewEmployee(newSe);
String empName = se.getEmpName();
if (Common.isNotNull(empName)) {
empName = empName.replaceAll("\\d+", "").replace("X", "");
}
List<String> phones = new ArrayList<>();
phones.add(newSe.getEmpPhone());
ParamVo paramVo = new ParamVo();
paramVo.setName(empName);
List<ParamVo> params = new ArrayList<>();
if (si.getRemindType() != 2) {
paramVo.setZhengjian(newSe.getCertType());
} else {
paramVo.setTime(newSe.getNotUsedVacationDuration());
}
params.add(paramVo);
// 调用发送接口
AliSmsResult asr = YiFuSmsTookit.sendBusBatchSms(phones, params, si.getSignName(), si.getModelCode());
if (asr != null && Common.isNotNull(asr.getBizId())) {
baseMapper.updateBizIdByBizId(asr.getBizId(), bizId);
// 异步更新短信发送状态
smsTaskExecute.querySendDetailTask(baseMapper, asr.getBizId(), se.getEmpPhone());
}
return R.ok(null,"正在发送中,请等待……");
}
/**
* @Description: 复审到期日
* @Author: hgw
* @Date: 2021/8/24 17:54
* @return: int
**/
@Override
public int insertByReviewDate(String warningId, Integer userId, String bizId, Integer days) {
return baseMapper.insertByReviewDate(warningId, userId, bizId, days);
}
/**
* @Description: 证件到期日
* @Author: hgw
* @Date: 2021/8/24 17:54
* @return: int
**/
@Override
public int insertByTermValidityEnd(String warningId, Integer userId, String bizId, Integer days) {
return baseMapper.insertByTermValidityEnd(warningId, userId, bizId, days);
}
/**
* @Description: 年假未休时长
* @Author: hgw
* @Date: 2021/8/24 17:54
* @return: int
**/
@Override
public int insertByYearVacation(String warningId, Integer userId, String bizId) {
return baseMapper.insertByYearVacation(warningId, userId, bizId);
}
/**
* @Description: 获取假期结束人员姓名
* @Author: hgw
* @Date: 2021/8/24 17:54
* @return: int
**/
@Override
public String getVacationInfoEmpName() {
return baseMapper.getVacationInfoEmpName();
}
}
package com.yifu.cloud.plus.v1.business.service.system.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.business.entity.system.TBusWarningMessage;
import com.yifu.cloud.plus.v1.business.mapper.system.TBusWarningMessageMapper;
import com.yifu.cloud.plus.v1.business.service.system.TBusWarningMessageService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* B端预警表
*
* @author hgw
* @date 2021-08-20 17:39:51
*/
@Service("tBusWarningMessageService")
public class TBusWarningMessageServiceImpl extends ServiceImpl<TBusWarningMessageMapper, TBusWarningMessage> implements TBusWarningMessageService {
/**
* B端预警表简单分页查询
*
* @param tBusWarningMessage B端预警表
* @return
*/
@Override
public IPage<TBusWarningMessage> getTBusWarningMessagePage(Page<TBusWarningMessage> page
, TBusWarningMessage tBusWarningMessage, List<Long> roleList) {
return baseMapper.getTBusWarningMessagePage(page, tBusWarningMessage, roleList);
}
}
package com.yifu.cloud.plus.v1.business.util;
import com.yifu.cloud.plus.v1.business.mapper.system.TBusWarningEmployeeMapper;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.QuerySendResult;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
/**
* 异步执行短信发送任务
*
* @Author fxj
* @Date 2021-05-24
* @return
**/
@Component
@Slf4j
public class SmsTaskExecute {
@Async
public void querySendDetailTask(TBusWarningEmployeeMapper mapper, String bizId, String phone) {
try {
TimeUnit.SECONDS.sleep(10);
QuerySendResult res = YiFuSmsUtil.querySendDetail(phone, bizId,
DateUtil.getCurrentDateString(DateUtil.ISO_DATE_FORMAT), null, null);
this.updateSmsResult(mapper, bizId, res);
} catch (Exception ex) {
log.error("查询短信状态异常!", ex);
}
}
private void updateSmsResult(TBusWarningEmployeeMapper mapper, String bizId, QuerySendResult res) {
if (null != res && null != res.getSmsSendDetailDTOs() &&
Common.isNotNull(res.getSmsSendDetailDTOs().getSmsSendDetailDTO())) {
mapper.updateSendStatusByBizId(
res.getSmsSendDetailDTOs().getSmsSendDetailDTO().get(0).getSendStatus().toString(),
CommonConstants.ONE_STRING, bizId);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.business.mapper.system.TBusWarningMapper">
<resultMap id="tBusWarningMap" type="com.yifu.cloud.plus.v1.business.entity.system.TBusWarning">
<id property="id" column="id"/>
<result property="type" column="type"/>
<result property="remindType" column="remind_type"/>
<result property="remindTemplate" column="remind_template"/>
<result property="sendMethod" column="send_method"/>
<result property="remindRules" column="remind_rules"/>
<result property="remindObject" column="remind_object"/>
<result property="modelCode" column="model_code"/>
<result property="signName" column="sign_name"/>
<result property="sendDate" column="send_date"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.type,
a.remind_type,
a.remind_template,
a.send_method,
a.remind_rules,
a.remind_object,
a.model_code,
a.sign_name,
a.send_date,
a.remark
</sql>
<sql id="tBusWarning_where">
<if test="tBusWarning != null">
<if test="tBusWarning.id != null and tBusWarning.id.trim() != ''">
AND a.id = #{tBusWarning.id}
</if>
<if test="tBusWarning.type != null">
AND a.type = #{tBusWarning.type}
</if>
<if test="tBusWarning.remindType != null">
AND a.remind_type = #{tBusWarning.remindType}
</if>
<if test="tBusWarning.remindTemplate != null and tBusWarning.remindTemplate.trim() != ''">
AND a.remind_template = #{tBusWarning.remindTemplate}
</if>
<if test="tBusWarning.sendMethod != null">
AND a.send_method = #{tBusWarning.sendMethod}
</if>
<if test="tBusWarning.remindRules != null">
AND a.remind_rules = #{tBusWarning.remindRules}
</if>
<if test="tBusWarning.remindObject != null and tBusWarning.remindObject.trim() != ''">
AND a.remind_object = #{tBusWarning.remindObject}
</if>
</if>
</sql>
<!--tBusWarning简单分页查询-->
<select id="getTBusWarningPage" resultMap="tBusWarningMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_bus_warning a
<where>
1=1
<include refid="tBusWarning_where"/>
</where>
</select>
<!--自动发送短信的list-->
<select id="getListByAutoSend" resultMap="tBusWarningMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_bus_warning a
where a.type = 0 and a.send_method = 0
</select>
<!--系统消息的list-->
<select id="getListBySystem" resultMap="tBusWarningMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_bus_warning a
where a.type = 1
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.business.mapper.system.TBusWarningMessageMapper">
<resultMap id="tBusWarningMessageMap" type="com.yifu.cloud.plus.v1.business.entity.system.TBusWarningMessage">
<id property="id" column="id"/>
<result property="warningId" column="warning_id"/>
<result property="remindType" column="remind_type"/>
<result property="remindContent" column="remind_content"/>
<result property="remindObject" column="remind_object"/>
<result property="remark" column="remark"/>
<result property="createDate" column="create_date"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.warning_id,
a.remind_type,
a.remind_content,
a.remind_object,
a.remark,
a.create_date
</sql>
<!--tBusWarningMessage简单分页查询-->
<select id="getTBusWarningMessagePage" resultMap="tBusWarningMessageMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_bus_warning_message a
where 1=1
<if test="tBusWarningMessage != null and tBusWarningMessage.createDate != null">
and a.create_date = #{tBusWarning.createDate}
</if>
<if test="roleList != null and roleList != '' ">
and ( 1=2
<foreach item="item" index="index" collection="roleList" >
or locate('${item}',a.remind_object)
</foreach>
)
</if>
order by a.create_date desc
</select>
</mapper>
......@@ -101,12 +101,4 @@ public class YifuUser extends User {
this.ldapDn = ldapDn;
this.clientRoleMap=clientRoleMap;
}
/**
* key是客户端id,val是角色id数组
*/
@Getter
@Setter
private Map<String, List<Integer>> clientRoleMap;
}
......@@ -45,11 +45,6 @@ public class UserInfo implements Serializable {
*/
private String[] permissions;
/**
* key是客户端id,val是角色id数组
*/
private Map<String,List<Integer>> clientRoleMap;
/**
* 角色集合
*/
......
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