From 1cf91e355038837f30f2d727507b2229263d7de7 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期二, 27 一月 2026 17:49:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_New
---
src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java | 32 ++++++++------------------------
1 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java b/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
index b07730d..a30adb9 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,19 +51,14 @@
@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("/listPage")
@@ -100,20 +96,9 @@
@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.setStatus("宸插彂璐�");
- 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();
+
+
+ return shippingInfoService.deductStock( req) ? AjaxResult.success() : AjaxResult.error();
}
@PostMapping("/update")
@@ -134,9 +119,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