Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0e2f1aa17a
26 files changed
+129
-38
No files matched your search
+6
-3
@@ -19,13 +19,15 @@ public interface HardGroupMapper extends PjcloudBaseMapper<HardGroupEntity> {
|
||||
|
||||
default Page<HardGroupVo> pageJoin(Page page, HardGroupDto dto) {
|
||||
MPJLambdaWrapper<HardGroupEntity> wrapper = new MPJLambdaWrapper<HardGroupEntity>()
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()),HardGroupEntity::getName, dto.getName());
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()), HardGroupEntity::getName, dto.getName())
|
||||
.orderByDesc(HardGroupEntity::getCreateTime);
|
||||
return selectJoinPage(page, HardGroupVo.class, wrapper);
|
||||
}
|
||||
|
||||
default Page<HardGroupVo> scopePageList(Page page, HardGroupDto dto) {
|
||||
LambdaQueryWrapper<HardGroupEntity> wrapper = new LambdaQueryWrapper<HardGroupEntity>()
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()), HardGroupEntity::getName, dto.getName());
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()), HardGroupEntity::getName, dto.getName())
|
||||
.orderByDesc(HardGroupEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardGroupVo.class));
|
||||
return list;
|
||||
@@ -34,7 +36,8 @@ public interface HardGroupMapper extends PjcloudBaseMapper<HardGroupEntity> {
|
||||
default List<HardGroupEntity> list(HardGroupDto dto) {
|
||||
LambdaQueryWrapper<HardGroupEntity> wrapper = new LambdaQueryWrapper<HardGroupEntity>()
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()), HardGroupEntity::getName, dto.getName())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getIds()), HardGroupEntity::getId, dto.getIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getIds()), HardGroupEntity::getId, dto.getIds())
|
||||
.orderByDesc(HardGroupEntity::getCreateTime);
|
||||
return selectList(wrapper);
|
||||
}
|
||||
}
|
||||
+2
-4
@@ -1,9 +1,6 @@
|
||||
package com.bsd.pjcloud.hard.mapper;
|
||||
|
||||
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.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardInvoiceDto;
|
||||
@@ -20,7 +17,8 @@ public interface HardInvoiceMapper extends PjcloudBaseMapper<HardInvoiceEntity>
|
||||
MPJLambdaWrapper<HardInvoiceEntity> wrapper = new MPJLambdaWrapper<HardInvoiceEntity>()
|
||||
.selectAll(HardInvoiceEntity.class)
|
||||
.eqIfExists(HardInvoiceEntity::getHardId, dto.getHardId())
|
||||
.eqIfExists(HardInvoiceEntity::getOrderId, dto.getOrderId());
|
||||
.eqIfExists(HardInvoiceEntity::getOrderId, dto.getOrderId())
|
||||
.orderByDesc(HardInvoiceEntity::getCreateTime);
|
||||
return selectJoinPage(page, HardInvoiceVo.class, wrapper);
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -25,7 +25,8 @@ public interface HardManagerMapper extends PjcloudBaseMapper<HardManagerEntity>
|
||||
.eqIfExists(HardManagerEntity::getType, dto.getType())
|
||||
.eqIfExists(HardManagerEntity::getMerchantId, dto.getMerchantId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), HardManagerEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getMerchantIds()), HardManagerEntity::getMerchantId, dto.getMerchantIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getMerchantIds()), HardManagerEntity::getMerchantId, dto.getMerchantIds())
|
||||
.orderByDesc(HardManagerEntity::getCreateTime);
|
||||
return selectJoinPage(page, HardManagerVo.class, wrapper);
|
||||
}
|
||||
|
||||
@@ -43,7 +44,8 @@ public interface HardManagerMapper extends PjcloudBaseMapper<HardManagerEntity>
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getType()), HardManagerEntity::getType, dto.getType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getType()), HardManagerEntity::getMerchantId, dto.getMerchantId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), HardManagerEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getMerchantIds()), HardManagerEntity::getMerchantId, dto.getMerchantIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getMerchantIds()), HardManagerEntity::getMerchantId, dto.getMerchantIds())
|
||||
.orderByDesc(HardManagerEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardManagerVo.class));
|
||||
return list;
|
||||
|
||||
+3
-1
@@ -5,6 +5,7 @@ import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardAfterSaleDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardAfterSaleEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardAfterSaleVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -15,7 +16,8 @@ public interface HardAfterSaleMapper extends PjcloudBaseMapper<HardAfterSaleEnti
|
||||
|
||||
default Page<HardAfterSaleVo> pageJoin(Page page, HardAfterSaleDto dto) {
|
||||
MPJLambdaWrapper<HardAfterSaleEntity> wrapper = new MPJLambdaWrapper<HardAfterSaleEntity>()
|
||||
.selectAll(HardAfterSaleEntity.class);
|
||||
.selectAll(HardAfterSaleEntity.class)
|
||||
.orderByDesc(HardAfterSaleEntity::getCreateTime);
|
||||
return selectJoinPage(page, HardAfterSaleVo.class, wrapper);
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -45,7 +45,8 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
HardOrderEntity::getPayTime,
|
||||
ObjectUtil.isNotEmpty(dto.getPayTimeList()) ? dto.getPayTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getPayTimeList()) ? dto.getPayTimeList()[1] : null
|
||||
);
|
||||
)
|
||||
.orderByDesc(HardOrderEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardOrderVo.class));
|
||||
return list;
|
||||
@@ -60,7 +61,8 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
.eqIfExists(HardOrderEntity::getOrderType, dto.getOrderType())
|
||||
.eqIfExists(HardOrderEntity::getPayType, dto.getPayType())
|
||||
.eqIfExists(HardOrderEntity::getOrderStatus, dto.getOrderStatus())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), HardOrderEntity::getUserId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), HardOrderEntity::getUserId, dto.getUserIds())
|
||||
.orderByDesc(HardOrderEntity::getCreateTime);
|
||||
return selectJoinPage(page, HardOrderVo.class, wrapper);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,5 +82,6 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
+1
@@ -93,5 +93,6 @@
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
+9
@@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@@ -19,6 +20,14 @@ public enum WalletBizEnum {
|
||||
|
||||
private final String desc;
|
||||
|
||||
public static List<String> getTopUpCodes() {
|
||||
return List.of(
|
||||
WalletBizEnum.UPDATE.getCode(),
|
||||
WalletBizEnum.BATCH.getCode(),
|
||||
WalletBizEnum.RECHARGE.getCode()
|
||||
);
|
||||
}
|
||||
|
||||
public static WalletBizEnum descOf(String description) {
|
||||
return Arrays.stream(WalletBizEnum.values())
|
||||
.filter(v -> ObjectUtil.equal(v.getDesc(), description))
|
||||
|
||||
+2
-1
@@ -95,7 +95,8 @@ public class WalletTransactionController {
|
||||
@Operation(summary = "后台充值分页", description = "后台充值分页")
|
||||
@GetMapping("/page-cz")
|
||||
public R pageCz(@ParameterObject Page page, @ParameterObject WalletTransactionDto dto) {
|
||||
dto.setBizTypes(List.of(WalletBizEnum.RECHARGE.getCode()));
|
||||
dto.setBizTypes(WalletBizEnum.getTopUpCodes());
|
||||
dto.setType(WalletTransactionDto.TYPE_INCOME);
|
||||
DataScope dataScope = new DataScope();
|
||||
return R.ok(walletTransactionService.scopePageList(page, dto, dataScope));
|
||||
}
|
||||
|
||||
+1
@@ -48,6 +48,7 @@ public class WalletTypeController {
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_view')" )
|
||||
public R getWalletTypePage(@ParameterObject Page page, @ParameterObject WalletTypeEntity walletType) {
|
||||
LambdaQueryWrapper<WalletTypeEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.orderByDesc(WalletTypeEntity::getCreateTime);
|
||||
return R.ok(walletTypeService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeImportDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
@@ -39,6 +40,14 @@ public class WalletRechargeImportController {
|
||||
|
||||
private final WalletRechargeImportService walletRechargeImportService;
|
||||
|
||||
@Operation(summary = "恢复", description = "恢复")
|
||||
@Idempotent(expireTime = 5, info = "正在处理中,请勿重复操作")
|
||||
@GetMapping("/recover")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeImport_recover')")
|
||||
public R<Boolean> recover(@RequestParam Long id) {
|
||||
return R.ok(walletRechargeImportService.recover(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeImport_view')")
|
||||
|
||||
+1
@@ -50,6 +50,7 @@ public class WalletRechargePackageController {
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargePackage_view')")
|
||||
public R getWalletRechargePackagePage(@ParameterObject Page page, @ParameterObject WalletRechargePackageEntity walletRechargePackage) {
|
||||
LambdaQueryWrapper<WalletRechargePackageEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.orderByDesc(WalletRechargePackageEntity::getCreateTime);
|
||||
return R.ok(walletRechargePackageService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
+8
-4
@@ -24,7 +24,8 @@ public interface MchManageMapper extends PjcloudBaseMapper<MchManageEntity> {
|
||||
.selectAll(MchManageEntity.class)
|
||||
.likeIfExists(MchManageEntity::getName, dto.getName())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), MchManageEntity::getDeptId, dto.getDeptIds())
|
||||
.apply(ObjectUtil.isNotEmpty(dto.getType()), "FIND_IN_SET({0}, types)", dto.getType());
|
||||
.apply(ObjectUtil.isNotEmpty(dto.getType()), "FIND_IN_SET({0}, types)", dto.getType())
|
||||
.orderByDesc(MchManageEntity::getCreateTime);
|
||||
return selectJoinPage(page, MchManageVo.class, wrapper);
|
||||
}
|
||||
|
||||
@@ -40,7 +41,8 @@ public interface MchManageMapper extends PjcloudBaseMapper<MchManageEntity> {
|
||||
.selectAll(MchManageEntity.class)
|
||||
.likeIfExists(MchManageEntity::getName, dto.getName())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), MchManageEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getIds()), MchManageEntity::getId, dto.getIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getIds()), MchManageEntity::getId, dto.getIds())
|
||||
.orderByDesc(MchManageEntity::getCreateTime);
|
||||
return selectJoinList(MchManageVo.class, wrapper);
|
||||
}
|
||||
|
||||
@@ -48,7 +50,8 @@ public interface MchManageMapper extends PjcloudBaseMapper<MchManageEntity> {
|
||||
LambdaQueryWrapper<MchManageEntity> wrapper = new LambdaQueryWrapper<MchManageEntity>()
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()), MchManageEntity::getName, dto.getName())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), MchManageEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getIds()), MchManageEntity::getId, dto.getIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getIds()), MchManageEntity::getId, dto.getIds())
|
||||
.orderByDesc(MchManageEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), MchManageVo.class));
|
||||
return list;
|
||||
@@ -58,7 +61,8 @@ public interface MchManageMapper extends PjcloudBaseMapper<MchManageEntity> {
|
||||
LambdaQueryWrapper<MchManageEntity> wrapper = new LambdaQueryWrapper<MchManageEntity>()
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()), MchManageEntity::getName, dto.getName())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), MchManageEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getIds()), MchManageEntity::getId, dto.getIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getIds()), MchManageEntity::getId, dto.getIds())
|
||||
.orderByDesc(MchManageEntity::getCreateTime);
|
||||
return selectListByScope(wrapper, DataScope.of());
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -21,7 +21,8 @@ public interface WalletActiveMapper extends PjcloudBaseMapper<WalletActiveEntity
|
||||
.likeIfExists(WalletActiveEntity::getCardNumber, dto.getCardNumber())
|
||||
.eqIfExists(WalletActiveEntity::getIsActiveHardware, dto.getIsActiveHardware())
|
||||
.eqIfExists(WalletActiveEntity::getDeptId, dto.getDeptId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletActiveEntity::getId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletActiveEntity::getId, dto.getUserIds())
|
||||
.orderByDesc(WalletActiveEntity::getCreateTime);
|
||||
return selectJoinPage(page, WalletActiveVo.class, wrapper);
|
||||
}
|
||||
|
||||
@@ -30,7 +31,8 @@ public interface WalletActiveMapper extends PjcloudBaseMapper<WalletActiveEntity
|
||||
.like(ObjectUtil.isNotEmpty(dto.getCardNumber()), WalletActiveEntity::getCardNumber, dto.getCardNumber())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getIsActiveHardware()), WalletActiveEntity::getIsActiveHardware, dto.getIsActiveHardware())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getDeptId()), WalletActiveEntity::getDeptId, dto.getDeptId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletActiveEntity::getId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletActiveEntity::getId, dto.getUserIds())
|
||||
.orderByDesc(WalletActiveEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), WalletActiveVo.class));
|
||||
return list;
|
||||
|
||||
+3
-1
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletCodeUseDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletActiveEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
@@ -23,7 +24,8 @@ public interface WalletCodeUseMapper extends PjcloudBaseMapper<WalletCodeUseEnti
|
||||
.eqIfExists(WalletCodeUseEntity::getBizId, dto.getBizId())
|
||||
.eqIfExists(WalletCodeUseEntity::getBizType, dto.getBizType())
|
||||
.eqIfExists(WalletCodeUseEntity::getStatus, dto.getStatus())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletCodeUseEntity::getUserId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletCodeUseEntity::getUserId, dto.getUserIds())
|
||||
.orderByDesc(WalletCodeUseEntity::getCreateTime);
|
||||
return selectJoinPage(page, WalletCodeUseVo.class, wrapper);
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -20,7 +20,8 @@ public interface WalletForeignMapper extends PjcloudBaseMapper<WalletForeignEnti
|
||||
.selectAll(WalletForeignEntity.class)
|
||||
.eqIfExists(WalletForeignEntity::getProcessStatus, dto.getProcessStatus())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletForeignEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletForeignEntity::getUserId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletForeignEntity::getUserId, dto.getUserIds())
|
||||
.orderByDesc(WalletForeignEntity::getCreateTime);
|
||||
return selectJoinPage(page, WalletForeignVo.class, wrapper);
|
||||
}
|
||||
|
||||
@@ -35,7 +36,8 @@ public interface WalletForeignMapper extends PjcloudBaseMapper<WalletForeignEnti
|
||||
LambdaQueryWrapper<WalletForeignEntity> wrapper = new LambdaQueryWrapper<WalletForeignEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getProcessStatus()), WalletForeignEntity::getProcessStatus, dto.getProcessStatus())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletForeignEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletForeignEntity::getUserId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletForeignEntity::getUserId, dto.getUserIds())
|
||||
.orderByDesc(WalletForeignEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), WalletForeignVo.class));
|
||||
return list;
|
||||
|
||||
+6
-3
@@ -75,7 +75,8 @@ public interface WalletManageMapper extends PjcloudBaseMapper<WalletManageEntity
|
||||
WalletManageEntity::getCreateTime,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
);
|
||||
)
|
||||
.orderByDesc(WalletManageEntity::getCreateTime);
|
||||
return selectJoinList(WalletManageVo.class, wrapper);
|
||||
}
|
||||
|
||||
@@ -85,7 +86,8 @@ public interface WalletManageMapper extends PjcloudBaseMapper<WalletManageEntity
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getWalletTypeId()), WalletManageEntity::getWalletTypeId, dto.getWalletTypeId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getIsFreeze()), WalletManageEntity::getIsFreeze, dto.getIsFreeze())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletIds()), WalletManageEntity::getId, dto.getWalletIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds())
|
||||
.orderByDesc(WalletManageEntity::getCreateTime);
|
||||
return selectList(wrapper);
|
||||
}
|
||||
|
||||
@@ -112,7 +114,8 @@ public interface WalletManageMapper extends PjcloudBaseMapper<WalletManageEntity
|
||||
WalletManageEntity::getCreateTime,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
);
|
||||
)
|
||||
.orderByDesc(WalletManageEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, dataScope);
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), WalletManageVo.class));
|
||||
return list;
|
||||
|
||||
+4
-2
@@ -20,7 +20,8 @@ public interface WalletStrideMapper extends PjcloudBaseMapper<WalletStrideEntity
|
||||
.selectAll(WalletStrideEntity.class)
|
||||
.eqIfExists(WalletStrideEntity::getProcessStatus, dto.getProcessStatus())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletStrideEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletStrideEntity::getUserId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletStrideEntity::getUserId, dto.getUserIds())
|
||||
.orderByDesc(WalletStrideEntity::getCreateTime);
|
||||
return selectJoinPage(page, WalletStrideVo.class, wrapper);
|
||||
}
|
||||
|
||||
@@ -35,7 +36,8 @@ public interface WalletStrideMapper extends PjcloudBaseMapper<WalletStrideEntity
|
||||
LambdaQueryWrapper<WalletStrideEntity> wrapper = new LambdaQueryWrapper<WalletStrideEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getProcessStatus()), WalletStrideEntity::getProcessStatus, dto.getProcessStatus())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletStrideEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletStrideEntity::getUserId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletStrideEntity::getUserId, dto.getUserIds())
|
||||
.orderByDesc(WalletStrideEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), WalletStrideVo.class));
|
||||
return list;
|
||||
|
||||
+4
-2
@@ -37,7 +37,8 @@ public interface WalletTransactionMapper extends PjcloudBaseMapper<WalletTransac
|
||||
.eqIfExists(WalletTransactionEntity::getBizType, dto.getBizType())
|
||||
.eqIfExists(WalletManageEntity::getWalletTypeId, dto.getWalletTypeId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getBizTypes()), WalletTransactionEntity::getBizType, dto.getBizTypes())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds())
|
||||
.orderByDesc(WalletTransactionEntity::getCreateTime);
|
||||
if (ObjectUtil.equals(dto.getType(), WalletTransactionDto.TYPE_INCOME)) {
|
||||
wrapper.gt(WalletTransactionEntity::getPrice, 0);
|
||||
} else if (Objects.equals(dto.getType(), WalletTransactionDto.TYPE_EXPENSE)) {
|
||||
@@ -57,7 +58,8 @@ public interface WalletTransactionMapper extends PjcloudBaseMapper<WalletTransac
|
||||
WalletTransactionEntity::getCreateTime,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
);
|
||||
)
|
||||
.orderByDesc(WalletTransactionEntity::getCreateTime);
|
||||
if (ObjectUtil.equals(dto.getType(), WalletTransactionDto.TYPE_INCOME)) {
|
||||
wrapper.gt(WalletTransactionEntity::getPrice, 0);
|
||||
} else if (Objects.equals(dto.getType(), WalletTransactionDto.TYPE_EXPENSE)) {
|
||||
|
||||
+7
-3
@@ -10,6 +10,7 @@ import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -27,7 +28,8 @@ public interface WalletRechargeApplyMapper extends PjcloudBaseMapper<WalletRecha
|
||||
.leftJoin(WalletTypeEntity.class, WalletTypeEntity::getId, WalletRechargeApplyEntity::getWalletTypeId)
|
||||
.eqIfExists(WalletRechargeApplyEntity::getWalletTypeId, dto.getWalletTypeId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletTypeIds()), WalletManageEntity::getWalletTypeId, dto.getWalletTypeIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletTypeIds()), WalletManageEntity::getWalletTypeId, dto.getWalletTypeIds())
|
||||
.orderByDesc(WalletRechargeApplyEntity::getCreateTime);
|
||||
return selectJoinPage(page, WalletRechargeApplyVo.class, wrapper);
|
||||
}
|
||||
|
||||
@@ -39,7 +41,8 @@ public interface WalletRechargeApplyMapper extends PjcloudBaseMapper<WalletRecha
|
||||
.leftJoin(WalletTypeEntity.class, WalletTypeEntity::getId, WalletRechargeApplyEntity::getWalletTypeId)
|
||||
.eqIfExists(WalletRechargeApplyEntity::getWalletTypeId, dto.getWalletTypeId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletTypeIds()), WalletManageEntity::getWalletTypeId, dto.getWalletTypeIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletTypeIds()), WalletManageEntity::getWalletTypeId, dto.getWalletTypeIds())
|
||||
.orderByDesc(WalletRechargeApplyEntity::getCreateTime);
|
||||
return selectJoinList(WalletRechargeApplyVo.class, wrapper);
|
||||
}
|
||||
|
||||
@@ -48,7 +51,8 @@ public interface WalletRechargeApplyMapper extends PjcloudBaseMapper<WalletRecha
|
||||
LambdaQueryWrapper<WalletRechargeApplyEntity> wrapper = new LambdaQueryWrapper<WalletRechargeApplyEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getWalletTypeId()), WalletRechargeApplyEntity::getWalletTypeId, dto.getWalletTypeId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletRechargeApplyEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletTypeIds()), WalletRechargeApplyEntity::getWalletTypeId, dto.getWalletTypeIds());
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletTypeIds()), WalletRechargeApplyEntity::getWalletTypeId, dto.getWalletTypeIds())
|
||||
.orderByDesc(WalletRechargeApplyEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), WalletRechargeApplyVo.class));
|
||||
return list;
|
||||
|
||||
+4
-2
@@ -20,14 +20,16 @@ public interface WalletRechargeImportMapper extends PjcloudBaseMapper<WalletRech
|
||||
default Page<WalletRechargeImportVo> pageJoin(Page page, WalletRechargeImportDto dto) {
|
||||
MPJLambdaWrapper<WalletRechargeImportEntity> wrapper = new MPJLambdaWrapper<WalletRechargeImportEntity>()
|
||||
.eqIfExists(WalletRechargeImportEntity::getId, dto.getId())
|
||||
.eqIfExists(WalletRechargeImportEntity::getApplyId, dto.getApplyId());
|
||||
.eqIfExists(WalletRechargeImportEntity::getApplyId, dto.getApplyId())
|
||||
.orderByDesc(WalletRechargeImportEntity::getCreateTime);
|
||||
return selectJoinPage(page, WalletRechargeImportVo.class, wrapper);
|
||||
}
|
||||
|
||||
default List<WalletRechargeImportVo> listJoin(WalletRechargeImportDto dto) {
|
||||
MPJLambdaWrapper<WalletRechargeImportEntity> wrapper = new MPJLambdaWrapper<WalletRechargeImportEntity>()
|
||||
.eqIfExists(WalletRechargeImportEntity::getId, dto.getId())
|
||||
.eqIfExists(WalletRechargeImportEntity::getApplyId, dto.getApplyId());
|
||||
.eqIfExists(WalletRechargeImportEntity::getApplyId, dto.getApplyId())
|
||||
.orderByDesc(WalletRechargeImportEntity::getCreateTime);
|
||||
return selectJoinList(WalletRechargeImportVo.class, wrapper);
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -15,7 +15,8 @@ public interface WalletRechargePackageMapper extends PjcloudBaseMapper<WalletRec
|
||||
|
||||
|
||||
default Page<WalletRechargePackageVo> pageJoin(Page page, WalletRechargePackageDto dto) {
|
||||
MPJLambdaWrapper<WalletRechargePackageEntity> wrapper = new MPJLambdaWrapper<WalletRechargePackageEntity>();
|
||||
MPJLambdaWrapper<WalletRechargePackageEntity> wrapper = new MPJLambdaWrapper<WalletRechargePackageEntity>()
|
||||
.orderByDesc(WalletRechargePackageEntity::getCreateTime);
|
||||
return selectJoinPage(page, WalletRechargePackageEntity.class, wrapper);
|
||||
}
|
||||
}
|
||||
+2
@@ -17,4 +17,6 @@ public interface WalletRechargeImportService extends IService<WalletRechargeImpo
|
||||
List<WalletRechargeImportVo> listJoin(WalletRechargeImportDto dto);
|
||||
|
||||
Page<WalletRechargeImportVo> scopePageList(Page page, WalletRechargeImportDto dto, DataScope dataScope);
|
||||
|
||||
Boolean recover(Long id);
|
||||
}
|
||||
+1
-1
@@ -312,7 +312,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
);
|
||||
if (ObjectUtil.isEmpty(detail)) return;
|
||||
if (!ObjectUtil.equals(detail.getProcessStatus(), TaskCheckStatusEnum.PADDING.getCode())) {
|
||||
log.error("|{}|重复的回调,dto:|{}|", TAG);
|
||||
log.error("|{}|重复的回调,dto:|{}|", TAG, JSON.toJSONString(dto));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
|
||||
+36
-2
@@ -1,6 +1,7 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.recharge;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserDTO;
|
||||
@@ -12,20 +13,26 @@ import com.bsd.pjcloud.admin.api.vo.UserVO;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletTypeDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeImportDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
import com.bsd.pjcloud.wallet.api.utils.WalletDataUtil;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeImportVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletTypeMapper;
|
||||
import com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeImportMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargeImportService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletTypeService;
|
||||
import com.bsd.pjcloud.wallet.service.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -43,6 +50,11 @@ import java.util.List;
|
||||
@Service
|
||||
public class WalletRechargeImportServiceImpl extends ServiceImpl<WalletRechargeImportMapper, WalletRechargeImportEntity> implements WalletRechargeImportService {
|
||||
|
||||
@Lazy
|
||||
private final WalletRechargeApplyService walletRechargeApplyService;
|
||||
private final WalletTransactionService walletTransactionService;
|
||||
private final WalletManageService walletManageService;
|
||||
|
||||
private final WalletTypeMapper walletTypeMapper;
|
||||
|
||||
private final RemoteUserService userService;
|
||||
@@ -104,4 +116,26 @@ public class WalletRechargeImportServiceImpl extends ServiceImpl<WalletRechargeI
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean recover(Long id) {
|
||||
WalletRechargeImportEntity rechargeImport = baseMapper.selectById(id);
|
||||
if (ObjectUtil.isEmpty(rechargeImport)) throw new RuntimeException("充值记录不存在");
|
||||
WalletRechargeApplyEntity rechargeApply = walletRechargeApplyService.getById(rechargeImport.getApplyId());
|
||||
if (ObjectUtil.isEmpty(rechargeApply)) throw new RuntimeException("充值申请不存在");
|
||||
WalletTypeEntity walletType = walletTypeMapper.selectById(rechargeApply.getWalletTypeId());
|
||||
WalletTypeEnum walletTypeEnum = WalletTypeEnum.valueOfByCode(walletType.getUniqueCode());
|
||||
if (ObjectUtil.isEmpty(walletType) || ObjectUtil.isEmpty(walletTypeEnum)) {
|
||||
throw new RuntimeException("钱包类型错误");
|
||||
}
|
||||
WalletTransactionEntity walletTransaction = walletTransactionService.getOne(new LambdaQueryWrapper<WalletTransactionEntity>()
|
||||
.eq(WalletTransactionEntity::getBizId, String.valueOf(rechargeImport.getId()))
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(walletTransaction)) throw new RuntimeException("钱包已经充值过");
|
||||
WalletManageEntity wallet = walletManageService.getOrCreateWallet(rechargeImport.getUserId(), walletTypeEnum);
|
||||
if (ObjectUtil.isEmpty(wallet)) throw new RuntimeException("钱包错误");
|
||||
walletTransactionService.addWalletBalance(wallet.getId(), rechargeImport.getPrice(), String.valueOf(rechargeImport.getId()), WalletBizEnum.BATCH);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+1
@@ -85,5 +85,6 @@
|
||||
and p.process_time between #{dto.processTimeList[0]} and #{dto.processTimeList[1]}
|
||||
</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user