Explorar el Código

修改地图管理文件

wangchao %!s(int64=4) %!d(string=hace) años
padre
commit
5f13388aac

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

@ -45,15 +45,6 @@ public class CallRescuerController {
45 45
        return result;
46 46
    }
47 47
48
    /**
49
     * 导出地图标记到excel
50
     */
51
    @ResponseBody
52
    @RequestMapping("/exportCallRescuerInfoToExcel")
53
    public ResponseEntity<byte[]> exportCallRescuerInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
54
55
        return exportService.exportExcel(request,response,params);
56
    }
57 48
58 49
    /**
59 50
     * 编辑地图标记

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

@ -1,34 +1,22 @@
1 1
package com.ai.ipu.server.controller;
2 2
3
4
import com.ai.ipu.basic.util.IpuUtility;
5 3
import com.ai.ipu.data.JMap;
6 4
import com.ai.ipu.data.impl.JsonMap;
7 5
import com.ai.ipu.server.service.interfaces.ExportService;
8 6
import com.ai.ipu.server.service.interfaces.DeviceManageService;
9
import com.ai.ipu.server.util.RestScaffoldConstant;
10 7
import com.github.pagehelper.PageInfo;
11 8
import org.slf4j.Logger;
12 9
import org.slf4j.LoggerFactory;
13 10
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.beans.factory.annotation.Qualifier;
15
import org.springframework.http.ResponseEntity;
16 11
import org.springframework.stereotype.Controller;
17 12
import org.springframework.web.bind.annotation.RequestMapping;
18 13
import org.springframework.web.bind.annotation.ResponseBody;
19 14
20
import javax.servlet.http.HttpServletRequest;
21
import javax.servlet.http.HttpServletResponse;
22
23 15
@Controller
24 16
@RequestMapping("/device")
25 17
public class DeviceManageController {
26 18
27 19
    @Autowired
28
    ExportService exportService;
29
30
31
    @Autowired
32 20
    DeviceManageService deviceManageService;
33 21
34 22
    Logger logger = LoggerFactory.getLogger(DeviceManageController.class);
@ -45,18 +33,9 @@ public class DeviceManageController {
45 33
        return result;
46 34
    }
47 35
48
    /**
49
     * 导出終端设备信息到excel
50
     */
51
    @ResponseBody
52
    @RequestMapping("/exportDeviceInfoToExcel")
53
    public ResponseEntity<byte[]> exportDeviceInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
54
55
        return exportService.exportExcel(request,response,params);
56
    }
57 36
58 37
    /**
59
     * 编辑地图标记
38
     * 编辑终端信息、增加终端信息
60 39
     */
61 40
    @ResponseBody
62 41
    @RequestMapping("/modifyDeviceInfo")
@ -71,7 +50,7 @@ public class DeviceManageController {
71 50
                num= deviceManageService.addDeviceInfo(params1);
72 51
            }
73 52
        }catch(Exception e){
74
            logger.error(">>>>>>>>>>导出excel 异常,原因为:" + e.getMessage());
53
            logger.error("异常,原因为:" + e.getMessage());
75 54
        }
76 55
        JMap result = new JsonMap();
77 56
        if(num>0){
@ -83,11 +62,12 @@ public class DeviceManageController {
83 62
    }
84 63
85 64
    /**
86
     * 刪除地图标记
65
     * 刪除终端管理
66
     *
87 67
     */
88 68
    @ResponseBody
89
    @RequestMapping("/deleteDeviceXyInfo")
90
    public JMap deleteDeviceXyInfo(JMap params) throws Exception {
69
    @RequestMapping("/deleteDeviceInfo")
70
    public JMap deleteDeviceInfo(JMap params) throws Exception {
91 71
        boolean flag=false;
92 72
        if(params.getInt("MAP_TAG_ID")!=0){
93 73
            flag=  deviceManageService.deleteDeviceXyInfo(params);
@ -96,5 +76,48 @@ public class DeviceManageController {
96 76
        result.put("result", flag);
97 77
        return result;
98 78
    }
79
    /**
80
     * 导入终端信息
81
     */
82
    @ResponseBody
83
    @RequestMapping("/importDeviceInfo")
84
    public JMap importDeviceInfo(JMap params) throws Exception {
85
        boolean flag=false;
86
        if(params.getInt("MAP_TAG_ID")!=0){
87
            //flag=  userManageService.importUserInfo(params);
88
        }
89
        JMap result = new JsonMap();
90
        result.put("result", flag);
91
        return result;
92
    }
99 93
94
    /**
95
     * 关联用户
96
     */
97
    @ResponseBody
98
    @RequestMapping("/associatUser")
99
    public JMap associatUser(JMap params) throws Exception {
100
        boolean flag=false;
101
        if(params.getInt("MAP_TAG_ID")!=0){
102
            //flag=  userManageService.associatTerminal(params);
103
        }
104
        JMap result = new JsonMap();
105
        result.put("result", flag);
106
        return result;
107
    }
108
109
    /**
110
     * 解绑用户
111
     */
112
    @ResponseBody
113
    @RequestMapping("/unbundUser")
114
    public JMap unbundUser(JMap params) throws Exception {
115
        boolean flag=false;
116
        if(params.getInt("MAP_TAG_ID")!=0){
117
            //flag=  userManageService.unbundTerminal(params);
118
        }
119
        JMap result = new JsonMap();
120
        result.put("result", flag);
121
        return result;
122
    }
100 123
}

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

@ -1,24 +1,17 @@
1 1
package com.ai.ipu.server.controller;
2 2
3
4
import com.ai.ipu.basic.util.IpuUtility;
5 3
import com.ai.ipu.data.JMap;
6 4
import com.ai.ipu.data.impl.JsonMap;
7 5
import com.ai.ipu.server.service.interfaces.ExportService;
8 6
import com.ai.ipu.server.service.interfaces.EquipmentManageService;
9
import com.ai.ipu.server.util.RestScaffoldConstant;
10 7
import com.github.pagehelper.PageInfo;
11 8
import org.slf4j.Logger;
12 9
import org.slf4j.LoggerFactory;
13 10
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.beans.factory.annotation.Qualifier;
15
import org.springframework.http.ResponseEntity;
16 11
import org.springframework.stereotype.Controller;
17 12
import org.springframework.web.bind.annotation.RequestMapping;
18 13
import org.springframework.web.bind.annotation.ResponseBody;
19 14
20
import javax.servlet.http.HttpServletRequest;
21
import javax.servlet.http.HttpServletResponse;
22 15
23 16
@Controller
24 17
@RequestMapping("/equipment")
@ -45,15 +38,6 @@ public class EquipmentManageController {
45 38
        return result;
46 39
    }
47 40
48
    /**
49
     * 导出设备信息到excel
50
     */
51
    @ResponseBody
52
    @RequestMapping("/exportEquipmentInfoToExcel")
53
    public ResponseEntity<byte[]> exportEquipmentInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
54
55
        return exportService.exportExcel(request,response,params);
56
    }
57 41
58 42
    /**
59 43
     * 编辑设备信息、新增设备信息
@ -71,7 +55,7 @@ public class EquipmentManageController {
71 55
                num= equipmentManageService.addEquipmentInfo(params1);
72 56
            }
73 57
        }catch(Exception e){
74
            logger.error(">>>>>>>>>>导出excel 异常,原因为:" + e.getMessage());
58
            logger.error("异常,原因为:" + e.getMessage());
75 59
        }
76 60
        JMap result = new JsonMap();
77 61
        if(num>0){
@ -83,7 +67,7 @@ public class EquipmentManageController {
83 67
    }
84 68
85 69
    /**
86
     * 刪除删除设备信息
70
     * 删除设备信息
87 71
     */
88 72
    @ResponseBody
89 73
    @RequestMapping("/deleteEquipmentInfo")
@ -117,7 +101,7 @@ public class EquipmentManageController {
117 101
     */
118 102
    @ResponseBody
119 103
    @RequestMapping("/importEquipmentsInfo")
120
    public JMap importEquipmentsInfo(JMap params) throws Exception {
104
    public JMap importEquipmentsInfo(JMap params) throws Exception{
121 105
        boolean flag=false;
122 106
        if(params.getInt("MAP_TAG_ID")!=0){
123 107
            flag=  equipmentManageService.importEquipmentInfo(params);

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

@ -4,6 +4,7 @@ import com.ai.ipu.data.JMap;
4 4
import com.ai.ipu.server.service.interfaces.ExportService;
5 5
import org.springframework.beans.factory.annotation.Autowired;
6 6
import org.springframework.http.ResponseEntity;
7
import org.springframework.stereotype.Controller;
7 8
import org.springframework.web.bind.annotation.RequestMapping;
8 9
import org.springframework.web.bind.annotation.ResponseBody;
9 10
@ -11,6 +12,7 @@ import javax.servlet.http.HttpServletRequest;
11 12
import javax.servlet.http.HttpServletResponse;
12 13
13 14
@RequestMapping("/ExportToExcel")
15
@Controller
14 16
public class ExportToExcelController {
15 17
    @Autowired
16 18
    ExportService exportService;
@ -25,5 +27,44 @@ public class ExportToExcelController {
25 27
        return exportService.exportMapTagInfoToExcel(request,response,params);
26 28
    }
27 29
30
    /**
31
     * 导出用户信息到excel
32
     */
33
    @ResponseBody
34
    @RequestMapping("/exportUserInfoToExcel")
35
    public ResponseEntity<byte[]> exportUserInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
36
37
        return exportService.exportMapTagInfoToExcel(request,response,params);
38
    }
39
40
    /**
41
     * 导出地图标记到excel
42
     */
43
    @ResponseBody
44
    @RequestMapping("/exportCallRescuerInfoToExcel")
45
    public ResponseEntity<byte[]> exportCallRescuerInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
46
47
        return exportService.exportMapTagInfoToExcel(request,response,params);
48
    }
49
50
    /**
51
     * 导出終端设备信息到excel
52
     */
53
    @ResponseBody
54
    @RequestMapping("/exportDeviceInfoToExcel")
55
    public ResponseEntity<byte[]> exportDeviceInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
56
57
        return exportService.exportMapTagInfoToExcel(request,response,params);
58
    }
59
60
    /**
61
     * 导出设备信息到excel
62
     */
63
    @ResponseBody
64
    @RequestMapping("/exportEquipmentInfoToExcel")
65
    public ResponseEntity<byte[]> exportEquipmentInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
66
67
        return exportService.exportMapTagInfoToExcel(request,response,params);
68
    }
28 69
29 70
}

+ 2 - 13
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/MapTagManageController.java

@ -54,27 +54,18 @@ public class MapTagManageController {
54 54
    }
55 55
56 56
    /**
57
     * 查询地图标记信息修改用表关联
57
     * 查询地图标记信息用作修改
58 58
     */
59 59
    @ResponseBody
60 60
    @RequestMapping("/queryMapTagforModifyInfo")
61 61
    public JMap queryMapTagforModifyInfo(JMap params) throws Exception {
62 62
63
        PageInfo mapTagList=  mapTagManageService.queryMapTagInfo(params);
63
        Map<String, Object> mapTagList=  mapTagManageService.queryMapTagforModifyInfo(params);
64 64
        JMap result = new JsonMap();
65 65
        result.put("result", mapTagList);
66 66
        return result;
67 67
    }
68 68
69
    /**
70
     * 导出地图标记到excel
71
     */
72
    @ResponseBody
73
    @RequestMapping("/exportMapTagInfoToExcel")
74
    public ResponseEntity<byte[]> exportMapTagInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
75
76
        return exportService.exportExcel(request,response,params);
77
    }
78 69
79 70
    /**
80 71
     * 编辑地图标记
@ -92,9 +83,7 @@ public class MapTagManageController {
92 83
                num= mapTagManageService.addMapTagInfo(params1);
93 84
            }
94 85
        }catch(Exception e){
95
96 86
            logger.error(">>>>>>>>>>导出excel 异常,原因为:" + e.getMessage());
97
98 87
        }
99 88
        JMap result = new JsonMap();
100 89
        if(num>0){

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

@ -45,15 +45,7 @@ public class UserManageController {
45 45
        return result;
46 46
    }
47 47
48
    /**
49
     * 导出用户信息到excel
50
     */
51
    @ResponseBody
52
    @RequestMapping("/exportUserInfoToExcel")
53
    public ResponseEntity<byte[]> exportUserInfoToExcel(JMap params, HttpServletRequest request, HttpServletResponse response) throws Exception {
54 48
55
        return exportService.exportExcel(request,response,params);
56
    }
57 49
58 50
    /**
59 51
     * 编辑用户信息、新增用户信息

+ 26 - 3
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/impl/MapTagManageDaoImpl.java

@ -26,21 +26,27 @@ public class MapTagManageDaoImpl implements MapTagManageDao {
26 26
    private String connName = "ebc";
27 27
    private String JdbcConnName = "JDBC";
28 28
    private String tableName = "ebc_map_tag";
29
    private String tableNameXy = "ebc_map_tag_xy";
30
29 31
30 32
    @Override
31 33
    public PageInfo queryMapTagInfo(JMap params) throws Exception {
32 34
        JMap params1 = params.getJMap("params");
33 35
        PageHelper.startPage(params1.getInt("pageNum"),params1.getInt("pageSize"));
34 36
35
        CommonTableDao dao = IpuDaoManager.takeDao(CommonTableDao.class, connName);
36
        List<Map<String, Object>> mapTagList = dao.selectByCond(tableName, params1);
37
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
38
        List<Map<String, Object>> mapTagList= dao.executeSelect("ipu.MapTagManageDao", "queryMapTagInfo", params1);
39
40
      /*  CommonTableDao dao1 = IpuDaoManager.takeDao(CommonTableDao.class, connName);
41
        List<Map<String, Object>> mapTagList1 = dao1.selectByCond(tableName, params1);*/
42
43
37 44
        PageInfo pageInfo = new PageInfo(mapTagList);
38 45
        return pageInfo;
39 46
    }
40 47
41 48
    @Override
42 49
    public int modifyMapTagInfo (JMap params) throws Exception {
43
44 50
        deleteMapTagXyInfo(params);
45 51
        //将新数据插入
46 52
        int num = addMapTagInfo(params);
@ -72,6 +78,14 @@ public class MapTagManageDaoImpl implements MapTagManageDao {
72 78
73 79
    @Override
74 80
    public boolean deleteMapTagXyInfo(JMap params) throws Exception {
81
 /*       //先删除子表在删除父表
82
        CommonTableDao dao = IpuDaoManager.takeDao(CommonTableDao.class, connName);
83
        dao.deleteByCond(tableNameXy,params);
84
        int num = dao.delete(tableName, params);
85
        if(num>0){
86
            return true;
87
        }*/
88
75 89
        ISqlMgmtDao dao = SqlMgmtDaoFactory.createFileSqlMgmtDao(connName);
76 90
        //先删除子表在删除父表
77 91
        dao.executeDelete( "ipu.MapTagManageDao", "deleteMapTagXyInfo", params);
@ -82,6 +96,15 @@ public class MapTagManageDaoImpl implements MapTagManageDao {
82 96
        return false;
83 97
    }
84 98
99
    @Override
100
    public Map<String, Object> queryMapTagforModifyInfo  (JMap params) throws Exception{
101
        JMap params1 = params.getJMap("params");
102
        CommonTableDao dao = IpuDaoManager.takeDao(CommonTableDao.class, connName);
103
        Map<String, Object> mapTagMap = dao.select(tableName, params1);
104
        List<Map<String, Object>> mapTagXyList = dao.selectByCond(tableNameXy, params1);
105
        mapTagMap.put("mapTagXyList", mapTagXyList);
106
        return mapTagMap;
107
    }
85 108
86 109
87 110
}

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

@ -16,4 +16,6 @@ public interface MapTagManageDao {
16 16
    int addMapTagInfo(JMap params) throws Exception;
17 17
18 18
    boolean deleteMapTagXyInfo(JMap params) throws Exception;
19
20
    Map<String, Object> queryMapTagforModifyInfo (JMap params)  throws Exception ;
19 21
}

+ 3 - 5
ebc-sea-platform/src/main/java/com/ai/ipu/server/service/impl/ExportToExcelServiceImpl.java

@ -12,6 +12,7 @@ import org.apache.poi.xssf.streaming.SXSSFSheet;
12 12
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
13 13
import org.slf4j.Logger;
14 14
import org.slf4j.LoggerFactory;
15
import org.springframework.beans.factory.annotation.Autowired;
15 16
import org.springframework.http.ResponseEntity;
16 17
import org.springframework.stereotype.Service;
17 18
@ -23,16 +24,13 @@ import java.util.Map;
23 24
@Service
24 25
public class ExportToExcelServiceImpl implements ExportService {
25 26
27
    @Autowired
26 28
    MapTagManageService mapTagManageService;
27 29
    /**
28 30
     * slf4j 日志 logger
29 31
     */
30 32
    Logger logger = LoggerFactory.getLogger(ExportToExcelServiceImpl.class);
31 33
32
    @Override
33
    public ResponseEntity<byte[]> exportExcel(HttpServletRequest request, HttpServletResponse response, Object object) {
34
        return null;
35
    }
36 34
37 35
    /**
38 36
     * 导出地图管理信息到excel
@ -50,7 +48,7 @@ public class ExportToExcelServiceImpl implements ExportService {
50 48
            PageInfo pageInfo = mapTagManageService.queryMapTagInfo(object1);
51 49
            List<JMap> mapTagList = pageInfo.getList();
52 50
            //设置表格名字
53
            String strName="终端导出表.xls";
51
            String strName="地图标记导出表.xls";
54 52
55 53
            logger.info(">>>>>>>>>>>>>>>>>>>>开始进入导出方法>>>>>>>>>>");
56 54

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

@ -9,6 +9,9 @@ import org.slf4j.LoggerFactory;
9 9
import org.springframework.beans.factory.annotation.Autowired;
10 10
import org.springframework.stereotype.Service;
11 11
12
import java.util.List;
13
import java.util.Map;
14
12 15
13 16
@Service
14 17
public class MapTagManageServiceImpl implements MapTagManageService {
@ -37,4 +40,9 @@ public class MapTagManageServiceImpl implements MapTagManageService {
37 40
    public boolean deleteMapTagXyInfo(JMap params) throws Exception{
38 41
        return mapTagManageDao.deleteMapTagXyInfo(params);
39 42
    }
43
44
    @Override
45
    public Map<String, Object> queryMapTagforModifyInfo (JMap params)  throws Exception {
46
        return mapTagManageDao.queryMapTagforModifyInfo(params);
47
    }
40 48
}

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

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

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

@ -16,4 +16,6 @@ public interface MapTagManageService {
16 16
    int addMapTagInfo(JMap params) throws Exception;
17 17
18 18
    boolean deleteMapTagXyInfo (JMap params) throws Exception;
19
20
    Map<String, Object> queryMapTagforModifyInfo(JMap params)  throws Exception ;
19 21
}