Compare commits

...

10 Commits

Author SHA1 Message Date
csyue 84d718b9bc Merge remote-tracking branch 'origin/dev-nx' into dev-nx
# Conflicts:
#	sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java
2024-05-28 18:36:05 +08:00
csyue ac4ee525d2 测试问题项修改 2024-05-28 18:31:22 +08:00
csyue 9eda3aa948 测试问题项修改 2024-05-28 18:30:04 +08:00
csyue 43e0624cda 测试问题项修改 2024-05-28 15:50:36 +08:00
csyue fba49bc8ed Merge remote-tracking branch 'origin/dev-nx' into dev-nx 2024-05-28 15:50:29 +08:00
csyue 72751401cf Merge remote-tracking branch 'origin/dev-nx' into dev-nx 2024-05-28 11:41:35 +08:00
csyue 86419027c1 Merge remote-tracking branch 'origin/dev-nx' into dev-nx 2024-05-28 10:38:31 +08:00
csyue 0b37588854 测试问题项修改 2024-05-28 09:43:10 +08:00
csyue 02e4f72d97 Merge remote-tracking branch 'origin/dev-nx' into dev-nx 2024-05-28 09:38:41 +08:00
csyue f766d1ae97 测试问题项修改 2024-05-27 20:45:12 +08:00
5 changed files with 58 additions and 18 deletions

View File

@ -60,7 +60,7 @@ public class TokenController {
public R<?> login(@RequestBody LoginBody form) throws Exception {
//String decryptedData = RsaUtil.decryptByPrivateKey(form.getPassword(), privateKey);
// 用户登录
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
LoginUser userInfo = sysLoginService.login(form.getUsername(), decryptedData);
String uuid = form.getUuid();
String captcha = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid).toString();
if (StringUtils.isBlank(captcha)) {

View File

@ -75,7 +75,7 @@ public class SysLoginService {
if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) {
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在");
throw new ServiceException("登录用户" + username + " 不存在");
throw new ServiceException("用户不存在/密码错误");
}
if (R.FAIL == userResult.getCode()) {

View File

@ -217,6 +217,7 @@ public class TmTaskController extends BaseController {
leaseApplyInfo.setCompanyId(leaseApplyDetailsList.get(0).getCompanyId()); // 设置设备所属分公司,用于交给哪家审核
leaseApplyInfo.setType("2"); // 设置审批层级先固定2层后期根据接口传入Type区分来源设定
leaseApplyInfo.setLeaseType(task.getLeaseType());
leaseApplyInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
leaseApplyInfo.setEstimateLeaseTime(task.getEstimateLeaseTime());
// 创建领料任务返回领料任务编号

View File

@ -442,11 +442,8 @@ public class TmTaskServiceImpl implements TmTaskService {
List<TmTask> tmTaskList;
if (roles.contains(STRING_ADMIN)) {
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(record);
} else if (deptId == 101) {
record.setCompanyId(101);
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(record);
} else if (deptId == 102) {
record.setCompanyId(102);
} else if (deptId != null) {
record.setCompanyId(deptId.intValue());
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(record);
} else {
String username = SecurityUtils.getLoginUser().getUsername();
@ -618,19 +615,37 @@ public class TmTaskServiceImpl implements TmTaskService {
public List<TmTask> getLeaseAuditManageList(TmTask record) {
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if (roles.contains("fgs")) {
List<TmTask> tmTaskList = new ArrayList<>();
if (roles.contains("admin")) {
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
} else if (roles.contains("em01") || roles.contains("em02")) { //机具经理机具副经理
record.setDeptId(101L);
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
} else if (roles.contains("sgb")) { //施管部经理
record.setDeptId(210L);
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
} else if (roles.contains("dm01") || roles.contains("dm04")) { //调试经理调试安全专责
record.setDeptId(102L);
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
} else if (roles.contains("dm02")) { //调试审核员
record.setCompanyId(102);
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
} else if (roles.contains("fgs")) { //各分公司经理
record.setDeptId(deptId);
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
} else { //其他角色只能看到自己部门下的数据
record.setDeptId(deptId);
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
}
List<TmTask> tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
for (TmTask tmTask : tmTaskList) {
int count = 0;
if (tmTask != null) {
tmTask.setDeptId(deptId);
// 去查询任务分单表
List<LeaseApplyInfo> collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
//没有companyId的用户或者是分公司账号可以看到所有数据
if (companyId == null || roles.contains("fgs")) {
//管理员可以看到所有数据
if (roles.contains("admin")) {
// 对领料任务集合查询具体详情
for (LeaseApplyInfo leaseApplyInfo : collect) {
if (leaseApplyInfo != null) {
@ -651,9 +666,7 @@ public class TmTaskServiceImpl implements TmTaskService {
}
}
}
}
//施管部只能看到机具分公司101的数据
if (roles.contains("jjfgs") || roles.contains("sgb") || deptId == 101) {
} else if (roles.contains("em01") || roles.contains("em02") || roles.contains("sgb")) {
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
// 对领料任务集合查询具体详情
@ -677,9 +690,7 @@ public class TmTaskServiceImpl implements TmTaskService {
}
}
}
}
//安监部只能看到设备分公司102的数据
if (roles.contains("tsfgs") || roles.contains("ajb") || deptId == 102) {
} else if (roles.contains("dm01") || roles.contains("dm04") || roles.contains("dm02")) {
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
// 对领料任务集合查询具体详情
@ -703,6 +714,31 @@ public class TmTaskServiceImpl implements TmTaskService {
}
}
}
} else {
//其他部门人只能看到自己部门下的数据
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCreateBy().equals(deptId.toString())).collect(Collectors.toList());
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
// 对领料任务集合查询具体详情
for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
if (leaseApplyInfo != null) {
// 去查询领料任务详情表
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyManageDetails(leaseApplyInfo);
if (leaseApplyDetails.size() > 0) {
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
if (leaseApplyDetail != null) {
// 统计预领数量
count += leaseApplyDetail.getPreNum();
}
}
// 塞入领料任务详情的集合中
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
// 存入领料任务实体集合
tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
tmTask.setRemark(collect.get(0).getRemark());
}
}
}
}
}
// 塞入预领的合计数量
tmTask.setPreCountNum(count);

View File

@ -561,6 +561,9 @@
<if test="record.deptId != null and record.deptId != '' ">
AND su.dept_id = #{record.deptId}
</if>
<if test="record.companyId != null ">
AND lai.company_id = #{record.companyId}
</if>
<if test="record.taskId != null and record.taskId != '' ">
AND tt.task_id = #{record.taskId}
</if>