测试问题项修改

This commit is contained in:
csyue 2024-05-29 13:06:56 +08:00
parent 5740d5841d
commit e314a4c4b1
1 changed files with 49 additions and 65 deletions

View File

@ -615,11 +615,6 @@ public class TmTaskServiceImpl implements TmTaskService {
public List<TmTask> getLeaseAuditManageList(TmTask record) {
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
List<TmTask> list = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
if (deptId == 101 || deptId == 102) {
record.setCompanyId(deptId.intValue());
}
List<TmTask> tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
for (TmTask tmTask : tmTaskList) {
@ -629,8 +624,30 @@ public class TmTaskServiceImpl implements TmTaskService {
List<LeaseApplyInfo> collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
if (collect.size() > 0) {
int deptId1 = tmTaskMapper.getDeptId(collect.get(0).getCreateBy());
if (roles.contains("admin")) {
// 对领料任务集合查询具体详情
for (LeaseApplyInfo leaseApplyInfo : collect) {
if (leaseApplyInfo != null) {
// 去查询领料任务详情表
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyManageDetails(leaseApplyInfo);
if (leaseApplyDetails.size() > 0) {
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
// 统计预领数量
count += leaseApplyDetail.getPreNum();
}
}
// 塞入领料任务详情的集合中
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
// 存入领料任务实体集合
tmTask.setLeaseApplyInfoList(collect);
tmTask.setRemark(collect.get(0).getRemark());
}
}
}
}
//机具经理书记副经理查看数据
if (deptId == 101) {
else if (deptId == 101) {
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
if (deptId1 == 101) {
List<LeaseApplyInfo> applyInfoList = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
@ -661,7 +678,7 @@ public class TmTaskServiceImpl implements TmTaskService {
}
}
// 调试公司可以看到的数据权限
if (deptId == 102) {
else if (deptId == 102) {
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
if (deptId1 == 102) {
List<LeaseApplyInfo> list2 = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
@ -692,7 +709,7 @@ public class TmTaskServiceImpl implements TmTaskService {
}
}
//其他各分公司可以看到的数据权限
if (deptId == deptId1) {
else if (deptId == deptId1) {
// 对领料任务集合查询具体详情
for (LeaseApplyInfo leaseApplyInfo : collect) {
if (leaseApplyInfo != null) {
@ -713,19 +730,7 @@ public class TmTaskServiceImpl implements TmTaskService {
}
}
}
}
}
}
tmTask.setPreCountNum(count);
}
for (TmTask tmTask : list) {
int count = 0;
if (tmTask != null) {
// 去查询任务分单表
List<LeaseApplyInfo> collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
int deptId1 = tmTaskMapper.getDeptId(collect.get(0).getCreateBy());
if (roles.contains("sgb")) {
} else if (roles.contains("sgb")) {
// 对领料任务集合查询具体详情
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
if (deptId1 == 210) {
@ -756,27 +761,6 @@ public class TmTaskServiceImpl implements TmTaskService {
}
}
if (roles.contains("admin")) {
// 对领料任务集合查询具体详情
for (LeaseApplyInfo leaseApplyInfo : collect) {
if (leaseApplyInfo != null) {
// 去查询领料任务详情表
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyManageDetails(leaseApplyInfo);
if (leaseApplyDetails.size() > 0) {
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
// 统计预领数量
count += leaseApplyDetail.getPreNum();
}
}
// 塞入领料任务详情的集合中
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
// 存入领料任务实体集合
tmTask.setLeaseApplyInfoList(collect);
tmTask.setRemark(collect.get(0).getRemark());
}
}
}
}
}
tmTask.setPreCountNum(count);