| | |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private XpElectronicFenceMapper xpElectronicFenceMapper; |
| | | |
| | | @Resource |
| | | @Lazy |
| | | private XpStationService xpStationService; |
| | | |
| | | @Resource |
| | |
| | | BeanUtils.copyProperties(pointAddDto, xpPoint); |
| | | xpPoint.setFpElectronicAreaId(pointAddDto.getElectronicAreaId()); |
| | | xpPoint.setPointNumber(pointNumber); |
| | | xpPoint.setStationSortNo(0); |
| | | this.save(xpPoint); |
| | | |
| | | //场站点位排序 后添加的点位 排第一个。 |
| | | this.setStationSortNo(xpPoint.getStationId(),0); |
| | | |
| | | return xpPoint; |
| | | } |
| | | |
| | | /** |
| | | * 场站 点位排序 |
| | | * @param stationId |
| | | * @param stationSortNo |
| | | */ |
| | | @Transactional |
| | | @Override |
| | | public void setStationSortNo(Long stationId, Integer stationSortNo){ |
| | | if(null != stationId && stationSortNo != null && stationSortNo ==0){ |
| | | // 查询该场站下的所有点位,按 stationSortNo 排序 |
| | | List<XpPoint> points = this.lambdaQuery() |
| | | .eq(XpPoint::getStationId, stationId) |
| | | .orderByAsc(XpPoint::getStationSortNo) |
| | | .list(); |
| | | |
| | | if (CollUtil.isNotEmpty(points)) { |
| | | int newSortNo = 1; |
| | | for (XpPoint point : points) { |
| | | point.setStationSortNo(newSortNo++); |
| | | } |
| | | this.updateBatchById(points); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String getPointNumber(Long electronicAreaId) { |
| | | String cityPrefix = buildCityPrefix(electronicAreaId); |
| | |
| | | continue; |
| | | } |
| | | String downloadUrl =""; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | log.info("downloadUrl:{}", downloadUrl); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | // try { todo 20260422 yyy暂时注释 |
| | | // downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | // log.info("downloadUrl:{}", downloadUrl); |
| | | // } catch (UnsupportedEncodingException e) { |
| | | // log.error("获取图片下载地址失败", e); |
| | | // } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | log.info("jsonArray:{}", jsonArray); |
| | |
| | | } |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void statusEnableByStationId(Long stationId) { |
| | | if (stationId == null) { |
| | | return; |
| | | } |
| | | this.lambdaUpdate() |
| | | .eq(XpPoint::getStationId, stationId) |
| | | .set(XpPoint::getOperationStatus, 2)//运营状态 1=待启用 2=启用中 3=已停用 4=已失效 |
| | | .update(); |
| | | } |
| | | |
| | | /** |
| | | * 场站删除 |
| | | * - 删除拦截逻辑: |