材料员优化

This commit is contained in:
mashuai 2025-09-24 18:36:06 +08:00
parent 44fc28a2e3
commit b7179fae41
2 changed files with 22 additions and 0 deletions

View File

@ -50,6 +50,7 @@ public class SelectServiceImpl implements SelectService {
*/ */
@Override @Override
public AjaxResult getUnitList(BmUnit bmUnit) { public AjaxResult getUnitList(BmUnit bmUnit) {
Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
// 性能监控开始 // 性能监控开始
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
Map<String, Long> stepTimes = new LinkedHashMap<>(); Map<String, Long> stepTimes = new LinkedHashMap<>();
@ -72,6 +73,12 @@ public class SelectServiceImpl implements SelectService {
if (Objects.nonNull(bmUnit) && Objects.nonNull(bmUnit.getEnableFilter()) && bmUnit.getEnableFilter()) { if (Objects.nonNull(bmUnit) && Objects.nonNull(bmUnit.getEnableFilter()) && bmUnit.getEnableFilter()) {
bmUnit.setDeptId(thisLoginUserDeptId); bmUnit.setDeptId(thisLoginUserDeptId);
} }
if (CollectionUtils.isNotEmpty(userRoles)) {
// 技术员只查询项目部类型的单位,固定传值36项目部类型
if (userRoles.contains("jsy")) {
bmUnit.setTypeId(36L);
}
}
stepTimes.put("过滤判断", System.currentTimeMillis() - step2Start); stepTimes.put("过滤判断", System.currentTimeMillis() - step2Start);
// 步骤3: 判断是否是app模式 // 步骤3: 判断是否是app模式

View File

@ -36,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unitId != null"> <if test="unitId != null">
AND bu.unit_id = #{unitId} AND bu.unit_id = #{unitId}
</if> </if>
<if test="typeId != null and typeId != 0">
AND bu.type_id = #{typeId}
</if>
UNION UNION
@ -65,6 +68,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unitId != null"> <if test="unitId != null">
AND bu.unit_id = #{unitId} AND bu.unit_id = #{unitId}
</if> </if>
<if test="typeId != null and typeId != 0">
AND bu.type_id = #{typeId}
</if>
UNION UNION
SELECT SELECT
@ -93,6 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unitId != null"> <if test="unitId != null">
AND bu.unit_id = #{unitId} AND bu.unit_id = #{unitId}
</if> </if>
<if test="typeId != null and typeId != 0">
AND bu.type_id = #{typeId}
</if>
) ff ) ff
ORDER BY ORDER BY
LEVEL LEVEL
@ -382,6 +391,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null and deptId != 0"> <if test="deptId != null and deptId != 0">
AND bpl.imp_unit = #{deptId} AND bpl.imp_unit = #{deptId}
</if> </if>
<if test="typeId != null and typeId != 0">
AND bu.type_id = #{typeId}
</if>
</if> </if>
<if test="projectId == null"> <if test="projectId == null">
SELECT unit_id AS unitId, SELECT unit_id AS unitId,
@ -391,6 +403,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null and deptId != 0"> <if test="deptId != null and deptId != 0">
AND dept_id = #{deptId} AND dept_id = #{deptId}
</if> </if>
<if test="typeId != null and typeId != 0">
AND bu.type_id = #{typeId}
</if>
</if> </if>
</select> </select>