Merge remote-tracking branch 'origin/main'

This commit is contained in:
cun-nan 2024-10-31 17:54:28 +08:00
commit a58892a2da
4 changed files with 32 additions and 7 deletions

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.cardFule.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
@ -14,7 +15,7 @@ import java.util.List;
* @author wangh
* @since 2023-11-13 18:53:47
*/
public interface CardFuelChangeMapper {
public interface CardFuelChangeMapper extends BaseMapper<CardFuelChange> {
/**
* 通过ID查询单条数据

View File

@ -2,6 +2,7 @@ package com.fuint.business.marketingActivity.cardFule.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.integral.entity.IntegralDetail;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
import com.fuint.business.marketingActivity.cardFule.vo.CardFuelChangeVo;
@ -14,7 +15,7 @@ import io.lettuce.core.dynamic.annotation.Param;
* @author wangh
* @since 2023-11-13 18:53:47
*/
public interface CardFuelChangeService {
public interface CardFuelChangeService extends IService<CardFuelChange> {
/**
* 通过ID查询单条数据

View File

@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelChangeMapper;
import com.fuint.business.marketingActivity.cardFule.service.CardFuelChangeService;
@ -29,7 +30,7 @@ import javax.annotation.Resource;
* @since 2023-11-13 18:53:47
*/
@Service("cardFuelChangeService")
public class CardFuelChangeServiceImpl implements CardFuelChangeService {
public class CardFuelChangeServiceImpl extends ServiceImpl<CardFuelChangeMapper,CardFuelChange> implements CardFuelChangeService {
@Resource
private CardFuelChangeMapper cardFuelChangeMapper;
@Autowired

View File

@ -21,6 +21,8 @@ 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.FleetInfo;
import com.fuint.business.fleet.entity.FleetMember;
import com.fuint.business.fleet.mapper.FleetInfoMapper;
import com.fuint.business.fleet.mapper.FleetLinesChangeMapper;
import com.fuint.business.fleet.mapper.FleetMemberMapper;
@ -28,7 +30,9 @@ import com.fuint.business.largeSscreen.vo.OrderGoodsVO;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelChangeMapper;
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelRecordMapper;
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
import com.fuint.business.order.dto.AllOrderInfoDto;
@ -110,8 +114,10 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
//囤油卡相关 mapper
@Autowired
private MtUserFuelMapper mtUserFuelMapper;
// @Autowired
// private CardFuelRecordMapper cardFuelRecordMapper;
@Autowired
private CardFuelRecordMapper cardFuelRecordMapper;
private CardFuelChangeMapper cardFuelChangeMapper;
//车队卡相关 mapper
@Autowired
private FleetMemberMapper fleetMemberMapper;
@ -634,14 +640,30 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
.eq("oil_name", oilOrder.getOils())
.eq("store_id", userBalance.getStoreId());
MtUserFuel mtUserFuel = mtUserFuelMapper.selectOne(q2);
QueryWrapper<CardFuelChange> q4 = Wrappers.query();
q2.eq("order_no", userBalance.getMtUserId());
CardFuelChange cardFuelChange = cardFuelChangeMapper.selectOne(q4);
mtUserFuel.setFuelAmount(mtUserFuel.getFuelAmount() + cardFuelChange.getBalance());
mtUserFuelMapper.updateById(mtUserFuel);
}
if (orderNo.equals("car_card_value")) {
QueryWrapper<FleetMember> q5 = Wrappers.query();
q5.eq("user_id", userBalance.getMtUserId())
.eq("store_id", oilOrder.getOils());
FleetMember fleetMember = fleetMemberMapper.selectOne(q5);
QueryWrapper<FleetInfo> q6 = Wrappers.query();
q6.eq("id", fleetMember.getFleetId());
FleetInfo fleetInfo = fleetInfoMapper.selectOne(q6);
// 待编辑
}
if (orderNo.equals("card_value")) {
QueryWrapper<CardBalanceChange> q6 = Wrappers.query();
q6.eq("order_no", cashierOrder.getOrderNo());
CardBalanceChange cardBalanceChange = cardBalanceChangeMapper.selectOne(q6);
userBalance.setCardBalance(userBalance.getCardBalance() + cardBalanceChange.getBalance());
userBalanceMapper.updateById(userBalance);
}
// 5.如果是 小程序码付款 则按照 油品表的 囤油卡金额 储值卡金额 还原