Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e7ebac6b34
@ -1,9 +1,18 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 查询会员详细
|
// 查询配置信息
|
||||||
export function getSysConfig(key) {
|
export function getSysConfig(key) {
|
||||||
return request({
|
return request({
|
||||||
url: '/sysConfig/getByKey/' + key,
|
url: '/sysConfig/getByKey/' + key,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改配置信息
|
||||||
|
export function editSysConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sysConfig/updateValue',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="来源油站" prop="storeIds">
|
<el-form-item label="来源油站" prop="storeIds">
|
||||||
<el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">
|
<el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">
|
||||||
<el-option v-for="item in storeList" :key="item.id+''" :label="item.name" :value="item.id+''"/>
|
<el-option v-for="item in storeList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="会员号" prop="userNo">
|
<el-form-item label="会员号" prop="userNo">
|
||||||
|
@ -448,7 +448,7 @@ import {
|
|||||||
updateUserGrade
|
updateUserGrade
|
||||||
} from "@/api/staff/user/usergrade";
|
} from "@/api/staff/user/usergrade";
|
||||||
import {getChainStoreConfig, updateChainStoreConfig} from "@/api/staff/user/chainstoreconfig";
|
import {getChainStoreConfig, updateChainStoreConfig} from "@/api/staff/user/chainstoreconfig";
|
||||||
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
import {editSysConfig, getSysConfig} from "@/api/staff/user/sysconfig";
|
||||||
export default {
|
export default {
|
||||||
name: "UserGradeIndex",
|
name: "UserGradeIndex",
|
||||||
dicts: ['yhlx','zhzt','yhhdz'],
|
dicts: ['yhlx','zhzt','yhhdz'],
|
||||||
@ -511,6 +511,11 @@ export default {
|
|||||||
catchTypeList: [],
|
catchTypeList: [],
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
|
// 等级开启信息
|
||||||
|
map:{
|
||||||
|
keyStr:"is_enable_level",
|
||||||
|
valueStr:""
|
||||||
|
},
|
||||||
// 默认排序
|
// 默认排序
|
||||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
@ -583,14 +588,20 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
editLevel1(){
|
editLevel1(){
|
||||||
|
this.map.valueStr = "yes"
|
||||||
|
editSysConfig(this.map).then(res => {
|
||||||
this.level1 = false;
|
this.level1 = false;
|
||||||
this.level2 = true;
|
this.level2 = true;
|
||||||
this.$modal.msgSuccess("等级状态更新成功");
|
this.$modal.msgSuccess("等级状态更新成功");
|
||||||
|
})
|
||||||
},
|
},
|
||||||
editLevel2(){
|
editLevel2(){
|
||||||
|
this.map.valueStr = "no"
|
||||||
|
editSysConfig(this.map).then(res => {
|
||||||
this.level1 = true;
|
this.level1 = true;
|
||||||
this.level2 = false;
|
this.level2 = false;
|
||||||
this.$modal.msgSuccess("等级状态更新成功");
|
this.$modal.msgSuccess("等级状态更新成功");
|
||||||
|
})
|
||||||
},
|
},
|
||||||
addGasOline(){
|
addGasOline(){
|
||||||
let temp= {
|
let temp= {
|
||||||
|
@ -78,7 +78,14 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
|
|||||||
public void ruleCycle(String ruleCycle) {
|
public void ruleCycle(String ruleCycle) {
|
||||||
// 如果是单日的话则开启定时任务
|
// 如果是单日的话则开启定时任务
|
||||||
if (ruleCycle.equals("singleDay")){
|
if (ruleCycle.equals("singleDay")){
|
||||||
|
try {
|
||||||
|
// 86400000
|
||||||
|
// Thread.sleep(20000);
|
||||||
|
// System.out.println(1);
|
||||||
|
merchantConfigService.updateMerchIsOpen("0");
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
package com.fuint.api.fuyou.util;
|
|
||||||
|
|
||||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class SchudelUtil {
|
|
||||||
@Autowired
|
|
||||||
private MerchantConfigService merchantConfigService;
|
|
||||||
|
|
||||||
@Scheduled(fixedDelay=86400000)
|
|
||||||
public void teak1(){
|
|
||||||
merchantConfigService.updateMerchIsOpen("0");
|
|
||||||
}
|
|
||||||
}
|
|
@ -123,10 +123,14 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
|||||||
activeConsumptionVO.setActiveGift(s.getActiveGift().split(","));
|
activeConsumptionVO.setActiveGift(s.getActiveGift().split(","));
|
||||||
//获取会员等级
|
//获取会员等级
|
||||||
String str = "";
|
String str = "";
|
||||||
|
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
||||||
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
||||||
|
if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){
|
||||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
activeConsumptionVO.setDieselUserLevel(str.split(","));
|
activeConsumptionVO.setDieselUserLevel(str.split(","));
|
||||||
|
}
|
||||||
activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList);
|
activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList);
|
||||||
return activeConsumptionVO;
|
return activeConsumptionVO;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
@ -123,10 +123,14 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
|
|||||||
.toArray(Integer[]::new));
|
.toArray(Integer[]::new));
|
||||||
//获取会员等级
|
//获取会员等级
|
||||||
String str = "";
|
String str = "";
|
||||||
|
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
||||||
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
||||||
|
if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){
|
||||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
activeDiscountVO.setDieselUserLevel(str.split(","));
|
activeDiscountVO.setDieselUserLevel(str.split(","));
|
||||||
|
}
|
||||||
activeDiscountVO.setActiveDiscountChildList(activeDiscountChildList);
|
activeDiscountVO.setActiveDiscountChildList(activeDiscountChildList);
|
||||||
return activeDiscountVO;
|
return activeDiscountVO;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
@ -120,10 +120,14 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
|
|||||||
.toArray(Integer[]::new));
|
.toArray(Integer[]::new));
|
||||||
//获取会员等级
|
//获取会员等级
|
||||||
String str = "";
|
String str = "";
|
||||||
|
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
||||||
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
||||||
|
if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){
|
||||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
activeFullminusVO.setDieselUserLevel(str.split(","));
|
activeFullminusVO.setDieselUserLevel(str.split(","));
|
||||||
|
}
|
||||||
activeFullminusVO.setActiveDiscountChildList(activeDiscountChildList);
|
activeFullminusVO.setActiveDiscountChildList(activeDiscountChildList);
|
||||||
return activeFullminusVO;
|
return activeFullminusVO;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
@ -91,7 +91,11 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
|
|||||||
activeRecommendVO.setInviterGiftType(new String[0]);
|
activeRecommendVO.setInviterGiftType(new String[0]);
|
||||||
if (ObjectUtils.isNotEmpty(id)){
|
if (ObjectUtils.isNotEmpty(id)){
|
||||||
//获取新人有礼活动信息
|
//获取新人有礼活动信息
|
||||||
ActiveRecommend activeRecommend = getById(id);
|
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(ActiveRecommend::getId,id);
|
||||||
|
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
|
||||||
|
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
|
||||||
|
//ActiveRecommend activeRecommend = getById(id);
|
||||||
//获取兑换物品信息
|
//获取兑换物品信息
|
||||||
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,id);
|
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,id);
|
||||||
|
@ -117,7 +117,7 @@ public class CardFuelDieselController extends BaseController {
|
|||||||
cardFuelDiesel.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
cardFuelDiesel.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
||||||
cardFuelDiesel.setChainStorId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
|
cardFuelDiesel.setChainStorId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
|
||||||
}
|
}
|
||||||
//活动时间
|
|
||||||
cardFuelDiesel.setStartTime(new Date());
|
cardFuelDiesel.setStartTime(new Date());
|
||||||
cardFuelDiesel.setEndTime(new Date());
|
cardFuelDiesel.setEndTime(new Date());
|
||||||
cardFuelDiesel.setStatus(cardFuelDiesel.getStatus().equals("true") ? "1" : "2");
|
cardFuelDiesel.setStatus(cardFuelDiesel.getStatus().equals("true") ? "1" : "2");
|
||||||
|
@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -115,11 +116,13 @@ public class CardValueController extends BaseController {
|
|||||||
queryWrapper.eq(CardValueChild::getCardValueId,id);
|
queryWrapper.eq(CardValueChild::getCardValueId,id);
|
||||||
queryWrapper.orderByDesc(CardValueChild::getCreateTime);
|
queryWrapper.orderByDesc(CardValueChild::getCreateTime);
|
||||||
List<CardValueChild> activeNewlywedsChildList = cardValueChildService.list(queryWrapper);
|
List<CardValueChild> activeNewlywedsChildList = cardValueChildService.list(queryWrapper);
|
||||||
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
|
|
||||||
//封装VO返回
|
|
||||||
BeanUtils.copyProperties(cardValue,cardValueVO);
|
BeanUtils.copyProperties(cardValue,cardValueVO);
|
||||||
cardValueVO.setMembershipLevel(cardValue.getMembershipLevel().split(","));
|
cardValueVO.setMembershipLevel(cardValue.getMembershipLevel().split(","));
|
||||||
|
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
|
||||||
|
//封装VO返回
|
||||||
cardValueVO.setCardValueChildList(activeNewlywedsChildList);
|
cardValueVO.setCardValueChildList(activeNewlywedsChildList);
|
||||||
|
}else {
|
||||||
|
cardValueVO.setCardValueChildList(new ArrayList<>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return getSuccessResult(cardValueVO);
|
return getSuccessResult(cardValueVO);
|
||||||
|
@ -48,6 +48,17 @@ public class LJUserGradeController extends BaseController {
|
|||||||
return getSuccessResult(userGrade);
|
return getSuccessResult(userGrade);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询会员等级信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/isUse/{id}")
|
||||||
|
public ResponseObject userGrade(@PathVariable Integer id){
|
||||||
|
LJUserGrade userGrade = userGradeService.selectUserGradeByIdIsUse(id);
|
||||||
|
return getSuccessResult(userGrade);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询会员等级信息
|
* 根据id查询会员等级信息
|
||||||
* @param map
|
* @param map
|
||||||
|
@ -23,6 +23,13 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
|
|||||||
*/
|
*/
|
||||||
public LJUserGrade selectUserGradeById(int id);
|
public LJUserGrade selectUserGradeById(int id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询会员等级信息是否可使用
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public LJUserGrade selectUserGradeByIdIsUse(int id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据会员等级名称查询会员等级信息
|
* 根据会员等级名称查询会员等级信息
|
||||||
* @param name
|
* @param name
|
||||||
|
@ -12,6 +12,8 @@ import com.fuint.business.userManager.service.LJUserGradeService;
|
|||||||
import com.fuint.common.dto.AccountInfo;
|
import com.fuint.common.dto.AccountInfo;
|
||||||
import com.fuint.common.util.StringUtils;
|
import com.fuint.common.util.StringUtils;
|
||||||
import com.fuint.common.util.TokenUtil;
|
import com.fuint.common.util.TokenUtil;
|
||||||
|
import com.fuint.system.config.service.SysConfigService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -41,6 +43,18 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
|||||||
return baseMapper.selectById(id);
|
return baseMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysConfigService sysConfigService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LJUserGrade selectUserGradeByIdIsUse(int id) {
|
||||||
|
String isEnableLevel = sysConfigService.getValueByKey("is_enable_level");
|
||||||
|
if (isEnableLevel.equals("yes")){
|
||||||
|
return baseMapper.selectById(id);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LJUserGrade selectUserGradeByName(String name) {
|
public LJUserGrade selectUserGradeByName(String name) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
@ -61,7 +75,9 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
|||||||
public int insertUserGrade(LJUserGrade userGrade) {
|
public int insertUserGrade(LJUserGrade userGrade) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
Integer storeId = nowAccountInfo.getStoreId();
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
Integer num = baseMapper.selectCount(null);
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.eq("store_id",storeId);
|
||||||
|
Integer num = baseMapper.selectCount(queryWrapper);
|
||||||
int row = 0;
|
int row = 0;
|
||||||
if (num<20){
|
if (num<20){
|
||||||
userGrade.setStoreId(storeId);
|
userGrade.setStoreId(storeId);
|
||||||
|
@ -17,6 +17,7 @@ public class AccountInfo implements Serializable {
|
|||||||
private Integer id;
|
private Integer id;
|
||||||
private String accountKey;
|
private String accountKey;
|
||||||
private String accountName;
|
private String accountName;
|
||||||
|
private String roleName;
|
||||||
private int accountStatus;
|
private int accountStatus;
|
||||||
private String isActive;
|
private String isActive;
|
||||||
private Date createDate;
|
private Date createDate;
|
||||||
|
@ -19,7 +19,7 @@ public class SMSUtils {
|
|||||||
* @param param 参数
|
* @param param 参数
|
||||||
*/
|
*/
|
||||||
public static void sendMessage(String signName, String templateCode,String phoneNumbers,String param){
|
public static void sendMessage(String signName, String templateCode,String phoneNumbers,String param){
|
||||||
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "", "");
|
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "LTAI5t7GEqGL46cwjYs6aanu", "d9MpwlyXbHOTrQaA5n8URVz40x5AX3");
|
||||||
IAcsClient client = new DefaultAcsClient(profile);
|
IAcsClient client = new DefaultAcsClient(profile);
|
||||||
|
|
||||||
SendSmsRequest request = new SendSmsRequest();
|
SendSmsRequest request = new SendSmsRequest();
|
||||||
|
@ -3,6 +3,8 @@ package com.fuint.module.backendApi.controller;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.api.R;
|
import com.baomidou.mybatisplus.extension.api.R;
|
||||||
|
import com.fuint.business.userManager.entity.LJUser;
|
||||||
|
import com.fuint.business.userManager.service.LJUserService;
|
||||||
import com.fuint.common.dto.AccountInfo;
|
import com.fuint.common.dto.AccountInfo;
|
||||||
import com.fuint.common.dto.UserDto;
|
import com.fuint.common.dto.UserDto;
|
||||||
import com.fuint.common.enums.AdminRoleEnum;
|
import com.fuint.common.enums.AdminRoleEnum;
|
||||||
@ -22,6 +24,7 @@ import com.fuint.system.role.service.DutyService;
|
|||||||
import com.fuint.utils.StringUtil;
|
import com.fuint.utils.StringUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||||
import org.apache.shiro.subject.Subject;
|
import org.apache.shiro.subject.Subject;
|
||||||
@ -69,6 +72,8 @@ public class BackendLoginController extends BaseController {
|
|||||||
* */
|
* */
|
||||||
@Resource
|
@Resource
|
||||||
private CaptchaService captchaService;
|
private CaptchaService captchaService;
|
||||||
|
@Autowired
|
||||||
|
private LJUserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public RedisTemplate redisTemplate;
|
public RedisTemplate redisTemplate;
|
||||||
@ -119,7 +124,7 @@ public class BackendLoginController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 后台登录
|
* 发送手机验证码
|
||||||
* */
|
* */
|
||||||
@ApiOperation(value = "发送手机验证码")
|
@ApiOperation(value = "发送手机验证码")
|
||||||
@RequestMapping(value="/sendMsg", method = RequestMethod.POST)
|
@RequestMapping(value="/sendMsg", method = RequestMethod.POST)
|
||||||
@ -128,38 +133,50 @@ public class BackendLoginController extends BaseController {
|
|||||||
//获取手机号
|
//获取手机号
|
||||||
String phone = userDto.getMobile();
|
String phone = userDto.getMobile();
|
||||||
if(StringUtils.isNotEmpty(phone)){
|
if(StringUtils.isNotEmpty(phone)){
|
||||||
|
//获取用户信息
|
||||||
|
LJUser ljUser = userService.selectUserByMobile(phone);
|
||||||
|
if (ObjectUtils.isEmpty(ljUser)){
|
||||||
|
return getSuccessResult("用户不存在,请先注册账号!");
|
||||||
|
}
|
||||||
//生成随机的四位验证码
|
//生成随机的四位验证码
|
||||||
String code = ValidateCodeUtils.verificationCode(4);
|
String code = ValidateCodeUtils.verificationCode(4);
|
||||||
|
//String code = "1234";
|
||||||
//调用阿里云提供的短信服务API完成发送短信
|
//调用阿里云提供的短信服务API完成发送短信
|
||||||
SMSUtils.sendMessage("蓝鲸智慧油站","SMS_154950909",phone,code);
|
SMSUtils.sendMessage("阿里云短信测试","SMS_154950909",phone,code);
|
||||||
//需要将生成的验证码保存到redis,过期时间60s
|
//SMSUtils.sendMessage("蓝鲸智慧油站", "SMS_291345282",phone,code);
|
||||||
redisTemplate.opsForValue().set(phone,code,60, TimeUnit.SECONDS);
|
//需要将生成的验证码保存到redis,过期时间300s
|
||||||
|
redisTemplate.opsForValue().set(phone,code,300, TimeUnit.SECONDS);
|
||||||
return getSuccessResult("手机验证码发送成功");
|
return getSuccessResult("手机验证码发送成功");
|
||||||
}
|
}
|
||||||
return getFailureResult("短信发送失败");
|
return getFailureResult("短信发送失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*手机验证码登录
|
||||||
* @param map
|
* @param map
|
||||||
* @param session
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/loginByPhone")
|
@PostMapping("/loginByPhone")
|
||||||
public ResponseObject loginByPhone(@RequestBody Map map) {
|
public ResponseObject loginByPhone(@RequestBody Map map) {
|
||||||
//获取手机号 1234
|
//获取手机号
|
||||||
String phone = map.get("mobile").toString();
|
String phone = map.get("mobile").toString();
|
||||||
|
//获取用户信息
|
||||||
|
LJUser ljUser = userService.selectUserByMobile(phone);
|
||||||
//获取验证码
|
//获取验证码
|
||||||
String code = map.get("code").toString();
|
String code = map.get("code").toString();
|
||||||
//从redis中获取保存的验证码
|
//从redis中获取保存的验证码
|
||||||
Object codeInRedis = redisTemplate.opsForValue().get(phone);
|
Object codeInRedis = redisTemplate.opsForValue().get(phone);
|
||||||
//进行验证码的比对
|
//进行验证码的比对
|
||||||
if (codeInRedis != null && codeInRedis.equals(code)) {
|
if (codeInRedis != null && codeInRedis.equals(code) && ObjectUtils.isNotEmpty(ljUser)) {
|
||||||
//如果能够比对成功,说明登录成功
|
//如果能够比对成功,说明登录成功
|
||||||
return getSuccessResult("登录成功!");
|
return getSuccessResult("登录成功!",ljUser);
|
||||||
}
|
}else if (codeInRedis != null && codeInRedis.equals(code) && ObjectUtils.isEmpty(ljUser)){
|
||||||
|
return getSuccessResult("用户不存在,请先注册账号!");
|
||||||
|
}else {
|
||||||
return getFailureResult("登录失败,请输入正确的验证码");
|
return getFailureResult("登录失败,请输入正确的验证码");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 获取登录信息接口
|
* 获取登录信息接口
|
||||||
* */
|
* */
|
||||||
@ -168,6 +185,11 @@ public class BackendLoginController extends BaseController {
|
|||||||
public ResponseObject getInfo(HttpServletRequest request) throws BusinessCheckException {
|
public ResponseObject getInfo(HttpServletRequest request) throws BusinessCheckException {
|
||||||
String token = request.getHeader("Access-Token");
|
String token = request.getHeader("Access-Token");
|
||||||
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
|
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
|
||||||
|
if (ObjectUtils.isNotEmpty(accountInfo.getRoleIds()) &&
|
||||||
|
ObjectUtils.isNotEmpty((long)Integer.parseInt(accountInfo.getRoleIds())) &&
|
||||||
|
ObjectUtils.isNotEmpty(dutyService.getRoleById((long)Integer.parseInt(accountInfo.getRoleIds())))){
|
||||||
|
accountInfo.setRoleName(dutyService.getRoleById((long)Integer.parseInt(accountInfo.getRoleIds())).getDutyName());
|
||||||
|
}
|
||||||
if (accountInfo == null) {
|
if (accountInfo == null) {
|
||||||
return getFailureResult(401, "登录信息已失效,请重新登录");
|
return getFailureResult(401, "登录信息已失效,请重新登录");
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,18 @@ public class SysConfigController extends BaseController {
|
|||||||
return getSuccessResult("成功");
|
return getSuccessResult("成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据key修改value
|
||||||
|
*
|
||||||
|
* @param sysConfig 实体对象
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/updateValue")
|
||||||
|
public ResponseObject updateSysConfig(@RequestBody SysConfig sysConfig) {
|
||||||
|
this.sysConfigService.updateSysConfig(sysConfig);
|
||||||
|
return getSuccessResult("成功");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除数据
|
* 删除数据
|
||||||
*
|
*
|
||||||
|
@ -12,6 +12,12 @@ import com.fuint.system.config.entity.SysConfig;
|
|||||||
public interface SysConfigService extends IService<SysConfig> {
|
public interface SysConfigService extends IService<SysConfig> {
|
||||||
void saveVo(SysConfig sysConfig);
|
void saveVo(SysConfig sysConfig);
|
||||||
void updateByIdVo(SysConfig sysConfig);
|
void updateByIdVo(SysConfig sysConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据key修改配置信息
|
||||||
|
* @param sysConfig
|
||||||
|
*/
|
||||||
|
void updateSysConfig(SysConfig sysConfig);
|
||||||
void removeByIdVo(Long id);
|
void removeByIdVo(Long id);
|
||||||
String getValueByKey(String keyStr);
|
String getValueByKey(String keyStr);
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.fuint.system.config.service.impl;
|
package com.fuint.system.config.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
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.common.util.RedisUtil;
|
import com.fuint.common.util.RedisUtil;
|
||||||
import com.fuint.system.config.mapper.SysConfigMapper;
|
import com.fuint.system.config.mapper.SysConfigMapper;
|
||||||
@ -34,6 +35,17 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|||||||
this.updateById(sysConfig);
|
this.updateById(sysConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSysConfig(SysConfig sysConfig) {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("key_str",sysConfig.getKeyStr());
|
||||||
|
SysConfig sysConfig1 = baseMapper.selectOne(queryWrapper);
|
||||||
|
if (ObjectUtils.isNotEmpty(sysConfig1)){
|
||||||
|
sysConfig1.setValueStr(sysConfig.getValueStr());
|
||||||
|
baseMapper.updateById(sysConfig1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeByIdVo(Long id) {
|
public void removeByIdVo(Long id) {
|
||||||
SysConfig sysConfig = this.getById(id);
|
SysConfig sysConfig = this.getById(id);
|
||||||
|
@ -17,6 +17,14 @@ export function getUserGrade(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询会员等级详细是否能使用
|
||||||
|
export function userGradeInfo(id) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/userGrade/isUse/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 根据会员等级名称查询会员等级信息
|
// 根据会员等级名称查询会员等级信息
|
||||||
export function queryUserGrade(data) {
|
export function queryUserGrade(data) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -782,7 +782,7 @@
|
|||||||
import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
|
import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
|
||||||
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
|
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
|
||||||
import {addLJGoods, goodsOrder, oilOrder} from "@/api/cashier/oilorder";
|
import {addLJGoods, goodsOrder, oilOrder} from "@/api/cashier/oilorder";
|
||||||
import {getUserGrade, listUserGrade} from "@/api/cashier/usergrade";
|
import {getUserGrade, listUserGrade, userGradeInfo} from "@/api/cashier/usergrade";
|
||||||
import {getOilGun} from "@/api/cashier/oilGuns";
|
import {getOilGun} from "@/api/cashier/oilGuns";
|
||||||
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
|
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
|
||||||
import {getOilNumberById, oilNumberList} from "@/api/cashier/oilnumber";
|
import {getOilNumberById, oilNumberList} from "@/api/cashier/oilnumber";
|
||||||
@ -1421,11 +1421,12 @@
|
|||||||
this.gradeDiscount = [];
|
this.gradeDiscount = [];
|
||||||
getSysConfig('is_enable_level').then(res => {
|
getSysConfig('is_enable_level').then(res => {
|
||||||
if (res.data=="yes") {
|
if (res.data=="yes") {
|
||||||
getUserGrade(id).then(response => {
|
userGradeInfo(id).then(response => {
|
||||||
let gasolineDiscount = 0;
|
let gasolineDiscount = 0;
|
||||||
let dieselDiscount = 0;
|
let dieselDiscount = 0;
|
||||||
let naturalGasDiscount = 0;
|
let naturalGasDiscount = 0;
|
||||||
_this.gradeDiscount = [];
|
_this.gradeDiscount = [];
|
||||||
|
if (response.data!=null) {
|
||||||
_this.oilOrder.forEach(item => {
|
_this.oilOrder.forEach(item => {
|
||||||
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||||
if (item.type == "汽油") {
|
if (item.type == "汽油") {
|
||||||
@ -1642,7 +1643,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
console.log(response)
|
||||||
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||||
_this.checkAll2 = true;
|
_this.checkAll2 = true;
|
||||||
_this.isExclusion();
|
_this.isExclusion();
|
||||||
@ -1682,7 +1684,7 @@
|
|||||||
_this.couponIds = response.data
|
_this.couponIds = response.data
|
||||||
if (response.data.length>0){
|
if (response.data.length>0){
|
||||||
response.data.forEach(item => {
|
response.data.forEach(item => {
|
||||||
_this.useCouponIds.push(item.id)
|
_this.useCouponIds = item.id
|
||||||
let discount = {type:item.type,discountType:item.discountType,name:item.name,oilName:item1.oilName,full:0,reduce:0,discount:0}
|
let discount = {type:item.type,discountType:item.discountType,name:item.name,oilName:item1.oilName,full:0,reduce:0,discount:0}
|
||||||
discount.full = item.satisfiedAmount
|
discount.full = item.satisfiedAmount
|
||||||
if (item.type==0){
|
if (item.type==0){
|
||||||
|
Loading…
Reference in New Issue
Block a user