From d8c86797adaef6c416efae16586f350ae77bde4b Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期六, 12 九月 2026 12:43:08 +0800
Subject: [PATCH] feat: 库存入库/出库字段全链路、采购台账申请提交时间、储罐租客信息、油库储罐模块

---
 src/main/java/com/ruoyi/stock/service/impl/StockUninventoryServiceImpl.java |  106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/ruoyi/stock/service/impl/StockUninventoryServiceImpl.java b/src/main/java/com/ruoyi/stock/service/impl/StockUninventoryServiceImpl.java
index 47f7d34..f30fd88 100644
--- a/src/main/java/com/ruoyi/stock/service/impl/StockUninventoryServiceImpl.java
+++ b/src/main/java/com/ruoyi/stock/service/impl/StockUninventoryServiceImpl.java
@@ -7,8 +7,15 @@
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.alibaba.fastjson2.JSON;
+import com.ruoyi.basic.mapper.CustomerMapper;
+import com.ruoyi.basic.mapper.OilDepotMapper;
 import com.ruoyi.basic.mapper.ProductModelMapper;
+import com.ruoyi.basic.mapper.TankInfoMapper;
+import com.ruoyi.basic.pojo.Customer;
+import com.ruoyi.basic.pojo.OilDepot;
 import com.ruoyi.basic.pojo.ProductModel;
+import com.ruoyi.basic.pojo.TankInfo;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.StringUtils;
@@ -54,6 +61,9 @@
     private final StockInRecordService stockInRecordService;
     private final ProductModelMapper productModelMapper;
     private final StockInventoryMapper stockInventoryMapper;
+    private final OilDepotMapper oilDepotMapper;
+    private final TankInfoMapper tankInfoMapper;
+    private final CustomerMapper customerMapper;
 
     @Override
     public IPage<StockUninventoryDto> pageStockUninventory(Page page, StockUninventoryDto stockUninventoryDto) {
@@ -79,6 +89,54 @@
         stockInRecordDto.setBatchNo(stockUninventoryDto.getBatchNo());
         stockInRecordDto.setProductModelId(stockUninventoryDto.getProductModelId());
         stockInRecordDto.setType("1");
+        stockInRecordDto.setOilDepotId(stockUninventoryDto.getOilDepotId());
+        stockInRecordDto.setOilDepotName(stockUninventoryDto.getOilDepotName());
+        stockInRecordDto.setInboundCategory(stockUninventoryDto.getInboundCategory());
+        if (stockUninventoryDto.getOilDepotId() != null && StringUtils.isEmpty(stockInRecordDto.getOilDepotName())) {
+            OilDepot oilDepot = oilDepotMapper.selectById(stockUninventoryDto.getOilDepotId());
+            if (oilDepot != null) {
+                stockInRecordDto.setOilDepotName(oilDepot.getDepotName());
+            }
+        }
+        stockInRecordDto.setTankId(stockUninventoryDto.getTankId());
+        stockInRecordDto.setTankNo(stockUninventoryDto.getTankNo());
+        if (stockUninventoryDto.getTankId() != null && StringUtils.isEmpty(stockInRecordDto.getTankNo())) {
+            TankInfo tankInfo = tankInfoMapper.selectById(stockUninventoryDto.getTankId());
+            if (tankInfo != null) {
+                stockInRecordDto.setTankNo(tankInfo.getTankNo());
+            }
+        }
+        stockInRecordDto.setInboundTime(stockUninventoryDto.getInboundTime());
+        stockInRecordDto.setOilProduct(stockUninventoryDto.getOilProduct());
+        stockInRecordDto.setOriginalQuantity(stockUninventoryDto.getOriginalQuantity());
+        stockInRecordDto.setCustomerId(stockUninventoryDto.getCustomerId());
+        stockInRecordDto.setCustomerName(stockUninventoryDto.getCustomerName());
+        stockInRecordDto.setContactPerson(stockUninventoryDto.getContactPerson());
+        stockInRecordDto.setContactPhone(stockUninventoryDto.getContactPhone());
+        stockInRecordDto.setDriverName(stockUninventoryDto.getDriverName());
+        stockInRecordDto.setDriverPhone(stockUninventoryDto.getDriverPhone());
+        stockInRecordDto.setEscortName(stockUninventoryDto.getEscortName());
+        stockInRecordDto.setEscortPhone(stockUninventoryDto.getEscortPhone());
+        stockInRecordDto.setTruckPlateNo(stockUninventoryDto.getTruckPlateNo());
+        stockInRecordDto.setTrailerPlateNo(stockUninventoryDto.getTrailerPlateNo());
+        stockInRecordDto.setTankInspectionStatus(stockUninventoryDto.getTankInspectionStatus());
+        stockInRecordDto.setUnloadingCranePosition(stockUninventoryDto.getUnloadingCranePosition());
+        stockInRecordDto.setDensity(stockUninventoryDto.getDensity());
+        stockInRecordDto.setUnloadPhotos(stockUninventoryDto.getUnloadPhotos() == null
+                ? null : JSON.toJSONString(stockUninventoryDto.getUnloadPhotos()));
+        stockInRecordDto.setGrossWeight(stockUninventoryDto.getGrossWeight());
+        stockInRecordDto.setTareWeight(stockUninventoryDto.getTareWeight());
+        stockInRecordDto.setNetWeight(stockUninventoryDto.getNetWeight());
+        stockInRecordDto.setLossQuantity(stockUninventoryDto.getLossQuantity());
+        stockInRecordDto.setActualVolume(stockUninventoryDto.getActualVolume());
+        stockInRecordDto.setPoundPhotos(stockUninventoryDto.getPoundPhotos() == null
+                ? null : JSON.toJSONString(stockUninventoryDto.getPoundPhotos()));
+        if (stockUninventoryDto.getCustomerId() != null && StringUtils.isEmpty(stockInRecordDto.getCustomerName())) {
+            Customer customer = customerMapper.selectById(stockUninventoryDto.getCustomerId());
+            if (customer != null) {
+                stockInRecordDto.setCustomerName(customer.getCustomerName());
+            }
+        }
         stockInRecordService.add(stockInRecordDto);
         //瀹℃壒鍐嶆坊鍔�
         return 1;
@@ -121,6 +179,54 @@
         stockInRecordDto.setProductModelId(stockUninventoryDto.getProductModelId());
         stockInRecordDto.setType("1");
         stockInRecordDto.setRemark(stockUninventoryDto.getRemark());
+        stockInRecordDto.setOilDepotId(stockUninventoryDto.getOilDepotId());
+        stockInRecordDto.setOilDepotName(stockUninventoryDto.getOilDepotName());
+        stockInRecordDto.setInboundCategory(stockUninventoryDto.getInboundCategory());
+        if (stockUninventoryDto.getOilDepotId() != null && StringUtils.isEmpty(stockInRecordDto.getOilDepotName())) {
+            OilDepot oilDepot = oilDepotMapper.selectById(stockUninventoryDto.getOilDepotId());
+            if (oilDepot != null) {
+                stockInRecordDto.setOilDepotName(oilDepot.getDepotName());
+            }
+        }
+        stockInRecordDto.setTankId(stockUninventoryDto.getTankId());
+        stockInRecordDto.setTankNo(stockUninventoryDto.getTankNo());
+        if (stockUninventoryDto.getTankId() != null && StringUtils.isEmpty(stockInRecordDto.getTankNo())) {
+            TankInfo tankInfo = tankInfoMapper.selectById(stockUninventoryDto.getTankId());
+            if (tankInfo != null) {
+                stockInRecordDto.setTankNo(tankInfo.getTankNo());
+            }
+        }
+        stockInRecordDto.setInboundTime(stockUninventoryDto.getInboundTime());
+        stockInRecordDto.setOilProduct(stockUninventoryDto.getOilProduct());
+        stockInRecordDto.setOriginalQuantity(stockUninventoryDto.getOriginalQuantity());
+        stockInRecordDto.setCustomerId(stockUninventoryDto.getCustomerId());
+        stockInRecordDto.setCustomerName(stockUninventoryDto.getCustomerName());
+        stockInRecordDto.setContactPerson(stockUninventoryDto.getContactPerson());
+        stockInRecordDto.setContactPhone(stockUninventoryDto.getContactPhone());
+        stockInRecordDto.setDriverName(stockUninventoryDto.getDriverName());
+        stockInRecordDto.setDriverPhone(stockUninventoryDto.getDriverPhone());
+        stockInRecordDto.setEscortName(stockUninventoryDto.getEscortName());
+        stockInRecordDto.setEscortPhone(stockUninventoryDto.getEscortPhone());
+        stockInRecordDto.setTruckPlateNo(stockUninventoryDto.getTruckPlateNo());
+        stockInRecordDto.setTrailerPlateNo(stockUninventoryDto.getTrailerPlateNo());
+        stockInRecordDto.setTankInspectionStatus(stockUninventoryDto.getTankInspectionStatus());
+        stockInRecordDto.setUnloadingCranePosition(stockUninventoryDto.getUnloadingCranePosition());
+        stockInRecordDto.setDensity(stockUninventoryDto.getDensity());
+        stockInRecordDto.setUnloadPhotos(stockUninventoryDto.getUnloadPhotos() == null
+                ? null : JSON.toJSONString(stockUninventoryDto.getUnloadPhotos()));
+        stockInRecordDto.setGrossWeight(stockUninventoryDto.getGrossWeight());
+        stockInRecordDto.setTareWeight(stockUninventoryDto.getTareWeight());
+        stockInRecordDto.setNetWeight(stockUninventoryDto.getNetWeight());
+        stockInRecordDto.setLossQuantity(stockUninventoryDto.getLossQuantity());
+        stockInRecordDto.setActualVolume(stockUninventoryDto.getActualVolume());
+        stockInRecordDto.setPoundPhotos(stockUninventoryDto.getPoundPhotos() == null
+                ? null : JSON.toJSONString(stockUninventoryDto.getPoundPhotos()));
+        if (stockUninventoryDto.getCustomerId() != null && StringUtils.isEmpty(stockInRecordDto.getCustomerName())) {
+            Customer customer = customerMapper.selectById(stockUninventoryDto.getCustomerId());
+            if (customer != null) {
+                stockInRecordDto.setCustomerName(customer.getCustomerName());
+            }
+        }
         stockInRecordService.add(stockInRecordDto);
         return 1;
     }

--
Gitblit v1.9.3