feat:是否开启用于100元跨单位吃饭

This commit is contained in:
dzc committed 2025-09-30 09:35:54 +08:00
1 parent b68f0bbad9
commit d7b9c4293e
5 files changed
+23 -1

No files matched your search

@@ -57,6 +57,12 @@ public class WalletRuleJoinEntity extends Model<WalletRuleJoinEntity> {
@Schema(description = "是否启用")
private String status;
/**
* 是否保留100元(用户跨单位支付)
*/
@Schema(description = "是否保留100元(用户跨单位支付)")
private String isReservePrice;
/**
* 创建人
*/
@@ -67,4 +67,9 @@ public class WalletRuleJoinUserConfigVo {
*/
private Integer balanceMultiple;
/**
* 是否保留100元用于钱包支付
*/
private String isReservePrice;
}
@@ -184,6 +184,7 @@ public class WalletRuleJoinServiceImpl extends ServiceImpl<WalletRuleJoinMapper,
throw new RuntimeException("该用户所属的部门<" + sysDept.getName() + ">未配置未打开");
}
configVo.setBalanceMultiple(walletRuleJoin.getBalanceMultiple());
configVo.setIsReservePrice(walletRuleJoin.getIsReservePrice());
// 计算最大可以转过去的金额
Long maxTransferBalance = BigDecimal.valueOf(sourceWallet.getTotalRecharge()).multiply(BigDecimal.valueOf(walletRuleJoin.getBalanceMultiple())).divide(BigDecimal.valueOf(100)).setScale(0, RoundingMode.HALF_UP).longValue();
configVo.setMaxTransferBalance(maxTransferBalance);
@@ -130,7 +130,10 @@ public class WalletRuleTransactionServiceImpl extends ServiceImpl<WalletRuleTran
// 查询源饭卡
if (ObjectUtil.equals(userConfig.getSourceWalletUniqueCode(), WalletTypeEnum.EAT.getCode())) {
if (price < 10000) {
throw new RuntimeException(WalletTypeEnum.EAT.getDesc() + "余额必须留100元用于公务餐");
// 是否开启用于100元跨单位吃饭
if (ObjectUtil.equals(userConfig.getIsReservePrice(), YesNoEnum.YES.getCode())) {
throw new RuntimeException(WalletTypeEnum.EAT.getDesc() + "余额必须留100元用于公务餐");
}
}
}
// 是否已经超过最大限制
@@ -24,6 +24,7 @@
a.target_dept_id,
a.balance_multiple,
a.status,
a.is_reserve_price,
a.create_by,
a.create_time,
a.update_by,
@@ -34,6 +35,12 @@
<sql id="whereA">
a.del_flag = 0
<if test="dto.targetDeptId != null">
and a.target_dept_id = #{dto.targetDeptId}
</if>
<if test="dto.status != null and dto.status != '' ">
and a.status = #{dto.status}
</if>
<if test="dto.sourceWalletTypeId != null">
and a.source_wallet_type_id = #{dto.sourceWalletTypeId}
</if>