bug处理

This commit is contained in:
wangh 2024-01-27 17:51:20 +08:00
parent a89ca421cd
commit f56fab7e9d
31 changed files with 232 additions and 198 deletions

View File

@ -541,6 +541,7 @@ export default {
async save(flag){ async save(flag){
let this_ = this let this_ = this
let con = true
// //
if (this_.damageForm.orderNumber == null) { if (this_.damageForm.orderNumber == null) {
this.$modal.msgError("货损单号不能为空"); this.$modal.msgError("货损单号不能为空");
@ -561,6 +562,7 @@ export default {
this.queryParams.damageId = res.data.id this.queryParams.damageId = res.data.id
}).catch(res=>{ }).catch(res=>{
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con = false
return; return;
}) })
}else { }else {
@ -570,11 +572,12 @@ export default {
await editDamageApi(this_.damageForm).then(res=> { await editDamageApi(this_.damageForm).then(res=> {
}).catch(res=>{ }).catch(res=>{
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con = false
return; return;
}) })
} }
// //
if (con) {
this_.detailsList.forEach(data=>{ this_.detailsList.forEach(data=>{
data.damageId = this_.damageId data.damageId = this_.damageId
}) })
@ -585,8 +588,10 @@ export default {
this.goToAbout(); this.goToAbout();
} }
}).catch(res=>{ }).catch(res=>{
this.$modal.msgError("保存失败"); // this.$modal.msgError("");
}) })
}
}, },
// //

View File

@ -568,6 +568,7 @@ export default {
async save(flag){ async save(flag){
let this_ = this let this_ = this
let con = true
// //
if (this_.purchaseForm.orderNumber == null) { if (this_.purchaseForm.orderNumber == null) {
this.$modal.msgError("进货单号不能为空"); this.$modal.msgError("进货单号不能为空");
@ -583,24 +584,38 @@ export default {
if (this_.purchaseId == null) { if (this_.purchaseId == null) {
// //
await addPurchaseApi(this_.purchaseForm).then(res=>{ await addPurchaseApi(this_.purchaseForm).then(res=>{
if (res.code === 200) {
this_.purchaseId = res.data.id this_.purchaseId = res.data.id
this.queryParams.purchaseId = res.data.id this.queryParams.purchaseId = res.data.id
}else {
this.$modal.msgError("保存失败");
con=false
return -1;
}
}).catch(res=>{ }).catch(res=>{
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
return; con=false
return -1;
}) })
}else { }else {
// //
this_.purchaseForm.id = this_.purchaseId this_.purchaseForm.id = this_.purchaseId
this.queryParams.purchaseId = this_.purchaseId this.queryParams.purchaseId = this_.purchaseId
await editPurchaseApi(this_.purchaseForm).then(res=> { await editPurchaseApi(this_.purchaseForm).then(res=> {
if (res.code !== 200){
this.$modal.msgError("保存失败");
con=false
return -1;
}
}).catch(res=>{ }).catch(res=>{
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
return; con=false
return -1;
}) })
} }
//
if (con) {
//
this_.detailsList.forEach(data=>{ this_.detailsList.forEach(data=>{
data.purchaseId = this_.purchaseId data.purchaseId = this_.purchaseId
}) })
@ -612,8 +627,12 @@ export default {
} }
}).catch(res=>{ }).catch(res=>{
this.$modal.msgError("保存失败"); // this.$modal.msgError("");
}) })
}
}, },
// //

View File

@ -557,6 +557,7 @@ export default {
async save(flag){ async save(flag){
let this_ = this let this_ = this
let con = true
// //
if (this_.returnsForm.orderNumber == null) { if (this_.returnsForm.orderNumber == null) {
this.$modal.msgError("退货单号不能为空"); this.$modal.msgError("退货单号不能为空");
@ -577,7 +578,9 @@ export default {
this.queryParams.returnsId = res.data.id this.queryParams.returnsId = res.data.id
}).catch(res=>{ }).catch(res=>{
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con = false
return; return;
}) })
}else { }else {
// //
@ -586,11 +589,13 @@ export default {
await editReturnsApi(this_.returnsForm).then(res=> { await editReturnsApi(this_.returnsForm).then(res=> {
}).catch(res=>{ }).catch(res=>{
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con = false
return; return;
}) })
} }
// //
if (con) {
this_.detailsList.forEach(data=>{ this_.detailsList.forEach(data=>{
data.returnsId = this_.returnsId data.returnsId = this_.returnsId
}) })
@ -603,6 +608,8 @@ export default {
}).catch(res=>{ }).catch(res=>{
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
}) })
}
}, },
// //

View File

@ -29,7 +29,7 @@
<div class="xs">储值卡销售额</div> <div class="xs">储值卡销售额</div>
<div class="xs">屯油卡销售额</div> <div class="xs">屯油卡销售额</div>
<div class="xs">油品销售额</div> <div class="xs">油品销售额</div>
<div class="xse">总销售额()</div> <div class="xse">总销售额()</div>
</div> </div>
<template v-loading="employeLoading" > <template v-loading="employeLoading" >
<div class="four-boxx" v-for="(item,index) in employeList" :key="index" > <div class="four-boxx" v-for="(item,index) in employeList" :key="index" >

View File

@ -112,7 +112,7 @@
</el-table-column> </el-table-column>
<el-table-column label="可用" align="center" prop="remainingInventory" width="80px"> <el-table-column label="可用" align="center" prop="remainingInventory" width="80px">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.totalInventory===-1?scope.row.totalInventory-scope.row.usedInventory+1: scope.row.totalInventory-scope.row.usedInventory}}</span> <span>{{ scope.row.totalInventory===-1?'无限制': scope.row.remainingInventory}}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -134,7 +134,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row),getStock(scope.row)"
>修改</el-button> >修改</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -276,9 +276,10 @@
<!-- </el-select> --> <!-- </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7" v-if="showList.goods">
<el-form-item label="礼品数量" prop="giftQuantity" style="width: 202px;"> <!-- giftQuantity-->
<el-input-number v-model="dataForm.giftQuantity" controls-position="right" :min="1" :max="10" label=""></el-input-number> <el-form-item label="商品库存" prop="">
<el-input v-model="stock" controls-position="right" :min="1" :max="10" label="" style="width: 202px;" :disabled="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -548,7 +549,7 @@ import {getGiftCategoryApi} from "@/api/integral/category";
import {getGiftApi,insertGiftApi,updateGiftApi ,updateGiftInventoryApi,getCardFavorableApi,getCardExchangeApi} from "@/api/integral/gift"; import {getGiftApi,insertGiftApi,updateGiftApi ,updateGiftInventoryApi,getCardFavorableApi,getCardExchangeApi} from "@/api/integral/gift";
import { editor } from '@/components/Editor/index' import { editor } from '@/components/Editor/index'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import {listLJGoods} from "@/api/convenienceStore/ljgoods"; import {listLJGoods, getLJGoods} from "@/api/convenienceStore/ljgoods";
import {selectParentById, selectTree} from "@/api/convenienceStore/goods"; import {selectParentById, selectTree} from "@/api/convenienceStore/goods";
@ -582,7 +583,7 @@ export default {
giftImages: [], // giftImages: [], //
giftType:"优惠券", // giftType:"优惠券", //
couponId:'',// couponId:'',//
giftQuantity:'', // giftQuantity: 1, //
totalInventory:'', // totalInventory:'', //
exchangeMethod:'积分', // exchangeMethod:'积分', //
exchangePoints:'', // exchangePoints:'', //
@ -599,7 +600,7 @@ export default {
status: '启用', status: '启用',
market:null market:null
}, },
stock: 0, //
inventoryForm: { inventoryForm: {
inventoryFlag: 0, inventoryFlag: 0,
remainingInventory: null, // remainingInventory: null, //
@ -764,12 +765,25 @@ export default {
watch: { watch: {
getGiftTypeShow: function(newVal) { getGiftTypeShow: function(newVal) {
} }
}, },
async created() { async created() {
await this.getList(); await this.getList();
}, },
methods: { methods: {
// id 使
getStock(data) {
if (data.giftType === '实物商品') {
getLJGoods(data.goodsId).then(res=>{
if (res.data.stock) {
this.stock = res.data.stock
}
})
}
},
getList() { getList() {
getGiftApi(this.queryParams).then(res=>{ getGiftApi(this.queryParams).then(res=>{
this.dataList = res.data.records this.dataList = res.data.records
@ -963,7 +977,7 @@ export default {
status: '启用', status: '启用',
market:null market:null
} }
this.stock = 0,
this.showList = { this.showList = {
// //
coupon: true, coupon: true,
@ -1233,6 +1247,7 @@ export default {
console.log("row",row) console.log("row",row)
// stock // stock
this.dataForm.totalInventory = row.stock this.dataForm.totalInventory = row.stock
this.stock = row.stock
this.dataForm.market = row.retailPrice this.dataForm.market = row.retailPrice
this.dataForm.goodsName = row.name this.dataForm.goodsName = row.name
this.dataForm.goodsId = row.id this.dataForm.goodsId = row.id

View File

@ -231,6 +231,13 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
watch: {
openOutcome(newValue) {
if (!newValue) {
this.created();
}
}
},
methods: { methods: {
async getList(){ async getList(){
await getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{ await getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{

View File

@ -128,7 +128,7 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="选择油号"> <el-form-item label="选择油号">
<el-select v-model="tankForm.numberId" placeholder="请选择油品号" style="width:100%" @change="chooseOilNumber()"> <el-select v-model="tankForm.numberId" placeholder="请选择油品号" style="width:100%" @change="chooseOilNumber()" clearable>
<el-option <el-option
v-for="option in selectOilTypeByPrice" v-for="option in selectOilTypeByPrice"
:key="option.numberId" :key="option.numberId"

View File

@ -55,7 +55,8 @@
label="预设油号" label="预设油号"
> >
</el-table-column> </el-table-column>
<el-table-column label="当前数据" style="width: 100%"> <el-table-column label="当前数据" style="width: 100%" align="center"
>
<el-table-column <el-table-column
prop="currentPetrolPrices" prop="currentPetrolPrices"
align="center" align="center"
@ -63,15 +64,16 @@
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="presetOilPrices" prop="currentGbPrice"
align="center" align="center"
label="国标价" label="国标价"
> >
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="预设新数据" style="width: 100%"> <el-table-column label="预设新数据" style="width: 100%" align="center"
>
<el-table-column <el-table-column
prop="currentPetrolPrices" prop="presetOilPrices"
align="center" align="center"
label="油站价" label="油站价"
> >
@ -321,7 +323,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="当前油站价"> <el-form-item label="当前油站价">
<el-input v-model="oilPresetPrices.currentGbPrice" style="width: 217px" readonly disabled> <el-input v-model="oilPresetPrices.currentPetrolPrices " style="width: 217px" readonly disabled>
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -331,7 +333,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="当前国标价"> <el-form-item label="当前国标价">
<el-input v-model="oilPresetPrices.currentPetrolPrices" style="width: 217px" readonly disabled> <el-input v-model="oilPresetPrices.currentGbPrice" style="width: 217px" readonly disabled>
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item> </el-form-item>

View File

@ -107,7 +107,7 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="油罐体积" prop="tankVolume"> <el-form-item label="油罐体积" prop="tankVolume">
<el-input v-model="tankForm.tankVolume" placeholder="请输入油罐体积" maxlength="30" :disabled="disableInput"> <el-input v-model="tankForm.tankVolume" placeholder="请输入油罐体积" maxlength="30" @change="changeNumber" :disabled="disableInput">
<template slot="append">{{tankForm.unit}}</template> <template slot="append">{{tankForm.unit}}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -419,6 +419,7 @@ export default {
if (this_.tankForm.totalPrice != null && this_.tankForm.storedQuantity != null) { if (this_.tankForm.totalPrice != null && this_.tankForm.storedQuantity != null) {
if (!this.checkNumeric(this_.tankForm.totalPrice)) { if (!this.checkNumeric(this_.tankForm.totalPrice)) {
this_.tankForm.totalPrice = 0 this_.tankForm.totalPrice = 0
@ -438,6 +439,15 @@ export default {
var this_=this var this_=this
// console.log("this_.tankForm.tankVolume",this_.tankForm.tankVolume)
// console.log("this_.tankForm.storedQuantity",this_.tankForm.storedQuantity)
// if (this_.tankForm.tankVolume)
if (parseFloat(this_.tankForm.storedQuantity) > parseFloat(this_.tankForm.tankVolume)) {
console.log("Stored quantity exceeds tank volume");
this_.tankForm.storedQuantity = parseFloat(this_.tankForm.tankVolume);
}
if (this_.tankForm.totalPrice != null) { if (this_.tankForm.totalPrice != null) {
if (!this.checkNumeric(this_.tankForm.totalPrice)) { if (!this.checkNumeric(this_.tankForm.totalPrice)) {
this_.tankForm.totalPrice = 0 this_.tankForm.totalPrice = 0

View File

@ -31,7 +31,7 @@ public class MtDamage extends BaseEntity {
/** /**
* 制单日期 * 制单日期
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date orderDate; private Date orderDate;
/** /**
* 审核人 * 审核人

View File

@ -31,7 +31,7 @@ public class MtInventory extends BaseEntity {
/** /**
* 制单日期 * 制单日期
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date orderDate; private Date orderDate;
/** /**
* 审核人 * 审核人

View File

@ -31,7 +31,7 @@ public class MtPurchase extends BaseEntity {
/** /**
* 制单日期 * 制单日期
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date orderDate; private Date orderDate;
/** /**
* 审核人 * 审核人

View File

@ -31,7 +31,7 @@ public class MtReturns extends BaseEntity {
/** /**
* 制单日期 * 制单日期
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date orderDate; private Date orderDate;
/** /**
* 审核人 * 审核人

View File

@ -255,6 +255,7 @@
and mg.supplier_id = #{mtDamage.supplierId} and mg.supplier_id = #{mtDamage.supplierId}
</if> </if>
group by mp.id group by mp.id
order by mp.order_date desc
</select> </select>
<!-- . <if test="mtReturns.supplierId != null">--> <!-- . <if test="mtReturns.supplierId != null">-->

View File

@ -153,6 +153,8 @@
</where> </where>
GROUP BY GROUP BY
mp.id mp.id
order by mp.create_time desc
</select> </select>
<!--新增所有列--> <!--新增所有列-->

View File

@ -1,5 +1,6 @@
package com.fuint.business.convenienceSore.service.impl; package com.fuint.business.convenienceSore.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fuint.business.convenienceSore.entity.MtDamageDetails; import com.fuint.business.convenienceSore.entity.MtDamageDetails;
@ -115,8 +116,9 @@ public class MtDamageDetailsServiceImpl implements MtDamageDetailsService {
AccountInfo accountInfoByToken = TokenUtil.getNowAccountInfo(); AccountInfo accountInfoByToken = TokenUtil.getNowAccountInfo();
if (mtDamageDetails.size() > 0) { if (ObjectUtil.isNotEmpty(mtDamageDetails)) {
for (MtDamageDetails mtDamageDetails1 : mtDamageDetails) { for (MtDamageDetails mtDamageDetails1 : mtDamageDetails) {
if (ObjectUtil.isEmpty(mtDamageDetails1.getDamageId())) continue;
mtDamageDetails1.setStoreId(accountInfoByToken.getStoreId()); mtDamageDetails1.setStoreId(accountInfoByToken.getStoreId());
mtDamageDetails1.setCreateBy(accountInfoByToken.getStaffId().toString()); mtDamageDetails1.setCreateBy(accountInfoByToken.getStaffId().toString());
if (mtDamageDetails1.getId() != null) { if (mtDamageDetails1.getId() != null) {
@ -125,10 +127,10 @@ public class MtDamageDetailsServiceImpl implements MtDamageDetailsService {
mtDamageDetailsIns.add(mtDamageDetails1); mtDamageDetailsIns.add(mtDamageDetails1);
} }
} }
if (mtDamageDetailsIns.size()>0) { if (ObjectUtil.isNotEmpty(mtDamageDetailsIns)) {
mtDamageDetailsDao.insertBatch(mtDamageDetailsIns); mtDamageDetailsDao.insertBatch(mtDamageDetailsIns);
} }
if (mtDamageDetailsEdit.size()>0) { if (ObjectUtil.isNotEmpty(mtDamageDetailsEdit)) {
mtDamageDetailsDao.editBatch(mtDamageDetailsEdit); mtDamageDetailsDao.editBatch(mtDamageDetailsEdit);
} }
return true; return true;

View File

@ -1,5 +1,6 @@
package com.fuint.business.convenienceSore.service.impl; package com.fuint.business.convenienceSore.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails; import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
@ -95,9 +96,9 @@ public class MtPurchaseDetailsServiceImpl implements MtPurchaseDetailsService {
List<MtPurchaseDetails> mtPurchaseDetailsEdit = new ArrayList<>(); List<MtPurchaseDetails> mtPurchaseDetailsEdit = new ArrayList<>();
AccountInfo accountInfoByToken = TokenUtil.getNowAccountInfo(); AccountInfo accountInfoByToken = TokenUtil.getNowAccountInfo();
if (mtPurchaseDetails.size() > 0) { if (mtPurchaseDetails.size() > 0) {
for (MtPurchaseDetails mtPurchaseDetail : mtPurchaseDetails) { for (MtPurchaseDetails mtPurchaseDetail : mtPurchaseDetails) {
if (ObjectUtil.isEmpty(mtPurchaseDetail.getPurchaseId())) continue;
mtPurchaseDetail.setStoreId(accountInfoByToken.getStoreId()); mtPurchaseDetail.setStoreId(accountInfoByToken.getStoreId());
mtPurchaseDetail.setCreateBy(accountInfoByToken.getStaffId().toString()); mtPurchaseDetail.setCreateBy(accountInfoByToken.getStaffId().toString());
if (mtPurchaseDetail.getId() != null) { if (mtPurchaseDetail.getId() != null) {

View File

@ -1,5 +1,6 @@
package com.fuint.business.convenienceSore.service.impl; package com.fuint.business.convenienceSore.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails; import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
@ -91,6 +92,7 @@ public class MtReturnsDetailsServiceImpl implements MtReturnsDetailsService {
if (mtReturnsDetails.size() > 0) { if (mtReturnsDetails.size() > 0) {
for (MtReturnsDetails mtReturnsDetail : mtReturnsDetails) { for (MtReturnsDetails mtReturnsDetail : mtReturnsDetails) {
if (ObjectUtil.isEmpty(mtReturnsDetail.getReturnsId())) continue;
mtReturnsDetail.setStoreId(accountInfoByToken.getStoreId()); mtReturnsDetail.setStoreId(accountInfoByToken.getStoreId());
mtReturnsDetail.setCreateBy(accountInfoByToken.getStaffId().toString()); mtReturnsDetail.setCreateBy(accountInfoByToken.getStaffId().toString());
if (mtReturnsDetail.getId() != null) { if (mtReturnsDetail.getId() != null) {

View File

@ -416,7 +416,7 @@
update integral_gift update integral_gift
set set
remaining_inventory = remaining_inventory - #{editInventory}, -- 剩余库存 remaining_inventory = remaining_inventory - #{editInventory}, -- 剩余库存
total_inventory = used_inventory + #{editInventory}, -- 使用库存 used_inventory = used_inventory + #{editInventory}, -- 使用库存
update_time = NOW() update_time = NOW()
where id =#{id} where id =#{id}
</update> </update>

View File

@ -186,6 +186,7 @@
card_value_record card_value_record
WHERE WHERE
store_id = #{storeId} store_id = #{storeId}
) )
card_value_record ON DATE(card_value_record.create_time) = date_range.date card_value_record ON DATE(card_value_record.create_time) = date_range.date
WHERE WHERE

View File

@ -49,14 +49,31 @@
COALESCE(SUM(cfr.recharge_balance), 0) AS totalSum COALESCE(SUM(cfr.recharge_balance), 0) AS totalSum
FROM FROM
mt_staff ms mt_staff ms
LEFT JOIN oil_order oo ON ms.id = oo.staff_id LEFT JOIN (
LEFT JOIN card_value_record cvr ON ms.id = cvr.mt_staff_id SELECT staff_id, COALESCE(SUM(pay_amount), 0) AS pay_amount
LEFT JOIN card_fuel_record cfr ON ms.id = cfr.mt_staff_id FROM oil_order
where ms.store_id = #{storeId} WHERE order_status = 'paid'
GROUP BY staff_id
) oo ON ms.id = oo.staff_id
LEFT JOIN (
SELECT mt_staff_id, COALESCE(SUM(recharge_balance), 0) AS recharge_balance
FROM card_value_record
WHERE pay_status = 'paid'
GROUP BY mt_staff_id
) cvr ON ms.id = cvr.mt_staff_id
LEFT JOIN (
SELECT mt_staff_id, COALESCE(SUM(recharge_balance), 0) AS recharge_balance
FROM card_fuel_record
WHERE pay_status = 'paid'
GROUP BY mt_staff_id
) cfr ON ms.id = cfr.mt_staff_id
WHERE
ms.store_id = #{storeId}
GROUP BY GROUP BY
ms.id, ms.real_name ms.id, ms.real_name
ORDER BY ORDER BY
totalSum DESC totalSum DESC;
</select> </select>
<select id="employeeSalesMongth" resultType="java.util.Map"> <select id="employeeSalesMongth" resultType="java.util.Map">

View File

@ -30,7 +30,7 @@ public class OilInventory extends BaseEntity {
/** /**
* 盘点时间 * 盘点时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date inventoryTime; private Date inventoryTime;
/** /**
* 盘点升数 * 盘点升数
@ -55,7 +55,7 @@ public class OilInventory extends BaseEntity {
/** /**
* 制单时间 * 制单时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date orderTime; private Date orderTime;
/** /**
* 状态 * 状态

View File

@ -36,6 +36,7 @@ public interface MtStoreMapper extends BaseMapper<MtStore> {
* @return * @return
*/ */
int editStatusBydeptIdList(@Param("list") List<SysDept> sysDeptsByjy); int editStatusBydeptIdList(@Param("list") List<SysDept> sysDeptsByjy);
int beachDelStore(@Param("list") List<SysDept> sysDeptsByjy);
// 批量修改该状态根据部门 // 批量修改该状态根据部门
int editStatusBydeptId(@Param("deptId") Long deptId); int editStatusBydeptId(@Param("deptId") Long deptId);

View File

@ -12,6 +12,16 @@
</foreach> </foreach>
</update> </update>
<update id="beachDelStore" parameterType="java.util.List">
update mt_store
set if_delete = '1'
where contract_dept_id IN
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item.deptId}
</foreach>
</update>
<update id="editStatusByExpirationTime"> <update id="editStatusByExpirationTime">
update mt_store update mt_store
set status = 'jy' set status = 'jy'

View File

@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
inner join mt_store ms on ms.chain_store_id = csi.id inner join mt_store ms on ms.chain_store_id = csi.id
where sd.ancestors like concat(#{ownDeptStr},'%') where sd.ancestors like concat(#{ownDeptStr},'%')
and csi.status = 'qy' and csi.status = 'qy'
and sd.if_delete = 0
<if test="chainStoreInfo.storeName !=null and chainStoreInfo.storeName !=''"> <if test="chainStoreInfo.storeName !=null and chainStoreInfo.storeName !=''">
and (csi.store_name like concat('%',#{chainStoreInfo.storeName},'%') or ms.name like concat('%',#{chainStoreInfo.storeName},'%')) and (csi.store_name like concat('%',#{chainStoreInfo.storeName},'%') or ms.name like concat('%',#{chainStoreInfo.storeName},'%'))
</if> </if>

View File

@ -57,6 +57,7 @@ public class ChainStoreInfoServiceImpl extends ServiceImpl<ChainStoreInfoMapper,
queryWrapper.eq(MtStore :: getStatus,chainStoreInfo.getStatus()); queryWrapper.eq(MtStore :: getStatus,chainStoreInfo.getStatus());
} }
queryWrapper.eq(MtStore::getIfDelete,0); queryWrapper.eq(MtStore::getIfDelete,0);
queryWrapper.eq(MtStore::getStatus,"qy");
queryWrapper.eq(MtStore::getChainStoreId,it.getId()).orderByDesc(BaseEntity::getCreateTime); queryWrapper.eq(MtStore::getChainStoreId,it.getId()).orderByDesc(BaseEntity::getCreateTime);
List<MtStore> list = storeService.list(queryWrapper); List<MtStore> list = storeService.list(queryWrapper);
for (MtStore mtStore : list) { for (MtStore mtStore : list) {
@ -76,6 +77,8 @@ public class ChainStoreInfoServiceImpl extends ServiceImpl<ChainStoreInfoMapper,
return res; return res;
} }
@Override @Override
public boolean theJudgmentIsTheSame(Integer chainStoreId) { public boolean theJudgmentIsTheSame(Integer chainStoreId) {
if (ObjectUtil.isEmpty(chainStoreId)) return false; if (ObjectUtil.isEmpty(chainStoreId)) return false;

View File

@ -541,7 +541,18 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
public void petrolStationsAreExpired() { public void petrolStationsAreExpired() {
// 直接修改 // 直接修改
mtStoreMapper.editStatusByExpirationTime(); mtStoreMapper.editStatusByExpirationTime();
beachDelStore();
}
// 将在部门里面删除的在油站中删除
public void beachDelStore() {
LambdaQueryWrapper<SysDept> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(SysDept::getIfDelete,"1");
List<SysDept> sysDepts = sysDeptMapper.selectList(lambdaQueryWrapper);
mtStoreMapper.beachDelStore(sysDepts);
} }

View File

@ -1,68 +0,0 @@
package com.fuint.business.store.task;
import lombok.extern.slf4j.Slf4j;
import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.quartz.JobDetailFactoryBean;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean;
import org.springframework.scheduling.support.CronTrigger;
import java.util.Date;
@Configuration
@Slf4j
public class QuartzConfig {
@Bean
public void job() {
//1.创建Scheduler的工厂
SchedulerFactory sf = new StdSchedulerFactory();
//2.从工厂中获取调度器实例
Scheduler scheduler = null;
try {
scheduler = sf.getScheduler();
} catch (SchedulerException e) {
e.printStackTrace();
}
//3.创建JobDetail
JobDetail jb = JobBuilder.newJob(streamTask.class) // Show 为一个job,是要执行的一个任务
.withDescription("这是我的测试定时任务。") //job的描述
.withIdentity("jy2Job", "jy2Group") //job 的name和group
.build();
//任务运行的时间SimpleSchedle类型触发器有效
long time = System.currentTimeMillis() + 3 * 1000L; // 3秒后启动任务
Date statTime = new Date(time);
//4.创建Trigger
//使用SimpleScheduleBuilder或者CronScheduleBuilder
// Trigger t = TriggerBuilder.newTrigger()
// .withDescription("")
// .withIdentity("jyTrigger", "jyTriggerGroup")
// //.withSchedule(SimpleScheduleBuilder.simpleSchedule())
// .startAt(statTime) //默认当前时间启动 ,也可以写为.startNow();
// .withSchedule(CronScheduleBuilder.cronSchedule("0 0 0 * * *")) //0点执行执行一次
//// .withSchedule(CronScheduleBuilder.cronSchedule("0/2 * * * * ?")) //两秒执行一次
// .build();
//5.注册任务和定时器
// try {
// scheduler.scheduleJob(jb, t);
// } catch (SchedulerException e) {
// e.printStackTrace();
// }
//6.启动 调度器
// try {
// scheduler.start();
// } catch (SchedulerException e) {
// e.printStackTrace();
// }
log.info("启动时间 " + new Date());
}
}

View File

@ -1,32 +0,0 @@
package com.fuint.business.store.task;
import com.fuint.business.store.controller.BackendStoreController;
import com.fuint.business.store.service.StoreService;
import org.quartz.*;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
/**
* 每日12点执行逻辑
*/
public class streamTask implements Job {
@Resource
StoreService storeService;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
// // 执行任务的逻辑
// System.out.println("24点定时任务执行中...");
// // 将流水上限和时间上限的部门全部设置为不可用
// storeService.flowflowConfiguration();
// // 将过期油站设置为不可用
// storeService.petrolStationsAreExpired();
}
}

View File

@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* 全局异常处理器 * 全局异常处理器
@ -69,9 +71,24 @@ public class GlobalExceptionHandler {
public ResponseObject handleRuntimeException(RuntimeException e, HttpServletRequest request) { public ResponseObject handleRuntimeException(RuntimeException e, HttpServletRequest request) {
String requestURI = request.getRequestURI(); String requestURI = request.getRequestURI();
log.error("请求地址'{}',发生未知异常.", requestURI, e); log.error("请求地址'{}',发生未知异常.", requestURI, e);
// 判断是否为自定义异常
if (containsChinese(e.getMessage())) {
return new ResponseObject(201, e.getMessage(), null); return new ResponseObject(201, e.getMessage(), null);
} else {
return new ResponseObject(201, "服务器异常,请联系管理员!", null);
} }
}
public static boolean containsChinese(String str) {
String regex = "[\\u4e00-\\u9fa5]";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(str);
return matcher.find();
}
/** /**
* 系统异常 * 系统异常
*/ */