From 1dcfa3702505f0c431757312b5304531029f90f6 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 09 四月 2026 18:57:38 +0800
Subject: [PATCH] #getter$摘出entity

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/DeliveryItemController.java |   98 ++++++++++++++++++++++++++++---------------------
 1 files changed, 56 insertions(+), 42 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..ed90faf 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,19 +13,25 @@
 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.manager.utils.buildPageRowsUtils;
 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;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.*;
 
 @RestController
@@ -31,8 +39,6 @@
 
     @Autowired
     private DeliveryItemService deliveryItemService;
-
-
     @Autowired
     private CompanysService companysService;
 
@@ -41,25 +47,62 @@
     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);
+        PageParam<DeliveryItem, BaseParam> page = deliveryItemService.page(pageParam, wrapper);
+        return R.ok().add(buildPageRowsUtils.rowsMap(page));
     }
+
+    @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 ");
+        PageParam<DeliveryItem, BaseParam> page = deliveryItemService.page(pageParam, wrapper);
+        return R.ok().add(buildPageRowsUtils.rowsMap(page));
+    }
+
+
+    @PreAuthorize("hasAuthority('manager:deliveryItem:list')")
+    @ApiOperation("鍒嗛〉鑾峰彇鍒楄〃")
+    @PostMapping("/deliveryItem/edit/page")
+    public R byPoIdspage(@RequestBody Map<String, Object> map) {
+        List<Long> poDetlIds = new ArrayList<>();
+        if (!Objects.isNull(map.get("ids"))) {
+            poDetlIds = JSONArray.parseArray(JSONArray.toJSONString(map.get("ids")), Long.class);
+            map.remove("ids");
+        }
+        BaseParam baseParam = buildParam(map, BaseParam.class);
+        PageParam<DeliveryItem, BaseParam> pageParam = new PageParam<>(baseParam, DeliveryItem.class);
+        QueryWrapper<DeliveryItem> queryWrapper = pageParam.buildWrapper(true);
+        if (!poDetlIds.isEmpty()) {
+            queryWrapper.in("id", poDetlIds);
+        } else {
+            return R.ok();
+        }
+        PageParam<DeliveryItem, BaseParam> page = deliveryItemService.page(pageParam, queryWrapper);
+        return R.ok().add(buildPageRowsUtils.rowsMap(page));
+    }
+
+
 
     @PreAuthorize("hasAuthority('manager:deliveryItem:list')")
     @PostMapping("/deliveryItem/list")
     public R list(@RequestBody Map<String, Object> map) {
-        return R.ok().add(deliveryItemService.list());
+        return R.ok().add(buildPageRowsUtils.rowsMap(deliveryItemService.list()));
     }
 
     @PreAuthorize("hasAuthority('manager:deliveryItem:list')")
     @PostMapping({"/deliveryItem/many/{ids}", "/deliveryItems/many/{ids}"})
     public R many(@PathVariable Long[] ids) {
-        return R.ok().add(deliveryItemService.listByIds(Arrays.asList(ids)));
+        return R.ok().add(buildPageRowsUtils.rowsMap(deliveryItemService.listByIds(Arrays.asList(ids))));
     }
 
     @PreAuthorize("hasAuthority('manager:deliveryItem:list')")
     @GetMapping("/deliveryItem/{id}")
     public R get(@PathVariable("id") Long id) {
-        return R.ok().add(deliveryItemService.getById(id));
+        return R.ok().add(buildPageRowsUtils.rowsMap(deliveryItemService.getById(id)));
     }
 
     @PreAuthorize("hasAuthority('manager:deliveryItem:save')")
@@ -77,7 +120,7 @@
         if (!deliveryItemService.save(deliveryItem)) {
             return R.error("Save Fail");
         }
-        return R.ok("Save Success").add(deliveryItem);
+        return R.ok("Save Success").add(buildPageRowsUtils.rowsMap(deliveryItem));
     }
 
     @PreAuthorize("hasAuthority('manager:deliveryItem:update')")
@@ -89,7 +132,7 @@
         if (!deliveryItemService.updateById(deliveryItem)) {
             return R.error("Update Fail");
         }
-        return R.ok("Update Success").add(deliveryItem);
+        return R.ok("Update Success").add(buildPageRowsUtils.rowsMap(deliveryItem));
     }
 
     @PreAuthorize("hasAuthority('manager:deliveryItem:remove')")
@@ -99,7 +142,7 @@
         if (!deliveryItemService.removeByIds(Arrays.asList(ids))) {
             return R.error("Delete Fail");
         }
-        return R.ok("Delete Success").add(ids);
+        return R.ok("Delete Success").add(buildPageRowsUtils.rowsMap(ids));
     }
 
     @PreAuthorize("hasAuthority('manager:deliveryItem:list')")
@@ -113,35 +156,6 @@
         deliveryItemService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
                 item -> vos.add(new KeyValVo(item.getId(), item.getId()))
         );
-        return R.ok().add(vos);
+        return R.ok().add(buildPageRowsUtils.rowsMap(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