更新9.28
This commit is contained in:
parent
fb5ec3d55f
commit
2176938b4e
@ -86,7 +86,7 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
FleetMember fleetMember1 = baseMapper.selectOne(new LambdaQueryWrapper<FleetMember>()
|
||||
.eq(FleetMember::getFleetId, fleetMember.getFleetId())
|
||||
.eq(FleetMember::getUserId, nowAccountInfo.getId()));
|
||||
.eq(FleetMember::getUserId, nowAccountInfo.getId()));
|
||||
if (ObjectUtil.isEmpty(fleetMember1)) {
|
||||
throw new RuntimeException("未绑定该车队,无法查看当前车队成员信息");
|
||||
}
|
||||
@ -255,7 +255,8 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
|
||||
switch (fleetMember.getSecondaryCardType()) {
|
||||
case 1:
|
||||
return 2;
|
||||
case 2:
|
||||
// case 2:
|
||||
default:
|
||||
//查询所有副卡类型为2的,所剩额度的和
|
||||
if (fleetMember.getAdjustType().equals("0")) {
|
||||
Double v = fleetInfoService.selectRemainCreditLimit(fleetMember.getFleetId());
|
||||
@ -264,18 +265,18 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (fleetMember.getAdjustType().equals("0")) {
|
||||
FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId());
|
||||
if (fleetInfo.getTotalBalance() < fleetMember.getAdjustLimit()) {
|
||||
return 4;
|
||||
}
|
||||
}else {
|
||||
if (fleetMember1.getRemainingCreditLimit() < fleetMember.getAdjustLimit()) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
break;
|
||||
// case 3:
|
||||
// if (fleetMember.getAdjustType().equals("0")) {
|
||||
// FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId());
|
||||
// if (fleetInfo.getTotalBalance() < fleetMember.getAdjustLimit()) {
|
||||
// return 4;
|
||||
// }
|
||||
// }else {
|
||||
// if (fleetMember1.getRemainingCreditLimit() < fleetMember.getAdjustLimit()) {
|
||||
// return 5;
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
}
|
||||
//添加到车队额度变化表
|
||||
FleetLinesChange fleetLinesChange = new FleetLinesChange();
|
||||
@ -287,23 +288,23 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
|
||||
fleetLinesChange.setAdjustLimit(fleetMember.getAdjustLimit());
|
||||
//剩余额度
|
||||
if (ObjectUtil.isNotEmpty(fleetMember1.getRemainingCreditLimit())) {
|
||||
if (fleetMember.getSecondaryCardType() == 3) {
|
||||
//将车队卡的余额扣减到副卡余额上
|
||||
FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId());
|
||||
double recharge = fleetInfo.getRechargeAmount() / fleetInfo.getTotalBalance();
|
||||
double give = fleetInfo.getGiveAmount() / fleetInfo.getTotalBalance();
|
||||
if (fleetMember.getAdjustType().equals("0")) {
|
||||
fleetInfo.setTotalBalance(fleetInfo.getTotalBalance() - fleetMember.getAdjustLimit());
|
||||
//计算充值余额与赠送金额的比例然后相减
|
||||
fleetInfo.setRechargeAmount(fleetInfo.getRechargeAmount() - (fleetMember.getAdjustLimit() * recharge));
|
||||
fleetInfo.setGiveAmount(fleetInfo.getGiveAmount() - (fleetMember.getAdjustLimit() * give));
|
||||
} else {
|
||||
fleetInfo.setTotalBalance(fleetInfo.getTotalBalance() + fleetMember.getAdjustLimit());
|
||||
fleetInfo.setRechargeAmount(fleetInfo.getRechargeAmount() + (fleetMember.getAdjustLimit() * recharge));
|
||||
fleetInfo.setGiveAmount(fleetInfo.getGiveAmount() + (fleetMember.getAdjustLimit() * give));
|
||||
}
|
||||
int i = fleetInfoMapper.updateById(fleetInfo);
|
||||
}
|
||||
// if (fleetMember.getSecondaryCardType() == 3) {
|
||||
// //将车队卡的余额扣减到副卡余额上
|
||||
// FleetInfo fleetInfo = fleetInfoMapper.selectById(fleetMember.getFleetId());
|
||||
// double recharge = fleetInfo.getRechargeAmount() / fleetInfo.getTotalBalance();
|
||||
// double give = fleetInfo.getGiveAmount() / fleetInfo.getTotalBalance();
|
||||
// if (fleetMember.getAdjustType().equals("0")) {
|
||||
// fleetInfo.setTotalBalance(fleetInfo.getTotalBalance() - fleetMember.getAdjustLimit());
|
||||
// //计算充值余额与赠送金额的比例然后相减
|
||||
// fleetInfo.setRechargeAmount(fleetInfo.getRechargeAmount() - (fleetMember.getAdjustLimit() * recharge));
|
||||
// fleetInfo.setGiveAmount(fleetInfo.getGiveAmount() - (fleetMember.getAdjustLimit() * give));
|
||||
// } else {
|
||||
// fleetInfo.setTotalBalance(fleetInfo.getTotalBalance() + fleetMember.getAdjustLimit());
|
||||
// fleetInfo.setRechargeAmount(fleetInfo.getRechargeAmount() + (fleetMember.getAdjustLimit() * recharge));
|
||||
// fleetInfo.setGiveAmount(fleetInfo.getGiveAmount() + (fleetMember.getAdjustLimit() * give));
|
||||
// }
|
||||
// int i = fleetInfoMapper.updateById(fleetInfo);
|
||||
// }
|
||||
if (fleetMember.getAdjustType().equals("0")) {
|
||||
fleetLinesChange.setRemainingCreditLimit(fleetMember1.getRemainingCreditLimit() + fleetMember.getAdjustLimit());
|
||||
fleetMember.setSecondaryCardLimit(fleetMember1.getRemainingCreditLimit() + fleetMember.getAdjustLimit());
|
||||
|
@ -202,9 +202,9 @@ public class CardCouponController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("getCouponOne")
|
||||
public ResponseObject getCouponOne(Integer id) {
|
||||
return getSuccessResult(cardCouponService.getCouponOne(id));
|
||||
}
|
||||
// @GetMapping("getCouponOne")
|
||||
// public ResponseObject getCouponOne(Integer id) {
|
||||
// return getSuccessResult(cardCouponService.getCouponOne(id));
|
||||
// }
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,6 @@ public interface CardCouponService extends IService<CardCoupon> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
CardCouponUniVo getCouponOne(Integer id);
|
||||
// CardCouponUniVo getCouponOne(Integer id);
|
||||
}
|
||||
|
||||
|
@ -122,25 +122,25 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
||||
/**
|
||||
* 卡券详情(小程序)
|
||||
*
|
||||
* @param id
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CardCouponUniVo getCouponOne(Integer id) {
|
||||
CardCoupon cardCoupon = baseMapper.selectById(id);
|
||||
CardCouponUniVo cardCouponUniVo = BeanUtil.copyProperties(cardCoupon, CardCouponUniVo.class);
|
||||
String oilNumber = cardCouponUniVo.getOilNumber();
|
||||
//以逗号隔开
|
||||
if (StrUtil.isNotEmpty(oilNumber)) {
|
||||
String[] split = oilNumber.split(",");
|
||||
List<String> list = Arrays.asList(split);
|
||||
//转成integer集合
|
||||
List<Integer> ids = list.stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||
List<OilName> oilNames = oilNameMapper.selectList(new LambdaQueryWrapper<OilName>()
|
||||
.in(OilName::getId, ids));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// @Override
|
||||
// public CardCouponUniVo getCouponOne(Integer id) {
|
||||
// CardCoupon cardCoupon = baseMapper.selectById(id);
|
||||
// CardCouponUniVo cardCouponUniVo = BeanUtil.copyProperties(cardCoupon, CardCouponUniVo.class);
|
||||
// String oilNumber = cardCouponUniVo.getOilNumber();
|
||||
// //以逗号隔开
|
||||
// if (StrUtil.isNotEmpty(oilNumber)) {
|
||||
// String[] split = oilNumber.split(",");
|
||||
// List<String> list = Arrays.asList(split);
|
||||
// //转成integer集合
|
||||
// List<Integer> ids = list.stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||
// List<OilName> oilNames = oilNameMapper.selectList(new LambdaQueryWrapper<OilName>()
|
||||
// .in(OilName::getId, ids));
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
private static void extracted(CardCouponUniVo coupon) {
|
||||
//计算领取的比例
|
||||
|
@ -5,7 +5,8 @@ module.exports = {
|
||||
// baseUrl: 'https://www.tuofeng.cc/oilAdmin/',
|
||||
// baseUrl: 'https://oilapi.youkerr.com/oilAdmin/',
|
||||
// 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',
|
||||
imagesUrl: 'http://www.nuoyunr.com/lananRsc',
|
||||
// 应用信息
|
||||
|
Loading…
Reference in New Issue
Block a user