材料员功能优化
This commit is contained in:
parent
5e7dcea2d2
commit
e194a430fe
|
|
@ -604,7 +604,6 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
public List<MaterialRetainedTeamTotalVo> getTeamNumList(MaterialRetainedEquipmentInfo bean) {
|
public List<MaterialRetainedTeamTotalVo> getTeamNumList(MaterialRetainedEquipmentInfo bean) {
|
||||||
String username = SecurityUtils.getLoginUser().getUsername();
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
|
Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
|
||||||
List<IwsTeamUserVo> iwsTeamUserVos = new ArrayList<>();
|
|
||||||
BmTeam teamData = new BmTeam();
|
BmTeam teamData = new BmTeam();
|
||||||
// 检查用户是否具有特殊角色
|
// 检查用户是否具有特殊角色
|
||||||
boolean hasSpecialRole = hasSpecialRole(userRoles);
|
boolean hasSpecialRole = hasSpecialRole(userRoles);
|
||||||
|
|
@ -614,46 +613,24 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
if (teamData == null) {
|
if (teamData == null) {
|
||||||
// 根据用户名查询项目部信息
|
// 根据用户名查询项目部信息
|
||||||
List<String> departId = mapper.getDepartId(username);
|
List<String> departId = mapper.getDepartId(username);
|
||||||
// 根据项目部id查询工程信息
|
if (CollectionUtil.isNotEmpty(departId)) {
|
||||||
List<String> projectIdList = mapper.getAllProjectList(departId);
|
// 根据项目部id查询工程信息
|
||||||
List<BmProject> list = mapper.getProjectInfo(new BmProject());
|
List<String> projectIdList = mapper.getAllProjectList(departId);
|
||||||
if (CollectionUtils.isNotEmpty(list) && CollectionUtils.isNotEmpty(projectIdList)) {
|
if (CollectionUtil.isNotEmpty(projectIdList)) {
|
||||||
// 找出list中projectId与projectIdList中相同的数据
|
bean.setProjectIdList(projectIdList);
|
||||||
list = list.stream().filter(info -> projectIdList.contains(info.getProjectId())).collect(Collectors.toList());
|
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
|
||||||
// 获取list中的projectId
|
|
||||||
List<String> collect = list.stream().map(BmProject::getProjectId).distinct().collect(Collectors.toList());
|
|
||||||
// 根据i8工程id查询班组信息
|
|
||||||
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(collect);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<MaterialRetainedTeamTotalVo> teamNumList = materialMachineMapper.getTeamNumList(bean);
|
List<MaterialRetainedTeamTotalVo> teamNumList = materialMachineMapper.getTeamNumList(bean);
|
||||||
// for (MaterialRetainedTeamTotalVo materialRetainedEquipmentInfo : teamNumList) {
|
|
||||||
// // 根据班组名称查询分包单位
|
|
||||||
// String subUnitName = iwsTeamUserMapper.getTeamName(materialRetainedEquipmentInfo.getTeamName());
|
|
||||||
// materialRetainedEquipmentInfo.setSubUnitName(subUnitName);
|
|
||||||
// }
|
|
||||||
// if(bean.getSubUnitName()!=null && !bean.getSubUnitName().equals("") && !teamNumList.isEmpty()){
|
|
||||||
// // 根据传入的SubUnitName过滤列表
|
|
||||||
// teamNumList = teamNumList.stream()
|
|
||||||
// .filter(item -> StringUtils.equals(item.getSubUnitName(), bean.getSubUnitName()))
|
|
||||||
// .collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
if (!hasSpecialRole) {
|
if (!hasSpecialRole) {
|
||||||
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
|
if (teamData == null) {
|
||||||
if (CollectionUtil.isNotEmpty(teamNumList)) {
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
// 筛选出teamNumList中班组名称和iwsTeamUserVos中班组名称相同的数据
|
if (deptId != null) {
|
||||||
List<IwsTeamUserVo> finalIwsTeamUserVos = iwsTeamUserVos;
|
// 删除元素
|
||||||
teamNumList = teamNumList.stream().filter(item -> finalIwsTeamUserVos.stream().anyMatch(info -> info.getTeamName().equals(item.getTeamName()))).collect(Collectors.toList());
|
teamNumList.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
|
||||||
if (deptId != null) {
|
|
||||||
// 删除元素
|
|
||||||
teamNumList.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
|
||||||
}
|
|
||||||
if (teamData != null) {
|
if (teamData != null) {
|
||||||
return teamNumList.stream().filter(item -> {
|
return teamNumList.stream().filter(item -> {
|
||||||
return StringUtils.isNotBlank(item.getIdCard()) && item.getIdCard().equals(username);
|
return StringUtils.isNotBlank(item.getIdCard()) && item.getIdCard().equals(username);
|
||||||
|
|
@ -663,50 +640,6 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
return teamNumList;
|
return teamNumList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// public List<MaterialRetainedTeamTotalVo> getTeamNumList(MaterialRetainedEquipmentInfo bean) {
|
|
||||||
// String username = SecurityUtils.getLoginUser().getUsername();
|
|
||||||
// // 根据用户名查询项目部信息
|
|
||||||
// List<String> departId = mapper.getDepartId(username);
|
|
||||||
// // 根据项目部id查询工程信息
|
|
||||||
// List<MaterialRetainedTeamTotalVo> teamNumList = materialMachineMapper.getTeamNumList(bean);
|
|
||||||
// if (!CollectionUtils.isEmpty(departId)) {
|
|
||||||
// List<String> projectIdList = mapper.getProjectId(departId);
|
|
||||||
// List<BmProject> list = mapper.getProjectInfo(new BmProject());
|
|
||||||
// if (CollectionUtils.isNotEmpty(list) && CollectionUtils.isNotEmpty(projectIdList)) {
|
|
||||||
// // 找出list中projectId与projectIdList中相同的数据
|
|
||||||
// list = list.stream().filter(info -> projectIdList.contains(info.getProjectId())).collect(Collectors.toList());
|
|
||||||
// if (CollectionUtils.isNotEmpty(list)) {
|
|
||||||
// // 获取list中的projectId
|
|
||||||
// List<String> collect = list.stream().map(BmProject::getProjectId).distinct().collect(Collectors.toList());
|
|
||||||
// // 根据i8工程id查询班组信息
|
|
||||||
// List<IwsTeamUserVo> iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(collect);
|
|
||||||
// if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
|
|
||||||
// if (CollectionUtil.isNotEmpty(teamNumList)) {
|
|
||||||
// // 筛选出teamNumList中班组名称和iwsTeamUserVos中班组名称相同的数据
|
|
||||||
// teamNumList = teamNumList.stream().filter(item -> iwsTeamUserVos.stream().anyMatch(info -> info.getTeamName().equals(item.getTeamName()))).collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // 根据用户名判断用户是否为班组长
|
|
||||||
// BmTeam teamData = materialMachineMapper.getTeamData(username);
|
|
||||||
// Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
|
||||||
// if (CollectionUtils.isNotEmpty(teamNumList)) {
|
|
||||||
// if (deptId != null) {
|
|
||||||
// // 删除元素
|
|
||||||
// teamNumList.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
|
||||||
// }
|
|
||||||
// if (teamData != null) {
|
|
||||||
// return teamNumList.stream().filter(item -> {
|
|
||||||
// return StringUtils.isNotBlank(item.getIdCard()) && item.getIdCard().equals(username);
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return teamNumList;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 后台班组在用库存查询二级页面
|
* 后台班组在用库存查询二级页面
|
||||||
* @param bean
|
* @param bean
|
||||||
|
|
|
||||||
|
|
@ -873,6 +873,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="teamName != null and teamName != ''">
|
<if test="teamName != null and teamName != ''">
|
||||||
and bu.unit_name LIKE CONCAT('%', #{teamName}, '%')
|
and bu.unit_name LIKE CONCAT('%', #{teamName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||||
|
and bp.external_id in
|
||||||
|
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
bu.unit_id,
|
bu.unit_id,
|
||||||
bp.pro_id
|
bp.pro_id
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
update sys_workflow_record set workflow_id = #{workflowId} where id = #{id}
|
update sys_workflow_record set workflow_id = #{workflowId} where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
<delete id="deleteSysWorkflowRecord">
|
<delete id="deleteSysWorkflowRecord">
|
||||||
delete from sys_workflow_record where task_id = #{taskId}
|
delete from sys_workflow_record where task_type = '25' AND task_id = #{taskId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="getSysWorkflowRecodeByTaskId" parameterType="Integer" resultType="com.bonus.material.work.domain.dto.SysWorkflowAuditDto">
|
<select id="getSysWorkflowRecodeByTaskId" parameterType="Integer" resultType="com.bonus.material.work.domain.dto.SysWorkflowAuditDto">
|
||||||
|
|
@ -142,6 +142,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
task_type as taskType,
|
task_type as taskType,
|
||||||
task_code as taskCode
|
task_code as taskCode
|
||||||
from sys_workflow_record
|
from sys_workflow_record
|
||||||
where task_id = #{id}
|
where task_type = '25' AND task_id = #{id}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue