From f26131172d91045a502cb5f42c9da4dac6ffaf65 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期五, 21 六月 2024 16:26:01 +0800
Subject: [PATCH] check user and station

---
 pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
index e2b8675..1cc15ce 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
@@ -1,8 +1,6 @@
 package com.dy.pmsStation.workOrder;
 
 import com.alibaba.excel.util.StringUtils;
-import com.dy.common.webUtil.BaseResponseUtils;
-import com.dy.common.webUtil.GlException;
 import com.dy.pmsGlobal.daoBa.BaUserMapper;
 import com.dy.pmsGlobal.daoOth.OthFileMapper;
 import com.dy.pmsGlobal.daoPlt.PltStationMapper;
@@ -19,7 +17,6 @@
 import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
 import com.dy.pmsGlobal.pojoPr.PrWorkingInstruction;
 import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast;
-import com.dy.pmsGlobal.util.UserUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -79,8 +76,6 @@
             throw new RuntimeException("鍛樺伐缂栫爜:"+ userId +"涓嶅湪绯荤粺涓�,璇峰厛缁存姢鍛樺伐淇℃伅");
         }else if(userInfo.getDisabled()){
             throw new RuntimeException("鍛樺伐("+userInfo.getName()+")缂栫爜:"+ userId +"鍦ㄧ郴缁熷凡绂佺敤,璇峰厛鍚敤鍛樺伐");
-        }else if(userInfo.getDeleted()){
-            throw new RuntimeException("鍛樺伐("+userInfo.getName()+")缂栫爜:"+ userId +"鍦ㄧ郴缁熷凡鍒犻櫎,璇峰厛鎭㈠鍛樺伐淇℃伅");
         }
         return userInfo;
     }
@@ -96,11 +91,11 @@
         }else{
             stationId = Long.parseLong(id.toString());
         }
-        PltStation record = new PltStation();
-        record.setId(stationId);
-        List<PltStation> stationInfo = pltStationDao.selectStationList(record);
-        if(stationInfo.size() == 0){
+        PltStation stationInfo = pltStationDao.selectByPrimaryKey(stationId);
+        if(stationInfo == null){
             throw new RuntimeException("宸ョ珯缂栫爜:"+ stationId +"涓嶅湪绯荤粺涓�,璇峰厛缁存姢宸ョ珯淇℃伅");
+        }else if(stationInfo.getDisabled()){
+            throw new RuntimeException("宸ョ珯("+stationInfo.getName()+")缂栫爜:"+ stationId +"鍦ㄧ郴缁熷凡绂佺敤,璇峰厛鍚敤宸ョ珯");
         }
         //妫�鏌ヨ〃涓璼tationId鏄惁宸茬粡瀛樺湪
         StaAssemblyWorkLast param = new StaAssemblyWorkLast();
@@ -110,7 +105,7 @@
         if(userStationList.size() > 0){
             throw new RuntimeException("鍛樺伐("+userStationList.get(0).getUserName()+")缂栫爜:"+ userStationList.get(0).getUserId() + "宸茬粡缁戝畾璇ュ伐绔�("+userStationList.get(0).getStationName()+")缂栫爜:" + userStationList.get(0).getStationId() + ".璇峰厛璁╁叾瑙g粦");
         }
-        return stationInfo.get(0);
+        return stationInfo;
     }
     public String checkUserAndStation(QueryVo last){
         String message = "OK";

--
Gitblit v1.8.0