From f56fab7e9d5b1b243797b63fcfc72bed2d0e6926 Mon Sep 17 00:00:00 2001
From: wangh <9483>
Date: Sat, 27 Jan 2024 17:51:20 +0800
Subject: [PATCH] =?UTF-8?q?bug=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../views/convenienceStore/damage/details.vue | 39 ++++++-----
.../convenienceStore/purchase/details.vue | 67 +++++++++++-------
.../convenienceStore/returns/details.vue | 43 +++++++-----
.../views/indexcomponents/centenrindex.vue | 2 +-
fuintAdmin/src/views/integral/gift/index.vue | 33 ++++++---
.../src/views/integral/order/pointsMall.vue | 7 ++
.../views/oilConfig/oilInventory/order.vue | 10 +--
.../src/views/oilConfig/oilPrice/index.vue | 14 ++--
.../src/views/oilConfig/oilTank/list.vue | 12 +++-
.../configure/dev/application2.properties | 0
.../convenienceSore/entity/MtDamage.java | 2 +-
.../convenienceSore/entity/MtInventory.java | 2 +-
.../convenienceSore/entity/MtPurchase.java | 2 +-
.../convenienceSore/entity/MtReturns.java | 2 +-
.../mapper/xml/MtDamageMapper.xml | 1 +
.../mapper/xml/MtReturnsMapper.xml | 2 +
.../impl/MtDamageDetailsServiceImpl.java | 8 ++-
.../impl/MtPurchaseDetailsServiceImpl.java | 3 +-
.../impl/MtReturnsDetailsServiceImpl.java | 2 +
.../mapper/xml/IntegralGiftMapper.xml | 2 +-
.../mapper/xml/CardValueRecordMapper.xml | 1 +
.../member/mapper/xml/LJStaffMapper.xml | 27 ++++++--
.../entity/OilInventory.java | 4 +-
.../business/store/mapper/MtStoreMapper.java | 1 +
.../store/mapper/xml/MtStoreMapper.xml | 10 +++
.../store/mapper/xml/OilOrdersMapper.xml | 1 +
.../impl/ChainStoreInfoServiceImpl.java | 3 +
.../store/service/impl/StoreServiceImpl.java | 11 +++
.../business/store/task/QuartzConfig.java | 68 -------------------
.../fuint/business/store/task/streamTask.java | 32 ---------
.../exception/GlobalExceptionHandler.java | 19 +++++-
31 files changed, 232 insertions(+), 198 deletions(-)
delete mode 100644 fuintBackend/configure/dev/application2.properties
delete mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/store/task/QuartzConfig.java
delete mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/store/task/streamTask.java
diff --git a/fuintAdmin/src/views/convenienceStore/damage/details.vue b/fuintAdmin/src/views/convenienceStore/damage/details.vue
index c8fb07ad5..3165deb6b 100644
--- a/fuintAdmin/src/views/convenienceStore/damage/details.vue
+++ b/fuintAdmin/src/views/convenienceStore/damage/details.vue
@@ -39,7 +39,7 @@
v-model="damageForm.orderDate"
type="date"
placeholder="选择日期">
-
+
@@ -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) {
diff --git a/fuintAdmin/src/views/convenienceStore/purchase/details.vue b/fuintAdmin/src/views/convenienceStore/purchase/details.vue
index 7edb25ec6..d3ab80dbb 100644
--- a/fuintAdmin/src/views/convenienceStore/purchase/details.vue
+++ b/fuintAdmin/src/views/convenienceStore/purchase/details.vue
@@ -7,7 +7,7 @@
进货详情
-
+
@@ -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("暂无审核权限");
}
-
+
})
}
},
diff --git a/fuintAdmin/src/views/convenienceStore/returns/details.vue b/fuintAdmin/src/views/convenienceStore/returns/details.vue
index 66494c955..38ddf5e01 100644
--- a/fuintAdmin/src/views/convenienceStore/returns/details.vue
+++ b/fuintAdmin/src/views/convenienceStore/returns/details.vue
@@ -39,7 +39,7 @@
v-model="returnsForm.orderDate"
type="date"
placeholder="选择日期">
-
+
@@ -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) {
diff --git a/fuintAdmin/src/views/indexcomponents/centenrindex.vue b/fuintAdmin/src/views/indexcomponents/centenrindex.vue
index fa08e0930..ae4fbf07d 100644
--- a/fuintAdmin/src/views/indexcomponents/centenrindex.vue
+++ b/fuintAdmin/src/views/indexcomponents/centenrindex.vue
@@ -29,7 +29,7 @@
储值卡销售额
屯油卡销售额
油品销售额
-
总销售额(万)
+
总销售额(元)
diff --git a/fuintAdmin/src/views/integral/gift/index.vue b/fuintAdmin/src/views/integral/gift/index.vue
index 0bf7d426a..b912cfccd 100644
--- a/fuintAdmin/src/views/integral/gift/index.vue
+++ b/fuintAdmin/src/views/integral/gift/index.vue
@@ -112,7 +112,7 @@
- {{ scope.row.totalInventory===-1?scope.row.totalInventory-scope.row.usedInventory+1: scope.row.totalInventory-scope.row.usedInventory}}
+ {{ scope.row.totalInventory===-1?'无限制': scope.row.remainingInventory}}
@@ -134,7 +134,7 @@
size="mini"
type="text"
icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
+ @click="handleUpdate(scope.row),getStock(scope.row)"
>修改
@@ -276,9 +276,10 @@
-
-
-
+
+
+
+
@@ -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
diff --git a/fuintAdmin/src/views/integral/order/pointsMall.vue b/fuintAdmin/src/views/integral/order/pointsMall.vue
index 12d5016f6..9b15878b6 100644
--- a/fuintAdmin/src/views/integral/order/pointsMall.vue
+++ b/fuintAdmin/src/views/integral/order/pointsMall.vue
@@ -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=>{
diff --git a/fuintAdmin/src/views/oilConfig/oilInventory/order.vue b/fuintAdmin/src/views/oilConfig/oilInventory/order.vue
index 405d73048..d160b330d 100644
--- a/fuintAdmin/src/views/oilConfig/oilInventory/order.vue
+++ b/fuintAdmin/src/views/oilConfig/oilInventory/order.vue
@@ -128,7 +128,7 @@
-
+
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) {
diff --git a/fuintAdmin/src/views/oilConfig/oilPrice/index.vue b/fuintAdmin/src/views/oilConfig/oilPrice/index.vue
index e8628e73c..eff93d325 100644
--- a/fuintAdmin/src/views/oilConfig/oilPrice/index.vue
+++ b/fuintAdmin/src/views/oilConfig/oilPrice/index.vue
@@ -55,7 +55,8 @@
label="预设油号"
>
-
+
-
+
@@ -321,7 +323,7 @@
-
+
元
@@ -331,7 +333,7 @@
-
+
元
diff --git a/fuintAdmin/src/views/oilConfig/oilTank/list.vue b/fuintAdmin/src/views/oilConfig/oilTank/list.vue
index a05009aab..73a1f6010 100644
--- a/fuintAdmin/src/views/oilConfig/oilTank/list.vue
+++ b/fuintAdmin/src/views/oilConfig/oilTank/list.vue
@@ -107,7 +107,7 @@
-
+
{{tankForm.unit}}
@@ -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
diff --git a/fuintBackend/configure/dev/application2.properties b/fuintBackend/configure/dev/application2.properties
deleted file mode 100644
index e69de29bb..000000000
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtDamage.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtDamage.java
index 0be876b9a..4f385cb37 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtDamage.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtDamage.java
@@ -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;
/**
* 审核人
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtInventory.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtInventory.java
index 8df348c67..45efa33ad 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtInventory.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtInventory.java
@@ -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;
/**
* 审核人
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtPurchase.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtPurchase.java
index 3f4f23505..1cb81225f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtPurchase.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtPurchase.java
@@ -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;
/**
* 审核人
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtReturns.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtReturns.java
index a00070da5..2c93854ed 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtReturns.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/MtReturns.java
@@ -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;
/**
* 审核人
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtDamageMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtDamageMapper.xml
index c43a88555..e6497c2e9 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtDamageMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtDamageMapper.xml
@@ -255,6 +255,7 @@
and mg.supplier_id = #{mtDamage.supplierId}
group by mp.id
+ order by mp.order_date desc
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtReturnsMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtReturnsMapper.xml
index 5acfae21d..7290e180b 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtReturnsMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/MtReturnsMapper.xml
@@ -153,6 +153,8 @@
GROUP BY
mp.id
+
+ order by mp.create_time desc
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtDamageDetailsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtDamageDetailsServiceImpl.java
index f5a0e7ccf..036ce0c6e 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtDamageDetailsServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtDamageDetailsServiceImpl.java
@@ -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;
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtPurchaseDetailsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtPurchaseDetailsServiceImpl.java
index 9917d15ee..f93fe3bb7 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtPurchaseDetailsServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtPurchaseDetailsServiceImpl.java
@@ -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 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) {
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtReturnsDetailsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtReturnsDetailsServiceImpl.java
index 1cf2926c1..3450a95b5 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtReturnsDetailsServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtReturnsDetailsServiceImpl.java
@@ -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) {
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml
index ea4e81563..281027145 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml
@@ -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}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml
index 74f2a0fa9..d38b87372 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml
@@ -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
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/mapper/xml/LJStaffMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/mapper/xml/LJStaffMapper.xml
index a4e684322..22ef04865 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/mapper/xml/LJStaffMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/mapper/xml/LJStaffMapper.xml
@@ -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;
+