bug修改

This commit is contained in:
wangh 2023-11-21 18:11:49 +08:00
parent 631df5ee81
commit 174bfee9d5
36 changed files with 1452 additions and 498 deletions

View File

@ -322,7 +322,7 @@
<el-col v-if="showList.je" :span="8">
<el-form-item label="兑换金额" prop="exchangeAmount">
<el-input v-model="dataForm.exchangeAmount" placeholder="" maxlength="30" style="width: 202px;">
<template slot="append">积分</template>
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
@ -423,9 +423,7 @@
</div>
</el-dialog>
<!-- 打开商品界面 -->
<!-- 打开商品界面 -->
<el-dialog title="选择商品" :visible.sync="openCommodity" width="1000px" append-to-body :close-on-click-modal="false">
<el-container>
<el-header style="">
@ -438,7 +436,7 @@
placeholder="全部"
clearable
>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
<el-option v-for="item in giftCategoryList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
</el-col>
@ -747,11 +745,12 @@ export default {
isRecovery:0,
},
//
cvsGoodList:[],
//
supplierList:[],
}
},
@ -865,27 +864,26 @@ export default {
this.cardFavorableApi();
this.cardExchangeApi();
this.selectGiftCategory();
//
let fileList = JSON.parse(data.giftImages);
this.giftImages = [],
this.giftImages = fileList;
console.log( this.giftImages);
this.giftImages.forEach(image=>{
let sp = image.url.split('//')
image.url = this.imagePath + '/'+sp[2]
})
console.log("data",data.deliveryMethod);
// data.deliveryMethod = JSON.parse(data.deliveryMethod);
//
this.dataForm = data;
this.changeGiftType(this.dataForm.giftType)
this.changeExchange(this.dataForm.exchangeMethod)
this.changeExpressEDIT()
console.log(" this.dataForm", this.dataForm)
this.open = true;
this.getList();
},
@ -1001,6 +999,7 @@ export default {
},
//
changeGiftType(newVal) {
console.log("")
let this_ = this
if (newVal == '优惠券') {
this_.showList.coupon = true
@ -1041,30 +1040,46 @@ export default {
this_.showList.jfjq = true
}
},
//
//
changeExpress(data,flag){
let this_ = this
// express: false,
console.log("data",data)
// shippingFee: false
console.log("flag",flag)
console.log("this.dataForm.deliveryMethod",this.dataForm.deliveryMethod)
if(flag === 1) {
if (!this.dataForm.deliveryMethod) {
this.dataForm.deliveryMethod = [];
this.showList.express= false
}
if (!Array.isArray(this.dataForm.deliveryMethod)) {
this.dataForm.deliveryMethod = JSON.parse(this.dataForm.deliveryMethod);
}
// const jsonArray = JSON.parse(this.dataForm.deliveryMethod);
// const index = jsonArray.indexOf(data);
const index = this.dataForm.deliveryMethod.indexOf(data);
if (index === -1) {
this.dataForm.deliveryMethod.push(data);
// const jsonArray = JSON.parse(this.dataForm.deliveryMethod);
// jsonArray.push(data)
// this.dataForm.deliveryMethod = jsonArray
console.log("data1",data)
if(data == '物流配送') {
this.showList.express= true
}
} else {
this.dataForm.deliveryMethod.splice(index, 1);
console.log("data2",data)
this.dataForm.deliveryMethod.splice(index, 1)
// const jsonArray = JSON.parse(this.dataForm.deliveryMethod);
// jsonArray.splice(index, 1);
// this.dataForm.deliveryMethod = JSON.stringify(jsonArray)
if(data == '物流配送') {
this.showList.express= false
}
}
console.log("data",this.dataForm.deliveryMethod)
} else {
if (data == '包邮') {
this.showList.shippingFee= false
@ -1073,6 +1088,31 @@ export default {
}
}
},
//
changeExpressEDIT(){
if (!this.dataForm.deliveryMethod) {
this.dataForm.deliveryMethod = [];
this.showList.express= false
}
if(!this.dataForm.expressShippingFee) {
this.dataForm.expressShippingFee= ''
this.showList.shippingFee= false
}
let this_ = this
if (!Array.isArray(this_.dataForm.deliveryMethod)) {
this_.dataForm.deliveryMethod = JSON.parse(this_.dataForm.deliveryMethod);
}
if (this_.dataForm.deliveryMethod.includes("物流配送")) {
this.showList.express= true
}
if (this_.dataForm.expressShippingFee == "统一运费") {
this.showList.shippingFee= true
}
},
//
handleIsopenSelect() {

View File

@ -337,7 +337,7 @@
<el-input placeholder="请输入充值金额"
size="medium"
v-model.number="cardValueForm.amount"
@change="valueAmoutChange(cardValueForm.amount)">
@input="valueAmoutChange(cardValueForm.amount)">
<template slot="prepend">自定义</template>
<template slot="append"></template>
</el-input>
@ -1017,6 +1017,18 @@ export default {
},
valueAmoutChange(data) {
this.cardValueForm.points = ''
this.cardValueForm.bidBalance =''
this.cardValueForm.giftBalance =''
this.cardValueForm.growthValue = ''
this.cardValueForm.rechargeBalance = ''
this.cardValueForm.royaltyType = ''
this.cardValueForm.percentageCommissions = ''
this.cardValueForm.amountCommission = ''
this.cardValueForm.rechargeBalance = data
if (this.cardValueList.length > 0){
@ -1033,6 +1045,7 @@ export default {
this.cardValueForm.percentageCommissions = change.percentageCommissions
this.cardValueForm.amountCommission = change.amountCommission
//
if (change.royaltyType === "3") {
//
@ -1047,6 +1060,7 @@ export default {
})
}
console.log("data",data)
console.log("this.cardValueForm",this.cardValueForm)
},
//
getCardFuelDieselList() {

View File

@ -163,6 +163,7 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
this.$forceUpdate()
},
getList() {
this.gunList = []
getGunApi().then(response => {
this.gunList = response.data;
})
@ -224,7 +225,8 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
if (response.code == 200) {
this.$modal.msgSuccess("新增成功");
this.dialogVisible = false;
// this.getList();
this.getList();
}else {
}
@ -235,17 +237,18 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
if (response.code == 200) {
this.$modal.msgSuccess("修改成功");
this.dialogVisible = false;
// this.getList();
this.getList();
this.dialogVisible = false
}
});
}
this.dialogVisible = false
} else {
return false;
}
});
this.getList();
// this.getList();
},
chooseName() {
var this_ = this

View File

@ -401,15 +401,14 @@ export default {
//
change(data) {
// new BigNumber
console.log("data",data)
//
data.stockDifference = data.inventoryVolume - data.currentInventoryVolume
//
data.profitLossAmount = data.inventoryVolume * data.stockDifference
data.profitLossAmount = data.stockDifference * data.currentAveragePrice
this.sumMethod(this.orderList)
//
// this.orderForm = data
// this.edit()
},
@ -441,20 +440,24 @@ export default {
//
addOrder () {
let this_ = this
// let oilInventoryOrder = []
//
// this.multipleSelection.forEach(mul=>{
// let now = {
// tankId: mul.id,
// numberId: mul.numberId,
// currentAveragePrice: mul.discountedPrice,
// currentInventoryVolume: mul.storedQuantity
// }
// oilInventoryOrder.push(now)
// })
console.log("this.multipleSelection",this.multipleSelection)
this.multipleSelection.forEach(mul=>{
const isDuplicate = false
if (this.orderList.length > 0) {
isDuplicate = this.orderList.some(order => order.tankId === mul.id);
}
if (isDuplicate || isDuplicate == '') {
console.log("isDuplicate222")
this.$message({
message: '油罐已经存在,请重新选择',
type: 'warning'
});
this.multipleSelection = []
return;
}
let now = {
tankId: mul.id,
tankName: mul.tankName,
@ -466,21 +469,13 @@ export default {
}
this_.orderList.push(now)
})
// this_.getList();
this_.open = false
this.multipleSelection = []
this_.open = false
this.numberOfTanks = this.numberOfTanks+1
this_.sumMethod(this_.orderList);
// this_.orderList
// insertBatchInventoryOrderApi(oilInventoryOrder).then(response => {
// this_.$modal.msgSuccess("");
// this_.getList();
// this_.open = false
// }).catch(response=>{
//
// })
},
//
handleSelectionChange(val) {

View File

@ -311,7 +311,7 @@
</el-select>
</el-form-item>
<el-form-item label="当前油站价">
<el-input v-model="oilPresetPrices.currentGbPrice" style="width: 217px" readonly>
<el-input v-model="oilPresetPrices.currentGbPrice" style="width: 217px" readonly disabled>
<template slot="append"></template>
</el-input>
</el-form-item>
@ -321,7 +321,7 @@
</el-input>
</el-form-item>
<el-form-item label="当前国标价">
<el-input v-model="oilPresetPrices.currentPetrolPrices" style="width: 217px" readonly>
<el-input v-model="oilPresetPrices.currentPetrolPrices" style="width: 217px" readonly disabled>
<template slot="append"></template>
</el-input>
</el-form-item>
@ -631,7 +631,8 @@ import {
if (valid) {
insertOilNumber(this.oilNumber).then( response => {
var list = response.data
if (list == 0) {
if (list < 0) {
this.getList();
this.$modal.msgWarning("有重复油号");
}else if(list > 0){
this.$modal.msgSuccess("新增油号成功");
@ -639,7 +640,6 @@ import {
this.getList();
}
console.log("updateOilNumber",list)
});
}
})
@ -655,6 +655,7 @@ import {
updateOilNumber(this_.oilNumber).then( response => {
var list = response.data
if ( list < 0) {
this.getList();
this.$modal.msgWarning("油品重复");
} else {
this.getList();

View File

@ -20,7 +20,7 @@
<el-form-item label="状态" v-model="queryParams.status" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择供应商" style="width:100%" clearable
<el-select v-model="queryParams.status" placeholder="请选择状态" style="width:100%" clearable
>
<el-option
v-for="dict in dict.type.oilPurchasedStatus"

View File

@ -15,7 +15,7 @@ public interface OilConfigMapper extends BaseMapper<OilConfig> {
* 查询油品配置列表信息
* @return
*/
public List<OilConfigVo> selectOilConfigList();
public List<OilConfigVo> selectOilConfigList(Integer storeId);
/**
* 根据id查询支付配置信息

View File

@ -8,6 +8,7 @@
<select id="selectOilConfigList" resultType="com.fuint.api.fuyou.vo.OilConfigVo">
<include refid="selectOilConfig"></include>
where oc.store_id = #{storeId}
</select>
<select id="selectOilConfigById" resultType="com.fuint.api.fuyou.vo.OilConfigVo" parameterType="int">
<include refid="selectOilConfig"></include>

View File

@ -61,7 +61,8 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
@Override
public List<OilConfigVo> selectOilConfigList() {
List<OilConfigVo> oilConfigs = baseMapper.selectOilConfigList();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<OilConfigVo> oilConfigs = baseMapper.selectOilConfigList(nowAccountInfo.getStoreId());
return oilConfigs;
}

View File

@ -88,9 +88,11 @@
ig.update_by,
ig.used_inventory,
ig.market,
igc.category_name
igc.category_name,
mg.name goodsName
from integral_gift ig
left join integral_gift_category igc ON ig.category_id = igc.id
left join mt_goods mg ON ig.goods_id = mg.id
<where>
ig.store_id = #{integralGift.storeId}

View File

@ -7,6 +7,7 @@ import lombok.Data;
public class IntegralGiftVO extends IntegralGift {
// 分类名称
private String categoryName;
private String goodsName;
// 商品
// 优惠卷
}

View File

@ -95,6 +95,12 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
String orderNo = timestamp+randomString;
cardValueRecordDTO.setPaymentNo(orderNo);
cardValueRecordDTO.setStoreId(nowAccountInfo.getStoreId());
if (ObjectUtil.isEmpty(cardValueRecordDTO.getBidBalance())) cardValueRecordDTO.setBidBalance(0.0);
if (cardValueRecordDTO.getBidBalance() <= 0.0) {
BigDecimal bigDecimal = new BigDecimal(cardValueRecordDTO.getBidBalance());
bigDecimal = bigDecimal.add(new BigDecimal(cardValueRecordDTO.getGiftBalance()).add(new BigDecimal(cardValueRecordDTO.getRechargeBalance())));
cardValueRecordDTO.setBidBalance(bigDecimal.doubleValue());
}
baseMapper.insert(cardValueRecordDTO);
double epsilon = 1e-10; // 阈值
@ -215,7 +221,10 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
// 计算之后修改对应余额
BigDecimal bigBidBalance = new BigDecimal(cardValueRecordDTO.getBidBalance());
BigDecimal addCardValance = bigBidBalance.add(new BigDecimal(ljUserVos.getCardBalance()));
// BigDecimal recharge = new BigDecimal(cardValueRecordDTO.getRechargeBalance());
BigDecimal addCardValance = bigBidBalance.add(new BigDecimal(ljUserVos.getCardBalance())); //
// BigDecimal addCardValance = bigBidBalance.add(new BigDecimal(ljUserVos.getCardBalance()));
// 计算积分
BigDecimal bigPoints = new BigDecimal(cardValueRecordDTO.getPoints());

View File

@ -35,7 +35,7 @@ public class HandoverRecordController extends BaseController {
* @return 查询结果
*/
@GetMapping("queryByPage")
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
public ResponseObject queryByPage(@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("handoverRecord") HandoverRecord handoverRecord) {
Page page = new Page(pageNo, pageSize);
@ -93,7 +93,10 @@ public class HandoverRecordController extends BaseController {
}
/**
* 交班
* @return
*/
@GetMapping("handover")
public ResponseObject handover() {
return getSuccessResult(handoverRecordService.handover());

View File

@ -27,6 +27,9 @@ public class HandoverRecord extends BaseEntity {
* 交班数据记录
*/
private String recordData;
private String staffName;
private String type;
private String status;
/**
* 交班开始时间
*/

View File

@ -85,15 +85,25 @@ public interface HandoverRecordMapper {
int deleteById(Integer id);
// 油品交易信息
Map<String, String> oilOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
Map<String, Object> oilOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
// 会员储值交易信息
Map<String, String> cardOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
Map<String, Object> cardOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
// 油卡交易信息
Map<String, String> fuelOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
Map<String, Object> fuelOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
// 普通交易
Map<String, String> goodsOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
Map<String, Object> goodsOrderStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
List<Map<String, String>> paymentAggregation(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
List<Map<String, Object>> paymentAggregation(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
List<Map<String, Object>> oilNumberStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
List<Map<String, Object>> greaseGunStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
List<Map<String, Object>> employeeStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
List<Map<String, Object>> billingDetails(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
List<Map<String, Object>> returnedToTheAccount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("storeId") Integer storeId);
}

View File

@ -35,6 +35,18 @@
left join mt_staff ms ON hr.staff_id = ms.id
where
hr.store_id = #{handoverRecord.storeId}
<if test="handoverRecord.status != null and handoverRecord.status != ''">
and hr.status = #{handoverRecord.status}
</if>
<if test="handoverRecord.type != null and handoverRecord.type != ''">
and hr.type = #{handoverRecord.type}
</if>
<if test="handoverRecord.params.beginTime != null and handoverRecord.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(end_time,'%y%m%d') &gt;= date_format(#{handoverRecord.params.beginTime},'%y%m%d')
</if>
<if test="handoverRecord.params.endTime != null and handoverRecord.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(end_time,'%y%m%d') &lt;= date_format(#{handoverRecord.params.endTime},'%y%m%d')
</if>
</select>
@ -119,7 +131,7 @@ limit 1
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into handover_record(staff_id, record_data, start_time, end_time, store_id, create_time, update_time, create_by, update_by,status,type)
values (#{staffId}, #{recordData}, #{startTime}, #{createTime}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy},#{status},{type})
values (#{staffId}, #{recordData}, #{startTime}, #{createTime}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy},#{status},#{type})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
@ -241,6 +253,8 @@ limit 1
SUM(IF(order_status='paid', pay_amount, 0)) AS paidAmount,
SUM(IF(order_status='refund', pay_amount, 0)) AS refundAmount
FROM oil_order
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY pay_type
UNION ALL
@ -251,6 +265,8 @@ limit 1
SUM(IF(pay_status='paid', recharge_balance, 0)) AS paidAmount,
SUM(IF(pay_status='refund', recharge_balance, 0)) AS refundAmount
FROM card_value_record
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY payment_type
UNION ALL
@ -261,6 +277,8 @@ limit 1
SUM(IF(pay_status='paid', recharge_balance, 0)) AS paidAmount,
SUM(IF(pay_status='refund', recharge_balance, 0)) AS refundAmount
FROM card_fuel_record
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY payment_type
UNION ALL
@ -271,10 +289,157 @@ limit 1
SUM(IF(status='paid', pay_amount, 0)) AS paidAmount,
SUM(IF(status='refund', pay_amount, 0)) AS refundAmount
FROM mt_order
GROUP BY pay_type;
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY pay_type
UNION ALL
SELECT
'point' AS flag,
payment_type AS payType,
SUM(IF(status='status', amount, 0)) AS paidAmount,
SUM(IF(status='refund', amount, 0)) AS refundAmount
FROM integral_orders
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY payment_type
having payment_type is not null
</select>
<select id="oilNumberStatistics" resultType="java.util.Map">
SELECT
on1.oil_name oilId,
concat(onn.oil_type,' ',onn.oil_name) oilName,
SUM(IF(order_status='paid', oil_num, 0)) AS oilNum,
SUM(IF(order_status='paid', pay_amount, 0)) AS paidAmount,
SUM(IF(order_status='paid', discount_amount, 0)) AS paidDiscount,
count(order_status='paid') numberOfDeals
from
oil_number on1
left join oil_name onn on on1.oil_name = onn.id
left join oil_order oo on oo.oils = onn.id
where on1.store_id = #{storeId}
and oo.create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY oo.oils
</select>
<select id="greaseGunStatistics" resultType="java.util.Map">
SELECT
oo.oil_gun_num gunName,
SUM(IF(order_status='paid', pay_amount, 0)) AS paidAmount,
SUM(IF(order_status='paid', oil_num, 0)) AS oilNum,
count(order_status='paid') numberOfDeals
FROM oil_order oo
left join oil_gun og on oo.oil_gun_num = og.id
where oo.store_id = #{storeId}
and oo.create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY oo.oil_gun_num
</select>
<select id="employeeStatistics" resultType="java.util.Map">
select
a.staffId AS staffId,
sum( a.numberOfDeals ) AS numberOfDeals,
SUM( a.paidAmount) AS paidAmount,
ms.real_name name
from
(SELECT
'oil' AS flag,
staff_id staffId,
count( order_status = 'paid' ) numberOfDeals,
SUM(IF( order_status = 'paid', pay_amount, 0 )) AS paidAmount
FROM
oil_order
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY
staff_id UNION ALL
SELECT
'card' AS flag,
mt_staff_id staffId,
count( pay_status = 'paid' ) numberOfDeals,
SUM(IF( pay_status = 'paid', recharge_balance, 0 )) AS paidAmount
FROM
card_value_record
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY
mt_staff_id UNION ALL
SELECT
'fuel' AS flag,
mt_staff_id staffId,
count( pay_status = 'paid' ) numberOfDeals,
SUM(IF( pay_status = 'paid', recharge_balance, 0 )) AS paidAmount
FROM
card_fuel_record
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY
mt_staff_id UNION ALL
SELECT
'goods' AS flag,
staff_id staffId,
count( STATUS = 'paid' ) numberOfDeals,
SUM(IF( STATUS = 'paid', pay_amount, 0 )) AS paidAmount
FROM
mt_order
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY
staff_id UNION ALL
SELECT
'point' AS flag,
staff_id staffId,
count( STATUS = 'paid' ) numberOfDeals,
SUM(IF(status='status', amount, 0)) AS paidAmount
FROM
integral_orders
where store_id = #{storeId}
and create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY payment_type
having staff_id is not null
) AS a
left join mt_staff ms ON a.staffId = ms.id
GROUP BY a.staffId
HAVING a.staffId is not null
</select>
<select id="billingDetails" resultType="java.util.Map">
select
cu.unit_name name,
hb.credit_unit_id ,
sum(amount) amount,
count(*) numberOfDeals
from
hang_bill hb
left join credit_unit cu ON hb.credit_unit_id = cu.id
where hb.status = 0
and hb.store_id = #{storeId}
and hb.create_time BETWEEN #{startTime} AND #{endTime}
group by hb.credit_unit_id
</select>
<select id="returnedToTheAccount" resultType="java.util.Map">
select
cu.unit_name name,
hb.credit_unit_id ,
sum(amount) amount,
count(*) numberOfDeals
from
hang_bill hb
left join credit_unit cu ON hb.credit_unit_id = cu.id
where (hb.status = 0 or hb.status = 1)
and hb.store_id = #{storeId}
and hb.update_time BETWEEN #{startTime} AND #{endTime}
group by hb.credit_unit_id
</select>
</mapper>

View File

@ -59,7 +59,7 @@ public interface HandoverRecordService {
*/
boolean deleteById(Integer id);
public Map<String, Map<String,String>> handover();
public Map<String, Object> handover();
}

View File

@ -3,12 +3,22 @@ package com.fuint.business.order.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.order.entity.HandoverRecord;
import com.fuint.business.order.mapper.HandoverRecordMapper;
import com.fuint.business.order.mapper.OilOrderMapper;
import com.fuint.business.order.service.HandoverRecordService;
import com.fuint.business.store.entity.MtStore;
import com.fuint.business.store.mapper.MtStoreMapper;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.system.dict.entity.SysDictData;
import com.fuint.system.dict.entity.SysDictType;
import com.fuint.system.dict.service.ISysDictDataService;
import com.fuint.system.dict.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fuint.common.util.TokenUtil;
import io.lettuce.core.dynamic.annotation.Param;
@ -23,6 +33,7 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -38,9 +49,14 @@ public class HandoverRecordServiceImpl implements HandoverRecordService {
@Resource
private HandoverRecordMapper handoverRecordMapper;
@Resource
private MtStoreMapper mtStoreMapper;
private StoreService storeService;
@Resource
private OilOrderMapper oilOrderMapper;
private LJUserMapper ljUserMapper;
@Resource
ILJStaffService iljStaffService;
@Resource
ISysDictDataService iSysDictDataService;
/**
* 通过ID查询单条数据
@ -115,19 +131,22 @@ public class HandoverRecordServiceImpl implements HandoverRecordService {
}
@Override
public Map<String, Map<String,String>> handover() {
public Map<String, Object> handover() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// MtStore mtStore = mtStoreMapper.queryStoreById(nowAccountInfo.getStoreId());
MtStore mtStore = new MtStore();
try {
mtStore = storeService.queryStoreById2(nowAccountInfo.getStoreId());
} catch (BusinessCheckException e) {
e.printStackTrace();
}
// 获取当前日期
LocalDate today = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
// 获取当前日期的零点时间
LocalDateTime midnight = today.atStartOfDay();
// 格式化当前时间
String formattedEndTime = LocalDateTime.now().format(formatter);
Map<String, Map<String,String>> handoverMap = new HashMap<>();
Map<String, Object> handoverMap = new HashMap<>();
String startTime = "2023-01-01 12:12:12";
HandoverRecord handoverRecord = selectByTime();
@ -136,98 +155,230 @@ public class HandoverRecordServiceImpl implements HandoverRecordService {
startTime = sdf.format(handoverRecord.getEndTime());
}
LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId());
String handover = iSysDictDataService.selectDictLabel("handover", ljStaff.getHandoverMode());
String handoverType = "未知";
if (!ObjectUtil.isEmpty(handover)) {
handoverType = handover;
}
// 填充 baseInfo
Map<String, String> baseInfo = new HashMap<>();
// baseInfo.put("storeName", mtStore.getName());
Map<String, Object> baseInfo = new HashMap<>();
baseInfo.put("storeName", mtStore.getName());
baseInfo.put("realName", nowAccountInfo.getRealName());
baseInfo.put("handoverType", "门店统一交班");
baseInfo.put("handoverType", handoverType);
baseInfo.put("startTime", startTime);
baseInfo.put("endTime", formattedEndTime);
baseInfo.put("handoverPrem", ljStaff.getHandoverPrem()); // 交班权限
baseInfo.put("handoverOut", ljStaff.getHandoverOut()); // 交班是否退出
handoverMap.put("baseInfo",baseInfo);
// 获取订单汇总
Map<String, String> orderSummaryMap = orderSummary(startTime, formattedEndTime);
Map<String, Object> orderSummaryMap = orderSummary(startTime, formattedEndTime);
handoverMap.put("orderSummary",orderSummaryMap);
// 支付方式汇总
Map<String, String> paymentAggregationMap = paymentAggregation(startTime, formattedEndTime);
List<Map<String, Object>> paymentAggregationMap = paymentAggregation(startTime, formattedEndTime);
handoverMap.put("paymentAggregation",paymentAggregationMap);
// 退款汇总
// 实收汇总
// 油品订单
// 商品订单
// 普通订单
// 会员储值
// 油号统计
// 优惠统计
List<Map<String, Object>> oilNumberStatisticsMap = oilNumberStatistics(startTime, formattedEndTime);
handoverMap.put("oilNumberStatistics",oilNumberStatisticsMap);
// 油枪统计
List<Map<String, Object>> greaseGunStatisticsMap = greaseGunStatistics(startTime, formattedEndTime);
handoverMap.put("greaseGunStatistics",greaseGunStatisticsMap);
// 员工统计
List<Map<String, Object>> employeeStatisticsMap = employeeStatistics(startTime, formattedEndTime);
handoverMap.put("employeeStatistics",employeeStatisticsMap);
// 挂账详情
List<Map<String, Object>> billingDetailsMap = billingDetails(startTime, formattedEndTime);
handoverMap.put("billingDetails",billingDetailsMap);
// 挂账归还
List<Map<String, Object>> returnedToTheAccountMap = returnedToTheAccount(startTime, formattedEndTime);
handoverMap.put("returnedToTheAccount",returnedToTheAccountMap);
// 合计
return handoverMap;
}
public Map<String, String> orderSummary(String startTime, String endTime) {
public Map<String, Object> orderSummary(String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// 油品订单(订单) 油品订单(退款) 油品订单(实收) 油品优惠(实收) 油品交易(实收)
Map<String, String> oilOrderStatistics = handoverRecordMapper.oilOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId());
Map<String, Object> oilOrderStatistics = handoverRecordMapper.oilOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId());
// 会员储值(订单) 会员储值(退款) 会员储值(实收) 储值赠送(订单) 储值赠送(退款) 储值赠送(实际)
Map<String, String> cardOrderStatistics = handoverRecordMapper.cardOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId());
Map<String, String> fuelOrderStatistics = handoverRecordMapper.fuelOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId());
Map<String, Object> cardOrderStatistics = handoverRecordMapper.cardOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId());
Map<String, Object> fuelOrderStatistics = handoverRecordMapper.fuelOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId());
// 普通收款(订单) 普通收款(退款) 普通收款(实收)
Map<String, String> goodsOrderStatistics = handoverRecordMapper.goodsOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId());
Map<String, Object> goodsOrderStatistics = handoverRecordMapper.goodsOrderStatistics(startTime, endTime, nowAccountInfo.getStoreId());
if (!ObjectUtil.isEmpty(oilOrderStatistics)) {
if(!ObjectUtil.isEmpty(cardOrderStatistics)) {
oilOrderStatistics.putAll(cardOrderStatistics);
}
if(!ObjectUtil.isEmpty(fuelOrderStatistics)) {
oilOrderStatistics.putAll(fuelOrderStatistics);
}
if(!ObjectUtil.isEmpty(goodsOrderStatistics)) {
oilOrderStatistics.putAll(goodsOrderStatistics);
}
}
if(!ObjectUtil.isEmpty(cardOrderStatistics)) {
oilOrderStatistics.putAll(cardOrderStatistics);
}
if(!ObjectUtil.isEmpty(fuelOrderStatistics)) {
oilOrderStatistics.putAll(fuelOrderStatistics);
}
if(!ObjectUtil.isEmpty(goodsOrderStatistics)) {
oilOrderStatistics.putAll(goodsOrderStatistics);
}
return oilOrderStatistics;
}
public Map<String, String> paymentAggregation(String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<Map<String, String>> paymentAggregation = handoverRecordMapper.paymentAggregation(startTime, endTime, nowAccountInfo.getStoreId());
// 共有四个 转为普通map
Map<String, String> allAggreMap = new HashMap<>();
Map<String, String> allRefundMap = new HashMap<>();
Map<String, String> oilMap = new HashMap<>();
Map<String, String> goodsMap = new HashMap<>();
Map<String, String> cardMap = new HashMap<>();
if (!ObjectUtil.isEmpty(paymentAggregation)) {
for (Map<String, String> stringStringMap : paymentAggregation) {
/**
* 汇总统计
*/
// 计算退款汇总
// if ( allRefundMap.containsKey("refALl"+stringStringMap.get("payType"))) {
// allRefundMap.put("refALl"+stringStringMap.get("payType"),
// (new BigDecimal( stringStringMap.get("refundAmount")).add(new BigDecimal(stringStringMap.get("refundAmount")))).toString());
// }else {
// allAggreMap.put("refALl"+stringStringMap.get("payType"), allRefundMap.get(stringStringMap.get("refundAmount")));
// }
public List<Map<String, Object>> paymentAggregation(String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<Map<String, Object>> paymentAggregation = handoverRecordMapper.paymentAggregation(startTime, endTime, nowAccountInfo.getStoreId());
List<Map<String, Object>> allRefundMapList = new ArrayList<>();
if (!ObjectUtil.isEmpty(paymentAggregation)) {
for (Map<String, Object> stringStringMap : paymentAggregation) {
// 汇总
aggregateCalculations(allRefundMapList, stringStringMap);
}
}
if (!ObjectUtil.isEmpty(allRefundMapList)){
paymentAggregation.addAll(allRefundMapList);
}
return paymentAggregation;
}
/**
* 汇总
*/
public List<Map<String, Object>> aggregateCalculations(List<Map<String, Object>> mapList,Map<String, Object> map) {
Map<String, Object> returnMap = new HashMap<>();
boolean flag = true;
for (Map<String, Object> stringObjectMap : mapList) {
if (map.get("payType").equals(stringObjectMap.get("payType"))) {
BigDecimal paidAmount = new BigDecimal(stringObjectMap.get("paidAmount").toString()).add(new BigDecimal(map.get("paidAmount").toString()));
BigDecimal refundAmount = new BigDecimal(stringObjectMap.get("refundAmount").toString()).add(new BigDecimal(map.get("refundAmount").toString()));
stringObjectMap.put("paidAmount",paidAmount.toString());
stringObjectMap.put("refundAmount",refundAmount.toString());
flag = false;
}
}
if (flag) {
returnMap.put("flag","all");
returnMap.put("payType",map.get("payType"));
returnMap.put("paidAmount",map.get("paidAmount").toString());
returnMap.put("refundAmount",map.get("refundAmount").toString());
mapList.add(returnMap);
}
return mapList;
}
public Map<String, Object> paymentAggregation2(String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<Map<String, Object>> paymentAggregation = handoverRecordMapper.paymentAggregation(startTime, endTime, nowAccountInfo.getStoreId());
// 共有四个 转为普通map
Map<String, Object> allAggreMap = new HashMap<>();
Map<String, Object> allRefundMap = new HashMap<>();
Map<String, Object> oilMap = new HashMap<>();
Map<String, Object> goodsMap = new HashMap<>();
Map<String, Object> cardMap = new HashMap<>();
if (!ObjectUtil.isEmpty(paymentAggregation)) {
for (Map<String, Object> stringStringMap : paymentAggregation) {
String payType = stringStringMap.get("payType").toString();
// 退款汇总
String refALlKey = "refALl" + payType;
summaryExtraction(stringStringMap, allRefundMap, refALlKey);
// 总汇总
// if ( allAggreMap.containsKey("agreALL"+stringStringMap.get("payType"))) {
// allAggreMap.put("agreALL"+stringStringMap.get("payType"),
// (new BigDecimal( stringStringMap.get("paidAmount")).add(new BigDecimal(stringStringMap.get("paidAmount")))).toString());
// }else {
// allAggreMap.put("agreALL"+stringStringMap.get("payType"), allAggreMap.get(stringStringMap.get("paidAmount")));
// }
String agreALLKey = "agreALL" + payType;
summaryExtraction(stringStringMap, allAggreMap, agreALLKey);
if ("oil".equals(stringStringMap.get("flag"))){
// 油品订单汇总
}else if ("card".equals(stringStringMap.get("flag"))) {
String oilKey = "oil" + payType;
summaryExtraction(stringStringMap, oilMap, oilKey);
}else if ("goods".equals(stringStringMap.get("flag"))) {
// 商品订单汇总
}else if ("fuel".equals(stringStringMap.get("flag")) || "goods".equals(stringStringMap.get("flag")) ) {
String goodsKey = "goods" + payType;
summaryExtraction(stringStringMap, goodsMap, goodsKey);
}else if ("fuel".equals(stringStringMap.get("flag")) || "card".equals(stringStringMap.get("flag")) ) {
// 会员储值汇总
String cardKey = "card" + payType;
summaryExtraction(stringStringMap, cardMap, cardKey);
}
}
}
return null;
if (!ObjectUtil.isEmpty(allAggreMap)) {
allRefundMap.putAll(allAggreMap);
}
if (!ObjectUtil.isEmpty(allRefundMap)) {
allRefundMap.putAll(allRefundMap);
}
if (!ObjectUtil.isEmpty(oilMap)) {
allRefundMap.putAll(oilMap);
}
if (!ObjectUtil.isEmpty(goodsMap)) {
allRefundMap.putAll(goodsMap);
}
if (!ObjectUtil.isEmpty(cardMap)) {
allRefundMap.putAll(cardMap);
}
return allRefundMap;
}
/**
* 油号统计
*/
public List<Map<String, Object>> oilNumberStatistics (String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<Map<String, Object>> oilNumberStatistics = handoverRecordMapper.oilNumberStatistics(startTime, endTime, nowAccountInfo.getStoreId());
return oilNumberStatistics;
}
/**
* 油枪统计
*/
public List<Map<String, Object>> greaseGunStatistics (String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<Map<String, Object>> greaseGunStatistics = handoverRecordMapper.greaseGunStatistics(startTime, endTime, nowAccountInfo.getStoreId());
return greaseGunStatistics;
}
/**
* 员工统计
*/
public List<Map<String, Object>> employeeStatistics (String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<Map<String, Object>> employeeStatistics = handoverRecordMapper.employeeStatistics(startTime, endTime, nowAccountInfo.getStoreId());
return employeeStatistics;
}
// 挂账详情
public List<Map<String, Object>> billingDetails (String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<Map<String, Object>> billingDetails = handoverRecordMapper.billingDetails(startTime, endTime, nowAccountInfo.getStoreId());
return billingDetails;
}
// 挂账归还
public List<Map<String, Object>> returnedToTheAccount (String startTime, String endTime) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
List<Map<String, Object>> returnedToTheAccount = handoverRecordMapper.returnedToTheAccount(startTime, endTime, nowAccountInfo.getStoreId());
return returnedToTheAccount;
}
/**
* 汇总抽取
*/
public Map<String, Object> summaryExtraction(Map<String, Object> sourceMap,Map<String, Object> map,String key) {
if (map.containsKey(key)) {
// 如果已经包含了该 payType则累加退款金额
BigDecimal currentRefundAmount = new BigDecimal(map.get(key).toString());
BigDecimal newRefundAmount = new BigDecimal(sourceMap.get("paidAmount").toString());
map.put(key, currentRefundAmount.add(newRefundAmount).toString());
} else {
// 如果还没有该 payType则直接添加新记录
map.put(key, sourceMap.get("paidAmount").toString());
}
return map;
}
}

View File

@ -19,7 +19,7 @@ public interface OilPresetPricesMapper extends BaseMapper<OilPresetPrices> {
* @param page
* @return
*/
public IPage<OilPresetPrices> selectOilPresetPricesList(Page page, @Param("oilNumber") OilPresetPrices presetPrices);
public IPage<OilPresetPrices> selectOilPresetPricesList(Page page, @Param("presetPrices") OilPresetPrices presetPrices);
/**
* 根据id查询员工信息

View File

@ -107,8 +107,10 @@
from oil_number onm
left join oil_name name on onm.oil_name = name.id
<where>
onm.state = '启用'
<if test="storeId != null">
onm.store_id = #{storeId}
and onm.store_id = #{storeId}
</if>
</where>
</select>
@ -117,9 +119,9 @@
from oil_gun
where
gun_name = #{oilGun.gunName}
and tank_id = #{oilGun.tankId}
and store_id = #{oilGun.storeId}
</select>
<!-- &#45;&#45; and tank_id = #{oilGun.tankId}-->
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">

View File

@ -155,6 +155,7 @@
LEFT JOIN mt_staff ms1 ON op.creator = ms1.id
LEFT JOIN mt_staff ms2 ON op.reviewer = ms2.id
<where>
op.store_id = #{oilInventory.storeId}
<if test="oilInventory.status != null and oilInventory.status != ''">
and op.status = #{oilInventory.status}
</if>

View File

@ -105,6 +105,7 @@
left join oil_name name on onm.oil_name = name.id
<where>
onm.store_id = #{storeId}
and onm.state = '启用'
</where>
</select>

View File

@ -31,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectOilPresetPricesList"
resultType="com.fuint.business.petrolStationManagement.entity.OilPresetPrices">
<include refid="selectOilPresetPrices"></include>
where store_id = #{presetPrices.storeId}
</select>
<!-- older by preset_id desc-->

View File

@ -172,6 +172,8 @@
LEFT JOIN mt_staff ms1 ON op.creator = ms1.id
LEFT JOIN mt_staff ms2 ON op.reviewer = ms2.id
<where>
op.store_id = #{oilPurchase.storeId}
<if test="oilPurchase.beginTime != null and oilPurchase.endTime != null">
and created_at &gt;= #{oilPurchase.beginTime} and created_at &lt;= #{oilPurchase.endTime}
</if>

View File

@ -30,6 +30,7 @@
id, supplier_name, contact_person, contact_phone, contact_address, remarks, create_time, update_time, create_by, update_by
from oil_suppliers
<where>
store_id = #{oilSuppliers.storeId}
<if test="oilSuppliers.id != null">
and id = #{oilSuppliers.id}
</if>
@ -60,9 +61,7 @@
<if test="oilSuppliers.updateBy != null">
and update_by = #{oilSuppliers.updateBy}
</if>
<if test="oilSuppliers.storeId != null">
and store_id = #{oilSuppliers.storeId}
</if>
</where>
</select>

View File

@ -91,8 +91,8 @@ public class OilGunServiceImpl implements OilGunService {
AccountInfo accountInfo = TokenUtil.getNowAccountInfo();
oilGun.setStoreId(accountInfo.getStoreId());
oilGun.setCreateBy(accountInfo.getStaffId().toString());
boolean check = checkData(oilGun);
if (check) {
int i = checkData(oilGun);
if (i>0) {
return false;
}
oilGun.setCreateBy(accountInfo.getId().toString());
@ -101,9 +101,9 @@ public class OilGunServiceImpl implements OilGunService {
}
// 判断是否有同一名称的数据
public boolean checkData(OilGun oilGun) {
public int checkData(OilGun oilGun) {
List<OilGun> oilGunList = oilGunDao.checkData(oilGun);
return oilGunList.size() > 1;
return oilGunList.size();
}
/**
@ -116,8 +116,8 @@ public class OilGunServiceImpl implements OilGunService {
public boolean update(OilGun oilGun) {
AccountInfo accountInfo = TokenUtil.getNowAccountInfo();
oilGun.setStoreId(accountInfo.getStoreId());
boolean check = checkData(oilGun);
if (check) {
int i = checkData(oilGun);
if (i>1) {
return false;
}
oilGun.setUpdateBy(accountInfo.getId().toString());

View File

@ -49,8 +49,8 @@ public class OilNumberServiceImpl extends ServiceImpl<OilNumberMapper, OilNumber
oilNumber.setCreateBy(nowAccountInfo.getStaffId().toString());
// 根据id查询这个店铺是否加过该型号的油
int i = baseMapper.selectOilNameByStore(oilNumber);
if ( i> 1) {
return 0;
if ( i >= 1) {
return -1;
}
return baseMapper.insertOilNumber(oilNumber);
}

View File

@ -41,6 +41,8 @@ public class OilPresetPricesServiceImpl extends ServiceImpl<OilPresetPricesMappe
@Override
public IPage<OilPresetPrices> selectOilPresetPricesList(Page page, OilPresetPrices presetPrices) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
presetPrices.setStoreId(nowAccountInfo.getStoreId());
return baseMapper.selectOilPresetPricesList(page, presetPrices);
}

View File

@ -58,6 +58,8 @@ public class OilPurchaseServiceImpl implements OilPurchaseService {
*/
@Override
public IPage<OilPurchase> queryByPage(@Param("page") Page page, @Param("OilPurchase") OilPurchase oilPurchase) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
oilPurchase.setStoreId(nowAccountInfo.getStoreId());
return oilPurchaseDao.queryAllByLimit(page, oilPurchase);
}

View File

@ -17,7 +17,7 @@ public interface MtStoreMapper extends BaseMapper<MtStore> {
MtStore queryStoreByName(@Param("name") String name);
public MtStore queryStoreById(@Param("id") Integer id);
// public MtStore queryStoreById(@Param("id") Integer id);
List<MtStore> findStoresByIds(@Param("ids") List<Integer> ids);

View File

@ -48,6 +48,8 @@ public interface StoreService extends IService<MtStore> {
*/
MtStore queryStoreById(Integer id) throws BusinessCheckException;
MtStore queryStoreById2(Integer id) throws BusinessCheckException;
/**
* 根据店铺id列表获取店铺信息
*

View File

@ -158,6 +158,14 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
return mtStoreMapper.selectById(id);
}
@Override
public MtStore queryStoreById2(Integer id) {
if (id == null) {
return null;
}
return mtStoreMapper.selectById(id);
}
/**
* 获取系统默认店铺
*

View File

@ -60,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType} limit 1
</select>
<delete id="deleteDictTypeById" parameterType="Long">
delete from sys_dict_type where dict_id = #{dictId}
</delete>

View File

@ -15,18 +15,18 @@
</div>
<div class="input-box">
<div>交班方式:</div>
<div>门店统一交班</div>
<el-tag size="small" >{{handoverList && handoverList.baseInfo ? handoverList.baseInfo.handoverType : '未知'}}</el-tag>
</div>
<div class="input-box">
<div>开始时间:</div>
<!-- <div>{{ handoverList.baseInfo.startTime }}</div>-->
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.startTime : '/--/' }}</div>
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.startTime : '-' }}</div>
</div>
<div class="input-box">
<div>结束时间:</div>
<!-- <div>{{ handoverList.baseInfo.endTime }}</div>-->
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.endTime : '/--/' }}</div>
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.endTime : '-' }}</div>
</div>
</div>
@ -139,10 +139,14 @@
<div>支付方式</div>
<div>退款金额</div>
</div>
<div class="input-box" v-for="item in paymentAggregation('all')" v-if="item.refundAmount > 0">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.refundAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div class="input-box" >
<div>合计</div>
<div>2164.55</div>
<div>{{refundAggregateTotal}}</div>
</div>
</div>
@ -152,26 +156,14 @@
<div>支付方式</div>
<div>金额</div>
</div>
<div class="input-box">
<div>现金</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>储值卡</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>加油金</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>银行转1</div>
<div>2164.55</div>
<div class="input-box" v-for="item in paymentAggregation('all')" v-if="item.paidAmount > 0">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>2164.55</div>
<div>{{totalTotalOfActualReceipts}}</div>
</div>
</div>
@ -181,26 +173,14 @@
<div>支付方式</div>
<div>金额</div>
</div>
<div class="input-box">
<div>现金</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>储值卡</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>加油金</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>银行转1</div>
<div>2164.55</div>
<div class="input-box" v-for="item in paymentAggregation('oil')">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>2164.55</div>
<div>{{totalOilOrders}}</div>
</div>
</div>
<div class="box-ge">
@ -209,40 +189,66 @@
<div>支付方式</div>
<div>金额</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>0.00</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">普通订单</div>
<div class="input-hui">
<div>支付方式</div>
<div>金额</div>
<div class="input-box" v-for="item in paymentAggregation('goods')">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>0.00</div>
<div>{{totalOfProductOrders}}</div>
</div>
</div>
<!-- <div class="box-ge">-->
<!-- <div class="boloicon">普通订单</div>-->
<!-- <div class="input-hui">-->
<!-- <div>支付方式</div>-->
<!-- <div>金额</div>-->
<!-- </div>-->
<!-- <div class="input-box" v-for="item in paymentAggregation('goods')">-->
<!-- <div>{{calculateThePaymentMethod(item.payType)}}</div>-->
<!-- <div>{{item.paidAmount}}</div>-->
<!-- </div>-->
<!-- <el-divider></el-divider>-->
<!-- <div class="input-box">-->
<!-- <div>合计</div>-->
<!-- <div>0.00</div>-->
<!-- </div>-->
<!-- </div>-->
<div class="box-ge">
<div class="boloicon">会员储值</div>
<div class="input-hui">
<div>支付方式</div>
<div>金额</div>
</div>
<div class="input-box">
<div>现金</div>
<div>888.88</div>
<div class="input-box" v-for="item in paymentAggregation('fg')">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{totalMemberStoredValue}}</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">积分商城</div>
<div class="input-hui">
<div>支付方式</div>
<div>金额</div>
</div>
<div class="input-box" v-for="item in paymentAggregation('point')" v-if="item.paidAmount>0">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>{{pointsMallStatistics}}</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">油号统计</div>
<div class="input-hui-frou">
@ -251,23 +257,16 @@
<div>升数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou">
<div>92#</div>
<div>9</div>
<div>1447.03</div>
<div style="text-align: right">888.88</div>
<div class="input-box-frou" v-for="item in oilNumberStatistics()">
<div>{{item.oilName}}</div>
<div>{{item.numberOfDeals}}</div>
<div>{{item.oilNum}}</div>
<div style="text-align: right">{{item.paidAmount}}</div>
</div>
<div class="input-box-frou">
<div>92#</div>
<div>9</div>
<div>1447.03</div>
<div style="text-align: right">888.88</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{totalOilNumberStatistics}}</div>
</div>
</div>
<div class="box-ge">
@ -276,14 +275,14 @@
<div>油品</div>
<div>金额</div>
</div>
<div class="input-box">
<div>92#</div>
<div>888.88</div>
<div class="input-box" v-for="item in oilNumberStatistics()">
<div>{{item.oilName}}</div>
<div>{{item.paidDiscount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{discountStatisticsTotal}}</div>
</div>
</div>
<div class="box-ge">
@ -294,23 +293,16 @@
<div>升数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou">
<div>一号枪</div>
<div>9</div>
<div>1447.03</div>
<div style="text-align: right">888.88</div>
<div class="input-box-frou" v-for="item in greaseGunStatistics()">
<div>{{item.gunName}}</div>
<div>{{item.numberOfDeals}}</div>
<div>{{item.oilNum}}</div>
<div style="text-align: right">{{item.paidAmount}}</div>
</div>
<div class="input-box-frou">
<div>二号枪</div>
<div>9</div>
<div>1447.03</div>
<div style="text-align: right">888.88</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{totalOfOilGunStatistics}}</div>
</div>
</div>
@ -319,35 +311,66 @@
<div class="input-hui-frou">
<div>员工姓名</div>
<div>笔数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou">
<div>一号员工</div>
<div>9</div>
<div style="text-align: right">888.88</div>
<div class="input-box-frou" v-for="item in employeeStatistics()">
<div>{{item.name}}</div>
<div>{{item.numberOfDeals}}</div>
<div style="text-align: right">{{item.paidAmount}}</div>
</div>
<div class="input-box-frou">
<div>二号员工</div>
<div>9</div>
<div style="text-align: right">888.88</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{totalOfEmployeeStatistics}}</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">挂账统计</div>
<el-divider>挂账详情</el-divider>
<div class="input-hui-frou">
<div>挂账单位</div>
<div>笔数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou" v-for="item in billingDetails()">
<div>{{item.name}}</div>
<div>{{item.numberOfDeals}}</div>
<div style="text-align: right">{{item.amount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>{{statisticsOfAccountDetails}}</div>
</div>
<el-divider>归还详情</el-divider>
<div class="input-hui-frou">
<div>挂账单位</div>
<div>笔数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou" v-for="item in returnedToTheAccount()">
<div>{{item.name}}</div>
<div>{{item.numberOfDeals}}</div>
<div style="text-align: right">{{item.amount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>{{postedAccountReturnStatistics}}</div>
</div>
</div>
</div>
<div style="width: 100%; height: 100px"></div>
<div class="app-bottom">
<el-card >
<div class="bottom-xz">
<div class="anniu" @click="shift">交班</div>
<div class="anniu" v-if="handoverList && handoverList.baseInfo && handoverList.baseInfo.handoverPrem == 'yqx'" @click="shift">交班</div>
<div class="anniu-lv">云打印</div>
<div class="anniu-lv">本地打印</div>
<div ><el-link type="primary" @click="recording">交班记录</el-link></div>
@ -360,12 +383,15 @@
<script>
import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
import BigNumber from "bignumber.js";
import {removeUserId} from "@/utils/auth";
export default {
name: "Handover",
data() {
name: "Handover",
data() {
return {
handoverList : {},
}
},
created() {
@ -378,7 +404,91 @@ import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
console.log("this.handoverList",this.handoverList)
})
},
orderSummary() {
//
},
paymentAggregation(flag) {
let count = [];
if (this.handoverList && this.handoverList.paymentAggregation) {
this.handoverList.paymentAggregation.forEach(res=> {
if (flag == 'fg') {
if (res.flag == 'fuel' || res.flag == 'card') {
let existingElementIndex = count.findIndex(item => item.payType === res.payType);
if (existingElementIndex !== -1) {
// let existingElement = count[existingElementIndex];
// paidAmount refundAmount
// existingElement.paidAmount = (Number(existingElement.paidAmount) || 0) + (Number(res.paidAmount) || 0);
// existingElement.refundAmount = (Number(existingElement.refundAmount) || 0) + (Number(res.refundAmount) || 0);
//
// existingElement.paidAmount = existingElement.paidAmount.toString();
// existingElement.refundAmount = existingElement.refundAmount.toString();
}else {
count.push(res);
}
}
}
else if (res.flag == flag) {
count.push(res)
}
})
}
return count;
},
calculateThePaymentMethod(payType) {
switch (payType) {
case 'ALIPAY':
return '支付宝'
break;
case 'WECHAT':
return '微信'
break;
case 'UNIONPAY':
return '银联二维码'
break;
case 'CASH':
return '现金'
break;
}
return '未知'
},
oilNumberStatistics() {
let count = [];
if (this.handoverList && this.handoverList.oilNumberStatistics) {
return this.handoverList.oilNumberStatistics
}
return count;
},
greaseGunStatistics() {
let count = [];
if (this.handoverList && this.handoverList.greaseGunStatistics) {
return this.handoverList.greaseGunStatistics
}
return count;
},
employeeStatistics() {
console.log("this.employeeStatistics",this.handoverList.employeeStatistics)
let count = [];
if (this.handoverList && this.handoverList.employeeStatistics) {
return this.handoverList.employeeStatistics
}
return count;
},
billingDetails() {
let count = [];
if (this.handoverList && this.handoverList.billingDetails) {
return this.handoverList.billingDetails
}
return count;
},
returnedToTheAccount() {
let count = [];
if (this.handoverList && this.handoverList.returnedToTheAccount) {
return this.handoverList.returnedToTheAccount
}
return count;
},
//
recording() {
this.$router.push({
@ -388,22 +498,35 @@ import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
}
});
},
//
shift() {
this.$confirm('交班并退出系统, 是否继续?', '提示', {
let msg = '交班并退出系统, 是否继续?'
let flag = false
if (this.handoverList && this.handoverList.baseInfo && this.handoverList.baseInfo.handoverOut == 'jbtc') {
flag = true
} else {
msg = '确定交班?'
}
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let recordData = this.handoverList
let handoverRecord = {
startTime:this.handoverList.baseInfo.endTime,
startTime:this.handoverList.baseInfo.startTime,
recordData:JSON.stringify(recordData),
type:0,
status:0,
status:this.handoverList.baseInfo.handoverType,
}
addHandoverApi(handoverRecord).then(res=>{
console.log("")
if (flag) {
removeUserId();
this.$store.dispatch('LogOut').then(() => {
location.href = '/';
})
}
})
//
// this.$message({
@ -417,6 +540,152 @@ import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
});
});
}
},
computed:{
//退
refundAggregateTotal() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "all"){
num = num.plus(new BigNumber(res.refundAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalTotalOfActualReceipts() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "all") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalOilOrders() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "oil") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalOfProductOrders() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "goods") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalMemberStoredValue() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "card" || res.flag == "fuel") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
pointsMallStatistics() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "point") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalOilNumberStatistics() {
if (this.handoverList && this.handoverList.oilNumberStatistics) {
let num = new BigNumber(0);
this.handoverList.oilNumberStatistics.forEach(res=>{
num = num.plus(new BigNumber(res.paidAmount));
})
return Number(num.toString()); //
}
return 0;
},
//
discountStatisticsTotal() {
if (this.handoverList && this.handoverList.oilNumberStatistics) {
let num = new BigNumber(0);
this.handoverList.oilNumberStatistics.forEach(res=>{
num = num.plus(new BigNumber(res.paidDiscount));
})
return Number(num.toString()); //
}
return 0;
},
//
totalOfOilGunStatistics() {
if (this.handoverList && this.handoverList.greaseGunStatistics) {
let num = new BigNumber(0);
this.handoverList.greaseGunStatistics.forEach(res=>{
num = num.plus(new BigNumber(res.paidAmount));
})
return Number(num.toString()); //
}
return 0;
},
//
totalOfEmployeeStatistics() {
if (this.handoverList && this.handoverList.employeeStatistics) {
let num = new BigNumber(0);
this.handoverList.employeeStatistics.forEach(res=>{
num = num.plus(new BigNumber(res.paidAmount));
})
return Number(num.toString()); //
}
return 0;
},
//
statisticsOfAccountDetails(){
if (this.handoverList && this.handoverList.billingDetails) {
let num = new BigNumber(0);
this.handoverList.billingDetails.forEach(res=>{
num = num.plus(new BigNumber(res.amount));
})
return Number(num.toString()); //
}
return 0;
},
//
postedAccountReturnStatistics(){
if (this.handoverList && this.handoverList.returnedToTheAccount) {
let num = new BigNumber(0);
this.handoverList.returnedToTheAccount.forEach(res=>{
num = num.plus(new BigNumber(res.amount));
})
return Number(num.toString()); //
}
return 0;
}
}
}

View File

@ -7,31 +7,35 @@
<span>交班详情</span>
</div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="交班方式" prop="giftName">
<el-select v-model="queryParams.status" style="width: 150px" placeholder="交班状态" clearable>
<!-- <el-option label="未支付" value="0">交班</el-option>-->
<!-- <el-option label="付款成功" value="1">未交班</el-option>-->
<el-form-item label="交班方式" prop="status">
<el-select v-model="queryParams.status" style="width: 150px" placeholder="交班方式" clearable>
<el-option
v-for="option in shiftHandoverList"
:key="option.dictCode"
:label="option.dictLabel"
:value="option.dictLabel"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="交班状态">
<el-select v-model="queryParams.type" style="width: 150px" placeholder="交班状态" clearable>
<el-option label="未支付" value="0">交班</el-option>
<el-option label="付款成功" value="1">未交班</el-option>
<el-option label="交班" value="0">交班</el-option>
<el-option label="未交班" value="1">未交班</el-option>
</el-select>
</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="-"-->
<!-- clearable-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<!-- </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="-"
clearable
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>
@ -110,6 +114,7 @@ export default {
dataList:[],
recordData:'',
zhztList:'',
shiftHandoverList:'',
queryParams: {
status: '',
@ -135,7 +140,7 @@ export default {
created() {
this.getList();
this.getStatistics();
this.getStatus();
},
methods: {
getList(){
@ -158,6 +163,11 @@ export default {
this.zhztList = response.data;
})
},
getStatus() {
getDicts("handover").then(response => {
this.shiftHandoverList = response.data;
})
},
handleUpdate(){},
handleQuery(){

View File

@ -5,131 +5,148 @@
<div class="box-title">
交班统计
<el-button style="float: right ;margin-left: 5px" size="mini" type="primary" plain>打印交班单</el-button>
</div>
<!-- <div class="box-ge">-->
<!-- <div class="input-box">-->
<!-- <div>油站名称:</div>-->
<!-- <div>{{ handoverList.baseInfo.storeName }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>收银员:</div>-->
<!-- <div>{{ handoverList.baseInfo.realName }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>交班方式:</div>-->
<!-- <div>门店统一交班</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>开始时间:</div>-->
<!-- <div>{{ handoverList.baseInfo.startTime }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>结束时间:</div>-->
<!-- <div>{{ handoverList.baseInfo.endTime }}</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="box-ge">-->
<!-- <div class="input-box">-->
<!-- <div>当前版本:</div>-->
<!-- <div>V1.0.1</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="box-ge">-->
<!-- <div class="boloicon">订单汇总</div>-->
<!-- <div class="input-hui">-->
<!-- <div>类型</div>-->
<!-- <div>金额</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>油品订单(订单)</div>-->
<!-- <div>{{ handoverList.orderSummary.oilOrder }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>油品订单(退款)</div>-->
<!-- <div>-{{ handoverList.orderSummary.oilRefund }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>油品订单(实收)</div>-->
<!-- <div>{{ handoverList.orderSummary.oilPaid }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>油品优惠(实收)</div>-->
<!-- <div>{{ handoverList.orderSummary.oilDiacount }}</div>-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="input-box">&ndash;&gt;-->
<!--&lt;!&ndash; <div>抹零总额(实收)</div>&ndash;&gt;-->
<!--&lt;!&ndash; <div>2164.55</div>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- <div class="input-box">-->
<!-- <div>油品交易(实收)????</div>-->
<!-- <div>2164.55</div>-->
<!-- </div>-->
<!-- <el-divider></el-divider>-->
<!--&lt;!&ndash; 六个一条线 &ndash;&gt;-->
<!-- <div class="input-box">-->
<!-- <div>会员储值(订单)</div>-->
<!-- <div>{{ handoverList.orderSummary.cardOrder }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>会员储值(退款)</div>-->
<!-- <div>-{{ handoverList.orderSummary.cardRefund }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>会员储值(实收)</div>-->
<!-- <div>{{ handoverList.orderSummary.cardPaid }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>储值赠送(订单)</div>-->
<!-- <div>{{ handoverList.orderSummary.cardGiftOrder }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>储值赠送(退款)</div>-->
<!-- <div>{{ handoverList.orderSummary.cardGiftRefund }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>储值赠送(实际)</div>-->
<!-- <div>{{ handoverList.orderSummary.cardGiftPaid }}</div>-->
<!-- </div>-->
<div class="box-ge">
<div class="input-box">
<div>油站名称:</div>
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.storeName : '未知油站' }}</div>
</div>
<div class="input-box">
<div>收银员:</div>
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.realName : '未知姓名' }}</div>
</div>
<div class="input-box">
<div>交班方式:</div>
<div>门店统一交班</div>
</div>
<div class="input-box">
<div>开始时间:</div>
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.startTime : '/--/' }}</div>
<!-- <el-divider></el-divider>-->
<!-- <div class="input-box">-->
<!-- <div>存油储值(订单)</div>-->
<!-- <div>{{ handoverList.orderSummary.fuelOrder }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>存油储值(退款)</div>-->
<!-- <div>{{ handoverList.orderSummary.fuelRefund }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>存油储值(实收)</div>-->
<!-- <div>{{ handoverList.orderSummary.fuelPaid }}</div>-->
<!-- </div>-->
</div>
<div class="input-box">
<div>结束时间:</div>
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.endTime : '/--/' }}</div>
<!-- <el-divider></el-divider>-->
<!-- <div class="input-box">-->
<!-- <div>普通收款(订单)</div>-->
<!-- <div>{{ handoverList.orderSummary.goodsOrder }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>普通收款(退款)</div>-->
<!-- <div>-{{ handoverList.orderSummary.goodsRefund }}</div>-->
<!-- </div>-->
<!-- <div class="input-box">-->
<!-- <div>普通收款(实收)</div>-->
<!-- <div>{{ handoverList.orderSummary.goodsPaid }}</div>-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
<div class="box-ge">
<div class="input-box">
<div>当前版本:</div>
<div>V1.0.1</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">订单汇总</div>
<div class="input-hui">
<div>类型</div>
<div>金额</div>
</div>
<div class="input-box">
<div>油品订单(订单)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilOrder : '0' }}</div>
</div>
<div class="input-box">
<div>油品订单(退款)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilRefund : '0' }}</div>
</div>
<div class="input-box">
<div>油品订单(实收)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilPaid : '0' }}</div>
</div>
<div class="input-box">
<div>油品优惠(实收)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilDiacount : '0' }}</div>
</div>
<!-- <div class="input-box">-->
<!-- <div>抹零总额(实收)</div>-->
<!-- <div>2164.55</div>-->
<!-- </div>-->
<el-divider></el-divider>
<!-- 六个一条线 -->
<div class="input-box">
<div>会员储值(订单)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardOrder : '0' }}</div>
</div>
<div class="input-box">
<div>会员储值(退款)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardRefund : '0' }}</div>
</div>
<div class="input-box">
<div>会员储值(实收)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardPaid : '0' }}</div>
</div>
<div class="input-box">
<div>储值赠送(订单)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardGiftOrder : '0' }}</div>
</div>
<div class="input-box">
<div>储值赠送(退款)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardGiftRefund : '0' }}</div>
</div>
<div class="input-box">
<div>储值赠送(实际)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardGiftPaid : '0' }}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>存油储值(订单)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.fuelOrder : '0' }}</div>
</div>
<div class="input-box">
<div>存油储值(退款)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.fuelRefund : '0' }}</div>
</div>
<div class="input-box">
<div>存油储值(实收)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.fuelPaid : '0' }}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>普通收款(订单)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.goodsOrder : '0' }}</div>
</div>
<div class="input-box">
<div>普通收款(退款)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.goodsRefund : '0' }}</div>
</div>
<div class="input-box">
<div>普通收款(实收)</div>
<div>{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.goodsPaid : '0' }}</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">退款汇总</div>
<div class="input-hui">
<div>支付方式</div>
<div>退款金额</div>
</div>
<div class="input-box" v-for="item in paymentAggregation('all')" v-if="item.refundAmount > 0">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.refundAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div class="input-box" >
<div>合计</div>
<div>2164.55</div>
<div>{{refundAggregateTotal}}</div>
</div>
</div>
@ -139,26 +156,14 @@
<div>支付方式</div>
<div>金额</div>
</div>
<div class="input-box">
<div>现金</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>储值卡</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>加油金</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>银行转1</div>
<div>2164.55</div>
<div class="input-box" v-for="item in paymentAggregation('all')" v-if="item.paidAmount > 0">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>2164.55</div>
<div>{{totalTotalOfActualReceipts}}</div>
</div>
</div>
@ -168,26 +173,14 @@
<div>支付方式</div>
<div>金额</div>
</div>
<div class="input-box">
<div>现金</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>储值卡</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>加油金</div>
<div>2164.55</div>
</div>
<div class="input-box">
<div>银行转1</div>
<div>2164.55</div>
<div class="input-box" v-for="item in paymentAggregation('oil')">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>2164.55</div>
<div>{{totalOilOrders}}</div>
</div>
</div>
<div class="box-ge">
@ -196,40 +189,66 @@
<div>支付方式</div>
<div>金额</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>0.00</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">普通订单</div>
<div class="input-hui">
<div>支付方式</div>
<div>金额</div>
<div class="input-box" v-for="item in paymentAggregation('goods')">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>0.00</div>
<div>{{totalOfProductOrders}}</div>
</div>
</div>
<!-- <div class="box-ge">-->
<!-- <div class="boloicon">普通订单</div>-->
<!-- <div class="input-hui">-->
<!-- <div>支付方式</div>-->
<!-- <div>金额</div>-->
<!-- </div>-->
<!-- <div class="input-box" v-for="item in paymentAggregation('goods')">-->
<!-- <div>{{calculateThePaymentMethod(item.payType)}}</div>-->
<!-- <div>{{item.paidAmount}}</div>-->
<!-- </div>-->
<!-- <el-divider></el-divider>-->
<!-- <div class="input-box">-->
<!-- <div>合计</div>-->
<!-- <div>0.00</div>-->
<!-- </div>-->
<!-- </div>-->
<div class="box-ge">
<div class="boloicon">会员储值</div>
<div class="input-hui">
<div>支付方式</div>
<div>金额</div>
</div>
<div class="input-box">
<div>现金</div>
<div>888.88</div>
<div class="input-box" v-for="item in paymentAggregation('fg')">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{totalMemberStoredValue}}</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">积分商城</div>
<div class="input-hui">
<div>支付方式</div>
<div>金额</div>
</div>
<div class="input-box" v-for="item in paymentAggregation('point')" v-if="item.paidAmount>0">
<div>{{calculateThePaymentMethod(item.payType)}}</div>
<div>{{item.paidAmount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>{{pointsMallStatistics}}</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">油号统计</div>
<div class="input-hui-frou">
@ -238,23 +257,16 @@
<div>升数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou">
<div>92#</div>
<div>9</div>
<div>1447.03</div>
<div style="text-align: right">888.88</div>
<div class="input-box-frou" v-for="item in oilNumberStatistics()">
<div>{{item.oilName}}</div>
<div>{{item.numberOfDeals}}</div>
<div>{{item.oilNum}}</div>
<div style="text-align: right">{{item.paidAmount}}</div>
</div>
<div class="input-box-frou">
<div>92#</div>
<div>9</div>
<div>1447.03</div>
<div style="text-align: right">888.88</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{totalOilNumberStatistics}}</div>
</div>
</div>
<div class="box-ge">
@ -263,14 +275,14 @@
<div>油品</div>
<div>金额</div>
</div>
<div class="input-box">
<div>92#</div>
<div>888.88</div>
<div class="input-box" v-for="item in oilNumberStatistics()">
<div>{{item.oilName}}</div>
<div>{{item.paidDiscount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{discountStatisticsTotal}}</div>
</div>
</div>
<div class="box-ge">
@ -281,23 +293,16 @@
<div>升数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou">
<div>一号枪</div>
<div>9</div>
<div>1447.03</div>
<div style="text-align: right">888.88</div>
<div class="input-box-frou" v-for="item in greaseGunStatistics()">
<div>{{item.gunName}}</div>
<div>{{item.numberOfDeals}}</div>
<div>{{item.oilNum}}</div>
<div style="text-align: right">{{item.paidAmount}}</div>
</div>
<div class="input-box-frou">
<div>二号枪</div>
<div>9</div>
<div>1447.03</div>
<div style="text-align: right">888.88</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{totalOfOilGunStatistics}}</div>
</div>
</div>
@ -306,47 +311,67 @@
<div class="input-hui-frou">
<div>员工姓名</div>
<div>笔数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou">
<div>一号员工</div>
<div>9</div>
<div style="text-align: right">888.88</div>
<div class="input-box-frou" v-for="item in employeeStatistics()">
<div>{{item.name}}</div>
<div>{{item.numberOfDeals}}</div>
<div style="text-align: right">{{item.paidAmount}}</div>
</div>
<div class="input-box-frou">
<div>二号员工</div>
<div>9</div>
<div style="text-align: right">888.88</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>888.88</div>
<div>{{totalOfEmployeeStatistics}}</div>
</div>
</div>
<div class="box-ge">
<div class="boloicon">挂账统计</div>
<el-divider>挂账详情</el-divider>
<div class="input-hui-frou">
<div>挂账单位</div>
<div>笔数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou" v-for="item in billingDetails()">
<div>{{item.name}}</div>
<div>{{item.numberOfDeals}}</div>
<div style="text-align: right">{{item.amount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>{{statisticsOfAccountDetails}}</div>
</div>
<el-divider>归还详情</el-divider>
<div class="input-hui-frou">
<div>挂账单位</div>
<div>笔数</div>
<div style="text-align: right">金额</div>
</div>
<div class="input-box-frou" v-for="item in returnedToTheAccount()">
<div>{{item.name}}</div>
<div>{{item.numberOfDeals}}</div>
<div style="text-align: right">{{item.amount}}</div>
</div>
<el-divider></el-divider>
<div class="input-box">
<div>合计</div>
<div>{{postedAccountReturnStatistics}}</div>
</div>
</div>
</div>
<div style="width: 100%; height: 100px"></div>
<!-- <div class="app-bottom">-->
<!-- <el-card >-->
<!-- <div class="bottom-xz">-->
<!-- <div class="anniu" @click="shift">交班</div>-->
<!-- <div class="anniu-lv">云打印</div>-->
<!-- <div class="anniu-lv">本地打印</div>-->
<!-- <div ><el-link type="primary" @click="recording">交班记录</el-link></div>-->
<!-- </div>-->
<!-- </el-card>-->
<!-- </div>-->
</div>
</template>
<script>
import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
import BigNumber from "bignumber.js";
export default {
name: "HandoverOnly",
@ -360,8 +385,9 @@ import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
},
created() {
console.log("12312231",this.recordData)
this.handoverList = this.recordData
// this.getHandover();
this.handoverList = JSON.parse(this.recordData)
// this.getHandover();
},
methods: {
// getHandover() {
@ -380,6 +406,89 @@ import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
}
});
},
paymentAggregation(flag) {
let count = [];
if (this.handoverList && this.handoverList.paymentAggregation) {
this.handoverList.paymentAggregation.forEach(res=> {
if (flag == 'fg') {
if (res.flag == 'fuel' || res.flag == 'card') {
let existingElementIndex = count.findIndex(item => item.payType === res.payType);
if (existingElementIndex !== -1) {
// let existingElement = count[existingElementIndex];
// paidAmount refundAmount
// existingElement.paidAmount = (Number(existingElement.paidAmount) || 0) + (Number(res.paidAmount) || 0);
// existingElement.refundAmount = (Number(existingElement.refundAmount) || 0) + (Number(res.refundAmount) || 0);
//
// existingElement.paidAmount = existingElement.paidAmount.toString();
// existingElement.refundAmount = existingElement.refundAmount.toString();
}else {
count.push(res);
}
}
}
else if (res.flag == flag) {
count.push(res)
}
})
}
return count;
},
calculateThePaymentMethod(payType) {
switch (payType) {
case 'ALIPAY':
return '支付宝'
break;
case 'WECHAT':
return '微信'
break;
case 'UNIONPAY':
return '银联二维码'
break;
case 'CASH':
return '现金'
break;
}
return '未知'
},
oilNumberStatistics() {
let count = [];
if (this.handoverList && this.handoverList.oilNumberStatistics) {
return this.handoverList.oilNumberStatistics
}
return count;
},
greaseGunStatistics() {
let count = [];
if (this.handoverList && this.handoverList.greaseGunStatistics) {
return this.handoverList.greaseGunStatistics
}
return count;
},
employeeStatistics() {
console.log("this.employeeStatistics",this.handoverList.employeeStatistics)
let count = [];
if (this.handoverList && this.handoverList.employeeStatistics) {
return this.handoverList.employeeStatistics
}
return count;
},
billingDetails() {
let count = [];
if (this.handoverList && this.handoverList.billingDetails) {
return this.handoverList.billingDetails
}
return count;
},
returnedToTheAccount() {
let count = [];
if (this.handoverList && this.handoverList.returnedToTheAccount) {
return this.handoverList.returnedToTheAccount
}
return count;
},
shift() {
this.$confirm('交班并退出系统, 是否继续?', '提示', {
confirmButtonText: '确定',
@ -409,6 +518,152 @@ import {addHandoverApi, getHandoverApi} from "@/api/cashier/handover";
});
});
}
},
computed:{
//退
refundAggregateTotal() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "all"){
num = num.plus(new BigNumber(res.refundAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalTotalOfActualReceipts() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "all") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalOilOrders() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "oil") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalOfProductOrders() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "goods") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalMemberStoredValue() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "card" || res.flag == "fuel") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
pointsMallStatistics() {
if (this.handoverList && this.handoverList.paymentAggregation) {
let num = new BigNumber(0);
this.handoverList.paymentAggregation.forEach(res => {
if (res.flag == "point") {
num = num.plus(new BigNumber(res.paidAmount));
}
});
return Number(num.toString()); //
}
return 0.00;
},
//
totalOilNumberStatistics() {
if (this.handoverList && this.handoverList.oilNumberStatistics) {
let num = new BigNumber(0);
this.handoverList.oilNumberStatistics.forEach(res=>{
num = num.plus(new BigNumber(res.paidAmount));
})
return Number(num.toString()); //
}
return 0;
},
//
discountStatisticsTotal() {
if (this.handoverList && this.handoverList.oilNumberStatistics) {
let num = new BigNumber(0);
this.handoverList.oilNumberStatistics.forEach(res=>{
num = num.plus(new BigNumber(res.paidDiscount));
})
return Number(num.toString()); //
}
return 0;
},
//
totalOfOilGunStatistics() {
if (this.handoverList && this.handoverList.greaseGunStatistics) {
let num = new BigNumber(0);
this.handoverList.greaseGunStatistics.forEach(res=>{
num = num.plus(new BigNumber(res.paidAmount));
})
return Number(num.toString()); //
}
return 0;
},
//
totalOfEmployeeStatistics() {
if (this.handoverList && this.handoverList.employeeStatistics) {
let num = new BigNumber(0);
this.handoverList.employeeStatistics.forEach(res=>{
num = num.plus(new BigNumber(res.paidAmount));
})
return Number(num.toString()); //
}
return 0;
},
//
statisticsOfAccountDetails(){
if (this.handoverList && this.handoverList.billingDetails) {
let num = new BigNumber(0);
this.handoverList.billingDetails.forEach(res=>{
num = num.plus(new BigNumber(res.amount));
})
return Number(num.toString()); //
}
return 0;
},
//
postedAccountReturnStatistics(){
if (this.handoverList && this.handoverList.returnedToTheAccount) {
let num = new BigNumber(0);
this.handoverList.returnedToTheAccount.forEach(res=>{
num = num.plus(new BigNumber(res.amount));
})
return Number(num.toString()); //
}
return 0;
}
}
}