浏览代码

测试线代码更新

baishaojie 1 年之前
父节点
当前提交
9bc6e0dce9
共有 75 个文件被更改,包括 4126 次插入326 次删除
  1. 332 0
      smart-admin-api/sa-admin/hs_err_pid48624.log
  2. 2461 0
      smart-admin-api/sa-admin/replay_pid48624.log
  3. 4 3
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/common/PostRequestUtil.java
  4. 72 22
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/audit/controller/AuditController.java
  5. 9 2
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/audit/dao/AuditDao.java
  6. 2 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/audit/domain/vo/AuditVo.java
  7. 15 4
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/audit/service/AuditService.java
  8. 3 2
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/controller/CommonController.java
  9. 19 3
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/controller/MovementController.java
  10. 7 2
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/dao/CommonDao.java
  11. 237 44
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/service/CommonService.java
  12. 6 2
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/service/MovementService.java
  13. 6 2
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/controller/EquipmentController.java
  14. 11 4
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/controller/EquipmentSapController.java
  15. 1 1
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/dao/EquipmentDao.java
  16. 2 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/domain/from/EquipmentQueryFrom.java
  17. 1 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/domain/from/EquipmentTplnrFrom.java
  18. 64 60
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/inspection/controller/InspectionController.java
  19. 8 2
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/inspection/dao/InspectionDao.java
  20. 1 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/inspection/domain/vo/BigInspectionVo.java
  21. 8 4
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/inspection/service/InspectionService.java
  22. 35 21
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/maintain/controller/MaintainQueryController.java
  23. 3 3
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/maintain/controller/RecordController.java
  24. 3 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/maintain/domain/vo/MaintainDetailsVo.java
  25. 1 1
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/malfunction/controller/MalfunctionController.java
  26. 2 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/partapply/dao/PartapplyDao.java
  27. 3 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/partapply/domain/vo/PartapplyVo.java
  28. 9 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/partapply/service/PartapplyService.java
  29. 18 12
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/parts/controller/PartsController.java
  30. 13 6
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/repair/controller/RepairController.java
  31. 14 6
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/takestock/controller/TakestockController.java
  32. 0 1
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/takestock/domain/vo/TakeStockVo.java
  33. 26 4
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/controller/EmployeeController.java
  34. 6 2
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/dao/EmployeeDao.java
  35. 10 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/editEmployeePastureFrom.java
  36. 3 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/vo/EmployeeVO.java
  37. 20 9
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java
  38. 2 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/controller/LoginController.java
  39. 1 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginEmployeeDetail.java
  40. 37 4
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java
  41. 199 8
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/controller/MenuController.java
  42. 14 3
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleController.java
  43. 4 2
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleEmployeeController.java
  44. 2 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDao.java
  45. 3 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleEmployeeDao.java
  46. 1 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEntity.java
  47. 1 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleMenuEntity.java
  48. 10 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/updateRoleDataRoleFrom.java
  49. 10 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/EquipmentEmpRoleVo.java
  50. 1 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleVO.java
  51. 4 1
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java
  52. 9 6
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleMenuService.java
  53. 12 0
      smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleService.java
  54. 34 13
      smart-admin-api/sa-admin/src/main/resources/dev/application.yaml
  55. 18 8
      smart-admin-api/sa-admin/src/main/resources/mapper/gm/audit/AuditMapper.xml
  56. 18 3
      smart-admin-api/sa-admin/src/main/resources/mapper/gm/common/CommonMapper.xml
  57. 6 6
      smart-admin-api/sa-admin/src/main/resources/mapper/gm/equipment/EquipmentMapper.xml
  58. 19 6
      smart-admin-api/sa-admin/src/main/resources/mapper/gm/inspection/inspectionMapper.xml
  59. 11 2
      smart-admin-api/sa-admin/src/main/resources/mapper/gm/partapply/partapply.xml
  60. 48 7
      smart-admin-api/sa-admin/src/main/resources/mapper/gm/repair/RepairMapper.xml
  61. 4 4
      smart-admin-api/sa-admin/src/main/resources/mapper/gm/takestock/TakeStockMapper.xml
  62. 14 7
      smart-admin-api/sa-admin/src/main/resources/mapper/system/employee/EmployeeMapper.xml
  63. 10 0
      smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleEmployeeMapper.xml
  64. 4 0
      smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMapper.xml
  65. 20 0
      smart-admin-api/sa-admin/src/main/resources/pre/application.yaml
  66. 3 6
      smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/interceptor/AbstractInterceptor.java
  67. 0 1
      smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/AbstractSecurityConfig.java
  68. 80 0
      smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/MyRequestWrapper.java
  69. 42 7
      smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityTokenFilter.java
  70. 4 4
      smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/CorsFilterConfig.java
  71. 2 2
      smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DataSourceConfig.java
  72. 2 1
      smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/TokenService.java
  73. 14 1
      smart-admin-api/sa-common/src/main/resources/dev/sa-common.yaml
  74. 14 1
      smart-admin-api/sa-common/src/main/resources/pre/sa-common.yaml
  75. 14 1
      smart-admin-api/sa-common/src/main/resources/test/sa-common.yaml

+ 332 - 0
smart-admin-api/sa-admin/hs_err_pid48624.log

@@ -0,0 +1,332 @@
+#
+# There is insufficient memory for the Java Runtime Environment to continue.
+# Native memory allocation (malloc) failed to allocate 1092416 bytes for Chunk::new
+# Possible reasons:
+#   The system is out of physical RAM or swap space
+#   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
+# Possible solutions:
+#   Reduce memory load on the system
+#   Increase physical memory or swap space
+#   Check if swap backing store is full
+#   Decrease Java heap size (-Xmx/-Xms)
+#   Decrease number of Java threads
+#   Decrease Java thread stack sizes (-Xss)
+#   Set larger code cache with -XX:ReservedCodeCacheSize=
+#   JVM is running with Zero Based Compressed Oops mode in which the Java heap is
+#     placed in the first 32GB address space. The Java Heap base address is the
+#     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress
+#     to set the Java Heap base and to place the Java Heap above 32GB virtual address.
+# This output file may be truncated or incomplete.
+#
+#  Out of Memory Error (allocation.cpp:389), pid=48624, tid=0x00000000000006d4
+#
+# JRE version: OpenJDK Runtime Environment (8.0_372-b07) (build 1.8.0_372-b07)
+# Java VM: OpenJDK 64-Bit Server VM (25.372-b07 mixed mode windows-amd64 compressed oops)
+# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
+#
+
+---------------  T H R E A D  ---------------
+
+Current thread (0x000001a8feb9a800):  JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=1748, stack(0x00000034dc900000,0x00000034dca00000)]
+
+Stack: [0x00000034dc900000,0x00000034dca00000]
+[error occurred during error reporting (printing stack bounds), id 0xc0000005]
+
+Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
+
+
+Current CompileTask:
+C2:   6464 5231       4       com.sun.tools.javac.util.Convert::quote (131 bytes)
+
+
+---------------  P R O C E S S  ---------------
+
+Java Threads: ( => current thread )
+  0x000001a8fec55000 JavaThread "Service Thread" daemon [_thread_blocked, id=48000, stack(0x00000034dcc00000,0x00000034dcd00000)]
+  0x000001a8feba0800 JavaThread "C1 CompilerThread3" daemon [_thread_in_native, id=16360, stack(0x00000034dcb00000,0x00000034dcc00000)]
+  0x000001a8feb9d800 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=45864, stack(0x00000034dca00000,0x00000034dcb00000)]
+=>0x000001a8feb9a800 JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=1748, stack(0x00000034dc900000,0x00000034dca00000)]
+  0x000001a8feb97800 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=41932, stack(0x00000034dc800000,0x00000034dc900000)]
+  0x000001a8feb90800 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=22980, stack(0x00000034dc700000,0x00000034dc800000)]
+  0x000001a8fce19800 JavaThread "Attach Listener" daemon [_thread_blocked, id=46012, stack(0x00000034dc600000,0x00000034dc700000)]
+  0x000001a8fce2e000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=13988, stack(0x00000034dc500000,0x00000034dc600000)]
+  0x000001a8fcd9a000 JavaThread "Finalizer" daemon [_thread_blocked, id=43804, stack(0x00000034dc400000,0x00000034dc500000)]
+  0x000001a8fcd8b000 JavaThread "Reference Handler" daemon [_thread_blocked, id=48452, stack(0x00000034dc300000,0x00000034dc400000)]
+  0x000001a8f121e800 JavaThread "main" [_thread_in_native, id=46824, stack(0x00000034db900000,0x00000034dba00000)]
+
+Other Threads:
+  0x000001a8fcd61000 VMThread [stack: 0x00000034dc200000,0x00000034dc300000] [id=45632]
+  0x000001a8fec59000 WatcherThread [stack: 0x00000034dcd00000,0x00000034dce00000] [id=47460]
+
+VM state:not at safepoint (normal execution)
+
+VM Mutex/Monitor currently owned by a thread: None
+
+heap address: 0x00000006ca000000, size: 3936 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
+Narrow klass base: 0x0000000000000000, Narrow klass shift: 3
+Compressed class space size: 1073741824 Address: 0x00000007c0000000
+
+Heap:
+ PSYoungGen      total 137216K, used 73026K [0x000000076e000000, 0x000000077e800000, 0x00000007c0000000)
+  eden space 126976K, 49% used [0x000000076e000000,0x0000000771d575a8,0x0000000775c00000)
+  from space 10240K, 99% used [0x0000000775c00000,0x00000007765f9348,0x0000000776600000)
+  to   space 27648K, 0% used [0x000000077cd00000,0x000000077cd00000,0x000000077e800000)
+ ParOldGen       total 111104K, used 44018K [0x00000006ca000000, 0x00000006d0c80000, 0x000000076e000000)
+  object space 111104K, 39% used [0x00000006ca000000,0x00000006ccafc908,0x00000006d0c80000)
+ Metaspace       used 23722K, capacity 24312K, committed 24368K, reserved 1071104K
+  class space    used 2668K, capacity 2822K, committed 2864K, reserved 1048576K
+
+Card table byte_map: [0x000001a8f3350000,0x000001a8f3b10000] byte_map_base: 0x000001a8efd00000
+
+Marking Bits: (ParMarkBitMap*) 0x0000000057906850
+ Begin Bits: [0x000001a8f4030000, 0x000001a8f7db0000)
+ End Bits:   [0x000001a8f7db0000, 0x000001a8fbb30000)
+
+Polling page: 0x000001a8f1430000
+
+CodeCache: size=245760Kb used=18464Kb max_used=18464Kb free=227295Kb
+ bounds [0x000001a880000000, 0x000001a881220000, 0x000001a88f000000]
+ total_blobs=5179 nmethods=4782 adapters=310
+ compilation: enabled
+
+Compilation events (10 events):
+Event: 6.454 Thread 0x000001a8feba0800 nmethod 5339 0x000001a881209e10 code [0x000001a881209fc0, 0x000001a88120a660]
+Event: 6.458 Thread 0x000001a8feba0800 5340       3       sun.misc.URLClassPath$3::run (5 bytes)
+Event: 6.458 Thread 0x000001a8feba0800 nmethod 5340 0x000001a881209a50 code [0x000001a881209bc0, 0x000001a881209d70]
+Event: 6.458 Thread 0x000001a8feba0800 5341       3       sun.misc.URLClassPath$3::run (93 bytes)
+Event: 6.458 Thread 0x000001a8feba0800 nmethod 5341 0x000001a88120f290 code [0x000001a88120f460, 0x000001a88120fd60]
+Event: 6.458 Thread 0x000001a8feba0800 5342       3       sun.misc.MetaIndex::forJar (13 bytes)
+Event: 6.459 Thread 0x000001a8feba0800 nmethod 5342 0x000001a88120ed10 code [0x000001a88120ee80, 0x000001a88120f1a0]
+Event: 6.459 Thread 0x000001a8feba0800 5343       3       sun.misc.URLClassPath$JarLoader::getClassPath (86 bytes)
+Event: 6.459 Thread 0x000001a8feb97800 5344   !   4       java.util.zip.InflaterInputStream::read (138 bytes)
+Event: 6.459 Thread 0x000001a8feba0800 nmethod 5343 0x000001a88120db10 code [0x000001a88120dd40, 0x000001a88120e850]
+
+GC Heap History (10 events):
+Event: 3.341 GC heap before
+{Heap before GC invocations=4 (full 0):
+ PSYoungGen      total 73728K, used 73704K [0x000000076e000000, 0x0000000777000000, 0x00000007c0000000)
+  eden space 63488K, 100% used [0x000000076e000000,0x0000000771e00000,0x0000000771e00000)
+  from space 10240K, 99% used [0x0000000771e00000,0x00000007727fa040,0x0000000772800000)
+  to   space 10240K, 0% used [0x0000000776600000,0x0000000776600000,0x0000000777000000)
+ ParOldGen       total 167936K, used 3117K [0x00000006ca000000, 0x00000006d4400000, 0x000000076e000000)
+  object space 167936K, 1% used [0x00000006ca000000,0x00000006ca30b658,0x00000006d4400000)
+ Metaspace       used 16541K, capacity 16974K, committed 17152K, reserved 1064960K
+  class space    used 1929K, capacity 2022K, committed 2048K, reserved 1048576K
+Event: 3.355 GC heap after
+Heap after GC invocations=4 (full 0):
+ PSYoungGen      total 137216K, used 10216K [0x000000076e000000, 0x0000000777000000, 0x00000007c0000000)
+  eden space 126976K, 0% used [0x000000076e000000,0x000000076e000000,0x0000000775c00000)
+  from space 10240K, 99% used [0x0000000776600000,0x0000000776ffa040,0x0000000777000000)
+  to   space 10240K, 0% used [0x0000000775c00000,0x0000000775c00000,0x0000000776600000)
+ ParOldGen       total 167936K, used 7447K [0x00000006ca000000, 0x00000006d4400000, 0x000000076e000000)
+  object space 167936K, 4% used [0x00000006ca000000,0x00000006ca745ec0,0x00000006d4400000)
+ Metaspace       used 16541K, capacity 16974K, committed 17152K, reserved 1064960K
+  class space    used 1929K, capacity 2022K, committed 2048K, reserved 1048576K
+}
+Event: 4.433 GC heap before
+{Heap before GC invocations=5 (full 0):
+ PSYoungGen      total 137216K, used 137192K [0x000000076e000000, 0x0000000777000000, 0x00000007c0000000)
+  eden space 126976K, 100% used [0x000000076e000000,0x0000000775c00000,0x0000000775c00000)
+  from space 10240K, 99% used [0x0000000776600000,0x0000000776ffa040,0x0000000777000000)
+  to   space 10240K, 0% used [0x0000000775c00000,0x0000000775c00000,0x0000000776600000)
+ ParOldGen       total 167936K, used 7447K [0x00000006ca000000, 0x00000006d4400000, 0x000000076e000000)
+  object space 167936K, 4% used [0x00000006ca000000,0x00000006ca745ec0,0x00000006d4400000)
+ Metaspace       used 19015K, capacity 19578K, committed 19840K, reserved 1067008K
+  class space    used 2193K, capacity 2336K, committed 2432K, reserved 1048576K
+Event: 4.447 GC heap after
+Heap after GC invocations=5 (full 0):
+ PSYoungGen      total 137216K, used 10233K [0x000000076e000000, 0x0000000777000000, 0x00000007c0000000)
+  eden space 126976K, 0% used [0x000000076e000000,0x000000076e000000,0x0000000775c00000)
+  from space 10240K, 99% used [0x0000000775c00000,0x00000007765fe4f8,0x0000000776600000)
+  to   space 10240K, 0% used [0x0000000776600000,0x0000000776600000,0x0000000777000000)
+ ParOldGen       total 167936K, used 13930K [0x00000006ca000000, 0x00000006d4400000, 0x000000076e000000)
+  object space 167936K, 8% used [0x00000006ca000000,0x00000006cad9a998,0x00000006d4400000)
+ Metaspace       used 19015K, capacity 19578K, committed 19840K, reserved 1067008K
+  class space    used 2193K, capacity 2336K, committed 2432K, reserved 1048576K
+}
+Event: 4.533 GC heap before
+{Heap before GC invocations=6 (full 0):
+ PSYoungGen      total 137216K, used 18281K [0x000000076e000000, 0x0000000777000000, 0x00000007c0000000)
+  eden space 126976K, 6% used [0x000000076e000000,0x000000076e7dc188,0x0000000775c00000)
+  from space 10240K, 99% used [0x0000000775c00000,0x00000007765fe4f8,0x0000000776600000)
+  to   space 10240K, 0% used [0x0000000776600000,0x0000000776600000,0x0000000777000000)
+ ParOldGen       total 167936K, used 13930K [0x00000006ca000000, 0x00000006d4400000, 0x000000076e000000)
+  object space 167936K, 8% used [0x00000006ca000000,0x00000006cad9a998,0x00000006d4400000)
+ Metaspace       used 20533K, capacity 21114K, committed 21296K, reserved 1069056K
+  class space    used 2429K, capacity 2592K, committed 2608K, reserved 1048576K
+Event: 4.542 GC heap after
+Heap after GC invocations=6 (full 0):
+ PSYoungGen      total 137216K, used 10217K [0x000000076e000000, 0x0000000777000000, 0x00000007c0000000)
+  eden space 126976K, 0% used [0x000000076e000000,0x000000076e000000,0x0000000775c00000)
+  from space 10240K, 99% used [0x0000000776600000,0x0000000776ffa4e8,0x0000000777000000)
+  to   space 10240K, 0% used [0x0000000775c00000,0x0000000775c00000,0x0000000776600000)
+ ParOldGen       total 167936K, used 14578K [0x00000006ca000000, 0x00000006d4400000, 0x000000076e000000)
+  object space 167936K, 8% used [0x00000006ca000000,0x00000006cae3c9b8,0x00000006d4400000)
+ Metaspace       used 20533K, capacity 21114K, committed 21296K, reserved 1069056K
+  class space    used 2429K, capacity 2592K, committed 2608K, reserved 1048576K
+}
+Event: 4.542 GC heap before
+{Heap before GC invocations=7 (full 1):
+ PSYoungGen      total 137216K, used 10217K [0x000000076e000000, 0x0000000777000000, 0x00000007c0000000)
+  eden space 126976K, 0% used [0x000000076e000000,0x000000076e000000,0x0000000775c00000)
+  from space 10240K, 99% used [0x0000000776600000,0x0000000776ffa4e8,0x0000000777000000)
+  to   space 10240K, 0% used [0x0000000775c00000,0x0000000775c00000,0x0000000776600000)
+ ParOldGen       total 167936K, used 14578K [0x00000006ca000000, 0x00000006d4400000, 0x000000076e000000)
+  object space 167936K, 8% used [0x00000006ca000000,0x00000006cae3c9b8,0x00000006d4400000)
+ Metaspace       used 20533K, capacity 21114K, committed 21296K, reserved 1069056K
+  class space    used 2429K, capacity 2592K, committed 2608K, reserved 1048576K
+Event: 4.610 GC heap after
+Heap after GC invocations=7 (full 1):
+ PSYoungGen      total 137216K, used 0K [0x000000076e000000, 0x0000000777000000, 0x00000007c0000000)
+  eden space 126976K, 0% used [0x000000076e000000,0x000000076e000000,0x0000000775c00000)
+  from space 10240K, 0% used [0x0000000776600000,0x0000000776600000,0x0000000777000000)
+  to   space 10240K, 0% used [0x0000000775c00000,0x0000000775c00000,0x0000000776600000)
+ ParOldGen       total 111104K, used 22230K [0x00000006ca000000, 0x00000006d0c80000, 0x000000076e000000)
+  object space 111104K, 20% used [0x00000006ca000000,0x00000006cb5b5aa8,0x00000006d0c80000)
+ Metaspace       used 20533K, capacity 21114K, committed 21296K, reserved 1069056K
+  class space    used 2429K, capacity 2592K, committed 2608K, reserved 1048576K
+}
+Event: 5.913 GC heap before
+{Heap before GC invocations=8 (full 1):
+ PSYoungGen      total 137216K, used 126976K [0x000000076e000000, 0x0000000777000000, 0x00000007c0000000)
+  eden space 126976K, 100% used [0x000000076e000000,0x0000000775c00000,0x0000000775c00000)
+  from space 10240K, 0% used [0x0000000776600000,0x0000000776600000,0x0000000777000000)
+  to   space 10240K, 0% used [0x0000000775c00000,0x0000000775c00000,0x0000000776600000)
+ ParOldGen       total 111104K, used 22230K [0x00000006ca000000, 0x00000006d0c80000, 0x000000076e000000)
+  object space 111104K, 20% used [0x00000006ca000000,0x00000006cb5b5aa8,0x00000006d0c80000)
+ Metaspace       used 22955K, capacity 23546K, committed 23856K, reserved 1071104K
+  class space    used 2624K, capacity 2784K, committed 2864K, reserved 1048576K
+Event: 5.934 GC heap after
+Heap after GC invocations=8 (full 1):
+ PSYoungGen      total 137216K, used 10212K [0x000000076e000000, 0x000000077e800000, 0x00000007c0000000)
+  eden space 126976K, 0% used [0x000000076e000000,0x000000076e000000,0x0000000775c00000)
+  from space 10240K, 99% used [0x0000000775c00000,0x00000007765f9348,0x0000000776600000)
+  to   space 27648K, 0% used [0x000000077cd00000,0x000000077cd00000,0x000000077e800000)
+ ParOldGen       total 111104K, used 44018K [0x00000006ca000000, 0x00000006d0c80000, 0x000000076e000000)
+  object space 111104K, 39% used [0x00000006ca000000,0x00000006ccafc908,0x00000006d0c80000)
+ Metaspace       used 22955K, capacity 23546K, committed 23856K, reserved 1071104K
+  class space    used 2624K, capacity 2784K, committed 2864K, reserved 1048576K
+}
+
+Deoptimization events (10 events):
+Event: 6.322 Thread 0x000001a8f121e800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000001a880a028f8 method=com.sun.tools.javac.comp.Resolve.findType(Lcom/sun/tools/javac/comp/Env;Lcom/sun/tools/javac/util/Name;)Lcom/sun/tools/javac/code/Symbol; @ 441
+Event: 6.324 Thread 0x000001a8f121e800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000001a88073049c method=com.sun.tools.javac.code.Types.capture(Lcom/sun/tools/javac/code/Type;)Lcom/sun/tools/javac/code/Type; @ 83
+Event: 6.332 Thread 0x000001a8f121e800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000001a8806aa020 method=java.lang.AbstractStringBuilder.append(Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder; @ 18
+Event: 6.334 Thread 0x000001a8f121e800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000001a8806aa020 method=java.lang.AbstractStringBuilder.append(Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder; @ 18
+Event: 6.334 Thread 0x000001a8f121e800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000001a8806aa020 method=java.lang.AbstractStringBuilder.append(Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder; @ 18
+Event: 6.334 Thread 0x000001a8f121e800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x000001a8806aa020 method=java.lang.AbstractStringBuilder.append(Ljava/lang/CharSequence;II)Ljava/lang/AbstractStringBuilder; @ 18
+Event: 6.413 Thread 0x000001a8f121e800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x000001a880486190 method=java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; @ 38
+Event: 6.415 Thread 0x000001a8f121e800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x000001a880486190 method=java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; @ 38
+Event: 6.415 Thread 0x000001a8f121e800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x000001a880486190 method=java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; @ 38
+Event: 6.415 Thread 0x000001a8f121e800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x000001a880486190 method=java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; @ 38
+
+Classes redefined (0 events):
+No events
+
+Internal exceptions (10 events):
+Event: 2.392 Thread 0x000001a8f121e800 Implicit null exception at 0x000001a88064e00a to 0x000001a88064f38d
+Event: 2.623 Thread 0x000001a8f121e800 Implicit null exception at 0x000001a8803e7b95 to 0x000001a8803e7d9d
+Event: 2.623 Thread 0x000001a8f121e800 Implicit null exception at 0x000001a88036afaf to 0x000001a88036b019
+Event: 2.657 Thread 0x000001a8f121e800 Implicit null exception at 0x000001a8807b0943 to 0x000001a8807b0b8d
+Event: 2.830 Thread 0x000001a8f121e800 Implicit null exception at 0x000001a88088f40d to 0x000001a880890955
+Event: 3.883 Thread 0x000001a8f121e800 Implicit null exception at 0x000001a880821717 to 0x000001a880821b49
+Event: 3.884 Thread 0x000001a8f121e800 Implicit null exception at 0x000001a880a8d0e9 to 0x000001a880a8d8b9
+Event: 4.381 Thread 0x000001a8f121e800 Exception <a 'java/lang/ClassNotFoundException': com/sun/tools/javac/api/JavacTool> (0x00000007758875d8) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 217]
+Event: 5.191 Thread 0x000001a8f121e800 Exception <a 'java/io/FileNotFoundException'> (0x000000077076b738) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\hotspot\src\share\vm\prims\jni.cpp, line 709]
+Event: 5.194 Thread 0x000001a8f121e800 Exception <a 'java/io/FileNotFoundException'> (0x00000007707c90a8) thrown at [C:\wsjdk\Corretto8Src\installers\windows\zip\corretto-build\buildRoot\hotspot\src\share\vm\prims\jni.cpp, line 709]
+
+Events (10 events):
+Event: 6.435 loading class java/util/WeakHashMap$EntrySet
+Event: 6.435 loading class java/util/WeakHashMap$EntrySet done
+Event: 6.435 loading class java/util/WeakHashMap$EntryIterator
+Event: 6.435 loading class java/util/WeakHashMap$HashIterator
+Event: 6.435 loading class java/util/WeakHashMap$HashIterator done
+Event: 6.435 loading class java/util/WeakHashMap$EntryIterator done
+Event: 6.435 loading class java/util/jar/JarFile$JarEntryIterator
+Event: 6.436 loading class java/util/jar/JarFile$JarEntryIterator done
+Event: 6.436 loading class java/util/zip/ZipFile$ZipEntryIterator
+Event: 6.436 loading class java/util/zip/ZipFile$ZipEntryIterator done
+
+
+Dynamic libraries:
+0x00007ff7231e0000 - 0x00007ff72321a000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\bin\java.exe
+0x00007ffd556d0000 - 0x00007ffd558c8000 	C:\WINDOWS\SYSTEM32\ntdll.dll
+0x00007ffd555d0000 - 0x00007ffd5568f000 	C:\WINDOWS\System32\KERNEL32.DLL
+0x00007ffd53390000 - 0x00007ffd53686000 	C:\WINDOWS\System32\KERNELBASE.dll
+0x00007ffd55420000 - 0x00007ffd554cf000 	C:\WINDOWS\System32\ADVAPI32.dll
+0x00007ffd552e0000 - 0x00007ffd5537e000 	C:\WINDOWS\System32\msvcrt.dll
+0x00007ffd54200000 - 0x00007ffd5429c000 	C:\WINDOWS\System32\sechost.dll
+0x00007ffd55100000 - 0x00007ffd55226000 	C:\WINDOWS\System32\RPCRT4.dll
+0x00007ffd54920000 - 0x00007ffd54abd000 	C:\WINDOWS\System32\USER32.dll
+0x00007ffd52e40000 - 0x00007ffd52e62000 	C:\WINDOWS\System32\win32u.dll
+0x00007ffd55390000 - 0x00007ffd553bc000 	C:\WINDOWS\System32\GDI32.dll
+0x00007ffd531d0000 - 0x00007ffd532e5000 	C:\WINDOWS\System32\gdi32full.dll
+0x00007ffd532f0000 - 0x00007ffd5338d000 	C:\WINDOWS\System32\msvcp_win.dll
+0x00007ffd52ec0000 - 0x00007ffd52fc0000 	C:\WINDOWS\System32\ucrtbase.dll
+0x00007ffd3f580000 - 0x00007ffd3f81a000 	C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll
+0x00007ffd541b0000 - 0x00007ffd541e0000 	C:\WINDOWS\System32\IMM32.DLL
+0x00007ffd21570000 - 0x00007ffd2165f000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\jre\bin\msvcr120.dll
+0x00007ffd24f90000 - 0x00007ffd25036000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\jre\bin\msvcp120.dll
+0x0000000057110000 - 0x0000000057985000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\jre\bin\server\jvm.dll
+0x00007ffd55380000 - 0x00007ffd55388000 	C:\WINDOWS\System32\PSAPI.DLL
+0x00007ffd4c250000 - 0x00007ffd4c25a000 	C:\WINDOWS\SYSTEM32\VERSION.dll
+0x00007ffd4c260000 - 0x00007ffd4c287000 	C:\WINDOWS\SYSTEM32\WINMM.dll
+0x00007ffd502b0000 - 0x00007ffd502b9000 	C:\WINDOWS\SYSTEM32\WSOCK32.dll
+0x00007ffd55560000 - 0x00007ffd555cb000 	C:\WINDOWS\System32\WS2_32.dll
+0x00007ffd2ac10000 - 0x00007ffd2ac1f000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\jre\bin\verify.dll
+0x00007ffd2a570000 - 0x00007ffd2a599000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\jre\bin\java.dll
+0x00007ffd2e040000 - 0x00007ffd2e06a000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\jre\bin\instrument.dll
+0x00007ffd2a550000 - 0x00007ffd2a566000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\jre\bin\zip.dll
+0x00007ffd53a60000 - 0x00007ffd541a4000 	C:\WINDOWS\System32\SHELL32.dll
+0x00007ffd50e20000 - 0x00007ffd515b3000 	C:\WINDOWS\SYSTEM32\windows.storage.dll
+0x00007ffd54d20000 - 0x00007ffd55074000 	C:\WINDOWS\System32\combase.dll
+0x00007ffd527f0000 - 0x00007ffd5281e000 	C:\WINDOWS\SYSTEM32\Wldp.dll
+0x00007ffd53790000 - 0x00007ffd5383d000 	C:\WINDOWS\System32\SHCORE.dll
+0x00007ffd53730000 - 0x00007ffd53785000 	C:\WINDOWS\System32\shlwapi.dll
+0x00007ffd52ce0000 - 0x00007ffd52d05000 	C:\WINDOWS\SYSTEM32\profapi.dll
+0x00007ffd27c30000 - 0x00007ffd27c4a000 	D:\Program Files\JetBrains\IntelliJ IDEA 2023.1.3\bin\breakgen64.dll
+0x00007ffd2a530000 - 0x00007ffd2a54a000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\jre\bin\net.dll
+0x00007ffd524e0000 - 0x00007ffd5254a000 	C:\WINDOWS\system32\mswsock.dll
+0x00007ffd526d0000 - 0x00007ffd526e8000 	C:\WINDOWS\SYSTEM32\CRYPTSP.dll
+0x00007ffd51d90000 - 0x00007ffd51dc4000 	C:\WINDOWS\system32\rsaenh.dll
+0x00007ffd53700000 - 0x00007ffd53727000 	C:\WINDOWS\System32\bcrypt.dll
+0x00007ffd52c60000 - 0x00007ffd52c8e000 	C:\WINDOWS\SYSTEM32\USERENV.dll
+0x00007ffd52db0000 - 0x00007ffd52e32000 	C:\WINDOWS\System32\bcryptprimitives.dll
+0x00007ffd526f0000 - 0x00007ffd526fc000 	C:\WINDOWS\SYSTEM32\CRYPTBASE.dll
+0x00007ffd521d0000 - 0x00007ffd5220b000 	C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL
+0x00007ffd54d10000 - 0x00007ffd54d18000 	C:\WINDOWS\System32\NSI.dll
+0x00007ffd4c780000 - 0x00007ffd4c797000 	C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL
+0x00007ffd4c6b0000 - 0x00007ffd4c6cd000 	C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL
+0x00007ffd52210000 - 0x00007ffd522da000 	C:\WINDOWS\SYSTEM32\DNSAPI.dll
+0x00007ffd20940000 - 0x00007ffd20952000 	D:\Users\zsyy\.jdks\corretto-1.8.0_372\jre\bin\nio.dll
+0x00007ffd48940000 - 0x00007ffd4894a000 	C:\Users\zsyy\AppData\Local\Temp\jansi-1.17.1-3847011498804030511.dll
+
+VM Arguments:
+jvm_args: -Dmaven.multiModuleProjectDirectory=D:\java_project\smart-admin\smart-admin-api\sa-admin -Djansi.passthrough=true -DarchetypeCatalog=internal -Dmaven.home=D:\service\apache-maven-3.6.1-bin\apache-maven-3.6.1 -Dclassworlds.conf=D:\service\apache-maven-3.6.1-bin\apache-maven-3.6.1\bin\m2.conf -Dmaven.ext.class.path=D:\Program Files\JetBrains\IntelliJ IDEA 2023.1.3\plugins\maven\lib\maven-event-listener.jar -javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2023.1.3\lib\idea_rt.jar=54240:D:\Program Files\JetBrains\IntelliJ IDEA 2023.1.3\bin -Dfile.encoding=UTF-8 
+java_command: org.codehaus.classworlds.Launcher -Didea.version=2023.1.3 -s D:\service\apache-maven-3.6.1-bin\apache-maven-3.6.1\conf\settings.xml -Dmaven.repo.local=D:\service\maven_repository package
+java_class_path (initial): D:\service\apache-maven-3.6.1-bin\apache-maven-3.6.1\boot\plexus-classworlds-2.6.0.jar;D:\Program Files\JetBrains\IntelliJ IDEA 2023.1.3\lib\idea_rt.jar
+Launcher Type: SUN_STANDARD
+
+Environment Variables:
+JAVA_HOME=D:\Users\zsyy\.jdks\corretto-1.8.0_372
+PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Go\bin;D:\Program Files\Git\cmd;C:\Program Files\TortoiseSVN\bin;C:\Program Files\TortoiseGit\bin;D:\profile\FlameGraph;C:\Program Files (x86)\xshell\;C:\Program Files (x86)\Tencent\微信web开发者工具\dll;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;D:\datasync\demo;D:\Program Files\PuTTY\;D:\Program Files\PuTTY\putty.exe;C:\Users\zsyy\Desktop\fprc\frpc.bat;C:\Program Files\Docker\Docker\resources\bin;D:\service\apache-maven-3.6.1-bin\apache-maven-3.6.1\bin;D:\Users\zsyy\.jdks\corretto-1.8.0_372\bin;C:\Program Files\Bandizip\;C:\Program Files (x86)\GnuWin32\bin;C:\Users\zsyy\AppData\Local\Microsoft\WindowsApps;C:\Users\zsyy\go\bin;D:\program files (x86)\Graphviz\bin;D:\profile\FlameGraph;D:\gosrc\bin;D:\1\mingw64\bin;D:\Program Files\Microsoft VS Code\bin;D:\Program Files\GoLand 2022.2.2\bin;;D:\datasync\demo;D:\Program Files\PuTTY\putty.exe;C:\Users\zsyy\Desktop\fprc\frpc.bat;d:\Program Files\JetBrains\IntelliJ IDEA 2021.1.1\bin;;D:\service\apache-maven-3.6.1-bin\apache-maven-3.6.1\bin;C:\Program Files (x86)\GnuWin32\bin;
+USERNAME=kpt
+OS=Windows_NT
+PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD
+
+
+
+---------------  S Y S T E M  ---------------
+
+OS: Windows 10 , 64 bit Build 19041 (10.0.19041.3155)
+
+CPU:total 8 (initial active 8) (8 cores per cpu, 1 threads per core) family 23 model 96 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, mmxext, 3dnowpref, lzcnt, sse4a, tsc, tscinvbit, tscinv, bmi1
+
+Memory: 4k page, physical 16119096k(1273420k free), swap 35319092k(5364k free)
+
+vm_info: OpenJDK 64-Bit Server VM (25.372-b07) for windows-amd64 JRE (1.8.0_372-b07), built on Apr 17 2023 22:43:30 by "Administrator" with MS VC++ 12.0 (VS2013)
+
+time: Wed Sep 13 10:14:17 2023
+timezone: 中国标准时间
+elapsed time: 6.469658 seconds (0d 0h 0m 6s)
+

文件差异内容过多而无法显示
+ 2461 - 0
smart-admin-api/sa-admin/replay_pid48624.log


+ 4 - 3
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/common/PostRequestUtil.java

@@ -44,8 +44,11 @@ public class PostRequestUtil {
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         connection.setRequestMethod("POST");
         connection.setRequestMethod("POST");
         connection.setRequestProperty("Content-Type", contentType);
         connection.setRequestProperty("Content-Type", contentType);
+//測試線
+        String encoding = DatatypeConverter.printBase64Binary("gmmy_pmapp:Gmmyapp0930".getBytes("UTF-8"));  //username  password 自行修改  中间":"不可少
+//        正式線
+//        String encoding = DatatypeConverter.printBase64Binary("gmmy_pmapp:Myapp0914".getBytes("UTF-8"));  //username  password 自行修改  中间":"不可少
 
 
-        String encoding = DatatypeConverter.printBase64Binary("gmmy_pmapp:1234qwer".getBytes("UTF-8"));  //username  password 自行修改  中间":"不可少
         connection.setRequestProperty("Authorization", "Basic " + encoding);
         connection.setRequestProperty("Authorization", "Basic " + encoding);
 //        connection.
 //        connection.
 
 
@@ -120,8 +123,6 @@ public class PostRequestUtil {
 //    }
 //    }
 
 
 
 
-
-
 //    @Autowired
 //    @Autowired
 //    private RepairService repairService;
 //    private RepairService repairService;
 //    public boolean MaintainSapSync(String res) throws Exception {
 //    public boolean MaintainSapSync(String res) throws Exception {

+ 72 - 22
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/audit/controller/AuditController.java

@@ -14,10 +14,13 @@ import net.lab1024.sa.admin.module.gm.audit.service.AuditService;
 import net.lab1024.sa.admin.module.gm.common.service.CommonService;
 import net.lab1024.sa.admin.module.gm.common.service.CommonService;
 import net.lab1024.sa.admin.module.gm.eq.domain.from.EquipmentQueryFrom;
 import net.lab1024.sa.admin.module.gm.eq.domain.from.EquipmentQueryFrom;
 import net.lab1024.sa.admin.module.gm.eq.domain.vo.EquipmentBindDetailsVo;
 import net.lab1024.sa.admin.module.gm.eq.domain.vo.EquipmentBindDetailsVo;
+import net.lab1024.sa.admin.module.gm.inspection.service.InspectionService;
 import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainDetailsVo;
 import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainDetailsVo;
 import net.lab1024.sa.admin.module.gm.partapply.domain.vo.BigPartapplyVo;
 import net.lab1024.sa.admin.module.gm.partapply.domain.vo.BigPartapplyVo;
 import net.lab1024.sa.admin.module.gm.partapply.service.PartapplyService;
 import net.lab1024.sa.admin.module.gm.partapply.service.PartapplyService;
 import net.lab1024.sa.admin.module.gm.repair.service.RepairService;
 import net.lab1024.sa.admin.module.gm.repair.service.RepairService;
+import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO;
+import net.lab1024.sa.admin.module.system.employee.service.EmployeeService;
 import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO;
 import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuVO;
 import net.lab1024.sa.admin.module.system.menu.service.MenuService;
 import net.lab1024.sa.admin.module.system.menu.service.MenuService;
 import net.lab1024.sa.common.common.annoation.NoNeedLogin;
 import net.lab1024.sa.common.common.annoation.NoNeedLogin;
@@ -44,14 +47,26 @@ public class AuditController {
     private CommonService commonService;
     private CommonService commonService;
     @Autowired
     @Autowired
     private PartapplyService partapplyService;
     private PartapplyService partapplyService;
-
+    @Autowired
+    private InspectionService inspectionService;
     @Autowired
     @Autowired
     private MenuService menuService;
     private MenuService menuService;
 
 
     @GetMapping("/audit/list")
     @GetMapping("/audit/list")
     //@NoNeedLogin
     //@NoNeedLogin
     @ApiOperation("审核列表")
     @ApiOperation("审核列表")
-    public ResponseDTO<List<AuditVo>> GetAuditList(@RequestParam int pageNum, @RequestParam int pageSize, @RequestParam int pastureId, @RequestParam(required = false, defaultValue = "") String eqCodeOrName, @RequestParam(required = false, defaultValue = "") String status, @RequestParam(required = false, defaultValue = "") String auditType, @RequestParam(required = false, defaultValue = "") String pick, @RequestParam(required = false, defaultValue = "") String code, @RequestParam(required = false, defaultValue = "") String sapCode, @RequestParam(required = false, defaultValue = "") String startDate, @RequestParam(required = false, defaultValue = "") String endDate, @RequestParam(required = false, defaultValue = "") String empId) {
+    public ResponseDTO<List<AuditVo>> GetAuditList(@RequestParam int pageNum, @RequestParam int pageSize,
+                                                   @RequestParam int pastureId,
+                                                   @RequestParam(required = false, defaultValue = "") String eqCodeOrName,
+                                                   @RequestParam(required = false, defaultValue = "") String status,
+                                                   @RequestParam(required = false, defaultValue = "") String auditType,
+                                                   @RequestParam(required = false, defaultValue = "") String pick,
+                                                   @RequestParam(required = false, defaultValue = "") String code,
+                                                   @RequestParam(required = false, defaultValue = "") String sapCode,
+                                                   @RequestParam(required = false, defaultValue = "") String startDate,
+                                                   @RequestParam(required = false, defaultValue = "") String endDate,
+                                                   @RequestParam(required = false, defaultValue = "") String empId,
+                                                   @RequestParam(required = false, defaultValue = "") String roleName) {
 
 
         if (auditType.equals("-1")) {
         if (auditType.equals("-1")) {
             auditType = "";
             auditType = "";
@@ -64,24 +79,45 @@ public class AuditController {
                 auditTypeList.add("1");
                 auditTypeList.add("1");
             } else if (menuVO.getMenuId() == 224) {
             } else if (menuVO.getMenuId() == 224) {
                 auditTypeList.add("3");
                 auditTypeList.add("3");
-            } else if (menuVO.getMenuId() == 222) {
-                auditTypeList.add("0");
             } else {
             } else {
-                auditTypeList.add("-1");
+                auditTypeList.add("0");
             }
             }
         }
         }
-        System.out.println(auditType);
 
 
         String authAuditType = String.join(",", auditTypeList);
         String authAuditType = String.join(",", auditTypeList);
-        System.out.println(authAuditType);
         EquipmentQueryFrom page = new EquipmentQueryFrom();
         EquipmentQueryFrom page = new EquipmentQueryFrom();
         page.setPageNum(pageNum);
         page.setPageNum(pageNum);
         page.setPageSize(pageSize);
         page.setPageSize(pageSize);
         Page pageParam = SmartPageUtil.convert2PageQuery(page);
         Page pageParam = SmartPageUtil.convert2PageQuery(page);
         List<AuditVo> auditList = auditService.GetAuditList(pageParam, "", "", "2", status, eqCodeOrName,
         List<AuditVo> auditList = auditService.GetAuditList(pageParam, "", "", "2", status, eqCodeOrName,
-                auditType, pastureId, pick, code, sapCode, startDate, endDate, authAuditType,"");
+                auditType, pastureId, pick, code, sapCode, startDate, endDate, authAuditType, "", empId,"");
         int count = auditService.GetAuditListCount("", "", "2", status, eqCodeOrName, auditType, pastureId,
         int count = auditService.GetAuditListCount("", "", "2", status, eqCodeOrName, auditType, pastureId,
-                pick, code, sapCode, startDate, endDate, authAuditType,"");
+                pick, code, sapCode, startDate, endDate, authAuditType, "", empId,"");
+
+
+        String[] roleNameList = roleName.split(",");
+
+        for (AuditVo auditVo : auditList) {
+            if (auditVo.getAuditType().equals(1)) {
+                auditVo.setEmpStatus(1);
+                double sumPrice = Double.parseDouble(auditVo.getSumPrice());
+                for (String s : roleNameList) {
+                    if (auditVo.getFlowCompeleted().equals(0) && s.equals("设备主管")) {
+                        auditVo.setEmpStatus(0);
+                        break;
+                    } else if (auditVo.getFlowCompeleted().equals(1) && s.equals("分管负责人") && sumPrice >= 1000.0) {
+                        auditVo.setEmpStatus(0);
+                        break;
+                    } else if (auditVo.getFlowCompeleted().equals(3) && s.equals("场长") && sumPrice >= 2000) {
+                        auditVo.setEmpStatus(0);
+                        break;
+                    }
+                }
+            } else {
+                auditVo.setEmpStatus(0);
+            }
+        }
+
         ResponseDTO t = ResponseDTO.ok(auditList);
         ResponseDTO t = ResponseDTO.ok(auditList);
         t.setCount(count);
         t.setCount(count);
         t.setCode(200);
         t.setCode(200);
@@ -123,7 +159,8 @@ public class AuditController {
             if (!from.getStatus().equals(0)) {
             if (!from.getStatus().equals(0)) {
                 if (from.getAuditType().equals(0)) {
                 if (from.getAuditType().equals(0)) {
                     MaintainDetailsVo wxRepair = repairService.GetRepairDetails(from.getCode(), "");
                     MaintainDetailsVo wxRepair = repairService.GetRepairDetails(from.getCode(), "");
-                    EquipmentAddResponse res = commonService.editSapBXPush(from.getCode(), wxRepair.getOutsource(), wxRepair.getIsOutsource(), wxRepair.getPrice_unit(), statusStr);
+
+                    EquipmentAddResponse res = commonService.editSapBXPush(from.getCode(), wxRepair.getOutsource(), wxRepair.getIsOutsource(), wxRepair.getPrice_unit(), statusStr, "");
                     if (res != null) {
                     if (res != null) {
                         ResponseDTO<Boolean> t;
                         ResponseDTO<Boolean> t;
                         t = ResponseDTO.ok(false);
                         t = ResponseDTO.ok(false);
@@ -146,17 +183,30 @@ public class AuditController {
                     status = auditService.editAuditFlowCompeleted(from);
                     status = auditService.editAuditFlowCompeleted(from);
 //                    statusStr = "P10";
 //                    statusStr = "P10";
                     BigPartapplyVo bigpartapply = partapplyService.getBigPartapply(from.getCode());
                     BigPartapplyVo bigpartapply = partapplyService.getBigPartapply(from.getCode());
-                    MaintainDetailsVo wxRepair = repairService.GetRepairDetails(bigpartapply.getRuCode(), "");
-                    System.out.println();
-                    EquipmentAddResponse res = commonService.editSapBXPush(bigpartapply.getRuCode(), wxRepair.getOutsource(), wxRepair.getIsOutsource(), wxRepair.getPrice_unit(), "");
-                    if (res != null) {
-                        from.setStatus(0);
-                        status = auditService.editAuditFlowCompeleted(from);
-                        ResponseDTO<Boolean> t;
-                        t = ResponseDTO.ok(false);
-                        t.setCode(500);
-                        t.setMsg(res.getMsg());
-                        return t;
+
+                    int count = inspectionService.getBigInspectionCount(bigpartapply.getRuCode());
+                    if (count == 0) {
+                        MaintainDetailsVo wxRepair = repairService.GetRepairDetails(bigpartapply.getRuCode(), "");
+                        EquipmentAddResponse res = commonService.editSapBXPush(bigpartapply.getRuCode(), wxRepair.getOutsource(), wxRepair.getIsOutsource(), wxRepair.getPrice_unit(), "", "");
+                        if (res != null) {
+                            from.setStatus(0);
+                            status = auditService.editAuditFlowCompeleted(from);
+                            ResponseDTO<Boolean> t;
+                            t = ResponseDTO.ok(false);
+                            t.setCode(500);
+                            t.setMsg(res.getMsg());
+                            return t;
+                        }
+                    } else {
+                        AuditVo whInfo = auditService.getAudit(bigpartapply.getRuCode());
+                        EquipmentAddResponse res = commonService.editSapBYPush(bigpartapply.getRuCode(), whInfo.getSapCode(), "");
+                        if (res != null) {
+                            ResponseDTO<Boolean> t;
+                            t = ResponseDTO.ok(false);
+                            t.setCode(500);
+                            t.setMsg(res.getMsg());
+                            return t;
+                        }
                     }
                     }
                 } else if (from.getAuditType().equals(2)) {
                 } else if (from.getAuditType().equals(2)) {
                     EquipmentAddResponse res = commonService.editSapBYPush(from.getCode(), auditInfo.getSapCode(), statusStr);
                     EquipmentAddResponse res = commonService.editSapBYPush(from.getCode(), auditInfo.getSapCode(), statusStr);
@@ -281,7 +331,7 @@ public class AuditController {
     public ResponseDTO<Boolean> editAuditCancel(@RequestBody editAuditCancelFrom from) throws Exception {
     public ResponseDTO<Boolean> editAuditCancel(@RequestBody editAuditCancelFrom from) throws Exception {
         if (from.getAuditType().equals(0)) {
         if (from.getAuditType().equals(0)) {
             MaintainDetailsVo wxRepair = repairService.GetRepairDetails(from.getCode(), "");
             MaintainDetailsVo wxRepair = repairService.GetRepairDetails(from.getCode(), "");
-            EquipmentAddResponse res = commonService.editSapBXPush(from.getCode(), wxRepair.getOutsource(), wxRepair.getIsOutsource(), wxRepair.getPrice_unit(), "P31");
+            EquipmentAddResponse res = commonService.editSapBXPush(from.getCode(), wxRepair.getOutsource(), wxRepair.getIsOutsource(), wxRepair.getPrice_unit(), "P31", "");
             if (res != null) {
             if (res != null) {
                 ResponseDTO<Boolean> t;
                 ResponseDTO<Boolean> t;
                 t = ResponseDTO.ok(false);
                 t = ResponseDTO.ok(false);

+ 9 - 2
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/audit/dao/AuditDao.java

@@ -24,7 +24,9 @@ public interface AuditDao {
                                @Param("pick") String pick,
                                @Param("pick") String pick,
                                @Param("code") String code,
                                @Param("code") String code,
                                @Param("sapCode") String sapCode,@Param("startDate")String startDate,@Param("endDate")String endDate,
                                @Param("sapCode") String sapCode,@Param("startDate")String startDate,@Param("endDate")String endDate,
-                               @Param("authAuditType")String  authAuditType,@Param("priok")String  priok);
+                               @Param("authAuditType")String  authAuditType,@Param("priok")String  priok,
+                               @Param("empId") String  empId,
+                               @Param("roleId") String  roleId);
 
 
     int getAuditListCount(@Param("personnel") String personnel, @Param("createUserId") String createUserId,
     int getAuditListCount(@Param("personnel") String personnel, @Param("createUserId") String createUserId,
                           @Param("processed") String processed, @Param("status") String status,
                           @Param("processed") String processed, @Param("status") String status,
@@ -32,10 +34,15 @@ public interface AuditDao {
                           @Param("fromPastureId") int pastureId, @Param("pick") String pick,
                           @Param("fromPastureId") int pastureId, @Param("pick") String pick,
                           @Param("code") String code,
                           @Param("code") String code,
                           @Param("sapCode") String sapCode,@Param("startDate")String startDate,@Param("endDate")String endDate,
                           @Param("sapCode") String sapCode,@Param("startDate")String startDate,@Param("endDate")String endDate,
-                          @Param("authAuditType")String authAuditType,@Param("priok")String  priok);
+                          @Param("authAuditType")String authAuditType,@Param("priok")String  priok,
+                          @Param("empId") String  empId,
+                          @Param("roleId") String  roleId);
 
 
     void editAuditPersonnel(@Param("audit") EditAuditFrom audit);
     void editAuditPersonnel(@Param("audit") EditAuditFrom audit);
 
 
+
+    void editAuditDate(@Param("code") String  code );
+
     String getAuditSapCode(@Param("code") String code);
     String getAuditSapCode(@Param("code") String code);
 
 
 
 

+ 2 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/audit/domain/vo/AuditVo.java

@@ -57,4 +57,6 @@ public class AuditVo {
     private String completionTime;
     private String completionTime;
     private String sumPrice;
     private String sumPrice;
     private String appgs;
     private String appgs;
+    // 0 还有需要审核 1 没有
+    private int empStatus;
 }
 }

+ 15 - 4
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/audit/service/AuditService.java

@@ -36,12 +36,12 @@ public class AuditService {
 
 
     public List<AuditVo> GetAuditList(Page page, String personnel, String createUserId, String processed, String status,
     public List<AuditVo> GetAuditList(Page page, String personnel, String createUserId, String processed, String status,
                                       String eqCodeOrName, String auditType, int pastureId, String pick, String code,
                                       String eqCodeOrName, String auditType, int pastureId, String pick, String code,
-                                      String sapCode,String startDate,String endDate,String authAuditType,String priok) {
+                                      String sapCode,String startDate,String endDate,String authAuditType,String priok,String empId,String roleId) {
 
 
         List<AuditVo> auditList = new ArrayList<>();
         List<AuditVo> auditList = new ArrayList<>();
 //        try {
 //        try {
             auditList = audittDao.getAuditList(page, personnel, createUserId, processed, status, eqCodeOrName,
             auditList = audittDao.getAuditList(page, personnel, createUserId, processed, status, eqCodeOrName,
-                    auditType, pastureId, pick, code, sapCode,startDate,endDate,authAuditType,priok);
+                    auditType, pastureId, pick, code, sapCode,startDate,endDate,authAuditType,priok,empId,roleId);
 //        } catch (Exception e) {
 //        } catch (Exception e) {
 //            return auditList;
 //            return auditList;
 //        }
 //        }
@@ -49,12 +49,13 @@ public class AuditService {
     }
     }
 
 
     public int GetAuditListCount(String personnel, String createUserId, String processed, String status, String eqCodeOrName,
     public int GetAuditListCount(String personnel, String createUserId, String processed, String status, String eqCodeOrName,
-                                 String auditType, int pastureId, String pick, String code, String sapCode,String startDate,String endDate,String authAuditType,String priok) {
+                                 String auditType, int pastureId, String pick, String code, String sapCode,String startDate,
+                                 String endDate,String authAuditType,String priok,String empId,String roleId) {
 
 
         int count = 0;
         int count = 0;
         try {
         try {
             count = audittDao.getAuditListCount(personnel, createUserId, processed, status, eqCodeOrName, auditType, pastureId,
             count = audittDao.getAuditListCount(personnel, createUserId, processed, status, eqCodeOrName, auditType, pastureId,
-                    pick, code, sapCode,startDate,endDate,authAuditType,priok);
+                    pick, code, sapCode,startDate,endDate,authAuditType,priok,empId,roleId);
         } catch (Exception e) {
         } catch (Exception e) {
             return count;
             return count;
         }
         }
@@ -71,6 +72,16 @@ public class AuditService {
         return true;
         return true;
     }
     }
 
 
+    public boolean editAuditDate(String code) {
+        try {
+            audittDao.editAuditDate(code);
+        } catch (Exception e) {
+            return false;
+        }
+        return true;
+    }
+
+
 
 
     public String getAuditSapCode(String code) {
     public String getAuditSapCode(String code) {
         return audittDao.getAuditSapCode(code);
         return audittDao.getAuditSapCode(code);

+ 3 - 2
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/controller/CommonController.java

@@ -119,8 +119,9 @@ public class CommonController {
     @GetMapping("/authdata/pasture")
     @GetMapping("/authdata/pasture")
     //@NoNeedLogin
     //@NoNeedLogin
     @ApiOperation("牧场信息")
     @ApiOperation("牧场信息")
-    public ResponseDTO<List<PastureVo>> getPasture() throws Exception {
-        List<PastureVo> pastureList = commonService.getPastureList();
+    public ResponseDTO<List<PastureVo>> getPasture(@RequestParam int pageNum, @RequestParam int pageSize,
+                                                   @RequestParam(required=false,defaultValue = "") String pastureName) throws Exception {
+        List<PastureVo> pastureList = commonService.getPastureList(pastureName);
         ResponseDTO t = ResponseDTO.ok(pastureList);
         ResponseDTO t = ResponseDTO.ok(pastureList);
         t.setCode(200);
         t.setCode(200);
         return t;
         return t;

+ 19 - 3
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/controller/MovementController.java

@@ -25,6 +25,14 @@ public class MovementController {
     //@NoNeedLogin
     //@NoNeedLogin
     @ApiOperation("保养模板新增")
     @ApiOperation("保养模板新增")
     public ResponseDTO addMovement(@RequestBody MovementFrom from) {
     public ResponseDTO addMovement(@RequestBody MovementFrom from) {
+        int count = movementService.getMovementCount(from.getMovement());
+        if (count > 0) {
+            ResponseDTO t = ResponseDTO.ok();
+            t.setCode(500);
+            t.setMsg("该动作已存在!");
+            return t;
+        }
+        from.setPastureId(2);
         boolean success = movementService.addMovement(from);
         boolean success = movementService.addMovement(from);
         if (!success) {
         if (!success) {
             ResponseDTO t = ResponseDTO.ok();
             ResponseDTO t = ResponseDTO.ok();
@@ -43,6 +51,14 @@ public class MovementController {
     //@NoNeedLogin
     //@NoNeedLogin
     @ApiOperation("保养模板修改")
     @ApiOperation("保养模板修改")
     public ResponseDTO editMovement(@RequestBody MovementFrom from) {
     public ResponseDTO editMovement(@RequestBody MovementFrom from) {
+
+        int count = movementService.getMovementCount(from.getMovement());
+        if (count > 0) {
+            ResponseDTO t = ResponseDTO.ok();
+            t.setCode(500);
+            t.setMsg("该动作已存在!");
+            return t;
+        }
         boolean success = movementService.editMovement(from);
         boolean success = movementService.editMovement(from);
         if (!success) {
         if (!success) {
             ResponseDTO t = ResponseDTO.ok();
             ResponseDTO t = ResponseDTO.ok();
@@ -60,8 +76,8 @@ public class MovementController {
     @GetMapping("/authdata/movement")
     @GetMapping("/authdata/movement")
     //@NoNeedLogin
     //@NoNeedLogin
     @ApiOperation("保养模板查看")
     @ApiOperation("保养模板查看")
-    public ResponseDTO<List<MovementVo>> getMovement(@RequestParam("pastureId") int pastureId,@RequestParam(required=false,defaultValue = "") String  enable) {
-        List<MovementVo> movementList = movementService.getMovement(pastureId,enable);
+    public ResponseDTO<List<MovementVo>> getMovement(@RequestParam(required = false, defaultValue = "") String enable) {
+        List<MovementVo> movementList = movementService.getMovement(enable);
 
 
         ResponseDTO t = ResponseDTO.ok(movementList);
         ResponseDTO t = ResponseDTO.ok(movementList);
         t.setCode(200);
         t.setCode(200);
@@ -74,7 +90,7 @@ public class MovementController {
     @ApiOperation("保养模板删除")
     @ApiOperation("保养模板删除")
     public ResponseDTO delMovement(@RequestBody DelMovementFrom from) {
     public ResponseDTO delMovement(@RequestBody DelMovementFrom from) {
         boolean s = movementService.delMovement(from.getId());
         boolean s = movementService.delMovement(from.getId());
-        if (!s){
+        if (!s) {
             ResponseDTO t = ResponseDTO.ok();
             ResponseDTO t = ResponseDTO.ok();
             t.setCode(500);
             t.setCode(500);
             t.setMsg("删除失败!");
             t.setMsg("删除失败!");

+ 7 - 2
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/dao/CommonDao.java

@@ -29,7 +29,7 @@ public interface CommonDao {
 
 
     PastureVo getPasture(@Param("companycode") String companycode);
     PastureVo getPasture(@Param("companycode") String companycode);
 
 
-    List<PastureVo> getPastureList();
+    List<PastureVo> getPastureList(@Param("pastureName") String  pastureName);
     PastureVo getPastureById(@Param("id") int id);
     PastureVo getPastureById(@Param("id") int id);
     List<AppearanceVo> getAppearance(@Param("bigId") int bigId);
     List<AppearanceVo> getAppearance(@Param("bigId") int bigId);
     List<AppearanceVo> getBigAppearanceList(@Param("plnnr") String plnnr);
     List<AppearanceVo> getBigAppearanceList(@Param("plnnr") String plnnr);
@@ -53,9 +53,14 @@ public interface CommonDao {
     void editMovement(@Param("from") MovementFrom from);
     void editMovement(@Param("from") MovementFrom from);
 
 
 
 
-    List<MovementVo> getMovement(@Param("pastureId") int pastureId,@Param("enable") String  enable);
+    List<MovementVo> getMovement(@Param("enable") String  enable);
 
 
 
 
     void delMovement(@Param("id") String id);
     void delMovement(@Param("id") String id);
 
 
+
+    int getMovementCount(@Param("movement") String movement);
+
+    String getPastureEquipmentZG(@Param("pastureId") String pastureId);
+
 }
 }

+ 237 - 44
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/service/CommonService.java

@@ -5,13 +5,21 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import net.lab1024.sa.admin.common.PostRequestUtil;
 import net.lab1024.sa.admin.common.PostRequestUtil;
+import net.lab1024.sa.admin.module.gm.audit.domain.from.AddAuditFrom;
 import net.lab1024.sa.admin.module.gm.common.dao.CommonDao;
 import net.lab1024.sa.admin.module.gm.common.dao.CommonDao;
+import net.lab1024.sa.admin.module.gm.common.domain.Vo.AppearanceVo;
 import net.lab1024.sa.admin.module.gm.common.domain.Vo.FileVo;
 import net.lab1024.sa.admin.module.gm.common.domain.Vo.FileVo;
 import net.lab1024.sa.admin.module.gm.common.domain.Vo.PartsSapVo;
 import net.lab1024.sa.admin.module.gm.common.domain.Vo.PartsSapVo;
 import net.lab1024.sa.admin.module.gm.common.domain.Vo.PastureVo;
 import net.lab1024.sa.admin.module.gm.common.domain.Vo.PastureVo;
 import net.lab1024.sa.admin.module.gm.eq.dao.EquipmentDao;
 import net.lab1024.sa.admin.module.gm.eq.dao.EquipmentDao;
+import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentInfo;
 import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentTplnrInfo;
 import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentTplnrInfo;
 import net.lab1024.sa.admin.module.gm.eq.domain.from.EquipmentTplnrFrom;
 import net.lab1024.sa.admin.module.gm.eq.domain.from.EquipmentTplnrFrom;
+import net.lab1024.sa.admin.module.gm.eq.service.EquipmentService;
+import net.lab1024.sa.admin.module.gm.inspection.domain.from.BigInspectionFrom;
+import net.lab1024.sa.admin.module.gm.inspection.domain.from.InspectionFrom;
+import net.lab1024.sa.admin.module.gm.inspection.domain.vo.BigInspectionVo;
+import net.lab1024.sa.admin.module.gm.inspection.service.InspectionService;
 import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainDetailsVo;
 import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainDetailsVo;
 import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainQueryVo;
 import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainQueryVo;
 import net.lab1024.sa.admin.module.gm.maintain.domain.vo.OutsourceVo;
 import net.lab1024.sa.admin.module.gm.maintain.domain.vo.OutsourceVo;
@@ -24,6 +32,7 @@ import net.lab1024.sa.admin.module.gm.repair.dao.RepairDao;
 import net.lab1024.sa.admin.module.gm.repair.domain.vo.RepirVo;
 import net.lab1024.sa.admin.module.gm.repair.domain.vo.RepirVo;
 import net.lab1024.sa.admin.module.gm.repair.service.RepairService;
 import net.lab1024.sa.admin.module.gm.repair.service.RepairService;
 import net.lab1024.sa.common.common.domain.EquipmentAddResponse;
 import net.lab1024.sa.common.common.domain.EquipmentAddResponse;
+import net.lab1024.sa.common.common.domain.ResponseDTO;
 import net.lab1024.sa.common.common.util.SmartPageUtil;
 import net.lab1024.sa.common.common.util.SmartPageUtil;
 import org.json.JSONObject;
 import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -48,15 +57,24 @@ public class CommonService {
     private PartapplyService partapplyService;
     private PartapplyService partapplyService;
     @Autowired
     @Autowired
     private MalfunctionService malfunctionService;
     private MalfunctionService malfunctionService;
-
+    @Autowired
+    private InspectionService inspectionService;
+    @Autowired
+    private AppearanceService appearanceService;
+    @Autowired
+    private EquipmentService equipmentService;
 
 
     public String autoCreatCode(String pastureId, String codeType) {
     public String autoCreatCode(String pastureId, String codeType) {
         String code = commonDao.autoCreatCode(pastureId, codeType);
         String code = commonDao.autoCreatCode(pastureId, codeType);
         return code;
         return code;
     }
     }
 
 
+    public String getPastureEquipmentZG(String pastureId) {
+        String code = commonDao.getPastureEquipmentZG(pastureId);
+        return code;
+    }
 
 
-    public EquipmentAddResponse addSapBXPush(String QMNUM,String loginName) throws Exception {
+    public EquipmentAddResponse addSapBXPush(String QMNUM, String loginName) throws Exception {
 
 
         try {
         try {
             Map<String, Object> getReq = new HashMap();
             Map<String, Object> getReq = new HashMap();
@@ -69,7 +87,7 @@ public class CommonService {
             getReq.put("Header", header);
             getReq.put("Header", header);
             JSONObject json = new JSONObject(getReq);
             JSONObject json = new JSONObject(getReq);
             System.out.println(json.toString());
             System.out.println(json.toString());
-            String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/FNS", "application/json", json.toString());
+            String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/FNS", "application/json", json.toString());
             ObjectMapper objectMapper = new ObjectMapper();
             ObjectMapper objectMapper = new ObjectMapper();
             Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
             Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
             List<RepirVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), RepirVo.class);
             List<RepirVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), RepirVo.class);
@@ -117,7 +135,7 @@ public class CommonService {
 
 
                 JSONObject jsonWx = new JSONObject(req);
                 JSONObject jsonWx = new JSONObject(req);
                 System.out.println(jsonWx.toString());
                 System.out.println(jsonWx.toString());
-                String responseWxStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
+                String responseWxStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
                 String AUFNR = "";
                 String AUFNR = "";
                 ObjectMapper objectWxMapper = new ObjectMapper();
                 ObjectMapper objectWxMapper = new ObjectMapper();
                 Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
                 Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
@@ -146,7 +164,7 @@ public class CommonService {
         return null;
         return null;
     }
     }
 
 
-    public EquipmentAddResponse editSapBXPush(String wxCode, String outSource, int isoutSource, String priceUnit, String status) throws Exception {
+    public EquipmentAddResponse editSapBXPush(String wxCode, String outSource, int isoutSource, String priceUnit, String status, String loginName) throws Exception {
         try {
         try {
             Map<String, Object> req = new HashMap<>();
             Map<String, Object> req = new HashMap<>();
             Map<String, Object> sapReq = new HashMap<>();
             Map<String, Object> sapReq = new HashMap<>();
@@ -167,12 +185,13 @@ public class CommonService {
             sapReq.put("PRIOK", maintain.getPRIOK());
             sapReq.put("PRIOK", maintain.getPRIOK());
             sapReq.put("ILART", "003");
             sapReq.put("ILART", "003");
             sapReq.put("QMNUM", maintain.getSapCode());
             sapReq.put("QMNUM", maintain.getSapCode());
-
+            sapReq.put("BNAME", loginName);
 //            if (!status.equals("P10")) {
 //            if (!status.equals("P10")) {
             sapReq.put("ZZOR_INF_STA", status);
             sapReq.put("ZZOR_INF_STA", status);
+              String eqLoginName= commonDao.getPastureEquipmentZG(maintain.getPastureId());
 //            }
 //            }
             if (status.equals("P20")) {
             if (status.equals("P20")) {
-                List<MalfunctionDatabaseVo>  malfunctionList = malfunctionService.getMalfunction(wxCode);
+                List<MalfunctionDatabaseVo> malfunctionList = malfunctionService.getMalfunction(wxCode);
                 for (MalfunctionDatabaseVo malfunctionDatabaseVo : malfunctionList) {
                 for (MalfunctionDatabaseVo malfunctionDatabaseVo : malfunctionList) {
                     System.out.println(malfunctionDatabaseVo);
                     System.out.println(malfunctionDatabaseVo);
                     sapReq.put("URGRP", malfunctionDatabaseVo.getReasonCodegruppe());
                     sapReq.put("URGRP", malfunctionDatabaseVo.getReasonCodegruppe());
@@ -202,7 +221,7 @@ public class CommonService {
                 getReq.put("Header", header);
                 getReq.put("Header", header);
                 JSONObject json = new JSONObject(getReq);
                 JSONObject json = new JSONObject(getReq);
 
 
-                String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
+                String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
                 ObjectMapper objectMapper = new ObjectMapper();
                 ObjectMapper objectMapper = new ObjectMapper();
                 Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
                 Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
                 List<MaintainQueryVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), MaintainQueryVo.class);
                 List<MaintainQueryVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), MaintainQueryVo.class);
@@ -280,6 +299,7 @@ public class CommonService {
                 sapReq1.put("STEUS", "PM01");
                 sapReq1.put("STEUS", "PM01");
             } else {
             } else {
                 sapReq1.put("STEUS", "PM02");
                 sapReq1.put("STEUS", "PM02");
+                sapReq.put("BNAME", eqLoginName);
             }
             }
 //            sapReq1.put("APLZL", 10);
 //            sapReq1.put("APLZL", 10);
             itemList1.add(sapReq1);
             itemList1.add(sapReq1);
@@ -289,26 +309,41 @@ public class CommonService {
             query.setPageNum(1);
             query.setPageNum(1);
             query.setPageSize(10000);
             query.setPageSize(10000);
             Page pageParam = SmartPageUtil.convert2PageQuery(query);
             Page pageParam = SmartPageUtil.convert2PageQuery(query);
-            List<PartapplyVo> partapplyList = partapplyService.getPartapplyList(pageParam, "", wxCode, "1");
+            List<PartapplyVo> partapplyList = partapplyService.getPartapplyList(pageParam, "", wxCode, "");
             List<Map<String, Object>> itemList2 = new ArrayList<>();
             List<Map<String, Object>> itemList2 = new ArrayList<>();
 
 
+            List<Integer> partapplyId = new ArrayList<>();
             if (!partapplyList.equals(null)) {
             if (!partapplyList.equals(null)) {
+                int i = 0;
                 for (PartapplyVo partapplyVo : partapplyList) {
                 for (PartapplyVo partapplyVo : partapplyList) {
+                    i++;
+                    if (partapplyVo.getStatus() == 0) {
+                        continue;
+                    }
+                    if (partapplyVo.getSapStatus() == 1) {
+                        continue;
+                    }
                     Map<String, Object> sapReq2 = new HashMap<>();
                     Map<String, Object> sapReq2 = new HashMap<>();
 //                    sapReq.put("ILART", "004");
 //                    sapReq.put("ILART", "004");
                     sapReq2.put("AUFNR", maintain.getAUFNR());
                     sapReq2.put("AUFNR", maintain.getAUFNR());
                     sapReq2.put("LGORT", partapplyVo.getLgort());
                     sapReq2.put("LGORT", partapplyVo.getLgort());
-                    if (Item2 != null) {
-                        for (net.lab1024.sa.admin.module.gm.maintain.domain.vo.PartapplyVo vo : Item2) {
-                            if (partapplyVo.getSort() * 10 == Integer.parseInt(vo.getPOSNR())) {
-                                sapReq2.put("AUFPL", vo.getAUFPL());
-                                sapReq2.put("VORNR", vo.getVORNR());
-                                sapReq2.put("RSNUM", vo.getRSNUM());
-                                sapReq2.put("POSNR", vo.getPOSNR());
-                                break;
-                            }
-                        }
-                    }
+//                    boolean exist = false;
+//                    if (Item2 != null) {
+//                        for (net.lab1024.sa.admin.module.gm.maintain.domain.vo.PartapplyVo vo : Item2) {
+//                            if (vo.getPOSNR().equals("00" + (i * 10))) {
+//                                sapReq2.put("AUFPL", vo.getAUFPL());
+//                                sapReq2.put("VORNR", vo.getVORNR());
+//                                sapReq2.put("RSNUM", vo.getRSNUM());
+//                                sapReq2.put("POSNR", vo.getPOSNR());
+//                                exist = true;
+//                                break;
+//                            }
+//                        }
+//                    }
+//                    if (exist) {
+//                        continue;
+//                    }
+
                     sapReq2.put("LTXA1", "维修工单");
                     sapReq2.put("LTXA1", "维修工单");
                     sapReq2.put("MATNR", partapplyVo.getPartCode());
                     sapReq2.put("MATNR", partapplyVo.getPartCode());
                     sapReq2.put("MAKTX", partapplyVo.getPartName());
                     sapReq2.put("MAKTX", partapplyVo.getPartName());
@@ -321,7 +356,9 @@ public class CommonService {
                     sapReq2.put("BDTER", bdter);
                     sapReq2.put("BDTER", bdter);
                     sapReq2.put("MEINS", partapplyVo.getUnit());
                     sapReq2.put("MEINS", partapplyVo.getUnit());
                     sapReq2.put("APLZL", partapplyVo.getSort());
                     sapReq2.put("APLZL", partapplyVo.getSort());
-//                sapReq2.put("POSNR", partapplyVo.getSort() * 10);
+                    sapReq2.put("POSNR", "00" + (i * 10));
+                    partapplyId.add(partapplyVo.getId());
+                    sapReq.put("BNAME", eqLoginName);
                     itemList2.add(sapReq2);
                     itemList2.add(sapReq2);
                 }
                 }
             }
             }
@@ -331,7 +368,7 @@ public class CommonService {
             req.put("Item", sapReq);
             req.put("Item", sapReq);
             JSONObject jsonWx = new JSONObject(req);
             JSONObject jsonWx = new JSONObject(req);
             System.out.println(jsonWx.toString());
             System.out.println(jsonWx.toString());
-            String responseWxStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
+            String responseWxStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
             System.out.println(responseWxStr);
             System.out.println(responseWxStr);
             ObjectMapper objectWxMapper = new ObjectMapper();
             ObjectMapper objectWxMapper = new ObjectMapper();
             Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
             Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
@@ -342,6 +379,10 @@ public class CommonService {
                     res.setCode("500");
                     res.setCode("500");
                     res.setMsg(stringObjectMap.get("SYNRESULT").toString());
                     res.setMsg(stringObjectMap.get("SYNRESULT").toString());
                     return res;
                     return res;
+                }else {
+                    for (Integer id : partapplyId) {
+                        partapplyService.EditPartapplySapStauts(id);
+                    }
                 }
                 }
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
@@ -375,8 +416,8 @@ public class CommonService {
         return commonDao.getPasture(companycode);
         return commonDao.getPasture(companycode);
     }
     }
 
 
-    public List<PastureVo> getPastureList() {
-        return commonDao.getPastureList();
+    public List<PastureVo> getPastureList(String pastureName) {
+        return commonDao.getPastureList(pastureName);
     }
     }
 
 
     public PastureVo getPastureById(int id) {
     public PastureVo getPastureById(int id) {
@@ -397,7 +438,7 @@ public class CommonService {
             req.put("Header", header);
             req.put("Header", header);
             JSONObject json = new JSONObject(req);
             JSONObject json = new JSONObject(req);
             System.out.println(json.toString());
             System.out.println(json.toString());
-            String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
+            String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
 
 
             System.out.println(responseStr);
             System.out.println(responseStr);
             ObjectMapper objectMapper = new ObjectMapper();
             ObjectMapper objectMapper = new ObjectMapper();
@@ -442,27 +483,44 @@ public class CommonService {
                     query.setPageNum(1);
                     query.setPageNum(1);
                     query.setPageSize(10000);
                     query.setPageSize(10000);
                     Page pageParam = SmartPageUtil.convert2PageQuery(query);
                     Page pageParam = SmartPageUtil.convert2PageQuery(query);
-                    List<PartapplyVo> partapplyList = partapplyService.getPartapplyList(pageParam, "", byCode, "1");
+                    List<PartapplyVo> partapplyList = partapplyService.getPartapplyList(pageParam, "", byCode, "");
                     List<Map<String, Object>> itemList2 = new ArrayList<>();
                     List<Map<String, Object>> itemList2 = new ArrayList<>();
 
 
-                    if (partapplyList != null) {
-
-
+                    List<Integer> partapplyId = new ArrayList<>();
+                    String  eqLoginName = "";
+                    if (!partapplyList.equals(null)) {
+                        int i = 0;
                         for (PartapplyVo partapplyVo : partapplyList) {
                         for (PartapplyVo partapplyVo : partapplyList) {
+                            i++;
+                            if (i == 0){
+                                 eqLoginName = commonDao.getPastureEquipmentZG(partapplyVo.getPastureId());
+                            }
+                            if (partapplyVo.getStatus() == 0) {
+                                continue;
+                            }
+                            if (partapplyVo.getSapStatus() == 1) {
+                                continue;
+                            }
                             Map<String, Object> sapReq2 = new HashMap<>();
                             Map<String, Object> sapReq2 = new HashMap<>();
 //                            sapReq.put("ILART", "004");
 //                            sapReq.put("ILART", "004");
                             sapReq2.put("AUFNR", maintain.getAUFNR());
                             sapReq2.put("AUFNR", maintain.getAUFNR());
-                            if (maintain.getItem2() != null) {
-                                for (net.lab1024.sa.admin.module.gm.maintain.domain.vo.PartapplyVo vo : maintain.getItem2()) {
-                                    if (partapplyVo.getSort() * 10 == Integer.parseInt(vo.getPOSNR())) {
-                                        sapReq2.put("AUFPL", vo.getAUFPL());
-                                        sapReq2.put("VORNR", vo.getVORNR());
-                                        sapReq2.put("RSNUM", vo.getRSNUM());
-                                        sapReq2.put("POSNR", vo.getPOSNR());
-                                        break;
-                                    }
-                                }
-                            }
+//                            System.out.println(sapReq2);
+//                            boolean exist = false;
+//                            if (maintain.getItem2() != null) {
+//                                for (net.lab1024.sa.admin.module.gm.maintain.domain.vo.PartapplyVo vo : maintain.getItem2()) {
+//                                    if (vo.getPOSNR().equals("00" + (i * 10))) {
+//                                        sapReq2.put("AUFPL", vo.getAUFPL());
+//                                        sapReq2.put("VORNR", vo.getVORNR());
+//                                        sapReq2.put("RSNUM", vo.getRSNUM());
+//                                        sapReq2.put("POSNR", vo.getPOSNR());
+//                                        exist = true;
+//                                        break;
+//                                    }
+//                                }
+//                            }
+//                            if (exist) {
+//                                continue;
+//                            }
 
 
                             sapReq2.put("LTXA1", "保养工单");
                             sapReq2.put("LTXA1", "保养工单");
                             sapReq2.put("MATNR", partapplyVo.getPartCode());
                             sapReq2.put("MATNR", partapplyVo.getPartCode());
@@ -477,8 +535,12 @@ public class CommonService {
                             sapReq2.put("BDTER", bdter);
                             sapReq2.put("BDTER", bdter);
                             sapReq2.put("MEINS", partapplyVo.getUnit());
                             sapReq2.put("MEINS", partapplyVo.getUnit());
                             sapReq2.put("APLZL", partapplyVo.getSort());
                             sapReq2.put("APLZL", partapplyVo.getSort());
-                            sapReq2.put("POSNR", partapplyVo.getSort() * 10);
+                            sapReq2.put("POSNR", "00" + (i * 10));
+                            System.out.println(sapReq2);
+                            partapplyId.add(partapplyVo.getId());
+                            sapReq.put("BNAME", eqLoginName);
                             itemList2.add(sapReq2);
                             itemList2.add(sapReq2);
+
                         }
                         }
                     }
                     }
 
 
@@ -502,7 +564,7 @@ public class CommonService {
                     JSONObject jsonWx = new JSONObject(req);
                     JSONObject jsonWx = new JSONObject(req);
                     System.out.println(jsonWx.toString());
                     System.out.println(jsonWx.toString());
 
 
-                    String responseWxStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
+                    String responseWxStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
                     System.out.println(responseWxStr);
                     System.out.println(responseWxStr);
                     ObjectMapper objectWxMapper = new ObjectMapper();
                     ObjectMapper objectWxMapper = new ObjectMapper();
                     Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
                     Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
@@ -513,6 +575,10 @@ public class CommonService {
                             res.setCode("500");
                             res.setCode("500");
                             res.setMsg(stringObjectMap.get("SYNRESULT").toString());
                             res.setMsg(stringObjectMap.get("SYNRESULT").toString());
                             return res;
                             return res;
+                        }else{
+                            for (Integer id : partapplyId) {
+                                partapplyService.EditPartapplySapStauts(id);
+                            }
                         }
                         }
                     }
                     }
                 }
                 }
@@ -528,14 +594,15 @@ public class CommonService {
     }
     }
 
 
     public void SyncParts() throws Exception {
     public void SyncParts() throws Exception {
-        List<PastureVo> pastureList = commonDao.getPastureList();
+
+        List<PastureVo> pastureList = commonDao.getPastureList("");
         for (PastureVo pastureVo : pastureList) {
         for (PastureVo pastureVo : pastureList) {
             System.out.println(pastureVo);
             System.out.println(pastureVo);
             Map<String, Object> req = new HashMap();
             Map<String, Object> req = new HashMap();
             req.put("WERKS", pastureVo.getCompanycode());
             req.put("WERKS", pastureVo.getCompanycode());
             JSONObject json = new JSONObject(req);
             JSONObject json = new JSONObject(req);
 
 
-            String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_ZK/MATERIALMASTER", "application/json", json.toString());
+            String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_ZK/MATERIALMASTER", "application/json", json.toString());
 
 
             try {
             try {
                 ObjectMapper objectMapper = new ObjectMapper();
                 ObjectMapper objectMapper = new ObjectMapper();
@@ -552,6 +619,132 @@ public class CommonService {
         }
         }
 
 
     }
     }
+
+    public ResponseDTO SyncBigInspection(int pastureId) throws Exception {
+        PastureVo pasture = getPastureById(pastureId);
+
+        Map<String, Object> req = new HashMap();
+        Map itemReq = new HashMap();
+        itemReq.put("IWERK", pasture.getCompanycode());
+        itemReq.put("AUART", "ZP02");
+
+        req.put("Item", itemReq);
+        Map header = new HashMap();
+        header.put("SRC_SYSTEM", "APP");
+        header.put("DEST_SYSTEM", "SAP");
+        req.put("Header", header);
+        JSONObject json = new JSONObject(req);
+        System.out.println(json.toString());
+        String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
+
+        System.out.println(responseStr);
+        ObjectMapper objectMapper = new ObjectMapper();
+        Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
+        List<MaintainQueryVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), MaintainQueryVo.class);
+        if (parseArray != null) {
+            List<String> sapCodeList = new ArrayList<>();
+            for (MaintainQueryVo maintainQueryVo : parseArray) {
+                sapCodeList.add(maintainQueryVo.getAUFNR());
+            }
+            String sapCode = String.join(",", sapCodeList);
+            List<BigInspectionVo> bigInspectionList = inspectionService.getBigInspectionBySapCode(sapCode);
+            for (MaintainQueryVo maintainQueryVo : parseArray) {
+                boolean exist = false;
+                for (BigInspectionVo bigInspectionVo : bigInspectionList) {
+                    if (maintainQueryVo.getAUFNR().equals(bigInspectionVo.getSapCode())) {
+                        exist = true;
+                        break;
+                    }
+                }
+
+                if (!exist) {
+                    System.out.println(maintainQueryVo.getAUFNR());
+                    BigInspectionFrom bigInspectionIn = new BigInspectionFrom();
+                    AddAuditFrom addAuditFrom = new AddAuditFrom();
+                    bigInspectionIn.setPastureId(pastureId);
+                    System.out.println(maintainQueryVo.getEQUNR());
+                    EquipmentInfo eqInfo = equipmentService.getEquipmenDetailsByEqCode(maintainQueryVo.getEQUNR());
+
+                    if (eqInfo == null) {
+                        continue;
+                    }
+//                    if (planType == 0) {
+//                    String xjCode = autoCreatCode(String.valueOf(pasture.getId()), "WH");
+//                    bigInspectionIn.setInspectionCode(xjCode);
+                    bigInspectionIn.setPlanType(1);
+//                    addAuditFrom.setCode(xjCode);
+                    addAuditFrom.setAuditType(3);
+                    if (eqInfo.getOneupkeep() == null) {
+                        eqInfo.setOneupkeep("");
+
+                    }
+                    if (eqInfo.getTwoupkeep() == null) {
+                        eqInfo.setTwoupkeep("");
+                    }
+                    if (eqInfo.getOneupkeep().equals("") || eqInfo.getTwoupkeep().equals("")) {
+                        continue;
+                    }
+                    bigInspectionIn.setUpkeepPerson(eqInfo.getOneupkeep().toString() + "," + eqInfo.getTwoupkeep().toString());
+
+                    bigInspectionIn.setEqCode(maintainQueryVo.getEQUNR());
+                    bigInspectionIn.setPlantime(maintainQueryVo.getERDAT());
+                    bigInspectionIn.setSapCode(maintainQueryVo.getAUFNR());
+                    bigInspectionIn.setRemark(maintainQueryVo.getKTEXT());
+
+                    addAuditFrom.setSapCode(maintainQueryVo.getAUFNR());
+                    addAuditFrom.setPastureId(pastureId);
+
+                    if (eqInfo.getOneduty() == null) {
+                        eqInfo.setOneduty("");
+                    }
+                    if (eqInfo.getTwoduty() == null) {
+                        eqInfo.setTwoduty("");
+                    }
+                    bigInspectionIn.setOnePerson(eqInfo.getOneduty().toString());
+                    bigInspectionIn.setOnePerson(eqInfo.getTwoduty().toString());
+
+                    addAuditFrom.setProcessed(1);
+                    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    Date date = new Date(System.currentTimeMillis());
+                    addAuditFrom.setDate(formatter.format(date));
+
+                    List<AppearanceVo> appearanceList = appearanceService.getAppearanceAllList(maintainQueryVo.getPLNNR(), maintainQueryVo.getPLNAL());
+                    List<InspectionFrom> inspectionFromList = new ArrayList<>();
+                    if (maintainQueryVo.getItem1() != null) {
+                        for (OutsourceVo taskDetails : maintainQueryVo.getItem1()) {
+//                                for (AppearanceVo appearanceVo : appearanceList) {
+                            String sapCode1 = maintainQueryVo.getPLNNR() + maintainQueryVo.getPLNAL() + taskDetails.getVORNR();
+                            if (sapCode1.equals(maintainQueryVo.getPLNNR() + maintainQueryVo.getPLNAL() + taskDetails.getVORNR())) {
+                                InspectionFrom inspectionFrom = new InspectionFrom();
+                                inspectionFrom.setInspectionCode(bigInspectionIn.getInspectionCode());
+                                inspectionFrom.setPLNNR(maintainQueryVo.getPLNNR());
+                                inspectionFrom.setPLNAL(maintainQueryVo.getPLNAL());
+                                inspectionFrom.setVORNR(taskDetails.getVORNR());
+                                inspectionFrom.setContent(maintainQueryVo.getKTEXT());
+                                inspectionFromList.add(inspectionFrom);
+                            }
+                        }
+                    }
+                    addAuditFrom.setEqCode(bigInspectionIn.getEqCode());
+                    String xjCode = autoCreatCode(String.valueOf(pasture.getId()), "WH");
+                    bigInspectionIn.setInspectionCode(xjCode);
+                    bigInspectionIn.setPlanType(1);
+                    addAuditFrom.setCode(xjCode);
+                    inspectionService.addBigInspection(bigInspectionIn, addAuditFrom, inspectionFromList);
+                    EquipmentAddResponse res1 = editSapBYPush(bigInspectionIn.getInspectionCode(), addAuditFrom.getSapCode(), "P10");
+                    if (res1 != null) {
+                        ResponseDTO res = ResponseDTO.ok();
+                        res = ResponseDTO.ok(false);
+                        res.setCode(500);
+                        res.setMsg(res1.getMsg());
+                        return res;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
 }
 }
 
 
 
 

+ 6 - 2
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/common/service/MovementService.java

@@ -38,8 +38,12 @@ public class MovementService {
     }
     }
 
 
 
 
-    public List<MovementVo> getMovement(int pastureId,String enable) {
-        return commonDao.getMovement(pastureId,enable);
+    public List<MovementVo> getMovement(String enable) {
+        return commonDao.getMovement(enable);
+    }
+
+    public int getMovementCount(String movement) {
+        return commonDao.getMovementCount(movement);
     }
     }
 
 
     public boolean delMovement(String id) {
     public boolean delMovement(String id) {

+ 6 - 2
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/controller/EquipmentController.java

@@ -34,7 +34,8 @@ public class EquipmentController {
                                                              @RequestParam(required = false, defaultValue = "") String eqName,
                                                              @RequestParam(required = false, defaultValue = "") String eqName,
                                                              @RequestParam(required = false, defaultValue = "") String eqCode,
                                                              @RequestParam(required = false, defaultValue = "") String eqCode,
                                                              @RequestParam(required = false, defaultValue = "") String pastureId,
                                                              @RequestParam(required = false, defaultValue = "") String pastureId,
-                                                             @RequestParam(required = false, defaultValue = "") String bind) {
+                                                             @RequestParam(required = false, defaultValue = "") String bind,
+                                                             @RequestParam(required = false, defaultValue = "") String roleId) {
         EquipmentQueryFrom query = new EquipmentQueryFrom();
         EquipmentQueryFrom query = new EquipmentQueryFrom();
         query.setPageNum(pageNum);
         query.setPageNum(pageNum);
         query.setPageSize(pageSize);
         query.setPageSize(pageSize);
@@ -42,6 +43,7 @@ public class EquipmentController {
         query.setEqName(eqName);
         query.setEqName(eqName);
         query.setPastureId(pastureId);
         query.setPastureId(pastureId);
         query.setBind(bind);
         query.setBind(bind);
+        query.setRoleId(roleId);
         Map map = equipmentService.getEquipmentList(query);
         Map map = equipmentService.getEquipmentList(query);
 
 
         ResponseDTO<List<EquipmentInfo>> t = ResponseDTO.ok((List<EquipmentInfo>) map.get("list"));
         ResponseDTO<List<EquipmentInfo>> t = ResponseDTO.ok((List<EquipmentInfo>) map.get("list"));
@@ -74,11 +76,13 @@ public class EquipmentController {
     //@NoNeedLogin
     //@NoNeedLogin
     @ApiOperation("查看功能位置主数据列表")
     @ApiOperation("查看功能位置主数据列表")
     public ResponseDTO<List<EquipmentTplnrVo>> getEquipmentTplnrList(@RequestParam int pageNum, @RequestParam int pageSize,
     public ResponseDTO<List<EquipmentTplnrVo>> getEquipmentTplnrList(@RequestParam int pageNum, @RequestParam int pageSize,
-                                                                     @RequestParam(required = false, defaultValue = "") String eqName) {
+                                                                     @RequestParam(required = false, defaultValue = "") String eqName,
+                                                                     @RequestParam(required = false, defaultValue = "") String roleId) {
         EquipmentTplnrFrom query = new EquipmentTplnrFrom();
         EquipmentTplnrFrom query = new EquipmentTplnrFrom();
         query.setPageNum(pageNum);
         query.setPageNum(pageNum);
         query.setPageSize(pageSize);
         query.setPageSize(pageSize);
         query.setEqName(eqName);
         query.setEqName(eqName);
+        query.setRoleId(roleId);
         Map map = equipmentService.getEquipmentTplnrList(query);
         Map map = equipmentService.getEquipmentTplnrList(query);
 
 
         ResponseDTO<List<EquipmentTplnrVo>> t = ResponseDTO.ok((List<EquipmentTplnrVo>) map.get("list"));
         ResponseDTO<List<EquipmentTplnrVo>> t = ResponseDTO.ok((List<EquipmentTplnrVo>) map.get("list"));

+ 11 - 4
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/controller/EquipmentSapController.java

@@ -1,13 +1,17 @@
 package net.lab1024.sa.admin.module.gm.eq.controller;
 package net.lab1024.sa.admin.module.gm.eq.controller;
 
 
+import com.alibaba.fastjson.JSON;
+import com.fasterxml.jackson.core.JsonProcessingException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentSap;
 import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentSap;
 import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentTplnrInfo;
 import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentTplnrInfo;
 import net.lab1024.sa.admin.module.gm.eq.service.EquipmentService;
 import net.lab1024.sa.admin.module.gm.eq.service.EquipmentService;
+import net.lab1024.sa.admin.module.system.employee.domain.form.EmployeeAddSapFrom;
 import net.lab1024.sa.common.common.annoation.NoNeedLogin;
 import net.lab1024.sa.common.common.annoation.NoNeedLogin;
 import net.lab1024.sa.common.common.domain.EQUNRResult;
 import net.lab1024.sa.common.common.domain.EQUNRResult;
 import net.lab1024.sa.common.common.domain.EquipmentAddResponse;
 import net.lab1024.sa.common.common.domain.EquipmentAddResponse;
+import net.lab1024.sa.common.common.domain.ResponseDTO;
 import net.lab1024.sa.common.common.domain.TPLNRResult;
 import net.lab1024.sa.common.common.domain.TPLNRResult;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -28,9 +32,11 @@ public class EquipmentSapController {
     @PostMapping("/eq/add")
     @PostMapping("/eq/add")
     @NoNeedLogin
     @NoNeedLogin
     @ApiOperation("添加设备基础信息")
     @ApiOperation("添加设备基础信息")
-    public EquipmentAddResponse addEquipment(@RequestBody Map<String, List<EquipmentSap>> from) {
+    public EquipmentAddResponse addEquipment(@RequestBody Map<String, Object> from) {
+
+        List<EquipmentSap> itemList = JSON.parseArray(JSON.toJSONString(from.get("Item")), EquipmentSap.class);
         EquipmentAddResponse res = new EquipmentAddResponse();
         EquipmentAddResponse res = new EquipmentAddResponse();
-        List<EquipmentSap> itemList = from.get("Item");
+//        List<EquipmentSap> itemList = from.get("Item");
         System.out.println(itemList);
         System.out.println(itemList);
         List<EQUNRResult> equnrList = new ArrayList<>();
         List<EQUNRResult> equnrList = new ArrayList<>();
         int SYNSTATUS = 1;
         int SYNSTATUS = 1;
@@ -62,9 +68,10 @@ public class EquipmentSapController {
     @PostMapping("/tplnr/add")
     @PostMapping("/tplnr/add")
     @NoNeedLogin
     @NoNeedLogin
     @ApiOperation("添加功能位置主数据")
     @ApiOperation("添加功能位置主数据")
-    public EquipmentAddResponse addEquipmentTplnr(@Valid @RequestBody Map<String, List<EquipmentTplnrInfo>> from) {
+    public EquipmentAddResponse addEquipmentTplnr(@Valid @RequestBody Map<String, Object> from) {
+
+            List<EquipmentTplnrInfo> itemList = JSON.parseArray(JSON.toJSONString(from.get("Item")), EquipmentTplnrInfo.class);
         System.out.println(from);
         System.out.println(from);
-        List<EquipmentTplnrInfo> itemList = from.get("Item");
         EquipmentAddResponse res = new EquipmentAddResponse();
         EquipmentAddResponse res = new EquipmentAddResponse();
         List<TPLNRResult> tplnrList = new ArrayList<>();
         List<TPLNRResult> tplnrList = new ArrayList<>();
         int SYNSTATUS = 1;
         int SYNSTATUS = 1;

+ 1 - 1
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/dao/EquipmentDao.java

@@ -46,7 +46,7 @@ public interface EquipmentDao  extends BaseMapper<EquipmentEntity> {
     EquipmentBindDetailsVo getEquipmentBindDetails(@Param("fromId") int id);
     EquipmentBindDetailsVo getEquipmentBindDetails(@Param("fromId") int id);
 
 
     List<EquimentRecordVo> getEquipmentRecord(@Param("page")Page page,@Param("eqCode")String  eqCode,@Param("startDate")String startDate,
     List<EquimentRecordVo> getEquipmentRecord(@Param("page")Page page,@Param("eqCode")String  eqCode,@Param("startDate")String startDate,
-                                              @Param("endDate")String endDate, @Param("pastureId")String pastureId);
+                                              @Param("endDate")String endDate, @Param("pastureId")String pastureId  );
 
 
     int getEquipmentRecordCount(@Param("eqCode")String  eqCode,@Param("startDate")String startDate,@Param("endDate")String endDate, @Param("pastureId")String pastureId);
     int getEquipmentRecordCount(@Param("eqCode")String  eqCode,@Param("startDate")String startDate,@Param("endDate")String endDate, @Param("pastureId")String pastureId);
 
 

+ 2 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/domain/from/EquipmentQueryFrom.java

@@ -15,4 +15,6 @@ public class EquipmentQueryFrom extends PageParam {
 
 
     private String pastureId;
     private String pastureId;
     private String bind;
     private String bind;
+
+    private String roleId;
 }
 }

+ 1 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/eq/domain/from/EquipmentTplnrFrom.java

@@ -6,4 +6,5 @@ import net.lab1024.sa.common.common.domain.PageParam;
 @Data
 @Data
 public class EquipmentTplnrFrom extends PageParam {
 public class EquipmentTplnrFrom extends PageParam {
     private String eqName;
     private String eqName;
+    private String roleId;
 }
 }

+ 64 - 60
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/inspection/controller/InspectionController.java

@@ -57,12 +57,14 @@ public class InspectionController {
     //@NoNeedLogin
     //@NoNeedLogin
     @ApiOperation("查看巡检保养信息")
     @ApiOperation("查看巡检保养信息")
     public ResponseDTO<List<BigInspectionVo>> getInspectionList(@RequestParam int pageNum, @RequestParam int pageSize,
     public ResponseDTO<List<BigInspectionVo>> getInspectionList(@RequestParam int pageNum, @RequestParam int pageSize,
-                                                                @RequestParam int pastureId, @RequestParam int planType, @RequestParam(required = false, defaultValue = "")  String empId,
+                                                                @RequestParam int pastureId, @RequestParam int planType, @RequestParam(required = false, defaultValue = "") String empId,
                                                                 @RequestParam int status, @RequestParam(required = false, defaultValue = "") String startDate,
                                                                 @RequestParam int status, @RequestParam(required = false, defaultValue = "") String startDate,
-                                                                @RequestParam(required = false, defaultValue = "") String endDate) throws Exception {
+                                                                @RequestParam(required = false, defaultValue = "") String endDate,
+                                                                @RequestParam(required = false, defaultValue = "") String roleId) throws Exception {
 
 
         PastureVo pasture = commonService.getPastureById(pastureId);
         PastureVo pasture = commonService.getPastureById(pastureId);
 
 
+
         if (status == 0) {
         if (status == 0) {
             Map<String, Object> req = new HashMap();
             Map<String, Object> req = new HashMap();
             Map itemReq = new HashMap();
             Map itemReq = new HashMap();
@@ -76,13 +78,12 @@ public class InspectionController {
             req.put("Header", header);
             req.put("Header", header);
             JSONObject json = new JSONObject(req);
             JSONObject json = new JSONObject(req);
             System.out.println(json.toString());
             System.out.println(json.toString());
-            String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
+            String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
 
 
             System.out.println(responseStr);
             System.out.println(responseStr);
             ObjectMapper objectMapper = new ObjectMapper();
             ObjectMapper objectMapper = new ObjectMapper();
             Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
             Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
             List<MaintainQueryVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), MaintainQueryVo.class);
             List<MaintainQueryVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), MaintainQueryVo.class);
-            System.out.println(parseArray);
             if (parseArray != null) {
             if (parseArray != null) {
                 List<String> sapCodeList = new ArrayList<>();
                 List<String> sapCodeList = new ArrayList<>();
                 for (MaintainQueryVo maintainQueryVo : parseArray) {
                 for (MaintainQueryVo maintainQueryVo : parseArray) {
@@ -90,10 +91,6 @@ public class InspectionController {
                 }
                 }
                 String sapCode = String.join(",", sapCodeList);
                 String sapCode = String.join(",", sapCodeList);
                 List<BigInspectionVo> bigInspectionList = inspectionService.getBigInspectionBySapCode(sapCode);
                 List<BigInspectionVo> bigInspectionList = inspectionService.getBigInspectionBySapCode(sapCode);
-
-                for (MaintainQueryVo maintainQueryVo : parseArray) {
-                    System.out.println(maintainQueryVo);
-                }
                 for (MaintainQueryVo maintainQueryVo : parseArray) {
                 for (MaintainQueryVo maintainQueryVo : parseArray) {
                     boolean exist = false;
                     boolean exist = false;
                     for (BigInspectionVo bigInspectionVo : bigInspectionList) {
                     for (BigInspectionVo bigInspectionVo : bigInspectionList) {
@@ -102,6 +99,7 @@ public class InspectionController {
                             break;
                             break;
                         }
                         }
                     }
                     }
+
                     if (!exist) {
                     if (!exist) {
                         System.out.println(maintainQueryVo.getAUFNR());
                         System.out.println(maintainQueryVo.getAUFNR());
                         BigInspectionFrom bigInspectionIn = new BigInspectionFrom();
                         BigInspectionFrom bigInspectionIn = new BigInspectionFrom();
@@ -109,29 +107,27 @@ public class InspectionController {
                         bigInspectionIn.setPastureId(pastureId);
                         bigInspectionIn.setPastureId(pastureId);
                         System.out.println(maintainQueryVo.getEQUNR());
                         System.out.println(maintainQueryVo.getEQUNR());
                         EquipmentInfo eqInfo = equipmentService.getEquipmenDetailsByEqCode(maintainQueryVo.getEQUNR());
                         EquipmentInfo eqInfo = equipmentService.getEquipmenDetailsByEqCode(maintainQueryVo.getEQUNR());
+
                         if (eqInfo == null) {
                         if (eqInfo == null) {
                             continue;
                             continue;
                         }
                         }
 //                    if (planType == 0) {
 //                    if (planType == 0) {
-                        String xjCode = commonService.autoCreatCode(String.valueOf(pasture.getId()), "WH");
-                        bigInspectionIn.setInspectionCode(xjCode);
-                        bigInspectionIn.setPlanType(1);
-                        addAuditFrom.setCode(xjCode);
+
                         addAuditFrom.setAuditType(3);
                         addAuditFrom.setAuditType(3);
-                        if (eqInfo.getOneinspection() == null) {
-                            eqInfo.setOneinspection("");
+                        if (eqInfo.getOneupkeep() == null) {
+                            eqInfo.setOneupkeep("");
 
 
                         }
                         }
-                        if (eqInfo.getTwoinspection() == null) {
-                            eqInfo.setTwoinspection("");
+                        if (eqInfo.getTwoupkeep() == null) {
+                            eqInfo.setTwoupkeep("");
                         }
                         }
-                        if (eqInfo.getOneinspection().equals("") || eqInfo.getTwoinspection().equals("")) {
+                        if (eqInfo.getOneupkeep().equals("") || eqInfo.getTwoupkeep().equals("")) {
                             continue;
                             continue;
                         }
                         }
-                        bigInspectionIn.setUpkeepPerson(eqInfo.getOneinspection().toString() + "," + eqInfo.getTwoinspection().toString());
+                        bigInspectionIn.setUpkeepPerson(eqInfo.getOneupkeep().toString() + "," + eqInfo.getTwoupkeep().toString());
 
 
                         bigInspectionIn.setEqCode(maintainQueryVo.getEQUNR());
                         bigInspectionIn.setEqCode(maintainQueryVo.getEQUNR());
-                        bigInspectionIn.setPlantime(maintainQueryVo.getERDAT());
+                        bigInspectionIn.setPlantime(maintainQueryVo.getIDAT1());
                         bigInspectionIn.setSapCode(maintainQueryVo.getAUFNR());
                         bigInspectionIn.setSapCode(maintainQueryVo.getAUFNR());
                         bigInspectionIn.setRemark(maintainQueryVo.getKTEXT());
                         bigInspectionIn.setRemark(maintainQueryVo.getKTEXT());
 
 
@@ -152,7 +148,6 @@ public class InspectionController {
                         Date date = new Date(System.currentTimeMillis());
                         Date date = new Date(System.currentTimeMillis());
                         addAuditFrom.setDate(formatter.format(date));
                         addAuditFrom.setDate(formatter.format(date));
 
 
-
                         List<AppearanceVo> appearanceList = appearanceService.getAppearanceAllList(maintainQueryVo.getPLNNR(), maintainQueryVo.getPLNAL());
                         List<AppearanceVo> appearanceList = appearanceService.getAppearanceAllList(maintainQueryVo.getPLNNR(), maintainQueryVo.getPLNAL());
                         List<InspectionFrom> inspectionFromList = new ArrayList<>();
                         List<InspectionFrom> inspectionFromList = new ArrayList<>();
                         if (maintainQueryVo.getItem1() != null) {
                         if (maintainQueryVo.getItem1() != null) {
@@ -165,14 +160,25 @@ public class InspectionController {
                                     inspectionFrom.setPLNNR(maintainQueryVo.getPLNNR());
                                     inspectionFrom.setPLNNR(maintainQueryVo.getPLNNR());
                                     inspectionFrom.setPLNAL(maintainQueryVo.getPLNAL());
                                     inspectionFrom.setPLNAL(maintainQueryVo.getPLNAL());
                                     inspectionFrom.setVORNR(taskDetails.getVORNR());
                                     inspectionFrom.setVORNR(taskDetails.getVORNR());
-                                    inspectionFrom.setContent(maintainQueryVo.getKTEXT());
+                                    inspectionFrom.setContent(taskDetails.getLTXA1());
                                     inspectionFromList.add(inspectionFrom);
                                     inspectionFromList.add(inspectionFrom);
-//                                    }
                                 }
                                 }
                             }
                             }
                         }
                         }
+                        String xjCode = commonService.autoCreatCode(String.valueOf(pasture.getId()), "WH");
+                        bigInspectionIn.setInspectionCode(xjCode);
+                        bigInspectionIn.setPlanType(1);
+                        addAuditFrom.setCode(xjCode);
                         addAuditFrom.setEqCode(bigInspectionIn.getEqCode());
                         addAuditFrom.setEqCode(bigInspectionIn.getEqCode());
                         inspectionService.addBigInspection(bigInspectionIn, addAuditFrom, inspectionFromList);
                         inspectionService.addBigInspection(bigInspectionIn, addAuditFrom, inspectionFromList);
+                        EquipmentAddResponse res1 = commonService.editSapBYPush(bigInspectionIn.getInspectionCode(), addAuditFrom.getSapCode(), "P10");
+                        if (res1 != null) {
+                            ResponseDTO res = ResponseDTO.ok();
+                            res = ResponseDTO.ok(false);
+                            res.setCode(500);
+                            res.setMsg(res1.getMsg());
+                            return res;
+                        }
                     }
                     }
                 }
                 }
             }
             }
@@ -182,11 +188,12 @@ public class InspectionController {
         page.setPageSize(pageSize);
         page.setPageSize(pageSize);
         Page pageParam = SmartPageUtil.convert2PageQuery(page);
         Page pageParam = SmartPageUtil.convert2PageQuery(page);
 
 
-        List<BigInspectionVo> bigInspectionVoList = inspectionService.getBigInspectionList(pageParam, pastureId, planType, empId, status, startDate, endDate);
+        List<BigInspectionVo> bigInspectionVoList = inspectionService.getBigInspectionList(pageParam, pastureId, planType, empId, status,
+                startDate, endDate, roleId);
         for (BigInspectionVo bigInspectionVo : bigInspectionVoList) {
         for (BigInspectionVo bigInspectionVo : bigInspectionVoList) {
             bigInspectionVo.setResult("检测" + bigInspectionVo.getCount() + "项,合格" + bigInspectionVo.getCount() + "项");
             bigInspectionVo.setResult("检测" + bigInspectionVo.getCount() + "项,合格" + bigInspectionVo.getCount() + "项");
         }
         }
-        int count = inspectionService.getBigInspectionListCount(pastureId, planType, empId, status, startDate, endDate);
+        int count = inspectionService.getBigInspectionListCount(pastureId, planType, empId, status, startDate, endDate, roleId);
         ResponseDTO res = ResponseDTO.ok(bigInspectionVoList);
         ResponseDTO res = ResponseDTO.ok(bigInspectionVoList);
         res.setCount(count);
         res.setCount(count);
         res.setCode(200);
         res.setCode(200);
@@ -201,36 +208,42 @@ public class InspectionController {
     public ResponseDTO<BigInspectionVo> getInspection(@RequestParam int id) throws Exception {
     public ResponseDTO<BigInspectionVo> getInspection(@RequestParam int id) throws Exception {
 
 
         BigInspectionVo bigInspection = new BigInspectionVo();
         BigInspectionVo bigInspection = new BigInspectionVo();
-        try {
-            bigInspection = inspectionService.getBigInspection(id);
+//        try {
+        bigInspection = inspectionService.getBigInspection(id);
+        if (bigInspection.getUpkeepPersonPhone() != null) {
             bigInspection.setUpkeepPersonPhoneList(Arrays.asList(bigInspection.getUpkeepPersonPhone().split(",")));
             bigInspection.setUpkeepPersonPhoneList(Arrays.asList(bigInspection.getUpkeepPersonPhone().split(",")));
+        }
+        if (bigInspection.getUpkeepPersonPhoneList() != null) {
             bigInspection.setUpkeepPersonCount(bigInspection.getUpkeepPersonPhoneList().size());
             bigInspection.setUpkeepPersonCount(bigInspection.getUpkeepPersonPhoneList().size());
-            List<InspectionVo> inspectionList = inspectionService.getInspection(id);
-            bigInspection.setInspectionList(inspectionList);
-
-            List<FileVo> fileList = commonService.getFile(bigInspection.getInspectionCode());
-            int i = 0;
-            for (FileVo fileVo : fileList) {
-                i++;
-                if (i == 1) {
-                    bigInspection.setPath1(fileVo.getPath());
-                    bigInspection.setPathId1(fileVo.getId());
-                } else if (i == 2) {
-                    bigInspection.setPath2(fileVo.getPath());
-                    bigInspection.setPathId2(fileVo.getId());
-                } else {
-                    bigInspection.setPath3(fileVo.getPath());
-                    bigInspection.setPathId3(fileVo.getId());
-                }
+        }else{
+            bigInspection.setUpkeepPersonCount(0);
+        }
+        List<InspectionVo> inspectionList = inspectionService.getInspection(id);
+        bigInspection.setInspectionList(inspectionList);
+        System.out.println(inspectionList);
+        System.out.println(id);
+        List<FileVo> fileList = commonService.getFile(bigInspection.getInspectionCode());
+        int i = 0;
+        for (FileVo fileVo : fileList) {
+            i++;
+            if (i == 1) {
+                bigInspection.setPath1(fileVo.getPath());
+                bigInspection.setPathId1(fileVo.getId());
+            } else if (i == 2) {
+                bigInspection.setPath2(fileVo.getPath());
+                bigInspection.setPathId2(fileVo.getId());
+            } else {
+                bigInspection.setPath3(fileVo.getPath());
+                bigInspection.setPathId3(fileVo.getId());
             }
             }
-
-
-        } catch (Exception e) {
-            ResponseDTO res = ResponseDTO.ok(bigInspection);
-            res.setMsg(e.getMessage());
-            res.setCode(500);
-            return res;
         }
         }
+//        } catch (Exception e) {
+//            ResponseDTO res = ResponseDTO.ok(bigInspection);
+//            res.setMsg(e.getMessage());
+//            res.setCode(500);
+//            System.out.println(e.getMessage());
+//            return res;
+//        }
 
 
         ResponseDTO res = ResponseDTO.ok(bigInspection);
         ResponseDTO res = ResponseDTO.ok(bigInspection);
         res.setCode(200);
         res.setCode(200);
@@ -254,17 +267,8 @@ public class InspectionController {
                     return t;
                     return t;
                 }
                 }
                 AuditVo auditInfo = auditService.getAudit(from.getInspectionCode());
                 AuditVo auditInfo = auditService.getAudit(from.getInspectionCode());
-
                 if (auditInfo.getStatus().equals(0)) {
                 if (auditInfo.getStatus().equals(0)) {
-                    EquipmentAddResponse res1 = commonService.editSapBYPush(from.getInspectionCode(), from.getSapCode(), "P10");
-                    if (res1 != null) {
-                        from.setStatus(0);
-                        ResponseDTO<Boolean> t;
-                        t = ResponseDTO.ok(false);
-                        t.setCode(500);
-                        t.setMsg(res1.getMsg());
-                        return t;
-                    }
+
                 }
                 }
 
 
                 EquipmentAddResponse res = commonService.editSapBYPush(from.getInspectionCode(), from.getSapCode(), "P20");
                 EquipmentAddResponse res = commonService.editSapBYPush(from.getInspectionCode(), from.getSapCode(), "P20");

+ 8 - 2
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/inspection/dao/InspectionDao.java

@@ -20,10 +20,16 @@ public interface InspectionDao {
     void addInspection(@Param("inspectionFrom") InspectionFrom inspectionFrom);
     void addInspection(@Param("inspectionFrom") InspectionFrom inspectionFrom);
 
 
     List<BigInspectionVo> getBigInspectionList (@Param("page") Page page,@Param("fromPastureId") int pastureId,@Param("fromPlanType") int  planType,
     List<BigInspectionVo> getBigInspectionList (@Param("page") Page page,@Param("fromPastureId") int pastureId,@Param("fromPlanType") int  planType,
-                                                @Param("empId") String empId,@Param("status") int  status,@Param("startTime") String startTime,@Param("endTime") String endTime);
+                                                @Param("empId") String empId,@Param("status") int  status,@Param("startTime") String startTime,
+                                                @Param("endTime") String endTime, @Param("roleId") String roleId);
 
 
     int getBigInspectionListCount (@Param("fromPastureId") int pastureId,@Param("fromPlanType") int   planType,@Param("empId") String empId,
     int getBigInspectionListCount (@Param("fromPastureId") int pastureId,@Param("fromPlanType") int   planType,@Param("empId") String empId,
-                                   @Param("status") int  status,@Param("startTime") String startTime,@Param("endTime") String endTime);
+                                   @Param("status") int  status,@Param("startTime") String startTime,@Param("endTime") String endTime,
+                                   @Param("roleId") String roleId);
+
+
+    int getBigInspectionCount (@Param("code") String code);
+
 
 
     BigInspectionVo getBigInspection (@Param("id") int id);
     BigInspectionVo getBigInspection (@Param("id") int id);
     List<InspectionVo> getInspection(@Param("bigid") int bigid);
     List<InspectionVo> getInspection(@Param("bigid") int bigid);

+ 1 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/inspection/domain/vo/BigInspectionVo.java

@@ -37,6 +37,7 @@ public class BigInspectionVo {
     private int upkeepPersonCount;
     private int upkeepPersonCount;
     private List<String> upkeepPersonPhoneList;
     private List<String> upkeepPersonPhoneList;
     private String upkeepPersonPhone;
     private String upkeepPersonPhone;
+    private String appTs;
 //    private String oneUpkeepPersonPhone;
 //    private String oneUpkeepPersonPhone;
 //    private String twoUpkeepPersonPhone;
 //    private String twoUpkeepPersonPhone;
     private List<InspectionVo> inspectionList;
     private List<InspectionVo> inspectionList;

+ 8 - 4
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/inspection/service/InspectionService.java

@@ -41,6 +41,7 @@ public class InspectionService {
             auditService.AddAudit(auditFrom);
             auditService.AddAudit(auditFrom);
             for (InspectionFrom inspection : inspectionList) {
             for (InspectionFrom inspection : inspectionList) {
                 inspection.setSort(Integer.parseInt(inspection.getVORNR()));
                 inspection.setSort(Integer.parseInt(inspection.getVORNR()));
+                inspection.setInspectionCode(from.getInspectionCode());
                 inspectionDao.addInspection(inspection);
                 inspectionDao.addInspection(inspection);
             }
             }
 
 
@@ -50,14 +51,17 @@ public class InspectionService {
         inspectionDao.addInspection(inspectionFrom);
         inspectionDao.addInspection(inspectionFrom);
     }
     }
 
 
-    public List<BigInspectionVo> getBigInspectionList(Page page, int pastureId, int planType, String empId, int status,String startTime,String endTime) {
-        return inspectionDao.getBigInspectionList(page, pastureId, planType, empId, status,startTime,endTime);
+    public List<BigInspectionVo> getBigInspectionList(Page page, int pastureId, int planType, String empId, int status,String startTime,String endTime,String roleId) {
+        return inspectionDao.getBigInspectionList(page, pastureId, planType, empId, status,startTime,endTime,roleId);
     }
     }
 
 
-    public int getBigInspectionListCount(int pastureId, int planType, String empId, int status,String startTime, String endTime) {
-        return inspectionDao.getBigInspectionListCount(pastureId, planType, empId, status,startTime,endTime);
+    public int getBigInspectionListCount(int pastureId, int planType, String empId, int status,String startTime, String endTime,String roleId) {
+        return inspectionDao.getBigInspectionListCount(pastureId, planType, empId, status,startTime,endTime,roleId);
     }
     }
 
 
+    public int getBigInspectionCount( String code) {
+        return inspectionDao.getBigInspectionCount(code);
+    }
     public BigInspectionVo getBigInspection(int id) {
     public BigInspectionVo getBigInspection(int id) {
         return inspectionDao.getBigInspection(id);
         return inspectionDao.getBigInspection(id);
     }
     }

+ 35 - 21
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/maintain/controller/MaintainQueryController.java

@@ -99,7 +99,8 @@ public class MaintainQueryController {
                                                       @RequestParam(required = false, defaultValue = "") String status,
                                                       @RequestParam(required = false, defaultValue = "") String status,
                                                       @RequestParam(required = false, defaultValue = "") String eqCodeOrName,
                                                       @RequestParam(required = false, defaultValue = "") String eqCodeOrName,
                                                       @RequestParam(required = false, defaultValue = "") String startDate,
                                                       @RequestParam(required = false, defaultValue = "") String startDate,
-                                                      @RequestParam(required = false, defaultValue = "") String endDate) throws Exception {
+                                                      @RequestParam(required = false, defaultValue = "") String endDate,
+                                                      @RequestParam(required = false, defaultValue = "") String roleId) throws Exception {
 
 
         EquipmentTplnrFrom query = new EquipmentTplnrFrom();
         EquipmentTplnrFrom query = new EquipmentTplnrFrom();
         query.setPageNum(pageNum);
         query.setPageNum(pageNum);
@@ -107,9 +108,9 @@ public class MaintainQueryController {
         Page pageParam = SmartPageUtil.convert2PageQuery(query);
         Page pageParam = SmartPageUtil.convert2PageQuery(query);
 
 
         List<AuditVo> auditList = auditService.GetAuditList(pageParam, personnelID, "", "1,2", status, eqCodeOrName,
         List<AuditVo> auditList = auditService.GetAuditList(pageParam, personnelID, "", "1,2", status, eqCodeOrName,
-                "0", pastureId, "1", "", "", startDate, endDate,"","");
+                "0", pastureId, "1", "", "", startDate, endDate,"","","",roleId);
         int count = auditService.GetAuditListCount(personnelID, "", "1,2", status, eqCodeOrName, "0",
         int count = auditService.GetAuditListCount(personnelID, "", "1,2", status, eqCodeOrName, "0",
-                pastureId, "1", "", "", startDate, endDate,"","");
+                pastureId, "1", "", "", startDate, endDate,"","","",roleId);
 
 
         for (AuditVo auditVo : auditList) {
         for (AuditVo auditVo : auditList) {
             auditVo.setSapCode(auditVo.getAUFNR());
             auditVo.setSapCode(auditVo.getAUFNR());
@@ -168,7 +169,7 @@ public class MaintainQueryController {
         req.put("Header", header);
         req.put("Header", header);
         JSONObject json = new JSONObject(req);
         JSONObject json = new JSONObject(req);
         System.out.println(json.toString());
         System.out.println(json.toString());
-        String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
+        String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
 
 
 
 
         ObjectMapper objectMapper = new ObjectMapper();
         ObjectMapper objectMapper = new ObjectMapper();
@@ -217,7 +218,7 @@ public class MaintainQueryController {
 //        P41 取消技术完成 - 撤销系统状态TECO
 //        P41 取消技术完成 - 撤销系统状态TECO
         String statusstr = "P10";
         String statusstr = "P10";
         if (from.getProcessed() == 1) {
         if (from.getProcessed() == 1) {
-            EquipmentAddResponse res = commonService.editSapBXPush(from.getWxCode(), from.getOutsource(), from.getIsOutsource(), from.getPrice_unit(), "");
+            EquipmentAddResponse res = commonService.editSapBXPush(from.getWxCode(), from.getOutsource(), from.getIsOutsource(), from.getPrice_unit(), "","");
             if (res != null) {
             if (res != null) {
                 ResponseDTO t;
                 ResponseDTO t;
                 t = ResponseDTO.ok();
                 t = ResponseDTO.ok();
@@ -247,7 +248,7 @@ public class MaintainQueryController {
                 }
                 }
             }
             }
 
 
-            EquipmentAddResponse res1 = commonService.editSapBXPush(from.getWxCode(), from.getOutsource(), from.getIsOutsource(), from.getPrice_unit(), "P20");
+            EquipmentAddResponse res1 = commonService.editSapBXPush(from.getWxCode(), from.getOutsource(), from.getIsOutsource(), from.getPrice_unit(), "P20","");
             if (res1 != null) {
             if (res1 != null) {
                 ResponseDTO t;
                 ResponseDTO t;
                 t = ResponseDTO.ok();
                 t = ResponseDTO.ok();
@@ -344,9 +345,9 @@ public class MaintainQueryController {
         Page pageParam = SmartPageUtil.convert2PageQuery(query);
         Page pageParam = SmartPageUtil.convert2PageQuery(query);
 
 
         List<AuditVo> auditList = auditService.GetAuditList(pageParam, "", "", "", status, eqCodeOrName,
         List<AuditVo> auditList = auditService.GetAuditList(pageParam, "", "", "", status, eqCodeOrName,
-                "0", pastureId, pick, "", "", startDate, endDate,"",priok);
+                "0", pastureId, pick, "", "", startDate, endDate,"",priok,"","");
         int count = auditService.GetAuditListCount( "", "", "", status, eqCodeOrName,
         int count = auditService.GetAuditListCount( "", "", "", status, eqCodeOrName,
-                "0", pastureId, pick, "", "", startDate, endDate,"",priok);
+                "0", pastureId, pick, "", "", startDate, endDate,"",priok,"","");
 
 
         for (AuditVo auditVo : auditList) {
         for (AuditVo auditVo : auditList) {
             auditVo.setSapCode(auditVo.getAUFNR());
             auditVo.setSapCode(auditVo.getAUFNR());
@@ -382,7 +383,7 @@ public class MaintainQueryController {
             req.put("Header", header);
             req.put("Header", header);
             JSONObject json = new JSONObject(req);
             JSONObject json = new JSONObject(req);
             System.out.println(json.toString());
             System.out.println(json.toString());
-            String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
+            String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
 
 
             System.out.println(responseStr);
             System.out.println(responseStr);
             ObjectMapper objectMapper = new ObjectMapper();
             ObjectMapper objectMapper = new ObjectMapper();
@@ -419,22 +420,22 @@ public class MaintainQueryController {
                             continue;
                             continue;
                         }
                         }
 //                    if (planType == 0) {
 //                    if (planType == 0) {
-                        String xjCode = commonService.autoCreatCode(String.valueOf(pasture.getId()), "WH");
-                        bigInspectionIn.setInspectionCode(xjCode);
-                        bigInspectionIn.setPlanType(1);
-                        addAuditFrom.setCode(xjCode);
+//                        String xjCode = commonService.autoCreatCode(String.valueOf(pasture.getId()), "WH");
+//                        bigInspectionIn.setInspectionCode(xjCode);
+//                        bigInspectionIn.setPlanType(1);
+//                        addAuditFrom.setCode(xjCode);
                         addAuditFrom.setAuditType(3);
                         addAuditFrom.setAuditType(3);
-                        if (eqInfo.getOneinspection() == null) {
-                            eqInfo.setOneinspection("");
+                        if (eqInfo.getOneupkeep() == null) {
+                            eqInfo.setOneupkeep("");
 
 
                         }
                         }
-                        if (eqInfo.getTwoinspection() == null) {
-                            eqInfo.setTwoinspection("");
+                        if (eqInfo.getTwoupkeep() == null) {
+                            eqInfo.setTwoupkeep("");
                         }
                         }
-                        if (eqInfo.getOneinspection().equals("") || eqInfo.getTwoinspection().equals("")) {
+                        if (eqInfo.getOneupkeep().equals("") || eqInfo.getTwoupkeep().equals("")) {
                             continue;
                             continue;
                         }
                         }
-                        bigInspectionIn.setUpkeepPerson(eqInfo.getOneinspection().toString() + "," + eqInfo.getTwoinspection().toString());
+                        bigInspectionIn.setUpkeepPerson(eqInfo.getOneupkeep().toString() + "," + eqInfo.getTwoupkeep().toString());
 
 
                         bigInspectionIn.setEqCode(maintainQueryVo.getEQUNR());
                         bigInspectionIn.setEqCode(maintainQueryVo.getEQUNR());
                         bigInspectionIn.setPlantime(maintainQueryVo.getERDAT());
                         bigInspectionIn.setPlantime(maintainQueryVo.getERDAT());
@@ -477,8 +478,20 @@ public class MaintainQueryController {
                                 }
                                 }
                             }
                             }
                         }
                         }
+                        String xjCode = commonService.autoCreatCode(String.valueOf(pasture.getId()), "WH");
+                        bigInspectionIn.setInspectionCode(xjCode);
+                        bigInspectionIn.setPlanType(1);
+                        addAuditFrom.setCode(xjCode);
                         addAuditFrom.setEqCode(bigInspectionIn.getEqCode());
                         addAuditFrom.setEqCode(bigInspectionIn.getEqCode());
                         inspectionService.addBigInspection(bigInspectionIn, addAuditFrom, inspectionFromList);
                         inspectionService.addBigInspection(bigInspectionIn, addAuditFrom, inspectionFromList);
+                        EquipmentAddResponse res1 = commonService.editSapBYPush(bigInspectionIn.getInspectionCode(), addAuditFrom.getSapCode(), "P10");
+                        if (res1 != null) {
+                            ResponseDTO res = ResponseDTO.ok();
+                            res = ResponseDTO.ok(false);
+                            res.setCode(500);
+                            res.setMsg(res1.getMsg());
+                            return res;
+                        }
                     }
                     }
                 }
                 }
             }
             }
@@ -488,11 +501,12 @@ public class MaintainQueryController {
         page.setPageSize(pageSize);
         page.setPageSize(pageSize);
         Page pageParam = SmartPageUtil.convert2PageQuery(page);
         Page pageParam = SmartPageUtil.convert2PageQuery(page);
 
 
-        List<BigInspectionVo> bigInspectionVoList = inspectionService.getBigInspectionList(pageParam, pastureId, planType, empId, status, startDate, endDate);
+        List<BigInspectionVo> bigInspectionVoList = inspectionService.getBigInspectionList(pageParam, pastureId, planType, empId, status,
+                startDate, endDate,"");
         for (BigInspectionVo bigInspectionVo : bigInspectionVoList) {
         for (BigInspectionVo bigInspectionVo : bigInspectionVoList) {
             bigInspectionVo.setResult("检测" + bigInspectionVo.getCount() + "项,合格" + bigInspectionVo.getCount() + "项");
             bigInspectionVo.setResult("检测" + bigInspectionVo.getCount() + "项,合格" + bigInspectionVo.getCount() + "项");
         }
         }
-        int count = inspectionService.getBigInspectionListCount(pastureId, planType, empId, status, startDate, endDate);
+        int count = inspectionService.getBigInspectionListCount(pastureId, planType, empId, status, startDate, endDate,"");
         ResponseDTO res = ResponseDTO.ok(bigInspectionVoList);
         ResponseDTO res = ResponseDTO.ok(bigInspectionVoList);
         res.setCount(count);
         res.setCount(count);
         res.setCode(200);
         res.setCode(200);

+ 3 - 3
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/maintain/controller/RecordController.java

@@ -60,9 +60,9 @@ public class RecordController {
         Page pageParam = SmartPageUtil.convert2PageQuery(query);
         Page pageParam = SmartPageUtil.convert2PageQuery(query);
 
 
         List<AuditVo> auditList = auditService.GetAuditList(pageParam, "", "", "", "1",
         List<AuditVo> auditList = auditService.GetAuditList(pageParam, "", "", "", "1",
-                eqCodeOrName, "0", pastureId, "1", "", "", startDate, endDate,"","");
+                eqCodeOrName, "0", pastureId, "1", "", "", startDate, endDate,"","","","");
         int count = auditService.GetAuditListCount("", "", "", "1", eqCodeOrName,
         int count = auditService.GetAuditListCount("", "", "", "1", eqCodeOrName,
-                "0", pastureId, "1", "", "", startDate, endDate,"","");
+                "0", pastureId, "1", "", "", startDate, endDate,"","","","");
 
 
         ResponseDTO<List<AuditVo>> t = ResponseDTO.ok(auditList);
         ResponseDTO<List<AuditVo>> t = ResponseDTO.ok(auditList);
         t.setCode(200);
         t.setCode(200);
@@ -114,7 +114,7 @@ public class RecordController {
         req.put("Header", header);
         req.put("Header", header);
         JSONObject json = new JSONObject(req);
         JSONObject json = new JSONObject(req);
         System.out.println(json.toString());
         System.out.println(json.toString());
-        String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/ORDERFNS", "application/json", json.toString());
+        String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/ORDERFNS", "application/json", json.toString());
         ObjectMapper objectMapper = new ObjectMapper();
         ObjectMapper objectMapper = new ObjectMapper();
         Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
         Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
 //        List<EquipmentRecordDetailsVo> respItem = (List<EquipmentRecordDetailsVo>) map.get("Item");
 //        List<EquipmentRecordDetailsVo> respItem = (List<EquipmentRecordDetailsVo>) map.get("Item");

+ 3 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/maintain/domain/vo/MaintainDetailsVo.java

@@ -112,5 +112,8 @@ public class MaintainDetailsVo {
     private String wxTime;//维修时间
     private String wxTime;//维修时间
     private String completionTime;
     private String completionTime;
     private String appgs;
     private String appgs;
+    private String processed;
+    private String pick;
+    private String pastureId;
 }
 }
 //e.CompanyCode,e.CostCenter
 //e.CompanyCode,e.CostCenter

+ 1 - 1
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/malfunction/controller/MalfunctionController.java

@@ -60,7 +60,7 @@ public class MalfunctionController {
         header.put("DEST_SYSTEM", "SAP");
         header.put("DEST_SYSTEM", "SAP");
         req.put("Header", header);
         req.put("Header", header);
         JSONObject json = new JSONObject(req);
         JSONObject json = new JSONObject(req);
-        String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/FKB", "application/json", json.toString());
+        String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/FKB", "application/json", json.toString());
 
 
         ObjectMapper objectMapper = new ObjectMapper();
         ObjectMapper objectMapper = new ObjectMapper();
         Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
         Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);

+ 2 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/partapply/dao/PartapplyDao.java

@@ -38,4 +38,6 @@ public interface PartapplyDao {
 
 
     void delBigPartapply(@Param("id") int id);
     void delBigPartapply(@Param("id") int id);
 
 
+        void editPartapplySapStauts(@Param("id") int id);
+
 }
 }

+ 3 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/partapply/domain/vo/PartapplyVo.java

@@ -33,4 +33,7 @@ public class PartapplyVo {
     private String empName;
     private String empName;
 //    库存地点
 //    库存地点
     private String lgort;
     private String lgort;
+    private int status ;
+    private int sapStatus;
+    private String pastureId;
 }
 }

+ 9 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/partapply/service/PartapplyService.java

@@ -143,5 +143,14 @@ public class PartapplyService {
         return true;
         return true;
     }
     }
 
 
+    public boolean EditPartapplySapStauts(int id) {
+        try {
+            partapplyDao.editPartapplySapStauts(id);
+        } catch (Exception e) {
+            return false;
+        }
+        return true;
+    }
+
 
 
 }
 }

+ 18 - 12
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/parts/controller/PartsController.java

@@ -43,7 +43,10 @@ public class PartsController {
     @GetMapping("/parts/list")
     @GetMapping("/parts/list")
     //@NoNeedLogin
     //@NoNeedLogin
     @ApiOperation("查看备件库存信息")
     @ApiOperation("查看备件库存信息")
-    public ResponseDTO<List<PartRepertoryVo>> getPartsList(@RequestParam int pageNum, @RequestParam int pageSize, @RequestParam(required = false, defaultValue = "") String werks, @RequestParam(required = false, defaultValue = "") String codeOrName, @RequestParam(required = false, defaultValue = "") String pastureId) throws Exception {
+    public ResponseDTO<List<PartRepertoryVo>> getPartsList(@RequestParam int pageNum, @RequestParam int pageSize,
+                                                           @RequestParam(required = false, defaultValue = "") String werks,
+                                                           @RequestParam(required = false, defaultValue = "") String codeOrName,
+                                                           @RequestParam(required = false, defaultValue = "") String pastureId) throws Exception {
         Map<String, Object> req = new HashMap();
         Map<String, Object> req = new HashMap();
         Map itemReq = new HashMap();
         Map itemReq = new HashMap();
         PastureVo pasture = commonService.getPastureById(Integer.parseInt(pastureId));
         PastureVo pasture = commonService.getPastureById(Integer.parseInt(pastureId));
@@ -60,7 +63,7 @@ public class PartsController {
         req.put("Header", header);
         req.put("Header", header);
         JSONObject json = new JSONObject(req);
         JSONObject json = new JSONObject(req);
         System.out.println(json.toString());
         System.out.println(json.toString());
-        String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/SPARESTOCK", "application/json", json.toString());
+        String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/SPARESTOCK", "application/json", json.toString());
 
 
         System.out.println(responseStr);
         System.out.println(responseStr);
         ObjectMapper objectMapper = new ObjectMapper();
         ObjectMapper objectMapper = new ObjectMapper();
@@ -80,6 +83,7 @@ public class PartsController {
         List<PartRepertoryVo> parts = new ArrayList<>();
         List<PartRepertoryVo> parts = new ArrayList<>();
         if (parseArray.size() > 0) {
         if (parseArray.size() > 0) {
             for (PartsInfoVo partsInfoVo : parseArray) {
             for (PartsInfoVo partsInfoVo : parseArray) {
+                if (partsInfoVo.getMATNR().indexOf(codeOrName) >= 0 || partsInfoVo.getITEM_RESERVED1().indexOf(codeOrName) >= 0) {
                     PartRepertoryVo from = new PartRepertoryVo();
                     PartRepertoryVo from = new PartRepertoryVo();
                     from.setPartName(partsInfoVo.getITEM_RESERVED1());
                     from.setPartName(partsInfoVo.getITEM_RESERVED1());
                     from.setPartCode(partsInfoVo.getMATNR());
                     from.setPartCode(partsInfoVo.getMATNR());
@@ -90,10 +94,11 @@ public class PartsController {
                     from.setPrice(partsInfoVo.getITEM_RESERVED2());
                     from.setPrice(partsInfoVo.getITEM_RESERVED2());
                     from.setPastureId(Integer.parseInt(pastureId));
                     from.setPastureId(Integer.parseInt(pastureId));
                     parts.add(from);
                     parts.add(from);
+                }
             }
             }
         }
         }
-        System.out.println(parts);
-        partsService.addParts(parts);
+//        System.out.println(parts);
+//        partsService.addParts(parts);
 
 
 //        int count = partList.size();
 //        int count = partList.size();
 //        partList = PostRequestUtil.Paginate(partList, pageSize, pageNum);
 //        partList = PostRequestUtil.Paginate(partList, pageSize, pageNum);
@@ -102,20 +107,21 @@ public class PartsController {
 //        }
 //        }
 
 
 
 
-        EquipmentTplnrFrom query = new EquipmentTplnrFrom();
-        query.setPageNum(pageNum);
-        query.setPageSize(pageSize);
-        Page pageParam = SmartPageUtil.convert2PageQuery(query);
-
-        List<PartRepertoryVo> partList = partsService.getPartsList(pageParam, codeOrName, pastureId, werks);
-        int count = partsService.getPartsListCount(codeOrName, pastureId, werks);
+//        EquipmentTplnrFrom query = new EquipmentTplnrFrom();
+//        query.setPageNum(pageNum);
+//        query.setPageSize(pageSize);
+//        Page pageParam = SmartPageUtil.convert2PageQuery(query);
 
 
+//        List<PartRepertoryVo> partList = partsService.getPartsList(pageParam, codeOrName, pastureId, werks);
+//        int count = partsService.getPartsListCount(codeOrName, pastureId, werks);
+        List<PartRepertoryVo> partList  = PostRequestUtil.Paginate(parts, pageSize, pageNum);
+        partsService.addParts(partList);
         ResponseDTO<List<PartRepertoryVo>> t;
         ResponseDTO<List<PartRepertoryVo>> t;
         t = ResponseDTO.ok(partList);
         t = ResponseDTO.ok(partList);
         t.setCode(200);
         t.setCode(200);
         t.setPageNum(pageNum);
         t.setPageNum(pageNum);
         t.setPageSize(pageSize);
         t.setPageSize(pageSize);
-        t.setCount(count);
+        t.setCount(parts.size());
         return t;
         return t;
     }
     }
 
 

+ 13 - 6
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/repair/controller/RepairController.java

@@ -99,7 +99,7 @@ public class RepairController {
             status = "0";
             status = "0";
         }
         }
 
 
-        List<RepirVo> auditList = repairService.GetRepairList(pageParam, personnelID, createUserId, processed.toString(), status, pick, pastureId, eqName);
+        List<RepirVo> auditList = repairService.GetRepairList(pageParam, personnelID, createUserId, processed, status, pick, pastureId, eqName);
         int auditCount = repairService.GetRepairListCount(personnelID, createUserId, processed, status, pick, pastureId, eqName);
         int auditCount = repairService.GetRepairListCount(personnelID, createUserId, processed, status, pick, pastureId, eqName);
 
 
         for (RepirVo audit : auditList) {
         for (RepirVo audit : auditList) {
@@ -221,7 +221,7 @@ public class RepairController {
 
 
         JSONObject json = new JSONObject(req);
         JSONObject json = new JSONObject(req);
         System.out.println(json.toString());
         System.out.println(json.toString());
-        String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/FNSCHG", "application/json", json.toString());
+        String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/FNSCHG", "application/json", json.toString());
         String QMNUM = "";
         String QMNUM = "";
         System.out.println(responseStr);
         System.out.println(responseStr);
         ObjectMapper objectMapper = new ObjectMapper();
         ObjectMapper objectMapper = new ObjectMapper();
@@ -270,7 +270,14 @@ public class RepairController {
         } else {
         } else {
             from.setMsaus("X");
             from.setMsaus("X");
         }
         }
-        String sapCode = auditService.getAuditSapCode(from.getQmnum());
+        AuditVo  auditInfo = auditService.getAudit(from.getQmnum());
+        if (auditInfo.getPick() == 1){
+            EquipmentAddResponse res = new EquipmentAddResponse();
+            res.setCode("500");
+            res.setMsg("该报修单已接单不可编辑!");
+            return res;
+        }
+        String sapCode = auditInfo.getSapCode();
 
 
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Date date = format.parse(from.getQmdat() + " " + from.getMzeit());
         Date date = format.parse(from.getQmdat() + " " + from.getMzeit());
@@ -305,7 +312,7 @@ public class RepairController {
         req.put("Item", itemList);
         req.put("Item", itemList);
         JSONObject json = new JSONObject(req);
         JSONObject json = new JSONObject(req);
         System.out.println(json.toString());
         System.out.println(json.toString());
-        String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/FNSCHG", "application/json", json.toString());
+        String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/FNSCHG", "application/json", json.toString());
         ObjectMapper objectMapper = new ObjectMapper();
         ObjectMapper objectMapper = new ObjectMapper();
         Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
         Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
         List<Map<String, Object>> respItem = (List<Map<String, Object>>) map.get("Item");
         List<Map<String, Object>> respItem = (List<Map<String, Object>>) map.get("Item");
@@ -325,7 +332,7 @@ public class RepairController {
         audit.setProcessed(1);
         audit.setProcessed(1);
         System.out.println(parnr);
         System.out.println(parnr);
         auditService.EditAuditPersonnel(audit);
         auditService.EditAuditPersonnel(audit);
-
+        auditService.editAuditDate(audit.getCode());
         repairService.EditRepair(from);
         repairService.EditRepair(from);
 
 
         EquipmentAddResponse res = new EquipmentAddResponse();
         EquipmentAddResponse res = new EquipmentAddResponse();
@@ -381,7 +388,7 @@ public class RepairController {
             return res;
             return res;
         }
         }
 
 
-        EquipmentAddResponse r1 = commonService.editSapBXPush(from.getQmnum(), "", 0, "", "P10");
+        EquipmentAddResponse r1 = commonService.editSapBXPush(from.getQmnum(), "", 0, "", "P10",empInfo.getLoginName());
         if (r != null) {
         if (r != null) {
             EquipmentAddResponse res = new EquipmentAddResponse();
             EquipmentAddResponse res = new EquipmentAddResponse();
             res.setCode("500");
             res.setCode("500");

+ 14 - 6
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/takestock/controller/TakestockController.java

@@ -35,8 +35,6 @@ import java.util.*;
 public class TakestockController {
 public class TakestockController {
     @Autowired
     @Autowired
     private CommonService commonService;
     private CommonService commonService;
-
-
     @Autowired
     @Autowired
     private TakestockService takestockService;
     private TakestockService takestockService;
 
 
@@ -71,8 +69,10 @@ public class TakestockController {
         TakeStockVo takeStock = takestockService.getTakeStock(from.getPdCode());
         TakeStockVo takeStock = takestockService.getTakeStock(from.getPdCode());
 
 
 //        EditTakeStockSapFrom sap = new EditTakeStockSapFrom();
 //        EditTakeStockSapFrom sap = new EditTakeStockSapFrom();
+//        if (from.get)
+        from.setZPDUT("X");
         Map<String, Object> req = new HashMap<>();
         Map<String, Object> req = new HashMap<>();
-
+System.out.println(takeStock);
         req.put("ZPDDH", takeStock.getSapCode());//盘点单号
         req.put("ZPDDH", takeStock.getSapCode());//盘点单号
         req.put("ZPDST", takeStock.getZPDST());//系统状态
         req.put("ZPDST", takeStock.getZPDST());//系统状态
         req.put("ZPDMN", takeStock.getZPDMN());//盘点年月
         req.put("ZPDMN", takeStock.getZPDMN());//盘点年月
@@ -105,7 +105,7 @@ public class TakestockController {
         req1.put("Header", header);
         req1.put("Header", header);
         JSONObject json = new JSONObject(req1);
         JSONObject json = new JSONObject(req1);
         System.out.println(json.toString());
         System.out.println(json.toString());
-        String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/CHECKUPDATE", "application/json", json.toString());
+        String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/CHECKUPDATE", "application/json", json.toString());
         ObjectMapper objectMapper = new ObjectMapper();
         ObjectMapper objectMapper = new ObjectMapper();
         Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
         Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
 //        List<EditTakeStockSap> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), EditTakeStockSap.class);
 //        List<EditTakeStockSap> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), EditTakeStockSap.class);
@@ -118,6 +118,8 @@ public class TakestockController {
                 res.setMsg(item.get("SYNRESULT").toString());
                 res.setMsg(item.get("SYNRESULT").toString());
                 res.setCode(500);
                 res.setCode(500);
                 return res;
                 return res;
+            }else {
+
             }
             }
         }
         }
 
 
@@ -134,12 +136,18 @@ public class TakestockController {
     @GetMapping("/authdata/takestock/list")
     @GetMapping("/authdata/takestock/list")
 //    @NoNeedLogin
 //    @NoNeedLogin
     @ApiOperation("查看盘点信息列表")
     @ApiOperation("查看盘点信息列表")
-    public ResponseDTO<List<TakeStockVo>> getTakeStockList(@RequestParam int pageNum, @RequestParam int pageSize, @RequestParam int pastureId, @RequestParam(required = false, defaultValue = "") String eqCodeOrName, @RequestParam int status, @RequestParam(required = false, defaultValue = "") String startDate, @RequestParam(required = false, defaultValue = "") String endDate) {
+    public ResponseDTO<List<TakeStockVo>> getTakeStockList(@RequestParam int pageNum, @RequestParam int pageSize,
+                                                           @RequestParam int pastureId,
+                                                           @RequestParam(required = false, defaultValue = "") String eqCodeOrName,
+                                                           @RequestParam int status,
+                                                           @RequestParam(required = false, defaultValue = "") String startDate,
+                                                           @RequestParam(required = false, defaultValue = "") String endDate) {
         EquipmentQueryFrom page = new EquipmentQueryFrom();
         EquipmentQueryFrom page = new EquipmentQueryFrom();
         page.setPageNum(pageNum);
         page.setPageNum(pageNum);
         page.setPageSize(pageSize);
         page.setPageSize(pageSize);
         Page pageParam = SmartPageUtil.convert2PageQuery(page);
         Page pageParam = SmartPageUtil.convert2PageQuery(page);
-        List<TakeStockVo> takeStockList = takestockService.getTakeStockList(pageParam, pastureId, eqCodeOrName, status, startDate, endDate);
+        List<TakeStockVo> takeStockList = takestockService.getTakeStockList(pageParam, pastureId, eqCodeOrName,
+                status, startDate, endDate);
         int count = takestockService.getTakeStockListCount(pastureId, eqCodeOrName, status, startDate, endDate);
         int count = takestockService.getTakeStockListCount(pastureId, eqCodeOrName, status, startDate, endDate);
 
 
         ResponseDTO res = ResponseDTO.ok(takeStockList);
         ResponseDTO res = ResponseDTO.ok(takeStockList);

+ 0 - 1
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/gm/takestock/domain/vo/TakeStockVo.java

@@ -26,7 +26,6 @@ public class TakeStockVo {
     private String INBDT;// 技术对象的开始日期 inbdt
     private String INBDT;// 技术对象的开始日期 inbdt
     private String ANLNR;// 主资产号 anlnr
     private String ANLNR;// 主资产号 anlnr
     private String ANLUN;// 资产子编号 anlun
     private String ANLUN;// 资产子编号 anlun
-
     private String ZPDUT;// 盘点状态 盘点状态(X-已盘点,空-未盘点) zpdut
     private String ZPDUT;// 盘点状态 盘点状态(X-已盘点,空-未盘点) zpdut
     private String eqClassName;// 设备类别
     private String eqClassName;// 设备类别
     private String note;// 盘点原因
     private String note;// 盘点原因

+ 26 - 4
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/controller/EmployeeController.java

@@ -115,12 +115,16 @@ public class EmployeeController extends AdminBaseController {
     public ResponseDTO<List<EmployeeVO>> queryAllEmployee(@RequestParam int pageNum, @RequestParam int pageSize,
     public ResponseDTO<List<EmployeeVO>> queryAllEmployee(@RequestParam int pageNum, @RequestParam int pageSize,
                                                           @RequestParam(value = "disabledFlag", required = false) Boolean disabledFlag,
                                                           @RequestParam(value = "disabledFlag", required = false) Boolean disabledFlag,
                                                           @RequestParam String nameOrLoginName, @RequestParam(required = false, defaultValue = "") String departmentId,
                                                           @RequestParam String nameOrLoginName, @RequestParam(required = false, defaultValue = "") String departmentId,
-                                                          @RequestParam(required = false, defaultValue = "") String name, @RequestParam(required = false, defaultValue = "") String pastureId) {
+                                                          @RequestParam(required = false, defaultValue = "") String name,
+                                                          @RequestParam(required = false, defaultValue = "") String pastureId,
+                                                          @RequestParam(required = false, defaultValue = "") String roleId) {
         EquipmentTplnrFrom query = new EquipmentTplnrFrom();
         EquipmentTplnrFrom query = new EquipmentTplnrFrom();
         query.setPageNum(pageNum);
         query.setPageNum(pageNum);
         query.setPageSize(pageSize);
         query.setPageSize(pageSize);
-        ResponseDTO<List<EmployeeVO>> empList = employeeService.queryAllEmployee(query, disabledFlag, nameOrLoginName, departmentId, name, pastureId, pageNum, pageSize, "","","");
-        int count = employeeService.selectEmployeeByDisabledAndDeletedCount(disabledFlag, nameOrLoginName, departmentId, name, pastureId, "","","");
+        ResponseDTO<List<EmployeeVO>> empList = employeeService.queryAllEmployee(query, disabledFlag, nameOrLoginName, departmentId, name,
+                pastureId, pageNum, pageSize, "","","",roleId);
+        int count = employeeService.selectEmployeeByDisabledAndDeletedCount(disabledFlag, nameOrLoginName, departmentId, name,
+                pastureId, "","","",roleId);
         empList.setCode(200);
         empList.setCode(200);
         empList.setPageNum(pageNum);
         empList.setPageNum(pageNum);
         empList.setPageSize(pageSize);
         empList.setPageSize(pageSize);
@@ -134,7 +138,6 @@ public class EmployeeController extends AdminBaseController {
     @PostMapping("/sap/employee/add")
     @PostMapping("/sap/employee/add")
     public ResponseDTO addEmployee(@Valid @RequestBody Map<String, Object> from) throws JsonProcessingException {
     public ResponseDTO addEmployee(@Valid @RequestBody Map<String, Object> from) throws JsonProcessingException {
 
 
-        System.out.println(from.get("Item"));
         List<EmployeeAddSapFrom> parseArray = JSON.parseArray(JSON.toJSONString(from.get("Item")), EmployeeAddSapFrom.class);
         List<EmployeeAddSapFrom> parseArray = JSON.parseArray(JSON.toJSONString(from.get("Item")), EmployeeAddSapFrom.class);
         System.out.println(parseArray);
         System.out.println(parseArray);
 
 
@@ -198,5 +201,24 @@ public class EmployeeController extends AdminBaseController {
         }
         }
         return t;
         return t;
     }
     }
+
+    @ApiOperation("修改用户牧场信息")
+    //@NoNeedLogin
+    @PostMapping("/employee/edit/pasture")
+    public ResponseDTO editEmployeePasture(@RequestBody editEmployeePastureFrom from) {
+
+        boolean m = employeeService.editEmployeePasture(from);
+        ResponseDTO t = ResponseDTO.ok();
+        if (m) {
+            t.setCode(200);
+            t.setMsg("修改成功!");
+            t.setMsg("S");
+        } else {
+            t.setCode(500);
+            t.setMsg("修改失败!");
+            t.setMsg("E");
+        }
+        return t;
+    }
 }
 }
 
 

+ 6 - 2
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/dao/EmployeeDao.java

@@ -6,6 +6,7 @@ import net.lab1024.sa.admin.module.gm.eq.domain.from.EquipmentTplnrFrom;
 import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity;
 import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity;
 import net.lab1024.sa.admin.module.system.employee.domain.form.EmployeeAddSapFrom;
 import net.lab1024.sa.admin.module.system.employee.domain.form.EmployeeAddSapFrom;
 import net.lab1024.sa.admin.module.system.employee.domain.form.EmployeeQueryForm;
 import net.lab1024.sa.admin.module.system.employee.domain.form.EmployeeQueryForm;
+import net.lab1024.sa.admin.module.system.employee.domain.form.editEmployeePastureFrom;
 import net.lab1024.sa.admin.module.system.employee.domain.form.editEmployeePhoneFrom;
 import net.lab1024.sa.admin.module.system.employee.domain.form.editEmployeePhoneFrom;
 import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO;
 import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
@@ -44,12 +45,13 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
                                                         @Param("departmentId") String departmentId, @Param("name") String name, @Param("pastureId") String pastureId,
                                                         @Param("departmentId") String departmentId, @Param("name") String name, @Param("pastureId") String pastureId,
                                                         @Param("pageNum") int pageNum, @Param("pageSize")  int pageSize,
                                                         @Param("pageNum") int pageNum, @Param("pageSize")  int pageSize,
                                                         @Param("pastureName") String pastureName,
                                                         @Param("pastureName") String pastureName,
-            @Param("loginName") String  loginName,@Param("roleId") String  roleId);
+            @Param("loginName") String  loginName,@Param("roleId") String  roleId,@Param("roleId1") String  roleId1);
 
 
     int selectEmployeeByDisabledAndDeletedCount(@Param("disabledFlag") Boolean disabledFlag,
     int selectEmployeeByDisabledAndDeletedCount(@Param("disabledFlag") Boolean disabledFlag,
                                                 @Param("deletedFlag") Boolean deletedFlag, @Param("nameOrLoginName") String nameOrLoginName,
                                                 @Param("deletedFlag") Boolean deletedFlag, @Param("nameOrLoginName") String nameOrLoginName,
                                                 @Param("departmentId") String departmentId, @Param("name") String name, @Param("pastureId") String pastureId,
                                                 @Param("departmentId") String departmentId, @Param("name") String name, @Param("pastureId") String pastureId,
-                                                @Param("pastureName") String pastureName,@Param("loginName") String  loginName,@Param("roleId") String  roleId);
+                                                @Param("pastureName") String pastureName,@Param("loginName") String  loginName,
+                                                @Param("roleId") String  roleId,@Param("roleId1") String  roleId1);
 
 
     /**
     /**
      * 更新单个
      * 更新单个
@@ -194,5 +196,7 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
 
 
     EmployeeEntity getEmpById(@Param("empid") int empid);
     EmployeeEntity getEmpById(@Param("empid") int empid);
 
 
+    void editEmployeePasture(@Param("from") editEmployeePastureFrom from);
+
 
 
 }
 }

+ 10 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/form/editEmployeePastureFrom.java

@@ -0,0 +1,10 @@
+package net.lab1024.sa.admin.module.system.employee.domain.form;
+
+
+import lombok.Data;
+
+@Data
+public class editEmployeePastureFrom {
+    private String pastureId;
+    private String empId;
+}

+ 3 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/domain/vo/EmployeeVO.java

@@ -68,4 +68,7 @@ public class EmployeeVO {
     private String loginPwd;
     private String loginPwd;
     //序号
     //序号
     private int number;
     private int number;
+    private String lrzx;
+    private int pastureId;
+
 }
 }

+ 20 - 9
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/employee/service/EmployeeService.java

@@ -376,19 +376,19 @@ public class EmployeeService {
      */
      */
     public ResponseDTO<List<EmployeeVO>> queryAllEmployee(EquipmentTplnrFrom query, Boolean disabledFlag, String nameOrLoginName,
     public ResponseDTO<List<EmployeeVO>> queryAllEmployee(EquipmentTplnrFrom query, Boolean disabledFlag, String nameOrLoginName,
                                                           String departmentId,String name,String pastureId,int pageNum,
                                                           String departmentId,String name,String pastureId,int pageNum,
-                                                          int pageSize,String pastureName,String loginName,String roleId) {
+                                                          int pageSize,String pastureName,String loginName,String roleId,String roleId1) {
         Page pageParam = SmartPageUtil.convert2PageQuery(query);
         Page pageParam = SmartPageUtil.convert2PageQuery(query);
         List<EmployeeVO> employeeList = employeeDao.selectEmployeeByDisabledAndDeleted(pageParam, disabledFlag, Boolean.FALSE,
         List<EmployeeVO> employeeList = employeeDao.selectEmployeeByDisabledAndDeleted(pageParam, disabledFlag, Boolean.FALSE,
-                nameOrLoginName,departmentId,name,pastureId,pageNum,pageSize,pastureName,loginName,roleId);
+                nameOrLoginName,departmentId,name,pastureId,pageNum,pageSize,pastureName,loginName,roleId,roleId1);
         System.out.println(employeeList);
         System.out.println(employeeList);
         return ResponseDTO.ok(employeeList);
         return ResponseDTO.ok(employeeList);
     }
     }
 
 
 
 
     public int selectEmployeeByDisabledAndDeletedCount( Boolean disabledFlag, String nameOrLoginName,String departmentId,
     public int selectEmployeeByDisabledAndDeletedCount( Boolean disabledFlag, String nameOrLoginName,String departmentId,
-                                                        String name,String pastureId,String pastureName,String loginName,String roleId) {
+                                                        String name,String pastureId,String pastureName,String loginName,String roleId,String roleId1) {
         int count = employeeDao.selectEmployeeByDisabledAndDeletedCount( disabledFlag, Boolean.FALSE, nameOrLoginName,
         int count = employeeDao.selectEmployeeByDisabledAndDeletedCount( disabledFlag, Boolean.FALSE, nameOrLoginName,
-                departmentId,name,pastureId,pastureName,loginName,roleId);
+                departmentId,name,pastureId,pastureName,loginName,roleId, roleId1);
         return count;
         return count;
     }
     }
 
 
@@ -409,14 +409,14 @@ public class EmployeeService {
 
 
 
 
     public boolean  addSapEmployee(List<EmployeeAddSapFrom> empList) {
     public boolean  addSapEmployee(List<EmployeeAddSapFrom> empList) {
-        try {
+//        try {
             for (EmployeeAddSapFrom emp : empList) {
             for (EmployeeAddSapFrom emp : empList) {
                 employeeDao.addSapEmployee(emp);
                 employeeDao.addSapEmployee(emp);
             }
             }
-        } catch (Exception e) {
-            System.out.println(e.getMessage());
-            return false;
-        }
+//        } catch (Exception e) {
+//            System.out.println(e.getMessage());
+//            return false;
+//        }
         return true;
         return true;
     }
     }
 
 
@@ -447,4 +447,15 @@ public class EmployeeService {
     public EmployeeEntity getEmpById(int empId) {
     public EmployeeEntity getEmpById(int empId) {
      return    employeeDao.getEmpById(empId);
      return    employeeDao.getEmpById(empId);
     }
     }
+
+    public boolean  editEmployeePasture(editEmployeePastureFrom from) {
+        try {
+            employeeDao.editEmployeePasture(from);
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+            return false;
+        }
+        return true;
+    }
+
 }
 }

+ 2 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/controller/LoginController.java

@@ -1,6 +1,7 @@
 package net.lab1024.sa.admin.module.system.login.controller;
 package net.lab1024.sa.admin.module.system.login.controller;
 
 
 import cn.hutool.extra.servlet.ServletUtil;
 import cn.hutool.extra.servlet.ServletUtil;
+import com.alibaba.fastjson.JSON;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
 import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
@@ -13,6 +14,7 @@ import net.lab1024.sa.common.common.constant.RequestHeaderConst;
 import net.lab1024.sa.common.common.domain.ResponseDTO;
 import net.lab1024.sa.common.common.domain.ResponseDTO;
 import net.lab1024.sa.common.common.util.SmartRequestUtil;
 import net.lab1024.sa.common.common.util.SmartRequestUtil;
 import net.lab1024.sa.common.module.support.captcha.domain.CaptchaVO;
 import net.lab1024.sa.common.module.support.captcha.domain.CaptchaVO;
+import net.lab1024.sa.common.module.support.redis.RedisService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.security.core.context.SecurityContextHolder;

+ 1 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/domain/LoginEmployeeDetail.java

@@ -88,6 +88,7 @@ public class LoginEmployeeDetail implements UserDetails, RequestUser {
 
 
     @ApiModelProperty("牧场编码")
     @ApiModelProperty("牧场编码")
     private String pastureNumber;
     private String pastureNumber;
+    private int datarole;
 
 
     private  List<RoleSelectedVO>  roleSelectedVO;
     private  List<RoleSelectedVO>  roleSelectedVO;
     /**
     /**

+ 37 - 4
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java

@@ -28,6 +28,7 @@ import net.lab1024.sa.common.module.support.loginlog.LoginLogResultEnum;
 import net.lab1024.sa.common.module.support.loginlog.LoginLogService;
 import net.lab1024.sa.common.module.support.loginlog.LoginLogService;
 import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogEntity;
 import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogEntity;
 import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogVO;
 import net.lab1024.sa.common.module.support.loginlog.domain.LoginLogVO;
+import net.lab1024.sa.common.module.support.redis.RedisService;
 import net.lab1024.sa.common.module.support.token.LoginDeviceEnum;
 import net.lab1024.sa.common.module.support.token.LoginDeviceEnum;
 import net.lab1024.sa.common.module.support.token.TokenService;
 import net.lab1024.sa.common.module.support.token.TokenService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -75,6 +76,9 @@ public class LoginService {
     @Autowired
     @Autowired
     private RoleEmployeeService roleEmployeeService;
     private RoleEmployeeService roleEmployeeService;
 
 
+    @Autowired
+    private RedisService redisService;
+
     /**
     /**
      * 登录信息二级缓存
      * 登录信息二级缓存
      */
      */
@@ -96,7 +100,6 @@ public class LoginService {
      * @return 返回用户登录信息
      * @return 返回用户登录信息
      */
      */
     public ResponseDTO<LoginEmployeeDetail> login(LoginForm loginForm, String ip, String userAgent) {
     public ResponseDTO<LoginEmployeeDetail> login(LoginForm loginForm, String ip, String userAgent) {
-//        loginForm.setLoginDevice(1);
         LoginDeviceEnum loginDeviceEnum = SmartEnumUtil.getEnumByValue(loginForm.getLoginDevice(), LoginDeviceEnum.class);
         LoginDeviceEnum loginDeviceEnum = SmartEnumUtil.getEnumByValue(loginForm.getLoginDevice(), LoginDeviceEnum.class);
         if (loginDeviceEnum == null) {
         if (loginDeviceEnum == null) {
             return ResponseDTO.userErrorParam("登录设备暂不支持!");
             return ResponseDTO.userErrorParam("登录设备暂不支持!");
@@ -106,13 +109,25 @@ public class LoginService {
         if (!checkCaptcha.getOk()) {
         if (!checkCaptcha.getOk()) {
             return ResponseDTO.error(checkCaptcha);
             return ResponseDTO.error(checkCaptcha);
         }*/
         }*/
+        if (redisService.get(loginForm.getLoginName()+"_count") != null){
+            int count = Integer.parseInt(redisService.get(loginForm.getLoginName()+"_count"));
+            if (count > 5){
+                return ResponseDTO.userErrorParam("登录失败5次,五分钟后再试!");
+            }
+        }
 
 
         /**
         /**
          * 验证账号和账号状态
          * 验证账号和账号状态
          */
          */
         EmployeeEntity employeeEntity = employeeService.getByLoginName(loginForm.getLoginName());
         EmployeeEntity employeeEntity = employeeService.getByLoginName(loginForm.getLoginName());
         if (null == employeeEntity) {
         if (null == employeeEntity) {
-            return ResponseDTO.userErrorParam("登录名不存在!");
+            if (redisService.get(loginForm.getLoginName()+"_count") == null){
+                redisService.set(loginForm.getLoginName()+"_count",1,300);
+            }else{
+                int count = Integer.parseInt(redisService.get(loginForm.getLoginName()+"_count"));
+                redisService.set(loginForm.getLoginName()+"_count",count+1,300);
+            }
+            return ResponseDTO.userErrorParam("登录名或密码错误!");
         }
         }
 
 
         if (employeeEntity.getDisabledFlag()) {
         if (employeeEntity.getDisabledFlag()) {
@@ -125,9 +140,17 @@ public class LoginService {
          * 2、真实密码
          * 2、真实密码
          */
          */
         String superPassword = EmployeeService.getEncryptPwd(configService.getConfigValue(ConfigKeyEnum.SUPER_PASSWORD));
         String superPassword = EmployeeService.getEncryptPwd(configService.getConfigValue(ConfigKeyEnum.SUPER_PASSWORD));
-        String requestPassword = EmployeeService.getEncryptPwd(loginForm.getPassword());
+        String requestPassword = loginForm.getPassword();
+        System.out.println(requestPassword);
+        System.out.println(loginForm.getPassword());
         if (!(superPassword.equals(requestPassword) || employeeEntity.getLoginPwd().equals(requestPassword))) {
         if (!(superPassword.equals(requestPassword) || employeeEntity.getLoginPwd().equals(requestPassword))) {
             saveLoginLog(employeeEntity, ip, userAgent, "密码错误", LoginLogResultEnum.LOGIN_FAIL);
             saveLoginLog(employeeEntity, ip, userAgent, "密码错误", LoginLogResultEnum.LOGIN_FAIL);
+            if (redisService.get(loginForm.getLoginName()+"_count") == null){
+                redisService.set(loginForm.getLoginName()+"_count",1,300);
+            }else{
+                int count = Integer.parseInt(redisService.get(loginForm.getLoginName()+"_count"));
+                redisService.set(loginForm.getLoginName()+"_count",count+1,300);
+            }
             return ResponseDTO.userErrorParam("登录名或密码错误!");
             return ResponseDTO.userErrorParam("登录名或密码错误!");
         }
         }
 
 
@@ -142,10 +165,20 @@ public class LoginService {
 //        loginEmployeeDetail.setPastureId(1);
 //        loginEmployeeDetail.setPastureId(1);
         // 放入缓存
         // 放入缓存
         loginUserDetailCache.put(employeeEntity.getEmployeeId(), loginEmployeeDetail);
         loginUserDetailCache.put(employeeEntity.getEmployeeId(), loginEmployeeDetail);
-        List<RoleSelectedVO>  roleUserl = roleEmployeeService.getRoleInfoListByEmployeeId(employeeEntity.getEmployeeId());
+        List<RoleSelectedVO> roleUserl = roleEmployeeService.getRoleInfoListByEmployeeId(employeeEntity.getEmployeeId());
         loginEmployeeDetail.setRoleSelectedVO(roleUserl);
         loginEmployeeDetail.setRoleSelectedVO(roleUserl);
         //保存登录记录
         //保存登录记录
         saveLoginLog(employeeEntity, ip, userAgent, superPasswordFlag ? "万能密码登录" : loginDeviceEnum.getDesc(), LoginLogResultEnum.LOGIN_SUCCESS);
         saveLoginLog(employeeEntity, ip, userAgent, superPasswordFlag ? "万能密码登录" : loginDeviceEnum.getDesc(), LoginLogResultEnum.LOGIN_SUCCESS);
+        loginEmployeeDetail.setDatarole(0);
+        for (RoleSelectedVO roleSelectedVO : loginEmployeeDetail.getRoleSelectedVO()) {
+            if (roleSelectedVO.getSelected() && roleSelectedVO.getDatarole() > 0) {
+                loginEmployeeDetail.setDatarole(1);
+                break;
+            }
+        }
+        if (redisService.get(loginForm.getLoginName()+"_count") != null){
+            redisService.delete(loginForm.getLoginName()+"_count");
+        }
         ResponseDTO t = ResponseDTO.ok(loginEmployeeDetail);
         ResponseDTO t = ResponseDTO.ok(loginEmployeeDetail);
         t.setCode(200);
         t.setCode(200);
         return t;
         return t;

+ 199 - 8
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/menu/controller/MenuController.java

@@ -1,9 +1,18 @@
 package net.lab1024.sa.admin.module.system.menu.controller;
 package net.lab1024.sa.admin.module.system.menu.controller;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import net.lab1024.sa.admin.common.AdminBaseController;
 import net.lab1024.sa.admin.common.AdminBaseController;
 import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
 import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
+import net.lab1024.sa.admin.module.gm.audit.domain.vo.AuditVo;
+import net.lab1024.sa.admin.module.gm.audit.service.AuditService;
+import net.lab1024.sa.admin.module.gm.common.service.CommonService;
+import net.lab1024.sa.admin.module.gm.eq.domain.from.EquipmentQueryFrom;
+import net.lab1024.sa.admin.module.gm.inspection.service.InspectionService;
+import net.lab1024.sa.admin.module.gm.maintain.service.MaintainService;
+import net.lab1024.sa.admin.module.gm.repair.service.RepairService;
+import net.lab1024.sa.admin.module.gm.takestock.service.TakestockService;
 import net.lab1024.sa.admin.module.system.menu.domain.form.MenuAddForm;
 import net.lab1024.sa.admin.module.system.menu.domain.form.MenuAddForm;
 import net.lab1024.sa.admin.module.system.menu.domain.form.MenuUpdateForm;
 import net.lab1024.sa.admin.module.system.menu.domain.form.MenuUpdateForm;
 import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuTreeVO;
 import net.lab1024.sa.admin.module.system.menu.domain.vo.MenuTreeVO;
@@ -12,6 +21,7 @@ import net.lab1024.sa.admin.module.system.menu.service.MenuService;
 import net.lab1024.sa.common.common.annoation.NoNeedLogin;
 import net.lab1024.sa.common.common.annoation.NoNeedLogin;
 import net.lab1024.sa.common.common.domain.RequestUrlVO;
 import net.lab1024.sa.common.common.domain.RequestUrlVO;
 import net.lab1024.sa.common.common.domain.ResponseDTO;
 import net.lab1024.sa.common.common.domain.ResponseDTO;
+import net.lab1024.sa.common.common.util.SmartPageUtil;
 import net.lab1024.sa.common.common.util.SmartRequestUtil;
 import net.lab1024.sa.common.common.util.SmartRequestUtil;
 import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog;
 import net.lab1024.sa.common.module.support.operatelog.annoation.OperateLog;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,7 +29,10 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.validation.Valid;
 import javax.validation.Valid;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 
 /**
 /**
  * 菜单
  * 菜单
@@ -37,6 +50,17 @@ public class MenuController extends AdminBaseController {
 
 
     @Autowired
     @Autowired
     private MenuService menuService;
     private MenuService menuService;
+    @Autowired
+    private TakestockService takestockService;
+    @Autowired
+    private RepairService repairService;
+    @Autowired
+    private InspectionService inspectionService;
+    @Autowired
+    private AuditService auditService;
+    @Autowired
+    private CommonService commonService;
+
 
 
     @ApiOperation(value = "添加菜单 @author 卓大")
     @ApiOperation(value = "添加菜单 @author 卓大")
     //@NoNeedLogin
     //@NoNeedLogin
@@ -44,7 +68,7 @@ public class MenuController extends AdminBaseController {
     @PreAuthorize("@saAuth.checkPermission('system:menu:add')")
     @PreAuthorize("@saAuth.checkPermission('system:menu:add')")
     public ResponseDTO<String> addMenu(@RequestBody @Valid MenuAddForm menuAddForm) {
     public ResponseDTO<String> addMenu(@RequestBody @Valid MenuAddForm menuAddForm) {
         menuAddForm.setCreateUserId(SmartRequestUtil.getRequestUserId());
         menuAddForm.setCreateUserId(SmartRequestUtil.getRequestUserId());
-        ResponseDTO<String> res =  menuService.addMenu(menuAddForm);
+        ResponseDTO<String> res = menuService.addMenu(menuAddForm);
         res.setCode(200);
         res.setCode(200);
         return res;
         return res;
     }
     }
@@ -55,7 +79,7 @@ public class MenuController extends AdminBaseController {
     @PreAuthorize("@saAuth.checkPermission('system:menu:update')")
     @PreAuthorize("@saAuth.checkPermission('system:menu:update')")
     public ResponseDTO<String> updateMenu(@RequestBody @Valid MenuUpdateForm menuUpdateForm) {
     public ResponseDTO<String> updateMenu(@RequestBody @Valid MenuUpdateForm menuUpdateForm) {
         menuUpdateForm.setUpdateUserId(SmartRequestUtil.getRequestUserId());
         menuUpdateForm.setUpdateUserId(SmartRequestUtil.getRequestUserId());
-        ResponseDTO<String>  res =menuService.updateMenu(menuUpdateForm);
+        ResponseDTO<String> res = menuService.updateMenu(menuUpdateForm);
         res.setCode(200);
         res.setCode(200);
         return res;
         return res;
     }
     }
@@ -65,7 +89,7 @@ public class MenuController extends AdminBaseController {
     @GetMapping("/menu/batchDelete")
     @GetMapping("/menu/batchDelete")
     @PreAuthorize("@saAuth.checkPermission('system:menu:delete,system:menu:batch:delete')")
     @PreAuthorize("@saAuth.checkPermission('system:menu:delete,system:menu:batch:delete')")
     public ResponseDTO<String> batchDeleteMenu(@RequestParam("menuIdList") List<Long> menuIdList) {
     public ResponseDTO<String> batchDeleteMenu(@RequestParam("menuIdList") List<Long> menuIdList) {
-        ResponseDTO<String> res= menuService.batchDeleteMenu(menuIdList, SmartRequestUtil.getRequestUserId());
+        ResponseDTO<String> res = menuService.batchDeleteMenu(menuIdList, SmartRequestUtil.getRequestUserId());
         res.setCode(200);
         res.setCode(200);
         return res;
         return res;
     }
     }
@@ -83,7 +107,7 @@ public class MenuController extends AdminBaseController {
     //@NoNeedLogin
     //@NoNeedLogin
     @GetMapping("/menu/detail/{menuId}")
     @GetMapping("/menu/detail/{menuId}")
     public ResponseDTO<MenuVO> getMenuDetail(@PathVariable Long menuId) {
     public ResponseDTO<MenuVO> getMenuDetail(@PathVariable Long menuId) {
-        ResponseDTO<MenuVO> res =   menuService.getMenuDetail(menuId);
+        ResponseDTO<MenuVO> res = menuService.getMenuDetail(menuId);
         res.setCode(200);
         res.setCode(200);
         return res;
         return res;
     }
     }
@@ -91,8 +115,8 @@ public class MenuController extends AdminBaseController {
     @ApiOperation(value = "查询菜单树 @author 卓大")
     @ApiOperation(value = "查询菜单树 @author 卓大")
     //@NoNeedLogin
     //@NoNeedLogin
     @GetMapping("/menu/tree")
     @GetMapping("/menu/tree")
-    public ResponseDTO<List<MenuTreeVO>> queryMenuTree(@RequestParam("onlyMenu") Boolean onlyMenu,@RequestParam(required = false, defaultValue = "") String isPc) {
-        ResponseDTO<List<MenuTreeVO>> res  =  menuService.queryMenuTree(onlyMenu,isPc);
+    public ResponseDTO<List<MenuTreeVO>> queryMenuTree(@RequestParam("onlyMenu") Boolean onlyMenu, @RequestParam(required = false, defaultValue = "") String isPc) {
+        ResponseDTO<List<MenuTreeVO>> res = menuService.queryMenuTree(onlyMenu, isPc);
         res.setCode(200);
         res.setCode(200);
         return res;
         return res;
     }
     }
@@ -105,10 +129,177 @@ public class MenuController extends AdminBaseController {
     }
     }
 
 
     @ApiOperation(value = "通过用户empid获取菜单")
     @ApiOperation(value = "通过用户empid获取菜单")
-    //@NoNeedLogin
     @GetMapping("/menu/emp")
     @GetMapping("/menu/emp")
-    public ResponseDTO<List<MenuVO>> getMenuEmp(@RequestParam("empId") int empId) {
+    public ResponseDTO<List<MenuVO>> getMenuEmp(@RequestParam("empId") int empId, @RequestParam(required = false, defaultValue = "") String pastureId, @RequestParam(required = false, defaultValue = "") String roleName) throws Exception {
+        List<MenuVO> menuList = menuService.getMenuEmp(empId);
+//
+//        for (MenuVO menuVO : menuList) {
+//            if (menuVO.getMenuName().equals("盘点")) {
+//                int count = takestockService.getTakeStockListCount(Integer.parseInt(pastureId), "", 0, "", "");
+//                menuVO.setAmount(count);
+//            } else if (menuVO.getMenuName().equals("维修接单")) {
+//                int auditCount = repairService.GetRepairListCount(String.valueOf(empId), "", "1", "", "0", pastureId, "");
+//                menuVO.setAmount(auditCount);
+//            } else if (menuVO.getMenuName().equals("派单")) {
+//                int auditCount = repairService.GetRepairListCount("", "", "1", "", "0", pastureId, "");
+//                menuVO.setAmount(auditCount);
+//            } else if (menuVO.getMenuName().equals("维修")) {
+//                int count = auditService.GetAuditListCount(String.valueOf(empId), "", "1,2", "0", "", "0", Integer.parseInt(pastureId), "1", "",
+//                        "", "", "", "", "", "","");
+//                menuVO.setAmount(count);
+//            } else if (menuVO.getMenuName().equals("预防性维护")) {
+////                ResponseDTO resp = commonService.SyncBigInspection(Integer.parseInt(pastureId));
+////                if (resp != null) {
+////                    ResponseDTO res = ResponseDTO.ok(menuList);
+////                    res.setCode(200);
+////                    res.setMsg(resp.getMsg());
+////                    return res;
+////                }
+//                int count = inspectionService.getBigInspectionListCount(Integer.parseInt(pastureId), 1, String.valueOf(empId), 0,
+//                        "", "","");
+//                menuVO.setAmount(count);
+//            } else if (menuVO.getMenuName().equals("审核模块")) {
+//                List<String> auditTypeList = new ArrayList<>();
+//                List<MenuVO> menuList1 = menuService.getMenuEmp(empId);
+//                for (MenuVO menuVO1 : menuList1) {
+//                    if (menuVO1.getMenuId() == 223) {
+//                        auditTypeList.add("1");
+//                    } else if (menuVO1.getMenuId() == 224) {
+//                        auditTypeList.add("3");
+//                    } else {
+//                        auditTypeList.add("0");
+//                    }
+//                }
+//                String authAuditType = String.join(",", auditTypeList);
+//                int wxCount = auditService.GetAuditListCount("", "", "2", "0", "",
+//                        "0", Integer.parseInt(pastureId), "", "", "", "", "", authAuditType,
+//                        "", String.valueOf(empId),"");
+//                int whCount = auditService.GetAuditListCount("", "", "2", "0",
+//                        "", "3", Integer.parseInt(pastureId), "", "", "", "", "",
+//                        authAuditType, "", String.valueOf(empId),"");
+//
+//                EquipmentQueryFrom page = new EquipmentQueryFrom();
+//                page.setPageNum(1);
+//                page.setPageSize(100000);
+//                Page pageParam = SmartPageUtil.convert2PageQuery(page);
+//                List<AuditVo> auditList = auditService.GetAuditList(pageParam, "", "", "2", "0", "", "1", Integer.parseInt(pastureId),
+//                        "", "", "", "", "", authAuditType, "", String.valueOf(empId),"");
+//
+//                int lyCount = 0;
+//                String[] roleNameList = roleName.split(",");
+//
+//                for (AuditVo auditVo : auditList) {
+//                    if (auditVo.getAuditType().equals(1)) {
+//                        auditVo.setEmpStatus(1);
+//                        double sumPrice = Double.parseDouble(auditVo.getSumPrice());
+//                        for (String s : roleNameList) {
+//                            if (auditVo.getFlowCompeleted().equals(0) && s.equals("设备主管")) {
+//                                lyCount++;
+//                                break;
+//                            } else if (auditVo.getFlowCompeleted().equals(1) && s.equals("分管负责人") && sumPrice >= 1000.0) {
+//                                lyCount++;
+//                                break;
+//                            } else if (auditVo.getFlowCompeleted().equals(3) && s.equals("场长") && sumPrice >= 2000) {
+//                                lyCount++;
+//                                break;
+//                            }
+//                        }
+//                    }
+//                }
+//                menuVO.setAmount(lyCount + whCount + wxCount);
+//            }
+//        }
+
+
+        ResponseDTO res = ResponseDTO.ok(menuList);
+        res.setCode(200);
+        return res;
+    }
+
+
+    @ApiOperation(value = "通过用户empid获取菜单消息提醒")
+    @GetMapping("/menu/emp/message")
+    public ResponseDTO<List<MenuVO>> getMenuEmpMessage(@RequestParam("empId") int empId, @RequestParam(required = false, defaultValue = "") String pastureId, @RequestParam(required = false, defaultValue = "") String roleName) throws Exception {
         List<MenuVO> menuList = menuService.getMenuEmp(empId);
         List<MenuVO> menuList = menuService.getMenuEmp(empId);
+
+        for (MenuVO menuVO : menuList) {
+            if (menuVO.getMenuName().equals("盘点")) {
+                int count = takestockService.getTakeStockListCount(Integer.parseInt(pastureId), "", 0, "", "");
+                menuVO.setAmount(count);
+            } else if (menuVO.getMenuName().equals("维修接单")) {
+                int auditCount = repairService.GetRepairListCount(String.valueOf(empId), "", "1", "", "0", pastureId, "");
+                menuVO.setAmount(auditCount);
+            } else if (menuVO.getMenuName().equals("派单")) {
+                int auditCount = repairService.GetRepairListCount("", "", "1", "", "0", pastureId, "");
+                menuVO.setAmount(auditCount);
+            } else if (menuVO.getMenuName().equals("维修")) {
+                int count = auditService.GetAuditListCount(String.valueOf(empId), "", "1,2", "0", "", "0", Integer.parseInt(pastureId), "1", "",
+                        "", "", "", "", "", "","");
+                menuVO.setAmount(count);
+            } else if (menuVO.getMenuName().equals("预防性维护")) {
+                ResponseDTO resp = commonService.SyncBigInspection(Integer.parseInt(pastureId));
+                if (resp != null) {
+                    ResponseDTO res = ResponseDTO.ok(menuList);
+                    res.setCode(200);
+                    res.setMsg(resp.getMsg());
+                    return res;
+                }
+                int count = inspectionService.getBigInspectionListCount(Integer.parseInt(pastureId), 1, String.valueOf(empId), 0,
+                        "", "","");
+                menuVO.setAmount(count);
+            } else if (menuVO.getMenuName().equals("审核模块")) {
+                List<String> auditTypeList = new ArrayList<>();
+                List<MenuVO> menuList1 = menuService.getMenuEmp(empId);
+                for (MenuVO menuVO1 : menuList1) {
+                    if (menuVO1.getMenuId() == 223) {
+                        auditTypeList.add("1");
+                    } else if (menuVO1.getMenuId() == 224) {
+                        auditTypeList.add("3");
+                    } else {
+                        auditTypeList.add("0");
+                    }
+                }
+                String authAuditType = String.join(",", auditTypeList);
+                int wxCount = auditService.GetAuditListCount("", "", "2", "0",  "",
+                        "0", Integer.parseInt(pastureId), "", "", "", "", "", authAuditType,
+                        "", String.valueOf(empId),"");
+                int whCount = auditService.GetAuditListCount("", "", "2", "0",
+                        "", "3", Integer.parseInt(pastureId), "", "", "", "", "",
+                        authAuditType, "", String.valueOf(empId),"");
+
+                EquipmentQueryFrom page = new EquipmentQueryFrom();
+                page.setPageNum(1);
+                page.setPageSize(100000);
+                Page pageParam = SmartPageUtil.convert2PageQuery(page);
+                List<AuditVo> auditList = auditService.GetAuditList(pageParam, "", "", "2", "0", "", "1", Integer.parseInt(pastureId),
+                        "", "", "", "", "", authAuditType, "", String.valueOf(empId),"");
+
+                int lyCount = 0;
+                String[] roleNameList = roleName.split(",");
+
+                for (AuditVo auditVo : auditList) {
+                    if (auditVo.getAuditType().equals(1)) {
+                        auditVo.setEmpStatus(1);
+                        double sumPrice = Double.parseDouble(auditVo.getSumPrice());
+                        for (String s : roleNameList) {
+                            if (auditVo.getFlowCompeleted().equals(0) && s.equals("设备主管")) {
+                                lyCount++;
+                                break;
+                            } else if (auditVo.getFlowCompeleted().equals(1) && s.equals("分管负责人") && sumPrice >= 1000.0) {
+                                lyCount++;
+                                break;
+                            } else if (auditVo.getFlowCompeleted().equals(3) && s.equals("场长") && sumPrice >= 2000) {
+                                lyCount++;
+                                break;
+                            }
+                        }
+                    }
+                }
+                menuVO.setAmount(lyCount + whCount + wxCount);
+            }
+        }
+
+
         ResponseDTO res = ResponseDTO.ok(menuList);
         ResponseDTO res = ResponseDTO.ok(menuList);
         res.setCode(200);
         res.setCode(200);
         return res;
         return res;

+ 14 - 3
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleController.java

@@ -9,6 +9,7 @@ import net.lab1024.sa.admin.module.gm.eq.domain.from.EquipmentQueryFrom;
 import net.lab1024.sa.admin.module.system.role.domain.form.DeleteRoleFrom;
 import net.lab1024.sa.admin.module.system.role.domain.form.DeleteRoleFrom;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleAddForm;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleAddForm;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleUpdateForm;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleUpdateForm;
+import net.lab1024.sa.admin.module.system.role.domain.form.updateRoleDataRoleFrom;
 import net.lab1024.sa.admin.module.system.role.domain.vo.RoleVO;
 import net.lab1024.sa.admin.module.system.role.domain.vo.RoleVO;
 import net.lab1024.sa.admin.module.system.role.service.RoleService;
 import net.lab1024.sa.admin.module.system.role.service.RoleService;
 import net.lab1024.sa.common.common.annoation.NoNeedLogin;
 import net.lab1024.sa.common.common.annoation.NoNeedLogin;
@@ -59,7 +60,7 @@ public class RoleController extends AdminBaseController {
     }
     }
 
 
     @ApiOperation("PC 更新角色 @author 卓大")
     @ApiOperation("PC 更新角色 @author 卓大")
-    //@NoNeedLogin
+    @NoNeedLogin
     @PostMapping("/role/update")
     @PostMapping("/role/update")
     public ResponseDTO<String> updateRole(@Valid @RequestBody RoleUpdateForm roleUpdateDTO) {
     public ResponseDTO<String> updateRole(@Valid @RequestBody RoleUpdateForm roleUpdateDTO) {
         ResponseDTO<String> res = roleService.updateRole(roleUpdateDTO);
         ResponseDTO<String> res = roleService.updateRole(roleUpdateDTO);
@@ -68,14 +69,14 @@ public class RoleController extends AdminBaseController {
     }
     }
 
 
     @ApiOperation("获取角色数据 @author 卓大")
     @ApiOperation("获取角色数据 @author 卓大")
-    //@NoNeedLogin
+    @NoNeedLogin
     @GetMapping("/role/get/{roleId}")
     @GetMapping("/role/get/{roleId}")
     public ResponseDTO<RoleVO> getRole(@PathVariable("roleId") Long roleId) {
     public ResponseDTO<RoleVO> getRole(@PathVariable("roleId") Long roleId) {
         return roleService.getRoleById(roleId);
         return roleService.getRoleById(roleId);
     }
     }
 
 
     @ApiOperation("PC获取所有角色 @author 卓大")
     @ApiOperation("PC获取所有角色 @author 卓大")
-    //@NoNeedLogin
+    @NoNeedLogin
     @GetMapping("/role/getAll")
     @GetMapping("/role/getAll")
     public ResponseDTO<List<RoleVO>> getAllRole(@RequestParam int pageNum, @RequestParam int pageSize, @RequestParam(required = false, defaultValue = "") String roleName) {
     public ResponseDTO<List<RoleVO>> getAllRole(@RequestParam int pageNum, @RequestParam int pageSize, @RequestParam(required = false, defaultValue = "") String roleName) {
         EquipmentQueryFrom page = new EquipmentQueryFrom();
         EquipmentQueryFrom page = new EquipmentQueryFrom();
@@ -95,4 +96,14 @@ public class RoleController extends AdminBaseController {
         return res;
         return res;
     }
     }
 
 
+    @ApiOperation("PC 更新角色数据权限")
+    @NoNeedLogin
+    @PostMapping("/role/data/update")
+    public ResponseDTO<Boolean> updateRoleDataRole(@Valid @RequestBody updateRoleDataRoleFrom from) {
+        boolean sueccss = roleService.updateRoleDataRole(from);
+        ResponseDTO<Boolean> res = ResponseDTO.ok(sueccss);
+        res.setCode(200);
+        return res;
+    }
+
 }
 }

+ 4 - 2
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/controller/RoleEmployeeController.java

@@ -100,8 +100,10 @@ public class RoleEmployeeController extends AdminBaseController {
         EquipmentTplnrFrom query = new EquipmentTplnrFrom();
         EquipmentTplnrFrom query = new EquipmentTplnrFrom();
         query.setPageNum(pageNum);
         query.setPageNum(pageNum);
         query.setPageSize(pageSize);
         query.setPageSize(pageSize);
-        ResponseDTO<List<EmployeeVO>> res = employeeService.queryAllEmployee(query, disabledFlag, nameOrLoginName, departmentId, name, pastureId, pageNum, pageSize,pastureName,loginName,roleId);
-        int count = employeeService.selectEmployeeByDisabledAndDeletedCount(disabledFlag, nameOrLoginName, departmentId, name, pastureId,pastureName,loginName,roleId);
+        ResponseDTO<List<EmployeeVO>> res = employeeService.queryAllEmployee(query, disabledFlag, nameOrLoginName, departmentId, name,
+                pastureId, pageNum, pageSize,pastureName,loginName,roleId,"");
+        int count = employeeService.selectEmployeeByDisabledAndDeletedCount(disabledFlag, nameOrLoginName, departmentId, name,
+                pastureId,pastureName,loginName,roleId,"");
         int i = 0;
         int i = 0;
         for (EmployeeVO datum : res.getData()) {
         for (EmployeeVO datum : res.getData()) {
             List<getRoleListVo> roleList = roleEmployeeService.getRoleList(datum.getEmployeeId());
             List<getRoleListVo> roleList = roleEmployeeService.getRoleList(datum.getEmployeeId());

+ 2 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleDao.java

@@ -2,6 +2,7 @@ package net.lab1024.sa.admin.module.system.role.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import net.lab1024.sa.admin.module.system.role.domain.form.updateRoleDataRoleFrom;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
@@ -33,4 +34,5 @@ public interface RoleDao extends BaseMapper<RoleEntity> {
     List<RoleEntity> getRole(@Param("page")Page page,@Param("roleName") String roleName);
     List<RoleEntity> getRole(@Param("page")Page page,@Param("roleName") String roleName);
 
 
     int getRoleCount(@Param("roleName") String roleName);
     int getRoleCount(@Param("roleName") String roleName);
+    void updateRoleDataRole(@Param("from") updateRoleDataRoleFrom from);
 }
 }

+ 3 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/dao/RoleEmployeeDao.java

@@ -3,6 +3,7 @@ package net.lab1024.sa.admin.module.system.role.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import net.lab1024.sa.admin.module.system.role.domain.form.EmpRoleFrom;
 import net.lab1024.sa.admin.module.system.role.domain.form.EmpRoleFrom;
+import net.lab1024.sa.admin.module.system.role.domain.vo.EquipmentEmpRoleVo;
 import net.lab1024.sa.admin.module.system.role.domain.vo.getRoleListVo;
 import net.lab1024.sa.admin.module.system.role.domain.vo.getRoleListVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -104,4 +105,6 @@ public interface RoleEmployeeDao extends BaseMapper<RoleEmployeeEntity> {
 
 
     void delEmpRole(@Param("from") EmpRoleFrom from);
     void delEmpRole(@Param("from") EmpRoleFrom from);
     List<getRoleListVo> getEmpRoleList();
     List<getRoleListVo> getEmpRoleList();
+
+    EquipmentEmpRoleVo getEquipmentEmpRole(@Param("pastureId") String  pastureId);
 }
 }

+ 1 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleEntity.java

@@ -38,4 +38,5 @@ public class RoleEntity {
      * 创建时间
      * 创建时间
      */
      */
     private LocalDateTime createTime;
     private LocalDateTime createTime;
+    private int datarole;
 }
 }

+ 1 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/entity/RoleMenuEntity.java

@@ -45,5 +45,6 @@ public class RoleMenuEntity {
      * 创建时间
      * 创建时间
      */
      */
     private LocalDateTime createTime;
     private LocalDateTime createTime;
+//    private int datarole;
 
 
 }
 }

+ 10 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/form/updateRoleDataRoleFrom.java

@@ -0,0 +1,10 @@
+package net.lab1024.sa.admin.module.system.role.domain.form;
+
+
+import lombok.Data;
+
+@Data
+public class updateRoleDataRoleFrom {
+    private String roleId;
+    private String datarole;
+}

+ 10 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/EquipmentEmpRoleVo.java

@@ -0,0 +1,10 @@
+package net.lab1024.sa.admin.module.system.role.domain.vo;
+
+
+import lombok.Data;
+
+@Data
+public class EquipmentEmpRoleVo {
+    private String employeeId;
+    private String loginName;
+}

+ 1 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/domain/vo/RoleVO.java

@@ -28,4 +28,5 @@ public class RoleVO {
 
 
     private List<Long> menuIdList;
     private List<Long> menuIdList;
     private int number;
     private int number;
+    private int  datarole;
 }
 }

+ 4 - 1
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleEmployeeService.java

@@ -7,6 +7,7 @@ import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEntity;
 import net.lab1024.sa.admin.module.system.role.domain.form.EmpRoleFrom;
 import net.lab1024.sa.admin.module.system.role.domain.form.EmpRoleFrom;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeQueryForm;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeQueryForm;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeUpdateForm;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeUpdateForm;
+import net.lab1024.sa.admin.module.system.role.domain.vo.EquipmentEmpRoleVo;
 import net.lab1024.sa.admin.module.system.role.domain.vo.RoleSelectedVO;
 import net.lab1024.sa.admin.module.system.role.domain.vo.RoleSelectedVO;
 import net.lab1024.sa.admin.module.system.role.domain.vo.getRoleListVo;
 import net.lab1024.sa.admin.module.system.role.domain.vo.getRoleListVo;
 import net.lab1024.sa.common.common.code.UserErrorCode;
 import net.lab1024.sa.common.common.code.UserErrorCode;
@@ -163,6 +164,8 @@ public class RoleEmployeeService {
         return true;
         return true;
     }
     }
 
 
-
+    public EquipmentEmpRoleVo getEquipmentEmpRole(String pastureId) {
+        return roleEmployeeDao.getEquipmentEmpRole(pastureId);
+    }
 
 
 }
 }

+ 9 - 6
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleMenuService.java

@@ -131,17 +131,19 @@ public class RoleMenuService {
 
 
     public ResponseDTO<RoleMenuTreeVO> getRoleSelectedMenuByEmpId(String empId) {
     public ResponseDTO<RoleMenuTreeVO> getRoleSelectedMenuByEmpId(String empId) {
         List<RoleSelectedVO> roleList =  roleEmployeeService.getRoleInfoListByEmployeeId(Long.valueOf(empId));
         List<RoleSelectedVO> roleList =  roleEmployeeService.getRoleInfoListByEmployeeId(Long.valueOf(empId));
-        List<Long> selectedMenuIdList = new ArrayList<>();
+        List<Long> selectedMenuIdList1 = new ArrayList<>();
         for (RoleSelectedVO roleSelectedVO : roleList) {
         for (RoleSelectedVO roleSelectedVO : roleList) {
-//            selectedMenuIdList.add(roleSelectedVO.getRoleId());
-            //查询角色ID选择的菜单权限
+            if (!roleSelectedVO.getSelected()){
+                continue;
+            }
+            System.out.println(  roleSelectedVO.getSelected());
             List<Long> selectedMenuId = roleMenuDao.queryMenuIdByRoleId(roleSelectedVO.getRoleId());
             List<Long> selectedMenuId = roleMenuDao.queryMenuIdByRoleId(roleSelectedVO.getRoleId());
             for (Long aLong : selectedMenuId) {
             for (Long aLong : selectedMenuId) {
-                selectedMenuIdList.add(aLong);
+                selectedMenuIdList1.add(aLong);
             }
             }
         }
         }
-        Set<Long> uniqueSet = new HashSet<>(selectedMenuIdList);
-        List<Long> selectedMenuIdList1 = new ArrayList<>(uniqueSet);
+//        Set<Long> uniqueSet = new HashSet<>(selectedMenuIdList1);
+//        List<Long> selectedMenuIdList = new ArrayList<>(uniqueSet);
         RoleMenuTreeVO res = new RoleMenuTreeVO();
         RoleMenuTreeVO res = new RoleMenuTreeVO();
         res.setSelectedMenuId(selectedMenuIdList1);
         res.setSelectedMenuId(selectedMenuIdList1);
         //查询菜单权限
         //查询菜单权限
@@ -149,6 +151,7 @@ public class RoleMenuService {
 
 
         List<MenuVO>  menuNameList = new ArrayList<>();
         List<MenuVO>  menuNameList = new ArrayList<>();
         List<MenuVO> menuVOList =new ArrayList<>();
         List<MenuVO> menuVOList =new ArrayList<>();
+        System.out.println(selectedMenuIdList1);
         for (MenuVO menuVO : menuVOList1) {
         for (MenuVO menuVO : menuVOList1) {
             for (Long aLong : selectedMenuIdList1) {
             for (Long aLong : selectedMenuIdList1) {
                 if (menuVO.getMenuId().equals(aLong)){
                 if (menuVO.getMenuId().equals(aLong)){

+ 12 - 0
smart-admin-api/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/role/service/RoleService.java

@@ -9,6 +9,7 @@ import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEntity;
 import net.lab1024.sa.admin.module.system.role.domain.entity.RoleMenuEntity;
 import net.lab1024.sa.admin.module.system.role.domain.entity.RoleMenuEntity;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleAddForm;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleAddForm;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleUpdateForm;
 import net.lab1024.sa.admin.module.system.role.domain.form.RoleUpdateForm;
+import net.lab1024.sa.admin.module.system.role.domain.form.updateRoleDataRoleFrom;
 import net.lab1024.sa.admin.module.system.role.domain.vo.RoleVO;
 import net.lab1024.sa.admin.module.system.role.domain.vo.RoleVO;
 import net.lab1024.sa.admin.module.system.role.domain.vo.getRoleListVo;
 import net.lab1024.sa.admin.module.system.role.domain.vo.getRoleListVo;
 import net.lab1024.sa.common.common.code.UserErrorCode;
 import net.lab1024.sa.common.common.code.UserErrorCode;
@@ -140,6 +141,17 @@ public class RoleService {
         return res;
         return res;
     }
     }
 
 
+
+    public boolean updateRoleDataRole(updateRoleDataRoleFrom from) {
+        try {
+            roleDao.updateRoleDataRole(from);
+        } catch (Exception e) {
+            return false;
+        }
+        return true;
+    }
+
+
 //    @Autowired
 //    @Autowired
 //    private RoleEmployeeDao roleEmployeeDao;
 //    private RoleEmployeeDao roleEmployeeDao;
 }
 }

+ 34 - 13
smart-admin-api/sa-admin/src/main/resources/dev/application.yaml

@@ -17,19 +17,39 @@ spring:
     url: jdbc:p6spy:mysql://172.16.87.199:3306/gmeq?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
     url: jdbc:p6spy:mysql://172.16.87.199:3306/gmeq?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
     username: root
     username: root
     password: Gm@5418#
     password: Gm@5418#
+  druid:
+    username: druid
+    password: 1024
+    login:
+      enabled: false
+    method:
+      pointcut: net.lab1024.sa..*Service.*
+    stat-view-servlet:
+      enabled: false
+    spring:
+      datasource:
+        druid:
+          stat-view-servlet:
+            enabled: false
+          filter:
+            stat:
+              enabled: false
+              exclusions: /*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
+          web-stat-filter:
+            enabled: false
 
 
-redis:
-  database: 1
-  host: 127.0.0.1
-  lettuce:
-    pool:
-      max-active: 5
-      min-idle: 1
-      max-idle: 3
-      max-wait: 30000ms
-  port: 6379
-  timeout: 10000ms
-  password: Kpt@123456
+  redis:
+    database: 1
+    host: 210.16.189.72
+    lettuce:
+      pool:
+        max-active: 5
+        min-idle: 1
+        max-idle: 3
+        max-wait: 30000ms
+    port: 6379
+    timeout: 10000ms
+    password: Gm@5418#
 
 
 # 项目配置
 # 项目配置
 project:
 project:
@@ -46,4 +66,5 @@ cloud:
   endpoint: oss-cn-qingdao.aliyuncs.com
   endpoint: oss-cn-qingdao.aliyuncs.com
   bucket-name: common-sit
   bucket-name: common-sit
   access-key:
   access-key:
-  secret-key:
+  secret-key:
+

+ 18 - 8
smart-admin-api/sa-admin/src/main/resources/mapper/gm/audit/AuditMapper.xml

@@ -7,11 +7,11 @@
     <insert id="addAudit">
     <insert id="addAudit">
         INSERT INTO audit(processed,`code`, `auditType`, `eqName`, `eqCode`,`date`, `personnelID`, `personnelName`,`createUserId`,sapCode,pastureId)
         INSERT INTO audit(processed,`code`, `auditType`, `eqName`, `eqCode`,`date`, `personnelID`, `personnelName`,`createUserId`,sapCode,pastureId)
         VALUES(#{audit.processed} ,#{audit.code},#{audit.auditType},(select eqName from equipment  where eqCode = #{audit.eqCode}),#{audit.eqCode},
         VALUES(#{audit.processed} ,#{audit.code},#{audit.auditType},(select eqName from equipment  where eqCode = #{audit.eqCode}),#{audit.eqCode},
-               DATE_FORMAT(#{audit.date},'%Y-%m-%d %H:%i:%s')  ,#{audit.personnelID},#{audit.personnelName},#{audit.createUserId},#{audit.sapCode},#{audit.pastureId});
+               now() ,#{audit.personnelID},#{audit.personnelName},#{audit.createUserId},#{audit.sapCode},#{audit.pastureId});
     </insert>
     </insert>
 
 
     <select id="getAuditList" resultType="net.lab1024.sa.admin.module.gm.audit.domain.vo.AuditVo">
     <select id="getAuditList" resultType="net.lab1024.sa.admin.module.gm.audit.domain.vo.AuditVo">
-        select a.*,e.swerk,e.pltxt,e.tplnr,cu.actual_name as createUserName,
+        select a.*,e.swerk,e.tplnr,cu.actual_name as createUserName,
                (select id from bigpartapply  where applyCode = a.code)bigPartapplyId,
                (select id from bigpartapply  where applyCode = a.code)bigPartapplyId,
         bist.id biginspectionId,bist.plantime,up.actual_name upkeepPersonName,
         bist.id biginspectionId,bist.plantime,up.actual_name upkeepPersonName,
         bpemp.actual_name partapplyPersonName,(select sum(amount) from partapply where bigid = bp.id) amount,
         bpemp.actual_name partapplyPersonName,(select sum(amount) from partapply where bigid = bp.id) amount,
@@ -20,17 +20,20 @@
                if(a.pick = 0 ,SEC_TO_TIME(TIMESTAMPDIFF(SECOND,  a.date, now())) ,
                if(a.pick = 0 ,SEC_TO_TIME(TIMESTAMPDIFF(SECOND,  a.date, now())) ,
                   if(a.pick = 1 and (a.status = 0 or a.status = 2 ),
                   if(a.pick = 1 and (a.status = 0 or a.status = 2 ),
                      SEC_TO_TIME(TIMESTAMPDIFF(SECOND,  a.pickTime, now())) ,
                      SEC_TO_TIME(TIMESTAMPDIFF(SECOND,  a.pickTime, now())) ,
-                     SEC_TO_TIME(TIMESTAMPDIFF(SECOND,  a.pickTime, completionTime)))) appgs
+                     round( (TIMESTAMPDIFF(SECOND,  a.pickTime, a.completionTime)-ifnull((SELECT sum(TIMESTAMPDIFF(	SECOND,w1.date,( SELECT date FROM wxprocess WHERE wxcode = w1.wxcode AND STATUS = 1 AND date > w1.date ORDER BY date ASC LIMIT 1 )))
+                       FROM wxprocess w1 WHERE wxcode = a.code AND STATUS = 0),0)) /60/60,2)  )) appgs,t.pltxt
+
         from audit a
         from audit a
             left join repair r on r.qmnum = a.code
             left join repair r on r.qmnum = a.code
             left join  equipment e  on e.eqCode = a.eqCode
             left join  equipment e  on e.eqCode = a.eqCode
+            left join tplnr t on t.tplnr = e.tplnr
         left join  t_employee cu  on  cu.employee_id = a.createUserId
         left join  t_employee cu  on  cu.employee_id = a.createUserId
             left join biginspection bist on  bist.inspectionCode = a.code
             left join biginspection bist on  bist.inspectionCode = a.code
             left join t_employee up on bist.upkeepPerson = up.employee_id
             left join t_employee up on bist.upkeepPerson = up.employee_id
                 left join bigpartapply bp on bp.applyCode = a.code
                 left join bigpartapply bp on bp.applyCode = a.code
         left join t_employee bpemp on    bp.empId = bpemp.employee_id
         left join t_employee bpemp on    bp.empId = bpemp.employee_id
    where
    where
-            (FIND_IN_SET(#{personnel},a.personnelID) or #{personnel} = '')
+            (FIND_IN_SET(#{personnel},a.personnelID)or #{roleId} = '46' or #{personnel} = '')
  and  ( a.createUserId = #{createUserId} or #{createUserId} = '')
  and  ( a.createUserId = #{createUserId} or #{createUserId} = '')
           and   (FIND_IN_SET(a.processed,#{processed})    or #{processed} = '')
           and   (FIND_IN_SET(a.processed,#{processed})    or #{processed} = '')
             and  ( a.status = #{status} or (if(#{status} = 0 ,a.status in(0,2),1=0) and #{personnel} != '' ) or (if(#{status} = 1 ,a.status in(1,2),1=0) and #{personnel} != '' ) or #{status} = '')
             and  ( a.status = #{status} or (if(#{status} = 0 ,a.status in(0,2),1=0) and #{personnel} != '' ) or (if(#{status} = 1 ,a.status in(1,2),1=0) and #{personnel} != '' ) or #{status} = '')
@@ -40,13 +43,14 @@
                  or #{eqCodeOrName} = ''
                  or #{eqCodeOrName} = ''
                 or (select count(1) from partapply  where partName like concat('%',#{eqCodeOrName},'%') and bigid = bp.id) >0)
                 or (select count(1) from partapply  where partName like concat('%',#{eqCodeOrName},'%') and bigid = bp.id) >0)
             and  (auditType = #{fromAuditType}  or  '' = #{fromAuditType})
             and  (auditType = #{fromAuditType}  or  '' = #{fromAuditType})
-            and a.pastureId = #{fromPastureId} and ( a.pick = #{pick} or #{pick} = '')
+            and (a.pastureId = #{fromPastureId} ) and ( a.pick = #{pick} or #{pick} = '')
             and  ( a.code = #{code} or #{code} = '')
             and  ( a.code = #{code} or #{code} = '')
             and  ( a.sapCode = #{sapCode} or #{sapCode} = '')  and (if (a.auditType = 1 , bp.recycle = 0 , 1= 1) )
             and  ( a.sapCode = #{sapCode} or #{sapCode} = '')  and (if (a.auditType = 1 , bp.recycle = 0 , 1= 1) )
             and (a.completionTime between #{startDate} and DATE_SUB(#{endDate}, INTERVAL -1 DAY)  or (#{startDate} = '' and  #{endDate}  = '') )
             and (a.completionTime between #{startDate} and DATE_SUB(#{endDate}, INTERVAL -1 DAY)  or (#{startDate} = '' and  #{endDate}  = '') )
     and ( FIND_IN_SET(a.auditType,#{authAuditType}) or #{authAuditType}= '' )
     and ( FIND_IN_SET(a.auditType,#{authAuditType}) or #{authAuditType}= '' )
      and (r.priok = #{priok}   or #{priok} = '')
      and (r.priok = #{priok}   or #{priok} = '')
-       order by a.pickTime desc, a.date desc, a.updateTime desc
+      and (#{empId} = '' or #{roleId} = '46'or (if(a.auditType = 0, (a.createUserId = #{empId} and a.auditType = 0),1 = 1) ) )
+       order by a.pickTime desc, a.date desc
     </select>
     </select>
 
 
 
 
@@ -63,7 +67,7 @@
         left join bigpartapply bp on bp.applyCode = a.code
         left join bigpartapply bp on bp.applyCode = a.code
         left join t_employee bpemp on    bp.empId = bpemp.employee_id
         left join t_employee bpemp on    bp.empId = bpemp.employee_id
         <where>
         <where>
-            (FIND_IN_SET(#{personnel},a.personnelID) or #{personnel} = '')
+            (FIND_IN_SET(#{personnel},a.personnelID) or #{personnel} = '' or #{roleId} = '46')
             and  ( a.createUserId = #{createUserId} or #{createUserId} = '')
             and  ( a.createUserId = #{createUserId} or #{createUserId} = '')
             and   (FIND_IN_SET(a.processed,#{processed})    or #{processed} = '')
             and   (FIND_IN_SET(a.processed,#{processed})    or #{processed} = '')
             and  ( a.status = #{status} or (if(#{status} = 0 ,a.status in(0,2),1=0) and #{personnel} != '' ) or (if(#{status} = 1 ,a.status in(1,2),1=0) and #{personnel} != '' ) or #{status} = '')
             and  ( a.status = #{status} or (if(#{status} = 0 ,a.status in(0,2),1=0) and #{personnel} != '' ) or (if(#{status} = 1 ,a.status in(1,2),1=0) and #{personnel} != '' ) or #{status} = '')
@@ -73,11 +77,12 @@
             or #{eqCodeOrName} = ''
             or #{eqCodeOrName} = ''
             or (select count(1) from partapply  where partName like concat('%',#{eqCodeOrName},'%') and bigid = bp.id) >0)
             or (select count(1) from partapply  where partName like concat('%',#{eqCodeOrName},'%') and bigid = bp.id) >0)
             and  (auditType = #{fromAuditType}  or  '' = #{fromAuditType})
             and  (auditType = #{fromAuditType}  or  '' = #{fromAuditType})
-            and a.pastureId = #{fromPastureId} and ( a.pick = #{pick} or #{pick} = '')
+            and (a.pastureId = #{fromPastureId}) and ( a.pick = #{pick} or #{pick} = '')
             and  ( a.code = #{code} or #{code} = '')
             and  ( a.code = #{code} or #{code} = '')
             and  ( a.sapCode = #{sapCode} or #{sapCode} = '')  and (if (a.auditType = 1 , bp.recycle = 0 , 1= 1) )
             and  ( a.sapCode = #{sapCode} or #{sapCode} = '')  and (if (a.auditType = 1 , bp.recycle = 0 , 1= 1) )
             and (a.completionTime between #{startDate} and DATE_SUB(#{endDate}, INTERVAL -1 DAY)  or (#{startDate} = '' and  #{endDate}  = '') )
             and (a.completionTime between #{startDate} and DATE_SUB(#{endDate}, INTERVAL -1 DAY)  or (#{startDate} = '' and  #{endDate}  = '') )
             and ( FIND_IN_SET(a.auditType,#{authAuditType}) or #{authAuditType}= '' )
             and ( FIND_IN_SET(a.auditType,#{authAuditType}) or #{authAuditType}= '' )
+            and (#{empId} = '' or #{roleId} = '46' or (if(a.auditType = 0, (a.createUserId = #{empId} and a.auditType = 0),1 = 1) ) )
         and (r.priok = #{priok}   or #{priok} = '')
         and (r.priok = #{priok}   or #{priok} = '')
         </where>
         </where>
     </select>
     </select>
@@ -87,6 +92,11 @@
                      where code = #{audit.code}
                      where code = #{audit.code}
     </update>
     </update>
 
 
+    <update id="editAuditDate">
+        update audit set date =  now()
+        where code = #{code}
+    </update>
+
 
 
     <select id="getAuditSapCode"  resultType="java.lang.String">
     <select id="getAuditSapCode"  resultType="java.lang.String">
         select sapCode from audit
         select sapCode from audit

+ 18 - 3
smart-admin-api/sa-admin/src/main/resources/mapper/gm/common/CommonMapper.xml

@@ -42,7 +42,7 @@
 
 
     <select id="getPastureList" resultType="net.lab1024.sa.admin.module.gm.common.domain.Vo.PastureVo">
     <select id="getPastureList" resultType="net.lab1024.sa.admin.module.gm.common.domain.Vo.PastureVo">
         select *
         select *
-        from pasture
+        from pasture  where (name like concat('%',#{pastureName},'%') or #{pastureName} = '')
     </select>
     </select>
 
 
     <select id="getPastureById" resultType="net.lab1024.sa.admin.module.gm.common.domain.Vo.PastureVo">
     <select id="getPastureById" resultType="net.lab1024.sa.admin.module.gm.common.domain.Vo.PastureVo">
@@ -135,7 +135,7 @@
     </insert>
     </insert>
 
 
     <insert id="addMovement">
     <insert id="addMovement">
-        insert into movement(pastureId, movement, sort, enable)
+        insert into movement(pastureId,movement, sort, enable)
         values (#{from.pastureId}, #{from.movement}, #{from.sort}, #{from.enable})
         values (#{from.pastureId}, #{from.movement}, #{from.sort}, #{from.enable})
     </insert>
     </insert>
 
 
@@ -151,7 +151,8 @@
     <select id="getMovement" resultType="net.lab1024.sa.admin.module.gm.common.domain.Vo.MovementVo">
     <select id="getMovement" resultType="net.lab1024.sa.admin.module.gm.common.domain.Vo.MovementVo">
         select *
         select *
         from movement
         from movement
-        where pastureId = #{pastureId}  and ( enable = #{enable} or #{enable} = '')
+
+        where ( enable = #{enable} or #{enable} = '')
         order by sort
         order by sort
     </select>
     </select>
 
 
@@ -160,4 +161,18 @@
         delete from movement where  FIND_IN_SET(id,#{id})
         delete from movement where  FIND_IN_SET(id,#{id})
     </delete>
     </delete>
 
 
+    <select id="getPastureEquipmentZG"  resultType="java.lang.String">
+        select te.login_name from t_role tr
+            join t_role_employee tre on tre.role_id  = tr.role_id
+            join t_employee te on te.employee_id = tre.employee_id
+                             where tr.role_id = 35  and te.pastureid = #{pastureId} and te.login_name != 'admin'  limit  1
+    </select>
+
+    <select id="getMovementCount" resultType="java.lang.Integer">
+        select count(1)
+        from movement
+        where movement = #{movement}
+    </select>
+
+
 </mapper>
 </mapper>

+ 6 - 6
smart-admin-api/sa-admin/src/main/resources/mapper/gm/equipment/EquipmentMapper.xml

@@ -43,7 +43,7 @@
         <where>
         <where>
             ((eqName  like concat("%",#{eqFrom.eqName},"%")  or #{eqFrom.eqName} = '')  or (eqCode like concat("%",#{eqFrom.eqName},"%") or #{eqFrom.eqName} = ''))
             ((eqName  like concat("%",#{eqFrom.eqName},"%")  or #{eqFrom.eqName} = '')  or (eqCode like concat("%",#{eqFrom.eqName},"%") or #{eqFrom.eqName} = ''))
         and  (eqCode = #{eqFrom.eqCode} or  #{eqFrom.eqCode} ='')
         and  (eqCode = #{eqFrom.eqCode} or  #{eqFrom.eqCode} ='')
-            and  (equipment.pastureId = #{eqFrom.pastureId} or  #{eqFrom.pastureId} ='')
+            and  (equipment.pastureId = #{eqFrom.pastureId} or  #{eqFrom.pastureId} ='' )
 and (if(equipment.oneduty = '' or equipment.oneupkeep = '' or equipment.oneinspection = '' or equipment.onerepair = '' or
 and (if(equipment.oneduty = '' or equipment.oneupkeep = '' or equipment.oneinspection = '' or equipment.onerepair = '' or
         equipment.oneduty is null or equipment.oneupkeep is null or equipment.oneinspection is null or equipment.onerepair is null ,1,0) = #{eqFrom.bind}
         equipment.oneduty is null or equipment.oneupkeep is null or equipment.oneinspection is null or equipment.onerepair is null ,1,0) = #{eqFrom.bind}
          or  #{eqFrom.bind} = 2 or  #{eqFrom.bind} = '')
          or  #{eqFrom.bind} = 2 or  #{eqFrom.bind} = '')
@@ -57,7 +57,7 @@ and (if(equipment.oneduty = '' or equipment.oneupkeep = '' or equipment.oneinspe
         select count(*) from equipment join tplnr t on t.tplnr = equipment.tplnr
         select count(*) from equipment join tplnr t on t.tplnr = equipment.tplnr
         <where>
         <where>
             (eqName =#{eqFrom.eqName}  or #{eqFrom.eqCode} = '')  and (eqCode = #{eqFrom.eqCode} or #{eqFrom.eqCode} = '')
             (eqName =#{eqFrom.eqName}  or #{eqFrom.eqCode} = '')  and (eqCode = #{eqFrom.eqCode} or #{eqFrom.eqCode} = '')
-            and  (equipment.pastureId = #{eqFrom.pastureId} or  #{eqFrom.pastureId} ='')
+            and  (equipment.pastureId = #{eqFrom.pastureId} or  #{eqFrom.pastureId} =''  )
             and (if(equipment.oneduty = '' or equipment.oneupkeep = '' or equipment.oneinspection = '' or equipment.onerepair = '' or
             and (if(equipment.oneduty = '' or equipment.oneupkeep = '' or equipment.oneinspection = '' or equipment.onerepair = '' or
             equipment.oneduty is null or equipment.oneupkeep is null or equipment.oneinspection is null or equipment.onerepair is null ,1,0) = #{eqFrom.bind}
             equipment.oneduty is null or equipment.oneupkeep is null or equipment.oneinspection is null or equipment.onerepair is null ,1,0) = #{eqFrom.bind}
             or  #{eqFrom.bind} = 2 or  #{eqFrom.bind} = '')
             or  #{eqFrom.bind} = 2 or  #{eqFrom.bind} = '')
@@ -141,8 +141,8 @@ and (if(equipment.oneduty = '' or equipment.oneupkeep = '' or equipment.oneinspe
         values((select id from pasture where companycode = #{eqFrom.SWERK}),#{eqFrom.TPLNR},#{eqFrom.PLTXT},#{eqFrom.SWERK},#{eqFrom.NAME1},#{eqFrom.LGWID},#{eqFrom.BUKRS},#{eqFrom.BUTXT},#{eqFrom.KOSTL},
         values((select id from pasture where companycode = #{eqFrom.SWERK}),#{eqFrom.TPLNR},#{eqFrom.PLTXT},#{eqFrom.SWERK},#{eqFrom.NAME1},#{eqFrom.LGWID},#{eqFrom.BUKRS},#{eqFrom.BUTXT},#{eqFrom.KOSTL},
                #{eqFrom.IWERK},#{eqFrom.INGRP},#{eqFrom.LGWID1},#{eqFrom.TPLMA},#{eqFrom.STTXU})
                #{eqFrom.IWERK},#{eqFrom.INGRP},#{eqFrom.LGWID1},#{eqFrom.TPLMA},#{eqFrom.STTXU})
             ON DUPLICATE KEY UPDATE pastureId = (select id from pasture where companycode = #{eqFrom.SWERK}), `pltxt` = #{eqFrom.PLTXT}, `swerk`= #{eqFrom.SWERK}, `name1`= #{eqFrom.NAME1}, `lgwid`= #{eqFrom.LGWID}, `bukrs`= #{eqFrom.BUKRS},
             ON DUPLICATE KEY UPDATE pastureId = (select id from pasture where companycode = #{eqFrom.SWERK}), `pltxt` = #{eqFrom.PLTXT}, `swerk`= #{eqFrom.SWERK}, `name1`= #{eqFrom.NAME1}, `lgwid`= #{eqFrom.LGWID}, `bukrs`= #{eqFrom.BUKRS},
-                                 `butxt`= #{eqFrom.BUTXT}, `kostl`= #{eqFrom.KOSTL}, `iwerk`= #{eqFrom.IWERK}, `ingrp`= #{eqFrom.INGRP}, `lgwid1`= #{eqFrom.LGWID1}, `tplma`= #{eqFrom.TPLMA},
-                                 `sttxu`= #{eqFrom.STTXU}
+          `butxt`= #{eqFrom.BUTXT}, `kostl`= #{eqFrom.KOSTL}, `iwerk`= #{eqFrom.IWERK}, `ingrp`= #{eqFrom.INGRP}, `lgwid1`= #{eqFrom.LGWID1}, `tplma`= #{eqFrom.TPLMA},
+          `sttxu`= #{eqFrom.STTXU}
 
 
     </insert>
     </insert>
 
 
@@ -209,7 +209,7 @@ and (if(equipment.oneduty = '' or equipment.oneupkeep = '' or equipment.oneinspe
                )  downtime
                )  downtime
         from equipment e  join tplnr t on t.tplnr = e.tplnr
         from equipment e  join tplnr t on t.tplnr = e.tplnr
         where (e.eqCode like concat('%',#{eqCode},'%') or e.eqName like concat('%',#{eqCode},'%') or #{eqCode} = '')
         where (e.eqCode like concat('%',#{eqCode},'%') or e.eqName like concat('%',#{eqCode},'%') or #{eqCode} = '')
-        and e.pastureId = #{pastureId}
+        and (e.pastureId = #{pastureId}  )
 
 
     </select>
     </select>
 
 
@@ -218,7 +218,7 @@ and (if(equipment.oneduty = '' or equipment.oneupkeep = '' or equipment.oneinspe
         select count(1)
         select count(1)
         from equipment e  join tplnr t on t.tplnr = e.tplnr
         from equipment e  join tplnr t on t.tplnr = e.tplnr
         where (e.eqCode like concat('%',#{eqCode},'%') or e.eqName like concat('%',#{eqCode},'%') or #{eqCode} = '')
         where (e.eqCode like concat('%',#{eqCode},'%') or e.eqName like concat('%',#{eqCode},'%') or #{eqCode} = '')
-          and e.pastureId = #{pastureId}
+          and (e.pastureId = #{pastureId} )
     </select>
     </select>
 
 
 
 

+ 19 - 6
smart-admin-api/sa-admin/src/main/resources/mapper/gm/inspection/inspectionMapper.xml

@@ -25,15 +25,16 @@
         select bi.* ,te1.actual_name onePersonName,te2.actual_name twoPersonName,
         select bi.* ,te1.actual_name onePersonName,te2.actual_name twoPersonName,
             (select count(1) from inspection where bigid = bi.id ) count,
             (select count(1) from inspection where bigid = bi.id ) count,
             (select count(1) from inspection where bigid = bi.id and status = 0 ) normal,
             (select count(1) from inspection where bigid = bi.id and status = 0 ) normal,
-            (select  GROUP_CONCAT(actual_name) from t_employee where FIND_IN_SET(employee_id,bi.upkeepPerson) ) upkeepPersonName
+            (select  GROUP_CONCAT(actual_name) from t_employee where FIND_IN_SET(employee_id,bi.upkeepPerson) ) upkeepPersonName,
+            if(bi.status= 0,DATEDIFF(now(),bi.plantime),DATEDIFF(bi.completeTime,bi.plantime )) appTs
         from biginspection bi
         from biginspection bi
             join audit a on a.code = bi.inspectionCode
             join audit a on a.code = bi.inspectionCode
         left join t_employee  te1 on te1.employee_id = bi.onePerson
         left join t_employee  te1 on te1.employee_id = bi.onePerson
         left join t_employee  te2 on te2.employee_id = bi.twoPerson
         left join t_employee  te2 on te2.employee_id = bi.twoPerson
 #         left join t_employee  up on up.employee_id = bi.upkeepPerson
 #         left join t_employee  up on up.employee_id = bi.upkeepPerson
         <where>
         <where>
-            bi.pastureId = #{fromPastureId} and bi.planType = #{fromPlanType}
-        and ( FIND_IN_SET(#{empId}, bi.upkeepPerson) or #{empId} = '' )
+           (bi.pastureId = #{fromPastureId} ) and bi.planType = #{fromPlanType}
+        and ( FIND_IN_SET(#{empId}, bi.upkeepPerson) or #{roleId} = '46' or #{empId} = '' )
         and     (if(#{status} = 0 ,a.status in(0,2),a.status =#{status} ) )
         and     (if(#{status} = 0 ,a.status in(0,2),a.status =#{status} ) )
         and (completeTime between #{startTime} and DATE_SUB(#{endTime}, INTERVAL -1 DAY) or (#{startTime} = '' and #{endTime} = '' ))
         and (completeTime between #{startTime} and DATE_SUB(#{endTime}, INTERVAL -1 DAY) or (#{startTime} = '' and #{endTime} = '' ))
         </where>
         </where>
@@ -45,20 +46,32 @@
         select count(1) from biginspection bi
         select count(1) from biginspection bi
         join audit a on a.code = bi.inspectionCode
         join audit a on a.code = bi.inspectionCode
         <where>
         <where>
-            bi.pastureId = #{fromPastureId} and bi.planType = #{fromPlanType}         and ( FIND_IN_SET(#{empId}, bi.upkeepPerson) or #{empId} = '' )
-         and  (if(#{status} = 0 ,a.status in(0,2),a.status =#{status} ) )
+            (bi.pastureId = #{fromPastureId}  ) and bi.planType = #{fromPlanType}
+            and ( FIND_IN_SET(#{empId}, bi.upkeepPerson) or #{roleId} = '46' or #{empId} = '' )
+            and     (if(#{status} = 0 ,a.status in(0,2),a.status =#{status} ) )
             and (bi.completeTime between #{startTime} and DATE_SUB(#{endTime}, INTERVAL -1 DAY) or (#{startTime} = ''
             and (bi.completeTime between #{startTime} and DATE_SUB(#{endTime}, INTERVAL -1 DAY) or (#{startTime} = ''
                         and #{endTime} = '' ))
                         and #{endTime} = '' ))
         </where>
         </where>
     </select>
     </select>
 
 
+
+
+    <select id="getBigInspectionCount"   resultType="java.lang.Integer">
+        select count(1) from biginspection bi
+        join audit a on a.code = bi.inspectionCode
+        <where>
+           bi.inspectionCode = #{code}
+        </where>
+    </select>
+
     <select id="getBigInspection"  resultType="net.lab1024.sa.admin.module.gm.inspection.domain.vo.BigInspectionVo">
     <select id="getBigInspection"  resultType="net.lab1024.sa.admin.module.gm.inspection.domain.vo.BigInspectionVo">
         select * ,(select plantime from biginspection where eqCode = bi.eqCode order by createTime desc limit 1) lastTime,
         select * ,(select plantime from biginspection where eqCode = bi.eqCode order by createTime desc limit 1) lastTime,
                (select  GROUP_CONCAT(actual_name) from t_employee where FIND_IN_SET( employee_id,upkeepPerson) ) upkeepPersonName,
                (select  GROUP_CONCAT(actual_name) from t_employee where FIND_IN_SET( employee_id,upkeepPerson) ) upkeepPersonName,
         ( select  actual_name from t_employee where employee_id = bi.onePerson  )onePersonName,
         ( select  actual_name from t_employee where employee_id = bi.onePerson  )onePersonName,
         ( select  actual_name from t_employee where employee_id = bi.twoPerson  )twoPersonName,
         ( select  actual_name from t_employee where employee_id = bi.twoPerson  )twoPersonName,
         (select  count(1) from t_employee where FIND_IN_SET(employee_id,bi.upkeepPerson) ) upkeepPersonCount,
         (select  count(1) from t_employee where FIND_IN_SET(employee_id,bi.upkeepPerson) ) upkeepPersonCount,
-        (select  GROUP_CONCAT(phone) from t_employee where FIND_IN_SET( employee_id,upkeepPerson) ) upkeepPersonPhone
+        (select  GROUP_CONCAT(phone) from t_employee where FIND_IN_SET( employee_id,upkeepPerson) ) upkeepPersonPhone,
+        if(bi.status= 0,DATEDIFF(now(),bi.plantime),DATEDIFF(bi.completeTime,bi.plantime )) appTs
         from biginspection bi
         from biginspection bi
         <where>
         <where>
             id = #{id}
             id = #{id}

+ 11 - 2
smart-admin-api/sa-admin/src/main/resources/mapper/gm/partapply/partapply.xml

@@ -49,8 +49,8 @@
 
 
 
 
     <select id="getPartapplyList" resultType="net.lab1024.sa.admin.module.gm.partapply.domain.vo.PartapplyVo">
     <select id="getPartapplyList" resultType="net.lab1024.sa.admin.module.gm.partapply.domain.vo.PartapplyVo">
-        select p.id,p.partCode, p.partName, p.price, p.unit, p.amount, p.sumPrice,p.bigId, p.note, p.reportery,bp.applyDate,p.sort,
-               te.actual_name empName,ifnull(p.lgort,'') lgort
+        select bp.pastureId,p.id,p.partCode, p.partName, p.price, p.unit, p.amount, p.sumPrice,p.bigId, p.note, p.reportery,bp.applyDate,p.sort,
+               te.actual_name empName,ifnull(p.lgort,'') lgort,( select status from audit where code = bp.applyCode) status,p.sapStatus
         from partapply p
         from partapply p
         join bigpartapply bp on bp.id = p.bigid
         join bigpartapply bp on bp.id = p.bigid
         join t_employee te on te.employee_id = bp.empId
         join t_employee te on te.employee_id = bp.empId
@@ -59,6 +59,7 @@
             and (bp.RUCode = #{wxCode} or #{wxCode} = '' )
             and (bp.RUCode = #{wxCode} or #{wxCode} = '' )
             and (( select status from audit where code = bp.applyCode) =  #{status} or #{status} = '' )
             and (( select status from audit where code = bp.applyCode) =  #{status} or #{status} = '' )
         </where>
         </where>
+        order by bp.creatTime,p.sort
     </select>
     </select>
 
 
     <select id="getPartapplyListCount"  resultType="java.lang.Integer">
     <select id="getPartapplyListCount"  resultType="java.lang.Integer">
@@ -109,5 +110,13 @@
     <delete id="delBigPartapply">
     <delete id="delBigPartapply">
        delete bp,p  from bigpartapply bp join partapply p on p.bigid = bp.id   where bp.id = #{id}
        delete bp,p  from bigpartapply bp join partapply p on p.bigid = bp.id   where bp.id = #{id}
     </delete>
     </delete>
+
+    <update id="editPartapplySapStauts">
+        update partapply
+        set sapStatus = 1
+        where id = #{id}
+    </update>
+
+
 </mapper>
 </mapper>
 
 

+ 48 - 7
smart-admin-api/sa-admin/src/main/resources/mapper/gm/repair/RepairMapper.xml

@@ -6,9 +6,49 @@
 
 
 
 
     <select id="queryRepairList" resultType="net.lab1024.sa.admin.module.gm.repair.domain.vo.RepirVo">
     <select id="queryRepairList" resultType="net.lab1024.sa.admin.module.gm.repair.domain.vo.RepirVo">
-        select r.*,audit.sapCode,audit.code,audit.processed,audit.createUserId,audit.personnelID,audit.flowCompeleted,
+        select r.id,
+        r.qmnum,
+        r.qmart,
+        r.qmartx,
+        r.qmtxt,
+        r.zznoti_status,
+        r.qmdab,
+        r.qmzab,
+        r.equnr,
+        r.parnr,
+        r.ktext,
+        r.parnr_name,
+        r.qmnam,
+        r.qmnam_name,
+        r.qmdat,
+        r.mzeit,
+        r.strmn,
+        r.strur,
+        r.ltrmn,
+        r.ltrur,
+        r.priok,
+        r.msaus,
+        r.revnr,
+        r.otgrp,
+        r.otgrp_txt,
+        r.oteil,
+        r.oteil_txt,
+        r.fegrp,
+        r.fegrp_txt,
+        r.fecod,
+        r.fecod_txt,
+        r.fetxt,
+        r.urgrp,
+        r.urgrp_txt,
+        r.urcod,
+        r.urcod_txt,
+        r.urtxt,
+        r.price_unit,
+        r.outsource,
+        r.participant,
+        r.isOutsource,audit.sapCode,audit.code,audit.processed,audit.createUserId,audit.personnelID,audit.flowCompeleted,
                audit.status,audit.date,e.swerk,e.gewrk,e.iwerk,t.pltxt,t.tplnr,cu.actual_name as createUserName,e.eqName EQKTX,
                audit.status,audit.date,e.swerk,e.gewrk,e.iwerk,t.pltxt,t.tplnr,cu.actual_name as createUserName,e.eqName EQKTX,
-               e.id eqId,cu.phone,audit.pick,r.oteil_txt oteiltxt,te.actual_name qmnamName
+               e.id eqId,cu.phone,audit.pick,r.oteil_txt oteiltxt,cu.actual_name qmnamName
         from repair r
         from repair r
         join  audit on  audit.code = r.qmnum
         join  audit on  audit.code = r.qmnum
         left join  equipment e  on e.eqCode = audit.eqCode
         left join  equipment e  on e.eqCode = audit.eqCode
@@ -22,7 +62,7 @@
             and  ( audit.status = #{status} or #{status} = '')
             and  ( audit.status = #{status} or #{status} = '')
             and (audit.pick= #{pick}  or '' = #{pick} )
             and (audit.pick= #{pick}  or '' = #{pick} )
             and (e.pastureId= #{pastureId}  or '' = #{pastureId} )
             and (e.pastureId= #{pastureId}  or '' = #{pastureId} )
-            and (#{eqNameOrEmpName} = '' or audit.eqName like concat('%',#{eqNameOrEmpName},'%') or
+            and (#{eqNameOrEmpName} = '' or e.eqCode like concat('%',#{eqNameOrEmpName},'%') or audit.eqName like concat('%',#{eqNameOrEmpName},'%') or
             FIND_IN_SET((select employee_id from t_employee where actual_name = #{eqNameOrEmpName}   and pastureId = #{pastureId} limit 1 ),audit.personnelID))
             FIND_IN_SET((select employee_id from t_employee where actual_name = #{eqNameOrEmpName}   and pastureId = #{pastureId} limit 1 ),audit.personnelID))
         and audit.status = 0
         and audit.status = 0
         </where>
         </where>
@@ -115,12 +155,11 @@
         r.urcod,
         r.urcod,
         r.urcod_txt,
         r.urcod_txt,
         r.urtxt,
         r.urtxt,
-        r.processed,
         r.price_unit,
         r.price_unit,
         r.outsource,
         r.outsource,
         r.participant,
         r.participant,
         r.isOutsource,a.code,a.processed,a.createUserId,a.personnelID,a.flowCompeleted,a.status,a.AUFNR,
         r.isOutsource,a.code,a.processed,a.createUserId,a.personnelID,a.flowCompeleted,a.status,a.AUFNR,
-        a.date,e.swerk,e.tplnr,cu.actual_name as createUserName,e.CompanyCode,e.CostCenter,e.iwerk,
+        a.date,e.swerk,e.tplnr,cu.actual_name as createUserName,e.CompanyCode,e.CostCenter,e.iwerk,e.pastureId,
         t.lgwid1,a.sapCode,e.gewrk,
         t.lgwid1,a.sapCode,e.gewrk,
         a.`oneAudit`,
         a.`oneAudit`,
         a.`oneAuditName` ,
         a.`oneAuditName` ,
@@ -129,7 +168,7 @@
         a.`twoAuditName` ,
         a.`twoAuditName` ,
         a.`twoAuditTime` ,
         a.`twoAuditTime` ,
         a.`threeAudit` ,
         a.`threeAudit` ,
-        a.`threeAuditName` ,
+        a.`threeAuditName` ,a.pick,
         a.`threeAuditTime`,a.note,t.pltxt,e.eqName,
         a.`threeAuditTime`,a.note,t.pltxt,e.eqName,
         round((TIMESTAMPDIFF(SECOND,  a.pickTime, a.completionTime) - ifnull((SELECT sum(TIMESTAMPDIFF(	SECOND,w1.date,( SELECT date FROM wxprocess WHERE wxcode = w1.wxcode AND STATUS = 1 AND date > w1.date ORDER BY date ASC LIMIT 1 )))
         round((TIMESTAMPDIFF(SECOND,  a.pickTime, a.completionTime) - ifnull((SELECT sum(TIMESTAMPDIFF(	SECOND,w1.date,( SELECT date FROM wxprocess WHERE wxcode = w1.wxcode AND STATUS = 1 AND date > w1.date ORDER BY date ASC LIMIT 1 )))
         FROM wxprocess w1 WHERE wxcode = a.code AND STATUS = 0),0)) /60/60,2) gsTime,
         FROM wxprocess w1 WHERE wxcode = a.code AND STATUS = 0),0)) /60/60,2) gsTime,
@@ -154,4 +193,6 @@
         UPDATE audit SET AUFNR = #{AUFNR}
         UPDATE audit SET AUFNR = #{AUFNR}
         where sapCode = #{sapCode}
         where sapCode = #{sapCode}
     </update>
     </update>
-</mapper>
+</mapper>
+
+

+ 4 - 4
smart-admin-api/sa-admin/src/main/resources/mapper/gm/takestock/TakeStockMapper.xml

@@ -17,7 +17,7 @@
         join equipment eq on eq.eqCode = ts.eqCode
         join equipment eq on eq.eqCode = ts.eqCode
 
 
         <where>
         <where>
-            ts.pastureId = #{fromPastureId}  and
+           ( ts.pastureId = #{fromPastureId})  and
             ((eq.eqName  like concat("%",#{eqCodeOrName},"%")  or #{eqCodeOrName} = '')  or (eq.eqCode like concat("%",#{eqCodeOrName},"%") or #{eqCodeOrName} = ''))
             ((eq.eqName  like concat("%",#{eqCodeOrName},"%")  or #{eqCodeOrName} = '')  or (eq.eqCode like concat("%",#{eqCodeOrName},"%") or #{eqCodeOrName} = ''))
             and ts.status = #{fromStatus}
             and ts.status = #{fromStatus}
             and (completeTime between #{startDate} and DATE_SUB(#{endDate}, INTERVAL -1 DAY) or (#{startDate} = '' and #{endDate} = '' ))
             and (completeTime between #{startDate} and DATE_SUB(#{endDate}, INTERVAL -1 DAY) or (#{startDate} = '' and #{endDate} = '' ))
@@ -29,7 +29,7 @@
         join equipment eq on eq.eqCode = ts.eqCode
         join equipment eq on eq.eqCode = ts.eqCode
 
 
         <where>
         <where>
-            ts.pastureId = #{fromPastureId} and
+            ( ts.pastureId = #{fromPastureId} )  and
             ((eq.eqName  like concat("%",#{eqCodeOrName},"%")  or #{eqCodeOrName} = '')  or (eq.eqCode like concat("%",#{eqCodeOrName},"%") or #{eqCodeOrName} = ''))
             ((eq.eqName  like concat("%",#{eqCodeOrName},"%")  or #{eqCodeOrName} = '')  or (eq.eqCode like concat("%",#{eqCodeOrName},"%") or #{eqCodeOrName} = ''))
         and  ts.status = #{fromStatus}
         and  ts.status = #{fromStatus}
             and (completeTime between #{startDate} and DATE_SUB(#{endDate}, INTERVAL -1 DAY) or (#{startDate} = '' and #{endDate} = '' ))
             and (completeTime between #{startDate} and DATE_SUB(#{endDate}, INTERVAL -1 DAY) or (#{startDate} = '' and #{endDate} = '' ))
@@ -37,9 +37,9 @@
     </select>
     </select>
 
 
     <select id="getTakeStock" resultType="net.lab1024.sa.admin.module.gm.takestock.domain.vo.TakeStockVo">
     <select id="getTakeStock" resultType="net.lab1024.sa.admin.module.gm.takestock.domain.vo.TakeStockVo">
-        select  ts.*,p.factorycode SWERK ,p.companycode BUKRS,eq.tplnr tplnr,eq.pltxt pltxt  from takestock ts join pasture p on p.id= ts.pastureId
+        select  ts.*,p.factorycode SWERK ,p.companycode BUKRS,eq.tplnr tplnr,eq.gewrk GEWRK,eq.pltxt pltxt
+        from takestock ts join pasture p on p.id= ts.pastureId
         join equipment eq on eq.eqCode = ts.eqCode
         join equipment eq on eq.eqCode = ts.eqCode
-
         <where>
         <where>
             ts.pdCode = #{fromPdCode}
             ts.pdCode = #{fromPdCode}
         </where>
         </where>

+ 14 - 7
smart-admin-api/sa-admin/src/main/resources/mapper/system/employee/EmployeeMapper.xml

@@ -199,7 +199,7 @@
             </if>
             </if>
             and  (t_department.department_id = #{departmentId}  or '' = #{departmentId}  )
             and  (t_department.department_id = #{departmentId}  or '' = #{departmentId}  )
             and  (t_employee.actual_name = #{name}  or '' = #{name}  )
             and  (t_employee.actual_name = #{name}  or '' = #{name}  )
-            and  (p.id = #{pastureId}  or '' = #{pastureId}  )
+            and  (p.id = #{pastureId}  or '' = #{pastureId})
             and  (p.name like concat('%',#{pastureName},'%')  or '' = #{pastureName}  )
             and  (p.name like concat('%',#{pastureName},'%')  or '' = #{pastureName}  )
         and  (t_employee.login_name like concat('%',#{loginName},'%')  or '' = #{loginName}  )
         and  (t_employee.login_name like concat('%',#{loginName},'%')  or '' = #{loginName}  )
             and  ( #{roleId} = '' or #{roleId} in(select role_id from t_role_employee where t_role_employee.employee_id = t_employee.employee_id) )
             and  ( #{roleId} = '' or #{roleId} in(select role_id from t_role_employee where t_role_employee.employee_id = t_employee.employee_id) )
@@ -240,18 +240,18 @@
     </update>
     </update>
 
 
     <insert id="addSapEmployee">
     <insert id="addSapEmployee">
-        INSERT INTO `gmeq`.`t_employee` (`login_name`, `login_pwd`, `actual_name`, `gender`, `phone`, `department_id`, `disabled_flag`,
+        INSERT INTO `gmeq`.`t_employee` (department_code,`login_name`, `login_pwd`, `actual_name`, `gender`, `phone`, `disabled_flag`,
         `deleted_flag`, `remark`, `update_time`, `pastureid`, `birthday`, `nation`, `nation_code`, `education`, `education_code`, `werks`,
         `deleted_flag`, `remark`, `update_time`, `pastureid`, `birthday`, `nation`, `nation_code`, `education`, `education_code`, `werks`,
         `werks_txt`, `kostl`, `ktext`, `plans`, `plans_txt`, `xcdj`, `bgdh`, `address`, `email`, `zzsts`, `zzsts_txt`, `nationality`, `nationality_code`,
         `werks_txt`, `kostl`, `ktext`, `plans`, `plans_txt`, `xcdj`, `bgdh`, `address`, `email`, `zzsts`, `zzsts_txt`, `nationality`, `nationality_code`,
         `entrydate`, `dimissiondate`, `iseffect`)
         `entrydate`, `dimissiondate`, `iseffect`)
-        VALUES (#{from.ZHR_PERNR},"55f1ed48a59fcddf19718a03e2099b6e",#{from.ZHR_ENAME},
-                #{from.ZHR_GESCH},#{from.ZHR_MOBILEPHONE},(select department_id from t_department where name = '无部门' and pastureid = (select id from pasture where companycode = #{from.ZHR_WERKS} limit 1) ),0
-                ,0,"sap",now(),(select id from pasture where companycode = #{from.ZHR_WERKS} limit 1),#{from.ZHR_GBDAT},#{from.ZHR_ZZMZU_T},#{from.ZHR_ZZMZU},#{from.ZHR_ZJY_T},#{from.ZHR_ZJY},
+        VALUES (#{from.ZHR_ORGEH},#{from.ZHR_PERNR},"1dae0a04c0c9b5a78885e170e709305d",#{from.ZHR_ENAME},
+                #{from.ZHR_GESCH},#{from.ZHR_MOBILEPHONE},0
+                ,0,"sap",now(), 1245,#{from.ZHR_GBDAT},#{from.ZHR_ZZMZU_T},#{from.ZHR_ZZMZU},#{from.ZHR_ZJY_T},#{from.ZHR_ZJY},
                 #{from.ZHR_WERKS},#{from.ZHR_WERKS_T},#{from.KOSTL},#{from.KTEXT},#{from.ZHR_PLANS},#{from.ZHR_PLANS_T},#{from.ZHR_XCDJ},#{from.ZHR_BGDH},
                 #{from.ZHR_WERKS},#{from.ZHR_WERKS_T},#{from.KOSTL},#{from.KTEXT},#{from.ZHR_PLANS},#{from.ZHR_PLANS_T},#{from.ZHR_XCDJ},#{from.ZHR_BGDH},
                 #{from.ZHR_ADDRESS},#{from.ZHR_EMAIL},#{from.ZHR_ZZSTS},#{from.ZHR_ZZSTS_T},#{from.ZHR_NATIO},#{from.ZHR_NATIO_T},#{from.ZHR_ZRZDATE},#{from.ZHR_ZLZDATE},
                 #{from.ZHR_ADDRESS},#{from.ZHR_EMAIL},#{from.ZHR_ZZSTS},#{from.ZHR_ZZSTS_T},#{from.ZHR_NATIO},#{from.ZHR_NATIO_T},#{from.ZHR_ZRZDATE},#{from.ZHR_ZLZDATE},
                 #{from.ZHR_ISEFFECT})
                 #{from.ZHR_ISEFFECT})
-    ON DUPLICATE KEY UPDATE   actual_name = #{from.ZHR_ENAME}, gender=#{from.ZHR_GESCH} , phone= #{from.ZHR_MOBILEPHONE}, department_id= (select department_id from t_department where name = '无部门' and pastureid = (select id from pasture where companycode = #{from.ZHR_WERKS} limit 1) ),
-     update_time = now(), pastureid = (select id from pasture where companycode = #{from.ZHR_WERKS} limit 1), birthday = #{from.ZHR_GBDAT}, nation = #{from.ZHR_ZZMZU_T}, nation_code = #{from.ZHR_ZZMZU}, education = #{from.ZHR_ZJY_T}, education_code =#{from.ZHR_ZJY} , werks = #{from.ZHR_WERKS},
+    ON DUPLICATE KEY UPDATE  department_code = #{from.ZHR_ORGEH}, actual_name = #{from.ZHR_ENAME}, gender=#{from.ZHR_GESCH} , phone= #{from.ZHR_MOBILEPHONE},
+     update_time = now(), birthday = #{from.ZHR_GBDAT}, nation = #{from.ZHR_ZZMZU_T}, nation_code = #{from.ZHR_ZZMZU}, education = #{from.ZHR_ZJY_T}, education_code =#{from.ZHR_ZJY} , werks = #{from.ZHR_WERKS},
     werks_txt = #{from.ZHR_WERKS_T}, kostl = #{from.KOSTL}, ktext = #{from.KTEXT}, plans =#{from.ZHR_PLANS} , plans_txt = #{from.ZHR_PLANS_T}, xcdj = #{from.ZHR_XCDJ},
     werks_txt = #{from.ZHR_WERKS_T}, kostl = #{from.KOSTL}, ktext = #{from.KTEXT}, plans =#{from.ZHR_PLANS} , plans_txt = #{from.ZHR_PLANS_T}, xcdj = #{from.ZHR_XCDJ},
         bgdh = #{from.ZHR_BGDH}, address = #{from.ZHR_ADDRESS} , email = #{from.ZHR_EMAIL}, zzsts = #{from.ZHR_ZZSTS}, zzsts_txt = #{from.ZHR_ZZSTS_T}, nationality = #{from.ZHR_NATIO},
         bgdh = #{from.ZHR_BGDH}, address = #{from.ZHR_ADDRESS} , email = #{from.ZHR_EMAIL}, zzsts = #{from.ZHR_ZZSTS}, zzsts_txt = #{from.ZHR_ZZSTS_T}, nationality = #{from.ZHR_NATIO},
         nationality_code = #{from.ZHR_NATIO_T},entrydate = #{from.ZHR_ZRZDATE}, dimissiondate = #{from.ZHR_ZLZDATE} , iseffect = #{from.ZHR_ISEFFECT}
         nationality_code = #{from.ZHR_NATIO_T},entrydate = #{from.ZHR_ZRZDATE}, dimissiondate = #{from.ZHR_ZLZDATE} , iseffect = #{from.ZHR_ISEFFECT}
@@ -292,5 +292,12 @@
     </select>
     </select>
 
 
 
 
+    <update id="editEmployeePasture">
+        UPDATE t_employee
+        SET pastureId = #{from.pastureId} ,lrzx = (select lrzx from pasture where id = #{from.pastureId}),
+            department_id = (select department_id from t_department where pastureid = #{from.pastureId} and name = '无部门' )
+        WHERE employee_id = #{from.empId}
+    </update>
+
 </mapper>
 </mapper>
 
 

+ 10 - 0
smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleEmployeeMapper.xml

@@ -175,4 +175,14 @@
                 LEFT JOIN t_role  ON t_role.role_id = t_role_employee.role_id
                 LEFT JOIN t_role  ON t_role.role_id = t_role_employee.role_id
     </select>
     </select>
 
 
+
+
+    <select id="getEquipmentEmpRole"  resultType="net.lab1024.sa.admin.module.system.role.domain.vo.EquipmentEmpRoleVo">
+    select te.employee_id  employeeId,te.login_name loginName from t_employee te
+    join t_role_employee tre on tre.employee_id = te.employee_id
+    join t_role tr on tr.role_id = tre.role_id
+    where te.pastureid = #{pastureId}  and tr.role_name = '设备主管'
+    </select>
+
+
 </mapper>
 </mapper>

+ 4 - 0
smart-admin-api/sa-admin/src/main/resources/mapper/system/role/RoleMapper.xml

@@ -25,4 +25,8 @@
         FROM t_role
         FROM t_role
         WHERE (role_name = #{roleName} or #{roleName} = '' )
         WHERE (role_name = #{roleName} or #{roleName} = '' )
     </select>
     </select>
+
+    <update id="updateRoleDataRole">
+       update t_role set datarole = #{from.datarole}  where role_id = #{from.roleId}
+    </update>
 </mapper>
 </mapper>

+ 20 - 0
smart-admin-api/sa-admin/src/main/resources/pre/application.yaml

@@ -12,6 +12,26 @@ server:
 spring:
 spring:
   profiles:
   profiles:
     active: '@profiles.active@'
     active: '@profiles.active@'
+  druid:
+    username: druid
+    password: 1024
+    login:
+      enabled: false
+    method:
+      pointcut: net.lab1024.sa..*Service.*
+    stat-view-servlet:
+      enabled: false
+    spring:
+      datasource:
+        druid:
+          stat-view-servlet:
+            enabled: false
+          filter:
+            stat:
+              enabled: false
+              exclusions: /*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
+          web-stat-filter:
+            enabled: false
 
 
 # 项目配置
 # 项目配置
 project:
 project:

+ 3 - 6
smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/interceptor/AbstractInterceptor.java

@@ -71,6 +71,7 @@ public abstract class AbstractInterceptor implements HandlerInterceptor {
     @Override
     @Override
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
         // OPTIONS请求直接return
         // OPTIONS请求直接return
+
         if (HttpMethod.OPTIONS.toString().equals(request.getMethod())) {
         if (HttpMethod.OPTIONS.toString().equals(request.getMethod())) {
             response.setStatus(HttpStatus.NO_CONTENT.value());
             response.setStatus(HttpStatus.NO_CONTENT.value());
             return false;
             return false;
@@ -93,12 +94,8 @@ public abstract class AbstractInterceptor implements HandlerInterceptor {
         String xRequestToken = request.getParameter(RequestHeaderConst.TOKEN);
         String xRequestToken = request.getParameter(RequestHeaderConst.TOKEN);
         String xHeaderToken = request.getHeader(RequestHeaderConst.TOKEN);
         String xHeaderToken = request.getHeader(RequestHeaderConst.TOKEN);
         String xAccessToken = StringUtils.isNotBlank(xRequestToken) ? xRequestToken : xHeaderToken;
         String xAccessToken = StringUtils.isNotBlank(xRequestToken) ? xRequestToken : xHeaderToken;
-        System.out.println("1111111111111111111111111");
-        System.out.println(xHeaderToken);
-        System.out.println("22222222222222222222222222222");
-        System.out.println(xAccessToken);
-        System.out.println("3333333333333333333333");
-        System.out.println(StringUtils.isBlank(xAccessToken));
+
+
         // 包含token 则获取用户信息 并保存
         // 包含token 则获取用户信息 并保存
         if (StringUtils.isNotBlank(xAccessToken)) {
         if (StringUtils.isNotBlank(xAccessToken)) {
             RequestUser requestUser = userFunction().apply(xAccessToken);
             RequestUser requestUser = userFunction().apply(xAccessToken);

+ 0 - 1
smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/AbstractSecurityConfig.java

@@ -86,7 +86,6 @@ public abstract class AbstractSecurityConfig extends WebSecurityConfigurerAdapte
         httpSecurity.addFilterBefore(corsFilter, SecurityTokenFilter.class);
         httpSecurity.addFilterBefore(corsFilter, SecurityTokenFilter.class);
         // 禁用spring security 使用 X-Frame-Options防止网页被Frame
         // 禁用spring security 使用 X-Frame-Options防止网页被Frame
         httpSecurity.headers().frameOptions().disable();
         httpSecurity.headers().frameOptions().disable();
-
     }
     }
 
 
 
 

+ 80 - 0
smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/MyRequestWrapper.java

@@ -0,0 +1,80 @@
+package net.lab1024.sa.common.common.security;
+
+import javax.servlet.ReadListener;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import java.io.*;
+
+/**
+ * <p> @Title MyRequestWrapper
+ * <p> @Description 定制请求
+ *
+ * @author ACGkaka
+ * @date 2021/6/24 19:34
+ */
+public class MyRequestWrapper extends HttpServletRequestWrapper {
+
+    /** 每次读取8kb */
+    private static final int BUFFER_SIZE = 1024 * 8;
+
+    /** 请求体 */
+    private final String body;
+
+    /**
+     * 构造方法
+     */
+    public MyRequestWrapper(HttpServletRequest request) throws IOException {
+        super(request);
+        BufferedReader reader = request.getReader();
+        StringWriter writer = new StringWriter();
+        int read;
+        char[] buf = new char[BUFFER_SIZE];
+        while( ( read = reader.read(buf) ) != -1 ) {
+            writer.write(buf, 0, read);
+        }
+        this.body = writer.getBuffer().toString();
+    }
+
+    /**
+     * 获取请求体
+     *
+     * @return 请求体
+     */
+    public String getBody() {
+        return body;
+    }
+
+    @Override
+    public ServletInputStream getInputStream()  {
+        final ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes());
+        return new ServletInputStream() {
+
+            @Override
+            public boolean isFinished() {
+                return false;
+            }
+
+            @Override
+            public boolean isReady() {
+                return false;
+            }
+
+            @Override
+            public void setReadListener(ReadListener readListener) {
+
+            }
+
+            @Override
+            public int read(){
+                return bais.read();
+            }
+        };
+    }
+
+    @Override
+    public BufferedReader getReader(){
+        return new BufferedReader(new InputStreamReader(this.getInputStream()));
+    }
+
+}

+ 42 - 7
smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/common/security/SecurityTokenFilter.java

@@ -1,11 +1,14 @@
 package net.lab1024.sa.common.common.security;
 package net.lab1024.sa.common.common.security;
 
 
+
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import net.lab1024.sa.common.common.constant.RequestHeaderConst;
 import net.lab1024.sa.common.common.constant.RequestHeaderConst;
 import net.lab1024.sa.common.common.domain.RequestUser;
 import net.lab1024.sa.common.common.domain.RequestUser;
 import net.lab1024.sa.common.common.util.SmartRequestUtil;
 import net.lab1024.sa.common.common.util.SmartRequestUtil;
+import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
 import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
@@ -17,7 +20,6 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
 import java.util.function.BiFunction;
 import java.util.function.BiFunction;
-import java.util.function.Function;
 
 
 /**
 /**
  * 注意此处不能 加入@Component,否则对应ignoreUrl的相关请求 将会进入此Filter,并会覆盖CorsFilter
  * 注意此处不能 加入@Component,否则对应ignoreUrl的相关请求 将会进入此Filter,并会覆盖CorsFilter
@@ -31,34 +33,67 @@ import java.util.function.Function;
 @Slf4j
 @Slf4j
 public class SecurityTokenFilter extends OncePerRequestFilter {
 public class SecurityTokenFilter extends OncePerRequestFilter {
 
 
-    private BiFunction<String,HttpServletRequest, UserDetails> userFunction;
+    private BiFunction<String, HttpServletRequest, UserDetails> userFunction;
 
 
-    public SecurityTokenFilter(BiFunction<String,HttpServletRequest, UserDetails> userFunction) {
+    public SecurityTokenFilter(BiFunction<String, HttpServletRequest, UserDetails> userFunction) {
         this.userFunction = userFunction;
         this.userFunction = userFunction;
     }
     }
 
 
     @Override
     @Override
-    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
-            throws ServletException, IOException {
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
         //需要做token校验, 消息头的token优先于请求query参数的token
         //需要做token校验, 消息头的token优先于请求query参数的token
         String xHeaderToken = request.getHeader(RequestHeaderConst.TOKEN);
         String xHeaderToken = request.getHeader(RequestHeaderConst.TOKEN);
         String xRequestToken = request.getParameter(RequestHeaderConst.TOKEN);
         String xRequestToken = request.getParameter(RequestHeaderConst.TOKEN);
+        String timeout = request.getHeader("Timeout");
+        String sing = request.getHeader("Sing");
         String xAccessToken = null != xHeaderToken ? xHeaderToken : xRequestToken;
         String xAccessToken = null != xHeaderToken ? xHeaderToken : xRequestToken;
         if (StringUtils.isBlank(xAccessToken)) {
         if (StringUtils.isBlank(xAccessToken)) {
             chain.doFilter(request, response);
             chain.doFilter(request, response);
             return;
             return;
         }
         }
+
         //清理spring security
         //清理spring security
         SecurityContextHolder.clearContext();
         SecurityContextHolder.clearContext();
 
 
-        UserDetails loginUserDetail = userFunction.apply(xAccessToken,request);
+        MyRequestWrapper requestWrapper = null;
+        UserDetails loginUserDetail = userFunction.apply(xAccessToken, request);
+        if (!request.getRequestURI().equals("/login")) {
+            String requestBody;
+            if (!request.getRequestURI().equals("/authdata/image/upload")) {
+                requestWrapper = new MyRequestWrapper((HttpServletRequest) request);
+
+                if ("GET".equals(requestWrapper.getMethod())) {
+                    requestBody = request.getRequestURI() + "?" + requestWrapper.getQueryString();
+                } else {
+                    requestBody = request.getRequestURI() + "?" + requestWrapper.getBody();
+                }
+            } else {
+                requestBody = request.getRequestURI() + "?" + "{}";
+            }
+            System.out.println(requestBody);
+            String localSing = DigestUtils.md5Hex(DigestUtils.md5Hex(requestBody) + timeout + "gmmu");
+            System.out.println(localSing);
+            System.out.println(sing);
+            System.out.println(timeout);
+            if (!sing.equals(localSing)) {
+                chain.doFilter(request, response);
+                return;
+            }
+        }
+
         if (null != loginUserDetail) {
         if (null != loginUserDetail) {
             UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUserDetail, null, loginUserDetail.getAuthorities());
             UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUserDetail, null, loginUserDetail.getAuthorities());
             authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
             authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
             SecurityContextHolder.getContext().setAuthentication(authenticationToken);
             SecurityContextHolder.getContext().setAuthentication(authenticationToken);
             SmartRequestUtil.setRequestUser((RequestUser) loginUserDetail);
             SmartRequestUtil.setRequestUser((RequestUser) loginUserDetail);
+
         }
         }
         // 若未给予spring security上下文用户授权 则会授权失败 进入AuthenticationEntryPointImpl
         // 若未给予spring security上下文用户授权 则会授权失败 进入AuthenticationEntryPointImpl
-        chain.doFilter(request, response);
+        if (requestWrapper == null) {
+            chain.doFilter(request, response);
+        } else {
+            chain.doFilter(requestWrapper, response);
+        }
     }
     }
 }
 }
+

+ 4 - 4
smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/CorsFilterConfig.java

@@ -32,13 +32,13 @@ public class CorsFilterConfig {
         UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
         UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
         CorsConfiguration config = new CorsConfiguration();
         CorsConfiguration config = new CorsConfiguration();
         config.setAllowCredentials(true);
         config.setAllowCredentials(true);
-        // 设置访问源地址
+//        // 设置访问源地址
         config.addAllowedOriginPattern(accessControlAllowOrigin);
         config.addAllowedOriginPattern(accessControlAllowOrigin);
-        // 设置访问源请求头
+//        // 设置访问源请求头
         config.addAllowedHeader("*");
         config.addAllowedHeader("*");
-        // 设置访问源请求方法
+//        // 设置访问源请求方法
         config.addAllowedMethod("*");
         config.addAllowedMethod("*");
-        // 对接口配置跨域设置
+//        // 对接口配置跨域设置
         source.registerCorsConfiguration("/**", config);
         source.registerCorsConfiguration("/**", config);
         return new CorsFilter(source);
         return new CorsFilter(source);
     }
     }

+ 2 - 2
smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/config/DataSourceConfig.java

@@ -161,10 +161,10 @@ public class DataSourceConfig {
         servletRegistrationBean.addUrlMappings("/druid/*");
         servletRegistrationBean.addUrlMappings("/druid/*");
         Map<String, String> initParameters = new HashMap<String, String>();
         Map<String, String> initParameters = new HashMap<String, String>();
         //不设置用户名密码可以直接通过druid/index.html访问
         //不设置用户名密码可以直接通过druid/index.html访问
-        if (druidLoginEnable) {
+//        if (druidLoginEnable) {
             initParameters.put("loginUsername", druidUserName);
             initParameters.put("loginUsername", druidUserName);
             initParameters.put("loginPassword", druidPassword);
             initParameters.put("loginPassword", druidPassword);
-        }
+//        }
         initParameters.put("resetEnable", "false");
         initParameters.put("resetEnable", "false");
         servletRegistrationBean.setInitParameters(initParameters);
         servletRegistrationBean.setInitParameters(initParameters);
         return servletRegistrationBean;
         return servletRegistrationBean;

+ 2 - 1
smart-admin-api/sa-common/src/main/java/net/lab1024/sa/common/module/support/token/TokenService.java

@@ -217,4 +217,5 @@ public class TokenService {
             redisService.delete(this.generateTokenRedisKey(userId, userTypeEnum.getValue(), device.getValue()));
             redisService.delete(this.generateTokenRedisKey(userId, userTypeEnum.getValue(), device.getValue()));
         }
         }
     }
     }
-}
+}
+

+ 14 - 1
smart-admin-api/sa-common/src/main/resources/dev/sa-common.yaml

@@ -14,11 +14,24 @@ spring:
     filters: stat
     filters: stat
     druid:
     druid:
       username: druid
       username: druid
-      password: 1024
+      password: Gm@5418#
       login:
       login:
         enabled: false
         enabled: false
       method:
       method:
         pointcut: net.lab1024.sa..*Service.*
         pointcut: net.lab1024.sa..*Service.*
+      stat-view-servlet:
+        enabled: false
+      spring:
+        datasource:
+          druid:
+            stat-view-servlet:
+              enabled: false
+            filter:
+              stat:
+                enabled: false
+                exclusions: /*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
+            web-stat-filter:
+              enabled: false
 
 
   # mvc swagger bugfix
   # mvc swagger bugfix
   mvc:
   mvc:

+ 14 - 1
smart-admin-api/sa-common/src/main/resources/pre/sa-common.yaml

@@ -16,9 +16,22 @@ spring:
       username: druid
       username: druid
       password: 1024
       password: 1024
       login:
       login:
-        enabled: true
+        enabled: false
       method:
       method:
         pointcut: net.lab1024.sa..*Service.*
         pointcut: net.lab1024.sa..*Service.*
+      stat-view-servlet:
+        enabled: false
+      spring:
+        datasource:
+          druid:
+            stat-view-servlet:
+              enabled: false
+            filter:
+              stat:
+                enabled: false
+                exclusions: /*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
+            web-stat-filter:
+              enabled: false
 
 
   # mvc swagger bugfix
   # mvc swagger bugfix
   mvc:
   mvc:

+ 14 - 1
smart-admin-api/sa-common/src/main/resources/test/sa-common.yaml

@@ -16,9 +16,22 @@ spring:
       username: druid
       username: druid
       password: 1024
       password: 1024
       login:
       login:
-        enabled: true
+        enabled: false
       method:
       method:
         pointcut: net.lab1024.sa..*Service.*
         pointcut: net.lab1024.sa..*Service.*
+      stat-view-servlet:
+        enabled: false
+      spring:
+        datasource:
+          druid:
+            stat-view-servlet:
+              enabled: false
+            filter:
+              stat:
+                enabled: false
+                exclusions: /*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
+            web-stat-filter:
+              enabled: false
 
 
   # mvc swagger bugfix
   # mvc swagger bugfix
   mvc:
   mvc:

部分文件因为文件数量过多而无法显示