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 e414333d2..7f4ec051d 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 @@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; +import java.util.List; @Data public class HardDeptTotalDto { @@ -14,4 +15,13 @@ public class HardDeptTotalDto { @Schema(description = "饭卡类型id") private LocalDateTime[] createTimeList; + @Schema(description = "部门id") + private Long deptId; + + @Schema(description = "是否深度搜索deptId") + private Boolean isDeepDept; + + @Schema(description = "部门ids") + private List deptIds; + } diff --git a/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/controller/order/HardOrderTotalController.java b/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/controller/order/HardOrderTotalController.java index 0b8618750..2e229232d 100644 --- a/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/controller/order/HardOrderTotalController.java +++ b/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/controller/order/HardOrderTotalController.java @@ -45,23 +45,23 @@ public class HardOrderTotalController { private final HardOrderTotalService HardOrderTotalService; - @GetMapping("/page-list-sb") + @PostMapping("/page-list-sb") @Operation(summary = "设备交易记录") - public R> pageListSb(@ParameterObject Page page, @ParameterObject HardOrderDto dto) { + public R> pageListSb(@ParameterObject Page page, @RequestBody HardOrderDto dto) { dto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes()); return R.ok(HardOrderTotalService.pageListSb(page, dto)); } - @GetMapping("/page-list-cs") + @PostMapping("/page-list-cs") @Operation(summary = "商户交易记录") - public R> pageListCs(@ParameterObject Page page, @ParameterObject HardOrderDto dto) { + public R> pageListCs(@ParameterObject Page page, @RequestBody HardOrderDto dto) { dto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes()); return R.ok(HardOrderTotalService.pageListCs(page, dto)); } - @GetMapping("/page-list-dept") + @PostMapping("/page-list-dept") @Operation(summary = "部门交易记录") - public R> pageListDept(@ParameterObject HardDeptTotalDto dto) { + public R> pageListDept(@RequestBody HardDeptTotalDto dto) { return R.ok(HardOrderTotalService.pageListDept(dto)); } @@ -145,10 +145,10 @@ public class HardOrderTotalController { } @Operation(summary = "部门交易记录导出", description = "部门交易记录导出") - @GetMapping("/export-dept") + @PostMapping("/export-dept") @SysLog("部门交易记录导出") @PreAuthorize("@pms.hasPermission('hard_hardTotal_export_dept')") - public void exportDept(HttpServletResponse response, HardDeptTotalDto dto) throws IOException { + public void exportDept(HttpServletResponse response, @RequestBody HardDeptTotalDto dto) throws IOException { List list = HardOrderTotalService.pageListDept(dto); try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(ResourceUtil.getStream("file/部门交易金额汇总.xlsx")).build()) { WriteSheet writeSheet = EasyExcel.writerSheet().build(); @@ -160,13 +160,25 @@ public class HardOrderTotalController { map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN)); } if (ObjectUtil.isNotEmpty(list)) { + // 批量充值 BigDecimal walletPriceSum = BigDecimal.ZERO; BigDecimal walletCountSum = BigDecimal.ZERO; + // 批量扣减 + BigDecimal walletReducePriceSum = BigDecimal.ZERO; + BigDecimal walletReduceCountSum = BigDecimal.ZERO; + // 单次充值 + BigDecimal walletOncePriceSum = BigDecimal.ZERO; + BigDecimal walletOnceCountSum = BigDecimal.ZERO; + // 单次扣减 + BigDecimal walletOnceReducePriceSum = BigDecimal.ZERO; + BigDecimal walletOnceReduceCountSum = BigDecimal.ZERO; + BigDecimal orderPayPriceSum = BigDecimal.ZERO; BigDecimal orderPayCountSum = BigDecimal.ZERO; BigDecimal orderRefundPriceSum = BigDecimal.ZERO; BigDecimal orderRefundContSum = BigDecimal.ZERO; for (HardDeptTotalVo v : list) { + // 批量充值 if (ObjectUtil.isNotEmpty(v.getWalletPrice())) { walletPriceSum = walletPriceSum.add(BigDecimal.valueOf(v.getWalletPrice())); v.setWalletPrice(BigDecimal.valueOf(v.getWalletPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); @@ -175,6 +187,33 @@ public class HardOrderTotalController { walletCountSum = walletCountSum.add(BigDecimal.valueOf(v.getWalletCount())); v.setWalletCount(BigDecimal.valueOf(v.getWalletCount()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); } + // 批量扣减 + if (ObjectUtil.isNotEmpty(v.getWalletReducePrice())) { + walletReducePriceSum = walletReducePriceSum.add(BigDecimal.valueOf(v.getWalletReducePrice())); + v.setWalletReducePrice(BigDecimal.valueOf(v.getWalletReducePrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); + } + if (ObjectUtil.isNotEmpty(v.getWalletReduceCount())) { + walletReduceCountSum = walletReduceCountSum.add(BigDecimal.valueOf(v.getWalletReduceCount())); + v.setWalletReduceCount(BigDecimal.valueOf(v.getWalletReduceCount()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); + } + // 单次充值 + if (ObjectUtil.isNotEmpty(v.getWalletOncePrice())) { + walletOncePriceSum = walletOncePriceSum.add(BigDecimal.valueOf(v.getWalletOncePrice())); + v.setWalletOncePrice(BigDecimal.valueOf(v.getWalletOncePrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); + } + if (ObjectUtil.isNotEmpty(v.getWalletOnceCount())) { + walletOnceCountSum = walletOnceCountSum.add(BigDecimal.valueOf(v.getWalletOnceCount())); + v.setWalletOnceCount(BigDecimal.valueOf(v.getWalletOnceCount()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); + } + // 单次扣减 + if (ObjectUtil.isNotEmpty(v.getWalletOnceReducePrice())) { + walletOnceReducePriceSum = walletOnceReducePriceSum.add(BigDecimal.valueOf(v.getWalletOnceReducePrice())); + v.setWalletOncePrice(BigDecimal.valueOf(v.getWalletOnceReducePrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); + } + if (ObjectUtil.isNotEmpty(v.getWalletOnceReduceCount())) { + walletOnceReduceCountSum = walletOnceReduceCountSum.add(BigDecimal.valueOf(v.getWalletOnceReduceCount())); + v.setWalletOnceReduceCount(BigDecimal.valueOf(v.getWalletOnceReduceCount()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); + } if (ObjectUtil.isNotEmpty(v.getOrderPayPrice())) { orderPayPriceSum = orderPayPriceSum.add(BigDecimal.valueOf(v.getOrderPayPrice())); v.setOrderPayPrice(BigDecimal.valueOf(v.getOrderPayPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); @@ -191,8 +230,19 @@ public class HardOrderTotalController { orderRefundContSum = orderRefundContSum.add(BigDecimal.valueOf(v.getOrderRefundCont())); v.setOrderRefundCont(BigDecimal.valueOf(v.getOrderRefundCont()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue()); } + // 批量充值 map.put("walletPriceSum", walletPriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString()); map.put("walletCountSum", walletCountSum.toString()); + // 批量扣减 + map.put("walletReducePriceSum", walletReducePriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString()); + map.put("walletReduceCountSum", walletReduceCountSum.toString()); + // 单次充值 + map.put("walletOncePriceSum", walletOncePriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString()); + map.put("walletOnceCountSum", walletOnceCountSum.toString()); + // 单次扣减 + map.put("walletOnceReducePriceSum", walletOnceReducePriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString()); + map.put("walletOnceReduceCountSum", walletOnceReduceCountSum.toString()); + map.put("orderPayPriceSum", orderPayPriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString()); map.put("orderPayCountSum", orderPayCountSum.toString()); map.put("orderRefundPriceSum", orderRefundPriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString()); 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 c98ffd0ba..3d864c734 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 @@ -3,6 +3,7 @@ package com.bsd.pjcloud.hard.service.impl.order; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.bsd.pjcloud.admin.api.dto.DeptAllListDto; import com.bsd.pjcloud.admin.api.entity.SysDept; import com.bsd.pjcloud.admin.api.feign.RemoteDeptService; import com.bsd.pjcloud.common.core.util.CollectionUtils; @@ -58,6 +59,9 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService { 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)) { // 商户 @@ -84,6 +88,16 @@ 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)) { // 商户 @@ -110,6 +124,16 @@ 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)) { // 商户 @@ -126,6 +150,16 @@ 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)) { // 商户 @@ -143,9 +177,24 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService { @Override public List pageListDept(HardDeptTotalDto dto) { // 查询部门 - CompletableFuture> deptFuture = CompletableFuture.supplyAsync(() -> - remoteDeptService.getInnerAllDept().getData() - ); + 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(); + if (ObjectUtil.isNotEmpty(dto.getDeptId())) { + deptDto.setDeptId(dto.getDeptId()); + } + if (ObjectUtil.isNotEmpty(dto.getDeptIds())) { + deptDto.setDeptId(null); + deptDto.setDeptIds(dto.getDeptIds()); + } + return remoteDeptService.getInnerAllDept(deptDto).getData(); + }); CompletableFuture> resultListFuture = deptFuture.thenApply(deptList -> { if (ObjectUtil.isEmpty(deptList)) return null; List deptIds = deptList.stream().map(SysDept::getDeptId).filter(ObjectUtil::isNotEmpty).distinct().toList(); diff --git a/pjcloud-hardware/pjcloud-hardware-biz/src/main/resources/file/部门交易金额汇总.xlsx b/pjcloud-hardware/pjcloud-hardware-biz/src/main/resources/file/部门交易金额汇总.xlsx index 9b748b978..64cf479c5 100644 Binary files a/pjcloud-hardware/pjcloud-hardware-biz/src/main/resources/file/部门交易金额汇总.xlsx and b/pjcloud-hardware/pjcloud-hardware-biz/src/main/resources/file/部门交易金额汇总.xlsx differ 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 new file mode 100644 index 000000000..3ab530b89 --- /dev/null +++ b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/DeptAllListDto.java @@ -0,0 +1,14 @@ +package com.bsd.pjcloud.admin.api.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class DeptAllListDto { + + private Long deptId; + + private List deptIds; + +} diff --git a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/feign/RemoteDeptService.java b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/feign/RemoteDeptService.java index 494715601..7764a7bc6 100644 --- a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/feign/RemoteDeptService.java +++ b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/feign/RemoteDeptService.java @@ -20,14 +20,13 @@ package com.bsd.pjcloud.admin.api.feign; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.bsd.pjcloud.admin.api.dto.DeptAllListDto; import com.bsd.pjcloud.admin.api.entity.SysDept; import com.bsd.pjcloud.common.core.constant.ServiceNameConstants; import com.bsd.pjcloud.common.core.util.R; import com.bsd.pjcloud.common.feign.annotation.NoToken; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Map; @@ -55,8 +54,8 @@ public interface RemoteDeptService { * @return */ @NoToken - @GetMapping("/dept/inner-all-dept") - R> getInnerAllDept(); + @PostMapping("/dept/inner-all-dept") + R> getInnerAllDept(@RequestBody DeptAllListDto dto); /** * 通过部门ID获取负责人列表 diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysDeptController.java b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysDeptController.java index b2729e309..26b33f8a5 100644 --- a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysDeptController.java +++ b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysDeptController.java @@ -22,6 +22,7 @@ package com.bsd.pjcloud.admin.controller; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.bsd.pjcloud.admin.api.dto.DeptAllListDto; import com.bsd.pjcloud.admin.api.entity.SysDept; import com.bsd.pjcloud.admin.api.vo.DeptExcelVO; import com.bsd.pjcloud.admin.mapper.SysDeptMapper; @@ -227,8 +228,8 @@ public class SysDeptController { } @Inner - @GetMapping("/inner-all-dept") - public R> getInnerAllDept() { - return R.ok(sysDeptMapper.allList()); + @PostMapping("/inner-all-dept") + public R> getInnerAllDept(@RequestBody DeptAllListDto dto) { + return R.ok(sysDeptMapper.allList(dto)); } } diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/mapper/SysDeptMapper.java b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/mapper/SysDeptMapper.java index a98cfa300..ea117d28f 100644 --- a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/mapper/SysDeptMapper.java +++ b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/mapper/SysDeptMapper.java @@ -19,9 +19,11 @@ package com.bsd.pjcloud.admin.mapper; +import com.bsd.pjcloud.admin.api.dto.DeptAllListDto; import com.bsd.pjcloud.admin.api.entity.SysDept; import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -36,5 +38,6 @@ import java.util.List; @Mapper public interface SysDeptMapper extends PjcloudBaseMapper { - List allList(); + List allList(@Param("dto") DeptAllListDto dto); + } 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 3925e0d0f..ba70eee4e 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 @@ -46,18 +46,33 @@ a.tenant_id + + + AND a.dept_id = #{dto.deptId} + + + and a.dept_id IN + + #{v} + + + + 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 88449bb48..d5555cdc2 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 @@ -40,4 +40,14 @@ public class WalletTransactionDto extends WalletTransactionEntity { */ private Boolean isFindOrder = false; + /** + * 是否深度搜索deptId + */ + private Boolean isDeepDept; + + /** + * 部门ids + */ + private List deptIds; + } 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 f9ccbcf5b..6eee9c65b 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 @@ -93,8 +93,8 @@ public class WalletTransactionController { } @Operation(summary = "后台充值分页", description = "后台充值分页") - @GetMapping("/page-cz") - public R pageCz(@ParameterObject Page page, @ParameterObject WalletTransactionDto dto) { + @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(); @@ -102,8 +102,8 @@ public class WalletTransactionController { } @Operation(summary = "后台消费分页", description = "后台消费分页") - @GetMapping("/page-xf") - public R pageXf(@ParameterObject Page page, @ParameterObject WalletTransactionDto dto) { + @PostMapping("/page-xf") + public R pageXf(@ParameterObject Page page, @RequestBody WalletTransactionDto dto) { dto.setBizTypes(List.of(WalletBizEnum.PAYMENT.getCode())); dto.setIsFindOrder(true); DataScope dataScope = new DataScope(); @@ -111,8 +111,8 @@ public class WalletTransactionController { } @Operation(summary = "后台退款分页", description = "后台退款分页") - @GetMapping("/page-tk") - public R pageTk(@ParameterObject Page page, @ParameterObject WalletTransactionDto dto) { + @PostMapping("/page-tk") + public R pageTk(@ParameterObject Page page, @RequestBody WalletTransactionDto dto) { dto.setBizTypes(List.of(WalletBizEnum.REFUND.getCode())); dto.setIsFindOrder(true); DataScope dataScope = new DataScope(); @@ -159,27 +159,27 @@ public class WalletTransactionController { } @Operation(summary = "充值导出", description = "充值导出") - @GetMapping("/export-cz") + @PostMapping("/export-cz") @PreAuthorize("@pms.hasPermission('wallet_walletTransaction_export')") - public void exportCz(HttpServletResponse response, @ParameterObject Page page, WalletTransactionDto dto) { + public void exportCz(HttpServletResponse response, @ParameterObject Page page, @RequestBody WalletTransactionDto dto) { dto.setBizTypes(List.of(WalletBizEnum.RECHARGE.getCode())); List list = walletTransactionService.scopePageList(page, dto, DataScope.of()).getRecords(); walletTransactionService.exportByTemplate(response, dto, "file/个人充值明细.xlsx", list); } @Operation(summary = "消费导出", description = "消费导出") - @GetMapping("/export-xf") + @PostMapping("/export-xf") @PreAuthorize("@pms.hasPermission('wallet_walletTransaction_export')") - public void exportXf(HttpServletResponse response, @ParameterObject Page page, WalletTransactionDto dto) { + public void exportXf(HttpServletResponse response, @ParameterObject Page page, @RequestBody WalletTransactionDto dto) { dto.setBizTypes(List.of(WalletBizEnum.PAYMENT.getCode())); List list = walletTransactionService.scopePageList(page, dto, DataScope.of()).getRecords(); walletTransactionService.exportByTemplate(response, dto, "file/个人消费明细.xlsx", list); } @Operation(summary = "退款导出", description = "退款导出") - @GetMapping("/export-tk") + @PostMapping("/export-tk") @PreAuthorize("@pms.hasPermission('wallet_walletTransaction_export')") - public void exportTk(HttpServletResponse response, @ParameterObject Page page, WalletTransactionDto dto) { + public void exportTk(HttpServletResponse response, @ParameterObject Page page, @RequestBody WalletTransactionDto dto) { dto.setBizTypes(List.of(WalletBizEnum.REFUND.getCode())); dto.setIsFindOrder(true); List list = walletTransactionService.scopePageList(page, dto, DataScope.of()).getRecords(); 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 ee718d60f..bad6fd667 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 @@ -51,7 +51,9 @@ public interface WalletTransactionMapper extends PjcloudBaseMapper wrapper = new LambdaQueryWrapper() .eq(ObjectUtil.isNotEmpty(dto.getWalletId()), WalletTransactionEntity::getWalletId, dto.getWalletId()) .eq(ObjectUtil.isNotEmpty(dto.getBizType()), WalletTransactionEntity::getBizType, dto.getBizType()) + .eq(ObjectUtil.isNotEmpty(dto.getDeptId()), WalletTransactionEntity::getDeptId, dto.getDeptId()) .in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletTransactionEntity::getUserId, dto.getUserIds()) + .in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletTransactionEntity::getDeptId, dto.getDeptIds()) .in(ObjectUtil.isNotEmpty(dto.getBizTypes()), WalletTransactionEntity::getBizType, dto.getBizTypes()) .between( ObjectUtil.isNotEmpty(dto.getCreateTimeList()), 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 c5af86710..579149818 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 @@ -50,6 +50,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 会员钱包流水表 @@ -166,6 +167,17 @@ 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); if (ObjectUtil.isNotEmpty(list.getRecords())) { // 用户