From 941396ae1d1e63112f80f7c02a2505f0ffd1966b Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Mon, 5 Jul 2021 11:35:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E6=97=B6=E5=9C=B0=E5=9B=BE=E5=8C=BA=E5=9F=9F=E8=A2=AB?= =?UTF-8?q?=E9=99=90=E5=88=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/userpoints/IUserPointsDao.java | 6 ++++++ .../impl/UserLocationServiceImpl.java | 16 ++++++++++++++-- .../userpoints/impl/UserPointsServiceImpl.java | 10 +++++++++- .../mapper/userpoints/userpoints-mapper.xml | 7 +++++++ .../static/route/userpoints/map_user.html | 2 +- 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/cm/systemcity/dao/userpoints/IUserPointsDao.java b/src/main/java/com/cm/systemcity/dao/userpoints/IUserPointsDao.java index 2fcd4f7..4232833 100755 --- a/src/main/java/com/cm/systemcity/dao/userpoints/IUserPointsDao.java +++ b/src/main/java/com/cm/systemcity/dao/userpoints/IUserPointsDao.java @@ -78,4 +78,10 @@ public interface IUserPointsDao { * @throws SearchException */ UserAndPointsDTO getUserAndPoints(Map params) throws SearchException; + + /** + * 根据gridId更新片区颜色 + * @param updateMap + */ + void updateGridColor(Map updateMap); } 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 f957c57..3081a2f 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 @@ -705,8 +705,20 @@ public class UserLocationServiceImpl extends BaseService implements IUserLocatio @Override public List listElectronicFenceOfMineByGridService(String token, Map params) { String userId = AppTokenManager.getInstance().getToken(token).getAppTokenUser().getId(); - List userIdList = new ArrayList<>(); - userIdList.add(userId); + /** + * 小王帅 2021年7月4日16:31:24 + * 因为片区信息中relation_id保存的是community_boss_id + * 所以要用userId去查询 + */ + Map queryMap = new HashMap<>(4); + queryMap.put("communityBossUserId",userId); + CommunityBossDTO communityBoss = communityBossService.getCommunityBoss(queryMap); + if(communityBoss == null){ + return new ArrayList<>(); + } + List userIdList = new ArrayList<>(); + // userIdList.add(userId); + userIdList.add(communityBoss.getCommunityBossId()); return userPointsService.listUserPointsByGridService(userIdList); } diff --git a/src/main/java/com/cm/systemcity/service/userpoints/impl/UserPointsServiceImpl.java b/src/main/java/com/cm/systemcity/service/userpoints/impl/UserPointsServiceImpl.java index cc05a03..263e325 100755 --- a/src/main/java/com/cm/systemcity/service/userpoints/impl/UserPointsServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/userpoints/impl/UserPointsServiceImpl.java @@ -522,6 +522,14 @@ public class UserPointsServiceImpl extends AbstractService implements IUserPoint } // 修改网格 for (GridVO gridVO : updateGrids) { + /** + * 小王帅 2021年7月4日16:41:56 + * 添加修改颜色 + */ + Map updateMap = new HashMap<>(8); + updateMap.put("gridId",gridVO.getId()); + updateMap.put("fillColor",gridVO.getFillColor()); + userPointsDao.updateGridColor(updateMap); gridService.updateGridPointArrayByGridId(gridVO.getId(), gridVO.getPointArray()); } // 删除关联关系 @@ -555,7 +563,7 @@ public class UserPointsServiceImpl extends AbstractService implements IUserPoint // 创建userId集合,用于请求GridService接口。 List userIdList = new ArrayList<>(); for (CommunityBossDTO communityBossDTO : communityBossDTOs) { - userIdList.add(communityBossDTO.getCommunityBossUserId()); + userIdList.add(communityBossDTO.getCommunityBossId()); } List userAndPointsDTOs = listUserPointsByGridService(userIdList); return userAndPointsDTOs; diff --git a/src/main/resources/mybatis/mapper/userpoints/userpoints-mapper.xml b/src/main/resources/mybatis/mapper/userpoints/userpoints-mapper.xml index a5c55bc..8fffa39 100755 --- a/src/main/resources/mybatis/mapper/userpoints/userpoints-mapper.xml +++ b/src/main/resources/mybatis/mapper/userpoints/userpoints-mapper.xml @@ -224,4 +224,11 @@ user_color_id = #{userColorId} + + + UPDATE map_grid SET + fill_color = #{fillColor} + WHERE + grid_id = #{gridId} + \ No newline at end of file diff --git a/src/main/resources/static/route/userpoints/map_user.html b/src/main/resources/static/route/userpoints/map_user.html index 6c85573..e3ebf11 100755 --- a/src/main/resources/static/route/userpoints/map_user.html +++ b/src/main/resources/static/route/userpoints/map_user.html @@ -147,7 +147,7 @@ baiduMap.getMap().addControl(mapTypeControl); var areaBounds = new BMap.Bounds(new BMap.Point(109.591583, 40.458812),new BMap.Point(110.505699, 40.826688)); try { - BMapLib.AreaRestriction.setBounds(baiduMap.getMap(), areaBounds); + //BMapLib.AreaRestriction.setBounds(baiduMap.getMap(), areaBounds); } catch (e) { console.log(e); }