From a3776853fa6ff1c4a9805615a79852d54f700e3f Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期六, 20 七月 2024 09:21:04 +0800
Subject: [PATCH] 增加库位明细导出功能,曾加物料、单据、库存全局搜索功能

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java |   81 +++++++++++++++++++++++-----------------
 1 files changed, 46 insertions(+), 35 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java
index 4576e75..d1fbe84 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java
@@ -42,6 +42,20 @@
     @Autowired
     private TreeUtils treeUtils;
 
+
+    @RequestMapping(value = "/tag/list/pda/auth")
+    @ManagerAuth
+    public R pdaList(@RequestParam(defaultValue = "1")Integer curr,
+                     @RequestParam(defaultValue = "10")Integer limit,
+                     @RequestParam(required = false)Long parentId){
+        LambdaQueryWrapper<Tag> tagLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        if(!Cools.isEmpty(parentId)) {
+            tagLambdaQueryWrapper.eq(Tag::getParentId, parentId == null ? getOriginTag().getId() : parentId);
+        }
+        List<Tag> tags = tagService.list(tagLambdaQueryWrapper);
+        return R.ok().add(tags);
+    }
+
     @RequestMapping(value = "/tag/{id}/auth")
     @ManagerAuth
     public R get(@PathVariable("id") String id) {
@@ -50,26 +64,24 @@
 
     @RequestMapping(value = "/tag/page/auth")
     @ManagerAuth
-    public R page(@RequestParam(defaultValue = "1") Integer curr,
-                  @RequestParam(defaultValue = "10") Integer limit,
-                  @RequestParam(required = false) String condition,
-                  @RequestParam(required = false) String timeRange) {
+    public R page(@RequestParam(defaultValue = "1")Integer curr,
+                  @RequestParam(defaultValue = "10")Integer limit,
+                  @RequestParam(required = false)String orderByField,
+                  @RequestParam(required = false)String orderByType,
+                  @RequestParam Map<String, Object> param) {
+        Long hostId = getHostId();
         LambdaQueryWrapper<Tag> wrapper = new LambdaQueryWrapper<>();
-        if (!Cools.isEmpty(condition)) {
-            wrapper.like(Tag::getId, condition);
-        }
-        if (!Cools.isEmpty(timeRange)) {
-            String[] range = timeRange.split(RANGE_TIME_LINK);
-            wrapper.ge(Tag::getCreateTime, DateUtils.convert(range[0]));
-            wrapper.le(Tag::getCreateTime, DateUtils.convert(range[1]));
-        }
-        return R.ok(tagService.page(new Page<>(curr, limit), wrapper));
+        wrapper.eq(Tag::getHostId, hostId);
+        excludeTrash(param);
+        return R.parse("0-鎿嶄綔鎴愬姛").add(tagService.list(wrapper));
     }
 
 
     @RequestMapping(value = "/tag/add/auth")
     @ManagerAuth
     public R add(Tag tag) {
+        tag.setHostId(getHostId());
+        tag.setStatus(1);
         tagService.save(tag);
         return R.ok();
     }
@@ -124,7 +136,7 @@
     @PostMapping(value = "/tag/tree/auth")
     @ManagerAuth
     public R tree(@RequestParam(required = false, defaultValue = "") String condition) throws IOException, ClassNotFoundException {
-        ArrayList<Map> tree = treeUtils.getTree(String.valueOf(getOriginTag().getId()));
+        ArrayList<Map> tree = treeUtils.getTree(getOriginTag().getId(), getHostId());
         // 娣辨嫹璐�
         List<Map> result = ListUtils.deepCopy(tree);
         if (!Cools.isEmpty(condition)) {
@@ -177,6 +189,15 @@
             print.setSpecs(mat.getSpecs());
             print.setUnit(mat.getUnit());
             print.setMemo(mat.getMemo());
+
+            print.setMaterial(mat.getMaterial());
+            print.setDecrees(mat.getDecrees());
+            print.setImgNum(mat.getImgNum());
+            print.setWeight(String.valueOf(mat.getWeight()));
+            print.setModel(mat.getModel());
+            print.setLength(String.valueOf(mat.getLength()));
+            print.setWidth(mat.getWidth());
+            print.setHeight(mat.getHeight());
             res.add(print);
         }
         return R.ok().add(res);
@@ -201,34 +222,24 @@
                 .doWrite(excels);
     }
 
+//    // excel瀵煎叆-------鍒ゆ柇鏄惁鏈夐噸澶嶇墿鏂�
+//    @PostMapping(value = "/mat/excel/import/check/auth")
+//    @ManagerAuth(memo = "鍟嗗搧妗f鏁版嵁瀵煎叆")
+//    @Transactional
+//    public R matExcelImportCheck(MultipartFile file) throws IOException {
+//        MatExcelListener listener = new MatExcelListener(getUserId(), getHostId());
+//        EasyExcel.read(file.getInputStream(), MatExcel.class, listener).sheet().doRead();
+//        return R.ok("鎴愬姛鍚屾"+listener.getTotal()+"鏉″晢鍝佹暟鎹�");
+//    }
+
     // excel瀵煎叆
     @PostMapping(value = "/mat/excel/import/auth")
     @ManagerAuth(memo = "鍟嗗搧妗f鏁版嵁瀵煎叆")
     @Transactional
     public R matExcelImport(MultipartFile file) throws IOException {
-        MatExcelListener listener = new MatExcelListener(getUserId());
+        MatExcelListener listener = new MatExcelListener(getUserId(), getHostId());
         EasyExcel.read(file.getInputStream(), MatExcel.class, listener).sheet().doRead();
         return R.ok("鎴愬姛鍚屾"+listener.getTotal()+"鏉″晢鍝佹暟鎹�");
-    }
-
-    /*************************************** xm-select ***********************************************/
-
-    // xm-select 鎼滅储鍟嗗搧鍒楄〃
-    @RequestMapping("/mat/all/get/kv")
-    @ManagerAuth
-    public R getMatDataKV(@RequestParam(required = false) String condition) {
-        LambdaQueryWrapper<Mat> wrapper = new LambdaQueryWrapper<Mat>()
-                .like(Mat::getMatnr, condition).or().like(Mat::getMaktx, condition)
-                .orderByAsc(Mat::getCreateTime);
-        List<Mat> mats = matService.page(new Page<>(1, 30), wrapper).getRecords();
-        List<KeyValueVo> valueVos = new ArrayList<>();
-        for (Mat mat : mats) {
-            KeyValueVo vo = new KeyValueVo();
-            vo.setName(mat.getMatnr() + " - " + mat.getMaktx());
-            vo.setValue(mat.getId());
-            valueVos.add(vo);
-        }
-        return R.ok().add(valueVos);
     }
 
 }

--
Gitblit v1.9.1