From 2d35acb93b1654c660153edaddd55a50bf447fe4 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期三, 14 八月 2024 17:05:34 +0800
Subject: [PATCH] fix addAssistant

---
 pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 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 16f4d06..d1150fa 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
@@ -41,8 +41,8 @@
     private static final String WORK_TYPE_INSPECTION = "3";
     private static final String WORK_TYPE_REPAIR = "4";
 
-    private static final String USER_PREFIX = "101";
-    private static final String STATION_PREFIX = "103";
+//    private static final String USER_PREFIX = "101";
+//    private static final String STATION_PREFIX = "103";
 
     private PrAssemblyPlanMapper assemblyDao;
     private BaUserMapper baUserDao;
@@ -99,7 +99,7 @@
             throw new RuntimeException("鍛樺伐缂栫爜涓嶈兘涓虹┖");
         }
         //鐢ㄦ埛101
-        if (id.startsWith(USER_PREFIX)) {
+        if (id.startsWith(QrCodeConstant.TypeWorker)) {
             userId = Long.parseLong(id.toString().substring(3));
         } else {
             userId = Long.parseLong(id.toString());
@@ -120,7 +120,7 @@
             throw new RuntimeException("宸ョ珯缂栫爜涓嶈兘涓虹┖");
         }
         //宸ョ珯103
-        if (id.startsWith(STATION_PREFIX)) {
+        if (id.startsWith(QrCodeConstant.TypeStation)) {
             stationId = Long.parseLong(id.toString().substring(3));
         } else {
             stationId = Long.parseLong(id.toString());
@@ -149,12 +149,12 @@
             throw new RuntimeException("宸ョ珯缂栫爜鎴栧憳宸ョ紪鐮佸潎涓嶈兘涓虹┖,璇锋鏌�");
         }
         //宸ョ珯103
-        if (vo.getStationId().startsWith(USER_PREFIX)) {
+        if (vo.getStationId().startsWith(QrCodeConstant.TypeWorker)) {
             userInfo = getUserInfo(vo.getStationId());
         } else {
             stationInfo = getStationInfo(vo.getStationId());
         }
-        if (vo.getUserId().startsWith(STATION_PREFIX)) {
+        if (vo.getUserId().startsWith(QrCodeConstant.TypeStation)) {
             stationInfo = getStationInfo(vo.getUserId());
         } else {
             userInfo = getUserInfo(vo.getUserId());
@@ -307,6 +307,8 @@
         //鏌ヨ鍒板綋鍓嶇殑淇℃伅 濡傛灉鐧诲綍淇℃伅涓�妯′竴鏍�,涓嶄細鏇存柊
         if (checkResult.getId() != null) {
             BeanUtils.copyProperties(checkResult, result);//checkResult鎷疯礉鍒皉esult
+            result.setDt(new Date());
+            assemblyWorkLastDao.updateByPrimaryKeySelective(result);
         }else{
             //閫愪釜灏佽淇濆瓨
             BeanUtils.copyProperties(vo, result);//vo鎷疯礉鍒皉esult
@@ -385,7 +387,7 @@
         }
         BaUser userInfo = getUserInfo(assistant);
         //褰撳墠鐧诲綍浜轰笉鑳芥槸杈呭姪浜哄憳
-        if (workLast.getUserId() == userInfo.getId()) {
+        if (workLast.getUserId().intValue() == userInfo.getId().intValue()) {
             throw new RuntimeException(userInfo.getName() + "鏄綋鍓嶇櫥褰曚汉鍛�,涓嶅繀娣诲姞涓鸿緟鍔╀汉鍛�.");
         }
         String userId = userInfo.getId().toString();
@@ -412,7 +414,7 @@
         if (workLast == null) {
             throw new RuntimeException("绯荤粺涓病鏈夊綋鍓嶇櫥褰曚俊鎭�,璇锋鏌ユ垨閲嶆柊鐧诲綍");
         }
-        if ((!StringUtils.isBlank(assistant)) && assistant.startsWith(USER_PREFIX)) {
+        if ((!StringUtils.isBlank(assistant)) && assistant.startsWith(QrCodeConstant.TypeWorker)) {
             assistant = assistant.substring(3);
         }
         if (!StringUtils.isBlank(workLast.getAssistants())) {

--
Gitblit v1.8.0