Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2024-03-27 16:39:27 +08:00
commit 849d22ff3f
16 changed files with 289 additions and 42 deletions

View File

@ -49,8 +49,8 @@ public class Const {
public static String NOTIFY_PUBLIC_KEYS="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbBAl3xSB7YeUnze4yYZmnTeT7OtXZr0sP10TsDVRH2SY/VEjgS9KPmHMmVeKZT3+6xKsUvulgVyie46GGtZPrnoh+glF1gzsYAXJ7dvR/R5nYO5VvfwK/ChPFTiKhbTtO4OKtchgBZuqCbsemG+gFIiVJo37dY0Kg0zISmFHdOQIDAQAB";
//异步通知(回调地址)
// public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify";
public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify";
public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify";
// public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify";
//下单
public static String fuiou_21_url = "https://fundwx.fuiou.com/preCreate";

View File

@ -785,7 +785,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
//4. 3和优惠券比较
if (ObjectUtils.isNotEmpty(activeDiscountPayVO3)) {
finalAmount = activeDiscountPayVO3.getDiscounts();
if (ObjectUtils.isNotEmpty(cardFavorableRecordVO) && finalAmount < cardFavorableRecordVO.getDiscountAmount()) {
if (ObjectUtils.isNotEmpty(cardFavorableRecordVO) && ObjectUtils.isNotEmpty(cardFavorableRecordVO.getDiscountAmount()) && finalAmount < cardFavorableRecordVO.getDiscountAmount()) {
PaymentActiveVO paymentActiveVO1 = new PaymentActiveVO();
//单用优惠券优惠力度最大
paymentActiveVO1.setCardFavorableId(cardFavorableRecordVO.getId());

View File

@ -40,14 +40,15 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implemen
@Override
public List<TDuty> selectDutys(TDuty duty) {
QueryWrapper<TDuty> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(duty.getStoreId())) {
/*if (ObjectUtil.isNotEmpty(duty.getStoreId())) {
SysDept sysDept = sysDeptService.selectParentId(Long.valueOf(duty.getStoreId()));
queryWrapper.eq("store_id", sysDept.getDeptId());
}else {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
SysDept sysDept = sysDeptService.selectParentId(nowAccountInfo.getDeptId());
queryWrapper.eq("store_id", sysDept.getDeptId());
}
}*/
queryWrapper.eq("store_id", duty.getStoreId());
return baseMapper.selectList(queryWrapper);
}
@ -63,14 +64,15 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implemen
@Override
public Page<TDuty> selectDutyPage(Page page, TDuty duty) {
if (ObjectUtil.isNotEmpty(duty.getStoreId())){
/*if (ObjectUtil.isNotEmpty(duty.getStoreId())){
SysDept sysDept = sysDeptService.selectParentId(Long.valueOf(duty.getStoreId()));
duty.setStoreId(Math.toIntExact(sysDept.getDeptId()));
}else {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
SysDept sysDept = sysDeptService.selectParentId(nowAccountInfo.getDeptId());
duty.setStoreId(Math.toIntExact(sysDept.getDeptId()));
}
}*/
duty.setStoreId(duty.getStoreId());
return baseMapper.selectDutyPage(page,duty);
}

View File

@ -22,6 +22,7 @@ import javax.swing.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.*;
/**
@ -128,6 +129,58 @@ public class QrCodeUtils {
}
}
public void createLogoCodePictures(InputStream logoStream, String url, String outImgPath, Integer staffId, Integer storeId,String urls) {
try {
// 读取原图片信息
//得到文件
//// File file = ResourceUtils.getFile(roundImage);
// ClassPathResource resource = new ClassPathResource(roundImage);
// ClassPathResource logoResource = new ClassPathResource(logoImage);
// File file = resource.getFile();
//文件转化为图片
// 加水印
//使用工具类生成二维码
Image image = createQrCode(logoStream, url, 360, 360);
//将小图片绘到大图片上,500,300 .表示你的小图片在大图片上的位置
// 查询当前店铺信息
if (ObjectUtils.isNotEmpty(storeId)){
LJStore store = storeService.selectStoreByStoreId(storeId);
// 查询加油员信息
LJStaff staff = null;
if (ObjectUtil.isNotEmpty(staffId)){
staff = staffService.selectStaffById(staffId);
}
LJStaff staff1 = staffService.selectStaffByStoreId(storeId);
}else {
//drawStringWithMultiLine(g,"欢迎光临", bufImg.getWidth()-20,20,940,10 );
}
// // 将码牌编号文字绘制到指定位置
// g.drawString(storeNumber, 200, 800);
// 输出图片
String urlsss = "/temp/qrCode/";
if (ObjectUtils.isNotEmpty(urls)){
urlsss = urls;
}
File file1 = new File(urlsss);
// 判断目录是否存在
if (!file1.exists()) {
file1.mkdirs();
}
FileOutputStream outImgStream = new FileOutputStream(outImgPath);
ImageIO.write((RenderedImage) image, "jpg", outImgStream);
outImgStream.flush();
outImgStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public Font chineseFont() throws Exception {
// 设置中文
Font b = null;

View File

@ -65,6 +65,7 @@ import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import com.fuint.system.config.service.SysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@ -80,6 +81,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
@Slf4j
public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> implements OilOrderService {
@Autowired
private LJOrderService orderService;
@ -123,6 +125,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
private ActiveDiscountService activeDiscountService;
@Resource
private IntegralSettingsService integralSettingsService;
@Resource
private OilGunService oilGunService;
@Override
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
@ -1080,10 +1084,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilOrder.setOrderType("主订单");
oilOrder.setInvoicing("未开票");
oilOrder.setUserId(nowAccountInfo.getId());
if (ObjectUtils.isNotEmpty(oilOrder.getOilTagSn())){
String[] split = oilOrder.getOilTagSn().split("=");
oilOrder.setOilTagSn(split[1]);
}
oilOrder.setOilTagSn(oilOrder.getOilTagSn());
// 判断当前店铺是否存在此用户的会员信息没有的话进行添加
LJStore store = storeService.selectStoreByStoreId(oilOrder.getStoreId());
UserBalance balance = userBalanceService.selectUserBalance(oilOrder.getUserId(), store.getChainStoreId());
@ -1346,7 +1347,18 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
String oils = oilOrder.getOils();
OilName oilName = oilNameService.getById(oils);
content = oilOrder.getOilGunNum()+"加油"+oilName.getOilName()+oilName.getOilType()+oilOrder.getOilNum()+"升,共计"+oilOrder.getPayAmount()+"";
//油枪名字
OilGun oilGun = oilGunService.queryById(Integer.parseInt(oilOrder.getOilGunNum()));
String oilName11 = "";
if (oilName.getOilName().contains("#")){
String[] split = oilName.getOilName().split("#");
oilName11 = split[0];
content = oilGun.getGunName()+"加油"+oilName11+oilName.getOilType()+oilOrder.getOilNum()+"升,共计"+oilOrder.getPayAmount()+"";
}else {
content = oilGun.getGunName()+"加油"+oilName.getOilName()+oilName.getOilType()+oilOrder.getOilNum()+"升,共计"+oilOrder.getPayAmount()+"";
}
log.info("码牌播报内容111"+content);
hashMap.put("content",content);
tagUtils.voiceBroadcast(hashMap);
//tagUtils
@ -1873,9 +1885,6 @@ return stringDoubleMap;
saleDetailService.insertSaleDetail(saleDetail,isMember);
}
@Resource
OilGunService oilGunService;
@Override
public OilOrderVo getInfoByTime(Date time,Integer tankId) {
List<OilGun> oilGuns = oilGunService.selectOilGunByTankId(tankId);

View File

@ -3,20 +3,28 @@ package com.fuint.business.tag.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.tag.entity.OilTag;
import com.fuint.business.tag.entity.TagCodeRecord;
import com.fuint.business.tag.service.OilTagService;
import com.fuint.business.tag.service.TagCodeRecordService;
import com.fuint.business.tag.util.TagUtils;
import com.fuint.business.tag.vo.OilTagVO;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* 码牌配置表(OilTag)表控制层
@ -33,6 +41,9 @@ public class OilTagController extends BaseController {
@Resource
private OilTagService oilTagService;
@Resource
private TagCodeRecordService tagCodeRecordService;
@Resource
private TagUtils tagUtils;
/**
@ -44,15 +55,34 @@ public class OilTagController extends BaseController {
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") OilTag oilTag) {
Page page = new Page(pageNo, pageSize);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LambdaQueryWrapper<OilTag> queryWrapper = new LambdaQueryWrapper<>();
if (ObjectUtils.isNotEmpty(oilTag.getTagCodeSn())){
queryWrapper.eq(OilTag::getTagCodeSn,oilTag.getTagCodeSn());
}
queryWrapper.eq(OilTag::getDeptId,nowAccountInfo.getDeptId());
if (ObjectUtils.isNotEmpty(oilTag.getSnCode())){
queryWrapper.eq(OilTag::getSnCode,oilTag.getSnCode());
}
queryWrapper.orderByDesc(OilTag::getCreateTime);
return getSuccessResult(this.oilTagService.page(page, queryWrapper));
ArrayList<OilTagVO> oilTagVOArrayList = new ArrayList<>();
IPage page1 = this.oilTagService.page(page, queryWrapper);
List<OilTag> records = page1.getRecords();
for (OilTag record : records) {
Integer oilTagId = record.getId();
LambdaQueryWrapper<TagCodeRecord> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(TagCodeRecord::getOilTagId,oilTagId);
TagCodeRecord one = tagCodeRecordService.getOne(queryWrapper1);
OilTagVO oilTagVO = new OilTagVO();
BeanUtils.copyProperties(record,oilTagVO);
if (ObjectUtils.isNotEmpty(one)){
oilTagVO.setStoreName(one.getStoreName());
}
oilTagVOArrayList.add(oilTagVO);
}
page1.setRecords(oilTagVOArrayList);
return getSuccessResult(page1);
}
/**
@ -98,7 +128,34 @@ public class OilTagController extends BaseController {
*/
@DeleteMapping("{id}")
public ResponseObject delete(@PathVariable("id") Long id) {
return getSuccessResult(this.oilTagService.removeById(id));
OilTag oilTag = this.oilTagService.getById(id);
LambdaQueryWrapper<TagCodeRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TagCodeRecord::getOilTagId,oilTag.getId());
TagCodeRecord tagCodeRecord = this.tagCodeRecordService.getOne(queryWrapper);
if (ObjectUtils.isNotEmpty(tagCodeRecord.getStaffId())){
return getSuccessResult("该码牌已绑定员工,请先解绑员工!");
}else {
this.tagCodeRecordService.removeById(tagCodeRecord.getId());
oilTag.setStatus("0");
this.oilTagService.updateById(oilTag);
return getSuccessResult("解绑成功!");
}
/* TagCodeRecord tagCodeRecord = this.tagCodeRecordService.getById(id);
return getSuccessResult(this.oilTagService.removeById(id));*/
}
//通过二维码sn查油站id
@GetMapping("/getSn/{sn}")
public ResponseObject selectOne(@PathVariable String sn) {
LambdaQueryWrapper<OilTag> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(OilTag::getTagCodeSn, sn);
OilTag one = this.oilTagService.getOne(queryWrapper);
Integer oilTagId = one.getId();
LambdaQueryWrapper<TagCodeRecord> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(TagCodeRecord::getOilTagId,oilTagId);
TagCodeRecord one1 = tagCodeRecordService.getOne(queryWrapper1);
return getSuccessResult(one1);
}
}

View File

@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.tag.dto.TagCodeDTO;
import com.fuint.business.tag.entity.TagCode;
import com.fuint.business.tag.service.TagCodeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
@ -59,10 +61,12 @@ public class TagCodeController extends BaseController {
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") TagCode tagCode) {
Page page = new Page(pageNo, pageSize);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LambdaQueryWrapper<TagCode> queryWrapper = new LambdaQueryWrapper<>();
if (ObjectUtils.isNotEmpty(tagCode.getTagCodeSn())){
queryWrapper.eq(TagCode::getTagCodeSn,tagCode.getTagCodeSn());
}
queryWrapper.eq(TagCode::getDeptId,nowAccountInfo.getDeptId());
queryWrapper.orderByDesc(TagCode::getCreateTime);
return getSuccessResult(this.tagCodeService.page(page, queryWrapper));
}

View File

@ -24,6 +24,7 @@ public class OilTag extends Model<OilTag> {
private Integer id;
//二维码id
private Integer tagCodeId;
private Integer deptId;
//二维码SN号
private String tagCodeSn;
//厂家名字

View File

@ -9,6 +9,8 @@ import com.fuint.business.tag.entity.OilTag;
import com.fuint.business.tag.mapper.TagCodeMapper;
import com.fuint.business.tag.service.OilTagService;
import com.fuint.business.tag.service.TagCodeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.module.backendApi.controller.BackendFileController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
@ -34,6 +36,8 @@ public class OilTagServiceImpl extends ServiceImpl<OilTagMapper, OilTag> impleme
@Override
public boolean add(OilTag oilTag) throws Exception {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
oilTag.setDeptId(Integer.parseInt(nowAccountInfo.getDeptId().toString()));
LambdaQueryWrapper<TagCode> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TagCode::getTagCodeSn, oilTag.getTagCodeSn());
TagCode tagCode = tagCodeService.getOne(queryWrapper);

View File

@ -17,6 +17,7 @@ import com.fuint.business.tag.mapper.TagCodeRecordMapper;
import com.fuint.business.tag.entity.TagCodeRecord;
import com.fuint.business.tag.service.OilTagService;
import com.fuint.business.tag.service.TagCodeRecordService;
import com.fuint.business.tag.service.TagCodeService;
import com.fuint.business.tag.vo.TagCodeRecordVO;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.service.StaffService;
@ -51,6 +52,9 @@ public class TagCodeRecordServiceImpl extends ServiceImpl<TagCodeRecordMapper, T
@Resource
private ILJStaffService mtStaffService;
@Resource
private TagCodeService tagCodeService;
@Override
@Transactional
public boolean add(TagCodeRecordDTO tagCodeRecordDTO) {
@ -59,6 +63,20 @@ public class TagCodeRecordServiceImpl extends ServiceImpl<TagCodeRecordMapper, T
TagCodeRecord tagCodeRecord = new TagCodeRecord();
if (ObjectUtils.isNotEmpty(tagCodeRecordDTO) && CollectionUtils.isNotEmpty(tagCodeRecordDTO.getOilTagList())){
for (Integer integer : tagCodeRecordDTO.getOilTagList()) {
//码牌配置
OilTag byId = oilTagService.getById(integer);
//二维码id
Integer tagCodeId = byId.getTagCodeId();
//二维码
TagCode byId1 = tagCodeService.getById(tagCodeId);
String collection = byId1.getCollection();
String[] storeIds = collection.split("sn");
String s = storeIds[0] + "storeId=" + tagCodeRecordDTO.getStoreId() + "&sn=" + byId1.getTagCodeSn();
//collection += "&storeId=" + tagCodeRecordDTO.getStoreId();
byId1.setCollection(s);
tagCodeService.updateById(byId1);
OilTag oilTag = new OilTag();
//码牌绑定店铺
tagCodeRecord.setOilTagId(integer);

View File

@ -72,7 +72,7 @@ public class TagCodeServiceImpl extends ServiceImpl<TagCodeMapper, TagCode> impl
Random random = new Random();
int i1 = random.nextInt(90000000);
//String url = "https://oil.youkerr.com/";
String url = "https://www.tuofeng.cc/oilStation?sn=byx"+i1;
String url = "https://www.tuofeng.cc/oilRefuel?sn=byx"+i1;
// String finalPath="/temp/qrCode/" + oilTag.getSnCode() + ".jpg";
//String finalPath="D:\\office\\document\\photos\\tagCode\\"+"str"+i+".jpg";
//String finalPath="/temp/tagCode/" + "byx"+i1 + ".jpg";
@ -85,14 +85,14 @@ public class TagCodeServiceImpl extends ServiceImpl<TagCodeMapper, TagCode> impl
tagCode.setDeptId(Integer.parseInt(nowAccountInfo.getDeptId().toString()));
//在图片上生成二维码
String backgroundImage = "static/qrCodeImg/huanyingguanglin2.jpg";
String backgroundImage = "static/qrCodeImg/huanyingguanglin.jpg";
InputStream backgroundStream = this.getClass().getClassLoader().getResourceAsStream(backgroundImage);
String urls = "";
urls = "/temp/tagCode/"+ DateUtil.formatDate(new Date(), "yyyyMMdd") + "-"+i2;
File file1 = new File(urls);
// String finalPath="/temp/tagCode/" + "byx"+i1 + ".jpg";
String finalPath=urls+"/" + "byx"+i1 + ".jpg";
qrCodeUtils.createLogoCodePicture(backgroundStream, null, url, finalPath, null,null,urls);
qrCodeUtils.createLogoCodePictures(null, url, finalPath, null,null,urls);
// 判断目录是否存在
@ -107,13 +107,13 @@ public class TagCodeServiceImpl extends ServiceImpl<TagCodeMapper, TagCode> impl
// 返回图片路径
String saveFile = backendFileController.saveFile(resFile);
//return saveFile;
tagCode.setImageUrl(finalPath);
tagCode.setImageUrl(saveFile);
flag = save(tagCode);
}
//导出码牌
//String IMAGE_DIRECTORY = "D:\\temp\\tagCode\\"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2;
String IMAGE_DIRECTORY = "/temp/tagCode/"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2;
String IMAGE_DIRECTORY = "/temp/tagCode/"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2;
List<File> imageFiles = getImageFiles(IMAGE_DIRECTORY);
InputStream zipInputStream = createZipInputStream(imageFiles);

View File

@ -0,0 +1,12 @@
package com.fuint.business.tag.vo;
import com.fuint.business.tag.entity.OilTag;
import lombok.Data;
import java.io.Serializable;
@Data
public class OilTagVO extends OilTag implements Serializable {
//店铺名字
private String storeName;
}

View File

@ -283,6 +283,12 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
tAccount.setAccountName(accountName);
tAccount.setAccountStatus(Integer.parseInt(accountStatus));
tAccount.setPassword(password);
if (ObjectUtil.isNotEmpty(param.get("deptType")) && "2".equals(param.get("deptType"))){
tAccount.setOwnerId(2);
}
if (ObjectUtil.isNotEmpty(param.get("deptType")) && "3".equals(param.get("deptType"))){
tAccount.setOwnerId(3);
}
tAccount.setIsActive(1);
tAccount.setLocked(0);
if (ObjectUtil.isEmpty(mtStore)) mtStore.setId(0);
@ -498,6 +504,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
account.setPassword(tAccount.getPassword());
account.setStaffId(tAccount.getStaffId());
account.setMobile(tAccount.getMobile());
account.setOwnerId(tAccount.getOwnerId());
this.entryptPassword(account);
int id = tAccountMapper.insert(account);

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.api.R;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.mapper.LJDutyMapper;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
@ -87,10 +88,14 @@ public class BackendLoginController extends BaseController {
@Autowired
public RedisTemplate redisTemplate;
@Resource
private LJDutyMapper ljDutyMapper;
/**
* 后台登录
* */
@ApiOperation(value = "后台登录")
@ApiOperation(value = "油站登录")
@RequestMapping(value="/doLogin", method = RequestMethod.POST)
@OperationServiceLog(description = "登录后台系统")
public ResponseObject doLogin(HttpServletRequest request, @RequestBody LoginRequest loginRequest) {
@ -100,6 +105,71 @@ public class BackendLoginController extends BaseController {
String captchaCode = loginRequest.getCaptchaCode();
String uuid = loginRequest.getUuid();
LambdaQueryWrapper<TAccount> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TAccount::getAccountName, accountName);
TAccount one = accountService.getOne(queryWrapper);
if (ObjectUtils.isNotEmpty(one) && one.getOwnerId().toString().equals("2") ||one.getOwnerId().toString().equals("1") ){
return getFailureResult(201,"请登录终台端!");
}
Boolean captchaVerify = captchaService.checkCodeByUuid(captchaCode, uuid);
if (!captchaVerify) {
return getFailureResult(201,"图形验证码有误");
}
if (StringUtil.isEmpty(accountName)|| StringUtil.isEmpty(password) || StringUtil.isEmpty(captchaCode)) {
return getFailureResult(Constants.HTTP_RESPONSE_CODE_PARAM_ERROR);
} else {
AccountInfo accountInfo = accountService.getAccountByName(loginRequest.getUsername());
if (accountInfo == null) {
return getFailureResult(Constants.HTTP_RESPONSE_CODE_USER_LOGIN_ERROR);
}
TAccount tAccount = accountService.getAccountInfoById(accountInfo.getId());
String myPassword = tAccount.getPassword();
String inputPassword = accountService.getEntryptPassword(password, tAccount.getSalt());
if (!myPassword.equals(inputPassword) || !tAccount.getAccountStatus().toString().equals("1")) {
return getFailureResult(201, "账号或密码有误");
}
Subject subject = SecurityUtils.getSubject();
UsernamePasswordToken info = new UsernamePasswordToken(accountInfo.getAccountName(), tAccount.getPassword());
subject.login(info);
String token = TokenUtil.generateToken(userAgent, accountInfo.getId());
accountInfo.setToken(token);
TokenUtil.saveAccountToken(accountInfo);
LoginResponse response = new LoginResponse();
response.setLogin(true);
response.setToken(token);
response.setTokenCreatedTime(new Date());
return getSuccessResult(response);
}
}
/**
* 后台登录
* */
@ApiOperation(value = "终台登录")
@RequestMapping(value="/doLogins", method = RequestMethod.POST)
@OperationServiceLog(description = "登录后台系统")
public ResponseObject doLogins(HttpServletRequest request, @RequestBody LoginRequest loginRequest) {
String userAgent = request.getHeader("user-agent");
String accountName = loginRequest.getUsername();
String password = loginRequest.getPassword();
String captchaCode = loginRequest.getCaptchaCode();
String uuid = loginRequest.getUuid();
LambdaQueryWrapper<TAccount> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TAccount::getAccountName, accountName);
TAccount one = accountService.getOne(queryWrapper);
if (ObjectUtils.isNotEmpty(one) && one.getOwnerId().toString().equals("3")){
return getFailureResult(201,"请登录油站端!");
}
//不知道是哪个平台过来的请求
/*LambdaQueryWrapper<TAccount> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TAccount::getAccountName, accountName);
ljDutyMapper*/
Boolean captchaVerify = captchaService.checkCodeByUuid(captchaCode, uuid);
if (!captchaVerify) {
return getFailureResult(201,"图形验证码有误");

View File

@ -3,7 +3,7 @@
onLaunch: function(e) {
console.log('App Launch')
// #ifdef MP-WEIXIN
uni.setStorageSync("appltType","WECHAT")
uni.setStorageSync("appltType", "WECHAT")
console.log("微信")
//
uni.getUpdateManager().onCheckForUpdate(function(res) {
@ -39,21 +39,22 @@
});
// #endif
// #ifdef MP-ALIPAY
uni.setStorageSync("appltType","ALIPAY")
uni.setStorageSync("appltType", "ALIPAY")
console.log("支付宝")
my.canIUse('button.open-type.getAuthorize')
//qrCode
if (e.query && e.query.qrCode) {
console.log(JSON.stringify(e)+"1.0")
let q = e.query.qrCode;
console.log(JSON.stringify(e) + "1.0")
let q = e.query.qrCode;
if (e.query.qrCode) {
let str = q.split("?")[1];
let storeId = "";
let staffId = "";
let userId = "";
let type = "";
if (str.includes("&")){
let sn = "";
if (str.includes("&")) {
let arr = str.split("&");
arr.forEach(item => {
if (item.includes("storeId")) {
@ -64,14 +65,17 @@
userId = item.split("=")[1]
} else if (item.includes("type")) {
type = item.split("=")[1]
} else {
sn = item.split("=")[1]
}
})
}else{
} else {
if (str.includes("storeId")) {
storeId = str.split("=")[1]
}
}
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("sn", sn)
uni.setStorageSync("y_type", type)
uni.setStorageSync("y_userId", userId)
uni.setStorageSync("inviteStaffId", staffId)
@ -79,7 +83,7 @@
// title:uni.getStorageSync("storeId") + "staffId" + uni.getStorageSync("inviteStaffId")
// })
}
}
}
// #endif
},
onShow: function() {

View File

@ -28,7 +28,7 @@
</view> -->
</view>
<view v-if="appltType == 'ALIPAY'" style="height: 400px;overflow-y: scroll;">
<view class="fa-box">
<view class="fa-title">选择油号 <text class="top-hui"> 请务必与员工确认类型</text> </view>
@ -74,7 +74,7 @@
<text>立即加油</text>
</view>
</view>
<view v-if="appltType == 'WECHAT'" style="height: 500px;overflow-y: scroll;">
<view class="fa-box">
<view class="fa-title">选择油号 <text class="top-hui"> 请务必与员工确认类型</text> </view>
@ -231,19 +231,24 @@
let storeId = "19";
let staffId = "";
let sn = "";
console.log("115151515:" + str);
if (str.includes("&")) {
let arr = str.split("&");
arr.forEach(item => {
if (item.includes("storeId")) {
storeId = item.split("=")[1]
} else {
} else if (item.includes("staffId")) {
staffId = item.split("=")[1]
} else {
sn = item.split("=")[1]
}
})
} else {
storeId = str.split("=")[1]
}
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("sn", sn)
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId")
@ -360,7 +365,7 @@
method: 'get',
}).then((res) => {
_this.oilNumberList = res.data;
if (res.data.length>0) {
if (res.data.length > 0) {
// _this.getOilGun(res.data[0].numberId);
_this.oilPrice = res.data[0].oilPrice
_this.oilUnit = res.data[0].unit
@ -388,7 +393,7 @@
getStaffList(storeId) {
let _this = this;
request({
url: "business/member/staff/queryList1/"+storeId,
url: "business/member/staff/queryList1/" + storeId,
method: 'get',
}).then((res) => {
_this.staffList = res.data
@ -420,6 +425,7 @@
this.oilOrder.staffId = id
this.oilOrder.oilNum = (this.value / this.oilPrice).toFixed(2)
this.oilOrder.tankId = uni.getStorageSync("tankId")
this.oilOrder.oilTagSn = uni.getStorageSync("sn")
let _this = this;
//
request({
@ -484,7 +490,7 @@
} else {
if (this.value != "" && this.qindex != null) {
this.show = false
if (uni.getStorageSync("inviteStaffId") || this.staffList.length==0) {
if (uni.getStorageSync("inviteStaffId") || this.staffList.length == 0) {
this.toPayment(uni.getStorageSync("inviteStaffId"))
} else {
// this.$refs.popup.open('bottom')
@ -562,7 +568,7 @@
})
}
if (uni.getStorageSync("appltType")== "WECHAT") {
if (uni.getStorageSync("appltType") == "WECHAT") {
// code
wx.login({
success(res) {
@ -587,8 +593,8 @@
}
})
}
if (uni.getStorageSync("appltType")== "ALIPAY") {
if (uni.getStorageSync("appltType") == "ALIPAY") {
my.getAuthCode({
scopes: 'auth_base',
success: res => {
@ -844,4 +850,4 @@
text-align: right;
color: #999999;
}
</style>
</style>