Эх сурвалжийг харах

提供给外部系统查询固定 指令类型/模型类型,信息接口开发
提供给外部系统查询架次,信息接口开发

wanggaokun 1 жил өмнө
parent
commit
99288a2fc2

+ 4 - 0
PHM-admin/phm-manage/pom.xml

@@ -21,6 +21,10 @@
             <groupId>com.phm</groupId>
             <groupId>com.phm</groupId>
             <artifactId>phm-generator</artifactId>
             <artifactId>phm-generator</artifactId>
         </dependency>
         </dependency>
+        <dependency>
+            <groupId>com.phm</groupId>
+            <artifactId>phm-system</artifactId>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
 </project>
 </project>

+ 43 - 10
PHM-admin/phm-manage/src/main/java/com/phm/manage/common/controller/ExternalInterfaceController.java

@@ -1,16 +1,20 @@
 package com.phm.manage.common.controller;
 package com.phm.manage.common.controller;
 
 
 import com.phm.common.annotation.Anonymous;
 import com.phm.common.annotation.Anonymous;
+import com.phm.common.core.domain.entity.SysDictData;
+import com.phm.common.utils.StringUtils;
+import com.phm.manage.common.domain.CommonResult;
 import com.phm.manage.common.domain.CommonResultXML;
 import com.phm.manage.common.domain.CommonResultXML;
 import com.phm.manage.common.domain.OrderXmlVO;
 import com.phm.manage.common.domain.OrderXmlVO;
-import com.phm.manage.common.enums.OrderEnum;
+import com.phm.manage.domain.Sortie;
+import com.phm.manage.service.ISortieService;
+import com.phm.system.service.ISysDictTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.http.MediaType;
-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 org.springframework.web.bind.annotation.*;
 
 
-import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
 
 
 /**
 /**
  * 对外提供接口
  * 对外提供接口
@@ -20,18 +24,47 @@ import javax.validation.Valid;
  */
  */
 @RestController
 @RestController
 @Anonymous
 @Anonymous
-@RequestMapping(value = "/publicservice", consumes = {MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_XML_VALUE},
-        produces = MediaType.APPLICATION_XML_VALUE)
+@RequestMapping("/publicservice")
 public class ExternalInterfaceController {
 public class ExternalInterfaceController {
 
 
+    @Autowired
+    private ISysDictTypeService dictTypeService;
+
+    @Autowired
+    private ISortieService sortieService;
+
     /**
     /**
      * 指令接受API
      * 指令接受API
      *
      *
      * @param orderXmlVO 入参
      * @param orderXmlVO 入参
      * @return res
      * @return res
      */
      */
-    @PostMapping("/receive")
-    public CommonResultXML<OrderXmlVO> sss(@RequestBody @Valid OrderXmlVO orderXmlVO) {
+    @PostMapping(value = "/receive", consumes = {MediaType.APPLICATION_XML_VALUE, MediaType.TEXT_XML_VALUE},
+            produces = MediaType.APPLICATION_XML_VALUE)
+    public CommonResultXML<OrderXmlVO> receive(@RequestBody OrderXmlVO orderXmlVO) {
         return CommonResultXML.success(orderXmlVO);
         return CommonResultXML.success(orderXmlVO);
     }
     }
+
+    /**
+     * 根据字典类型查询字典数据信息
+     */
+    @GetMapping(value = "/type/{dictType}", produces = MediaType.APPLICATION_JSON_VALUE)
+    public CommonResult<List<SysDictData>> dictType(@PathVariable String dictType) {
+        List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
+        if (StringUtils.isNull(data)) {
+            data = new ArrayList<SysDictData>();
+        }
+        return CommonResult.success(data);
+    }
+
+    /**
+     * 查询架次信息
+     *
+     * @return 架次列表
+     */
+    @GetMapping(value = "/sortieList", produces = MediaType.APPLICATION_JSON_VALUE)
+    public CommonResult<List<Sortie>> dictType() {
+        List<Sortie> data = sortieService.selectSortieList(null);
+        return CommonResult.success(data);
+    }
 }
 }

+ 28 - 0
PHM-admin/phm-manage/src/main/java/com/phm/manage/common/domain/PageParam.java

@@ -0,0 +1,28 @@
+package com.phm.manage.common.domain;
+
+import lombok.Data;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @author wangg
+ */
+@Data
+public class PageParam implements Serializable {
+
+    private static final Integer PAGE_NO = 1;
+    private static final Integer PAGE_SIZE = 10;
+
+    @NotNull(message = "页码不能为空")
+    @Min(value = 1, message = "页码最小值为 1")
+    private Integer pageNo = PAGE_NO;
+
+    @NotNull(message = "每页条数不能为空")
+    @Min(value = 1, message = "每页条数最小值为 1")
+    @Max(value = 100, message = "每页条数最大值为 100")
+    private Integer pageSize = PAGE_SIZE;
+
+}

+ 40 - 0
PHM-admin/phm-manage/src/main/java/com/phm/manage/common/domain/PageResult.java

@@ -0,0 +1,40 @@
+package com.phm.manage.common.domain;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author wangg
+ */
+@Data
+public final class PageResult<T> implements Serializable {
+
+    private List<T> list;
+
+    private Long total;
+
+    public PageResult() {
+    }
+
+    public PageResult(List<T> list, Long total) {
+        this.list = list;
+        this.total = total;
+    }
+
+    public PageResult(Long total) {
+        this.list = new ArrayList<>();
+        this.total = total;
+    }
+
+    public static <T> PageResult<T> empty() {
+        return new PageResult<>(0L);
+    }
+
+    public static <T> PageResult<T> empty(Long total) {
+        return new PageResult<>(total);
+    }
+
+}

+ 36 - 0
PHM-admin/phm-manage/src/main/java/com/phm/manage/common/enums/ModelEnum.java

@@ -0,0 +1,36 @@
+package com.phm.manage.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Description ModelEnum
+ *
+ * @Author WGK
+ * @Date 2023/9/6 15:19
+ */
+@AllArgsConstructor
+@Getter
+public enum ModelEnum {
+
+    /*
+     * 虚警抑制模型
+     */
+    DATA_DOWN("虚警抑制模型", "FALSE_ALARM"),
+
+    /*
+     * 地面诊断模型
+     */
+    DIAGNOSIS("地面诊断模型", "GROUND_DIAGNOSIS"),
+
+    /*
+     * 深度隔离模型
+     */
+    FORECAST("深度隔离模型", "DEEP_ISOLATION");
+
+
+    private final String name;
+
+    private final String type;
+
+}

+ 1 - 0
PHM-admin/phm-manage/src/main/java/com/phm/manage/common/enums/OrderEnum.java

@@ -5,6 +5,7 @@ import lombok.Getter;
 
 
 /**
 /**
  * @Description Order
  * @Description Order
+ *
  * @Author WGK
  * @Author WGK
  * @Date 2023/9/6 15:19
  * @Date 2023/9/6 15:19
  */
  */