This commit is contained in:
wangh 2024-01-08 10:07:57 +08:00
commit a3ed2f8b2d
14 changed files with 85 additions and 30 deletions

View File

@ -741,13 +741,11 @@ export default {
this.$modal.msgError("手机号已存在"); this.$modal.msgError("手机号已存在");
}else { }else {
addUser(this.form).then(res => { addUser(this.form).then(res => {
if (res.data == 1) {
this.$modal.msgSuccess("新增会员成功"); this.$modal.msgSuccess("新增会员成功");
this.open = false; this.open = false;
this.openUser = false; this.openUser = false;
this.getList(); this.getList();
this.getUserList(); this.getUserList();
}
}); });
} }
}) })

View File

@ -1,7 +1,14 @@
package com.fuint.business.userManager.entity; package com.fuint.business.userManager.entity;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
import com.fuint.repository.model.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fuint.framework.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
@ -11,9 +18,14 @@ import lombok.Data;
* @since 2023-11-28 16:04:50 * @since 2023-11-28 16:04:50
*/ */
@Data @Data
public class MtInvitation extends BaseEntity { @TableName("mt_invitation")
private static final long serialVersionUID = -81875140284347711L; @ApiModel(value = "MtInvitation对象", description = "邀请注册表")
public class MtInvitation extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("会员ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id; private Integer id;
/** /**
* 用户id * 用户id

View File

@ -1,5 +1,6 @@
package com.fuint.business.userManager.mapper; package com.fuint.business.userManager.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.userManager.entity.MtInvitation; import com.fuint.business.userManager.entity.MtInvitation;
@ -13,7 +14,7 @@ import java.util.List;
* @author wangh * @author wangh
* @since 2023-11-28 16:04:50 * @since 2023-11-28 16:04:50
*/ */
public interface MtInvitationMapper { public interface MtInvitationMapper extends BaseMapper<MtInvitation> {
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据

View File

@ -34,12 +34,6 @@ public interface LJUserService extends IService<LJUser> {
*/ */
LJUser queryUserByUserId(int userId); LJUser queryUserByUserId(int userId);
/**
*
* @return
*/
LJUser queryUserByUserId();
/** /**
* 查询所有会员信息 * 查询所有会员信息
* @return * @return

View File

@ -55,4 +55,9 @@ public interface MtInvitationService {
*/ */
boolean deleteById(Integer id); boolean deleteById(Integer id);
/**
* 根据会员id和店铺id删除用户邀请注册信息
* @param userId
*/
void deleteByUserIdAndeStoreId(Integer userId);
} }

View File

@ -3,6 +3,8 @@ package com.fuint.business.userManager.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.entity.UserBalance;
import java.util.List;
/** /**
* 会员储值卡信息 业务层 * 会员储值卡信息 业务层
*/ */
@ -16,7 +18,7 @@ public interface UserBalanceService extends IService<UserBalance> {
public int insertUserBalance(UserBalance balance); public int insertUserBalance(UserBalance balance);
/** /**
* 根据用户id删除会员储值信息 * 根据用户id和店铺id删除会员储值信息
* @param userId * @param userId
*/ */
public void deleteUserBalanceByUserId(Integer userId); public void deleteUserBalanceByUserId(Integer userId);
@ -33,7 +35,7 @@ public interface UserBalanceService extends IService<UserBalance> {
* @param userId * @param userId
* @return * @return
*/ */
public UserBalance selectUserBalance(int userId); public List<UserBalance> selectUserBalance(int userId);
/** /**
* 根据用户id和店铺id查询用户余额信息 * 根据用户id和店铺id查询用户余额信息

View File

@ -74,11 +74,6 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return baseMapper.selectById(userId); return baseMapper.selectById(userId);
} }
@Override
public LJUser queryUserByUserId() {
return null;
}
/** /**
* 查询所有会员信息 * 查询所有会员信息
* @return * @return
@ -201,14 +196,23 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return list; return list;
} }
@Autowired
private MtInvitationService invitationService;
/** /**
* 根据id删除会员信息 * 根据id删除会员信息
* @param id * @param id
*/ */
@Override @Override
public void deleteUserById(Integer id) { public void deleteUserById(Integer id) {
baseMapper.deleteById(id);
balanceService.deleteUserBalanceByUserId(id); balanceService.deleteUserBalanceByUserId(id);
List<UserBalance> userBalances = balanceService.selectUserBalance(id);
if (userBalances.size()==0){
baseMapper.deleteById(id);
}
invitationService.deleteByUserIdAndeStoreId(id);
} }
@Autowired @Autowired

View File

@ -1,5 +1,6 @@
package com.fuint.business.userManager.service.impl; package com.fuint.business.userManager.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.userManager.entity.MtInvitation; import com.fuint.business.userManager.entity.MtInvitation;
@ -86,4 +87,13 @@ public class MtInvitationServiceImpl implements MtInvitationService {
public boolean deleteById(Integer id) { public boolean deleteById(Integer id) {
return this.mtInvitationMapper.deleteById(id) > 0; return this.mtInvitationMapper.deleteById(id) > 0;
} }
@Override
public void deleteByUserIdAndeStoreId(Integer userId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("userId",userId);
queryWrapper.eq("storeId",nowAccountInfo.getStoreId());
mtInvitationMapper.delete(queryWrapper);
}
} }

View File

@ -3,6 +3,8 @@ package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.LJUserGrade; import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.UserBalanceMapper; import com.fuint.business.userManager.mapper.UserBalanceMapper;
@ -10,9 +12,11 @@ import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* 会员储值卡信息 业务层 * 会员储值卡信息 业务层
@ -23,6 +27,8 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
@Resource @Resource
LJUserGradeService ljUserGradeService; LJUserGradeService ljUserGradeService;
@Autowired
private ILJStoreService storeService;
@Override @Override
public int insertUserBalance(UserBalance balance) { public int insertUserBalance(UserBalance balance) {
@ -32,8 +38,11 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
@Override @Override
public void deleteUserBalanceByUserId(Integer userId) { public void deleteUserBalanceByUserId(Integer userId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mt_user_id",userId); queryWrapper.eq("mt_user_id",userId);
queryWrapper.eq("chain_store_id",store.getChainStoreId());
baseMapper.delete(queryWrapper); baseMapper.delete(queryWrapper);
} }
@ -44,11 +53,10 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
} }
@Override @Override
public UserBalance selectUserBalance(int userId) { public List<UserBalance> selectUserBalance(int userId) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mt_user_id",userId); queryWrapper.eq("mt_user_id",userId);
UserBalance balance = baseMapper.selectOne(queryWrapper); return baseMapper.selectList(queryWrapper);
return balance;
} }
@Override @Override

View File

@ -98,8 +98,11 @@ public class SysDeptController extends BaseController
userGrade.setGrowthValue(1); userGrade.setGrowthValue(1);
userGrade.setPreferential("自定义优惠"); userGrade.setPreferential("自定义优惠");
userGrade.setGasolineDiscount("无优惠"); userGrade.setGasolineDiscount("无优惠");
userGrade.setGasolineRule("[{\"gasolineRule1\":1,\"gasolineRule2\":1,\"gasolineRule3\":1}]");
userGrade.setDieselDiscount("无优惠"); userGrade.setDieselDiscount("无优惠");
userGrade.setDieselRule("[{\"dieselRule1\":1,\"dieselRule2\":1,\"dieselRule3\":1}]");
userGrade.setNaturalGasDiscount("无优惠"); userGrade.setNaturalGasDiscount("无优惠");
userGrade.setNaturalGasRule("[{\"naturalGas1\":1,\"naturalGas2\":1,\"naturalGas3\":1}]");
userGradeService.insertUserGrade(userGrade,store.getId()); userGradeService.insertUserGrade(userGrade,store.getId());
} }
return getSuccessResult(row); return getSuccessResult(row);

View File

@ -188,6 +188,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
public SysDept selectSysDeptByName(String deptName) { public SysDept selectSysDeptByName(String deptName) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("dept_name",deptName); queryWrapper.eq("dept_name",deptName);
queryWrapper.eq("if_delete","0");
return baseMapper.selectOne(queryWrapper); return baseMapper.selectOne(queryWrapper);
} }

View File

@ -283,14 +283,14 @@
if (this.staffId == '') { if (this.staffId == '') {
uni.showToast({ uni.showToast({
title: "员工为必填项", title: "员工为必填项",
icon: Error icon: "error"
}) })
return return
} }
if (this.carValueId == '') { if (this.carValueId == '') {
uni.showToast({ uni.showToast({
title: "储值卡为必填项", title: "储值卡为必填项",
icon: Error icon: "error"
}) })
return return
} }

View File

@ -15,7 +15,10 @@
<view class="b-top"> <view class="b-top">
<view style="width: 70%;"> <view style="width: 70%;">
<view class="title-size">{{item.name}}</view> <view class="title-size">
{{item.name}}
<span v-if="member.gradeId==item.id">(当前等级)</span>
</view>
<view class="min-size" style="margin-bottom: 20px;">升级会员享更多特权</view> <view class="min-size" style="margin-bottom: 20px;">升级会员享更多特权</view>
<!-- <view class="min-size" style="margin-bottom: 10px;" v-if="userBalance.gradeId == item.id && index < (userGradeList.length-1)"> <!-- <view class="min-size" style="margin-bottom: 10px;" v-if="userBalance.gradeId == item.id && index < (userGradeList.length-1)">
在获得{{item.growthValue - userBalance.growthValue}}可升级至{{userGradeList[index+1].name}} 在获得{{item.growthValue - userBalance.growthValue}}可升级至{{userGradeList[index+1].name}}
@ -182,7 +185,7 @@
swiperDotIndex: 0, swiperDotIndex: 0,
// //
userGradeList:[], userGradeList:[],
storeId:"", storeId:uni.getStorageSync("storeId"),
userId:"", userId:"",
userBalance:{}, userBalance:{},
userGrade:{}, userGrade:{},
@ -196,6 +199,8 @@
chainStoreConfig: {}, chainStoreConfig: {},
// //
isExist:false, isExist:false,
//
member:{},
} }
}, },
onLoad() { onLoad() {
@ -203,8 +208,18 @@
this.getList(this.storeId) this.getList(this.storeId)
this.getChainConfig(this.storeId) this.getChainConfig(this.storeId)
this.getUserBalance() this.getUserBalance()
this.getMember()
}, },
methods: { methods: {
//
getMember(){
request({
url: "business/userManager/user/storeUser/" + this.storeId,
method: 'get',
}).then((res) => {
this.member = res.data
})
},
getChainConfig(storeId){ getChainConfig(storeId){
let _this = this; let _this = this;
request({ request({

View File

@ -28,6 +28,7 @@
data() { data() {
return { return {
timestamp:3, timestamp:3,
timer:{},
} }
}, },
onLoad() { onLoad() {
@ -37,18 +38,19 @@
// //
countdown(){ countdown(){
let _this = this let _this = this
let timer = setInterval(() => { this.timer = setInterval(() => {
// countdown1 // countdown1
_this.timestamp--; _this.timestamp--;
// 0 // 0
if(_this.timestamp === 0) { if(_this.timestamp === 0) {
_this.goBack() _this.goBack()
clearInterval(timer) clearInterval(this.timer)
_this.timestamp = 3 _this.timestamp = 3
} }
}, 1000); }, 1000);
}, },
goBack() { goBack() {
clearInterval(this.timer)
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
}) })