diff --git a/fuintAdmin/src/views/EventMarketing/activeDiscount/index.vue b/fuintAdmin/src/views/EventMarketing/activeDiscount/index.vue index faa9bde27..842954c78 100644 --- a/fuintAdmin/src/views/EventMarketing/activeDiscount/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeDiscount/index.vue @@ -490,6 +490,7 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); + this.activeDiscountChildList = [ {amount:'',discount:''}, ] this.open = true; this.title = "添加折扣营销"; }, @@ -500,6 +501,11 @@ export default { getActiveDiscount(id).then(response => { console.log( response.data) this.form = response.data; + if (response.data.activeDiscountChildList && response.data.activeDiscountChildList.length>0){ + this.activeDiscountChildList = response.data.activeDiscountChildList + }else { + this.activeDiscountChildList = [ {amount:'',discount:''}, ] + } this.open = true; this.title = "修改折扣营销"; }); diff --git a/fuintAdmin/src/views/EventMarketing/activeFullminus/index.vue b/fuintAdmin/src/views/EventMarketing/activeFullminus/index.vue index 79db431c4..3e7fae61c 100644 --- a/fuintAdmin/src/views/EventMarketing/activeFullminus/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeFullminus/index.vue @@ -456,6 +456,7 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); + this.activeDiscountChildList = [ {amount:'',deductionAmount:''}, ] this.open = true; this.title = "添加满减营销"; }, @@ -464,7 +465,13 @@ export default { this.reset(); const id = row.id || this.ids getActiveFullminus(id).then(response => { + console.log(response) this.form = response.data; + if (response.data.activeDiscountChildList && response.data.activeDiscountChildList.length>0){ + this.activeDiscountChildList = response.data.activeDiscountChildList + }else { + this.activeDiscountChildList = [ {amount:'',deductionAmount:''}, ] + } this.open = true; this.title = "修改满减营销"; }); diff --git a/fuintAdmin/src/views/EventMarketing/giftBlock/index.vue b/fuintAdmin/src/views/EventMarketing/giftBlock/index.vue index 416957b64..5602077ac 100644 --- a/fuintAdmin/src/views/EventMarketing/giftBlock/index.vue +++ b/fuintAdmin/src/views/EventMarketing/giftBlock/index.vue @@ -410,7 +410,7 @@ import { // 下载 handleChange(file, fileList) { this.uploading = true; - console.log(file) + console.log(file,111) if(file.status === 'success'){ this.uploading = false; this.openUpload = false; @@ -418,6 +418,7 @@ import { this.fileList.splice(0,1) this.result = file.response.data + this.getlist() } }, putStatus(id){ diff --git a/fuintAdmin/src/views/integral/gift/index.vue b/fuintAdmin/src/views/integral/gift/index.vue index fe4e646ac..4310c9fbf 100644 --- a/fuintAdmin/src/views/integral/gift/index.vue +++ b/fuintAdmin/src/views/integral/gift/index.vue @@ -255,7 +255,7 @@ diff --git a/fuintAdmin/src/views/member/userInfo.vue b/fuintAdmin/src/views/member/userInfo.vue index e7ae1bec3..95342f149 100644 --- a/fuintAdmin/src/views/member/userInfo.vue +++ b/fuintAdmin/src/views/member/userInfo.vue @@ -366,7 +366,7 @@ - + @@ -1411,7 +1411,7 @@ export default { this.title = this.payment }, confirm1(){ - this.$refs["form"].validate(valid => { + this.$refs["form2"].validate(valid => { if (valid) { this.form2.userId = this.id giftCardExchange(this.form2).then(res => { @@ -1422,6 +1422,7 @@ export default { this.openRecharge = false this.form2.number = '' this.form2.cardPassword = '' + this.getUserInfo() } }) } @@ -1602,6 +1603,7 @@ export default { // 当支付成功时 this_.isPaySuccess = true; this_.isQuery = false; + this_.getUserInfo() }else if (payStatus === "payFail") { this_.isPaySuccess = false; this_.isQuery = false; @@ -1675,6 +1677,7 @@ export default { if (response.data.payStatus == "paid") { this_.isPaySuccess = true; this_.isQuery = false; + this_.getUserInfo() } if (response.data.payStatus == "payFail") { this_.isPaySuccess = false; diff --git a/fuintAdmin/src/views/staffCommission/staffCommission.vue b/fuintAdmin/src/views/staffCommission/staffCommission.vue index f9b93c223..9d30d7adc 100644 --- a/fuintAdmin/src/views/staffCommission/staffCommission.vue +++ b/fuintAdmin/src/views/staffCommission/staffCommission.vue @@ -218,15 +218,15 @@ - + - - + + diff --git a/fuintAdmin/src/views/userGrade/index.vue b/fuintAdmin/src/views/userGrade/index.vue index 1f64ffec2..006412e80 100644 --- a/fuintAdmin/src/views/userGrade/index.vue +++ b/fuintAdmin/src/views/userGrade/index.vue @@ -329,8 +329,8 @@ width="80"> { if (response.data==1) { this.$modal.msgSuccess("修改成功"); + this.tableDatas1 = [] + this.tableDatas = [] this.open = false; this.getList(); }else if (response.data==2) { @@ -1250,6 +1252,8 @@ export default { if (res.data==1){ this.$modal.msgSuccess("新增成功"); this.open = false; + this.tableDatas1 = [] + this.tableDatas = [] this.getList(); }else if (res.data==0){ this.$modal.msgError("新增失败,最多支持20个等级"); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java index 98738d162..877987adf 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/commission/service/impl/StaffCommissionServiceImpl.java @@ -211,7 +211,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl activeDiscountChildList = activeDiscountChildService.list(queryWrappers); BeanUtils.copyProperties(s,activeDiscountVO); - activeDiscountVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(",")) - .map(Integer::valueOf) - .toArray(Integer[]::new)); + if (ObjectUtil.isNotEmpty(s.getAdaptOil())) { + activeDiscountVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(",")) + .map(Integer::valueOf) + .toArray(Integer[]::new)); + } String oilName = ""; - for (Integer integer : activeDiscountVO.getAdaptOil()) { - OilName oilNames = oilNameService.selectOilNameById(integer); - oilName += oilNames.getOilType() + "-"+oilNames.getOilName() + ","; + if (ObjectUtils.isNotEmpty(activeDiscountVO.getAdaptOil())) { + for (Integer integer : activeDiscountVO.getAdaptOil()) { + OilName oilNames = oilNameService.selectOilNameById(integer); + oilName += oilNames.getOilType() + "-" + oilNames.getOilName() + ","; + } } if (oilName.endsWith(",")) { // 判断字符串是否以逗号结尾 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 ecb5ca082..9c0cb7d89 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 @@ -841,10 +841,12 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){ for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) { BigDecimal amount = new BigDecimal(activeConsumptionVO.getAmount()); - if (activeConsumptionVO.getMoneyType().equals("1") && paymentActiveDTO.getOrderAmount()>=activeConsumptionVO.getAmount()){ + if (ObjectUtils.isNotEmpty(activeConsumptionVO.getMoneyType()) && activeConsumptionVO.getMoneyType().equals("1") + && paymentActiveDTO.getOrderAmount()>=activeConsumptionVO.getAmount()){ activeConsumptionVOS1.add(activeConsumptionVO); } - if (activeConsumptionVO.getMoneyType().equals("2") && paymentActiveDTO.getAmount().compareTo(amount)>0){ + if (ObjectUtils.isNotEmpty(activeConsumptionVO.getMoneyType()) && activeConsumptionVO.getMoneyType().equals("2") + && paymentActiveDTO.getAmount().compareTo(amount)>0){ activeConsumptionVOS1.add(activeConsumptionVO); } } 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 68a2a8db7..d25b2790e 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 @@ -1,5 +1,6 @@ package com.fuint.business.marketingActivity.cardGift.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.excel.EasyExcelFactory; import com.alipay.api.domain.LoginUserDTO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -176,7 +177,14 @@ public class CardGiftServiceImpl extends ServiceImpl i public CardGift exchange(CardGift cardGift) { //登录用户id Integer userId = TokenUtil.getNowAccountInfo().getId(); - LJUserVo ljUserVo = ljUserService.selectUserById(userId, TokenUtil.getNowAccountInfo().getStoreId()); + if (ObjectUtil.isNotEmpty(cardGift.getUserId())){ + userId = cardGift.getUserId(); + } + Integer storeId = TokenUtil.getNowAccountInfo().getStoreId(); + if (ObjectUtil.isNotEmpty(cardGift.getStoreId())){ + storeId = cardGift.getStoreId(); + } + LJUserVo ljUserVo = ljUserService.selectUserById(userId, storeId); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(CardGift::getNumber,cardGift.getNumber()); queryWrapper.eq(CardGift::getStatus,"1"); 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 805c37f50..3c539b04d 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 @@ -289,7 +289,10 @@ public class OilOrderServiceImpl extends ServiceImpl i // 商品优惠金额 Double goodsDiscount = Double.valueOf(map.get("goodsDiscount")); // 员工id - Integer staffId = Integer.valueOf(map.get("staffId")); + 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; @@ -359,7 +362,7 @@ public class OilOrderServiceImpl extends ServiceImpl i ljOrder.setDiscount(goodsDiscount); ljOrder.setStaffId(staffId); ljOrder.setStatus(payStatus); - if (payType.equals("CASH")){ + if (payType.equals("CASH") && ObjectUtil.isNotEmpty(staffId)){ staffCommissionService.countStaffCommission(staffId,storeId,goodsAmount,goodsActualPay,"2",orderNo); ljOrder.setPayTime(new Date()); } @@ -412,7 +415,7 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setDiscountAmount(oilDiscount); order.setBalanceAmount(Double.valueOf(balanceAmount)); order.setOilCardAmount(Double.valueOf(oilCardAmount)); - if (payType.equals("CASH")){ + if (payType.equals("CASH") && ObjectUtil.isNotEmpty(staffId)){ staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,"1",orderNo); } order.setCouponId(recordId); @@ -427,7 +430,7 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setCouponId(null); } - if (userId!=null){ + if (ObjectUtil.isNotEmpty(userId)){ this.updateGrowthValue(oilAmount,oilActualPay, userId, Integer.valueOf(jsonObjects.get(i).get("oilName").toString()),refuelMoney,storeId,orderNo); } order.setStoreId(storeId); @@ -551,7 +554,7 @@ public class OilOrderServiceImpl extends ServiceImpl i // 调用消费有礼接口 public void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Integer oilId){ - if (userId!=null){ + if (ObjectUtil.isNotEmpty(userId)){ LJUserVo userVo = userService.queryUserById(userId, storeId); PaymentActiveVO paymentActiveVO = new PaymentActiveVO(); paymentActiveVO.setUserId(userId); @@ -1383,7 +1386,7 @@ public class OilOrderServiceImpl extends ServiceImpl i * @param storeId 店铺id */ private void updateGrowthValue(Double oilAmount,Double oilActualPay,Integer userid,Integer oilId,String refuelMoney,Integer storeId,String orderNo){ - if (oilId!=null){ + if (ObjectUtil.isNotEmpty(oilId)){ OilName oilName = oilNameService.selectOilNameById(oilId); // 获取成长值增长数值 Integer gasGrowthValue = null; @@ -1421,7 +1424,7 @@ public class OilOrderServiceImpl extends ServiceImpl i // }else { // balance.setRefuelMoney(refuelMoney); // } - if (ObjectUtil.isNotEmpty(refuelMoney)){ + if (ObjectUtil.isNotEmpty(refuelMoney) && !refuelMoney.equals("null")){ String refuelMoney1 = balance.getRefuelMoney(); JSONArray objects = JSONArray.parseArray(refuelMoney); JSONArray objects1 = JSONArray.parseArray(refuelMoney1); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java index 4b91ab22a..48863547a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java @@ -251,7 +251,7 @@ public class LJUserGradeServiceImpl extends ServiceImpl ljUserGrades = this.selectUserGradeByChainStoreId(store.getChainStoreId()); for (LJUserGrade ljUserGrade : ljUserGrades) { if (ljUserGrade.getGrade().equals(userGrade.getGrade()) && !ljUserGrade.getId().equals(userGrade.getId())){ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java index 4a6444054..8c5d6e2cf 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java @@ -994,6 +994,12 @@ public class MemberServiceImpl extends ServiceImpl impleme } // 新增会员余额信息 userBalanceService.insertUserBalance(userBalanceAdd); + }else { + LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeByStoreId(Integer.parseInt(storeId)); + if (ObjectUtil.isNotEmpty(ljUserGrade) && ObjectUtil.isNotEmpty(ljUserGrade.getId())) { + userBalance.setGradeId(ljUserGrade.getId()); + } + userBalanceService.updateUserBalance(userBalance); } // 查询关联表里面是否有信息 (注册邀请) MtInvitation mtInvitation1 = mtInvitationMapper.queryByStoreId(Integer.parseInt(storeId), mtUser.getId()); diff --git a/fuintCashierWeb/src/api/cashier/giftCard/giftcard.js b/fuintCashierWeb/src/api/cashier/giftCard/giftcard.js index 359c122a7..0c45cba51 100644 --- a/fuintCashierWeb/src/api/cashier/giftCard/giftcard.js +++ b/fuintCashierWeb/src/api/cashier/giftCard/giftcard.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 测试支付接口 export function giftCardExchange(query) { return request({ - url: '/business/marketingActivity/cardGift/exchange', + url: '/business/marketingActivity/cardGift/exchange?number=' + query.number + "&cardPassword=" + query.cardPassword + "&userId=" + query.userId, method: 'get', data:query }) diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index 5f91d37b7..14377a074 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -68,8 +68,8 @@
{{ getName(oilNameList,item.oilName) }}_{{getName1(gunList,item.gunName)}}
-¥{{ item.discount }}
-
满减优惠
-
折扣优惠
+
满减优惠
+
折扣优惠
@@ -797,7 +797,7 @@
- + @@ -1763,15 +1763,17 @@ }, // 会员充值 async userRecharge() { - // if (this.isSure){ - if (this.member){ + if (this.isSure){ + // if (this.member){ this.$message.error("请先选择会员") return; } - await getUserGrade(this.member.gradeId).then(res => { - this.grade = res.data - }) + if (this.member && this.member.gradeId){ + await getUserGrade(this.member.gradeId).then(res => { + this.grade = res.data + }) + } await this.getCardFuelDieselList() await this.getCardValueList() @@ -2079,16 +2081,19 @@ } }, confirm1(){ - this.$refs["form"].validate(valid => { + this.$refs["form3"].validate(valid => { if (valid) { - giftCardExchange(this.form2).then(res => { + this.form3.userId = this.member.id + let cardGift = this.form3 + giftCardExchange(cardGift).then(res => { if (res.data.id == '' || res.data.id == null) { this.$message.error('兑换失败!'); } else { this.$message.success('兑换成功!'); this.openRecharge = false - this.form2.number = '' - this.form2.cardPassword = '' + this.form3.number = '' + this.form3.cardPassword = '' + this.getMemberAfter(); } }) } @@ -3860,7 +3865,6 @@ }, // 确定收款 async collection(){ - this.loading = true; if (this.payType=="CASH"){ if (this.authCode<((+this.oilActualPay) + (+this.goodsActualPay)) || this.seekZero<0){ this.$modal.msgError("请输入正确的金额"); @@ -3875,6 +3879,7 @@ this.$modal.msgError("请先扫码"); return; } + this.loading = true; // JSON.parse() this.map.seekZero = this.seekZero; this.map.oilAmount = this.oilAmount; diff --git a/fuintCashierWeb/src/views/details/index.vue b/fuintCashierWeb/src/views/details/index.vue index 5d92a438a..e1b756163 100644 --- a/fuintCashierWeb/src/views/details/index.vue +++ b/fuintCashierWeb/src/views/details/index.vue @@ -367,7 +367,7 @@ - + @@ -1368,8 +1368,9 @@ export default { } }, confirm1(){ - this.$refs["form"].validate(valid => { + this.$refs["form2"].validate(valid => { if (valid) { + this.form2.userId = this.id; giftCardExchange(this.form2).then(res => { if (res.data.id == '' || res.data.id == null) { this.$message.error('兑换失败!'); @@ -1378,6 +1379,7 @@ export default { this.openRecharge = false this.form2.number = '' this.form2.cardPassword = '' + this.getUserInfo(); } }) } diff --git a/gasStation-uni/pages/refuel/refuel.vue b/gasStation-uni/pages/refuel/refuel.vue index ab98ec4cb..ed0ab800d 100644 --- a/gasStation-uni/pages/refuel/refuel.vue +++ b/gasStation-uni/pages/refuel/refuel.vue @@ -487,7 +487,8 @@ if (uni.getStorageSync("inviteStaffId") || this.staffList.length==0) { this.toPayment(uni.getStorageSync("inviteStaffId")) } else { - this.$refs.popup.open('bottom') + // this.$refs.popup.open('bottom') + this.toPayment(uni.getStorageSync("inviteStaffId")) } } else { if (this.value == "") { @@ -547,17 +548,19 @@ // if (!this.AppToken) { // return; // } - await request({ - url: 'chainStoreInfo/theJudgmentIsTheSame', - method: 'get', - data: { - "chainStoreId": uni.getStorageSync("chainStoreId") - } - }).then(res => { - if (!res.data) { - uni.removeStorageSync("App-Token"); - } - }) + if (this.AppToken) { + await request({ + url: 'chainStoreInfo/theJudgmentIsTheSame', + method: 'get', + data: { + "chainStoreId": uni.getStorageSync("chainStoreId") + } + }).then(res => { + if (!res.data) { + uni.removeStorageSync("App-Token"); + } + }) + } if (uni.getStorageSync("appltType")== "WECHAT") { // 判断当前登录的code是否相同 diff --git a/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue b/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue index 59a47ac4a..4cee89479 100644 --- a/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue +++ b/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue @@ -596,8 +596,8 @@ //礼品卡兑换 exchangeGift() { request({ - url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" + - this.cardPassword, + url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" + + this.cardPassword + "&storeId=" + uni.getStorageSync("storeId"), method: 'get', }).then(res => { if (res.data.id == '' || res.data.id == null) { diff --git a/gasStation-uni/pagesMy/details/details.vue b/gasStation-uni/pagesMy/details/details.vue index 993ff7935..ebc1a7a39 100644 --- a/gasStation-uni/pagesMy/details/details.vue +++ b/gasStation-uni/pagesMy/details/details.vue @@ -135,10 +135,10 @@ this.getOilNumber(res.data.storeId) this.getCardFavorable(res.data.cardFavorableId) if ( res.data.activeId && res.data.activeType){ - if (res.data.activeType == "1"){ + if (res.data.activeType == "2"){ this.getFullFavorable(res.data.activeId) } - if (res.data.activeType == "2"){ + if (res.data.activeType == "1"){ this.getDiscountFavorable(res.data.activeId) } }