材料站功能优化

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_TASK_TYPE_LABEL = "MT";
/** 材料站预约退料单号的开头字母 */
public static final String BACK_MATERIAL_APPOINT_TASK_TYPE_LABEL = "YT";
/** 维修单号的开头字母 */ /** 维修单号的开头字母 */
public static final String REPAIR_TASK_TYPE_LABEL = "WX"; 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(); String username = SecurityUtils.getLoginUser().getUsername();
// 根据用户名判断用户是否为班组长 // 根据用户名判断用户是否为班组长
BmTeam teamData = materialMachineMapper.getTeamData(username); BmTeam teamData = materialMachineMapper.getTeamData(username);
if (teamData == null) { Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
// 根据用户名查询项目部信息 // 检查用户是否具有特殊角色
List<String> departId = mapper.getDepartId(username); boolean hasSpecialRole = hasSpecialRole(userRoles);
// 根据项目部id查询工程信息 if (!hasSpecialRole) {
List<String> projectIdList = mapper.getProjectId(departId); if (teamData == null) {
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) { // 根据用户名查询项目部信息
bean.setProjectIdList(projectIdList); 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); 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 != ''"> <if test="departName != null and departName != ''">
AND bp.pro_center = #{departName} AND bp.pro_center = #{departName}
</if> </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>
<select id="selectTeamNum" resultType="java.lang.Integer"> <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 != ''"> <if test="proName != null and proName != ''">
AND bz.project_name = #{proName} AND bz.project_name = #{proName}
</if> </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 != ''"> <if test="teamName != null and teamName != ''">
AND bz.bzmc = #{teamName} AND bz.bzmc = #{teamName}
</if> </if>