|  |  |  | 
|---|
|  |  |  | import com.moral.mapper.OrganizationMapper; | 
|---|
|  |  |  | import com.moral.service.AccountService; | 
|---|
|  |  |  | import com.moral.service.DeviceService; | 
|---|
|  |  |  | import com.moral.service.MonitorPointService; | 
|---|
|  |  |  | import com.moral.util.LatLngTransformation; | 
|---|
|  |  |  | import com.moral.util.TkMybatisUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.util.ObjectUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import tk.mybatis.mapper.entity.Example; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | 
|---|
|  |  |  | OrganizationMapper organizationMapper; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | DictionaryDataMapper dictionaryDataMapper; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private MonitorPointService monitorPointService ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public Map<String, Object> getDeviceStatesByAccount(Map<String, Object> parameters) { | 
|---|
|  |  |  | 
|---|
|  |  |  | public List<Device> query(Map<String, Object> params) { | 
|---|
|  |  |  | List<Integer> dv = deviceMapper.getHasWindDirAndWindSpeedDeviceVersion(); | 
|---|
|  |  |  | Object orgIdObj = params.get("orgId"); | 
|---|
|  |  |  | String regionCode = params.get("regionCode").toString(); | 
|---|
|  |  |  | List<Device> deviceList = null; | 
|---|
|  |  |  | if (orgIdObj != null) { | 
|---|
|  |  |  | Integer orgId = Integer.parseInt(orgIdObj.toString()); | 
|---|
|  |  |  | List<Integer> orgIds = orgMapper.selectLowerOrgIds(orgId); | 
|---|
|  |  |  | params.put("orgIds", orgIds); | 
|---|
|  |  |  | System.out.println(params); | 
|---|
|  |  |  | //剔除沧州地图页面非公司设备图标 | 
|---|
|  |  |  | if (regionCode.startsWith("1309")) { | 
|---|
|  |  |  | orgIds = new ArrayList<>(); | 
|---|
|  |  |  | Collections.addAll(orgIds, 60, 65, 159, 165, 166); | 
|---|
|  |  |  | deviceList = deviceMapper.selectByMap(params); | 
|---|
|  |  |  | Iterator<Device> iter = deviceList.iterator(); | 
|---|
|  |  |  | while (iter.hasNext()) { | 
|---|
|  |  |  | Device device = iter.next(); | 
|---|
|  |  |  | Integer mpId = device.getMonitorPointId(); | 
|---|
|  |  |  | Integer oid = monitorPointService.byIdGetMonitorPoint(mpId).getOrganizationId(); | 
|---|
|  |  |  | if (!orgIds.contains(oid)) { | 
|---|
|  |  |  | iter.remove(); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | if (orgId == 60) { | 
|---|
|  |  |  | if (mpId != 56) { | 
|---|
|  |  |  | iter.remove(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (orgId == 65) { | 
|---|
|  |  |  | if (mpId != 83 && mpId != 84) { | 
|---|
|  |  |  | iter.remove(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | params.put("orgIds", orgIds); | 
|---|
|  |  |  | deviceList = deviceMapper.selectByMap(params); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // loadDeviceState(deviceList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Example deviceExample = new Example(Device.class);//实例化 | 
|---|