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("手机号已存在");
}else {
addUser(this.form).then(res => {
if (res.data == 1) {
this.$modal.msgSuccess("新增会员成功");
this.open = false;
this.openUser = false;
this.getList();
this.getUserList();
}
});
}
})

View File

@ -1,7 +1,14 @@
package com.fuint.business.userManager.entity;
import java.io.Serializable;
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;
/**
@ -11,9 +18,14 @@ import lombok.Data;
* @since 2023-11-28 16:04:50
*/
@Data
public class MtInvitation extends BaseEntity {
private static final long serialVersionUID = -81875140284347711L;
@TableName("mt_invitation")
@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;
/**
* 用户id

View File

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

View File

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

View File

@ -55,4 +55,9 @@ public interface MtInvitationService {
*/
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.fuint.business.userManager.entity.UserBalance;
import java.util.List;
/**
* 会员储值卡信息 业务层
*/
@ -16,7 +18,7 @@ public interface UserBalanceService extends IService<UserBalance> {
public int insertUserBalance(UserBalance balance);
/**
* 根据用户id删除会员储值信息
* 根据用户id和店铺id删除会员储值信息
* @param userId
*/
public void deleteUserBalanceByUserId(Integer userId);
@ -33,7 +35,7 @@ public interface UserBalanceService extends IService<UserBalance> {
* @param userId
* @return
*/
public UserBalance selectUserBalance(int userId);
public List<UserBalance> selectUserBalance(int userId);
/**
* 根据用户id和店铺id查询用户余额信息

View File

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

View File

@ -1,5 +1,6 @@
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.extension.plugins.pagination.Page;
import com.fuint.business.userManager.entity.MtInvitation;
@ -86,4 +87,13 @@ public class MtInvitationServiceImpl implements MtInvitationService {
public boolean deleteById(Integer id) {
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 com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.UserBalance;
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.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 会员储值卡信息 业务层
@ -23,6 +27,8 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
@Resource
LJUserGradeService ljUserGradeService;
@Autowired
private ILJStoreService storeService;
@Override
public int insertUserBalance(UserBalance balance) {
@ -32,8 +38,11 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
@Override
public void deleteUserBalanceByUserId(Integer userId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mt_user_id",userId);
queryWrapper.eq("chain_store_id",store.getChainStoreId());
baseMapper.delete(queryWrapper);
}
@ -44,11 +53,10 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
}
@Override
public UserBalance selectUserBalance(int userId) {
public List<UserBalance> selectUserBalance(int userId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mt_user_id",userId);
UserBalance balance = baseMapper.selectOne(queryWrapper);
return balance;
return baseMapper.selectList(queryWrapper);
}
@Override

View File

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

View File

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

View File

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

View File

@ -15,7 +15,10 @@
<view class="b-top">
<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: 10px;" v-if="userBalance.gradeId == item.id && index < (userGradeList.length-1)">
在获得{{item.growthValue - userBalance.growthValue}}可升级至{{userGradeList[index+1].name}}
@ -182,7 +185,7 @@
swiperDotIndex: 0,
//
userGradeList:[],
storeId:"",
storeId:uni.getStorageSync("storeId"),
userId:"",
userBalance:{},
userGrade:{},
@ -196,6 +199,8 @@
chainStoreConfig: {},
//
isExist:false,
//
member:{},
}
},
onLoad() {
@ -203,8 +208,18 @@
this.getList(this.storeId)
this.getChainConfig(this.storeId)
this.getUserBalance()
this.getMember()
},
methods: {
//
getMember(){
request({
url: "business/userManager/user/storeUser/" + this.storeId,
method: 'get',
}).then((res) => {
this.member = res.data
})
},
getChainConfig(storeId){
let _this = this;
request({

View File

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