diff --git a/pjcloud-hardware/pjcloud-hardware-api/src/main/java/com/bsd/pjcloud/hard/api/dto/order/HardDeptTotalDto.java b/pjcloud-hardware/pjcloud-hardware-api/src/main/java/com/bsd/pjcloud/hard/api/dto/order/HardDeptTotalDto.java index 7f4ec051d..4eb5bc81f 100644 --- a/pjcloud-hardware/pjcloud-hardware-api/src/main/java/com/bsd/pjcloud/hard/api/dto/order/HardDeptTotalDto.java +++ b/pjcloud-hardware/pjcloud-hardware-api/src/main/java/com/bsd/pjcloud/hard/api/dto/order/HardDeptTotalDto.java @@ -1,5 +1,6 @@ package com.bsd.pjcloud.hard.api.dto.order; +import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -7,7 +8,7 @@ import java.time.LocalDateTime; import java.util.List; @Data -public class HardDeptTotalDto { +public class HardDeptTotalDto implements BaseIsIncludeTreeInterface { @Schema(description = "饭卡类型id") private Long walletTypeId; @@ -18,10 +19,13 @@ public class HardDeptTotalDto { @Schema(description = "部门id") private Long deptId; - @Schema(description = "是否深度搜索deptId") + @Schema(description = "是否深度搜索deptIds") private Boolean isDeepDept; @Schema(description = "部门ids") private List deptIds; + @Schema(description = "是否包含deptIds") + private Boolean isInclude = false; + } diff --git a/pjcloud-hardware/pjcloud-hardware-api/src/main/java/com/bsd/pjcloud/hard/api/dto/order/HardOrderDto.java b/pjcloud-hardware/pjcloud-hardware-api/src/main/java/com/bsd/pjcloud/hard/api/dto/order/HardOrderDto.java index dee26ad8f..a677caac5 100644 --- a/pjcloud-hardware/pjcloud-hardware-api/src/main/java/com/bsd/pjcloud/hard/api/dto/order/HardOrderDto.java +++ b/pjcloud-hardware/pjcloud-hardware-api/src/main/java/com/bsd/pjcloud/hard/api/dto/order/HardOrderDto.java @@ -1,5 +1,6 @@ package com.bsd.pjcloud.hard.api.dto.order; +import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface; import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity; import lombok.Data; @@ -8,7 +9,7 @@ import java.time.LocalDateTime; import java.util.List; @Data -public class HardOrderDto extends HardOrderEntity { +public class HardOrderDto extends HardOrderEntity implements BaseIsIncludeTreeInterface { /** * 订单部门id极其子部门id @@ -17,7 +18,7 @@ public class HardOrderDto extends HardOrderEntity { private List deptIds; - private Boolean isDeepDept = false; + private Boolean isInclude = false; private List userIds; diff --git a/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/service/impl/order/HardOrderTotalServiceImpl.java b/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/service/impl/order/HardOrderTotalServiceImpl.java index 3d864c734..4d2c6dd28 100644 --- a/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/service/impl/order/HardOrderTotalServiceImpl.java +++ b/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/service/impl/order/HardOrderTotalServiceImpl.java @@ -52,16 +52,6 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService { @Override public Page pageListSb(Page page, HardOrderDto dto) { - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { - List deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData(); - dto.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getDeptIds())) { - dto.setDeptId(null); - } Page list = hardOrderMapper.pageListSb(page, dto); if (ObjectUtil.isNotEmpty(list)) { // 商户 @@ -88,16 +78,6 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService { @Override public List listSb(HardOrderDto dto) { - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { - List deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData(); - dto.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getDeptIds())) { - dto.setDeptId(null); - } List list = hardOrderMapper.listSb(dto); if (ObjectUtil.isNotEmpty(list)) { // 商户 @@ -124,16 +104,6 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService { @Override public Page pageListCs(Page page, HardOrderDto dto) { - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { - List deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData(); - dto.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getDeptIds())) { - dto.setDeptId(null); - } Page list = hardOrderMapper.pageListCs(page, dto); if (ObjectUtil.isNotEmpty(list)) { // 商户 @@ -150,16 +120,6 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService { @Override public List listCs(HardOrderDto dto) { - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { - List deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData(); - dto.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getDeptIds())) { - dto.setDeptId(null); - } List list = hardOrderMapper.listCs(dto); if (ObjectUtil.isNotEmpty(list)) { // 商户 @@ -177,15 +137,9 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService { @Override public List pageListDept(HardDeptTotalDto dto) { // 查询部门 - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { - List deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData(); - dto.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } CompletableFuture> deptFuture = CompletableFuture.supplyAsync(() -> { DeptAllListDto deptDto = new DeptAllListDto(); + deptDto.setIsInclude(dto.getIsInclude()); if (ObjectUtil.isNotEmpty(dto.getDeptId())) { deptDto.setDeptId(dto.getDeptId()); } diff --git a/pjcloud-hardware/pjcloud-hardware-biz/src/main/resources/mapper/order/HardOrderMapper.xml b/pjcloud-hardware/pjcloud-hardware-biz/src/main/resources/mapper/order/HardOrderMapper.xml index 40aee211c..c45b4df98 100644 --- a/pjcloud-hardware/pjcloud-hardware-biz/src/main/resources/mapper/order/HardOrderMapper.xml +++ b/pjcloud-hardware/pjcloud-hardware-biz/src/main/resources/mapper/order/HardOrderMapper.xml @@ -81,7 +81,17 @@ and a.dept_id = #{dto.deptId} - and a.dept_id in + + + and a.dept_id IN + + + and a.dept_id NOT IN + + + and a.dept_id IN + + #{v} diff --git a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/DeptAllListDto.java b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/DeptAllListDto.java index 3ab530b89..a7b225a54 100644 --- a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/DeptAllListDto.java +++ b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/DeptAllListDto.java @@ -5,10 +5,12 @@ import lombok.Data; import java.util.List; @Data -public class DeptAllListDto { +public class DeptAllListDto { private Long deptId; private List deptIds; + private Boolean isInclude; + } diff --git a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/UserDTO.java b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/UserDTO.java index 5589448aa..bfec27d8a 100644 --- a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/UserDTO.java +++ b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/UserDTO.java @@ -20,6 +20,7 @@ package com.bsd.pjcloud.admin.api.dto; import com.bsd.pjcloud.admin.api.entity.SysUser; +import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,7 +35,7 @@ import java.util.List; @Data @Schema(description = "系统用户传输对象") @EqualsAndHashCode(callSuper = true) -public class UserDTO extends SysUser { +public class UserDTO extends SysUser implements BaseIsIncludeTreeInterface { /** * 角色ID @@ -72,11 +73,13 @@ public class UserDTO extends SysUser { private List userIds; /** - * false 当前部门 - * true 当前部门及子部门 + * 部门ids */ - private Boolean isDeepDept = false; - private List deptIds; + /** + * 是否包含部门ids + */ + private Boolean isInclude; + } diff --git a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/utils/DataUtil.java b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/utils/DataUtil.java index 54d1d2e82..20cec39b9 100644 --- a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/utils/DataUtil.java +++ b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/utils/DataUtil.java @@ -7,10 +7,7 @@ import com.bsd.pjcloud.admin.api.entity.SysMenu; import com.bsd.pjcloud.admin.api.entity.SysUser; import com.bsd.pjcloud.admin.api.vo.SysUserFaceVo; import com.bsd.pjcloud.admin.api.vo.UserVO; -import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface; -import com.bsd.pjcloud.admin.api.vo.base.BaseFacesInterface; -import com.bsd.pjcloud.admin.api.vo.base.BaseUserDeptInterface; -import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface; +import com.bsd.pjcloud.admin.api.vo.base.*; import com.bsd.pjcloud.common.core.util.CollectionUtils; import lombok.experimental.UtilityClass; diff --git a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/vo/base/BaseIsDeepDeptTreeInterface.java b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/vo/base/BaseIsDeepDeptTreeInterface.java new file mode 100644 index 000000000..52b667b44 --- /dev/null +++ b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/vo/base/BaseIsDeepDeptTreeInterface.java @@ -0,0 +1,27 @@ +package com.bsd.pjcloud.admin.api.vo.base; + +import java.util.List; + +public interface BaseIsDeepDeptTreeInterface { + /** + * 部门ids + */ + List getDeptIds(); + + void setDeptIds(List deptIds); + + /** + * 部门id + */ + Long getDeptId(); + + void setDeptId(Long deptId); + + /** + * 是否深度搜索deptIds + * @return + */ + Boolean getIsDeepDept(); + + void setIsDeepDept(Boolean isDeepDept); +} diff --git a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/vo/base/BaseIsIncludeTreeInterface.java b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/vo/base/BaseIsIncludeTreeInterface.java new file mode 100644 index 000000000..84e4b4c6a --- /dev/null +++ b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/vo/base/BaseIsIncludeTreeInterface.java @@ -0,0 +1,20 @@ +package com.bsd.pjcloud.admin.api.vo.base; + +import java.util.List; + +public interface BaseIsIncludeTreeInterface { + + /** + * 是否包含部门ids + */ + Boolean getIsInclude(); + + void setIsInclude(Boolean isInclude); + + /** + * 部门ids + */ + List getDeptIds(); + + void setDeptIds(List deptIds); +} diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysUserServiceImpl.java b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysUserServiceImpl.java index fd637c1a1..c2306bb67 100644 --- a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysUserServiceImpl.java +++ b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysUserServiceImpl.java @@ -220,17 +220,6 @@ public class SysUserServiceImpl extends ServiceImpl impl */ @Override public IPage getUsersWithRolePage(Page page, UserDTO userDTO) { - // 部门 - if (ObjectUtil.isNotEmpty(userDTO.getIsDeepDept()) && userDTO.getIsDeepDept() && ObjectUtil.isNotEmpty(userDTO.getDeptId())) { - List deptList = sysDeptService.listDescendant(userDTO.getDeptId()); - userDTO.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - userDTO.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(userDTO.getDeptIds())) { - userDTO.setDeptId(null); - } IPage list = baseMapper.getUserVosPage(page, userDTO, DataScope.of()); if (ObjectUtil.isNotEmpty(list.getRecords())) { List userIds = list.getRecords().stream().map(UserVO::getUserId).distinct().toList(); @@ -367,17 +356,6 @@ public class SysUserServiceImpl extends ServiceImpl impl */ @Override public List listUser(UserDTO userDTO, Long[] ids) { - // 部门 - if (ObjectUtil.isNotEmpty(userDTO.getIsDeepDept()) && userDTO.getIsDeepDept() && ObjectUtil.isNotEmpty(userDTO.getDeptId())) { - List deptList = sysDeptService.listDescendant(userDTO.getDeptId()); - userDTO.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - userDTO.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(userDTO.getDeptIds())) { - userDTO.setDeptId(null); - } // 根据数据权限查询全部的用户信息 List voList = baseMapper.selectVoListByScope(userDTO, ids, DataScope.of()); // 转换成execl 对象输出 diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/resources/mapper/SysDeptMapper.xml b/pjcloud-upms/pjcloud-upms-biz/src/main/resources/mapper/SysDeptMapper.xml index ba70eee4e..2b0f16b9b 100644 --- a/pjcloud-upms/pjcloud-upms-biz/src/main/resources/mapper/SysDeptMapper.xml +++ b/pjcloud-upms/pjcloud-upms-biz/src/main/resources/mapper/SysDeptMapper.xml @@ -51,7 +51,17 @@ AND a.dept_id = #{dto.deptId} - and a.dept_id IN + + + and a.dept_id IN + + + and a.dept_id NOT IN + + + and a.dept_id IN + + #{v} diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/resources/mapper/SysUserMapper.xml b/pjcloud-upms/pjcloud-upms-biz/src/main/resources/mapper/SysUserMapper.xml index 3621fb244..2a341dd0c 100644 --- a/pjcloud-upms/pjcloud-upms-biz/src/main/resources/mapper/SysUserMapper.xml +++ b/pjcloud-upms/pjcloud-upms-biz/src/main/resources/mapper/SysUserMapper.xml @@ -182,7 +182,17 @@ AND u.dept_id = #{query.deptId} - and u.dept_id IN + + + and u.dept_id IN + + + and u.dept_id NOT IN + + + and u.dept_id IN + + #{v} @@ -248,7 +258,17 @@ AND u.dept_id = #{query.deptId} - AND u.dept_id in + + + and u.dept_id IN + + + and u.dept_id NOT IN + + + and u.dept_id IN + + #{id} diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/WalletManageDto.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/WalletManageDto.java index 4f8aa8e00..c2611195f 100644 --- a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/WalletManageDto.java +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/WalletManageDto.java @@ -1,5 +1,6 @@ package com.bsd.pjcloud.wallet.api.dto; +import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface; import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity; import lombok.Data; @@ -8,7 +9,7 @@ import java.time.LocalDateTime; import java.util.List; @Data -public class WalletManageDto extends WalletManageEntity { +public class WalletManageDto extends WalletManageEntity implements BaseIsIncludeTreeInterface { private List userIds; @@ -16,14 +17,14 @@ public class WalletManageDto extends WalletManageEntity { private LocalDateTime[] createTimeList; - /** - * 是否深度搜索deptId - */ - private Boolean isDeepDept; - /** * 部门ids */ private List deptIds; + /** + * 是否深度搜索deptId + */ + private Boolean isInclude; + } \ No newline at end of file diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/WalletTransactionDto.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/WalletTransactionDto.java index d5555cdc2..76c8a076d 100644 --- a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/WalletTransactionDto.java +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/WalletTransactionDto.java @@ -1,5 +1,6 @@ package com.bsd.pjcloud.wallet.api.dto; +import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface; import com.bsd.pjcloud.wallet.api.entity.WalletTransactionEntity; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -8,7 +9,7 @@ import java.time.LocalDate; import java.util.List; @Data -public class WalletTransactionDto extends WalletTransactionEntity { +public class WalletTransactionDto extends WalletTransactionEntity implements BaseIsIncludeTreeInterface { /** * 类型 - 收入 @@ -40,14 +41,14 @@ public class WalletTransactionDto extends WalletTransactionEntity { */ private Boolean isFindOrder = false; - /** - * 是否深度搜索deptId - */ - private Boolean isDeepDept; - /** * 部门ids */ private List deptIds; + /** + * 是否包含部门ids + */ + private Boolean isInclude; + } diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/recharge/WalletRechargeImportDto.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/recharge/WalletRechargeImportDto.java index 379b1fd73..0220b4202 100644 --- a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/recharge/WalletRechargeImportDto.java +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/recharge/WalletRechargeImportDto.java @@ -1,5 +1,6 @@ package com.bsd.pjcloud.wallet.api.dto.recharge; +import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface; import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity; import lombok.Data; @@ -7,7 +8,7 @@ import java.time.LocalDateTime; import java.util.List; @Data -public class WalletRechargeImportDto extends WalletRechargeImportEntity { +public class WalletRechargeImportDto extends WalletRechargeImportEntity implements BaseIsIncludeTreeInterface { private String processStatus; @@ -19,16 +20,22 @@ public class WalletRechargeImportDto extends WalletRechargeImportEntity { private Long userDeptId; - /** - * 是否深度搜索deptId - */ - private Boolean isDeepDept; /** * 部门ids */ private List userDeptIds; + /** + * 没有使用 + */ + private List deptIds; + + /** + * 是否包含部门ids + */ + private Boolean isInclude; + private LocalDateTime[] createTimeList; private LocalDateTime[] processTimeList; diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletManageController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletManageController.java index d8f568536..fb9b518ff 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletManageController.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletManageController.java @@ -1,6 +1,5 @@ package com.bsd.pjcloud.wallet.controller; -import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -22,7 +21,6 @@ import com.bsd.pjcloud.wallet.service.WalletCodeUseService; import com.bsd.pjcloud.wallet.service.WalletManageService; import jakarta.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; -import com.bsd.pjcloud.common.excel.annotation.ResponseExcel; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import org.springdoc.core.annotations.ParameterObject; import org.springframework.http.HttpHeaders; @@ -181,6 +179,13 @@ public class WalletManageController { return R.ok(walletManageService.removeBatchByIds(CollUtil.toList(ids))); } + @Operation(summary = "钱包记录分页", description = "钱包记录分页") + @PostMapping("/page-qb") + public R pageQb(@ParameterObject Page page, @RequestBody WalletManageDto dto) { + DataScope dataScope = new DataScope(); + return R.ok(walletManageService.scopeQbPageList(page, dto, dataScope)); + } + @PostMapping("/export") @PreAuthorize("@pms.hasPermission('wallet_walletManage_export')") public void export(HttpServletResponse response, @ParameterObject Page page, @RequestBody WalletManageDto dto) { diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletTransactionController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletTransactionController.java index b25496c28..f2524644a 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletTransactionController.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletTransactionController.java @@ -96,7 +96,6 @@ public class WalletTransactionController { @PostMapping("/page-cz") public R pageCz(@ParameterObject Page page, @RequestBody WalletTransactionDto dto) { dto.setBizTypes(WalletBizEnum.getTopUpCodes()); - // dto.setType(WalletTransactionDto.TYPE_INCOME); DataScope dataScope = new DataScope(); return R.ok(walletTransactionService.scopePageList(page, dto, dataScope)); } diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/WalletManageMapper.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/WalletManageMapper.java index afe5b1307..a4c1b34a0 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/WalletManageMapper.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/WalletManageMapper.java @@ -110,7 +110,6 @@ public interface WalletManageMapper extends PjcloudBaseMapper list = selectListByScope(wrapper, dataScope); return BeanUtils.toBean(list, WalletManageVo.class); } diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/WalletTransactionMapper.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/WalletTransactionMapper.java index 873e39393..8fe2c23e1 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/WalletTransactionMapper.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/WalletTransactionMapper.java @@ -31,7 +31,6 @@ public interface WalletTransactionMapper extends PjcloudBaseMapper { Page scopePageList(Page page, WalletManageDto dto, DataScope dataScope); + Page scopeQbPageList(Page page, WalletManageDto dto, DataScope dataScope); + List scopeList(WalletManageDto dto, DataScope dataScope); WalletManageVo join(Long user, Long walletId); diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletManageServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletManageServiceImpl.java index 614b6bd33..5cf51fa49 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletManageServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletManageServiceImpl.java @@ -219,17 +219,6 @@ public class WalletManageServiceImpl extends ServiceImpl scopeList(WalletManageDto dto, DataScope dataScope) { - // 查询部门 - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { - List deptList = deptService.getDescendantList(dto.getDeptId()).getData(); - dto.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getDeptIds())) { - dto.setDeptId(null); - } List list = baseMapper.scopeList(dto, dataScope); disposeList(list, dto); return list; @@ -237,17 +226,6 @@ public class WalletManageServiceImpl extends ServiceImpl scopePageList(Page page, WalletManageDto dto, DataScope dataScope) { - // 查询部门 - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { - List deptList = deptService.getDescendantList(dto.getDeptId()).getData(); - dto.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getDeptIds())) { - dto.setDeptId(null); - } Page list = baseMapper.scopePageList(page, dto, dataScope); disposeList(list.getRecords(), dto); return list; @@ -266,6 +244,11 @@ public class WalletManageServiceImpl extends ServiceImpl scopeQbPageList(Page page, WalletManageDto dto, DataScope dataScope) { + return null; + } + @Override public void export(HttpServletResponse response, Page page, WalletManageDto dto) { String fileName = "file/账户余额.xlsx"; diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletTransactionServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletTransactionServiceImpl.java index 88421782a..0237f6b48 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletTransactionServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletTransactionServiceImpl.java @@ -165,17 +165,6 @@ public class WalletTransactionServiceImpl extends ServiceImpl scopePageList(Page page, WalletTransactionDto dto, DataScope dataScope) { - // 查询部门 - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { - List deptList = deptService.getDescendantList(dto.getDeptId()).getData(); - dto.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getDeptIds())) { - dto.setDeptId(null); - } Page list = baseMapper.scopePageList(page, dto, dataScope); disposeList(list.getRecords(), dto); return list; @@ -183,17 +172,6 @@ public class WalletTransactionServiceImpl extends ServiceImpl scopeList(WalletTransactionDto dto, DataScope dataScope) { - // 查询部门 - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { - List deptList = deptService.getDescendantList(dto.getDeptId()).getData(); - dto.setDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getDeptIds())) { - dto.setDeptId(null); - } List list = baseMapper.scopeList(dto, dataScope); disposeList(list, dto); return list; diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeImportServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeImportServiceImpl.java index de97a2ea3..4e43d7932 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeImportServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeImportServiceImpl.java @@ -94,17 +94,6 @@ public class WalletRechargeImportServiceImpl extends ServiceImpl scopePageList(Page page, WalletRechargeImportDto dto, DataScope dataScope) { - // 查询部门 - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getUserDeptId())) { - List deptList = deptService.getDescendantList(dto.getUserDeptId()).getData(); - dto.setUserDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setUserDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getUserDeptIds())) { - dto.setUserDeptId(null); - } Page list = baseMapper.scopePageList(page, dto, dataScope); disposeList(list.getRecords(), dto); return list; @@ -112,17 +101,6 @@ public class WalletRechargeImportServiceImpl extends ServiceImpl scopeList(WalletRechargeImportDto dto, DataScope dataScope) { - // 查询部门 - if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getUserDeptId())) { - List deptList = deptService.getDescendantList(dto.getUserDeptId()).getData(); - dto.setUserDeptId(null); - if (ObjectUtil.isNotEmpty(deptList)) { - dto.setUserDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); - } - } - if (ObjectUtil.isNotEmpty(dto.getUserDeptIds())) { - dto.setUserDeptId(null); - } List list = baseMapper.scopeList(dto, dataScope); disposeList(list, dto); return list; diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/utils/dept/DeptUtil.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/utils/dept/DeptUtil.java new file mode 100644 index 000000000..183387e6a --- /dev/null +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/utils/dept/DeptUtil.java @@ -0,0 +1,36 @@ +package com.bsd.pjcloud.wallet.utils.dept; + +import cn.hutool.core.util.ObjectUtil; +import com.bsd.pjcloud.admin.api.entity.SysDept; +import com.bsd.pjcloud.admin.api.feign.RemoteDeptService; +import com.bsd.pjcloud.admin.api.vo.base.BaseIsDeepDeptTreeInterface; +import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.stream.Collectors; + +@Component +@RequiredArgsConstructor +public class DeptUtil { + + private final RemoteDeptService deptService; + + public void disposeIsIncludeTreeDto(T dto) { + if (ObjectUtil.isEmpty(dto)) return; + } + + public void disposeIsDeepDeptTreeDto(T dto) { + if (ObjectUtil.isEmpty(dto)) return; + // 查询部门 + if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) { + List deptList = deptService.getDescendantList(dto.getDeptId()).getData(); + dto.setDeptId(null); + if (ObjectUtil.isNotEmpty(deptList)) { + dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList())); + } + } + } + +} diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeImportMapper.xml b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeImportMapper.xml index 3331804cd..24ac7129d 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeImportMapper.xml +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeImportMapper.xml @@ -50,7 +50,17 @@ - and a.user_dept_id in + + + and a.user_dept_id IN + + + and a.user_dept_id NOT IN + + + and a.user_dept_id IN + + #{v}