会员信息
This commit is contained in:
parent
069e51d3cf
commit
491c8bf426
@ -9,6 +9,14 @@ export function listUserGrade(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询所有会员等级列表
|
||||
export function allUserGrade() {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/allUserGrade',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员等级详细
|
||||
export function getUserGrade(id) {
|
||||
return request({
|
||||
|
@ -184,7 +184,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="会员等级" align="center" prop="gradeId" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.gradeId ? getName(userGradeList, scope.row.gradeId) : '-' }}</span>
|
||||
<span>{{ scope.row.gradeId ? getName(allUserGrade, scope.row.gradeId) : '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="储值卡" align="center" prop="cardBalance">
|
||||
@ -199,7 +199,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="加油次数" align="center" prop="consumeNum">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.row.consumeNum }}</div>
|
||||
<div>{{ scope.row.consumeNum ? scope.row.consumeNum : '0' }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="注册时间" align="center" width="160" prop="createTime">
|
||||
@ -309,6 +309,7 @@
|
||||
<el-select
|
||||
v-model="form.gradeId"
|
||||
placeholder="会员等级"
|
||||
:disabled="form.gradeId==''"
|
||||
style="width: 300px"
|
||||
>
|
||||
<el-option v-for="grade in userGradeList" :key="grade.id+''" :label="grade.name" :value="grade.id+''"/>
|
||||
@ -371,7 +372,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="会员状态">
|
||||
<el-form-item label="会员状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio label="qy" value="qy">启用</el-radio>
|
||||
<el-radio label="jy" value="jy">禁用</el-radio>
|
||||
@ -453,7 +454,7 @@ import {
|
||||
listUser, listUserStatistic,
|
||||
updateUser
|
||||
} from "@/api/staff/user/user";
|
||||
import {listUserGrade} from "@/api/staff/user/usergrade";
|
||||
import {allUserGrade, listUserGrade} from "@/api/staff/user/usergrade";
|
||||
import {ljStoreList} from "@/api/staff/store";
|
||||
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
||||
import { getToken } from "@/utils/auth";
|
||||
@ -505,8 +506,10 @@ export default {
|
||||
list: [],
|
||||
// 会员表格数据
|
||||
userList: [],
|
||||
// 会员等级列表
|
||||
// 当前店铺会员等级列表
|
||||
userGradeList: [],
|
||||
// 所有等级信息
|
||||
allUserGrade:[],
|
||||
// 店铺列表
|
||||
storeList: [],
|
||||
storeIds: [],
|
||||
@ -549,7 +552,8 @@ export default {
|
||||
{ required: true, message: "会员名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
|
||||
],
|
||||
gradeId: [{ required: true, message: "会员等级", trigger: "blur" }],
|
||||
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }],
|
||||
status: [{ required: true, message: "请选择会员状态", trigger: "blur" }],
|
||||
mobile: [
|
||||
{ required: true, message: "请输入手机号", trigger: "blur" },
|
||||
],
|
||||
@ -596,11 +600,12 @@ export default {
|
||||
this.yesterdayAddNum = response.data.yesterdayAddNum;
|
||||
this.balance = response.data.balance;
|
||||
this.point = response.data.point;
|
||||
// this.literCard = response.data.literCard;
|
||||
// this.refuelMoney = response.data.refuelMoney;
|
||||
});
|
||||
listUserGrade().then( response => {
|
||||
this.userGradeList = response.data.records
|
||||
allUserGrade().then( response => {
|
||||
this.allUserGrade = response.data
|
||||
});
|
||||
listUserGrade({page:1,pageSize:20}).then( response => {
|
||||
this.userGradeList = response.data.records;
|
||||
});
|
||||
ljStoreList().then( response => {
|
||||
this.storeList = response.data
|
||||
@ -749,6 +754,7 @@ export default {
|
||||
const id = row.id || this.ids;
|
||||
getUser(id).then(response => {
|
||||
this.form = response.data;
|
||||
console.log(this.form)
|
||||
this.open = true;
|
||||
this.title = "编辑会员";
|
||||
});
|
||||
|
@ -1069,8 +1069,6 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log("data",data)
|
||||
console.log("this.cardValueForm",this.cardValueForm)
|
||||
},
|
||||
// 存油卡查询
|
||||
async getCardFuelDieselList() {
|
||||
@ -1131,7 +1129,7 @@ export default {
|
||||
},
|
||||
// 根据油品过滤查询存油卡
|
||||
async tabOilTypeClick(data){
|
||||
console.log("aaaaaaaaaaaaaa",data)
|
||||
// console.log("aaaaaaaaaaaaaa",data)
|
||||
await this.getCardFuelDieselList()
|
||||
|
||||
this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => {
|
||||
@ -1188,7 +1186,7 @@ export default {
|
||||
this.openConfirm = true;
|
||||
this.isPay = true
|
||||
|
||||
console.log("11111",this.isPay)
|
||||
// console.log("11111",this.isPay)
|
||||
// this.isPaySuccess=false
|
||||
|
||||
this.title = this.payment
|
||||
@ -1199,7 +1197,7 @@ export default {
|
||||
if (falg === 1) {
|
||||
|
||||
}
|
||||
console.log("payType",payType)
|
||||
// console.log("payType",payType)
|
||||
this.cardValueForm.paymentType = payType
|
||||
},
|
||||
// 获取副卡信息
|
||||
@ -1220,6 +1218,7 @@ export default {
|
||||
// 获取会员详情
|
||||
getUser(this.id).then(response => {
|
||||
this.form = response.data;
|
||||
console.log(response.data)
|
||||
this.getGrade(response.data.gradeId);
|
||||
});
|
||||
// 获取店铺详情
|
||||
@ -1236,7 +1235,7 @@ export default {
|
||||
|
||||
// 选择余额充值金额
|
||||
rechargeCard(index,item){
|
||||
console.log("index",index)
|
||||
// console.log("index",index)
|
||||
this.cardValueForm.amount = null,
|
||||
this.cardValueForm.rechargeType = 0
|
||||
|
||||
@ -1268,7 +1267,7 @@ export default {
|
||||
this.cardValueForm.percentageCommissions = file.percentageCommissions
|
||||
this.cardValueForm.amountCommission = file.amountCommission
|
||||
|
||||
console.log("file.royaltyType ", file.royaltyType )
|
||||
// console.log("file.royaltyType ", file.royaltyType )
|
||||
|
||||
// 计算员工提成金额
|
||||
if (file.royaltyType === "3") {
|
||||
@ -1363,7 +1362,7 @@ export default {
|
||||
|
||||
},30000)
|
||||
}else if (this.flag === 2){
|
||||
console.log("cardFuelDieselForm",this.cardFuelDieselForm)
|
||||
// console.log("cardFuelDieselForm",this.cardFuelDieselForm)
|
||||
this.cardFuelDieselForm.mtUserId = userForm.id
|
||||
this.cardFuelDieselForm.name = userForm.name
|
||||
this.cardFuelDieselForm.mobile = userForm.mobile
|
||||
@ -1422,9 +1421,9 @@ export default {
|
||||
},
|
||||
|
||||
getPayList(){
|
||||
console.log("payment_type1")
|
||||
// console.log("payment_type1")
|
||||
getDicts("payment_type").then( response => {
|
||||
console.log("payment_type2",response.data)
|
||||
// console.log("payment_type2",response.data)
|
||||
this.payList = response.data;
|
||||
})
|
||||
},
|
||||
|
@ -678,12 +678,6 @@ export default {
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
})
|
||||
// getUserGradeList(this.queryParams).then( response => {
|
||||
// this.list = response.data.paginationResponse.content;
|
||||
// this.total = response.data.paginationResponse.totalElements;
|
||||
// this.catchTypeList = response.data.catchTypeList
|
||||
// }
|
||||
// );
|
||||
},
|
||||
// 搜索按钮操作
|
||||
handleQuery() {
|
||||
@ -730,7 +724,6 @@ export default {
|
||||
this.form = {
|
||||
id: '', grade: 0, name: '',gasoline:1,dieselOil:1,naturalGas:1,preferential:'自定义优惠',
|
||||
gasolineDiscount:'无优惠',dieselDiscount:'无优惠',naturalGasDiscount:'无优惠',promotionGroup:'',
|
||||
// catchCondition: '', userPrivilege: '', catchType: '', catchValue: '', validDay: '',discount: '', speedPoint: '',
|
||||
status: 'qy'
|
||||
};
|
||||
this.gasolinePreferential=[
|
||||
@ -784,8 +777,10 @@ export default {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}else {
|
||||
}else if (res.data==0){
|
||||
this.$modal.msgError("新增失败,最多支持20个等级");
|
||||
}else {
|
||||
this.$modal.msgError("新增失败,已存在当前等级的会员等级信息");
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -807,12 +802,6 @@ export default {
|
||||
this.open = true;
|
||||
this.title = "编辑会员等级";
|
||||
});
|
||||
|
||||
// getUserGradeInfo(id).then(response => {
|
||||
// this.form = response.data.userGradeInfo;
|
||||
// this.open = true;
|
||||
// this.title = "编辑会员等级";
|
||||
// });
|
||||
},
|
||||
// 删除按钮操作
|
||||
handleDelete(row) {
|
||||
|
@ -121,4 +121,14 @@ public class LJStaffController extends BaseController {
|
||||
public ResponseObject auditPrem(String auditPrem) {
|
||||
return getSuccessResult(mtStaffService.auditPrem(auditPrem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据店铺id查询员工信息
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryStaffList/{storeId}")
|
||||
public ResponseObject queryStaffList(@PathVariable Integer storeId){
|
||||
return getSuccessResult(mtStaffService.queryStaffs(storeId));
|
||||
}
|
||||
}
|
||||
|
@ -70,4 +70,11 @@ public interface ILJStaffService extends IService<LJStaff> {
|
||||
public void entryptPassword(LJStaff staff);
|
||||
|
||||
public int auditPrem(String auditPrem);
|
||||
|
||||
/**
|
||||
* 根据店铺id查询员工信息
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
public List<LJStaff> queryStaffs(int storeId);
|
||||
}
|
||||
|
@ -76,10 +76,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
*/
|
||||
@Override
|
||||
public LJStaff selectStaffByMobile(String mobile) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("mobile",mobile);
|
||||
LJStaff staff = baseMapper.selectOne(queryWrapper);
|
||||
return staff;
|
||||
@ -168,4 +165,12 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
int row = baseMapper.auditPrem(nowAccountInfo.getStaffId(),auditPrem);
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LJStaff> queryStaffs(int storeId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
List<LJStaff> list = baseMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
@ -387,8 +387,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
Integer gasGrowthValue = null;
|
||||
Integer dieselGrowthValue = null;
|
||||
Integer naturalGrowthValue = null;
|
||||
// 根据id查询会员信息 获取会员当前成长值数据
|
||||
LJUser user = userService.selectUserById(userid);
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userid);
|
||||
int growth = balance.getGrowthValue();
|
||||
balance.setRefuelMoney(refuelMoney);
|
||||
@ -404,10 +402,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
// 如果会员成长值达到会员等级成长值,则修改会员的会员等级信息
|
||||
for (int i = 0; i < records.size(); i++){
|
||||
if ((growthAfter-records.get(i).getGrowthValue())<100){
|
||||
user.setGradeId(records.get(i).getId());
|
||||
balance.setGradeId(records.get(i).getId());
|
||||
}
|
||||
if (growthAfter>records.get(records.size()-1).getGrowthValue()){
|
||||
user.setGradeId(records.get(records.size()-1).getId());
|
||||
balance.setGradeId(records.get(records.size()-1).getId());
|
||||
}
|
||||
}
|
||||
balance.setGrowthValue(growthAfter);
|
||||
@ -419,10 +417,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
System.out.println(records.size());
|
||||
for (int i = 0; i < records.size(); i++){
|
||||
if ((growthAfter-records.get(i).getGrowthValue())<100 && (growthAfter-records.get(i).getGrowthValue())>0){
|
||||
user.setGradeId(records.get(i).getId());
|
||||
balance.setGradeId(records.get(i).getId());
|
||||
}
|
||||
if (growthAfter > records.get(records.size()-1).getGrowthValue()){
|
||||
user.setGradeId(records.get(records.size()-1).getId());
|
||||
balance.setGradeId(records.get(records.size()-1).getId());
|
||||
}
|
||||
}
|
||||
balance.setGrowthValue(growthAfter);
|
||||
@ -433,16 +431,14 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
// 如果会员成长值达到会员等级成长值,则修改会员的会员等级信息
|
||||
for (int i = 0; i < records.size(); i++){
|
||||
if ((growthAfter-records.get(i).getGrowthValue())<100){
|
||||
user.setGradeId(records.get(i).getId());
|
||||
balance.setGradeId(records.get(i).getId());
|
||||
}
|
||||
if (growthAfter>records.get(records.size()-1).getGrowthValue()){
|
||||
user.setGradeId(records.get(records.size()-1).getId());
|
||||
balance.setGradeId(records.get(records.size()-1).getId());
|
||||
}
|
||||
}
|
||||
balance.setGrowthValue(growthAfter);
|
||||
}
|
||||
// 修改用户会员等级
|
||||
userService.updateUser(user);
|
||||
// 修改用户成长值
|
||||
userBalanceService.updateUserBalance(balance);
|
||||
}
|
||||
|
@ -60,11 +60,12 @@ public class LJStoreController extends BaseController {
|
||||
|
||||
/**
|
||||
* 根据id查询店铺信息
|
||||
* @param storeId
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{storeId}")
|
||||
public ResponseObject queryStore(@PathVariable Integer storeId){
|
||||
@PostMapping("/queryStoreById")
|
||||
public ResponseObject queryStore(@Validated @RequestBody Map<String,String> map){
|
||||
Integer storeId = Integer.valueOf(map.get("storeId"));
|
||||
return getSuccessResult(storeService.selectStoreByStoreId(storeId));
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
|
||||
double min = earthRadius * c;
|
||||
ljStore = list.get(0);
|
||||
|
||||
// 计算最小距离
|
||||
for (int i = 0; i < list.size(); i++){
|
||||
@ -85,7 +86,32 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> queryStoreByPosition(Map<String, String> map) {
|
||||
return null;
|
||||
// 经度
|
||||
Double lon = Double.valueOf(map.get("lon"));
|
||||
Double lat = Double.valueOf(map.get("lat"));
|
||||
List<LJStore> list = baseMapper.selectList(null);
|
||||
|
||||
List<Map<String, Object>> list1 = new ArrayList<>();
|
||||
|
||||
double earthRadius = 6371; // 地球半径,单位为公里
|
||||
for (LJStore store : list) {
|
||||
Map<String,Object> map1 = new HashMap<>();
|
||||
if (StringUtils.isNotEmpty(store.getLatitude()) && StringUtils.isNotEmpty(store.getLongitude())){
|
||||
double dLat1 = Math.toRadians(Double.parseDouble(store.getLatitude()) - lat);
|
||||
double dLon1 = Math.toRadians(Double.parseDouble(store.getLongitude()) - lon);
|
||||
|
||||
double a1 = Math.sin(dLat1 / 2) * Math.sin(dLat1 / 2) +
|
||||
Math.cos(Math.toRadians(lat)) * Math.cos(Math.toRadians(Double.parseDouble(store.getLatitude()))) *
|
||||
Math.sin(dLon1 / 2) * Math.sin(dLon1 / 2);
|
||||
|
||||
double c1 = 2 * Math.atan2(Math.sqrt(a1), Math.sqrt(1 - a1));
|
||||
|
||||
map1.put("distance",earthRadius * c1);
|
||||
map1.put("store",store);
|
||||
list1.add(map1);
|
||||
}
|
||||
}
|
||||
return list1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,7 +69,7 @@ public class LJUserController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseObject userInfo(@PathVariable Integer id){
|
||||
LJUser user = userService.selectUserById(id);
|
||||
LJUserVo user = userService.selectUserById(id);
|
||||
return getSuccessResult(user);
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ public class LJUserController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject edit(@Validated @RequestBody LJUser user){
|
||||
public ResponseObject edit(@Validated @RequestBody LJUserVo user){
|
||||
return getSuccessResult(userService.updateUser(user));
|
||||
}
|
||||
}
|
||||
|
@ -37,14 +37,26 @@ public class LJUserGradeController extends BaseController {
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有启用的会员等级信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/allUserGrade")
|
||||
public ResponseObject lists(){
|
||||
return getSuccessResult(userGradeService.selectUserGradeAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员等级信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseObject userGradeInfo(@PathVariable Integer id){
|
||||
LJUserGrade userGrade = userGradeService.selectUserGradeById(id);
|
||||
public ResponseObject userGradeInfo(@PathVariable String id){
|
||||
LJUserGrade userGrade = null;
|
||||
if (id!=null && !id.equals("null")){
|
||||
userGrade = userGradeService.selectUserGradeById(Integer.parseInt(id));
|
||||
}
|
||||
return getSuccessResult(userGrade);
|
||||
}
|
||||
|
||||
|
@ -57,8 +57,8 @@ public class LJUser extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty("证件号码")
|
||||
private String idcard;
|
||||
|
||||
@ApiModelProperty("等级ID")
|
||||
private Integer gradeId;
|
||||
// @ApiModelProperty("等级ID")
|
||||
// private Integer gradeId;
|
||||
|
||||
@ApiModelProperty("性别 1男,0女")
|
||||
private Integer sex;
|
||||
@ -72,8 +72,8 @@ public class LJUser extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty("地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty("默认店铺")
|
||||
private Integer storeId;
|
||||
// @ApiModelProperty("默认店铺")
|
||||
// private Integer storeId;
|
||||
|
||||
@ApiModelProperty("状态,启用、禁用")
|
||||
private String status;
|
||||
@ -84,15 +84,15 @@ public class LJUser extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty("公众号")
|
||||
private String official;
|
||||
|
||||
@ApiModelProperty("加油次数")
|
||||
private BigDecimal consumeNum;
|
||||
// @ApiModelProperty("加油次数")
|
||||
// private BigDecimal consumeNum;
|
||||
//
|
||||
// @ApiModelProperty("副卡信息")
|
||||
// private String secondCard;
|
||||
//
|
||||
// @ApiModelProperty("固定等级")
|
||||
// private String fixingLevel;
|
||||
|
||||
@ApiModelProperty("副卡信息")
|
||||
private String secondCard;
|
||||
|
||||
@ApiModelProperty("固定等级")
|
||||
private String fixingLevel;
|
||||
|
||||
@ApiModelProperty("邀请员工id")
|
||||
private Integer staffId;
|
||||
// @ApiModelProperty("邀请员工id")
|
||||
// private Integer staffId;
|
||||
}
|
||||
|
@ -35,8 +35,10 @@ public class MtInvitation extends BaseEntity {
|
||||
* 状态:启用、禁用
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 连锁店id
|
||||
*/
|
||||
private Integer chainStoreId;
|
||||
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,13 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
||||
*/
|
||||
public IPage<LJUserVo> selectUserList(Page page, @Param("user") LJUserVo user);
|
||||
|
||||
/**
|
||||
* 根据id查询用户信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public LJUserVo selectUserById(@Param("id") Integer id);
|
||||
|
||||
/**
|
||||
* 根据手机号查询用户信息
|
||||
* @param mobile
|
||||
|
@ -10,5 +10,6 @@
|
||||
<where>
|
||||
store_id = #{userGrade.storeId}
|
||||
</where>
|
||||
order by grade
|
||||
</select>
|
||||
</mapper>
|
@ -2,7 +2,9 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.userManager.mapper.LJUserMapper">
|
||||
<sql id="selectUser">
|
||||
select mu.*,mub.card_balance,mub.points,mub.growth_value,mub.refuel_money from mt_user mu
|
||||
select mu.*,mub.card_balance,mub.points,mub.growth_value,mub.refuel_money,mub.grade_id,mub.consume_num,
|
||||
mub.second_card,mub.fixing_level
|
||||
from mt_user mu
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
</sql>
|
||||
|
||||
@ -25,7 +27,7 @@
|
||||
and mu.name like concat('%', #{user.name}, '%')
|
||||
</if>
|
||||
<if test="user.gradeId != null and user.gradeId != ''">
|
||||
and mu.grade_id = #{user.gradeId}
|
||||
and mub.grade_id = #{user.gradeId}
|
||||
</if>
|
||||
<if test="user.official != null and user.official != ''">
|
||||
and mu.official = #{user.official}
|
||||
@ -75,4 +77,11 @@
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
where mu.id = #{userId}
|
||||
</select>
|
||||
<select id="selectUserById" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
||||
parameterType="java.lang.Integer">
|
||||
<include refid="selectUser"></include>
|
||||
<where>
|
||||
mu.id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -5,7 +5,7 @@
|
||||
<resultMap type="com.fuint.business.userManager.entity.MtInvitation" id="MtInvitationMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userid" column="userId" jdbcType="INTEGER"/>
|
||||
<result property="storeid" column="storeId" jdbcType="INTEGER"/>
|
||||
<result property="storeId" column="storeId" jdbcType="INTEGER"/>
|
||||
<result property="staffid" column="staffId" jdbcType="INTEGER"/>
|
||||
<result property="inviterid" column="inviterId" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员等级信息 业务层
|
||||
*/
|
||||
@ -16,6 +18,12 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
|
||||
*/
|
||||
public IPage<LJUserGrade> selectUserGradeList(Page page, LJUserGrade userGrade);
|
||||
|
||||
/**
|
||||
* 查询所有会员等级信息
|
||||
* @return
|
||||
*/
|
||||
public List<LJUserGrade> selectUserGradeAll();
|
||||
|
||||
/**
|
||||
* 根据id查询会员等级信息
|
||||
* @param id
|
||||
|
@ -37,7 +37,7 @@ public interface LJUserService extends IService<LJUser> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public LJUser selectUserById(int id);
|
||||
public LJUserVo selectUserById(int id);
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
@ -78,5 +78,5 @@ public interface LJUserService extends IService<LJUser> {
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public int updateUser(LJUser user);
|
||||
public int updateUser(LJUserVo user);
|
||||
}
|
||||
|
@ -16,6 +16,8 @@ import com.fuint.system.config.service.SysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
|
||||
@Override
|
||||
@ -38,6 +40,13 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
return ljUserGradeIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LJUserGrade> selectUserGradeAll() {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status","qy");
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LJUserGrade selectUserGradeById(int id) {
|
||||
return baseMapper.selectById(id);
|
||||
@ -75,10 +84,19 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
public int insertUserGrade(LJUserGrade userGrade) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
int row = 0;
|
||||
// 根据等级级别查询等级信息是否存在
|
||||
QueryWrapper queryWrapper1 = new QueryWrapper<>();
|
||||
queryWrapper1.eq("store_id",storeId);
|
||||
queryWrapper1.eq("grade",userGrade.getGrade());
|
||||
LJUserGrade ljUserGrade = baseMapper.selectOne(queryWrapper1);
|
||||
if (ljUserGrade!=null){
|
||||
return 2;
|
||||
}
|
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
Integer num = baseMapper.selectCount(queryWrapper);
|
||||
int row = 0;
|
||||
if (num<20){
|
||||
userGrade.setStoreId(storeId);
|
||||
row = baseMapper.insert(userGrade);
|
||||
|
@ -1,5 +1,6 @@
|
||||
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.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -96,8 +97,8 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LJUser selectUserById(int id) {
|
||||
return baseMapper.selectById(id);
|
||||
public LJUserVo selectUserById(int id) {
|
||||
return baseMapper.selectUserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -187,7 +188,6 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
user1.setOpenId(user.getOpenId());
|
||||
user1.setMobile(user.getMobile());
|
||||
user1.setIdcard(user.getIdcard());
|
||||
user1.setGradeId(user.getGradeId());
|
||||
user1.setSex(user.getSex());
|
||||
user1.setBirthday(user.getBirthday());
|
||||
user1.setCarNo(user.getCarNo());
|
||||
@ -195,9 +195,6 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
user1.setStatus(user.getStatus());
|
||||
user1.setDescription(user.getDescription());
|
||||
user1.setOfficial(user.getOfficial());
|
||||
user1.setConsumeNum(user.getConsumeNum());
|
||||
user1.setSecondCard(user.getSecondCard());
|
||||
user1.setFixingLevel(user.getFixingLevel());
|
||||
int row = baseMapper.insert(user1);
|
||||
// 查询添加后的用户id
|
||||
LJUser ljUser = this.selectUserByMobile(user.getMobile());
|
||||
@ -207,25 +204,52 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
balance.setCardBalance(user.getCardBalance());
|
||||
balance.setPoints(user.getPoints());
|
||||
balance.setStoreId(storeId);
|
||||
balance.setGradeId(user.getGradeId());
|
||||
balance.setConsumeNum(user.getConsumeNum());
|
||||
balance.setSecondCard(user.getSecondCard());
|
||||
balance.setFixingLevel(user.getFixingLevel());
|
||||
balanceService.insertUserBalance(balance);
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员信息
|
||||
* @param user
|
||||
* @param userVo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateUser(LJUser user) {
|
||||
public int updateUser(LJUserVo userVo) {
|
||||
LJUser user = new LJUser();
|
||||
user.setUserNo(userVo.getUserNo());
|
||||
user.setStoreId(userVo.getStoreId());
|
||||
user.setAvatar(userVo.getAvatar());
|
||||
user.setName(userVo.getName());
|
||||
user.setOpenId(userVo.getOpenId());
|
||||
user.setMobile(userVo.getMobile());
|
||||
user.setIdcard(userVo.getIdcard());
|
||||
user.setSex(userVo.getSex());
|
||||
user.setBirthday(userVo.getBirthday());
|
||||
user.setCarNo(userVo.getCarNo());
|
||||
user.setAddress(userVo.getAddress());
|
||||
user.setStatus(userVo.getStatus());
|
||||
user.setDescription(userVo.getDescription());
|
||||
user.setOfficial(userVo.getOfficial());
|
||||
int row = baseMapper.updateById(user);
|
||||
// 修改认证会员手机号
|
||||
CertifiedMember certifiedMember = new CertifiedMember();
|
||||
certifiedMember.setUserId(user.getId());
|
||||
certifiedMember.setMobile(user.getMobile());
|
||||
certifiedMember.setUserId(userVo.getId());
|
||||
certifiedMember.setMobile(userVo.getMobile());
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id",certifiedMember.getUserId());
|
||||
certifiedMemberMapper.update(certifiedMember,queryWrapper);
|
||||
|
||||
// 修改余额会员等级信息
|
||||
UserBalance balance = balanceService.selectUserBalance(userVo.getId());
|
||||
if (!ObjectUtil.isEmpty(balance)){
|
||||
balance.setGradeId(userVo.getGradeId());
|
||||
balance.setFixingLevel(userVo.getFixingLevel());
|
||||
balanceService.updateUserBalance(balance);
|
||||
}
|
||||
return row;
|
||||
}
|
||||
}
|
||||
|
@ -11,9 +11,10 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class LJUserVo extends BaseEntity {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer id;
|
||||
private Integer balanceId;
|
||||
|
||||
|
||||
// 会员号
|
||||
@ExcelProperty(value = "会员号")
|
||||
@ -72,9 +73,6 @@ public class LJUserVo extends BaseEntity {
|
||||
@ExcelProperty(value = "地址")
|
||||
private String address;
|
||||
|
||||
// 默认店铺
|
||||
private Integer storeId;
|
||||
|
||||
// 状态,启用、禁用
|
||||
private String status;
|
||||
|
||||
@ -86,7 +84,7 @@ public class LJUserVo extends BaseEntity {
|
||||
private String official;
|
||||
|
||||
// 加油次数
|
||||
private BigDecimal consumeNum;
|
||||
private Integer consumeNum;
|
||||
|
||||
// 副卡信息
|
||||
@ExcelProperty(value = "副卡信息")
|
||||
@ -94,6 +92,17 @@ public class LJUserVo extends BaseEntity {
|
||||
|
||||
// 固定等级
|
||||
private String fixingLevel;
|
||||
// 邀请员工id
|
||||
private Integer staffId;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Integer staffid;
|
||||
/**
|
||||
* 邀请人id
|
||||
*/
|
||||
private Integer inviterid;
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ public class ShiroConfig {
|
||||
filterMap.put("/excel/export","anon");
|
||||
//根据地理位置获取最近的店铺信息
|
||||
filterMap.put("/business/storeInformation/store/recentlyStore","anon");
|
||||
//会员扫码进入小程序后根据id获取店铺信息
|
||||
filterMap.put("/business/storeInformation/store/queryStoreById","anon");
|
||||
filterMap.put("/**","commonFilter");
|
||||
filter.setFilterChainDefinitionMap(filterMap);
|
||||
filter.setLoginUrl("/login");
|
||||
|
@ -2,7 +2,7 @@
|
||||
module.exports = {
|
||||
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
||||
// baseUrl: 'http://192.168.0.196:8081/',
|
||||
baseUrl: 'http://192.168.1.6:8008/',
|
||||
baseUrl: 'http://192.168.1.4:8080/',
|
||||
// baseUrl: 'http://192.168.1.5:8002/cdJdc',
|
||||
|
||||
imagesUrl: 'http://www.nuoyunr.com/lananRsc',
|
||||
|
@ -70,7 +70,8 @@
|
||||
<view class="station">
|
||||
<view class="station-box">
|
||||
|
||||
<view class="station-title">{{store.name}}{{store.description ? "("+store.description+")" : ""}}
|
||||
<view class="station-title">
|
||||
{{store.name}}{{store.description ? "("+store.description+")" : ""}}
|
||||
</view><!--顺通石化加油站(工业南路站)-->
|
||||
<view style="display: flex;">
|
||||
<view class="bule-icon" v-if="welfare.length!=0" v-for="(item,index) in welfare" :key="index">
|
||||
@ -80,10 +81,12 @@
|
||||
<view class="dis-bt">
|
||||
<view class="">
|
||||
<view class="hui1">{{ store.address }}</view>
|
||||
<view class="hui2">{{ distance }}km</view>
|
||||
<view class="hui2" v-if="distance!=''">{{ distance }}km</view>
|
||||
</view>
|
||||
<view class="lananniu" @click="goGoGo" v-if="distance!=''">
|
||||
<uni-icons type="paperplane-filled" color="#195ADA"
|
||||
size="16"></uni-icons> {{ distance*1000 }}米
|
||||
</view>
|
||||
<view class="lananniu" @click="goGoGo"> <uni-icons type="paperplane-filled" color="#195ADA"
|
||||
size="16"></uni-icons> {{ distance*1000 }}米</view>
|
||||
</view>
|
||||
<!-- <scroll-view scroll-x="true">
|
||||
<view class="scrollbox" >
|
||||
@ -138,6 +141,7 @@
|
||||
distance: "",
|
||||
storeId: "",
|
||||
staffId: "",
|
||||
baseUrl: this.$baseUrl,
|
||||
}
|
||||
},
|
||||
onLoad(query) {
|
||||
@ -156,9 +160,10 @@
|
||||
})
|
||||
uni.setStorageSync("inviteStoreId",storeId)
|
||||
uni.setStorageSync("inviteStaffId",staffId)
|
||||
this.storeId = uni.getStorageInfoSync("inviteStoreId")
|
||||
this.staffId = uni.getStorageInfoSync("inviteStaffId")
|
||||
this.storeId = uni.getStorageSync("inviteStoreId")
|
||||
this.staffId = uni.getStorageSync("inviteStaffId")
|
||||
}
|
||||
this.isExistStoreId();
|
||||
},
|
||||
onShow() {
|
||||
this.isExistStoreId();
|
||||
@ -168,21 +173,34 @@
|
||||
},
|
||||
methods: {
|
||||
isExistStoreId(){
|
||||
if (this.storeId != ""){
|
||||
this.getStore();
|
||||
if (uni.getStorageSync("inviteStoreId") != ""){
|
||||
this.getStore(uni.getStorageSync("inviteStoreId"));
|
||||
}else{
|
||||
this.getAddress();
|
||||
}
|
||||
},
|
||||
// 获取门店信息
|
||||
getStore(){
|
||||
getStore(id){
|
||||
let _this = this;
|
||||
uni.request({
|
||||
url: "http://localhost:8080/business/storeInformation/store/" + _this.storeId,
|
||||
method: "GET",
|
||||
url: _this.baseUrl+"/business/storeInformation/store/queryStoreById",
|
||||
method: "POST",
|
||||
data:{"storeId":id},
|
||||
success: function(response){
|
||||
console.log(response)
|
||||
// _this.store = response
|
||||
_this.store = response.data.data
|
||||
let welfare = response.data.data.welfare
|
||||
if (welfare != undefined && welfare != null && welfare != "") {
|
||||
if (welfare.includes(",")) {
|
||||
_this.welfare = response.data.data.welfare.split(",")
|
||||
} else {
|
||||
_this.welfare.push(response.data.data.welfare)
|
||||
}
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
uni.showLoading({
|
||||
title:err.errMsg
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -198,7 +216,7 @@
|
||||
// console.log('经度: ' + res.longitude);
|
||||
// console.log('纬度: ' + res.latitude);
|
||||
uni.request({
|
||||
url: "http://localhost:8080/business/storeInformation/store/recentlyStore",
|
||||
url: _this.baseUrl+"/business/storeInformation/store/recentlyStore",
|
||||
method: "POST",
|
||||
data: {
|
||||
"lon": res.longitude,
|
||||
@ -219,6 +237,7 @@
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
_this.getStore(2);
|
||||
console.log('获取位置信息失败: ' + err.errMsg);
|
||||
}
|
||||
});
|
||||
@ -454,7 +473,7 @@
|
||||
}
|
||||
|
||||
.bule-icon {
|
||||
width: 70px;
|
||||
width: 85px;
|
||||
font-size: 12px;
|
||||
color: #195ADA;
|
||||
box-sizing: border-box;
|
||||
|
@ -112,16 +112,55 @@
|
||||
oilNumberList:[],
|
||||
// 油枪列表信息
|
||||
oilGunList:[],
|
||||
amountList:[100,200,300]
|
||||
// 员工列表信息
|
||||
staffList: [],
|
||||
// 加油金额列表
|
||||
amountList:[100,200,300],
|
||||
// url信息
|
||||
baseUrl: this.$baseUrl,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
tabbar
|
||||
},
|
||||
onShow() {
|
||||
this.getAddress();
|
||||
this.isExistStoreId();
|
||||
},
|
||||
methods: {
|
||||
isExistStoreId(){
|
||||
if (uni.getStorageSync("inviteStoreId") != ""){
|
||||
this.getStore(uni.getStorageSync("inviteStoreId"));
|
||||
}else{
|
||||
this.getAddress();
|
||||
}
|
||||
},
|
||||
// 获取门店信息
|
||||
getStore(id){
|
||||
let _this = this;
|
||||
uni.request({
|
||||
url: _this.baseUrl+"/business/storeInformation/store/queryStoreById",
|
||||
method: "POST",
|
||||
data:{"storeId":id},
|
||||
success: function(response){
|
||||
_this.getOilNumber(id);
|
||||
_this.getStaffList(id)
|
||||
_this.store = response.data.data
|
||||
let welfare = response.data.data.welfare
|
||||
if (welfare != undefined && welfare != null && welfare != "") {
|
||||
if (welfare.includes(",")) {
|
||||
_this.welfare = response.data.data.welfare.split(",")
|
||||
} else {
|
||||
_this.welfare.push(response.data.data.welfare)
|
||||
}
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
uni.showLoading({
|
||||
title:err.errMsg
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取当前位置
|
||||
getAddress(){
|
||||
let _this = this;
|
||||
@ -132,7 +171,7 @@
|
||||
// console.log('经度: ' + res.longitude);
|
||||
// console.log('纬度: ' + res.latitude);
|
||||
uni.request({
|
||||
url: "http://localhost:8080/business/storeInformation/store/recentlyStore",
|
||||
url: _this.baseUrl+"/business/storeInformation/store/recentlyStore",
|
||||
method: "POST",
|
||||
data: {
|
||||
"lon": res.longitude,
|
||||
@ -143,6 +182,7 @@
|
||||
_this.store = response.data.data.store;
|
||||
_this.storeId = response.data.data.store.id;
|
||||
_this.getOilNumber(_this.storeId);
|
||||
_this.getStaffList(_this.storeId)
|
||||
let welfare = response.data.data.store.welfare;
|
||||
if (welfare != undefined && welfare!=null && welfare!=""){
|
||||
if (welfare.includes(",")){
|
||||
@ -155,20 +195,7 @@
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '获取地理位置失败,请手动选取加油站信息',
|
||||
// success: function (res) {
|
||||
// if (res.confirm) {
|
||||
// console.log('用户点击确定');
|
||||
// uni.navigateTo({
|
||||
// url: '/pagesRefuel/pagesRefuel/index'
|
||||
// })
|
||||
// } else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
_this.getStore(2);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -176,21 +203,35 @@
|
||||
getOilNumber(storeId){
|
||||
let _this = this;
|
||||
uni.request({
|
||||
url: "http://localhost:8080/business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId,
|
||||
url: _this.baseUrl+"/business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId,
|
||||
method: "GET",
|
||||
success: function(response){
|
||||
console.log(response)
|
||||
// _this.oilNumberList = response.data.data;
|
||||
// _this.getOilGun(response.data.data.numberId)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取当前店铺油号对应的油枪信息
|
||||
getOilGun(numberId){
|
||||
let _this = this;
|
||||
uni.request({
|
||||
url: "http://localhost:8080/business/petrolStationManagement/oilGun/queryGunList/" + numberId,
|
||||
url: _this.baseUrl+"/business/petrolStationManagement/oilGun/queryGunList/" + numberId,
|
||||
method: "GET",
|
||||
success: function(response){
|
||||
console.log(response)
|
||||
// _this.oilGunList = response.data.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
getStaffList(storeId){
|
||||
let _this = this;
|
||||
uni.request({
|
||||
url: _this.baseUrl+"/business/member/staff/queryStaffList/" + storeId,
|
||||
method: "GET",
|
||||
success: function(response){
|
||||
console.log(response)
|
||||
// _this.oilGunList = response.data.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user