This commit is contained in:
cun-nan 2024-01-18 15:01:26 +08:00
parent d8023ecfba
commit 944b5bbb87
28 changed files with 170 additions and 50 deletions

View File

@ -20,7 +20,7 @@
</el-switch> </el-switch>
</div> </div>
</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"> <div class="content-box">
<!-- <el-card class="box-card" shadow="hover" v-for="(item,index) in 10" :key="index">--> <!-- <el-card class="box-card" shadow="hover" v-for="(item,index) in 10" :key="index">-->
<!-- <div slot="header" class="clearfix">--> <!-- <div slot="header" class="clearfix">-->
@ -75,7 +75,7 @@
</div> </div>
<div class="hangbox" v-for="(item,index) in oilConfigList" :key="item.id"> <div class="hangbox" v-for="(item,index) in oilConfigList" :key="item.id">
<div>{{index + 1}}.通道</div> <div>{{index + 1}}.通道</div>
<div class="jiaong">{{ item.merchantName }}</div> <div class="jiaong">{{ item.merchantName }}({{ item.remark }})</div>
<div> 商户号 </div> <div> 商户号 </div>
<div class="jiaong">{{ item.mchntCd }}</div> <div class="jiaong">{{ item.mchntCd }}</div>
<!-- <div> 交易满 </div>--> <!-- <div> 交易满 </div>-->
@ -161,7 +161,7 @@
<span style="float: left"> <span style="float: left">
<dict-tag :options="dict.type.payment_channel" :value="item.merchantName"/> <dict-tag :options="dict.type.payment_channel" :value="item.merchantName"/>
</span> </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> <span style="float: right; color: #8492a6; font-size: 13px">{{ item.mchntCd }}</span>
</el-option> </el-option>
</el-select> </el-select>

View File

@ -4,6 +4,8 @@ import com.fuint.api.fuyou.entity.OilConfig;
import com.fuint.api.fuyou.service.MerchantConfigService; import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.api.fuyou.service.OilConfigService; import com.fuint.api.fuyou.service.OilConfigService;
import com.fuint.api.fuyou.vo.OilConfigVo; 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.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -52,7 +54,8 @@ public class OilConfigController extends BaseController {
if (isOpen.equals("1")){ if (isOpen.equals("1")){
result = oilConfigService.judgmentProportion(); result = oilConfigService.judgmentProportion();
if (result==1){ if (result==1){
oilConfigService.oilRule(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
oilConfigService.oilRule(nowAccountInfo.getStoreId());
// 开启定时关闭规则 // 开启定时关闭规则
oilConfigService.ruleCycle(ruleCycle); oilConfigService.ruleCycle(ruleCycle);
} }

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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"> <mapper namespace="com.fuint.api.fuyou.mapper.OilConfigMapper">
<sql id="selectOilConfig"> <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 inner join merchant_config mc on oc.merch_config_id = mc.id
</sql> </sql>

View File

@ -13,7 +13,7 @@ public interface OilConfigService extends IService<OilConfig> {
/** /**
* 规则配置 * 规则配置
*/ */
public void oilRule(); public void oilRule(Integer storeId);
/** /**
* 判断占比相加是否为100% 是返回1 不是返回0 * 判断占比相加是否为100% 是返回1 不是返回0

View File

@ -274,7 +274,7 @@ public class FyPayServiceImpl implements FyPayService {
} }
// 修改商户账号余额信息 // 修改商户账号余额信息
Double amount = merchantConfig.getAmount(); Double amount = merchantConfig.getAmount();
merchantConfig.setAmount(amount+allAmount); merchantConfig.setAmount(amount+allAmount/100);
merchantConfigService.updateMerch(merchantConfig); merchantConfigService.updateMerch(merchantConfig);
resMap.put("msg","success"); resMap.put("msg","success");
}else if (reqMap.get("trans_stat").equals("USERPAYING")){ }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(receiveParameter.getStoreId());
// MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(16); // 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(); Const.INS_PUBLIC_KEY = merchantConfig.getPublicKey();

View File

@ -7,8 +7,11 @@ import com.fuint.api.fuyou.entity.FuYouPublicMerchant;
import com.fuint.api.fuyou.entity.MerchantConfig; import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.mapper.MerchantConfigMapper; import com.fuint.api.fuyou.mapper.MerchantConfigMapper;
import com.fuint.api.fuyou.service.MerchantConfigService; import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.api.fuyou.service.OilConfigService;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil; 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 org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -18,6 +21,10 @@ import java.util.List;
*/ */
@Service @Service
public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper, MerchantConfig> implements MerchantConfigService { public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper, MerchantConfig> implements MerchantConfigService {
@Autowired
@Lazy
private OilConfigService oilConfigService;
@Override @Override
public MerchantConfig selectMeChByIsUse(String isUse) { public MerchantConfig selectMeChByIsUse(String isUse) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
@ -28,6 +35,10 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
@Override @Override
public MerchantConfig selectMeChByIdIsUse(int storeId) { public MerchantConfig selectMeChByIdIsUse(int storeId) {
List<MerchantConfig> list = this.selectMeChByIsOpen(storeId);
if (list.size()>0){
oilConfigService.oilRule(storeId);
}
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_use","1"); queryWrapper.eq("is_use","1");
queryWrapper.eq("store_id",storeId); queryWrapper.eq("store_id",storeId);

View File

@ -27,10 +27,10 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
private MerchantConfigService merchantConfigService; private MerchantConfigService merchantConfigService;
@Override @Override
public void oilRule() { public void oilRule(Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); // AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",nowAccountInfo.getStoreId()); queryWrapper.eq("store_id",storeId);
List<OilConfig> list = baseMapper.selectList(queryWrapper); List<OilConfig> list = baseMapper.selectList(queryWrapper);
Double amountAll = 0.0; 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 merchantConfig = merchantConfigService.selectMerchById(list.get(index).getMerchConfigId());
merchantConfig.setIsUse("1"); merchantConfig.setIsUse("1");

View File

@ -7,4 +7,5 @@ import lombok.Data;
public class OilConfigVo extends OilConfig { public class OilConfigVo extends OilConfig {
private String merchantName; private String merchantName;
private String mchntCd; private String mchntCd;
private String remark;
} }

View File

@ -98,6 +98,15 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
@Override @Override
public int insertRecord(CommissionRecord commissionRecord) { 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); return commissionRecordMapper.insert(commissionRecord);
} }

View File

@ -128,6 +128,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
if (unit.equals("%")){ if (unit.equals("%")){
commissionRecord.setAmount(amount*(royaltyRate/100)); commissionRecord.setAmount(amount*(royaltyRate/100));
} }
commissionRecordService.insertRecord(commissionRecord);
} }
} }
// 按照实付金额计算提成 // 按照实付金额计算提成
@ -139,6 +140,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
if (unit.equals("%")){ if (unit.equals("%")){
commissionRecord.setAmount(payAmount*(royaltyRate/100)); commissionRecord.setAmount(payAmount*(royaltyRate/100));
} }
commissionRecordService.insertRecord(commissionRecord);
} }
} }
// 按照加油数量计算提成 // 按照加油数量计算提成
@ -150,9 +152,9 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
if (unit.equals("%")){ if (unit.equals("%")){
commissionRecord.setAmount(oilLiters*(royaltyRate/100)); commissionRecord.setAmount(oilLiters*(royaltyRate/100));
} }
commissionRecordService.insertRecord(commissionRecord);
} }
} }
commissionRecordService.insertRecord(commissionRecord);
} }
if (type.equals("2") && staffCommission.getCommissionSource().equals("非油品") if (type.equals("2") && staffCommission.getCommissionSource().equals("非油品")
&& staff.getRoleId().equals(staffCommission.getStaffRoleGroup())){ && staff.getRoleId().equals(staffCommission.getStaffRoleGroup())){

View File

@ -60,7 +60,7 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
//用户信息 //用户信息
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId(); Integer userId = nowAccountInfo.getId();
LJUserVo ljUserVo = userService.selectUserById(userId); LJUserVo ljUserVo = userService.selectUserById(userId,activeNewlywedsRecords.getStoreId());
//保存新人有礼记录 //保存新人有礼记录
ActiveNewlywedsVO activeNewlyweds = activeNewlywedsService.getOneByStoreId(activeNewlywedsRecords.getStoreId()); ActiveNewlywedsVO activeNewlyweds = activeNewlywedsService.getOneByStoreId(activeNewlywedsRecords.getStoreId());
activeNewlywedsRecords.setActiveNewlywedsId(activeNewlyweds.getId()); activeNewlywedsRecords.setActiveNewlywedsId(activeNewlyweds.getId());

View File

@ -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.service.CardFavorableService;
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO;
import com.fuint.business.petrolStationManagement.service.OilNameService; 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.service.LJUserService;
import com.fuint.business.userManager.vo.LJUserVo; import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
@ -118,7 +119,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
boolean save = false; boolean save = false;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId(); Integer userId = nowAccountInfo.getId();
LJUserVo ljUserVo = userService.selectUserById(userId); LJUser ljUserVo = userService.queryUserByUserId(userId);;
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
//优惠券 //优惠券
for (Integer id : idList.getIdList()) { for (Integer id : idList.getIdList()) {

View File

@ -292,7 +292,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
// 判断是否开启支付规则 // 判断是否开启支付规则
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId); List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
if (list.size()>0){ if (list.size()>0){
oilConfigService.oilRule(); oilConfigService.oilRule(storeId);
} }
// 根据店铺id查询商户配置信息 // 根据店铺id查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId);

View File

@ -398,7 +398,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 判断是否开启支付规则 // 判断是否开启支付规则
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId); List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
if (list.size()>0){ if (list.size()>0){
oilConfigService.oilRule(); oilConfigService.oilRule(storeId);
} }
// 处理支付需要的数据 // 处理支付需要的数据
@ -485,7 +485,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 根据userId查询用户储值卡信息 // 根据userId查询用户储值卡信息
UserBalance balance = userBalanceService.selectUserBalanceByStorId(userId,storeId); UserBalance balance = userBalanceService.selectUserBalanceByStorId(userId,storeId);
// 根据用户id查询用户信息 // 根据用户id查询用户信息
LJUserVo userVo1 = userService.selectUserById(userId); LJUserVo userVo1 = userService.selectUserById(userId,storeId);
// 根据日期生成订单信息 // 根据日期生成订单信息
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
@ -867,7 +867,14 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilOrder.setInvoicing("未开票"); oilOrder.setInvoicing("未开票");
oilOrder.setRemark("未评价"); oilOrder.setRemark("未评价");
oilOrder.setUserId(nowAccountInfo.getId()); 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()); oilOrder.setPayUser(userVo.getMobile());
baseMapper.insert(oilOrder); baseMapper.insert(oilOrder);
@ -1083,6 +1090,13 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo); this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo);
this.addOilTracks(oilOrder,oilOrder.getStoreId()); this.addOilTracks(oilOrder,oilOrder.getStoreId());
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"1",orderNo); staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"1",orderNo);
// 修改配置收款账户余额信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(oilOrder.getStoreId());
Double beforeAmount = merchantConfig.getAmount();
Double afterAmount = beforeAmount + oilOrder.getPayAmount();
merchantConfig.setAmount(afterAmount);
merchantConfigService.updateMerch(merchantConfig);
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo); CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
if (ObjectUtil.isNotEmpty(cashierOrder)){ if (ObjectUtil.isNotEmpty(cashierOrder)){
cashierOrder.setOilOrderId(oilOrder.getId()); cashierOrder.setOilOrderId(oilOrder.getId());
@ -1195,7 +1209,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
int growth = balance.getGrowthValue(); int growth = balance.getGrowthValue();
if (refuelMoney==null){ if (refuelMoney==null){
String refuelMoney1 = balance.getRefuelMoney(); 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 objects = JSONArray.parseArray(refuelMoney);
JSONArray objects1 = JSONArray.parseArray(refuelMoney1); JSONArray objects1 = JSONArray.parseArray(refuelMoney1);
List<RefuelMoney> list = new ArrayList<>(); List<RefuelMoney> list = new ArrayList<>();

View File

@ -52,6 +52,12 @@ public class OilGunController extends BaseController {
return getSuccessResult(oilGunVOS); return getSuccessResult(oilGunVOS);
} }
@GetMapping("selectByNumber/{storeId}")
public ResponseObject selectByNumberTGUn(@PathVariable Integer storeId) {
List<OilGunVO> oilGunVOS = this.oilGunService.selectByNumberTGUn2(storeId);
return getSuccessResult(oilGunVOS);
}
/** /**

View File

@ -103,7 +103,8 @@
</where> </where>
</select> </select>
<select id="getOilName" resultType="com.fuint.business.petrolStationManagement.vo.OilGunVO"> <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 from oil_number onm
left join oil_name name on onm.oil_name = name.id left join oil_name name on onm.oil_name = name.id
<where> <where>

View File

@ -138,7 +138,7 @@
</select> </select>
<select id="selectOilNumberNameByStoreId" resultType="com.fuint.business.petrolStationManagement.vo.OilNumberNameVo" <select id="selectOilNumberNameByStoreId" resultType="com.fuint.business.petrolStationManagement.vo.OilNumberNameVo"
parameterType="java.lang.Integer"> 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_number onu on ot.number_id = onu.number_id
left join oil_name ona on onu.oil_name = ona.id left join oil_name ona on onu.oil_name = ona.id
<where> <where>

View File

@ -37,6 +37,8 @@ public interface OilGunService {
IPage<OilGun> queryByPage(@Param("page") Page page, @Param("oilGun") OilGun oilGun); IPage<OilGun> queryByPage(@Param("page") Page page, @Param("oilGun") OilGun oilGun);
List<OilGunVO> selectByNumberTGUn(OilGun oilGun); List<OilGunVO> selectByNumberTGUn(OilGun oilGun);
List<OilGunVO> selectByNumberTGUn2(Integer storeId);
/** /**
* 新增数据 * 新增数据
* *

View File

@ -81,6 +81,30 @@ public class OilGunServiceImpl implements OilGunService {
return oilName; 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;
}
/** /**
* 新增数据 * 新增数据
* *

View File

@ -23,5 +23,5 @@ public class OilGunVO extends OilGun {
private String unit; // private String unit; //
private Integer storeId; // private Integer storeId; //
private Double oilDensity; //油品密度 private Double oilDensity; //油品密度
private Integer oilNameId;
} }

View File

@ -13,4 +13,6 @@ public class OilNumberNameVo extends OilNumber {
private String tankId; private String tankId;
// 油品id // 油品id
private Integer oilId; private Integer oilId;
// 油罐名称
private String tankName;
} }

View File

@ -1,5 +1,6 @@
package com.fuint.business.storeInformation.service.impl; 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.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.mapper.LJStoreMapper;
import com.fuint.business.storeInformation.service.ILJStoreService; import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.ChainStoreConfig; 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.ChainStoreConfigService;
import com.fuint.business.userManager.service.UserBalanceService;
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 io.swagger.models.auth.In; import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
@ -25,6 +29,10 @@ import java.util.*;
*/ */
@Service @Service
public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> implements ILJStoreService { public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> implements ILJStoreService {
@Autowired
@Lazy
private UserBalanceService userBalanceService;
/** /**
* 根据id查询店铺信息 * 根据id查询店铺信息
* @return * @return
@ -54,7 +62,8 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
@Override @Override
public LJStore selectStoreByStoreId(int storeId) { public LJStore selectStoreByStoreId(int storeId) {
return baseMapper.selectById(storeId); LJStore store = baseMapper.selectById(storeId);
return store;
} }
@Override @Override
@ -66,7 +75,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
LJStore ljStore = new LJStore(); LJStore ljStore = new LJStore();
Double distance = 0.0; Double distance = 0.0;
double earthRadius = 6371; // 地球半径单位为公里 double earthRadius = 6371; // 地球半径单位为公里
if (storeId==null){ if (StringUtils.isEmpty(storeId)){
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("if_delete","0"); queryWrapper.eq("if_delete","0");
queryWrapper.eq("status","qy"); queryWrapper.eq("status","qy");
@ -83,6 +92,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
double min = earthRadius * c; double min = earthRadius * c;
ljStore = list.get(0); ljStore = list.get(0);
storeId = ljStore.getId().toString();
// 计算最小距离 // 计算最小距离
for (int i = 0; i < list.size(); i++){ for (int i = 0; i < list.size(); i++){
@ -99,6 +109,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
if ((earthRadius * c1) < min){ if ((earthRadius * c1) < min){
min = earthRadius * c1; min = earthRadius * c1;
ljStore = list.get(i); ljStore = list.get(i);
storeId = ljStore.getId().toString();
} }
} }
} }
@ -119,6 +130,13 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
ljStore = store; 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<>(); Map<String,Object> map1 = new HashMap<>();
map1.put("distance",distance); map1.put("distance",distance);

View File

@ -109,7 +109,7 @@ public class LJUserController extends BaseController {
*/ */
@GetMapping("/{id}") @GetMapping("/{id}")
public ResponseObject userInfo(@PathVariable Integer id){ public ResponseObject userInfo(@PathVariable Integer id){
LJUserVo user = userService.selectUserById(id); LJUserVo user = userService.selectUserById(id,null);
return getSuccessResult(user); return getSuccessResult(user);
} }

View File

@ -51,7 +51,7 @@ public interface LJUserService extends IService<LJUser> {
* @param id * @param id
* @return * @return
*/ */
public LJUserVo selectUserById(int id); public LJUserVo selectUserById(int id,Integer storeId);
/** /**
* 根据storeId获取连锁店id 根据连锁店id查询用户信息 * 根据storeId获取连锁店id 根据连锁店id查询用户信息

View File

@ -127,9 +127,12 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
* @return * @return
*/ */
@Override @Override
public LJUserVo selectUserById(int id) { public LJUserVo selectUserById(int id,Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); if (storeId==null){
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId()); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
storeId = nowAccountInfo.getStoreId();
}
LJStore store = storeService.selectStoreByStoreId(storeId);
return baseMapper.queryUserByChainStoreId(id,store.getChainStoreId()); return baseMapper.queryUserByChainStoreId(id,store.getChainStoreId());
} }

View File

@ -155,15 +155,9 @@
gbPrice: '0' gbPrice: '0'
}, },
list1: [ 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',
],
list3: [ list3: [
'http://47.95.206.185:83/topbj.png', '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: "", longitude: "",
@ -414,8 +408,7 @@
uni.setStorageSync("chainStoreId", response.data.store uni.setStorageSync("chainStoreId", response.data.store
.chainStoreId) .chainStoreId)
let welfare = response.data.store.welfare let welfare = response.data.store.welfare
if (welfare != undefined && welfare != null && if (welfare) {
welfare != "") {
if (welfare.includes(",")) { if (welfare.includes(",")) {
_this.welfare = response.data.store.welfare _this.welfare = response.data.store.welfare
.split(",") .split(",")
@ -423,6 +416,13 @@
_this.welfare.push(response.data.store.welfare) _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({ // uni.showToast({

View File

@ -15,7 +15,7 @@
</view> </view>
<view class=""> <view class="">
<view class="user-tel" @click="goSetup">{{user.mobile}}</view> <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> size="12"></uni-icons> </view>
</view> </view>
</view> </view>
@ -154,7 +154,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-divider text="蓝鲸智慧加油站" :hairline="true"></u-divider> <u-divider text="来个油惠" :hairline="true"></u-divider>
<tabbar :msg="msg"></tabbar> <tabbar :msg="msg"></tabbar>
</view> </view>
</view> </view>
@ -182,6 +182,7 @@
// url // url
baseUrl: this.$baseUrl, baseUrl: this.$baseUrl,
user: {}, user: {},
store: {},
} }
}, },
@ -194,8 +195,22 @@
this.query.chainStoreId = uni.getStorageSync('chainStoreId') this.query.chainStoreId = uni.getStorageSync('chainStoreId')
this.getUserBalance(); this.getUserBalance();
this.getGiftRecords(); this.getGiftRecords();
this.getStore(uni.getStorageSync("storeId"));
}, },
methods: { methods: {
//
getStore(id) {
let _this = this;
request({
url: "business/storeInformation/store/queryStoreById",
method: 'post',
data: {
"storeId": id
},
}).then((res) => {
_this.store = res.data;
})
},
// //
getUser() { getUser() {
request({ request({

View File

@ -37,7 +37,7 @@
</view> --> </view> -->
<view class="box-oil" v-for="(item,index) in oilNumberList" :key="index" <view class="box-oil" v-for="(item,index) in oilNumberList" :key="index"
:class=" {'xz' :hindex == index }" @click="getHIndex(index,item)"> :class=" {'xz' :hindex == index }" @click="getHIndex(index,item)">
<text>{{item.oilNames}}</text> <text>{{item.oilName}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -291,16 +291,21 @@
getOilNumber(storeId){ getOilNumber(storeId){
let _this = this; let _this = this;
request({ request({
url: "business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId, // url: "business/petrolStationManagement/oilNumber/getOilNumberName/" + storeId,
url: "business/petrolStationManagement/oilGun/selectByNumber/" + storeId,
method: 'get', method: 'get',
}).then((res)=>{ }).then((res)=>{
_this.oilNumberList = res.data; _this.oilNumberList = res.data;
if (res.data != null && res.data!=""){ if (res.data){
_this.getOilGun(res.data[0].numberId); // _this.getOilGun(res.data[0].numberId);
_this.oilPrice = res.data[0].gbPrice _this.oilPrice = res.data[0].gbPrice
_this.oilUnit = res.data[0].unit _this.oilUnit = res.data[0].unit
_this.oilOrder.oils = res.data[0].oilName _this.oilOrder.oils = res.data[0].oilNameId
uni.setStorageSync("tankId",res.data[0].tankId) 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) { getHIndex(index,data) {
this.hindex = index this.hindex = index
// console.log(data) // 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.oilPrice = data.gbPrice
this.oilUnit = data.unit this.oilUnit = data.unit
this.oilOrder.oils = data.oilName this.oilOrder.oils = data.oilNameId
uni.setStorageSync("tankId",data.tankId) uni.setStorageSync("tankId",data.oilGunList[0].tankId)
}, },
// //
getQIndex(index,data) { getQIndex(index,data) {
this.qindex = index this.qindex = index
this.oilOrder.oilGunNum = data.id this.oilOrder.oilGunNum = data.id
uni.setStorageSync("tankId",data.tankId)
}, },
goRefuel() { goRefuel() {
uni.navigateTo({ uni.navigateTo({