This commit is contained in:
cun-nan 2024-01-22 11:51:12 +08:00
parent 63ec546d5c
commit 179f49c58f
19 changed files with 178 additions and 71 deletions

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询成长值记录信息列表
export function listGrowthValueRecord(query) {
return request({
url: '/business/growthValueChange/list',
method: 'get',
params: query
})
}

View File

@ -105,7 +105,6 @@ export default {
}, },
getOilName(){ getOilName(){
oilNumbers().then(res => { oilNumbers().then(res => {
console.log(res)
this.oilNameList = res.data this.oilNameList = res.data
}) })
}, },
@ -123,7 +122,6 @@ export default {
}) })
}, },
changeStatus() { changeStatus() {
console.log("12312312312312312",this.cardList)
if (this.cardList == 'notUse') { if (this.cardList == 'notUse') {
this.queryParams.status = 0 this.queryParams.status = 0
} else if (this.cardList == 'used') { } else if (this.cardList == 'used') {

View File

@ -1,12 +1,23 @@
<template> <template>
<div> <div>
<el-table ref="tables" v-loading="loading" :data="list"> <el-table ref="tables" v-loading="loading" :data="list">
<el-table-column label="所属油站" prop="id" align="center"/> <el-table-column label="所属油站" prop="storeName" align="center">
<el-table-column label="变动时间" align="center"/> <template slot-scope="scope">
<el-table-column label="类型" align="center" prop="userNo"/> <span>{{scope.row.storeName ? scope.row.storeName : storeName}}</span>
<el-table-column label="变动成长值" align="center" prop="name" /> </template>
<el-table-column label="描述" align="center" prop="name" /> </el-table-column>
<el-table-column label="类型" align="center" prop="balance"/> <el-table-column label="变动时间" prop="createTime" align="center"/>
<el-table-column label="类型" align="center" prop="changeType">
<template slot-scope="scope">
<el-tag v-if="scope.row.changeType == 0">减少</el-tag>
<el-tag type="success" v-else>增加</el-tag>
</template>
</el-table-column>
<el-table-column label="变动成长值" align="center" prop="growthValue" />
<el-table-column label="变动后成长值" align="center" prop="afterTheChange" />
<el-table-column label="描述" align="center" prop="fromType" />
</el-table> </el-table>
<pagination <pagination
@ -19,6 +30,9 @@
</template> </template>
<script> <script>
import {listGrowthValueRecord} from "@/api/order/growthvaluerecord";
import {ljStoreInfo} from "@/api/staff/store";
export default { export default {
props:["pUserId"], props:["pUserId"],
data(){ data(){
@ -30,16 +44,30 @@ export default {
queryParams:{ queryParams:{
page:1, page:1,
pageSize:10, pageSize:10,
} },
storeName:"",
} }
}, },
created() { created() {
// this.userId = this.pUserId; // this.userId = this.pUserId;
this.userId = this.$route.query.id; this.userId = this.$route.query.id;
this.getList()
this.getStoreName()
}, },
methods:{ methods:{
getStoreName(){
ljStoreInfo().then(res => {
this.storeName = res.data.name
})
},
getList(){ getList(){
this.loading = true
this.queryParams.userId = this.userId
listGrowthValueRecord(this.queryParams).then(res => {
this.list = res.data.records
this.total = res.data.total
this.loading = false
})
} }
} }
} }

View File

@ -40,15 +40,15 @@
<div style="margin-top: 15px"> <div style="margin-top: 15px">
<span style="color: grey;">成长值计算方式</span> <span style="color: grey;">成长值计算方式</span>
<div style="display: flex;justify-content: space-between"> <div style="display: flex;justify-content: space-between">
<el-input v-model="gasGrowthValue" disabled placeholder="1" style="margin: 10px 10px"> <el-input v-model="gasGrowthValue" disabled style="margin: 10px 10px">
<template slot="prepend">汽油成长值比例,每消费1元积</template> <template slot="prepend">汽油成长值比例,每消费1元积</template>
<template slot="append">成长值</template> <template slot="append">成长值</template>
</el-input> </el-input>
<el-input v-model="dieselGrowthValue" disabled placeholder="1" style="margin: 10px 10px"> <el-input v-model="dieselGrowthValue" disabled style="margin: 10px 10px">
<template slot="prepend">柴油成长值比例,每消费1元积</template> <template slot="prepend">柴油成长值比例,每消费1元积</template>
<template slot="append">成长值</template> <template slot="append">成长值</template>
</el-input> </el-input>
<el-input v-model="naturalGrowthValue" disabled placeholder="1" style="margin: 10px 10px"> <el-input v-model="naturalGrowthValue" disabled style="margin: 10px 10px">
<template slot="prepend">天然气成长值比例,每消费1元积</template> <template slot="prepend">天然气成长值比例,每消费1元积</template>
<template slot="append">成长值</template> <template slot="append">成长值</template>
</el-input> </el-input>
@ -491,11 +491,11 @@ export default {
// //
growthValueRule:[], growthValueRule:[],
// //
gasGrowthValue:'', gasGrowthValue:0,
// //
dieselGrowthValue:'', dieselGrowthValue:0,
// //
naturalGrowthValue:'', naturalGrowthValue:0,
clear:'', clear:'',
// //
loading: true, loading: true,
@ -584,9 +584,15 @@ export default {
// console.log(response) // console.log(response)
this.isEnableLevel = response.data.isEnableLevel; this.isEnableLevel = response.data.isEnableLevel;
this.clear = response.data.isMonthClear; this.clear = response.data.isMonthClear;
this.gasGrowthValue = response.data.gasGrowthValue; if (response.data.gasGrowthValue){
this.dieselGrowthValue = response.data.dieselGrowthValue; this.gasGrowthValue = response.data.gasGrowthValue;
this.naturalGrowthValue = response.data.naturalGrowthValue; }
if (response.data.dieselGrowthValue) {
this.dieselGrowthValue = response.data.dieselGrowthValue;
}
if (response.data.naturalGrowthValue) {
this.naturalGrowthValue = response.data.naturalGrowthValue;
}
if (response.data.isEnableLevel=="no"){ if (response.data.isEnableLevel=="no"){
this.level1 = true; this.level1 = true;
this.level2 = false; this.level2 = false;

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.GrowthValueChange; import com.fuint.business.order.entity.GrowthValueChange;
import com.fuint.business.order.entity.LJOrder; import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.service.GrowthValueChangeService; import com.fuint.business.order.service.GrowthValueChangeService;
import com.fuint.business.order.vo.GrowthValueChangeVo;
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;
@ -27,11 +28,11 @@ public class GrowthValueChangeController extends BaseController {
* @return * @return
*/ */
@GetMapping("/list") @GetMapping("/list")
public ResponseObject list(GrowthValueChange growthValueChange, public ResponseObject list(GrowthValueChangeVo growthValueChange,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo, @RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){ @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize); Page page =new Page(pageNo,pageSize);
IPage<GrowthValueChange> list = growthValueChangeService.selectGrowthValueChangeList(page,growthValueChange); IPage<GrowthValueChangeVo> list = growthValueChangeService.selectGrowthValueChangeList(page,growthValueChange);
return getSuccessResult(list); return getSuccessResult(list);
} }
} }

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.GrowthValueChange; import com.fuint.business.order.entity.GrowthValueChange;
import com.fuint.business.order.vo.GrowthValueChangeVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
public interface GrowthValueChangeMapper extends BaseMapper<GrowthValueChange> { public interface GrowthValueChangeMapper extends BaseMapper<GrowthValueChange> {
@ -13,5 +14,5 @@ public interface GrowthValueChangeMapper extends BaseMapper<GrowthValueChange> {
* @param growthValueChange * @param growthValueChange
* @return * @return
*/ */
public IPage<GrowthValueChange> selectGrowthValueChangeList(@Param("page") Page page,@Param("growthValueChange") GrowthValueChange growthValueChange); public IPage<GrowthValueChangeVo> selectGrowthValueChangeList(@Param("page") Page page, @Param("growthValueChange") GrowthValueChangeVo growthValueChange);
} }

View File

@ -1,12 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!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.business.order.mapper.GrowthValueChangeMapper"> <mapper namespace="com.fuint.business.order.mapper.GrowthValueChangeMapper">
<select id="selectGrowthValueChangeList" resultType="com.fuint.business.order.entity.GrowthValueChange"> <select id="selectGrowthValueChangeList" resultType="com.fuint.business.order.vo.GrowthValueChangeVo">
select * from growth_value_change select gvc.*,ms.name storeName from growth_value_change gvc
left join mt_store ms on store_id = ms.id
<where> <where>
<if test="growthValueChange.storeId != null and growthValueChange.storeId != ''"> <if test="growthValueChange.storeId != null and growthValueChange.storeId != ''">
and store_id = #{growthValueChange.storeId} and gvc.store_id = #{growthValueChange.storeId}
</if>
<if test="growthValueChange.userId != null and growthValueChange.userId != ''">
and gvc.user_id = #{growthValueChange.userId}
</if> </if>
</where> </where>
order by gvc.create_time desc
</select> </select>
</mapper> </mapper>

View File

@ -3,6 +3,7 @@ package com.fuint.business.order.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.GrowthValueChange; import com.fuint.business.order.entity.GrowthValueChange;
import com.fuint.business.order.vo.GrowthValueChangeVo;
public interface GrowthValueChangeService { public interface GrowthValueChangeService {
/** /**
@ -11,7 +12,7 @@ public interface GrowthValueChangeService {
* @param growthValueChange * @param growthValueChange
* @return * @return
*/ */
public IPage<GrowthValueChange> selectGrowthValueChangeList(Page page, GrowthValueChange growthValueChange); public IPage<GrowthValueChangeVo> selectGrowthValueChangeList(Page page, GrowthValueChangeVo growthValueChange);
/** /**
* 根据id查询成长值变化记录信息 * 根据id查询成长值变化记录信息

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.order.entity.GrowthValueChange; import com.fuint.business.order.entity.GrowthValueChange;
import com.fuint.business.order.mapper.GrowthValueChangeMapper; import com.fuint.business.order.mapper.GrowthValueChangeMapper;
import com.fuint.business.order.service.GrowthValueChangeService; import com.fuint.business.order.service.GrowthValueChangeService;
import com.fuint.business.order.vo.GrowthValueChangeVo;
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.stereotype.Service; import org.springframework.stereotype.Service;
@ -13,7 +14,7 @@ import org.springframework.stereotype.Service;
@Service @Service
public class GrowthValueChangeServiceImpl extends ServiceImpl<GrowthValueChangeMapper, GrowthValueChange> implements GrowthValueChangeService { public class GrowthValueChangeServiceImpl extends ServiceImpl<GrowthValueChangeMapper, GrowthValueChange> implements GrowthValueChangeService {
@Override @Override
public IPage<GrowthValueChange> selectGrowthValueChangeList(Page page, GrowthValueChange growthValueChange) { public IPage<GrowthValueChangeVo> selectGrowthValueChangeList(Page page, GrowthValueChangeVo growthValueChange) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
growthValueChange.setStoreId(nowAccountInfo.getStoreId()); growthValueChange.setStoreId(nowAccountInfo.getStoreId());
return baseMapper.selectGrowthValueChangeList(page,growthValueChange); return baseMapper.selectGrowthValueChangeList(page,growthValueChange);

View File

@ -40,9 +40,11 @@ import com.fuint.business.petrolStationManagement.service.OilTankService;
import com.fuint.business.petrolStationManagement.service.OilTrackingService; import com.fuint.business.petrolStationManagement.service.OilTrackingService;
import com.fuint.business.storeInformation.entity.LJStore; import com.fuint.business.storeInformation.entity.LJStore;
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.LJUser; import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.entity.LJUserGrade; import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.service.ChainStoreConfigService;
import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.LJUserService; import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.service.UserBalanceService;
@ -94,6 +96,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
private StaffCommissionService staffCommissionService; private StaffCommissionService staffCommissionService;
@Autowired @Autowired
private GrowthValueChangeService growthValueChangeService; private GrowthValueChangeService growthValueChangeService;
@Autowired
private ChainStoreConfigService chainStoreConfigService;
@Override @Override
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) { public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
@ -556,7 +560,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
baseMapper.insert(order); baseMapper.insert(order);
oilOrder = this.selectOilOrderByOrderNo(orderNo); oilOrder = this.selectOilOrderByOrderNo(orderNo);
this.updateGrowthValue1(0.0, userId, Integer.valueOf(oilOrder.getOils()), refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()), storeId,orderNo); this.updateGrowthValue1(oilAmount,0.0, userId, Integer.valueOf(oilOrder.getOils()), refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()), storeId,orderNo);
this.insertOilBalance(userId,storeId,oilName.getId().toString(),oilName.getOilType(),Double.valueOf(oilOrders.get(i).get("liters").toString()),refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()),orderNo); this.insertOilBalance(userId,storeId,oilName.getId().toString(),oilName.getOilType(),Double.valueOf(oilOrders.get(i).get("liters").toString()),refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()),orderNo);
}else if (refuelMoneyLiters>0 && (Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice<=cardBalance){ }else if (refuelMoneyLiters>0 && (Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice<=cardBalance){
flag = true; flag = true;
@ -593,7 +597,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
baseMapper.insert(order); baseMapper.insert(order);
oilOrder = this.selectOilOrderByOrderNo(orderNo); oilOrder = this.selectOilOrderByOrderNo(orderNo);
this.updateGrowthValue1((Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId,orderNo); this.updateGrowthValue1(oilAmount,(Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId,orderNo);
this.insertOilBalance(userId,storeId,oilName.getId().toString(),oilName.getOilType(),refuelMoneyLiters,0.0,orderNo); this.insertOilBalance(userId,storeId,oilName.getId().toString(),oilName.getOilType(),refuelMoneyLiters,0.0,orderNo);
} else if (cardBalance >= oilAmount){ } else if (cardBalance >= oilAmount){
flag = true; flag = true;
@ -630,7 +634,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
baseMapper.insert(order); baseMapper.insert(order);
oilOrder = this.selectOilOrderByOrderNo(orderNo); oilOrder = this.selectOilOrderByOrderNo(orderNo);
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo); this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
// this.insertCardBalance((Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice,userId,storeId); // this.insertCardBalance((Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice,userId,storeId);
}else { }else {
res.put("error","囤油卡或储值卡余额不足!"); res.put("error","囤油卡或储值卡余额不足!");
@ -672,7 +676,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
baseMapper.insert(order); baseMapper.insert(order);
oilOrder = this.selectOilOrderByOrderNo(orderNo); oilOrder = this.selectOilOrderByOrderNo(orderNo);
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo); this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
} }
} }
@ -757,7 +761,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setSeekZero(0.0); cashierOrder.setSeekZero(0.0);
cashierOrder.setPayType(map.get("payType")); cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder); cashierOrderService.insertCashierOrder(cashierOrder);
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo); this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid"); this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"1",orderNo); staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"1",orderNo);
// this.insertCardBalance(oilAmount,userId,storeId); // this.insertCardBalance(oilAmount,userId,storeId);
@ -808,7 +812,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
* @param oilId 油号id * @param oilId 油号id
* @param refuelMoney 扣除的囤油卡升数 * @param refuelMoney 扣除的囤油卡升数
*/ */
private void updateGrowthValue1(Double oilActualPay,Integer userid,Integer oilId,Double refuelMoney,Integer storeId,String orderNo){ private void updateGrowthValue1(Double oilAmount,Double oilActualPay,Integer userid,Integer oilId,Double refuelMoney,Integer storeId,String orderNo){
OilName oilName = oilNameService.selectOilNameById(oilId); OilName oilName = oilNameService.selectOilNameById(oilId);
// 获取成长值增长数值 // 获取成长值增长数值
Integer gasGrowthValue = null; Integer gasGrowthValue = null;
@ -842,9 +846,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Page page = new Page(1,20); Page page = new Page(1,20);
LJUserGrade ljUserGrade1 = new LJUserGrade(); LJUserGrade ljUserGrade1 = new LJUserGrade();
List<LJUserGrade> records = userGradeService.selectUserGradeAll(storeId); List<LJUserGrade> records = userGradeService.selectUserGradeAll(storeId);
if (oilName.getOilType().equals("汽油")){ ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreByStoreId(storeId);
gasGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("gas_growth_value")); if (oilName.getOilType().equals("汽油") && ObjectUtil.isNotEmpty(chainStoreConfig)){
Integer addVal = (int) (gasGrowthValue * oilActualPay); gasGrowthValue = Integer.valueOf(chainStoreConfig.getGasGrowthValue());
Integer addVal = (int) (gasGrowthValue * oilAmount);
addGrowthVal = addVal; addGrowthVal = addVal;
growthAfter = growth + addVal; growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息 // 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -857,9 +862,9 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
} }
balance.setGrowthValue(growthAfter); balance.setGrowthValue(growthAfter);
}else if(oilName.getOilType().equals("柴油")){ }else if(oilName.getOilType().equals("柴油") && ObjectUtil.isNotEmpty(chainStoreConfig)){
dieselGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("diesel_growth_value")); dieselGrowthValue = Integer.valueOf(chainStoreConfig.getDieselGrowthValue());
Integer addVal = (int) (dieselGrowthValue * oilActualPay); Integer addVal = (int) (dieselGrowthValue * oilAmount);
addGrowthVal = addVal; addGrowthVal = addVal;
growthAfter = growth + addVal; growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息 // 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -872,9 +877,9 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
} }
balance.setGrowthValue(growthAfter); balance.setGrowthValue(growthAfter);
}else{ }else if (oilName.getOilType().equals("天然气") && ObjectUtil.isNotEmpty(chainStoreConfig)){
naturalGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("natural_growth_value")); naturalGrowthValue = Integer.valueOf(chainStoreConfig.getNaturalGrowthValue());
Integer addVal = (int) (naturalGrowthValue * oilActualPay); Integer addVal = (int) (naturalGrowthValue * oilAmount);
addGrowthVal = addVal; addGrowthVal = addVal;
growthAfter = growth + addVal; growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息 // 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -887,7 +892,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
} }
balance.setGrowthValue(growthAfter); balance.setGrowthValue(growthAfter);
} }else {}
// balance.setCardBalance(balance.getCardBalance()-oilActualPay); // balance.setCardBalance(balance.getCardBalance()-oilActualPay);
userBalanceService.updateUserBalance(balance); userBalanceService.updateUserBalance(balance);
@ -1291,9 +1296,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Page page = new Page(1,20); Page page = new Page(1,20);
LJUserGrade ljUserGrade1 = new LJUserGrade(); LJUserGrade ljUserGrade1 = new LJUserGrade();
List<LJUserGrade> records = userGradeService.selectUserGradeAll(storeId); List<LJUserGrade> records = userGradeService.selectUserGradeAll(storeId);
if (oilName.getOilType().equals("汽油")){ ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreByStoreId(storeId);
gasGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("gas_growth_value")); if (oilName.getOilType().equals("汽油") && ObjectUtil.isNotEmpty(chainStoreConfig)){
Integer addVal = (int) (gasGrowthValue * oilActualPay); gasGrowthValue = Integer.valueOf(chainStoreConfig.getGasGrowthValue());
Integer addVal = (int) (gasGrowthValue * oilAmount);
addGrowthVal = addVal; addGrowthVal = addVal;
growthAfter = growth + addVal; growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息 // 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -1306,9 +1312,9 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
} }
balance.setGrowthValue(growthAfter); balance.setGrowthValue(growthAfter);
}else if(oilName.getOilType().equals("柴油")){ }else if(oilName.getOilType().equals("柴油") && ObjectUtil.isNotEmpty(chainStoreConfig)){
dieselGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("diesel_growth_value")); dieselGrowthValue = Integer.valueOf(chainStoreConfig.getDieselGrowthValue());
Integer addVal = (int) (dieselGrowthValue * oilActualPay); Integer addVal = (int) (dieselGrowthValue * oilAmount);
addGrowthVal = addVal; addGrowthVal = addVal;
growthAfter = growth + addVal; growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息 // 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -1321,9 +1327,9 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
} }
balance.setGrowthValue(growthAfter); balance.setGrowthValue(growthAfter);
}else{ }else if (oilName.getOilType().equals("天然气") && ObjectUtil.isNotEmpty(chainStoreConfig)){
naturalGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("natural_growth_value")); naturalGrowthValue = Integer.valueOf(chainStoreConfig.getNaturalGrowthValue());
Integer addVal = (int) (naturalGrowthValue * oilActualPay); Integer addVal = (int) (naturalGrowthValue * oilAmount);
addGrowthVal = addVal; addGrowthVal = addVal;
growthAfter = growth + addVal; growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息 // 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -1336,7 +1342,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
} }
balance.setGrowthValue(growthAfter); balance.setGrowthValue(growthAfter);
} }else {}
// 修改用户成长值 // 修改用户成长值
Integer consumeNum = balance.getConsumeNum(); Integer consumeNum = balance.getConsumeNum();
balance.setConsumeNum(consumeNum+1); balance.setConsumeNum(consumeNum+1);

View File

@ -0,0 +1,10 @@
package com.fuint.business.order.vo;
import com.fuint.business.order.entity.GrowthValueChange;
public class GrowthValueChangeVo extends GrowthValueChange {
/**
* 店铺名称
*/
private String storeName;
}

View File

@ -29,7 +29,9 @@ public class ChainStoreConfigServiceImpl extends ServiceImpl<ChainStoreConfigMap
public ChainStoreConfig selectChainStoreConfigById() { public ChainStoreConfig selectChainStoreConfigById() {
LJStore store = storeService.selectStoreById(); LJStore store = storeService.selectStoreById();
Integer id = store.getChainStoreId(); Integer id = store.getChainStoreId();
return baseMapper.selectById(id); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("chain_store_id",id);
return baseMapper.selectOne(queryWrapper);
} }
/** /**

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询成长值记录信息列表
export function listGrowthValueRecord(query) {
return request({
url: '/business/growthValueChange/list',
method: 'get',
params: query
})
}

View File

@ -209,6 +209,7 @@ export default {
} }
}, },
created() { created() {
// this.userId = this.pUserId;
this.userId = this.$route.query.id; this.userId = this.$route.query.id;
this.getUser() this.getUser()

View File

@ -76,9 +76,9 @@ export default {
} }
}, },
created() { created() {
this.userId = this.pUserId; // this.userId = this.pUserId;
// this.userId = this.$route.query.id; this.userId = this.$route.query.id;
console.log( "111111",this.userId)
this.getList() this.getList()
this.getOilName() this.getOilName()
}, },
@ -109,7 +109,6 @@ export default {
}, },
getOilName(){ getOilName(){
oilNumbers().then(res => { oilNumbers().then(res => {
console.log(res)
this.oilNameList = res.data this.oilNameList = res.data
}) })
}, },
@ -129,7 +128,6 @@ export default {
}) })
}, },
changeStatus() { changeStatus() {
console.log("12312312312312312",this.cardList)
if (this.cardList == 'notUse') { if (this.cardList == 'notUse') {
this.queryParams.status = 0 this.queryParams.status = 0
} else if (this.cardList == 'used') { } else if (this.cardList == 'used') {

View File

@ -1,12 +1,23 @@
<template> <template>
<div> <div>
<el-table ref="tables" v-loading="loading" :data="list"> <el-table ref="tables" v-loading="loading" :data="list">
<el-table-column label="所属油站" prop="id" align="center"/> <el-table-column label="所属油站" prop="storeName" align="center">
<el-table-column label="变动时间" align="center"/> <template slot-scope="scope">
<el-table-column label="类型" align="center" prop="userNo"/> <span>{{scope.row.storeName ? scope.row.storeName : storeName}}</span>
<el-table-column label="变动成长值" align="center" prop="name" /> </template>
<el-table-column label="描述" align="center" prop="name" /> </el-table-column>
<el-table-column label="类型" align="center" prop="balance"/> <el-table-column label="变动时间" prop="createTime" align="center"/>
<el-table-column label="类型" align="center" prop="changeType">
<template slot-scope="scope">
<el-tag v-if="scope.row.changeType == 0">减少</el-tag>
<el-tag type="success" v-else>增加</el-tag>
</template>
</el-table-column>
<el-table-column label="变动成长值" align="center" prop="growthValue" />
<el-table-column label="变动后成长值" align="center" prop="afterTheChange" />
<el-table-column label="描述" align="center" prop="fromType" />
</el-table> </el-table>
<pagination <pagination
@ -19,6 +30,9 @@
</template> </template>
<script> <script>
import {ljStoreInfo} from "@/api/staff/store";
import {listGrowthValueRecord} from "@/api/cashier/growthvaluerecord";
export default { export default {
props:["pUserId"], props:["pUserId"],
data(){ data(){
@ -30,15 +44,31 @@ export default {
queryParams:{ queryParams:{
page:1, page:1,
pageSize:10, pageSize:10,
} },
storeName:""
} }
}, },
created() { created() {
this.userId = this.pUserId; // this.userId = this.pUserId;
this.userId = this.$route.query.id;
this.getList()
this.getStoreName()
}, },
methods:{ methods:{
getList(){
getStoreName(){
ljStoreInfo().then(res => {
this.storeName = res.data.name
})
},
getList(){
this.loading = true
this.queryParams.userId = this.userId
listGrowthValueRecord(this.queryParams).then(res => {
this.list = res.data.records
this.total = res.data.total
this.loading = false
})
} }
} }
} }

View File

@ -84,7 +84,6 @@ export default {
getPayType(){ getPayType(){
getDicts("payment_type").then(res => { getDicts("payment_type").then(res => {
this.payTypeList = res.data this.payTypeList = res.data
console.log(res)
}) })
}, },
// //

View File

@ -45,7 +45,6 @@ export default {
created() { created() {
// this.userId = this.pUserId; // this.userId = this.pUserId;
this.userId = this.$route.query.id; this.userId = this.$route.query.id;
console.log('1212',this.userId)
this.getList() this.getList()
}, },
methods:{ methods:{

View File

@ -35,7 +35,8 @@ export default {
} }
}, },
created() { created() {
this.userId = this.pUserId; // this.userId = this.pUserId;
this.userId = this.$route.query.id;
}, },
methods:{ methods:{
getList(){ getList(){