CMM 1 year ago
parent
commit
0f427bca97
45 changed files with 644 additions and 222 deletions
  1. +0
    -200
      hs_err_pid50732.log
  2. BIN
      pmapi/lib/agent-boot-1.3.22.0215.jar
  3. BIN
      pmapi/lib/commons-compress-1.19.jar
  4. BIN
      pmapi/lib/commons-io-2.5.jar
  5. BIN
      pmapi/lib/commons-lang-2.6.jar
  6. BIN
      pmapi/lib/commons-lang3-3.8.1.jar
  7. BIN
      pmapi/lib/commons-logging-1.1.1.jar
  8. BIN
      pmapi/lib/dom4j-2.0.2.jar
  9. BIN
      pmapi/lib/gson-2.8.0.jar
  10. BIN
      pmapi/lib/httpclient-4.5.13.jar
  11. BIN
      pmapi/lib/httpcore-4.4.13.jar
  12. BIN
      pmapi/lib/httpmime-4.5.13.jar
  13. BIN
      pmapi/lib/jbArchivesTools-1.0-SNAPSHOT.jar
  14. BIN
      pmapi/lib/ofd-simple-tool-1.0.23.0324.jar
  15. BIN
      pmapi/lib/slf4j-api-1.7.29.jar
  16. BIN
      pmapi/lib/slf4j-simple-1.7.26.jar
  17. BIN
      pmapi/lib/suwell-agent-http-1.7.220630.jar
  18. BIN
      pmapi/lib/suwell-agent-wrapper-1.6.221208.jar
  19. BIN
      pmapi/lib/suwell-bank-extend-1.8.28.0627-sgcc.jar
  20. BIN
      pmapi/lib/suwell-convert-base-1.5.19.0408.jar
  21. BIN
      pmapi/lib/suwell-core-base-1.7.220623-lite.jar
  22. BIN
      pmapi/lib/suwell-extend-1.0.22.0804.jar
  23. BIN
      pmapi/lib/suwell-packet-wrapper-1.21.230306.jar
  24. BIN
      pmapi/lib/suwell-rpc-manager-client-2.7.211125.jar
  25. +110
    -0
      pmapi/pom.xml
  26. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java
  27. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java
  28. +88
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/ProjectIrsManage.java
  29. +1
    -21
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java
  30. +48
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  31. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/wps/contants/WpsContant.java
  32. +82
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/wps/controller/WpsConvertController.java
  33. +175
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/wps/manage/WpsConvertManage.java
  34. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/wps/service/IConvertService.java
  35. +19
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/wps/service/impl/ConvertService.java
  36. +5
    -0
      pmapi/src/main/resources/application-dev.yml
  37. +5
    -0
      pmapi/src/main/resources/application-pre.yml
  38. +5
    -0
      pmapi/src/main/resources/application-prod.yml
  39. +2
    -0
      pmapi/src/main/resources/security/auth-dev.yml
  40. +2
    -0
      pmapi/src/main/resources/security/auth-pre.yml
  41. +2
    -0
      pmapi/src/main/resources/security/auth-prod.yml
  42. +60
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest4.java
  43. +5
    -0
      pmapi/src/test/resources/application-dev.yml
  44. +5
    -0
      pmapi/src/test/resources/application-pre.yml
  45. +5
    -0
      pmapi/src/test/resources/application-prod.yml

+ 0
- 200
hs_err_pid50732.log View File

@@ -1,200 +0,0 @@
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 532676608 bytes for Failed to commit area from 0x0000000604400000 to 0x0000000624000000 of length 532676608.
# 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=
# This output file may be truncated or incomplete.
#
# Out of Memory Error (src/hotspot/os/windows/os_windows.cpp:3627), pid=50732, tid=468
#
# JRE version: (11.0.15+10) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.15+10-b2043.56, mixed mode, sharing, tiered, compressed oops, g1 gc, windows-amd64)
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#

--------------- S U M M A R Y ------------

Command Line: git4idea.http.GitAskPassApp Username for 'http://git.ningdatech.com':

Host: 12th Gen Intel(R) Core(TM) i9-12900H, 20 cores, 31G, Windows 11 , 64 bit Build 22621 (10.0.22621.1928)
Time: Mon Aug 7 10:27:38 2023 Windows 11 , 64 bit Build 22621 (10.0.22621.1928) elapsed time: 0.022779 seconds (0d 0h 0m 0s)

--------------- T H R E A D ---------------

Current thread (0x000002df0ddfd800): JavaThread "Unknown thread" [_thread_in_vm, id=468, stack(0x000000e5e2300000,0x000000e5e2400000)]

Stack: [0x000000e5e2300000,0x000000e5e2400000]
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x61612a]
V [jvm.dll+0x79c450]
V [jvm.dll+0x79da6d]
V [jvm.dll+0x79e143]
V [jvm.dll+0x24cc18]
V [jvm.dll+0x613174]
V [jvm.dll+0x607e55]
V [jvm.dll+0x30b1cb]
V [jvm.dll+0x30b13a]
V [jvm.dll+0x30b012]
V [jvm.dll+0x30ff76]
V [jvm.dll+0x35b4c3]
V [jvm.dll+0x35bbc6]
V [jvm.dll+0x35b5c3]
V [jvm.dll+0x2e5918]
V [jvm.dll+0x2e6ab7]
V [jvm.dll+0x7794f7]
V [jvm.dll+0x77acec]
V [jvm.dll+0x368a59]
V [jvm.dll+0x75ce8e]
V [jvm.dll+0x3d6a33]
V [jvm.dll+0x3d9001]
C [jli.dll+0x536b]
C [ucrtbase.dll+0x29363]
C [KERNEL32.DLL+0x126ad]
C [ntdll.dll+0x5aa68]


--------------- P R O C E S S ---------------

Threads class SMR info:
_java_thread_list=0x000002df0ba385e0, length=0, elements={
}

Java Threads: ( => current thread )

Other Threads:
0x000002df0de18000 GCTaskThread "GC Thread#0" [stack: 0x000000e5e2400000,0x000000e5e2500000] [id=2344]
0x000002df0de98000 ConcurrentGCThread "G1 Main Marker" [stack: 0x000000e5e2500000,0x000000e5e2600000] [id=43216]
0x000002df0de9a800 ConcurrentGCThread "G1 Conc#0" [stack: 0x000000e5e2600000,0x000000e5e2700000] [id=30344]

[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe70616017]

VM state:not at safepoint (not fully initialized)

VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x000002df0ddfad60] Heap_lock - owner thread: 0x000002df0ddfd800

Heap address: 0x0000000604400000, size: 8124 MB, Compressed Oops mode: Non-zero based: 0x0000000604400000
Narrow klass base: 0x0000000000000000, Narrow klass shift: 0

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Classes redefined (0 events):
No events

Internal exceptions (0 events):
No events

Events (1 events):
Event: 0.016 Loaded shared library C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\zip.dll


Dynamic libraries:
0x00007ff796130000 - 0x00007ff79613a000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\java.exe
0x00007fff205f0000 - 0x00007fff20804000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x00007fff1f640000 - 0x00007fff1f702000 C:\WINDOWS\System32\KERNEL32.DLL
0x00007fff1d9f0000 - 0x00007fff1dd93000 C:\WINDOWS\System32\KERNELBASE.dll
0x00007fff1e0f0000 - 0x00007fff1e201000 C:\WINDOWS\System32\ucrtbase.dll
0x00007fff035a0000 - 0x00007fff035b9000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\jli.dll
0x00007ffef11a0000 - 0x00007ffef11b6000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\VCRUNTIME140.dll
0x00007fff1f000000 - 0x00007fff1f1aa000 C:\WINDOWS\System32\USER32.dll
0x00007fff1de60000 - 0x00007fff1de86000 C:\WINDOWS\System32\win32u.dll
0x00007fff1ed90000 - 0x00007fff1edb9000 C:\WINDOWS\System32\GDI32.dll
0x00007fff07f70000 - 0x00007fff081fe000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.1635_none_270f70857386168e\COMCTL32.dll
0x00007fff1e2b0000 - 0x00007fff1e3c9000 C:\WINDOWS\System32\gdi32full.dll
0x00007fff1edc0000 - 0x00007fff1ee67000 C:\WINDOWS\System32\msvcrt.dll
0x00007fff1e210000 - 0x00007fff1e2aa000 C:\WINDOWS\System32\msvcp_win.dll
0x00007fff1e440000 - 0x00007fff1e471000 C:\WINDOWS\System32\IMM32.DLL
0x00007ffea1c40000 - 0x00007ffea1cea000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\msvcp140.dll
0x00007ffe70320000 - 0x00007ffe70e9b000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\server\jvm.dll
0x00007fff20390000 - 0x00007fff2043e000 C:\WINDOWS\System32\ADVAPI32.dll
0x00007fff1fea0000 - 0x00007fff1ff44000 C:\WINDOWS\System32\sechost.dll
0x00007fff1eee0000 - 0x00007fff1eff7000 C:\WINDOWS\System32\RPCRT4.dll
0x00007fff1f1b0000 - 0x00007fff1f1b8000 C:\WINDOWS\System32\PSAPI.DLL
0x00007fff168f0000 - 0x00007fff168f9000 C:\WINDOWS\SYSTEM32\WSOCK32.dll
0x00007fff20440000 - 0x00007fff204b1000 C:\WINDOWS\System32\WS2_32.dll
0x00007fff0ea00000 - 0x00007fff0ea34000 C:\WINDOWS\SYSTEM32\WINMM.dll
0x00007fff1a930000 - 0x00007fff1a93a000 C:\WINDOWS\SYSTEM32\VERSION.dll
0x00007fff1ca90000 - 0x00007fff1caa8000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll
0x00007fff10140000 - 0x00007fff10151000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\verify.dll
0x00007fff1b360000 - 0x00007fff1b58e000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL
0x00007fff1f8d0000 - 0x00007fff1fc59000 C:\WINDOWS\System32\combase.dll
0x00007fff1ff90000 - 0x00007fff20067000 C:\WINDOWS\System32\OLEAUT32.dll
0x00007ffefbaa0000 - 0x00007ffefbad2000 C:\WINDOWS\SYSTEM32\dbgcore.DLL
0x00007fff1df00000 - 0x00007fff1df7a000 C:\WINDOWS\System32\bcryptPrimitives.dll
0x00007fff10110000 - 0x00007fff10139000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\java.dll
0x00007fff17290000 - 0x00007fff1729b000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\jimage.dll
0x00007fff03580000 - 0x00007fff03599000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\zip.dll

dbghelp: loaded successfully - version: 4.0.5 - missing functions: none
symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.1635_none_270f70857386168e;C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\server

VM Arguments:
java_command: git4idea.http.GitAskPassApp Username for 'http://git.ningdatech.com':
java_class_path (initial): C:/IDEA/IntelliJ IDEA 2022.1.4/plugins/git4idea/lib/git4idea-rt.jar;C:/IDEA/IntelliJ IDEA 2022.1.4/lib/externalProcess-rt.jar;C:/IDEA/IntelliJ IDEA 2022.1.4/lib/app.jar;C:/IDEA/IntelliJ IDEA 2022.1.4/lib/3rd-party-rt.jar
Launcher Type: SUN_STANDARD

[Global flags]
intx CICompilerCount = 12 {product} {ergonomic}
uint ConcGCThreads = 4 {product} {ergonomic}
uint G1ConcRefinementThreads = 15 {product} {ergonomic}
size_t G1HeapRegionSize = 2097152 {product} {ergonomic}
uintx GCDrainStackTargetSize = 64 {product} {ergonomic}
size_t InitialHeapSize = 532676608 {product} {ergonomic}
size_t MarkStackSize = 4194304 {product} {ergonomic}
size_t MaxHeapSize = 8518631424 {product} {ergonomic}
size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic}
uintx NonNMethodCodeHeapSize = 7594288 {pd product} {ergonomic}
uintx NonProfiledCodeHeapSize = 122031976 {pd product} {ergonomic}
uintx ProfiledCodeHeapSize = 122031976 {pd product} {ergonomic}
uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic}
bool SegmentedCodeCache = true {product} {ergonomic}
bool UseCompressedClassPointers = true {lp64_product} {ergonomic}
bool UseCompressedOops = true {lp64_product} {ergonomic}
bool UseG1GC = true {product} {ergonomic}
bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic}

Logging:
Log output configuration:
#0: stdout all=warning uptime,level,tags
#1: stderr all=off uptime,level,tags

Environment Variables:
JAVA_HOME=C:\IDEA\jdk\jdk-11.0.17
CLASSPATH=.;C:\IDEA\jdk\jdk-11.0.17\lib\dt.jar;C:\IDEA\jdk\jdk-11.0.17\lib\tools.jar;
PATH=D:\soft\Git\Git\mingw64\libexec\git-core;D:\soft\Git\Git\mingw64\libexec\git-core;D:\soft\Git\Git\mingw64\bin;D:\soft\Git\Git\usr\bin;C:\Users\CMM\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\IDEA\jdk\jdk-11.0.17\bi;C:\IDEA\jdk\jdk-11.0.17\jre\bin";D:\soft\Git\Git\cmd;D:\soft\Git\Git\usr\bin;D:\soft\Maven\apache-maven-3.8.6-bin\apache-maven-3.8.6\bin;D:\soft\MySQL Installer\MySQL8.0\bin;D:\soft\Nodejs;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D:\soft\putty;C:\Users\CMM\AppData\Local\Microsoft\WindowsApps;C:\Users\CMM\AppData\Roaming\npm;D:\soft\GoLand\GoLand 2019.3.3\bin;D:\soft\Pycharm\PyCharm Community Edition 2022.3.3\bin
USERNAME=CMM
DISPLAY=:0.0
LC_ALL=en_US.UTF-8
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 154 Stepping 3, GenuineIntel



--------------- S Y S T E M ---------------

OS: Windows 11 , 64 bit Build 22621 (10.0.22621.1928)
OS uptime: 11 days 17:18 hours

CPU:total 20 (initial active 20) (10 cores per cpu, 2 threads per core) family 6 model 154 stepping 3 microcode 0x41c, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx, sha, fma

Memory: 4k page, system-wide physical 32492M (784M free)
TotalPageFile size 58070M (AvailPageFile size 32M)
current process WorkingSet (physical memory assigned to process): 11M, peak: 11M
current process commit charge ("private bytes"): 76M, peak: 584M

vm_info: OpenJDK 64-Bit Server VM (11.0.15+10-b2043.56) for windows-amd64 JRE (11.0.15+10-b2043.56), built on May 16 2022 02:28:12 by "" with MS VC++ 14.0 (VS2015)

END.

BIN
pmapi/lib/agent-boot-1.3.22.0215.jar View File


BIN
pmapi/lib/commons-compress-1.19.jar View File


BIN
pmapi/lib/commons-io-2.5.jar View File


BIN
pmapi/lib/commons-lang-2.6.jar View File


BIN
pmapi/lib/commons-lang3-3.8.1.jar View File


BIN
pmapi/lib/commons-logging-1.1.1.jar View File


BIN
pmapi/lib/dom4j-2.0.2.jar View File


BIN
pmapi/lib/gson-2.8.0.jar View File


BIN
pmapi/lib/httpclient-4.5.13.jar View File


BIN
pmapi/lib/httpcore-4.4.13.jar View File


BIN
pmapi/lib/httpmime-4.5.13.jar View File


BIN
pmapi/lib/jbArchivesTools-1.0-SNAPSHOT.jar View File


BIN
pmapi/lib/ofd-simple-tool-1.0.23.0324.jar View File


BIN
pmapi/lib/slf4j-api-1.7.29.jar View File


BIN
pmapi/lib/slf4j-simple-1.7.26.jar View File


BIN
pmapi/lib/suwell-agent-http-1.7.220630.jar View File


BIN
pmapi/lib/suwell-agent-wrapper-1.6.221208.jar View File


BIN
pmapi/lib/suwell-bank-extend-1.8.28.0627-sgcc.jar View File


BIN
pmapi/lib/suwell-convert-base-1.5.19.0408.jar View File


BIN
pmapi/lib/suwell-core-base-1.7.220623-lite.jar View File


BIN
pmapi/lib/suwell-extend-1.0.22.0804.jar View File


BIN
pmapi/lib/suwell-packet-wrapper-1.21.230306.jar View File


BIN
pmapi/lib/suwell-rpc-manager-client-2.7.211125.jar View File


+ 110
- 0
pmapi/pom.xml View File

@@ -265,7 +265,117 @@
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
</dependency>
<dependency>
<groupId>com.agent</groupId>
<artifactId>agent-boot</artifactId>
<version>1.3.22</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/agent-boot-1.3.22.0215.jar</systemPath>
</dependency>

<dependency>
<groupId>com.agent</groupId>
<artifactId>agent-boot</artifactId>
<version>1.3.22</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/agent-boot-1.3.22.0215.jar</systemPath>
</dependency>

<dependency>
<groupId>com.suwell</groupId>
<artifactId>suwell-agent-http</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/suwell-agent-http-1.7.220630.jar</systemPath>
</dependency>

<dependency>
<groupId>com.suwell</groupId>
<artifactId>suwell-agent-wrapper</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/suwell-agent-wrapper-1.6.221208.jar</systemPath>
</dependency>

<dependency>
<groupId>com.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.29</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/slf4j-api-1.7.29.jar</systemPath>
</dependency>

<dependency>
<groupId>com.httpclient</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/httpclient-4.5.13.jar</systemPath>
</dependency>

<dependency>
<groupId>com.httpcore</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.13</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/httpcore-4.4.13.jar</systemPath>
</dependency>

<dependency>
<groupId>com.httpmime</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.13</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/httpmime-4.5.13.jar</systemPath>
</dependency>

<dependency>
<groupId>com.jbArchivesTools</groupId>
<artifactId>jbArchivesTools</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jbArchivesTools-1.0-SNAPSHOT.jar</systemPath>
</dependency>

<dependency>
<groupId>com.suwell</groupId>
<artifactId>suwell-convert-base</artifactId>
<version>1.5.19</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/suwell-convert-base-1.5.19.0408.jar</systemPath>
</dependency>

<dependency>
<groupId>com.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/gson-2.8.0.jar</systemPath>
</dependency>

<dependency>
<groupId>com.suwell</groupId>
<artifactId>suwell-rpc-manager-client</artifactId>
<version>2.7</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/suwell-rpc-manager-client-2.7.211125.jar</systemPath>
</dependency>

<dependency>
<groupId>com.suwell</groupId>
<artifactId>suwell-packet-wrapper</artifactId>
<version>1.21</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/suwell-packet-wrapper-1.21.230306.jar</systemPath>
</dependency>

<dependency>
<groupId>com.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.0.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/dom4j-2.0.2.jar</systemPath>
</dependency>

</dependencies>
<!-- 打包 -->


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java View File

@@ -90,4 +90,6 @@ public interface BizConst {
String ORG_CODE = "organizationCode";

String DEV = "dev";
String PRE = "pre";
String PROD = "prod";
}

+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java View File

@@ -34,7 +34,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
"com.ningdatech.pmapi.safety.controller",
"com.ningdatech.pmapi.portrait.controller",
"com.ningdatech.pmapi.irs.controller",
"com.ningdatech.pmapi.dashboard.controller"
"com.ningdatech.pmapi.dashboard.controller",
"com.ningdatech.pmapi.wps.controller"
})
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {



+ 88
- 0
pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/ProjectIrsManage.java View File

@@ -0,0 +1,88 @@
package com.ningdatech.pmapi.irs.manage;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ningdatech.irs.service.IRefreshTokenService;
import com.ningdatech.pmapi.common.util.CryptUtils;
import com.ningdatech.pmapi.common.util.HttpUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.security.NoSuchAlgorithmException;
import java.util.Objects;

/**
* @Classname ProjectIrsManage
* @Description
* @Date 2023/8/15 11:43
* @Author PoffyZhang
*/
@Component
@Slf4j
@RequiredArgsConstructor
public class ProjectIrsManage {

@Value("${irs.core-biz.appKey}")
private String appKey;

@Value("${irs.core-biz.appSecret}")
private String appSecret;

@Value("${irs.core-biz.url}")
private String coreBizUrl;

@Value("${irs.core-biz.interfaceName}")
private String interfaceName;
@Resource
private IRefreshTokenService refreshTokenService;

@Value("${irs.interface-refresh.request-token-url}")
private String govRequestTokenUrl;
@Value("${irs.interface-refresh.refresh-token-url}")
private String govRefreshTokenUrl;

/**
* 查询核心业务
*
* @param businessName
* @return
* @throws NoSuchAlgorithmException
*/
public JSONObject searchCoreBiz(String businessName,String orgCode) {
long timestamp = System.currentTimeMillis();
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl,
interfaceName, HttpMethod.POST.name());
String sign = null;
try{
sign = CryptUtils.MD5Encode(appKey + secret + timestamp);
}catch (Exception e){
log.error(e.getMessage());
}
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate;
if(Objects.nonNull(factory)){
restTemplate = new RestTemplate(factory);
}else{
restTemplate = new RestTemplate();
}

String url = coreBizUrl + "?" +
"dingCode=&matterName=" + businessName + "&oid=&useState=1&limit=10&page=1" +
"&appKey=" + appKey + "&sign=" + sign + "&requestTime=" + timestamp;

ResponseEntity<JSONObject> forEntity = restTemplate.getForEntity(url, JSONObject.class);
JSONObject body = forEntity.getBody();
log.info("body :{}",body);
JSONObject datas = body.getJSONObject("datas");
if(Objects.nonNull(datas)){
return datas;
}
return forEntity.getBody();
}
}

+ 1
- 21
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java View File

@@ -1,19 +1,13 @@
package com.ningdatech.pmapi.projectdeclared.controller;

import java.util.Iterator;

import javax.servlet.http.HttpServletResponse;

import com.ningdatech.log.annotation.WebLog;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.projectdeclared.contants.DeclaredProjectContant;
import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage;
import com.ningdatech.pmapi.projectdeclared.manage.ProjectAdjustmentManage;
import com.ningdatech.pmapi.projectdeclared.model.dto.DeclaredProjectListParamDTO;
@@ -54,21 +48,7 @@ public class DeclaredProjectController {
@ApiOperation(value = "核心业务列表", notes = "核心业务列表")
@GetMapping("/core-biz")
public JSONObject bizList(@RequestParam(required = false) String businessName) {
JSONObject jsonObject = JSONObject.parseObject(DeclaredProjectContant.Biz.CORE_BIZ);
if(StringUtils.isNotBlank(businessName)){
JSONArray dataArray = JSONArray.parseArray(jsonObject.getString("data"));
Iterator iter = dataArray.stream().iterator();
JSONArray dataArrayRes = new JSONArray();
while (iter.hasNext()) {
JSONObject value = (JSONObject) iter.next();
String businessValue = value.getString("matterName");
if(StringUtils.isNotBlank(businessValue) && businessValue.contains(businessName)){
dataArrayRes.add(value);
}
}
jsonObject.put("data",dataArrayRes);
}
return jsonObject;
return declaredProjectManage.bizList(businessName);
}

@ApiOperation(value = "申报项目草稿箱列表", notes = "申报项目草稿箱列表")


+ 48
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java View File

@@ -3,6 +3,8 @@ package com.ningdatech.pmapi.projectdeclared.manage;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -19,6 +21,8 @@ import com.ningdatech.pmapi.common.helper.RegionCacheHelper;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.common.util.ExcelExportStyle;
import com.ningdatech.pmapi.irs.manage.ProjectIrsManage;
import com.ningdatech.pmapi.projectdeclared.contants.DeclaredProjectContant;
import com.ningdatech.pmapi.projectdeclared.model.dto.*;
import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectDraft;
import com.ningdatech.pmapi.projectdeclared.model.vo.ProjectDraftVO;
@@ -37,6 +41,7 @@ import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.sys.manage.NoticeManage;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeConstant;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.bean.entity.WflowModels;
import com.wflow.exception.BusinessException;
@@ -48,6 +53,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@@ -87,6 +93,11 @@ public class DeclaredProjectManage {

private final RegionCacheHelper regionCacheHelper;

private final ProjectIrsManage projectIrsManage;

@Value("${spring.profiles.active}")
private String active;

/**
* 新项目 启动实例
*
@@ -414,4 +425,41 @@ public class DeclaredProjectManage {
throw new RuntimeException(e);
}
}

/**
* 查询 核心业务
* @param businessName
* @return
*/
public JSONObject bizList(String businessName) {
JSONObject jsonObject = new JSONObject();
UserInfoDetails user = LoginUserUtil.loginUserDetail();
if(BizConst.DEV.equals(active)){
jsonObject = JSONObject.parseObject(DeclaredProjectContant.Biz.CORE_BIZ);
if(StringUtils.isNotBlank(businessName)){
JSONArray dataArray = JSONArray.parseArray(jsonObject.getString("data"));
if(CollUtil.isEmpty(dataArray)){
return new JSONObject();
}
Iterator iter = dataArray.stream().iterator();
JSONArray dataArrayRes = new JSONArray();
while (iter.hasNext()) {
JSONObject value = (JSONObject) iter.next();
String businessValue = value.getString("matterName");
if(StringUtils.isNotBlank(businessValue) && businessValue.contains(businessName)){
dataArrayRes.add(value);
}
}
jsonObject.put("data",dataArrayRes);
}
}else if(BizConst.PRE.equals(active) ||
BizConst.PROD.equals(active)){
jsonObject = projectIrsManage.searchCoreBiz(businessName,user.getEmpPosUnitCode());
}
if(CollUtil.isEmpty(jsonObject)){
return jsonObject;
}

return jsonObject;
}
}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/wps/contants/WpsContant.java View File

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.wps.contants;

/**
* @Classname WpsContant
* @Description
* @Date 2023/8/15 14:09
* @Author PoffyZhang
*/
public interface WpsContant {

String WPS_CONVERT_URL_ONLINE = "http://10.53.157.47";
String FIX_FILE_PATH = "/opt/file/";
String PDF_PATH = "/opt/file/offices2pdf.pdf";
String PDF_CONTENT_TYPE = "application/pdf";
String PDF_NAME = "offices2pdf.pdf";
}

+ 82
- 0
pmapi/src/main/java/com/ningdatech/pmapi/wps/controller/WpsConvertController.java View File

@@ -0,0 +1,82 @@
package com.ningdatech.pmapi.wps.controller;

import com.ningdatech.irs.service.IRefreshTokenService;
import com.ningdatech.pmapi.common.util.CryptUtils;
import com.ningdatech.pmapi.common.util.HttpUtil;
import com.ningdatech.pmapi.wps.manage.WpsConvertManage;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.servlet.http.HttpServletResponse;
import java.security.NoSuchAlgorithmException;
import java.util.Objects;

/**
* @Classname WpsConvertController
* @Description
* @Date 2023/8/14 13:58
* @Author PoffyZhang
*/
@Slf4j
@RestController
@Api(tags = "待办中心控制器")
@RequestMapping("/api/v1/wps-convert")
public class WpsConvertController {
@Autowired
private IRefreshTokenService refreshTokenService;

@Autowired
private WpsConvertManage wpsConvertManage;


@Value("${irs.interface-refresh.request-token-url}")
private String govRequestTokenUrl;
@Value("${irs.interface-refresh.refresh-token-url}")
private String govRefreshTokenUrl;

@GetMapping("/office2pdf")
public String office2pdf(){
return wpsConvertManage.offs2Pdf();
}

@GetMapping("/downloadToPdfStream")
public void downloadToPdfStream(@RequestParam Long fileId, HttpServletResponse response){
wpsConvertManage.downloadToPdfStream(fileId,response);
}

@GetMapping("/test-core")
public String testCore() throws NoSuchAlgorithmException {
long timestamp = System.currentTimeMillis();
String appSecret = "496f0f2a19994f76b4fd9dae087366c7";
String appKey = "A331101453557202109017383";

String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl,
"Fc3re2cq7r64Qfa7", HttpMethod.POST.name());
String sign = CryptUtils.MD5Encode(appKey + secret + timestamp);
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate;
if(Objects.nonNull(factory)){
restTemplate = new RestTemplate(factory);
}else{
restTemplate = new RestTemplate();
}

String url = "https://interface.zjzwfw.gov.cn/gateway/api/001008012012001/dataSharing/Fc3re2cq7r64Qfa7.htm?" +
"dingCode=&matterName=&oid=&useState=1&limit=1000&page=1" +
"&appKey=" + appKey + "&sign=" + sign + "&requestTime=" + timestamp;

ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
log.info(forEntity.getBody());
return forEntity.getBody();
}
}

+ 175
- 0
pmapi/src/main/java/com/ningdatech/pmapi/wps/manage/WpsConvertManage.java View File

@@ -0,0 +1,175 @@
package com.ningdatech.pmapi.wps.manage;

import cn.hutool.core.util.CharsetUtil;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.OSSObject;
import com.aliyun.oss.model.ObjectMetadata;
import com.ningdatech.file.properties.FileServerProperties;
import com.ningdatech.file.service.FileService;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.wps.contants.WpsContant;
import com.suwell.ofd.custom.agent.AtomAgent;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

/**
* @Classname WpsConvertManage
* @Description
* @Date 2023/8/14 13:42
* @Author PoffyZhang
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class WpsConvertManage {

@Resource
private FileService fileService;

private final FileServerProperties fileServerProperties;

@Value("${spring.profiles.active}")
private String active;

// HTTPAgent ha = new HTTPAgent("http://127.0.0.1:8090");
//2、定义方法实现 多个文件合并转为1个pdf文件
public String offs2Pdf() {
AtomAgent ha = new AtomAgent("http://10.53.157.47");

try {

//2-1、传参文件对象转换输出PDF文件
//1)、定义集合,存储待转换的原文件
List<File> fileList =new ArrayList<File>();
//2)、定义转换后的pdf文件输出流
OutputStream out = null;
//3)、添加原文件到集合
fileList.add(new File("/temp/111.xlsx"));
// fileList.add(new File("D:/cs.doc"));
// fileList.add(new File("D:/a.pdf"));
// fileList.add(new File("D:\\555.ofd"));
//4)、赋值转换后的pdf文件输出流
out=new FileOutputStream(new File("/temp/offices2_pdf.pdf"));
//5)、调用方法,执行将多个文件转为pdf文件
ha.OFDToPDF(fileList, out);

//2-2、传参文件流转换输出PDF文件(与2-1二选一即可)
//1)、定义集合,存储待转换的原文件(支持传文件流)
// Param[] params = new Param[] {
// new Param(PackEntry.wrap(new FileInputStream("D:\\temp\\111.ofd")), "ofd"),
// new Param(PackEntry.wrap(new FileInputStream("D:\\2.ofd")), "ofd"),
// new Param(PackEntry.wrap(new FileInputStream("D:\\T3.txt")), "txt")
// };
//2)、赋值转换后的pdf文件输出流
// out=new FileOutputStream(new File("D:/convert/offices_pdf.pdf"));
//3)、调用方法,执行将多个文件转为pdf文件
// ha.OFDToPDF(params,out);
return "转换成功";
} catch (Exception e) {
log.error(e.getMessage());
} finally {
try {
//2-6、关闭资源
ha.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return "转换失败";
}

public void downloadToPdfStream(Long fileId, HttpServletResponse response) {
com.ningdatech.file.entity.File file = fileService.getById(fileId);
downloadAndToPdf(file, response);
}

private void downloadAndToPdf(com.ningdatech.file.entity.File file, HttpServletResponse response) {
OSS oss = new OSSClientBuilder().build(fileServerProperties.getAli().getEndpoint(), fileServerProperties.getAli().getAccessKeyId(), fileServerProperties.getAli().getAccessKeySecret());
AtomAgent ha = new AtomAgent(WpsContant.WPS_CONVERT_URL_ONLINE);
try (OSSObject ossObject = oss.getObject(file.getBucket(), file.getPath());
InputStream stream = ossObject.getObjectContent();
ServletOutputStream outputStream = response.getOutputStream()) {
String fileName = null;
byte[] bytes = new byte[4096];
int read;
//测试环境 转不了PDF 请求不了 WPS转换服务器
if(BizConst.DEV.equals(active)){
ObjectMetadata metadata = ossObject.getObjectMetadata();
response.setContentType(metadata.getContentType());
fileName = URLEncoder.encode(file.getOriginalFileName(), CharsetUtil.UTF_8);
response.setHeader("Content-Disposition", "attachment;filename*=utf-8''" + fileName);
while ((read = stream.read(bytes)) != -1) {
outputStream.write(bytes, 0, read);
}
}else if(BizConst.PRE.equals(active) ||
BizConst.PROD.equals(active)){
String filePath = WpsContant.FIX_FILE_PATH + file.getOriginalFileName();
convert(stream,filePath);
//转换PDF
List<File> fileList =new ArrayList<File>();
//2)、定义转换后的pdf文件输出流
OutputStream out = null;
//3)、添加原文件到集合
fileList.add(new File(filePath));
//4)、赋值转换后的pdf文件输出流
File pdfFile = new File(WpsContant.PDF_PATH);
out = new FileOutputStream(pdfFile);
//5)、调用方法,执行将多个文件转为pdf文件
ha.OFDToPDF(fileList, out);
FileInputStream fileInputStream = new FileInputStream(pdfFile);
response.setContentType(WpsContant.PDF_CONTENT_TYPE);
fileName = URLEncoder.encode(WpsContant.PDF_NAME, CharsetUtil.UTF_8);
response.setHeader("Content-Disposition", "attachment;filename*=utf-8''" + fileName);
while ((read = fileInputStream.read(bytes)) != -1) {
outputStream.write(bytes, 0, read);
}
for(File f : fileList){
//用完就删
f.deleteOnExit();
}
}
outputStream.flush();
}catch (Exception e){
log.error(e.getMessage());
}finally {
oss.shutdown();
try {
ha.close();
} catch (IOException e) {
log.error(e.getMessage());
}
}
}

public static void convert(InputStream inputStream, String filePath) {
try {
File file = new File(filePath);
FileOutputStream outputStream = new FileOutputStream(file);

int bytesRead;
byte[] buffer = new byte[1024];

while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}

outputStream.close();
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/wps/service/IConvertService.java View File

@@ -0,0 +1,5 @@
package com.ningdatech.pmapi.wps.service;

public interface IConvertService {

}

+ 19
- 0
pmapi/src/main/java/com/ningdatech/pmapi/wps/service/impl/ConvertService.java View File

@@ -0,0 +1,19 @@
package com.ningdatech.pmapi.wps.service.impl;

import com.ningdatech.pmapi.wps.service.IConvertService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
* @Classname ConvertService
* @Description
* @Date 2023/8/15 10:56
* @Author PoffyZhang
*/
@Service
@Slf4j
public class ConvertService implements IConvertService {



}

+ 5
- 0
pmapi/src/main/resources/application-dev.yml View File

@@ -240,6 +240,11 @@ irs:
interfaceName: 3XN9R93Pva6db7sf
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
core-biz:
url: https://interface.zjzwfw.gov.cn/gateway/api/001008012012001/dataSharing/Fc3re2cq7r64Qfa7.htm
interfaceName: Fc3re2cq7r64Qfa7
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}


+ 5
- 0
pmapi/src/main/resources/application-pre.yml View File

@@ -243,6 +243,11 @@ irs:
interfaceName: 3XN9R93Pva6db7sf
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
core-biz:
url: https://interface.zjzwfw.gov.cn/gateway/api/001008012012001/dataSharing/Fc3re2cq7r64Qfa7.htm
interfaceName: Fc3re2cq7r64Qfa7
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}


+ 5
- 0
pmapi/src/main/resources/application-prod.yml View File

@@ -243,6 +243,11 @@ irs:
interfaceName: 3XN9R93Pva6db7sf
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
core-biz:
url: https://interface.zjzwfw.gov.cn/gateway/api/001008012012001/dataSharing/Fc3re2cq7r64Qfa7.htm
interfaceName: Fc3re2cq7r64Qfa7
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}


+ 2
- 0
pmapi/src/main/resources/security/auth-dev.yml View File

@@ -36,6 +36,7 @@ security:
- /file/download
- /api/v1/zwdd/pull/**
- /api/v1/irs/**
- /api/v1/wps-convert/**
ignore-csrf-urls:
- /api/v1/user/auth/**
- /v2/api-docs
@@ -64,6 +65,7 @@ security:
- /file/download
- /api/v1/zwdd/pull/**
- /api/v1/irs/**
- /api/v1/wps-convert/**
role-map:
"engineer":
"project_manager":


+ 2
- 0
pmapi/src/main/resources/security/auth-pre.yml View File

@@ -36,6 +36,7 @@ security:
- /file/download
- /api/v1/zwdd/pull/**
- /api/v1/irs/**
- /api/v1/wps-convert/**
ignore-csrf-urls:
- /api/v1/user/auth/**
- /v2/api-docs
@@ -64,6 +65,7 @@ security:
- /file/download
- /api/v1/zwdd/pull/**
- /api/v1/irs/**
- /api/v1/wps-convert/**
role-map:
"engineer":
"project_manager":


+ 2
- 0
pmapi/src/main/resources/security/auth-prod.yml View File

@@ -36,6 +36,7 @@ security:
- /file/download
- /api/v1/zwdd/pull/**
- /api/v1/irs/**
- /api/v1/wps-convert/**
ignore-csrf-urls:
- /api/v1/user/auth/**
- /v2/api-docs
@@ -64,6 +65,7 @@ security:
- /file/download
- /api/v1/zwdd/pull/**
- /api/v1/irs/**
- /api/v1/wps-convert/**
role-map:
"engineer":
"project_manager":


+ 60
- 0
pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest4.java View File

@@ -0,0 +1,60 @@
package com.ningdatech.pmapi.irs;

import com.ningdatech.irs.service.IRefreshTokenService;
import com.ningdatech.pmapi.AppTests;
import com.ningdatech.pmapi.common.util.CryptUtils;
import com.ningdatech.pmapi.common.util.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.security.NoSuchAlgorithmException;
import java.util.Objects;

/**
* @Classname irsTest3
* @Description
* @Date 2023/7/25 9:52
* @Author PoffyZhang
*/
@Slf4j
public class irsTest4 extends AppTests {
@Resource
private IRefreshTokenService refreshTokenService;

@Value("${irs.interface-refresh.request-token-url}")
private String govRequestTokenUrl;
@Value("${irs.interface-refresh.refresh-token-url}")
private String govRefreshTokenUrl;

@Test
public void test1() throws NoSuchAlgorithmException {
long timestamp = System.currentTimeMillis();
String appSecret = "496f0f2a19994f76b4fd9dae087366c7";
String appKey = "A331101453557202109017383";
String dataName = "大数据管理局";

String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl,
"Fc3re2cq7r64Qfa7", HttpMethod.POST.name());
String sign = CryptUtils.MD5Encode(appKey + secret + timestamp);
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate;
if(Objects.nonNull(factory)){
restTemplate = new RestTemplate(factory);
}else{
restTemplate = new RestTemplate();
}

String url = "https://interface.zjzwfw.gov.cn/gateway/api/001008012012001/dataSharing/Fc3re2cq7r64Qfa7.htm?" +
"dingCode=&matterName=&oid=&useState=1&limit=1000&page=1" +
"&appKey=" + appKey + "&sign=" + sign + "&requestTime=" + timestamp;

ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
System.out.println(forEntity.getBody());
}
}

+ 5
- 0
pmapi/src/test/resources/application-dev.yml View File

@@ -240,6 +240,11 @@ irs:
interfaceName: 3XN9R93Pva6db7sf
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
core-biz:
url: https://interface.zjzwfw.gov.cn/gateway/api/001008012012001/dataSharing/Fc3re2cq7r64Qfa7.htm
interfaceName: Fc3re2cq7r64Qfa7
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}


+ 5
- 0
pmapi/src/test/resources/application-pre.yml View File

@@ -243,6 +243,11 @@ irs:
interfaceName: 3XN9R93Pva6db7sf
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
core-biz:
url: https://interface.zjzwfw.gov.cn/gateway/api/001008012012001/dataSharing/Fc3re2cq7r64Qfa7.htm
interfaceName: Fc3re2cq7r64Qfa7
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}


+ 5
- 0
pmapi/src/test/resources/application-prod.yml View File

@@ -238,6 +238,11 @@ irs:
interfaceName: 3XN9R93Pva6db7sf
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
core-biz:
url: https://interface.zjzwfw.gov.cn/gateway/api/001008012012001/dataSharing/Fc3re2cq7r64Qfa7.htm
interfaceName: Fc3re2cq7r64Qfa7
appSecret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}


Loading…
Cancel
Save