From 7cbf3dba956e51f70ad35d213f7593365e4ec4a9 Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Mon, 1 Sep 2025 09:07:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(inventory):=20=E6=B7=BB=E5=8A=A0=E6=92=A4?= =?UTF-8?q?=E5=9B=9E=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增撤回功能,允许用户撤回已发货的订单 - 优化发货流程,增加备注和文件上传功能 - 调整库存管理,支持撤回后的库存更新 - 修复了一些与发货和库存相关的bug --- .../controller/common/CommonController.java | 20 ++++-- .../controller/system/SysIndexController.java | 5 +- .../inventory/delivery/delivery.html | 11 +++ .../templates/inventory/execution/edit.html | 16 +++-- .../templates/inventory/execution/track.html | 10 ++- .../templates/inventory/inner/add.html | 4 +- .../templates/inventory/inner/edit.html | 21 ++++++ .../templates/inventory/inner/inner.html | 6 ++ .../templates/inventory/outer/edit.html | 32 ++++++--- .../templates/system/customer/info.html | 6 +- .../InventoryDeliveryController.java | 8 +++ .../InventoryExecutionController.java | 7 ++ .../ruoyi/sip/domain/InventoryDelivery.java | 1 + .../ruoyi/sip/domain/ProjectOrderInfo.java | 8 +++ .../ruoyi/sip/mapper/InventoryInfoMapper.java | 3 + .../ruoyi/sip/mapper/ProductInfoMapper.java | 2 + .../sip/service/IExecutionTrackService.java | 2 + .../service/IInventoryDeliveryService.java | 3 + .../sip/service/IInventoryInfoService.java | 2 + .../sip/service/IProductInfoService.java | 4 ++ .../impl/ExecutionTrackServiceImpl.java | 70 +++++++++++++++++++ .../impl/InventoryDeliveryServiceImpl.java | 38 ++++++++++ .../impl/InventoryInfoServiceImpl.java | 5 ++ .../impl/InventoryOuterServiceImpl.java | 17 ++--- .../service/impl/ProductInfoServiceImpl.java | 5 ++ .../impl/ProjectOrderInfoServiceImpl.java | 14 +++- .../inventory/InventoryDeliveryMapper.xml | 5 +- .../mapper/inventory/InventoryInfoMapper.xml | 8 +++ .../mapper/sip/ProjectOrderInfoMapper.xml | 1 + .../mapper/system/ProductInfoMapper.xml | 8 +++ 30 files changed, 305 insertions(+), 37 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index 7b1fca45..bd316b04 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -14,10 +14,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.config.ServerConfig; @@ -113,6 +110,21 @@ public class CommonController return AjaxResult.error(e.getMessage()); } } + @GetMapping("/file/download") + public void download(@RequestParam("id") Integer id, HttpServletRequest request, HttpServletResponse response) { + try { + // 本地资源路径 + String localPath = RuoYiConfig.getProfile(); + OmsFileLog omsFileLog = fileLogService.queryById(id); + // 下载名称 + String downloadPath = omsFileLog.getFileName().replace(Constants.RESOURCE_PREFIX,localPath); + response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); + FileUtils.setAttachmentResponseHeader(response, StringUtils.isEmpty(omsFileLog.getOriginalFilename()) ? omsFileLog.getNewFilename() : omsFileLog.getOriginalFilename()); + FileUtils.writeBytes(downloadPath, response.getOutputStream()); + } catch (Exception e) { + log.error("下载文件失败", e); + } + } /** * 通用上传请求(多个) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java index 10da47fb..5fe06998 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java @@ -42,7 +42,10 @@ public class SysIndexController extends BaseController @Autowired private SysPasswordService passwordService; - + @GetMapping("/test") + public String test(){ + return "test"; + } // 系统首页 @GetMapping("/index") public String index(ModelMap mmap) diff --git a/ruoyi-admin/src/main/resources/templates/inventory/delivery/delivery.html b/ruoyi-admin/src/main/resources/templates/inventory/delivery/delivery.html index a2b6b26f..704fbb8c 100644 --- a/ruoyi-admin/src/main/resources/templates/inventory/delivery/delivery.html +++ b/ruoyi-admin/src/main/resources/templates/inventory/delivery/delivery.html @@ -65,9 +65,19 @@