From c35602749d47a56b5c20783b82f9df49c00840db Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 06 七月 2020 10:10:48 +0800
Subject: [PATCH] #任务中心————拣料入库

---
 src/main/java/com/zy/asrs/controller/MatCodeController.java |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/MatCodeController.java b/src/main/java/com/zy/asrs/controller/MatCodeController.java
index f7e8bd8..1594efb 100644
--- a/src/main/java/com/zy/asrs/controller/MatCodeController.java
+++ b/src/main/java/com/zy/asrs/controller/MatCodeController.java
@@ -16,6 +16,7 @@
 import com.zy.asrs.entity.MatCodePrint;
 import com.zy.asrs.service.MatCodeService;
 import com.zy.common.CodeRes;
+import com.zy.common.config.AdminInterceptor;
 import com.zy.common.utils.BarcodeUtils;
 import com.zy.common.utils.QrCode;
 import com.zy.common.utils.excel.matcode.MatCodeExcel;
@@ -44,6 +45,12 @@
         return R.ok(matCodeService.selectById(String.valueOf(id)));
     }
 
+    @RequestMapping(value = "/matCode/auth")
+    @ManagerAuth
+    public R find(@RequestParam("id") String id) {
+        return R.ok(matCodeService.selectById(String.valueOf(id)));
+    }
+
     @RequestMapping(value = "/matCode/list/auth")
     @ManagerAuth
     public R list(@RequestParam(defaultValue = "1")Integer curr,
@@ -63,14 +70,15 @@
         return R.ok(matCodeService.selectPage(new Page<>(curr, limit), wrapper));
     }
 
-    private void convert(Map<String, Object> map, EntityWrapper wrapper){
+    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
         for (Map.Entry<String, Object> entry : map.entrySet()){
-            if (entry.getKey().endsWith(">")) {
-                wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue())));
-            } else if (entry.getKey().endsWith("<")) {
-                wrapper.le(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue())));
+            String val = String.valueOf(entry.getValue());
+            if (val.contains(RANGE_TIME_LINK)){
+                String[] dates = val.split(RANGE_TIME_LINK);
+                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
+                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
             } else {
-                wrapper.like(entry.getKey(), String.valueOf(entry.getValue()));
+                wrapper.like(entry.getKey(), val);
             }
         }
     }
@@ -150,7 +158,7 @@
     }
 
     // 鎵撳嵃
-    @RequestMapping(value = "/macCode/print/auth")
+    @RequestMapping(value = "/matCode/print/auth")
     @ManagerAuth(memo = "鐗╂枡缂栫爜鎵撳嵃")
     public R matCodePrint(@RequestParam(value = "param[]") String[] param) {
         if(Cools.isEmpty(param)) {
@@ -176,6 +184,7 @@
     public R matCodeBarcode(@RequestParam(defaultValue = "1") Integer type
                         , @RequestParam String param
                         , HttpServletResponse response) throws Exception {
+        AdminInterceptor.cors(response);
         if (Cools.isEmpty(param)){
             return R.parse(BaseRes.EMPTY);
         }

--
Gitblit v1.9.1