dengpan 1 jaar geleden
bovenliggende
commit
e099bb71e4

+ 112 - 0
src/main/java/com/steerinfo/dil/controller/WMSController.java

@@ -1,9 +1,12 @@
 package com.steerinfo.dil.controller;
 
 import com.steerinfo.dil.annotaion.LogAround;
+import com.steerinfo.dil.feign.ATWmsFeign;
 import com.steerinfo.dil.feign.WMSFeign;
 import com.steerinfo.dil.model.WmsSlmDlivDir;
 import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -32,6 +35,12 @@ public class WMSController extends BaseRESTfulController {
     @Autowired
     WMSFeign wmsFeign;
 
+    @Autowired
+    ATWmsFeign atWmsFeign;
+
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+
     @ApiOperation(value = "查询", notes = "分页查询销售订单")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "params", value = "查询条件", required = false, dataType = "HashMap"),
@@ -223,5 +232,108 @@ public class WMSController extends BaseRESTfulController {
     public Map<String, Object> outbound(@RequestBody(required = false) Map<String, Object> map){
         return wmsFeign.outbound(map);
     }
+
+    @PostMapping("/selectkcmx")
+    public RESTfulResult selectkcmx(@RequestBody HashMap map,
+                             Integer apiId,
+                             Integer pageNum,
+                             Integer pageSize){
+
+        if (map.get("createTime") != null) {
+            ArrayList arrayList = (ArrayList)map.get("createTime");
+            map.put("starttime", arrayList.get(0).toString());
+            map.put("endtime", arrayList.get(1).toString());
+        }
+
+         if (map.get("inDt") != null) {
+                ArrayList arrayList = (ArrayList)map.get("inDt");
+                map.put("indtstart", arrayList.get(0).toString());
+                map.put("indtend", arrayList.get(1).toString());
+        }
+        RESTfulResult selectkcmx = atWmsFeign.wuliuSelectkcmx(map, pageNum, pageSize);
+        Map<String, Object> data = (Map<String, Object>)selectkcmx.getData();
+        List<Map<String, Object>> list = (List<Map<String,Object>>)data.get("list");
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId,list);
+        pageList.setTotal((int)data.get("total"));
+        return success(pageList);
+    }
+
+    @PostMapping("/selectbybatchno")
+    public RESTfulResult selectbybatchno(@RequestBody HashMap map,
+                             Integer apiId,
+                             Integer pageNum,
+                             Integer pageSize){
+
+        if (map.get("createTime") != null) {
+            ArrayList arrayList = (ArrayList)map.get("createTime");
+            map.put("starttime", arrayList.get(0).toString());
+            map.put("endtime", arrayList.get(1).toString());
+        }
+
+        if (map.get("inDt") != null) {
+            ArrayList arrayList = (ArrayList)map.get("inDt");
+            map.put("indtstart", arrayList.get(0).toString());
+            map.put("indtend", arrayList.get(1).toString());
+        }
+
+        RESTfulResult selectkcmx = atWmsFeign.wuliuSelectbybatchno(map, pageNum, pageSize);
+        Map<String, Object> data = (Map<String, Object>)selectkcmx.getData();
+        List<Map<String, Object>> list = (List<Map<String,Object>>)data.get("list");
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId,list);
+        pageList.setTotal((int)data.get("total"));
+        return success(pageList);
+    }
+
+    @PostMapping("/selectbyprod")
+    public RESTfulResult selectbyprod(@RequestBody HashMap map,
+                                         Integer apiId,
+                                         Integer pageNum,
+                                         Integer pageSize){
+
+        if (map.get("createTime") != null) {
+            ArrayList arrayList = (ArrayList)map.get("createTime");
+            map.put("starttime", arrayList.get(0).toString());
+            map.put("endtime", arrayList.get(1).toString());
+        }
+
+        if (map.get("inDt") != null) {
+            ArrayList arrayList = (ArrayList)map.get("inDt");
+            map.put("indtstart", arrayList.get(0).toString());
+            map.put("indtend", arrayList.get(1).toString());
+        }
+
+        RESTfulResult selectkcmx = atWmsFeign.wuliuSelectbyprod(map, pageNum, pageSize);
+        Map<String, Object> data = (Map<String, Object>)selectkcmx.getData();
+        List<Map<String, Object>> list = (List<Map<String,Object>>)data.get("list");
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId,list);
+        pageList.setTotal((int)data.get("total"));
+        return success(pageList);
+    }
+
+    @PostMapping("/selectbybuttress")
+    public RESTfulResult selectbybuttress(@RequestBody HashMap map,
+                                      Integer apiId,
+                                      Integer pageNum,
+                                      Integer pageSize){
+
+        if (map.get("createTime") != null) {
+            ArrayList arrayList = (ArrayList)map.get("createTime");
+            map.put("starttime", arrayList.get(0).toString());
+            map.put("endtime", arrayList.get(1).toString());
+        }
+
+        if (map.get("inDt") != null) {
+            ArrayList arrayList = (ArrayList)map.get("inDt");
+            map.put("indtstart", arrayList.get(0).toString());
+            map.put("indtend", arrayList.get(1).toString());
+        }
+
+        RESTfulResult selectkcmx = atWmsFeign.wuliuSelectbybuttress(map, pageNum, pageSize);
+        Map<String, Object> data = (Map<String, Object>)selectkcmx.getData();
+        List<Map<String, Object>> list = (List<Map<String,Object>>)data.get("list");
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId,list);
+        pageList.setTotal((int)data.get("total"));
+        return success(pageList);
+    }
 }
 

+ 32 - 0
src/main/java/com/steerinfo/dil/feign/ATWmsFeign.java

@@ -0,0 +1,32 @@
+package com.steerinfo.dil.feign;
+
+import com.steerinfo.framework.controller.RESTfulResult;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.HashMap;
+
+@FeignClient(value = "antwms-service", url = "http://192.168.1.16:8802/")  //http://192.168.0.244:8002/
+public interface ATWmsFeign {
+
+    /**
+     * 库存查询
+     * @param parmas
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping(value = "antai.maketx/v1/wmsproductdetails/wuliuSelectkcmx")
+    RESTfulResult wuliuSelectkcmx(@RequestBody HashMap parmas, @RequestParam Integer pageNum,@RequestParam Integer pageSize);
+
+    @GetMapping(value = "antai.maketx/v1/wmsproductdetails/wuliuSelectbybatchno")
+    RESTfulResult wuliuSelectbybatchno(@RequestBody HashMap parmas, @RequestParam Integer pageNum,@RequestParam Integer pageSize);
+
+    @GetMapping(value = "antai.maketx/v1/wmsproductdetails/wuliuSelectbyprod")
+    RESTfulResult wuliuSelectbyprod(@RequestBody HashMap parmas, @RequestParam Integer pageNum,@RequestParam Integer pageSize);
+
+    @GetMapping(value = "antai.maketx/v1/wmsproductdetails/wuliuSelectbybuttress")
+    RESTfulResult wuliuSelectbybuttress(@RequestBody HashMap parmas, @RequestParam Integer pageNum,@RequestParam Integer pageSize);
+}