浏览代码

连续安全运行基础信息

ouyj 3 月之前
父节点
当前提交
e6da4ddda6

+ 137 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/controller/GxtSafeOperationRewardController.java

@@ -0,0 +1,137 @@
+package com.ygtx.gxt.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ygtx.common.annotation.Excel;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import com.ygtx.common.annotation.Log;
+import com.ygtx.common.core.controller.BaseController;
+import com.ygtx.common.core.domain.AjaxResult;
+import com.ygtx.common.enums.BusinessType;
+import com.ygtx.gxt.domain.GxtSafeOperationReward;
+import com.ygtx.gxt.service.IGxtSafeOperationRewardService;
+import com.ygtx.common.utils.poi.ExcelUtil;
+import com.ygtx.common.core.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+
+/**
+ * 安全运行奖励Controller
+ * 
+ * @author ygtx
+ * @date 2026-01-07
+ */
+@RestController
+@RequestMapping("/gxt/safeoperationreward")
+@Api(tags = "安全运行奖励")
+public class GxtSafeOperationRewardController extends BaseController
+{
+    @Autowired
+    private IGxtSafeOperationRewardService gxtSafeOperationRewardService;
+
+    /**
+     * 查询安全运行奖励列表
+     */
+    @PreAuthorize("@ss.hasPermi('gxt:safeoperationreward:list')")
+    @ApiOperation("查询安全运行奖励列表")
+    @GetMapping("/list")
+    public TableDataInfo list(GxtSafeOperationReward gxtSafeOperationReward)
+    {
+        startPage();
+        List<GxtSafeOperationReward> list = gxtSafeOperationRewardService.selectGxtSafeOperationRewardList(gxtSafeOperationReward);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出安全运行奖励列表
+     */
+    @PreAuthorize("@ss.hasPermi('gxt:safeoperationreward:export')")
+    @Log(title = "安全运行奖励", businessType = BusinessType.EXPORT)
+    @ApiOperation("导出安全运行奖励列表")
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, GxtSafeOperationReward gxtSafeOperationReward,
+                       @RequestParam(value = "exportFields", required = false) String exportFieldsStr)
+    {
+        List<GxtSafeOperationReward> list = gxtSafeOperationRewardService.selectGxtSafeOperationRewardList(gxtSafeOperationReward);
+        ExcelUtil<GxtSafeOperationReward> util = new ExcelUtil<GxtSafeOperationReward>(GxtSafeOperationReward.class);
+        if (exportFieldsStr != null && !exportFieldsStr.isEmpty()) {
+            // 将字符串分割成数组
+            String[] exportFields = exportFieldsStr.split(",");
+            util.showColumn(exportFields);
+        }
+        util.exportExcel(response, list, "安全运行奖励数据");
+    }
+
+    /**
+     * 获取安全运行奖励导出字段列表
+     */
+    @GetMapping("/exportFields")
+    @ApiOperation("获取安全运行奖励导出字段列表")
+    public AjaxResult getExportFields() {
+        ExcelUtil<GxtSafeOperationReward> util = new ExcelUtil<GxtSafeOperationReward>(GxtSafeOperationReward.class);
+        util.init(null, "安全运行奖励", "", Excel.Type.EXPORT);
+        return success(util.getExportFields());
+    }
+
+    /**
+     * 获取安全运行奖励详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('gxt:safeoperationreward:query')")
+    @ApiOperation("获取安全运行奖励详细信息")
+    @ApiImplicitParam(name = "id", value = "主键ID", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(gxtSafeOperationRewardService.selectGxtSafeOperationRewardById(id));
+    }
+
+    /**
+     * 新增安全运行奖励
+     */
+    @PreAuthorize("@ss.hasPermi('gxt:safeoperationreward:add')")
+    @Log(title = "安全运行奖励", businessType = BusinessType.INSERT)
+    @ApiOperation("新增安全运行奖励")
+    @PostMapping
+    public AjaxResult add(@RequestBody GxtSafeOperationReward gxtSafeOperationReward)
+    {
+        return toAjax(gxtSafeOperationRewardService.insertGxtSafeOperationReward(gxtSafeOperationReward));
+    }
+
+    /**
+     * 修改安全运行奖励
+     */
+    @PreAuthorize("@ss.hasPermi('gxt:safeoperationreward:edit')")
+    @Log(title = "安全运行奖励", businessType = BusinessType.UPDATE)
+    @ApiOperation("修改安全运行奖励")
+    @PutMapping
+    public AjaxResult edit(@RequestBody GxtSafeOperationReward gxtSafeOperationReward)
+    {
+        return toAjax(gxtSafeOperationRewardService.updateGxtSafeOperationReward(gxtSafeOperationReward));
+    }
+
+    /**
+     * 删除安全运行奖励
+     */
+    @PreAuthorize("@ss.hasPermi('gxt:safeoperationreward:remove')")
+    @Log(title = "安全运行奖励", businessType = BusinessType.DELETE)
+    @ApiOperation("删除安全运行奖励")
+    @ApiImplicitParam(name = "ids", value = "主键ID数组", required = true, dataType = "Long[]", paramType = "path", dataTypeClass = Long[].class)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(gxtSafeOperationRewardService.deleteGxtSafeOperationRewardByIds(ids));
+    }
+}

+ 15 - 2
ygtx-gxt/src/main/java/com/ygtx/gxt/domain/GxtRepairOrderPerson.java

@@ -77,6 +77,10 @@ public class GxtRepairOrderPerson extends BaseEntity
     /** 总分 */
     private Double totalScore;
 
+    /** 运行得分 */
+    @Excel(name = "运行得分")
+    private Double runScore;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -217,12 +221,20 @@ public class GxtRepairOrderPerson extends BaseEntity
         this.extraScore = extraScore;
     }
 
+    public void setTotalScore(Double totalScore) {
+        this.totalScore = totalScore;
+    }
+
     public Double getTotalScore() {
         return totalScore;
     }
 
-    public void setTotalScore(Double totalScore) {
-        this.totalScore = totalScore;
+    public void setRunScore(Double runScore) {
+        this.runScore = runScore;
+    }
+
+    public Double getRunScore() {
+        return runScore;
     }
 
     @Override
@@ -245,6 +257,7 @@ public class GxtRepairOrderPerson extends BaseEntity
             .append("remark", getRemark())
             .append("extraScore", getExtraScore())
             .append("totalScore", getTotalScore())
+            .append("runScore", getRunScore())
             .toString();
     }
 }

+ 112 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/domain/GxtSafeOperationReward.java

@@ -0,0 +1,112 @@
+package com.ygtx.gxt.domain;
+
+import com.ygtx.common.annotation.Excel;
+import com.ygtx.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+
+/**
+ * 安全运行奖励对象 gxt_safe_operation_reward
+ * 
+ * @author ygtx
+ * @date 2026-01-07
+ */
+@ApiModel(description = "安全运行奖励配置")
+public class GxtSafeOperationReward extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键ID */
+    @ApiModelProperty(value = "主键ID")
+    private Long id;
+
+    /** 连续安全运行时长(天) */
+    @Excel(name = "连续安全运行时长")
+    @ApiModelProperty(value = "连续安全运行时长(天)")
+    private Integer safeDuration;
+
+    /** 计划检修奖励分值 */
+    @Excel(name = "计划检修奖励分值")
+    @ApiModelProperty(value = "计划检修奖励分值")
+    private BigDecimal plannedMaintenanceScore;
+
+    /** 非计划检修奖励分值 */
+    @Excel(name = "非计划检修奖励分值")
+    @ApiModelProperty(value = "非计划检修奖励分值")
+    private BigDecimal unplannedMaintenanceScore;
+
+    /** 状态 */
+    @Excel(name = "启用状态")
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    
+    public void setSafeDuration(Integer safeDuration) 
+    {
+        this.safeDuration = safeDuration;
+    }
+
+    public Integer getSafeDuration() 
+    {
+        return safeDuration;
+    }
+    
+    public void setPlannedMaintenanceScore(BigDecimal plannedMaintenanceScore) 
+    {
+        this.plannedMaintenanceScore = plannedMaintenanceScore;
+    }
+
+    public BigDecimal getPlannedMaintenanceScore() 
+    {
+        return plannedMaintenanceScore;
+    }
+    
+    public void setUnplannedMaintenanceScore(BigDecimal unplannedMaintenanceScore) 
+    {
+        this.unplannedMaintenanceScore = unplannedMaintenanceScore;
+    }
+
+    public BigDecimal getUnplannedMaintenanceScore() 
+    {
+        return unplannedMaintenanceScore;
+    }
+    
+    public void setStatus(Integer status) 
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus() 
+    {
+        return status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("safeDuration", getSafeDuration())
+            .append("plannedMaintenanceScore", getPlannedMaintenanceScore())
+            .append("unplannedMaintenanceScore", getUnplannedMaintenanceScore())
+            .append("status", getStatus())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 13 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/domain/GxtWorkOrderPerson.java

@@ -83,6 +83,10 @@ public class GxtWorkOrderPerson extends BaseEntity
     @Excel(name = "总分")
     private Double totalScore;
 
+    /** 运行得分 */
+    @Excel(name = "运行得分")
+    private Double runScore;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -243,6 +247,14 @@ public class GxtWorkOrderPerson extends BaseEntity
         this.totalScore = totalScore;
     }
 
+    public Double getRunScore() {
+        return runScore;
+    }
+
+    public void setRunScore(Double runScore) {
+        this.runScore = runScore;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -265,6 +277,7 @@ public class GxtWorkOrderPerson extends BaseEntity
             .append("remark", getRemark())
             .append("extraScore", getExtraScore())
             .append("totalScore", getTotalScore())
+            .append("runScore", getRunScore())
             .toString();
     }
 }

+ 61 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/mapper/GxtSafeOperationRewardMapper.java

@@ -0,0 +1,61 @@
+package com.ygtx.gxt.mapper;
+
+import java.util.List;
+import com.ygtx.gxt.domain.GxtSafeOperationReward;
+
+/**
+ * 安全运行奖励Mapper接口
+ * 
+ * @author ygtx
+ * @date 2026-01-07
+ */
+public interface GxtSafeOperationRewardMapper 
+{
+    /**
+     * 查询安全运行奖励
+     * 
+     * @param id 安全运行奖励主键
+     * @return 安全运行奖励
+     */
+    public GxtSafeOperationReward selectGxtSafeOperationRewardById(Long id);
+
+    /**
+     * 查询安全运行奖励列表
+     * 
+     * @param gxtSafeOperationReward 安全运行奖励
+     * @return 安全运行奖励集合
+     */
+    public List<GxtSafeOperationReward> selectGxtSafeOperationRewardList(GxtSafeOperationReward gxtSafeOperationReward);
+
+    /**
+     * 新增安全运行奖励
+     * 
+     * @param gxtSafeOperationReward 安全运行奖励
+     * @return 结果
+     */
+    public int insertGxtSafeOperationReward(GxtSafeOperationReward gxtSafeOperationReward);
+
+    /**
+     * 修改安全运行奖励
+     * 
+     * @param gxtSafeOperationReward 安全运行奖励
+     * @return 结果
+     */
+    public int updateGxtSafeOperationReward(GxtSafeOperationReward gxtSafeOperationReward);
+
+    /**
+     * 删除安全运行奖励
+     * 
+     * @param id 安全运行奖励主键
+     * @return 结果
+     */
+    public int deleteGxtSafeOperationRewardById(Long id);
+
+    /**
+     * 批量删除安全运行奖励
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteGxtSafeOperationRewardByIds(Long[] ids);
+}

+ 61 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/service/IGxtSafeOperationRewardService.java

@@ -0,0 +1,61 @@
+package com.ygtx.gxt.service;
+
+import java.util.List;
+import com.ygtx.gxt.domain.GxtSafeOperationReward;
+
+/**
+ * 安全运行奖励Service接口
+ * 
+ * @author ygtx
+ * @date 2026-01-07
+ */
+public interface IGxtSafeOperationRewardService 
+{
+    /**
+     * 查询安全运行奖励
+     * 
+     * @param id 安全运行奖励主键
+     * @return 安全运行奖励
+     */
+    public GxtSafeOperationReward selectGxtSafeOperationRewardById(Long id);
+
+    /**
+     * 查询安全运行奖励列表
+     * 
+     * @param gxtSafeOperationReward 安全运行奖励
+     * @return 安全运行奖励集合
+     */
+    public List<GxtSafeOperationReward> selectGxtSafeOperationRewardList(GxtSafeOperationReward gxtSafeOperationReward);
+
+    /**
+     * 新增安全运行奖励
+     * 
+     * @param gxtSafeOperationReward 安全运行奖励
+     * @return 结果
+     */
+    public int insertGxtSafeOperationReward(GxtSafeOperationReward gxtSafeOperationReward);
+
+    /**
+     * 修改安全运行奖励
+     * 
+     * @param gxtSafeOperationReward 安全运行奖励
+     * @return 结果
+     */
+    public int updateGxtSafeOperationReward(GxtSafeOperationReward gxtSafeOperationReward);
+
+    /**
+     * 批量删除安全运行奖励
+     * 
+     * @param ids 需要删除的运行时长分值配置主键集合
+     * @return 结果
+     */
+    public int deleteGxtSafeOperationRewardByIds(Long[] ids);
+
+    /**
+     * 删除安全运行奖励信息
+     * 
+     * @param id 安全运行奖励主键
+     * @return 结果
+     */
+    public int deleteGxtSafeOperationRewardById(Long id);
+}

+ 19 - 2
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtOrderHourServiceImpl.java

@@ -1052,8 +1052,9 @@ public class GxtOrderHourServiceImpl implements IGxtOrderHourService {
         /*double processingHours = calculateOrderProcessingHours(order);
         order.setHandleHour(processingHours);*/
 
+        /*
         // 停运时长 = 复运时间 – 故障发生时间(维修工单)或创建时间(维保工单)
-        Double originalDowntimeHour = null;
+         Double originalDowntimeHour = null;
         if (order.getRestartTime() != null) {
             Date startTime = null;
             if (order.getOrderType() == 1) { // 维修工单
@@ -1062,13 +1063,29 @@ public class GxtOrderHourServiceImpl implements IGxtOrderHourService {
                 startTime = order.getCreateTime();
             }
 
+            if (startTime != null) {
+                long diffMillis = order.getRestartTime().getTime() - startTime.getTime();
+                originalDowntimeHour = diffMillis / (1000.0 * 60 * 60);
+                order.setDowntimeHour(originalDowntimeHour);
+            }
+        }*/
+
+        // 停运时长 = 复运时间 – 故障发生时间(维修工单)或停机时间(维保工单)
+        Double originalDowntimeHour = null;
+        if (order.getRestartTime() != null) {
+            Date startTime = null;
+            if (order.getOrderType() == 1) { // 维修工单
+                startTime = order.getOccurTime();
+            } else if (order.getOrderType() == 2) { // 维保工单
+                startTime = order.getPauseTime();
+            }
+
             if (startTime != null) {
                 long diffMillis = order.getRestartTime().getTime() - startTime.getTime();
                 originalDowntimeHour = diffMillis / (1000.0 * 60 * 60);
                 order.setDowntimeHour(originalDowntimeHour);
             }
         }
-        
         // 使用新方法计算停运时长:停运时长 = 下发时长 + 接单时长 + 准备时长 + 挂起时长 + 作业时长 + 复运时长
         // G(停运时长)=A(下发时长)+B(接单时长)+C(准备时长)+D(挂起时长)+E(作业时长)+F(复运时长)
         if (originalDowntimeHour != null) {

+ 93 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtSafeOperationRewardServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ygtx.gxt.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ygtx.gxt.mapper.GxtSafeOperationRewardMapper;
+import com.ygtx.gxt.domain.GxtSafeOperationReward;
+import com.ygtx.gxt.service.IGxtSafeOperationRewardService;
+
+/**
+ * 安全运行奖励Service业务层处理
+ * 
+ * @author ygtx
+ * @date 2026-01-07
+ */
+@Service
+public class GxtSafeOperationRewardServiceImpl implements IGxtSafeOperationRewardService
+{
+    @Autowired
+    private GxtSafeOperationRewardMapper gxtSafeOperationRewardMapper;
+
+    /**
+     * 查询安全运行奖励
+     * 
+     * @param id 安全运行奖励主键
+     * @return 安全运行奖励
+     */
+    @Override
+    public GxtSafeOperationReward selectGxtSafeOperationRewardById(Long id)
+    {
+        return gxtSafeOperationRewardMapper.selectGxtSafeOperationRewardById(id);
+    }
+
+    /**
+     * 查询安全运行奖励列表
+     * 
+     * @param gxtSafeOperationReward 安全运行奖励
+     * @return 安全运行奖励
+     */
+    @Override
+    public List<GxtSafeOperationReward> selectGxtSafeOperationRewardList(GxtSafeOperationReward gxtSafeOperationReward)
+    {
+        return gxtSafeOperationRewardMapper.selectGxtSafeOperationRewardList(gxtSafeOperationReward);
+    }
+
+    /**
+     * 新增安全运行奖励
+     * 
+     * @param gxtSafeOperationReward 安全运行奖励
+     * @return 结果
+     */
+    @Override
+    public int insertGxtSafeOperationReward(GxtSafeOperationReward gxtSafeOperationReward)
+    {
+        return gxtSafeOperationRewardMapper.insertGxtSafeOperationReward(gxtSafeOperationReward);
+    }
+
+    /**
+     * 修改安全运行奖励
+     * 
+     * @param gxtSafeOperationReward 安全运行奖励
+     * @return 结果
+     */
+    @Override
+    public int updateGxtSafeOperationReward(GxtSafeOperationReward gxtSafeOperationReward)
+    {
+        return gxtSafeOperationRewardMapper.updateGxtSafeOperationReward(gxtSafeOperationReward);
+    }
+
+    /**
+     * 批量删除安全运行奖励
+     * 
+     * @param ids 需要删除的安全运行奖励主键
+     * @return 结果
+     */
+    @Override
+    public int deleteGxtSafeOperationRewardByIds(Long[] ids)
+    {
+        return gxtSafeOperationRewardMapper.deleteGxtSafeOperationRewardByIds(ids);
+    }
+
+    /**
+     * 删除安全运行奖励信息
+     * 
+     * @param id 安全运行奖励主键
+     * @return 结果
+     */
+    @Override
+    public int deleteGxtSafeOperationRewardById(Long id)
+    {
+        return gxtSafeOperationRewardMapper.deleteGxtSafeOperationRewardById(id);
+    }
+}

+ 5 - 1
ygtx-gxt/src/main/resources/mapper/gxt/GxtRepairOrderPersonMapper.xml

@@ -25,10 +25,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="score"    column="score"    />
         <result property="extraScore"    column="extra_score"    />
         <result property="totalScore"    column="total_score"    />
+        <result property="runScore"    column="run_score"    />
     </resultMap>
 
     <sql id="selectGxtRepairOrderPersonVo">
-        select id, user_id, nick_name, order_id, order_code, status, score, self_score, review_score, final_score, is_leader, feedback_reason, confirm_status, create_by, create_time, update_time, remark, extra_score, total_score from gxt_repair_order_person
+        select id, user_id, nick_name, order_id, order_code, status, score, self_score, review_score, final_score, is_leader, feedback_reason, confirm_status, create_by, create_time, update_time, remark, extra_score, total_score, run_score from gxt_repair_order_person
     </sql>
 
     <select id="selectGxtRepairOrderPersonList" parameterType="GxtRepairOrderPerson" resultMap="GxtRepairOrderPersonResult">
@@ -88,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">remark,</if>
             <if test="extraScore != null">extra_score,</if>
             <if test="totalScore != null">total_score,</if>
+            <if test="runScore != null">run_score,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -109,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">#{remark},</if>
             <if test="extraScore != null">#{extraScore},</if>
             <if test="totalScore != null">#{totalScore},</if>
+            <if test="runScore != null">#{runScore},</if>
          </trim>
     </insert>
 
@@ -134,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">remark = #{remark},</if>
             <if test="extraScore != null">extra_score = #{extraScore},</if>
             <if test="totalScore != null">total_score = #{totalScore},</if>
+            <if test="runScore != null">run_score = #{runScore},</if>
         </trim>
         where id = #{id}
     </update>

+ 92 - 0
ygtx-gxt/src/main/resources/mapper/gxt/GxtSafeOperationRewardMapper.xml

@@ -0,0 +1,92 @@
+<?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.ygtx.gxt.mapper.GxtSafeOperationRewardMapper">
+
+    <resultMap type="GxtSafeOperationReward" id="GxtSafeOperationRewardResult">
+        <result property="id" column="id"/>
+        <result property="safeDuration" column="safe_duration"/>
+        <result property="plannedMaintenanceScore" column="planned_maintenance_score"/>
+        <result property="unplannedMaintenanceScore" column="unplanned_maintenance_score"/>
+        <result property="status" column="status"/>
+        <result property="createBy" column="create_by"/>
+        <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="selectGxtSafeOperationRewardVo">
+        select id, safe_duration, planned_maintenance_score, unplanned_maintenance_score, status, create_by, create_time, update_by, update_time, remark from gxt_safe_operation_reward
+    </sql>
+
+    <select id="selectGxtSafeOperationRewardList" parameterType="GxtSafeOperationReward" resultMap="GxtSafeOperationRewardResult">
+        <include refid="selectGxtSafeOperationRewardVo"/>
+        <where>  
+            <if test="safeDuration != null "> and safe_duration = #{safeDuration}</if>
+            <if test="plannedMaintenanceScore != null "> and planned_maintenance_score = #{plannedMaintenanceScore}</if>
+            <if test="unplannedMaintenanceScore != null "> and unplanned_maintenance_score = #{unplannedMaintenanceScore}</if>
+            <if test="status != null "> and status = #{status}</if>
+        </where>
+        order by safe_duration asc
+    </select>
+    
+    <select id="selectGxtSafeOperationRewardById" parameterType="Long" resultMap="GxtSafeOperationRewardResult">
+        <include refid="selectGxtSafeOperationRewardVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertGxtSafeOperationReward" parameterType="GxtSafeOperationReward" useGeneratedKeys="true" keyProperty="id">
+        insert into gxt_safe_operation_reward
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="safeDuration != null">safe_duration,</if>
+            <if test="plannedMaintenanceScore != null">planned_maintenance_score,</if>
+            <if test="unplannedMaintenanceScore != null">unplanned_maintenance_score,</if>
+            <if test="status != null">status,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="safeDuration != null">#{safeDuration},</if>
+            <if test="plannedMaintenanceScore != null">#{plannedMaintenanceScore},</if>
+            <if test="unplannedMaintenanceScore != null">#{unplannedMaintenanceScore},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateGxtSafeOperationReward" parameterType="GxtSafeOperationReward">
+        update gxt_safe_operation_reward
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="safeDuration != null">safe_duration = #{safeDuration},</if>
+            <if test="plannedMaintenanceScore != null">planned_maintenance_score = #{plannedMaintenanceScore},</if>
+            <if test="unplannedMaintenanceScore != null">unplanned_maintenance_score = #{unplannedMaintenanceScore},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">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="deleteGxtSafeOperationRewardById" parameterType="Long">
+        delete from gxt_safe_operation_reward where id = #{id}
+    </delete>
+
+    <delete id="deleteGxtSafeOperationRewardByIds" parameterType="Long">
+        delete from gxt_safe_operation_reward where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 5 - 1
ygtx-gxt/src/main/resources/mapper/gxt/GxtWorkOrderPersonMapper.xml

@@ -27,10 +27,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="remark"    column="remark"    />
         <result property="extraScore"    column="extra_score"    />
         <result property="totalScore"    column="total_score"    />
+        <result property="runScore"    column="run_score"    />
     </resultMap>
 
     <sql id="selectGxtWorkOrderPersonVo">
-        select id, user_id, nick_name, order_id, order_code, status, mis_no, user_name, score, self_score, review_score, final_score, is_leader, feedback_reason, confirm_status, create_by, create_time, update_by, update_time, remark, extra_score, total_score
+        select id, user_id, nick_name, order_id, order_code, status, mis_no, user_name, score, self_score, review_score, final_score, is_leader, feedback_reason, confirm_status, create_by, create_time, update_by, update_time, remark, extra_score, total_score, run_score
         from gxt_work_order_person
     </sql>
 
@@ -105,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="confirmStatus != null">confirm_status,</if>
             <if test="extraScore != null">extra_score,</if>
             <if test="totalScore != null">total_score,</if>
+            <if test="runScore != null">run_score,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -128,6 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="confirmStatus != null">#{confirmStatus},</if>
             <if test="extraScore != null">#{extraScore},</if>
             <if test="totalScore != null">#{totalScore},</if>
+            <if test="runScore != null">#{runScore},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -155,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="confirmStatus != null">confirm_status = #{confirmStatus},</if>
             <if test="extraScore != null">extra_score = #{extraScore},</if>
             <if test="totalScore != null">total_score = #{totalScore},</if>
+            <if test="runScore != null">run_score = #{runScore},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>

+ 61 - 0
ygtx-ui/src/api/gxt/safeOperationReward.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request'
+
+// 查询安全运行奖励列表
+export function listSafeOperationReward(query) {
+  return request({
+    url: '/gxt/safeoperationreward/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询安全运行奖励详细
+export function getSafeOperationReward(id) {
+  return request({
+    url: '/gxt/safeoperationreward/' + id,
+    method: 'get'
+  })
+}
+
+// 新增安全运行奖励
+export function addSafeOperationReward(data) {
+  return request({
+    url: '/gxt/safeoperationreward',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改安全运行奖励
+export function updateSafeOperationReward(data) {
+  return request({
+    url: '/gxt/safeoperationreward',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除安全运行奖励
+export function delSafeOperationReward(id) {
+  return request({
+    url: '/gxt/safeoperationreward/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出安全运行奖励
+export function exportSafeOperationReward(query) {
+  return request({
+    url: '/gxt/safeoperationreward/export',
+    method: 'post',
+    params: query
+  })
+}
+
+// 获取安全运行奖励导出字段列表
+export function getExportFields() {
+  return request({
+    url: '/gxt/safeoperationreward/exportFields',
+    method: 'get'
+  })
+}

+ 404 - 0
ygtx-ui/src/views/gxt/safeOperationReward/index.vue

@@ -0,0 +1,404 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="top">
+      <el-form-item label="连续安全运行时长" prop="safeDuration" label-position="top">
+        <el-input
+          v-model="queryParams.safeDuration"
+          placeholder="请输入连续安全运行时长"
+          clearable
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="启用状态" prop="status" label-position="top">
+        <el-select v-model="queryParams.status" placeholder="启用状态" clearable>
+          <el-option
+            v-for="dict in sys_normal_disable"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label-position="top">
+        <div class="item-search">&nbsp;</div>
+        <div class="item-search">
+          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+        </div>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="Plus"
+          @click="handleAdd"
+          v-hasPermi="['gxt:safeoperationreward:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="Edit"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['gxt:safeoperationreward:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="Delete"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['gxt:safeoperationreward:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="Download"
+          @click="handleExport"
+          v-hasPermi="['gxt:safeoperationreward:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="safeOperationRewardList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="连续安全运行时长" align="center">
+        <template #default="scope">{{ '≥' + scope.row.safeDuration + '天'}}</template>
+      </el-table-column>
+      <el-table-column label="计划检修奖励分值" prop="plannedMaintenanceScore"  align="center"/>
+      <el-table-column label="非计划检修奖励分值" prop="unplannedMaintenanceScore" align="center"/>
+      <el-table-column label="启用状态" prop="status" align="center">
+        <template #default="scope">
+          <dict-tag :options="sys_normal_disable" :value="scope.row.status" />
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" width="180" class-name="small-padding fixed-width" align="center">
+        <template #default="scope">
+          <el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['gxt:safeoperationreward:edit']"><i class="fa fa-edit"></i>编辑</el-button>
+          <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['gxt:safeoperationreward:remove']"><i class="fa fa-trash"></i>删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改安全运行奖励对话框 -->
+    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
+      <el-form ref="formRef" :model="form" :rules="rules" label-width="200px">
+        <el-form-item label="连续安全运行时长(≥)" prop="safeDuration">
+          <el-input-number v-model="form.safeDuration" placeholder="请输入连续安全运行时长(天)" controls-position="right" :precision="0" :step="1"/>(天)
+        </el-form-item>
+        <el-form-item label="计划检修奖励分值" prop="plannedMaintenanceScore">
+          <el-input-number v-model="form.plannedMaintenanceScore" controls-position="right" :precision="2" :step="0.1" />
+        </el-form-item>
+        <el-form-item label="非计划检修奖励分值" prop="unplannedMaintenanceScore">
+          <el-input-number v-model="form.unplannedMaintenanceScore" controls-position="right" :precision="2" :step="0.1" />
+        </el-form-item>
+        <el-form-item label="启用状态" prop="status">
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="dict in sys_normal_disable"
+              :key="dict.value"
+              :label="Number(dict.value)"
+            >{{ dict.label }}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" maxlength="200" show-word-limit/>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+    
+    <!-- 字段选择对话框 -->
+    <el-dialog title="选择导出字段" v-model="showExportFieldsDialog" width="600px" append-to-body>
+      <div style="position: absolute;bottom: 65px;right: 38%;">
+        <el-button type="primary" icon="upload" size="mini" style="width:5px;" @click="upDown('up')" /><br/>
+        <el-button type="primary" icon="download" size="mini" style="margin-top:3px;width:5px;" @click="upDown('down')" />
+      </div>
+      <el-transfer 
+        v-model="exportFieldsSelected" 
+        :data="exportFieldsData" 
+        :titles="['可选字段', '导出字段']"
+        target-order = "push"
+        show-checkbox
+        filterable
+        filter-placeholder="请输入字段名称"
+        @right-check-change="rightCheckHandler">
+      </el-transfer>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="showExportFieldsDialog = false">取 消</el-button>
+          <el-button type="primary" @click="confirmExport">确 定</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="SafeOperationReward">
+import { ref, reactive, toRefs, getCurrentInstance } from "vue"
+import { listSafeOperationReward, getSafeOperationReward, delSafeOperationReward, addSafeOperationReward, updateSafeOperationReward, exportSafeOperationReward, getExportFields } from "@/api/gxt/safeOperationReward"
+
+const { proxy } = getCurrentInstance()
+const { sys_normal_disable } = proxy.useDict("sys_normal_disable")
+
+const safeOperationRewardList = ref([])
+const open = ref(false)
+const loading = ref(true)
+const showSearch = ref(true)
+const ids = ref([])
+const single = ref(true)
+const multiple = ref(true)
+const total = ref(0)
+const title = ref("")
+
+// 导出字段选择相关
+const showExportFieldsDialog = ref(false)
+const exportFieldsSelected = ref([])
+const exportFieldsData = ref([])
+
+const data = reactive({
+  form: {},
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    safeDuration: undefined,
+    plannedMaintenanceScore: undefined,
+    unplannedMaintenanceScore: undefined,
+    status: undefined
+  },
+  rules: {
+    safeDuration: [{ required: true, message: "连续安全运行时长不能为空", trigger: "blur" }],
+    plannedMaintenanceScore: [{ required: true, message: "计划检修奖励分值不能为空", trigger: "blur" }],
+    unplannedMaintenanceScore: [{ required: true, message: "非计划检修奖励分值不能为空", trigger: "blur" }]
+  }
+})
+
+const { queryParams, form, rules } = toRefs(data)
+
+/** 查询安全运行奖励列表 */
+function getList() {
+  loading.value = true
+  listSafeOperationReward(queryParams.value).then(response => {
+    safeOperationRewardList.value = response.rows
+    total.value = response.total
+    loading.value = false
+  })
+}
+
+/** 取消按钮 */
+function cancel() {
+  open.value = false
+  reset()
+}
+
+/** 表单重置 */
+function reset() {
+  form.value = {
+    safeDuration: undefined,
+    plannedMaintenanceScore: undefined,
+    unplannedMaintenanceScore: undefined,
+    status: 0,
+    remark: undefined
+  }
+  proxy.resetForm("formRef")
+}
+
+/** 搜索按钮操作 */
+function handleQuery() {
+  queryParams.value.pageNum = 1
+  getList()
+}
+
+/** 重置按钮操作 */
+function resetQuery() {
+  proxy.resetForm("queryRef")
+  handleQuery()
+}
+
+/** 多选框选中数据 */
+function handleSelectionChange(selection) {
+  ids.value = selection.map(item => item.id)
+  single.value = selection.length != 1
+  multiple.value = !selection.length
+}
+
+/** 新增按钮操作 */
+function handleAdd() {
+  reset()
+  open.value = true
+  title.value = "添加安全运行奖励"
+}
+
+/** 修改按钮操作 */
+function handleUpdate(row) {
+  reset()
+  const id = row.id || ids.value
+  getSafeOperationReward(id).then(response => {
+    form.value = response.data
+    open.value = true
+    title.value = "修改安全运行奖励"
+  })
+}
+
+/** 提交按钮 */
+function submitForm() {
+  proxy.$refs["formRef"].validate(valid => {
+    if (valid) {
+      if (form.value.id != undefined) {
+        updateSafeOperationReward(form.value).then(response => {
+          proxy.$modal.msgSuccess("修改成功")
+          open.value = false
+          getList()
+        })
+      } else {
+        addSafeOperationReward(form.value).then(response => {
+          proxy.$modal.msgSuccess("新增成功")
+          open.value = false
+          getList()
+        })
+      }
+    }
+  })
+}
+
+/** 删除按钮操作 */
+function handleDelete(row) {
+  const deleteIds = row.id || ids.value
+  proxy.$modal.confirm('是否确认删除安全运行奖励编号为"' + deleteIds + '"的数据项?').then(function() {
+    return delSafeOperationReward(deleteIds)
+  }).then(() => {
+    getList()
+    proxy.$modal.msgSuccess("删除成功")
+  }).catch(() => {})
+}
+
+/** 导出按钮操作 */
+function handleExport() {
+  // 获取导出字段数据并处理默认选中
+  getExportFieldsData().then(() => {
+    // 显示字段选择对话框
+    showExportFieldsDialog.value = true
+    
+    // 定义默认选中的字段(基于字段标签)
+    const defaultSelectedLabels = [
+      '连续安全运行时长',
+      '计划检修奖励分值',
+      '非计划检修奖励分值',
+      '启用状态'
+    ];
+    
+    // 在导出字段中查找对应的key
+    const selectedKeys = [];
+    exportFieldsData.value.forEach(field => {
+      if (defaultSelectedLabels.includes(field.label)) {
+        selectedKeys.push(field.key);
+      }
+    });
+    
+    // 设置默认选中的字段
+    exportFieldsSelected.value = selectedKeys;
+  });
+}
+
+/** 确认导出 */
+function confirmExport() {
+  if (exportFieldsSelected.value.length === 0) {
+    proxy.$modal.msgWarning("请至少选择一个导出字段")
+    return
+  }
+  
+  // 将导出字段拼接成字符串
+  const exportFieldsStr = exportFieldsSelected.value.join(',')
+  
+  const exportParams = {
+    ...queryParams.value,
+    exportFields: exportFieldsStr
+  }
+
+  proxy.download("gxt/safeoperationreward/export", exportParams, `safeoperationreward_${new Date().getTime()}.xlsx`)
+  
+  showExportFieldsDialog.value = false
+}
+
+/** 获取导出字段数据 */
+function getExportFieldsData() {
+  return getExportFields().then(response => {
+    exportFieldsData.value = response.data;
+    return response.data;
+  });
+}
+
+/** 解析时间 */
+function parseTime(time) {
+  if (!time) return ''
+  const date = new Date(time)
+  const year = date.getFullYear()
+  const month = String(date.getMonth() + 1).padStart(2, '0')
+  const day = String(date.getDate()).padStart(2, '0')
+  const hours = String(date.getHours()).padStart(2, '0')
+  const minutes = String(date.getMinutes()).padStart(2, '0')
+  const seconds = String(date.getSeconds()).padStart(2, '0')
+  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+}
+
+const rightChecks = ref([])
+function rightCheckHandler(val) {
+  rightChecks.value = exportFieldsSelected.value
+    .filter(item => val.includes(item))
+  console.log(rightChecks.value, "rightCheckHandler")
+}
+
+function upDown(direction) {
+   // 找出最小和最大索引
+  const indices = rightChecks.value
+    .map(i => exportFieldsSelected.value.indexOf(i))
+    .filter(i => i !== -1)
+  const minIndex = Math.min(...indices)
+  const maxIndex = Math.max(...indices)
+  // 边界检查
+  if (direction === 'up' && minIndex === 0) {
+    console.log('已到顶部')
+    return
+  }
+  if (direction === 'down' && maxIndex === exportFieldsSelected.value.length - 1) {
+    console.log('已到底部')
+    return
+  }
+  if (direction === 'up') {
+    rightChecks.value.map(i => {
+      const index = exportFieldsSelected.value.findIndex(t => t == i)
+      exportFieldsSelected.value.splice(index, 1);
+      exportFieldsSelected.value.splice(index - 1, 0, i);
+    })
+  } else {
+    rightChecks.value.slice().reverse().forEach(i => {
+      const index = exportFieldsSelected.value.findIndex(t => t == i)
+      if (index < exportFieldsSelected.value.length - 1) {
+        exportFieldsSelected.value.splice(index, 1)
+        exportFieldsSelected.value.splice(index + 1, 0, i)
+      }
+    })
+  }
+}
+
+getList()
+</script>