dengpan 1 rok pred
rodič
commit
4cb2be38f6

+ 1 - 1
src/main/java/com/steerinfo/dil/config/SessionInterceptor.java

@@ -39,7 +39,7 @@ public class SessionInterceptor extends HandlerInterceptorAdapter {
             //无权访问
             response.setCharacterEncoding("UTF-8");
             response.setContentType("application/json; charset=utf-8");
-            RESTfulResult result =new RESTfulResult("500", "无权访问", "无权访问");
+            RESTfulResult result =new RESTfulResult("500", "无权访问111", "无权访问");
             response.getWriter().write(JSONObject.toJSONString(result));
             return false;
         }

+ 37 - 0
src/main/java/com/steerinfo/dil/controller/ReportController.java

@@ -0,0 +1,37 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.feign.ReportFeign;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@RestController
+@RequestMapping("${api.version}/report")
+public class ReportController {
+
+    @Autowired
+    ReportFeign reportFeign;
+
+    @ApiOperation(value="展示汽运监控")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mapValue", value = "参数", required = false, dataType = "map"),
+            @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
+    })
+    @PostMapping(value = "/getQYMonitors")
+    Map<String, Object> getQYMonitors(@RequestBody(required=false) HashMap<String,Object> mapValue,
+                                        Integer apiId,
+                                        Integer pageNum,
+                                        Integer pageSize){
+        return reportFeign.getQYMonitors(mapValue == null ? new HashMap<>() : mapValue,apiId,pageNum,pageSize);
+    }
+}

+ 7 - 0
src/main/java/com/steerinfo/dil/controller/UniversalController.java

@@ -224,4 +224,11 @@ public class UniversalController extends BaseRESTfulController {
         String idCardCode = universalMapper.getIdCardCode(map);
         return success(idCardCode);
     }
+
+    @ApiOperation("根据物料编码获取物料信息")
+    @PostMapping("/getMaterial")
+    public RESTfulResult getMaterial(@RequestBody Map<String,Object> map) {
+        List<Map<String, Object>> material = universalMapper.getMaterial(map);
+        return success(material);
+    }
 }

+ 19 - 0
src/main/java/com/steerinfo/dil/feign/ReportFeign.java

@@ -0,0 +1,19 @@
+package com.steerinfo.dil.feign;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@FeignClient(value = "ANTAI-REPORT-API", url = "${openfeign.REPORTFeign.url}")
+public interface ReportFeign {
+
+    @PostMapping(value = "api/v1/report/monitors/getQYMonitors")
+    Map<String, Object> getQYMonitors(@RequestBody(required = false) HashMap<String, Object> map,
+                                        @RequestParam Integer apiId,
+                                        @RequestParam  Integer pageNum,
+                                        @RequestParam  Integer pageSize);
+}

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/UniversalMapper.java

@@ -71,4 +71,6 @@ public interface UniversalMapper {
 
     String getIdCardCode(Map<String, Object> map);
 
+    List<Map<String, Object>> getMaterial(Map<String, Object> map);
+
 }

+ 2 - 0
src/main/resources/application-dev.yml

@@ -62,6 +62,8 @@ openfeign:
     url: ${WEBSOCKETFEIGN_URL:localhost:8000}
   SSOFeign:
     url: ${SSOFEIGN_URL:172.16.90.214:9001}
+  REPORTFeign:
+    url: ${REPORTFEIGN_URL:localhost:8055}
 
 
 #远程调用

+ 2 - 0
src/main/resources/application-prod.yml

@@ -47,6 +47,8 @@ openfeign:
     url: ${SSOFEIGN_URL:172.16.90.214:9001}
   WebSocketFeign:
     url: ${WEBSOCKETFEIGN_URL:172.16.90.214:8000}
+  REPORTFeign:
+    url: ${REPORTFEIGN_URL:172.16.90.214:8055}
 
 
 #远程调用

+ 51 - 0
src/main/resources/com/steerinfo/dil/mapper/UniversalMapper.xml

@@ -917,4 +917,55 @@
         FETCH NEXT 1 ROWS ONLY
     </select>
 
+    <select id="getMaterial" parameterType="java.util.Map" resultType="java.util.Map">
+        select t.prod_code_pk as "prodCodePk",
+               b.material_id as "materialId",
+               b.material_code as "prodCode",
+               b.material_name as "prodName",
+               b.material_model as "steelName",
+               t.create_emp as "createEmp",
+               t.create_time as "createTime",
+               b.material_specification as "specName",
+               nvl(substr(b.material_specification,
+                          decode(instr(b.material_specification, '/'),
+                                 0,
+                                 100,
+                                 instr(b.material_specification, '/')) + 1),
+                   12) * b.material_theoretical_weight / 1000 as "weight"
+        from rms_material b
+                 left join rms_material_map t
+                           on t.prod_code_l = b.material_code
+        <where>
+            <if test="prodCode != null and prodCode != ''">
+                and t.prod_code = #{prodCode}
+            </if>
+            <if test="materialId != null and materialId != ''">
+                and b.material_id = #{materialId}
+            </if>
+        </where>
+        union all
+        select '' as "prodCodePk",
+               b.material_id as "materialId",
+               b.material_code as "prodCode",
+               b.material_name as "prodName",
+               b.material_model as "steelName",
+               '' as "createEmp",
+               sysdate as "createTime",
+               b.material_specification as "specName",
+               nvl(substr(b.material_specification,
+                          decode(instr(b.material_specification, '/'),
+                                 0,
+                                 100,
+                                 instr(b.material_specification, '/')) + 1),
+                   12) * b.material_theoretical_weight / 1000 as "weight"
+        from rms_material b
+        <where>
+            <if test="prodCode != null and prodCode != ''">
+                and t.prod_code = #{prodCode}
+            </if>
+            <if test="materialId != null and materialId != ''">
+                and b.material_id = #{materialId}
+            </if>
+        </where>
+    </select>
 </mapper>