| | |
| | | public FebsResponse leaderUpdate(MallTeamLeader mallTeamLeader) { |
| | | Long id = mallTeamLeader.getId(); |
| | | MallTeamLeader mallTeamLeaders = this.baseMapper.selectById(id); |
| | | if(1 == mallTeamLeader.getOnlineState()){ |
| | | if(1 == mallTeamLeaders.getOnlineState()){ |
| | | return new FebsResponse().fail().message("请先让团长离线"); |
| | | } |
| | | if(ObjectUtil.isEmpty(mallTeamLeaders)){ |
| | |
| | | |
| | | private final XcxProperties xcxProperties = SpringContextHolder.getBean(XcxProperties.class); |
| | | @Override |
| | | @Transactional |
| | | public FebsResponse addFence(AdminLeaderAddFenceDto adminLeaderAddFenceDto) { |
| | | Long id = adminLeaderAddFenceDto.getId(); |
| | | MallTeamLeader mallTeamLeader = this.baseMapper.selectById(id); |
| | |
| | | if("fail".equals(resultStr)){ |
| | | return new FebsResponse().fail().message("高德地图查询服务失败"); |
| | | } |
| | | JSONObject jsonObject = JSONUtil.parseObj(resultStr); |
| | | String results = jsonObject.get("results").toString(); |
| | | JSONArray jsonArray = JSONUtil.parseArray(results); |
| | | for(Object jsonArray1 : jsonArray){ |
| | | JSONObject jsonObject1 = JSONUtil.parseObj(jsonArray1); |
| | | String name = jsonObject1.get("name").toString(); |
| | | String sid = jsonObject1.get("sid").toString(); |
| | | if(xcxProperties.getServiceName().equals(name)){ |
| | | serviceId= sid; |
| | | break; |
| | | } |
| | | } |
| | | if(StrUtil.isBlank(serviceId)){ |
| | | log.info(resultStr); |
| | | if("null".equals(resultStr) || StrUtil.isBlank(resultStr)){ |
| | | serviceId = iMallElectronicFenceService.trackServiceAdd(xcxProperties.getGaodeKey(), xcxProperties.getServiceName()); |
| | | }else{ |
| | | JSONObject jsonObject = JSONUtil.parseObj(resultStr); |
| | | String results = jsonObject.get("results").toString(); |
| | | JSONArray jsonArray = JSONUtil.parseArray(results); |
| | | for(Object jsonArray1 : jsonArray){ |
| | | JSONObject jsonObject1 = JSONUtil.parseObj(jsonArray1); |
| | | String name = jsonObject1.get("name").toString(); |
| | | String sid = jsonObject1.get("sid").toString(); |
| | | if(xcxProperties.getServiceName().equals(name)){ |
| | | serviceId= sid; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | serviceId = mallElectronicFences.get(0).getServiceId(); |