From 89fe6b7fa8430a883d6578774ef7a5ab8e39918f Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Wed, 9 Oct 2024 17:32:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fuyou/service/impl/FyPayServiceImpl.java | 40 +--- .../controller/CardCouponController.java | 8 + .../cardCoupon/entity/CardCouponUser.java | 2 +- .../cardCoupon/service/CardCouponService.java | 3 +- .../service/impl/CardCouponServiceImpl.java | 30 ++- .../impl/CardFuelRecordServiceImpl.java | 40 +++- .../impl/CardValueRecordServiceImpl.java | 50 +++-- .../service/impl/OilOrderServiceImpl.java | 95 +++------- .../service/impl/LJUserServiceImpl.java | 10 +- fuintCashierWeb/src/api/newHome/newHome.js | 7 + .../views/cashier/NewComponents/newHome.vue | 178 +++++++++++++----- 11 files changed, 270 insertions(+), 193 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java index 1bfe1859c..5a3809924 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java @@ -190,7 +190,6 @@ public class FyPayServiceImpl implements FyPayService { String str = reqMap.get("sign"); if (Utils.verifySign(reqMap, str)) { OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(orderNo); - List list = oilOrderService.selectOilOrder(orderNo); LJOrder goodsOrder = goodsOrderService.selectGoodsOrder(orderNo); CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo); String transactionType = null; @@ -281,32 +280,6 @@ public class FyPayServiceImpl implements FyPayService { receiveParameter.setType("7"); receiveParameter.setContent("挂账订单"); } - if (!ArrayUtil.isEmpty(list)) { - if (list.size() > 1) { - Double oilLiters = 0.0; - for (OilOrder order : list) { - oilLiters += order.getOilNum(); - } - for (OilOrder order : list) { - if (order.getOrderType().equals("主订单")) { - if (ObjectUtil.isNotEmpty(order.getStaffId())) - staffCommissionService.countStaffCommission(order.getStaffId(), order.getStoreId(), order.getOrderAmount(), order.getPayAmount(), "1", orderNo); - } -// 添加多个油品订单 - order.setOrderStatus("paid"); - order.setPayTime(date); - oilOrderService.updateOilOrder(order); - - oilOrderService.updateCardAndActiveById(order.getStoreId(), order.getUserId(), order.getActiveId(), order.getCouponId(), order.getActiveType(), order.getOrderAmount(), order.getPayAmount(), Integer.valueOf(order.getOils())); - -// 修改油罐容量 - List jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class); - for (JSONObject jsonObject : jsonObjects) { - oilOrderService.addOilTrack(jsonObject, oilOrder.getStoreId()); - } - } - } - } if ("CVR".equals(type)) { //储值卡订单 payStates = "paid"; @@ -351,14 +324,6 @@ public class FyPayServiceImpl implements FyPayService { receiveParameter.setType("7"); receiveParameter.setContent("挂账订单"); } - if (!ArrayUtil.isEmpty(list)) { - if (list.size() > 1) { - for (OilOrder order : list) { - order.setOrderStatus("payFail"); - oilOrderService.updateOilOrder(order); - } - } - } if ("CVR".equals(type)) { payStates = "payFail"; cardValueOrdersService.updateOrderStatus(orderNo,payStatus); @@ -413,7 +378,7 @@ public class FyPayServiceImpl implements FyPayService { //储值卡 Integer id = Integer.parseInt(map1.get("orderId")); cardValueRecordService.editPayStatus(id, payStates); - cardValueOrdersService.updateBalance(orderNo,payStatus); + //cardValueOrdersService.updateBalance(orderNo,payStatus); CardValueRecord byId = cardValueRecordService.getById(id); receiveParameter.setType("3"); if (byId.getMtUserId() != null) { @@ -449,13 +414,12 @@ public class FyPayServiceImpl implements FyPayService { this.insertAllOrderInfo(receiveParameter, payStatus,discountAmount,payChannel,merchantConfig); } if (ObjectUtil.isNotEmpty(merchantConfig)) { - //添加配置记录信息 MerchantConfigRecord merchantConfigRecord = new MerchantConfigRecord(); merchantConfigRecord.setMerchantId(merchantConfig.getId()); if (payStatus.equals("paid")) { merchantConfigRecord.setIsSuccess("yes"); - } else { + }else { merchantConfigRecord.setIsSuccess("no"); } merchantConfigRecord.setAmount(allAmount / 100.0); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponController.java index 3543a0b9e..d5844c370 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/controller/CardCouponController.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.api.ApiController; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon; +import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService; import com.fuint.business.marketingActivity.cardGiftActive.entity.CardGiftActive; import com.fuint.business.petrolStationManagement.entity.OilName; @@ -214,6 +215,13 @@ public class CardCouponController extends BaseController { return getSuccessResult(this.cardCouponService.selectAllByPageAndStoreId(page, cardCoupon)); } + @PostMapping("/sendCoupon") + public ResponseObject sendCoupon(@RequestBody CardCouponUser cardCouponUser) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + cardCouponUser.setStoreId(nowAccountInfo.getStoreId()); + cardCouponUser.setChainStoreId(nowAccountInfo.getChainStoreId()); + return getSuccessResult(cardCouponService.sendCoupon(cardCouponUser)); + } // @GetMapping("getCouponOne") // public ResponseObject getCouponOne(Integer id) { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/entity/CardCouponUser.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/entity/CardCouponUser.java index 027200b4c..a0729d5d6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/entity/CardCouponUser.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/entity/CardCouponUser.java @@ -30,7 +30,7 @@ public class CardCouponUser extends Model { private Integer mtUserId; //会员手机号码 private String mobile; - //来源类型 1储值卡2囤油卡.... + //来源类型 1储值卡2囤油卡 3消费有礼赠送4收银台赠送 private String fromType; //活动id private Integer activeId; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponService.java index 476166d1c..df9fa1dd6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/CardCouponService.java @@ -4,6 +4,7 @@ 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.marketingActivity.cardCoupon.entity.CardCoupon; +import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo; import java.util.List; @@ -27,7 +28,7 @@ public interface CardCouponService extends IService { int isOnLine(Integer id); IPage selectAllByPageAndStoreId(Page page, CardCoupon cardCoupon); - + int sendCoupon(CardCouponUser cardCouponUser); CardCoupon selectOneBuId(Integer id); /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponServiceImpl.java index 617086415..4686b702f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/service/impl/CardCouponServiceImpl.java @@ -11,6 +11,7 @@ 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.cardCoupon.entity.CardCoupon; +import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponMapper; import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper; import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService; @@ -20,15 +21,14 @@ import com.fuint.business.petrolStationManagement.entity.OilName; import com.fuint.business.petrolStationManagement.mapper.OilNameMapper; import com.fuint.business.store.entity.MtStore; import com.fuint.business.store.mapper.MtStoreMapper; +import com.fuint.business.userManager.service.LJUserService; +import com.fuint.business.userManager.vo.LJUserVo; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -40,14 +40,12 @@ import java.util.stream.Collectors; @Service("cardCouponService") public class CardCouponServiceImpl extends ServiceImpl implements CardCouponService { - @Autowired - private MtStoreMapper mtStoreMapper; + @Autowired private CardCouponUserMapper cardCouponUserMapper; - @Autowired - private OilNameMapper oilNameMapper; + private LJUserService userService; @Override public IPage pageVo(Page page, CardCoupon cardCoupon) { return baseMapper.pageVo( page, cardCoupon); @@ -128,6 +126,22 @@ public class CardCouponServiceImpl extends ServiceImpl queryWrapper =new LambdaQueryWrapper<>(); + queryWrapper.eq(MtUserFuel::getMtUserId,record.getMtUserId()) + .eq(MtUserFuel::getStoreId,record.getStoreId()).eq(MtUserFuel::getOilName,record.getOilNumberId()); + MtUserFuel mtUserFuel = userFuelService.getOne(queryWrapper); + if (ObjectUtils.isNotEmpty(mtUserFuel)){ + mtUserFuel.setFuelAmount(mtUserFuel.getFuelAmount()+record.getIncomeLitres()); + }else { + mtUserFuel =new MtUserFuel(); + mtUserFuel.setFuelAmount(record.getIncomeLitres()); + mtUserFuel.setOilName(String.valueOf(record.getOilNumberId())); + mtUserFuel.setMtUserId(record.getMtUserId()); + mtUserFuel.setStoreId(record.getStoreId()); + mtUserFuel.setChainStoreId(record.getChainStoreId()); + + } + userFuelService.saveOrUpdate(mtUserFuel); + + } CardFuelRecord cardFuelRecord = new CardFuelRecord(); cardFuelRecord.setId(id); cardFuelRecord.setPayStatus(payStatus); @@ -251,15 +285,10 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { Date from = Date.from(instant1); cardFuelRecordDTO.setExpireTime(from); } - - - cardFuelRecordDTO.setExpireTime(cardFuelRecordDTO.getExpireTime()); - if (ObjectUtil.isEmpty(cardFuelRecordDTO.getMtStaffId())) { cardFuelRecordDTO.setMtStaffId(nowAccountInfo.getStaffId()); } - LJStaff ljStaff = iljStaffService.selectStaffById(cardFuelRecordDTO.getMtStaffId()); if (ObjectUtil.isNotEmpty(ljStaff)) { cardFuelRecordDTO.setStaffMobile(ljStaff.getMobile()); @@ -623,7 +652,6 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService { if (map.get("code").equals("success")){ return JSONObject.parseObject(JSONObject.toJSONString(map.get("data")),ReturnParameter.class); }else { -// throw new Exception(map.get("msg").toString()); return new ReturnParameter(); } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java index 71eb7471d..d5e071c28 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/service/impl/CardValueRecordServiceImpl.java @@ -60,9 +60,11 @@ import com.fuint.business.order.service.CardBalanceChangeService; import com.fuint.business.order.service.GrowthValueChangeService; import com.fuint.business.storeInformation.entity.LJStore; import com.fuint.business.storeInformation.service.ILJStoreService; +import com.fuint.business.userManager.entity.LJUserGrade; import com.fuint.business.userManager.entity.MtUserGradeChild; import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.mapper.LJUserMapper; +import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.business.userManager.service.MtUserGradeChildService; import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.vo.LJUserVo; @@ -76,6 +78,7 @@ import com.fuint.repository.model.MtStaff; import io.lettuce.core.dynamic.annotation.Param; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import org.redisson.api.RLock; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -147,6 +150,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl records = userGradeService.selectUserGradeAll(userBalance.getStoreId()); + } CardValueRecord cardValueRecord = new CardValueRecord(); cardValueRecord.setId(id); cardValueRecord.setPayStatus(payStatus); int i = baseMapper.updateById(cardValueRecord); + // staffCommissionService.countStaffCommission(cardValueOrders.getStaffId(),cardValueOrders.getStoreId(),cardValueOrders.getAmount(),cardValueOrders.getPayAmount(),"3",cardValueOrders.getOrderNo()); return i>0; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java index 051c755ba..e481c3c3a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java @@ -407,49 +407,36 @@ public class OilOrderServiceImpl extends ServiceImpl i Double seekZero = Double.valueOf(map.get("seekZero")); // 油枪id String oilGunId = map.get("oilGunId"); - log.info("11111111111111111111111285:", map.get("levelAmount")); Double levelAmount = Double.valueOf(map.get("levelAmount")); Double activeAmount = Double.valueOf(map.get("activeAmount")); Double oilCardAmount1 = Double.valueOf(map.get("oilCardAmount1")); -// 优惠券id - Integer cardFavorableId = null; - if (StringUtils.isNotEmpty(map.get("cardFavorableId"))) { - cardFavorableId = Integer.valueOf(map.get("cardFavorableId")); - } - - if (ObjectUtils.isNotEmpty(cardFavorableId) && StringUtils.isNotEmpty(map.get("userId"))) { - Integer userId = Integer.valueOf(map.get("userId")); - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(CardFavorableRecord::getMtUserId, userId); - queryWrapper.eq(CardFavorableRecord::getCardFavorableId, cardFavorableId); - queryWrapper.eq(CardFavorableRecord::getStoreId, storeId); - queryWrapper.eq(CardFavorableRecord::getStatus, 0); - List list = cardFavorableRecordService.list(queryWrapper); - list.get(0).setStatus("1"); - cardFavorableRecordService.updateById(list.get(0)); +// 优惠券 用户 id + Integer couponUserId = null; + if (StringUtils.isNotEmpty(map.get("couponUserId"))) { + couponUserId = Integer.valueOf(map.get("couponUserId")); } Integer recordId = null; if (StringUtils.isNotEmpty(map.get("recordId"))) { recordId = Integer.valueOf(map.get("recordId")); } -// 付款用户 + //付款用户 String payUser = null; if (ObjectUtil.isNotEmpty(map.get("payUser")) && !map.get("payUser").equals("[]")) { payUser = map.get("payUser"); } else { payUser = "散客"; } -// 油品优惠金额 + //油品优惠金额 Double oilDiscount = Double.valueOf(map.get("oilDiscount")); // 商品优惠金额 Double goodsDiscount = Double.valueOf(map.get("goodsDiscount")); -// 员工id + //员工id Integer staffId = null; if (ObjectUtil.isNotEmpty(map.get("staffId"))) { staffId = Integer.valueOf(map.get("staffId")); } -// 会员消费金额(储值卡需要减少的金额) + // 会员消费金额(储值卡需要减少的金额) Double consumeAmount = Double.valueOf(map.get("consumeAmount")); Integer userId = null; Boolean isMember = false; @@ -546,7 +533,7 @@ public class OilOrderServiceImpl extends ServiceImpl i orderService.insertGoodOrder(ljOrder); -// 查询商品订单号 + //查询商品订单号 LJOrder ljOrder2 = orderService.selectGoodsOrder(orderNo); if (payType.equals("CASH") || payType.equals("credit")) { // 添加商品订单记录表 @@ -630,16 +617,13 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setPayTime(new Date()); order.setOrderStatus("paid"); } -// if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){ -// baseMapper.updateById(order); -// }else { + baseMapper.insert(order); -// } oilOrder1 = this.selectOilOrderByOrderNo(orderNo); } } -// 添加收银台订单信息 + // 添加收银台订单信息 CashierOrder cashierOrder = new CashierOrder(); cashierOrder.setStaffId(staffId); cashierOrder.setStoreId(storeId); @@ -1586,13 +1570,12 @@ public class OilOrderServiceImpl extends ServiceImpl i public OilOrder addOilOrder(OilOrder oilOrder) { // AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo1(); - // 根据日期生成订单信息 + //根据日期生成订单信息 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); String timestamp = dateFormat.format(new Date()); String randomString = UUID.randomUUID().toString().replace("-", "").substring(0, 6); String orderNo = "2345" + timestamp + randomString; - - // 添加油品订单信息 + //添加油品订单信息 oilOrder.setOrderNo(orderNo); oilOrder.setOrderStatus("unpaid"); oilOrder.setOrderType("主订单"); @@ -1616,7 +1599,6 @@ public class OilOrderServiceImpl extends ServiceImpl i LJUserVo userVo = userService.selectUserById(oilOrder.getUserId(), oilOrder.getStoreId()); oilOrder.setPayUser(userVo.getMobile()); -// baseMapper.insert(oilOrder); if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))) { baseMapper.updateById(oilOrder); } else { @@ -1629,15 +1611,15 @@ public class OilOrderServiceImpl extends ServiceImpl i public Map appletPay(Map map) throws Exception { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); String orderNo = map.get("orderNo"); -// 支付金额 + // 支付金额 Double payAmount = Double.valueOf(map.get("payAmount")); -// 优惠金额 + //优惠金额 String discountAmount = map.get("discountAmount"); -// 囤油卡消费后的信息 + //囤油卡消费后的信息 String oilCardAmount = map.get("oilCardAmount"); -// 囤油卡消费升数 + //囤油卡消费升数 Double oilCardLiters = Double.valueOf(map.get("oilCardLiters")); -// 是否使用囤油卡 +//是否使用囤油卡 String isOilStorageCard = map.get("isOilStorageCard"); // 储值卡消费金额 String balanceAmount = map.get("balanceAmount"); @@ -2044,7 +2026,7 @@ public class OilOrderServiceImpl extends ServiceImpl i private void updateGrowthValue(Double oilAmount, Double oilActualPay, Integer userid, Integer oilId, String refuelMoney, Integer storeId, String orderNo) { if (ObjectUtil.isNotEmpty(oilId)) { OilName oilName = oilNameService.selectOilNameById(oilId); -// 获取成长值增长数值 + //获取成长值增长数值 Integer gasGrowthValue = null; Integer dieselGrowthValue = null; Integer naturalGrowthValue = null; @@ -2053,33 +2035,6 @@ public class OilOrderServiceImpl extends ServiceImpl i LJStore store = storeService.selectStoreByStoreId(storeId); UserBalance balance = userBalanceService.selectUserBalance(userid, store.getChainStoreId()); int growth = balance.getGrowthValue(); -// if (refuelMoney==null){ -// String refuelMoney1 = balance.getRefuelMoney(); -// if (ObjectUtil.isNotEmpty(refuelMoney1) && ObjectUtil.isNotEmpty(refuelMoney)){ -// JSONArray objects = JSONArray.parseArray(refuelMoney); -// JSONArray objects1 = JSONArray.parseArray(refuelMoney1); -// List list = new ArrayList<>(); -// for (int i = 0;i i balance.setRefuelMoney(refuelMoney); } -// 查询会员等级列表信息 + //查询会员等级列表信息 Page page = new Page(1, 20); LJUserGrade ljUserGrade1 = new LJUserGrade(); List records = userGradeService.selectUserGradeAll(storeId); @@ -2106,7 +2061,7 @@ public class OilOrderServiceImpl extends ServiceImpl i Integer addVal = (int) (gasGrowthValue * oilAmount); addGrowthVal = addVal; growthAfter = growth + addVal; -// 如果会员成长值达到会员等级成长值,则修改会员的会员等级信息 + //如果会员成长值达到会员等级成长值,则修改会员的会员等级信息 for (int i = 1; i < records.size(); i++) { if (growthAfter < records.get(i).getGrowthValue()) { balance.setGradeId(records.get(i - 1).getId()); @@ -2119,7 +2074,7 @@ public class OilOrderServiceImpl extends ServiceImpl i Integer addVal = (int) (dieselGrowthValue * oilAmount); addGrowthVal = addVal; growthAfter = growth + addVal; -// 如果会员成长值达到会员等级成长值,则修改会员的会员等级信息 + //如果会员成长值达到会员等级成长值,则修改会员的会员等级信息 for (int i = 0; i < records.size(); i++) { if (growthAfter < records.get(i).getGrowthValue()) { balance.setGradeId(records.get(i - 1).getId()); @@ -2132,7 +2087,7 @@ public class OilOrderServiceImpl extends ServiceImpl i Integer addVal = (int) (naturalGrowthValue * oilAmount); addGrowthVal = addVal; growthAfter = growth + addVal; -// 如果会员成长值达到会员等级成长值,则修改会员的会员等级信息 + //如果会员成长值达到会员等级成长值,则修改会员的会员等级信息 for (int i = 0; i < records.size(); i++) { if (growthAfter < records.get(i).getGrowthValue()) { balance.setGradeId(records.get(i - 1).getId()); @@ -2142,9 +2097,7 @@ public class OilOrderServiceImpl extends ServiceImpl i balance.setGrowthValue(growthAfter); } else { } -// 修改用户成长值 - Integer consumeNum = balance.getConsumeNum(); - // balance.setConsumeNum(consumeNum+1); + // 修改用户成长值 userBalanceService.updateUserBalance(balance); this.insertGrowthValueChange(userid, storeId, addGrowthVal, growthAfter, orderNo); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java index 5781a924e..bce6aede6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java @@ -374,7 +374,15 @@ public class LJUserServiceImpl extends ServiceImpl impleme @Override public List userListByPhone(String mobile) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); - return baseMapper.userListByPhone(mobile, nowAccountInfo.getStoreId()); + List ljUserVos = baseMapper.userListByPhone(mobile, nowAccountInfo.getStoreId()); + ljUserVos.forEach(it->{ + //在查询囤油卡信息 + LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); + queryWrapper.eq(MtUserFuel::getStoreId,nowAccountInfo.getStoreId()).eq(MtUserFuel::getMtUserId,it.getId()); + List list = userFuelService.list(queryWrapper); + it.setUserFuels(list); + }); + return ljUserVos; } @Resource diff --git a/fuintCashierWeb/src/api/newHome/newHome.js b/fuintCashierWeb/src/api/newHome/newHome.js index eeb6f566e..542b6ceb4 100644 --- a/fuintCashierWeb/src/api/newHome/newHome.js +++ b/fuintCashierWeb/src/api/newHome/newHome.js @@ -65,3 +65,10 @@ export function getCouponList(data) { data: data }) } +export function sendCouponFun(data) { + return request({ + url: '/cardCoupon/sendCoupon', + method: 'post', + data: data + }) +} diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue b/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue index 20e38ee75..99ba5d389 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue @@ -131,7 +131,7 @@
¥{{realAmount}}
优惠合计:¥{{disTotal}}
-
立即结算
+
立即结算
@@ -249,23 +249,23 @@
-
{{ item.name }} +
+ {{ item.name }}
- 优惠价格固定1元 + {{sendCoupon.name}}
-
油品立减券
-
可用时间:周一至周日 全天
+
{{sendCoupon.type}}
+
-
可用日期:
-
2024-09-01 12:00:00至2024-09-01 12:00:00
+
日期规则:
+
{{sendCoupon.dateText}}
使用规则
-
优惠说明:价值10元代金券一张消费满100可用
+
{{sendCoupon.ruleText}}
@@ -274,7 +274,7 @@
- 确定赠送 + 确定赠送
@@ -538,7 +538,14 @@ import pickUp from './newHomeComponents/pickUpTheOrder.vue' import accountPending from './newHomeComponents/accountPending.vue' import memberRecharge from './newHomeComponents/memberRecharge.vue' import refuelingAmount from './newHomeComponents/refuelingAmount.vue' -import { cashRegisterList, cashRegisterGoodsList,getActivityList,getCouponList,getCanUseCoupon } from '@/api/newHome/newHome.js' +import { + cashRegisterList, + cashRegisterGoodsList, + getActivityList, + getCouponList, + getCanUseCoupon, + sendCouponFun +} from '@/api/newHome/newHome.js' import {QRCodeByStoreId} from "@/api/staff/qrcode"; import {userListByPhone} from "@/api/cashier/user"; @@ -551,6 +558,7 @@ import { import {getReturnCode} from "@/api/print"; export default { + dicts: ['CardCoupon_type'], data() { return { payForm:{ @@ -559,6 +567,7 @@ export default { authCode:null, seekZero:0.00 }, + sendCoupon:{}, //可参加的活动 activityList:[], //可用优惠券 @@ -613,32 +622,6 @@ export default { showCoupon: true, freeTicket:false, freeIndex:0, - freeTicketList:[ - { - name: '油品券', - num: '0' - }, - { - name: '储值卡券', - num: '0' - }, - { - name: '会员卡券', - num: '0' - }, - { - name: '油品券', - num: '0' - }, - { - name: '储值卡券', - num: '0' - }, - { - name: '会员卡券', - num: '0' - }, - ], nums:0, payList: [ ], @@ -676,6 +659,7 @@ export default { //会员搜索列表 vipUserList:[], chooseVipUser:{}, + couponTypeList:[], cardValueForm:{ cardValueId: '', // 储值卡id mtStaffId: '', // @@ -785,6 +769,7 @@ export default { this.getGoodsList() this.getQRCodeInfoByStoreId(0); this.getPayList() + this.getCouponType() }, computed: { @@ -820,6 +805,18 @@ export default { }, methods: { + sendCouponClick(){ + //this.sendCoupon this.chooseVipUser.id + this.sendCoupon.mtUserId = this.chooseVipUser.id + this.sendCoupon.fromType = "4" + this.sendCoupon.cardCouponId = this.sendCoupon.id + sendCouponFun(this.sendCoupon).then( + res=>{ + this.$message.success("赠送成功") + this.freeTicket = false + } + ) + }, handleCilone(value){ console.log(value) }, @@ -901,23 +898,14 @@ export default { }, async collection1() { let makeChange = 0 - if (!this.payForm.authCode && this.payForm.paymentType !== "CASH") { this.$message.error('请先扫码'); return - }else { - if (this.payForm.authCode { + this.couponTypeList = response.data; + }) }, addFreeTicket(){ getCanUseCoupon().then(res=>{ - this.s + this.sendCouponList = res.data }) this.freeTicket = true },