测试问题项修改
This commit is contained in:
parent
5740d5841d
commit
e314a4c4b1
|
|
@ -615,11 +615,6 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
public List<TmTask> getLeaseAuditManageList(TmTask record) {
|
public List<TmTask> getLeaseAuditManageList(TmTask record) {
|
||||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
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);
|
List<TmTask> tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
||||||
|
|
||||||
for (TmTask tmTask : tmTaskList) {
|
for (TmTask tmTask : tmTaskList) {
|
||||||
|
|
@ -629,8 +624,30 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
List<LeaseApplyInfo> collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
|
List<LeaseApplyInfo> collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
|
||||||
if (collect.size() > 0) {
|
if (collect.size() > 0) {
|
||||||
int deptId1 = tmTaskMapper.getDeptId(collect.get(0).getCreateBy());
|
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());
|
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
|
||||||
if (deptId1 == 101) {
|
if (deptId1 == 101) {
|
||||||
List<LeaseApplyInfo> applyInfoList = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
|
List<LeaseApplyInfo> applyInfoList = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
|
||||||
|
|
@ -661,9 +678,9 @@ 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());
|
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
|
||||||
if (deptId1 == 102){
|
if (deptId1 == 102) {
|
||||||
List<LeaseApplyInfo> list2 = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
|
List<LeaseApplyInfo> list2 = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
|
||||||
auditListByLeaseInfo.addAll(list2);
|
auditListByLeaseInfo.addAll(list2);
|
||||||
}
|
}
|
||||||
|
|
@ -692,7 +709,7 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//其他各分公司可以看到的数据权限
|
//其他各分公司可以看到的数据权限
|
||||||
if (deptId == deptId1) {
|
else if (deptId == deptId1) {
|
||||||
// 对领料任务集合查询具体详情
|
// 对领料任务集合查询具体详情
|
||||||
for (LeaseApplyInfo leaseApplyInfo : collect) {
|
for (LeaseApplyInfo leaseApplyInfo : collect) {
|
||||||
if (leaseApplyInfo != null) {
|
if (leaseApplyInfo != null) {
|
||||||
|
|
@ -713,70 +730,37 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (roles.contains("sgb")) {
|
||||||
}
|
|
||||||
}
|
|
||||||
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")) {
|
|
||||||
// 对领料任务集合查询具体详情
|
|
||||||
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
|
|
||||||
if (deptId1 == 210) {
|
|
||||||
List<LeaseApplyInfo> list1 = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
|
|
||||||
auditListByLeaseInfo.addAll(list1);
|
|
||||||
}
|
|
||||||
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
|
||||||
// 对领料任务集合查询具体详情
|
// 对领料任务集合查询具体详情
|
||||||
for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 101).collect(Collectors.toList());
|
||||||
if (leaseApplyInfo != null) {
|
if (deptId1 == 210) {
|
||||||
// 去查询领料任务详情表
|
List<LeaseApplyInfo> list1 = collect.stream().filter(t -> t.getCompanyId() != null).filter(t -> t.getCompanyId() == 102).collect(Collectors.toList());
|
||||||
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyManageDetails(leaseApplyInfo);
|
auditListByLeaseInfo.addAll(list1);
|
||||||
if (leaseApplyDetails.size() > 0) {
|
}
|
||||||
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
|
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
||||||
if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
|
// 对领料任务集合查询具体详情
|
||||||
// 统计预领数量
|
for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
||||||
count += leaseApplyDetail.getPreNum();
|
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(auditListByLeaseInfo);
|
||||||
|
tmTask.setRemark(collect.get(0).getRemark());
|
||||||
}
|
}
|
||||||
// 塞入领料任务详情的集合中
|
|
||||||
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
|
|
||||||
// 存入领料任务实体集合
|
|
||||||
tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
|
|
||||||
tmTask.setRemark(collect.get(0).getRemark());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
tmTask.setPreCountNum(count);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue