From f4d4d29368ccacb807f93e2033cd4a643a3ddade Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 30 三月 2026 10:20:28 +0800
Subject: [PATCH] yys 1.修改bug

---
 src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java |   51 +++++++++++++++++++--------------------------------
 1 files changed, 19 insertions(+), 32 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java b/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
index 1c657e9..29dafda 100644
--- a/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
+++ b/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
@@ -16,6 +16,7 @@
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.other.service.impl.TempFileServiceImpl;
+import com.ruoyi.procurementrecord.utils.StockUtils;
 import com.ruoyi.sales.dto.ShippingInfoDto;
 import com.ruoyi.sales.mapper.ShipmentApprovalMapper;
 import com.ruoyi.sales.mapper.ShippingInfoMapper;
@@ -50,25 +51,32 @@
 
     @Autowired
     private ShippingInfoService shippingInfoService;
-    @Autowired
-    private ShipmentApprovalMapper shipmentApprovalMapper;
-    @Autowired
-    private ISalesLedgerProductService salesLedgerProductService;
-
-    @Autowired
-    private TempFileServiceImpl tempFileService;
 
     @Autowired
     private CommonFileServiceImpl commonFileService;
 
     @Autowired
     private ApproveProcessServiceImpl approveProcessService;
+    @Autowired
+    private StockUtils stockUtils;
+
+    @GetMapping("/getByCustomerName")
+    @ApiOperation("閫氳繃瀹㈡埛鍚嶇О鏌ヨ")
+    public AjaxResult getByCustomerName(String customerName) {
+        return AjaxResult.success(shippingInfoService.getShippingInfoByCustomerName(customerName));
+    }
+
+    @ApiOperation("璇︽儏")
+    @GetMapping("/getById")
+    public AjaxResult getById(Long id) {
+        return AjaxResult.success(shippingInfoService.getDateil(id));
+    }
 
 
     @GetMapping("/listPage")
     @ApiOperation("鍙戣揣淇℃伅鍒楄〃")
     public AjaxResult listPage(Page page, ShippingInfo req) {
-        IPage<ShippingInfo> listPage = shippingInfoService.listPage(page,req);
+        IPage<ShippingInfoDto> listPage = shippingInfoService.listPage(page,req);
         return AjaxResult.success(listPage);
     }
 
@@ -82,7 +90,7 @@
         // 鍙戣揣瀹℃壒
         ApproveProcessVO approveProcessVO = new ApproveProcessVO();
         approveProcessVO.setApproveType(7);
-        approveProcessVO.setApproveDeptId(loginUser.getTenantId());
+        approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId());
         approveProcessVO.setApproveReason(req.getType() + ":" +sh);
         approveProcessVO.setApproveUserIds(req.getApproveUserIds());
         approveProcessVO.setApproveUser(loginUser.getUserId());
@@ -93,26 +101,6 @@
         req.setStatus("寰呭鏍�");
         boolean save = shippingInfoService.save(req);
         return save ? AjaxResult.success() : AjaxResult.error();
-    }
-
-    @ApiOperation("鍙戣揣鎵e簱瀛�")
-    @PostMapping("/deductStock")
-    @Transactional(rollbackFor = Exception.class)
-    @Log(title = "鍙戣揣淇℃伅绠$悊", businessType = BusinessType.UPDATE)
-    public AjaxResult deductStock(@RequestBody ShippingInfoDto req) throws IOException {
-        ShippingInfo byId = shippingInfoService.getById(req.getId());
-        if (byId == null) {
-            return AjaxResult.error("鍙戣揣淇℃伅涓嶅瓨鍦�");
-        }
-        byId.setExpressNumber(req.getExpressNumber());
-        byId.setExpressCompany(req.getExpressCompany());
-        byId.setShippingCarNumber(req.getShippingCarNumber());
-        boolean update = shippingInfoService.updateById(req);
-        // 杩佺Щ鏂囦欢
-        if(CollectionUtils.isNotEmpty(req.getTempFileIds())){
-            tempFileService.migrateTempFilesToFormal(req.getId(), req.getTempFileIds(), FileNameType.SHIP.getValue());
-        }
-        return update ? AjaxResult.success() : AjaxResult.error();
     }
 
     @PostMapping("/update")
@@ -133,9 +121,8 @@
     @Transactional(rollbackFor = Exception.class)
     @Log(title = "鍙戣揣淇℃伅绠$悊", businessType = BusinessType.DELETE)
     public AjaxResult delete(@RequestBody List<Long> ids) {
-        commonFileService.deleteByBusinessIds(ids, FileNameType.SHIP.getValue());
-        boolean delete = shippingInfoService.removeBatchByIds(ids);
-        return delete ? AjaxResult.success("鍒犻櫎鎴愬姛") : AjaxResult.error("鍒犻櫎澶辫触");
+
+        return shippingInfoService.delete(ids) ? AjaxResult.success("鍒犻櫎鎴愬姛") : AjaxResult.error("鍒犻櫎澶辫触");
     }
 
     @Autowired

--
Gitblit v1.9.3