测试问题项修改
This commit is contained in:
parent
fd998f1b41
commit
587ffc6eab
|
|
@ -142,4 +142,6 @@ public interface TmTaskMapper {
|
||||||
int updateLeaseApplyInfoRejectInfoCq(@Param("record") LeaseApplyInfo leaseApplyInfo);
|
int updateLeaseApplyInfoRejectInfoCq(@Param("record") LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
int updateLeaseApplyInfoAuditInfoCq(@Param("record") LeaseApplyInfo leaseApplyInfo);
|
int updateLeaseApplyInfoAuditInfoCq(@Param("record") LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
|
int getDeptId(String createBy);
|
||||||
}
|
}
|
||||||
|
|
@ -615,37 +615,16 @@ 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> tmTaskList = new ArrayList<>();
|
List<LeaseApplyInfo> collect;
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (TmTask tmTask : tmTaskList) {
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (tmTask != null) {
|
List<LeaseApplyInfo> leaseApplyInfoList = new ArrayList<>();
|
||||||
tmTask.setDeptId(deptId);
|
List<TmTask> tmTaskList = tmTaskMapper.getAuditManageListByLeaseTmTask(record);
|
||||||
// 去查询任务分单表
|
|
||||||
List<LeaseApplyInfo> collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
|
|
||||||
//管理员可以看到所有数据
|
|
||||||
if (roles.contains("admin")) {
|
if (roles.contains("admin")) {
|
||||||
|
for (TmTask tmTask : tmTaskList) {
|
||||||
|
if (tmTask != null) {
|
||||||
|
// 去查询任务分单表
|
||||||
|
collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
|
||||||
|
record.setDeptId(null);
|
||||||
// 对领料任务集合查询具体详情
|
// 对领料任务集合查询具体详情
|
||||||
for (LeaseApplyInfo leaseApplyInfo : collect) {
|
for (LeaseApplyInfo leaseApplyInfo : collect) {
|
||||||
if (leaseApplyInfo != null) {
|
if (leaseApplyInfo != null) {
|
||||||
|
|
@ -666,11 +645,35 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} 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()) {
|
tmTask.setPreCountNum(count);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
for (TmTask tmTask : tmTaskList) {
|
||||||
|
collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
|
||||||
|
for (LeaseApplyInfo leaseApplyInfo : collect) {
|
||||||
|
String createBy = leaseApplyInfo.getCreateBy();
|
||||||
|
// 查询当前领料人所属部门
|
||||||
|
int deptId1 = tmTaskMapper.getDeptId(createBy);
|
||||||
|
if ((deptId == 101 && leaseApplyInfo.getCompanyId() == 101) || (deptId1 == deptId && deptId1 == 101)) {
|
||||||
|
leaseApplyInfoList.add(leaseApplyInfo);
|
||||||
|
}
|
||||||
|
if ((deptId == 102 && leaseApplyInfo.getCompanyId() == 102) || (deptId1 == deptId && deptId1 == 102)) {
|
||||||
|
leaseApplyInfoList.add(leaseApplyInfo);
|
||||||
|
}
|
||||||
|
if ((roles.contains("sgb") && leaseApplyInfo.getCompanyId() == 101) || (deptId1 == 210)) {
|
||||||
|
leaseApplyInfoList.add(leaseApplyInfo);
|
||||||
|
}
|
||||||
|
if (roles.contains("fgs") && (deptId == deptId1)) {
|
||||||
|
leaseApplyInfoList.add(leaseApplyInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leaseApplyInfoList != null && !leaseApplyInfoList.isEmpty()) {
|
||||||
// 对领料任务集合查询具体详情
|
// 对领料任务集合查询具体详情
|
||||||
for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
for (LeaseApplyInfo leaseApplyInfo : leaseApplyInfoList) {
|
||||||
if (leaseApplyInfo != null) {
|
if (leaseApplyInfo != null) {
|
||||||
// 去查询领料任务详情表
|
// 去查询领料任务详情表
|
||||||
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyManageDetails(leaseApplyInfo);
|
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyManageDetails(leaseApplyInfo);
|
||||||
|
|
@ -684,58 +687,8 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
// 塞入领料任务详情的集合中
|
// 塞入领料任务详情的集合中
|
||||||
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
|
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
|
||||||
// 存入领料任务实体集合
|
// 存入领料任务实体集合
|
||||||
tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
|
tmTask.setLeaseApplyInfoList(leaseApplyInfoList);
|
||||||
tmTask.setRemark(collect.get(0).getRemark());
|
tmTask.setRemark(leaseApplyInfoList.get(0).getRemark());
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} 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()) {
|
|
||||||
// 对领料任务集合查询具体详情
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} 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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1152,4 +1152,7 @@
|
||||||
AND task_type = #{taskType}
|
AND task_type = #{taskType}
|
||||||
ORDER BY create_time DESC LIMIT 1
|
ORDER BY create_time DESC LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getDeptId" resultType="java.lang.Integer">
|
||||||
|
select dept_id from sys_user where user_id = #{createBy}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue