Merge branch 'master' of https://gitee.com/nny_1/oilSystem
This commit is contained in:
commit
0fe66f0d65
@ -20,7 +20,7 @@
|
||||
</el-switch>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 20px"><el-button type="primary" icon="el-icon-plus" @click="addMerchant">添加商户信息</el-button></div>
|
||||
<!-- <div style="margin-top: 20px"><el-button type="primary" icon="el-icon-plus" @click="addMerchant">添加商户信息</el-button></div>-->
|
||||
<div class="content-box">
|
||||
<!-- <el-card class="box-card" shadow="hover" v-for="(item,index) in 10" :key="index">-->
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
@ -75,7 +75,7 @@
|
||||
</div>
|
||||
<div class="hangbox" v-for="(item,index) in oilConfigList" :key="item.id">
|
||||
<div>{{index + 1}}.通道</div>
|
||||
<div class="jiaong">{{ item.merchantName }}</div>
|
||||
<div class="jiaong">{{ item.merchantName }}({{ item.remark }})</div>
|
||||
<div> 商户号 </div>
|
||||
<div class="jiaong">{{ item.mchntCd }}</div>
|
||||
<!-- <div> 交易满 </div>-->
|
||||
@ -161,7 +161,7 @@
|
||||
<span style="float: left">
|
||||
<dict-tag :options="dict.type.payment_channel" :value="item.merchantName"/>
|
||||
</span>
|
||||
<span style="color: #00ff80">(111({{ item.remark ? item.remark : "--" }}))</span>
|
||||
<span style="color: #30a1ff">({{ item.remark ? item.remark : "--" }})</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mchntCd }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
@ -3,7 +3,9 @@ package com.fuint.api.fuyou.controller;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fuint.api.fuyou.entity.Const;
|
||||
import com.fuint.api.fuyou.entity.MerchantConfig;
|
||||
import com.fuint.api.fuyou.service.FyPayService;
|
||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||
import com.fuint.api.fuyou.util.Utils;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.fuint.business.marketingActivity.cardFule.service.CardFuelRecordService;
|
||||
@ -44,6 +46,9 @@ public class FyPayController {
|
||||
@Lazy
|
||||
private AllOrderInfoService allOrderInfoService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private MerchantConfigService merchantConfigService;
|
||||
@Autowired
|
||||
private RedisLock redisLock;
|
||||
|
||||
// 接收支付平台异步通知的接口
|
||||
@ -67,6 +72,13 @@ public class FyPayController {
|
||||
allOrderInfo.setStatus("paid");
|
||||
allOrderInfo.setPayTime(new Date());
|
||||
allOrderInfoService.updateAllOrderInfo(allOrderInfo);
|
||||
|
||||
// 修改配置收款账户余额信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(allOrderInfo.getStoreId());
|
||||
Double beforeAmount = merchantConfig.getAmount();
|
||||
Double afterAmount = beforeAmount + allOrderInfo.getPayMoney();
|
||||
merchantConfig.setAmount(afterAmount);
|
||||
merchantConfigService.updateMerch(merchantConfig);
|
||||
}
|
||||
|
||||
updateOrderStatus(orderNo,allOrderInfo.getType());
|
||||
|
@ -4,6 +4,8 @@ import com.fuint.api.fuyou.entity.OilConfig;
|
||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||
import com.fuint.api.fuyou.service.OilConfigService;
|
||||
import com.fuint.api.fuyou.vo.OilConfigVo;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
@ -52,7 +54,8 @@ public class OilConfigController extends BaseController {
|
||||
if (isOpen.equals("1")){
|
||||
result = oilConfigService.judgmentProportion();
|
||||
if (result==1){
|
||||
oilConfigService.oilRule();
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
oilConfigService.oilRule(nowAccountInfo.getStoreId());
|
||||
// 开启定时关闭规则
|
||||
oilConfigService.ruleCycle(ruleCycle);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.api.fuyou.mapper.OilConfigMapper">
|
||||
<sql id="selectOilConfig">
|
||||
select oc.*,mc.mchnt_cd,mc.merchant_name from oil_config oc
|
||||
select oc.*,mc.mchnt_cd,mc.merchant_name,mc.remark from oil_config oc
|
||||
inner join merchant_config mc on oc.merch_config_id = mc.id
|
||||
</sql>
|
||||
|
||||
|
@ -13,7 +13,7 @@ public interface OilConfigService extends IService<OilConfig> {
|
||||
/**
|
||||
* 规则配置
|
||||
*/
|
||||
public void oilRule();
|
||||
public void oilRule(Integer storeId);
|
||||
|
||||
/**
|
||||
* 判断占比相加是否为100% 是返回1 不是返回0
|
||||
|
@ -274,7 +274,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
}
|
||||
// 修改商户账号余额信息
|
||||
Double amount = merchantConfig.getAmount();
|
||||
merchantConfig.setAmount(amount+allAmount);
|
||||
merchantConfig.setAmount(amount+allAmount/100);
|
||||
merchantConfigService.updateMerch(merchantConfig);
|
||||
resMap.put("msg","success");
|
||||
}else if (reqMap.get("trans_stat").equals("USERPAYING")){
|
||||
@ -411,7 +411,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId());
|
||||
// MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(16);
|
||||
// 查询用户信息
|
||||
LJUserVo userVo = userService.selectUserById(receiveParameter.getUserId());
|
||||
LJUserVo userVo = userService.selectUserById(receiveParameter.getUserId(), receiveParameter.getStoreId());
|
||||
|
||||
// 公钥
|
||||
Const.INS_PUBLIC_KEY = merchantConfig.getPublicKey();
|
||||
|
@ -7,9 +7,12 @@ import com.fuint.api.fuyou.entity.FuYouPublicMerchant;
|
||||
import com.fuint.api.fuyou.entity.MerchantConfig;
|
||||
import com.fuint.api.fuyou.mapper.MerchantConfigMapper;
|
||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||
import com.fuint.api.fuyou.service.OilConfigService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.RedisLock;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -21,6 +24,10 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper, MerchantConfig> implements MerchantConfigService {
|
||||
@Autowired
|
||||
@Lazy
|
||||
private OilConfigService oilConfigService;
|
||||
|
||||
@Override
|
||||
public MerchantConfig selectMeChByIsUse(String isUse) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
@ -31,6 +38,10 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
|
||||
|
||||
@Override
|
||||
public MerchantConfig selectMeChByIdIsUse(int storeId) {
|
||||
List<MerchantConfig> list = this.selectMeChByIsOpen(storeId);
|
||||
if (list.size()>0){
|
||||
oilConfigService.oilRule(storeId);
|
||||
}
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_use","1");
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
|
@ -27,10 +27,10 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
|
||||
private MerchantConfigService merchantConfigService;
|
||||
|
||||
@Override
|
||||
public void oilRule() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
public void oilRule(Integer storeId) {
|
||||
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
List<OilConfig> list = baseMapper.selectList(queryWrapper);
|
||||
Double amountAll = 0.0;
|
||||
// 百分占比
|
||||
@ -54,7 +54,7 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
|
||||
}
|
||||
}
|
||||
// 将其他使用的账户关掉
|
||||
merchantConfigService.updateMerchOrter(nowAccountInfo.getStoreId());
|
||||
merchantConfigService.updateMerchOrter(storeId);
|
||||
// 改变目前使用账户
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMerchById(list.get(index).getMerchConfigId());
|
||||
merchantConfig.setIsUse("1");
|
||||
|
@ -7,4 +7,5 @@ import lombok.Data;
|
||||
public class OilConfigVo extends OilConfig {
|
||||
private String merchantName;
|
||||
private String mchntCd;
|
||||
private String remark;
|
||||
}
|
||||
|
@ -101,6 +101,15 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
||||
|
||||
@Override
|
||||
public int insertRecord(CommissionRecord commissionRecord) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("staff_id",commissionRecord.getStaffId());
|
||||
queryWrapper.eq("store_id",commissionRecord.getStoreId());
|
||||
queryWrapper.eq("type",commissionRecord.getType());
|
||||
queryWrapper.eq("order_no",commissionRecord.getOrderNo());
|
||||
CommissionRecord commissionRecord1 = commissionRecordMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(commissionRecord1)){
|
||||
return 0;
|
||||
}
|
||||
return commissionRecordMapper.insert(commissionRecord);
|
||||
}
|
||||
|
||||
|
@ -128,6 +128,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
if (unit.equals("%")){
|
||||
commissionRecord.setAmount(amount*(royaltyRate/100));
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
@ -139,6 +140,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
if (unit.equals("%")){
|
||||
commissionRecord.setAmount(payAmount*(royaltyRate/100));
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
// 按照加油数量计算提成
|
||||
@ -150,9 +152,9 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
if (unit.equals("%")){
|
||||
commissionRecord.setAmount(oilLiters*(royaltyRate/100));
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
if (type.equals("2") && staffCommission.getCommissionSource().equals("非油品")
|
||||
&& staff.getRoleId().equals(staffCommission.getStaffRoleGroup())){
|
||||
|
@ -60,7 +60,7 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
|
||||
//用户信息
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer userId = nowAccountInfo.getId();
|
||||
LJUserVo ljUserVo = userService.selectUserById(userId);
|
||||
LJUserVo ljUserVo = userService.selectUserById(userId,activeNewlywedsRecords.getStoreId());
|
||||
//保存新人有礼记录
|
||||
ActiveNewlywedsVO activeNewlyweds = activeNewlywedsService.getOneByStoreId(activeNewlywedsRecords.getStoreId());
|
||||
activeNewlywedsRecords.setActiveNewlywedsId(activeNewlyweds.getId());
|
||||
|
@ -13,6 +13,7 @@ import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableR
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||
import com.fuint.business.userManager.entity.LJUser;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
@ -118,7 +119,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
|
||||
boolean save = false;
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer userId = nowAccountInfo.getId();
|
||||
LJUserVo ljUserVo = userService.selectUserById(userId);
|
||||
LJUser ljUserVo = userService.queryUserByUserId(userId);;
|
||||
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
|
||||
//优惠券
|
||||
for (Integer id : idList.getIdList()) {
|
||||
|
@ -292,7 +292,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
|
||||
// 判断是否开启支付规则
|
||||
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
|
||||
if (list.size()>0){
|
||||
oilConfigService.oilRule();
|
||||
oilConfigService.oilRule(storeId);
|
||||
}
|
||||
// 根据店铺id查询商户配置信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId);
|
||||
|
@ -398,7 +398,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
// 判断是否开启支付规则
|
||||
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
|
||||
if (list.size()>0){
|
||||
oilConfigService.oilRule();
|
||||
oilConfigService.oilRule(storeId);
|
||||
}
|
||||
|
||||
// 处理支付需要的数据
|
||||
@ -485,7 +485,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
// 根据userId查询用户储值卡信息
|
||||
UserBalance balance = userBalanceService.selectUserBalanceByStorId(userId,storeId);
|
||||
// 根据用户id查询用户信息
|
||||
LJUserVo userVo1 = userService.selectUserById(userId);
|
||||
LJUserVo userVo1 = userService.selectUserById(userId,storeId);
|
||||
|
||||
// 根据日期生成订单信息
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
@ -867,7 +867,14 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
oilOrder.setInvoicing("未开票");
|
||||
oilOrder.setRemark("未评价");
|
||||
oilOrder.setUserId(nowAccountInfo.getId());
|
||||
LJUserVo userVo = userService.selectUserById(nowAccountInfo.getId());
|
||||
// 判断当前店铺是否存在此用户的会员信息,没有的话进行添加
|
||||
LJStore store = storeService.selectStoreByStoreId(oilOrder.getStoreId());
|
||||
UserBalance balance = userBalanceService.selectUserBalance(oilOrder.getUserId(), store.getChainStoreId());
|
||||
if (ObjectUtil.isEmpty(balance)){
|
||||
userBalanceService.initBalance(oilOrder.getUserId(),store.getChainStoreId());
|
||||
}
|
||||
|
||||
LJUserVo userVo = userService.selectUserById(oilOrder.getUserId(),oilOrder.getStoreId());
|
||||
oilOrder.setPayUser(userVo.getMobile());
|
||||
baseMapper.insert(oilOrder);
|
||||
|
||||
@ -1083,6 +1090,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo);
|
||||
this.addOilTracks(oilOrder,oilOrder.getStoreId());
|
||||
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"1",orderNo);
|
||||
|
||||
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
|
||||
if (ObjectUtil.isNotEmpty(cashierOrder)){
|
||||
cashierOrder.setOilOrderId(oilOrder.getId());
|
||||
@ -1195,7 +1203,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
int growth = balance.getGrowthValue();
|
||||
if (refuelMoney==null){
|
||||
String refuelMoney1 = balance.getRefuelMoney();
|
||||
if (StringUtils.isNotEmpty(refuelMoney1) && !"null".equals(refuelMoney1)){
|
||||
if (StringUtils.isNotEmpty(refuelMoney1) && !"null".equals(refuelMoney1) && StringUtils.isNotEmpty(refuelMoney)){
|
||||
JSONArray objects = JSONArray.parseArray(refuelMoney);
|
||||
JSONArray objects1 = JSONArray.parseArray(refuelMoney1);
|
||||
List<RefuelMoney> list = new ArrayList<>();
|
||||
|
@ -52,6 +52,12 @@ public class OilGunController extends BaseController {
|
||||
return getSuccessResult(oilGunVOS);
|
||||
}
|
||||
|
||||
@GetMapping("selectByNumber/{storeId}")
|
||||
public ResponseObject selectByNumberTGUn(@PathVariable Integer storeId) {
|
||||
List<OilGunVO> oilGunVOS = this.oilGunService.selectByNumberTGUn2(storeId);
|
||||
return getSuccessResult(oilGunVOS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -103,7 +103,8 @@
|
||||
</where>
|
||||
</select>
|
||||
<select id="getOilName" resultType="com.fuint.business.petrolStationManagement.vo.OilGunVO">
|
||||
select onm.number_id numberId,name.oil_name oilName, name.oil_type oilType,onm.oil_price oilPrice ,onm.gb_price gbPrice, name.oil_density oilDensity,onm.unit unit
|
||||
select onm.number_id numberId,name.oil_name oilName, name.oil_type oilType,onm.oil_price oilPrice ,onm.gb_price gbPrice,
|
||||
name.oil_density oilDensity,onm.unit unit,name.id oilNameId
|
||||
from oil_number onm
|
||||
left join oil_name name on onm.oil_name = name.id
|
||||
<where>
|
||||
|
@ -138,7 +138,7 @@
|
||||
</select>
|
||||
<select id="selectOilNumberNameByStoreId" resultType="com.fuint.business.petrolStationManagement.vo.OilNumberNameVo"
|
||||
parameterType="java.lang.Integer">
|
||||
select onu.*,ona.oil_type,ona.oil_name oilNames,ona.id oilId,ot.id tankId from oil_tank ot
|
||||
select onu.*,ona.oil_type,ona.oil_name oilNames,ona.id oilId,ot.id tankId,ot.tank_name from oil_tank ot
|
||||
left join oil_number onu on ot.number_id = onu.number_id
|
||||
left join oil_name ona on onu.oil_name = ona.id
|
||||
<where>
|
||||
|
@ -37,6 +37,8 @@ public interface OilGunService {
|
||||
IPage<OilGun> queryByPage(@Param("page") Page page, @Param("oilGun") OilGun oilGun);
|
||||
|
||||
List<OilGunVO> selectByNumberTGUn(OilGun oilGun);
|
||||
|
||||
List<OilGunVO> selectByNumberTGUn2(Integer storeId);
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
|
@ -81,6 +81,30 @@ public class OilGunServiceImpl implements OilGunService {
|
||||
return oilName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OilGunVO> selectByNumberTGUn2(Integer storeId) {
|
||||
// 根据店铺id查询所有油类
|
||||
List<OilGunVO> oilName = oilGunDao.getOilName(storeId);
|
||||
OilGun oilGun = new OilGun();
|
||||
oilGun.setStoreId(storeId);
|
||||
oilGun.setStatus("启用");
|
||||
// 根据店铺id查询所有油枪
|
||||
List<OilGun> allList = oilGunDao.getAllList(oilGun);
|
||||
if (oilName.size() <= 0 || allList.size() <= 0){
|
||||
return oilName;
|
||||
}
|
||||
for (OilGunVO oilNumber : oilName) {
|
||||
List<OilGun> oilGunList = new ArrayList<>();
|
||||
for (OilGun gun : allList) {
|
||||
if (oilNumber.getNumberId().equals(gun.getNumberId())) {
|
||||
oilGunList.add(gun);
|
||||
}
|
||||
}
|
||||
oilNumber.setOilGunList(oilGunList);
|
||||
}
|
||||
return oilName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
|
@ -23,5 +23,5 @@ public class OilGunVO extends OilGun {
|
||||
private String unit; //
|
||||
private Integer storeId; //
|
||||
private Double oilDensity; //油品密度
|
||||
|
||||
private Integer oilNameId;
|
||||
}
|
||||
|
@ -13,4 +13,6 @@ public class OilNumberNameVo extends OilNumber {
|
||||
private String tankId;
|
||||
// 油品id
|
||||
private Integer oilId;
|
||||
// 油罐名称
|
||||
private String tankName;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.storeInformation.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -10,12 +11,15 @@ import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.mapper.LJStoreMapper;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.ChainStoreConfig;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.service.ChainStoreConfigService;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.StringUtils;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
@ -25,6 +29,10 @@ import java.util.*;
|
||||
*/
|
||||
@Service
|
||||
public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> implements ILJStoreService {
|
||||
@Autowired
|
||||
@Lazy
|
||||
private UserBalanceService userBalanceService;
|
||||
|
||||
/**
|
||||
* 根据id查询店铺信息
|
||||
* @return
|
||||
@ -54,7 +62,8 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
|
||||
@Override
|
||||
public LJStore selectStoreByStoreId(int storeId) {
|
||||
return baseMapper.selectById(storeId);
|
||||
LJStore store = baseMapper.selectById(storeId);
|
||||
return store;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,7 +75,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
LJStore ljStore = new LJStore();
|
||||
Double distance = 0.0;
|
||||
double earthRadius = 6371; // 地球半径,单位为公里
|
||||
if (storeId==null){
|
||||
if (StringUtils.isEmpty(storeId)){
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("if_delete","0");
|
||||
queryWrapper.eq("status","qy");
|
||||
@ -83,6 +92,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
|
||||
double min = earthRadius * c;
|
||||
ljStore = list.get(0);
|
||||
storeId = ljStore.getId().toString();
|
||||
|
||||
// 计算最小距离
|
||||
for (int i = 0; i < list.size(); i++){
|
||||
@ -99,6 +109,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
if ((earthRadius * c1) < min){
|
||||
min = earthRadius * c1;
|
||||
ljStore = list.get(i);
|
||||
storeId = ljStore.getId().toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -119,6 +130,13 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
|
||||
ljStore = store;
|
||||
}
|
||||
|
||||
// 判断当前店铺是否存在此用户的会员信息,没有的话进行添加
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = this.selectStoreByStoreId(Integer.valueOf(storeId));
|
||||
UserBalance balance = userBalanceService.selectUserBalance(nowAccountInfo.getId(), store.getChainStoreId());
|
||||
if (ObjectUtil.isEmpty(balance)){
|
||||
userBalanceService.initBalance(nowAccountInfo.getId(),store.getChainStoreId());
|
||||
}
|
||||
|
||||
Map<String,Object> map1 = new HashMap<>();
|
||||
map1.put("distance",distance);
|
||||
|
@ -109,7 +109,7 @@ public class LJUserController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseObject userInfo(@PathVariable Integer id){
|
||||
LJUserVo user = userService.selectUserById(id);
|
||||
LJUserVo user = userService.selectUserById(id,null);
|
||||
return getSuccessResult(user);
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public interface LJUserService extends IService<LJUser> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public LJUserVo selectUserById(int id);
|
||||
public LJUserVo selectUserById(int id,Integer storeId);
|
||||
|
||||
/**
|
||||
* 根据storeId获取连锁店id 根据连锁店id查询用户信息
|
||||
|
@ -127,9 +127,12 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LJUserVo selectUserById(int id) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
|
||||
public LJUserVo selectUserById(int id,Integer storeId) {
|
||||
if (storeId==null){
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
storeId = nowAccountInfo.getStoreId();
|
||||
}
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
return baseMapper.queryUserByChainStoreId(id,store.getChainStoreId());
|
||||
}
|
||||
|
||||
|
@ -155,15 +155,9 @@
|
||||
gbPrice: '0'
|
||||
},
|
||||
|
||||
list1: [
|
||||
'http://47.95.206.185:83/topbj.png',
|
||||
'http://47.95.206.185:83/centerbj.png',
|
||||
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
|
||||
],
|
||||
list1: [],
|
||||
list3: [
|
||||
'http://47.95.206.185:83/topbj.png',
|
||||
'http://47.95.206.185:83/centerbj.png',
|
||||
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
|
||||
],
|
||||
// 当前经度信息
|
||||
longitude: "",
|
||||
@ -414,8 +408,7 @@
|
||||
uni.setStorageSync("chainStoreId", response.data.store
|
||||
.chainStoreId)
|
||||
let welfare = response.data.store.welfare
|
||||
if (welfare != undefined && welfare != null &&
|
||||
welfare != "") {
|
||||
if (welfare) {
|
||||
if (welfare.includes(",")) {
|
||||
_this.welfare = response.data.store.welfare
|
||||
.split(",")
|
||||
@ -423,6 +416,13 @@
|
||||
_this.welfare.push(response.data.store.welfare)
|
||||
}
|
||||
}
|
||||
if (response.data.store.doorstepPhoto) {
|
||||
let list = JSON.parse(response.data.store.doorstepPhoto)
|
||||
_this.list3 = [];
|
||||
list.forEach(item => {
|
||||
_this.list3.push(_this.baseUrl + item)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// uni.showToast({
|
||||
|
@ -15,7 +15,7 @@
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="user-tel" @click="goSetup">{{user.mobile}}</view>
|
||||
<view class="user-name" @click="gorefuel">蓝鲸加油站(总站)<uni-icons type="right" color="#c1c1ff"
|
||||
<view class="user-name" @click="gorefuel">{{store.name}}{{store.description ? "("+store.description+")" : ""}}<uni-icons type="right" color="#c1c1ff"
|
||||
size="12"></uni-icons> </view>
|
||||
</view>
|
||||
</view>
|
||||
@ -154,7 +154,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider text="蓝鲸智慧加油站" :hairline="true"></u-divider>
|
||||
<u-divider text="来个油惠" :hairline="true"></u-divider>
|
||||
<tabbar :msg="msg"></tabbar>
|
||||
</view>
|
||||
</view>
|
||||
@ -182,6 +182,7 @@
|
||||
// url信息
|
||||
baseUrl: this.$baseUrl,
|
||||
user: {},
|
||||
store: {},
|
||||
}
|
||||
},
|
||||
|
||||
@ -194,8 +195,22 @@
|
||||
this.query.chainStoreId = uni.getStorageSync('chainStoreId')
|
||||
this.getUserBalance();
|
||||
this.getGiftRecords();
|
||||
this.getStore(uni.getStorageSync("storeId"));
|
||||
},
|
||||
methods: {
|
||||
// 获取门店信息
|
||||
getStore(id) {
|
||||
let _this = this;
|
||||
request({
|
||||
url: "business/storeInformation/store/queryStoreById",
|
||||
method: 'post',
|
||||
data: {
|
||||
"storeId": id
|
||||
},
|
||||
}).then((res) => {
|
||||
_this.store = res.data;
|
||||
})
|
||||
},
|
||||
// 查询当前登录用户信息
|
||||
getUser() {
|
||||
request({
|
||||
|
@ -37,7 +37,7 @@
|
||||
</view> -->
|
||||
<view class="box-oil" v-for="(item,index) in oilNumberList" :key="index"
|
||||
:class=" {'xz' :hindex == index }" @click="getHIndex(index,item)">
|
||||
<text>{{item.oilNames}}</text>
|
||||
<text>{{item.oilName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -291,16 +291,21 @@
|
||||
getOilNumber(storeId){
|
||||
let _this = this;
|
||||
request({
|
||||
url: "business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId,
|
||||
// url: "business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId,
|
||||
url: "business/petrolStationManagement/oilGun/selectByNumber/" + storeId,
|
||||
method: 'get',
|
||||
}).then((res)=>{
|
||||
_this.oilNumberList = res.data;
|
||||
if (res.data != null && res.data!=""){
|
||||
_this.getOilGun(res.data[0].numberId);
|
||||
if (res.data){
|
||||
// _this.getOilGun(res.data[0].numberId);
|
||||
_this.oilPrice = res.data[0].gbPrice
|
||||
_this.oilUnit = res.data[0].unit
|
||||
_this.oilOrder.oils = res.data[0].oilName
|
||||
uni.setStorageSync("tankId",res.data[0].tankId)
|
||||
_this.oilOrder.oils = res.data[0].oilNameId
|
||||
if (res.data[0].oilGunList){
|
||||
_this.oilGunList = res.data[0].oilGunList
|
||||
_this.oilOrder.oilGunNum = res.data[0].oilGunList[0].id
|
||||
uni.setStorageSync("tankId",res.data[0].oilGunList[0].tankId)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -358,16 +363,19 @@
|
||||
getHIndex(index,data) {
|
||||
this.hindex = index
|
||||
// console.log(data)
|
||||
this.getOilGun(data.numberId)
|
||||
// this.getOilGun(data.numberId)
|
||||
this.oilGunList = data.oilGunList
|
||||
this.oilOrder.oilGunNum = data.oilGunList[0].id
|
||||
this.oilPrice = data.gbPrice
|
||||
this.oilUnit = data.unit
|
||||
this.oilOrder.oils = data.oilName
|
||||
uni.setStorageSync("tankId",data.tankId)
|
||||
this.oilOrder.oils = data.oilNameId
|
||||
uni.setStorageSync("tankId",data.oilGunList[0].tankId)
|
||||
},
|
||||
// 选择油枪信息
|
||||
getQIndex(index,data) {
|
||||
this.qindex = index
|
||||
this.oilOrder.oilGunNum = data.id
|
||||
uni.setStorageSync("tankId",data.tankId)
|
||||
},
|
||||
goRefuel() {
|
||||
uni.navigateTo({
|
||||
|
Loading…
Reference in New Issue
Block a user