Forráskód Böngészése

安全运行奖励调整

ouyj 3 hónapja
szülő
commit
f7151acd17

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

@@ -2,6 +2,7 @@ package com.ygtx.gxt.domain;
 
 import com.ygtx.common.annotation.Excel;
 import com.ygtx.common.core.domain.BaseEntity;
+import com.ygtx.gxt.handler.SafeDurationExcelHandler;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -25,22 +26,21 @@ public class GxtSafeOperationReward extends BaseEntity
     private Long id;
 
     /** 连续安全运行时长(天) */
-    @Excel(name = "连续安全运行时长")
+    @Excel(name = "连续安全运行时长", handler = SafeDurationExcelHandler.class)
     @ApiModelProperty(value = "连续安全运行时长(天)")
     private Integer safeDuration;
 
-    /** 计划检修奖励分值 */
-    @Excel(name = "计划检修奖励分值")
-    @ApiModelProperty(value = "计划检修奖励分值")
+    /** 维保工单奖励分值 */
+    @Excel(name = "维保工单奖励分值")
+    @ApiModelProperty(value = "维保工单奖励分值")
     private BigDecimal plannedMaintenanceScore;
 
-    /** 非计划检修奖励分值 */
-    @Excel(name = "非计划检修奖励分值")
-    @ApiModelProperty(value = "非计划检修奖励分值")
+    /** 维修工单奖励分值 */
+    @Excel(name = "维修工单奖励分值")
+    @ApiModelProperty(value = "维修工单奖励分值")
     private BigDecimal unplannedMaintenanceScore;
 
     /** 状态 */
-    @Excel(name = "启用状态")
     @ApiModelProperty(value = "状态")
     private Integer status;
 

+ 26 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/handler/SafeDurationExcelHandler.java

@@ -0,0 +1,26 @@
+package com.ygtx.gxt.handler;
+
+import com.ygtx.common.utils.poi.ExcelHandlerAdapter;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Workbook;
+
+/**
+ * 安全运行时长Excel处理器 - 用于在导出时格式化显示为 "≥X天"
+ * 
+ * @author ygtx
+ * @date 2026-01-12
+ */
+public class SafeDurationExcelHandler implements ExcelHandlerAdapter
+{
+    @Override
+    public Object format(Object value, String[] args, Cell cell, Workbook wb)
+    {
+        if (value == null)
+        {
+            return "";
+        }
+        
+        // 将数值转换为 "≥X天" 格式
+        return "≥" + value.toString() + "天";
+    }
+}

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

@@ -2,11 +2,12 @@
   <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
+        <el-input-number
           v-model="queryParams.safeDuration"
-          placeholder="请输入连续安全运行时长"
+          placeholder="请输入时长"
           clearable
           @keyup.enter="handleQuery"
+          controls-position="right" :precision="0" :step="1" :min="0"
         />
       </el-form-item>
       <el-form-item label="启用状态" prop="status" label-position="top">
@@ -71,8 +72,8 @@
       <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="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" />
@@ -95,16 +96,16 @@
     />
 
     <!-- 添加或修改安全运行奖励对话框 -->
-    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
+    <el-dialog :title="title" v-model="open" width="600px" 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-input-number v-model="form.safeDuration" placeholder="请输入连续安全运行时长(天)" controls-position="right" :precision="0" :step="1" :min="0" style="width: 80%"/>(天)
         </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 label="维保工单奖励分值" prop="plannedMaintenanceScore">
+          <el-input-number v-model="form.plannedMaintenanceScore" controls-position="right" :precision="2" :step="0.1" :min="0" style="width: 100%"/>
         </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 label="维修工单奖励分值" prop="unplannedMaintenanceScore">
+          <el-input-number v-model="form.unplannedMaintenanceScore" controls-position="right" :precision="2" :step="0.1" :min="0" style="width: 100%"/>
         </el-form-item>
         <el-form-item label="启用状态" prop="status">
           <el-radio-group v-model="form.status">
@@ -187,8 +188,8 @@ const data = reactive({
   },
   rules: {
     safeDuration: [{ required: true, message: "连续安全运行时长不能为空", trigger: "blur" }],
-    plannedMaintenanceScore: [{ required: true, message: "计划检修奖励分值不能为空", trigger: "blur" }],
-    unplannedMaintenanceScore: [{ required: true, message: "非计划检修奖励分值不能为空", trigger: "blur" }]
+    plannedMaintenanceScore: [{ required: true, message: "维保工单奖励分值不能为空", trigger: "blur" }],
+    unplannedMaintenanceScore: [{ required: true, message: "维修工单奖励分值不能为空", trigger: "blur" }]
   }
 })
 
@@ -301,9 +302,8 @@ function handleExport() {
     // 定义默认选中的字段(基于字段标签)
     const defaultSelectedLabels = [
       '连续安全运行时长',
-      '计划检修奖励分值',
-      '非计划检修奖励分值',
-      '启用状态'
+      '维保工单奖励分值',
+      '维修工单奖励分值'
     ];
     
     // 在导出字段中查找对应的key