diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java index 91dea426..edad4ce3 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java @@ -1702,6 +1702,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { @Override public AjaxResult getMachineByCode(BackApplyInfo dto) { + dto.setUserId(SecurityUtils.getLoginUser().getUserid()); return backApplyInfoMapper.getMachineByCode(dto); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java index 41225b5c..b94ee401 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java @@ -45,4 +45,6 @@ public class SelectDto { private String teamId; private Long proId; + + private Long userId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java index 4a728133..93d4b358 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java @@ -379,6 +379,7 @@ public class SelectServiceImpl implements SelectService { List listL21 = new ArrayList<>(); try { // 先查第四层类型 + dto.setUserId(SecurityUtils.getLoginUser().getUserid()); listL4 = mapper.getUseTypeTreeL4Back(dto); if (CollectionUtils.isNotEmpty(listL4)) { List list4ParentIds = listL4.stream().map(o -> o.getParentId()).collect(Collectors.toList()); @@ -536,6 +537,7 @@ public class SelectServiceImpl implements SelectService { @Override public AjaxResult getUseType(BackApplyInfo bean) { //四级类型只查询数量管理类型数据 + bean.setUserId(SecurityUtils.getLoginUser().getUserid()); List listL4 = mapper.getUseTypeTreeApp(bean); if (CollectionUtils.isEmpty(listL4)) { return AjaxResult.success(); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml index eb12a8f3..25caa2f8 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml @@ -1125,7 +1125,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id LEFT JOIN sys_dict_data sd on sd.dict_value = mm.ma_status and sd.dict_type = "ma_machine_status" AND bu.del_flag = '0' + LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id WHERE sai.`status`=0 and mm.ma_status = '2' + + and mtr.user_id = #{userId} + and mm.ma_code = #{maCode} GROUP BY mm.ma_id diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml index 7ca294f8..4153c69d 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml @@ -400,9 +400,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ma_type mt LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = '0' + LEFT JOIN ma_type_repair mtr ON mt.type_id = mtr.type_id WHERE sai.agreement_id = #{agreementId} AND sai.STATUS = '0' and mt.manage_type = '1' + + and mtr.user_id = #{userId} + GROUP BY mt.type_id HAVING num> 0 @@ -806,8 +810,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0' LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id + LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id WHERE mm.ma_status = '2' + and mtr.user_id = #{userId} AND ba.unit_id = #{unitId} AND ba.project_id = #{proId} GROUP BY mm.type_id