Browse Source

烽火数据对接,接口修改

xuhj 1 year ago
parent
commit
3fddc699dc

+ 28 - 0
dcuc-app-model/src/main/java/com/dragoninfo/dcuc/app/dto/appindex/FhAppIndexReqDTO.java

@@ -0,0 +1,28 @@
+package com.dragoninfo.dcuc.app.dto.appindex;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author: xhj
+ * time: 2023/9/5
+ * description:
+ */
+@Data
+public class FhAppIndexReqDTO implements Serializable {
+
+    @JsonProperty("From")
+    private String from;
+
+    @JsonProperty("To")
+    private String to;
+
+    @JsonProperty("MessageSequence")
+    private String messageSequence;
+
+    @JsonProperty("RequestParam")
+    private RequestParam requestParam;
+
+}

+ 77 - 47
dcuc-app-model/src/main/java/com/dragoninfo/dcuc/app/dto/appindex/FhResourceRespDTO.java

@@ -11,57 +11,59 @@ import lombok.Data;
  */
 @Data
 public class FhResourceRespDTO {
-
-    @JsonProperty("PTXTBH")
-    private Object ptxtbh;
+    /**
+     * 应用系统编号
+     */
+    @JsonProperty("YYXTBH")
+    private String yyxtbh;
 
     /**
-     * 上线日期
+     * 应用系统名称
      */
-    @JsonProperty("SXRQ")
-    private String sxrq;
+    @JsonProperty("YYXTMC")
+    private String yyxtmc;
 
     /**
-     * 系统架构类型
+     * 应用系统说明
      */
-    @JsonProperty("XTJGLX")
-    private String xtjglx;
+    @JsonProperty("YYXTSM")
+    private String yyxtsm;
 
     /**
-     * 系统在用标识
+     * 应用系统事权单位代码
      */
-    @JsonProperty("XTZYBS")
-    private Long xtzybs;
+    @JsonProperty("YYXTSQDWDM")
+    private String yyxtsqdwdm;
 
     /**
-     * 下线日期
+     * 应用系统管理单位代码
      */
-    @JsonProperty("XXRQ")
-    private Object xxrq;
+    @JsonProperty("YYXTGLDWDM")
+    private String yyxtgldwdm;
 
     /**
-     * 业务使用场景代码
+     * 应用系统承建单位名称
      */
-    @JsonProperty("YWSYCJDM")
-    private String ywsycjdm;
+    @JsonProperty("YYXTCJDWMC")
+    private String yyxtcjdwmc;
 
     /**
-     *
+     * 应用系统运维单位名称
      */
-    @JsonProperty("YYLX")
-    private String yylx;
+    @JsonProperty("YYXTYWDWMC")
+    private String yyxtywdwmc;
 
     /**
-     * 应用系统编号
+     * 上线日期
      */
-    @JsonProperty("YYXTBH")
-    private String yyxtbh;
+    @JsonProperty("SXRQ")
+    private String sxrq;
 
     /**
-     * 应用系统承建单位代码
+     * 下线日期
      */
-    @JsonProperty("YYXTCJDWDM")
-    private String yyxtcjdwdm;
+    @JsonProperty("XXRQ")
+    private String xxrq;
 
     /**
      * 应用系统分类代码
@@ -69,6 +71,36 @@ public class FhResourceRespDTO {
     @JsonProperty("YYXTFLDM")
     private String yyxtfldm;
 
+    /**
+     * 应用来源系统种类
+     */
+    @JsonProperty("YYLYXTZL")
+    private String yylyxtzl;
+
+    /**
+     * 应用获取方式
+     */
+    @JsonProperty("YYHQFS")
+    private String yyhqfs;
+
+    /**
+     * 应用系统认证级别
+     */
+    @JsonProperty("YYXTRZJB")
+    private String yyxtrzjb;
+
+    /**
+     * 系统在用标识
+     */
+    @JsonProperty("XTZYBS")
+    private Long xtzybs;
+
+    /**
+     * 系统架构类型
+     */
+    @JsonProperty("XTJGLX")
+    private String xtjglx;
+
     /**
      * 应用系统访问地址
      */
@@ -76,40 +108,38 @@ public class FhResourceRespDTO {
     private String yyxtfwdz;
 
     /**
-     * 应用系统管理单位代码
+     * 应用系统访问路径
      */
-    @JsonProperty("YYXTGLDWDM")
-    private String yyxtgldwdm;
+    @JsonProperty("YYXTFWLJ")
+    private String yyxtfwlj;
 
     /**
-     *应用系统名称
+     * 业务使用场景代码
      */
-    @JsonProperty("YYXTMC")
-    private String yyxtmc;
+    @JsonProperty("YYSYCJDM")
+    private String yysycjdm;
 
     /**
-     *
+     * 应用系统地市编码
      */
-    @JsonProperty("YYXTRZJB")
-    private String yyxtrzjb;
+    @JsonProperty("YYXTDSBM")
+    private String yyxtdsbm;
 
     /**
-     * 应用系统说明
+     * 应用系统图标
      */
-    @JsonProperty("YYXTSM")
-    private String yyxtsm;
+    @JsonProperty("YYXTTB")
+    private String yyxttb;
 
     /**
-     * 应用系统事权单位代码
+     * 顶层菜单编码 内置字段:PSD
      */
-    @JsonProperty("YYXTSQDWDM")
-    private String yyxtsqdwdm;
+    @JsonProperty("TOPID")
+    private String topid;
 
     /**
-     * 应用系统运维单位代
+     * 应用
      */
-    @JsonProperty("YYXTYWDWDM")
-    private String yyxtywdwdm;
-
-
+    @JsonProperty("OPTID")
+    private String optid;
 }

+ 4 - 14
dcuc-app-model/src/main/java/com/dragoninfo/dcuc/app/dto/appindex/FhResponseParamRespDTO.java

@@ -14,21 +14,11 @@ import java.util.List;
 @Data
 public class FhResponseParamRespDTO {
 
-    @JsonProperty("Exception")
-    private List<Object> exception;
-    @JsonProperty("FileDigest")
-    private String fileDigest;
-    @JsonProperty("FileName")
-    private String fileName;
-    @JsonProperty("FileSize")
-    private String fileSize;
-    @JsonProperty("RegisterInfos")
-    private List<Object> registerInfos;
-    @JsonProperty("RelationId")
-    private Object relationId;
-    @JsonProperty("Resources")
-    private List<FhResourceRespDTO> resources;
     @JsonProperty("TotalNum")
     private Long totalNum;
+    @JsonProperty("ResourceType")
+    private String resourceType;
+    @JsonProperty("Resources")
+    private List<FhResourceRespDTO> resources;
 
 }

+ 28 - 0
dcuc-app-model/src/main/java/com/dragoninfo/dcuc/app/dto/appindex/RequestParam.java

@@ -0,0 +1,28 @@
+package com.dragoninfo.dcuc.app.dto.appindex;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author: xhj
+ * time: 2023/9/5
+ * description:
+ */
+@Data
+public class RequestParam implements Serializable {
+
+    @JsonProperty("ResourceType")
+    private String resourceType;
+
+    @JsonProperty("Condition")
+    private String condition;
+
+    @JsonProperty("PageSize")
+    private String pageSize;
+
+    @JsonProperty("CurrentPage")
+    private String currentPage;
+
+}

+ 2 - 2
dcuc-app-model/src/main/java/com/dragoninfo/dcuc/app/vo/AppDataItemPageVo.java

@@ -45,12 +45,12 @@ public class AppDataItemPageVo {
     private String invalidStatus;
 
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间")
     private Date columnRegisterTime;
 
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "更新时间")
     private Date columnUpdateTime;
 }

+ 2 - 2
dcuc-app-model/src/main/java/com/dragoninfo/dcuc/app/vo/AppDataResourcePageVo.java

@@ -54,12 +54,12 @@ public class AppDataResourcePageVo {
     private String labelName;
 
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 }

+ 13 - 5
dcuc-app-service/src/main/java/com/dragoninfo/dcuc/app/business/impl/FhAppSyncBusinessImpl.java

@@ -3,9 +3,7 @@ package com.dragoninfo.dcuc.app.business.impl;
 import cn.hutool.core.bean.BeanUtil;
 import com.dragoninfo.dcuc.app.business.IFhAppSyncBusiness;
 import com.dragoninfo.dcuc.app.config.FhAppSyncProperties;
-import com.dragoninfo.dcuc.app.dto.appindex.FhAppIndexRespDTO;
-import com.dragoninfo.dcuc.app.dto.appindex.FhResourceRespDTO;
-import com.dragoninfo.dcuc.app.dto.appindex.FhResponseParamRespDTO;
+import com.dragoninfo.dcuc.app.dto.appindex.*;
 import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.app.entity.ApplyOauth;
 import com.dragoninfo.dcuc.app.service.IApplyInfoService;
@@ -148,7 +146,7 @@ public class FhAppSyncBusinessImpl implements IFhAppSyncBusiness {
                 app.setApplyStatus(BooleanEnum.TRUE.value);
             }
         }
-        app.setAppOpsDepName(dto.getYyxtywdwdm());
+        app.setAppOpsDepName(dto.getYyxtywdwmc());
         app.setApplyUrl(dto.getYyxtfwdz());
         app.setOrgCode(dto.getYyxtsqdwdm());
         app.setManagerOrgCode(dto.getYyxtgldwdm());
@@ -191,7 +189,17 @@ public class FhAppSyncBusinessImpl implements IFhAppSyncBusiness {
     protected ResponseDTO<FhAppIndexRespDTO> getAppResource() {
         String address = fhAppSyncProperties.getAddress();
         log.info("同步应用资源地址:{}", address);
-        HttpEntity<Map<String,String>> httpEntity = new HttpEntity<>(Collections.emptyMap());
+        // TODO 封装请求条件入参确认
+        RequestParam requestParam = new RequestParam();
+        requestParam.setResourceType("0");
+//        requestParam.setCondition();
+        FhAppIndexReqDTO reqDTO = new FhAppIndexReqDTO();
+//        reqDTO.setFrom();
+//        reqDTO.setTo();
+//        reqDTO.setMessageSequence();
+        reqDTO.setRequestParam(requestParam);
+
+        HttpEntity<FhAppIndexReqDTO> httpEntity = new HttpEntity<>(reqDTO);
         ResponseEntity<String> exchange = restTemplate.exchange(address, HttpMethod.POST, httpEntity, String.class);
         if (!exchange.getStatusCode().is2xxSuccessful()) {
             log.error("调用同步接口响应异常. 响应结果:{}", JsonUtils.toJSONString(exchange));

+ 1 - 1
dcuc-app-service/src/main/resources/application-app.yml

@@ -42,4 +42,4 @@ dcuc:
       bu-service-url: http://10.11.0.41:8081/ddos/v1/ministryResources/searchMinistryResources
       fh:
         app-sync:
-          address: http://130.0.56.174:9988/metadata/app/resource/QueryDataResource
+          address: http://130.0.56.186:10010/appmarket/app/resources/QueryAppResource

+ 1 - 1
dcuc-app-service/src/test/java/com/dragoninfo/dcuc/app/business/impl/FhAppSyncBusinessImplTerst.java

@@ -35,7 +35,7 @@ public class FhAppSyncBusinessImplTerst {
 
     public static Runner runner;
 
-    public static String address = "/metadata/app/resource/QueryDataResource";
+    public static String address = "/appmarket/app/resources/QueryAppResource";
 
     @BeforeClass
     public static void before() {

+ 53 - 43
dcuc-app-service/src/test/resources/fh/app.json

@@ -1,73 +1,83 @@
 {
   "MessageStatus": "0200",
-  "MessageSequence": "2023-07-19 18:07:24",
+  "MessageSequence": "2020030314141200001",
   "Remark": "正常",
   "ResponseParam": {
-    "RegisterInfos": [],
     "TotalNum": 3,
+    "ResourceType": "0",
     "Resources": [
       {
-        "YYXTBH": "A-120000000000-3508",
-        "YYXTMC": "公安大数据治理平台",
-        "YYXTSM": "公安大数据治理平台",
+        "YYXTBH": "A-120000000000-0016",
+        "YYXTMC": "应用市场",
+        "YYXTSM": "应用市场提供所有应用的信息展示,功能描述,支持申请使用和评价打分",
         "YYXTSQDWDM": "120000000000",
         "YYXTGLDWDM": "120000000000",
-        "YYXTCJDWDM": "烽火",
-        "YYXTYWDWDM": "烽火",
-        "SXRQ": "2021-06-19",
-        "XXRQ": null,
+        "YYXTCJDWMC": "烽火",
+        "YYXTYWDWMC": "烽火",
+        "SXRQ": "1690357836",
+        "XXRQ": "",
         "YYXTFLDM": "04",
+        "YYLYXTZL": "科信",
+        "YYHQFS": "01",
         "YYXTRZJB": "01",
-        "XTZYBS": 1,
+        "XTZYBS": "1",
         "XTJGLX": "1",
-        "YYXTFWDZ": "http://130.0.46.34:11018",
-        "YWSYCJDM": "04",
-        "PTXTBH": null,
-        "YYLX": "1"
+        "YYXTFWDZ": "http://130.0.46.121:8189/ns/appmarket/yysc",
+        "YYXTFWLJ": "http://130.0.46.121:8189",
+        "YWSYCJDM": "01",
+        "YYXTDSBM": "120000",
+        "OPTID": "appmarket",
+        "YYXTTB": "/upload/A-120000000000-0016/应用市场.png",
+        "TOPID": "PSD"
       },
       {
-        "YYXTBH": "A-120000000000-0001",
-        "YYXTMC": "公安大数据治理平台",
-        "YYXTSM": "进行公安大数据治理及管理工作",
+        "YYXTBH": "A-120000000000-0022",
+        "YYXTMC": "应用资源目录",
+        "YYXTSM": "应用资源目录提供应用的注册,更新,上下架以及版本变更等功能",
         "YYXTSQDWDM": "120000000000",
         "YYXTGLDWDM": "120000000000",
-        "YYXTCJDWDM": "",
-        "YYXTYWDWDM": "",
-        "SXRQ": "2021-04-15",
+        "YYXTCJDWMC": "烽火",
+        "YYXTYWDWMC": "烽火",
+        "SXRQ": "1690357836",
         "XXRQ": "",
         "YYXTFLDM": "04",
+        "YYLYXTZL": "科信",
+        "YYHQFS": "01",
         "YYXTRZJB": "01",
-        "XTZYBS": 1,
+        "XTZYBS": "1",
         "XTJGLX": "1",
-        "YYXTFWDZ": "",
-        "YWSYCJDM": "03",
-        "PTXTBH": null,
-        "YYLX": "1"
+        "YYXTFWDZ": "http://130.0.46.121:8189/ns/appresources/applyHome",
+        "YYXTFWLJ": "http://130.0.46.121:8189",
+        "YWSYCJDM": "01",
+        "YYXTDSBM": "120000",
+        "OPTID": "appmarket_resource",
+        "YYXTTB": "/upload/A-120000000000-0022/应用资源目录.png",
+        "TOPID": "PSD"
       },
       {
-        "YYXTBH": "A-120000000000-5517",
-        "YYXTMC": "智能助理",
-        "YYXTSM": "移动端快捷查询系统",
+        "YYXTBH": "A-120000000000-0023",
+        "YYXTMC": "应用市场服务",
+        "YYXTSM": "提供应用市场和应用资源目录后台接口服务",
         "YYXTSQDWDM": "120000000000",
         "YYXTGLDWDM": "120000000000",
-        "YYXTCJDWDM": "",
-        "YYXTYWDWDM": "",
-        "SXRQ": "2023-01-05",
+        "YYXTCJDWMC": "烽火",
+        "YYXTYWDWMC": "烽火",
+        "SXRQ": "1690357836",
         "XXRQ": "",
-        "YYXTFLDM": "01",
+        "YYXTFLDM": "04",
+        "YYLYXTZL": "科信",
+        "YYHQFS": "01",
         "YYXTRZJB": "01",
-        "XTZYBS": 1,
-        "XTJGLX": "2",
-        "YYXTFWDZ": "http://130.0.46.114:18080/?code=admin&state=1&policeNo=888888&policeInfoCode=000&policeCaseCode=000#/siri",
+        "XTZYBS": "1",
+        "XTJGLX": "1",
+        "YYXTFWDZ": "http://130.0.56.186:10010/appmarket",
+        "YYXTFWLJ": "http://130.0.56.186:10010/appmarket",
         "YWSYCJDM": "01",
-        "PTXTBH": null,
-        "YYLX": "1"
+        "YYXTDSBM": "120000",
+        "OPTID": "appmarket_service",
+        "YYXTTB": "/upload/A-120000000000-0023/应用市场服务.png",
+        "TOPID": "PSD"
       }
-    ],
-    "FileName": "",
-    "FileDigest": "",
-    "FileSize": "",
-    "RelationId": null,
-    "Exception": []
+    ]
   }
 }