Merge remote-tracking branch 'origin/master'

This commit is contained in:
@QQNZX 2023-11-11 17:54:12 +08:00
commit 492e53ca49
48 changed files with 1455 additions and 402 deletions

View File

@ -76,15 +76,15 @@
<template v-if="dataForm.refuelSceneRules == 0">
<el-row>
<el-form-item label="消费金额" prop="refuelConsumptionAmount" label-width="90px">
<el-input style="width: 500px;" v-model="dataForm.refuelConsumptionAmount" placeholder="">
<el-form-item label="消费金额" prop="refuelFuelAmount" label-width="90px">
<el-input style="width: 500px;" v-model="dataForm.refuelFuelAmount" placeholder="">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="积多少分" prop="refuelPoints" label-width="90px">
<el-input style="width: 500px;" v-model="dataForm.refuelPoints" placeholder="">
<el-input style="width: 500px;" v-model.number="dataForm.refuelPoints" placeholder="">
<template slot="append"></template>
</el-input>
</el-form-item>
@ -94,16 +94,18 @@
<div class="conten-bottom">
<div v-for="(item, index) in dataForm.refuelConsumptionAmount" class="cardbox">
<div style="height:40px; ">
<span>92#汽油</span>
<span>{{ item.oilName }}</span>
</div>
<div style=" width: 99%;height: 99%;">
<el-form-item label="消费金额" prop="refuelPointsRules" label-width="90px">
<el-input style="width: 200px;" v-model="dataForm.refuelPointsRules" placeholder="">
<el-form-item label="消费金额" prop="amount" label-width="90px">
<el-input style="width: 200px;" v-model="item.amount" placeholder="">
<!-- {{ item.amount }} -->
<template slot="append"></template>
</el-input>
</el-form-item>
<el-form-item label="积多少分" prop="refuelPointsRules" label-width="90px">
<el-input style="width: 200px;" v-model="dataForm.refuelPointsRules" placeholder="">
<el-form-item label="积多少分" prop="points" label-width="90px">
<el-input style="width: 200px;" v-model.number="item.integral" placeholder="">
<!-- {{ parseInt(item.integral) }} -->
<template slot="append">积分</template>
</el-input>
</el-form-item>
@ -118,14 +120,14 @@
</el-form>
</div>
</el-tab-pane>
<el-tab-pane label="充值积分" name="second">
<!-- <el-tab-pane label="充值积分" name="second">
<div>
<el-alert
title="充值赠送积分详细规则请在充值活动对应规则内配置"
type="warning"
show-icon>
</el-alert>
<el-form :model="refuelForm" ref="refuelForm" :rules="rules" size="small" :inline="true" label-width="100px">
<el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true" label-width="100px">
<el-row>
<el-form-item label="充值赠送" prop="rechargeGive" >
<el-radio-group v-model="dataForm.rechargeGive">
@ -136,7 +138,7 @@
</el-row>
</el-form>
</div>
</el-tab-pane>
</el-tab-pane> -->
<el-tab-pane label="邀请用户" name="third">
<div>
<el-alert
@ -144,7 +146,7 @@
type="info"
show-icon>
</el-alert>
<el-form :model="refuelForm" ref="refuelForm" :rules="rules" size="small" :inline="true" label-width="100px">
<el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true" label-width="100px">
<el-row>
<el-form-item label="邀请赠送" prop="inviteGive" >
<el-radio-group v-model="dataForm.inviteGive">
@ -154,8 +156,8 @@
</el-form-item>
</el-row>
<el-row>
<el-form-item label="充值赠送" prop="inviteGiveRules" >
<el-input v-model="dataForm.inviteGiveRules" placeholder="">
<el-form-item label="充值赠送" prop="rechargeGive" >
<el-input v-model.number="dataForm.rechargeGive" placeholder="">
<template slot="prepend">每邀请一人赠送</template>
<template slot="append">积分</template>
@ -178,7 +180,7 @@
<div style="width: 100%; margin-top: 20px;">
<el-form-item style="width: 24%" v-for="item, index in dataForm.pointsObtained" :key="index" :prop="'pointsObtained' + index" :label="item.day">
<el-input v-model="item.integral" placeholder="">
<el-input v-model.number="item.integral" placeholder="">
<template slot="append">积分</template>
</el-input>
</el-form-item>
@ -207,16 +209,17 @@
</el-tab-pane>
<el-tab-pane label="积分规则" name="five">
<div>
<el-form :model="refuelForm" ref="refuelForm" :rules="rules" size="small" :inline="true" label-width="100px">
<el-form :model="dataForm" ref="dataForm" :rules="rules" size="small" :inline="true" label-width="100px">
<!-- <el-row> -->
<span style="margin-bottom: 20px;">积分说明</span>
<Editor style="margin-top: 20px;"></Editor>
<editor style="margin-top: 20px;" @input="handleChildValue" :value.default="dataForm.pointsRules" :height.default="500"></editor>
<!-- </el-row> -->
</el-form>
</div>
</el-tab-pane>
</el-tabs>
<div style="float: right; margin-bottom: 20px;">
<div style="float: right;margin-top: 20px; margin-bottom: 20px;">
<el-button type="primary" @click="submit"> </el-button>
</div>
</div>
@ -225,19 +228,69 @@
</template>
<script>
import {getSettingsApi,insertSettingsApi } from "@/api/integral/settings";
import Editor from '@/components/Editor/index'
import {getSettingsApi,updateSettingsApi } from "@/api/integral/settings";
import editor from '@/components/Editor/index'
export default {
name: "index",
components: {Editor},
// components: {Editor},
data() {
var valiNumberPass = (rule, value, callback) => {//
parseFloat(value).toFixed(2)
let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
if (value === '') {
callback(new Error('请输入内容'));
} else if (!reg.test(value)) {
callback(new Error('请输入数字'));
} else {
callback();
}
};
return {
activeName: 'first',
rules:{},
rules:{
refuelPointsRules:[
{ required: true, message: '请选择积分规则', trigger: 'change' }
],
refuelSceneType:[
{ required: true, message: '请选择场景类型', trigger: 'change' }
],
refuelAmountType:[
{ required: true, message: '请选择金额类型', trigger: 'change' }
],
refuelValueParticipation:[
{ required: true, message: '请选择储值参与', trigger: 'change' }
],
refuelSceneRules:[
{ required: true, message: '请选择场景规则', trigger: 'change' }
],
refuelFuelAmount: [
{ required: true, validator:valiNumberPass, trigger: "blur" }
],
refuelPoints: [
{ required: true, message: '输入积分', trigger: "blur" },
{ type: 'number', message: '积分必须为数字值'}
],
// amount:[
// {required: true,
// validator: (rule, value, callback) => this.valiNumberPass(rule, value, callback, 'amount'),
// trigger: 'blur'
// }
// ],
rechargeGive:[
{ required: true, message: '输入积分', trigger: "blur" },
{ type: 'number', message: '积分必须为数字值'}
],
// points: [
// { required: true}
// ],
},
dataForm: {
// ID
id: null,
@ -312,11 +365,6 @@ export default {
},
refuelForm:{
refuelPointsRules:'',
},
signInForm: {}
}
@ -325,29 +373,54 @@ export default {
this.getData()
},
methods: {
handleChildValue(value) {
console.log("vale",value)
this.dataForm.pointsRules = value
},
getData() {
this.dataForm.pointsObtained = JSON.stringify(this.dataForm.pointsObtained);
let file = this.dataForm
file.pointsObtained = JSON.stringify(file.pointsObtained);
file.refuelConsumptionAmount = JSON.stringify(file.refuelConsumptionAmount);
getSettingsApi(this.dataForm).then(res=>{
this.dataForm = res.data
this.dataForm.pointsObtained = JSON.parse(this.dataForm.pointsObtained)
this.dataForm.refuelConsumptionAmount = JSON.parse(res.data.refuelConsumptionAmount)
})
},
submit() {
this.dataForm.pointsObtained = JSON.stringify(this.dataForm.pointsObtained);
insertSettingsApi(this.dataForm).then(res=>{
let file = this.dataForm
file.pointsObtained = JSON.stringify(file.pointsObtained);
file.refuelConsumptionAmount = JSON.stringify(file.refuelConsumptionAmount);
this.dataForm = {}
updateSettingsApi(file).then(res=>{
this.$modal.msgSuccess("添加成功");
this.dataForm = {}
res.data.pointsObtained = JSON.parse(res.data.pointsObtained)
res.data.refuelConsumptionAmount = JSON.parse(res.data.refuelConsumptionAmount)
this.dataForm = res.data
}).catch(res=>{
this.$modal.msgSuccess("添加失败");
})
// this.getData()
},
cancel() {},
handleClick(tab, event) {
console.log(tab, event);
}
}
},
valiNumberPass(rule, value, callback, fieldName) {
this.$nextTick(() => {
// value
console.log(`Validating ${fieldName}:`, value);
});
},
}
</script>

View File

@ -7,15 +7,16 @@ import com.fuint.api.fuyou.entity.Const;
import com.fuint.api.fuyou.entity.Message;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.util.Utils;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.entity.OilOrder;
import com.fuint.business.order.service.CashierOrderService;
import com.fuint.business.order.service.LJOrderService;
import com.fuint.business.order.service.OilOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
@ -25,6 +26,8 @@ public class FyPayServiceImpl implements FyPayService {
private LJOrderService goodsOrderService;
@Autowired
private OilOrderService oilOrderService;
@Autowired
private CashierOrderService cashierOrderService;
/**
* 条码支付
@ -112,9 +115,8 @@ public class FyPayServiceImpl implements FyPayService {
if (Utils.verifySign(reqMap, str)){
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(orderNo);
LJOrder goodsOrder = goodsOrderService.selectGoodsOrder(orderNo);
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
Date date = new Date();
// SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
// dateFormat.format(date);
if (reqMap.get("trans_stat").equals("SUCCESS")){
if (!ObjectUtil.isEmpty(oilOrder)){
oilOrder.setOrderStatus("paid");
@ -123,6 +125,9 @@ public class FyPayServiceImpl implements FyPayService {
if (!ObjectUtil.isEmpty(goodsOrder)){
goodsOrder.setStatus("paid");
}
if (!ObjectUtil.isEmpty(cashierOrder)){
cashierOrder.setStatus("paid");
}
resMap.put("msg","success");
}else if (reqMap.get("trans_stat").equals("USERPAYING")){
resMap.put("msg","unpaid");
@ -133,6 +138,9 @@ public class FyPayServiceImpl implements FyPayService {
if (!ObjectUtil.isEmpty(goodsOrder)){
goodsOrder.setStatus("payFail");
}
if (!ObjectUtil.isEmpty(cashierOrder)){
cashierOrder.setStatus("payFail");
}
}
if (!ObjectUtil.isEmpty(oilOrder)){
oilOrderService.updateOilOrder(oilOrder);
@ -140,6 +148,9 @@ public class FyPayServiceImpl implements FyPayService {
if (!ObjectUtil.isEmpty(goodsOrder)){
goodsOrderService.updateGoodOrder(goodsOrder);
}
if (!ObjectUtil.isEmpty(cashierOrder)){
cashierOrderService.updateCashierOrder(cashierOrder);
}
}
}catch (Exception e){
log.error(e.getMessage());

View File

@ -3,6 +3,7 @@ package com.fuint.business.convenienceSore.controller;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.convenienceSore.dto.LJGoodsDto;
import com.fuint.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.framework.web.BaseController;
@ -117,4 +118,15 @@ public class LJGoodsController extends BaseController {
public ResponseObject edit(@Validated @RequestBody LJGoods goods){
return getSuccessResult(goodsService.updateLJGoods(goods));
}
/**
* 修改该商品库存
* @param goods
* @return
*/
@PostMapping("editGoodsInventory")
public ResponseObject editGoodsInventory(@RequestBody LJGoodsDto goods){
return getSuccessResult(goodsService.editGoodsInventory(goods));
}
}

View File

@ -0,0 +1,16 @@
package com.fuint.business.convenienceSore.dto;
import com.fuint.business.convenienceSore.entity.LJGoods;
import lombok.Data;
@Data
public class LJGoodsDto extends LJGoods {
// 库存变动
private Integer numberOfChanges;
private Integer stockId;
// 变动原因
private String document;
}

View File

@ -15,4 +15,6 @@ public interface LJGoodsMapper extends BaseMapper<LJGoods> {
* @return
*/
public IPage<LJGoods> selectLJGoodsList(Page page, @Param("goods") LJGoods goods);
}

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.convenienceSore.dto.LJGoodsDto;
import com.fuint.business.convenienceSore.entity.LJGoods;
import java.util.List;
@ -70,4 +71,7 @@ public interface LJGoodsService extends IService<LJGoods> {
* @return
*/
public int updateLJGoods(LJGoods goods);
boolean editGoodsInventory(LJGoodsDto goods);
}

View File

@ -53,4 +53,8 @@ public interface StockStatisticService extends IService<StockStatistic> {
* @return
*/
public void deleteStock(Integer goodsId);
public int editStock(StockStatistic stock);
}

View File

@ -1,11 +1,13 @@
package com.fuint.business.convenienceSore.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.convenienceSore.dto.LJGoodsDto;
import com.fuint.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.entity.StockStatistic;
import com.fuint.business.convenienceSore.entity.StockTrack;
@ -14,12 +16,19 @@ import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.convenienceSore.service.StockStatisticService;
import com.fuint.business.convenienceSore.service.StockTrackService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.math.BigDecimal;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ExecutionException;
/**
* 商品信息 业务层
@ -174,4 +183,77 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
int row = baseMapper.updateById(goods);
return row;
}
@Override
@Transactional
public boolean editGoodsInventory(LJGoodsDto goods) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
goods.setStoreId(storeId);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",goods.getId());
queryWrapper.eq("store_id",goods.getStoreId());
LJGoods ljGoods = baseMapper.selectOne(queryWrapper);
// 变动库存
if (ObjectUtil.isEmpty(ljGoods)) {
return false;
}
goods.setBuyingPrice(ljGoods.getBuyingPrice());
if (!ObjectUtil.isEmpty(ljGoods.getStock()) && !ObjectUtil.isEmpty(goods.getNumberOfChanges())) {
goods.setStock(ljGoods.getStock() + goods.getNumberOfChanges());
if (goods.getStock()>0) {
// 修改该库存
int i = baseMapper.updateById(goods);
if (i>0) {
// 添加统计信息
StockStatistic stockStatistic = stockService.selectStockByGoodsId(goods.getId().intValue());
goods.setStockId(stockStatistic.getId());
boolean b = addStockStatistic(goods);
if (!ObjectUtil.isEmpty(stockStatistic)) {
// 添加库存跟踪信息
if (!ObjectUtil.isEmpty(stockStatistic.getId())){
goods.setStockId(stockStatistic.getId());
addStockTrack(goods);
return true;
}
}
}
} else {
try {
throw new Exception("剩余库存已小于0");
} catch (Exception e) {
e.printStackTrace();
}
}
}
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return false;
}
// 添加统计信息
public boolean addStockStatistic(LJGoodsDto goods) {
StockStatistic stock = new StockStatistic();
stock.setId(goods.getId());
BigDecimal Price = new BigDecimal(goods.getBuyingPrice());
BigDecimal Stock = new BigDecimal(goods.getStock());
BigDecimal multiply = Price.multiply(Stock);
stock.setCostAmount(multiply.doubleValue());
int i = stockService.editStock(stock);
return i>0;
}
// 添加库存跟踪信息
public boolean addStockTrack(LJGoodsDto goods) {
StockTrack stockTrack = new StockTrack();
stockTrack.setStockId(goods.getStockId());
stockTrack.setStoreId(goods.getStoreId());
stockTrack.setDocument(goods.getDocument());
stockTrack.setChangeNumber(goods.getNumberOfChanges());
int i = trackService.insertStockTrack(stockTrack);
return i>0;
}
}

View File

@ -91,4 +91,11 @@ public class StockStatisticServiceImpl extends ServiceImpl<StockStatisticMapper,
queryWrapper.eq("goods_id",goodsId);
baseMapper.delete(queryWrapper);
}
@Override
public int editStock(StockStatistic stock) {
return baseMapper.updateById(stock);
}
}

View File

@ -1,5 +1,6 @@
package com.fuint.business.convenienceSore.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -8,6 +9,7 @@ import com.fuint.business.convenienceSore.entity.StockTrack;
import com.fuint.business.convenienceSore.mapper.StockTrackMapper;
import com.fuint.business.convenienceSore.service.StockTrackService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
@ -43,7 +45,7 @@ public class StockTrackServiceImpl extends ServiceImpl<StockTrackMapper, StockTr
*/
@Override
public int insertStockTrack(StockTrack stockTrack) {
if (stockTrack.getOddNumber()!=null && stockTrack.getOddNumber()!=""){
if (StringUtils.isEmpty(stockTrack.getOddNumber())){
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String timestamp = dateFormat.format(new Date());
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);

View File

@ -0,0 +1,93 @@
package com.fuint.business.integral.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.integral.entity.IntegralDetail;
import com.fuint.business.integral.service.IntegralDetailService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.web.bind.annotation.*;
import io.lettuce.core.dynamic.annotation.Param;
import javax.annotation.Resource;
/**
* 积分明细表(IntegralDetail)表控制层
*
* @author wangh
* @since 2023-11-10 17:52:32
*/
@RestController
@RequestMapping("integralDetail")
public class IntegralDetailController extends BaseController {
/**
* 服务对象
*/
@Resource
private IntegralDetailService integralDetailService;
/**
* 分页查询
*
* @param integralDetail 筛选条件
* @param pageNo 分页对象
* @return 查询结果
*/
@GetMapping("queryByPage")
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("integralDetail") IntegralDetail integralDetail) {
Page page = new Page(pageNo, pageSize);
IPage< IntegralDetail> iPageList = this.integralDetailService.queryByPage(page, integralDetail);
return getSuccessResult(iPageList);
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResponseObject queryById(@PathVariable("id") Integer id) {
return getSuccessResult(this.integralDetailService.queryById(id));
}
/**
* 新增数据
*
* @param integralDetail 实体
* @return 新增结果
*/
@PostMapping
public ResponseObject add(@RequestBody IntegralDetail integralDetail) {
return getSuccessResult(this.integralDetailService.insert(integralDetail));
}
/**
* 编辑数据
*
* @param integralDetail 实体
* @return 编辑结果
*/
@PutMapping
public ResponseObject edit(@RequestBody IntegralDetail integralDetail) {
return getSuccessResult(this.integralDetailService.update(integralDetail));
}
/**
* 删除数据
*
* @param id 主键
* @return 删除是否成功
*/
@DeleteMapping
public ResponseObject deleteById(Integer id) {
return getSuccessResult(this.integralDetailService.deleteById(id));
}
}

View File

@ -110,5 +110,29 @@ public class IntegralOrdersController extends BaseController {
public ResponseObject statistics() {
return getSuccessResult(this.integralOrdersService.statistics());
}
/**
*
* 礼品订单
*
* 判断积分是否足够
*
* 增加订单之前首先判断是否还存在 库存
*
* 增加积分订单
*
* 减去积分商城库存
*
* 减去商品库存
*
* 减去用户积分
*
*/
@PostMapping("integralOrdersProcessing")
public ResponseObject integralOrdersProcessing(@RequestBody IntegralOrders integralOrders) {
return getSuccessResult(this.integralOrdersService.integralOrdersProcessing(integralOrders));
}
}

View File

@ -0,0 +1,74 @@
package com.fuint.business.integral.entity;
import java.util.Date;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
/**
* 积分明细表(IntegralDetail)实体类
*
* @author wangh
* @since 2023-11-10 17:52:33
*/
@Data
public class IntegralDetail extends BaseEntity {
private static final long serialVersionUID = 263718830208700746L;
/**
* 积分明细ID
*/
private Integer id;
/**
* 用户ID表示积分变动的用户
*/
private Integer userId;
/**
* 积分变动的数量可以是正数表示增加负数表示减少
*/
private Integer pointsChange;
/**
* 变动后用户的当前积分总数
*/
private Integer currentPoints;
/**
* 变动类型
*/
private String type;
/**
* 积分变动的原因用于记录变动的具体原因或业务场景
*/
private String changeReason;
/**
* 店铺ID
*/
private Integer storeId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private String createBy;
/**
* 更新人
*/
private String updateBy;
}

View File

@ -44,7 +44,7 @@ public class IntegralSettings extends BaseEntity {
/**
* 加油消费金额
*/
private Double refuelConsumptionAmount;
private String refuelConsumptionAmount;
/**
* 加油积分
*/

View File

@ -0,0 +1,85 @@
package com.fuint.business.integral.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.integral.entity.IntegralDetail;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* 积分明细表(IntegralDetail)表数据库访问层
*
* @author wangh
* @since 2023-11-10 17:52:33
*/
public interface IntegralDetailMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
IntegralDetail queryById(Integer id);
/**
* 查询指定行数据
*
* @param integralDetail 查询条件
* @param page 分页对象
* @return 对象列表
*/
IPage<IntegralDetail> queryAllByLimit(@Param("page") Page page, IntegralDetail integralDetail);
/**
* 统计总行数
*
* @param integralDetail 查询条件
* @return 总行数
*/
long count(IntegralDetail integralDetail);
/**
* 新增数据
*
* @param integralDetail 实例对象
* @return 影响行数
*/
int insert(IntegralDetail integralDetail);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<IntegralDetail> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<IntegralDetail> entities);
/**
* 批量新增或按主键更新数据MyBatis原生foreach方法
*
* @param entities List<IntegralDetail> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常请自行校验入参
*/
int insertOrUpdateBatch(@Param("entities") List<IntegralDetail> entities);
/**
* 修改数据
*
* @param integralDetail 实例对象
* @return 影响行数
*/
int update(IntegralDetail integralDetail);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

@ -0,0 +1,185 @@
<?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">
<mapper namespace="com.fuint.business.integral.mapper.IntegralDetailMapper">
<resultMap type="com.fuint.business.integral.entity.IntegralDetail" id="IntegralDetailMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="userId" column="user_id" jdbcType="INTEGER"/>
<result property="pointsChange" column="points_change" jdbcType="INTEGER"/>
<result property="currentPoints" column="current_points" jdbcType="INTEGER"/>
<result property="type" column="type" jdbcType="VARCHAR"/>
<result property="changeReason" column="change_reason" jdbcType="VARCHAR"/>
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="IntegralDetailMap">
select
id, user_id, points_change, current_points, type, change_reason, store_id, create_time, update_time, create_by, update_by
from integral_detail
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="IntegralDetailMap">
select
id, user_id, points_change, current_points, type, change_reason, store_id, create_time, update_time, create_by, update_by
from integral_detail
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="pointsChange != null">
and points_change = #{pointsChange}
</if>
<if test="currentPoints != null">
and current_points = #{currentPoints}
</if>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="changeReason != null and changeReason != ''">
and change_reason = #{changeReason}
</if>
<if test="storeId != null">
and store_id = #{storeId}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createBy != null and createBy != ''">
and create_by = #{createBy}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from integral_detail
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="pointsChange != null">
and points_change = #{pointsChange}
</if>
<if test="currentPoints != null">
and current_points = #{currentPoints}
</if>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="changeReason != null and changeReason != ''">
and change_reason = #{changeReason}
</if>
<if test="storeId != null">
and store_id = #{storeId}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createBy != null and createBy != ''">
and create_by = #{createBy}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into integral_detail(user_id, points_change, current_points, type, change_reason, store_id, create_time, update_time, create_by, update_by)
values (#{userId}, #{pointsChange}, #{currentPoints}, #{type}, #{changeReason}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into integral_detail(user_id, points_change, current_points, type, change_reason, store_id, create_time, update_time, create_by, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.userId}, #{entity.pointsChange}, #{entity.currentPoints}, #{entity.type}, #{entity.changeReason}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into integral_detail(user_id, points_change, current_points, type, change_reason, store_id, create_time, update_time, create_by, update_by)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.userId}, #{entity.pointsChange}, #{entity.currentPoints}, #{entity.type}, #{entity.changeReason}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
</foreach>
on duplicate key update
user_id = values(user_id),
points_change = values(points_change),
current_points = values(current_points),
type = values(type),
change_reason = values(change_reason),
store_id = values(store_id),
create_time = values(create_time),
update_time = values(update_time),
create_by = values(create_by),
update_by = values(update_by)
</insert>
<!--通过主键修改数据-->
<update id="update">
update integral_detail
<set>
<if test="userId != null">
user_id = #{userId},
</if>
<if test="pointsChange != null">
points_change = #{pointsChange},
</if>
<if test="currentPoints != null">
current_points = #{currentPoints},
</if>
<if test="type != null and type != ''">
type = #{type},
</if>
<if test="changeReason != null and changeReason != ''">
change_reason = #{changeReason},
</if>
<if test="storeId != null">
store_id = #{storeId},
</if>
<if test="updateTime != null">
update_time = NOW(),
</if>
<if test="createBy != null and createBy != ''">
create_by = #{createBy},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from integral_detail where id = #{id}
</delete>
</mapper>

View File

@ -10,7 +10,7 @@
<result property="refuelAmountType" column="refuel_amount_type" jdbcType="VARCHAR"/>
<result property="refuelValueParticipation" column="refuel_value_participation" jdbcType="VARCHAR"/>
<result property="refuelSceneRules" column="refuel_scene_rules" jdbcType="VARCHAR"/>
<result property="refuelConsumptionAmount" column="refuel_consumption_amount" jdbcType="NUMERIC"/>
<result property="refuelConsumptionAmount" column="refuel_consumption_amount" jdbcType="VARCHAR"/>
<result property="refuelPoints" column="refuel_points" jdbcType="INTEGER"/>
<result property="refuelFuelAmount" column="refuel_fuel_amount" jdbcType="NUMERIC"/>
<result property="refuelFuelVolume" column="refuel_fuel_volume" jdbcType="NUMERIC"/>
@ -125,7 +125,7 @@
<!--查询指定行数据-->
<select id="getSettings" resultMap="IntegralSettingsMap">
select
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_by, update_by
from integral_settings
<where>
store_id = #{integralSettings.storeId}
@ -180,22 +180,22 @@
<update id="update">
update integral_settings
<set>
<if test="refuelPointsRules != null and refuelPointsRules != ''">
<if test="refuelPointsRules != null and refuelPointsRules != '' or refuelPointsRules == 0">
refuel_points_rules = #{refuelPointsRules},
</if>
<if test="refuelPointsFunction != null and refuelPointsFunction != ''">
<if test="refuelPointsFunction != null and refuelPointsFunction != '' or refuelAmountType == 0">
refuel_points_function = #{refuelPointsFunction},
</if>
<if test="refuelSceneType != null and refuelSceneType != ''">
<if test="refuelSceneType != null and refuelSceneType != '' or refuelSceneType == 0">
refuel_scene_type = #{refuelSceneType},
</if>
<if test="refuelAmountType != null and refuelAmountType != ''">
<if test="refuelAmountType != null and refuelAmountType != '' or refuelAmountType == 0">
refuel_amount_type = #{refuelAmountType},
</if>
<if test="refuelValueParticipation != null and refuelValueParticipation != ''">
<if test="refuelValueParticipation != null and refuelValueParticipation != '' or refuelValueParticipation == 0">
refuel_value_participation = #{refuelValueParticipation},
</if>
<if test="refuelSceneRules != null and refuelSceneRules != ''">
<if test="refuelSceneRules != null and refuelSceneRules != '' or refuelValueParticipation == 0">
refuel_scene_rules = #{refuelSceneRules},
</if>
<if test="refuelConsumptionAmount != null">
@ -216,29 +216,26 @@
<if test="inviteGive != null">
invite_give = #{inviteGive},
</if>
<if test="inviteGiveRules != null and inviteGiveRules != ''">
<if test="inviteGiveRules != null ">
invite_give_rules = #{inviteGiveRules},
</if>
<if test="signInFunction != null and signInFunction != ''">
<if test="signInFunction != null">
sign_in_function = #{signInFunction},
</if>
<if test="signInRules != null and signInRules != ''">
<if test="signInRules != null">
sign_in_rules = #{signInRules},
</if>
<if test="pointsObtained != null and pointsObtained != ''">
<if test="pointsObtained != null">
points_obtained = #{pointsObtained},
</if>
<if test="pointsRules != null and pointsRules != ''">
<if test="pointsRules != null">
points_rules = #{pointsRules},
</if>
<if test="storeId != null">
store_id = #{storeId},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
update_time = NOW(),
</if>
<if test="createBy != null">
create_by = #{createBy},

View File

@ -0,0 +1,58 @@
package com.fuint.business.integral.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.integral.entity.IntegralDetail;
import io.lettuce.core.dynamic.annotation.Param;
/**
* 积分明细表(IntegralDetail)表服务接口
*
* @author wangh
* @since 2023-11-10 17:52:52
*/
public interface IntegralDetailService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
IntegralDetail queryById(Integer id);
/**
* 分页查询
*
* @param integralDetail 筛选条件
* @param page 分页对象
* @return 查询结果
*/
IPage<IntegralDetail> queryByPage(@Param("page") Page page, IntegralDetail integralDetail);
/**
* 新增数据
*
* @param integralDetail 实例对象
* @return 实例对象
*/
IntegralDetail insert(IntegralDetail integralDetail);
/**
* 修改数据
*
* @param integralDetail 实例对象
* @return 实例对象
*/
IntegralDetail update(IntegralDetail integralDetail);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Integer id);
}

View File

@ -41,6 +41,7 @@ public interface IntegralOrdersService {
* @return 实例对象
*/
IntegralOrders insert(IntegralOrders integralOrders);
IntegralOrders integralOrdersProcessing(IntegralOrders integralOrders);
/**
* 修改数据

View File

@ -0,0 +1,92 @@
package com.fuint.business.integral.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.integral.entity.IntegralDetail;
import com.fuint.business.integral.mapper.IntegralDetailMapper;
import com.fuint.business.integral.service.IntegralDetailService;
import org.springframework.stereotype.Service;
import com.fuint.common.util.TokenUtil;
import io.lettuce.core.dynamic.annotation.Param;
import com.fuint.common.dto.AccountInfo;
import javax.annotation.Resource;
/**
* 积分明细表(IntegralDetail)表服务实现类
*
* @author wangh
* @since 2023-11-10 17:52:52
*/
@Service("integralDetailService")
public class IntegralDetailServiceImpl implements IntegralDetailService {
@Resource
private IntegralDetailMapper integralDetailMapper;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public IntegralDetail queryById(Integer id) {
return this.integralDetailMapper.queryById(id);
}
/**
* 分页查询
*
* @param integralDetail 筛选条件
* @param page 分页对象
* @return 查询结果
*/
@Override
public IPage<IntegralDetail> queryByPage(@Param("page") Page page, IntegralDetail integralDetail) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
integralDetail.setStoreId(nowAccountInfo.getStoreId());
return this.integralDetailMapper.queryAllByLimit(page, integralDetail);
}
/**
* 新增数据
*
* @param integralDetail 实例对象
* @return 实例对象
*/
@Override
public IntegralDetail insert(IntegralDetail integralDetail) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
integralDetail.setStoreId(nowAccountInfo.getStoreId());
this.integralDetailMapper.insert(integralDetail);
return integralDetail;
}
/**
* 修改数据
*
* @param integralDetail 实例对象
* @return 实例对象
*/
@Override
public IntegralDetail update(IntegralDetail integralDetail) {
this.integralDetailMapper.update(integralDetail);
return this.queryById(integralDetail.getId());
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Integer id) {
return this.integralDetailMapper.deleteById(id) > 0;
}
}

View File

@ -67,6 +67,11 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
return integralOrders;
}
@Override
public IntegralOrders integralOrdersProcessing(IntegralOrders integralOrders) {
return null;
}
/**
* 修改数据
*

View File

@ -1,11 +1,17 @@
package com.fuint.business.integral.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.business.integral.entity.IntegralGift;
import com.fuint.business.integral.entity.IntegralSettings;
import com.fuint.business.integral.mapper.IntegralSettingsMapper;
import com.fuint.business.integral.service.IntegralSettingsService;
import com.fuint.business.petrolStationManagement.entity.OilNumber;
import com.fuint.business.petrolStationManagement.mapper.OilNumberMapper;
import org.springframework.stereotype.Service;
import com.fuint.common.util.TokenUtil;
import io.lettuce.core.dynamic.annotation.Param;
@ -14,6 +20,10 @@ import com.fuint.common.dto.AccountInfo;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 积分设置表(IntegralSettings)表服务实现类
@ -26,6 +36,8 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
@Resource
private IntegralSettingsMapper integralSettingsMapper;
@Resource
private OilNumberMapper oilNumberMapper;
/**
* 通过ID查询单条数据
*
@ -51,16 +63,41 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
return integralSettingsMapper.queryAllByLimit(page,integralSettings);
}
/**
* 查询店铺的数据
*
* @return 实例对象
*/
@Override
public IntegralSettings getSettings(IntegralSettings integralSettings) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
integralSettings.setStoreId(nowAccountInfo.getStoreId());
IntegralSettings settings = this.integralSettingsMapper.getSettings(integralSettings);
if (settings != null) {
return settings;
if (ObjectUtil.isEmpty(settings)) {
// 查询店铺所有的存油
List<OilNumber> oilName = oilNumberMapper.getOilName(nowAccountInfo.getStoreId());
if (!CollUtil.isEmpty(oilName)) {
List<Map<String, Object>> refuelConsumptionAmountList = new ArrayList<>();
for (OilNumber oilNumber : oilName) {
Map<String, Object> refuelConsumptionAmountMap = new HashMap<>();
refuelConsumptionAmountMap.put("oilName",oilNumber.getOilName()+oilNumber.getOilType());
refuelConsumptionAmountMap.put("amount",0);
refuelConsumptionAmountMap.put("integral",0);
refuelConsumptionAmountList.add(refuelConsumptionAmountMap);
}
String refuelConsumptionAmount = JSON.toJSONString(refuelConsumptionAmountList);
integralSettings.setRefuelConsumptionAmount(refuelConsumptionAmount);
}
insert(integralSettings);
return integralSettings;
}
insert(integralSettings);
return integralSettings;
return settings;
}
/**
@ -74,8 +111,10 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
integralSettings.setStoreId(nowAccountInfo.getStoreId());
integralSettings.setCreateBy(nowAccountInfo.getStaffId().toString());
this.integralSettingsMapper.insert(integralSettings);
IntegralSettings settings = this.integralSettingsMapper.getSettings(integralSettings);
if (ObjectUtil.isEmpty(settings)) {
this.integralSettingsMapper.insert(integralSettings);
}
return integralSettings;
}

View File

@ -0,0 +1,39 @@
package com.fuint.business.order.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.service.CashierOrderService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 收银员订单信息 controller层
*/
@RestController
@RequestMapping("/business/cashierOrder")
public class CashierOrderController extends BaseController {
@Autowired
private CashierOrderService cashierOrderService;
/**
* 根据条件分页查询收银员订单信息
* @param order
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/list")
public ResponseObject list(CashierOrder order,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<CashierOrder> list = cashierOrderService.selectCashierOrderList(page,order);
return getSuccessResult(list);
}
}

View File

@ -48,4 +48,20 @@ public class LJOrderController extends BaseController {
LJOrder ljOrder = orderService.selectGoodsOrder(orderNo);
return getSuccessResult(ljOrder);
}
/**
* 根据订单号查询订单信息
* @param map
* @return
*/
@PostMapping("/id")
public ResponseObject goodsOrderInfo(@Validated @RequestBody Map<String,String> map){
String id = map.get("id");
LJOrder ljOrder = null;
if (id != null && !id.equals("")){
Integer orderId = Integer.valueOf(id);
ljOrder = orderService.selectGoodsOrderById(orderId);
}
return getSuccessResult(ljOrder);
}
}

View File

@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@ -57,4 +58,15 @@ public class OilOrderController extends BaseController {
OilOrder order = orderService.selectOilOrderByOrderNo(orderNo);
return getSuccessResult(order);
}
/**
* 根据订单号模糊查询订单信息
* @param map
* @return
*/
@PostMapping("/orderNos")
public ResponseObject oilOrders(@Validated @RequestBody Map<String,String> map){
String orderNo = map.get("orderNo");
List<OilOrder> list = orderService.selectOilOrder(orderNo);
return getSuccessResult(list);
}
}

View File

@ -1,43 +1,71 @@
package com.fuint.business.order.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fuint.framework.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.io.Serializable;
/**
* 收银台订单表(CashierOrder)实体类
*/
@Data
public class CashierOrder {
// 油品id
private Integer oilId;
// 商品id
private Integer goodId;
// 订单号
private String orderNo;
// 油品实付金额
private Double oilPayAmount;
// 商品实付金额
private Double goodsPayAmount;
// 油品订单金额
private Double oilOrderAmount;
// 商品订单金额
private Double goodsOrderAmount;
// 油品优惠金额
private Double oilDiscountAmount;
// 商品优惠金额
private Double goodsDiscountAmount;
// 付款用户
@TableName("cashier_order")
@ApiModel(value = "CashierOrder对象", description = "收银台订单表")
public class CashierOrder extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
/**
* 员工id
*/
private Integer staffId;
/**
* 店铺id
*/
private Integer storeId;
/**
* 油品订单id
*/
private Integer oilOrderId;
/**
* 商品订单id
*/
private Integer goodsOrderId;
/**
* 付款用户
*/
private String payUser;
// 付款类型
private String payType;
// 支付时间
/**
* 订单号
*/
private String orderNo;
/**
* 订单金额
*/
private Double amount;
/**
* 实付金额
*/
private Double payAmount;
/**
* 订单状态已支付未支付支付失败
*/
private String status;
/**
* 支付时间
*/
private Date payTime;
// 油品金额
private Double orderAmount;
// 油号
private String oils;
// 油枪号
private Integer oilGunNum;
// 油品数量
private Double oilNum;
// 油品单价
private Double oilPrice;
}

View File

@ -0,0 +1,17 @@
package com.fuint.business.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.CashierOrder;
import org.apache.ibatis.annotations.Param;
public interface CashierOrderMapper extends BaseMapper<CashierOrder> {
/**
* 根据条件分页查询订单信息
* @param page
* @param order
* @return
*/
public IPage<CashierOrder> selectCashierOrderList(Page page, @Param("order") CashierOrder order);
}

View File

@ -0,0 +1,27 @@
<?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">
<mapper namespace="com.fuint.business.order.mapper.CashierOrderMapper">
<sql id="selectOrders">
select * from cashier_order
</sql>
<select id="selectCashierOrderList" resultType="com.fuint.business.order.entity.CashierOrder">
<include refid="selectOrders"></include>
<where>
store_id = #{order.storeId}
<if test="order.staffId != null and order.staffId != ''">
and staff_id = #{order.staffId}
</if>
<if test="order.orderNo != null and order.orderNo != ''">
and order_no like concat('%', #{order.orderNo}, '%')
</if>
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{order.params.beginTime},'%y%m%d')
</if>
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')
</if>
</where>
</select>
</mapper>

View File

@ -35,4 +35,5 @@
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,40 @@
package com.fuint.business.order.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.order.entity.CashierOrder;
/**
* 收银员订单信息 业务层
*/
public interface CashierOrderService extends IService<CashierOrder> {
/**
* 根据条件分页查询订单信息
* @param page
* @param order
* @return
*/
public IPage<CashierOrder> selectCashierOrderList(Page page, CashierOrder order);
/**
* 根据订单号查询商品订单信息
* @param orderNo
* @return
*/
public CashierOrder selectCashierOrder(String orderNo);
/**
* 添加商品订单信息
* @param order
* @return
*/
public int insertCashierOrder(CashierOrder order);
/**
* 修改商品订单信息
* @param order
* @return
*/
public int updateCashierOrder(CashierOrder order);
}

View File

@ -24,6 +24,13 @@ public interface LJOrderService extends IService<LJOrder> {
*/
public LJOrder selectGoodsOrder(String orderNo);
/**
* 根据订单号查询商品订单信息
* @param id
* @return
*/
public LJOrder selectGoodsOrderById(Integer id);
/**
* 添加商品订单信息
* @param order

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.order.entity.OilOrder;
import java.util.List;
import java.util.Map;
/**
@ -26,6 +27,13 @@ public interface OilOrderService extends IService<OilOrder> {
*/
public OilOrder selectOilOrderByOrderNo(String orderNo);
/**
* 根据订单号模糊查询商品订单信息
* @param orderNo
* @return
*/
public List<OilOrder> selectOilOrder(String orderNo);
/**
* 添加油品订单信息
* @param map

View File

@ -0,0 +1,44 @@
package com.fuint.business.order.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.mapper.CashierOrderMapper;
import com.fuint.business.order.service.CashierOrderService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
@Service
public class CashierOrderServiceImpl extends ServiceImpl<CashierOrderMapper, CashierOrder> implements CashierOrderService {
@Override
public IPage<CashierOrder> selectCashierOrderList(Page page, CashierOrder order) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
order.setStoreId(storeId);
IPage<CashierOrder> cashierOrderIPage = baseMapper.selectCashierOrderList(page, order);
return cashierOrderIPage;
}
@Override
public CashierOrder selectCashierOrder(String orderNo) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_no",orderNo);
CashierOrder cashierOrder = baseMapper.selectOne(queryWrapper);
return cashierOrder;
}
@Override
public int insertCashierOrder(CashierOrder order) {
int row = baseMapper.insert(order);
return row;
}
@Override
public int updateCashierOrder(CashierOrder order) {
int row = baseMapper.updateById(order);
return row;
}
}

View File

@ -30,6 +30,12 @@ public class LJOrderServiceImpl extends ServiceImpl<LJOrderMapper, LJOrder> impl
return ljOrder;
}
@Override
public LJOrder selectGoodsOrderById(Integer id) {
LJOrder ljOrder = baseMapper.selectById(id);
return ljOrder;
}
@Override
public int insertGoodOrder(LJOrder order) {
int row = baseMapper.insert(order);

View File

@ -10,10 +10,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.entity.OilOrder;
import com.fuint.business.order.entity.OrderGoods;
import com.fuint.business.order.mapper.OilOrderMapper;
import com.fuint.business.order.service.CashierOrderService;
import com.fuint.business.order.service.LJOrderService;
import com.fuint.business.order.service.OilOrderService;
import com.fuint.business.order.service.OrderGoodsService;
@ -39,6 +41,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
private MerchantConfigService merchantConfigService;
@Autowired
private UserBalanceService userBalanceService;
@Autowired
private CashierOrderService cashierOrderService;
@Override
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
@ -57,6 +61,14 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
return order;
}
@Override
public List<OilOrder> selectOilOrder(String orderNo) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.like("order_no",orderNo+"%");
List list = baseMapper.selectList(queryWrapper);
return list;
}
@Override
public Map<String,Object> insertOilOrder(Map<String ,String> map) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
@ -131,6 +143,19 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
String orderNo = timestamp+randomString;
// 添加收银台订单信息
CashierOrder cashierOrder = new CashierOrder();
cashierOrder.setStaffId(staffId);
cashierOrder.setStoreId(storeId);
cashierOrder.setPayUser(payUser);
cashierOrder.setAmount(oilAmount+goodsAmount);
cashierOrder.setPayAmount(oilActualPay+goodsActualPay);
cashierOrder.setStatus(payStatus);
if (payType.equals("CASH")){
cashierOrder.setPayTime(new Date());
}
cashierOrder.setOrderNo(orderNo);
OilOrder oilOrder1 = null;
LJOrder ljOrder1 = null;
// 添加油品订单信息
@ -244,10 +269,13 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
LJOrder goodsOrder1 = orderService.selectGoodsOrder(orderNo);
if (!ObjectUtil.isEmpty(oilOrder2)){
orders.put("oilOrder",oilOrder2);
cashierOrder.setOilOrderId(oilOrder2.getId());
}
if (!ObjectUtil.isEmpty(goodsOrder1)){
orders.put("goodsOrder",goodsOrder1);
cashierOrder.setGoodsOrderId(goodsOrder1.getId());
}
cashierOrderService.insertCashierOrder(cashierOrder);
return orders;
}

View File

@ -0,0 +1,25 @@
package com.fuint.business.order.vo;
import lombok.Data;
@Data
public class OilOrderVo {
// 油品id
private Integer id;
// 油品订单金额
private Double orderAmount;
// 油号
private String oils;
// 油枪
private Integer oilGunNum;
// 加油数量
private Double oilNum;
// 油品单价
private Double oilPrice;
// 员工id
private Integer staffId;
// 员工姓名
private String name;
// 员工账号
private String mobile;
}

View File

@ -21,37 +21,37 @@ public interface OilNumberMapper extends BaseMapper<OilNumber> {
* @param page
* @return
*/
public IPage<OilNumber> selectOilNumberList(Page page, @Param("oilNumber") OilNumber oilNumber);
IPage<OilNumber> selectOilNumberList(Page page, @Param("oilNumber") OilNumber oilNumber);
/**
* 根据id查询员工信息
* @param id
* @return
*/
public OilNumber selectOilNumberById(@Param("id") int id);
OilNumber selectOilNumberById(@Param("id") int id);
/**
* 根据id删除员工信息
* @return
*/
public int deleteOilNumberById(@Param("id") int id);
int deleteOilNumberById(@Param("id") int id);
/**
* 添加员工信息
* @return
*/
public int insertOilNumber(OilNumber oilNumber);
int insertOilNumber(OilNumber oilNumber);
/**
* 修改员工信息
* @return
*/
public int updateOilNumber(OilNumber oilNumber);
int updateOilNumber(OilNumber oilNumber);
public List<OilNumber> getOilName(@Param("storeId") Integer storeId);
List<OilNumber> getOilName(@Param("storeId") Integer storeId);
// 根据店铺和油号查询是否存在重复
public int selectOilNameByStore(OilNumber oilNumber);
int selectOilNameByStore(OilNumber oilNumber);

View File

@ -92,7 +92,6 @@
<if test=" updateBy != null and updateBy != ''">update_by= #{updateBy},</if>
<if test=" unit != null and unit != ''">unit= #{unit},</if>
update_time= NOW()
</set>
where number_id = #{numberId}
</update>
@ -105,11 +104,10 @@
from oil_number onm
left join oil_name name on onm.oil_name = name.id
<where>
<if test="storeId != null">
onm.store_id = #{storeId}
</if>
onm.store_id = #{storeId}
</where>
</select>
<select id="selectOilNameByStore" resultType="java.lang.Integer">
select count(*)
from oil_number
@ -118,33 +116,4 @@
oil_name = #{oilName}
limit 1
</select>
<!-- oilType-->
<!-- oilName-->
<!-- oilPrice-->
<!-- gbPrice-->
<!-- receivingUni-->
<!-- createTime-->
<!-- updateTime-->
<!-- state-->
<!-- sort-->
<!-- remark-->
<!-- ifDelete-->
<!-- oil_type-->
<!-- oil_name-->
<!-- oil_price-->
<!-- gb_price-->
<!-- receiving_units-->
<!-- create_time-->
<!-- update_time-->
<!-- state-->
<!-- sort-->
<!-- remark-->
<!-- if_delete-->
</mapper>

View File

@ -49,9 +49,9 @@ public interface OilNumberService extends IService<OilNumber> {
public int updateOilNumber(OilNumber oilNumber);
public List<OilNumber> getOilName();
List<OilNumber> getOilName();
public OilNumber selectOilNameByStore(OilNumber oilNumber);
OilNumber selectOilNameByStore(OilNumber oilNumber);

View File

@ -126,10 +126,9 @@ public class OilPresetPricesServiceImpl extends ServiceImpl<OilPresetPricesMappe
@Override
public int updateOilPresetPrices(OilPresetPrices presetPrices) {
// Date date = new Date();
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
// String format = sdf.format(date);
// presetPrices.setUpdateTime(format);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
presetPrices.setStoreId(nowAccountInfo.getStoreId());
return baseMapper.insertOilPresetPrices(presetPrices);
}
@ -143,9 +142,7 @@ public class OilPresetPricesServiceImpl extends ServiceImpl<OilPresetPricesMappe
*/
@Override
public void timingAdjustment(Integer id) {
System.out.println("ssssssssssssssssssssssssssssssssssssss");
System.out.println("aaaaaaaaa"+id);
// // 通过id查出这一条的数据
// 通过id查出这一条的数据
OilPresetPrices oilPresetPrices = baseMapper.selectOilPresetPricesById(id);
// 关联价格将number中的数据修改掉
OilNumber oilNumber = new OilNumber();

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询油品订单列表
export function listCashierOrder(query) {
return request({
url: '/business/cashierOrder/list',
method: 'get',
params: query
})
}

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'
// 查询商品列表
// 查询商品订单列表
export function listOrder(query) {
return request({
url: '/business/order/list',
@ -16,3 +16,12 @@ export function getOrderGoods(orderId) {
method: 'get',
})
}
// 根据订单id查询商品订单信息
export function getGoodsOrder(data) {
return request({
url: '/business/order/id',
method: 'post',
data: data,
})
}

View File

@ -35,3 +35,12 @@ export function goodsOrder(data) {
data: data
})
}
// 根据订单号查询油品订单信息
export function oilOrders(data) {
return request({
url: '/business/oilOrder/orderNos',
method: 'post',
data: data
})
}

View File

@ -1,61 +0,0 @@
import request from '@/utils/request'
// 查询固定等级列表
export function listCertifiedMember(query) {
return request({
url: '/business/userManager/certifiedMember/list',
method: 'get',
params: query
})
}
// 查询固定等级详细
export function getCertifiedMember(id) {
return request({
url: '/business/userManager/certifiedMember/' + id,
method: 'get'
})
}
// 根据会员id查询固定等级详细
export function getCertifiedMemberByUserId(userId) {
return request({
url: '/business/userManager/certifiedMember/userId/' + userId,
method: 'get'
})
}
// 新增固定等级
export function addCertifiedMember(data) {
return request({
url: '/business/userManager/certifiedMember',
method: 'post',
data: data
})
}
// 批量新增固定等级
export function addCertifiedMembers(data) {
return request({
url: '/business/userManager/certifiedMember/members',
method: 'post',
data: data
})
}
// 修改固定等级
export function updateCertifiedMember(data) {
return request({
url: '/business/userManager/certifiedMember',
method: 'put',
data: data
})
}
// 删除固定等级
export function delCertifiedMember(id) {
return request({
url: '/business/userManager/certifiedMember/' + id,
method: 'delete'
})
}

View File

@ -1,19 +0,0 @@
import request from '@/utils/request'
// 查询会员详细
export function getChainStoreConfig() {
return request({
url: '/business/userManager/chainStoreConfig',
method: 'get'
})
}
// 修改会员
export function updateChainStoreConfig(data) {
return request({
url: '/business/userManager/chainStoreConfig',
method: 'put',
data: data
})
}

View File

@ -1,53 +0,0 @@
import request from '@/utils/request'
// 查询固定等级列表
export function listFixingLevel(query) {
return request({
url: '/business/userManager/fixingLevel/list',
method: 'get',
params: query
})
}
// 查询固定等级详细
export function getFixingLevel(id) {
return request({
url: '/business/userManager/fixingLevel/' + id,
method: 'get'
})
}
// 根据固定等级名称查询固定等级信息
export function queryFixingLevel(data) {
return request({
url: '/business/userManager/fixingLevel/getName',
method: 'post',
data: data
})
}
// 新增固定等级
export function addFixingLevel(data) {
return request({
url: '/business/userManager/fixingLevel',
method: 'post',
data: data
})
}
// 修改固定等级
export function updateFixingLevel(data) {
return request({
url: '/business/userManager/fixingLevel',
method: 'put',
data: data
})
}
// 删除固定等级
export function delFixingLevel(id) {
return request({
url: '/business/userManager/fixingLevel/' + id,
method: 'delete'
})
}

View File

@ -1,53 +0,0 @@
import request from '@/utils/request'
// 查询会员等级列表
export function listUserGrade(query) {
return request({
url: '/business/userManager/userGrade/list',
method: 'get',
params: query
})
}
// 查询会员等级详细
export function getUserGrade(id) {
return request({
url: '/business/userManager/userGrade/' + id,
method: 'get'
})
}
// 根据会员等级名称查询会员等级信息
export function queryUserGrade(data) {
return request({
url: '/business/userManager/userGrade/getName',
method: 'post',
data: data
})
}
// 新增会员等级
export function addUserGrade(data) {
return request({
url: '/business/userManager/userGrade',
method: 'post',
data: data
})
}
// 修改会员等级
export function updateUserGrade(data) {
return request({
url: '/business/userManager/userGrade',
method: 'put',
data: data
})
}
// 删除会员等级
export function delUserGrade(id) {
return request({
url: '/business/userManager/userGrade/' + id,
method: 'delete'
})
}

View File

@ -2,18 +2,51 @@
<template>
<div>
<el-card class="box-card">
<div style="display: flex;">
<div class="top-app-sou">
<el-form :label-position="labelPosition" label-width="40px" :model="formLabelAlign">
<el-form-item label="名称">
<el-input v-model="formLabelAlign.name" placeholder="请输入要搜索的内容"></el-input>
</el-form-item>
</el-form>
</div>
<div style="margin-left: 10px">
<el-button type="primary" icon="el-icon-search">搜索</el-button>
</div>
</div>
<!-- <div style="display: flex;">-->
<!-- <div class="top-app-sou">-->
<!-- <el-form :label-position="labelPosition" label-width="40px" :model="formLabelAlign">-->
<!-- <el-form-item label="名称">-->
<!-- <el-input v-model="formLabelAlign.name" placeholder="请输入要搜索的内容"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- <div style="margin-left: 10px">-->
<!-- <el-button type="primary" icon="el-icon-search">搜索</el-button>-->
<!-- </div>-->
<!-- </div>-->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="交易员工" prop="staffId">
<el-select
v-model="queryParams.staffId"
clearable
placeholder="全部"
>
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
<span style="float: left">{{ item.realName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="订单号">
<el-input v-model="queryParams.orderNo" placeholder="订单号、官方单号检索"></el-input>
</el-form-item>
<el-form-item label="交易时间">
<el-date-picker
v-model="dateRange"
style="width: 240px"
size="medium"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
@ -37,89 +70,71 @@
</div>
<div class="table-box">
<el-table
:data="tableData"
:data="orderList"
style="width: 100%">
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="left" inline class="demo-table-expand">
<el-form-item label="名称">
<span>{{ props.row.name }}</span>
<el-form-item label="收银员">
<span>{{ props.row.staffId }}</span>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column
prop="date"
label="用户信息"
width="150">
prop="orderNo"
label="订单号"
width="180">
</el-table-column>
<el-table-column label="余额">
<el-table-column
prop="name"
label="储值卡"
width="120">
</el-table-column>
<el-table-column
prop="name"
label="升值卡"
width="120">
</el-table-column>
<el-table-column
prop="amount"
label="订单金额">
</el-table-column>
<el-table-column label="会员等级">
<el-table-column
prop="province"
label="汽油"
width="120">
</el-table-column>
<el-table-column
prop="city"
label="柴油"
width="120">
</el-table-column>
<el-table-column
prop="city"
label="天然气"
width="120">
</el-table-column>
<el-table-column
prop="payAmount"
label="实付金额">
</el-table-column>
<el-table-column label="统计">
<el-table-column label="订单金额组成">
<el-table-column
prop="province"
label="加油金"
width="120">
prop="oilOrderId"
label="油品金额">
<template slot-scope="scope">
<span>{{ getOilPrice(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column
prop="city"
label="积分"
width="120">
</el-table-column>
<el-table-column
prop="city"
label="消费次数"
width="120">
prop="goodsOrderId"
label="商品金额">
<template slot-scope="scope">
<span>{{ getGoodsOrder(scope.row.goodsOrderId) }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column
prop="zip"
label="实体卡号"
width="220">
prop="payUser"
label="付款用户">
</el-table-column>
<el-table-column
prop="zip"
label="状态"
width="120">
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
prop="status"
label="状态">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
>更多操作</el-button>
<el-tag v-if="scope.row.status == 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status == 'paid'">已支付</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag>
</template>
</el-table-column>
<el-table-column label="注册时间" align="center" width="160" prop="payTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button style="width: 60px" size="mini" type="success" plain round>详情</el-button>
<el-button style="width: 60px" size="mini" type="primary" plain round>补打</el-button>
<el-button style="width: 60px" size="mini" type="danger" plain round>退款</el-button>
</template>
</el-table-column>
@ -140,10 +155,29 @@
</template>
<script>
import {listCashierOrder} from "@/api/cashier/cashierorder";
import {queryStaffs} from "@/api/cashier/staff";
import {oilOrders} from "@/api/cashier/oilorder";
import {getGoodsOrder} from "@/api/cashier/goodsorder";
export default {
name: "order_Cashier",
data(){
return{
//
oilAmount:0,
//
staffList:[],
//
dateRange: [],
//
orderList:[],
//
queryParams: {
page: 1,
pageSize: 10,
},
total:0,
labelPosition: 'right',
formLabelAlign: {
name: '',
@ -199,6 +233,54 @@
zip: 200333
}]
}
},
created() {
this.getList();
this.getStaffList();
},
methods:{
getGoodsOrder(id){
let amount = 0;
getGoodsOrder({id:id}).then( response => {
console.log(response)
})
return amount;
},
//
getOilPrice(data){
},
//
getList(val){
if (val!=undefined){
this.queryParams.page = val
}
listCashierOrder(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
})
},
//
getStaffList(){
queryStaffs().then( response => {
this.staffList = response.data;
})
},
//
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
//
resetQuery() {
this.dateRange = [];
this.queryParams = {
page: 1,
pageSize: 10,
}
// this.resetForm("queryForm");
this.handleQuery();
},
}
}
</script>
@ -262,5 +344,4 @@
width: 20%;
}
</style>