| | |
| | | */ |
| | | package org.sxkj.fw.record.service.impl; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.sxkj.common.utils.HeaderUtils; |
| | | import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO; |
| | | import org.sxkj.fw.record.dto.FwDroneAlarmRecordDTO; |
| | |
| | | import org.sxkj.system.entity.Dept; |
| | | import org.sxkj.system.entity.Region; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @since 2026-01-08 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class FwDroneAlarmRecordServiceImpl extends BaseServiceImpl<FwDroneAlarmRecordMapper, FwDroneAlarmRecordEntity> implements IFwDroneAlarmRecordService { |
| | | |
| | | @Autowired |
| | | private FwDevicePerShareMapper fwDevicePerShareMapper; |
| | | |
| | | /** |
| | | * 查询无人机告警记录分页列表 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param fwDroneAlarmRecord 无人机告警记录查询参数 |
| | | * @return 分页结果 |
| | | */ |
| | | @Override |
| | | public IPage<FwDroneAlarmRecordVO> selectFwDroneAlarmRecordPage(IPage<FwDroneAlarmRecordVO> page, FwDroneAlarmRecordDTO fwDroneAlarmRecord) { |
| | | // 设置当前用户ID |
| | | fwDroneAlarmRecord.setCurrentUserId(AuthUtil.getUserId()); |
| | | log.info("查询参数:{}", fwDroneAlarmRecord); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | log.info("部门信息:{}", dept); |
| | | // 3. 查询不在这些部门区域内的设备 |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | log.info("部门区域信息:{}", byCode); |
| | | fwDroneAlarmRecord.setRegionName(byCode.getName()); |
| | | fwDroneAlarmRecord.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | fwDroneAlarmRecord.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode())); |
| | | // 获取当前部门及其子部门列表 |
| | | // List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | // fwDroneAlarmRecord.setDeptList(deptList); |
| | | // 获取共享给当前部门的设备编号列表 |
| | | // 执行查询 |
| | | return page.setRecords(baseMapper.selectFwDroneAlarmRecordPage(page, fwDroneAlarmRecord)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<FwDroneAlarmRecordExcel> exportFwDroneAlarmRecord(FwDroneAlarmRecordExportParam fwDroneAlarmRecord) { |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | fwDroneAlarmRecord.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode())); |
| | | fwDroneAlarmRecord.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | List<FwDroneAlarmRecordExcel> fwDroneAlarmRecordList = baseMapper.exportFwDroneAlarmRecord(fwDroneAlarmRecord); |
| | | return fwDroneAlarmRecordList; |
| | | } |