材料站功能优化

This commit is contained in:
mashuai 2025-09-13 01:28:58 +08:00
parent 16573aedc9
commit 4bc97b87ac
3 changed files with 34 additions and 11 deletions

View File

@ -73,6 +73,9 @@ public class MaterialConstants {
/** 材料站退料单号的开头字母 */
public static final String BACK_MATERIAL_TASK_TYPE_LABEL = "MT";
/** 材料站预约退料单号的开头字母 */
public static final String BACK_MATERIAL_APPOINT_TASK_TYPE_LABEL = "YT";
/** 维修单号的开头字母 */
public static final String REPAIR_TASK_TYPE_LABEL = "WX";

View File

@ -145,18 +145,23 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
String username = SecurityUtils.getLoginUser().getUsername();
// 根据用户名判断用户是否为班组长
BmTeam teamData = materialMachineMapper.getTeamData(username);
if (teamData == null) {
// 根据用户名查询项目部信息
List<String> departId = mapper.getDepartId(username);
// 根据项目部id查询工程信息
List<String> projectIdList = mapper.getProjectId(departId);
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
bean.setProjectIdList(projectIdList);
Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
// 检查用户是否具有特殊角色
boolean hasSpecialRole = hasSpecialRole(userRoles);
if (!hasSpecialRole) {
if (teamData == null) {
// 根据用户名查询项目部信息
List<String> departId = mapper.getDepartId(username);
// 根据项目部id查询工程信息
List<String> projectIdList = mapper.getProjectId(departId);
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
bean.setProjectIdList(projectIdList);
}
}
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if (deptId != null) {
bean.setImpUnit(deptId.toString());
}
}
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if (deptId != null) {
bean.setImpUnit(deptId.toString());
}
// 查询目前在用的设备信息
List<MaterialRetainedEquipmentInfo> usList = materialMachineMapper.getUsInfoList(bean);

View File

@ -1022,6 +1022,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="departName != null and departName != ''">
AND bp.pro_center = #{departName}
</if>
<if test="impUnit != null and impUnit != ''">
and bp.imp_unit = #{impUnit}
</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>
</select>
<select id="selectTeamNum" resultType="java.lang.Integer">
@ -1038,6 +1047,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="proName != null and proName != ''">
AND bz.project_name = #{proName}
</if>
<if test="projectIdList != null and projectIdList.size() > 0">
and bz.project_id in
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="teamName != null and teamName != ''">
AND bz.bzmc = #{teamName}
</if>