From 50cd7a5a34763438f2ecd833a59ad7951b682f50 Mon Sep 17 00:00:00 2001 From: wangh <9483> Date: Tue, 27 Feb 2024 14:03:47 +0800 Subject: [PATCH] no message --- .../src/api/convenienceStore/inventory.js | 8 ++++ .../convenienceStore/inventory/details.vue | 30 +++++++++--- .../src/views/handover/HandoverDetails.vue | 2 +- .../src/views/oilConfig/oilGun/list.vue | 2 +- .../oilConfig/oilPurchase/purchaseOrder.vue | 2 +- fuintAdmin/src/views/staff/list.vue | 3 +- .../MtInventoryDetailsController.java | 7 +++ .../service/MtInventoryDetailsService.java | 2 + .../impl/MtInventoryDetailsServiceImpl.java | 46 ++++++++++++++++++- .../vo/MtInventoryDetailsVO.java | 3 +- .../business/order/mapper/LJOrderMapper.java | 2 +- .../order/mapper/xml/LJOrderMapper.xml | 3 ++ .../order/mapper/xml/OilOrderMapper.xml | 10 ++-- .../order/service/LJOrderService.java | 2 +- .../service/impl/LJOrderServiceImpl.java | 4 +- .../service/impl/UserBalanceServiceImpl.java | 10 ++-- .../dept/service/impl/SysDeptServiceImpl.java | 6 ++- .../cashier/NewComponents/HandoverDetails.vue | 22 ++++----- .../cashier/NewComponents/HandoverOnly.vue | 8 ++-- .../views/cashier/NewComponents/Integral.vue | 13 +++--- 20 files changed, 137 insertions(+), 48 deletions(-) diff --git a/fuintAdmin/src/api/convenienceStore/inventory.js b/fuintAdmin/src/api/convenienceStore/inventory.js index 860babb5c..8da54f2f3 100644 --- a/fuintAdmin/src/api/convenienceStore/inventory.js +++ b/fuintAdmin/src/api/convenienceStore/inventory.js @@ -97,3 +97,11 @@ export function exportExcelApi(data) { data: data }) } + +export function getSalesByMtInventoryApi(data) { + return request({ + url: 'business/convenience/mtInventoryDetails/getSalesByMtInventory', + method: 'get', + params: data + }) +} diff --git a/fuintAdmin/src/views/convenienceStore/inventory/details.vue b/fuintAdmin/src/views/convenienceStore/inventory/details.vue index b4ee6357d..d27dcc0fd 100644 --- a/fuintAdmin/src/views/convenienceStore/inventory/details.vue +++ b/fuintAdmin/src/views/convenienceStore/inventory/details.vue @@ -90,12 +90,17 @@ + + + @@ -241,10 +246,10 @@ import { editInventoryApi, addInventoryApi, batchProcessingApi, - auditInventoryApi , + auditInventoryApi, storageInventoryApi, abolitionInventoryApi, - exportExcelApi + exportExcelApi, getSalesByMtInventoryApi } from "@/api/convenienceStore/inventory"; @@ -480,11 +485,11 @@ export default { }) }, - addCommodity () { + async addCommodity () { let this_ = this let sum = 0; - this.multipleSelection.forEach(mul=>{ + for (const mul of this.multipleSelection) { let flag = true; this_.detailsList.forEach(det=>{ if (mul.id == det.goodsId) { @@ -493,6 +498,12 @@ export default { } }) if(flag) { + + let getPurchaseByTankIdData + await getSalesByMtInventoryApi().then(res=>{ + getPurchaseByTankIdData = res.data + }) + let now = { inventoryId: this.inventoryId, goodsId: mul.id, @@ -506,10 +517,15 @@ export default { damageQuantity:0, profitLossAmount:0, // 盈亏金额 inventoryDiscrepancy:0, // 库存差异 + purchase:getPurchaseByTankIdData.purchase, + goodsSales:getPurchaseByTankIdData.goodsSales, + inventorySales:getPurchaseByTankIdData.inventorySales, + exchangeSales:getPurchaseByTankIdData.exchangeSales, + } this_.detailsList.push(now) } - }) + } if(sum>0) { this.$modal.msgError("同一货损单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除"); } diff --git a/fuintAdmin/src/views/handover/HandoverDetails.vue b/fuintAdmin/src/views/handover/HandoverDetails.vue index 44551dfc0..7a96ccb52 100644 --- a/fuintAdmin/src/views/handover/HandoverDetails.vue +++ b/fuintAdmin/src/views/handover/HandoverDetails.vue @@ -127,7 +127,7 @@ export default { pageSize:null }, loading: false, - dateRange: [], + dateRange: [new Date(),new Date()], defaultSort: {prop: 'createTime', order: 'descending'}, total: 0, diff --git a/fuintAdmin/src/views/oilConfig/oilGun/list.vue b/fuintAdmin/src/views/oilConfig/oilGun/list.vue index cf5b92be8..67efc1b47 100644 --- a/fuintAdmin/src/views/oilConfig/oilGun/list.vue +++ b/fuintAdmin/src/views/oilConfig/oilGun/list.vue @@ -26,7 +26,7 @@
{{item.gunName}}
-
ID:{{ item.id }}
+
diff --git a/fuintAdmin/src/views/oilConfig/oilPurchase/purchaseOrder.vue b/fuintAdmin/src/views/oilConfig/oilPurchase/purchaseOrder.vue index 8e0bd35e7..08cad0844 100644 --- a/fuintAdmin/src/views/oilConfig/oilPurchase/purchaseOrder.vue +++ b/fuintAdmin/src/views/oilConfig/oilPurchase/purchaseOrder.vue @@ -178,7 +178,7 @@ diff --git a/fuintAdmin/src/views/staff/list.vue b/fuintAdmin/src/views/staff/list.vue index b05b50842..ba1c3be38 100644 --- a/fuintAdmin/src/views/staff/list.vue +++ b/fuintAdmin/src/views/staff/list.vue @@ -645,8 +645,9 @@ export default { this.getList(); }, // 新增按钮操作 - handleAdd() { + async handleAdd() { this.reset(); + await this.getAuditPrem() this.open = true; this.title = "新增员工"; }, diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/MtInventoryDetailsController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/MtInventoryDetailsController.java index 88d23831f..48374d5dc 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/MtInventoryDetailsController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/MtInventoryDetailsController.java @@ -58,6 +58,13 @@ public class MtInventoryDetailsController extends BaseController { return getSuccessResult(list); } + @GetMapping("/getSalesByMtInventory") + public ResponseObject getSales(Integer goodsId) { + return getSuccessResult(mtInventoryDetailsService.getSales(goodsId)); + + } + + /** * 通过主键查询单条数据 * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/MtInventoryDetailsService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/MtInventoryDetailsService.java index acb21cc65..fe6ac8022 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/MtInventoryDetailsService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/MtInventoryDetailsService.java @@ -37,6 +37,8 @@ public interface MtInventoryDetailsService { IPage getListByPage(Page page, MtInventoryDetails mtInventoryDetails); + + MtInventoryDetailsVO getSales(Integer goodsId); /** * 新增数据 * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtInventoryDetailsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtInventoryDetailsServiceImpl.java index b1f52d10c..656985679 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtInventoryDetailsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/MtInventoryDetailsServiceImpl.java @@ -95,11 +95,14 @@ public class MtInventoryDetailsServiceImpl implements MtInventoryDetailsService } // 查询销售数据 - LJOrder statisticsByTime = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId()); + LJOrder statisticsByTime = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId(),null); // 查询积分兑换数据 IntegralOrders statisticsByTime1 = integralOrdersService.getStatisticsByTime(queryTime, record.getGoodsId()); // 查询积分商品库存 IntegralGift stockByGoodsId = integralGiftService.getStockByGoodsId(record.getGoodsId()); + // 兑换卷 + LJOrder statisticsByTime2 = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId(),"0"); + if (ObjectUtil.isNotEmpty(statisticsByTime)) { @@ -111,10 +114,51 @@ public class MtInventoryDetailsServiceImpl implements MtInventoryDetailsService if (ObjectUtil.isNotEmpty(stockByGoodsId)) { record.setStock(record.getStock()+stockByGoodsId.getRemainingInventory()); } + if (ObjectUtil.isNotEmpty(stockByGoodsId)) { + record.setExchangeSales(statisticsByTime2.getGoodsNum().toString()); + } } return MtInventoryDetailsIPage; } + + public MtInventoryDetailsVO getSales(Integer goodsId) { + MtInventoryDetailsVO record = new MtInventoryDetailsVO(); + record.setGoodsId(goodsId); + Date queryTime = new Date(); + // 查询进货数据 + MtPurchaseDetails incomingGoodsData = mtPurchaseDetailsService.getIncomingGoodsData(record.getGoodsId()); + if (ObjectUtil.isNotEmpty(incomingGoodsData)) { + record.setPurchase(incomingGoodsData.getQuantityPurchased().toString()); + queryTime = incomingGoodsData.getUpdateTime(); + } + + // 查询销售数据 + LJOrder statisticsByTime = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId(),null); + // 查询积分兑换数据 + IntegralOrders statisticsByTime1 = integralOrdersService.getStatisticsByTime(queryTime, record.getGoodsId()); + // 查询积分商品库存 + IntegralGift stockByGoodsId = integralGiftService.getStockByGoodsId(record.getGoodsId()); + // 兑换卷 + LJOrder statisticsByTime2 = ljOrderService.getStatisticsByTime(queryTime, record.getGoodsId(),"0"); + + + + if (ObjectUtil.isNotEmpty(statisticsByTime)) { + record.setGoodsSales(statisticsByTime.getGoodsNum().toString()); + } + if (ObjectUtil.isNotEmpty(statisticsByTime1)) { + record.setInventorySales(statisticsByTime1.getExchangeQuantity().toString()); + } + if (ObjectUtil.isNotEmpty(stockByGoodsId)) { + record.setStock(record.getStock()+stockByGoodsId.getRemainingInventory()); + } + if (ObjectUtil.isNotEmpty(stockByGoodsId)) { + record.setExchangeSales(statisticsByTime2.getGoodsNum().toString()); + } + return record; + } + /** * 新增数据 * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/MtInventoryDetailsVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/MtInventoryDetailsVO.java index 930a83b54..32b259973 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/MtInventoryDetailsVO.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/MtInventoryDetailsVO.java @@ -23,5 +23,6 @@ public class MtInventoryDetailsVO extends MtInventoryDetails { private String goodsSales; // 积分商品兑换量 private String inventorySales; - + // 兑换卷 + private String exchangeSales; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/LJOrderMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/LJOrderMapper.java index 368284565..a39900df0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/LJOrderMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/LJOrderMapper.java @@ -36,5 +36,5 @@ public interface LJOrderMapper extends BaseMapper { Map orderStatistics(@Param("order") LJOrder order); - LJOrder getStatisticsByTime(@Param("time") Date time,@Param("goodsId") Integer goodsId); + LJOrder getStatisticsByTime(@Param("time") Date time,@Param("goodsId") Integer goodsId,@Param("payType") String payType); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml index 3e605452b..0fc173c43 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml @@ -202,6 +202,9 @@ left join mt_order_goods mog ON mo.id = mog.goods_id where mog.goods_id = #{goodsId} + + and mo.pay_type = #{payType} + and mo.create_time >= #{time} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml index e49aa3591..5c5337be8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml @@ -549,6 +549,10 @@ od.order_no = #{orderNo} + + + +