diff --git a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/controller/admin/handlinggroupamountspecifications/dto/HandlingGroupAmountSpecificationsTotalNumDTO.java b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/controller/admin/handlinggroupamountspecifications/dto/HandlingGroupAmountSpecificationsTotalNumDTO.java index 7f7c76a6..bc7a5ff4 100644 --- a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/controller/admin/handlinggroupamountspecifications/dto/HandlingGroupAmountSpecificationsTotalNumDTO.java +++ b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/controller/admin/handlinggroupamountspecifications/dto/HandlingGroupAmountSpecificationsTotalNumDTO.java @@ -6,6 +6,7 @@ import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; +import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -23,4 +24,6 @@ public class HandlingGroupAmountSpecificationsTotalNumDTO { @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; + @Schema(description = "工厂ids") + private List factoryIds; } diff --git a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/controller/admin/handlinggroupamountspecifications/vo/HandlingGroupAmountSpecificationsPageReqVO.java b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/controller/admin/handlinggroupamountspecifications/vo/HandlingGroupAmountSpecificationsPageReqVO.java index f3590058..bd566508 100644 --- a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/controller/admin/handlinggroupamountspecifications/vo/HandlingGroupAmountSpecificationsPageReqVO.java +++ b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/controller/admin/handlinggroupamountspecifications/vo/HandlingGroupAmountSpecificationsPageReqVO.java @@ -10,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -47,4 +48,7 @@ public class HandlingGroupAmountSpecificationsPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; + @Schema(description = "工厂ids", example = "23178") + private List factoryIds; + } diff --git a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/handlinggroupamountspecifications/HandlingGroupAmountSpecificationsServiceImpl.java b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/handlinggroupamountspecifications/HandlingGroupAmountSpecificationsServiceImpl.java index 46d93a9c..c630d8fc 100644 --- a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/handlinggroupamountspecifications/HandlingGroupAmountSpecificationsServiceImpl.java +++ b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/handlinggroupamountspecifications/HandlingGroupAmountSpecificationsServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecifications; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils; import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo.HandlingGroupListVO; @@ -64,11 +65,10 @@ public class HandlingGroupAmountSpecificationsServiceImpl implements HandlingGro public PageResult getHandlingGroupAmountSpecificationsPage(HandlingGroupAmountSpecificationsPageReqVO pageReqVO) { // 判断当前登录人是否属于工厂主管 AdminUserRespDTO userRespDTO = userApi.getUser(getLoginUserId()).getCheckedData(); - DeptRespDTO deptRespDTO = deptApi.getDept(userRespDTO.getDeptId()).getCheckedData(); - if (deptRespDTO.getFactoryId() != null) { - pageReqVO.setFactoryId(deptRespDTO.getFactoryId()); + List deptRespDTOS = deptApi.getDeptByLeaderId(userRespDTO.getDeptId()).getCheckedData(); + if (CollUtil.isNotEmpty(deptRespDTOS)) { + pageReqVO.setFactoryIds(deptRespDTOS.stream().map(DeptRespDTO::getFactoryId).distinct().collect(Collectors.toList())); } - IPage pageResult = handlingGroupAmountSpecificationsMapper.getHandlingGroupAmountSpecificationsPage(MyBatisUtils.buildPage(pageReqVO), pageReqVO); return new PageResult<>(pageResult.getRecords(), pageResult.getTotal()); } @@ -160,6 +160,12 @@ public class HandlingGroupAmountSpecificationsServiceImpl implements HandlingGro @Override public HandlingGroupAmountSpecificationsTotalNumVO getTotalNum(HandlingGroupAmountSpecificationsTotalNumDTO dto) { + // 判断当前登录人是否属于工厂主管 + AdminUserRespDTO userRespDTO = userApi.getUser(getLoginUserId()).getCheckedData(); + List deptRespDTOS = deptApi.getDeptByLeaderId(userRespDTO.getDeptId()).getCheckedData(); + if (CollUtil.isNotEmpty(deptRespDTOS)) { + dto.setFactoryIds(deptRespDTOS.stream().map(DeptRespDTO::getFactoryId).distinct().collect(Collectors.toList())); + } return handlingGroupAmountSpecificationsMapper.getTotalNum(dto); } diff --git a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/resources/mapper/handlinggroupamountspecifications/HandlingGroupAmountSpecificationsMapper.xml b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/resources/mapper/handlinggroupamountspecifications/HandlingGroupAmountSpecificationsMapper.xml index 686be192..8f1a1df8 100644 --- a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/resources/mapper/handlinggroupamountspecifications/HandlingGroupAmountSpecificationsMapper.xml +++ b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/resources/mapper/handlinggroupamountspecifications/HandlingGroupAmountSpecificationsMapper.xml @@ -40,6 +40,12 @@ AND a.factory_id = #{vo.factoryId} + + and a.factory_id in + + #{item} + + and g.nick_name like concat('%', #{vo.porterName}, '%') @@ -108,6 +114,12 @@ and a.factory_id = #{dto.factoryId} + + and a.factory_id in + + #{item} + + and a.handling_specifications_id = #{dto.handlingSpecificationsId}