| | |
| | | ardAlarmpointsWell.setUpdateTime(DateUtils.getNowDate()); |
| | | return ardAlarmpointsWellMapper.updateArdAlarmpointsWell(ardAlarmpointsWell); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public int updateArdAlarmpointsWellByWellId(ArdAlarmpointsWell ardAlarmpointsWell) { |
| | | ardAlarmpointsWell.setUpdateBy(SecurityUtils.getUsername()); |
| | | ardAlarmpointsWell.setUpdateTime(DateUtils.getNowDate()); |
| | | return ardAlarmpointsWellMapper.updateArdAlarmpointsWellByWellId(ardAlarmpointsWell); |
| | | } |
| | | /** |
| | | * 批量删除井管理 |
| | | * |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String importUser(List<ArdAlarmpointsWell> ardAlarmpointsWellList, Boolean isUpdateSupport, String operName) { |
| | | public String importWell(List<ArdAlarmpointsWell> ardAlarmpointsWellList, Boolean isUpdateSupport, String operName) { |
| | | if (StringUtils.isNull(ardAlarmpointsWellList) || ardAlarmpointsWellList.size() == 0) { |
| | | throw new ServiceException("导入井数据不能为空!"); |
| | | } |
| | |
| | | //获取当前登录用户id |
| | | String userId = SecurityUtils.getUserId(); |
| | | well.setUserId(userId); |
| | | // 验证是否存在这个用户 |
| | | ArdAlarmpointsWell u = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(well.getWellId()); |
| | | if (StringUtils.isNull(u)) { |
| | | // 验证是否存在这个井 |
| | | ArdAlarmpointsWell w = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(well.getWellId()); |
| | | if (StringUtils.isNull(w)) { |
| | | BeanValidators.validateWithException(validator, well); |
| | | well.setCreateBy(operName); |
| | | this.insertArdAlarmpointsWell(well); |
| | |
| | | successMsg.append("<br/>" + successNum + "、井号 " + well.getWellId() + " 导入成功"); |
| | | } else if (isUpdateSupport) { |
| | | BeanValidators.validateWithException(validator, well); |
| | | checkWellAllowed(well); |
| | | checkWellDataScope(well.getUserId()); |
| | | well.setUpdateBy(operName); |
| | | this.updateArdAlarmpointsWell(well); |
| | | this.updateArdAlarmpointsWellByWellId(well); |
| | | successNum++; |
| | | successMsg.append("<br/>" + successNum + "、井号 " + well.getWellId() + " 更新成功"); |
| | | } else { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ArdAlarmpointsWell> getNearbyWellList(Double[] position, Long deptId, Integer range) { |
| | | public List<ArdAlarmpointsWell> getNearbyWellList(Double longitudeCenter,Double latitudeCenter, Long deptId, Integer range) { |
| | | List<ArdAlarmpointsWell> nearbyWellList = new ArrayList<>(); |
| | | try { |
| | | Double longitudeCenter = position[0]; |
| | | Double latitudeCenter = position[1]; |
| | | if (longitudeCenter != null && latitudeCenter != null) { |
| | | ArdAlarmpointsWell ardAlarmpointsWell=new ArdAlarmpointsWell(); |
| | | ardAlarmpointsWell.setDeptId(deptId); |