From ac225bd66eb7c21b5af1d8533dc59376ea53da6c Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期五, 12 十二月 2025 12:29:42 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
---
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java | 60 +++++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 41 insertions(+), 19 deletions(-)
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java b/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
index 86fc231..67265c9 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
@@ -1,22 +1,14 @@
package com.example.erp.service.mm;
import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.example.erp.common.Constants;
-import com.example.erp.dto.mm.FinishedOperateLogDTO;
+import com.example.erp.dto.mm.MaterialLogDTO;
import com.example.erp.entity.mm.*;
import com.example.erp.entity.pp.*;
-import com.example.erp.entity.sd.Delivery;
-import com.example.erp.entity.sd.DeliveryDetail;
-import com.example.erp.entity.sd.OrderDetail;
-import com.example.erp.entity.sd.OrderProcessDetail;
import com.example.erp.entity.userInfo.Log;
import com.example.erp.entity.userInfo.SysError;
-import com.example.erp.exception.ServiceException;
import com.example.erp.mapper.mm.BasicWarehouseTypeMapper;
import com.example.erp.mapper.mm.MaterialInventoryMapper;
import com.example.erp.mapper.mm.MaterialLogMapper;
@@ -28,7 +20,6 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
-import java.time.LocalDateTime;
import java.util.List;
import java.util.ArrayList;
@@ -36,6 +27,9 @@
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@Service
@@ -875,8 +869,15 @@
return map;
}
- public List<MaterialLog> exportMaterialLogReport(List<LocalDate> dates, String type) {
- return materialInventoryMapper.exportMaterialLogReport(dates,type);
+ public List<MaterialLogDTO> exportMaterialLogReport(List<LocalDate> dates, String type) {
+ if(type.equals("鐗╂枡鍑哄簱")){
+ return materialInventoryMapper.exportMaterialLogReport(dates,type);
+ }else if(type.equals("浼樺寲鍑哄簱")){
+ return materialInventoryMapper.exportMaterialLogOptimizeOutboundReport(dates,type);
+ }else{
+ return materialInventoryMapper.exportMaterialLogReports(dates,type);
+ }
+
}
@@ -1170,7 +1171,6 @@
materialInventoryMapper.insertMaterialOutbound(materialOutbound, oddNumber);
log.setFunction("saveMaterialOutbound鏂板:"+oddNumber);
}
-
//鑾峰彇瀵硅薄闆嗗悎寰幆杩涜鏂板淇敼
if (!materialOutboundDetailList.isEmpty()) {
@@ -1229,10 +1229,6 @@
TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
return "false1";
}
-
-
-
-
}
}
@@ -1276,9 +1272,9 @@
//鏌ヨ鐗╂枡鏄惁瀛樺湪
List<MaterialInventory> MaterialInventoryCount;
if (materialInventory.getDateOfManufacture()!=null){
- MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCount(materialInventory.getMaterialCode(),materialInventory.getDateOfManufacture(),materialInventory.getProducer());
+ MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCount1(materialInventory.getMaterialCode(),materialInventory.getDateOfManufacture(),materialInventory.getProducer(),materialInventory.getId());
}else{
- MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCountNull(materialInventory.getMaterialCode(),materialInventory.getProducer());
+ MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCountNull1(materialInventory.getMaterialCode(),materialInventory.getProducer(),materialInventory.getId());
}
if(MaterialInventoryCount.size()==1){
@@ -1307,4 +1303,30 @@
}
+ public Object appGetStockList() {
+ //ExecutorService executor = Executors.newFixedThreadPool(2);
+ List<MaterialInventory> materialInventoryList = materialInventoryMapper.selectGetStockList();
+ //executor.shutdown();
+
+ Map<String, Object> totalSum = new HashMap<>();
+
+ Integer inventoryQuantity = 0;
+ Integer availableQuantity = 0;
+ Double totalArea = 0.00;
+ for (MaterialInventory materialInventory : materialInventoryList) {
+ inventoryQuantity += materialInventory.getInventoryQuantity();
+ availableQuantity += materialInventory.getAvailableQuantity();
+ totalArea += materialInventory.getTotalArea();
+ }
+ DecimalFormat df = new DecimalFormat("#.00");
+ totalSum.put("inventoryQuantity",inventoryQuantity);
+ totalSum.put("availableQuantity",availableQuantity);
+ totalSum.put("totalArea", df.format(totalArea));
+
+
+ Map<String, Object> map = new HashMap<>();
+ map.put("glassStock", materialInventoryList);
+ map.put("totalSum", totalSum);
+ return map;
+ }
}
--
Gitblit v1.8.0