diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/back/service/impl/BackChangeServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/back/service/impl/BackChangeServiceImpl.java index a333224..071f5de 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/back/service/impl/BackChangeServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/back/service/impl/BackChangeServiceImpl.java @@ -426,11 +426,17 @@ public class BackChangeServiceImpl implements BackChangeService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// dto.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + dto.setCompanyId(1L); + }else{ dto.setCompanyId(deptId); } + return mapper.getList(dto); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeVo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeVo.java index 50c020e..01d1070 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeVo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/domain/CsDeviceChangeVo.java @@ -126,4 +126,6 @@ public class CsDeviceChangeVo { private String endTime; private String useTime; + + private Long companyId; } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java index 1287781..2e910c3 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java @@ -502,9 +502,14 @@ public class DevChangeServiceImpl implements DevChangeService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// dto.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + dto.setCompanyId(1L); + }else{ dto.setCompanyId(deptId); } return mapper.getList(dto); @@ -857,9 +862,14 @@ public class DevChangeServiceImpl implements DevChangeService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// dto.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + dto.setCompanyId(1L); + }else{ dto.setCompanyId(deptId); } return mapper.getOutboundList(dto); @@ -1137,7 +1147,13 @@ public class DevChangeServiceImpl implements DevChangeService { vo.setEndTime(endTimeAfterAddOneDay.format(dateFormatter)); } - + Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); + Long userId = SecurityUtils.getLoginUser().getUserid(); + if(ADMIN_ID.equals(userId)){ + vo.setCompanyId(1L); + }else{ + vo.setCompanyId(deptId); + } return mapper.getDevChangeList(vo); } catch (Exception e) { log.error(e.getMessage()); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java index c87cc1b..2049f5a 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java @@ -33,9 +33,14 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// o.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + o.setCompanyId(1L); + }else{ o.setCompanyId(deptId); } List list = mapper.list(o); @@ -248,12 +253,15 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { Long companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && companyId != null - && !userId.equals(ADMIN_ID) - && !companyId.equals(PROVINCE_COMPANY_DEPT_ID)) { - companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); - } else { - companyId = null; +// if (userId != null && companyId != null +// && !userId.equals(ADMIN_ID) +// && !companyId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); +// } else { +// companyId = null; +// } + if(ADMIN_ID.equals(userId)){ + companyId = 1L; } Integer totalCount = mapper.selectTotalDeviceCount(companyId); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevRetireWarningServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevRetireWarningServiceImpl.java index 937c87f..212768a 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevRetireWarningServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevRetireWarningServiceImpl.java @@ -29,9 +29,14 @@ public class MaDevRetireWarningServiceImpl implements MaDevRetireWarningService{ Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// o.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + o.setCompanyId(1L); + }else{ o.setCompanyId(deptId); } return mapper.list(o); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/MaDevQc.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/MaDevQc.java index 58ad1df..36f1066 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/MaDevQc.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/MaDevQc.java @@ -100,5 +100,7 @@ public class MaDevQc extends BaseEntity implements Serializable { private String phonenumber; private String alert; + + private Long companyId; } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/MaDevQcServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/MaDevQcServiceImpl.java index 3268189..93714e5 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/MaDevQcServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/MaDevQcServiceImpl.java @@ -22,6 +22,8 @@ import java.util.Date; import java.util.List; import java.util.Optional; +import static com.bonus.common.biz.constant.MaterialConstants.ADMIN_ID; + /** * @Author ma_sh * @create 2024/12/5 15:53 @@ -47,6 +49,13 @@ public class MaDevQcServiceImpl implements MaDevQcService { @Override public List selectDevQcList(MaDevQc maDevQc) { maDevQc.setQcCom(SecurityUtils.getLoginUser().getSysUser().getDeptId().toString()); + Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId(); + Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); + if(ADMIN_ID.equals(userId)){ + maDevQc.setCompanyId(1L); + }else{ + maDevQc.setCompanyId(deptId); + } return maDevQcMapper.selectDevQcList(maDevQc); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java index 21a11bc..6c5de07 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java @@ -208,9 +208,14 @@ public class RepairServiceImpl implements RepairService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// bean.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + bean.setCompanyId(1L); + }else{ bean.setCompanyId(deptId); } List list = mapper.getRepairList(bean); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/scrap/service/impl/ToBeScrapServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/scrap/service/impl/ToBeScrapServiceImpl.java index ce363ca..0ac3029 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/scrap/service/impl/ToBeScrapServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/scrap/service/impl/ToBeScrapServiceImpl.java @@ -276,9 +276,14 @@ public class ToBeScrapServiceImpl implements ToBeScrapService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// bean.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + bean.setCompanyId(1L); + }else{ bean.setCompanyId(deptId); } return scrapMapper.getScrapApplyList(bean); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/toolLedger/service/Impl/ToolLedgerServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/toolLedger/service/Impl/ToolLedgerServiceImpl.java index 7e18d76..37b0a14 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/toolLedger/service/Impl/ToolLedgerServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/toolLedger/service/Impl/ToolLedgerServiceImpl.java @@ -41,9 +41,14 @@ public class ToolLedgerServiceImpl implements ToolLedgerService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// entity.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + entity.setCompanyId(1L); + }else{ entity.setCompanyId(deptId); } return mapper.list(entity); @@ -60,9 +65,14 @@ public class ToolLedgerServiceImpl implements ToolLedgerService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// entity.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + entity.setCompanyId(1L); + }else{ entity.setCompanyId(deptId); } List toolLedgerEntities = mapper.listCode(entity); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/upOrDown/equipment/service/impl/UpOrDownEquipmentServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/upOrDown/equipment/service/impl/UpOrDownEquipmentServiceImpl.java index 0468ccf..71a4ebd 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/upOrDown/equipment/service/impl/UpOrDownEquipmentServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/upOrDown/equipment/service/impl/UpOrDownEquipmentServiceImpl.java @@ -33,9 +33,9 @@ public class UpOrDownEquipmentServiceImpl implements UpOrDownEquipmentService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { + if(ADMIN_ID.equals(userId)){ + entity.setCompanyId(1L); + }else{ entity.setCompanyId(deptId); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/upOrDown/tool/service/impl/UpOrDownToolServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/upOrDown/tool/service/impl/UpOrDownToolServiceImpl.java index fdb438f..70f3963 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/upOrDown/tool/service/impl/UpOrDownToolServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/upOrDown/tool/service/impl/UpOrDownToolServiceImpl.java @@ -38,9 +38,14 @@ public class UpOrDownToolServiceImpl implements UpOrDownToolService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// entity.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + entity.setCompanyId(1L); + }else{ entity.setCompanyId(deptId); } return upOrDownToolMapper.list(entity); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/warehousing/service/Impl/WarehousingServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/warehousing/service/Impl/WarehousingServiceImpl.java index 3084224..927a29b 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/warehousing/service/Impl/WarehousingServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/warehousing/service/Impl/WarehousingServiceImpl.java @@ -114,9 +114,14 @@ public class WarehousingServiceImpl implements WarehousingService { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// if (userId != null && deptId != null +// && !userId.equals(ADMIN_ID) +// && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { +// warehousing.setCompanyId(deptId); +// } + if(ADMIN_ID.equals(userId)){ + warehousing.setCompanyId(1L); + }else{ warehousing.setCompanyId(deptId); } List warehousingEntities = mapper.selectList(warehousing); diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/back/BackChangeMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/back/BackChangeMapper.xml index 4f757cd..1dcbea7 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/back/BackChangeMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/back/BackChangeMapper.xml @@ -547,8 +547,15 @@ and cd.use_unit = #{useUnit} - - and cd.company_id = #{companyId} + + and cd.company_id + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) GROUP BY cd.id @@ -578,4 +585,4 @@ - \ No newline at end of file + diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml index 3b6f570..8e53139 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml @@ -183,6 +183,16 @@ and cds.create_time between #{startTime} and #{endTime} + + and cds.company_id + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) + GROUP BY cds.id, cds.change_status, @@ -567,8 +577,15 @@ and cd.pro_code = #{proCode} - - and cd.company_id = #{companyId} + + and cd.company_id + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) GROUP BY cd.id @@ -719,8 +736,18 @@ AND temp.taskStatus = #{taskStatus} - - AND temp.companyId = #{companyId} + + + + + AND temp.companyId + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) @@ -1281,4 +1308,4 @@ update cs_device_change set del_flag = '1' where id = #{id} - \ No newline at end of file + diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml index a7f44c7..8adc868 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml @@ -360,8 +360,15 @@ LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id mdi.is_active = '1' and mdi.entry_status = '1' - - AND mdi.on_company = #{companyId} + + AND mdi.on_company + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) and ( @@ -527,8 +534,15 @@ LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id mdi.is_active = '1' and mdi.entry_status = '1' - - AND mdi.on_company = #{companyId} + + AND mdi.on_company + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevRetireWarningMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevRetireWarningMapper.xml index 5804bce..99cb47a 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevRetireWarningMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevRetireWarningMapper.xml @@ -63,8 +63,15 @@ AND mdi.supplier_id like concat('%',#{manufacturerId},'%') - - AND mdi.on_company = #{companyId} + + AND mdi.on_company + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) ) a diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/MaDevQcMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/MaDevQcMapper.xml index 8f641e3..9a9ef6b 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/MaDevQcMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/MaDevQcMapper.xml @@ -109,8 +109,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and DATE_FORMAT(m1.create_time,'%Y-%m-%d') between #{createStartTime} and #{createEndTime} - - and m2.on_company = #{qcCom} + + and m2.on_company + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/repair/RepairMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/repair/RepairMapper.xml index bb1581f..ed9fb25 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/repair/RepairMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/repair/RepairMapper.xml @@ -287,8 +287,16 @@ AND cdc.review_status = #{status} - - and cdc.company_id = #{companyId} + + and cdc.company_id + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) + and cdc.review_status !='5' @@ -448,4 +456,4 @@ id = #{id} LIMIT 1 - \ No newline at end of file + diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/scrap/ScrapMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/scrap/ScrapMapper.xml index 5630e6a..e554e81 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/scrap/ScrapMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/scrap/ScrapMapper.xml @@ -144,8 +144,15 @@ AND cdc.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') - - and cdc.company_id = #{companyId} + + and cdc.company_id + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) GROUP BY cdc.id ORDER BY @@ -449,4 +456,4 @@ update cs_device_change set del_flag = '1' where id = #{id} - \ No newline at end of file + diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/toolLedger/ToolLedgerMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/toolLedger/ToolLedgerMapper.xml index ee4df7b..aea4e7e 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/toolLedger/ToolLedgerMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/toolLedger/ToolLedgerMapper.xml @@ -104,8 +104,14 @@ AND tt.manage_type = #{manageMode} - - AND tl.company_id = #{companyId} + + AND tl.company_id in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) AND tt.type_name LIKE CONCAT('%', #{typeName}, '%') @@ -228,8 +234,15 @@ AND tl.tool_code LIKE CONCAT('%', #{toolCode}, '%') - - AND (tl.company_id = #{companyId} OR tl.company_id IS NULL) + + + and tl.company_id in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) ORDER BY tl.create_time DESC diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownEquipmentMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownEquipmentMapper.xml index bdd2517..5303399 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownEquipmentMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownEquipmentMapper.xml @@ -198,8 +198,16 @@ and mtv.childGx like concat('%', #{subProcess}, '%') - - and mdi.on_company = #{companyId} + + and mdi.on_company + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) + diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownToolMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownToolMapper.xml index fcdfc02..93878e0 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownToolMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownToolMapper.xml @@ -89,7 +89,14 @@ AND tt.type_name LIKE CONCAT('%', #{typeName}, '%') - AND tl.company_id = #{companyId} + AND tl.company_id + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) GROUP BY tl.id diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/warehousing/WarehousingMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/warehousing/WarehousingMapper.xml index fceed1c..3aba98d 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/warehousing/WarehousingMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/warehousing/WarehousingMapper.xml @@ -153,8 +153,15 @@ AND bw.status != #{isStatus} - - AND su.dept_id = #{companyId} + + AND su.dept_id + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + ) and bw.create_time >= #{startTime} @@ -221,4 +228,4 @@ - \ No newline at end of file +