bug处理
This commit is contained in:
parent
a89ca421cd
commit
f56fab7e9d
@ -39,7 +39,7 @@
|
||||
v-model="damageForm.orderDate"
|
||||
type="date"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -381,7 +381,7 @@ export default {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
// 查询商品
|
||||
@ -396,7 +396,7 @@ export default {
|
||||
let weightedAverageCost = new BigNumber(data.weightedAverageCost);
|
||||
let subtotalAmount = damageQuantity.times(weightedAverageCost);
|
||||
|
||||
data.subtotalAmount = subtotalAmount.toNumber();
|
||||
data.subtotalAmount = subtotalAmount.toNumber();
|
||||
|
||||
this.sumMethod(this.detailsList);
|
||||
// console.log("this.detailsList",this.detailsList)
|
||||
@ -541,6 +541,7 @@ export default {
|
||||
|
||||
async save(flag){
|
||||
let this_ = this
|
||||
let con = true
|
||||
// 保存之前进行判断
|
||||
if (this_.damageForm.orderNumber == null) {
|
||||
this.$modal.msgError("货损单号不能为空");
|
||||
@ -561,6 +562,7 @@ export default {
|
||||
this.queryParams.damageId = res.data.id
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
con = false
|
||||
return;
|
||||
})
|
||||
}else {
|
||||
@ -570,23 +572,26 @@ export default {
|
||||
await editDamageApi(this_.damageForm).then(res=> {
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
con = false
|
||||
return;
|
||||
})
|
||||
}
|
||||
// 批量保存订单
|
||||
if (con) {
|
||||
this_.detailsList.forEach(data=>{
|
||||
data.damageId = this_.damageId
|
||||
})
|
||||
|
||||
this_.detailsList.forEach(data=>{
|
||||
data.damageId = this_.damageId
|
||||
})
|
||||
await batchProcessingApi(this_.detailsList).then(res=>{
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
if (flag != -1) {
|
||||
this.goToAbout();
|
||||
}
|
||||
}).catch(res=>{
|
||||
// this.$modal.msgError("保存失败");
|
||||
})
|
||||
}
|
||||
|
||||
await batchProcessingApi(this_.detailsList).then(res=>{
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
if (flag != -1) {
|
||||
this.goToAbout();
|
||||
}
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
})
|
||||
|
||||
},
|
||||
// 保存并审核
|
||||
@ -634,9 +639,9 @@ export default {
|
||||
message: '已取消'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
// 作废
|
||||
abolition(){
|
||||
if (this.damageId < 0) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
<!-- <el-link icon="el-icon-edit" :underline="false" @click="goToAbout">编辑</el-link>-->
|
||||
<span> 进货详情</span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div style="height: 90px; display: flex; justify-content: space-between;">
|
||||
<div style="height: 100%; width: 50%; display: flex; justify-content: space-between;">
|
||||
@ -295,7 +295,7 @@ export default {
|
||||
open: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
// supplierId: '',
|
||||
@ -401,11 +401,11 @@ export default {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 查询商品
|
||||
inquire() {
|
||||
@ -477,7 +477,7 @@ export default {
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
if(sum>0) {
|
||||
@ -568,6 +568,7 @@ export default {
|
||||
|
||||
async save(flag){
|
||||
let this_ = this
|
||||
let con = true
|
||||
// 保存之前进行判断
|
||||
if (this_.purchaseForm.orderNumber == null) {
|
||||
this.$modal.msgError("进货单号不能为空");
|
||||
@ -583,37 +584,55 @@ export default {
|
||||
if (this_.purchaseId == null) {
|
||||
// 新增
|
||||
await addPurchaseApi(this_.purchaseForm).then(res=>{
|
||||
this_.purchaseId = res.data.id
|
||||
this.queryParams.purchaseId = res.data.id
|
||||
if (res.code === 200) {
|
||||
this_.purchaseId = res.data.id
|
||||
this.queryParams.purchaseId = res.data.id
|
||||
}else {
|
||||
this.$modal.msgError("保存失败");
|
||||
con=false
|
||||
return -1;
|
||||
}
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
return;
|
||||
con=false
|
||||
return -1;
|
||||
})
|
||||
}else {
|
||||
// 修改
|
||||
this_.purchaseForm.id = this_.purchaseId
|
||||
this.queryParams.purchaseId = this_.purchaseId
|
||||
this_.purchaseForm.id = this_.purchaseId
|
||||
this.queryParams.purchaseId = this_.purchaseId
|
||||
await editPurchaseApi(this_.purchaseForm).then(res=> {
|
||||
if (res.code !== 200){
|
||||
this.$modal.msgError("保存失败");
|
||||
con=false
|
||||
return -1;
|
||||
}
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
return;
|
||||
con=false
|
||||
return -1;
|
||||
})
|
||||
}
|
||||
|
||||
if (con) {
|
||||
// 批量保存订单
|
||||
this_.detailsList.forEach(data=>{
|
||||
data.purchaseId = this_.purchaseId
|
||||
})
|
||||
|
||||
await batchProcessingApi(this_.detailsList).then(res=>{
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
if (flag == -1) {
|
||||
this.goToAbout();
|
||||
|
||||
}
|
||||
}).catch(res=>{
|
||||
// this.$modal.msgError("保存失败");
|
||||
})
|
||||
}
|
||||
// 批量保存订单
|
||||
|
||||
this_.detailsList.forEach(data=>{
|
||||
data.purchaseId = this_.purchaseId
|
||||
})
|
||||
|
||||
await batchProcessingApi(this_.detailsList).then(res=>{
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
if (flag == -1) {
|
||||
this.goToAbout();
|
||||
|
||||
}
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
})
|
||||
|
||||
},
|
||||
// 保存并审核
|
||||
@ -635,7 +654,7 @@ export default {
|
||||
} else {
|
||||
this.$modal.msgWarning("暂无审核权限");
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -39,7 +39,7 @@
|
||||
v-model="returnsForm.orderDate"
|
||||
type="date"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -393,12 +393,12 @@ export default {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 查询商品
|
||||
inquire() {
|
||||
@ -474,7 +474,7 @@ export default {
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
if(sum>0) {
|
||||
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
@ -557,6 +557,7 @@ export default {
|
||||
|
||||
async save(flag){
|
||||
let this_ = this
|
||||
let con = true
|
||||
// 保存之前进行判断
|
||||
if (this_.returnsForm.orderNumber == null) {
|
||||
this.$modal.msgError("退货单号不能为空");
|
||||
@ -577,7 +578,9 @@ export default {
|
||||
this.queryParams.returnsId = res.data.id
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
con = false
|
||||
return;
|
||||
|
||||
})
|
||||
}else {
|
||||
// 修改
|
||||
@ -586,23 +589,27 @@ export default {
|
||||
await editReturnsApi(this_.returnsForm).then(res=> {
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
con = false
|
||||
|
||||
return;
|
||||
})
|
||||
}
|
||||
// 批量保存订单
|
||||
if (con) {
|
||||
this_.detailsList.forEach(data=>{
|
||||
data.returnsId = this_.returnsId
|
||||
})
|
||||
|
||||
this_.detailsList.forEach(data=>{
|
||||
data.returnsId = this_.returnsId
|
||||
})
|
||||
await batchProcessingApi(this_.detailsList).then(res=>{
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
if (flag != -1) {
|
||||
this.goToAbout();
|
||||
}
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
})
|
||||
}
|
||||
|
||||
await batchProcessingApi(this_.detailsList).then(res=>{
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
if (flag != -1) {
|
||||
this.goToAbout();
|
||||
}
|
||||
}).catch(res=>{
|
||||
this.$modal.msgError("保存失败");
|
||||
})
|
||||
|
||||
},
|
||||
// 保存并审核
|
||||
@ -661,9 +668,9 @@ export default {
|
||||
message: '已取消'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
// 作废
|
||||
abolition(){
|
||||
if (this.returnsId < 0) {
|
||||
|
@ -29,7 +29,7 @@
|
||||
<div class="xs">储值卡销售额</div>
|
||||
<div class="xs">屯油卡销售额</div>
|
||||
<div class="xs">油品销售额</div>
|
||||
<div class="xse">总销售额(万)</div>
|
||||
<div class="xse">总销售额(元)</div>
|
||||
</div>
|
||||
<template v-loading="employeLoading" >
|
||||
<div class="four-boxx" v-for="(item,index) in employeList" :key="index" >
|
||||
|
@ -112,7 +112,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="可用" align="center" prop="remainingInventory" width="80px">
|
||||
<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>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
@ -134,7 +134,7 @@
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
@click="handleUpdate(scope.row),getStock(scope.row)"
|
||||
>修改</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -276,9 +276,10 @@
|
||||
<!-- </el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="礼品数量" prop="giftQuantity" style="width: 202px;">
|
||||
<el-input-number v-model="dataForm.giftQuantity" controls-position="right" :min="1" :max="10" label=""></el-input-number>
|
||||
<el-col :span="7" v-if="showList.goods">
|
||||
<!-- giftQuantity-->
|
||||
<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-col>
|
||||
</el-row>
|
||||
@ -548,7 +549,7 @@ import {getGiftCategoryApi} from "@/api/integral/category";
|
||||
import {getGiftApi,insertGiftApi,updateGiftApi ,updateGiftInventoryApi,getCardFavorableApi,getCardExchangeApi} from "@/api/integral/gift";
|
||||
import { editor } from '@/components/Editor/index'
|
||||
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";
|
||||
|
||||
|
||||
@ -582,7 +583,7 @@ export default {
|
||||
giftImages: [], // 礼品图片
|
||||
giftType:"优惠券", // 礼品类型
|
||||
couponId:'',// 优惠券
|
||||
giftQuantity:'', // 礼品数量
|
||||
giftQuantity: 1, // 礼品数量
|
||||
totalInventory:'', // 库存
|
||||
exchangeMethod:'积分', // 兑换方式
|
||||
exchangePoints:'', // 兑换积分
|
||||
@ -599,7 +600,7 @@ export default {
|
||||
status: '启用',
|
||||
market:null
|
||||
},
|
||||
|
||||
stock: 0, // 商品剩余库存
|
||||
inventoryForm: {
|
||||
inventoryFlag: 0,
|
||||
remainingInventory: null, // 剩余库存
|
||||
@ -764,12 +765,25 @@ export default {
|
||||
watch: {
|
||||
getGiftTypeShow: function(newVal) {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 根据商品id查询库存 (修改时使用)
|
||||
getStock(data) {
|
||||
if (data.giftType === '实物商品') {
|
||||
getLJGoods(data.goodsId).then(res=>{
|
||||
if (res.data.stock) {
|
||||
this.stock = res.data.stock
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
getList() {
|
||||
getGiftApi(this.queryParams).then(res=>{
|
||||
this.dataList = res.data.records
|
||||
@ -963,7 +977,7 @@ export default {
|
||||
status: '启用',
|
||||
market:null
|
||||
}
|
||||
|
||||
this.stock = 0,
|
||||
this.showList = {
|
||||
// 优惠类型展示
|
||||
coupon: true,
|
||||
@ -1233,6 +1247,7 @@ export default {
|
||||
console.log("row",row)
|
||||
// stock
|
||||
this.dataForm.totalInventory = row.stock
|
||||
this.stock = row.stock
|
||||
this.dataForm.market = row.retailPrice
|
||||
this.dataForm.goodsName = row.name
|
||||
this.dataForm.goodsId = row.id
|
||||
|
@ -231,6 +231,13 @@ export default {
|
||||
this.$forceUpdate();
|
||||
|
||||
},
|
||||
watch: {
|
||||
openOutcome(newValue) {
|
||||
if (!newValue) {
|
||||
this.created();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getList(){
|
||||
await getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
|
||||
|
@ -128,7 +128,7 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="10">
|
||||
<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
|
||||
v-for="option in selectOilTypeByPrice"
|
||||
:key="option.numberId"
|
||||
@ -320,7 +320,7 @@ export default {
|
||||
|
||||
|
||||
this.$route.query.inventoryTime;
|
||||
|
||||
|
||||
|
||||
if (this.$route.query.inventoryDate != null) {
|
||||
this.inventoryNo.inventoryDate = new Date(parseInt(this.$route.query.inventoryDate))
|
||||
@ -392,7 +392,7 @@ export default {
|
||||
// 库存差异升数
|
||||
const stockDifference = new BigNumber(data.inventoryVolume).minus(data.currentInventoryVolume);
|
||||
|
||||
// 盈亏金额
|
||||
// 盈亏金额
|
||||
const profitLossAmount = stockDifference.times(data.currentAveragePrice).decimalPlaces(2).toNumber();
|
||||
|
||||
// 将结果存回 data 对象
|
||||
@ -435,7 +435,7 @@ export default {
|
||||
if (this.orderList.length > 0) {
|
||||
isDuplicate = this.orderList.some(order => order.tankId === mul.id);
|
||||
}
|
||||
|
||||
|
||||
if (isDuplicate) {
|
||||
this.$message({
|
||||
message: '有重复油罐,请重新选择',
|
||||
@ -462,7 +462,7 @@ export default {
|
||||
this.numberOfTanks = this.numberOfTanks+1
|
||||
|
||||
this_.sumMethod(this_.orderList);
|
||||
|
||||
|
||||
},
|
||||
// 表格选择器
|
||||
handleSelectionChange(val) {
|
||||
|
@ -55,7 +55,8 @@
|
||||
label="预设油号"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前数据" style="width: 100%">
|
||||
<el-table-column label="当前数据" style="width: 100%" align="center"
|
||||
>
|
||||
<el-table-column
|
||||
prop="currentPetrolPrices"
|
||||
align="center"
|
||||
@ -63,15 +64,16 @@
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="presetOilPrices"
|
||||
prop="currentGbPrice"
|
||||
align="center"
|
||||
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
|
||||
prop="currentPetrolPrices"
|
||||
prop="presetOilPrices"
|
||||
align="center"
|
||||
label="油站价"
|
||||
>
|
||||
@ -321,7 +323,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -331,7 +333,7 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
@ -107,7 +107,7 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<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>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -419,6 +419,7 @@ export default {
|
||||
|
||||
|
||||
|
||||
|
||||
if (this_.tankForm.totalPrice != null && this_.tankForm.storedQuantity != null) {
|
||||
if (!this.checkNumeric(this_.tankForm.totalPrice)) {
|
||||
this_.tankForm.totalPrice = 0
|
||||
@ -438,6 +439,15 @@ export default {
|
||||
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.checkNumeric(this_.tankForm.totalPrice)) {
|
||||
this_.tankForm.totalPrice = 0
|
||||
|
@ -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;
|
||||
/**
|
||||
* 审核人
|
||||
|
@ -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;
|
||||
/**
|
||||
* 审核人
|
||||
|
@ -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;
|
||||
/**
|
||||
* 审核人
|
||||
|
@ -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;
|
||||
/**
|
||||
* 审核人
|
||||
|
@ -255,6 +255,7 @@
|
||||
and mg.supplier_id = #{mtDamage.supplierId}
|
||||
</if>
|
||||
group by mp.id
|
||||
order by mp.order_date desc
|
||||
</select>
|
||||
|
||||
<!-- . <if test="mtReturns.supplierId != null">-->
|
||||
|
@ -153,6 +153,8 @@
|
||||
</where>
|
||||
GROUP BY
|
||||
mp.id
|
||||
|
||||
order by mp.create_time desc
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.entity.MtDamageDetails;
|
||||
@ -115,8 +116,9 @@ public class MtDamageDetailsServiceImpl implements MtDamageDetailsService {
|
||||
|
||||
AccountInfo accountInfoByToken = TokenUtil.getNowAccountInfo();
|
||||
|
||||
if (mtDamageDetails.size() > 0) {
|
||||
if (ObjectUtil.isNotEmpty(mtDamageDetails)) {
|
||||
for (MtDamageDetails mtDamageDetails1 : mtDamageDetails) {
|
||||
if (ObjectUtil.isEmpty(mtDamageDetails1.getDamageId())) continue;
|
||||
mtDamageDetails1.setStoreId(accountInfoByToken.getStoreId());
|
||||
mtDamageDetails1.setCreateBy(accountInfoByToken.getStaffId().toString());
|
||||
if (mtDamageDetails1.getId() != null) {
|
||||
@ -125,10 +127,10 @@ public class MtDamageDetailsServiceImpl implements MtDamageDetailsService {
|
||||
mtDamageDetailsIns.add(mtDamageDetails1);
|
||||
}
|
||||
}
|
||||
if (mtDamageDetailsIns.size()>0) {
|
||||
if (ObjectUtil.isNotEmpty(mtDamageDetailsIns)) {
|
||||
mtDamageDetailsDao.insertBatch(mtDamageDetailsIns);
|
||||
}
|
||||
if (mtDamageDetailsEdit.size()>0) {
|
||||
if (ObjectUtil.isNotEmpty(mtDamageDetailsEdit)) {
|
||||
mtDamageDetailsDao.editBatch(mtDamageDetailsEdit);
|
||||
}
|
||||
return true;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
@ -95,9 +96,9 @@ public class MtPurchaseDetailsServiceImpl implements MtPurchaseDetailsService {
|
||||
List<MtPurchaseDetails> mtPurchaseDetailsEdit = new ArrayList<>();
|
||||
|
||||
AccountInfo accountInfoByToken = TokenUtil.getNowAccountInfo();
|
||||
|
||||
if (mtPurchaseDetails.size() > 0) {
|
||||
for (MtPurchaseDetails mtPurchaseDetail : mtPurchaseDetails) {
|
||||
if (ObjectUtil.isEmpty(mtPurchaseDetail.getPurchaseId())) continue;
|
||||
mtPurchaseDetail.setStoreId(accountInfoByToken.getStoreId());
|
||||
mtPurchaseDetail.setCreateBy(accountInfoByToken.getStaffId().toString());
|
||||
if (mtPurchaseDetail.getId() != null) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
@ -91,6 +92,7 @@ public class MtReturnsDetailsServiceImpl implements MtReturnsDetailsService {
|
||||
|
||||
if (mtReturnsDetails.size() > 0) {
|
||||
for (MtReturnsDetails mtReturnsDetail : mtReturnsDetails) {
|
||||
if (ObjectUtil.isEmpty(mtReturnsDetail.getReturnsId())) continue;
|
||||
mtReturnsDetail.setStoreId(accountInfoByToken.getStoreId());
|
||||
mtReturnsDetail.setCreateBy(accountInfoByToken.getStaffId().toString());
|
||||
if (mtReturnsDetail.getId() != null) {
|
||||
|
@ -416,7 +416,7 @@
|
||||
update integral_gift
|
||||
set
|
||||
remaining_inventory = remaining_inventory - #{editInventory}, -- 剩余库存
|
||||
total_inventory = used_inventory + #{editInventory}, -- 使用库存
|
||||
used_inventory = used_inventory + #{editInventory}, -- 使用库存
|
||||
update_time = NOW()
|
||||
where id =#{id}
|
||||
</update>
|
||||
|
@ -186,6 +186,7 @@
|
||||
card_value_record
|
||||
WHERE
|
||||
store_id = #{storeId}
|
||||
|
||||
)
|
||||
card_value_record ON DATE(card_value_record.create_time) = date_range.date
|
||||
WHERE
|
||||
|
@ -49,14 +49,31 @@
|
||||
COALESCE(SUM(cfr.recharge_balance), 0) AS totalSum
|
||||
FROM
|
||||
mt_staff ms
|
||||
LEFT JOIN oil_order oo ON ms.id = oo.staff_id
|
||||
LEFT JOIN card_value_record cvr ON ms.id = cvr.mt_staff_id
|
||||
LEFT JOIN card_fuel_record cfr ON ms.id = cfr.mt_staff_id
|
||||
where ms.store_id = #{storeId}
|
||||
LEFT JOIN (
|
||||
SELECT staff_id, COALESCE(SUM(pay_amount), 0) AS pay_amount
|
||||
FROM oil_order
|
||||
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
|
||||
ms.id, ms.real_name
|
||||
ORDER BY
|
||||
totalSum DESC
|
||||
totalSum DESC;
|
||||
|
||||
</select>
|
||||
|
||||
<select id="employeeSalesMongth" resultType="java.util.Map">
|
||||
|
@ -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;
|
||||
/**
|
||||
* 盘点升数
|
||||
@ -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;
|
||||
/**
|
||||
* 状态
|
||||
|
@ -36,6 +36,7 @@ public interface MtStoreMapper extends BaseMapper<MtStore> {
|
||||
* @return
|
||||
*/
|
||||
int editStatusBydeptIdList(@Param("list") List<SysDept> sysDeptsByjy);
|
||||
int beachDelStore(@Param("list") List<SysDept> sysDeptsByjy);
|
||||
|
||||
// 批量修改该状态根据部门
|
||||
int editStatusBydeptId(@Param("deptId") Long deptId);
|
||||
|
@ -12,6 +12,16 @@
|
||||
</foreach>
|
||||
</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 mt_store
|
||||
set status = 'jy'
|
||||
|
@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
inner join mt_store ms on ms.chain_store_id = csi.id
|
||||
where sd.ancestors like concat(#{ownDeptStr},'%')
|
||||
and csi.status = 'qy'
|
||||
and sd.if_delete = 0
|
||||
<if test="chainStoreInfo.storeName !=null and chainStoreInfo.storeName !=''">
|
||||
and (csi.store_name like concat('%',#{chainStoreInfo.storeName},'%') or ms.name like concat('%',#{chainStoreInfo.storeName},'%'))
|
||||
</if>
|
||||
|
@ -57,6 +57,7 @@ public class ChainStoreInfoServiceImpl extends ServiceImpl<ChainStoreInfoMapper,
|
||||
queryWrapper.eq(MtStore :: getStatus,chainStoreInfo.getStatus());
|
||||
}
|
||||
queryWrapper.eq(MtStore::getIfDelete,0);
|
||||
queryWrapper.eq(MtStore::getStatus,"qy");
|
||||
queryWrapper.eq(MtStore::getChainStoreId,it.getId()).orderByDesc(BaseEntity::getCreateTime);
|
||||
List<MtStore> list = storeService.list(queryWrapper);
|
||||
for (MtStore mtStore : list) {
|
||||
@ -76,6 +77,8 @@ public class ChainStoreInfoServiceImpl extends ServiceImpl<ChainStoreInfoMapper,
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean theJudgmentIsTheSame(Integer chainStoreId) {
|
||||
if (ObjectUtil.isEmpty(chainStoreId)) return false;
|
||||
|
@ -541,7 +541,18 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
|
||||
public void petrolStationsAreExpired() {
|
||||
// 直接修改
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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());
|
||||
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
|
||||
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) {
|
||||
String requestURI = request.getRequestURI();
|
||||
log.error("请求地址'{}',发生未知异常.", requestURI, e);
|
||||
return new ResponseObject(201, e.getMessage(), null);
|
||||
// 判断是否为自定义异常
|
||||
if (containsChinese(e.getMessage())) {
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 系统异常
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user