zhaoyun 4 hónapja
szülő
commit
4d97b4e0cc

+ 98 - 0
ruoyi-powerdistribution/src/main/java/com/ruoyi/powerdistribution/controller/PdmVehicleAlarmHistController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.powerdistribution.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.powerdistribution.domain.PdmVehicleAlarmHist;
+import com.ruoyi.powerdistribution.service.IPdmVehicleAlarmHistService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 施工车辆告警历史Controller
+ * 
+ * @author ruoyi
+ * @date 2025-01-23
+ */
+@RestController
+@RequestMapping("/powerdistribution/vehicleAlarmHist")
+public class PdmVehicleAlarmHistController extends BaseController
+{
+    @Autowired
+    private IPdmVehicleAlarmHistService pdmVehicleAlarmHistService;
+
+    /**
+     * 查询施工车辆告警历史列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(PdmVehicleAlarmHist pdmVehicleAlarmHist)
+    {
+        startPage();
+        List<PdmVehicleAlarmHist> list = pdmVehicleAlarmHistService.selectPdmVehicleAlarmHistList(pdmVehicleAlarmHist);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出施工车辆告警历史列表
+     */
+    @Log(title = "施工车辆告警历史", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PdmVehicleAlarmHist pdmVehicleAlarmHist)
+    {
+        List<PdmVehicleAlarmHist> list = pdmVehicleAlarmHistService.selectPdmVehicleAlarmHistList(pdmVehicleAlarmHist);
+        ExcelUtil<PdmVehicleAlarmHist> util = new ExcelUtil<PdmVehicleAlarmHist>(PdmVehicleAlarmHist.class);
+        util.exportExcel(response, list, "施工车辆告警历史数据");
+    }
+
+    /**
+     * 获取施工车辆告警历史详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(pdmVehicleAlarmHistService.selectPdmVehicleAlarmHistById(id));
+    }
+
+    /**
+     * 新增施工车辆告警历史
+     */
+    @Log(title = "施工车辆告警历史", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody PdmVehicleAlarmHist pdmVehicleAlarmHist)
+    {
+        return toAjax(pdmVehicleAlarmHistService.insertPdmVehicleAlarmHist(pdmVehicleAlarmHist));
+    }
+
+    /**
+     * 修改施工车辆告警历史
+     */
+    @Log(title = "施工车辆告警历史", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody PdmVehicleAlarmHist pdmVehicleAlarmHist)
+    {
+        return toAjax(pdmVehicleAlarmHistService.updatePdmVehicleAlarmHist(pdmVehicleAlarmHist));
+    }
+
+    /**
+     * 删除施工车辆告警历史
+     */
+    @Log(title = "施工车辆告警历史", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(pdmVehicleAlarmHistService.deletePdmVehicleAlarmHistByIds(ids));
+    }
+}

+ 103 - 0
ruoyi-powerdistribution/src/main/java/com/ruoyi/powerdistribution/domain/PdmVehicleAlarmHist.java

@@ -0,0 +1,103 @@
+package com.ruoyi.powerdistribution.domain;
+
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 施工车辆告警历史对象 pdm_vehicle_alarm_hist
+ * 
+ * @author ruoyi
+ * @date 2025-01-23
+ */
+@Data
+public class PdmVehicleAlarmHist extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 施工车辆 */
+    @Excel(name = "施工车辆")
+    private String vehicleNo;
+
+    /** 发生日期 */
+    @Excel(name = "发生日期")
+    private String occurDate;
+
+    /** 异常编码0-正常,1-车辆GPS离线,2-施工车辆长期未动,3-有作业信息,没有车辆行驶里程,4-有车辆行驶里程,没有作业信息 */
+    @Excel(name = "异常编码0-正常,1-车辆GPS离线,2-施工车辆长期未动,3-有作业信息,没有车辆行驶里程,4-有车辆行驶里程,没有作业信息")
+    private String alarmCd;
+
+    /** 告警描述 */
+    @Excel(name = "告警描述")
+    private String alarmDesc;
+
+    private String startDate;
+
+    private  String endDate;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setVehicleNo(String vehicleNo) 
+    {
+        this.vehicleNo = vehicleNo;
+    }
+
+    public String getVehicleNo() 
+    {
+        return vehicleNo;
+    }
+    public void setOccurDate(String occurDate) 
+    {
+        this.occurDate = occurDate;
+    }
+
+    public String getOccurDate() 
+    {
+        return occurDate;
+    }
+    public void setAlarmCd(String alarmCd) 
+    {
+        this.alarmCd = alarmCd;
+    }
+
+    public String getAlarmCd() 
+    {
+        return alarmCd;
+    }
+    public void setAlarmDesc(String alarmDesc) 
+    {
+        this.alarmDesc = alarmDesc;
+    }
+
+    public String getAlarmDesc() 
+    {
+        return alarmDesc;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("vehicleNo", getVehicleNo())
+            .append("occurDate", getOccurDate())
+            .append("alarmCd", getAlarmCd())
+            .append("alarmDesc", getAlarmDesc())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-powerdistribution/src/main/java/com/ruoyi/powerdistribution/mapper/PdmVehicleAlarmHistMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.powerdistribution.mapper;
+
+import java.util.List;
+import com.ruoyi.powerdistribution.domain.PdmVehicleAlarmHist;
+
+/**
+ * 施工车辆告警历史Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2025-01-23
+ */
+public interface PdmVehicleAlarmHistMapper 
+{
+    /**
+     * 查询施工车辆告警历史
+     * 
+     * @param id 施工车辆告警历史主键
+     * @return 施工车辆告警历史
+     */
+    public PdmVehicleAlarmHist selectPdmVehicleAlarmHistById(Long id);
+
+    /**
+     * 查询施工车辆告警历史列表
+     * 
+     * @param pdmVehicleAlarmHist 施工车辆告警历史
+     * @return 施工车辆告警历史集合
+     */
+    public List<PdmVehicleAlarmHist> selectPdmVehicleAlarmHistList(PdmVehicleAlarmHist pdmVehicleAlarmHist);
+
+    /**
+     * 新增施工车辆告警历史
+     * 
+     * @param pdmVehicleAlarmHist 施工车辆告警历史
+     * @return 结果
+     */
+    public int insertPdmVehicleAlarmHist(PdmVehicleAlarmHist pdmVehicleAlarmHist);
+
+    /**
+     * 修改施工车辆告警历史
+     * 
+     * @param pdmVehicleAlarmHist 施工车辆告警历史
+     * @return 结果
+     */
+    public int updatePdmVehicleAlarmHist(PdmVehicleAlarmHist pdmVehicleAlarmHist);
+
+    /**
+     * 删除施工车辆告警历史
+     * 
+     * @param id 施工车辆告警历史主键
+     * @return 结果
+     */
+    public int deletePdmVehicleAlarmHistById(Long id);
+
+    /**
+     * 批量删除施工车辆告警历史
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePdmVehicleAlarmHistByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-powerdistribution/src/main/java/com/ruoyi/powerdistribution/service/IPdmVehicleAlarmHistService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.powerdistribution.service;
+
+import java.util.List;
+import com.ruoyi.powerdistribution.domain.PdmVehicleAlarmHist;
+
+/**
+ * 施工车辆告警历史Service接口
+ * 
+ * @author ruoyi
+ * @date 2025-01-23
+ */
+public interface IPdmVehicleAlarmHistService 
+{
+    /**
+     * 查询施工车辆告警历史
+     * 
+     * @param id 施工车辆告警历史主键
+     * @return 施工车辆告警历史
+     */
+    public PdmVehicleAlarmHist selectPdmVehicleAlarmHistById(Long id);
+
+    /**
+     * 查询施工车辆告警历史列表
+     * 
+     * @param pdmVehicleAlarmHist 施工车辆告警历史
+     * @return 施工车辆告警历史集合
+     */
+    public List<PdmVehicleAlarmHist> selectPdmVehicleAlarmHistList(PdmVehicleAlarmHist pdmVehicleAlarmHist);
+
+    /**
+     * 新增施工车辆告警历史
+     * 
+     * @param pdmVehicleAlarmHist 施工车辆告警历史
+     * @return 结果
+     */
+    public int insertPdmVehicleAlarmHist(PdmVehicleAlarmHist pdmVehicleAlarmHist);
+
+    /**
+     * 修改施工车辆告警历史
+     * 
+     * @param pdmVehicleAlarmHist 施工车辆告警历史
+     * @return 结果
+     */
+    public int updatePdmVehicleAlarmHist(PdmVehicleAlarmHist pdmVehicleAlarmHist);
+
+    /**
+     * 批量删除施工车辆告警历史
+     * 
+     * @param ids 需要删除的施工车辆告警历史主键集合
+     * @return 结果
+     */
+    public int deletePdmVehicleAlarmHistByIds(Long[] ids);
+
+    /**
+     * 删除施工车辆告警历史信息
+     * 
+     * @param id 施工车辆告警历史主键
+     * @return 结果
+     */
+    public int deletePdmVehicleAlarmHistById(Long id);
+}

+ 96 - 0
ruoyi-powerdistribution/src/main/java/com/ruoyi/powerdistribution/service/impl/PdmVehicleAlarmHistServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.powerdistribution.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.powerdistribution.mapper.PdmVehicleAlarmHistMapper;
+import com.ruoyi.powerdistribution.domain.PdmVehicleAlarmHist;
+import com.ruoyi.powerdistribution.service.IPdmVehicleAlarmHistService;
+
+/**
+ * 施工车辆告警历史Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2025-01-23
+ */
+@Service
+public class PdmVehicleAlarmHistServiceImpl implements IPdmVehicleAlarmHistService 
+{
+    @Autowired
+    private PdmVehicleAlarmHistMapper pdmVehicleAlarmHistMapper;
+
+    /**
+     * 查询施工车辆告警历史
+     * 
+     * @param id 施工车辆告警历史主键
+     * @return 施工车辆告警历史
+     */
+    @Override
+    public PdmVehicleAlarmHist selectPdmVehicleAlarmHistById(Long id)
+    {
+        return pdmVehicleAlarmHistMapper.selectPdmVehicleAlarmHistById(id);
+    }
+
+    /**
+     * 查询施工车辆告警历史列表
+     * 
+     * @param pdmVehicleAlarmHist 施工车辆告警历史
+     * @return 施工车辆告警历史
+     */
+    @Override
+    public List<PdmVehicleAlarmHist> selectPdmVehicleAlarmHistList(PdmVehicleAlarmHist pdmVehicleAlarmHist)
+    {
+        return pdmVehicleAlarmHistMapper.selectPdmVehicleAlarmHistList(pdmVehicleAlarmHist);
+    }
+
+    /**
+     * 新增施工车辆告警历史
+     * 
+     * @param pdmVehicleAlarmHist 施工车辆告警历史
+     * @return 结果
+     */
+    @Override
+    public int insertPdmVehicleAlarmHist(PdmVehicleAlarmHist pdmVehicleAlarmHist)
+    {
+        pdmVehicleAlarmHist.setCreateTime(DateUtils.getNowDate());
+        return pdmVehicleAlarmHistMapper.insertPdmVehicleAlarmHist(pdmVehicleAlarmHist);
+    }
+
+    /**
+     * 修改施工车辆告警历史
+     * 
+     * @param pdmVehicleAlarmHist 施工车辆告警历史
+     * @return 结果
+     */
+    @Override
+    public int updatePdmVehicleAlarmHist(PdmVehicleAlarmHist pdmVehicleAlarmHist)
+    {
+        pdmVehicleAlarmHist.setUpdateTime(DateUtils.getNowDate());
+        return pdmVehicleAlarmHistMapper.updatePdmVehicleAlarmHist(pdmVehicleAlarmHist);
+    }
+
+    /**
+     * 批量删除施工车辆告警历史
+     * 
+     * @param ids 需要删除的施工车辆告警历史主键
+     * @return 结果
+     */
+    @Override
+    public int deletePdmVehicleAlarmHistByIds(Long[] ids)
+    {
+        return pdmVehicleAlarmHistMapper.deletePdmVehicleAlarmHistByIds(ids);
+    }
+
+    /**
+     * 删除施工车辆告警历史信息
+     * 
+     * @param id 施工车辆告警历史主键
+     * @return 结果
+     */
+    @Override
+    public int deletePdmVehicleAlarmHistById(Long id)
+    {
+        return pdmVehicleAlarmHistMapper.deletePdmVehicleAlarmHistById(id);
+    }
+}

+ 90 - 0
ruoyi-powerdistribution/src/main/resources/mapper/powerdistribution/PdmVehicleAlarmHistMapper.xml

@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.powerdistribution.mapper.PdmVehicleAlarmHistMapper">
+    
+    <resultMap type="PdmVehicleAlarmHist" id="PdmVehicleAlarmHistResult">
+        <result property="id"    column="id"    />
+        <result property="vehicleNo"    column="vehicle_no"    />
+        <result property="occurDate"    column="occur_date"    />
+        <result property="alarmCd"    column="alarm_cd"    />
+        <result property="alarmDesc"    column="alarm_desc"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectPdmVehicleAlarmHistVo">
+        select id, vehicle_no, occur_date, alarm_cd, alarm_desc, create_time, update_by, update_time, remark from pdm_vehicle_alarm_hist
+    </sql>
+
+    <select id="selectPdmVehicleAlarmHistList" parameterType="PdmVehicleAlarmHist" resultMap="PdmVehicleAlarmHistResult">
+        <include refid="selectPdmVehicleAlarmHistVo"/>
+        <where>  
+            <if test="vehicleNo != null  and vehicleNo != ''"> and vehicle_no = #{vehicleNo}</if>
+            <if test="occurDate != null  and occurDate != ''"> and occur_date = #{occurDate}</if>
+            <if test="startDate != null  and startDate != ''"> and occur_date &gt;= #{startDate}</if>
+            <if test="endDate != null  and endDate != ''"> and occur_date &lt;= #{endDate}</if>
+            <if test="alarmCd != null  and alarmCd != ''"> and alarm_cd = #{alarmCd}</if>
+            <if test="alarmDesc != null  and alarmDesc != ''"> and alarm_desc = #{alarmDesc}</if>
+        </where>
+        order by occur_date desc
+    </select>
+    
+    <select id="selectPdmVehicleAlarmHistById" parameterType="Long" resultMap="PdmVehicleAlarmHistResult">
+        <include refid="selectPdmVehicleAlarmHistVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertPdmVehicleAlarmHist" parameterType="PdmVehicleAlarmHist" useGeneratedKeys="true" keyProperty="id">
+        insert into pdm_vehicle_alarm_hist
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="vehicleNo != null">vehicle_no,</if>
+            <if test="occurDate != null">occur_date,</if>
+            <if test="alarmCd != null">alarm_cd,</if>
+            <if test="alarmDesc != null">alarm_desc,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="vehicleNo != null">#{vehicleNo},</if>
+            <if test="occurDate != null">#{occurDate},</if>
+            <if test="alarmCd != null">#{alarmCd},</if>
+            <if test="alarmDesc != null">#{alarmDesc},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updatePdmVehicleAlarmHist" parameterType="PdmVehicleAlarmHist">
+        update pdm_vehicle_alarm_hist
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="vehicleNo != null">vehicle_no = #{vehicleNo},</if>
+            <if test="occurDate != null">occur_date = #{occurDate},</if>
+            <if test="alarmCd != null">alarm_cd = #{alarmCd},</if>
+            <if test="alarmDesc != null">alarm_desc = #{alarmDesc},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deletePdmVehicleAlarmHistById" parameterType="Long">
+        delete from pdm_vehicle_alarm_hist where id = #{id}
+    </delete>
+
+    <delete id="deletePdmVehicleAlarmHistByIds" parameterType="String">
+        delete from pdm_vehicle_alarm_hist where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 1 - 1
ruoyi-powerdistribution/src/main/resources/mapper/powerdistribution/PdmVehicleAlarmMapper.xml

@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="alarmCd != null  and alarmCd != ''"> and alarm_cd = #{alarmCd}</if>
             <if test="alarmDesc != null  and alarmDesc != ''"> and alarm_desc = #{alarmDesc}</if>
         </where>
-        order by vehicle_group,vehicle_no
+        order by alarm_cd desc,vehicle_group,vehicle_no
     </select>
     
     <select id="selectPdmVehicleAlarmById" parameterType="Long" resultMap="PdmVehicleAlarmResult">

+ 2 - 2
ruoyi-powerdistribution/src/main/resources/mapper/powerdistribution/PdmWorkPlanMapper.xml

@@ -600,7 +600,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             SELECT
             DISTINCT t.*
             FROM
-            pdm_construct_team t INNER JOIN pdm_vehicle_alarm a on a.vehicle_no like concat('%', t.construc_car_number, '%')
+            pdm_construct_team t INNER JOIN pdm_vehicle_alarm a on t.construc_car_number like concat('%',a.vehicle_no , '%')
             and ifnull(t.construc_car_number,'')!=''
             WHERE
             t.team_leader = work_princip_nm and a.vehicle_no=#{vehicleNo}
@@ -615,7 +615,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             SELECT
             DISTINCT t.*
             FROM
-            pdm_constructor t INNER JOIN pdm_construct_team t1  on t1.team_no=t.team_no INNER JOIN pdm_vehicle_alarm a on a.vehicle_no like concat('%', t1.construc_car_number, '%')
+            pdm_constructor t INNER JOIN pdm_construct_team t1  on t1.team_no=t.team_no INNER JOIN pdm_vehicle_alarm a on t1.construc_car_number like concat('%',a.vehicle_no, '%')
             and ifnull(t1.construc_car_number,'')!=''
             WHERE
             t.construct_personnel_name = work_princip_nm and a.vehicle_no=#{vehicleNo}