This commit is contained in:
cun-nan 2024-03-05 14:16:43 +08:00
parent 1de8243319
commit 4b1ee8a19f
13 changed files with 79 additions and 46 deletions

View File

@ -405,7 +405,7 @@ import {
// //
handleChange(file, fileList) { handleChange(file, fileList) {
this.uploading = true; this.uploading = true;
console.log(file) console.log(file,111)
if(file.status === 'success'){ if(file.status === 'success'){
this.uploading = false; this.uploading = false;
this.openUpload = false; this.openUpload = false;
@ -413,6 +413,7 @@ import {
this.fileList.splice(0,1) this.fileList.splice(0,1)
this.result = file.response.data this.result = file.response.data
this.getlist()
} }
}, },
putStatus(id){ putStatus(id){

View File

@ -366,7 +366,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard"> <el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard">
<el-form ref="form" :model="form2" :rules="rules1" label-width="120px"> <el-form ref="form2" :model="form2" :rules="rules1" label-width="120px">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="卡号" prop="number" style="width: 500px"> <el-form-item label="卡号" prop="number" style="width: 500px">
@ -1411,7 +1411,7 @@ export default {
this.title = this.payment this.title = this.payment
}, },
confirm1(){ confirm1(){
this.$refs["form"].validate(valid => { this.$refs["form2"].validate(valid => {
if (valid) { if (valid) {
this.form2.userId = this.id this.form2.userId = this.id
giftCardExchange(this.form2).then(res => { giftCardExchange(this.form2).then(res => {
@ -1422,6 +1422,7 @@ export default {
this.openRecharge = false this.openRecharge = false
this.form2.number = '' this.form2.number = ''
this.form2.cardPassword = '' this.form2.cardPassword = ''
this.getUserInfo()
} }
}) })
} }
@ -1602,6 +1603,7 @@ export default {
// //
this_.isPaySuccess = true; this_.isPaySuccess = true;
this_.isQuery = false; this_.isQuery = false;
this_.getUserInfo()
}else if (payStatus === "payFail") { }else if (payStatus === "payFail") {
this_.isPaySuccess = false; this_.isPaySuccess = false;
this_.isQuery = false; this_.isQuery = false;
@ -1675,6 +1677,7 @@ export default {
if (response.data.payStatus == "paid") { if (response.data.payStatus == "paid") {
this_.isPaySuccess = true; this_.isPaySuccess = true;
this_.isQuery = false; this_.isQuery = false;
this_.getUserInfo()
} }
if (response.data.payStatus == "payFail") { if (response.data.payStatus == "payFail") {
this_.isPaySuccess = false; this_.isPaySuccess = false;

View File

@ -218,15 +218,15 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24" style="display: flex;margin-bottom: 10px"> <el-col :span="24" style="display: flex;margin-bottom: 10px">
<el-form-item label="提成来源" prop="commissionSource" style="width: 420px"> <el-form-item label="提成来源" prop="commissionSource" style="width: 90%">
<el-radio-group v-model="form.commissionSource" v-if="form.commissionSource == '非油品'"> <el-radio-group v-model="form.commissionSource" v-if="form.commissionSource == '非油品'">
<!-- <el-radio v-for="dict in dict.type.source" @change="isChange" :label="dict.value">{{ dict.label }}</el-radio>--> <!-- <el-radio v-for="dict in dict.type.source" @change="isChange" :label="dict.value">{{ dict.label }}</el-radio>-->
<el-radio v-if="form.commissionSource == '非油品'" @change="isChange" label="非油品" value="非油品"></el-radio> <el-radio v-if="form.commissionSource == '非油品'" @change="isChange" label="非油品" value="非油品"></el-radio>
</el-radio-group> </el-radio-group>
<el-radio-group v-model="form.commissionSource" v-else> <el-radio-group v-model="form.commissionSource" v-else>
<!-- <el-radio v-for="dict in dict.type.source" @change="isChange" :label="dict.value">{{ dict.label }}</el-radio>--> <!-- <el-radio v-for="dict in dict.type.source" @change="isChange" :label="dict.value">{{ dict.label }}</el-radio>-->
<el-radio @change="isChange" label="储值卡充值" value="储值卡充值"></el-radio> <el-radio @change="isChange" label="电子储值卡充值" value="电子储值卡充值"></el-radio>
<el-radio @change="isChange" label="囤油卡充值" value="囤油卡充值"></el-radio> <el-radio @change="isChange" label="电子囤油卡充值" value="电子囤油卡充值"></el-radio>
<el-radio @change="isChange" label="车主加油" value="车主加油"></el-radio> <el-radio @change="isChange" label="车主加油" value="车主加油"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>

View File

@ -211,7 +211,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
} }
} }
} }
if (type.equals("3") && staffCommission.getCommissionSource().equals("储值卡充值")){ if (type.equals("3") && staffCommission.getCommissionSource().equals("电子储值卡充值")){
for (String staffRoleGroup : staffRoleGroups) { for (String staffRoleGroup : staffRoleGroups) {
if (staff.getRoleId().equals(staffRoleGroup)) { if (staff.getRoleId().equals(staffRoleGroup)) {
commissionRecord.setStaffId(staffId); commissionRecord.setStaffId(staffId);
@ -247,7 +247,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
} }
} }
} }
if (type.equals("4") && staffCommission.getCommissionSource().equals("囤油卡充值")){ if (type.equals("4") && staffCommission.getCommissionSource().equals("电子囤油卡充值")){
for (String staffRoleGroup : staffRoleGroups) { for (String staffRoleGroup : staffRoleGroups) {
if (staff.getRoleId().equals(staffRoleGroup)) { if (staff.getRoleId().equals(staffRoleGroup)) {
commissionRecord.setStaffId(staffId); commissionRecord.setStaffId(staffId);

View File

@ -841,10 +841,12 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){ if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){
for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) { for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) {
BigDecimal amount = new BigDecimal(activeConsumptionVO.getAmount()); 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); 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); activeConsumptionVOS1.add(activeConsumptionVO);
} }
} }

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.cardGift.service.impl; package com.fuint.business.marketingActivity.cardGift.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcelFactory; import com.alibaba.excel.EasyExcelFactory;
import com.alipay.api.domain.LoginUserDTO; import com.alipay.api.domain.LoginUserDTO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -176,7 +177,14 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
public CardGift exchange(CardGift cardGift) { public CardGift exchange(CardGift cardGift) {
//登录用户id //登录用户id
Integer userId = TokenUtil.getNowAccountInfo().getId(); 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<CardGift> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CardGift> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardGift::getNumber,cardGift.getNumber()); queryWrapper.eq(CardGift::getNumber,cardGift.getNumber());
queryWrapper.eq(CardGift::getStatus,"1"); queryWrapper.eq(CardGift::getStatus,"1");

View File

@ -289,7 +289,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 商品优惠金额 // 商品优惠金额
Double goodsDiscount = Double.valueOf(map.get("goodsDiscount")); Double goodsDiscount = Double.valueOf(map.get("goodsDiscount"));
// 员工id // 员工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")); Double consumeAmount = Double.valueOf(map.get("consumeAmount"));
Integer userId = null; Integer userId = null;
@ -359,7 +362,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
ljOrder.setDiscount(goodsDiscount); ljOrder.setDiscount(goodsDiscount);
ljOrder.setStaffId(staffId); ljOrder.setStaffId(staffId);
ljOrder.setStatus(payStatus); ljOrder.setStatus(payStatus);
if (payType.equals("CASH")){ if (payType.equals("CASH") && ObjectUtil.isNotEmpty(staffId)){
staffCommissionService.countStaffCommission(staffId,storeId,goodsAmount,goodsActualPay,"2",orderNo); staffCommissionService.countStaffCommission(staffId,storeId,goodsAmount,goodsActualPay,"2",orderNo);
ljOrder.setPayTime(new Date()); ljOrder.setPayTime(new Date());
} }
@ -412,7 +415,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setDiscountAmount(oilDiscount); order.setDiscountAmount(oilDiscount);
order.setBalanceAmount(Double.valueOf(balanceAmount)); order.setBalanceAmount(Double.valueOf(balanceAmount));
order.setOilCardAmount(Double.valueOf(oilCardAmount)); order.setOilCardAmount(Double.valueOf(oilCardAmount));
if (payType.equals("CASH")){ if (payType.equals("CASH") && ObjectUtil.isNotEmpty(staffId)){
staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,"1",orderNo); staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,"1",orderNo);
} }
order.setCouponId(recordId); order.setCouponId(recordId);
@ -427,7 +430,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setCouponId(null); 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); this.updateGrowthValue(oilAmount,oilActualPay, userId, Integer.valueOf(jsonObjects.get(i).get("oilName").toString()),refuelMoney,storeId,orderNo);
} }
order.setStoreId(storeId); order.setStoreId(storeId);
@ -551,7 +554,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 调用消费有礼接口 // 调用消费有礼接口
public void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Integer oilId){ 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); LJUserVo userVo = userService.queryUserById(userId, storeId);
PaymentActiveVO paymentActiveVO = new PaymentActiveVO(); PaymentActiveVO paymentActiveVO = new PaymentActiveVO();
paymentActiveVO.setUserId(userId); paymentActiveVO.setUserId(userId);
@ -1383,7 +1386,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
* @param storeId 店铺id * @param storeId 店铺id
*/ */
private void updateGrowthValue(Double oilAmount,Double oilActualPay,Integer userid,Integer oilId,String refuelMoney,Integer storeId,String orderNo){ 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); OilName oilName = oilNameService.selectOilNameById(oilId);
// 获取成长值增长数值 // 获取成长值增长数值
Integer gasGrowthValue = null; Integer gasGrowthValue = null;
@ -1421,7 +1424,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// }else { // }else {
// balance.setRefuelMoney(refuelMoney); // balance.setRefuelMoney(refuelMoney);
// } // }
if (ObjectUtil.isNotEmpty(refuelMoney)){ if (ObjectUtil.isNotEmpty(refuelMoney) && !refuelMoney.equals("null")){
String refuelMoney1 = balance.getRefuelMoney(); String refuelMoney1 = balance.getRefuelMoney();
JSONArray objects = JSONArray.parseArray(refuelMoney); JSONArray objects = JSONArray.parseArray(refuelMoney);
JSONArray objects1 = JSONArray.parseArray(refuelMoney1); JSONArray objects1 = JSONArray.parseArray(refuelMoney1);

View File

@ -994,6 +994,12 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
} }
// 新增会员余额信息 // 新增会员余额信息
userBalanceService.insertUserBalance(userBalanceAdd); 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()); MtInvitation mtInvitation1 = mtInvitationMapper.queryByStoreId(Integer.parseInt(storeId), mtUser.getId());

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 测试支付接口 // 测试支付接口
export function giftCardExchange(query) { export function giftCardExchange(query) {
return request({ return request({
url: '/business/marketingActivity/cardGift/exchange', url: '/business/marketingActivity/cardGift/exchange?number=' + query.number + "&cardPassword=" + query.cardPassword + "&userId=" + query.userId,
method: 'get', method: 'get',
data:query data:query
}) })

View File

@ -797,7 +797,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard"> <el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard">
<el-form ref="form" :model="form3" :rules="rules2" label-width="120px"> <el-form ref="form3" :model="form3" :rules="rules2" label-width="120px">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="卡号" prop="number" style="width: 500px"> <el-form-item label="卡号" prop="number" style="width: 500px">
@ -1763,15 +1763,17 @@
}, },
// //
async userRecharge() { async userRecharge() {
// if (this.isSure){ if (this.isSure){
if (this.member){ // if (this.member){
this.$message.error("请先选择会员") this.$message.error("请先选择会员")
return; return;
} }
await getUserGrade(this.member.gradeId).then(res => { if (this.member && this.member.gradeId){
this.grade = res.data await getUserGrade(this.member.gradeId).then(res => {
}) this.grade = res.data
})
}
await this.getCardFuelDieselList() await this.getCardFuelDieselList()
await this.getCardValueList() await this.getCardValueList()
@ -2079,16 +2081,19 @@
} }
}, },
confirm1(){ confirm1(){
this.$refs["form"].validate(valid => { this.$refs["form3"].validate(valid => {
if (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) { if (res.data.id == '' || res.data.id == null) {
this.$message.error('兑换失败!'); this.$message.error('兑换失败!');
} else { } else {
this.$message.success('兑换成功!'); this.$message.success('兑换成功!');
this.openRecharge = false this.openRecharge = false
this.form2.number = '' this.form3.number = ''
this.form2.cardPassword = '' this.form3.cardPassword = ''
this.getMemberAfter();
} }
}) })
} }
@ -3860,7 +3865,6 @@
}, },
// //
async collection(){ async collection(){
this.loading = true;
if (this.payType=="CASH"){ if (this.payType=="CASH"){
if (this.authCode<((+this.oilActualPay) + (+this.goodsActualPay)) || this.seekZero<0){ if (this.authCode<((+this.oilActualPay) + (+this.goodsActualPay)) || this.seekZero<0){
this.$modal.msgError("请输入正确的金额"); this.$modal.msgError("请输入正确的金额");
@ -3875,6 +3879,7 @@
this.$modal.msgError("请先扫码"); this.$modal.msgError("请先扫码");
return; return;
} }
this.loading = true;
// JSON.parse() // JSON.parse()
this.map.seekZero = this.seekZero; this.map.seekZero = this.seekZero;
this.map.oilAmount = this.oilAmount; this.map.oilAmount = this.oilAmount;

View File

@ -367,7 +367,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard"> <el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard">
<el-form ref="form" :model="form2" :rules="rules1" label-width="120px"> <el-form ref="form2" :model="form2" :rules="rules1" label-width="120px">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="卡号" prop="number" style="width: 500px"> <el-form-item label="卡号" prop="number" style="width: 500px">
@ -1368,8 +1368,9 @@ export default {
} }
}, },
confirm1(){ confirm1(){
this.$refs["form"].validate(valid => { this.$refs["form2"].validate(valid => {
if (valid) { if (valid) {
this.form2.userId = this.id;
giftCardExchange(this.form2).then(res => { giftCardExchange(this.form2).then(res => {
if (res.data.id == '' || res.data.id == null) { if (res.data.id == '' || res.data.id == null) {
this.$message.error('兑换失败!'); this.$message.error('兑换失败!');
@ -1378,6 +1379,7 @@ export default {
this.openRecharge = false this.openRecharge = false
this.form2.number = '' this.form2.number = ''
this.form2.cardPassword = '' this.form2.cardPassword = ''
this.getUserInfo();
} }
}) })
} }

View File

@ -487,7 +487,8 @@
if (uni.getStorageSync("inviteStaffId") || this.staffList.length==0) { if (uni.getStorageSync("inviteStaffId") || this.staffList.length==0) {
this.toPayment(uni.getStorageSync("inviteStaffId")) this.toPayment(uni.getStorageSync("inviteStaffId"))
} else { } else {
this.$refs.popup.open('bottom') // this.$refs.popup.open('bottom')
this.toPayment(uni.getStorageSync("inviteStaffId"))
} }
} else { } else {
if (this.value == "") { if (this.value == "") {
@ -547,17 +548,19 @@
// if (!this.AppToken) { // if (!this.AppToken) {
// return; // return;
// } // }
await request({ if (this.AppToken) {
url: 'chainStoreInfo/theJudgmentIsTheSame', await request({
method: 'get', url: 'chainStoreInfo/theJudgmentIsTheSame',
data: { method: 'get',
"chainStoreId": uni.getStorageSync("chainStoreId") data: {
} "chainStoreId": uni.getStorageSync("chainStoreId")
}).then(res => { }
if (!res.data) { }).then(res => {
uni.removeStorageSync("App-Token"); if (!res.data) {
} uni.removeStorageSync("App-Token");
}) }
})
}
if (uni.getStorageSync("appltType")== "WECHAT") { if (uni.getStorageSync("appltType")== "WECHAT") {
// code // code

View File

@ -596,8 +596,8 @@
// //
exchangeGift() { exchangeGift() {
request({ request({
url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" + url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" +
this.cardPassword, this.cardPassword + "&storeId=" + uni.getStorageSync("storeId"),
method: 'get', method: 'get',
}).then(res => { }).then(res => {
if (res.data.id == '' || res.data.id == null) { if (res.data.id == '' || res.data.id == null) {