From 9a8c7d5aced94a4587def9b831cc1e4aa0b2eef1 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Wed, 19 Feb 2025 15:19:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=AE=B0=E5=BD=95=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=83=A8=E9=97=A8=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hard/api/dto/order/HardDeptTotalDto.java | 10 +++ .../order/HardOrderTotalController.java | 66 +++++++++++++++--- .../impl/order/HardOrderTotalServiceImpl.java | 55 ++++++++++++++- .../main/resources/file/部门交易金额汇总.xlsx | Bin 10059 -> 10244 bytes .../pjcloud/admin/api/dto/DeptAllListDto.java | 14 ++++ .../admin/api/feign/RemoteDeptService.java | 9 ++- .../admin/controller/SysDeptController.java | 7 +- .../pjcloud/admin/mapper/SysDeptMapper.java | 5 +- .../main/resources/mapper/SysDeptMapper.xml | 37 +++++++--- .../wallet/api/dto/WalletTransactionDto.java | 10 +++ .../WalletTransactionController.java | 24 +++---- .../mapper/WalletTransactionMapper.java | 2 + .../impl/WalletTransactionServiceImpl.java | 12 ++++ 13 files changed, 208 insertions(+), 43 deletions(-) create mode 100644 pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/dto/DeptAllListDto.java 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 9b748b9782bbab681cbe45a1f101c6d615be3788..64cf479c50bb95fed2245f28da21ab5325a5c355 100644 GIT binary patch delta 2004 zcmV;_2P^o?PJ~dfjRAi$M$uYc0RRAJ0ssIJ0001FZ(~q$Z*X%jV{dY0E_iKhg_2uJ z#4s3z-v#$j^4_Mm5e;nzFAN9{3RV=~Lh{c{u}w=7?aU6m;11k`Z!Sp1Wtg@zV+REv z^PiJ1=lmoZ&Wqf-1F5o7#K?18WPxBM&%`uF7wO2}MV8W3aGHOY0%EiPg@(!YR>Ug8 zN(pDOtU&4vlx0Xl5mv=$rgcRyR%`|ZRgQ58BTh9g;wb~i%c&n(`gyE&*rQX*Y3H> z*2cQ7ojPb^nEZbpz8asLw^i*-G`nJel87_HBv4(-WZ$%%fpvCz9O2%$Sz%6<9-D1X zGT;Y`VEjOse)Uv_hc>@jm%4F;!mc# zNSR?EK9hs*c5%q2JUpf>Q)Lpt5~`qnd5Cj)&h{34DqkdM0dqaqb5-KBd{X5LI*t0$ zI22s+opM8-dSz+NS@yktZJue^N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c)@dL^z@qU36}1K&1TU5NcRLw_q+_k4&OwL z>5>9$!RYlR(LOXy%!|~}XVdtLq_{Rkm=DRmrsymM3`JE0vF%$F=58{F5=U-Rzj({r=9#(I2LL0kfSDbQ1!WA(Im%KLYqTPHgKgOishAsi~Jwapy^0080$000;O0000000031AOHXWuLP6N Q1R9g>ClCfMBLDyZ05=aR{{R30 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())) { // 用户