|
@@ -1,17 +1,19 @@
|
|
|
package com.example.nngkxxdp.controller;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.http.HttpRequest;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import com.example.nngkxxdp.service.MapDataService;
|
|
|
import com.example.nngkxxdp.util.Blank;
|
|
|
import com.example.nngkxxdp.util.ConstStr;
|
|
|
import com.example.nngkxxdp.util.SendUtil;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
/**
|
|
|
* @ApplicationName: nngkxxdp
|
|
|
* @Title: MapDataController
|
|
@@ -25,50 +27,71 @@ import com.example.nngkxxdp.util.SendUtil;
|
|
|
@RequestMapping("mapdata")
|
|
|
public class MapDataController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private MapDataService mapDataService;
|
|
|
+ @Autowired
|
|
|
+ private MapDataService mapDataService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return
|
|
|
+ * @Title: insertBatchByJson
|
|
|
+ * @Description: 批量保存地图数据
|
|
|
+ * @author: YJQ
|
|
|
+ * @date: 2022年6月24日 下午3:19:41
|
|
|
+ * @returnType Map<String, Object>
|
|
|
+ */
|
|
|
+ @GetMapping("insertBatchByJson")
|
|
|
+ public Map<String, Object> insertBatchByJson() {
|
|
|
+ return SendUtil.send(true, ConstStr.RESULT_SUCCESS, mapDataService.insertBatchByJson());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param dictType
|
|
|
+ * @return
|
|
|
+ * @Title: getMapDataByDictType
|
|
|
+ * @Description: 根据数据字典类型获取地图数据
|
|
|
+ * @author: YJQ
|
|
|
+ * @date: 2022年6月24日 下午3:52:14
|
|
|
+ * @returnType Map<String, Object>
|
|
|
+ */
|
|
|
+ @GetMapping("getMapDataByDictType")
|
|
|
+ public Map<String, Object> getMapDataByDictType(String dictType) {
|
|
|
+ if (Blank.isEmpty(dictType)) {
|
|
|
+ return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
|
|
|
+ }
|
|
|
+ return SendUtil.send(true, ConstStr.RESULT_SUCCESS, mapDataService.getMapDataByDictType(dictType));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return
|
|
|
+ * @Title: getMapDataAll
|
|
|
+ * @Description: 查询所有的地图数据信息
|
|
|
+ * @author: YJQ
|
|
|
+ * @date: 2022年6月24日 下午4:36:07
|
|
|
+ * @returnType Map<String, Object>
|
|
|
+ */
|
|
|
+ @GetMapping("getMapDataAll")
|
|
|
+ public Map<String, Object> getMapDataAll() {
|
|
|
+ return SendUtil.send(true, ConstStr.RESULT_SUCCESS, mapDataService.getMapDataAll());
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * @Title: insertBatchByJson
|
|
|
- * @Description: 批量保存地图数据
|
|
|
- * @author: YJQ
|
|
|
- * @date: 2022年6月24日 下午3:19:41
|
|
|
- * @returnType Map<String,Object>
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("insertBatchByJson")
|
|
|
- public Map<String, Object> insertBatchByJson() {
|
|
|
- return SendUtil.send(true, ConstStr.RESULT_SUCCESS, mapDataService.insertBatchByJson());
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @Title: getMapDataByDictType
|
|
|
- * @Description: 根据数据字典类型获取地图数据
|
|
|
- * @author: YJQ
|
|
|
- * @date: 2022年6月24日 下午3:52:14
|
|
|
- * @returnType Map<String,Object>
|
|
|
- * @param dictType
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("getMapDataByDictType")
|
|
|
- public Map<String, Object> getMapDataByDictType(String dictType) {
|
|
|
- if (Blank.isEmpty(dictType)) {
|
|
|
- return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
|
|
|
- }
|
|
|
- return SendUtil.send(true, ConstStr.RESULT_SUCCESS, mapDataService.getMapDataByDictType(dictType));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @Title: getMapDataAll
|
|
|
- * @Description: 查询所有的地图数据信息
|
|
|
- * @author: YJQ
|
|
|
- * @date: 2022年6月24日 下午4:36:07
|
|
|
- * @returnType Map<String,Object>
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("getMapDataAll")
|
|
|
- public Map<String, Object> getMapDataAll() {
|
|
|
- return SendUtil.send(true, ConstStr.RESULT_SUCCESS, mapDataService.getMapDataAll());
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 提交纠错信息
|
|
|
+ */
|
|
|
+ @PostMapping("/saveErrorLog")
|
|
|
+ public Map<String, Object> saveErrorLog(HttpServletRequest request) {
|
|
|
+ Map<String, Object> mapErrorLog = new HashMap<>();
|
|
|
+ mapErrorLog.put("sMapId", request.getParameter("sMapId"));
|
|
|
+ mapErrorLog.put("addressName", request.getParameter("addressName"));
|
|
|
+ mapErrorLog.put("originalAddress", request.getParameter("originalAddress"));
|
|
|
+ mapErrorLog.put("originalCoordinates", request.getParameter("originalCoordinates"));
|
|
|
+ mapErrorLog.put("newAddress", request.getParameter("newAddress"));
|
|
|
+ mapErrorLog.put("newCoordinates", request.getParameter("newCoordinates"));
|
|
|
+ mapErrorLog.put("errorState", request.getParameter("errorState"));
|
|
|
+ try {
|
|
|
+ return mapDataService.saveErrorLog(mapErrorLog);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return SendUtil.send(false, ConstStr.ADD_FAILED);
|
|
|
+ }
|
|
|
|
|
|
}
|