更新9.28

This commit is contained in:
许允枞 2024-09-28 18:08:43 +08:00
parent fb5ec3d55f
commit 2176938b4e
5 changed files with 56 additions and 54 deletions

View File

@ -86,7 +86,7 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
FleetMember fleetMember1 = baseMapper.selectOne(new LambdaQueryWrapper<FleetMember>() FleetMember fleetMember1 = baseMapper.selectOne(new LambdaQueryWrapper<FleetMember>()
.eq(FleetMember::getFleetId, fleetMember.getFleetId()) .eq(FleetMember::getFleetId, fleetMember.getFleetId())
.eq(FleetMember::getUserId, nowAccountInfo.getId())); .eq(FleetMember::getUserId, nowAccountInfo.getId()));
if (ObjectUtil.isEmpty(fleetMember1)) { if (ObjectUtil.isEmpty(fleetMember1)) {
throw new RuntimeException("未绑定该车队,无法查看当前车队成员信息"); throw new RuntimeException("未绑定该车队,无法查看当前车队成员信息");
} }
@ -255,7 +255,8 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
switch (fleetMember.getSecondaryCardType()) { switch (fleetMember.getSecondaryCardType()) {
case 1: case 1:
return 2; return 2;
case 2: // case 2:
default:
//查询所有副卡类型为2的所剩额度的和 //查询所有副卡类型为2的所剩额度的和
if (fleetMember.getAdjustType().equals("0")) { if (fleetMember.getAdjustType().equals("0")) {
Double v = fleetInfoService.selectRemainCreditLimit(fleetMember.getFleetId()); Double v = fleetInfoService.selectRemainCreditLimit(fleetMember.getFleetId());
@ -264,18 +265,18 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
} }
} }
break; break;
case 3: // case 3:
if (fleetMember.getAdjustType().equals("0")) { // if (fleetMember.getAdjustType().equals("0")) {
FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId()); // FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId());
if (fleetInfo.getTotalBalance() < fleetMember.getAdjustLimit()) { // if (fleetInfo.getTotalBalance() < fleetMember.getAdjustLimit()) {
return 4; // return 4;
} // }
}else { // }else {
if (fleetMember1.getRemainingCreditLimit() < fleetMember.getAdjustLimit()) { // if (fleetMember1.getRemainingCreditLimit() < fleetMember.getAdjustLimit()) {
return 5; // return 5;
} // }
} // }
break; // break;
} }
//添加到车队额度变化表 //添加到车队额度变化表
FleetLinesChange fleetLinesChange = new FleetLinesChange(); FleetLinesChange fleetLinesChange = new FleetLinesChange();
@ -287,23 +288,23 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
fleetLinesChange.setAdjustLimit(fleetMember.getAdjustLimit()); fleetLinesChange.setAdjustLimit(fleetMember.getAdjustLimit());
//剩余额度 //剩余额度
if (ObjectUtil.isNotEmpty(fleetMember1.getRemainingCreditLimit())) { if (ObjectUtil.isNotEmpty(fleetMember1.getRemainingCreditLimit())) {
if (fleetMember.getSecondaryCardType() == 3) { // if (fleetMember.getSecondaryCardType() == 3) {
//将车队卡的余额扣减到副卡余额上 // //将车队卡的余额扣减到副卡余额上
FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId()); // FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId());
double recharge = fleetInfo.getRechargeAmount() / fleetInfo.getTotalBalance(); // double recharge = fleetInfo.getRechargeAmount() / fleetInfo.getTotalBalance();
double give = fleetInfo.getGiveAmount() / fleetInfo.getTotalBalance(); // double give = fleetInfo.getGiveAmount() / fleetInfo.getTotalBalance();
if (fleetMember.getAdjustType().equals("0")) { // if (fleetMember.getAdjustType().equals("0")) {
fleetInfo.setTotalBalance(fleetInfo.getTotalBalance() - fleetMember.getAdjustLimit()); // fleetInfo.setTotalBalance(fleetInfo.getTotalBalance() - fleetMember.getAdjustLimit());
//计算充值余额与赠送金额的比例然后相减 // //计算充值余额与赠送金额的比例然后相减
fleetInfo.setRechargeAmount(fleetInfo.getRechargeAmount() - (fleetMember.getAdjustLimit() * recharge)); // fleetInfo.setRechargeAmount(fleetInfo.getRechargeAmount() - (fleetMember.getAdjustLimit() * recharge));
fleetInfo.setGiveAmount(fleetInfo.getGiveAmount() - (fleetMember.getAdjustLimit() * give)); // fleetInfo.setGiveAmount(fleetInfo.getGiveAmount() - (fleetMember.getAdjustLimit() * give));
} else { // } else {
fleetInfo.setTotalBalance(fleetInfo.getTotalBalance() + fleetMember.getAdjustLimit()); // fleetInfo.setTotalBalance(fleetInfo.getTotalBalance() + fleetMember.getAdjustLimit());
fleetInfo.setRechargeAmount(fleetInfo.getRechargeAmount() + (fleetMember.getAdjustLimit() * recharge)); // fleetInfo.setRechargeAmount(fleetInfo.getRechargeAmount() + (fleetMember.getAdjustLimit() * recharge));
fleetInfo.setGiveAmount(fleetInfo.getGiveAmount() + (fleetMember.getAdjustLimit() * give)); // fleetInfo.setGiveAmount(fleetInfo.getGiveAmount() + (fleetMember.getAdjustLimit() * give));
} // }
int i = fleetInfoMapper.updateById(fleetInfo); // int i = fleetInfoMapper.updateById(fleetInfo);
} // }
if (fleetMember.getAdjustType().equals("0")) { if (fleetMember.getAdjustType().equals("0")) {
fleetLinesChange.setRemainingCreditLimit(fleetMember1.getRemainingCreditLimit() + fleetMember.getAdjustLimit()); fleetLinesChange.setRemainingCreditLimit(fleetMember1.getRemainingCreditLimit() + fleetMember.getAdjustLimit());
fleetMember.setSecondaryCardLimit(fleetMember1.getRemainingCreditLimit() + fleetMember.getAdjustLimit()); fleetMember.setSecondaryCardLimit(fleetMember1.getRemainingCreditLimit() + fleetMember.getAdjustLimit());

View File

@ -202,9 +202,9 @@ public class CardCouponController extends BaseController {
} }
@GetMapping("getCouponOne") // @GetMapping("getCouponOne")
public ResponseObject getCouponOne(Integer id) { // public ResponseObject getCouponOne(Integer id) {
return getSuccessResult(cardCouponService.getCouponOne(id)); // return getSuccessResult(cardCouponService.getCouponOne(id));
} // }
} }

View File

@ -29,6 +29,6 @@ public interface CardCouponService extends IService<CardCoupon> {
* @param id * @param id
* @return * @return
*/ */
CardCouponUniVo getCouponOne(Integer id); // CardCouponUniVo getCouponOne(Integer id);
} }

View File

@ -122,25 +122,25 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
/** /**
* 卡券详情小程序 * 卡券详情小程序
* *
* @param id * @param
* @return * @return
*/ */
@Override // @Override
public CardCouponUniVo getCouponOne(Integer id) { // public CardCouponUniVo getCouponOne(Integer id) {
CardCoupon cardCoupon = baseMapper.selectById(id); // CardCoupon cardCoupon = baseMapper.selectById(id);
CardCouponUniVo cardCouponUniVo = BeanUtil.copyProperties(cardCoupon, CardCouponUniVo.class); // CardCouponUniVo cardCouponUniVo = BeanUtil.copyProperties(cardCoupon, CardCouponUniVo.class);
String oilNumber = cardCouponUniVo.getOilNumber(); // String oilNumber = cardCouponUniVo.getOilNumber();
//以逗号隔开 // //以逗号隔开
if (StrUtil.isNotEmpty(oilNumber)) { // if (StrUtil.isNotEmpty(oilNumber)) {
String[] split = oilNumber.split(","); // String[] split = oilNumber.split(",");
List<String> list = Arrays.asList(split); // List<String> list = Arrays.asList(split);
//转成integer集合 // //转成integer集合
List<Integer> ids = list.stream().map(Integer::parseInt).collect(Collectors.toList()); // List<Integer> ids = list.stream().map(Integer::parseInt).collect(Collectors.toList());
List<OilName> oilNames = oilNameMapper.selectList(new LambdaQueryWrapper<OilName>() // List<OilName> oilNames = oilNameMapper.selectList(new LambdaQueryWrapper<OilName>()
.in(OilName::getId, ids)); // .in(OilName::getId, ids));
} // }
return null; // return null;
} // }
private static void extracted(CardCouponUniVo coupon) { private static void extracted(CardCouponUniVo coupon) {
//计算领取的比例 //计算领取的比例

View File

@ -5,7 +5,8 @@ module.exports = {
// baseUrl: 'https://www.tuofeng.cc/oilAdmin/', // baseUrl: 'https://www.tuofeng.cc/oilAdmin/',
// baseUrl: 'https://oilapi.youkerr.com/oilAdmin/', // baseUrl: 'https://oilapi.youkerr.com/oilAdmin/',
// baseUrl: 'https://8q4f124343.yicp.fun/', // baseUrl: 'https://8q4f124343.yicp.fun/',
baseUrl: 'http://192.168.31.95:8080/', // baseUrl: 'http://192.168.31.95:8080/',
baseUrl: 'http://localhost:8080/',
// baseUrl: 'http://192.168.1.5:8002/cdJdc', // baseUrl: 'http://192.168.1.5:8002/cdJdc',
imagesUrl: 'http://www.nuoyunr.com/lananRsc', imagesUrl: 'http://www.nuoyunr.com/lananRsc',
// 应用信息 // 应用信息