wuweihao 3 年 前
コミット
6e3752044b

+ 1 - 1
README.md

@@ -4,4 +4,4 @@
 
 甲方接口文档:
 大屏BI接口:https://docs.qq.com/doc/DWlNlZkJLTEdNZ0N3
-开房平台API文档:https://docs.qq.com/doc/DZFh1eUtNcXhEUHlx
+开房平台API文档:https://docs.qq.com/doc/DZFh1eUtNcXhEUHlx

+ 1 - 1
gis_application/src/main/resources/application-dev.properties

@@ -1,7 +1,7 @@
 
 
 #log
-logging.path=D:/log/${project.en}_log
+logging.file.path=D:/log/${project.en}_log
 logging.config=classpath:logback-spring.xml
 logging.level.com.gis=debug
 

+ 1 - 1
gis_application/src/main/resources/application-pro.properties

@@ -1,7 +1,7 @@
 
 
 #log
-logging.path=/root/user/${project.en}_log
+logging.file.path=/root/log/${project.en}_log
 logging.config=classpath:logback-spring.xml
 logging.level.com.gis=debug
 

+ 27 - 0
gis_application/target/classes/application-dev.properties

@@ -0,0 +1,27 @@
+
+
+#log
+logging.file.path=D:/log/${project.en}_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+
+# swagger2 \uFFFD\uFFFD\uFFFD\uFFFD\u022B\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u02BD\u03AAutf-8
+swagger.package=com.gis.web.controller
+swagger.title=${project.sc}-dev
+swagger.description=${swagger.title}
+swagger.version=1.0
+
+
+# \u5927\u5C4F
+api.screen=https://testlife.eshimin.com
+
+#\u95E8\u7981
+api.door=https://cdpre.tfsmy.com/intelligence-access-control-api
+
+# ����ǻ�ȡ��������Ƶ�ĵ�ַ
+api.IOTVideo=https://cdpre.tfsmy.com/intelligent-internetrt-api
+#����ǡ���ȡ��Ƶ�б����ݡ�  ���豸�б���Ϣ��ѯ��  ����ȡָ����Ƶ����Ϣ��
+api.video=https://cdpre.tfsmy.com/intelligence-access-control-api
+#��Ϣ����
+api.info=https://cdpre.tfsmy.com

+ 1 - 1
gis_application/target/classes/application-pro.properties

@@ -1,7 +1,7 @@
 
 
 #log
-logging.path=/root/user/${project.en}_log
+logging.file.path=/root/log/${project.en}_log
 logging.config=classpath:logback-spring.xml
 logging.level.com.gis=debug
 

+ 22 - 0
gis_application/target/classes/application.properties

@@ -0,0 +1,22 @@
+server.port=8013
+
+spring.profiles.active=dev
+
+# \u8BBF\u95EE\u9759\u6001\u8D44\u6E90\u8BBE\u7F6E
+spring.resources.static-locations=classpath:templates/,classpath:static/,classpath:web/
+
+#\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F
+spring.servlet.multipart.enabled=true
+spring.servlet.multipart.max-file-size=256MB
+spring.servlet.multipart.max-request-size=256MB
+
+project.en=smart_chengdu_xindu_dafeng
+project.sc=\u6210\u90FD\u667A\u6167\u57CE\u5E02\u4E8C\u671F-\u65B0\u90FD\u5927\u4E30
+
+
+
+
+
+
+
+

+ 156 - 0
gis_application/target/classes/logback-spring.xml

@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <property name="LOG_MAX_HISTORY" value="180"/>
+    <springProperty scope="context" name="LOG_PATH" source="logging.path"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
+            <pattern>${LOG_PATH}/%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %X{TRACE_ID} %-5level %logger{50} - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+    </appender>
+    <!-- 按照每天生成日志文件:主项目日志 -->
+    <appender name="file.all" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 追加日志到原文件结尾 -->
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 -->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 除按日志记录之外,还配置了日志文件不能超过10M(默认),若超过10M,日志文件会以索引0开始, -->
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %X{TRACE_ID} %-5level %logger{500} - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+    </appender>
+
+    <!--info日志统一输出到这里-->
+    <appender name="file.info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 每小时生成日志文件 -->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}/info/console-info.%d{yyyy-MM-dd-HH}.%i.log</FileNamePattern>
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 除按日志记录之外,还配置了日志文件不能超过10M(默认),若超过10M,日志文件会以索引0开始, -->
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %method 方法名  %L 行数 %msg:日志消息,%n是换行符-->
+            <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %X{TRACE_ID} %-5level %logger{56}.%method:%L - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+        <!-- 此日志文件只记录info级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!--错误日志统一输出到这里-->
+    <appender name="file.error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名-->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}/error/console-error.%d{yyyy-MM-dd-HH}.%i.log</FileNamePattern>
+            <!--日志文件保留天数-->
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 除按日志记录之外,还配置了日志文件不能超过10M(默认),若超过10M,日志文件会以索引0开始, -->
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %method 方法名  %L 行数 %msg:日志消息,%n是换行符-->
+            <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %X{TRACE_ID} %-5level %logger{56}.%method:%L - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+        <!-- 此日志文件只记录error级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!--warn日志统一输出到这里-->
+    <appender name="file.warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 按小时生成日志-->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}/warn/console-warn.%d{yyyy-MM-dd-HH}.%i.log</FileNamePattern>
+            <!--日志文件保留天数-->
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 除按日志记录之外,还配置了日志文件不能超过10M(默认),若超过10M,日志文件会以索引0开始, -->
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %method 方法名  %L 行数 %msg:日志消息,%n是换行符-->
+            <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %X{TRACE_ID} %-5level %logger{56}.%method:%L - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+        <!-- 此日志文件只记录warn级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>WARN</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!--debug级别日志统一输出到这里-->
+    <appender name="file.debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 按小时生成日志-->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}/debug/console-debug.%d{yyyy-MM-dd-HH}.%i.log</FileNamePattern>
+            <!--日志文件保留天数-->
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过5M,若超过5M,日志文件会以索引0开始,命名日志文件,例如console-debug.2018-08-24-09.1.log -->
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %method 方法名  %L 行数 %msg:日志消息,%n是换行符-->
+            <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %X{TRACE_ID} %-5level %logger{56}.%method:%L - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+        <!-- 此日志文件只记录debug级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>DEBUG</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY </onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+    <appender name="file.async" class="ch.qos.logback.classic.AsyncAppender">
+        <discardingThreshold>0</discardingThreshold>
+        <queueSize>256</queueSize>
+        <includeCallerData>true</includeCallerData>
+        <appender-ref ref="file.all" />
+    </appender>
+
+    <!--  日志输出级别 -->
+    <!-- TRACE\DEBUG\INFO\WARN\ERROR\FATAL\OFF -->
+    <root level="INFO">
+        <appender-ref ref="console" />
+        <appender-ref ref="file.async"/>
+        <appender-ref ref="file.error" />
+        <appender-ref ref="file.info" />
+        <appender-ref ref="file.debug" />
+        <appender-ref ref="file.warn" />
+    </root>
+
+</configuration>

+ 11 - 0
gis_application/target/classes/static/shutdown.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+RESOURCE_NAME=scene_zhuhai_partyhistor.jar
+   Pid=`awk '{print $1}' tpid`
+
+if [ ${Pid} ]; then
+kill -9 $Pid
+echo 'Kill Process!'
+else
+echo 'Stop failed!'
+fi
+

+ 11 - 0
gis_application/target/classes/static/startup.sh

@@ -0,0 +1,11 @@
+#!/bin/sh
+RESOURCE_NAME=scene_zhuhai_partyhistor.jar
+APP_DEBUG=5005
+rm -f tpid
+nohup java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${APP_DEBUG} $RESOURCE_NAME --spring.profiles.active=sit --server.port=8012 & echo $! > tpid
+echo Start Success!
+
+
+
+
+

+ 1 - 0
gis_common/pom.xml

@@ -93,6 +93,7 @@
             <version>1.0.0</version>
         </dependency>
 
+
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>

+ 1 - 1
gis_common/src/main/java/com/gis/common/deyuan/util/HttpUtils.java

@@ -53,7 +53,7 @@ public class HttpUtils {
                                      Map<String, String> querys)
             throws Exception {
         HttpClient httpClient = wrapClient(host);
-        System.out.println("buildUrl: "+buildUrl(host, path, querys));
+//        System.out.println("buildUrl: "+buildUrl(host, path, querys));
         HttpGet request = new HttpGet(buildUrl(host, path, querys));
         for (Map.Entry<String, String> e : headers.entrySet()) {
             request.addHeader(e.getKey(), e.getValue());

+ 7 - 11
gis_common/src/main/java/com/gis/common/deyuan/util/ResultUtils.java

@@ -1,10 +1,13 @@
 package com.gis.common.deyuan.util;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.parser.Feature;
 import com.gis.common.config.ConfigConstant;
 import com.gis.common.util.Result;
 import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.util.EntityUtils;
@@ -20,7 +23,7 @@ import java.util.Map;
  * Created by owen on 2020/10/15 0015 9:21
  */
 @Component
-@Log4j2
+@Slf4j
 public class ResultUtils {
 
     /** 德源ip-测试*/
@@ -73,7 +76,6 @@ public class ResultUtils {
         querys.put("Content-Type", "application/json;charset=utf-8");
 
         String resultData = null;
-//        log.info("request url: "+ path);
 
         try {
             HttpResponse httpResponse = HttpUtils.doGet(configConstant.apiScreen, path, headers, querys);
@@ -89,17 +91,15 @@ public class ResultUtils {
                     String s = RSAUtils.decryptByPrivateKey(result, RSAUtils.getPrivateKey(privateKyeRes));
                     resultData = URLDecoder.decode(s, "utf-8");
                 }
-//                else {
-//
-//                    return Result.failure(msg);
-//                }
             }
         } catch (Exception e) {
             e.printStackTrace();
         }
 
         log.info("result: {}", resultData);
-        return Result.success(JSONObject.parseObject(resultData));
+
+        Object parse = JSON.parse(resultData);
+        return Result.success(parse);
     }
 
 
@@ -131,12 +131,10 @@ public class ResultUtils {
         querys.put("appId", appId);
         querys.put("sign", sign);
 
-//        log.info("request param: {}", querys);
 
         Map<String, String> headers = new HashMap<>();
         querys.put("Content-Type", "application/json;charset=utf-8");
         String resultData = null;
-//        log.info("request url: "+ path);
         try {
             HttpResponse httpResponse = HttpUtils.doGet(configConstant.apiScreen, path, headers, querys);
             String restResult = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
@@ -184,12 +182,10 @@ public class ResultUtils {
         querys.put("appId", appId);
         querys.put("sign", sign);
 
-//        log.info("request param: {}", querys);
 
         Map<String, String> headers = new HashMap<>();
         querys.put("Content-Type", "application/json;charset=utf-8");
         String resultData = null;
-//        log.info("request url: "+ path);
         try {
             HttpResponse httpResponse = HttpUtils.doGet(configConstant.apiScreen, path, headers, querys);
             String restResult = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");

+ 83 - 0
gis_common/src/main/java/com/gis/common/util/AESCBCUtil.java

@@ -0,0 +1,83 @@
+package com.gis.common.util;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.codec.binary.Hex;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * @ClassName AESCBCUtil
+ * @Description: TODO
+ * @Author cjh
+ * @Date 2022-02-28
+ * @Version V1.0
+ **/
+public class AESCBCUtil {
+   // private final static Logger logger = LoggerFactory.getLogger(com.wonders.bud.framework.utils.AESCBCUtil.class);
+
+    private static final String defaultCharset = "UTF-8";
+    private static final String KEY_AES = "AES";
+    private static final String ECB_CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding";
+    private static final String CBC_CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding";
+    public static final int CODE_BASE64 = 1;
+    public static final int CODE_HEX = 2;
+
+    private static final String iv = "E08ADE2699714B87";
+
+    /**
+     * 加密
+     *
+     * @param data 需要加密的内容
+     * @param key  加密密码
+     * @return
+     */
+    public static String encrypt(String data, String key) {
+        return doAES(data, key, iv.getBytes(), Cipher.ENCRYPT_MODE, 2);
+    }
+
+    /**
+     * 解密
+     *
+     * @param data 待解密内容
+     * @param key  解密密钥
+     * @return
+     */
+    public static String decrypt(String data, String key) {
+        return doAES(data, key, iv.getBytes(), Cipher.DECRYPT_MODE, 2);
+    }
+
+    public static String doAES(String data, String secretKey, byte[] iv, int mode, int code) {
+
+        try {
+            boolean encrypt = mode == Cipher.ENCRYPT_MODE;
+            byte[] content;
+            //true 加密内容 false 解密内容
+            if (encrypt) {
+                content = data.getBytes(defaultCharset);
+            } else if (code == CODE_HEX) {
+                content = Hex.decodeHex(data.toCharArray());
+            } else {
+                content = Base64.decodeBase64(data);
+            }
+
+            Cipher cipher = Cipher.getInstance(CBC_CIPHER_ALGORITHM);
+            SecretKeySpec skeySpec = new SecretKeySpec(secretKey.getBytes(), KEY_AES);
+            cipher.init(mode, skeySpec, new IvParameterSpec(iv));
+            byte[] result = cipher.doFinal(content);
+            if (!encrypt) {
+                return new String(result, defaultCharset);
+            } else if (code == CODE_HEX) {
+                return Hex.encodeHexString(result);//通过Hex转码返回
+            } else {
+                return Base64.encodeBase64String(result);
+            }
+        } catch (Exception e) {
+           // logger.error("aes error:", e);
+        }
+        return null;
+    }
+}

+ 207 - 0
gis_common/src/main/java/com/gis/common/util/RSAUtils.java

@@ -0,0 +1,207 @@
+package com.gis.common.util;
+
+import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
+//import org.bouncycastle.jce.provider.BouncyCastleProvider;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.security.InvalidKeyException;
+import java.security.KeyFactory;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+
+
+/**
+ * @ClassName RSAUtils
+ * @Description: TODO
+ * @Author cjh
+ * @Date 2022-02-28
+ * @Version V1.0
+ **/
+public class RSAUtils {
+    /**
+     * 解密
+     * @param content 密文
+     * @param private_key 商户私钥
+     * @param input_charset 编码格式
+     * @return 解密后的字符串
+     */
+    public static String decrypt(String content, String private_key, String input_charset) throws Exception {
+        PrivateKey prikey = getPrivateKey(private_key);
+        return decrypt(content,prikey,input_charset);
+    }
+
+
+    public static String decrypt(String content, PrivateKey prikey, String input_charset) {
+
+        try {
+            Cipher cipher = Cipher.getInstance("RSA");
+            cipher.init(Cipher.DECRYPT_MODE, prikey);
+
+            InputStream ins = new ByteArrayInputStream(Base64.decode(content));
+            ByteArrayOutputStream writer = new ByteArrayOutputStream();
+            //rsa解密的字节大小最多是128,将需要解密的内容,按128位拆开解密
+            byte[] buf = new byte[128];
+            int bufl;
+
+            while ((bufl = ins.read(buf)) != -1) {
+                byte[] block = null;
+
+                if (buf.length == bufl) {
+                    block = buf;
+                } else {
+                    block = new byte[bufl];
+                    for (int i = 0; i < bufl; i++) {
+                        block[i] = buf[i];
+                    }
+                }
+
+                writer.write(cipher.doFinal(block));
+            }
+
+            return new String(writer.toByteArray(), input_charset);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+//    /**
+//     * * 解密 *
+//     *
+//     * @param pk
+//     *            解密的密钥 *
+//     * @param raw
+//     *            已经加密的数据 *
+//     * @return 解密后的明文 *
+//     * @throws Exception
+//     */
+//    @SuppressWarnings("static-access")
+//    public static byte[] decrypt(PrivateKey pk, byte[] raw) throws Exception {
+//        try {
+//            Cipher cipher = Cipher.getInstance("RSA", new BouncyCastleProvider());
+//            cipher.init(cipher.DECRYPT_MODE, pk);
+//            int blockSize = cipher.getBlockSize();
+//            ByteArrayOutputStream bout = new ByteArrayOutputStream(64);
+//            int j = 0;
+//
+//            while (raw.length - j * blockSize > 0) {
+//                bout.write(cipher.doFinal(raw, j * blockSize, blockSize));
+//                j++;
+//            }
+//            return bout.toByteArray();
+//        } catch (Exception e) {
+//            return null;
+//        }
+//    }
+
+    public static String encrypt(String publicKey, String plainText) throws Exception {
+        return encrypt(getPublicKey(publicKey), plainText);
+    }
+
+    /**
+     * 加密
+     * @param publicKey
+     * @param plainText
+     * @return
+     * @throws Exception
+     */
+    public static String encrypt(PublicKey publicKey, String plainText) throws Exception{
+        try {
+            Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
+            cipher.init(Cipher.ENCRYPT_MODE, publicKey);
+            ByteArrayOutputStream writer = new ByteArrayOutputStream();
+            InputStream ins = new ByteArrayInputStream(plainText.getBytes("utf-8"));
+            //rsa加密的字节大小最多是117,将需要解密的内容,按117位拆开解密
+            byte[] buf = new byte[117];
+            int bufl;
+
+            while ((bufl = ins.read(buf)) != -1) {
+                byte[] block = null;
+
+                if (buf.length == bufl) {
+                    block = buf;
+                } else {
+                    block = new byte[bufl];
+                    for (int i = 0; i < bufl; i++) {
+                        block[i] = buf[i];
+                    }
+                }
+
+                writer.write(cipher.doFinal(block));
+            }
+            return Base64.encode(writer.toByteArray());
+        } catch (InvalidKeyException e) {
+            e.printStackTrace();
+        } catch (IllegalBlockSizeException e) {
+            e.printStackTrace();
+        } catch (BadPaddingException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
+    /**
+     * 得到私钥
+     * @param key 密钥字符串(经过base64编码)
+     * @throws Exception
+     */
+    public static PrivateKey getPrivateKey(String key) throws Exception {
+
+        byte[] keyBytes;
+
+        keyBytes = Base64.decode(key);
+
+        PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);
+
+        KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+
+        PrivateKey privateKey = keyFactory.generatePrivate(keySpec);
+
+        return privateKey;
+    }
+
+    /**
+     * 将string类型的key存成 PublicKey类
+     *
+     * @param key
+     *            密钥字符串(经过base64编码)
+     * @throws Exception
+     */
+    public static PublicKey getPublicKey(String key) throws Exception {
+        byte[] keyBytes;
+        keyBytes = Base64.decode(key);
+        X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+        PublicKey publicKey = keyFactory.generatePublic(keySpec);
+        return publicKey;
+
+
+    }
+
+    public static byte[] hexStringToBytes(String hexString) {
+        if (hexString == null || hexString.equals("")) {
+            return null;
+        }
+        hexString = hexString.toUpperCase();
+        int length = hexString.length() / 2;
+        char[] hexChars = hexString.toCharArray();
+        byte[] d = new byte[length];
+        for (int i = 0; i < length; i++) {
+            int pos = i * 2;
+            d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
+        }
+        return d;
+    }
+
+    private static byte charToByte(char c) {
+        return (byte) "0123456789ABCDEF".indexOf(c);
+    }
+
+}

+ 0 - 8
gis_common/src/main/java/com/gis/common/util/TianfushimingyunUtils.java

@@ -3,18 +3,10 @@ package com.gis.common.util;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.gis.common.deyuan.util.SignUtil;
-import com.sun.org.apache.bcel.internal.ExceptionConst;
 import com.tfsmy.aesrsa.util.*;
 import lombok.extern.log4j.Log4j2;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.codec.binary.Hex;
 
-import javax.crypto.Cipher;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
 import java.net.URLEncoder;
-import java.security.Security;
 import java.util.*;
 
 @Log4j2

+ 0 - 41
gis_web/src/main/java/com/gis/web/controller/BaiduWeatherController.java

@@ -1,41 +0,0 @@
-//package com.gis.web.controller;
-//
-//import cn.hutool.http.HttpUtil;
-//import com.alibaba.fastjson.JSONObject;
-//import com.gis.common.util.Result;
-//import io.swagger.annotations.Api;
-//import io.swagger.annotations.ApiOperation;
-//import lombok.extern.log4j.Log4j2;
-//import org.springframework.web.bind.annotation.GetMapping;
-//import org.springframework.web.bind.annotation.PathVariable;
-//import org.springframework.web.bind.annotation.RequestMapping;
-//import org.springframework.web.bind.annotation.RestController;
-//
-///**
-// * Created by owen on 2020/11/6 0006 9:56
-// *
-// * 调用百度天气api, 需要在百度控制台创建应用,添加ip白名称
-// * 目前是设置0.0.0.0/0
-// */
-//@Log4j2
-//@Api(tags = "百度天气")
-//@RestController
-//@RequestMapping("weather")
-//public class BaiduWeatherController {
-//
-//    // 百度应用应用AK
-//    private static final String AK = "KXhUz8ptVFAyVK3zi1OXvaFOq9Qq9Gst";
-//
-//
-//    // 47.107.252.54,221.4.210.172
-//
-//    @ApiOperation("获取天气(测试码:110100)")
-//    @GetMapping("get/{districtId}")
-//    public Result getWeather(@PathVariable String districtId){
-//        // http://api.map.baidu.com/weather/v1/?district_id=222405&data_type=all&ak=你的ak
-//        String api = "http://api.map.baidu.com/weather/v1/?district_id=" + districtId + "&data_type=all&ak=" + AK;
-//        String s = HttpUtil.get(api);
-//        JSONObject result = JSONObject.parseObject(s);
-//        return Result.success(result);
-//    }
-//}

+ 87 - 0
gis_web/src/main/java/com/gis/web/controller/ChengDuYiQingFangKongController.java

@@ -0,0 +1,87 @@
+package com.gis.web.controller;
+
+import com.gis.common.deyuan.util.ResultUtils;
+import com.gis.common.util.Result;
+import io.swagger.annotations.Api;
+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.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+
+/**
+ * Created by owen on 2022/6/16 0016 15:05
+ * 成都疫情防控接口
+ *
+ * https://xtpt.yuque.com/books/share/826c2d4f-1ddb-4bd3-95d8-94729984d695?# 《数据开放平台》密码:ympb
+ *
+ * FY101 FY102 FY105 FY106
+ *
+ * 社区码查询
+ * https://tfsmy.chengdu.gov.cn/cbase/bud-cloud-governance-biz/openApi/district/getAllDistrict?cityCode=510114001
+ *
+ */
+@Api(tags = "成都疫情防控接口")
+@RestController
+@RequestMapping("/fy")
+public class ChengDuYiQingFangKongController {
+
+    @Autowired
+    ResultUtils resultUtils;
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "code", value = "社区编码 如:测试环境 510114001(大丰社区)  正式环境太平社区 510114001016", dataType = "String")
+    })
+    @ApiOperation("社区报备统计(FY101)")
+    @GetMapping("/community/report/data/{code}")
+    public Result reportDdata(@PathVariable String code){
+        String apiUrl = "/open/api/v1/community/report/data";
+        HashMap<String, Object> param = new HashMap<>();
+        param.put("code", code);
+        return resultUtils.doGetResult(apiUrl, param);
+    }
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "code", value = "社区编码 如:测试环境 510114001(大丰社区)  正式环境太平社区 510114001016", dataType = "String")
+    })
+    @ApiOperation("异常状况分析-各辖区重点人员异常状况(FY102)")
+    @GetMapping("/community/exception/list/{code}")
+    public Result exceptionList(@PathVariable String code){
+        String apiUrl = "/open/api/v1/community/exception/list";
+        HashMap<String, Object> param = new HashMap<>();
+        param.put("code", code);
+        return resultUtils.doGetResult(apiUrl, param);
+    }
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "code", value = "社区编码 如:测试环境 510114001(大丰社区)  正式环境太平社区 510114001016", dataType = "String")
+    })
+    @ApiOperation("管控情况-各区县已管控人员分布(FY105)")
+    @GetMapping("/community/manager/list/{code}")
+    public Result managerList(@PathVariable String code){
+        String apiUrl = "/open/api/v1/community/manager/list";
+        HashMap<String, Object> param = new HashMap<>();
+        param.put("code", code);
+        return resultUtils.doGetResult(apiUrl, param);
+    }
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "code", value = "社区编码 如:测试环境 510114001(大丰社区)  正式环境太平社区 510114001016", dataType = "String")
+    })
+    @ApiOperation("管控情况-总数统计(FY106)")
+    @GetMapping("/community/manager/total{code}")
+    public Result managerTotal(@PathVariable String code){
+        String apiUrl = "/open/api/v1/community/manager/total";
+        HashMap<String, Object> param = new HashMap<>();
+        param.put("code", code);
+        return resultUtils.doGetResult(apiUrl, param);
+    }
+}

+ 0 - 592
gis_web/src/main/java/com/gis/web/controller/ScreenController1.java

@@ -1,592 +0,0 @@
-//package com.gis.web.controller;
-//
-//
-//import com.alibaba.fastjson.JSON;
-//import com.alibaba.fastjson.JSONObject;
-//import com.alibaba.fastjson.serializer.SerializerFeature;
-//import com.gis.common.base.entity.dto.DeviceInfo;
-//import com.gis.common.deyuan.util.ResultUtils;
-//import com.gis.common.util.DoorUtils;
-//import com.gis.common.util.Result;
-//import com.gis.web.dto.PageDto;
-//import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-//import io.swagger.annotations.Api;
-//import io.swagger.annotations.ApiImplicitParam;
-//import io.swagger.annotations.ApiImplicitParams;
-//import io.swagger.annotations.ApiOperation;
-//import lombok.extern.log4j.Log4j2;
-//import lombok.extern.slf4j.Slf4j;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.web.bind.annotation.*;
-//
-//import java.util.HashMap;
-//import java.util.TreeMap;
-//
-//
-///**
-// * Created by owen on 2020/10/18 0018 12:17
-// */
-//@Slf4j
-//@Api(tags = "大屏BI接口")
-//@RestController
-//@RequestMapping("screen")
-//public class ScreenController1 {
-//
-//    @Autowired
-//    ResultUtils resultUtils;
-//
-//    @ApiOperationSupport(order=1)
-//    @ApiOperation("街道人员组成、房屋信息")
-//    @GetMapping("baseData/{code}")
-//    public Result baseData(@PathVariable String code){
-//        String apiUrl = "/open/api/v1/community/base-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperationSupport(order=1)
-//    @ApiOperation("街道服务")
-//    @GetMapping("serviceData/{code}")
-//    public JSONObject serviceData(@PathVariable String code){
-//        String apiUrl = "/open/api/v1/community/service-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGet(apiUrl, param);
-//    }
-//
-//    @ApiOperationSupport(order=1)
-//    @ApiOperation("市民之声数据")
-//    @GetMapping("citizenVoiceData/{code}")
-//    public JSONObject citizenVoiceData(@PathVariable String code){
-//        String apiUrl = "/open/api/v1/community/citizen-voice-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGet(apiUrl, param);
-//    }
-//
-//    @ApiOperationSupport(order=1)
-//    @ApiOperation("公共空间数据")
-//    @GetMapping("spaceData/{code}")
-//    public JSONObject spaceData(@PathVariable String code){
-//        String apiUrl = "/open/api/v1/community/space-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGet(apiUrl, param);
-//    }
-//
-//
-//    @ApiImplicitParams({
-//            @ApiImplicitParam(name = "code", value = "行政编码 (必传)", dataType = "String"),
-//            @ApiImplicitParam(name = "children", value = "查询下级节点(非必传), 必传是否查询街道及其以下社区:" +"true ", dataType = "String")
-//    })
-//    @ApiOperationSupport(order=1)
-//    @ApiOperation("社区活动")
-//    @GetMapping("activityData")
-//    public JSONObject activityData(@PathVariable String code,@PathVariable Boolean children){
-//        String apiUrl = "/open/api/v1/community/activity-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        param.put("children", children);
-//        return resultUtils.doGet(apiUrl, param);
-//    }
-//
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("邻里交流,cityCode:510124112")
-//    @GetMapping("interFlow/{cityCode}")
-//    public Result interFlow(@PathVariable String cityCode) {
-//        String apiUrl = "/open/api/v1/community/statistics/interflow";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("cityCode", cityCode);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("积分商城数据")
-//    @GetMapping("pointData/{code}")
-//    public Result pointData(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/point-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("社区资讯")
-//    @GetMapping("infoData/{code}")
-//    public Result infoData(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/info-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("可信生活圈")
-//    @GetMapping("businessData/{code}/{type}")
-//    public Result businessData(@PathVariable String group,@PathVariable String[] type) {
-//        String apiUrl = "/open/api/v1/community/business-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("group", group);
-//        param.put("type", type);
-//
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//
-//    @ApiImplicitParams({
-//            @ApiImplicitParam(name = "appId", value = "应用Id(必传)", dataType = "String"),
-//            @ApiImplicitParam(name = "sign", value = "参数签名(必传), ", dataType = "String"),
-//            @ApiImplicitParam(name = "data", value = "data(非必传) ", dataType = "String")
-//    })
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("就业专栏")
-//    @GetMapping("getStatistics")
-//    public Result getStatistics(@PathVariable String appId,@PathVariable String sign,@PathVariable String data) {
-//        String apiUrl = "/open/api/v1/community/deyuan/getStatistics";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("appId", appId);
-//        param.put("sign", sign);
-//        param.put("data", data);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//
-//    /**
-//     * 2021-02-19
-//     * @param xzCode 行政编码
-//     * @param xzLevel 行政级别
-//     * @return
-//     */
-//    @ApiOperation("一键报警, 510124112006:4, 510124112:3")
-//    @GetMapping("getInfo")
-//    public Result getInfo(@PathVariable String xzCode, @PathVariable String xzLevel, @PathVariable String topic, @PathVariable String lastestNewsNum, @PathVariable String reportStarttime, @PathVariable String reportEndtime, @PathVariable String dealStartTime, @PathVariable String dealEndTime) {
-//        String apiUrl = "/open/api/v1/sspReportInfo/getInfo";
-//
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("xzCode", xzCode);
-//        param.put("xzLevel", xzLevel);
-//        param.put("topic", topic);
-//        param.put("lastestNewsNum", lastestNewsNum);
-//        param.put("reportStarttime", reportStarttime);
-//        param.put("reportEndtime", reportEndtime);
-//        param.put("dealStartTime", dealStartTime);
-//        param.put("dealEndTime", dealEndTime);
-//        return Result.success(resultUtils.doGet(apiUrl, param));
-//    }
-//
-//
-//    @ApiImplicitParams({
-//            @ApiImplicitParam(name = "code", value = "行政编码 (必传)", dataType = "String"),
-//            @ApiImplicitParam(name = "xzLevel", value = "行政级别(必传), ", dataType = "String"),
-//            @ApiImplicitParam(name = "topic", value = "查询主题, DB 表示待办, YB 表示已办 (必传), ", dataType = "String")
-//    })
-//    @ApiOperation("一键报警(已办/代办), 510124112006:4, 510124112:3")
-//    @GetMapping("sspReportInfo")
-//    public Result sspReportInfo(@PathVariable String code, @PathVariable String xzLevel, @PathVariable String topic, @PathVariable String reportStarttime, @PathVariable String reportEndtime, @PathVariable String dealStartTime, @PathVariable String dealEndTime) {
-//        String apiUrl = "/open/api/v1/sspReportInfo/getInfoList";
-//
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("xzCode", code);
-//        param.put("xzLevel", xzLevel);
-//        param.put("topic", topic);
-//        param.put("reportStarttime", reportStarttime);
-//        param.put("reportEndtime", reportEndtime);
-//        param.put("dealStartTime", dealStartTime);
-//        param.put("dealEndTime", dealEndTime);
-//        return Result.success(resultUtils.doGet(apiUrl, param));
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("党建活动")
-//    @GetMapping("activity/{code}")
-//    public Result activity(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/deyuan/activity";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("党组织概况")
-//    @GetMapping("organization/{code}")
-//    public Result organization(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/deyuan/organization";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("党建资讯")
-//    @GetMapping("article/{code}")
-//    public Result article(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/deyuan/article";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("智慧门禁健康码推送")
-//    @GetMapping("article")
-//    public Result entranceGuard(@PathVariable String idCard,@PathVariable String dataTime,@PathVariable String status,@PathVariable String desc) throws Exception{
-//        String apiUrl = "/open/api/v1/ entrance-guard/health/pull";
-//        TreeMap<String, Object> param =  new TreeMap<>();
-//        param.put("idCard", idCard);
-//        param.put("dataTime", dataTime);
-//        param.put("status", status);
-//        param.put("desc", desc);
-//        return DoorUtils.doPost(apiUrl,param);
-//    }
-//
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("走访打更")
-//    @GetMapping("zfSignin")
-//    public Result zfSignin(@PathVariable String townCode,@PathVariable String page,@PathVariable String size) {
-//        String apiUrl = "/open/api/v1/zfSignin/querySign";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("townCode", townCode);
-//        param.put("page", page);
-//        param.put("size", size);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("社区警务室信息")
-//    @GetMapping("policeRoom/{code}")
-//    public Result policeRoom(@PathVariable String code) throws Exception{
-//        String apiUrl = "/open/api/screen/policeRoom";
-//        TreeMap<String, Object> param =  new TreeMap<>();
-//        param.put("code", code);
-//        return  DoorUtils.doPost(apiUrl,param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("证明申请信息统计")
-//    @GetMapping("screenCount/{code}")
-//    public Result screenCount(@PathVariable String code) throws Exception{
-//        String apiUrl = "/open/api/screen/count";
-//        TreeMap<String, Object> param =  new TreeMap<>();
-//        param.put("code", code);
-//        return DoorUtils.doPost(apiUrl,param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("证明申请最新动态")
-//    @GetMapping("screenCount/{code}/{count}")
-//    public Result screenCount(@PathVariable String code,@PathVariable int count)throws Exception {
-//        String apiUrl = "/open/api/screen/count";
-//        TreeMap<String, Object> param =  new TreeMap<>();
-//        param.put("code", code);
-//        param.put("count", count);
-//        return DoorUtils.doPost(apiUrl,param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("社区积分商城商品数量(社区排行榜)")
-//    @GetMapping("getStatics/{code}")
-//    public Result getStatics(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/getStatics";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("空间数量统计(社区排行榜")
-//    @GetMapping("communalSpace/{code}")
-//    public Result communalSpace(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/communal/space";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("空间数量统计(社区排行榜)")
-//    @GetMapping("activityStatics/{code}")
-//    public Result activityStatics(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/activity/statics";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("资讯数量统计(社区排行榜)")
-//    @GetMapping("newsManage/{code}")
-//    public Result newsManage(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/news-manage";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("加入和访问社区统计接口(7天,30天,当天,累计加入)")
-//    @GetMapping("budCloudGovernanceBiz/{code}/{date}")
-//    public Result budCloudGovernanceBiz(@PathVariable String code,@PathVariable String date) {
-//        String apiUrl = "/open/api/v1/bi/bud-cloud-governance-biz";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        param.put("date", date);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperationSupport(order=2)
-//    @ApiOperation("基库 - 查询社区各类标签的使用详情")
-//    @GetMapping("labelUsed/{code}/{date}")
-//    public Result labelUsed(@PathVariable String code,@PathVariable String labelType) {
-//        String apiUrl = "/open/api/v1/community/label-used";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        param.put("labelType", labelType);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperation("积分商城-积分兑换统计,code:510124112")
-//    @GetMapping("shopPoint/{code}")
-//    public Result shopPoint(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/shop-point";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperation("积分商城-积分发放统计,code:510124112")
-//    @GetMapping("pointCountByCode/{code}")
-//    public Result pointCountByCode(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/pointCountByCode";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("areaCode", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperation("基库-社区人员各个省份分布")
-//    @GetMapping("provinceDistributed/{code}")
-//    public Result provinceDistributed(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/province-distributed";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperation("基库-社区人员本省城市分布(新增)")
-//    @GetMapping("cityDistributed/{code}")
-//    public Result cityDistributed(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/city-distributed";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//
-//    @ApiOperation("基库-小区楼栋信息(新增)")
-//    @GetMapping("residential/{code}")
-//    public Result residential(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/residential/info";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperation("基库-高龄老人进出预警(新增-天府用)")
-//    @GetMapping("focusAlarm/{code}")
-//    public Result focusAlarm(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/focus/alarm";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("residentialCode", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("基库-根据标签查询人员列表(新增)")
-//    @GetMapping("getPeopleByLabel/{code}/{pageIndex}/{pageSize}/{labelId}")
-//    public Result getPeopleByLabel(@PathVariable String code,@PathVariable String pageIndex,@PathVariable String pageSize,@PathVariable String labelId) {
-//        String apiUrl = "/open/api/v1/community/getPeopleByLabel";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        param.put("pageIndex", pageIndex);
-//        param.put("pageSize", pageSize);
-//        param.put("labelId", labelId);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperation("加入社区,门户访问量")
-//    @GetMapping("doorStatistical/{code}")
-//    public Result doorStatistical(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/door/statistical";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperation("启用服务数,服务总次数")
-//    @GetMapping("serviceUsestatistical/{code}")
-//    public Result serviceUsestatistical(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/service-use/statistics";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("市级别服务饼图")
-//    @GetMapping("classStatistical/{code}")
-//    public Result classStatistical(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/service/class-statistical";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("市级服务使用排行")
-//    @GetMapping("rankStatistical/{code}")
-//    public Result rankStatistical(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/service/rank-statistical";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("居民使用接口")
-//    @GetMapping("monthStatistical/{code}")
-//    public Result monthStatistical(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/service/month-statistical";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("积分发放总数、积分发放核 销分析")
-//    @GetMapping("activePointStatistical/{code}")
-//    public Result activePointStatistical(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/service/active-point-statistical";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("问卷使用量接口")
-//    @GetMapping("summaryStatistics/{code}")
-//    public Result summaryStatistics(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/summary-statistics";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("资讯阅读数统计")
-//    @GetMapping("newsManageScreen")
-//    public Result summaryStatistics(@PathVariable String code,@PathVariable String num,@PathVariable String size) {
-//        String apiUrl = "/open/api/v1/bi/news-manage/screen";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        param.put("num", num);
-//        param.put("size", size);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//    @ApiOperation("积分商城兑换统计")
-//    @GetMapping("communityPointData")
-//    public Result communityPointData(@PathVariable String code,@PathVariable String size) {
-//        String apiUrl = "/open/api/v1/community/point-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        param.put("size", size);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("党建-最新一条党建活动")
-//    @GetMapping("partyActivityOne/{code}")
-//    public Result communityPointData(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/party/activity-one";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("community_code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("工具使用量统计")
-//    @GetMapping("toolsServerData/{code}")
-//    public Result toolsServerData(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/tools/server-data";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("积分发放核销分析")
-//    @GetMapping("activePointMonthStatistical/{code}")
-//    public Result activePointMonthStatistical(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/bi/active-point-month-statistical";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("基库-高龄老人进出预警(新)-测试地址")
-//    @GetMapping("alarmFocus/{code}")
-//    public Result alarmFocus(@PathVariable String code) {
-//        String apiUrl = "/open/api/device/alarm/focus";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("code", code);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//    @ApiOperation("数据告警信息")
-//    @PostMapping("deviceInfo")
-//    public Result deviceInfo(@RequestBody DeviceInfo deviceInfo) throws Exception{
-//        String apiUrl = "/open/api/device/info";
-//        TreeMap<String, Object> param =  new TreeMap<>();
-//        param.put("deviceType", deviceInfo.getDeviceType());
-//        param.put("channel", deviceInfo.getChannel());
-//        param.put("name", deviceInfo.getName());
-//        param.put("address", deviceInfo.getAddress());
-//        param.put("deviceCode", deviceInfo.getDeviceCode());
-//        param.put("deviceStatus", deviceInfo.getDeviceStatus());
-//        param.put("deviceWarn", deviceInfo.getDeviceWarn());
-//        param.put("deviceWarnContent", deviceInfo.getDeviceWarnContent());
-//        param.put("deviceWarnTime", deviceInfo.getDeviceWarnTime());
-//        param.put("manageDepartment", deviceInfo.getDeviceType());
-//        param.put("altitude", deviceInfo.getDeviceType());
-//        param.put("longitude", deviceInfo.getDeviceType());
-//        param.put("villageCode", deviceInfo.getDeviceType());
-//        param.put("outId", deviceInfo.getDeviceType());
-//        JSONObject object = JSONObject.parseObject(deviceInfo.getExtras());
-//        param.put("extras", JSON.toJSONString(object, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue,
-//                SerializerFeature.WriteDateUseDateFormat));
-//        return  DoorUtils.doPost(apiUrl, param);
-//    }
-//
-//
-//
-//
-////----------------------------------------------------------------------以上接口2021.12.13日修改
-//
-//    @ApiOperation(value = "就业发展-就业专栏(code:510124112、510100)", notes = "510100:有数据")
-//    @GetMapping("getStatistics/{code}")
-//    public Result getStatistics(@PathVariable String code) {
-//        String apiUrl = "/open/api/v1/community/deyuan/getStatistics";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("cityCode", code);
-//        // 商家分组编码
-//        param.put("group", "5f3de3d925892e0001e10312");
-//        return Result.success(resultUtils.doGet(apiUrl, param));
-//    }
-//
-//
-//
-//    /**
-//     * 2021-02-19
-//     * 新增接口
-//     * @param pageDto
-//     * @return
-//     */
-//    @ApiOperation("网格治理-走访打更")
-//    @PostMapping("zfSignin/querySign")
-//    public Result zfSignin(@RequestBody PageDto pageDto) {
-//        String apiUrl = "/open/api/v1/zfSignin/querySign";
-//        HashMap<String, Object> param = new HashMap<>();
-//        param.put("townCode", pageDto.getCode());
-//        Integer pageSize = pageDto.getPageSize();
-//        Integer pageNum = pageDto.getPageNum();
-//        if (pageSize <= 0) {
-//            pageSize = 10;
-//        }
-//        if (pageNum <= 0) {
-//            pageNum = 1;
-//        }
-//        param.put("size", pageSize);
-//        param.put("page", pageNum);
-//        return resultUtils.doGetResult(apiUrl, param);
-//    }
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//}

+ 8 - 1
pom.xml

@@ -30,7 +30,7 @@
         <java.version>1.8</java.version>
         <spring.boot.version>2.1.0.RELEASE</spring.boot.version>
         <gis.version>1.0.0</gis.version>
-        <fastjson.version>1.2.75</fastjson.version>
+        <fastjson.version>1.2.83</fastjson.version>
         <druid.version>1.1.14</druid.version>
         <hutool.version>5.3.3</hutool.version>
         <lombok.version>1.18.2</lombok.version>
@@ -75,6 +75,13 @@
                 <version>${gis.version}</version>
             </dependency>
 
+            <!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-core</artifactId>
+                <version>5.2.20.RELEASE</version>
+            </dependency>
+
 
 
             <dependency>

+ 68 - 0
remark.md

@@ -0,0 +1,68 @@
+## 成都德源数据大屏api
+
+# sit
+    server:http://47.112.166.173,这服务器需要开放端口才能外网访问
+    tomcat:http://47.112.166.173/root/user/java/tomcat_cmsChengDuScreen_8106
+    doc: http://47.112.166.173:8106/doc.html
+    web: http://47.112.166.173/chengdu/cljk.html
+    
+    <Context path="" docBase="/root/user/java/tomcat_cmsChengDuScreen_8106/webapps/cmsChengDuScreen" debug="0" reloadable="true" crossContext="true"/>
+
+
+
+
+接口名称	测试参数	是否有数据
+街道概况-街道人员组成、房屋信息	510115001076	有
+街道概况-街道服务	510115001076	有
+街道概况-公共空间数据	510115001076	有
+场景营造-党建活动	510115001076	否
+场景营造-社区活动	510115001076	否
+场景营造-党建资讯	510115001076	否
+场景营造-可信生活圈	510115001076	否
+场景营造-社区资讯	510115001076	有
+场景营造-邻里交流	460300	有
+场景营造-党组织概况	510115001076	有
+网格治理-一键报警	 510100	有
+就业发展-就业专栏	 510100	有
+
+
+门禁
+    车辆出入日志  510124112006001 有
+    
+    
+//        新城佳苑小区:510124112007001
+//        怡丽佳苑小区:510124112006001
+//        嘉业花园小区:510124112005001
+//        和乐佳苑小区:510124112005002
+//        馨美佳苑小区:510124112005003
+//        雅居佳苑小区:510124112001001
+//        德安佳苑小区:510124112008001   
+
+德源社区:510124112 
+
+
+# git
+http://192.168.0.115:3000/wuweihao/cms_chengdu_screen.git
+
+
+#################################### 2020-11-11 ####################################
+ 1. 服务器变更:47.112.166.173
+ doc: http://47.112.166.173:8106/doc.html
+ 
+ 
+#################################### 2020-12-02 ####################################
+ 1. 更新门禁接口域名为正式环境
+ 2. 更换大屏接口域名为正式环境
+ 
+ 
+ 接口名称	测试参数	是否有数据
+ 
+ 场景营造-可信生活圈	5f3de3d925892e0001e10312	有
+ 
+ 
+# 更新日志
+    sit :
+        2021-04-07
+            新增 设备列表信息查询 接口
+
+ 

+ 60 - 0
run.sh

@@ -0,0 +1,60 @@
+#!/bin/sh
+APP_NAME=smart_chengdu_xindu_dafeng.jar
+APP_PORT=8013
+APP_EVN=$2   #执行环境 sit|pro
+APP_ORDER=$1   #执行方法  start|stop|restart
+# 获取进程号
+APP_PID=`netstat -ntpl | grep $APP_PORT | grep LISTEN | awk '{print $7}' | awk -F "/" '{print $1}'`
+
+
+# 启动命令
+startApp(){
+    if [ ${APP_PID} ];
+    then
+    	echo "程序已经在运行了"
+    else
+    	echo "执行 start 方法"
+    	nohup java -jar -Xmx3072M -Xms512M ./$APP_NAME --spring.profiles.active=$APP_EVN --server.port=$APP_PORT > logs.log 2>error.log &  # 说明pid为空
+	echo Start Success!
+fi
+}
+
+# 停止命令
+stopApp(){
+    echo "执行 stop 方法"
+    if [ ${APP_PID} ];
+	then
+		echo $APP_NAME "存在,执行 stop 方法"
+			kill -9 ${APP_PID} && echo 'Kill Process!'
+	else
+		echo $APP_NAME 没有运行
+    fi
+}
+
+# 重启命令
+restartApp(){
+    echo " 1 执行 restart 方法"
+	stopApp
+	APP_PID=''  #将进程号置空
+	sleep 2
+	echo "进程号:" ${APP_PID} "端口号:" ${APP_PORT}
+	echo " 2 执行 restart 方法"
+	startApp
+}
+
+# 判断执行命令 取第一个参数
+case $APP_ORDER in
+    "start")
+        startApp
+        ;;
+    "stop")
+        stopApp
+        ;;
+	"restart")
+		restartApp
+        ;;
+        *)
+     ;;
+esac
+
+