15 files modified
1 files added
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.sxkj.common.utils.HeaderUtils; |
| | | import org.sxkj.fw.cockpit.service.ICockpitService; |
| | | import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO; |
| | | import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO; |
| | |
| | | |
| | | @Override |
| | | public IPage<CockpitFwDeviceVO> selectCockpitDevicePage(IPage<CockpitFwDeviceVO> page, FwDeviceDTO fwDevice) { |
| | | // List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | // fwDevice.setDeptList(deptList); |
| | | // fwDevice.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | String regionName = byCode.getName(); |
| | | fwDevice.setRegionName(regionName); |
| | | fwDevice.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | fwDevice.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode())); |
| | | fwDevice.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | IPage<CockpitFwDeviceVO> cockpitFwDeviceVOIPage = fwDeviceService.selectCockpitDevicePage(page, fwDevice); |
| | | return cockpitFwDeviceVOIPage; |
| | | } |
| | |
| | | // List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | String regionName = byCode.getName(); |
| | | return fwDeviceService.statisticalDeviceType(regionName, AuthUtil.getDeptId()); |
| | | return fwDeviceService.statisticalDeviceType(HeaderUtils.formatAreaCode(byCode.getCode()), AuthUtil.getDeptId()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | // List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | String regionName = byCode.getName(); |
| | | String regionCode = HeaderUtils.formatAreaCode(byCode.getCode()); |
| | | // 设备统计 |
| | | AlarmStatisticsVO alarmStatisticsVO = fwDeviceService.statisticalDeviceAtt(regionName, AuthUtil.getDeptId()); |
| | | AlarmStatisticsVO alarmStatisticsVO = fwDeviceService.statisticalDeviceAtt(regionCode, AuthUtil.getDeptId()); |
| | | // 告警统计 |
| | | AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(regionName, AuthUtil.getDeptId()); |
| | | AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(regionCode, AuthUtil.getDeptId()); |
| | | alarmStatisticsVO.setHistoryAlarmCount(alarmStatistics.getHistoryAlarmCount()); |
| | | alarmStatisticsVO.setRealTimeAlarmCount(alarmStatistics.getRealTimeAlarmCount()); |
| | | return alarmStatisticsVO; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param effectiveRangeKmIsNotNull |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull) { |
| | | return fwDeviceService.getDeviceOutStatistics(effectiveRangeKmIsNotNull); |
| | | FwDeviceDTO fwDeviceDTO = new FwDeviceDTO(); |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | fwDeviceDTO.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | fwDeviceDTO.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode())); |
| | | return fwDeviceService.getDeviceStatistics(fwDeviceDTO); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.sxkj.fw.common; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class FwBaseInfo { |
| | | |
| | | @ApiModelProperty(value = "部门集合",hidden = true) |
| | | private List<Long> deptList; |
| | | |
| | | @ApiModelProperty(value = "部门id",hidden = true) |
| | | private String currentDeptId; |
| | | |
| | | @ApiModelProperty(value = "区域名称") |
| | | private String regionName; |
| | | |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String regionCode; |
| | | } |
| | |
| | | public R submit(@Valid @RequestBody FwDeviceDTO fwDevice) { |
| | | return R.status(fwDeviceService.saveOrUpdateDevice(FwDeviceWrapper.build().entityDTO(fwDevice))); |
| | | } |
| | | |
| | | /** |
| | | * 设备表 新增或修改 |
| | | */ |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "修改设备出入库状态", notes = "传入fwDevice") |
| | | public R updateTrackStatus(@ApiParam(value = "", required = true) @RequestParam Long deviceId) { |
| | | return R.status(fwDeviceService.updateTrackStatusByDeviceId(deviceId,0,"")); |
| | | return R.status(fwDeviceService.updateTrackStatusByDeviceId(deviceId, 0, "", "")); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 设备类型统计 |
| | | * |
| | | * @return 统计数据 |
| | | */ |
| | | @GetMapping("/statisticalDeviceType") |
| | |
| | | |
| | | /** |
| | | * 设备出库去向统计 |
| | | * |
| | | * @return 统计数据 |
| | | */ |
| | | @GetMapping("/statisticalDeviceOut") |
| | |
| | | |
| | | /** |
| | | * 设备生产厂商统计 |
| | | * |
| | | * @return 统计数据 |
| | | */ |
| | | @GetMapping("/statisticalDeviceManufacturer") |
| | |
| | | |
| | | /** |
| | | * 查询非本部门区域的设备 |
| | | * |
| | | * @param regionCode 区域编码,用于查询不在该区域内的设备 |
| | | * @param deptId 机构ID,用于限定查询范围 |
| | | * @param deptId 机构ID,用于限定查询范围 |
| | | * @return 设备列表 |
| | | */ |
| | | @GetMapping("/nonDeptAreaDevices") |
| | |
| | | @ApiImplicitParam(name = "deptId", value = "机构ID", paramType = "query", dataType = "string", required = true) |
| | | }) |
| | | public R<List<FwDeviceVO>> getNonDeptAreaDevices( |
| | | @ApiParam(value = "区域编码", required = true) @RequestParam String regionCode, |
| | | @ApiParam(value = "机构ID", required = true) @RequestParam String deptId) { |
| | | @ApiParam(value = "区域编码", required = true) @RequestParam String regionCode, |
| | | @ApiParam(value = "机构ID", required = true) @RequestParam String deptId) { |
| | | return R.data(fwDeviceService.getNonDeptAreaDevices(regionCode, deptId)); |
| | | } |
| | | |
| | |
| | | @ApiIgnore |
| | | public void exportFwDevice(@ApiIgnore @RequestParam Map<String, Object> fwDevice, BladeUser bladeUser, HttpServletResponse response) { |
| | | QueryWrapper<FwDeviceEntity> queryWrapper = Condition.getQueryWrapper(fwDevice, FwDeviceEntity.class); |
| | | //if (!AuthUtil.isAdministrator()) { |
| | | // if (!AuthUtil.isAdministrator()) { |
| | | // queryWrapper.lambda().eq(FwDevice::getTenantId, bladeUser.getTenantId()); |
| | | //} |
| | | queryWrapper.lambda().eq(FwDeviceEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import javax.validation.constraints.NotEmpty; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import org.sxkj.fw.common.FwBaseInfo; |
| | | |
| | | /** |
| | | * 设备表 数据传输对象实体类 |
| | |
| | | * @since 2026-01-08 |
| | | */ |
| | | @Data |
| | | public class FwDeviceDTO implements Serializable { |
| | | public class FwDeviceDTO extends FwBaseInfo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @ApiModelProperty(value = "经度") |
| | | private String longitude; |
| | | |
| | | @ApiModelProperty(value = "部门集合",hidden = true) |
| | | private List<Long> deptList; |
| | | // 当前用户部门id |
| | | @ApiModelProperty(value = "部门id",hidden = true) |
| | | private String currentDeptId; |
| | | |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | |
| | | */ |
| | | @ApiModelProperty(value = "删除标志(0存在 1删除)") |
| | | private Integer isDeleted; |
| | | // setRegionName |
| | | @ApiModelProperty(value = "区域名称") |
| | | private String regionName; |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "出库去向") |
| | | private String outTarget; |
| | | |
| | | /** |
| | | * 出库去向 |
| | | */ |
| | | @ApiModelProperty(value = "出库去向编码") |
| | | private String outTargetCode; |
| | | /** |
| | | * 用途 |
| | | */ |
| | |
| | | */ |
| | | @ApiModelProperty(value = "出库去向") |
| | | private String outTarget; |
| | | |
| | | /** |
| | | * 出库去向 |
| | | */ |
| | | @ApiModelProperty(value = "出库去向编码") |
| | | private String outTargetCode; |
| | | /** |
| | | * 用途 |
| | | */ |
| | |
| | | * 设备统计 - 驾驶舱使用 |
| | | * @return 统计数据 |
| | | */ |
| | | List<DeviceStatisticsVO> statisticalDeviceType(String regionName, String currentDeptId); |
| | | List<DeviceStatisticsVO> statisticalDeviceType(String regionCode, String currentDeptId); |
| | | |
| | | /** |
| | | * 设备统计 - 按类型统计 |
| | |
| | | * 告警统计 |
| | | * @return |
| | | */ |
| | | AlarmStatisticsVO statisticalDeviceAtt(String regionName, String currentDeptId); |
| | | AlarmStatisticsVO statisticalDeviceAtt(String regionCode, String currentDeptId); |
| | | |
| | | /** |
| | | * 获取设备列表 |
| | |
| | | * @param trackStatus 出入库状态 |
| | | * @return 影响行数 |
| | | */ |
| | | int updateTrackStatusByDeviceId(@Param("deviceId") Long deviceId, @Param("trackStatus") Integer trackStatus, @Param("outTarget") String outTarget); |
| | | int updateTrackStatusByDeviceId(@Param("deviceId") Long deviceId, @Param("trackStatus") Integer trackStatus, @Param("outTarget") String outTarget, @Param("outTargetCode") String outTargetCode); |
| | | |
| | | /** |
| | | * 查询非本部门区域的设备 |
| | |
| | | * @return 设备列表 |
| | | */ |
| | | List<FwDeviceVO> selectNonDeptAreaDevices(@Param("regionName") String regionName, @Param("currentDeptId") String currentDeptId); |
| | | |
| | | /** |
| | | * |
| | | * @param fwDeviceDTO |
| | | * @return |
| | | */ |
| | | List<DeviceStatisticsVO> getDeviceStatistics(FwDeviceDTO fwDeviceDTO); |
| | | } |
| | |
| | | d.is_deleted = 0 |
| | | AND d.is_enabled = 1 |
| | | AND status != 3 |
| | | <if test="regionName != null and regionName != ''"> |
| | | and (d.final_outbound_area = #{regionName} |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and (d.final_outbound_area_code like concat(#{regionCode}, '%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or d.id in ( |
| | |
| | | AND is_enabled = 1 |
| | | AND status != 3 |
| | | AND device_type = '3' |
| | | <if test="regionName != null and regionName != ''"> |
| | | and (d.final_outbound_area = #{regionName} |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and (d.final_outbound_area_code like concat(#{regionCode}, '%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or d.id in ( |
| | |
| | | d.is_deleted = 0 |
| | | AND d.is_enabled = 1 |
| | | AND d.final_outbound_area IS NOT NULL |
| | | <!-- <if test="effectiveRangeKmIsNotNull != null and effectiveRangeKmIsNotNull == 1"> --> |
| | | <!-- and d.effective_range_km is not null --> |
| | | <!-- and d.effective_range_km > 0 --> |
| | | <!-- </if> --> |
| | | <if test="effectiveRangeKmIsNotNull != null and effectiveRangeKmIsNotNull == 2"> |
| | | and (d.effective_range_km is null or d.effective_range_km = 0) |
| | | </if> |
| | |
| | | WHERE |
| | | d.is_deleted = 0 |
| | | and d.is_enabled = 1 |
| | | <if test="regionName != null and regionName != ''"> |
| | | and (d.final_outbound_area = #{regionName} |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and (d.final_outbound_area_code like concat(#{regionCode},'%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or d.id in ( |
| | |
| | | d.is_deleted = 0 |
| | | and d.is_enabled = 1 |
| | | AND device_att = '1' |
| | | <if test="regionName != null and regionName != ''"> |
| | | and (d.final_outbound_area = #{regionName} |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and (d.final_outbound_area_code like concat(#{regionCode},'%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or d.id in ( |
| | |
| | | WHERE d.is_deleted = 0 |
| | | and d.is_enabled = 1 |
| | | AND device_att = '2' |
| | | <if test="regionName != null and regionName != ''"> |
| | | and (d.final_outbound_area = #{regionName} |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and (d.final_outbound_area_code like concat(#{regionCode},'%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or d.id in ( |
| | |
| | | WHERE d.is_deleted = 0 |
| | | and d.is_enabled = 1 |
| | | AND device_att = '3' |
| | | <if test="regionName != null and regionName != ''"> |
| | | and (d.final_outbound_area = #{regionName} |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and (d.final_outbound_area_code like concat(#{regionCode},'%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or d.id in ( |
| | |
| | | WHERE d.is_deleted = 0 |
| | | and d.is_enabled = 1 |
| | | AND status in ('1', '2', '3' ) |
| | | <if test="regionName != null and regionName != ''"> |
| | | and (d.final_outbound_area = #{regionName} |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and (d.final_outbound_area_code like concat(#{regionCode},'%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or d.id in ( |
| | |
| | | <where> |
| | | d.is_deleted = 0 |
| | | and d.is_enabled = 1 |
| | | <if test="param2.regionName != null and param2.regionName != ''"> |
| | | and (d.final_outbound_area = #{param2.regionName} |
| | | <if test="param2.regionCode != null and param2.regionCode != ''"> |
| | | and (d.final_outbound_area_code like concat(#{param2.regionCode},'%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="param2.currentDeptId != null and param2.currentDeptId != '' "> |
| | | or d.id in ( |
| | |
| | | update |
| | | ja_fw_device |
| | | set track_status = #{trackStatus}, |
| | | final_outbound_area = #{outTarget} |
| | | final_outbound_area = #{outTarget}, |
| | | final_outbound_area_code = #{outTargetCode} |
| | | where id = #{deviceId} |
| | | and is_deleted = 0 |
| | | </update> |
| | |
| | | AND d.final_outbound_area != #{regionName} |
| | | </select> |
| | | |
| | | <select id="getDeviceStatistics" resultType="org.sxkj.fw.cockpit.vo.DeviceStatisticsVO"> |
| | | SELECT |
| | | d.final_outbound_area AS type, |
| | | COUNT(*) AS count |
| | | FROM |
| | | ja_fw_device d |
| | | WHERE |
| | | d.is_deleted = 0 |
| | | AND d.is_enabled = 1 |
| | | AND d.final_outbound_area IS NOT NULL |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and ( d.final_outbound_area_code like concat(#{regionCode},'%') |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or d.id in ( |
| | | SELECT device_id FROM ja_fw_device_per_share |
| | | WHERE loan_to_dept_id = #{currentDeptId} |
| | | AND is_deleted = 0 |
| | | ) |
| | | </if> |
| | | ) |
| | | </if> |
| | | GROUP BY |
| | | d.final_outbound_area |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * 设备类型统计 |
| | | * @return |
| | | */ |
| | | List<DeviceStatisticsVO> statisticalDeviceType(String regionName, String currentDeptId); |
| | | List<DeviceStatisticsVO> statisticalDeviceType(String regionCode, String currentDeptId); |
| | | |
| | | /** |
| | | * 设备统计 - 按类型统计 |
| | |
| | | * 设备报警统计 |
| | | * @return |
| | | */ |
| | | AlarmStatisticsVO statisticalDeviceAtt(String regionName, String currentDeptId); |
| | | AlarmStatisticsVO statisticalDeviceAtt(String regionCode, String currentDeptId); |
| | | |
| | | /** |
| | | * 驾驶舱获取设备列表 |
| | |
| | | * @param trackStatus 出入库状态 |
| | | * @return 是否更新成功 |
| | | */ |
| | | boolean updateTrackStatusByDeviceId(Long deviceId, Integer trackStatus, String outTarget); |
| | | boolean updateTrackStatusByDeviceId(Long deviceId, Integer trackStatus, String outTarget, String outTargetCode); |
| | | |
| | | /** |
| | | * 查询非本部门区域的设备 |
| | |
| | | * @return 设备列表 |
| | | */ |
| | | List<FwDeviceVO> getNonDeptAreaDevices(String regionCode, String deptId); |
| | | |
| | | /** |
| | | * |
| | | * @param fwDeviceDTO |
| | | * @return |
| | | */ |
| | | List<DeviceStatisticsVO> getDeviceStatistics(FwDeviceDTO fwDeviceDTO); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DeviceStatisticsVO> statisticalDeviceType(String regionName, String currentDeptId) { |
| | | return baseMapper.statisticalDeviceType(regionName, currentDeptId); |
| | | public List<DeviceStatisticsVO> statisticalDeviceType(String regionCode, String currentDeptId) { |
| | | return baseMapper.statisticalDeviceType(regionCode, currentDeptId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AlarmStatisticsVO statisticalDeviceAtt(String regionName, String currentDeptId) { |
| | | return baseMapper.statisticalDeviceAtt(regionName, currentDeptId); |
| | | public AlarmStatisticsVO statisticalDeviceAtt(String regionCode, String currentDeptId) { |
| | | return baseMapper.statisticalDeviceAtt(regionCode, currentDeptId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateTrackStatusByDeviceId(Long deviceId, Integer trackStatus, String outTarget) { |
| | | return baseMapper.updateTrackStatusByDeviceId(deviceId, trackStatus, outTarget) > 0; |
| | | public boolean updateTrackStatusByDeviceId(Long deviceId, Integer trackStatus, String outTarget, String outTargetCode) { |
| | | return baseMapper.updateTrackStatusByDeviceId(deviceId, trackStatus, outTarget, outTargetCode) > 0; |
| | | } |
| | | |
| | | /** |
| | |
| | | List<FwDeviceVO> deviceList = baseMapper.selectNonDeptAreaDevices(regionName, deptId); |
| | | return deviceList; |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceStatisticsVO> getDeviceStatistics(FwDeviceDTO fwDeviceDTO) { |
| | | return baseMapper.getDeviceStatistics(fwDeviceDTO); |
| | | } |
| | | } |
| | |
| | | public boolean saveOrUpdateFwDeviceTrack(FwDeviceTrackEntity fwDeviceTrackEntity) { |
| | | boolean b = saveOrUpdate(fwDeviceTrackEntity); |
| | | if (b) { |
| | | return fwDeviceService.updateTrackStatusByDeviceId(fwDeviceTrackEntity.getDeviceId(), 1, fwDeviceTrackEntity.getOutTarget()); |
| | | return fwDeviceService.updateTrackStatusByDeviceId(fwDeviceTrackEntity.getDeviceId(), 1, fwDeviceTrackEntity.getOutTarget(),fwDeviceTrackEntity.getOutTargetCode()); |
| | | } |
| | | return false; |
| | | } |
| | |
| | | // 当前用户部门ID |
| | | @ApiModelProperty(value = "当前用户部门ID",hidden = true) |
| | | private String currentDeptId; |
| | | // regionName |
| | | |
| | | @ApiModelProperty(value = "regionName",hidden = true) |
| | | private String regionName; |
| | | |
| | | @ApiModelProperty(value = "regionCode",hidden = true) |
| | | private String regionCode; |
| | | } |
| | |
| | | * 告警类型统计 |
| | | * @return |
| | | */ |
| | | AlarmStatisticsVO alarmTypeStatistics(String regionName, String currentDeptId); |
| | | AlarmStatisticsVO alarmTypeStatistics(String regionCode, String currentDeptId); |
| | | } |
| | |
| | | <where> |
| | | dar.is_deleted = 0 |
| | | and d.is_enabled = 1 |
| | | <if test="param2.regionName != null and param2.regionName != ''"> |
| | | and (d.final_outbound_area = #{param2.regionName} |
| | | <if test="param2.regionCode != null and param2.regionCode != ''"> |
| | | and (d.final_outbound_area_code like CONCAT(#{param2.regionCode}, '%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="param2.currentDeptId != null and param2.currentDeptId != '' "> |
| | | or dar.device_id in ( |
| | |
| | | WHERE dar.is_deleted = 0 |
| | | AND d.is_deleted = 0 |
| | | and d.is_enabled = 1 |
| | | <if test="regionName != null and regionName != ''"> |
| | | and (d.final_outbound_area = #{regionName} |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and (d.final_outbound_area_code like CONCAT(#{regionCode}, '%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or dar.device_id in ( |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | AlarmStatisticsVO alarmTypeStatistics(String regionName, String currentDeptId); |
| | | AlarmStatisticsVO alarmTypeStatistics(String regionCode, String currentDeptId); |
| | | } |
| | |
| | | package org.sxkj.fw.record.service.impl; |
| | | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.sxkj.common.utils.HeaderUtils; |
| | | import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO; |
| | | import org.sxkj.fw.record.dto.FwDroneAlarmRecordDTO; |
| | | import org.sxkj.fw.record.entity.FwDroneAlarmRecordEntity; |
| | |
| | | Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId())); |
| | | // 3. 查询不在这些部门区域内的设备 |
| | | Region byCode = RegionCache.getByCode(dept.getAreaCode()); |
| | | String regionName = byCode.getName(); |
| | | fwDroneAlarmRecord.setRegionName(regionName); |
| | | 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); |
| | | // 获取共享给当前部门的设备编号列表 |
| | | fwDroneAlarmRecord.setCurrentDeptId(AuthUtil.getDeptId()); |
| | | // 执行查询 |
| | | return page.setRecords(baseMapper.selectFwDroneAlarmRecordPage(page, fwDroneAlarmRecord)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AlarmStatisticsVO alarmTypeStatistics(String regionName, String currentDeptId) { |
| | | return baseMapper.alarmTypeStatistics(regionName, currentDeptId); |
| | | public AlarmStatisticsVO alarmTypeStatistics(String regionCode, String currentDeptId) { |
| | | return baseMapper.alarmTypeStatistics(regionCode, currentDeptId); |
| | | } |
| | | } |