修改编辑网格时地图区域被限制的问题

This commit is contained in:
wans 2021-07-05 11:35:10 +08:00
parent 3e23958fcc
commit 941396ae1d
5 changed files with 37 additions and 4 deletions

View File

@ -78,4 +78,10 @@ public interface IUserPointsDao {
* @throws SearchException
*/
UserAndPointsDTO getUserAndPoints(Map<String, Object> params) throws SearchException;
/**
* 根据gridId更新片区颜色
* @param updateMap
*/
void updateGridColor(Map<String, Object> updateMap);
}

View File

@ -705,8 +705,20 @@ public class UserLocationServiceImpl extends BaseService implements IUserLocatio
@Override
public List<GridDTO> listElectronicFenceOfMineByGridService(String token, Map<String, Object> params) {
String userId = AppTokenManager.getInstance().getToken(token).getAppTokenUser().getId();
List<String> userIdList = new ArrayList<>();
userIdList.add(userId);
/**
* 小王帅 2021年7月4日16:31:24
* 因为片区信息中relation_id保存的是community_boss_id
* 所以要用userId去查询
*/
Map<String, Object> queryMap = new HashMap<>(4);
queryMap.put("communityBossUserId",userId);
CommunityBossDTO communityBoss = communityBossService.getCommunityBoss(queryMap);
if(communityBoss == null){
return new ArrayList<>();
}
List<String> userIdList = new ArrayList<>();
// userIdList.add(userId);
userIdList.add(communityBoss.getCommunityBossId());
return userPointsService.listUserPointsByGridService(userIdList);
}

View File

@ -522,6 +522,14 @@ public class UserPointsServiceImpl extends AbstractService implements IUserPoint
}
// 修改网格
for (GridVO gridVO : updateGrids) {
/**
* 小王帅 2021年7月4日16:41:56
* 添加修改颜色
*/
Map<String, Object> 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<String> userIdList = new ArrayList<>();
for (CommunityBossDTO communityBossDTO : communityBossDTOs) {
userIdList.add(communityBossDTO.getCommunityBossUserId());
userIdList.add(communityBossDTO.getCommunityBossId());
}
List<GridDTO> userAndPointsDTOs = listUserPointsByGridService(userIdList);
return userAndPointsDTOs;

View File

@ -224,4 +224,11 @@
user_color_id = #{userColorId}
</select>
<!-- 根据gridId更新片区颜色-->
<update id="updateGridColor" parameterType="map">
UPDATE map_grid SET
fill_color = #{fillColor}
WHERE
grid_id = #{gridId}
</update>
</mapper>

View File

@ -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);
}