From f54944daaf82309571e39c6b23f11c195c7b8eae Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Sun, 25 Sep 2022 13:49:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=83=A8=E5=88=86=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datarelease/DataReleaseController.java | 35 +++ .../dao/datarelease/IDataReleaseDao.java | 14 + .../impl/UserLocationServiceImpl.java | 2 +- .../mapper/datarelease/datarelease-mapper.xml | 29 ++ .../bigdata/list-hour-user-rysshyqk.html | 279 ++++++++++++++++++ 5 files changed, 358 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/static/route/bigdata/list-hour-user-rysshyqk.html diff --git a/src/main/java/com/cm/systemcity/controller/datarelease/DataReleaseController.java b/src/main/java/com/cm/systemcity/controller/datarelease/DataReleaseController.java index a6ef1e5..b33213e 100644 --- a/src/main/java/com/cm/systemcity/controller/datarelease/DataReleaseController.java +++ b/src/main/java/com/cm/systemcity/controller/datarelease/DataReleaseController.java @@ -5,6 +5,7 @@ import com.cm.common.constants.ISystemConstant; import com.cm.common.exception.SearchException; import com.cm.common.pojo.ListPage; import com.cm.common.result.ErrorResult; +import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.common.utils.DateUtil; import com.cm.systemcity.dao.datarelease.IDataReleaseDao; @@ -14,10 +15,14 @@ import com.cm.systemcity.pojo.dtos.reportcase.CaseStatisticDTO; import com.cm.systemcity.pojo.dtos.reportcase.ReportCaseAssignDTO; import com.cm.systemcity.pojo.dtos.reportcase.ReportCaseDTO; import com.cm.systemcity.pojo.dtos.reportcase.ReportCaseLogDTO; +import com.cm.systemcity.pojo.dtos.userlocation.UserLocationDTO; import com.cm.systemcity.service.dict.IDictService; import com.cm.systemcity.service.readstate.IReadStateService; import com.cm.systemcity.service.reportcase.IReportCaseService; +import com.cm.systemcity.service.userlocation.IUserLocationService; import com.cm.systemcity.utils.BigDataResult; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -46,6 +51,8 @@ public class DataReleaseController extends AbstractController { private IDictService dictService; @Autowired private IReportCaseService reportCaseService; + @Autowired + private IUserLocationService userLocationService; @ApiOperation(value = "案件情况-数量", notes = "案件情况-数量") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @@ -465,4 +472,32 @@ public class DataReleaseController extends AbstractController { Map params = requestParams(); return reportCaseService.listCaseStatisticRatio(params); } + + @GetMapping("list-page-user-location") + public SuccessResultList> listPageUserLocation (ListPage page){ + Map params = requestParams(); + PageHelper.startPage(page.getPage(), page.getRows()); + List> userLocationList = dataReleaseDao.listUserLocation(params); + List resList = new ArrayList<>(); + // 查询用户上传的最新的一条定位信息 + for(Map item : userLocationList){ + String userId = item.get("creator").toString(); + params.put("userId", userId); + Map temp = dataReleaseDao.getLastUserLocationInfo(params); + UserLocationDTO dto = new UserLocationDTO(); + dto.setUserLocationId(temp.get("user_location_id") == null ? "" : temp.get("user_location_id").toString()); + dto.setUserLongitude(temp.get("user_longitude") == null ? "" : temp.get("user_longitude").toString()); + dto.setUserLatitude(temp.get("user_latitude") == null ? "" : temp.get("user_latitude").toString()); + dto.setUserLocation(temp.get("user_location") == null ? "" : temp.get("user_location").toString()); + dto.setIsOverstep(temp.get("is_overstep") == null ? "" : temp.get("is_overstep").toString()); + dto.setUserName(temp.get("user_name") == null ? "" : temp.get("user_name").toString()); + dto.setCreator(temp.get("creator") == null ? "" : temp.get("creator").toString()); + dto.setGmtCreate(temp.get("gmt_create") == null ? "" : temp.get("gmt_create").toString()); + dto.setUserAvatar(temp.get("user_avatar") == null ? "" : temp.get("user_avatar").toString()); + dto.setUserPhone(temp.get("user_phone") == null ? "" : temp.get("user_phone").toString()); + resList.add(dto); + } + PageInfo> pageInfo = new PageInfo<>(userLocationList); + return new SuccessResultList<>(resList, pageInfo.getPageNum(), pageInfo.getTotal()); + } } diff --git a/src/main/java/com/cm/systemcity/dao/datarelease/IDataReleaseDao.java b/src/main/java/com/cm/systemcity/dao/datarelease/IDataReleaseDao.java index 7274ff9..057cbbd 100644 --- a/src/main/java/com/cm/systemcity/dao/datarelease/IDataReleaseDao.java +++ b/src/main/java/com/cm/systemcity/dao/datarelease/IDataReleaseDao.java @@ -56,4 +56,18 @@ public interface IDataReleaseDao { List> getCommunityInfo(Map param); List> listCaseInMap(Map params); + + /** + * 实时活跃人员列表(去重)查询-大数据接口 + * @param params + * @return + */ + List> listUserLocation(Map params); + + /** + * 查询人员上传定位的最后一条记录 + * @param params + * @return + */ + Map getLastUserLocationInfo(Map params); } diff --git a/src/main/java/com/cm/systemcity/service/userlocation/impl/UserLocationServiceImpl.java b/src/main/java/com/cm/systemcity/service/userlocation/impl/UserLocationServiceImpl.java index 94530ad..0aaf5d4 100755 --- a/src/main/java/com/cm/systemcity/service/userlocation/impl/UserLocationServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/userlocation/impl/UserLocationServiceImpl.java @@ -912,7 +912,7 @@ public class UserLocationServiceImpl extends BaseService implements IUserLocatio //userId = "f569baa1-8c99-47bb-98d8-5eea132e0051"; /** * 小王帅 2021年7月4日16:31:24 - * 因为片区信息中relation_id保存的是community_boss_id + * 因为片区信息中部分人员relation_id保存的是community_boss_id * 所以要用userId去查询 * 2021-10-12 一个用户可能有多个片区信息 */ diff --git a/src/main/resources/mybatis/mapper/datarelease/datarelease-mapper.xml b/src/main/resources/mybatis/mapper/datarelease/datarelease-mapper.xml index 00dae19..7322a7b 100644 --- a/src/main/resources/mybatis/mapper/datarelease/datarelease-mapper.xml +++ b/src/main/resources/mybatis/mapper/datarelease/datarelease-mapper.xml @@ -144,4 +144,33 @@ ORDER BY gmt_create DESC + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/bigdata/list-hour-user-rysshyqk.html b/src/main/resources/static/route/bigdata/list-hour-user-rysshyqk.html new file mode 100644 index 0000000..3aa6547 --- /dev/null +++ b/src/main/resources/static/route/bigdata/list-hour-user-rysshyqk.html @@ -0,0 +1,279 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+ + + + \ No newline at end of file