吉安感知网项目-后端
rain
2026-01-14 46b35a8bbb4767b2a28b03a88f705d18c9dbf426
Merge remote-tracking branch 'origin/master'
5 files modified
2 files added
1 files deleted
367 ■■■■ changed files
drone-common/src/main/java/org/sxkj/common/enums/WorkOrderStatusEnum.java 112 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java 36 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.java 36 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml 55 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java 19 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java 20 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/DeviceTypeStatisticsVO.java 36 ●●●●● patch | view | raw | blame | history
drone-service/drone-system/src/main/java/org/sxkj/system/feign/ManageDevicePerShareClient.java 53 ●●●●● patch | view | raw | blame | history
drone-common/src/main/java/org/sxkj/common/enums/WorkOrderStatusEnum.java
New file
@@ -0,0 +1,112 @@
package org.sxkj.common.enums;
import com.fasterxml.jackson.annotation.JsonValue;
/**
 * 工单状态枚举
 */
public enum WorkOrderStatusEnum {
    /**
     * 草稿
     */
    DRAFT("0", "草稿"),
    /**
     * 发布中_接单中
     */
    PUBLISHING_ACCEPTING("10", "发布中_接单中"),
    /**
     * 发布中_拒绝接单
     */
    PUBLISHING_REJECTING("11", "发布中_拒绝接单"),
    /**
     * 响应中_待拆分
     */
    RESPONDING_TO_SPLIT("20", "响应中_待拆分"),
    /**
     * 响应中_申请取消
     */
    RESPONDING_APPLY_CANCEL("21", "响应中_申请取消"),
    /**
     * 响应中_申请修改
     */
    RESPONDING_APPLY_MODIFY("22", "响应中_申请修改"),
    /**
     * 响应中_已取消
     */
    RESPONDING_CANCELLED("23", "响应中_已取消"),
    /**
     * 执行中_待全部完成
     */
    EXECUTING_TO_COMPLETE("30", "执行中_待全部完成"),
    /**
     * 执行中_协商修改
     */
    EXECUTING_NEGOTIATE_MODIFY("31", "执行中_协商修改"),
    /**
     * 完成待验_待全部验收
     */
    COMPLETED_TO_CHECK("40", "完成待验_待全部验收"),
    /**
     * 验收通过_待结算
     */
    ACCEPTED_TO_SETTLE("50", "验收通过_待结算"),
    /**
     * 结算完成_已结算
     */
    SETTLED_COMPLETED("60", "结算完成_已结算");
    private final String code;
    private final String description;
    WorkOrderStatusEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }
    @JsonValue
    public String getCode() {
        return code;
    }
    public String getDescription() {
        return description;
    }
    /**
     * 根据编码获取枚举值
     *
     * @param code 编码
     * @return 枚举值
     */
    public static WorkOrderStatusEnum getByCode(String code) {
        for (WorkOrderStatusEnum status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        return null;
    }
    /**
     * 验证工单状态编码是否有效
     *
     * @param code 工单状态编码
     * @return 是否有效
     */
    public static boolean isValidCode(String code) {
        return getByCode(code) != null;
    }
}
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java
@@ -34,6 +34,7 @@
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO;
import org.sxkj.fw.common.GenericConverter;
import org.sxkj.fw.common.IdParam;
import org.sxkj.fw.device.dto.FwDeviceDTO;
@@ -41,6 +42,7 @@
import org.sxkj.fw.device.excel.FwDeviceExcel;
import org.sxkj.fw.device.param.FwDevicePageParam;
import org.sxkj.fw.device.service.IFwDeviceService;
import org.sxkj.fw.device.vo.DeviceTypeStatisticsVO;
import org.sxkj.fw.device.vo.FwDeviceVO;
import org.sxkj.fw.device.wrapper.FwDeviceWrapper;
import springfox.documentation.annotations.ApiIgnore;
@@ -138,12 +140,44 @@
        return R.status(fwDeviceService.deleteLogic(Func.toLongList(ids)));
    }
    /**
     * 设备类型统计
     * @return 统计数据
     */
    @GetMapping("/statisticalDeviceType")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "设备类型统计", notes = "设备类型统计")
    public R<List<DeviceTypeStatisticsVO>> statisticalDeviceType() {
        return R.data(fwDeviceService.getDeviceTypeStatistics());
    }
    /**
     * 设备类型统计
     * @return 统计数据
     */
    @GetMapping("/statisticalDeviceOut")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "设备出库去向统计", notes = "设备出库去向统计")
    public R<List<DeviceStatisticsVO>> statisticalDeviceOut() {
        return R.data(fwDeviceService.getDeviceOutStatistics());
    }
    /**
     * 设备生产厂商统计
     * @return 统计数据
     */
    @GetMapping("/statisticalDeviceManufacturer")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "设备生产厂商统计", notes = "设备生产厂商统计")
    public R<List<DeviceStatisticsVO>> statisticalDeviceManufacturer() {
        return R.data(fwDeviceService.getDeviceManufacturerStatistics());
    }
    /**
     * 导出数据
     */
    @GetMapping("/export-fwDevice")
    @ApiOperationSupport(order = 6)
    @ApiOperationSupport(order = 99)
    @ApiOperation(value = "导出数据", notes = "传入fwDevice")
    @ApiIgnore
    public void exportFwDevice(@ApiIgnore @RequestParam Map<String, Object> fwDevice, BladeUser bladeUser, HttpServletResponse response) {
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.java
@@ -16,17 +16,18 @@
 */
package org.sxkj.fw.device.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO;
import org.sxkj.fw.device.vo.DeviceTypeStatisticsVO;
import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO;
import org.sxkj.fw.device.dto.FwDeviceDTO;
import org.sxkj.fw.device.entity.FwDeviceEntity;
import org.sxkj.fw.device.vo.CockpitFwDeviceVO;
import org.sxkj.fw.device.vo.FwDeviceVO;
import org.sxkj.fw.device.excel.FwDeviceExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.sxkj.fw.device.vo.CockpitFwDeviceVO;
import java.util.List;
/**
@@ -58,19 +59,36 @@
    /**
     * 获取导出数据
     *
     * @param queryWrapper
     * @return
     */
    List<FwDeviceExcel> exportFwDevice(@Param("ew") Wrapper<FwDeviceEntity> queryWrapper);
    /**
     * 设备统计
     * @return
     * 设备统计 - 驾驶舱使用
     * @return 统计数据
     */
    List<DeviceStatisticsVO> statisticalDeviceType();
    /**
     * 设备统计 - 按类型统计
     * @return 统计数据
     */
    List<DeviceTypeStatisticsVO> getDeviceTypeStatistics();
    /**
     * 设备出库去向统计
     * @return 统计数据
     */
    List<DeviceStatisticsVO> getDeviceOutStatistics();
    /**
     * 设备生产厂商统计
     * @return 统计数据
     */
    List<DeviceStatisticsVO> getDeviceManufacturerStatistics();
    /**
     * 告警统计
     * @return
     */
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
@@ -165,6 +165,61 @@
        ORDER BY split_device_type
    </select>
    <!-- 获取设备类型统计数据 -->
    <select id="getDeviceTypeStatistics" resultType="org.sxkj.fw.device.vo.DeviceTypeStatisticsVO">
        SELECT a.device_type,b.dict_value AS device_type_value,count(*) device_count, (SELECT COUNT(*) FROM ja_fw_device) as total_devices
        FROM ja_fw_device a
        LEFT JOIN blade_dict_biz b ON (
            a.device_type = b.dict_key
            AND b.code = 'deviceType'
            AND b.parent_id != 0
        ) where a.is_deleted = 0
        group by a.device_type,b.dict_value
    </select>
    <!-- 设备出库去向统计 -->
    <select id="getDeviceOutStatistics" resultType="org.sxkj.fw.cockpit.vo.DeviceStatisticsVO">
        SELECT
            t.out_target AS type,
            COUNT(*) AS count
        FROM
            ja_fw_device d
                LEFT JOIN (
                SELECT
                    device_id,
                    out_target,
                    ROW_NUMBER() OVER (
                        PARTITION BY
                            device_id
                        ORDER BY
                            create_time DESC
                        ) AS rn
                FROM
                    ja_fw_device_track
                WHERE
                    out_target IS NOT NULL
            ) t ON d.id = t.device_id
                AND t.rn = 1
        WHERE
            d.is_deleted = 0
          AND t.out_target IS NOT NULL
        GROUP BY
            t.out_target;
    </select>
    <!--  设备生产厂商统计  -->
    <select id="getDeviceManufacturerStatistics" resultType="org.sxkj.fw.cockpit.vo.DeviceStatisticsVO">
        SELECT
            manufacturer AS type,
            COUNT(*) AS count
        FROM
            ja_fw_device
        WHERE
            is_deleted = 0
        GROUP BY
            manufacturer
    </select>
     <!-- 查询设备总数 + 无线电/光电/雷达设备数量 -->
    <select id="statisticalDeviceAtt" resultType="org.sxkj.fw.cockpit.vo.AlarmStatisticsVO">
        SELECT
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java
@@ -22,6 +22,7 @@
import org.sxkj.fw.device.dto.FwDeviceDTO;
import org.sxkj.fw.device.entity.FwDeviceEntity;
import org.sxkj.fw.device.vo.CockpitFwDeviceVO;
import org.sxkj.fw.device.vo.DeviceTypeStatisticsVO;
import org.sxkj.fw.device.vo.FwDeviceVO;
import org.sxkj.fw.device.excel.FwDeviceExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -70,6 +71,24 @@
    List<DeviceStatisticsVO> statisticalDeviceType();
    /**
     * 设备统计 - 按类型统计
     * @return 统计数据
     */
    List<DeviceTypeStatisticsVO> getDeviceTypeStatistics();
    /**
     * 设备出库去向统计
     * @return 统计数据
     */
    List<DeviceStatisticsVO> getDeviceOutStatistics();
    /**
     * 设备生产厂商统计
     * @return 统计数据
     */
    List<DeviceStatisticsVO> getDeviceManufacturerStatistics();
    /**
     * 设备报警统计
     * @return
     */
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -21,6 +21,7 @@
import org.sxkj.fw.device.dto.FwDeviceDTO;
import org.sxkj.fw.device.entity.FwDeviceEntity;
import org.sxkj.fw.device.vo.CockpitFwDeviceVO;
import org.sxkj.fw.device.vo.DeviceTypeStatisticsVO;
import org.sxkj.fw.device.vo.FwDeviceVO;
import org.sxkj.fw.device.excel.FwDeviceExcel;
import org.sxkj.fw.device.mapper.FwDeviceMapper;
@@ -87,6 +88,25 @@
    }
    /**
     * 设备统计 - 按类型统计
     * @return 统计数据
     */
    @Override
    public List<DeviceTypeStatisticsVO> getDeviceTypeStatistics() {
        return baseMapper.getDeviceTypeStatistics();
    }
    @Override
    public List<DeviceStatisticsVO> getDeviceOutStatistics() {
        return baseMapper.getDeviceOutStatistics();
    }
    @Override
    public List<DeviceStatisticsVO> getDeviceManufacturerStatistics() {
        return baseMapper.getDeviceManufacturerStatistics();
    }
    /**
     * 设备属性统计
     * @return
     */
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/vo/DeviceTypeStatisticsVO.java
New file
@@ -0,0 +1,36 @@
package org.sxkj.fw.device.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @Description 设备统计
 * @Author AIX
 * @Date 2026/1/14 11:30
 * @Version 1.0
 */
@Data
public class DeviceTypeStatisticsVO {
    /**
     * 设备类型
     */
    @ApiModelProperty(value = "设备类型")
    private String deviceType;
    /**
     * 设备类型名称
     */
    @ApiModelProperty(value = "设备类型名称")
    private String deviceTypeValue;
    /**
     * 数量
     */
    @ApiModelProperty(value = "数量")
    private Integer deviceCount;
    /**
     * 总数量
     */
    @ApiModelProperty(value = "总数量")
    private Integer totalDevices;
}
drone-service/drone-system/src/main/java/org/sxkj/system/feign/ManageDevicePerShareClient.java
File was deleted