<!--过滤掉不希望包含在jar中的文件-->
325
					<excludes>
326
						<exclude>**/*.properties</exclude>
327
						<exclude>**/*.xml</exclude>
328
						<exclude>**/*.yaml</exclude>
329
						<exclude>**/*.yml</exclude>
330
						<exclude>**/*.txt</exclude>
331
					</excludes>
332
				</configuration>
333
			</plugin>
334
335
			<plugin>
336
				<groupId>org.apache.maven.plugins</groupId>
337
				<artifactId>maven-assembly-plugin</artifactId>
338
				<version>2.4</version>
339
				<!-- The configuration of the plugin -->
340
				<configuration>
341
					<!-- Specifies the configuration file of the assembly plugin -->
342
					<descriptors>
343
						<descriptor>src/main/assembly-package.xml</descriptor>
344
					</descriptors>
345
				</configuration>
346
				<executions>
347
					<execution>
348
						<id>make-assembly</id>
349
						<phase>package</phase>
350
						<goals>
351
							<goal>single</goal>
352
						</goals>
353
					</execution>
354
				</executions>
355
			</plugin>
356
		</plugins>
357
		<finalName>${project.artifactId}</finalName>
226 358
	</build>
227 359
</project>

ipu-demo/readme.md → ebc-sea-platform/readme.md


ipu-demo/sql/ipu_db_demo.sql → ebc-sea-platform/sql/ipu_db_demo.sql


ipu-demo/src/main/assembly-package.xml → ebc-sea-platform/src/main/assembly-package.xml


+ 1 - 1
ipu-demo/src/main/java/com/ai/ipu/server/IpuDemoStart.java

@ -12,7 +12,7 @@ import org.springframework.context.annotation.ComponentScan;
12 12
 * @date 2019年11月21日下午3:11:12
13 13
 * @desc SpringBoot应用启动类
14 14
 */
15
public class IpuDemoStart {
15
public class EbcSeaPlatformStart {
16 16
	private final static String EXCEPTION_MESSAGES_CONFIG = "exception_messages";
17 17
18 18
	public static void main(String[] args) {

ipu-demo/src/main/java/com/ai/ipu/server/control/AuthController.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/control/AuthController.java


ipu-demo/src/main/java/com/ai/ipu/server/control/DbSqlMgmtController.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/control/DbSqlMgmtController.java


+ 73 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/BaseFrontController.java

@ -0,0 +1,73 @@
1
package com.ai.ipu.server.controller;
2
import java.io.InputStream;
3
import java.net.URLEncoder;
4
import java.util.Calendar;
5
import java.util.Date;
6
import java.util.HashMap;
7
import java.util.Map;
8
9
import org.apache.poi.util.IOUtils;
10
import org.slf4j.Logger;
11
import org.slf4j.LoggerFactory;
12
import org.springframework.http.HttpHeaders;
13
import org.springframework.http.HttpStatus;
14
import org.springframework.http.ResponseEntity;
15
import org.springframework.util.StringUtils;
16
import org.springframework.validation.annotation.Validated;
17
18
@Validated
19
public class BaseFrontController {
20
21
    /**
22
     * slf4j 日志 logger
23
     */
24
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
25
26
    /**
27
     * 下载文件,纯SpringMVC的API来完成
28
     *
29
     * @param is 文件输入流
30
     * @param name 文件名称,带后缀名
31
     *
32
     * @throws Exception
33
     */
34
    public ResponseEntity<byte[]> buildResponseEntity(InputStream is, String name) throws Exception {
35
        logger.info(">>>>>>>>>>>>>>>>>>>>开始下载文件>>>>>>>>>>");
36
        if (this.logger.isDebugEnabled())
37
            this.logger.debug("download: " + name);
38
        HttpHeaders header = new HttpHeaders();
39
40
        Calendar cal = Calendar.getInstance();
41
        int year = cal.get(Calendar.YEAR);//获取年份
42
        int month=cal.get(Calendar.MONTH)+1;//获取月份
43
        int day=cal.get(Calendar.DATE);//获取日
44
        int hour=cal.get(Calendar.HOUR);//小时
45
        int minute=cal.get(Calendar.MINUTE);//分
46
        int second=cal.get(Calendar.SECOND);//秒
47
        String filePrefix = name.substring(0,name.lastIndexOf('.') - 1);
48
        String fileSuffix = name.substring(name.lastIndexOf('.') + 1);
49
        fileSuffix = fileSuffix.toLowerCase();
50
        String fileName=filePrefix+year+month+day+hour+minute+second+"."+fileSuffix;
51
        Map<String, String> arguments = new HashMap<String, String>();
52
        arguments.put("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
53
        arguments.put("xls", "application/vnd.ms-excel");
54
55
        String contentType = arguments.get(fileSuffix);
56
        header.add("Content-Type", (StringUtils.hasText(contentType) ? contentType : "application/x-download"));
57
        if(is!=null && is.available()!=0){
58
            header.add("Content-Length", String.valueOf(is.available()));
59
            header.add("Content-Disposition", "attachment;filename*=utf-8'zh_cn'" + URLEncoder.encode(fileName, "UTF-8"));
60
            byte[] bs = IOUtils.toByteArray(is);
61
            logger.info(">>>>>>>>>>>>>>>>>>>>结束下载文件-有记录>>>>>>>>>>");
62
            logger.info(">>>>>>>>>>结束导出excel>>>>>>>>>>");
63
            return new ResponseEntity<>(bs, header, HttpStatus.OK);
64
        }else{
65
            String string="数据为空";
66
            header.add("Content-Length", "0");
67
            header.add("Content-Disposition", "attachment;filename*=utf-8'zh_cn'" + URLEncoder.encode(fileName, "UTF-8"));
68
            logger.info(">>>>>>>>>>>>>>>>>>>>结束下载文件-无记录>>>>>>>>>>");
69
            logger.info(">>>>>>>>>>结束导出excel>>>>>>>>>>");
70
            return new ResponseEntity<>(string.getBytes(), header, HttpStatus.OK);
71
        }
72
    }
73
}

+ 98 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/CallRescuerController.java

@ -0,0 +1,98 @@
1
package com.ai.ipu.server.controller;
2
3
4
import com.ai.ipu.basic.util.IpuUtility;
5
import com.ai.ipu.data.JMap;
6
import com.ai.ipu.data.impl.JsonMap;
7
import com.ai.ipu.server.service.interfaces.ExportService;
8
import com.ai.ipu.server.service.interfaces.CallRescuerService;
9
import com.ai.ipu.server.util.RestScaffoldConstant;
10
import com.github.pagehelper.PageInfo;
11
import org.springframework.beans.factory.annotation.Autowired;
12
import org.springframework.beans.factory.annotation.Qualifier;
13
import org.springframework.http.ResponseEntity;
14
import org.springframework.stereotype.Controller;
15
import org.springframework.web.bind.annotation.RequestMapping;
16
import org.springframework.web.bind.annotation.ResponseBody;
17
18
import javax.servlet.http.HttpServletRequest;
19
import javax.servlet.http.HttpServletResponse;
20
21
@Controller
22
@RequestMapping("/terminal")
23
public class CallRescuerController {
24
25
    @Autowired
26
    @Qualifier("CallRescuerServiceImpl")
27
    ExportService exportService;
28
29
30
    @Autowired
31
    CallRescuerService callRescuerService;
32
    /**
33
     * 查询终端信息
34
     */
35
    @ResponseBody
36
    @RequestMapping("/queryCallRescuerInfo")
37
    public JMap queryCallRescuerInfo(JMap params) throws Exception {
38
39
        PageInfo terminalList=  callRescuerService.queryCallRescuerInfo(params);
40
        JMap result = new JsonMap();
41
        result.put("result", terminalList);
42
        return result;
43
    }
44
45
    /**
46
     * 导出地图标记到excel
47
     */
48
    @ResponseBody
49
    @RequestMapping("/exportCallRescuerInfoToExcel")
50
    public ResponseEntity<byte[]> exportCallRescuerInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
51
52
        return exportService.exportExcel(request,response,params);
53
    }
54
55
    /**
56
     * 编辑地图标记
57
     */
58
    @ResponseBody
59
    @RequestMapping("/modifyCallRescuerInfo")
60
    public JMap modifyCallRescuerInfo(JMap params) throws Exception {
61
        int num=0;
62
        //取值判断如果有当前id则为修改,否则为新增
63
        JMap params1 = params.getJMap("params");
64
        try{
65
            if(params1.getInt("MAP_TAG_ID")!=0){
66
                num= callRescuerService.modifyCallRescuerInfo(params1);
67
            }else{
68
                num= callRescuerService.addCallRescuerInfo(params1);
69
            }
70
        }catch(Exception e){
71
            e.printStackTrace();
72
            IpuUtility.errorCode(RestScaffoldConstant.SERVER_003);
73
        }
74
        JMap result = new JsonMap();
75
        if(num>0){
76
            result.put("result", true);
77
        }else{
78
            result.put("result", false);
79
        }
80
        return result;
81
    }
82
83
    /**
84
     * 刪除地图标记
85
     */
86
    @ResponseBody
87
    @RequestMapping("/deleteCallRescuerXyInfo")
88
    public JMap deleteCallRescuerXyInfo(JMap params) throws Exception {
89
        boolean flag=false;
90
        if(params.getInt("MAP_TAG_ID")!=0){
91
            flag=  callRescuerService.deleteCallRescuerXyInfo(params);
92
        }
93
        JMap result = new JsonMap();
94
        result.put("result", flag);
95
        return result;
96
    }
97
98
}

+ 98 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/DeviceManageController.java

@ -0,0 +1,98 @@
1
package com.ai.ipu.server.controller;
2
3
4
import com.ai.ipu.basic.util.IpuUtility;
5
import com.ai.ipu.data.JMap;
6
import com.ai.ipu.data.impl.JsonMap;
7
import com.ai.ipu.server.service.interfaces.ExportService;
8
import com.ai.ipu.server.service.interfaces.DeviceManageService;
9
import com.ai.ipu.server.util.RestScaffoldConstant;
10
import com.github.pagehelper.PageInfo;
11
import org.springframework.beans.factory.annotation.Autowired;
12
import org.springframework.beans.factory.annotation.Qualifier;
13
import org.springframework.http.ResponseEntity;
14
import org.springframework.stereotype.Controller;
15
import org.springframework.web.bind.annotation.RequestMapping;
16
import org.springframework.web.bind.annotation.ResponseBody;
17
18
import javax.servlet.http.HttpServletRequest;
19
import javax.servlet.http.HttpServletResponse;
20
21
@Controller
22
@RequestMapping("/device")
23
public class DeviceManageController {
24
25
    @Autowired
26
    @Qualifier("DeviceManageServiceImpl")
27
    ExportService exportService;
28
29
30
    @Autowired
31
    DeviceManageService deviceManageService;
32
    /**
33
     * 查询终端信息
34
     */
35
    @ResponseBody
36
    @RequestMapping("/queryDeviceInfo")
37
    public JMap queryDeviceInfo(JMap params) throws Exception {
38
39
        PageInfo deviceList=  deviceManageService.queryDeviceInfo(params);
40
        JMap result = new JsonMap();
41
        result.put("result", deviceList);
42
        return result;
43
    }
44
45
    /**
46
     * 导出終端设备信息到excel
47
     */
48
    @ResponseBody
49
    @RequestMapping("/exportDeviceInfoToExcel")
50
    public ResponseEntity<byte[]> exportDeviceInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
51
52
        return exportService.exportExcel(request,response,params);
53
    }
54
55
    /**
56
     * 编辑地图标记
57
     */
58
    @ResponseBody
59
    @RequestMapping("/modifyDeviceInfo")
60
    public JMap modifyDeviceInfo(JMap params) throws Exception {
61
        int num=0;
62
        //取值判断如果有当前id则为修改,否则为新增
63
        JMap params1 = params.getJMap("params");
64
        try{
65
            if(params1.getInt("MAP_TAG_ID")!=0){
66
                num= deviceManageService.modifyDeviceInfo(params1);
67
            }else{
68
                num= deviceManageService.addDeviceInfo(params1);
69
            }
70
        }catch(Exception e){
71
            e.printStackTrace();
72
            IpuUtility.errorCode(RestScaffoldConstant.SERVER_003);
73
        }
74
        JMap result = new JsonMap();
75
        if(num>0){
76
            result.put("result", true);
77
        }else{
78
            result.put("result", false);
79
        }
80
        return result;
81
    }
82
83
    /**
84
     * 刪除地图标记
85
     */
86
    @ResponseBody
87
    @RequestMapping("/deleteDeviceXyInfo")
88
    public JMap deleteDeviceXyInfo(JMap params) throws Exception {
89
        boolean flag=false;
90
        if(params.getInt("MAP_TAG_ID")!=0){
91
            flag=  deviceManageService.deleteDeviceXyInfo(params);
92
        }
93
        JMap result = new JsonMap();
94
        result.put("result", flag);
95
        return result;
96
    }
97
98
}

+ 128 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/EquipmentManageController.java

@ -0,0 +1,128 @@
1
package com.ai.ipu.server.controller;
2
3
4
import com.ai.ipu.basic.util.IpuUtility;
5
import com.ai.ipu.data.JMap;
6
import com.ai.ipu.data.impl.JsonMap;
7
import com.ai.ipu.server.service.interfaces.ExportService;
8
import com.ai.ipu.server.service.interfaces.EquipmentManageService;
9
import com.ai.ipu.server.util.RestScaffoldConstant;
10
import com.github.pagehelper.PageInfo;
11
import org.springframework.beans.factory.annotation.Autowired;
12
import org.springframework.beans.factory.annotation.Qualifier;
13
import org.springframework.http.ResponseEntity;
14
import org.springframework.stereotype.Controller;
15
import org.springframework.web.bind.annotation.RequestMapping;
16
import org.springframework.web.bind.annotation.ResponseBody;
17
18
import javax.servlet.http.HttpServletRequest;
19
import javax.servlet.http.HttpServletResponse;
20
21
@Controller
22
@RequestMapping("/equipment")
23
public class EquipmentManageController {
24
25
    @Autowired
26
    @Qualifier("EquipmentManageServiceImpl")
27
    ExportService exportService;
28
29
30
    @Autowired
31
    EquipmentManageService equipmentManageService;
32
    /**
33
     * 查询设备信息
34
     */
35
    @ResponseBody
36
    @RequestMapping("/queryEquipmentInfo")
37
    public JMap queryEquipmentInfo(JMap params) throws Exception {
38
39
        PageInfo equipmentList=  equipmentManageService.queryEquipmentInfo(params);
40
        JMap result = new JsonMap();
41
        result.put("result", equipmentList);
42
        return result;
43
    }
44
45
    /**
46
     * 导出设备信息到excel
47
     */
48
    @ResponseBody
49
    @RequestMapping("/exportEquipmentInfoToExcel")
50
    public ResponseEntity<byte[]> exportEquipmentInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
51
52
        return exportService.exportExcel(request,response,params);
53
    }
54
55
    /**
56
     * 编辑设备信息、新增设备信息
57
     */
58
    @ResponseBody
59
    @RequestMapping("/modifyEquipmentInfo")
60
    public JMap modifyEquipmentInfo(JMap params) throws Exception {
61
        int num=0;
62
        //取值判断如果有当前id则为修改,否则为新增
63
        JMap params1 = params.getJMap("params");
64
        try{
65
            if(params1.getInt("MAP_TAG_ID")!=0){
66
                num= equipmentManageService.modifyEquipmentInfo(params1);
67
            }else{
68
                num= equipmentManageService.addEquipmentInfo(params1);
69
            }
70
        }catch(Exception e){
71
            e.printStackTrace();
72
            IpuUtility.errorCode(RestScaffoldConstant.SERVER_003);
73
        }
74
        JMap result = new JsonMap();
75
        if(num>0){
76
            result.put("result", true);
77
        }else{
78
            result.put("result", false);
79
        }
80
        return result;
81
    }
82
83
    /**
84
     * 刪除删除设备信息
85
     */
86
    @ResponseBody
87
    @RequestMapping("/deleteEquipmentInfo")
88
    public JMap deleteEquipmentInfo(JMap params) throws Exception {
89
        boolean flag=false;
90
        if(params.getInt("MAP_TAG_ID")!=0){
91
            flag=  equipmentManageService.deleteEquipmentInfo(params);
92
        }
93
        JMap result = new JsonMap();
94
        result.put("result", flag);
95
        return result;
96
    }
97
98
    /**
99
     * 批量刪除删除设备信息
100
     */
101
    @ResponseBody
102
    @RequestMapping("/deleteEquipmentsInfo")
103
    public JMap deleteEquipmentsInfo(JMap params) throws Exception {
104
        boolean flag=false;
105
        if(params.getInt("MAP_TAG_ID")!=0){
106
            flag=  equipmentManageService.deleteEquipmentsInfo(params);
107
        }
108
        JMap result = new JsonMap();
109
        result.put("result", flag);
110
        return result;
111
    }
112
113
    /**
114
     * 导入设备信息
115
     */
116
    @ResponseBody
117
    @RequestMapping("/importEquipmentsInfo")
118
    public JMap importEquipmentsInfo(JMap params) throws Exception {
119
        boolean flag=false;
120
        if(params.getInt("MAP_TAG_ID")!=0){
121
            flag=  equipmentManageService.importEquipmentInfo(params);
122
        }
123
        JMap result = new JsonMap();
124
        result.put("result", flag);
125
        return result;
126
    }
127
128
}

+ 27 - 5
ipu-demo/src/main/java/com/ai/ipu/server/controller/MapTagManageController.java

@ -5,10 +5,14 @@ import com.ai.ipu.basic.util.IpuUtility;
5 5
import com.ai.ipu.data.JMap;
6 6
import com.ai.ipu.data.impl.JsonMap;
7 7
import com.ai.ipu.server.model.MapTag;
8
import com.ai.ipu.server.service.interfaces.ExportService;
8 9
import com.ai.ipu.server.service.interfaces.MapTagManageService;
9 10
import com.ai.ipu.server.util.RestScaffoldConstant;
10 11
import com.github.pagehelper.PageInfo;
11 12
import org.springframework.beans.factory.annotation.Autowired;
13
import org.springframework.beans.factory.annotation.Qualifier;
14
import org.springframework.http.MediaType;
15
import org.springframework.http.ResponseEntity;
12 16
import org.springframework.stereotype.Controller;
13 17
import org.springframework.web.bind.annotation.RequestBody;
14 18
import org.springframework.web.bind.annotation.RequestMapping;
@ -16,6 +20,9 @@ import org.springframework.web.bind.annotation.RequestParam;
16 20
import org.springframework.web.bind.annotation.ResponseBody;
17 21
import sun.java2d.pipe.SpanClipRenderer;
18 22
23
import javax.servlet.http.HttpServletRequest;
24
import javax.servlet.http.HttpServletResponse;
25
import java.util.Date;
19 26
import java.util.List;
20 27
import java.util.Map;
21 28
@ -23,6 +30,10 @@ import java.util.Map;
23 30
@RequestMapping("/mapTag")
24 31
public class MapTagManageController {
25 32
33
    @Autowired
34
    @Qualifier("MapTagManageServiceImpl")
35
    ExportService exportService;
36
26 37
27 38
    @Autowired
28 39
    MapTagManageService mapTagManageService;
@ -44,12 +55,9 @@ public class MapTagManageController {
44 55
     */
45 56
    @ResponseBody
46 57
    @RequestMapping("/exportMapTagInfoToExcel")
47
    public JMap exportMapTagInfoToExcel(JMap params) throws Exception {
58
    public ResponseEntity<byte[]> exportMapTagInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
48 59
49
        PageInfo mapTagList=  mapTagManageService.queryMapTagInfo(params);
50
        JMap result = new JsonMap();
51
        result.put("result", mapTagList);
52
        return result;
60
        return exportService.exportExcel(request,response,params);
53 61
    }
54 62
55 63
    /**
@ -80,5 +88,19 @@ public class MapTagManageController {
80 88
        return result;
81 89
    }
82 90
91
    /**
92
     * 刪除地图标记
93
     */
94
    @ResponseBody
95
    @RequestMapping("/deleteMapTagXyInfo")
96
    public JMap deleteMapTagXyInfo(JMap params) throws Exception {
97
        boolean flag=false;
98
        if(params.getInt("MAP_TAG_ID")!=0){
99
            flag=  mapTagManageService.deleteMapTagXyInfo(params);
100
        }
101
        JMap result = new JsonMap();
102
        result.put("result", flag);
103
        return result;
104
    }
83 105
84 106
}

+ 142 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/UserManageController.java

@ -0,0 +1,142 @@
1
package com.ai.ipu.server.controller;
2
3
4
import com.ai.ipu.basic.util.IpuUtility;
5
import com.ai.ipu.data.JMap;
6
import com.ai.ipu.data.impl.JsonMap;
7
import com.ai.ipu.server.service.interfaces.ExportService;
8
import com.ai.ipu.server.service.interfaces.UserManageService;
9
import com.ai.ipu.server.util.RestScaffoldConstant;
10
import com.github.pagehelper.PageInfo;
11
import org.springframework.beans.factory.annotation.Autowired;
12
import org.springframework.beans.factory.annotation.Qualifier;
13
import org.springframework.http.ResponseEntity;
14
import org.springframework.stereotype.Controller;
15
import org.springframework.web.bind.annotation.RequestMapping;
16
import org.springframework.web.bind.annotation.ResponseBody;
17
18
import javax.servlet.http.HttpServletRequest;
19
import javax.servlet.http.HttpServletResponse;
20
21
@Controller
22
@RequestMapping("/user")
23
public class UserManageController {
24
25
    @Autowired
26
    @Qualifier("UserManageServiceImpl")
27
    ExportService exportService;
28
29
30
    @Autowired
31
    UserManageService userManageService;
32
    /**
33
     * 查询用户信息
34
     */
35
    @ResponseBody
36
    @RequestMapping("/queryUserInfo")
37
    public JMap queryUserInfo(JMap params) throws Exception {
38
39
        PageInfo userList=  userManageService.queryUserInfo(params);
40
        JMap result = new JsonMap();
41
        result.put("result", userList);
42
        return result;
43
    }
44
45
    /**
46
     * 导出用户信息到excel
47
     */
48
    @ResponseBody
49
    @RequestMapping("/exportUserInfoToExcel")
50
    public ResponseEntity<byte[]> exportUserInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
51
52
        return exportService.exportExcel(request,response,params);
53
    }
54
55
    /**
56
     * 编辑用户信息、新增用户信息
57
     */
58
    @ResponseBody
59
    @RequestMapping("/modifyUserInfo")
60
    public JMap modifyUserInfo(JMap params) throws Exception {
61
        int num=0;
62
        //取值判断如果有当前id则为修改,否则为新增
63
        JMap params1 = params.getJMap("params");
64
        try{
65
            if(params1.getInt("MAP_TAG_ID")!=0){
66
                num= userManageService.modifyUserInfo(params1);
67
            }else{
68
                num= userManageService.addUserInfo(params1);
69
            }
70
        }catch(Exception e){
71
            e.printStackTrace();
72
            IpuUtility.errorCode(RestScaffoldConstant.SERVER_003);
73
        }
74
        JMap result = new JsonMap();
75
        if(num>0){
76
            result.put("result", true);
77
        }else{
78
            result.put("result", false);
79
        }
80
        return result;
81
    }
82
83
    /**
84
     * 刪除用户信息
85
     */
86
    @ResponseBody
87
    @RequestMapping("/deleteUserInfo")
88
    public JMap deleteUserXyInfo(JMap params) throws Exception {
89
        boolean flag=false;
90
        if(params.getInt("MAP_TAG_ID")!=0){
91
            flag=  userManageService.deleteUserXyInfo(params);
92
        }
93
        JMap result = new JsonMap();
94
        result.put("result", flag);
95
        return result;
96
    }
97
98
    /**
99
     * 导入用户信息
100
     */
101
    @ResponseBody
102
    @RequestMapping("/importUserInfo")
103
    public JMap importUserInfo(JMap params) throws Exception {
104
        boolean flag=false;
105
        if(params.getInt("MAP_TAG_ID")!=0){
106
            //flag=  userManageService.importUserInfo(params);
107
        }
108
        JMap result = new JsonMap();
109
        result.put("result", flag);
110
        return result;
111
    }
112
113
    /**
114
     * 关联终端
115
     */
116
    @ResponseBody
117
    @RequestMapping("/associatTerminal")
118
    public JMap associatTerminal(JMap params) throws Exception {
119
        boolean flag=false;
120
        if(params.getInt("MAP_TAG_ID")!=0){
121
            //flag=  userManageService.associatTerminal(params);
122
        }
123
        JMap result = new JsonMap();
124
        result.put("result", flag);
125
        return result;
126
    }
127
128
    /**
129
     * 解绑终端
130
     */
131
    @ResponseBody
132
    @RequestMapping("/unbundTerminal")
133
    public JMap unbundTerminal(JMap params) throws Exception {
134
        boolean flag=false;
135
        if(params.getInt("MAP_TAG_ID")!=0){
136
            //flag=  userManageService.unbundTerminal(params);
137
        }
138
        JMap result = new JsonMap();
139
        result.put("result", flag);
140
        return result;
141
    }
142
}

+ 97 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/impl/CallRescuerDaoImpl.java

@ -0,0 +1,97 @@
1
package com.ai.ipu.server.dao.impl;
2
3
import com.ai.ipu.data.JList;
4
import com.ai.ipu.data.JMap;
5
import com.ai.ipu.data.impl.JsonList;
6
import com.ai.ipu.data.impl.JsonMap;
7
import com.ai.ipu.server.dao.interfaces.CallRescuerDao;
8
import com.ai.ipu.sql.mgmt.ISqlMgmtDao;
9
import com.ai.ipu.sql.mgmt.SqlMgmtDaoFactory;
10
import com.alibaba.fastjson.JSON;
11
import com.alibaba.fastjson.JSONObject;
12
import com.github.pagehelper.PageHelper;
13
import com.github.pagehelper.PageInfo;
14
import org.springframework.stereotype.Component;
15
16
import java.util.ArrayList;
17
import java.util.HashMap;
18
import java.util.List;
19
import java.util.Map;
20
21
@Component
22
public class CallRescuerDaoImpl implements CallRescuerDao {
23
24
    private String connName = "ebc";
25
26
    @Override
27
    public PageInfo queryCallRescuerInfo(JMap params) throws Exception {
28
        JMap params1 = params.getJMap("params");
29
        PageHelper.startPage(params1.getInt("pageNum"),params1.getInt("pageSize"));
30
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
31
        List<Map<String, Object>> mapTagList= dao.executeSelect("ipu.CallRescuerDao", "queryCallRescuerInfo", params1);
32
33
        List<Map<String, Object>> mapTagXyList= dao.executeSelect("ipu.CallRescuerDao", "queryCallRescuerXyInfo", params1);
34
35
        //将后台拼接成级联属性
36
        mapTagList.forEach((mapTag)->{
37
            ArrayList<Object> arrayList = new ArrayList<>();
38
            mapTagXyList.forEach((mapTagXy)->{
39
                if(mapTag.get("MAP_TAG_ID")==mapTagXy.get("MAP_TAG_ID")){
40
                    arrayList.add(mapTagXy);
41
                    System.out.println(arrayList.toString());
42
                }
43
            });
44
            mapTag.put("EBC_MAP_TAG_XY",arrayList);
45
        });
46
        PageInfo pageInfo = new PageInfo(mapTagList);
47
        return pageInfo;
48
49
    }
50
51
    @Override
52
    public int modifyCallRescuerInfo (JMap params) throws Exception {
53
54
        deleteCallRescuerXyInfo(params);
55
        //将新数据插入
56
        int num = addCallRescuerInfo(params);
57
        return num;
58
    }
59
60
    @Override
61
    public int addCallRescuerInfo(JMap params) throws Exception {
62
        Object mapTagContent = params.get("MAP_TAG_CONTENT");
63
        String mapTagContentStr = JSONObject.toJSONString(mapTagContent);
64
        params.put("MAP_TAG_CONTENT",mapTagContentStr);
65
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
66
        int num = dao.executeInsert("ipu.CallRescuerManageDao", "addCallRescuerInfo", params);
67
        if(num>0){
68
            JMap paramsMap=new JsonMap();
69
            JList paramsList=new JsonList();
70
            JList paramsJList = params.getJList("EBC_MAP_TAG_XY");
71
72
            paramsJList.forEach(s->{
73
                HashMap hashMap = JSON.parseObject(JSONObject.toJSONString(s), HashMap.class);
74
                hashMap.put("MAP_TAG_ID",params.getInt("MAP_TAG_ID"));
75
                paramsList.add(hashMap);
76
            });
77
            paramsMap.put("paramsList",paramsList);
78
            int i = dao.executeInsert("ipu.CallRescuerDao", "addCallRescuerxyInfo", paramsMap);
79
        }
80
        return num;
81
    }
82
83
    @Override
84
    public boolean deleteCallRescuerXyInfo(JMap params) throws Exception {
85
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
86
        //先删除子表在删除父表
87
        dao.executeDelete( "ipu.CallRescuerDao", "deleteCallRescuerXyInfo", params);
88
        int num = dao.executeDelete("ipu.CallRescuerDao", "deleteCallRescuerInfo", params);
89
        if(num>0){
90
            return true;
91
        }
92
        return false;
93
    }
94
95
96
97
}

+ 97 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/impl/DeviceManageDaoImpl.java

@ -0,0 +1,97 @@
1
package com.ai.ipu.server.dao.impl;
2
3
import com.ai.ipu.data.JList;
4
import com.ai.ipu.data.JMap;
5
import com.ai.ipu.data.impl.JsonList;
6
import com.ai.ipu.data.impl.JsonMap;
7
import com.ai.ipu.server.dao.interfaces.DeviceManageDao;
8
import com.ai.ipu.sql.mgmt.ISqlMgmtDao;
9
import com.ai.ipu.sql.mgmt.SqlMgmtDaoFactory;
10
import com.alibaba.fastjson.JSON;
11
import com.alibaba.fastjson.JSONObject;
12
import com.github.pagehelper.PageHelper;
13
import com.github.pagehelper.PageInfo;
14
import org.springframework.stereotype.Component;
15
16
import java.util.ArrayList;
17
import java.util.HashMap;
18
import java.util.List;
19
import java.util.Map;
20
21
@Component
22
public class DeviceManageDaoImpl implements DeviceManageDao {
23
24
    private String connName = "ebc";
25
26
    @Override
27
    public PageInfo queryDeviceInfo(JMap params) throws Exception {
28
        JMap params1 = params.getJMap("params");
29
        PageHelper.startPage(params1.getInt("pageNum"),params1.getInt("pageSize"));
30
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
31
        List<Map<String, Object>> mapTagList= dao.executeSelect("ipu.DeviceManageDao", "queryDeviceInfo", params1);
32
33
        List<Map<String, Object>> mapTagXyList= dao.executeSelect("ipu.DeviceManageDao", "queryDeviceXyInfo", params1);
34
35
        //将后台拼接成级联属性
36
        mapTagList.forEach((mapTag)->{
37
            ArrayList<Object> arrayList = new ArrayList<>();
38
            mapTagXyList.forEach((mapTagXy)->{
39
                if(mapTag.get("MAP_TAG_ID")==mapTagXy.get("MAP_TAG_ID")){
40
                    arrayList.add(mapTagXy);
41
                    System.out.println(arrayList.toString());
42
                }
43
            });
44
            mapTag.put("EBC_MAP_TAG_XY",arrayList);
45
        });
46
        PageInfo pageInfo = new PageInfo(mapTagList);
47
        return pageInfo;
48
49
    }
50
51
    @Override
52
    public int modifyDeviceInfo (JMap params) throws Exception {
53
54
        deleteDeviceXyInfo(params);
55
        //将新数据插入
56
        int num = addDeviceInfo(params);
57
        return num;
58
    }
59
60
    @Override
61
    public int addDeviceInfo(JMap params) throws Exception {
62
        Object mapTagContent = params.get("MAP_TAG_CONTENT");
63
        String mapTagContentStr = JSONObject.toJSONString(mapTagContent);
64
        params.put("MAP_TAG_CONTENT",mapTagContentStr);
65
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
66
        int num = dao.executeInsert("ipu.DeviceManageDao", "addDeviceInfo", params);
67
        if(num>0){
68
            JMap paramsMap=new JsonMap();
69
            JList paramsList=new JsonList();
70
            JList paramsJList = params.getJList("EBC_MAP_TAG_XY");
71
72
            paramsJList.forEach(s->{
73
                HashMap hashMap = JSON.parseObject(JSONObject.toJSONString(s), HashMap.class);
74
                hashMap.put("MAP_TAG_ID",params.getInt("MAP_TAG_ID"));
75
                paramsList.add(hashMap);
76
            });
77
            paramsMap.put("paramsList",paramsList);
78
            int i = dao.executeInsert("ipu.DeviceManageDao", "addDevicexyInfo", paramsMap);
79
        }
80
        return num;
81
    }
82
83
    @Override
84
    public boolean deleteDeviceXyInfo(JMap params) throws Exception {
85
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
86
        //先删除子表在删除父表
87
        dao.executeDelete( "ipu.DeviceManageDao", "deleteDeviceXyInfo", params);
88
        int num = dao.executeDelete("ipu.DeviceManageDao", "deleteDeviceInfo", params);
89
        if(num>0){
90
            return true;
91
        }
92
        return false;
93
    }
94
95
96
97
}

+ 97 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/impl/EquipmentManageDaoImpl.java

@ -0,0 +1,97 @@
1
package com.ai.ipu.server.dao.impl;
2
3
import com.ai.ipu.data.JList;
4
import com.ai.ipu.data.JMap;
5
import com.ai.ipu.data.impl.JsonList;
6
import com.ai.ipu.data.impl.JsonMap;
7
import com.ai.ipu.server.dao.interfaces.EquipmentManageDao;
8
import com.ai.ipu.sql.mgmt.ISqlMgmtDao;
9
import com.ai.ipu.sql.mgmt.SqlMgmtDaoFactory;
10
import com.alibaba.fastjson.JSON;
11
import com.alibaba.fastjson.JSONObject;
12
import com.github.pagehelper.PageHelper;
13
import com.github.pagehelper.PageInfo;
14
import org.springframework.stereotype.Component;
15
16
import java.util.ArrayList;
17
import java.util.HashMap;
18
import java.util.List;
19
import java.util.Map;
20
21
@Component
22
public class EquipmentManageDaoImpl implements EquipmentManageDao {
23
24
    private String connName = "ebc";
25
26
    @Override
27
    public PageInfo queryEquipmentInfo(JMap params) throws Exception {
28
        JMap params1 = params.getJMap("params");
29
        PageHelper.startPage(params1.getInt("pageNum"),params1.getInt("pageSize"));
30
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
31
        List<Map<String, Object>> mapTagList= dao.executeSelect("ipu.EquipmentManageDao", "queryEquipmentInfo", params1);
32
33
        List<Map<String, Object>> mapTagXyList= dao.executeSelect("ipu.EquipmentManageDao", "queryEquipmentXyInfo", params1);
34
35
        //将后台拼接成级联属性
36
        mapTagList.forEach((mapTag)->{
37
            ArrayList<Object> arrayList = new ArrayList<>();
38
            mapTagXyList.forEach((mapTagXy)->{
39
                if(mapTag.get("MAP_TAG_ID")==mapTagXy.get("MAP_TAG_ID")){
40
                    arrayList.add(mapTagXy);
41
                    System.out.println(arrayList.toString());
42
                }
43
            });
44
            mapTag.put("EBC_MAP_TAG_XY",arrayList);
45
        });
46
        PageInfo pageInfo = new PageInfo(mapTagList);
47
        return pageInfo;
48
49
    }
50
51
    @Override
52
    public int modifyEquipmentInfo (JMap params) throws Exception {
53
54
        deleteEquipmentXyInfo(params);
55
        //将新数据插入
56
        int num = addEquipmentInfo(params);
57
        return num;
58
    }
59
60
    @Override
61
    public int addEquipmentInfo(JMap params) throws Exception {
62
        Object mapTagContent = params.get("MAP_TAG_CONTENT");
63
        String mapTagContentStr = JSONObject.toJSONString(mapTagContent);
64
        params.put("MAP_TAG_CONTENT",mapTagContentStr);
65
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
66
        int num = dao.executeInsert("ipu.EquipmentManageDao", "addEquipmentInfo", params);
67
        if(num>0){
68
            JMap paramsMap=new JsonMap();
69
            JList paramsList=new JsonList();
70
            JList paramsJList = params.getJList("EBC_MAP_TAG_XY");
71
72
            paramsJList.forEach(s->{
73
                HashMap hashMap = JSON.parseObject(JSONObject.toJSONString(s), HashMap.class);
74
                hashMap.put("MAP_TAG_ID",params.getInt("MAP_TAG_ID"));
75
                paramsList.add(hashMap);
76
            });
77
            paramsMap.put("paramsList",paramsList);
78
            int i = dao.executeInsert("ipu.EquipmentManageDao", "addEquipmentxyInfo", paramsMap);
79
        }
80
        return num;
81
    }
82
83
    @Override
84
    public boolean deleteEquipmentXyInfo(JMap params) throws Exception {
85
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
86
        //先删除子表在删除父表
87
        dao.executeDelete( "ipu.EquipmentManageDao", "deleteEquipmentXyInfo", params);
88
        int num = dao.executeDelete("ipu.EquipmentManageDao", "deleteEquipmentInfo", params);
89
        if(num>0){
90
            return true;
91
        }
92
        return false;
93
    }
94
95
96
97
}

+ 30 - 2
ipu-demo/src/main/java/com/ai/ipu/server/dao/impl/MapTagManageDaoImpl.java

@ -14,6 +14,7 @@ import com.github.pagehelper.PageInfo;
14 14
import org.mapstruct.Mapper;
15 15
import org.springframework.stereotype.Component;
16 16
17
import java.util.ArrayList;
17 18
import java.util.HashMap;
18 19
import java.util.List;
19 20
import java.util.Map;
@ -30,6 +31,19 @@ public class MapTagManageDaoImpl implements MapTagManageDao {
30 31
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
31 32
        List<Map<String, Object>> mapTagList= dao.executeSelect("ipu.MapTagManageDao", "queryMapTagInfo", params1);
32 33
34
        List<Map<String, Object>> mapTagXyList= dao.executeSelect("ipu.MapTagManageDao", "queryMapTagXyInfo", params1);
35
36
        //将后台拼接成级联属性
37
        mapTagList.forEach((mapTag)->{
38
            ArrayList<Object> arrayList = new ArrayList<>();
39
            mapTagXyList.forEach((mapTagXy)->{
40
                if(mapTag.get("MAP_TAG_ID")==mapTagXy.get("MAP_TAG_ID")){
41
                    arrayList.add(mapTagXy);
42
                    System.out.println(arrayList.toString());
43
                }
44
            });
45
            mapTag.put("EBC_MAP_TAG_XY",arrayList);
46
        });
33 47
        PageInfo pageInfo = new PageInfo(mapTagList);
34 48
        return pageInfo;
35 49
@ -38,8 +52,9 @@ public class MapTagManageDaoImpl implements MapTagManageDao {
38 52
    @Override
39 53
    public int modifyMapTagInfo (JMap params) throws Exception {
40 54
41
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
42
        int num = dao.executeUpdate("ipu.MapTagManageDao", "modifyMapTagInfo", params);
55
        deleteMapTagXyInfo(params);
56
        //将新数据插入
57
        int num = addMapTagInfo(params);
43 58
        return num;
44 59
    }
45 60
@ -66,5 +81,18 @@ public class MapTagManageDaoImpl implements MapTagManageDao {
66 81
        return num;
67 82
    }
68 83
84
    @Override
85
    public boolean deleteMapTagXyInfo(JMap params) throws Exception {
86
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
87
        //先删除子表在删除父表
88
        dao.executeDelete( "ipu.MapTagManageDao", "deleteMapTagXyInfo", params);
89
        int num = dao.executeDelete("ipu.MapTagManageDao", "deleteMapTagInfo", params);
90
        if(num>0){
91
            return true;
92
        }
93
        return false;
94
    }
95
96
69 97
70 98
}

+ 97 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/impl/UserManageDaoImpl.java

@ -0,0 +1,97 @@
1
package com.ai.ipu.server.dao.impl;
2
3
import com.ai.ipu.data.JList;
4
import com.ai.ipu.data.JMap;
5
import com.ai.ipu.data.impl.JsonList;
6
import com.ai.ipu.data.impl.JsonMap;
7
import com.ai.ipu.server.dao.interfaces.UserManageDao;
8
import com.ai.ipu.sql.mgmt.ISqlMgmtDao;
9
import com.ai.ipu.sql.mgmt.SqlMgmtDaoFactory;
10
import com.alibaba.fastjson.JSON;
11
import com.alibaba.fastjson.JSONObject;
12
import com.github.pagehelper.PageHelper;
13
import com.github.pagehelper.PageInfo;
14
import org.springframework.stereotype.Component;
15
16
import java.util.ArrayList;
17
import java.util.HashMap;
18
import java.util.List;
19
import java.util.Map;
20
21
@Component
22
public class UserManageDaoImpl implements UserManageDao {
23
24
    private String connName = "ebc";
25
26
    @Override
27
    public PageInfo queryUserInfo(JMap params) throws Exception {
28
        JMap params1 = params.getJMap("params");
29
        PageHelper.startPage(params1.getInt("pageNum"),params1.getInt("pageSize"));
30
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
31
        List<Map<String, Object>> mapTagList= dao.executeSelect("ipu.UserManageDao", "queryUserInfo", params1);
32
33
        List<Map<String, Object>> mapTagXyList= dao.executeSelect("ipu.UserManageDao", "queryUserXyInfo", params1);
34
35
        //将后台拼接成级联属性
36
        mapTagList.forEach((mapTag)->{
37
            ArrayList<Object> arrayList = new ArrayList<>();
38
            mapTagXyList.forEach((mapTagXy)->{
39
                if(mapTag.get("MAP_TAG_ID")==mapTagXy.get("MAP_TAG_ID")){
40
                    arrayList.add(mapTagXy);
41
                    System.out.println(arrayList.toString());
42
                }
43
            });
44
            mapTag.put("EBC_MAP_TAG_XY",arrayList);
45
        });
46
        PageInfo pageInfo = new PageInfo(mapTagList);
47
        return pageInfo;
48
49
    }
50
51
    @Override
52
    public int modifyUserInfo (JMap params) throws Exception {
53
54
        deleteUserXyInfo(params);
55
        //将新数据插入
56
        int num = addUserInfo(params);
57
        return num;
58
    }
59
60
    @Override
61
    public int addUserInfo(JMap params) throws Exception {
62
        Object mapTagContent = params.get("MAP_TAG_CONTENT");
63
        String mapTagContentStr = JSONObject.toJSONString(mapTagContent);
64
        params.put("MAP_TAG_CONTENT",mapTagContentStr);
65
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
66
        int num = dao.executeInsert("ipu.UserManageDao", "addUserInfo", params);
67
        if(num>0){
68
            JMap paramsMap=new JsonMap();
69
            JList paramsList=new JsonList();
70
            JList paramsJList = params.getJList("EBC_MAP_TAG_XY");
71
72
            paramsJList.forEach(s->{
73
                HashMap hashMap = JSON.parseObject(JSONObject.toJSONString(s), HashMap.class);
74
                hashMap.put("MAP_TAG_ID",params.getInt("MAP_TAG_ID"));
75
                paramsList.add(hashMap);
76
            });
77
            paramsMap.put("paramsList",paramsList);
78
            int i = dao.executeInsert("ipu.UserManageDao", "addUserxyInfo", paramsMap);
79
        }
80
        return num;
81
    }
82
83
    @Override
84
    public boolean deleteUserXyInfo(JMap params) throws Exception {
85
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
86
        //先删除子表在删除父表
87
        dao.executeDelete( "ipu.UserManageDao", "deleteUserXyInfo", params);
88
        int num = dao.executeDelete("ipu.UserManageDao", "deleteUserInfo", params);
89
        if(num>0){
90
            return true;
91
        }
92
        return false;
93
    }
94
95
96
97
}

+ 15 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/interfaces/CallRescuerDao.java

@ -0,0 +1,15 @@
1
package com.ai.ipu.server.dao.interfaces;
2
3
import com.ai.ipu.data.JMap;
4
import com.github.pagehelper.PageInfo;
5
6
public interface CallRescuerDao {
7
8
    PageInfo queryCallRescuerInfo(JMap params) throws Exception;
9
10
    int modifyCallRescuerInfo(JMap params) throws Exception;
11
12
    int addCallRescuerInfo(JMap params) throws Exception;
13
14
    boolean deleteCallRescuerXyInfo(JMap params) throws Exception;
15
}

+ 15 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/interfaces/DeviceManageDao.java

@ -0,0 +1,15 @@
1
package com.ai.ipu.server.dao.interfaces;
2
3
import com.ai.ipu.data.JMap;
4
import com.github.pagehelper.PageInfo;
5
6
public interface DeviceManageDao {
7
8
    PageInfo queryDeviceInfo(JMap params) throws Exception;
9
10
    int modifyDeviceInfo(JMap params) throws Exception;
11
12
    int addDeviceInfo(JMap params) throws Exception;
13
14
    boolean deleteDeviceXyInfo(JMap params) throws Exception;
15
}

+ 15 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/interfaces/EquipmentManageDao.java

@ -0,0 +1,15 @@
1
package com.ai.ipu.server.dao.interfaces;
2
3
import com.ai.ipu.data.JMap;
4
import com.github.pagehelper.PageInfo;
5
6
public interface EquipmentManageDao {
7
8
    PageInfo queryEquipmentInfo(JMap params) throws Exception;
9
10
    int modifyEquipmentInfo(JMap params) throws Exception;
11
12
    int addEquipmentInfo(JMap params) throws Exception;
13
14
    boolean deleteEquipmentXyInfo(JMap params) throws Exception;
15
}

+ 2 - 0
ipu-demo/src/main/java/com/ai/ipu/server/dao/interfaces/MapTagManageDao.java

@ -14,4 +14,6 @@ public interface MapTagManageDao {
14 14
    int modifyMapTagInfo(JMap params) throws Exception;
15 15
16 16
    int addMapTagInfo(JMap params) throws Exception;
17
18
    boolean deleteMapTagXyInfo(JMap params) throws Exception;
17 19
}

+ 15 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/interfaces/UserManageDao.java

@ -0,0 +1,15 @@
1
package com.ai.ipu.server.dao.interfaces;
2
3
import com.ai.ipu.data.JMap;
4
import com.github.pagehelper.PageInfo;
5
6
public interface UserManageDao {
7
8
    PageInfo queryUserInfo(JMap params) throws Exception;
9
10
    int modifyUserInfo(JMap params) throws Exception;
11
12
    int addUserInfo(JMap params) throws Exception;
13
14
    boolean deleteUserXyInfo(JMap params) throws Exception;
15
}

ipu-demo/src/main/java/com/ai/ipu/server/handler/AuthHandler.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/handler/AuthHandler.java


ipu-demo/src/main/java/com/ai/ipu/server/handler/HandlerManager.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/handler/HandlerManager.java


ipu-demo/src/main/java/com/ai/ipu/server/model/Caller.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/model/Caller.java


ipu-demo/src/main/java/com/ai/ipu/server/model/Department.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/model/Department.java


ipu-demo/src/main/java/com/ai/ipu/server/model/MapTag.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/model/MapTag.java


ipu-demo/src/main/java/com/ai/ipu/server/model/MapTagXY.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/model/MapTagXY.java


ipu-demo/src/main/java/com/ai/ipu/server/model/PartyDevice.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/model/PartyDevice.java


ipu-demo/src/main/java/com/ai/ipu/server/model/Rescuers.java → ebc-sea-platform/src/main/java/com/ai/ipu/server/model/Rescuers.java


+ 8 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/model/UrlAddress.java

@ -0,0 +1,8 @@
1
package com.ai.ipu.server.model;
2
3
public interface UrlAddress {
4
5
    public static final String IOT_URL="http://60.205.219.67:8300/dmp/terminalNorthApi/";
6
7
    public static final String IOT_LOGIN="http://60.205.219.67:8300/sso/login";
8
}

+ 146 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/CallRescuerServiceImpl.java

@ -0,0 +1,146 @@
1
package com.ai.ipu.server.service.impl;
2
3
import com.ai.ipu.data.JMap;
4
import com.ai.ipu.server.controller.BaseFrontController;
5
import com.ai.ipu.server.dao.interfaces.CallRescuerDao;
6
import com.ai.ipu.server.service.interfaces.ExportService;
7
import com.ai.ipu.server.service.interfaces.CallRescuerService;
8
import com.ai.ipu.server.util.ExcelFormatUtil;
9
import com.github.pagehelper.PageInfo;
10
import org.apache.poi.ss.usermodel.CellStyle;
11
import org.apache.poi.xssf.streaming.SXSSFCell;
12
import org.apache.poi.xssf.streaming.SXSSFRow;
13
import org.apache.poi.xssf.streaming.SXSSFSheet;
14
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
15
import org.slf4j.Logger;
16
import org.slf4j.LoggerFactory;
17
import org.springframework.beans.factory.annotation.Autowired;
18
import org.springframework.http.ResponseEntity;
19
import org.springframework.stereotype.Service;
20
21
import javax.servlet.http.HttpServletRequest;
22
import javax.servlet.http.HttpServletResponse;
23
import java.io.ByteArrayInputStream;
24
import java.io.ByteArrayOutputStream;
25
import java.io.IOException;
26
import java.io.InputStream;
27
import java.util.List;
28
import java.util.Map;
29
30
@Service("CallRescuerServiceImpl")
31
public class CallRescuerServiceImpl implements CallRescuerService , ExportService {
32
    Logger logger = LoggerFactory.getLogger(CallRescuerServiceImpl.class);
33
34
    @Autowired
35
    CallRescuerDao callRescuerManageDao;
36
37
    @Override
38
    public PageInfo queryCallRescuerInfo(JMap params) throws Exception {
39
        return callRescuerManageDao.queryCallRescuerInfo(params);
40
    }
41
42
    @Override
43
    public int modifyCallRescuerInfo(JMap params) throws Exception{
44
        //將原來数据删除,然后在从新插入
45
        return callRescuerManageDao.modifyCallRescuerInfo(params);
46
    }
47
48
    @Override
49
    public int addCallRescuerInfo(JMap params) throws Exception{
50
        return callRescuerManageDao.addCallRescuerInfo(params);
51
    }
52
53
    @Override
54
    public boolean deleteCallRescuerXyInfo(JMap params) throws Exception{
55
        return callRescuerManageDao.deleteCallRescuerXyInfo(params);
56
    }
57
58
    @Override
59
    public ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response,Object object) {
60
        try {
61
            logger.info(">>>>>>>>>>开始导出excel>>>>>>>>>>");
62
            JMap object1 = (JMap) object;
63
            JMap params1 = object1.getJMap("params");
64
65
            params1.put("pageNum",0 );
66
            params1.put("pageSize",0 );
67
            // 查询数据
68
69
70
            PageInfo pageInfo = queryCallRescuerInfo(object1);
71
            List<JMap> CallRescuerList = pageInfo.getList();
72
            //设置表格名字
73
            String strName="终端导出表.xls";
74
            BaseFrontController baseFrontController = new BaseFrontController();
75
            return baseFrontController.buildResponseEntity(export(CallRescuerList), strName);
76
        } catch (Exception e) {
77
            e.printStackTrace();
78
            logger.error(">>>>>>>>>>导出excel 异常,原因为:" + e.getMessage());
79
        }
80
        return null;
81
    }
82
    private InputStream export(List<JMap> list) {
83
        logger.info(">>>>>>>>>>>>>>>>>>>>开始进入导出方法>>>>>>>>>>");
84
        ByteArrayOutputStream output = null;
85
        InputStream inputStream1 = null;
86
        SXSSFWorkbook wb = new SXSSFWorkbook(1000);// 保留1000条数据在内存中
87
        SXSSFSheet sheet = wb.createSheet();
88
        // 设置报表头样式
89
        CellStyle header = ExcelFormatUtil.headSytle(wb);// cell样式
90
        CellStyle content = ExcelFormatUtil.contentStyle(wb);// 报表体样式
91
92
        // 每一列字段名
93
        String[] strs = new String[] { "标记名称", "类型", "创建时间"};
94
95
        // 字段名所在表格的宽度
96
        int[] ints = new int[] { 5000, 5000, 5000, 5000, 5000, 5000 };
97
98
        // 设置表头样式
99
        ExcelFormatUtil.initTitleEX(sheet, header, strs, ints);
100
        logger.info(">>>>>>>>>>>>>>>>>>>>表头样式设置完成>>>>>>>>>>");
101
102
        if (list != null && list.size() > 0) {
103
            logger.info(">>>>>>>>>>>>>>>>>>>>开始遍历数据组装单元格内容>>>>>>>>>>");
104
105
            for (int i = 0; i < list.size(); i++) {
106
                Map CallRescuerJMap = list.get(i);
107
                SXSSFRow row = sheet.createRow(i + 1);
108
                int j = 0;
109
110
                SXSSFCell cell = row.createCell(j++);
111
                cell.setCellValue(CallRescuerJMap.get("MAP_TAG_NAME").toString()); // 标记名称
112
                cell.setCellStyle(content);
113
114
                cell = row.createCell(j++);
115
                cell.setCellValue(CallRescuerJMap.get("MAP_TAG_TYPE").toString()); // 类型
116
                cell.setCellStyle(content);
117
118
                cell = row.createCell(j++);
119
                String createDate = CallRescuerJMap.get("CREATE_DATE").toString();
120
                cell.setCellValue(createDate.substring(0,createDate.length()-2)); // 创建时间
121
                cell.setCellStyle(content);
122
123
            }
124
            logger.info(">>>>>>>>>>>>>>>>>>>>结束遍历数据组装单元格内容>>>>>>>>>>");
125
        }
126
        try {
127
            output = new ByteArrayOutputStream();
128
            wb.write(output);
129
            inputStream1 = new ByteArrayInputStream(output.toByteArray());
130
            output.flush();
131
        } catch (Exception e) {
132
            e.printStackTrace();
133
        } finally {
134
            try {
135
                if (output != null) {
136
                    output.close();
137
                    if (inputStream1 != null)
138
                        inputStream1.close();
139
                }
140
            } catch (IOException e) {
141
                e.printStackTrace();
142
            }
143
        }
144
        return inputStream1;
145
    }
146
}

+ 146 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/DeviceManageServiceImpl.java

@ -0,0 +1,146 @@
1
package com.ai.ipu.server.service.impl;
2
3
import com.ai.ipu.data.JMap;
4
import com.ai.ipu.server.controller.BaseFrontController;
5
import com.ai.ipu.server.dao.interfaces.DeviceManageDao;
6
import com.ai.ipu.server.service.interfaces.ExportService;
7
import com.ai.ipu.server.service.interfaces.DeviceManageService;
8
import com.ai.ipu.server.util.ExcelFormatUtil;
9
import com.github.pagehelper.PageInfo;
10
import org.apache.poi.ss.usermodel.CellStyle;
11
import org.apache.poi.xssf.streaming.SXSSFCell;
12
import org.apache.poi.xssf.streaming.SXSSFRow;
13
import org.apache.poi.xssf.streaming.SXSSFSheet;
14
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
15
import org.slf4j.Logger;
16
import org.slf4j.LoggerFactory;
17
import org.springframework.beans.factory.annotation.Autowired;
18
import org.springframework.http.ResponseEntity;
19
import org.springframework.stereotype.Service;
20
21
import javax.servlet.http.HttpServletRequest;
22
import javax.servlet.http.HttpServletResponse;
23
import java.io.ByteArrayInputStream;
24
import java.io.ByteArrayOutputStream;
25
import java.io.IOException;
26
import java.io.InputStream;
27
import java.util.List;
28
import java.util.Map;
29
30
@Service("DeviceManageServiceImpl")
31
public class DeviceManageServiceImpl implements DeviceManageService , ExportService {
32
    Logger logger = LoggerFactory.getLogger(DeviceManageServiceImpl.class);
33
34
    @Autowired
35
    DeviceManageDao deviceManageDao;
36
37
    @Override
38
    public PageInfo queryDeviceInfo(JMap params) throws Exception {
39
        return deviceManageDao.queryDeviceInfo(params);
40
    }
41
42
    @Override
43
    public int modifyDeviceInfo(JMap params) throws Exception{
44
        //將原來数据删除,然后在从新插入
45
        return deviceManageDao.modifyDeviceInfo(params);
46
    }
47
48
    @Override
49
    public int addDeviceInfo(JMap params) throws Exception{
50
        return deviceManageDao.addDeviceInfo(params);
51
    }
52
53
    @Override
54
    public boolean deleteDeviceXyInfo(JMap params) throws Exception{
55
        return deviceManageDao.deleteDeviceXyInfo(params);
56
    }
57
58
    @Override
59
    public ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response,Object object) {
60
        try {
61
            logger.info(">>>>>>>>>>开始导出excel>>>>>>>>>>");
62
            JMap object1 = (JMap) object;
63
            JMap params1 = object1.getJMap("params");
64
65
            params1.put("pageNum",0 );
66
            params1.put("pageSize",0 );
67
            // 查询数据
68
69
70
            PageInfo pageInfo = queryDeviceInfo(object1);
71
            List<JMap> DeviceList = pageInfo.getList();
72
            //设置表格名字
73
            String strName="终端导出表.xls";
74
            BaseFrontController baseFrontController = new BaseFrontController();
75
            return baseFrontController.buildResponseEntity(export(DeviceList), strName);
76
        } catch (Exception e) {
77
            e.printStackTrace();
78
            logger.error(">>>>>>>>>>导出excel 异常,原因为:" + e.getMessage());
79
        }
80
        return null;
81
    }
82
    private InputStream export(List<JMap> list) {
83
        logger.info(">>>>>>>>>>>>>>>>>>>>开始进入导出方法>>>>>>>>>>");
84
        ByteArrayOutputStream output = null;
85
        InputStream inputStream1 = null;
86
        SXSSFWorkbook wb = new SXSSFWorkbook(1000);// 保留1000条数据在内存中
87
        SXSSFSheet sheet = wb.createSheet();
88
        // 设置报表头样式
89
        CellStyle header = ExcelFormatUtil.headSytle(wb);// cell样式
90
        CellStyle content = ExcelFormatUtil.contentStyle(wb);// 报表体样式
91
92
        // 每一列字段名
93
        String[] strs = new String[] { "标记名称", "类型", "创建时间"};
94
95
        // 字段名所在表格的宽度
96
        int[] ints = new int[] { 5000, 5000, 5000, 5000, 5000, 5000 };
97
98
        // 设置表头样式
99
        ExcelFormatUtil.initTitleEX(sheet, header, strs, ints);
100
        logger.info(">>>>>>>>>>>>>>>>>>>>表头样式设置完成>>>>>>>>>>");
101
102
        if (list != null && list.size() > 0) {
103
            logger.info(">>>>>>>>>>>>>>>>>>>>开始遍历数据组装单元格内容>>>>>>>>>>");
104
105
            for (int i = 0; i < list.size(); i++) {
106
                Map DeviceJMap = list.get(i);
107
                SXSSFRow row = sheet.createRow(i + 1);
108
                int j = 0;
109
110
                SXSSFCell cell = row.createCell(j++);
111
                cell.setCellValue(DeviceJMap.get("MAP_TAG_NAME").toString()); // 标记名称
112
                cell.setCellStyle(content);
113
114
                cell = row.createCell(j++);
115
                cell.setCellValue(DeviceJMap.get("MAP_TAG_TYPE").toString()); // 类型
116
                cell.setCellStyle(content);
117
118
                cell = row.createCell(j++);
119
                String createDate = DeviceJMap.get("CREATE_DATE").toString();
120
                cell.setCellValue(createDate.substring(0,createDate.length()-2)); // 创建时间
121
                cell.setCellStyle(content);
122
123
            }
124
            logger.info(">>>>>>>>>>>>>>>>>>>>结束遍历数据组装单元格内容>>>>>>>>>>");
125
        }
126
        try {
127
            output = new ByteArrayOutputStream();
128
            wb.write(output);
129
            inputStream1 = new ByteArrayInputStream(output.toByteArray());
130
            output.flush();
131
        } catch (Exception e) {
132
            e.printStackTrace();
133
        } finally {
134
            try {
135
                if (output != null) {
136
                    output.close();
137
                    if (inputStream1 != null)
138
                        inputStream1.close();
139
                }
140
            } catch (IOException e) {
141
                e.printStackTrace();
142
            }
143
        }
144
        return inputStream1;
145
    }
146
}

+ 232 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/EquipmentManageServiceImpl.java

@ -0,0 +1,232 @@
1
package com.ai.ipu.server.service.impl;
2
3
import com.ai.ipu.data.JMap;
4
import com.ai.ipu.server.controller.BaseFrontController;
5
import com.ai.ipu.server.dao.interfaces.EquipmentManageDao;
6
import com.ai.ipu.server.model.UrlAddress;
7
import com.ai.ipu.server.service.interfaces.ExportService;
8
import com.ai.ipu.server.service.interfaces.EquipmentManageService;
9
import com.ai.ipu.server.util.ExcelFormatUtil;
10
import com.ai.ipu.server.util.HttpURLConnectionUtil;
11
import com.alibaba.fastjson.JSON;
12
import com.github.pagehelper.PageInfo;
13
import org.apache.poi.ss.usermodel.CellStyle;
14
import org.apache.poi.xssf.streaming.SXSSFCell;
15
import org.apache.poi.xssf.streaming.SXSSFRow;
16
import org.apache.poi.xssf.streaming.SXSSFSheet;
17
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
18
import org.slf4j.Logger;
19
import org.slf4j.LoggerFactory;
20
import org.springframework.beans.factory.annotation.Autowired;
21
import org.springframework.http.ResponseEntity;
22
import org.springframework.stereotype.Service;
23
24
import javax.servlet.http.HttpServletRequest;
25
import javax.servlet.http.HttpServletResponse;
26
import java.io.ByteArrayInputStream;
27
import java.io.ByteArrayOutputStream;
28
import java.io.IOException;
29
import java.io.InputStream;
30
import java.util.HashMap;
31
import java.util.List;
32
import java.util.Map;
33
34
@Service("EquipmentManageServiceImpl")
35
public class EquipmentManageServiceImpl implements EquipmentManageService , ExportService {
36
    Logger logger = LoggerFactory.getLogger(EquipmentManageServiceImpl.class);
37
38
    @Autowired
39
    EquipmentManageDao equipmentManageDao;
40
41
    @Override
42
    public PageInfo queryEquipmentInfo(JMap params) throws Exception {
43
        HashMap<String, String> paramHashMap = new HashMap<>();
44
        //调用北向服务的查询接口
45
        //调用登录接口获取sessionId与sign
46
        Map<String, String> result = HttpURLConnectionUtil.iotLogin();
47
        //拼接接口地址
48
        String IOT_URL=UrlAddress.IOT_URL+"device";
49
        //将参数转为json
50
51
        //调用北向服务的查询接口
52
        String s = HttpURLConnectionUtil.doPost(IOT_URL, "",result);
53
        //将返回json转换
54
55
        return equipmentManageDao.queryEquipmentInfo(params);
56
57
    }
58
59
    @Override
60
    public int modifyEquipmentInfo(JMap params) throws Exception{
61
        //调用北向服务的修改接口
62
        //调用登录接口获取sessionId与sign
63
        Map<String, String> result = HttpURLConnectionUtil.iotLogin();
64
        //拼接接口地址
65
        String IOT_URL=UrlAddress.IOT_URL+"";
66
        //将参数转为json
67
68
        //调用北向服务的查询接口
69
        String s = HttpURLConnectionUtil.doPost(IOT_URL, "",result);
70
        //将返回json转换
71
        return equipmentManageDao.modifyEquipmentInfo(params);
72
    }
73
74
    @Override
75
    public int addEquipmentInfo(JMap params) throws Exception{
76
        //调用北向服务的增加接口
77
        //调用登录接口获取sessionId与sign
78
        Map<String, String> result = HttpURLConnectionUtil.iotLogin();
79
        //拼接接口地址
80
        String IOT_URL=UrlAddress.IOT_URL+"";
81
        //将参数转为json
82
83
        //调用北向服务的接口
84
        String s = HttpURLConnectionUtil.doPost(IOT_URL, "",result);
85
        //将返回json转换
86
        return equipmentManageDao.addEquipmentInfo(params);
87
    }
88
89
    @Override
90
    public boolean deleteEquipmentInfo(JMap params) throws Exception{
91
92
        //调用登录接口获取sessionId与sign
93
        Map<String, String> result = HttpURLConnectionUtil.iotLogin();
94
        //拼接接口地址
95
        String IOT_URL=UrlAddress.IOT_URL+"";
96
        //将参数转为json
97
98
        //调用北向服务的删除接口
99
        String s = HttpURLConnectionUtil.doPost(IOT_URL, "",result);
100
        //将返回json转换
101
102
        return equipmentManageDao.deleteEquipmentXyInfo(params);
103
    }
104
105
    @Override
106
    public boolean deleteEquipmentsInfo(JMap params) {
107
        //调用北向服务的批量删除接口
108
        //调用登录接口获取sessionId与sign
109
        Map<String, String> result = HttpURLConnectionUtil.iotLogin();
110
        //拼接接口地址
111
        String IOT_URL=UrlAddress.IOT_URL+"";
112
        //将参数转为json
113
114
        //调用北向服务的查询接口
115
        String s = HttpURLConnectionUtil.doPost(IOT_URL, "",result);
116
        //将返回json转换
117
        return false;
118
    }
119
120
    @Override
121
    public boolean importEquipmentInfo(JMap params) {
122
        //调用北向服务的查询接口
123
        //调用登录接口获取sessionId与sign
124
        Map<String, String> result = HttpURLConnectionUtil.iotLogin();
125
        //拼接接口地址
126
        String IOT_URL=UrlAddress.IOT_URL+"";
127
        //将参数转为json
128
129
        //调用北向服务的查询接口
130
        String s = HttpURLConnectionUtil.doPost(IOT_URL, "",result);
131
        //将返回json转换
132
        return false;
133
    }
134
135
    @Override
136
    public ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response,Object object) {
137
        try {
138
            logger.info(">>>>>>>>>>开始导出excel>>>>>>>>>>");
139
            JMap object1 = (JMap) object;
140
            JMap params1 = object1.getJMap("params");
141
142
            params1.put("pageNum",0 );
143
            params1.put("pageSize",0 );
144
            // 查询数据
145
            //调用北向服务的查询接口
146
            //拼接接口地址
147
            String IOT_URL=UrlAddress.IOT_URL+"";
148
            //将参数转为json
149
            //调用登录接口获取sessionId与sign
150
            Map<String, String> result = HttpURLConnectionUtil.iotLogin();
151
            //调用北向服务的查询接口
152
            String s = HttpURLConnectionUtil.doPost(IOT_URL, "",result);
153
            //将返回json转换
154
            PageInfo pageInfo = queryEquipmentInfo(object1);
155
            List<JMap> EquipmentList = pageInfo.getList();
156
157
158
            //设置表格名字
159
            String strName="设备导出表.xls";
160
            BaseFrontController baseFrontController = new BaseFrontController();
161
            return baseFrontController.buildResponseEntity(export(EquipmentList), strName);
162
        } catch (Exception e) {
163
            e.printStackTrace();
164
            logger.error(">>>>>>>>>>导出excel 异常,原因为:" + e.getMessage());
165
        }
166
        return null;
167
    }
168
    private InputStream export(List<JMap> list) {
169
        logger.info(">>>>>>>>>>>>>>>>>>>>开始进入导出方法>>>>>>>>>>");
170
        ByteArrayOutputStream output = null;
171
        InputStream inputStream1 = null;
172
        SXSSFWorkbook wb = new SXSSFWorkbook(1000);// 保留1000条数据在内存中
173
        SXSSFSheet sheet = wb.createSheet();
174
        // 设置报表头样式
175
        CellStyle header = ExcelFormatUtil.headSytle(wb);// cell样式
176
        CellStyle content = ExcelFormatUtil.contentStyle(wb);// 报表体样式
177
178
        // 每一列字段名
179
        String[] strs = new String[] { "标记名称", "类型", "创建时间"};
180
181
        // 字段名所在表格的宽度
182
        int[] ints = new int[] { 5000, 5000, 5000, 5000, 5000, 5000 };
183
184
        // 设置表头样式
185
        ExcelFormatUtil.initTitleEX(sheet, header, strs, ints);
186
        logger.info(">>>>>>>>>>>>>>>>>>>>表头样式设置完成>>>>>>>>>>");
187
188
        if (list != null && list.size() > 0) {
189
            logger.info(">>>>>>>>>>>>>>>>>>>>开始遍历数据组装单元格内容>>>>>>>>>>");
190
191
            for (int i = 0; i < list.size(); i++) {
192
                Map EquipmentJMap = list.get(i);
193
                SXSSFRow row = sheet.createRow(i + 1);
194
                int j = 0;
195
196
                SXSSFCell cell = row.createCell(j++);
197
                cell.setCellValue(EquipmentJMap.get("MAP_TAG_NAME").toString()); // 标记名称
198
                cell.setCellStyle(content);
199
200
                cell = row.createCell(j++);
201
                cell.setCellValue(EquipmentJMap.get("MAP_TAG_TYPE").toString()); // 类型
202
                cell.setCellStyle(content);
203
204
                cell = row.createCell(j++);
205
                String createDate = EquipmentJMap.get("CREATE_DATE").toString();
206
                cell.setCellValue(createDate.substring(0,createDate.length()-2)); // 创建时间
207
                cell.setCellStyle(content);
208
209
            }
210
            logger.info(">>>>>>>>>>>>>>>>>>>>结束遍历数据组装单元格内容>>>>>>>>>>");
211
        }
212
        try {
213
            output = new ByteArrayOutputStream();
214
            wb.write(output);
215
            inputStream1 = new ByteArrayInputStream(output.toByteArray());
216
            output.flush();
217
        } catch (Exception e) {
218
            e.printStackTrace();
219
        } finally {
220
            try {
221
                if (output != null) {
222
                    output.close();
223
                    if (inputStream1 != null)
224
                        inputStream1.close();
225
                }
226
            } catch (IOException e) {
227
                e.printStackTrace();
228
            }
229
        }
230
        return inputStream1;
231
    }
232
}

+ 149 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/MapTagManageServiceImpl.java

@ -0,0 +1,149 @@
1
package com.ai.ipu.server.service.impl;
2
3
import com.ai.ipu.data.JMap;
4
import com.ai.ipu.server.controller.BaseFrontController;
5
import com.ai.ipu.server.dao.interfaces.MapTagManageDao;
6
import com.ai.ipu.server.model.MapTag;
7
import com.ai.ipu.server.service.interfaces.ExportService;
8
import com.ai.ipu.server.service.interfaces.MapTagManageService;
9
import com.ai.ipu.server.util.ExcelFormatUtil;
10
import com.github.pagehelper.PageHelper;
11
import com.github.pagehelper.PageInfo;
12
import org.apache.poi.ss.usermodel.CellStyle;
13
import org.apache.poi.xssf.streaming.SXSSFCell;
14
import org.apache.poi.xssf.streaming.SXSSFRow;
15
import org.apache.poi.xssf.streaming.SXSSFSheet;
16
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
17
import org.slf4j.Logger;
18
import org.slf4j.LoggerFactory;
19
import org.springframework.beans.factory.annotation.Autowired;
20
import org.springframework.http.ResponseEntity;
21
import org.springframework.stereotype.Service;
22
23
import javax.servlet.http.HttpServletRequest;
24
import javax.servlet.http.HttpServletResponse;
25
import java.io.ByteArrayInputStream;
26
import java.io.ByteArrayOutputStream;
27
import java.io.IOException;
28
import java.io.InputStream;
29
import java.util.ArrayList;
30
import java.util.List;
31
import java.util.Map;
32
33
@Service("MapTagManageServiceImpl")
34
public class MapTagManageServiceImpl implements MapTagManageService , ExportService {
35
    Logger logger = LoggerFactory.getLogger(MapTagManageServiceImpl.class);
36
37
    @Autowired
38
    MapTagManageDao mapTagManageDao;
39
40
    @Override
41
    public PageInfo queryMapTagInfo(JMap params) throws Exception {
42
        return mapTagManageDao.queryMapTagInfo(params);
43
    }
44
45
    @Override
46
    public int modifyMapTagInfo(JMap params) throws Exception{
47
        //將原來数据删除,然后在从新插入
48
        return mapTagManageDao.modifyMapTagInfo(params);
49
    }
50
51
    @Override
52
    public int addMapTagInfo(JMap params) throws Exception{
53
        return mapTagManageDao.addMapTagInfo(params);
54
    }
55
56
    @Override
57
    public boolean deleteMapTagXyInfo(JMap params) throws Exception{
58
        return mapTagManageDao.deleteMapTagXyInfo(params);
59
    }
60
61
    @Override
62
    public ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response,Object object) {
63
        try {
64
            logger.info(">>>>>>>>>>开始导出excel>>>>>>>>>>");
65
            JMap object1 = (JMap) object;
66
            JMap params1 = object1.getJMap("params");
67
68
            params1.put("pageNum",0 );
69
            params1.put("pageSize",0 );
70
            // 查询数据
71
72
73
            PageInfo pageInfo = queryMapTagInfo(object1);
74
            List<JMap> mapTagList = pageInfo.getList();
75
            //设置表格名字
76
            String strName="终端导出表.xls";
77
            BaseFrontController baseFrontController = new BaseFrontController();
78
            return baseFrontController.buildResponseEntity(export(mapTagList), strName);
79
        } catch (Exception e) {
80
            e.printStackTrace();
81
            logger.error(">>>>>>>>>>导出excel 异常,原因为:" + e.getMessage());
82
        }
83
        return null;
84
    }
85
    private InputStream export(List<JMap> list) {
86
        logger.info(">>>>>>>>>>>>>>>>>>>>开始进入导出方法>>>>>>>>>>");
87
        ByteArrayOutputStream output = null;
88
        InputStream inputStream1 = null;
89
        SXSSFWorkbook wb = new SXSSFWorkbook(1000);// 保留1000条数据在内存中
90
        SXSSFSheet sheet = wb.createSheet();
91
        // 设置报表头样式
92
        CellStyle header = ExcelFormatUtil.headSytle(wb);// cell样式
93
        CellStyle content = ExcelFormatUtil.contentStyle(wb);// 报表体样式
94
95
        // 每一列字段名
96
        String[] strs = new String[] { "标记名称", "类型", "创建时间"};
97
98
        // 字段名所在表格的宽度
99
        int[] ints = new int[] { 5000, 5000, 5000, 5000, 5000, 5000 };
100
101
        // 设置表头样式
102
        ExcelFormatUtil.initTitleEX(sheet, header, strs, ints);
103
        logger.info(">>>>>>>>>>>>>>>>>>>>表头样式设置完成>>>>>>>>>>");
104
105
        if (list != null && list.size() > 0) {
106
            logger.info(">>>>>>>>>>>>>>>>>>>>开始遍历数据组装单元格内容>>>>>>>>>>");
107
108
            for (int i = 0; i < list.size(); i++) {
109
                Map mapTagJMap = list.get(i);
110
                SXSSFRow row = sheet.createRow(i + 1);
111
                int j = 0;
112
113
                SXSSFCell cell = row.createCell(j++);
114
                cell.setCellValue(mapTagJMap.get("MAP_TAG_NAME").toString()); // 标记名称
115
                cell.setCellStyle(content);
116
117
                cell = row.createCell(j++);
118
                cell.setCellValue(mapTagJMap.get("MAP_TAG_TYPE").toString()); // 类型
119
                cell.setCellStyle(content);
120
121
                cell = row.createCell(j++);
122
                String createDate = mapTagJMap.get("CREATE_DATE").toString();
123
                cell.setCellValue(createDate.substring(0,createDate.length()-2)); // 创建时间
124
                cell.setCellStyle(content);
125
126
            }
127
            logger.info(">>>>>>>>>>>>>>>>>>>>结束遍历数据组装单元格内容>>>>>>>>>>");
128
        }
129
        try {
130
            output = new ByteArrayOutputStream();
131
            wb.write(output);
132
            inputStream1 = new ByteArrayInputStream(output.toByteArray());
133
            output.flush();
134
        } catch (Exception e) {
135
            e.printStackTrace();
136
        } finally {
137
            try {
138
                if (output != null) {
139
                    output.close();
140
                    if (inputStream1 != null)
141
                        inputStream1.close();
142
                }
143
            } catch (IOException e) {
144
                e.printStackTrace();
145
            }
146
        }
147
        return inputStream1;
148
    }
149
}

+ 64 - 42
ipu-demo/src/main/java/com/ai/ipu/server/service/impl/ExportServiceImpl.java

@ -1,17 +1,12 @@
1 1
package com.ai.ipu.server.service.impl;
2 2
3
import java.io.ByteArrayInputStream;
4
import java.io.ByteArrayOutputStream;
5
import java.io.IOException;
6
import java.io.InputStream;
7
import java.util.ArrayList;
8
import java.util.List;
9
10
import javax.servlet.http.HttpServletRequest;
11
import javax.servlet.http.HttpServletResponse;
12
3
import com.ai.ipu.data.JMap;
4
import com.ai.ipu.server.controller.BaseFrontController;
5
import com.ai.ipu.server.dao.interfaces.UserManageDao;
13 6
import com.ai.ipu.server.service.interfaces.ExportService;
7
import com.ai.ipu.server.service.interfaces.UserManageService;
14 8
import com.ai.ipu.server.util.ExcelFormatUtil;
9
import com.github.pagehelper.PageInfo;
15 10
import org.apache.poi.ss.usermodel.CellStyle;
16 11
import org.apache.poi.xssf.streaming.SXSSFCell;
17 12
import org.apache.poi.xssf.streaming.SXSSFRow;
@ -19,36 +14,72 @@ import org.apache.poi.xssf.streaming.SXSSFSheet;
19 14
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
20 15
import org.slf4j.Logger;
21 16
import org.slf4j.LoggerFactory;
17
import org.springframework.beans.factory.annotation.Autowired;
22 18
import org.springframework.http.ResponseEntity;
23 19
import org.springframework.stereotype.Service;
24 20
21
import javax.servlet.http.HttpServletRequest;
22
import javax.servlet.http.HttpServletResponse;
23
import java.io.ByteArrayInputStream;
24
import java.io.ByteArrayOutputStream;
25
import java.io.IOException;
26
import java.io.InputStream;
27
import java.util.List;
28
import java.util.Map;
29
30
@Service("UserManageServiceImpl")
31
public class UserManageServiceImpl implements UserManageService , ExportService {
32
    Logger logger = LoggerFactory.getLogger(UserManageServiceImpl.class);
25 33
26
@Service
27
public class ExportServiceImpl implements ExportService {
28
    Logger logger = LoggerFactory.getLogger(ExportServiceImpl.class);
34
    @Autowired
35
    UserManageDao userManageDao;
29 36
30 37
    @Override
31
    public ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response) {
32
        /*try {
38
    public PageInfo queryUserInfo(JMap params) throws Exception {
39
        return userManageDao.queryUserInfo(params);
40
    }
41
42
    @Override
43
    public int modifyUserInfo(JMap params) throws Exception{
44
        //將原來数据删除,然后在从新插入
45
        return userManageDao.modifyUserInfo(params);
46
    }
47
48
    @Override
49
    public int addUserInfo(JMap params) throws Exception{
50
        return userManageDao.addUserInfo(params);
51
    }
52
53
    @Override
54
    public boolean deleteUserXyInfo(JMap params) throws Exception{
55
        return userManageDao.deleteUserXyInfo(params);
56
    }
57
58
    @Override
59
    public ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response,Object object) {
60
        try {
33 61
            logger.info(">>>>>>>>>>开始导出excel>>>>>>>>>>");
62
            JMap object1 = (JMap) object;
63
            JMap params1 = object1.getJMap("params");
64
65
            params1.put("pageNum",0 );
66
            params1.put("pageSize",0 );
67
            // 查询数据
34 68
35
            // 造几条数据
36
            List<User> list = new ArrayList<>();
37
            list.add(new User("唐三藏", "男", 30, "13411111111", "东土大唐", "取西经"));
38
            list.add(new User("孙悟空", "男", 29, "13411111112", "菩提院", "打妖怪"));
39
            list.add(new User("猪八戒", "男", 28, "13411111113", "高老庄", "偷懒"));
40
            list.add(new User("沙悟净", "男", 27, "13411111114", "流沙河", "挑担子"));
41 69
70
            PageInfo pageInfo = queryUserInfo(object1);
71
            List<JMap> UserList = pageInfo.getList();
72
            //设置表格名字
73
            String strName="终端导出表.xls";
42 74
            BaseFrontController baseFrontController = new BaseFrontController();
43
            return baseFrontController.buildResponseEntity(export((List<User>) list), "用户表.xls");
75
            return baseFrontController.buildResponseEntity(export(UserList), strName);
44 76
        } catch (Exception e) {
45 77
            e.printStackTrace();
46 78
            logger.error(">>>>>>>>>>导出excel 异常,原因为:" + e.getMessage());
47
        }*/
79
        }
48 80
        return null;
49 81
    }
50
51
  /*  private InputStream export(List<User> list) {
82
    private InputStream export(List<JMap> list) {
52 83
        logger.info(">>>>>>>>>>>>>>>>>>>>开始进入导出方法>>>>>>>>>>");
53 84
        ByteArrayOutputStream output = null;
54 85
        InputStream inputStream1 = null;
@ -59,7 +90,7 @@ public class ExportServiceImpl implements ExportService {
59 90
        CellStyle content = ExcelFormatUtil.contentStyle(wb);// 报表体样式
60 91
61 92
        // 每一列字段名
62
        String[] strs = new String[] { "姓名", "性别", "年龄", "手机号", "地址","爱好" };
93
        String[] strs = new String[] { "标记名称", "类型", "创建时间"};
63 94
64 95
        // 字段名所在表格的宽度
65 96
        int[] ints = new int[] { 5000, 5000, 5000, 5000, 5000, 5000 };
@ -70,34 +101,25 @@ public class ExportServiceImpl implements ExportService {
70 101
71 102
        if (list != null && list.size() > 0) {
72 103
            logger.info(">>>>>>>>>>>>>>>>>>>>开始遍历数据组装单元格内容>>>>>>>>>>");
104
73 105
            for (int i = 0; i < list.size(); i++) {
74
                User user = list.get(i);
106
                Map UserJMap = list.get(i);
75 107
                SXSSFRow row = sheet.createRow(i + 1);
76 108
                int j = 0;
77 109
78 110
                SXSSFCell cell = row.createCell(j++);
79
                cell.setCellValue(user.getName()); // 姓名
80
                cell.setCellStyle(content);
81
82
                cell = row.createCell(j++);
83
                cell.setCellValue(user.getSex()); // 性别
84
                cell.setCellStyle(content);
85
86
                cell = row.createCell(j++);
87
                cell.setCellValue(user.getAge()); // 年龄
111
                cell.setCellValue(UserJMap.get("MAP_TAG_NAME").toString()); // 标记名称
88 112
                cell.setCellStyle(content);
89 113
90 114
                cell = row.createCell(j++);
91
                cell.setCellValue(user.getPhoneNo()); // 手机号
115
                cell.setCellValue(UserJMap.get("MAP_TAG_TYPE").toString()); // 类型
92 116
                cell.setCellStyle(content);
93 117
94 118
                cell = row.createCell(j++);
95
                cell.setCellValue(user.getAddress()); // 地址
119
                String createDate = UserJMap.get("CREATE_DATE").toString();
120
                cell.setCellValue(createDate.substring(0,createDate.length()-2)); // 创建时间
96 121
                cell.setCellStyle(content);
97 122
98
                cell = row.createCell(j++);
99
                cell.setCellValue(user.getHobby()); // 爱好
100
                cell.setCellStyle(content);
101 123
            }
102 124
            logger.info(">>>>>>>>>>>>>>>>>>>>结束遍历数据组装单元格内容>>>>>>>>>>");
103 125
        }
@ -120,5 +142,5 @@ public class ExportServiceImpl implements ExportService {
120 142
            }
121 143
        }
122 144
        return inputStream1;
123
    }*/
145
    }
124 146
}

+ 15 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/interfaces/CallRescuerService.java

@ -0,0 +1,15 @@
1
package com.ai.ipu.server.service.interfaces;
2
3
import com.ai.ipu.data.JMap;
4
import com.github.pagehelper.PageInfo;
5
6
public interface CallRescuerService {
7
8
    PageInfo queryCallRescuerInfo(JMap params) throws Exception;
9
10
    int modifyCallRescuerInfo(JMap params) throws Exception;
11
12
    int addCallRescuerInfo(JMap params) throws Exception;
13
14
    boolean deleteCallRescuerXyInfo(JMap params) throws Exception;
15
}

+ 15 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/interfaces/DeviceManageService.java

@ -0,0 +1,15 @@
1
package com.ai.ipu.server.service.interfaces;
2
3
import com.ai.ipu.data.JMap;
4
import com.github.pagehelper.PageInfo;
5
6
public interface DeviceManageService {
7
8
    PageInfo queryDeviceInfo(JMap params) throws Exception;
9
10
    int modifyDeviceInfo(JMap params) throws Exception;
11
12
    int addDeviceInfo(JMap params) throws Exception;
13
14
    boolean deleteDeviceXyInfo(JMap params) throws Exception;
15
}

+ 19 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/interfaces/EquipmentManageService.java

@ -0,0 +1,19 @@
1
package com.ai.ipu.server.service.interfaces;
2
3
import com.ai.ipu.data.JMap;
4
import com.github.pagehelper.PageInfo;
5
6
public interface EquipmentManageService {
7
8
    PageInfo queryEquipmentInfo(JMap params) throws Exception;
9
10
    int modifyEquipmentInfo(JMap params) throws Exception;
11
12
    int addEquipmentInfo(JMap params) throws Exception;
13
14
    boolean deleteEquipmentInfo(JMap params) throws Exception;
15
16
    boolean deleteEquipmentsInfo(JMap params);
17
18
    boolean importEquipmentInfo(JMap params);
19
}

+ 1 - 1
ipu-demo/src/main/java/com/ai/ipu/server/service/interfaces/ExportService.java

@ -6,5 +6,5 @@ import javax.servlet.http.HttpServletRequest;
6 6
import javax.servlet.http.HttpServletResponse;
7 7
8 8
public interface ExportService {
9
    ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response);
9
    ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response,Object object);
10 10
}

+ 2 - 0
ipu-demo/src/main/java/com/ai/ipu/server/service/interfaces/MapTagManageService.java

@ -14,4 +14,6 @@ public interface MapTagManageService {
14 14
    int modifyMapTagInfo(JMap params) throws Exception;
15 15
16 16
    int addMapTagInfo(JMap params) throws Exception;
17
18
    boolean deleteMapTagXyInfo (JMap params) throws Exception;
17 19
}

+ 15 - 0
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/interfaces/UserManageService.java

@ -0,0 +1,15 @@
1
package com.ai.ipu.server.service.interfaces;
2
3
import com.ai.ipu.data.JMap;
4
import com.github.pagehelper.PageInfo;
5
6
public interface UserManageService {
7
8
    PageInfo queryUserInfo(JMap params) throws Exception;
9
10
    int modifyUserInfo(JMap params) throws Exception;
11
12
    int addUserInfo(JMap params) throws Exception;
13
14
    boolean deleteUserXyInfo(JMap params) throws Exception;
15
}

+ 5 - 6
ipu-demo/src/main/java/com/ai/ipu/server/util/ExcelFormatUtil.java

@ -18,8 +18,7 @@ public class ExcelFormatUtil {
18 18
     * @return
19 19
     */
20 20
    public static CellStyle headSytle(SXSSFWorkbook workbook){
21
        CellStyle style1 = workbook.createCellStyle();// cell样式
22
       /* // 设置style1的样式,此样式运用在第二行
21
        // 设置style1的样式,此样式运用在第二行
23 22
        CellStyle style1 = workbook.createCellStyle();// cell样式
24 23
        // 设置单元格背景色,设置单元格背景色以下两句必须同时设置
25 24
        style1.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);// 设置填充样式
@ -36,7 +35,7 @@ public class ExcelFormatUtil {
36 35
        style1.setFont(font1);// 设置style1的字体
37 36
        style1.setWrapText(true);// 设置自动换行
38 37
        style1.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 设置单元格字体显示居中(左右方向)
39
        style1.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 设置单元格字体显示居中(上下方向)*/
38
        style1.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 设置单元格字体显示居中(上下方向)
40 39
        return style1;
41 40
    }
42 41
    /**
@ -48,7 +47,7 @@ public class ExcelFormatUtil {
48 47
        // 设置style1的样式,此样式运用在第二行
49 48
        CellStyle style1 = wb.createCellStyle();// cell样式
50 49
        // 设置单元格上、下、左、右的边框线
51
      /*  style1.setBorderBottom(HSSFCellStyle.BORDER_THIN);
50
        style1.setBorderBottom(HSSFCellStyle.BORDER_THIN);
52 51
        style1.setBorderLeft(HSSFCellStyle.BORDER_THIN);
53 52
        style1.setBorderRight(HSSFCellStyle.BORDER_THIN);
54 53
        style1.setBorderTop(HSSFCellStyle.BORDER_THIN);
@ -71,7 +70,7 @@ public class ExcelFormatUtil {
71 70
        if(color != HSSFColor.WHITE.index){
72 71
            style1.setFillForegroundColor(color);// 设置填充色
73 72
        }
74
      /*  // 设置单元格上、下、左、右的边框线
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>

ipu/android-share - Nuosi Git Service

1106 Commits (b715f4e3f6543b72d299b7477d406cc163b71898)

Auteur SHA1 Message Date
  huangbo b715f4e3f6 使得ant脚本也可以编译通过 8 ans auparavant
  huangbo 1eaab35961 Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share.git 8 ans auparavant
  huangbo 325e48c8cc display-server的maven可构建版本 8 ans auparavant
  huangbo 2c106fb457 jar更新 8 ans auparavant
  larryjay 1d8b1605c6 Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share 8 ans auparavant
  larryjay a0da697fb7 commit 8 ans auparavant
  larryjay 25554beddc 提交 8 ans auparavant
  huangbo eac5a7477d ipu-server-lib的maven初始化 8 ans auparavant
  huangbo d4e6645597 Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share.git 8 ans auparavant
  huangbo 30a725fa3a display工程maven初始化 8 ans auparavant
  larryjay 6c9130f830 删除wade-mobile-lib的android-lite-http.jar 8 ans auparavant
  leijie 6b61bfc18d 解决登录退出后返回键回到主界面的bug 8 ans auparavant
  huangbo 0692961f0c display可编译ant初始化 8 ans auparavant
  huangbo a448cdc0ba 本地local和导出所有 8 ans auparavant
  huangbo 1338872838 区分本地local的jar和导出所有的jar 8 ans auparavant
  huangbo ec877f443d Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share.git 8 ans auparavant
  huangbo 22723cc2b7 ipu-server-lib初始化 8 ans auparavant
  1712772270@qq.com 1a458e3e6d 修改视频压缩传入参数 8 ans auparavant
  1712772270@qq.com 11d4c9df35 视频压缩中添加视频选择功能 8 ans auparavant
  1712772270@qq.com 6fbe518bab 视频压缩中选择图片 8 ans auparavant
  huangbo 259e6b0d58 Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share.git 8 ans auparavant
  huangbo b5fb8f44b4 插件管理平台 8 ans auparavant
  wangxl 480c48dc7a update ipu-basic-1.0.jar 8 ans auparavant
  leijie 702d04d931 更新fun项目的wade-mobile包 8 ans auparavant
  leijie 2100e310d0 注释alter和confirm 8 ans auparavant
  leijie 264eb540ca 更新iframe跨域 8 ans auparavant
  leijie 335c6fe7df Merge branch 'iframe' 8 ans auparavant
  leijie cce1ba0191 将跨域iframe功能嵌入display;(general-web-server) 8 ans auparavant
  huangbo 533f37d256 工程配置 8 ans auparavant
  wangyujuan 67b53327e9 update ipu-basic 8 ans auparavant
  huangbo 4ff2ce573b 编译需要ant-contrib 8 ans auparavant
  wangxl 4cb114bdd1 Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share 8 ans auparavant
  wangxl 72f2cc928c Android 增加 clearbackstack方法 8 ans auparavant
  leijie 3a60c3aaac Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share 8 ans auparavant
  leijie 681899724b pathmenu 8 ans auparavant
  chengwb3 b61665220c display-server-maven同时支持ant编译打包 8 ans auparavant
  1712772270@qq.com e19421c6fc Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share 8 ans auparavant
  1712772270@qq.com f9f13f7029 在mobile-action.xml中添加邮件,分享,视频压缩的action 8 ans auparavant
  chengwb3 e3d24b8837 去掉注释,可忽略 8 ans auparavant
  chengwb3 e3dc2b2def 解决打的war包不含本地jar包的问题 8 ans auparavant
  1712772270@qq.com 9dea2304fb 把百度地图和高德地图的功能展示合并到一个html页面展示 8 ans auparavant
  wangyujuan 6ae037fec0 ipu-pathmenu 删除jar包 8 ans auparavant
  wangyujuan dc2ae407ba appplugin acitivity service 8 ans auparavant
  wangyujuan d72d51eb20 更新wade-mobile-common下的lib 8 ans auparavant
  wangyujuan a721aca42d appplugins 8 ans auparavant
  huangbo 6115ae87e6 Merge branch 'master' of http://10.1.235.20:3000/ipu/android-share.git 8 ans auparavant
  huangbo f77e2b72a3 精简配置 8 ans auparavant
  wangyujuan 5b75905a88 del 8 ans auparavant
  wangyujuan 3ed7fb088d apppligins 8 ans auparavant
  wangyujuan b469bc67c6 appplugins 8 ans auparavant