From 2a9b7cae2eb050786ba276a9a89ddc951e0fcaf2 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Thu, 11 Jan 2024 13:55:20 +0800 Subject: [PATCH 1/6] bug --- fuintAdmin/src/views/member/index.vue | 2 +- fuintAdmin/src/views/member/userInfo.vue | 252 +++++++++++++++++- .../member/userInfoOrder/cardValueChild.vue | 56 ++-- .../mapper/xml/CardValueChildOrderMapper.xml | 9 +- .../impl/CardValueChildOrderServiceImpl.java | 19 +- .../service/impl/OilOrderServiceImpl.java | 21 +- .../userManager/mapper/LJUserMapper.java | 2 +- .../userManager/mapper/xml/LJUserMapper.xml | 5 +- .../service/impl/LJUserServiceImpl.java | 4 +- .../views/cashier/NewComponents/homeindex.vue | 22 +- .../pagesRefuel/orderDetail/index.vue | 40 ++- 11 files changed, 368 insertions(+), 64 deletions(-) diff --git a/fuintAdmin/src/views/member/index.vue b/fuintAdmin/src/views/member/index.vue index e4017afff..1a1568ee6 100644 --- a/fuintAdmin/src/views/member/index.vue +++ b/fuintAdmin/src/views/member/index.vue @@ -551,7 +551,7 @@ export default { rules: { name: [ { required: true, message: "会员名称不能为空", trigger: "blur" }, - { min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' } + // { min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' } ], gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }], status: [{ required: true, message: "请选择会员状态", trigger: "blur" }], diff --git a/fuintAdmin/src/views/member/userInfo.vue b/fuintAdmin/src/views/member/userInfo.vue index 6dc1e5f1e..44a183462 100644 --- a/fuintAdmin/src/views/member/userInfo.vue +++ b/fuintAdmin/src/views/member/userInfo.vue @@ -541,7 +541,133 @@ - + + + +
+
会员信息:{{form.mobile}}
+ 新增子卡 +
+
+ + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ + + + + + + + + + + 搜索 + + +
+
+
+ + + + + + + + + + + + + + + + + + +
+ + +
+
@@ -598,6 +724,43 @@ + + + + + + + + + + + + + + + + + + + + + + 取 消 + 确 定 + + @@ -628,6 +791,12 @@ import growthValueRecord from "@/views/member/userInfoOrder/growthValueRecord.vu import refuelMoneyRecord from "@/views/member/userInfoOrder/refuelMoneyRecord.vue"; import cardValueChild from "@/views/member/userInfoOrder/cardValueChild.vue"; import {allFixingLevel, getFixingLevel} from "@/api/staff/user/fixinglevel"; +import { + addCardValueChild, + cardValueChildInfo, + editCardValueChild, + listCardValueChild, listCardValueChildOrder +} from "@/api/staff/user/cardvaluechild"; export default { components: { @@ -646,9 +815,11 @@ export default { return item } }, - dicts: ['official', 'zhzt', 'zcrzdj', 'payment_type'], + dicts: ['official', 'zhzt', 'zcrzdj', 'payment_type','pay_status'], data() { return { + orderList:[], + openSubCard1:false, baseUrl: process.env.VUE_APP_BASE_API, flag: null, fixingLevelList: [], @@ -744,11 +915,13 @@ export default { tabOilType: '92', // 关于副卡信息 aboutSecondCard: [], + cardValueChildList:[], // 遮罩层 loading: false, id: '', // 会员信息 form: {}, + form1: {}, // 店铺信息 store: '', // 会员等级信息 @@ -766,7 +939,13 @@ export default { name: '', status: '', }, - subCardList: [], + subCardList:{ + page:1, + pageSize:10, + cardChildPhones:'', + userId:'', + status:'' + }, list: [], // 表单校验 rules: { @@ -774,6 +953,8 @@ export default { name: [{required: true, message: "请输入会员昵称,内容不可为空", trigger: "blur"}], type: [{required: true, message: "请选择操作类型", trigger: "blur"}], fixingLevel: [{required: true, message: "请选择认证信息", trigger: "blur"}], + userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }], + cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}], } } }, @@ -788,8 +969,73 @@ export default { this.getInformation(); this.getFixingLevelList(); this.getStore(); + this.getCardList() + this.getOrderList() }, methods: { + handleQuery(){ + this.subCardList.page = 1; + this.getOrderList() + }, + handleOrder(data){ + this.subCardList.cardChildPhones = data.cardChildPhones + this.subCardActive = "consumption" + this.subCardList.page = 1; + this.getOrderList() + }, + // 查询子卡的交易信息 + getOrderList(){ + this.subCardList.userId = this.id + listCardValueChildOrder(this.subCardList).then(res => { + this.orderList = res.data.records + this.total = res.data.total + }) + }, + // 查询当前用户的子卡信息 + getCardList(){ + listCardValueChild(this.id).then(res => { + this.cardValueChildList = res.data + }) + }, + handleAdd1(){ + this.title = "添加子卡信息" + this.openSubCard1 = true + }, + handleUpdate1(data){ + cardValueChildInfo(data.id).then(res => { + this.form1 = res.data + this.title = "修改子卡信息" + this.openSubCard1 = true + }) + }, + // 添加或修改子卡信息 + submitSubCard(){ + this.$refs["form1"].validate(valid => { + if (valid) { + if (this.form1.id) { + editCardValueChild(this.form1).then(res => { + if (res.data==1){ + this.$modal.msgSuccess("修改成功!") + this.openSubCard1 = false + this.getCardList() + }else { + this.$modal.msgError("手机号已存在,请重新添加") + } + }) + }else { + addCardValueChild(this.form1).then(res => { + if (res.data.success=="添加成功!"){ + this.$modal.msgSuccess("添加成功!") + this.openSubCard1 = false + this.getCardList() + }else { + this.$modal.msgError(res.data.error) + } + }) + } + } + }) + }, fixingLevelinfo(list, id) { let name = ""; list.forEach(item => { diff --git a/fuintAdmin/src/views/member/userInfoOrder/cardValueChild.vue b/fuintAdmin/src/views/member/userInfoOrder/cardValueChild.vue index d931fb4e2..98c56a070 100644 --- a/fuintAdmin/src/views/member/userInfoOrder/cardValueChild.vue +++ b/fuintAdmin/src/views/member/userInfoOrder/cardValueChild.vue @@ -4,10 +4,10 @@
会员信息:{{form.mobile}}
- 新增子卡 + 新增子卡
- + @@ -21,7 +21,7 @@ size="mini" type="text" icon="el-icon-edit" - @click="handleUpdate(scope.row)" + @click="handleUpdate1(scope.row)" >修改 - - + + @@ -159,8 +159,8 @@ - 取 消 - 确 定 + 取 消 + 确 定
@@ -191,7 +191,7 @@ export default { page:1, pageSize:10, }, - list:[], + cardValueChildList:[], userId:"", subCardList: { page:1, @@ -201,7 +201,7 @@ export default { }, orderList:[], title:"", - dialogVisible:false, + openSubCard1:false, rules:{ userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }], cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}], @@ -212,7 +212,7 @@ export default { this.userId = this.$route.query.id; this.getUser() - this.getList() + this.getCardList() this.getOrderList() }, methods:{ @@ -223,9 +223,9 @@ export default { }) }, // 查询当前用户的子卡信息 - getList(){ + getCardList(){ listCardValueChild(this.userId).then(res => { - this.list = res.data + this.cardValueChildList = res.data }) }, // 查询子卡的交易信息 @@ -235,27 +235,29 @@ export default { this.total = res.data.total }) }, - handleAdd(){ - this.title = "添加子卡信息" - this.dialogVisible = true + handleAdd1(){ + // this.title = "添加子卡信息" + // this.openSubCard1 = true + this.$emit("handleAdd") }, - handleUpdate(data){ - cardValueChildInfo(data.id).then(res => { - this.form1 = res.data - this.title = "修改子卡信息" - this.dialogVisible = true - }) + handleUpdate1(data){ + // cardValueChildInfo(data.id).then(res => { + // this.form1 = res.data + // this.title = "修改子卡信息" + // this.openSubCard1 = true + // }) + this.$emit("handleUpdate") }, // 添加或修改子卡信息 - submitFrom(){ - this.$refs["form"].validate(valid => { + submitSubCard(){ + this.$refs["form1"].validate(valid => { if (valid) { if (this.form1.id) { editCardValueChild(this.form1).then(res => { if (res.data==1){ this.$modal.msgSuccess("修改成功!") - this.dialogVisible = false - this.getList() + this.openSubCard1 = false + this.getCardList() }else { this.$modal.msgError("手机号已存在,请重新添加") } @@ -264,8 +266,8 @@ export default { addCardValueChild(this.form1).then(res => { if (res.data.success=="添加成功!"){ this.$modal.msgSuccess("添加成功!") - this.dialogVisible = false - this.getList() + this.openSubCard1 = false + this.getCardList() }else { this.$modal.msgError(res.data.error) } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CardValueChildOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CardValueChildOrderMapper.xml index 091099780..3b3e14d2a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CardValueChildOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CardValueChildOrderMapper.xml @@ -3,7 +3,8 @@ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CardValueChildOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CardValueChildOrderServiceImpl.java index 7266d8b86..f07769a56 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CardValueChildOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CardValueChildOrderServiceImpl.java @@ -1,5 +1,6 @@ package com.fuint.business.order.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -30,10 +31,13 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl selectCardValueChildOrderList(Page page, CardValueChildOrderVo cardValueChildOrderVo) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); if (cardValueChildOrderVo.getStoreId()==null){ - AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); cardValueChildOrderVo.setStoreId(nowAccountInfo.getStoreId()); } + if (cardValueChildOrderVo.getUserId()==null){ + cardValueChildOrderVo.setUserId(nowAccountInfo.getId()); + } return baseMapper.selectCardValueChildOrderList(page,cardValueChildOrderVo); } @@ -50,10 +54,15 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl i LJStore store = storeService.selectStoreByStoreId(storeId); UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId()); int growth = balance.getGrowthValue(); - balance.setRefuelMoney(refuelMoney); + if (refuelMoney==null){ + String refuelMoney1 = balance.getRefuelMoney(); + if (StringUtils.isNotEmpty(refuelMoney1)){ + JSONArray objects = JSONArray.parseArray(refuelMoney1); + List list = new ArrayList<>(); + for (Object object : objects) { + if (((JSONObject)object).get("oilType").toString().equals(oilId)){ + RefuelMoney refuelMoney2 = new RefuelMoney(); + refuelMoney2.setType(((JSONObject) object).get("type").toString()); + refuelMoney2.setOilType(((JSONObject) object).get("oilType").toString()); + refuelMoney2.setRefuelMoney("0"); + list.add(refuelMoney2); + } + } + balance.setRefuelMoney(JSONObject.toJSONString(list)); + } + }else { + balance.setRefuelMoney(refuelMoney); + } // 查询会员等级列表信息 Page page = new Page(1,20); LJUserGrade ljUserGrade1 = new LJUserGrade(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserMapper.java index 05a76cf3a..f6c2f387e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserMapper.java @@ -68,7 +68,7 @@ public interface LJUserMapper extends BaseMapper { * @param name * @return */ - public List selectUserByName(@Param("name") String name); + public List selectUserByName(@Param("name") String name,@Param("chainStoreId") Integer chainStoreId); /** * 统计信息 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml index 18a2feca5..7d2e0b4f7 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml @@ -67,9 +67,12 @@ 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 281d16570..49020b854 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 @@ -206,7 +206,9 @@ public class LJUserServiceImpl extends ServiceImpl impleme */ @Override public List queryUserByName(String name) { - List list = baseMapper.selectUserByName(name); + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId()); + List list = baseMapper.selectUserByName(name,store.getChainStoreId()); return list; } diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index 739cf3862..dc3aaac6b 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -15,7 +15,7 @@ background-color: rgb(67,119,204)">
@@ -135,7 +135,7 @@
- {{ consumeRefuelMoney }}L
-
+
@@ -639,12 +639,12 @@ title="请选择会员" :visible.sync="dialogVisibleMember" :close-on-click-modal="false"> -
+
@@ -804,6 +804,7 @@ name: "homeindex", data(){ return{ + baseUrl:process.env.VUE_APP_BASE_API, // 满减全选 checkAll1: false, isIndeterminate1: true, @@ -852,6 +853,7 @@ loading:false, // 油号 oilType:'', + oilNameID:'', // 油品类型 type:"", // 取单列表 @@ -1032,7 +1034,7 @@ // 油号列表 oilNumberList:[], // 是否可以点会员确定按钮 - isSure:false, + isSure:true, // 优惠券消费金额 couponAmount:0, // 是否为满减互斥 @@ -1939,6 +1941,7 @@ _this.couponDiscount =[]; _this.couponIds = [], selectCoupon(_this.preferentialData).then(response => { + // console.log(response) _this.couponAmount = 0; _this.couponIds = response.data if (response.data.length>0){ @@ -2031,6 +2034,7 @@ this.oilActualPay = 0 this.consumeAmount = 0 } + console.log("囤油卡",this.hoardAmount,this.balance,this.oilAmount,this.oilActualPay,this.consumeAmount) }, // 使用优惠券不使用满减 countAmountFull(){ @@ -2190,7 +2194,7 @@ }, // 选择会员信息 handleChoose(data) { - this.isSure = true; + this.isSure = false; this.member = data; if (data.refuelMoney != null && data.refuelMoney != ""){ this.refuelMoney = JSON.parse(data.refuelMoney) @@ -2306,7 +2310,7 @@ // 油品订单信息 getOilOrder(){ this.dialogVisibleamount = false - this.form.oilType = this.oilType; + this.form.oilType = this.oilNameID; this.form.type = this.type; // 计算油的升数 if (this.select == "元"){ @@ -2424,6 +2428,7 @@ name = item.oilName; oilType = item.oilType; _this.oilType = item.oilName; + _this.oilNameID = item.id; _this.type = item.oilType; } }) @@ -2442,6 +2447,7 @@ getUserInfoMobile({mobile:this.userNo}).then( response => { if (response.data!=null){ this.member = response.data + this.isSure = false }else { this.$modal.msgError("会员信息不存在") } @@ -2568,7 +2574,6 @@ }) this.loading = true; _this.queryPayStatus(); - // console.log(_this.isQuery) let timer = setInterval(function () { if (_this.isQuery == false) { _this.loading = false; @@ -2582,7 +2587,6 @@ _this.resetting1(); }, resetting1(){ - // console.log(111) let _this = this; this.authCode = ""; if (_this.isPaySuccess == true){ diff --git a/gasStation-uni/pagesRefuel/orderDetail/index.vue b/gasStation-uni/pagesRefuel/orderDetail/index.vue index 5a537442e..8c40b8223 100644 --- a/gasStation-uni/pagesRefuel/orderDetail/index.vue +++ b/gasStation-uni/pagesRefuel/orderDetail/index.vue @@ -148,6 +148,7 @@ oilPrice: 0, // 油品名称 oilName: "", + oilNameId:"", // 油品类型 oilType:"", // 油品id @@ -169,6 +170,7 @@ deductAmount:0, // 囤油卡信息 refuelMoney:[], + refuelMoneyAfter:[], // 会员等级优惠信息 gradeDiscount:[], // 优惠券优惠信息 @@ -200,7 +202,7 @@ }, onLoad(e) { this.orderNo = e.orderNo - // this.orderNo = "23452024011011251833f48e" + // this.orderNo = "234520240111104725ec1fbe" }, onShow() { this.getOilOrder(); @@ -211,14 +213,12 @@ methods: { // 支付接口 payment(){ - let refuel = this.refuelMoney - refuel.refuelMoney = this.refuelMoney.refuelMoney - this.oilCardRedece let map = { orderNo : this.orderNo, payAmount : this.payAmount, // payAmount : "0.01", discountAmount : this.fullRedece+this.gradeRedece+this.couponRedece, - oilCardAmount : JSON.stringify(refuel), + oilCardAmount : JSON.stringify(this.refuelMoneyAfter), oilCardLiters : this.oilCardRedece, balanceAmount : this.balanceRedece, isOilStorageCard : this.isOilStorageCard, @@ -308,19 +308,23 @@ // 查看是否有可使用的囤油卡 chooseRefuelMoney(){ let falg = false; - this.refuelMoney.forEach(item => { - if (item.oilType == this.oilName){ + for(let i = 0;i= this.oilOrder.oilNum){ + this.refuelBalance = this.refuelMoney[i].refuelMoney + if (this.refuelMoney[i].refuelMoney>0){ + this.isOilStorageCard = true + } + if (this.refuelMoney[i].refuelMoney >= this.oilOrder.oilNum){ this.oilCardRedece = this.oilOrder.oilNum + this.refuelMoneyAfter[i].refuelMoney = this.refuelMoney[i].refuelMoney - this.oilOrder.oilNum }else{ - this.oilCardRedece = item.refuelMoney + this.oilCardRedece = this.refuelMoney[i].refuelMoney + this.refuelMoneyAfter[i].refuelMoney = 0 this.chooseCardBalance(1) } } - }) + } if (falg == false) { this.chooseCardBalance(0) this.chooseGrade(this.user.id,this.user.gradeId) @@ -342,12 +346,17 @@ }else{ // 使用囤油卡 // 扣除囤油卡金额后需要支付的金额 - let residueAmount = (this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice + let residueAmount = 0 + if(this.oilCardRedece>0){ + residueAmount = ((this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice).toFixed(2) + }else{ + residueAmount = this.oilOrder.orderAmount + } if (this.user.cardBalance >= residueAmount){ this.balanceRedece = residueAmount } else { this.balanceRedece = this.user.cardBalance - this.payAmount = (this.oilOrder.orderAmount - residueAmount - this.balanceRedece).toFixed(2) + this.payAmount = ((residueAmount*100).toFixed(0) - (this.balanceRedece*100).toFixed(0))/100 } } }else{ @@ -691,9 +700,10 @@ } _this.user = res.data.userVo; _this.user = res.data.userVo; - console.log(res.data.userVo.refuelMoney); + // console.log(res.data.userVo.refuelMoney); if (res.data.userVo.refuelMoney!=null && res.data.userVo.refuelMoney!=""){ _this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney) + _this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney) _this.chooseRefuelMoney() }else{ _this.chooseCardBalance(0) @@ -752,9 +762,11 @@ method: 'get', }).then((res) => { res.data.forEach(item => { + // console.log(item); if (item.oilName == _this.oilOrder.oils) { _this.oilPrice = item.gbPrice; _this.oilName = item.oilNames; + _this.oilNameId = item.oilName; _this.oilType = item.oilType; _this.oilId = item.oilId; } From 7c512e33aae5d0ffbc94169862d72826567a6722 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Thu, 11 Jan 2024 18:08:12 +0800 Subject: [PATCH 2/6] bug --- .../service/impl/OilOrderServiceImpl.java | 32 +-- .../controller/LJUserController.java | 3 +- .../userManager/service/LJUserService.java | 2 +- .../service/impl/LJUserServiceImpl.java | 8 +- .../views/cashier/NewComponents/homeindex.vue | 186 ++++++++++-------- 5 files changed, 135 insertions(+), 96 deletions(-) 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 50025f601..9518db6b3 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 @@ -356,6 +356,10 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setPayTime(new Date()); this.addOilTrack(jsonObjects.get(i),storeId); } + if (map.get("allAmount").equals("0")){ + order.setPayTime(new Date()); + order.setOrderStatus("paid"); + } baseMapper.insert(order); oilOrder1 = this.selectOilOrderByOrderNo(orderNo); } @@ -405,7 +409,6 @@ public class OilOrderServiceImpl extends ServiceImpl i cashierOrder.setGoodsOrderId(goodsOrder1.getId()); } cashierOrderService.insertCashierOrder(cashierOrder); -// this.insertAllOrderInfo(orderNo,storeId,oilAmount,payType,userId,"PC"); return orders; } @@ -421,16 +424,16 @@ public class OilOrderServiceImpl extends ServiceImpl i if (!map.get("oilOrder").equals("[]")) { oilOrders = JSONArray.parseArray(map.get("oilOrder"), JSONObject.class); -// 条码支付 - if (authCode.contains("19")) { - String[] split = authCode.split("19"); +// 二维码支付 + if (authCode.contains("9E")) { + String[] split = authCode.split("9E"); // 获取用户id Integer userId = Integer.valueOf(split[1]); res = this.updateUserBalanceAndInsetOrder(userId,map,oilAmount,oilOrders,nowAccountInfo.getStoreId()); } -// 二维码支付 - if (authCode.contains("9E")) { - String[] split = authCode.split("9E"); +// 条码支付 + if (authCode.contains("19") && authCode.matches("\\d+")) { + String[] split = authCode.split("19"); // 获取用户id Integer userId = Integer.valueOf(split[1]); res = this.updateUserBalanceAndInsetOrder(userId,map,oilAmount,oilOrders,nowAccountInfo.getStoreId()); @@ -530,15 +533,17 @@ public class OilOrderServiceImpl extends ServiceImpl i String oilType = ((JSONObject) refuelMoney).get("oilType").toString(); Double refuelMoneyLiters = Double.valueOf(((JSONObject) refuelMoney).get("refuelMoney").toString()); // 根据油品名称查询油品id - OilName oilName = oilNameService.selectOilNameByOilName(oilType); + OilName oilName = oilNameService.selectOilNameById(Integer.valueOf(oilType)); OilOrder order = new OilOrder(); OilOrder oilOrder = null; // 添加收银台订单信息 CashierOrder cashierOrder = new CashierOrder(); + boolean flag = false; for (int i = 0;i < oilOrders.size();i++) { if (oilOrders.get(i).get("oilName").equals(oilName.getId().toString())){ if (refuelMoneyLiters>=Double.valueOf(oilOrders.get(i).get("liters").toString())){ + flag = true; Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString()); Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString()); Double oilNum = amount / oilPrice; @@ -592,9 +597,10 @@ public class OilOrderServiceImpl extends ServiceImpl i } } - cashierOrderService.insertCashierOrder(cashierOrder); -// this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"applet"); - res.put("success","success"); + if (flag){ + cashierOrderService.insertCashierOrder(cashierOrder); + res.put("success","success"); + } } }else { @@ -647,8 +653,8 @@ public class OilOrderServiceImpl extends ServiceImpl i refuelMoney1.setRefuelMoney(((JSONObject) money).get("refuelMoney").toString()); Double refuelMoneyLiters = Double.valueOf(((JSONObject) money).get("refuelMoney").toString()); // 根据油品名称查询油品id - OilName oilName = oilNameService.selectOilNameByOilName(((JSONObject) money).get("oilType").toString()); - if (oilName.getId().toString().equals(oilId.toString())){ +// OilName oilName = oilNameService.selectOilNameByOilName(((JSONObject) money).get("oilType").toString()); + if (((JSONObject) money).get("oilType").toString().equals(oilId.toString())){ refuelMoney1.setRefuelMoney(String.valueOf(refuelMoney)); } list.add(refuelMoney1); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java index ab59629dd..79836430e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java @@ -185,8 +185,7 @@ public class LJUserController extends BaseController { @PostMapping("/name") public ResponseObject userVoByName(@Validated @RequestBody Map map){ String name = map.get("name"); - List list = userService.queryUserByName(name); - return getSuccessResult(list); + return getSuccessResult(userService.queryUserByName(name)); } /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java index 9bf17e4cf..a5d7865dc 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java @@ -89,7 +89,7 @@ public interface LJUserService extends IService { * @param name * @return */ - public List queryUserByName(String name); + public Map queryUserByName(String name); /** * 根据id删除会员信息 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 49020b854..1ee593390 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 @@ -159,6 +159,7 @@ public class LJUserServiceImpl extends ServiceImpl impleme if (ObjectUtil.isNotEmpty(store)){ ljUserVo = baseMapper.selectUserByMobileAndChantStoreId(mobile,store.getChainStoreId()); } + ljUserVo.setStoreId(store.getId()); return ljUserVo; } @@ -205,11 +206,14 @@ public class LJUserServiceImpl extends ServiceImpl impleme * @return */ @Override - public List queryUserByName(String name) { + public Map queryUserByName(String name) { + Map map = new HashMap<>(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId()); List list = baseMapper.selectUserByName(name,store.getChainStoreId()); - return list; + map.put("userVo",list); + map.put("storeId",store.getId()); + return map; } @Autowired diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index dc3aaac6b..cb435fac1 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -152,17 +152,6 @@ width="400" trigger="click">
- - - - - - - - - - - @@ -482,7 +471,7 @@ :visible.sync="dialogVisiblej" width="30%" :close-on-click-modal="false"> -
应收金额
@@ -823,7 +812,7 @@ checkedCities3: [], cities3: cityOptions, // 储值卡全选 - checkAll4: true, + checkAll4: false, isIndeterminate4: true, checkedCities4: [], cities4: cityOptions, @@ -900,6 +889,7 @@ // 会员列表信息 memberList:[], select1:'会员手机号', + storeId:"", // 查询会员信息参数 userNo:"", // 查询的商品信息 @@ -1022,7 +1012,7 @@ menu:1, index:0, // 是否支付 - isPay:true, + isPay:false, isPaySuccess:false, // 订单号 orderNo:'', @@ -1244,7 +1234,7 @@ } this.checkedCities1 = val ? list : []; this.isIndeterminate1 = false; - this.isExclusion(); + this.isDefaultUseCard(); }, handleCheckedCitiesChange1(value) { this.fullReduction = 0; @@ -1260,7 +1250,7 @@ let checkedCount = value.length; this.checkAll1 = checkedCount === this.fullReduceDiscount.length; this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.fullReduceDiscount.length; - this.isExclusion(); + this.isDefaultUseCard(); }, handleCheckAllChange2(val) { let list = [] @@ -1276,7 +1266,7 @@ } this.checkedCities2 = val ? list : []; this.isIndeterminate2 = false; - this.isExclusion(); + this.isDefaultUseCard(); }, handleCheckedCitiesChange2(value) { this.oilDiscount = 0 @@ -1292,7 +1282,7 @@ let checkedCount = value.length; this.checkAll2 = checkedCount === this.gradeDiscount.length; this.isIndeterminate2 = checkedCount > 0 && checkedCount < this.gradeDiscount.length; - this.isExclusion(); + this.isDefaultUseCard(); }, handleCheckAllChange3(val) { if (val==false){ @@ -1303,7 +1293,7 @@ this.isOilStorageCard = true; this.changeRefuelMoney() } - this.isExclusion(); + this.isDefaultUseCard(); }, handleCheckedCitiesChange3(value) { let checkedCount = value.length; @@ -1317,7 +1307,7 @@ }else { this.isUseBalance = false; } - this.isExclusion(); + this.isDefaultUseCard(); }, handleCheckedCitiesChange4(value) { let checkedCount = value.length; @@ -1361,7 +1351,7 @@ this.couponAmount = 0 this.checkedCities5 = "" } - this.isExclusion(); + this.isDefaultUseCard(); }, handleCheckedCitiesChange5(value) { this.couponAmount = 0; @@ -1377,7 +1367,7 @@ } }) this.checkAll5 = true; - this.isExclusion(); + this.isDefaultUseCard(); }, // 模糊查询商品信息 querySearch(queryString, cb) { @@ -1910,7 +1900,7 @@ } _this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount _this.checkAll2 = true; - _this.isExclusion(); + _this.isDefaultUseCard(); }) }, // 选择会员 @@ -1920,10 +1910,14 @@ this.map.payUser = data.mobile; this.map.userId = data.id; this.balance = this.member.cardBalance; + if (data.refuelMoney){ + // 使用囤油卡 + this.refuelMoney = JSON.parse(data.refuelMoney) + this.changeRefuelMoney(); + }else this.getGrade(data.id,data.gradeId) - this.changeRefuelMoney(); - this.handleChange(); - this.preferentialData.storeId = data.storeId; + // this.handleChange(); + this.preferentialData.storeId = this.storeId; this.preferentialData.userId = data.id; this.preferentialData.gradeId = data.gradeId; if (this.oilOrder.length>0){ @@ -2017,24 +2011,25 @@ }) } _this.checkAll5 = true; - _this.isExclusion(); + _this.isDefaultUseCard(); }) }) }, // 使用囤油卡 囤油卡不参与任何优惠 countOilCard(){ - if (this.hoardAmount!=0){ - if (this.balance!=0 && this.balance >= (this.oilAmount - this.hoardAmount)){ + if (this.hoardAmount>0){ + if (this.balance!=0 && this.balance >= this.hoardAmount){ this.oilActualPay = 0 this.consumeAmount = this.hoardAmount }else { - this.oilActualPay = (this.oilAmount - this.hoardAmount -this.balance).toFixed(2) + this.oilActualPay = (this.hoardAmount -this.balance).toFixed(2) + this.consumeAmount = this.balance } }else { this.oilActualPay = 0 this.consumeAmount = 0 } - console.log("囤油卡",this.hoardAmount,this.balance,this.oilAmount,this.oilActualPay,this.consumeAmount) + console.log("囤油卡",this.isOilStorageCard,this.hoardAmount,this.balance,this.oilAmount,this.oilActualPay,this.consumeAmount) }, // 使用优惠券不使用满减 countAmountFull(){ @@ -2050,6 +2045,7 @@ }else { this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2) } + console.log("优惠券",this.oilAmount, this.oilDiscount,this.couponAmount) }, // 使用优惠券和满减不使用储值卡 countAmountUnBalance(){ @@ -2059,6 +2055,7 @@ this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2) } this.consumeAmount = 0 + console.log("优惠券和满减",this.oilAmount , this.fullReduction , this.oilDiscount , this.couponAmount) }, // 使用储值卡不使用优惠券 || 使用满减不使用优惠券 countAmountBalance(){ @@ -2073,6 +2070,7 @@ }else { this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2) } + console.log("储值卡满减",this.oilAmount, this.oilDiscount,this.fullReduction) }, // 判断互斥限制 isExclusion(){ @@ -2117,20 +2115,39 @@ return; } // 使用囤油卡 - if (this.isOilStorageCard){ - this.checkAll1 = false; - this.fullReduction = 0; - this.checkAll2 = false; - this.checkedCities2 = [], - this.oilDiscount = 0; - this.checkAll5 = false; - this.couponAmount = 0; - this.countOilCard(); - return; - } + // if (this.isOilStorageCard){ + // this.checkAll1 = false; + // this.fullReduction = 0; + // this.checkAll2 = false; + // this.checkedCities2 = []; + // this.oilDiscount = 0; + // this.checkAll5 = false; + // this.couponAmount = 0; + // this.countOilCard(); + // return; + // } this.countAmountBalance(); } }, + // 默认使用囤油卡 + isDefaultUseCard(){ + if (this.isOilStorageCard){ + this.checkAll3 = true; + this.checkAll1 = false; + this.fullReduction = 0; + this.checkAll2 = false; + this.checkedCities2 = []; + this.oilDiscount = 0; + this.checkAll5 = false; + this.couponAmount = 0; + this.countOilCard(); + if (this.hoardAmount>0 && this.balance > 0){ + this.checkAll4 = true; + } + }else { + this.isExclusion() + } + }, // 调用优惠参数接口 preferential(){ let _this = this; @@ -2188,7 +2205,7 @@ _this.checkedCities1 = [] _this.fullReduction = 0 } - _this.isExclusion(); + _this.isDefaultUseCard(); }) }) }, @@ -2196,9 +2213,9 @@ handleChoose(data) { this.isSure = false; this.member = data; - if (data.refuelMoney != null && data.refuelMoney != ""){ - this.refuelMoney = JSON.parse(data.refuelMoney) - } + // if (data.refuelMoney != null && data.refuelMoney != ""){ + // this.refuelMoney = JSON.parse(data.refuelMoney) + // } this.dialogVisibleMember = false; }, // 清空商品订单列表 @@ -2278,8 +2295,10 @@ settlement(){ this.authCode = "" this.seekZero = 0; - this.isPay = true + this.isPay = false + console.log(this.isPay) this.dialogVisiblej = true + this.getStaff() }, // 重置油品订单 resetting(){ @@ -2362,13 +2381,17 @@ _this.consumeRefuelMoney = 0; _this.oilActualPay = 0; _this.hoardAmount = 0; + _this.oilAmount = 0; _this.oilOrder.forEach(item => { let conRefMon = 0; let hoardAmount = 0; - if (_this.refuelMoney!=null){ + let id = "" + if (_this.refuelMoney){ for (let i = 0;i < _this.refuelMoney.length;i++){ // 囤油卡升数变化 - if (_this.refuelMoney[i].oilType==item.oilType){ + if (_this.refuelMoney[i].oilType==item.oilType && _this.refuelMoney[i].refuelMoney>0){ + id = item.id + _this.isOilStorageCard = true if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){ conRefMon = item.liters }else { @@ -2376,18 +2399,34 @@ // 扣除升数后需要消费的金额 hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2) } + }else { + hoardAmount = item.amount } } } _this.consumeRefuelMoney += +conRefMon - if (_this.consumeRefuelMoney!=0){ - _this.isOilStorageCard = true; - _this.checkAll3 = true; - _this.consumeAmount = 0; - } _this.hoardAmount += +hoardAmount + _this.oilAmount += +item.amount + // _this.changeBalance(_this.hoardAmount,id) + // if (_this.consumeRefuelMoney!=0){ + // _this.isOilStorageCard = true; + // _this.checkAll3 = true; + // _this.consumeAmount = 0; + // } + _this.isDefaultUseCard(); }) - _this.isExclusion(); + }, + changeBalance(hoardAmount,id){ + if (this.balance>0 && id != ""){ + this.oilOrder.forEach(item => { + if (this.balance >= item.amount){ + this.consumeAmount = item.amount + }else { + this.consumeAmount = this.balance + this.oilActualPay = item.amount - this.balance + } + }) + } }, // 选择“元”或“L” changeSelect(){ @@ -2447,16 +2486,18 @@ getUserInfoMobile({mobile:this.userNo}).then( response => { if (response.data!=null){ this.member = response.data + this.storeId = response.data.storeId this.isSure = false }else { this.$modal.msgError("会员信息不存在") } }) }else { - getUserVoName({name:this.userNo}).then( response => { - this.memberList = response.data - }) this.dialogVisibleMember = true; + getUserVoName({name:this.userNo}).then( response => { + this.memberList = response.data.userVo + this.storeId = response.data.storeId + }) } }, // 查询所有商品信息 @@ -2527,13 +2568,13 @@ let _this = this; if (this.payType=="APPLET_CODE"){ - this.loading = true; scanAppletQrCode(_this.map).then( resp => { - if (resp.data.success!=undefined){ + if (resp.data.success=='success'){ + this.loading = true; setTimeout(function (){ _this.isPaySuccess = true; - this.loading = false; - _this.isPay = false; + _this.loading = false; + _this.isPay = true; _this.resetting1(); },3000) }else { @@ -2577,7 +2618,7 @@ let timer = setInterval(function () { if (_this.isQuery == false) { _this.loading = false; - _this.isPay = false; + _this.isPay = true; clearInterval(_this.timer); } },500) @@ -2704,22 +2745,11 @@ },500) }, handClose(){ - if(this.isPaySuccess){ - this.oilAmount = 0; - this.oilActualPay = 0; - this.oilDiscount = 0; - this.goodsAmount = 0; - this.goodsActualPay = 0; - this.goodsDiscount = 0; - this.consumeAmount = 0; - this.consumeRefuelMoney = 0; - this.oilTotal = 0; - this.goodsTotal = 0; - this.isMember = false; - } - this.isPay = true; - this.dialogVisiblej = false + this.resetting1() + this.member = {}; this.isPaySuccess = false; + this.isPay = false; + this.dialogVisiblej = false }, // 支付方式 payMethod(payType){ From b5d5f6b1eb131fd246b317df2ef2bc54e9e08fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Fri, 12 Jan 2024 12:05:42 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EventMarketing/Writeoffrecords/index.vue | 8 ++-- .../impl/ActiveExchangeServiceImpl.java | 3 -- .../service/ActiveNewlywedsService.java | 1 + .../ActiveNewlywedsRecordsServiceImpl.java | 43 +++++++++++-------- .../impl/ActiveNewlywedsServiceImpl.java | 37 ++++++++++++++++ .../CardExchangeRecordController.java | 10 +++++ .../service/impl/CardGiftServiceImpl.java | 23 ++++++++++ .../impl/CardValueRecordServiceImpl.java | 1 + 8 files changed, 102 insertions(+), 24 deletions(-) diff --git a/fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue b/fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue index 6be83fd82..72d283a14 100644 --- a/fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue +++ b/fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue @@ -28,12 +28,12 @@ /> - + 搜索 @@ -62,9 +62,9 @@ - + - + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index b4a538567..894d44575 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -290,9 +290,6 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { new Date().getTime() <= cardFavorable.getCreateTime().getTime() + Integer.parseInt(cardFavorable.getValidityDay()) * 86400000L + 86400000L * cardFavorable.getValidityTwo()) { BeanUtils.copyProperties(cardFavorable, exchangeFavorableVO); } - /*if (){ - - }*/ exchangeFavorableVOArrayList.add(exchangeFavorableVO); } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java index 922059183..9143c2fe7 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/ActiveNewlywedsService.java @@ -40,6 +40,7 @@ public interface ActiveNewlywedsService extends IService { * @return */ ActiveNewlywedsVO getOneById(Serializable id); + ActiveNewlywedsVO getOneByStoreId(Serializable id); ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption); /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java index db9a238ce..21f8a889c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsRecordsServiceImpl.java @@ -14,11 +14,14 @@ import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRec import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord; import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableRecordMapper; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; +import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.service.LJUserService; +import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.vo.LJUserVo; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import com.sun.xml.bind.v2.TODO; +import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +46,8 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl activeNewlywedsChildList = activeNewlyweds.getActiveNewlywedsChildList(); if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){ for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsChildList) { if (activeNewlywedsChild.getActiveGift().equals("1")){ - cardFavorableRecord.setCardFavorableId(activeNewlywedsChild.getActiveNewlywedsId()); - cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId()); + CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); + cardFavorableRecord.setCardFavorableId(activeNewlywedsChild.getVouchersId()); cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId()); - cardFavorableRecord.setMtUserId(userId); + cardFavorableRecord.setMtUserId(ljUserVo.getId()); cardFavorableRecord.setName(ljUserVo.getName()); cardFavorableRecord.setMobile(ljUserVo.getMobile()); - cardFavorableRecord.setName(nowAccountInfo.getRealName()); + cardFavorableRecord.setStatus("0"); cardFavorableRecord.setExchangeFrom("新人发券"); - save = cardFavorableRecordService.save(cardFavorableRecord); + save = cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord); }else { //兑换券 CardExchangeRecord cardExchangeRecord = new CardExchangeRecord(); - cardExchangeRecord.setCardExchangeId(activeNewlywedsChild.getActiveNewlywedsId()); - cardExchangeRecord.setChainStorId(nowAccountInfo.getChainStoreId()); + cardExchangeRecord.setCardExchangeId(activeNewlywedsChild.getVouchersId()); cardExchangeRecord.setStoreId(nowAccountInfo.getStoreId()); - cardExchangeRecord.setMtUserId(userId); + cardExchangeRecord.setMtUserId(ljUserVo.getId()); cardExchangeRecord.setName(ljUserVo.getName()); cardExchangeRecord.setMobile(ljUserVo.getMobile()); - cardExchangeRecord.setExchangeName(activeNewlywedsChild.getGiftCardName()); + cardExchangeRecord.setPhoto(ljUserVo.getAvatar()); + cardExchangeRecord.setStatus("0"); cardExchangeRecord.setExchangeFrom("新人领券"); - cardExchangeRecord.setGiftName(activeNewlywedsChild.getGiftCardName()); - cardExchangeRecord.setDescription(activeNewlywedsChild.getGiftCardDetail()); - save = cardExchangeRecordService.save(cardExchangeRecord); + save = cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord); } } + //用户余额 + UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId()); //积分 - //成长值 TODO + if (ObjectUtils.isNotEmpty(userBalance.getPoints()) && ObjectUtils.isNotEmpty(activeNewlyweds.getPoints())){ + userBalance.setPoints(userBalance.getPoints() + activeNewlyweds.getPoints()); + } + //成长值 + if (ObjectUtils.isNotEmpty(userBalance.getGrowthValue()) && ObjectUtils.isNotEmpty(activeNewlyweds.getGrowthValue())){ + userBalance.setGrowthValue(userBalance.getGrowthValue() + activeNewlyweds.getGrowthValue()); + } + userBalanceService.updateUserBalance(userBalance); } - // - return save; } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java index 7d0b740ad..2b00d6c27 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeNewlyweds/service/impl/ActiveNewlywedsServiceImpl.java @@ -183,6 +183,43 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,id); + ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper); + //获取兑换物品信息 + if (ObjectUtils.isNotEmpty(activeNewlyweds)){ + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId()); + queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime); + List activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper); + BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO); + //封装VO返回 + activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(",")); + if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){ + activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList); + }else { + ArrayList activeNewlywedsChildLists = new ArrayList<>(); + activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists); + } + }else { + ArrayList activeNewlywedsChildList = new ArrayList<>(); + activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList); + } + } + return activeNewlywedsVO; + } + /** * 通过店铺查询单条数据(小程序端) * @param activeConsumption diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java index c885a6aeb..75694a474 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java @@ -4,6 +4,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.marketingActivity.cardExchange.dto.CardExchangeRecordDTO; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService; +import com.fuint.business.member.entity.LJStaff; +import com.fuint.business.member.service.ILJStaffService; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; import com.fuint.framework.web.BaseController; import com.fuint.framework.web.ResponseObject; import org.apache.ibatis.annotations.Param; @@ -27,6 +31,8 @@ public class CardExchangeRecordController extends BaseController { */ @Resource private CardExchangeRecordService cardExchangeRecordService; + @Resource + private ILJStaffService iljStaffService; /** * 分页查询所有数据 @@ -104,6 +110,10 @@ public class CardExchangeRecordController extends BaseController { */ @PutMapping public ResponseObject update(@RequestBody CardExchangeRecord cardExchangeRecord) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId()); + cardExchangeRecord.setRealName(ljStaff.getRealName()); + cardExchangeRecord.setStaffMobile(ljStaff.getMobile()); return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord)); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java index 857140129..6d62c1a2f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardGift/service/impl/CardGiftServiceImpl.java @@ -11,13 +11,19 @@ import com.fuint.business.marketingActivity.cardGift.service.CardGiftService; import com.fuint.business.oilDepotConfiguration.entity.OilDepotConfig; import com.fuint.business.oilDepotConfiguration.service.OilDepotConfigService; import com.fuint.business.store.service.StoreService; +import com.fuint.business.userManager.entity.UserBalance; +import com.fuint.business.userManager.mapper.LJUserMapper; +import com.fuint.business.userManager.service.UserBalanceService; +import com.fuint.business.userManager.vo.LJUserVo; import com.fuint.common.util.TokenUtil; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; @@ -38,6 +44,10 @@ public class CardGiftServiceImpl extends ServiceImpl i @Resource private StoreService storeService; + @Resource + private UserBalanceService userBalanceService; + @Resource + private LJUserMapper ljUserMapper; /** * 新增数据 @@ -148,6 +158,7 @@ public class CardGiftServiceImpl extends ServiceImpl i * @return */ @Override + @Transactional public CardGift exchange(CardGift cardGift) { //登录用户id Integer userId = TokenUtil.getNowAccountInfo().getId(); @@ -161,6 +172,17 @@ public class CardGiftServiceImpl extends ServiceImpl i one.setActivateStatus("1"); one.setUserId(userId); updateById(one); + //更新用户余额 + Double cardAmount = one.getCardAmount(); + //会员信息 + LJUserVo ljUserVo = ljUserMapper.selectUserById(userId); + UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId()); + Double cardBalance = userBalance.getCardBalance(); + BigDecimal bigDecimal = BigDecimal.valueOf(cardAmount); + BigDecimal bigDecimal1 = BigDecimal.valueOf(cardBalance); + BigDecimal add = bigDecimal1.add(bigDecimal); + userBalance.setCardBalance(add.doubleValue()); + userBalanceService.updateUserBalance(userBalance); return one; }else { return cardGift; @@ -179,6 +201,7 @@ public class CardGiftServiceImpl extends ServiceImpl i Integer userId = TokenUtil.getNowAccountInfo().getId(); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(CardGift::getUserId,userId); + queryWrapper.orderByDesc(CardGift::getUpdateTime); return page(page,queryWrapper); } } 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 f72779333..b9353be42 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 @@ -768,6 +768,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl Date: Fri, 12 Jan 2024 13:26:22 +0800 Subject: [PATCH 4/6] bug --- .../controller/LJUserController.java | 10 ++++ .../userManager/service/LJUserService.java | 7 +++ .../service/impl/LJUserServiceImpl.java | 7 +++ .../views/cashier/NewComponents/homeindex.vue | 57 ++++++++++--------- 4 files changed, 55 insertions(+), 26 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java index 79836430e..6eab3dfc3 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java @@ -126,6 +126,16 @@ public class LJUserController extends BaseController { return getSuccessResult(map1); } + /** + * 根据storeId查询会员信息 + * @param storeId + * @return + */ + @GetMapping("/storeUserInfo/{storeId}") + public ResponseObject userVoInfo1(@PathVariable Integer storeId){ + return getSuccessResult(userService.queryUserByStoreIdAndUserId(storeId)); + } + @GetMapping("/getByUniApp") public ResponseObject getByUniApp(Integer chainStoreId){ LJUserVo user = userService.getByUniApp(chainStoreId); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java index a5d7865dc..b2b2301c4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java @@ -60,6 +60,13 @@ public interface LJUserService extends IService { */ public Map queryUserByStoreId(Integer storeId,Integer mobile); + /** + * 根据storeId获取连锁店id 根据连锁店id查询用户信息 + * @param storeId + * @return + */ + public LJUserVo queryUserByStoreIdAndUserId(Integer storeId); + /** * 根据手机号和连锁店id查询会员信息 * @param mobile 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 1ee593390..7e05bf5d6 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 @@ -151,6 +151,13 @@ public class LJUserServiceImpl extends ServiceImpl impleme return map; } + @Override + public LJUserVo queryUserByStoreIdAndUserId(Integer storeId) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + LJStore store = storeService.selectStoreByStoreId(storeId); + return baseMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId()); + } + @Override public LJUserVo selectUserByMobileAndChantStoreId(String mobile) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index cb435fac1..40438ae0b 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -572,7 +572,7 @@ {{member.cardBalance ? member.cardBalance : "--"}}元 @@ -2062,7 +2062,7 @@ if (this.isMember){ if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){ this.oilActualPay = 0 - this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction + this.consumeAmount = (this.oilAmount*100 - this.oilDiscount*100 - this.fullReduction*100)/100 }else { this.oilActualPay = (this.oilAmount -this.balance - this.oilDiscount - this.fullReduction).toFixed(2) this.consumeAmount = this.balance @@ -2241,6 +2241,7 @@ // 删除商品列表信息 delGoods(index){ this.goodsOrder.splice(index,1) + this.handleChange() }, // 添加商品列表信息 changeGoods(val){ @@ -2250,11 +2251,6 @@ if (this.goodsOrder.length > 0) { let amount = 0; for (let i = 0; i < goods.length; i++) { - if (_this.isMember) { - amount += +(goods[i].memberPrice * goods[i].num).toFixed(2) - } else { - amount += +(goods[i].retailPrice * goods[i].num).toFixed(2) - } if (goods[i].id == val.id) { if (val.stock 0) { + this.$modal.msgError("非油商品不可使用小程序码支付") + return; + } + } this.authCode = "" this.seekZero = 0; this.isPay = false - console.log(this.isPay) this.dialogVisiblej = true this.getStaff() }, @@ -2568,6 +2586,10 @@ let _this = this; if (this.payType=="APPLET_CODE"){ + if (this.goodsOrder.length>0){ + this.$modal.msgError("非油商品不可使用小程序码支付") + return; + } scanAppletQrCode(_this.map).then( resp => { if (resp.data.success=='success'){ this.loading = true; @@ -2585,8 +2607,8 @@ } addLJGoods(_this.map).then( response => { + _this.orderNo = response.data.orderNo; if (response.data.oilOrder!=null){ - _this.orderNo = response.data.oilOrder.orderNo; if (response.data.oilOrder.orderStatus == "paid"){ _this.isPaySuccess = true; _this.seekZero = 0 @@ -2709,23 +2731,6 @@ _this.timer = setInterval(function (){ // "234520231228115544f073f4" cashierOrderByOrderNo({orderNo:_this.orderNo}).then( response => { - if (response.data!=null){ - if (response.data.orderStatus == "unpaid"){ - _this.isQuery = true; - } - if (response.data.orderStatus == "paid"){ - _this.isPaySuccess = true; - _this.isQuery = false; - _this.amount = 0 - } - if (response.data.orderStatus == "payFail"){ - _this.isPaySuccess = false; - _this.isQuery = false; - } - } - _this.resetting1(); - }) - goodsOrder({orderNo:_this.orderNo}).then( response => { if (response.data!=null){ if (response.data.status == "unpaid"){ _this.isQuery = true; From a4c4e5fa0a13b8315d176c97dda9bf90e86ec10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Fri, 12 Jan 2024 13:26:50 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gasStation-uni/pages/index/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index e8f166074..a751e1a2f 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -279,7 +279,7 @@ url: 'business/marketingActivity/activeNewlywedsRecords', method: 'post', data: { - + storeId: this.storeId } }).then(res => { console.log("11111" + res) From 4ed6ba6e8c95f19f84a19fc0f008dfb38b18071b Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Fri, 12 Jan 2024 13:55:40 +0800 Subject: [PATCH 6/6] bug --- fuintAdmin/src/api/convenienceStore/goods.js | 18 +++-- .../src/views/convenienceStore/goodsFile.vue | 56 ++++++++----- .../controller/CvsGoodsController.java | 9 +++ .../service/CvsGoodsService.java | 6 ++ .../service/impl/CvsGoodsServiceImpl.java | 8 ++ .../business/order/entity/CreditUnit.java | 8 ++ .../order/mapper/xml/HangBillMapper.xml | 5 +- .../service/impl/CreditUnitServiceImpl.java | 14 ++++ .../service/impl/OilOrderServiceImpl.java | 29 ++++--- .../src/api/cashier/cashierorder.js | 2 +- .../views/cashier/NewComponents/credit.vue | 79 ++++++++----------- .../views/cashier/NewComponents/homeindex.vue | 3 +- gasStation-uni/pagesMy/VIP/vip.vue | 2 +- 13 files changed, 153 insertions(+), 86 deletions(-) diff --git a/fuintAdmin/src/api/convenienceStore/goods.js b/fuintAdmin/src/api/convenienceStore/goods.js index 666ea2cc6..06679c043 100644 --- a/fuintAdmin/src/api/convenienceStore/goods.js +++ b/fuintAdmin/src/api/convenienceStore/goods.js @@ -20,11 +20,19 @@ export function selectTree(data) { // 联级选择器 树形数据结构 export function cvsGoodsTree() { - return request({ - url: '/business/cvsGoods/tree', - method: 'get', - }) - } + return request({ + url: '/business/cvsGoods/tree', + method: 'get', + }) +} + +// 联级选择器 树形数据结构 +export function cvsGoodsAll() { + return request({ + url: '/business/cvsGoods', + method: 'get', + }) +} // 查询一级分类 export function list(data) { diff --git a/fuintAdmin/src/views/convenienceStore/goodsFile.vue b/fuintAdmin/src/views/convenienceStore/goodsFile.vue index 1cfae09ed..df3751b1f 100644 --- a/fuintAdmin/src/views/convenienceStore/goodsFile.vue +++ b/fuintAdmin/src/views/convenienceStore/goodsFile.vue @@ -11,14 +11,6 @@ :options="cvsGoodOptions" :props="{ checkStrictly: true }" clearable> - - - - - - - - - - - + + + + + + + + + @@ -331,7 +327,7 @@