Browse Source

周期运行情况-样式优化

wanglt 3 months ago
parent
commit
c33e31ef35

+ 2 - 2
ygtx-gxt/src/main/java/com/ygtx/gxt/controller/GxtMonthRuntimeController.java

@@ -60,8 +60,8 @@ public class GxtMonthRuntimeController extends BaseController
 
     @PreAuthorize("@ss.hasPermi('gxt:monthRuntime:query')")
     @GetMapping("/getOrders")
-    public TableDataInfo getOrders(@RequestParam Integer itemNum,@RequestParam Integer itemSize,@RequestParam Long pid,@RequestParam Integer fromDays,@RequestParam Integer toDays,@RequestParam boolean isStop) {
-        List<GxtWorkOrder> list = gxtMonthRuntimeService.getOrders(pid,fromDays,toDays,isStop);
+    public TableDataInfo getOrders(@RequestParam Integer itemNum,@RequestParam Integer itemSize,@RequestParam Long pid,@RequestParam Long stationId,@RequestParam Integer fromDays,@RequestParam Integer toDays,@RequestParam boolean isStop) {
+        List<GxtWorkOrder> list = gxtMonthRuntimeService.getOrders(pid,stationId,fromDays,toDays,isStop);
         Integer total = list.size();
         List<GxtWorkOrder> result = new ArrayList<>();
         if (itemNum!=null && itemSize!=null) {

+ 22 - 1
ygtx-gxt/src/main/java/com/ygtx/gxt/domain/GxtMonthRuntime.java

@@ -27,6 +27,10 @@ public class GxtMonthRuntime extends BaseEntity
     /** 场站名称 */
     private String deptName;
 
+    private Long stationId;
+
+    private String stationName;
+
     /** 运行天数范围ID */
     private Long runtimeScoreId;
 
@@ -95,7 +99,24 @@ public class GxtMonthRuntime extends BaseEntity
     {
         return deptName;
     }
-    public void setRuntimeScoreId(Long runtimeScoreId) 
+
+    public Long getStationId() {
+        return stationId;
+    }
+
+    public void setStationId(Long stationId) {
+        this.stationId = stationId;
+    }
+
+    public String getStationName() {
+        return stationName;
+    }
+
+    public void setStationName(String stationName) {
+        this.stationName = stationName;
+    }
+
+    public void setRuntimeScoreId(Long runtimeScoreId)
     {
         this.runtimeScoreId = runtimeScoreId;
     }

+ 1 - 1
ygtx-gxt/src/main/java/com/ygtx/gxt/service/IGxtMonthRuntimeService.java

@@ -28,7 +28,7 @@ public interface IGxtMonthRuntimeService
      */
     public List<GxtMonthRuntime> selectGxtMonthRuntimeList(GxtMonthRuntime gxtMonthRuntime);
 
-    public List<GxtWorkOrder> getOrders(Long pid, Integer fromDays, Integer toDays, boolean isStop);
+    public List<GxtWorkOrder> getOrders(Long pid, Long stationId, Integer fromDays, Integer toDays, boolean isStop);
 
     /**
      * 新增月度场站运行天数工单

+ 16 - 8
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtMonthRuntimeServiceImpl.java

@@ -64,7 +64,7 @@ public class GxtMonthRuntimeServiceImpl implements IGxtMonthRuntimeService
     @Override
     public List<GxtMonthRuntime> selectGxtMonthRuntimeList(GxtMonthRuntime gxtMonthRuntime)
     {
-        List<GxtWorkOrder> workOrders = getOrdersByPid(gxtMonthRuntime.getDeptName(),null);
+        List<GxtWorkOrder> workOrders = getOrdersByPid(gxtMonthRuntime.getDeptName(),gxtMonthRuntime.getStationName(),null, null);
         List<GxtMonthRuntime> result = new ArrayList<>();
         if (!workOrders.isEmpty()) {
             GxtSafeOperationReward safeOperationReward = new GxtSafeOperationReward();
@@ -91,7 +91,7 @@ public class GxtMonthRuntimeServiceImpl implements IGxtMonthRuntimeService
                             String runtimeRange = "≥" + fromDays + "天";
                             if (!result.isEmpty()) {
                                 for (GxtMonthRuntime runtime:result) {
-                                    if (Objects.equals(runtime.getDeptId(), workOrder.getPcsStationPid()) && runtime.getRuntimeRange().equals(runtimeRange)) {
+                                    if (Objects.equals(runtime.getStationId(), workOrder.getPcsStationId()) && runtime.getRuntimeRange().equals(runtimeRange)) {
                                         isAdd = false;
                                         runtime.setStopNum(runtime.getStopNum()+1);
                                         break;
@@ -102,6 +102,8 @@ public class GxtMonthRuntimeServiceImpl implements IGxtMonthRuntimeService
                                 GxtMonthRuntime addRuntime = new GxtMonthRuntime();
                                 addRuntime.setDeptName(workOrder.getDeptName());
                                 addRuntime.setDeptId(workOrder.getPcsStationPid());
+                                addRuntime.setStationId(workOrder.getPcsStationId());
+                                addRuntime.setStationName(workOrder.getPcsStationName());
                                 addRuntime.setFromDays(fromDays);
                                 addRuntime.setToDays(toDays);
                                 addRuntime.setRuntimeRange(runtimeRange);
@@ -116,7 +118,7 @@ public class GxtMonthRuntimeServiceImpl implements IGxtMonthRuntimeService
                             String runtimeRange = "≥" + fromDays + "天";
                             if (!result.isEmpty()) {
                                 for (GxtMonthRuntime runtime:result) {
-                                    if (Objects.equals(runtime.getDeptId(), workOrder.getPcsStationPid()) && runtime.getRuntimeRange().equals(runtimeRange)) {
+                                    if (Objects.equals(runtime.getStationId(), workOrder.getPcsStationId()) && runtime.getRuntimeRange().equals(runtimeRange)) {
                                         isAdd = false;
                                         runtime.setRunningNum(runtime.getRunningNum()+1);
                                         break;
@@ -127,6 +129,8 @@ public class GxtMonthRuntimeServiceImpl implements IGxtMonthRuntimeService
                                 GxtMonthRuntime addRuntime = new GxtMonthRuntime();
                                 addRuntime.setDeptName(workOrder.getDeptName());
                                 addRuntime.setDeptId(workOrder.getPcsStationPid());
+                                addRuntime.setStationId(workOrder.getPcsStationId());
+                                addRuntime.setStationName(workOrder.getPcsStationName());
                                 addRuntime.setFromDays(fromDays);
                                 addRuntime.setToDays(toDays);
                                 addRuntime.setRuntimeRange(runtimeRange);
@@ -152,14 +156,18 @@ public class GxtMonthRuntimeServiceImpl implements IGxtMonthRuntimeService
         return result;
     }
 
-    public List<GxtWorkOrder> getOrdersByPid(String searchName,Long pid) {
+    public List<GxtWorkOrder> getOrdersByPid(String deptName, String stationName,Long pid, Long stationId) {
         GxtWorkOrder searchOrder = new GxtWorkOrder();
         searchOrder.setPcsStationPid(pid);
-        searchOrder.setDeptName(searchName);
+        searchOrder.setPcsStationId(stationId);
+        searchOrder.setDeptName(deptName);
+        searchOrder.setPcsStationName(stationName);
         addBusinessDataScopeFilter(searchOrder);
         GxtWorkOrder searchRepairOrder = new GxtWorkOrder();
         searchRepairOrder.setPcsStationPid(pid);
-        searchRepairOrder.setDeptName(searchName);
+        searchRepairOrder.setPcsStationId(stationId);
+        searchRepairOrder.setDeptName(deptName);
+        searchRepairOrder.setPcsStationName(stationName);
         addBusinessDataScopeFilterRepair(searchRepairOrder);
         List<GxtWorkOrder> workOrders = new ArrayList<>();
         List<GxtWorkOrder> workOrderList = gxtWorkOrderMapper.selectGxtWorkOrderRunningDaysInfo(searchOrder);
@@ -206,8 +214,8 @@ public class GxtMonthRuntimeServiceImpl implements IGxtMonthRuntimeService
     }
 
     @Override
-    public List<GxtWorkOrder> getOrders(Long pid,Integer fromDays,Integer toDays,boolean isStop) {
-        List<GxtWorkOrder> workOrders = getOrdersByPid(null,pid);
+    public List<GxtWorkOrder> getOrders(Long pid, Long stationId,Integer fromDays,Integer toDays,boolean isStop) {
+        List<GxtWorkOrder> workOrders = getOrdersByPid(null, null, pid, stationId);
         List<GxtWorkOrder> result = new ArrayList<>();
         if (!workOrders.isEmpty()) {
             for (GxtWorkOrder order:workOrders) {

+ 6 - 2
ygtx-gxt/src/main/resources/mapper/gxt/GxtWorkOrderMapper.xml

@@ -924,7 +924,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             COALESCE ( t.pause_time, t.real_start_time ) AS pause_time,
             t.pcs_station_pid,
             1 AS order_type,
-            t.pcs_device_id,t.gxt_center,t.pcs_station_name,d.dept_name,
+            t.pcs_device_id,t.gxt_center_id,t.gxt_center,t.pcs_station_id,t.pcs_station_name,d.dept_name,
             DATEDIFF( t.restart_time, COALESCE ( t.pause_time, t.real_start_time ) ) AS stop_days,
             DATEDIFF( NOW(), DATE(t.restart_time) + INTERVAL 1 DAY ) AS running_days
         FROM
@@ -950,6 +950,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             latest.pcs_device_id IS NOT NULL
             AND t.restart_time IS NOT NULL
         <if test="deptName != null  and deptName != ''"> and d.dept_name like concat('%', #{deptName}, '%')</if>
+        <if test="pcsStationName != null  and pcsStationName != ''"> and t.pcs_station_name like concat('%', #{pcsStationName}, '%')</if>
+        <if test="pcsStationId != null"> and t.pcs_station_id = #{pcsStationId}</if>
         <if test="pcsStationPid != null"> and t.pcs_station_pid = #{pcsStationPid}</if>
         <if test="params.businessDataScope != null and params.businessDataScope != ''">
             ${params.businessDataScope}
@@ -965,7 +967,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         t.pcs_station_pid,
         t.occur_time AS pause_time,
         2 AS order_type,
-        t.pcs_device_id,t.gxt_center,t.pcs_station_name,d.dept_name,
+        t.pcs_device_id,t.gxt_center_id,t.gxt_center,t.pcs_station_id,t.pcs_station_name,d.dept_name,
         DATEDIFF( t.restart_time, t.occur_time ) AS stop_days,
         DATEDIFF( NOW(), DATE(t.restart_time) + INTERVAL 1 DAY ) AS running_days
         FROM
@@ -987,6 +989,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         t.occur_time IS NOT NULL
         AND t.restart_time IS NOT NULL
         <if test="deptName != null  and deptName != ''"> and d.dept_name like concat('%', #{deptName}, '%')</if>
+        <if test="pcsStationName != null  and pcsStationName != ''"> and t.pcs_station_name like concat('%', #{pcsStationName}, '%')</if>
+        <if test="pcsStationId != null"> and t.pcs_station_id = #{pcsStationId}</if>
         <if test="pcsStationPid != null"> and t.pcs_station_pid = #{pcsStationPid}</if>
         <if test="params.businessDataScope != null and params.businessDataScope != ''">
             ${params.businessDataScope}

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

@@ -9,6 +9,14 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="设备场站" prop="stationName">
+        <el-input
+          v-model="queryParams.stationName"
+          placeholder="请输入设备场站"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item style="margin-right: 0;">
         <div class="item-search">&nbsp;</div>
         <div class="item-search" style="display: flex; gap: 8px;">
@@ -19,10 +27,10 @@
     </el-form>
 
     <!-- 数据表格 -->
-    <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" />
+    <el-table v-loading="loading" :data="list">
       <el-table-column label="场站名称" prop="deptName" />
-      <el-table-column label="运行天数" prop="runtimeRange">
+      <el-table-column label="设备场站" prop="stationName" />
+      <el-table-column label="天数" prop="runtimeRange">
         <template #default="scope">
           {{ scope.row.runtimeRange }}
         </template>
@@ -102,15 +110,12 @@ const openOrders = ref(false)
 const loading = ref(true)
 const ordersLoading = ref(false)
 const showSearch = ref(true)
-const ids = ref([])
-const single = ref(true)
-const multiple = ref(true)
 const total = ref(0)
 const ordersTitle = ref("")
 const isStop = ref(false)
 const orderTotal = ref(0)
 
-const orderQueryParams = ref({ itemNum: 1, itemSize: 10, pid: 0, fromDays: 0, toDays: 0, isStop: false })
+const orderQueryParams = ref({ itemNum: 1, itemSize: 10, pid: 0, stationId: 0, fromDays: 0, toDays: 0, isStop: false })
 
 const data = reactive({
   formData: {},
@@ -118,6 +123,7 @@ const data = reactive({
     pageNum: 1,
     pageSize: 10,
     deptName: undefined,
+    stationName: undefined,
     monthPeriod: undefined
   },
   ordersList: [],
@@ -160,13 +166,6 @@ function resetQuery() {
   handleQuery()
 }
 
-/** 多选框选中数据 */
-function handleSelectionChange(selection) {
-  ids.value = selection.map(item => item.id)
-  single.value = selection.length != 1
-  multiple.value = !selection.length
-}
-
 function getOrdersByNextPage() {
   // 调用API获取订单列表
   ordersLoading.value = true;
@@ -188,7 +187,7 @@ function handleShowOrders(row, type) {
   
   ordersTitle.value = title;
 
-  orderQueryParams.value = { itemNum: 1, itemSize: 10, pid: row.deptId, fromDays: row.fromDays, toDays: row.toDays || 0, isStop: isStop.value };
+  orderQueryParams.value = { itemNum: 1, itemSize: 10, pid: row.deptId, stationId: row.stationId, fromDays: row.fromDays, toDays: row.toDays || 0, isStop: isStop.value };
   
   // 调用API获取订单列表
   getOrdersByNextPage()