ff-efa2edfc2ee07669a74e86ec280994f9d086aed0R73">73
        // 设置单元格上、下、左、右的边框线
75 74
        style1.setBorderBottom(HSSFCellStyle.BORDER_THIN);
76 75
        style1.setBorderLeft(HSSFCellStyle.BORDER_THIN);
77 76
        style1.setBorderRight(HSSFCellStyle.BORDER_THIN);
@ -83,7 +82,7 @@ public class ExcelFormatUtil {
83 82
        style1.setFont(font1);// 设置style1的字体
84 83
        style1.setWrapText(true);// 设置自动换行
85 84
        style1.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 设置单元格字体显示居中(左右方向)
86
        style1.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 设置单元格字体显示居中(上下方向)*/
85
        style1.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 设置单元格字体显示居中(上下方向)
87 86
        return style1;
88 87
    }
89 88
    /**

+ 191 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/util/HttpURLConnectionUtil.java

@ -0,0 +1,191 @@
1
package com.ai.ipu.server.util;
2
3
4
import com.ai.ipu.server.model.UrlAddress;
5
import com.alibaba.fastjson.JSON;
6
import com.sun.istack.internal.Nullable;
7
8
import java.io.*;
9
import java.net.HttpURLConnection;
10
import java.net.MalformedURLException;
11
import java.net.URL;
12
import java.net.URLConnection;
13
import java.util.HashMap;
14
import java.util.List;
15
import java.util.Map;
16
17
/**
18
 *
19
 * @date 2010/09/24 23:42
20
 */
21
public class HttpURLConnectionUtil {
22
23
    /**
24
     * Http get请求
25
     * @param httpUrl 连接
26
     * @return 响应数据
27
     */
28
    public static String doGet(String httpUrl){
29
        //链接
30
        HttpURLConnection connection = null;
31
        InputStream is = null;
32
        BufferedReader br = null;
33
        StringBuffer result = new StringBuffer();
34
        try {
35
            //创建连接
36
            URL url = new URL(httpUrl);
37
            connection = (HttpURLConnection) url.openConnection();
38
            //设置请求方式
39
            connection.setRequestMethod("GET");
40
            //设置连接超时时间
41
            connection.setReadTimeout(15000);
42
            //开始连接
43
            connection.connect();
44
            //获取响应数据
45
            if (connection.getResponseCode() == 200) {
46
                //获取返回的数据
47
                is = connection.getInputStream();
48
                if (null != is) {
49
                    br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
50
                    String temp = null;
51
                    while (null != (temp = br.readLine())) {
52
                        result.append(temp);
53
                    }
54
                }
55
            }
56
        } catch (IOException e) {
57
            e.printStackTrace();
58
        } finally {
59
            if (null != br) {
60
                try {
61
                    br.close();
62
                } catch (IOException e) {
63
                    e.printStackTrace();
64
                }
65
            }
66
            if (null != is) {
67
                try {
68
                    is.close();
69
                } catch (IOException e) {
70
                    e.printStackTrace();
71
                }
72
            }
73
            //关闭远程连接
74
            connection.disconnect();
75
        }
76
        return result.toString();
77
    }
78
79
    /**
80
     * Http post请求
81
     * @param httpUrl 连接
82
     * @param param 参数
83
     * @return
84
     */
85
    public static String doPost(String httpUrl, @Nullable String param, Map<String,String> pramMap) {
86
        StringBuffer result = new StringBuffer();
87
        //连接
88
        HttpURLConnection connection = null;
89
        OutputStream os = null;
90
        InputStream is = null;
91
        BufferedReader br = null;
92
        try {
93
            //创建连接对象
94
            URL url = new URL(httpUrl);
95
            //创建连接
96
            connection = (HttpURLConnection) url.openConnection();
97
            //设置请求方法
98
            connection.setRequestMethod("POST");
99
            //设置连接超时时间
100
            connection.setConnectTimeout(15000);
101
            //设置读取超时时间
102
            connection.setReadTimeout(15000);
103
            //DoOutput设置是否向httpUrlConnection输出,DoInput设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个
104
            //设置是否可读取
105
            connection.setDoOutput(true);
106
            connection.setDoInput(true);
107
            //设置通用的请求属性
108
            connection.setRequestProperty("accept", "*/*");
109
            connection.setRequestProperty("connection", "Keep-Alive");
110
            connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
111
            connection.setRequestProperty("Content-Type", "application/json;charset=utf-8");
112
113
            //拼装参数
114
            if (null != param && param.equals("")) {
115
                //设置参数
116
                os = connection.getOutputStream();
117
                //拼装参数
118
                os.write(param.getBytes("UTF-8"));
119
            }
120
            //设置权限
121
            //设置请求头等
122
            if(pramMap!=null&&pramMap.size()>0){
123
                connection.setRequestProperty("sign", pramMap.get("sign"));
124
                connection.setRequestProperty("session_id", pramMap.get("session_id"));
125
            }
126
            //开启连接
127
            connection.connect();
128
            //读取响应
129
            if (connection.getResponseCode() == 200) {
130
                is = connection.getInputStream();
131
                if (null != is) {
132
                    br = new BufferedReader(new InputStreamReader(is, "GBK"));
133
                    String temp = null;
134
                    while (null != (temp = br.readLine())) {
135
                        result.append(temp);
136
                        result.append("\r\n");
137
                    }
138
                }
139
            }
140
141
        } catch (MalformedURLException e) {
142
            e.printStackTrace();
143
        } catch (IOException e) {
144
            e.printStackTrace();
145
        } finally {
146
            //关闭连接
147
            if(br!=null){
148
                try {
149
                    br.close();
150
                } catch (IOException e) {
151
                    e.printStackTrace();
152
                }
153
            }
154
            if(os!=null){
155
                try {
156
                    os.close();
157
                } catch (IOException e) {
158
                    e.printStackTrace();
159
                }
160
            }
161
            if(is!=null){
162
                try {
163
                    is.close();
164
                } catch (IOException e) {
165
                    e.printStackTrace();
166
                }
167
            }
168
            //关闭连接
169
            connection.disconnect();
170
        }
171
        return result.toString();
172
    }
173
174
175
    /**
176
     * 调用登录接口获取sessionId与sign
177
     * @return
178
     */
179
    public static Map<String,String> iotLogin() {
180
        HashMap<String, String> paramHashMap = new HashMap<>();
181
        //        //调用北向服务的查询接口
182
        //调用登录接口获取sessionId与sign
183
        //设置登录接口参数
184
        String loginParam=" {\"userCode\":\"IOT_ADMIN\",\"passWord\":\"123456\"}";
185
        String loginResult =doPost(UrlAddress.IOT_LOGIN, loginParam,paramHashMap);
186
        Map mapType = JSON.parseObject(loginResult,Map.class);
187
        return (Map)mapType.get("result");
188
    }
189
190
191
}

ipu-demo/src/main/java/com/ai/ipu/server/util/IpUtil.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/util/IpUtil.java


ipu-demo/src/main/java/com/ai/ipu/server/util/RestScaffoldConstant.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/util/RestScaffoldConstant.java


ipu-demo/src/main/java/com/ai/ipu/server/util/SpringUtil.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/util/SpringUtil.java


ipu-demo/src/main/resources/banner.txt → ebc-sea-platform/src/main/resources/banner.txt


+ 0 - 1
ipu-demo/src/main/resources/dev/application.properties

@ -24,4 +24,3 @@ spring.devtools.restart.enabled=true
24 24
#重启目录
25 25
spring.devtools.restart.additional-paths=src/main/java
26 26
spring.devtools.restart.exclude=WEB-INF/**
27

ipu-demo/src/main/resources/dev/ipu-mybatis-config.xml → ebc-sea-platform/src/main/resources/dev/ipu-mybatis-config.xml


ipu-demo/src/main/resources/dev/ipu-nosql.xml → ebc-sea-platform/src/main/resources/dev/ipu-nosql.xml


+ 32 - 0
ebc-sea-platform/src/main/resources/dev/log4j2.xml

@ -0,0 +1,32 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<Configuration status="WARN">
3
    <Properties>
4
        <!-- 配置日志文件输出目录,此配置将日志输出到tomcat根目录下的指定文件夹 -->
5
        <Property name="LOG_HOME">${sys:log.path:-target}</Property>
6
    </Properties>
7
    <Appenders>
8
        <Console name="Console" target="SYSTEM_OUT">
9
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
10
        </Console>
11
        <RollingFile name="File" fileName="${LOG_HOME}/ebc-sea-platform.log" filePattern="${LOG_HOME}/ebc-sea-platform-%d{yyyy-MM-dd}.log">
12
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
13
            <Policies>
14
                <TimeBasedTriggeringPolicy modulate="true" interval="1"/>
15
            </Policies>
16
        </RollingFile>
17
        <RollingFile name="FileError" fileName="${LOG_HOME}/ebc-sea-platform-error.log" filePattern="${LOG_HOME}/ebc-sea-platform-error-%d{yyyy-MM-dd}.log">
18
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
19
            <Policies>
20
                <TimeBasedTriggeringPolicy modulate="true" interval="1"/>
21
            </Policies>
22
        </RollingFile>
23
    </Appenders>
24
    <Loggers>
25
        <Root level="all">
26
            <AppenderRef ref="Console"/>
27
        </Root>
28
        <logger name="com.ai.ipu" level="DEBUG"></logger>
29
        <logger name="org" level="WARN"></logger>
30
        <logger name="io.netty" level="INFO"></logger>
31
    </Loggers>
32
</Configuration>

ipu-demo/src/main/resources/dev/logback.xml → ebc-sea-platform/src/main/resources/dev/logback.xml


ipu-demo/src/main/resources/dev/menu.json → ebc-sea-platform/src/main/resources/dev/menu.json


ipu-demo/src/main/resources/exception_messages_zh_CN.properties → ebc-sea-platform/src/main/resources/exception_messages_zh_CN.properties


ipu-demo/src/main/resources/ipu-spring-mvc.xml → ebc-sea-platform/src/main/resources/ipu-spring-mvc.xml


ipu-demo/src/main/resources/pro/application.properties → ebc-sea-platform/src/main/resources/pro/application.properties


ipu-demo/src/main/resources/pro/ipu-mybatis-config.xml → ebc-sea-platform/src/main/resources/pro/ipu-mybatis-config.xml


ipu-demo/src/main/resources/pro/ipu-nosql.xml → ebc-sea-platform/src/main/resources/pro/ipu-nosql.xml


ipu-demo/src/main/resources/pro/log4j.properties → ebc-sea-platform/src/main/resources/pro/log4j.properties


+ 41 - 4
ipu-demo/src/main/resources/sql/ipu/MapTagManageDao.xml

@ -2,8 +2,14 @@
2 2
<sqls>
3 3
	<sql name="queryMapTagInfo">
4 4
		<![CDATA[
5
		<select id="queryMapTagInfo" resultType="java.util.Map">
6
	        SELECT MAP_TAG_ID,MAP_TAG_NAME,MAP_TAG_TYPE,CREATE_DATE FROM  ebc_map_tag
5
		<select id="queryMapTagInfo" resultType="java.util.Map" >
6
	        SELECT
7
				MAP_TAG_ID,
8
				MAP_TAG_NAME,
9
				MAP_TAG_TYPE,
10
				CREATE_DATE
11
			FROM
12
				ebc_map_tag emt
7 13
	        <where>
8 14
	        	<if test="MAP_TAG_NAME!=null">
9 15
               		 and MAP_TAG_NAME like concat(concat("%",#{MAP_TAG_NAME}),"%")
@ -12,7 +18,24 @@
12 18
		</select>
13 19
		]]>
14 20
	</sql>
15
	
21
22
	<sql name="queryMapTagXyInfo">
23
		<![CDATA[
24
		<select id="queryMapTagXyInfo" resultType="java.util.Map" >
25
	        SELECT
26
				MAP_TAG_ID,
27
				MAP_TAG_XY_ID,
28
				XY_NAME,
29
				LATITUDE,
30
				LONGITUDE
31
			FROM
32
				ebc_map_tag_xy
33
		</select>
34
35
36
		]]>
37
	</sql>
38
16 39
	<sql name="addMapTagInfo">
17 40
		<![CDATA[
18 41
		<insert id="addMapTagInfo" resultType="java.util.Map" useGeneratedKeys="true" keyProperty="MAP_TAG_ID">
@ -30,7 +53,6 @@
30 53
31 54
	<sql name="addMapTagxyInfo">
32 55
		<![CDATA[<insert id="addMapTagxyInfo">
33
34 56
			INSERT INTO ebc_map_tag_xy
35 57
			(MAP_TAG_ID,XY_NAME,LONGITUDE,LATITUDE)
36 58
			VALUES
@ -39,8 +61,23 @@
39 61
			</foreach>
40 62
		</insert>
41 63
		]]>
64
	</sql>
42 65
43 66
67
68
	<sql name="deleteMapTagXyInfo">
69
		<![CDATA[
70
			<delete id="deleteMapTagXyInfo">
71
				delete FROM ebc_map_tag_xy where MAP_TAG_ID=#{MAP_TAG_ID}
72
			</delete>
73
		]]>
44 74
	</sql>
45 75
76
	<sql name="deleteMapTagInfo">
77
		<![CDATA[
78
			<delete id="deleteMapTagInfo">
79
				delete FROM ebc_map_tag where MAP_TAG_ID=#{MAP_TAG_ID}
80
			</delete>
81
		]]>
82
	</sql>
46 83
</sqls>

ipu-demo/src/main/resources/sql/ipu/demo/ipu-db-demo.xml → ebc-sea-platform/src/main/resources/sql/ipu/demo/ipu-db-demo.xml


ipu-demo/src/main/resources/test/application.properties → ebc-sea-platform/src/main/resources/test/application.properties


ipu-demo/src/main/resources/test/ipu-mybatis-config.xml → ebc-sea-platform/src/main/resources/test/ipu-mybatis-config.xml


ipu-demo/src/main/resources/test/ipu-nosql.xml → ebc-sea-platform/src/main/resources/test/ipu-nosql.xml


ipu-demo/src/main/resources/test/log4j.properties → ebc-sea-platform/src/main/resources/test/log4j.properties


ipu-demo/src/main/resources/uspa.properties → ebc-sea-platform/src/main/resources/uspa.properties


ipu-demo/src/main/resources/uspaContext.xml → ebc-sea-platform/src/main/resources/uspaContext.xml


ipu-demo/src/main/resources/uspaJDBC.properties → ebc-sea-platform/src/main/resources/uspaJDBC.properties


+ 0 - 34
ipu-demo/src/main/java/com/ai/ipu/server/service/impl/MapTagManageServiceImpl.java

@ -1,34 +0,0 @@
1
package com.ai.ipu.server.service.impl;
2
3
import com.ai.ipu.data.JMap;
4
import com.ai.ipu.server.dao.interfaces.MapTagManageDao;
5
import com.ai.ipu.server.model.MapTag;
6
import com.ai.ipu.server.service.interfaces.MapTagManageService;
7
import com.github.pagehelper.PageInfo;
8
import org.springframework.beans.factory.annotation.Autowired;
9
import org.springframework.stereotype.Service;
10
11
import java.util.List;
12
import java.util.Map;
13
14
@Service
15
public class MapTagManageServiceImpl implements MapTagManageService {
16
17
    @Autowired
18
    MapTagManageDao mapTagManageDao;
19
20
    @Override
21
    public PageInfo queryMapTagInfo(JMap params) throws Exception {
22
        return mapTagManageDao.queryMapTagInfo(params);
23
    }
24
25
    @Override
26
    public int modifyMapTagInfo(JMap params) throws Exception{
27
        return mapTagManageDao.modifyMapTagInfo(params);
28
    }
29
30
    @Override
31
    public int addMapTagInfo(JMap params) throws Exception{
32
        return mapTagManageDao.addMapTagInfo(params);
33
    }
34
}

+ 0 - 15
ipu-demo/src/main/resources/dev/log4j2.xml

@ -1,15 +0,0 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<Configuration status="WARN">
3
    <Appenders>
4
        <Console name="Console" target="SYSTEM_OUT">
5
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
6
        </Console>
7
    </Appenders>
8
    <Loggers>
9
        <Root level="WARN">
10
            <AppenderRef ref="Console"/>
11
        </Root>
12
        <logger name="com.ai" level="DEBUG"></logger>
13
        <logger name="org.springframework.boot.web" level="DEBUG"></logger>
14
    </Loggers>
15
</Configuration>

更新文件 · 000ebd90c9 - Nuosi Git Service
Browse Source

更新文件

liuchang 4 years ago
parent
commit
000ebd90c9

Diff Data Not Available.