更新9.28

This commit is contained in:
许允枞 2024-09-28 10:31:40 +08:00
parent bba101f127
commit b8bdbaab89
2 changed files with 21 additions and 33 deletions

View File

@ -15,6 +15,9 @@
<if test="fleetLinesChange.storeId != null and fleetLinesChange.storeId != ''">
and fc.store_id = #{fleetLinesChange.storeId}
</if>
<if test="fleetLinesChange.userId != null and fleetLinesChange.userId != ''">
and fc.user_id = #{fleetLinesChange.userId}
</if>
<if test="fleetLinesChange.adjustType != null and fleetLinesChange.adjustType != ''">
and fc.adjust_type = #{fleetLinesChange.adjustType}
</if>

View File

@ -154,10 +154,10 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
mtUser.setCreateTime(DateUtil.date());
mtUserMapper.insert(mtUser);
//注册完成后再查询一次
mtUser = mtUserMapper.selectOne(new LambdaQueryWrapper<MtUser>()
.eq(MtUser::getMobile, fleetMember.getMobile())
.last("limit 1"));
// //注册完成后再查询一次
// mtUser = mtUserMapper.selectOne(new LambdaQueryWrapper<MtUser>()
// .eq(MtUser::getMobile, fleetMember.getMobile())
// .last("limit 1"));
createVaseInfo(mtUser, nowAccountInfo.getStoreId().toString(), null, null);
}
@ -203,29 +203,6 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
if (ObjectUtil.isNotEmpty(fleetMember1) && fleetMember1.getId() != fleetMember.getId()) {
return 0;
}
// //添加到车队额度变化表
// FleetLinesChange fleetLinesChange = new FleetLinesChange();
// if (ObjectUtil.isNotEmpty(fleetMember)) {
// fleetLinesChange.setFleetId(fleetMember.getFleetId());
// fleetLinesChange.setUserId(fleetMember.getUserId());
// fleetLinesChange.setStoreId(fleetMember.getStoreId());
// fleetLinesChange.setAdjustType(fleetMember.getAdjustType());
// fleetLinesChange.setAdjustLimit(fleetMember.getAdjustLimit());
// //剩余额度
// if (ObjectUtil.isNotEmpty(fleetMember1.getRemainingCreditLimit())) {
// if (fleetMember.getAdjustType().equals("0")) {
// fleetLinesChange.setRemainingCreditLimit(fleetMember1.getRemainingCreditLimit() + fleetMember.getAdjustLimit());
// } else {
// if (fleetMember1.getRemainingCreditLimit() < fleetMember.getAdjustLimit()) {
// throw new RuntimeException("当前剩余额度不足,无法扣除");
// }
// fleetLinesChange.setRemainingCreditLimit(fleetMember1.getRemainingCreditLimit() - fleetMember.getAdjustLimit());
// }
// }
// fleetLinesChange.setCreateBy(nowAccountInfo.getId().toString());
// fleetLinesChange.setCreateTime(DateUtil.date().toLocalDateTime());
// fleetLinesChangeService.insertFleetLinesChange(fleetLinesChange);
// }
return baseMapper.updateById(fleetMember);
}
@ -280,15 +257,23 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
throw new RuntimeException("共享副卡-不限额,暂不支持修改");
case 2:
//查询所有副卡类型为2的所剩额度的和
Double v = fleetInfoService.selectRemainCreditLimit(fleetMember.getFleetId());
if (v < fleetMember.getAdjustLimit()) {
throw new RuntimeException("当前车队卡剩余额度不足,无法扣除");
if (fleetMember.getAdjustType().equals("0")) {
Double v = fleetInfoService.selectRemainCreditLimit(fleetMember.getFleetId());
if (v < fleetMember.getAdjustLimit()) {
throw new RuntimeException("当前车队卡剩余额度不足,无法扣除");
}
}
break;
case 3:
FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId());
if (fleetInfo.getTotalBalance() < fleetMember.getAdjustLimit()) {
throw new RuntimeException("当前车队卡剩余额度不足,无法扣除");
if (fleetMember.getAdjustType().equals("0")) {
FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId());
if (fleetInfo.getTotalBalance() < fleetMember.getAdjustLimit()) {
throw new RuntimeException("当前车队卡剩余额度不足,无法扣除");
}
}else {
if (fleetMember1.getRemainingCreditLimit() < fleetMember.getAdjustLimit()) {
throw new RuntimeException("当前副卡剩余额度不足,无法扣除");
}
}
break;
}