测试问题项修改
This commit is contained in:
parent
43e0624cda
commit
9eda3aa948
|
|
@ -58,25 +58,12 @@ public class TokenController {
|
||||||
//web端登录
|
//web端登录
|
||||||
@PostMapping("login")
|
@PostMapping("login")
|
||||||
public R<?> login(@RequestBody LoginBody form) throws Exception {
|
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(), form.getPassword());
|
||||||
String uuid = form.getUuid();
|
if (userInfo != null) {
|
||||||
String captcha = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid).toString();
|
userInfo.setLoginMethod("mobile");
|
||||||
if (StringUtils.isBlank(captcha)) {
|
|
||||||
// 删除验证码缓存
|
|
||||||
redisService.deleteObject(CacheConstants.CAPTCHA_CODE_KEY + uuid);
|
|
||||||
return R.fail("验证码超时,请重新刷新");
|
|
||||||
}
|
|
||||||
if (form.getCode() != null && form.getCode().equals(captcha)) {
|
|
||||||
// 删除验证码缓存
|
|
||||||
redisService.deleteObject(CacheConstants.CAPTCHA_CODE_KEY + uuid);
|
|
||||||
// 获取登录token
|
|
||||||
return R.ok(tokenService.createToken(userInfo));
|
return R.ok(tokenService.createToken(userInfo));
|
||||||
} else {
|
} else {
|
||||||
// 删除验证码缓存
|
return R.fail("登录信息为空,请重试");
|
||||||
redisService.deleteObject(CacheConstants.CAPTCHA_CODE_KEY + uuid);
|
|
||||||
return R.fail("验证码错误");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,7 @@ public class TmTaskController extends BaseController {
|
||||||
leaseApplyInfo.setCompanyId(leaseApplyDetailsList.get(0).getCompanyId()); // 设置设备所属分公司,用于交给哪家审核
|
leaseApplyInfo.setCompanyId(leaseApplyDetailsList.get(0).getCompanyId()); // 设置设备所属分公司,用于交给哪家审核
|
||||||
leaseApplyInfo.setType("2"); // 设置审批层级,先固定2层,后期根据接口传入Type区分来源设定
|
leaseApplyInfo.setType("2"); // 设置审批层级,先固定2层,后期根据接口传入Type区分来源设定
|
||||||
leaseApplyInfo.setLeaseType(task.getLeaseType());
|
leaseApplyInfo.setLeaseType(task.getLeaseType());
|
||||||
|
leaseApplyInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||||
leaseApplyInfo.setEstimateLeaseTime(task.getEstimateLeaseTime());
|
leaseApplyInfo.setEstimateLeaseTime(task.getEstimateLeaseTime());
|
||||||
|
|
||||||
// 创建领料任务,返回领料任务编号
|
// 创建领料任务,返回领料任务编号
|
||||||
|
|
|
||||||
|
|
@ -618,25 +618,34 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
List<TmTask> tmTaskList = new ArrayList<>();
|
List<TmTask> tmTaskList = new ArrayList<>();
|
||||||
if (roles.contains("admin")) {
|
if (roles.contains("admin")) {
|
||||||
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
||||||
} else if (roles.contains("fgs") && roles.contains("sgb")) {
|
} else if (roles.contains("em01") || roles.contains("em02")) { //机具经理、机具副经理
|
||||||
record.setCompanyId(101);
|
record.setDeptId(101L);
|
||||||
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
||||||
} else if (roles.contains("fgs") && (roles.contains("em01") || roles.contains("em02"))) { //机具书记/副经理内部审批权限
|
} else if (roles.contains("sgb")) { //施管部经理
|
||||||
record.setCompanyId(101);
|
record.setDeptId(210L);
|
||||||
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
||||||
} else if (roles.contains("fgs")){
|
} 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);
|
record.setDeptId(deptId);
|
||||||
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
||||||
|
|
||||||
}
|
}
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
|
||||||
for (TmTask tmTask : tmTaskList) {
|
for (TmTask tmTask : tmTaskList) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (tmTask != null) {
|
if (tmTask != null) {
|
||||||
|
tmTask.setDeptId(deptId);
|
||||||
// 去查询任务分单表
|
// 去查询任务分单表
|
||||||
List<LeaseApplyInfo> collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
|
List<LeaseApplyInfo> collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
|
||||||
//没有companyId的用户或者是分公司账号可以看到所有数据
|
//管理员可以看到所有数据
|
||||||
if (companyId == null || roles.contains("fgs")) {
|
if (roles.contains("admin")) {
|
||||||
// 对领料任务集合查询具体详情
|
// 对领料任务集合查询具体详情
|
||||||
for (LeaseApplyInfo leaseApplyInfo : collect) {
|
for (LeaseApplyInfo leaseApplyInfo : collect) {
|
||||||
if (leaseApplyInfo != null) {
|
if (leaseApplyInfo != null) {
|
||||||
|
|
@ -657,9 +666,7 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (roles.contains("em01") || roles.contains("em02") || roles.contains("sgb")) {
|
||||||
//施管部只能看到机具分公司(101)的数据
|
|
||||||
if (roles.contains("jjfgs") || roles.contains("sgb") || deptId == 101) {
|
|
||||||
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
|
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
|
||||||
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
||||||
// 对领料任务集合查询具体详情
|
// 对领料任务集合查询具体详情
|
||||||
|
|
@ -683,9 +690,7 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (roles.contains("dm01") || roles.contains("dm04") || roles.contains("dm02")) {
|
||||||
//安监部只能看到设备分公司(102)的数据
|
|
||||||
if (roles.contains("tsfgs") || roles.contains("ajb") || deptId == 102) {
|
|
||||||
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
|
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
|
||||||
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
||||||
// 对领料任务集合查询具体详情
|
// 对领料任务集合查询具体详情
|
||||||
|
|
@ -709,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);
|
tmTask.setPreCountNum(count);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue