fix:商户交易记录、设备交易记录查询bug

This commit is contained in:
dzc committed 2025-04-03 17:31:43 +08:00
1 parent c2c5cfc971
commit b07d43a339
1 file changed
+18 -11
@@ -66,24 +66,27 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
*/
@Override
public List<HardOrderSbVo> listSb(HardOrderDto dto) {
DataScope dataScope = DataScope.of().func(DataScopeFuncEnum.ALL);
dataScope.setScopeDeptName("merchant_dept_id");
PjcloudUser user = SecurityUtils.getUser();
CurrentUserHardTypeInfoDto hardTypeInfo = hardManagerService.getCurrentUserHardTypeInfo(user);
dto.setMchTypeCodes(hardTypeInfo.getHardTypeList());
// 查询总流水
HardOrderDto totalDto = BeanUtil.toBean(dto, HardOrderDto.class);
totalDto.setOrderStatusCodes(HardOrderStatusEnum.getPayPrice());
List<HardOrderSbVo> totalList = hardOrderMapper.listSb(totalDto, dataScope);
DataScope totalDataScope = DataScope.of().func(DataScopeFuncEnum.ALL);
totalDataScope.setScopeDeptName("merchant_dept_id");
List<HardOrderSbVo> totalList = hardOrderMapper.listSb(totalDto, totalDataScope);
// 扣款总流水
HardOrderDto refundDto = BeanUtil.toBean(dto, HardOrderDto.class);
refundDto.setOrderStatusCodes(HardOrderStatusEnum.getPayErrorCodes());
List<HardOrderSbVo> refundList = hardOrderMapper.listSb(refundDto, dataScope);
DataScope refundDataScope = DataScope.of().func(DataScopeFuncEnum.ALL);
refundDataScope.setScopeDeptName("merchant_dept_id");
List<HardOrderSbVo> refundList = hardOrderMapper.listSb(refundDto, refundDataScope);
// 盈利
HardOrderDto profitDto = BeanUtil.toBean(dto, HardOrderDto.class);
profitDto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
List<HardOrderSbVo> profitList = hardOrderMapper.listSb(profitDto, dataScope);
DataScope profitDataScope = DataScope.of().func(DataScopeFuncEnum.ALL);
profitDataScope.setScopeDeptName("merchant_dept_id");
List<HardOrderSbVo> profitList = hardOrderMapper.listSb(profitDto, profitDataScope);
// 聚合一下数据
for (HardOrderSbVo v : totalList) {
// 退款
@@ -129,23 +132,27 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
*/
@Override
public List<HardOrderCsVo> listCs(HardOrderDto dto) {
DataScope dataScope = DataScope.of();
dataScope.setScopeDeptName("merchant_dept_id");
PjcloudUser user = SecurityUtils.getUser();
CurrentUserHardTypeInfoDto hardTypeInfo = hardManagerService.getCurrentUserHardTypeInfo(user);
dto.setMchTypeCodes(hardTypeInfo.getHardTypeList());
// 查询总流水
HardOrderDto totalDto = BeanUtil.toBean(dto, HardOrderDto.class);
totalDto.setOrderStatusCodes(HardOrderStatusEnum.getPayPrice());
List<HardOrderCsVo> totalList = hardOrderMapper.listCs(totalDto, dataScope);
DataScope totalDataScope = DataScope.of();
totalDataScope.setScopeDeptName("merchant_dept_id");
List<HardOrderCsVo> totalList = hardOrderMapper.listCs(totalDto, totalDataScope);
// 扣款总流水
HardOrderDto refundDto = BeanUtil.toBean(dto, HardOrderDto.class);
refundDto.setOrderStatusCodes(HardOrderStatusEnum.getPayErrorCodes());
List<HardOrderCsVo> refundList = hardOrderMapper.listCs(refundDto, dataScope);
DataScope refundDataScope = DataScope.of();
refundDataScope.setScopeDeptName("merchant_dept_id");
List<HardOrderCsVo> refundList = hardOrderMapper.listCs(refundDto, refundDataScope);
// 盈利
HardOrderDto profitDto = BeanUtil.toBean(dto, HardOrderDto.class);
profitDto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
List<HardOrderCsVo> profitList = hardOrderMapper.listCs(profitDto, dataScope);
DataScope profitDataScope = DataScope.of();
profitDataScope.setScopeDeptName("merchant_dept_id");
List<HardOrderCsVo> profitList = hardOrderMapper.listCs(profitDto, profitDataScope);
for (HardOrderCsVo v : totalList) {
// 退款
if (ObjectUtil.isNotEmpty(refundList)) {