This commit is contained in:
cun-nan 2024-01-13 10:35:03 +08:00
parent 686a0d2e03
commit 3892bd0e21
16 changed files with 139 additions and 39 deletions

View File

@ -61,3 +61,11 @@ export function oilOrderList(data) {
data: data data: data
}) })
} }
// 根据订单号模糊查询油品订单信息
export function getOilOrderAllAmount(id) {
return request({
url: '/business/oilOrder/getAllAmount/'+id,
method: 'get',
})
}

View File

@ -37,7 +37,7 @@
<dict-tag :options="dict.type.zhzt" :value="form.status"/> <dict-tag :options="dict.type.zhzt" :value="form.status"/>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="加油次数">{{ form.consumeNum }}</el-descriptions-item> <el-descriptions-item label="加油次数">{{ form.consumeNum }}</el-descriptions-item>
<el-descriptions-item label="加油总金额">{{ form.refuelMoney ? form.refuelMoney : "--" }} <el-descriptions-item label="加油总金额">{{ allAmount || 0 }}
</el-descriptions-item> </el-descriptions-item>
<!-- <el-descriptions-item label="所属油站">{{ store.name }}</el-descriptions-item>--> <!-- <el-descriptions-item label="所属油站">{{ store.name }}</el-descriptions-item>-->
<el-descriptions-item label="注册时间">{{ form.createTime }}</el-descriptions-item> <el-descriptions-item label="注册时间">{{ form.createTime }}</el-descriptions-item>
@ -105,7 +105,7 @@
<el-statistic <el-statistic
group-separator="," group-separator=","
:precision="2" :precision="2"
:value="form.refuelMoney" :value="refuelMoney"
title="囤油卡余额" title="囤油卡余额"
> >
<!-- <span></span>--> <!-- <span></span>-->
@ -797,6 +797,7 @@ import {
editCardValueChild, editCardValueChild,
listCardValueChild, listCardValueChildOrder listCardValueChild, listCardValueChildOrder
} from "@/api/staff/user/cardvaluechild"; } from "@/api/staff/user/cardvaluechild";
import {getOilOrderAllAmount} from "@/api/order/oilorder";
export default { export default {
components: { components: {
@ -925,7 +926,10 @@ export default {
id: '', id: '',
// //
form: {}, form: {},
refuelMoney:0,
form1: {}, form1: {},
//
allAmount:0,
// //
store: '', store: '',
// //
@ -975,6 +979,7 @@ export default {
this.getStore(); this.getStore();
this.getCardList() this.getCardList()
this.getOrderList() this.getOrderList()
this.getAllAmount()
}, },
methods: { methods: {
handleQuery(){ handleQuery(){
@ -1054,7 +1059,6 @@ export default {
allFixingLevel().then(res => { allFixingLevel().then(res => {
if (res.code == 200) { if (res.code == 200) {
this.fixingLevelList = res.data this.fixingLevelList = res.data
console.log(res.data)
} }
}) })
}, },
@ -1107,9 +1111,9 @@ export default {
await getCardValueListApi(quy).then(res => { await getCardValueListApi(quy).then(res => {
this.cardValueList = res.data.records; this.cardValueList = res.data.records;
this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance); this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance);
console.log("this.grade.name",this.grade) // console.log("this.grade.name",this.grade)
}) })
console.log("this.cardValueList", this.grade) // console.log("this.cardValueList", this.grade)
if (this.cardValueList.length > 0) { if (this.cardValueList.length > 0) {
// //
@ -1130,7 +1134,7 @@ export default {
// this.cardValueForm.amount = null // this.cardValueForm.amount = null
this.$set(this.cardValueForm, 'amount', data); this.$set(this.cardValueForm, 'amount', data);
console.log("data17.16", this.cardValueForm.amount) // console.log("data17.16", this.cardValueForm.amount)
if (!data) { if (!data) {
this.cardValueForm.amount = '' this.cardValueForm.amount = ''
@ -1241,7 +1245,7 @@ export default {
}, },
// //
async tabOilTypeClick(data) { async tabOilTypeClick(data) {
console.log("aaaaaaaaaaaaaa",data) // console.log("aaaaaaaaaaaaaa",data)
await this.getCardFuelDieselList() await this.getCardFuelDieselList()
this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => { this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => {
@ -1253,7 +1257,7 @@ export default {
}, },
selectOilType(status, oilType) { selectOilType(status, oilType) {
this.tabOilType = oilType; this.tabOilType = oilType;
console.log("453",oilType) // console.log("453",oilType)
this.tabOilTypeClick(oilType); this.tabOilTypeClick(oilType);
}, },
// //
@ -1334,10 +1338,18 @@ export default {
// //
getUser(this.id).then(response => { getUser(this.id).then(response => {
this.form = response.data; this.form = response.data;
console.log(response.data) if (response.data.refuelMoney){
let refuelMoney = JSON.parse(response.data.refuelMoney)
_this.refuelMoney = parseFloat(refuelMoney[0].refuelMoney)
}
this.getGrade(response.data.gradeId); this.getGrade(response.data.gradeId);
}); });
}, },
getAllAmount(){
getOilOrderAllAmount(this.id).then(res => {
this.allAmount = res.data
})
},
// //
getGrade(id) { getGrade(id) {
getUserGradeInfo(id).then(response => { getUserGradeInfo(id).then(response => {
@ -1352,7 +1364,7 @@ export default {
}, },
// //
rechargeCard(index, item) { rechargeCard(index, item) {
console.log("index", index) // console.log("index", index)
// this.cardValueForm.amount = null, // this.cardValueForm.amount = null,
this.cardValueForm.rechargeType = 0 this.cardValueForm.rechargeType = 0
@ -1406,7 +1418,7 @@ export default {
let file = {} let file = {}
// //
file = this.cardFuelDieselList[index] file = this.cardFuelDieselList[index]
console.log("file",file) // console.log("file",file)
this.cardFuelDieselForm.points = file.points this.cardFuelDieselForm.points = file.points
this.cardFuelDieselForm.rechargeBalance = file.rechargeBalance this.cardFuelDieselForm.rechargeBalance = file.rechargeBalance
this.cardFuelDieselForm.oilType = file.oilType this.cardFuelDieselForm.oilType = file.oilType
@ -1488,12 +1500,12 @@ export default {
this.$message.error('请先扫码'); this.$message.error('请先扫码');
return return
} }
console.log("cardFuelDieselForm",this.cardFuelDieselForm) // console.log("cardFuelDieselForm",this.cardFuelDieselForm)
this.cardFuelDieselForm.mtUserId = userForm.id this.cardFuelDieselForm.mtUserId = userForm.id
this.cardFuelDieselForm.name = userForm.name this.cardFuelDieselForm.name = userForm.name
this.cardFuelDieselForm.mobile = userForm.mobile this.cardFuelDieselForm.mobile = userForm.mobile
this.cardFuelDieselForm.authCode = this.authCode this.cardFuelDieselForm.authCode = this.authCode
console.log("this.cardFuelDieselForm",this.cardFuelDieselForm) // console.log("this.cardFuelDieselForm",this.cardFuelDieselForm)
let id; let id;

View File

@ -54,3 +54,12 @@ export function merchantInfo(id) {
method: 'get', method: 'get',
}) })
} }
// 根据id删除商户配置信息
export function deleteMerchant(id) {
return request({
url: '/api/merchantConfig/'+id,
method: 'delete',
})
}

View File

@ -38,9 +38,11 @@
<el-tag v-else effect="dark" type="success" style="float: right">当前使用中</el-tag> <el-tag v-else effect="dark" type="success" style="float: right">当前使用中</el-tag>
</div> </div>
<div>商户编号: {{ item.mchntCd }}</div> <div>商户编号: {{ item.mchntCd }}</div>
<div style="margin-top: 5px"> <div style="margin-top: 5px;display: flex;justify-content: space-between">
<span>
备注: <span style="color: #00afff;margin-left: 3px" @click="editRemark(item.id)">{{ item.remark ? item.remark : "--" }}</span> 备注: <span style="color: #00afff;margin-left: 3px" @click="editRemark(item.id)">{{ item.remark ? item.remark : "--" }}</span>
<span style="margin-left: 150px"> </span>
<span>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -217,7 +219,7 @@
<script> <script>
import { import {
addMerchantApi, addMerchantApi, deleteMerchant,
editMerchant, editMerchant,
editMerchantRemark, editMerchantRemark,
listMerchant, listMerchant,
@ -292,7 +294,14 @@ export default {
}) })
}, },
handleDelete(data){ handleDelete(data){
let name = data.remark ? data.merchantName + "(" + data.remark + ")" : data.merchantName
this.$modal.confirm('是否确认删除"' + name + '"的支付配置信息?').then(function () {
return deleteMerchant(data.id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
}, },
// //
submitRemark(){ submitRemark(){
@ -316,15 +325,27 @@ export default {
console.log("hello world") console.log("hello world")
this.$refs["form1"].validate(valid => { this.$refs["form1"].validate(valid => {
if (valid) { if (valid) {
if (this.form1.id){
editMerchantRemark(this.form1).then(res => {
if (res.data===1){
this.$modal.msgSuccess("修改成功")
this.getList()
this.show = false
}
})
}else {
this.form1.storeId = this.id this.form1.storeId = this.id
addMerchantApi(this.form1).then(res => { addMerchantApi(this.form1).then(res => {
if (res.data == 1){ if (res.data == 1){
this.$modal.msgSuccess("添加成功"); this.$modal.msgSuccess("添加成功");
this.getList() this.getList()
this.dialogVisible = false this.dialogVisible = false
}else {
this.$modal.msgError("添加失败,当前通道未配置")
} }
}) })
} }
}
}) })
}, },
// //

View File

@ -134,13 +134,11 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
public int insertMerch(MerchantConfig merchantConfig) { public int insertMerch(MerchantConfig merchantConfig) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId(); Integer storeId = merchantConfig.getStoreId();
if (ObjectUtil.isEmpty(merchantConfig.getStoreId())) { if (ObjectUtil.isEmpty(merchantConfig.getStoreId())) {
storeId = nowAccountInfo.getStoreId(); storeId = nowAccountInfo.getStoreId();
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// if (ObjectUtil.isEmpty(merchantConfig.getStoreId())) {
merchantConfig.setStoreId(nowAccountInfo.getStoreId());
} }
merchantConfig.setStoreId(storeId);
int row = 0; int row = 0;
if (merchantConfig.getMerchantName().equals("富友")){ if (merchantConfig.getMerchantName().equals("富友")){
merchantConfig.setInsCd(FuYouPublicMerchant.insCd); merchantConfig.setInsCd(FuYouPublicMerchant.insCd);
@ -152,7 +150,7 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
} }
merchantConfig.setAppid(FuYouPublicMerchant.appid); merchantConfig.setAppid(FuYouPublicMerchant.appid);
merchantConfig.setAlipayAppid(FuYouPublicMerchant.alipayAppid); merchantConfig.setAlipayAppid(FuYouPublicMerchant.alipayAppid);
MerchantConfig merchantConfig1 = this.selectMeChByIdIsUse(nowAccountInfo.getStoreId()); MerchantConfig merchantConfig1 = this.selectMeChByIdIsUse(storeId);
if (ObjectUtil.isEmpty(merchantConfig1)){ if (ObjectUtil.isEmpty(merchantConfig1)){
merchantConfig.setIsUse("1"); merchantConfig.setIsUse("1");
}else { }else {

View File

@ -41,6 +41,8 @@ import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.entity.OilBalanceChange; import com.fuint.business.order.entity.OilBalanceChange;
import com.fuint.business.order.service.OilBalanceChangeService; import com.fuint.business.order.service.OilBalanceChangeService;
import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.LJUserMapper; import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.service.UserBalanceService;
@ -93,6 +95,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
private OilBalanceChangeService oilBalanceChangeService; private OilBalanceChangeService oilBalanceChangeService;
@Resource @Resource
private OilNameService oilNameService; private OilNameService oilNameService;
@Autowired
private ILJStoreService storeService;
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
* *
@ -424,8 +428,10 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//订单信息 //订单信息
CardFuleOrders cardFuleOrders = new CardFuleOrders(); CardFuleOrders cardFuleOrders = new CardFuleOrders();
// 店铺信息
LJStore store = storeService.selectStoreByStoreId(cardFuelRecordDTO.getStoreId());
//会员信息 //会员信息
LJUserVo ljUserVo = ljUserMapper.selectUserById(nowAccountInfo.getId()); LJUserVo ljUserVo = ljUserMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId());
//员工信息 //员工信息
LJStaff ljStaff = mtStaffService.selectStaffById(cardFuelRecordDTO.getMtStaffId()); LJStaff ljStaff = mtStaffService.selectStaffById(cardFuelRecordDTO.getMtStaffId());
//查询囤油卡信息 //查询囤油卡信息

View File

@ -10,6 +10,7 @@ import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
import com.fuint.business.marketingActivity.cardGift.service.CardGiftService; import com.fuint.business.marketingActivity.cardGift.service.CardGiftService;
import com.fuint.business.oilDepotConfiguration.entity.OilDepotConfig; import com.fuint.business.oilDepotConfiguration.entity.OilDepotConfig;
import com.fuint.business.oilDepotConfiguration.service.OilDepotConfigService; import com.fuint.business.oilDepotConfiguration.service.OilDepotConfigService;
import com.fuint.business.store.entity.MtStore;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.LJUserMapper; import com.fuint.business.userManager.mapper.LJUserMapper;
@ -175,8 +176,10 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
//更新用户余额 //更新用户余额
Double cardAmount = one.getCardAmount(); Double cardAmount = one.getCardAmount();
//会员信息 //会员信息
LJUserVo ljUserVo = ljUserMapper.selectUserById(userId); // LJUserVo ljUserVo = ljUserMapper.selectUserById(userId);
UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId()); // UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId());
MtStore store = storeService.getById(cardGift.getStoreId());
UserBalance userBalance = userBalanceService.selectUserBalance(userId,store.getChainStoreId());
Double cardBalance = userBalance.getCardBalance(); Double cardBalance = userBalance.getCardBalance();
BigDecimal bigDecimal = BigDecimal.valueOf(cardAmount); BigDecimal bigDecimal = BigDecimal.valueOf(cardAmount);
BigDecimal bigDecimal1 = BigDecimal.valueOf(cardBalance); BigDecimal bigDecimal1 = BigDecimal.valueOf(cardBalance);

View File

@ -41,6 +41,8 @@ import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.order.entity.CardBalanceChange; import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.entity.CashierOrder; import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.service.CardBalanceChangeService; import com.fuint.business.order.service.CardBalanceChangeService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.LJUserMapper; import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.service.UserBalanceService;
@ -111,6 +113,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
private CardFavorableRecordService cardFavorableRecordService; private CardFavorableRecordService cardFavorableRecordService;
@Resource @Resource
private CardExchangeRecordService cardExchangeRecordService; private CardExchangeRecordService cardExchangeRecordService;
@Autowired
private ILJStoreService storeService;
/** /**
* 储值卡充值新增 * 储值卡充值新增
* @param cardValueRecordDTO * @param cardValueRecordDTO
@ -124,8 +128,10 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//订单信息 //订单信息
CardValueOrders cardValueOrders = new CardValueOrders(); CardValueOrders cardValueOrders = new CardValueOrders();
//店铺信息
LJStore store = storeService.selectStoreByStoreId(cardValueRecordDTO.getStoreId());
//会员信息 //会员信息
LJUserVo ljUserVo = ljUserMapper.selectUserById(nowAccountInfo.getId()); LJUserVo ljUserVo = ljUserMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId());
//员工信息 //员工信息
LJStaff ljStaff = mtStaffService.selectStaffById(cardValueRecordDTO.getMtStaffId()); LJStaff ljStaff = mtStaffService.selectStaffById(cardValueRecordDTO.getMtStaffId());
//查询储值卡信息 //查询储值卡信息

View File

@ -243,4 +243,14 @@ public class OilOrderController extends BaseController {
public ResponseObject orderStatistics(OilOrder order){ public ResponseObject orderStatistics(OilOrder order){
return getSuccessResult(orderService.orderStatistics(order)); return getSuccessResult(orderService.orderStatistics(order));
} }
/**
* 根据用户id和店铺id查询当前用户在此店铺消费的所有油品总金额
* @param userId
* @return
*/
@GetMapping("/getAllAmount/{userId}")
public ResponseObject getAllAmount(@PathVariable Integer userId){
return getSuccessResult(orderService.sumOilOrderAmountByUserIdAndStoreId(userId));
}
} }

View File

@ -30,6 +30,13 @@ public interface OilOrderMapper extends BaseMapper<OilOrder> {
List<OilOrderExcel> selectOilOrderListExcel(@Param("order") OilOrder order); List<OilOrderExcel> selectOilOrderListExcel(@Param("order") OilOrder order);
/**
* 根据userId和店铺id查询当前用户在此店铺加油的总金额
* @param userId
* @return
*/
Double sumOilOrderAmountByUserIdAndStoreId(@Param("userId") Integer userId,@Param("storeId") Integer StoreId);
/** /**
* 根据userid查询油品订单信息 * 根据userid查询油品订单信息
* @param page * @param page

View File

@ -435,4 +435,10 @@
</where> </where>
</select> </select>
<select id="sumOilOrderAmountByUserIdAndStoreId" resultType="double">
select sum(order_amount) from oil_order
<where>
user_id = #{userId} and store_id = #{storeId}
</where>
</select>
</mapper> </mapper>

View File

@ -28,6 +28,12 @@ public interface OilOrderService extends IService<OilOrder> {
void export(HttpServletResponse response, OilOrder order); void export(HttpServletResponse response, OilOrder order);
/**
* 根据userId和店铺id查询当前用户在此店铺加油的总金额
* @param userId
* @return
*/
Double sumOilOrderAmountByUserIdAndStoreId(Integer userId);
/** /**
* 根据条件分页查询油品订单信息 * 根据条件分页查询油品订单信息

View File

@ -120,6 +120,12 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
} }
@Override
public Double sumOilOrderAmountByUserIdAndStoreId(Integer userId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
return baseMapper.sumOilOrderAmountByUserIdAndStoreId(userId,nowAccountInfo.getStoreId());
}
@Override @Override
public IPage<OilOrder> selectOilOrderByUserId(Page page, OilOrder order) { public IPage<OilOrder> selectOilOrderByUserId(Page page, OilOrder order) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();

View File

@ -138,10 +138,9 @@
<select id="selectUserById" resultType="com.fuint.business.userManager.vo.LJUserVo" <select id="selectUserById" resultType="com.fuint.business.userManager.vo.LJUserVo"
parameterType="java.lang.Integer"> parameterType="java.lang.Integer">
<include refid="selectUser"></include> select * from mt_user
<where> <where>
mu.id = #{id} mu.id = #{id}
limit 1
</where> </where>
</select> </select>

View File

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

View File

@ -230,7 +230,7 @@
<el-table-column label="会员ID" prop="id" align="center" width="60"/> <el-table-column label="会员ID" prop="id" align="center" width="60"/>
<el-table-column label="头像" align="center" width="70"> <el-table-column label="头像" align="center" width="70">
<template slot-scope="scope"> <template slot-scope="scope">
<img v-if="scope.row.avatar" class="list-avatar" :src="scope.row.avatar"> <img v-if="scope.row.avatar" class="list-avatar" :src="baseUrl + scope.row.avatar">
<img v-else class="list-avatar" src="@/assets/images/avatar.png"> <img v-else class="list-avatar" src="@/assets/images/avatar.png">
</template> </template>
</el-table-column> </el-table-column>
@ -521,6 +521,7 @@
name: "vipList", name: "vipList",
data(){ data(){
return{ return{
baseUrl:process.env.VUE_APP_BASE_API,
// //
officialList:[], officialList:[],
result:{}, result:{},