优化项

This commit is contained in:
cun-nan 2024-01-10 13:45:02 +08:00
parent 8e2fc95aa9
commit eaa527e109
10 changed files with 111 additions and 53 deletions

View File

@ -24,6 +24,13 @@ export function getUserGrade(id) {
method: 'get' method: 'get'
}) })
} }
// 查询会员等级详细
export function getUserGradeInfo(id) {
return request({
url: '/business/userManager/userGrade/userGradeInfo/' + id,
method: 'get'
})
}
// 根据会员等级名称查询会员等级信息 // 根据会员等级名称查询会员等级信息
export function queryUserGrade(data) { export function queryUserGrade(data) {

View File

@ -174,7 +174,7 @@
<el-table-column label="会员号" align="center" prop="userNo" width="150"/> <el-table-column label="会员号" align="center" prop="userNo" width="150"/>
<el-table-column label="名称" align="center" prop="name" > <el-table-column label="名称" align="center" prop="name" >
<template slot-scope="scope"> <template slot-scope="scope">
<span style="color: #409EFF;cursor: pointer " @click="goDedi(scope.row.id)">{{ scope.row.name }}</span> <span style="color: #409EFF;cursor: pointer " @click="goDedi(scope.row.id)">{{ scope.row.name ? scope.row.name : "--" }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="手机号" align="center" prop="mobile" width="110"> <el-table-column label="手机号" align="center" prop="mobile" width="110">

View File

@ -17,7 +17,7 @@
<img v-if="form.avatar" :src="baseUrl+form.avatar" style="width: 80px;height: 80px;border-radius: 50%"> <img v-if="form.avatar" :src="baseUrl+form.avatar" style="width: 80px;height: 80px;border-radius: 50%">
<img v-else src="@/assets/images/avatar.png" style="width: 80px;height: 80px"> <img v-else src="@/assets/images/avatar.png" style="width: 80px;height: 80px">
</div> </div>
<el-button type="warning" plain round size="mini" style="margin: 10px" @click="bindIdCard">绑定实体卡</el-button><br> <!-- <el-button type="warning" plain round size="mini" style="margin: 10px" @click="bindIdCard">绑定实体卡</el-button><br>-->
<el-button type="primary" icon="el-icon-bank-card" round style="margin: 10px;width: 50%;height: 40px" @click="userRecharge">会员充值</el-button> <el-button type="primary" icon="el-icon-bank-card" round style="margin: 10px;width: 50%;height: 40px" @click="userRecharge">会员充值</el-button>
</div> </div>
<div class="right"> <div class="right">
@ -28,20 +28,20 @@
<el-descriptions-item label="会员昵称"> <el-descriptions-item label="会员昵称">
<span style="color: #00afff" @click="changeName">{{form.name ? form.name : "--"}}</span> <span style="color: #00afff" @click="changeName">{{form.name ? form.name : "--"}}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="实体卡号">{{form.idcard ? form.idcard : "--"}}</el-descriptions-item> <!-- <el-descriptions-item label="实体卡号">{{form.idcard ? form.idcard : "&#45;&#45;"}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="绑定信息">&#45;&#45;</el-descriptions-item>--> <!-- <el-descriptions-item label="绑定信息">&#45;&#45;</el-descriptions-item>-->
<el-descriptions-item label="会员状态"> <el-descriptions-item label="会员状态">
<dict-tag :options="dict.type.zhzt" :value="form.status"/> <dict-tag :options="dict.type.zhzt" :value="form.status"/>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="加油次数">{{form.consumeNum}}</el-descriptions-item> <el-descriptions-item label="加油次数">{{form.consumeNum}}</el-descriptions-item>
<el-descriptions-item label="加油总金额">{{form.refuelMoney ? form.refuelMoney : "--"}}</el-descriptions-item> <el-descriptions-item label="加油总金额">{{form.refuelMoney ? form.refuelMoney : "--"}}</el-descriptions-item>
<el-descriptions-item label="所属油站">{{ store.name }}</el-descriptions-item> <!-- <el-descriptions-item label="所属油站">{{ store.name }}</el-descriptions-item>-->
<el-descriptions-item label="注册时间">{{form.createTime}}</el-descriptions-item> <el-descriptions-item label="注册时间">{{form.createTime}}</el-descriptions-item>
<el-descriptions-item label="关联卡"> <el-descriptions-item label="关联卡">
<span style="color: #00afff" @click="secondCard">卡管理</span> <span style="color: #00afff" @click="subCard">卡管理</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="会员等级"> <el-descriptions-item label="会员等级">
{{ grade.name }} {{ grade ? grade.name : "--" }}
</el-descriptions-item> </el-descriptions-item>
<!-- <el-descriptions-item label="储值优惠">&#45;&#45;</el-descriptions-item>--> <!-- <el-descriptions-item label="储值优惠">&#45;&#45;</el-descriptions-item>-->
<!-- <el-descriptions-item label="每日笔数">--> <!-- <el-descriptions-item label="每日笔数">-->
@ -263,7 +263,10 @@
<div style="display: flex;margin: 20px 0"> <div style="display: flex;margin: 20px 0">
<div style="width: 7%">支付方式</div> <div style="width: 7%">支付方式</div>
<div> <div>
<el-radio v-for="dict in payList" v-model="cardValueForm.paymentType" :key="dict.dictValue" :label="dict.dictValue" :value="dict.dictValue" border >{{ dict.dictLabel }}</el-radio> <el-radio v-for="dict in payList" v-model="cardValueForm.paymentType" v-if="dict.dictValue!='APPLET_CODE'"
:key="dict.dictValue" :label="dict.dictValue" :value="dict.dictValue" border >
{{ dict.dictLabel }}
</el-radio>
</div> </div>
</div> </div>
</el-col> </el-col>
@ -681,7 +684,7 @@
<script> <script>
import {getUser, updateUser} from "@/api/staff/user/user"; import {getUser, updateUser} from "@/api/staff/user/user";
import {ljStoreInfo} from "@/api/staff/store"; import {ljStoreInfo} from "@/api/staff/store";
import {getUserGrade} from "@/api/staff/user/usergrade"; import {getUserGrade, getUserGradeInfo} from "@/api/staff/user/usergrade";
import {getList} from "@/api/EventMarketing/oilBlock"; import {getList} from "@/api/EventMarketing/oilBlock";
import {getCountOilTypeApi,getCardValueListApi,getPrepaidCardTopUpApi,getCheckTheStatusOfYourPaymentApi,getDicts,getPrepaidFuelTopUpApi,getCheckTheStatusOfYourPaymentByFuelApi} from "@/api/EventMarketing/cardSet"; import {getCountOilTypeApi,getCardValueListApi,getPrepaidCardTopUpApi,getCheckTheStatusOfYourPaymentApi,getDicts,getPrepaidFuelTopUpApi,getCheckTheStatusOfYourPaymentByFuelApi} from "@/api/EventMarketing/cardSet";
import {getSysConfig} from "@/api/staff/user/sysconfig"; import {getSysConfig} from "@/api/staff/user/sysconfig";
@ -733,7 +736,7 @@ export default {
points:'', // points:'', //
growthValue:'', // growthValue:'', //
remark:'', remark:'',
paymentType:'', // paymentType:'WECHAT', //
royaltyType: '',// royaltyType: '',//
percentageCommissions:null, percentageCommissions:null,
amountCommission:null, amountCommission:null,
@ -750,7 +753,7 @@ export default {
points:'', points:'',
remark:'', remark:'',
rechargeBalance:'', // rechargeBalance:'', //
paymentType:'', paymentType:'WECHAT',
oilType:'', oilType:'',
type:'', type:'',
chainStorId:'', chainStorId:'',
@ -854,6 +857,7 @@ export default {
this.getUserInfo(); this.getUserInfo();
this.getInformation(); this.getInformation();
this.getFixingLevelList(); this.getFixingLevelList();
this.getStore();
}, },
methods: { methods: {
fixingLevelinfo(list,id){ fixingLevelinfo(list,id){
@ -1145,18 +1149,19 @@ export default {
console.log(response.data) console.log(response.data)
this.getGrade(response.data.gradeId); this.getGrade(response.data.gradeId);
}); });
},
//
getGrade(id){
getUserGradeInfo(id).then(response => {
this.grade = response.data;
});
},
getStore(){
// //
ljStoreInfo().then(response => { ljStoreInfo().then(response => {
this.store = response.data; this.store = response.data;
}); });
}, },
//
getGrade(id){
getUserGrade(id).then(response => {
this.grade = response.data;
});
},
// //
rechargeCard(index,item){ rechargeCard(index,item){
console.log("index",index) console.log("index",index)
@ -1401,6 +1406,7 @@ export default {
if (valid) { if (valid) {
if (this.form.id) { if (this.form.id) {
updateUser(this.form).then(response => { updateUser(this.form).then(response => {
if (response.data==1){
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.openMobile = false; this.openMobile = false;
this.openName = false; this.openName = false;
@ -1408,6 +1414,10 @@ export default {
this.openLevel = false; this.openLevel = false;
this.openBindIdCard = false; this.openBindIdCard = false;
this.getUserInfo(); this.getUserInfo();
}else {
this.$modal.msgError("修改失败");
}
}); });
} }
} }

View File

@ -4,6 +4,7 @@ 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.LJUserGrade; import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.util.StringUtils;
import com.fuint.framework.web.BaseController; import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -67,12 +68,26 @@ public class LJUserGradeController extends BaseController {
@GetMapping("/{id}") @GetMapping("/{id}")
public ResponseObject userGradeInfo(@PathVariable String id){ public ResponseObject userGradeInfo(@PathVariable String id){
LJUserGrade userGrade = null; LJUserGrade userGrade = null;
if (id!=null && !id.equals("null")){ if (StringUtils.isNotEmpty(id)){
userGrade = userGradeService.selectUserGradeById(Integer.parseInt(id)); userGrade = userGradeService.selectUserGradeById(Integer.parseInt(id));
} }
return getSuccessResult(userGrade); return getSuccessResult(userGrade);
} }
/**
* 根据id查询当前店铺会员等级信息
* @param id
* @return
*/
@GetMapping("/userGradeInfo/{id}")
public ResponseObject userGradeInfo1(@PathVariable String id){
LJUserGrade userGrade = null;
if (StringUtils.isNotEmpty(id)){
userGrade = userGradeService.selectUserGradeByIdAndStoreId(Integer.parseInt(id));
}
return getSuccessResult(userGrade);
}
/** /**
* 根据id查询会员等级信息 * 根据id查询会员等级信息
* @param map * @param map

View File

@ -46,11 +46,11 @@ public interface CertifiedMemberService extends IService<CertifiedMember> {
public void deleteCertifiedMemberByFixingLevelId(int fixingLevelId); public void deleteCertifiedMemberByFixingLevelId(int fixingLevelId);
/** /**
* 根据会员手机号查询认证会员信息 * 根据会员id和店铺id查询认证会员信息
* @param mobile * @param userId
* @return * @return
*/ */
public CertifiedMember selectCertifiedMemberByMobile(String mobile); public CertifiedMember selectCertifiedMemberByUserIdAndStoreId(Integer userId,Integer storeId);
/** /**
* 根据id删除认证会员信息 * 根据id删除认证会员信息

View File

@ -46,6 +46,13 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
*/ */
public LJUserGrade selectUserGradeById(int id); public LJUserGrade selectUserGradeById(int id);
/**
* 根据id和店铺id查询会员等级信息
* @param id
* @return
*/
public LJUserGrade selectUserGradeByIdAndStoreId(int id);
/** /**
* 根据id查询会员等级信息是否可使用 * 根据id查询会员等级信息是否可使用
* @param userId * @param userId

View File

@ -101,13 +101,14 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
/** /**
* 根据会员手机号查询认证会员信息 * 根据会员手机号查询认证会员信息
* @param mobile * @param userId
* @return * @return
*/ */
@Override @Override
public CertifiedMember selectCertifiedMemberByMobile(String mobile) { public CertifiedMember selectCertifiedMemberByUserIdAndStoreId(Integer userId,Integer storeId) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mobile",mobile); queryWrapper.eq("user_id",userId);
queryWrapper.eq("store_id",storeId);
CertifiedMember certifiedMember = baseMapper.selectOne(queryWrapper); CertifiedMember certifiedMember = baseMapper.selectOne(queryWrapper);
return certifiedMember; return certifiedMember;
} }
@ -130,6 +131,9 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
public int insertCertifiedMember(CertifiedMember certifiedMember) { public int insertCertifiedMember(CertifiedMember certifiedMember) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId(); Integer storeId = nowAccountInfo.getStoreId();
if (certifiedMember.getStoreId()!=null){
storeId = certifiedMember.getStoreId();
}
if (certifiedMember.getMobile()==null || certifiedMember.getMobile().equals("")){ if (certifiedMember.getMobile()==null || certifiedMember.getMobile().equals("")){
return 2; return 2;
} }

View File

@ -83,6 +83,15 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
return baseMapper.selectById(id); return baseMapper.selectById(id);
} }
@Override
public LJUserGrade selectUserGradeByIdAndStoreId(int id) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
queryWrapper.eq("id",id);
return baseMapper.selectOne(queryWrapper);
}
@Autowired @Autowired
private ILJStoreService storeService; private ILJStoreService storeService;
@Autowired @Autowired

View File

@ -13,10 +13,7 @@ import com.fuint.business.userManager.entity.*;
import com.fuint.business.userManager.mapper.CertifiedMemberMapper; import com.fuint.business.userManager.mapper.CertifiedMemberMapper;
import com.fuint.business.userManager.mapper.LJUserMapper; import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.mapper.MtInvitationMapper; import com.fuint.business.userManager.mapper.MtInvitationMapper;
import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.business.userManager.service.*;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.MtInvitationService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo; import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils; import com.fuint.common.util.StringUtils;
@ -34,7 +31,8 @@ import java.util.*;
@Service @Service
public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> implements LJUserService { public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> implements LJUserService {
@Autowired @Autowired
private CertifiedMemberMapper certifiedMemberMapper; @Lazy
private CertifiedMemberService certifiedMemberService;
@Autowired @Autowired
private UserBalanceService balanceService; private UserBalanceService balanceService;
@Autowired @Autowired
@ -343,8 +341,8 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
@Override @Override
public int updateUser(LJUserVo userVo) { public int updateUser(LJUserVo userVo) {
int row = 0; int row = 0;
LJUser user1 = this.selectUserByMobileAndUserId(userVo.getMobile(), userVo.getId()); LJUser user1 = this.selectUserByMobile(userVo.getMobile());
if (ObjectUtil.isNotEmpty(user1)){ if (ObjectUtil.isNotEmpty(user1) && user1.getId()!=userVo.getId()){
row = 0; row = 0;
return row; return row;
} }
@ -365,13 +363,25 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
user.setDescription(userVo.getDescription()); user.setDescription(userVo.getDescription());
user.setOfficial(userVo.getOfficial()); user.setOfficial(userVo.getOfficial());
row = baseMapper.updateById(user); row = baseMapper.updateById(user);
// 修改认证会员手机号 // 修改认证会员手机号
CertifiedMember certifiedMember = new CertifiedMember(); CertifiedMember certifiedMember = certifiedMemberService.selectCertifiedMemberByUserIdAndStoreId(userVo.getId(), userVo.getStoreId());
certifiedMember.setUserId(userVo.getId()); if (ObjectUtil.isNotEmpty(certifiedMember)){
certifiedMember.setMobile(userVo.getMobile()); certifiedMember.setMobile(userVo.getMobile());
QueryWrapper queryWrapper = new QueryWrapper<>(); certifiedMember.setFixingLevelId(Integer.valueOf(userVo.getFixingLevel()));
queryWrapper.eq("user_id",certifiedMember.getUserId()); certifiedMemberService.updateById(certifiedMember);
certifiedMemberMapper.update(certifiedMember,queryWrapper); }else{
if (StringUtils.isNotEmpty(userVo.getFixingLevel())){
CertifiedMember certifiedMember1 = new CertifiedMember();
certifiedMember1.setUserId(userVo.getId());
certifiedMember1.setStoreId(userVo.getStoreId());
certifiedMember1.setName(userVo.getName());
certifiedMember1.setMobile(userVo.getMobile());
certifiedMember1.setFixingLevelId(Integer.valueOf(userVo.getFixingLevel()));
certifiedMember1.setStatus("enable");
certifiedMemberService.insertCertifiedMember(certifiedMember1);
}
}
// 修改余额会员等级信息 // 修改余额会员等级信息
UserBalance balance = balanceService.selectUserBalanceByStorId(userVo.getId(),userVo.getStoreId()); UserBalance balance = balanceService.selectUserBalanceByStorId(userVo.getId(),userVo.getStoreId());

View File

@ -200,7 +200,7 @@
}, },
onLoad(e) { onLoad(e) {
this.orderNo = e.orderNo this.orderNo = e.orderNo
// this.orderNo = "234520240109161930c1f4e6" // this.orderNo = "23452024011011251833f48e"
}, },
onShow() { onShow() {
this.getOilOrder(); this.getOilOrder();
@ -336,8 +336,8 @@
this.balanceRedece = this.oilOrder.orderAmount this.balanceRedece = this.oilOrder.orderAmount
} else { } else {
this.balanceRedece = this.user.cardBalance this.balanceRedece = this.user.cardBalance
this.deductAmount = this.oilOrder.orderAmount - this.balanceRedece this.deductAmount = (this.oilOrder.orderAmount*100-this.balanceRedece*100)/100
this.payAmount = this.oilOrder.orderAmount - this.balanceRedece this.payAmount = (this.oilOrder.orderAmount*100-this.balanceRedece*100)/100
} }
}else{ }else{
// 使 // 使
@ -670,10 +670,6 @@
} }
}) })
}, },
// 使
chooseCardBalanceChild(){
},
// //
countPayMent(){ countPayMent(){
@ -688,7 +684,7 @@
method: 'post', method: 'post',
data:{storeId:_this.oilOrder.storeId,userId:id} data:{storeId:_this.oilOrder.storeId,userId:id}
}).then((res) => { }).then((res) => {
if (res.data.isUseChild){ if (res.data.isUseChild=='yes'){
_this.isUseChildCard = true _this.isUseChildCard = true
}else{ }else{
_this.isUseChildCard = false _this.isUseChildCard = false