From adc03660c3592d4d87076c4fefcbb86280610c4a Mon Sep 17 00:00:00 2001
From: 18516761980 <4761516tqsxp>
Date: 星期三, 25 八月 2021 13:29:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/xgmasrs' into xgmasrs

---
 src/main/java/com/zy/ints/controller/WaitMatinController.java |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/zy/ints/controller/WaitMatinController.java b/src/main/java/com/zy/ints/controller/WaitMatinController.java
index ac5b143..aca57b3 100644
--- a/src/main/java/com/zy/ints/controller/WaitMatinController.java
+++ b/src/main/java/com/zy/ints/controller/WaitMatinController.java
@@ -9,7 +9,9 @@
 import com.core.common.Cools;
 import com.core.common.DateUtils;
 import com.core.common.R;
-import com.zy.asrs.entity.LocDetl;
+import com.zy.asrs.entity.MatCode;
+import com.zy.asrs.service.MatCodeService;
+import com.zy.common.entity.KeyValueVo;
 import com.zy.common.web.BaseController;
 import com.zy.ints.entity.WaitMatin;
 import com.zy.ints.service.WaitMatinService;
@@ -26,6 +28,8 @@
 
     @Autowired
     private WaitMatinService waitMatinService;
+    @Autowired
+    private MatCodeService matCodeService;
 
     @RequestMapping(value = "/waitMatin/head/page/auth")
     @ManagerAuth
@@ -46,11 +50,25 @@
 
 
 
+    /*************************************** xm-select ***********************************************/
 
-
-
-
-
+    // xm-select 鎼滅储鍟嗗搧鍒楄〃
+    @RequestMapping("/mat/all/get/kv")
+    @ManagerAuth
+    public R getMatDataKV(@RequestParam(required = false) String condition) {
+        Wrapper<MatCode> wrapper = new EntityWrapper<MatCode>()
+                .andNew().like("matnr", condition).or().like("maktx", condition)
+                .orderBy("create_time", false);
+        List<MatCode> mats = matCodeService.selectPage(new Page<>(1, 30), wrapper).getRecords();
+        List<KeyValueVo> valueVos = new ArrayList<>();
+        for (MatCode mat : mats) {
+            KeyValueVo vo = new KeyValueVo();
+            vo.setName(mat.getMatNo() + " - " + mat.getMatName());
+            vo.setValue(mat.getMatNo());
+            valueVos.add(vo);
+        }
+        return R.ok().add(valueVos);
+    }
 
 
 
@@ -70,10 +88,12 @@
                   @RequestParam(defaultValue = "10")Integer limit,
                   @RequestParam(required = false)String orderByField,
                   @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
                   @RequestParam Map<String, Object> param){
         EntityWrapper<WaitMatin> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
+        allLike(WaitMatin.class, param.keySet(), wrapper, condition);
         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
         return R.ok(waitMatinService.selectPage(new Page<>(curr, limit), wrapper));
     }

--
Gitblit v1.9.1