| | |
| | | @ApiModelProperty(value = "关联派出所id") |
| | | private Long policeStationId; |
| | | /** |
| | | * 关联设备ID,逗号分隔 |
| | | */ |
| | | @ApiModelProperty(value = "关联设备ID,逗号分隔") |
| | | private String deviceIds; |
| | | /** |
| | | * 可飞行日期时间-开始 |
| | | */ |
| | | @ApiModelProperty(value = "可飞行日期时间-开始") |
| | |
| | | @ApiModelProperty(value = "关联派出所id") |
| | | private Long policeStationId; |
| | | /** |
| | | * 关联设备ID,逗号分隔 |
| | | */ |
| | | @TableField("device_ids") |
| | | @ApiModelProperty(value = "关联设备ID,逗号分隔") |
| | | private String deviceIds; |
| | | /** |
| | | * 可飞行日期时间-开始 |
| | | */ |
| | | @TableField("fly_date_start") |
| | |
| | | @ApiModelProperty(value = "关联区域ID,逗号分隔") |
| | | private String areaDivideIds; |
| | | /** |
| | | * 关联设备ID,逗号分隔 |
| | | */ |
| | | @TableField("device_ids") |
| | | @ApiModelProperty(value = "关联设备ID,逗号分隔") |
| | | private String deviceIds; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @TableField("area_code") |
| | |
| | | @ExcelProperty("关联派出所id") |
| | | private Long policeStationId; |
| | | /** |
| | | * 关联设备ID,逗号分隔 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("关联设备ID,逗号分隔") |
| | | private String deviceIds; |
| | | /** |
| | | * 可飞行日期时间-开始 |
| | | */ |
| | | @ColumnWidth(20) |
| | |
| | | @ExcelProperty("关联区域ID,逗号分隔") |
| | | private String areaDivideIds; |
| | | /** |
| | | * 关联设备ID,逗号分隔 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("关联设备ID,逗号分隔") |
| | | private String deviceIds; |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ColumnWidth(20) |
| | |
| | | <result column="response_mechanism" property="responseMechanism"/> |
| | | <result column="control_level" property="controlLevel"/> |
| | | <result column="police_station_id" property="policeStationId"/> |
| | | <result column="device_ids" property="deviceIds"/> |
| | | <result column="fly_date_start" property="flyDateStart"/> |
| | | <result column="fly_date_end" property="flyDateEnd"/> |
| | | <result column="area_code" property="areaCode"/> |
| | |
| | | ad.response_mechanism, |
| | | ad.control_level, |
| | | ad.police_station_id, |
| | | ad.device_ids, |
| | | ad.fly_date_start, |
| | | ad.fly_date_end, |
| | | ad.area_code, |
| | |
| | | <if test="param2.policeStationId != null and param2.policeStationId != ''"> |
| | | and ad.police_station_id = #{param2.policeStationId} |
| | | </if> |
| | | <if test="param2.deviceIds != null and param2.deviceIds != ''"> |
| | | and ad.device_ids = #{param2.deviceIds} |
| | | </if> |
| | | <if test="param2.flyDateStart != null and param2.flyDateStart != ''"> |
| | | and ad.fly_date_start >= #{param2.flyDateStart} |
| | | </if> |
| | |
| | | ad.response_mechanism, |
| | | ad.control_level, |
| | | ad.police_station_id, |
| | | ad.device_ids, |
| | | ad.fly_date_start, |
| | | ad.fly_date_end, |
| | | ad.area_code, |
| | |
| | | response_mechanism, |
| | | control_level, |
| | | police_station_id, |
| | | device_ids, |
| | | fly_date_start, |
| | | fly_date_end, |
| | | area_code, |
| | |
| | | response_mechanism, |
| | | control_level, |
| | | police_station_id, |
| | | device_ids, |
| | | fly_date_start, |
| | | fly_date_end, |
| | | area_code, |
| | |
| | | #{responseMechanism}, |
| | | #{controlLevel}, |
| | | #{policeStationId}, |
| | | #{deviceIds}, |
| | | #{flyDateStart}, |
| | | #{flyDateEnd}, |
| | | #{areaCode}, |
| | |
| | | <if test="responseMechanism != null">response_mechanism = #{responseMechanism},</if> |
| | | <if test="controlLevel != null">control_level = #{controlLevel},</if> |
| | | <if test="policeStationId != null">police_station_id = #{policeStationId},</if> |
| | | <if test="deviceIds != null">device_ids = #{deviceIds},</if> |
| | | <if test="flyDateStart != null">fly_date_start = #{flyDateStart},</if> |
| | | <if test="flyDateEnd != null">fly_date_end = #{flyDateEnd},</if> |
| | | <if test="areaCode != null">area_code = #{areaCode},</if> |
| | |
| | | <result column="defense_area" property="defenseArea"/> |
| | | <result column="device_mode" property="deviceMode"/> |
| | | <result column="area_divide_ids" property="areaDivideIds"/> |
| | | <result column="device_ids" property="deviceIds"/> |
| | | <result column="area_code" property="areaCode"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_dept" property="createDept"/> |
| | |
| | | </if> |
| | | <if test="param2.areaDivideIds != null and param2.areaDivideIds != ''"> |
| | | and area_divide_ids = #{param2.areaDivideIds} |
| | | </if> |
| | | <if test="param2.deviceIds != null and param2.deviceIds != ''"> |
| | | and device_ids = #{param2.deviceIds} |
| | | </if> |
| | | <if test="param2.areaCode != null and param2.areaCode != ''"> |
| | | and area_code = #{param2.areaCode} |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | |
| | | } |
| | | |
| | | Set<Long> areaIdSet = new HashSet<>(); |
| | | Set<Long> deviceIdSet = new HashSet<>(); |
| | | for (FwDefenseSceneVO record : records) { |
| | | areaIdSet.addAll(parseIdList(record.getAreaDivideIds())); |
| | | deviceIdSet.addAll(parseIdList(record.getDeviceIds())); |
| | | } |
| | | |
| | | Map<Long, BigDecimal> areaSizeMap = new HashMap<>(); |
| | | Map<Long, List<Long>> areaDeviceMap = new HashMap<>(); |
| | | Set<Long> deviceIdSet = new HashSet<>(); |
| | | if (!areaIdSet.isEmpty()) { |
| | | List<FwAreaDivideEntity> areaList = fwAreaDivideService.listByIds(areaIdSet); |
| | | for (FwAreaDivideEntity area : areaList) { |
| | |
| | | continue; |
| | | } |
| | | areaSizeMap.put(area.getId(), area.getAreaSize()); |
| | | List<Long> areaDeviceIds = parseIdList(area.getDeviceIds()); |
| | | areaDeviceMap.put(area.getId(), areaDeviceIds); |
| | | deviceIdSet.addAll(areaDeviceIds); |
| | | } |
| | | } |
| | | |
| | |
| | | record.setAreaCount(areaIds.size()); |
| | | record.setDefenseArea(sumDefenseArea(areaIds, areaSizeMap)); |
| | | |
| | | List<Long> deviceIds = parseIdList(record.getDeviceIds()); |
| | | Set<Long> deviceIds = new HashSet<>(); |
| | | for (Long areaId : areaIds) { |
| | | List<Long> areaDeviceIds = areaDeviceMap.get(areaId); |
| | | if (areaDeviceIds != null) { |
| | | deviceIds.addAll(areaDeviceIds); |
| | | } |
| | | } |
| | | int detectCount = 0; |
| | | int counterCount = 0; |
| | | for (Long deviceId : deviceIds) { |
| | |
| | | import org.sxkj.common.utils.HeaderUtils; |
| | | import org.sxkj.fw.area.dto.FwDefenseZoneDTO; |
| | | import org.sxkj.fw.area.entity.FwAreaDivideEntity; |
| | | import org.sxkj.fw.area.entity.FwDefenseSceneEntity; |
| | | import org.sxkj.fw.area.entity.FwDefenseZoneEntity; |
| | | import org.sxkj.fw.area.vo.FwDefenseZoneVO; |
| | | import org.sxkj.fw.area.excel.FwDefenseZoneExcel; |
| | | import org.sxkj.fw.area.mapper.FwDefenseZoneMapper; |
| | | import org.sxkj.fw.area.service.IFwAreaDivideService; |
| | | import org.sxkj.fw.area.service.IFwDefenseSceneService; |
| | | import org.sxkj.fw.area.service.IFwDefenseZoneService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | |
| | | */ |
| | | @Service |
| | | public class FwDefenseZoneServiceImpl extends BaseServiceImpl<FwDefenseZoneMapper, FwDefenseZoneEntity> implements IFwDefenseZoneService { |
| | | |
| | | @Resource |
| | | private IFwDefenseSceneService fwDefenseSceneService; |
| | | |
| | | @Resource |
| | | private IFwAreaDivideService fwAreaDivideService; |
| | |
| | | } |
| | | return; |
| | | } |
| | | Map<Long, List<Long>> sceneDeviceMap = new HashMap<>(); |
| | | if (!sceneIdSet.isEmpty()) { |
| | | List<FwDefenseSceneEntity> sceneList = fwDefenseSceneService.listByIds(sceneIdSet); |
| | | for (FwDefenseSceneEntity scene : sceneList) { |
| | | if (scene == null || scene.getId() == null) { |
| | | continue; |
| | | } |
| | | sceneDeviceMap.put(scene.getId(), parseIdList(scene.getDeviceIds())); |
| | | } |
| | | } |
| | | Map<Long, BigDecimal> areaSizeMap = new HashMap<>(); |
| | | Map<Long, List<Long>> areaDeviceMap = new HashMap<>(); |
| | | if (!areaIdSet.isEmpty()) { |
| | | List<FwAreaDivideEntity> areaList = fwAreaDivideService.listByIds(areaIdSet); |
| | | for (FwAreaDivideEntity area : areaList) { |
| | |
| | | continue; |
| | | } |
| | | areaSizeMap.put(area.getId(), area.getAreaSize()); |
| | | areaDeviceMap.put(area.getId(), parseIdList(area.getDeviceIds())); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | Set<Long> areaIds = new HashSet<>(zoneAreaIds); |
| | | Set<Long> deviceIds = new HashSet<>(); |
| | | for (Long sceneId : uniqueSceneIds) { |
| | | List<Long> sceneDeviceIds = sceneDeviceMap.get(sceneId); |
| | | if (sceneDeviceIds != null) { |
| | | deviceIds.addAll(sceneDeviceIds); |
| | | for (Long areaId : areaIds) { |
| | | List<Long> areaDeviceIds = areaDeviceMap.get(areaId); |
| | | if (areaDeviceIds != null) { |
| | | deviceIds.addAll(areaDeviceIds); |
| | | } |
| | | } |
| | | record.setAreaCount(areaIds.size()); |
| | |
| | | deptId = null; |
| | | } |
| | | } |
| | | String areaCode = HeaderUtils.getAreaCode(); |
| | | if (StringUtil.isBlank(areaCode)) { |
| | | areaCode = fwPoliceStation.getAreaCode(); |
| | | } |
| | | // String areaCode = HeaderUtils.getAreaCode(); |
| | | // if (StringUtil.isBlank(areaCode)) { |
| | | // areaCode = fwPoliceStation.getAreaCode(); |
| | | // } |
| | | Date now = new Date(); |
| | | fwPoliceStation.setCreateUser(userId); |
| | | fwPoliceStation.setUpdateUser(userId); |
| | | if (deptId != null) { |
| | | fwPoliceStation.setCreateDept(deptId); |
| | | } |
| | | if (StringUtil.isNotBlank(areaCode)) { |
| | | fwPoliceStation.setAreaCode(areaCode); |
| | | } |
| | | // if (StringUtil.isNotBlank(areaCode)) { |
| | | // fwPoliceStation.setAreaCode(areaCode); |
| | | // } |
| | | fwPoliceStation.setCreateTime(now); |
| | | fwPoliceStation.setUpdateTime(now); |
| | | } |