用户管理、值班日志
parent
41155cf9f5
commit
2b79b18fc9
|
|
@ -54,16 +54,23 @@ public class HomeController {
|
||||||
bizStatCateService.statByDate(cateBo);
|
bizStatCateService.statByDate(cateBo);
|
||||||
|
|
||||||
|
|
||||||
|
if (user.getRolePermission().contains("report_manager")){
|
||||||
BizReportInfoBo bo = new BizReportInfoBo();
|
BizReportInfoBo bo = new BizReportInfoBo();
|
||||||
bo.setOldType("dcl");
|
bo.setOldType("dcl");
|
||||||
if (user.getRolePermission().contains("report_manager")){
|
|
||||||
bo.setOldTable("xxbs");
|
bo.setOldTable("xxbs");
|
||||||
|
result.put("dbxxbslist", bizReportInfoService.queryPageList(bo, pageQuery));
|
||||||
}else{
|
}else{
|
||||||
bo.setOldTable("xxcl");
|
result.put("dbxxbslist", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.put("dblist", bizReportInfoService.queryPageList(bo, pageQuery));
|
if (user.getRolePermission().contains("report_user")){
|
||||||
|
BizReportInfoBo bo2 = new BizReportInfoBo();
|
||||||
|
bo2.setOldType("dcl");
|
||||||
|
bo2.setOldTable("xxcl");
|
||||||
|
result.put("dbxxcllist", bizReportInfoService.queryPageList(bo2, pageQuery));
|
||||||
|
}else{
|
||||||
|
result.put("dbxxcllist", null);
|
||||||
|
}
|
||||||
|
|
||||||
return R.ok(result);
|
return R.ok(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ spring:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://127.0.0.1:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
# url: jdbc:mysql://192.168.0.49:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
# url: jdbc:mysql://192.168.0.49:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: ruansee
|
||||||
# type: ${spring.datasource.type}
|
# type: ${spring.datasource.type}
|
||||||
# driverClassName: org.postgresql.Driver
|
# driverClassName: org.postgresql.Driver
|
||||||
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ spring:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://127.0.0.1:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
# url: jdbc:mysql://192.168.0.49:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
# url: jdbc:mysql://192.168.0.49:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: ruansee
|
||||||
# # 从库数据源
|
# # 从库数据源
|
||||||
# slave:
|
# slave:
|
||||||
# lazy: true
|
# lazy: true
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,9 @@ spring:
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
# 单个文件大小
|
# 单个文件大小
|
||||||
max-file-size: 10MB
|
max-file-size: 100MB
|
||||||
# 设置总上传的文件大小
|
# 设置总上传的文件大小
|
||||||
max-request-size: 20MB
|
max-request-size: 200MB
|
||||||
mvc:
|
mvc:
|
||||||
# 设置静态资源路径 防止所有请求都去查静态资源
|
# 设置静态资源路径 防止所有请求都去查静态资源
|
||||||
static-path-pattern: /static/**
|
static-path-pattern: /static/**
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ public class Helper {
|
||||||
Pattern p1 = null;
|
Pattern p1 = null;
|
||||||
Pattern p2 = null;
|
Pattern p2 = null;
|
||||||
Matcher m = null;
|
Matcher m = null;
|
||||||
p1 = Pattern.compile("^((1[3-9]{1})+\\d{8})?$");
|
p1 = Pattern.compile("^((1[3-9]{1})+\\d{9})?$");
|
||||||
p2 = Pattern.compile("^(0[0-9]{2,3}\\-)?([1-9][0-9]{6,7})$");
|
p2 = Pattern.compile("^(0[0-9]{2,3}\\-)?([1-9][0-9]{6,7})$");
|
||||||
if("0".equals(checkType)){
|
if("0".equals(checkType)){
|
||||||
System.out.println(phoneNum.length());
|
System.out.println(phoneNum.length());
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ spring:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://127.0.0.1:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
# url: jdbc:mysql://192.168.0.49:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
# url: jdbc:mysql://192.168.0.49:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: ruansee
|
||||||
# type: com.zaxxer.hikari.HikariDataSource
|
# type: com.zaxxer.hikari.HikariDataSource
|
||||||
# driver-class-name: org.postgresql.Driver
|
# driver-class-name: org.postgresql.Driver
|
||||||
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ spring:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://127.0.0.1:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
# url: jdbc:mysql://192.168.0.49:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
# url: jdbc:mysql://192.168.0.49:3306/xxbsdb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: ruansee
|
||||||
hikari:
|
hikari:
|
||||||
connection-timeout: 30000
|
connection-timeout: 30000
|
||||||
validation-timeout: 5000
|
validation-timeout: 5000
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import lombok.RequiredArgsConstructor;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.dromara.common.core.utils.Helper;
|
||||||
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
|
@ -42,6 +44,8 @@ public class BizDutyController extends BaseController {
|
||||||
@SaCheckPermission("biz:duty:list")
|
@SaCheckPermission("biz:duty:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<BizDutyVo> list(BizDutyBo bo, PageQuery pageQuery) {
|
public TableDataInfo<BizDutyVo> list(BizDutyBo bo, PageQuery pageQuery) {
|
||||||
|
if (bo.getDeptId()==null || Helper.NStr(bo.getDeptId()).equals(""))
|
||||||
|
bo.setDeptId(LoginHelper.getDeptId());
|
||||||
return bizDutyService.queryPageList(bo, pageQuery);
|
return bizDutyService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ public class RPAController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/smstest")
|
@GetMapping("/smstest")
|
||||||
public R<Void> smstest() {
|
public R<Void> smstest() {
|
||||||
return R.ok(SmsUtils.sendSMS("18655101696", "您有一条新的报送信息待处理,请前往查看"));
|
return R.ok(SmsUtils.sendSMS("18655101696", "您有一条新的信息待签收,请前往综合情报信息报送处理系统处理"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ import org.dromara.common.core.service.DeptService;
|
||||||
import org.dromara.common.core.service.UserService;
|
import org.dromara.common.core.service.UserService;
|
||||||
import org.dromara.common.core.utils.Helper;
|
import org.dromara.common.core.utils.Helper;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.annotation.DataColumn;
|
||||||
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
@ -14,6 +17,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
import org.dromara.system.domain.SysDept;
|
||||||
|
import org.dromara.system.domain.SysUser;
|
||||||
|
import org.dromara.system.mapper.SysDeptMapper;
|
||||||
import org.dromara.system.mapper.SysUserMapper;
|
import org.dromara.system.mapper.SysUserMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.biz.domain.bo.BizDutyBo;
|
import org.dromara.biz.domain.bo.BizDutyBo;
|
||||||
|
|
@ -44,6 +50,7 @@ public class BizDutyServiceImpl implements IBizDutyService {
|
||||||
private final DeptService deptService;
|
private final DeptService deptService;
|
||||||
|
|
||||||
private final SysUserMapper userMapper;
|
private final SysUserMapper userMapper;
|
||||||
|
private final SysDeptMapper deptMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询值班信息
|
* 查询值班信息
|
||||||
|
|
@ -54,9 +61,13 @@ public class BizDutyServiceImpl implements IBizDutyService {
|
||||||
@Override
|
@Override
|
||||||
public BizDutyVo queryById(Long id){
|
public BizDutyVo queryById(Long id){
|
||||||
BizDutyVo duty = baseMapper.selectVoById(id);
|
BizDutyVo duty = baseMapper.selectVoById(id);
|
||||||
|
if (Helper.FInt(duty.getLeaderId())>0)
|
||||||
duty.setLeader(userMapper.selectById(duty.getLeaderId()));
|
duty.setLeader(userMapper.selectById(duty.getLeaderId()));
|
||||||
|
if (Helper.FInt(duty.getChairmanId())>0)
|
||||||
duty.setChairman(userMapper.selectById(duty.getChairmanId()));
|
duty.setChairman(userMapper.selectById(duty.getChairmanId()));
|
||||||
|
if (Helper.FInt(duty.getMonitorId())>0)
|
||||||
duty.setMonitor(userMapper.selectById(duty.getMonitorId()));
|
duty.setMonitor(userMapper.selectById(duty.getMonitorId()));
|
||||||
|
if (duty.getWatchkeeperIds()!=null && duty.getWatchkeeperIds().length()>0)
|
||||||
duty.setWatchkeeperList(userMapper.selectByIds(convertIds(duty.getWatchkeeperIds())));
|
duty.setWatchkeeperList(userMapper.selectByIds(convertIds(duty.getWatchkeeperIds())));
|
||||||
return duty;
|
return duty;
|
||||||
}
|
}
|
||||||
|
|
@ -79,6 +90,9 @@ public class BizDutyServiceImpl implements IBizDutyService {
|
||||||
* @return 值班信息分页列表
|
* @return 值班信息分页列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@DataPermission({
|
||||||
|
@DataColumn(key = "deptName", value = "dept_id"),
|
||||||
|
})
|
||||||
public TableDataInfo<BizDutyVo> queryPageList(BizDutyBo bo, PageQuery pageQuery) {
|
public TableDataInfo<BizDutyVo> queryPageList(BizDutyBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<BizDuty> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<BizDuty> lqw = buildQueryWrapper(bo);
|
||||||
Page<BizDutyVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<BizDutyVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
|
@ -92,6 +106,9 @@ public class BizDutyServiceImpl implements IBizDutyService {
|
||||||
* @return 值班信息列表
|
* @return 值班信息列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@DataPermission({
|
||||||
|
@DataColumn(key = "deptName", value = "dept_id"),
|
||||||
|
})
|
||||||
public List<BizDutyVo> queryList(BizDutyBo bo) {
|
public List<BizDutyVo> queryList(BizDutyBo bo) {
|
||||||
LambdaQueryWrapper<BizDuty> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<BizDuty> lqw = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(lqw);
|
||||||
|
|
@ -104,7 +121,15 @@ public class BizDutyServiceImpl implements IBizDutyService {
|
||||||
lqw.eq(bo.getDutyDate() != null, BizDuty::getDutyDate, bo.getDutyDate());
|
lqw.eq(bo.getDutyDate() != null, BizDuty::getDutyDate, bo.getDutyDate());
|
||||||
lqw.between(params.get("beginDutyDate") != null && params.get("endDutyDate") != null,
|
lqw.between(params.get("beginDutyDate") != null && params.get("endDutyDate") != null,
|
||||||
BizDuty::getDutyDate ,params.get("beginDutyDate"), params.get("endDutyDate"));
|
BizDuty::getDutyDate ,params.get("beginDutyDate"), params.get("endDutyDate"));
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), BizDuty::getDeptId, bo.getDeptId());
|
|
||||||
|
if (bo.getDeptId()!=null && !Helper.NStr(bo.getDeptId()).equals("")) {
|
||||||
|
List<SysDept> deptList = deptMapper.selectListByParentId(bo.getDeptId());
|
||||||
|
List<String> ids = StreamUtils.toList(deptList, SysDept::getDeptId);
|
||||||
|
ids.add(bo.getDeptId());
|
||||||
|
lqw.in(BizDuty::getDeptId, ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
// lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), BizDuty::getDeptId, bo.getDeptId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getDeptName()), BizDuty::getDeptName, bo.getDeptName());
|
lqw.like(StringUtils.isNotBlank(bo.getDeptName()), BizDuty::getDeptName, bo.getDeptName());
|
||||||
lqw.eq(bo.getLeaderId() != null, BizDuty::getLeaderId, bo.getLeaderId());
|
lqw.eq(bo.getLeaderId() != null, BizDuty::getLeaderId, bo.getLeaderId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getLeaderName()), BizDuty::getLeaderName, bo.getLeaderName());
|
lqw.like(StringUtils.isNotBlank(bo.getLeaderName()), BizDuty::getLeaderName, bo.getLeaderName());
|
||||||
|
|
@ -137,9 +162,13 @@ public class BizDutyServiceImpl implements IBizDutyService {
|
||||||
|
|
||||||
add.setDeptId(user.getDeptId());
|
add.setDeptId(user.getDeptId());
|
||||||
add.setCreateUserId(user.getUserId());
|
add.setCreateUserId(user.getUserId());
|
||||||
|
if (Helper.FInt(add.getLeaderId())>0)
|
||||||
add.setLeaderName(userService.selectNicknameById(add.getLeaderId()));
|
add.setLeaderName(userService.selectNicknameById(add.getLeaderId()));
|
||||||
|
if (Helper.FInt(add.getChairmanId())>0)
|
||||||
add.setChairmanName(userService.selectNicknameById(add.getChairmanId()));
|
add.setChairmanName(userService.selectNicknameById(add.getChairmanId()));
|
||||||
|
if (Helper.FInt(add.getMonitorId())>0)
|
||||||
add.setMonitorName(userService.selectNicknameById(add.getMonitorId()));
|
add.setMonitorName(userService.selectNicknameById(add.getMonitorId()));
|
||||||
|
if (add.getWatchkeeperIds()!=null && add.getWatchkeeperIds().length()>0)
|
||||||
add.setWatchkeeperNames(userService.selectNicknameByIds(add.getWatchkeeperIds()));
|
add.setWatchkeeperNames(userService.selectNicknameByIds(add.getWatchkeeperIds()));
|
||||||
add.setDeptName(user.getDeptName());
|
add.setDeptName(user.getDeptName());
|
||||||
|
|
||||||
|
|
@ -160,13 +189,13 @@ public class BizDutyServiceImpl implements IBizDutyService {
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateByBo(BizDutyBo bo) {
|
public Boolean updateByBo(BizDutyBo bo) {
|
||||||
BizDuty update = MapstructUtils.convert(bo, BizDuty.class);
|
BizDuty update = MapstructUtils.convert(bo, BizDuty.class);
|
||||||
if(update.getLeaderId()!=null)
|
if (Helper.FInt(update.getLeaderId())>0)
|
||||||
update.setLeaderName(userService.selectNicknameById(update.getLeaderId()));
|
update.setLeaderName(userService.selectNicknameById(update.getLeaderId()));
|
||||||
if(update.getChairmanId()!=null)
|
if (Helper.FInt(update.getChairmanId())>0)
|
||||||
update.setChairmanName(userService.selectNicknameById(update.getChairmanId()));
|
update.setChairmanName(userService.selectNicknameById(update.getChairmanId()));
|
||||||
if(update.getMonitorId()!=null)
|
if (Helper.FInt(update.getMonitorId())>0)
|
||||||
update.setMonitorName(userService.selectNicknameById(update.getMonitorId()));
|
update.setMonitorName(userService.selectNicknameById(update.getMonitorId()));
|
||||||
if(update.getWatchkeeperIds()!=null)
|
if (update.getWatchkeeperIds()!=null && update.getWatchkeeperIds().length()>0)
|
||||||
update.setWatchkeeperNames(userService.selectNicknameByIds(update.getWatchkeeperIds()));
|
update.setWatchkeeperNames(userService.selectNicknameByIds(update.getWatchkeeperIds()));
|
||||||
// update.setDeptName(deptService.selectDeptNameByIds(update.getDeptId()));
|
// update.setDeptName(deptService.selectDeptNameByIds(update.getDeptId()));
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ public class BizIcdsNoticeServiceImpl implements IBizIcdsNoticeService {
|
||||||
private LambdaQueryWrapper<BizIcdsNotice> buildQueryWrapper(BizIcdsNoticeBo bo) {
|
private LambdaQueryWrapper<BizIcdsNotice> buildQueryWrapper(BizIcdsNoticeBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<BizIcdsNotice> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<BizIcdsNotice> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByAsc(BizIcdsNotice::getId);
|
lqw.orderByDesc(BizIcdsNotice::getSendTime);
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getOldId()), BizIcdsNotice::getOldId, bo.getOldId());
|
lqw.eq(StringUtils.isNotBlank(bo.getOldId()), BizIcdsNotice::getOldId, bo.getOldId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), BizIcdsNotice::getTitle, bo.getTitle());
|
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), BizIcdsNotice::getTitle, bo.getTitle());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getFileUrl()), BizIcdsNotice::getFileUrl, bo.getFileUrl());
|
lqw.eq(StringUtils.isNotBlank(bo.getFileUrl()), BizIcdsNotice::getFileUrl, bo.getFileUrl());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
package org.dromara.biz.service.impl;
|
package org.dromara.biz.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.biz.domain.*;
|
import org.dromara.biz.domain.*;
|
||||||
import org.dromara.biz.domain.bo.BizReportReceiverBo;
|
import org.dromara.biz.domain.bo.BizReportReceiverBo;
|
||||||
import org.dromara.biz.domain.vo.BizReportReceiverVo;
|
import org.dromara.biz.domain.vo.BizReportReceiverVo;
|
||||||
|
|
@ -33,9 +36,12 @@ import org.dromara.biz.domain.bo.BizReportInfoBo;
|
||||||
import org.dromara.biz.domain.vo.BizReportInfoVo;
|
import org.dromara.biz.domain.vo.BizReportInfoVo;
|
||||||
import org.dromara.biz.service.IBizReportInfoService;
|
import org.dromara.biz.service.IBizReportInfoService;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报送信息Service业务层处理
|
* 报送信息Service业务层处理
|
||||||
|
|
@ -45,6 +51,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class BizReportInfoServiceImpl implements IBizReportInfoService {
|
public class BizReportInfoServiceImpl implements IBizReportInfoService {
|
||||||
|
|
||||||
private final BizReportInfoMapper baseMapper;
|
private final BizReportInfoMapper baseMapper;
|
||||||
|
|
@ -167,8 +174,8 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService {
|
||||||
}else {
|
}else {
|
||||||
if (table.equals("xxcl")) {
|
if (table.equals("xxcl")) {
|
||||||
lqw.and(w -> {
|
lqw.and(w -> {
|
||||||
// w.eq(user.getDeptId()!=null, BizReportInfo::getReportDeptId, user.getDeptId());
|
w.eq(user.getDeptId()!=null, BizReportInfo::getReportDeptId, user.getDeptId());
|
||||||
w.likeRight(BizReportInfo::getReportDeptId, Helper.PrefixDeptid(user.getDeptId()));
|
// w.eq(BizReportInfo::getReportDeptId, Helper.PrefixDeptid(user.getDeptId()));
|
||||||
w.or(ww -> {
|
w.or(ww -> {
|
||||||
ww.exists("select id from biz_report_receiver where dept_id = '" + Helper.NStr(user.getDeptId()) + "' and report_id = v.id ");
|
ww.exists("select id from biz_report_receiver where dept_id = '" + Helper.NStr(user.getDeptId()) + "' and report_id = v.id ");
|
||||||
});
|
});
|
||||||
|
|
@ -219,6 +226,13 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService {
|
||||||
if (bo.getOldTable().equals("xxbs")){
|
if (bo.getOldTable().equals("xxbs")){
|
||||||
SysDept dept = deptMapper.selectById(deptid);
|
SysDept dept = deptMapper.selectById(deptid);
|
||||||
String sjdept = dept.getParentId(); //deptid.substring(0, 4)+"00000000";
|
String sjdept = dept.getParentId(); //deptid.substring(0, 4)+"00000000";
|
||||||
|
if (sjdept.equals("0")){
|
||||||
|
bo.setReceiverDeptIds(null);
|
||||||
|
BizReportInfo dbinfo = new BizReportInfo();
|
||||||
|
dbinfo.setId(bo.getId());
|
||||||
|
dbinfo.setStatus(ReportInfoStatusEnum.FINISH.getStatus());
|
||||||
|
baseMapper.updateById(dbinfo);
|
||||||
|
}else {
|
||||||
BizReportReceiver receiver = new BizReportReceiver();
|
BizReportReceiver receiver = new BizReportReceiver();
|
||||||
receiver.setReportId(bo.getId());
|
receiver.setReportId(bo.getId());
|
||||||
receiver.setDeptId(sjdept);
|
receiver.setDeptId(sjdept);
|
||||||
|
|
@ -230,6 +244,7 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService {
|
||||||
receiverMapper.insert(receiver);
|
receiverMapper.insert(receiver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 插入附件表
|
// 插入附件表
|
||||||
if (bo.getFiles()!=null && bo.getFiles().size()>0){
|
if (bo.getFiles()!=null && bo.getFiles().size()>0){
|
||||||
|
|
@ -265,20 +280,35 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService {
|
||||||
SysUserBo userBo = new SysUserBo();
|
SysUserBo userBo = new SysUserBo();
|
||||||
userBo.setDeptIds(bo.getReceiverDeptIds());
|
userBo.setDeptIds(bo.getReceiverDeptIds());
|
||||||
List<SysUserVo> list = userService.selectUserIdList(userBo);
|
List<SysUserVo> list = userService.selectUserIdList(userBo);
|
||||||
|
|
||||||
|
if(list!=null && list.size()>0) {
|
||||||
List<Long> userIds = StreamUtils.toList(list, SysUserVo::getUserId);
|
List<Long> userIds = StreamUtils.toList(list, SysUserVo::getUserId);
|
||||||
|
|
||||||
|
String userIdStr = userIds.stream()
|
||||||
|
.map(item -> "" + item + "")
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
|
||||||
|
HashMap item = new HashMap();
|
||||||
|
item.put("id", bo.getId());
|
||||||
|
item.put("title", bo.getTitle());
|
||||||
|
item.put("time", bo.getReportTime());
|
||||||
|
item.put("userIds", userIdStr);
|
||||||
|
log.info("推送任务: " + JSONUtil.toJsonStr(item));
|
||||||
|
|
||||||
scheduledExecutorService.schedule(() -> {
|
scheduledExecutorService.schedule(() -> {
|
||||||
SseMessageDto dto = new SseMessageDto();
|
SseMessageDto dto = new SseMessageDto();
|
||||||
dto.setMessage("您有新的待办信息,请前往查看!");
|
dto.setMessage("您有新的待办信息,请前往查看!");
|
||||||
dto.setType("todo");
|
dto.setType("todo");
|
||||||
dto.setUserIds(userIds);
|
dto.setUserIds(userIds);
|
||||||
SseMessageUtils.publishMessage(dto);
|
SseMessageUtils.publishMessage(dto);
|
||||||
}, 5, TimeUnit.SECONDS);
|
}, 1, TimeUnit.SECONDS);
|
||||||
|
|
||||||
for (SysUserVo userVo : list) {
|
for (SysUserVo userVo : list) {
|
||||||
String phone = Helper.NStr(userVo.getPhonenumber());
|
String phone = Helper.NStr(userVo.getPhonenumber());
|
||||||
if (Helper.validPhoneNum("0", phone)) {
|
if (Helper.validPhoneNum("0", phone)) {
|
||||||
SmsUtils.sendSMS(phone, "您有一条新的报送信息待处理,请前往查看");
|
|
||||||
|
SmsUtils.sendSMS(phone, "您有一条新的信息待签收,请前往综合情报信息报送处理系统处理");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -435,7 +465,15 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService {
|
||||||
LambdaQueryWrapper<BizReportInfo> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<BizReportInfo> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(bo.getCategoryId() != null, BizReportInfo::getCategoryId, bo.getCategoryId());
|
lqw.eq(bo.getCategoryId() != null, BizReportInfo::getCategoryId, bo.getCategoryId());
|
||||||
lqw.eq(BizReportInfo::getReportDeptId, user.getDeptId());
|
lqw.eq(BizReportInfo::getReportDeptId, user.getDeptId());
|
||||||
lqw.between(BizReportInfo::getReportTime , "", "");
|
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
LocalDate first = now.withDayOfYear(1);
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
String firstDay = first.format(formatter) + " 00:00:00";
|
||||||
|
String lastDay = now.format(formatter) + " 23:59:59";
|
||||||
|
System.out.println(firstDay + " ========= " + lastDay);
|
||||||
|
|
||||||
|
lqw.between(BizReportInfo::getReportTime , firstDay, lastDay);
|
||||||
|
|
||||||
int count = Helper.FInt(baseMapper.selectCount(lqw));
|
int count = Helper.FInt(baseMapper.selectCount(lqw));
|
||||||
String result = String.format("%0" + 4 + "d", count+1);
|
String result = String.format("%0" + 4 + "d", count+1);
|
||||||
|
|
@ -488,8 +526,20 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService {
|
||||||
SysUserBo userBo = new SysUserBo();
|
SysUserBo userBo = new SysUserBo();
|
||||||
userBo.setDeptIds(bo.getReportInfo().getReceiverDeptIds());
|
userBo.setDeptIds(bo.getReportInfo().getReceiverDeptIds());
|
||||||
List<SysUserVo> list = userService.selectUserIdList(userBo);
|
List<SysUserVo> list = userService.selectUserIdList(userBo);
|
||||||
|
if(list!=null && list.size()>0) {
|
||||||
List<Long> userIds = StreamUtils.toList(list, SysUserVo::getUserId);
|
List<Long> userIds = StreamUtils.toList(list, SysUserVo::getUserId);
|
||||||
|
|
||||||
|
String userIdStr = userIds.stream()
|
||||||
|
.map(item -> "" + item + "")
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
|
||||||
|
HashMap item = new HashMap();
|
||||||
|
item.put("id", bo.getReportId());
|
||||||
|
item.put("title", "分局下发派出所");
|
||||||
|
item.put("time", new Date());
|
||||||
|
item.put("userIds", userIdStr);
|
||||||
|
log.info("推送任务: " + JSONUtil.toJsonStr(item));
|
||||||
|
|
||||||
scheduledExecutorService.schedule(() -> {
|
scheduledExecutorService.schedule(() -> {
|
||||||
SseMessageDto dto = new SseMessageDto();
|
SseMessageDto dto = new SseMessageDto();
|
||||||
dto.setMessage("您有新的待办信息,请前往查看!");
|
dto.setMessage("您有新的待办信息,请前往查看!");
|
||||||
|
|
@ -501,7 +551,8 @@ public class BizReportInfoServiceImpl implements IBizReportInfoService {
|
||||||
for (SysUserVo userVo : list) {
|
for (SysUserVo userVo : list) {
|
||||||
String phone = Helper.NStr(userVo.getPhonenumber());
|
String phone = Helper.NStr(userVo.getPhonenumber());
|
||||||
if (Helper.validPhoneNum("0", phone)) {
|
if (Helper.validPhoneNum("0", phone)) {
|
||||||
SmsUtils.sendSMS(phone, "您有一条新的报送信息待处理,请前往查看");
|
SmsUtils.sendSMS(phone, "您有一条新的信息待签收,请前往综合情报信息报送处理系统处理");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package org.dromara.biz.service.impl;
|
package org.dromara.biz.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.biz.domain.BizReportInfo;
|
import org.dromara.biz.domain.BizReportInfo;
|
||||||
import org.dromara.biz.domain.BizReportReply;
|
import org.dromara.biz.domain.BizReportReply;
|
||||||
import org.dromara.biz.mapper.BizReportInfoMapper;
|
import org.dromara.biz.mapper.BizReportInfoMapper;
|
||||||
|
|
@ -9,6 +11,7 @@ import org.dromara.common.core.enums.ReportInfoStatusEnum;
|
||||||
import org.dromara.common.core.enums.ReportLogTypeEnum;
|
import org.dromara.common.core.enums.ReportLogTypeEnum;
|
||||||
import org.dromara.common.core.utils.Helper;
|
import org.dromara.common.core.utils.Helper;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
@ -17,6 +20,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
import org.dromara.common.sse.dto.SseMessageDto;
|
||||||
|
import org.dromara.common.sse.utils.SseMessageUtils;
|
||||||
|
import org.dromara.system.domain.bo.SysUserBo;
|
||||||
|
import org.dromara.system.domain.vo.SysUserVo;
|
||||||
|
import org.dromara.system.service.ISysUserService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.biz.domain.bo.BizReportReceiverBo;
|
import org.dromara.biz.domain.bo.BizReportReceiverBo;
|
||||||
import org.dromara.biz.domain.vo.BizReportReceiverVo;
|
import org.dromara.biz.domain.vo.BizReportReceiverVo;
|
||||||
|
|
@ -24,10 +32,10 @@ import org.dromara.biz.domain.BizReportReceiver;
|
||||||
import org.dromara.biz.mapper.BizReportReceiverMapper;
|
import org.dromara.biz.mapper.BizReportReceiverMapper;
|
||||||
import org.dromara.biz.service.IBizReportReceiverService;
|
import org.dromara.biz.service.IBizReportReceiverService;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.Map;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.Collection;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报送记录接收单位Service业务层处理
|
* 报送记录接收单位Service业务层处理
|
||||||
|
|
@ -37,6 +45,7 @@ import java.util.Collection;
|
||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class BizReportReceiverServiceImpl implements IBizReportReceiverService {
|
public class BizReportReceiverServiceImpl implements IBizReportReceiverService {
|
||||||
|
|
||||||
private final BizReportReceiverMapper baseMapper;
|
private final BizReportReceiverMapper baseMapper;
|
||||||
|
|
@ -44,6 +53,10 @@ public class BizReportReceiverServiceImpl implements IBizReportReceiverService {
|
||||||
|
|
||||||
private final IBizReportLogService logService;
|
private final IBizReportLogService logService;
|
||||||
|
|
||||||
|
private final ISysUserService userService;
|
||||||
|
|
||||||
|
private final ScheduledExecutorService scheduledExecutorService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询报送记录接收单位
|
* 查询报送记录接收单位
|
||||||
*
|
*
|
||||||
|
|
@ -189,13 +202,44 @@ public class BizReportReceiverServiceImpl implements IBizReportReceiverService {
|
||||||
// 添加日志
|
// 添加日志
|
||||||
logService.saveLog(bo.getReportId(), ReportLogTypeEnum.SIGN.getStatus(), bo.getId().toString(), "签收");
|
logService.saveLog(bo.getReportId(), ReportLogTypeEnum.SIGN.getStatus(), bo.getId().toString(), "签收");
|
||||||
|
|
||||||
|
BizReportInfo dbinfo = reportInfoMapper.selectById(bo.getReportId());
|
||||||
|
|
||||||
|
BizReportInfo info = new BizReportInfo();
|
||||||
|
info.setId(bo.getReportId());
|
||||||
|
|
||||||
|
String[] deptIds = new String[]{ user.getDeptId() };
|
||||||
|
SysUserBo userBo = new SysUserBo();
|
||||||
|
userBo.setDeptIds(deptIds);
|
||||||
|
List<SysUserVo> list = userService.selectUserIdList(userBo);
|
||||||
|
List<Long> userIds = StreamUtils.toList(list, SysUserVo::getUserId);
|
||||||
|
|
||||||
|
String userIdStr = userIds.stream()
|
||||||
|
.map(item -> "" + item + "")
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
|
||||||
|
HashMap item = new HashMap();
|
||||||
|
item.put("id", bo.getReportId());
|
||||||
|
item.put("title", dbinfo.getTitle());
|
||||||
|
item.put("time", new Date());
|
||||||
|
item.put("userIds", userIdStr);
|
||||||
|
log.info("停止推送任务: "+ JSONUtil.toJsonStr(item));
|
||||||
|
|
||||||
|
scheduledExecutorService.schedule(() -> {
|
||||||
|
SseMessageDto dto = new SseMessageDto();
|
||||||
|
dto.setMessage("停止播放提醒!");
|
||||||
|
dto.setType("stop");
|
||||||
|
dto.setUserIds(userIds);
|
||||||
|
SseMessageUtils.publishMessage(dto);
|
||||||
|
}, 1, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
if (dbinfo.getOldTable().equals("xxbs")){
|
||||||
|
info.setStatus(ReportInfoStatusEnum.FINISH.getStatus());
|
||||||
|
}else {
|
||||||
LambdaQueryWrapper<BizReportReceiver> lqw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BizReportReceiver> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(BizReportReceiver::getReportId, bo.getReportId());
|
lqw.eq(BizReportReceiver::getReportId, bo.getReportId());
|
||||||
lqw.eq(BizReportReceiver::getIsSign, 0);
|
lqw.eq(BizReportReceiver::getIsSign, 0);
|
||||||
Long notSignCount = baseMapper.selectCount(lqw);
|
Long notSignCount = baseMapper.selectCount(lqw);
|
||||||
|
|
||||||
BizReportInfo info = new BizReportInfo();
|
|
||||||
info.setId(bo.getReportId());
|
|
||||||
if (Helper.FInt(notSignCount) > 0)
|
if (Helper.FInt(notSignCount) > 0)
|
||||||
info.setStatus(ReportInfoStatusEnum.ANY_SIGN.getStatus());
|
info.setStatus(ReportInfoStatusEnum.ANY_SIGN.getStatus());
|
||||||
else {
|
else {
|
||||||
|
|
@ -208,6 +252,7 @@ public class BizReportReceiverServiceImpl implements IBizReportReceiverService {
|
||||||
else
|
else
|
||||||
info.setStatus(ReportInfoStatusEnum.WAITING_REPLY.getStatus());
|
info.setStatus(ReportInfoStatusEnum.WAITING_REPLY.getStatus());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
reportInfoMapper.updateById(info);
|
reportInfoMapper.updateById(info);
|
||||||
}
|
}
|
||||||
return flag > 0;
|
return flag > 0;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.domain.model.LoginUser;
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
|
import org.dromara.common.core.utils.Helper;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.encrypt.annotation.ApiEncrypt;
|
import org.dromara.common.encrypt.annotation.ApiEncrypt;
|
||||||
|
|
@ -23,6 +24,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.common.tenant.helper.TenantHelper;
|
import org.dromara.common.tenant.helper.TenantHelper;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.system.domain.SysDept;
|
||||||
import org.dromara.system.domain.bo.SysDeptBo;
|
import org.dromara.system.domain.bo.SysDeptBo;
|
||||||
import org.dromara.system.domain.bo.SysPostBo;
|
import org.dromara.system.domain.bo.SysPostBo;
|
||||||
import org.dromara.system.domain.bo.SysRoleBo;
|
import org.dromara.system.domain.bo.SysRoleBo;
|
||||||
|
|
@ -111,6 +113,12 @@ public class SysUserController extends BaseController {
|
||||||
TenantHelper.clearDynamic();
|
TenantHelper.clearDynamic();
|
||||||
}
|
}
|
||||||
SysUserVo user = userService.selectUserById(loginUser.getUserId());
|
SysUserVo user = userService.selectUserById(loginUser.getUserId());
|
||||||
|
SysDeptVo dept = deptService.selectDeptById(user.getDeptId());
|
||||||
|
String shortName = Helper.NStr(dept.getShortName());
|
||||||
|
String deptName = Helper.NStr(dept.getDeptName());
|
||||||
|
shortName = shortName.equals("") ? deptName : shortName;
|
||||||
|
user.setDeptShortName(shortName);
|
||||||
|
|
||||||
if (ObjectUtil.isNull(user)) {
|
if (ObjectUtil.isNull(user)) {
|
||||||
return R.fail("没有权限访问用户数据!");
|
return R.fail("没有权限访问用户数据!");
|
||||||
}
|
}
|
||||||
|
|
@ -297,4 +305,12 @@ public class SysUserController extends BaseController {
|
||||||
return R.ok(userService.selectUserListByDept(deptId));
|
return R.ok(userService.selectUserListByDept(deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门下的所有用户信息
|
||||||
|
*/
|
||||||
|
// @SaCheckPermission("system:user:list")
|
||||||
|
@GetMapping("/listNotLeader/dept/{deptId}")
|
||||||
|
public R<List<SysUserVo>> listNotLeaderByDept(@PathVariable @NotNull String deptId) {
|
||||||
|
return R.ok(userService.selectUserListNotLeaderByDept(deptId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,11 @@ public class SysUser extends TenantEntity {
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示顺序
|
||||||
|
*/
|
||||||
|
private Integer orderNum;
|
||||||
|
|
||||||
|
|
||||||
public SysUser(Long userId) {
|
public SysUser(Long userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package org.dromara.system.domain.bo;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import jakarta.validation.constraints.Email;
|
import jakarta.validation.constraints.Email;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
@ -130,4 +131,10 @@ public class SysUserBo extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String[] deptIds;
|
private String[] deptIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示顺序
|
||||||
|
*/
|
||||||
|
@NotNull(message = "显示顺序不能为空")
|
||||||
|
private Integer orderNum;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -152,4 +152,13 @@ public class SysUserVo implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门简称
|
||||||
|
*/
|
||||||
|
private String deptShortName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示顺序
|
||||||
|
*/
|
||||||
|
private Integer orderNum;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,9 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
|
||||||
})
|
})
|
||||||
List<SysUserVo> selectUserList(@Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
List<SysUserVo> selectUserList(@Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
List<SysUserVo> selectBaseUserList(@Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询用户列表
|
* 根据条件分页查询用户列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -221,4 +221,12 @@ public interface ISysUserService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
List<SysUserVo> selectUserListByDept(String deptId);
|
List<SysUserVo> selectUserListByDept(String deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过部门id查询当前部门所有用户(非领导 不是局领导角色用户)
|
||||||
|
*
|
||||||
|
* @param deptId 部门id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<SysUserVo> selectUserListNotLeaderByDept(String deptId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据权限 实现
|
* 数据权限 实现
|
||||||
|
|
@ -50,6 +51,7 @@ public class SysDataScopeServiceImpl implements ISysDataScopeService {
|
||||||
.eq(SysRoleDept::getRoleId, roleId));
|
.eq(SysRoleDept::getRoleId, roleId));
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
return StreamUtils.join(list, rd -> Convert.toStr(rd.getDeptId()));
|
return StreamUtils.join(list, rd -> Convert.toStr(rd.getDeptId()));
|
||||||
|
|
||||||
}
|
}
|
||||||
return "-1";
|
return "-1";
|
||||||
}
|
}
|
||||||
|
|
@ -69,10 +71,15 @@ public class SysDataScopeServiceImpl implements ISysDataScopeService {
|
||||||
List<SysDept> deptList = deptMapper.selectListByParentId(deptId);
|
List<SysDept> deptList = deptMapper.selectListByParentId(deptId);
|
||||||
List<String> ids = StreamUtils.toList(deptList, SysDept::getDeptId);
|
List<String> ids = StreamUtils.toList(deptList, SysDept::getDeptId);
|
||||||
ids.add(deptId);
|
ids.add(deptId);
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(ids)) {
|
if (CollUtil.isNotEmpty(ids)) {
|
||||||
return StreamUtils.join(ids, Convert::toStr);
|
String collect = ids.stream()
|
||||||
|
.map(item -> "'" + item + "'")
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
return collect;
|
||||||
}
|
}
|
||||||
return "-1";
|
return "-1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -364,7 +364,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
||||||
*/
|
*/
|
||||||
private void updateParentDeptStatusNormal(SysDept dept) {
|
private void updateParentDeptStatusNormal(SysDept dept) {
|
||||||
String ancestors = dept.getAncestors();
|
String ancestors = dept.getAncestors();
|
||||||
Long[] deptIds = Convert.toLongArray(ancestors);
|
String[] deptIds = Convert.toStrArray(ancestors);
|
||||||
baseMapper.update(null, new LambdaUpdateWrapper<SysDept>()
|
baseMapper.update(null, new LambdaUpdateWrapper<SysDept>()
|
||||||
.set(SysDept::getStatus, SystemConstants.NORMAL)
|
.set(SysDept::getStatus, SystemConstants.NORMAL)
|
||||||
.in(SysDept::getDeptId, Arrays.asList(deptIds)));
|
.in(SysDept::getDeptId, Arrays.asList(deptIds)));
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,9 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||||
}
|
}
|
||||||
w.in("u.dept_id", ids);
|
w.in("u.dept_id", ids);
|
||||||
})
|
})
|
||||||
.orderByAsc("u.user_id");
|
.orderByAsc("u.dept_id")
|
||||||
List<SysUserVo> list = baseMapper.selectUserList(wrapper);
|
.orderByAsc("u.order_num");
|
||||||
|
List<SysUserVo> list = baseMapper.selectBaseUserList(wrapper);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,7 +124,8 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||||
}
|
}
|
||||||
w.in("u.dept_id", ids);
|
w.in("u.dept_id", ids);
|
||||||
})
|
})
|
||||||
.orderByAsc("u.user_id");
|
.orderByAsc("u.dept_id")
|
||||||
|
.orderByAsc("u.order_num");
|
||||||
if (StringUtils.isNotBlank(user.getExcludeUserIds())) {
|
if (StringUtils.isNotBlank(user.getExcludeUserIds())) {
|
||||||
wrapper.notIn("u.user_id", StringUtils.splitTo(user.getExcludeUserIds(), Convert::toLong));
|
wrapper.notIn("u.user_id", StringUtils.splitTo(user.getExcludeUserIds(), Convert::toLong));
|
||||||
}
|
}
|
||||||
|
|
@ -144,7 +146,8 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||||
.like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName())
|
.like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName())
|
||||||
.eq(StringUtils.isNotBlank(user.getStatus()), "u.status", user.getStatus())
|
.eq(StringUtils.isNotBlank(user.getStatus()), "u.status", user.getStatus())
|
||||||
.like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber())
|
.like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber())
|
||||||
.orderByAsc("u.user_id");
|
.orderByAsc("u.dept_id")
|
||||||
|
.orderByAsc("u.order_num");
|
||||||
Page<SysUserVo> page = baseMapper.selectAllocatedList(pageQuery.build(), wrapper);
|
Page<SysUserVo> page = baseMapper.selectAllocatedList(pageQuery.build(), wrapper);
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +167,8 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||||
.notIn(CollUtil.isNotEmpty(userIds), "u.user_id", userIds)
|
.notIn(CollUtil.isNotEmpty(userIds), "u.user_id", userIds)
|
||||||
.like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName())
|
.like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName())
|
||||||
.like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber())
|
.like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber())
|
||||||
.orderByAsc("u.user_id");
|
.orderByAsc("u.dept_id")
|
||||||
|
.orderByAsc("u.order_num");
|
||||||
Page<SysUserVo> page = baseMapper.selectUnallocatedList(pageQuery.build(), wrapper);
|
Page<SysUserVo> page = baseMapper.selectUnallocatedList(pageQuery.build(), wrapper);
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
|
|
@ -581,10 +585,62 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||||
public List<SysUserVo> selectUserListByDept(String deptId) {
|
public List<SysUserVo> selectUserListByDept(String deptId) {
|
||||||
LambdaQueryWrapper<SysUser> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<SysUser> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(SysUser::getDeptId, deptId);
|
lqw.eq(SysUser::getDeptId, deptId);
|
||||||
lqw.orderByAsc(SysUser::getUserId);
|
lqw.orderByAsc(SysUser::getOrderNum);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(lqw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过部门id查询当前部门所有用户(非领导 不是局领导角色用户)
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 用户信息集合信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysUserVo> selectUserListNotLeaderByDept(String deptId) {
|
||||||
|
|
||||||
|
// 屏蔽局领导角色
|
||||||
|
LambdaQueryWrapper<SysRole> lqwr = Wrappers.lambdaQuery();
|
||||||
|
lqwr.eq(SysRole::getRoleKey, "leader");
|
||||||
|
SysRole role = roleMapper.selectOne(lqwr);
|
||||||
|
|
||||||
|
// SysUserBo userBo = new SysUserBo();
|
||||||
|
// userBo.setDeptId(LoginHelper.getDeptId());
|
||||||
|
// userBo.setRoleId(Helper.FLong(role.getRoleId()));
|
||||||
|
// PageQuery pageQuery = new PageQuery(1000, 1);
|
||||||
|
//
|
||||||
|
// TableDataInfo<SysUserVo> userpage = selectUnallocatedList(userBo, pageQuery);
|
||||||
|
// List<SysUserVo> users = userpage.getRows();
|
||||||
|
|
||||||
|
LambdaQueryWrapper<SysUser> lqw = Wrappers.lambdaQuery();
|
||||||
|
|
||||||
|
List<SysDept> deptList = deptMapper.selectListByParentId(deptId);
|
||||||
|
List<String> ids = StreamUtils.toList(deptList, SysDept::getDeptId);
|
||||||
|
ids.add(deptId);
|
||||||
|
lqw.in(SysUser::getDeptId, ids);
|
||||||
|
|
||||||
|
lqw.orderByAsc(SysUser::getOrderNum);
|
||||||
|
List<SysUserVo> users = baseMapper.selectVoList(lqw);
|
||||||
|
|
||||||
|
List<SysUserVo> result = new ArrayList<>();
|
||||||
|
|
||||||
|
List<Long> roleIds = new ArrayList<>();
|
||||||
|
roleIds.add(1L); // 屏蔽超级管理员
|
||||||
|
if (role!=null && Helper.FInt(role.getRoleId())>0) {
|
||||||
|
roleIds.add(role.getRoleId());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> userIds = selectUserIdsByRoleIds(roleIds);
|
||||||
|
for (SysUserVo user : users) {
|
||||||
|
if (userIds.contains(user.getUserId()))
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
result.add(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户账户
|
* 通过用户ID查询用户账户
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
</if>
|
</if>
|
||||||
<if test="ew.getSqlSelect == null">
|
<if test="ew.getSqlSelect == null">
|
||||||
u.user_id, u.work_dept_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
u.user_id, u.work_dept_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
|
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.order_num
|
||||||
</if>
|
</if>
|
||||||
from sys_user u
|
from sys_user u
|
||||||
${ew.getCustomSqlSegment}
|
${ew.getCustomSqlSegment}
|
||||||
|
|
@ -31,7 +31,21 @@
|
||||||
</if>
|
</if>
|
||||||
<if test="ew.getSqlSelect == null">
|
<if test="ew.getSqlSelect == null">
|
||||||
u.user_id, u.work_dept_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
u.user_id, u.work_dept_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
|
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.order_num
|
||||||
|
</if>
|
||||||
|
from sys_user u
|
||||||
|
${ew.getCustomSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectBaseUserList" resultMap="SysUserResult">
|
||||||
|
select
|
||||||
|
<if test="ew.getSqlSelect != null">
|
||||||
|
${ew.getSqlSelect}
|
||||||
|
</if>
|
||||||
|
<if test="ew.getSqlSelect == null">
|
||||||
|
u.user_id, u.work_dept_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||||
|
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.order_num
|
||||||
</if>
|
</if>
|
||||||
from sys_user u
|
from sys_user u
|
||||||
${ew.getCustomSqlSegment}
|
${ew.getCustomSqlSegment}
|
||||||
|
|
@ -39,7 +53,7 @@
|
||||||
|
|
||||||
<select id="selectUserExportList" resultMap="SysUserExportResult">
|
<select id="selectUserExportList" resultMap="SysUserExportResult">
|
||||||
select u.user_id, u.work_dept_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
select u.user_id, u.work_dept_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.order_num,
|
||||||
d.dept_name, d.leader, wd.dept_name work_dept_name, u1.user_name as leaderName
|
d.dept_name, d.leader, wd.dept_name work_dept_name, u1.user_name as leaderName
|
||||||
from sys_user u
|
from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
|
|
@ -49,7 +63,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllocatedList" resultMap="SysUserResult">
|
<select id="selectAllocatedList" resultMap="SysUserResult">
|
||||||
select distinct u.work_dept_id, u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
select distinct u.work_dept_id, u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time, u.order_num
|
||||||
from sys_user u
|
from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
left join sys_user_role sur on u.user_id = sur.user_id
|
left join sys_user_role sur on u.user_id = sur.user_id
|
||||||
|
|
@ -58,7 +72,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUnallocatedList" resultMap="SysUserResult">
|
<select id="selectUnallocatedList" resultMap="SysUserResult">
|
||||||
select distinct u.user_id, u.work_dept_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
select distinct u.user_id, u.work_dept_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time, u.order_num
|
||||||
from sys_user u
|
from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
left join sys_user_role sur on u.user_id = sur.user_id
|
left join sys_user_role sur on u.user_id = sur.user_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue