Browse Source

大屏地图接口

feature/dangjian
sunyuchao 3 years ago
parent
commit
f14489914c
  1. 53
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemListByAddressResultDTO.java
  2. 10
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java
  3. 2
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java
  4. 2
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java
  5. 10
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java
  6. 30
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

53
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemListByAddressResultDTO.java

@ -0,0 +1,53 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto.item.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class ItemListByAddressResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 项目内容
*/
private String itemContent;
/**
* 纬度
*/
private String latitude;
/**
* 经度
*/
private String longitude;
/**
* 离中心点千米数
*/
private String km;
}

10
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemController.java

@ -444,5 +444,15 @@ public class ItemController {
return itemService.pushItemDifficulty(formDto); return itemService.pushItemDifficulty(formDto);
} }
/**
* 根据经纬度查询部门下附近项目数据
* @param params
* @return
*/
@GetMapping("getItemListByAddress")
public Result<List<ItemListByAddressResultDTO>> getItemListByAddress(@RequestParam Map<String, Object> params){
return new Result<List<ItemListByAddressResultDTO>>().ok(itemService.getItemListByAddress(params));
}
} }

2
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java

@ -522,4 +522,6 @@ public interface ItemDao extends BaseDao<ItemEntity> {
List<ItemStatisListPageResultDTO> getItemStatisListPage(Map<String, Object> params); List<ItemStatisListPageResultDTO> getItemStatisListPage(Map<String, Object> params);
void updateBatchBySerialNum(@Param("updateList") List<String> updateList); void updateBatchBySerialNum(@Param("updateList") List<String> updateList);
List<ItemListByAddressResultDTO> getItemListByAddress(Map<String, Object> params);
} }

2
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java

@ -661,5 +661,5 @@ public interface ItemService extends BaseService<ItemEntity> {
*/ */
Result pushItemDifficulty(AcceptItemDifficultyOutFormDTO formDto); Result pushItemDifficulty(AcceptItemDifficultyOutFormDTO formDto);
List<ItemListByAddressResultDTO> getItemListByAddress(Map<String, Object> params);
} }

10
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java

@ -4031,5 +4031,15 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
return new Result().ok("操作成功"); return new Result().ok("操作成功");
} }
/**
* 根据经纬度查询部门下附近项目数据
* @param params
* @return
*/
@Override
public List<ItemListByAddressResultDTO> getItemListByAddress(Map<String, Object> params) {
return baseDao.getItemListByAddress(params);
}
} }

30
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

@ -2444,6 +2444,36 @@
ORDER BY DATE_FORMAT(item.CREATED_TIME,'%Y-%m') asc ORDER BY DATE_FORMAT(item.CREATED_TIME,'%Y-%m') asc
</select> </select>
<select id="getItemListByAddress" resultType="com.elink.esua.epdc.dto.item.result.ItemListByAddressResultDTO">
SELECT
a.id id,
a.item_content itemContent,
a.issue_latitude latitude,
a.issue_longitude longitude,
round((st_distance_sphere(point(#{longitude}, #{latitude}), point(a.ISSUE_LONGITUDE, a.ISSUE_LATITUDE))) / 1000 ,1) as km
FROM
epdc_item a
INNER JOIN (
SELECT
b.id, b.item_id, b.created_time, b.state
FROM epdc_item_handle_process b
WHERE b.del_flag = '0'
AND b.created_time = (
SELECT max(created_time)
FROM epdc_item_handle_process
WHERE b.item_id = item_id AND del_flag = '0'
)
AND b.state = 1001
) process ON process.item_id = a.id
WHERE
a.del_flag = '0'
AND a.all_dept_ids LIKE concat('%', trim(#{deptId}), '%')
HAVING km <![CDATA[ <= ]]> 10
ORDER BY
a.created_time DESC,
a.all_dept_ids ASC
</select>
<update id="updateBatchBySerialNum"> <update id="updateBatchBySerialNum">
UPDATE UPDATE
epdc_item epdc_item

Loading…
Cancel
Save