From 8e52b85a55710327c4c39e075d05cad2258ad44b Mon Sep 17 00:00:00 2001 From: gaowdong Date: Thu, 24 Apr 2025 10:30:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/domain/param/AccountInfoQueryParam.java | 5 ----- .../account/service/impl/AccInfoServiceImpl.java | 8 +++++--- .../service/impl/AccOperationHistoryServiceImpl.java | 6 +++--- .../core/account/service/impl/AccSubServiceImpl.java | 8 +++++--- .../account/service/impl/AccTradeServiceImpl.java | 6 +++--- .../report/controller/TradeReportController.java | 12 ++++++------ .../report/service/impl/TradeReportServiceImpl.java | 10 +++++++++- 7 files changed, 31 insertions(+), 24 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccountInfoQueryParam.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccountInfoQueryParam.java index 1a98b63..583d00a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccountInfoQueryParam.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccountInfoQueryParam.java @@ -28,9 +28,4 @@ public class AccountInfoQueryParam extends BaseEntity { // private BigDecimal walletMinAmount; // @ApiModelProperty("钱包最大金额") // private BigDecimal walletMaxAmount; - - public AccountInfoQueryParam() { - this.endDateTime = LocalDateTime.now().plusDays(7); - this.startDateTime = LocalDateTime.now().minusDays(7); - } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccInfoServiceImpl.java index 3ce1368..ae1c6c4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccInfoServiceImpl.java @@ -470,9 +470,11 @@ public class AccInfoServiceImpl implements IAccInfoService { @Override public List queryAccPersonalWalOperationAddList(AccWalletOperationQueryParam param) { List operationListVOList = accTradeService.queryAccOperationList(param); - operationListVOList = operationListVOList.stream().peek(operation -> { - operation.setPhoneNumber(SM4EncryptUtils.sm4Decrypt(operation.getPhoneNumber())); - }).collect(Collectors.toList()); + if(CollUtil.isNotEmpty(operationListVOList)) { + for(AccOperationListVO vo: operationListVOList) { + vo.setPhoneNumber(SM4EncryptUtils.sm4Decrypt(vo.getPhoneNumber())); + } + } return operationListVOList ; } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccOperationHistoryServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccOperationHistoryServiceImpl.java index 1a25da8..cd37c0d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccOperationHistoryServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccOperationHistoryServiceImpl.java @@ -31,9 +31,9 @@ public class AccOperationHistoryServiceImpl extends ServiceImpl operationRecordList = this.baseMapper.queryPageAccOperationRecord(param, encryptedSearchValue); if(CollUtil.isNotEmpty(operationRecordList)) { - operationRecordList = operationRecordList.stream().peek(accOperationRecord -> { - accOperationRecord.setPhone(SM4EncryptUtils.sm4Decrypt(accOperationRecord.getPhone())); - }).collect(Collectors.toList()); + for(AccOperationHistory history : operationRecordList) { + history.setPhone(SM4EncryptUtils.sm4Decrypt(history.getPhone())); + } } return operationRecordList; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccSubServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccSubServiceImpl.java index fd57a02..ae9244a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccSubServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccSubServiceImpl.java @@ -368,9 +368,11 @@ public class AccSubServiceImpl implements AccSubService { @Override public List queryAccSubOperationList(AccWalletOperationQueryParam param) { List operationListVOList = accTradeService.queryAccOperationList(param); - operationListVOList = operationListVOList.stream().peek(operation -> { - operation.setPhoneNumber(SM4EncryptUtils.sm4Decrypt(operation.getPhoneNumber())); - }).collect(Collectors.toList()); + if(CollUtil.isNotEmpty(operationListVOList)) { + for(AccOperationListVO vo: operationListVOList) { + vo.setPhoneNumber(SM4EncryptUtils.sm4Decrypt(vo.getPhoneNumber())); + } + } return operationListVOList ; } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java index b558f96..99d0922 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java @@ -140,9 +140,9 @@ public class AccTradeServiceImpl implements IAccTradeService { String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(param.getSearchValue()); List list = accTradeMapper.queryAccOperationList(param, encryptedSearchValue); if(CollUtil.isNotEmpty(list)) { - list = list.stream().peek(operation -> { - operation.setPhoneNumber(SM4EncryptUtils.sm4Decrypt(operation.getPhoneNumber())); - }).collect(Collectors.toList()); + for(AccOperationListVO vo : list) { + vo.setPhoneNumber(SM4EncryptUtils.sm4Decrypt(vo.getPhoneNumber())); + } } return list; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/report/controller/TradeReportController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/report/controller/TradeReportController.java index 70b4daa..8a9cbb5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/report/controller/TradeReportController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/report/controller/TradeReportController.java @@ -34,7 +34,7 @@ public class TradeReportController extends BaseController @ApiOperation("交易流水") @PostMapping("/flow") @ResponseBody - public TableDataInfo tradeFlowList(TradeFlowParam param) + public TableDataInfo tradeFlowList(@RequestBody TradeFlowParam param) { startPage(); List list = tradeReportService.selectTradeFlow(param); @@ -43,7 +43,7 @@ public class TradeReportController extends BaseController @ApiOperation("营业汇总") @PostMapping("/revenue/operating") @ResponseBody - public TableDataInfo selectOperatingRevenue(OperatingRevenueParam param) + public TableDataInfo selectOperatingRevenue(@RequestBody OperatingRevenueParam param) { startPage(); List list = tradeReportService.selectOperatingRevenue(param); @@ -52,7 +52,7 @@ public class TradeReportController extends BaseController @ApiOperation("食堂档口汇总") @PostMapping("/revenue/canteen") @ResponseBody - public TableDataInfo selectCanteenStallRevenue(CanteenStallRevenueParam param) + public TableDataInfo selectCanteenStallRevenue(@RequestBody CanteenStallRevenueParam param) { startPage(); List list = tradeReportService.selectCanteenStallRevenue(param); @@ -61,7 +61,7 @@ public class TradeReportController extends BaseController @ApiOperation("设备汇总") @PostMapping("/revenue/device") @ResponseBody - public TableDataInfo selectDeviceRevenue(DeviceRevenueParam param) + public TableDataInfo selectDeviceRevenue(@RequestBody DeviceRevenueParam param) { startPage(); List list = tradeReportService.selectDeviceRevenue(param); @@ -70,7 +70,7 @@ public class TradeReportController extends BaseController @ApiOperation("个人消费汇总") @PostMapping("/revenue/user") @ResponseBody - public TableDataInfo selectUserRevenue(UserRevenueParam param) + public TableDataInfo selectUserRevenue(@RequestBody UserRevenueParam param) { startPage(); List list = tradeReportService.selectUserRevenue(param); @@ -79,7 +79,7 @@ public class TradeReportController extends BaseController @ApiOperation("菜品销售汇总") @PostMapping("/revenue/goods") @ResponseBody - public TableDataInfo selectGoodsRevenue(GoodsRevenueParam param) + public TableDataInfo selectGoodsRevenue(@RequestBody GoodsRevenueParam param) { startPage(); List list = tradeReportService.selectGoodsRevenue(param); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/report/service/impl/TradeReportServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/report/service/impl/TradeReportServiceImpl.java index b08d343..215b165 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/report/service/impl/TradeReportServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/report/service/impl/TradeReportServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.canteen.core.report.service.impl; +import cn.hutool.core.collection.CollUtil; import com.bonus.canteen.core.report.domain.*; import com.bonus.canteen.core.report.mapper.TradeReportMapper; import com.bonus.canteen.core.report.service.TradeReportService; @@ -8,6 +9,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; +import java.util.stream.Collectors; @Service public class TradeReportServiceImpl implements TradeReportService { @@ -17,7 +19,13 @@ public class TradeReportServiceImpl implements TradeReportService { @Override public List selectTradeFlow(TradeFlowParam param) { String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(param.getSearchValue()); - return tradeReportMapper.selectTradeFlow(param, encryptedSearchValue); + List tradeFlowVOList = tradeReportMapper.selectTradeFlow(param, encryptedSearchValue); + if(CollUtil.isNotEmpty(tradeFlowVOList)) { + for(TradeFlowVO vo : tradeFlowVOList) { + vo.setPhonenumber(SM4EncryptUtils.sm4Decrypt(vo.getPhonenumber())); + } + } + return tradeFlowVOList; } @Override From e99880855121f909a4d00685a0eda94c1e89a0d1 Mon Sep 17 00:00:00 2001 From: gaowdong Date: Thu, 24 Apr 2025 11:04:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/domain/param/AccWalletOperationQueryParam.java | 1 + .../src/main/resources/mapper/account/AccTradeMapper.xml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccWalletOperationQueryParam.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccWalletOperationQueryParam.java index 0e26c2b..b3d9b52 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccWalletOperationQueryParam.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccWalletOperationQueryParam.java @@ -21,6 +21,7 @@ public class AccWalletOperationQueryParam extends BaseEntity { private LocalDateTime endDateTime; @ApiModelProperty("交易类型") private Integer tradeType; + private Integer payState; private String searchValue; private String createBy; private Long userId; diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccTradeMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccTradeMapper.xml index 906fa4f..3bdfd42 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccTradeMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccTradeMapper.xml @@ -242,7 +242,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN sys_dept sd ON sd.dept_id = ate.dept_id LEFT JOIN acc_trade_wallet_detail atwd ON ate.trade_id = atwd.trade_id - ate.trade_type = #{param.tradeType} and ate.pay_state = 3 + + ate.trade_type = #{param.tradeType} + + + and ate.pay_state = #{param.payState} + and ate.trade_time = ]]> #{param.startDateTime}