From c312a110ee4823a4a1f912a05e9648edc56f96e7 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 06 六月 2025 15:48:42 +0800
Subject: [PATCH] DO 单生成出库单功能优化

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/DeliveryItemController.java |   55 +++++++++++++++++++++----------------------------------
 1 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/DeliveryItemController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/DeliveryItemController.java
index adf0cba..dd11eb1 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/DeliveryItemController.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/DeliveryItemController.java
@@ -1,7 +1,9 @@
 package com.vincent.rsf.server.manager.controller;
 
 import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.vincent.rsf.framework.common.Cools;
 import com.vincent.rsf.framework.common.R;
@@ -11,15 +13,20 @@
 import com.vincent.rsf.server.common.domain.BaseParam;
 import com.vincent.rsf.server.common.domain.KeyValVo;
 import com.vincent.rsf.server.common.domain.PageParam;
-import com.vincent.rsf.server.manager.entity.Companys;
-import com.vincent.rsf.server.manager.entity.DeliveryItem;
+import com.vincent.rsf.server.manager.entity.*;
+import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate;
+import com.vincent.rsf.server.manager.entity.excel.DeliveryTemplate;
+import com.vincent.rsf.server.manager.enums.OrderType;
+import com.vincent.rsf.server.manager.enums.OrderWorkType;
 import com.vincent.rsf.server.manager.service.CompanysService;
 import com.vincent.rsf.server.manager.service.DeliveryItemService;
+import com.vincent.rsf.server.manager.service.impl.DeliveryServiceImpl;
 import com.vincent.rsf.server.system.controller.BaseController;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -31,8 +38,6 @@
 
     @Autowired
     private DeliveryItemService deliveryItemService;
-
-
     @Autowired
     private CompanysService companysService;
 
@@ -41,7 +46,18 @@
     public R page(@RequestBody Map<String, Object> map) {
         BaseParam baseParam = buildParam(map, BaseParam.class);
         PageParam<DeliveryItem, BaseParam> pageParam = new PageParam<>(baseParam, DeliveryItem.class);
-        return R.ok().add(deliveryItemService.page(pageParam, pageParam.buildWrapper(true)));
+        QueryWrapper<DeliveryItem> wrapper = pageParam.buildWrapper(true);
+        return R.ok().add(deliveryItemService.page(pageParam, wrapper));
+    }
+
+    @PreAuthorize("hasAuthority('manager:deliveryItem:list')")
+    @PostMapping("/deliveryItem/filters/page")
+    public R filter(@RequestBody Map<String, Object> map) {
+        BaseParam baseParam = buildParam(map, BaseParam.class);
+        PageParam<DeliveryItem, BaseParam> pageParam = new PageParam<>(baseParam, DeliveryItem.class);
+        QueryWrapper<DeliveryItem> wrapper = pageParam.buildWrapper(true);
+        wrapper.apply("anfme > work_qty + qty ");
+        return R.ok().add(deliveryItemService.page(pageParam, wrapper));
     }
 
     @PreAuthorize("hasAuthority('manager:deliveryItem:list')")
@@ -115,33 +131,4 @@
         );
         return R.ok().add(vos);
     }
-
-    @PreAuthorize("hasAuthority('manager:deliveryItem:list')")
-    @PostMapping("/deliveryItem/export")
-    public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
-        if (!Cools.isEmpty(map) && !Cools.isEmpty(map.get("ids"))) {
-            throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
-        }
-        List<Long> jsonArray = JSONArray.parseArray(JSONArray.toJSONString(map.get("ids")), Long.class);
-//        if (jsonArray.isEmpty()) {
-//            ExcelUtil.build(ExcelUtil.create(deliveryItemService.getOne(new La), DeliveryItem.class), response);
-//        } else {
-//            ExcelUtil.build(ExcelUtil.create(deliveryItemService.list(), DeliveryItem.class), response);
-//        }
-    }
-
-
-    @PostMapping("/deliveryItem/import")
-    @ApiOperation("DO鍗曞鍏ユ帴鍙�")
-    @PreAuthorize("hasAuthority('manager:asnOrderItem:update')")
-    public R importExcel(@RequestParam(value = "file") MultipartFile file) throws Exception {
-        if (Objects.isNull(file)) {
-            return R.error("鏂囦欢涓嶈兘涓虹┖锛侊紒");
-        }
-        Map<String, Object> hashMap = new HashMap<>();
-
-        return R.ok();
-//        return deliveryItemService.excelImport(file, hashMap, getLoginUserId());
-    }
-
 }

--
Gitblit v1.9.1