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] 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; }