This commit is contained in:
zhaohengkun 2024-11-04 09:27:46 +08:00
parent 62c20b2c15
commit 1a5e536cf6

View File

@ -21,8 +21,10 @@ import com.fuint.business.convenienceSore.dto.LJGoodsDto;
import com.fuint.business.convenienceSore.mapper.LJGoodsMapper;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.convenienceSore.service.StockTrackService;
import com.fuint.business.fleet.entity.FleetConsumeRecord;
import com.fuint.business.fleet.entity.FleetInfo;
import com.fuint.business.fleet.entity.FleetMember;
import com.fuint.business.fleet.mapper.FleetConsumeRecordMapper;
import com.fuint.business.fleet.mapper.FleetInfoMapper;
import com.fuint.business.fleet.mapper.FleetLinesChangeMapper;
import com.fuint.business.fleet.mapper.FleetMemberMapper;
@ -125,7 +127,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
@Autowired
private FleetMemberMapper fleetMemberMapper;
@Autowired
private FleetLinesChangeMapper fleetLinesChangeMapper;
private FleetConsumeRecordMapper fleetConsumeRecordMapper;
@Autowired
private FleetInfoMapper fleetInfoMapper;
@ -595,7 +597,6 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
// 参数
String orderNo = map.get("orderNo");
// 1.根据 orderNo 查询 总订单表 收银台表 会员表 油品订单表
AllOrderInfo allOrder = selectAllOrderInfoByOrderNo(orderNo);
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
@ -646,7 +647,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
.eq("store_id", userBalance.getStoreId());
MtUserFuel mtUserFuel = mtUserFuelMapper.selectOne(q2);
QueryWrapper<CardFuelChange> q4 = Wrappers.query();
q2.eq("order_no", userBalance.getMtUserId());
q2.eq("order_no", allOrder.getOrderNo());
CardFuelChange cardFuelChange = cardFuelChangeMapper.selectOne(q4);
mtUserFuel.setFuelAmount(mtUserFuel.getFuelAmount() + cardFuelChange.getBalance());
mtUserFuelMapper.updateById(mtUserFuel);
@ -660,7 +661,14 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
q6.eq("id", fleetMember.getFleetId());
FleetInfo fleetInfo = fleetInfoMapper.selectOne(q6);
// 待编辑
QueryWrapper<FleetConsumeRecord> q7 = Wrappers.query();
q7.eq("order_no", allOrder.getOrderNo());
FleetConsumeRecord fleetConsumeRecord = fleetConsumeRecordMapper.selectOne(q7);
fleetMember.setRemainingCreditLimit(fleetMember.getRemainingCreditLimit() + fleetConsumeRecord.getAfterTheChange());
fleetInfo.setTotalBalance(fleetInfo.getTotalBalance() + fleetConsumeRecord.getAfterTheChange());
fleetInfoMapper.updateById(fleetInfo);
fleetMemberMapper.updateById(fleetMember);
}
if (orderNo.equals("card_value")) {