Commit 139331d4 by XiaHou

first

parents
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000697748db, pid=1456, tid=0x00000000000034f0
#
# JRE version: Java(TM) SE Runtime Environment (8.0_151-b12) (build 1.8.0_151-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.151-b12 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V [jvm.dll+0x1148db]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x0000000002791800): GCTaskThread [stack: 0x0000000012650000,0x0000000012750000] [id=13552]
siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000150
Registers:
RAX=0x0000000012850000, RBX=0x00000000815d1ba8, RCX=0x0000000000000003, RDX=0x0000000000000001
RSP=0x000000001274f780, RBP=0x0000000081dd1b78, RSI=0x0000000000000005, RDI=0x0000000002863cf0
R8 =0x0000000000000148, R9 =0x0000000000000005, R10=0x000000000000000c, R11=0x0000000000007669
R12=0x0000000081dd1b80, R13=0x0000000100041df0, R14=0x0000000100041df8, R15=0x0000000081dd1b60
RIP=0x00000000697748db, EFLAGS=0x0000000000010206
Top of Stack: (sp=0x000000001274f780)
0x000000001274f780: 0000000081dd1b80 0000000081dd1b74
0x000000001274f790: 0000000000000005 0000000002863cf0
0x000000001274f7a0: 0000000000000000 00000000000003d8
0x000000001274f7b0: 00000000027924c8 0000000002786040
0x000000001274f7c0: 0000000000007669 0000000069a57b50
0x000000001274f7d0: 0000000017d80388 00000000174355a0
0x000000001274f7e0: 0000000002863cf0 00000000027920f0
0x000000001274f7f0: 0000000000000000 0000000000000c00
0x000000001274f800: 0000000000000000 0000000000000000
0x000000001274f810: 0000000000000000 000000001d284800
0x000000001274f820: 0000000000000001 000000001d889301
0x000000001274f830: 0000cf218e05d487 00000000027924c8
0x000000001274f840: 00000000027920f0 00000000000003d8
0x000000001274f850: 00000000027920f0 0000000002786040
0x000000001274f860: 00000000027920e0 00000000174355a0
0x000000001274f870: 0000000002863cf0 0000000069a54c23
Instructions: (pc=0x00000000697748db)
0x00000000697748bb: 6f 00 84 d2 74 16 44 8b 43 08 8b 0d dd ce 68 00
0x00000000697748cb: 49 d3 e0 4c 03 05 cb ce 68 00 eb 04 4c 8b 43 08
0x00000000697748db: 45 8b 48 08 45 85 c9 7e 0c 41 f6 c1 01 75 4b 41
0x00000000697748eb: c1 f9 03 eb 57 79 43 84 d2 41 8b c9 b8 10 00 00
Register to memory mapping:
RAX=0x0000000012850000 is an unknown value
RBX=0x00000000815d1ba8 is pointing into object: 0x00000000815d1b98
java.lang.String
- klass: 'java/lang/String'
RCX=0x0000000000000003 is an unknown value
RDX=0x0000000000000001 is an unknown value
RSP=0x000000001274f780 is an unknown value
RBP=0x0000000081dd1b78 is pointing into object: 0x0000000081dd1b60
java.util.zip.ZipCoder
- klass: 'java/util/zip/ZipCoder'
RSI=0x0000000000000005 is an unknown value
RDI=0x0000000002863cf0 is an unknown value
R8 =0x0000000000000148 is an unknown value
R9 =0x0000000000000005 is an unknown value
R10=0x000000000000000c is an unknown value
R11=0x0000000000007669 is an unknown value
R12=0x0000000081dd1b80 is an oop
sun.nio.cs.UTF_8$Decoder
- klass: 'sun/nio/cs/UTF_8$Decoder'
R13=0x0000000100041df0 is pointing into metadata
R14=0x0000000100041df8 is pointing into metadata
R15=0x0000000081dd1b60 is an oop
java.util.zip.ZipCoder
- klass: 'java/util/zip/ZipCoder'
Stack: [0x0000000012650000,0x0000000012750000], sp=0x000000001274f780, free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x1148db]
V [jvm.dll+0x3f7b50]
V [jvm.dll+0x3f4c23]
V [jvm.dll+0x3f2a0e]
V [jvm.dll+0x29c3ea]
C [msvcr100.dll+0x21d9f]
C [msvcr100.dll+0x21e3b]
C [KERNEL32.DLL+0x17974]
C [ntdll.dll+0x6a271]
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x000000001d284800 JavaThread "globalEventExecutor-2-38" [_thread_blocked, id=12372, stack(0x0000000045f10000,0x0000000046010000)]
0x0000000019891800 JavaThread "Thread-144" [_thread_blocked, id=580, stack(0x0000000045910000,0x0000000045a10000)]
0x0000000019890800 JavaThread "http-nio-8099-Acceptor-0" daemon [_thread_blocked, id=9924, stack(0x0000000045810000,0x0000000045910000)]
0x000000001d287000 JavaThread "Catalina-utility-2" [_thread_blocked, id=9156, stack(0x0000000044810000,0x0000000044910000)]
0x000000001d289000 JavaThread "Catalina-utility-1" [_thread_blocked, id=16116, stack(0x0000000044710000,0x0000000044810000)]
0x000000001988b000 JavaThread "mysql-cj-abandoned-connection-cleanup" daemon [_thread_blocked, id=12504, stack(0x0000000020710000,0x0000000020810000)]
0x0000000019888000 JavaThread "DestroyJavaVM" [_thread_blocked, id=19832, stack(0x0000000002620000,0x0000000002720000)]
0x000000001d288800 JavaThread "Live Reload Server" daemon [_thread_in_native, id=17360, stack(0x000000001e910000,0x000000001ea10000)]
0x000000001a2e4800 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1400, stack(0x000000001ba40000,0x000000001bb40000)]
0x0000000019785000 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=13716, stack(0x0000000019dc0000,0x0000000019ec0000)]
0x0000000019510800 JavaThread "Service Thread" daemon [_thread_blocked, id=19300, stack(0x0000000019cc0000,0x0000000019dc0000)]
0x00000000194ed000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=17332, stack(0x0000000019bc0000,0x0000000019cc0000)]
0x00000000194e9800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=14928, stack(0x0000000019ac0000,0x0000000019bc0000)]
0x0000000019499000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=5296, stack(0x00000000199c0000,0x0000000019ac0000)]
0x00000000175a5000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=14924, stack(0x00000000190c0000,0x00000000191c0000)]
0x00000000175a1800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=14692, stack(0x0000000018fc0000,0x00000000190c0000)]
0x0000000017592000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=20160, stack(0x0000000018ec0000,0x0000000018fc0000)]
0x0000000018903800 JavaThread "Attach Listener" daemon [_thread_blocked, id=19124, stack(0x0000000018dc0000,0x0000000018ec0000)]
0x000000001755f000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=16192, stack(0x0000000018cc0000,0x0000000018dc0000)]
0x000000001754a800 JavaThread "Finalizer" daemon [_thread_blocked, id=11284, stack(0x00000000187c0000,0x00000000188c0000)]
0x0000000017529800 JavaThread "Reference Handler" daemon [_thread_blocked, id=14628, stack(0x00000000186c0000,0x00000000187c0000)]
Other Threads:
0x0000000017527800 VMThread [stack: 0x00000000185c0000,0x00000000186c0000] [id=18840]
0x0000000019794800 WatcherThread [stack: 0x0000000019ec0000,0x0000000019fc0000] [id=9956]
=>0x0000000002791800 (exited) GCTaskThread [stack: 0x0000000012650000,0x0000000012750000] [id=13552]
VM state:at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x0000000002770fd0] Threads_lock - owner thread: 0x0000000017527800
[0x0000000002771450] Heap_lock - owner thread: 0x0000000019891800
Heap:
PSYoungGen total 271360K, used 3742K [0x00000000d5b80000, 0x00000000e7c00000, 0x0000000100000000)
eden space 265728K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000e5f00000)
from space 5632K, 66% used [0x00000000e7680000,0x00000000e7a27988,0x00000000e7c00000)
to space 14848K, 0% used [0x00000000e5f00000,0x00000000e5f00000,0x00000000e6d80000)
ParOldGen total 97280K, used 25072K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a7c3c8,0x0000000087100000)
Metaspace used 76096K, capacity 80524K, committed 84096K, reserved 1124352K
class space used 8700K, capacity 9477K, committed 10112K, reserved 1048576K
Card table byte_map: [0x0000000011da0000,0x00000000121a0000] byte_map_base: 0x0000000011997000
Marking Bits: (ParMarkBitMap*) 0x0000000069e7d850
Begin Bits: [0x0000000012850000, 0x0000000014808000)
End Bits: [0x0000000014808000, 0x00000000167c0000)
Polling page: 0x00000000001f0000
CodeCache: size=245760Kb used=20762Kb max_used=20762Kb free=224997Kb
bounds [0x00000000029e0000, 0x0000000003e30000, 0x00000000119e0000]
total_blobs=10948 nmethods=10388 adapters=479
compilation: enabled
Compilation events (10 events):
Event: 6038.054 Thread 0x00000000194ed000 nmethod 10520 0x0000000003e22fd0 code [0x0000000003e23140, 0x0000000003e232c8]
Event: 6038.056 Thread 0x00000000194ed000 10521 1 javax.management.ObjectName::quote (126 bytes)
Event: 6038.057 Thread 0x00000000194ed000 nmethod 10521 0x0000000003e23350 code [0x0000000003e235a0, 0x0000000003e241e8]
Event: 6038.366 Thread 0x00000000194ed000 10522 1 org.apache.catalina.mapper.MapperListener::containerEvent (691 bytes)
Event: 6038.368 Thread 0x00000000194ed000 nmethod 10522 0x0000000003e24fd0 code [0x0000000003e254e0, 0x0000000003e26bc8]
Event: 6038.372 Thread 0x00000000194ed000 10523 ! 1 java.util.concurrent.ThreadPoolExecutor$Worker::interruptIfStarted (32 bytes)
Event: 6038.372 Thread 0x00000000194ed000 nmethod 10523 0x0000000003e280d0 code [0x0000000003e28240, 0x0000000003e283f8]
Event: 6038.373 Thread 0x00000000194ed000 10524 1 java.util.concurrent.ThreadPoolExecutor::compareAndDecrementWorkerCount (12 bytes)
Event: 6038.373 Thread 0x00000000194ed000 nmethod 10524 0x0000000003e28510 code [0x0000000003e28660, 0x0000000003e28790]
Event: 6038.374 Thread 0x00000000194ed000 10525 ! 1 java.util.concurrent.ThreadPoolExecutor::processWorkerExit (138 bytes)
GC Heap History (10 events):
Event: 5533.081 GC heap after
Heap after GC invocations=65 (full 22):
PSYoungGen total 273408K, used 10043K [0x00000000d5b80000, 0x00000000e9280000, 0x0000000100000000)
eden space 263168K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000e5c80000)
from space 10240K, 98% used [0x00000000e7a00000,0x00000000e83ced48,0x00000000e8400000)
to space 14336K, 0% used [0x00000000e8480000,0x00000000e8480000,0x00000000e9280000)
ParOldGen total 97280K, used 24859K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a46e38,0x0000000087100000)
Metaspace used 75134K, capacity 79534K, committed 82944K, reserved 1122304K
class space used 8637K, capacity 9403K, committed 9984K, reserved 1048576K
}
Event: 5827.209 GC heap before
{Heap before GC invocations=66 (full 22):
PSYoungGen total 273408K, used 167199K [0x00000000d5b80000, 0x00000000e9280000, 0x0000000100000000)
eden space 263168K, 59% used [0x00000000d5b80000,0x00000000df4f8f60,0x00000000e5c80000)
from space 10240K, 98% used [0x00000000e7a00000,0x00000000e83ced48,0x00000000e8400000)
to space 14336K, 0% used [0x00000000e8480000,0x00000000e8480000,0x00000000e9280000)
ParOldGen total 97280K, used 24859K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a46e38,0x0000000087100000)
Metaspace used 75137K, capacity 79540K, committed 83072K, reserved 1122304K
class space used 8637K, capacity 9405K, committed 10112K, reserved 1048576K
Event: 5827.221 GC heap after
Heap after GC invocations=66 (full 22):
PSYoungGen total 267264K, used 3790K [0x00000000d5b80000, 0x00000000e8880000, 0x0000000100000000)
eden space 263168K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000e5c80000)
from space 4096K, 92% used [0x00000000e8480000,0x00000000e8833998,0x00000000e8880000)
to space 14336K, 0% used [0x00000000e6c80000,0x00000000e6c80000,0x00000000e7a80000)
ParOldGen total 97280K, used 24859K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a46e38,0x0000000087100000)
Metaspace used 75137K, capacity 79540K, committed 83072K, reserved 1122304K
class space used 8637K, capacity 9405K, committed 10112K, reserved 1048576K
}
Event: 5827.221 GC heap before
{Heap before GC invocations=67 (full 23):
PSYoungGen total 267264K, used 3790K [0x00000000d5b80000, 0x00000000e8880000, 0x0000000100000000)
eden space 263168K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000e5c80000)
from space 4096K, 92% used [0x00000000e8480000,0x00000000e8833998,0x00000000e8880000)
to space 14336K, 0% used [0x00000000e6c80000,0x00000000e6c80000,0x00000000e7a80000)
ParOldGen total 97280K, used 24859K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a46e38,0x0000000087100000)
Metaspace used 75137K, capacity 79540K, committed 83072K, reserved 1122304K
class space used 8637K, capacity 9405K, committed 10112K, reserved 1048576K
Event: 5827.465 GC heap after
Heap after GC invocations=67 (full 23):
PSYoungGen total 267264K, used 0K [0x00000000d5b80000, 0x00000000e8880000, 0x0000000100000000)
eden space 263168K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000e5c80000)
from space 4096K, 0% used [0x00000000e8480000,0x00000000e8480000,0x00000000e8880000)
to space 14336K, 0% used [0x00000000e6c80000,0x00000000e6c80000,0x00000000e7a80000)
ParOldGen total 97280K, used 25072K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a7c3c8,0x0000000087100000)
Metaspace used 75134K, capacity 79534K, committed 83072K, reserved 1122304K
class space used 8637K, capacity 9403K, committed 10112K, reserved 1048576K
}
Event: 5884.164 GC heap before
{Heap before GC invocations=68 (full 23):
PSYoungGen total 267264K, used 263168K [0x00000000d5b80000, 0x00000000e8880000, 0x0000000100000000)
eden space 263168K, 100% used [0x00000000d5b80000,0x00000000e5c80000,0x00000000e5c80000)
from space 4096K, 0% used [0x00000000e8480000,0x00000000e8480000,0x00000000e8880000)
to space 14336K, 0% used [0x00000000e6c80000,0x00000000e6c80000,0x00000000e7a80000)
ParOldGen total 97280K, used 25072K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a7c3c8,0x0000000087100000)
Metaspace used 76093K, capacity 80518K, committed 84096K, reserved 1124352K
class space used 8699K, capacity 9475K, committed 10112K, reserved 1048576K
Event: 5884.182 GC heap after
Heap after GC invocations=68 (full 23):
PSYoungGen total 275968K, used 9979K [0x00000000d5b80000, 0x00000000e8500000, 0x0000000100000000)
eden space 265728K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000e5f00000)
from space 10240K, 97% used [0x00000000e6c80000,0x00000000e763ed48,0x00000000e7680000)
to space 14848K, 0% used [0x00000000e7680000,0x00000000e7680000,0x00000000e8500000)
ParOldGen total 97280K, used 25072K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a7c3c8,0x0000000087100000)
Metaspace used 76093K, capacity 80518K, committed 84096K, reserved 1124352K
class space used 8699K, capacity 9475K, committed 10112K, reserved 1048576K
}
Event: 6038.375 GC heap before
{Heap before GC invocations=69 (full 23):
PSYoungGen total 275968K, used 96939K [0x00000000d5b80000, 0x00000000e8500000, 0x0000000100000000)
eden space 265728K, 32% used [0x00000000d5b80000,0x00000000db06c250,0x00000000e5f00000)
from space 10240K, 97% used [0x00000000e6c80000,0x00000000e763ed48,0x00000000e7680000)
to space 14848K, 0% used [0x00000000e7680000,0x00000000e7680000,0x00000000e8500000)
ParOldGen total 97280K, used 25072K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a7c3c8,0x0000000087100000)
Metaspace used 76096K, capacity 80524K, committed 84096K, reserved 1124352K
class space used 8700K, capacity 9477K, committed 10112K, reserved 1048576K
Event: 6038.383 GC heap after
Heap after GC invocations=69 (full 23):
PSYoungGen total 271360K, used 3742K [0x00000000d5b80000, 0x00000000e7c00000, 0x0000000100000000)
eden space 265728K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000e5f00000)
from space 5632K, 66% used [0x00000000e7680000,0x00000000e7a27988,0x00000000e7c00000)
to space 14848K, 0% used [0x00000000e5f00000,0x00000000e5f00000,0x00000000e6d80000)
ParOldGen total 97280K, used 25072K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a7c3c8,0x0000000087100000)
Metaspace used 76096K, capacity 80524K, committed 84096K, reserved 1124352K
class space used 8700K, capacity 9477K, committed 10112K, reserved 1048576K
}
Event: 6038.383 GC heap before
{Heap before GC invocations=70 (full 24):
PSYoungGen total 271360K, used 3742K [0x00000000d5b80000, 0x00000000e7c00000, 0x0000000100000000)
eden space 265728K, 0% used [0x00000000d5b80000,0x00000000d5b80000,0x00000000e5f00000)
from space 5632K, 66% used [0x00000000e7680000,0x00000000e7a27988,0x00000000e7c00000)
to space 14848K, 0% used [0x00000000e5f00000,0x00000000e5f00000,0x00000000e6d80000)
ParOldGen total 97280K, used 25072K [0x0000000081200000, 0x0000000087100000, 0x00000000d5b80000)
object space 97280K, 25% used [0x0000000081200000,0x0000000082a7c3c8,0x0000000087100000)
Metaspace used 76096K, capacity 80524K, committed 84096K, reserved 1124352K
class space used 8700K, capacity 9477K, committed 10112K, reserved 1048576K
Deoptimization events (0 events):
No events
Internal exceptions (10 events):
Event: 5828.951 Thread 0x000000001d284800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x00000000e39fbd18) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
Event: 5828.951 Thread 0x000000001d284800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x00000000e3a04208) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
Event: 5828.951 Thread 0x000000001d284800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x00000000e3a089e8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
Event: 5828.951 Thread 0x000000001d284800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x00000000e3a0a838) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
Event: 5828.951 Thread 0x000000001d284800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x00000000e3a0ca50) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
Event: 5828.951 Thread 0x000000001d284800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x00000000e3a14d68) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
Event: 5828.951 Thread 0x000000001d284800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x00000000e3a19548) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
Event: 5828.952 Thread 0x000000001d284800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x00000000e3a1b398) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
Event: 5828.952 Thread 0x000000001d284800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x00000000e3a1d5b0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
Event: 6038.375 Thread 0x000000001d28a000 Exception <a 'java/lang/InterruptedException': sleep interrupted> (0x00000000daff3600) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u151\9699\hotspot\src\share\vm\prims\jvm.cpp, line 3228]
Events (10 events):
Event: 6038.374 Executing VM operation: RevokeBias
Event: 6038.374 Executing VM operation: RevokeBias done
Event: 6038.374 Executing VM operation: RevokeBias
Event: 6038.375 Executing VM operation: RevokeBias done
Event: 6038.375 Executing VM operation: RevokeBias
Event: 6038.375 Executing VM operation: RevokeBias done
Event: 6038.375 Thread 0x000000001d28a000 Thread exited: 0x000000001d28a000
Event: 6038.375 Executing VM operation: RevokeBias
Event: 6038.375 Executing VM operation: RevokeBias done
Event: 6038.375 Executing VM operation: ParallelGCSystemGC
Dynamic libraries:
0x00007ff614ec0000 - 0x00007ff614ef7000 C:\Program Files\Java\jdk1.8.0_151\bin\java.exe
0x00007ff877830000 - 0x00007ff877a1d000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x00007ff876620000 - 0x00007ff8766d3000 C:\WINDOWS\System32\KERNEL32.DLL
0x00007ff874580000 - 0x00007ff874813000 C:\WINDOWS\System32\KERNELBASE.dll
0x00007ff876c40000 - 0x00007ff876ce3000 C:\WINDOWS\System32\ADVAPI32.dll
0x00007ff874f90000 - 0x00007ff87502e000 C:\WINDOWS\System32\msvcrt.dll
0x00007ff877730000 - 0x00007ff8777ce000 C:\WINDOWS\System32\sechost.dll
0x00007ff874b30000 - 0x00007ff874c52000 C:\WINDOWS\System32\RPCRT4.dll
0x00007ff8771b0000 - 0x00007ff877347000 C:\WINDOWS\System32\USER32.dll
0x00007ff8741c0000 - 0x00007ff8741e0000 C:\WINDOWS\System32\win32u.dll
0x00007ff877350000 - 0x00007ff877379000 C:\WINDOWS\System32\GDI32.dll
0x00007ff874930000 - 0x00007ff874ac9000 C:\WINDOWS\System32\gdi32full.dll
0x00007ff8741e0000 - 0x00007ff874280000 C:\WINDOWS\System32\msvcp_win.dll
0x00007ff873970000 - 0x00007ff873a6a000 C:\WINDOWS\System32\ucrtbase.dll
0x00007ff8661e0000 - 0x00007ff866459000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.17763.914_none_05b346b2072102f2\COMCTL32.dll
0x00007ff874c60000 - 0x00007ff874f8c000 C:\WINDOWS\System32\combase.dll
0x00007ff8748b0000 - 0x00007ff87492e000 C:\WINDOWS\System32\bcryptPrimitives.dll
0x00007ff8777d0000 - 0x00007ff8777fe000 C:\WINDOWS\System32\IMM32.DLL
0x0000000069f00000 - 0x0000000069fd2000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\msvcr100.dll
0x0000000069660000 - 0x0000000069efd000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\server\jvm.dll
0x00007ff877720000 - 0x00007ff877728000 C:\WINDOWS\System32\PSAPI.DLL
0x00007ff871ae0000 - 0x00007ff871b04000 C:\WINDOWS\SYSTEM32\WINMM.dll
0x00007ff869230000 - 0x00007ff86923a000 C:\WINDOWS\SYSTEM32\VERSION.dll
0x00007ff870260000 - 0x00007ff870269000 C:\WINDOWS\SYSTEM32\WSOCK32.dll
0x00007ff8770e0000 - 0x00007ff87714d000 C:\WINDOWS\System32\WS2_32.dll
0x00007ff871a80000 - 0x00007ff871aad000 C:\WINDOWS\SYSTEM32\WINMMBASE.dll
0x00007ff874280000 - 0x00007ff8742ca000 C:\WINDOWS\System32\cfgmgr32.dll
0x0000000069650000 - 0x000000006965f000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\verify.dll
0x0000000069620000 - 0x0000000069649000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\java.dll
0x000000006ab10000 - 0x000000006ab45000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\jdwp.dll
0x000000006ab00000 - 0x000000006ab08000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\npt.dll
0x000000006aad0000 - 0x000000006aaf3000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\instrument.dll
0x0000000069600000 - 0x0000000069616000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\zip.dll
0x00007ff875030000 - 0x00007ff876524000 C:\WINDOWS\System32\SHELL32.dll
0x00007ff877670000 - 0x00007ff877718000 C:\WINDOWS\System32\shcore.dll
0x00007ff873a70000 - 0x00007ff8741bd000 C:\WINDOWS\System32\windows.storage.dll
0x00007ff8738c0000 - 0x00007ff8738e4000 C:\WINDOWS\System32\profapi.dll
0x00007ff8738f0000 - 0x00007ff87394d000 C:\WINDOWS\System32\powrprof.dll
0x00007ff874ad0000 - 0x00007ff874b22000 C:\WINDOWS\System32\shlwapi.dll
0x00007ff8738a0000 - 0x00007ff8738b1000 C:\WINDOWS\System32\kernel.appcore.dll
0x00007ff874560000 - 0x00007ff874577000 C:\WINDOWS\System32\cryptsp.dll
0x000000006aac0000 - 0x000000006aac9000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\dt_socket.dll
0x00007ff8730b0000 - 0x00007ff873117000 C:\WINDOWS\system32\mswsock.dll
0x00007ff872c30000 - 0x00007ff872c63000 C:\WINDOWS\system32\rsaenh.dll
0x00007ff874820000 - 0x00007ff874846000 C:\WINDOWS\System32\bcrypt.dll
0x00007ff8737d0000 - 0x00007ff8737f8000 C:\WINDOWS\SYSTEM32\USERENV.dll
0x00007ff873280000 - 0x00007ff87328c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll
0x00000000695e0000 - 0x00000000695fa000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\net.dll
0x00007ff872dd0000 - 0x00007ff872e0d000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL
0x00007ff876cf0000 - 0x00007ff876cf8000 C:\WINDOWS\System32\NSI.dll
0x00007ff86c910000 - 0x00007ff86c926000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL
0x00007ff86c8f0000 - 0x00007ff86c90c000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL
0x00007ff872e10000 - 0x00007ff872ed6000 C:\WINDOWS\SYSTEM32\DNSAPI.dll
0x00000000695c0000 - 0x00000000695d1000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\nio.dll
0x00007ff86c240000 - 0x00007ff86c24a000 C:\Windows\System32\rasadhlp.dll
0x00007ff86c390000 - 0x00007ff86c409000 C:\WINDOWS\System32\fwpuclnt.dll
0x000000006ab50000 - 0x000000006ab5d000 C:\Program Files\Java\jdk1.8.0_151\jre\bin\management.dll
0x00007ff866630000 - 0x00007ff866646000 C:\WINDOWS\system32\napinsp.dll
0x00007ff866610000 - 0x00007ff86662a000 C:\WINDOWS\system32\pnrpnsp.dll
0x00007ff8665f0000 - 0x00007ff8665fe000 C:\WINDOWS\System32\winrnr.dll
0x00007ff870130000 - 0x00007ff87014b000 C:\WINDOWS\system32\NLAapi.dll
0x00007ff8665d0000 - 0x00007ff8665e5000 C:\WINDOWS\system32\wshbth.dll
0x0000000180000000 - 0x0000000180282000 C:\Program Files\Java\apache-tomcat-8.5.45\bin\tcnative-1.dll
0x00007ff8742d0000 - 0x00007ff8744ab000 C:\WINDOWS\System32\CRYPT32.dll
0x00007ff873950000 - 0x00007ff873962000 C:\WINDOWS\System32\MSASN1.dll
0x00007ff8692c0000 - 0x00007ff8694ad000 C:\WINDOWS\SYSTEM32\dbghelp.dll
VM Arguments:
jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:58543,suspend=y,server=n -XX:TieredStopAtLevel=1 -Xverify:none -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:C:\Users\liYuling\.IntelliJIdea2018.3\system\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8
java_command: com.ServicecenterApplication
java_class_path (initial): C:\Program Files\Java\jdk1.8.0_151\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\rt.jar;D:\mywork\servicecenter\target\classes;C:\environment\maven_repository\org\springframework\boot\spring-boot-starter-data-redis\2.1.4.RELEASE\spring-boot-starter-data-redis-2.1.4.RELEASE.jar;C:\environment\maven_repository\org\springframework\boot\spring-boot-starter\2.1.4.RELEASE\spring-boot-starter-2.1.4.RELEASE.jar;C:\environment\maven_repository\org\springframework\boot\spring-boot-starter-logging\2.1.4.RELEASE\spring-boot-starter-logging-2.1.4.RELEASE.jar;C:\environment\maven_repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\environment\maven_repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_151
CLASSPATH=.;C:\Program Files\Java\jdk1.8.0_151\bin;C:\Program Files\Java\jdk1.8.0_151\lib\dt.jar;C:\Program Files\Java\jdk1.8.0_151\lib\tools.jar
PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_151\bin;C:\Program Files\Java\jdk1.8.0_151\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\environment\apache-maven-3.6.1\bin;C:\Program Files\Java\apache-tomcat-8.5.45\bin;C:\Program Files\Java\apache-tomcat-8.5.45\lib;D:\git\downloads\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Users\liYuling\AppData\Local\Microsoft\WindowsApps;
USERNAME=liYuling
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 10.0 , 64 bit Build 17763 (10.0.17763.475)
CPU:total 4 (initial active 4) (4 cores per cpu, 1 threads per core) family 6 model 60 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, lzcnt, tsc, tscinvbit, bmi1, bmi2
Memory: 4k page, physical 8308496k(2295412k free), swap 15782520k(2547964k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (25.151-b12) for windows-amd64 JRE (1.8.0_151-b12), built on Sep 5 2017 19:33:46 by "java_re" with MS VC++ 10.0 (VS2010)
time: Fri Jan 10 11:47:42 2020
elapsed time: 6038 seconds (0d 1h 40m 38s)
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.atlgroupasia</groupId>
<artifactId>servicecenter</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>servicecenter</name>
<description>Demo project for Spring Boot</description>
<packaging>jar</packaging>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.0.1</version>
</dependency>
<!-- 打包成war包必备 -->
<!--<dependency>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
<!--<scope>provided</scope>-->
<!--</dependency>-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-starter-redis</artifactId>-->
<!--<version>2.1.0.RELEASE</version>-->
<!--</dependency>-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<!-- swaggerUi start -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
<!-- swaggerUi end -->
<!-- 使用durid连接池的依赖 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>
<!-- 热部署依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<!-- thymeleaf依赖 -->
<!--<dependency>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-starter-thymeleaf</artifactId>-->
<!--</dependency>-->
<!-- 分页插件 -->
<!--<dependency>-->
<!--<groupId>com.github.pagehelper</groupId>-->
<!--<artifactId>pagehelper-spring-boot-starter</artifactId>-->
<!--<version>4.1.6</version>-->
<!--</dependency>-->
<!-- shiro -->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-ehcache</artifactId>
<version>1.2.2</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.apache.tomcat.embed</groupId>-->
<!--<artifactId>tomcat-embed-jasper</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.2</version>
</dependency>
<!-- 分页 -->
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<!-- 阿里云短信 -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.1.0</version>
</dependency>
<!-- 阿里云OSS -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.29</version>
</dependency>
<!--<dependency>-->
<!--<groupId>it.sauronsoftware</groupId>-->
<!--<artifactId>jave</artifactId>-->
<!--<version>1.0.2</version>-->
<!--</dependency>-->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.28</version>
</dependency>
<!--<dependency>-->
<!--<groupId>net.sourceforge.pinyin4j</groupId>-->
<!--<artifactId>pinyin4j</artifactId>-->
<!--<version>2.5.0</version>-->
<!--</dependency>-->
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>java-emoji-converter</artifactId>
<version>0.1.1</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.gexin.platform</groupId>-->
<!--<artifactId>gexin-rp-sdk-http</artifactId>-->
<!--<version>4.1.0.5</version>-->
<!--</dependency>-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.wxpay</groupId>
<artifactId>wxpay-sdk</artifactId>
<version>0.0.3</version>
</dependency>
</dependencies>
<!--<repositories>-->
<!--<repository>-->
<!--<id>getui-nexus</id>-->
<!--<url>http://mvn.gt.igexin.com/nexus/content/repositories/releases/</url>-->
<!--</repository>-->
<!--</repositories>-->
<build>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<!--如果想在没有web.xml文件的情况下构建WAR,请设置为false。 -->
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!-- mybatis generator 自动生成代码插件 -->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication
@EnableSwagger2
@EnableCaching
@MapperScan(value = "com.atlgroupasia.servicecenter.mapper")
@ComponentScan(basePackages = {"com.atlgroupasia.servicecenter.*"})
public class ServicecenterApplication {
public static void main(String[] args) {
SpringApplication.run(ServicecenterApplication.class, args);
}
}
package com.atlgroupasia.servicecenter.common;
/**
* Constants
*
* @author whj
* @date 2018/7/29 21:26
*/
public class Constants {
/**
* 成功
*/
public static final String RESPONSE_STATUS_200 = "200";
/**
* 登录过期
*/
public static final String RESPONSE_STATUS_401 = "401";
/**
* 失败
*/
public static final String RESPONSE_STATUS_500 = "500";
/**
* excel 文件后缀
*/
public static final String XLS = "xls";
/**
* excel 文件后缀
*/
public static final String XLSX = "xlsx";
/**
* Token
*/
public static final String TOKEN_NAME = "549CCDD8711E0D5DF61169B1CA001E9D";
/**
* Session验证码
*/
public static final String SESSION_VALID_CODE = "SESSION_VALID_CODE";
/**
* 全局 true 和 false 公共变量
*/
public static final Byte GLOBAL_TRUE_BYTE = 1;
public static final Byte GLOBAL_FALSE_BYTE = 0;
public static final Short GLOBAL_TRUE_SHORT = 1;
public static final Short GLOBAL_FALSE_SHORT = 0;
public static final Integer GLOBAL_TRUE_INT = 1;
public static final Integer GLOBAL_FALSE_INT = 0;
public static final String GLOBAL_TRUE_STR = "1";
public static final String GLOBAL_FALSE_STR = "0";
public static final Boolean GLOBAL_TRUE_BOOLEAN = true;
public static final Boolean GLOBAL_FALSE_BOOLEAN = false;
/**
* 是
*/
public static final Integer YES = 1;
/**
* 否
*/
public static final Integer NO = 0;
/**
* 流水类型1:收入
*/
public static final Integer FLOW_TYPE_INCOME = 1;
/**
* 流水类型:支出
*/
public static final Integer FLOW_TYPE_OUTCOME = 2;
/**
* 变动类型1、预约单补贴
*/
public static final Integer CHANGE_TYPE_SUBSIDY = 1;
/**
* 变动类型2:提现
*/
public static final Integer CHANGE_TYPE_WITHDRAW = 2;
/**
* 变动类型4:积分活动
*/
public static final Integer CHANGE_TYPE_ACTIVITY = 4;
/**
* 收藏类型1、项目
*/
public static final Integer FAV_TYPE_PLASTIC = 1;
/**
* 收藏类型2:商品
*/
public static final Integer FAV_TYPE_GOODS = 2;
/**
* 评价类型1、项目
*/
public static final Integer COMMENT_TYPE_PLASTIC = 1;
/**
* 评价类型2:商品
*/
public static final Integer COMMENT_TYPE_GOODS = 2;
/**
* 短信类型:1:注册
*/
public static final int SMS_TYPE_REGISTER = 1;
public static final String SMS_TYPE_REGISTER_VALUE="SMS_153815089";
public static final String SMS_TYPE_REGISTER_VALUE_INTERNATIONAL = "SMS_173406364";
/**
* 短信类型:3:修改登录密码
*/
public static final int SMS_TYPE_UPDATEPASSWORD = 3;
public static final String SMS_TYPE_UPDATEPASSWORD_VALUE="SMS_153815090";
public static final String SMS_TYPE_UPDATEPASSWORD_VALUE_INTERNATIONAL="SMS_173406384";
/**
* 短信类型:4:绑定手机号
*/
public static final int SMS_TYPE_BINDINGMOBILE = 4;
public static final String SMS_TYPE_BINDINGMOBILE_VALUE="SMS_153815091";
public static final String SMS_TYPE_BINDINGMOBILE_VALUE_INTERNATIONAL="SMS_173406381";
/**
* 提现类型 1:咖啡豆
*/
public static final Integer WITHDRAW_TYPE_BEANS = 1;
/**
* 提现类型 2:奖励
*/
public static final Integer WITHDRAW_TYPE_REWARDS = 2;
/**
* 发放状态 0:待发放
*/
public static final Integer SEND_STATE_INIT = 1;
/**
* 发放状态 1:暂停发放
*/
public static final Integer SEND_STATE_PAUSE = 2;
/**
* 发放状态 2:已发放
*/
public static final Integer SEND_STATE_SENT = 2;
/**
* 服务商等级0:普通用户
*/
public static final Integer AGENT_LEVEL_NOT_AGENT = 0;
/**
* 服务商等级1:高级服务商
*/
public static final Integer AGENT_LEVEL_10 = 10;
/**
* 服务商等级2:特级服务商
*/
public static final Integer AGENT_LEVEL_20 = 20;
/**
* 服务商等级3:钻石服务商
*/
public static final Integer AGENT_LEVEL_30 = 30;
/**
* 服务商99:99服务商
*/
public static final Integer AGENT_LEVEL_99 = 5;
/**
* 订单类型 1:预约
*/
public static final Integer ORDER_TYPE_RESERVE = 1;
/**
* 订单类型 2:购买商品
*/
public static final Integer ORDER_TYPE_SHOPPING = 2;
/**
* 订单类型 3:尊享会员
*/
public static final Integer ORDER_TYPE_ENJOY = 3;
/**
* 支付方式 1:支付宝
*/
public static final Integer PAY_TYPE_ALI = 1;
/**
* 支付方式 2:微信
*/
public static final Integer PAY_TYPE_WEIXIN = 2;
/**
* 类型(1:项目;2:积分商品;3:活动页;4:敬请期待)
*/
public static final Integer BANNER_TYPE_PLASTIC = 1;
public static final Integer BANNER_TYPE_GOODS = 2;
public static final Integer BANNER_TYPE_ACTIVITY = 3;
public static final Integer BANNER_TYPE_TOAST = 4;
/**
* 触发条件1:成为服务商;2:本月推荐服务商;3:本月推荐顾客
*/
public static final int TRIGGER_TYPE_BECOME_SERVICE_PROVIDER = 1;
public static final int TRIGGER_TYPE_RECOMMEND_SERVICE_PROVIDER = 2;
public static final int TRIGGER_TYPE_RECOMMEND_CUSTOMER = 3;
/**
* 领取状态1:已领取
*/
public static final int POINT_ACTIVITY_RECEIVE_STATE_DONE = 1;
/**
* 领取状态0:未领取
*/
public static final int POINT_ACTIVITY_RECEIVE_STATE_UNCLAIMED = 0;
/**
* 领取状态2:未满足
*/
public static final int POINT_ACTIVITY_RECEIVE_STATE_FAIL = 2;
/**
* 奖励类型1:积分
*/
public static final int SENDTYPE_POINT = 1;
/**
* 奖励类型2:商品
*/
public static final int SENDTYPE_GOODS = 2;
/**
* 商品类型 1:普通商品
*/
public static final Integer GOODS_TYPE_1 = 1;
/**
* 商品类型 2:签到商品
*/
public static final Integer GOODS_TYPE_2 = 2;
/**
* 商品类型 3:99尊享会员
*/
public static final Integer GOODS_TYPE_3 = 3;
/**
* 商品类型 4:高级服务商
*/
public static final Integer GOODS_TYPE_4 = 4;
}
package com.atlgroupasia.servicecenter.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import java.lang.reflect.Method;
/**
* @Name: Redis缓存配置类
* @Author: Lijc
* @Date: 2019/4/8 15:29
* @Version 1.0
*/
@Configuration
@EnableCaching
public class RedisConfig extends CachingConfigurerSupport {
@Value("${spring.redis.host}")
private String host;
@Value("${spring.redis.port}")
private int port;
@Value("${spring.redis.timeout}")
private int timeout;
/**
* 生成key的策略
* @return
*/
public KeyGenerator keyGenerator(){
return new KeyGenerator() {
@Override
public Object generate(Object target, Method method, Object... params){
StringBuilder sb = new StringBuilder();
sb.append(target.getClass().getName());
sb.append(method.getName());
for (Object obj : params){
sb.append(obj.toString());
}
return sb.toString();
}
};
}
/**
* 缓存管理器
* @param connectionFactory
* @return
*/
@Bean
public CacheManager cacheManager(RedisConnectionFactory connectionFactory){
RedisCacheManager cacheManager = RedisCacheManager.create(connectionFactory);
return cacheManager;
}
/**
* RedisTemplate配置
* @param factory
* @return
*/
public RedisTemplate<String,Object> redisTemplate(RedisConnectionFactory factory){
RedisTemplate<String, Object> template = new RedisTemplate<>();
// 配置连接工厂
template.setConnectionFactory(factory);
//使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
// 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
// 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jacksonSeial.setObjectMapper(om);
// 值采用json序列化
template.setValueSerializer(jacksonSeial);
//使用StringRedisSerializer来序列化和反序列化redis的key值
template.setKeySerializer(new StringRedisSerializer());
// 设置hash key 和value序列化模式
template.setHashKeySerializer(new StringRedisSerializer());
template.setHashValueSerializer(jacksonSeial);
template.afterPropertiesSet();
return template;
}
}
package com.atlgroupasia.servicecenter.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
/**
* @Name: swaggerui配置类
* @Author: Lijc
* @Date: 2019/4/10 10:19
* @Version 1.0
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
// public Docket createRestApi() {
// return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
// .select()
// .apis(RequestHandlerSelectors.basePackage("com.jains.controller"))
// .paths(PathSelectors.any()).build();
// }
//
// private ApiInfo apiInfo() {
// return new ApiInfoBuilder().title("janis Manger Swagger RSETful APIs")
// .description("综合管理 Swagger API 服务")
// .termsOfServiceUrl("http://swagger.io/")
// .contact(new Contact("janis", "127.0.0.1", "jains@163.com.cn"))
// .version("1.0")
// .build();
// }
@Bean
public Docket buildDocket() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<Parameter>();
tokenPar.name("token").description("令牌").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build());
//添加head参数end
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(buildApiInf())
.select()
.apis(RequestHandlerSelectors.basePackage("com.atlgroupasia.servicecenter.controller"))
.paths(PathSelectors.any())
.build()
.globalOperationParameters(pars);
}
private ApiInfo buildApiInf() {
return new ApiInfoBuilder().title("服务中心接口").termsOfServiceUrl("#").description("").version("0.1").build();
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.dto.BlessDto;
import com.atlgroupasia.servicecenter.dto.BlessEnableDto;
import com.atlgroupasia.servicecenter.dto.DonorDto;
import com.atlgroupasia.servicecenter.dto.OshParamsDto;
import com.atlgroupasia.servicecenter.dto.UserBlessUsingDto;
import com.atlgroupasia.servicecenter.entity.*;
import com.atlgroupasia.servicecenter.service.*;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.vo.DonorVo;
import com.google.common.collect.Maps;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
@RestController
@RequestMapping("/api/bless")
@Api(tags = "福位接口")
public class ApiBlessController {
@Autowired
private DonorService donorService;
@Autowired
private UserService userService;
@Autowired
private BlessService blessService;
@Autowired
private MaintainPriceService maintainPriceService;
@Autowired
private TempleService templeService;
@Autowired
private MemorialHallService memorialHallService;
@Autowired
private MaintainOrderService maintainOrderSerivice;
@Autowired
private DonateOrderService donateOrderService;
@Autowired
private ParamsService paramsService;
@Autowired
private GiveRecordService giveRecordService;
/**
* 获取用户已购买的福位列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/my-bless", method = RequestMethod.POST)
@ApiOperation(value = "购买福位列表查询", httpMethod = "POST", notes = "福位查询接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "phone", value = "手机号码", required = true, dataType = "String", paramType = "query")
})
@ResponseBody
public JsonResult userLogin(DonorVo vo, HttpServletRequest request, HttpServletResponse response) throws IOException {
HashMap<String, Object> map = new HashMap<>();
try {
List<DonorDto> donor = donorService.findNoDel(vo);
if (donor.size() == 0) {
return JsonResult.failed("您暂未购买任何福位!");
}
User user = userService.findNoDel((vo.getPhone()));
Integer userId = user.getId();
String donorIds = "";
for (int i = 0; i < donor.size(); i++) {
if (i == donor.size() - 1) {
donorIds += donor.get(i).getId().toString();
} else {
donorIds += donor.get(i).getId().toString() + ",";
}
}
List blessList = blessService.findMyBlessList(donorIds);
map.put("blessList", blessList);
//map.put("userId", userId);
if (blessList.size() <= 0) {//ControllerHelper.sendErrorJson(response, result);
return JsonResult.failed("您暂未购买任何福位!");
}
return JsonResult.success("获取福位列表成功!", map);
} catch (Exception e) {
return JsonResult.failed("连接超时,请稍后登入!!");
}
}
@RequestMapping(value = "/select-bless", method = RequestMethod.POST)
@ApiOperation(value = "查看福位详情", httpMethod = "POST", notes = "查看福位详情接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "福位id", required = true, dataType = "Integer", paramType = "query")
})
@ResponseBody
public JsonResult selectBless(Integer id, HttpServletResponse response, HttpServletRequest request) throws IOException {
try {
BlessDto bless = blessService.selectBless1(id);
if (bless == null) {
return JsonResult.failed("没有该福位的信息!");
}
return JsonResult.success("获取福位详情成功!", bless);
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("连接超时,请稍后登入!!");
}
}
@RequestMapping(value = "/go/change-user-bless", method = RequestMethod.POST)
@ApiOperation(value = "福位变更", httpMethod = "POST", notes = "福位变更", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "blessId", value = "福位id", required = true, dataType = "Integer", paramType = "query"),
})
@ResponseBody
public JsonResult goChangeBless(Integer blessId) {
try {
BlessDto bless = null;
bless = blessService.selectBless1(blessId);
return JsonResult.success("查询成功", bless);
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("查询失败,请稍候再试!");
}
}
@RequestMapping(value = "/go/change-donate-person", method = RequestMethod.POST)
@ApiOperation(value = "更改捐建人详情", httpMethod = "POST", notes = "更改捐建人详情", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "blessId", value = "福位id", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "blessIdx", value = "福位索引", required = true, dataType = "Integer", paramType = "query"),
})
@ResponseBody
public JsonResult goChangedD0natePerson(Integer blessId, Integer userId, Integer blessIdx) {
try {
Map<String, Object> map = Maps.newHashMap();
BlessDto bless = blessService.selectBless1(blessId);
int specificationsId = blessService.findNoDel(blessId).getSpecificationsId();
int templeId = templeService.findNoDelByMemorialHallId(memorialHallService.findNoDel(blessService.findNoDel(blessId).getMemorialHallId()).getTempleId()).getId();
MaintainPrice maintainPrice = maintainPriceService.findMaintainPrice(specificationsId, templeId);
MaintainOrder maintainOrder = maintainOrderSerivice.findNoDelByBlessIdAndIdx(blessId, blessIdx);
OshParamsDto oshParams = paramsService.findNoDel(5);
String value = oshParams.getValue();
int parseValue = Integer.parseInt(value);
String serialNumber = bless.getSerialNumber();
String fashionName = bless.getFashionName();
String codeNumber = bless.getCodeNumber();
String layer = bless.getLayer();
String floors = bless.getFloors();
String specificationsName = bless.getSpecificationsName();
String blessVoucherStr = bless.getBlessVoucherStr();
map.put("sendMoney", Integer.parseInt(value));
map.put("serialNumber", serialNumber);
map.put("codeNumber", codeNumber);
map.put("layer", layer);
map.put("floors", floors);
map.put("specificationsName", specificationsName);
map.put("fashionName", fashionName);
map.put("blessVoucherStr", blessVoucherStr);
map.put("blessId", bless.getId());
map.put("ddoId", bless.getDdoId());
map.put("ddoNumbers", bless.getDdoNumbers());
map.put("userId", userId);
map.put("serviceCharge", parseValue);
if (maintainOrder != null) {
map.put("isBuy", 0);
Integer payYears = maintainOrder.getPayYears();
BigDecimal payMoney = maintainOrder.getPayMoney();
map.put("payYears", payYears);
map.put("payMoney", payMoney);
} else {
map.put("isBuy", 1);
map.put("maintainPrice", maintainPrice);
}
return JsonResult.success("查询成功", map);
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("查询失败,请稍候再试!");
}
}
@RequestMapping(value = "/go/confirm-donate-person", method = RequestMethod.POST)
@ApiOperation(value = "更改捐建人详情确认", httpMethod = "POST", notes = "更改捐建人详情确认", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "identify", value = "身份证号", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "userId", value = "当前登录用户id", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "blessId", value = "当前选择的福位", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "ddoNumbers", value = "助捐单单号", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "address", value = "address", required = true, dataType = "String", paramType = "query"),
})
@ResponseBody
public JsonResult goCommitDonatePerson(String donatePersonName, String identify, String phone, String province, String city, String area,
String linkedBakName, String linkedBakPhone, Integer userId, Integer blessId, String ddoNumbers) {
try {
Donor donor = donorService.findByIdentify(identify);
GiveRecord giveRecord = new GiveRecord();
giveRecord.setCreateTime(new Date());
giveRecord.setOrderCode(ddoNumbers);
giveRecord.setReferId(0);
giveRecord.setReferType(0);
giveRecord.setState(0);
giveRecord.setUserId(userId);
giveRecord.setBlessId(blessId);
if (donor != null) {
User user1 = userService.findNoDel(phone);
if (user1 != null) {
giveRecord.setGiveUserId(user1.getId());
giveRecordService.batchEntity(giveRecord);
}
} else {
Donor donor1 = new Donor();
donor1.setName(donatePersonName);
donor1.setCompanyId(1);
donor1.setIdentify(identify);
if (linkedBakName == null) {
donor1.setLinkedBakName("");
} else {
donor1.setLinkedBakName(linkedBakName);
}
if (linkedBakPhone == null) {
donor1.setLinkedBakPhone("");
} else {
donor1.setLinkedBakPhone(linkedBakPhone);
}
donor1.setLinkedName(donatePersonName);
donor1.setLinkedPhone(phone);
donor1.setIsService(0);
donor1.setAuthentication(0);
donorService.batchEntity(donor1);
}
return JsonResult.success("新增成功");
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("新增失败,请稍候再试");
}
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.service.GiveRecordService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/user")
@Api(tags = "福位转增表接口")
public class ApiGiveRecordController {
@Autowired
private GiveRecordService giveRecordService;
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.dto.ActivityDto;
import com.atlgroupasia.servicecenter.dto.DonorDto;
import com.atlgroupasia.servicecenter.entity.DonateOrder;
import com.atlgroupasia.servicecenter.entity.User;
import com.atlgroupasia.servicecenter.service.ActivitySerice;
import com.atlgroupasia.servicecenter.service.BlessService;
import com.atlgroupasia.servicecenter.service.DonorService;
import com.atlgroupasia.servicecenter.service.UserService;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.vo.AtlUserVo;
import com.atlgroupasia.servicecenter.vo.DonorVo;
import com.google.common.collect.Lists;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api")
@Api(tags = "登录接口")
public class ApiLoginController extends BaseController {
@Autowired
private UserService userService;
// @Autowired
// private AdvertisementService advertisementService;
@Autowired
private ActivitySerice activityService;
@Autowired
private BlessService blessService;
@Autowired
private DonorService donorService;
// @RequestMapping(value = "/check-user", method = RequestMethod.POST)
// public User checkUser(String name, String password) {
// User user = userService.checkUser(name, password);
// return user;
// }
/**
* @param name
* @param password
* @return
* @author chesong
*/
// @SystemControllerLog(description = "登录验证")
// @RequestMapping(value = "/login", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// @ResponseBody
// public String login(String name, String password) {
// Map map = userService.verificationLogin(name, password);
// Object data = map.get("data");
//
// System.out.println(data);
//
// return JSON.toJSONString(map);
//
// }
/**
* 查询广告图片
*
*
* @author chesong
*/
// @RequestMapping(value = "/ad/index", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// @ResponseBody
// public String topAds() {
// List<Advertisement> list = advertisementService.findAllNoDel();
//
// Map<String, Object> map = Maps.newHashMap();
// if (list != null) {
// map.put("topAds", list);
// map.put("success", true);
// } else {
// map.put("success", false);
// }
//
// return JSON.toJSONString(map);
//
// }
@RequestMapping(value = "/findPhone")
@ApiOperation(value = "登录服务中心", httpMethod = "POST", notes = "登录服务中心", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "mobilePhone", value = "手机号码", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "payPassword", value = "支付驸马", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "loginPassword", value = "登录密码", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "nickName", value = "昵称", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "avaterImageUrl", value = "头像", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "realName", value = "真实姓名", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "openId", value = "微信id", required = false, dataType = "String", paramType = "query")
})
@ResponseBody
public JsonResult findPhoneBySysToken(AtlUserVo atlUserVo, HttpServletRequest request) {
DonorVo donorVo = new DonorVo();
donorVo.setPhone(atlUserVo.getMobilePhone());
HashMap<String, Object> resultMap = new HashMap<>();
try {
String sysToken = request.getHeader("token");
if (sysToken == null) {
return JsonResult.failed("您尚未登录,重新登录");
}
List<ActivityDto> activityList1 = activityService.findAllNoDel();
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
Date date = new Date();
System.out.println(date);
List<ActivityDto> activityList = Lists.newArrayList();
for (int i = 0; i < activityList1.size(); i++) {
Date endTime = activityList1.get(i).getEndTime();
if (endTime.getTime() > date.getTime()) {
activityList.add(activityList1.get(i));
}
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm");
List<Map> activityMapList = Lists.newArrayList();
for (int i = 0; i < activityList.size(); i++) {
HashMap<String, Object> map = new HashMap<>();
map.put("title", activityList.get(i).getTitle());
map.put("coverPicStr", activityList.get(i).getCoverPicStr());
map.put("address", activityList.get(i).getAddress());
Date beginTime = activityList.get(i).getBeginTime();
Date endTime = activityList.get(i).getEndTime();
String beginTimeStr = sdf.format(beginTime);
String endTimeStr = sdf.format(endTime);
String beginTimeStr1 = sdf1.format(beginTime);
String endTimeStr1 = sdf1.format(endTime);
String endTimeStr2 = sdf2.format(endTime);
if (beginTimeStr1.equals(endTimeStr1)) {
activityList.get(i).setActivityTime(beginTimeStr + "-" + endTimeStr2);
} else {
activityList.get(i).setActivityTime(beginTimeStr + "-" + endTimeStr);
}
map.put("activityTime", activityList.get(i).getActivityTime());
activityMapList.add(map);
}
resultMap.put("activityMapList", activityMapList);
List<DonorDto> donorDtos = donorService.findNoDel(donorVo);
List<DonateOrder> donateOrderList = null;
String donorIds = "";
if (donorDtos.size() > 0) {
for (int i = 0; i < donorDtos.size(); i++) {
if (i == donorDtos.size() - 1) {
donorIds += donorDtos.get(i).getId().toString();
} else {
donorIds += donorDtos.get(i).getId().toString() + ",";
}
}
donateOrderList = blessService.findMyBless1(donorIds);
if (donateOrderList.size() > 0) {
userService.updateByPhone(atlUserVo);
}
}
if (donorDtos.size() == 0 && donateOrderList.size() == 0) {
resultMap.put("blessSize", 0);
User user = new User();
user.setPhone(atlUserVo.getMobilePhone());
userService.batchNewEntity(user);
} else {
User user = userService.findNoDel(donorVo.getPhone());
Integer userId = user.getId();
List<Integer> blessIdList = blessService.findMyBless(donorIds);
int blessSize = blessIdList.size();
resultMap.put("userId", userId);
resultMap.put("phone", donorVo.getPhone());
resultMap.put("blessSize", blessSize);
}
return JsonResult.success("请求成功", resultMap);
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("请求失败,请稍候重试");
}
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.service.OshServicesAdSerice;
import com.atlgroupasia.servicecenter.service.OshServicesOrderSerice;
import com.atlgroupasia.servicecenter.service.OshServicesSerice;
import com.atlgroupasia.servicecenter.service.OshServicesTypeSerice;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.vo.OshServicesAdVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import com.atlgroupasia.servicecenter.vo.OshServicesTypeVo;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api/services/home")
@Api(tags = "首页接口")
@CrossOrigin
public class ApiOshHomePageController {
@Autowired
private OshServicesAdSerice oshServicesAdSerice;
@Autowired
private OshServicesSerice oshServicesSerice;
@Autowired
private OshServicesTypeSerice oshServicesTypeSerice;
@Autowired
private OshServicesOrderSerice oshServicesOrderSerice;
/**
* 广告列表
*
* @author heshenmi
* <p>
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/ad/list", method = RequestMethod.POST)
@ApiOperation(value = "广告列表", httpMethod = "POST", notes = "广告列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
})
@ResponseBody
public JsonResult list(OshServicesAdVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("列表请求成功", oshServicesAdSerice.findList(vo));
}
/**
* 广告详情
*
* @author heshenmi
* <p>
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/ad/view", method = RequestMethod.POST)
@ApiOperation(value = "广告详情", httpMethod = "POST", notes = "广告详情", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "广告编号", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult view(OshServicesAdVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("详情请求成功", oshServicesAdSerice.view(vo));
}
/**
* 商品列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/service/list", method = RequestMethod.POST)
@ApiOperation(value = "商品列表", httpMethod = "POST", notes = "商品列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
})
@ResponseBody
public JsonResult serviceList(OshServicesVo vo, HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> result = Maps.newHashMap();
vo.setStatus("1");
List<Map<String, Object>> list = oshServicesSerice.findList(vo);
List<Map<String, Object>> comboList = Lists.newArrayList();
List<Map<String, Object>> itemList = Lists.newArrayList();
for (Map<String, Object> map : list) {
Long id = (Long) map.get("id");
OshServicesVo servicesVo = new OshServicesVo();
servicesVo.setId(id);
List<Map<String, Object>> priceList = oshServicesSerice.getLowPrice(servicesVo);
String priceA = priceList.get(0).get("price").toString();
double priceADouble = Double.parseDouble(priceA);
map.put("price",new Double(priceADouble).intValue());
if(priceList.size()>1){
String priceB = priceList.get(priceList.size()-1).get("price").toString();
double priceBDouble = Double.parseDouble(priceB);
map.put("priceB",new Double(priceBDouble).intValue());
}else {
map.put("priceB","");
}
String isCombo = map.get("isCombo").toString();
if ("0".equals(isCombo)) {
itemList.add(map);
} else {
comboList.add(map);
}
}
result.put("comboList", comboList);
result.put("itemList", itemList);
OshServicesTypeVo typeVo = new OshServicesTypeVo();
typeVo.setIsCombo("0");
List<Map<String, Object>> typeList = oshServicesTypeSerice.findList(typeVo);
result.put("typeList", typeList);
return JsonResult.success("列表请求成功", result);
}
/**
* 商品详情
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/service/view", method = RequestMethod.POST)
@ApiOperation(value = "商品详情", httpMethod = "POST", notes = "商品详情", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "商品编号", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult view(OshServicesVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("列表请求成功", oshServicesSerice.view(vo));
}
/**
* 评价列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/evaluate/list", method = RequestMethod.POST)
@ApiOperation(value = "评价列表", httpMethod = "POST", notes = "评价列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "productId", value = "商品编号", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult evaluateList(OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("列表请求成功", oshServicesOrderSerice.findEvaluateList(vo));
}
/**
* 规格列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/specification/list", method = RequestMethod.POST)
@ApiOperation(value = "规格列表", httpMethod = "POST", notes = "规格列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "商品编号", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult specificationList(OshServicesVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("列表请求成功", oshServicesSerice.findSpecificationByServiceId(vo));
}
/**
* 查询商品
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/select", method = RequestMethod.POST)
@ApiOperation(value = "查询商品", httpMethod = "POST", notes = "查询商品", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
})
@ResponseBody
public JsonResult list(OshServicesVo vo, HttpServletRequest request, HttpServletResponse response) {
vo.setStatus("1");
List<Map<String, Object>> list = oshServicesSerice.findList(vo);
for (Map<String, Object> map : list) {
Long id = (Long) map.get("id");
OshServicesVo servicesVo = new OshServicesVo();
servicesVo.setId(id);
List<Map<String, Object>> priceList = oshServicesSerice.getLowPrice(servicesVo);
String priceA = priceList.get(0).get("price").toString();
double priceADouble = Double.parseDouble(priceA);
map.put("price",new Double(priceADouble).intValue());
if(priceList.size()>1){
String priceB = priceList.get(priceList.size()-1).get("price").toString();
double priceBDouble = Double.parseDouble(priceB);
map.put("priceB",new Double(priceBDouble).intValue());
}else {
map.put("priceB","");
}
}
return JsonResult.success("列表请求成功", list);
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.service.OshServicesAdSerice;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.vo.OshServicesAdVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderItemVo;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@RestController
@RequestMapping("/api/services/ad")
@Api(tags = "商品广告接口")
public class ApiOshServicesAdController {
@Autowired
private OshServicesAdSerice oshServicesAdSerice;
/**
* 广告列表
*
* @author heshenmi
*
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/list", method = RequestMethod.POST)
@ApiOperation(value = "广告列表", httpMethod = "POST", notes = "广告列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
})
@ResponseBody
public JsonResult list(OshServicesAdVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("列表请求成功", oshServicesAdSerice.findList(vo));
}
/**
* 广告详情
*
* @author heshenmi
*
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/view", method = RequestMethod.POST)
@ApiOperation(value = "广告详情", httpMethod = "POST", notes = "广告详情", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
})
@ResponseBody
public JsonResult view(OshServicesAdVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("详情请求成功", oshServicesAdSerice.view(vo));
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.dto.DonorDto;
import com.atlgroupasia.servicecenter.entity.User;
import com.atlgroupasia.servicecenter.service.OshServicesSerice;
import com.atlgroupasia.servicecenter.service.OshServicesSpecificationSerice;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.vo.DonorVo;
import com.atlgroupasia.servicecenter.vo.OshServicesSpecificationVo;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
@RestController
@RequestMapping("/api/services")
@Api(tags = "商品接口")
public class ApiOshServicesController {
@Autowired
private OshServicesSerice oshServicesSerice;
@Autowired
private OshServicesSpecificationSerice oshServicesSpecificationSerice;
/**
* 商品列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/list", method = RequestMethod.POST)
@ApiOperation(value = "商品列表", httpMethod = "POST", notes = "商品列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "templeId", value = "纪念馆编号", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult list(OshServicesVo vo, HttpServletRequest request, HttpServletResponse response) {
vo.setStatus("1");
return JsonResult.success("列表请求成功", oshServicesSerice.findList(vo));
}
/**
* 商品详情
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/view", method = RequestMethod.POST)
@ApiOperation(value = "商品详情", httpMethod = "POST", notes = "商品详情", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "商品编号", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult view(OshServicesVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("列表请求成功", oshServicesSerice.view(vo));
}
/**
* 规格列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/specification/list", method = RequestMethod.POST)
@ApiOperation(value = "规格列表", httpMethod = "POST", notes = "规格列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "商品编号", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult specificationList(OshServicesVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("列表请求成功", oshServicesSerice.findSpecificationByServiceId(vo));
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.dto.DonorDto;
import com.atlgroupasia.servicecenter.entity.DonateOrder;
import com.atlgroupasia.servicecenter.entity.User;
import com.atlgroupasia.servicecenter.service.*;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.utils.StringUtilSS;
import com.atlgroupasia.servicecenter.vo.DonorVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderItemVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import com.github.wxpay.sdk.WXPayUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import io.swagger.annotations.*;
import jodd.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api/services/order")
@Api(tags = "订单接口")
@CrossOrigin(origins = "*", maxAge = 3600)
public class ApiOshServicesOrderController {
@Autowired
private OshServicesOrderSerice oshServicesOrderSerice;
@Autowired
private OshServicesOrderItemSerice oshServicesOrderItemSerice;
@Autowired
private OshServicesOrderRecordSerice oshServicesOrderRecordSerice;
@Autowired
private UserService userService;
@Autowired
private BlessService blessService;
@Autowired
private DonorService donorService;
/**
* 订单列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/list", method = RequestMethod.POST)
@ApiOperation(value = "订单列表", httpMethod = "POST", notes = "订单列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "status", value = "状态", required = true, dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "phone", value = "电话", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult list(OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) {
String status = vo.getStatus();
List<Map<String, Object>> list = oshServicesOrderSerice.findList(vo);
String toConfirmTime = "";
for (Map<String, Object> map : list) {
Date createTime = (Date) map.get("createTime");
map.put("createTimeStamp", createTime.getTime());
map.put("createTime", createTime.getTime());
Long id = (Long) map.get("id");
OshServicesOrderItemVo itemVo = new OshServicesOrderItemVo();
itemVo.setOrderId(id);
List<Map<String, Object>> itemList = oshServicesOrderItemSerice.findList(itemVo);
map.put("itemList", itemList);
List<Map<String, Object>> watchList = oshServicesOrderSerice.findVideoListUnWatch(id);
boolean isWatch = false;
if (watchList.size() > 0) {
for (Map<String, Object> watchMap : watchList) {
String isWatchStr = watchMap.get("isWatch").toString();
if ("0".equals(isWatchStr)) {
isWatch = true;
}
}
map.put("isWatch", isWatch);
}
String process = watchList.size() + "/" + map.get("ageLimit").toString();
map.put("process", process);
String statusLabel = getStatusLabel(map, status);
map.put("statusLabel", statusLabel);
if ("2".equals(status)) {
String confirmTimeStr = map.get("confirmTime").toString();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date confirmTime = sdf.parse(confirmTimeStr);
Long confirmTimeStamp = confirmTime.getTime();
Long nowTimeStamp = (new Date()).getTime();
if (nowTimeStamp < confirmTimeStamp) {
Long allHour = (confirmTimeStamp - nowTimeStamp) / (1000 * 3600);
Long day = allHour / 24;
Long hour = allHour % 24;
if (day == 0) {
toConfirmTime = hour + "小时";
} else {
toConfirmTime = day + "天" + hour + "小时";
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
if ("3".equals(status)) {
List<Map<String, Object>> videoList = oshServicesOrderSerice.videoAndImageList((Long) map.get("id"));
for (Map<String, Object> item : videoList) {
List<String> imageList = Lists.newArrayList();
String imageUrls = item.get("imageUrls").toString();
if (StringUtil.isNotBlank(imageUrls)) {
String[] imageUrlArr = imageUrls.split(",");
for (String str : imageUrlArr) {
imageList.add(str);
}
}
item.put("imageUrls", imageList);
}
map.put("videoList", videoList);
}
map.put("toConfirmTime", toConfirmTime);
}
return JsonResult.success("列表请求成功", list);
}
private String getStatusLabel(Map<String, Object> map, String status) {
String statusLabel = "";
if ("1".equals(status)) {
statusLabel = "等待付款";
}
if ("2".equals(status)) {
statusLabel = "等待祭扫";
}
if ("3".equals(status)) {
String process = map.get("process").toString();
String[] processArr = process.split("/");
String finishSize = processArr[0];
String allCount = processArr[1];
if ("0".equals(finishSize)) {
statusLabel = "祭扫中";
} else if (!finishSize.equals(allCount)) {
statusLabel = "已完成(" + process + ")";
}
}
if ("4".equals(status)) {
String evaluateLevel = map.get("evaluateLevel").toString();
if (StringUtils.isNotBlank(evaluateLevel)) {
statusLabel = "已评价";
} else {
statusLabel = "未评价";
}
}
return statusLabel;
}
/**
* 获取已关联福位列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/findConnectBlessUsingList", method = RequestMethod.POST)
@ApiOperation(value = "获取已关联福位列表", httpMethod = "POST", notes = "获取已关联福位列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "phone", value = "电话", required = true, dataType = "String", paramType = "query")
})
@ResponseBody
public JsonResult findConnectBlessUsingList(String phone, HttpServletRequest request, HttpServletResponse response) throws IOException {
DonorVo vo = new DonorVo();
vo.setPhone(phone);
List<DonorDto> donor = donorService.findNoDel(vo);
if (donor.size() == 0) {
JsonResult.success("获取福位列表成功!", "");
}
String donorIds = "";
for (int i = 0; i < donor.size(); i++) {
if (i == donor.size() - 1) {
donorIds += donor.get(i).getId().toString();
} else {
donorIds += donor.get(i).getId().toString() + ",";
}
}
List<Map<String, Object>> list = blessService.findConnectBlessUsingList(donorIds);
for (Map<String, Object> map : list) {
String pic = map.get("singlePic").toString();
if (StringUtils.isNotBlank(pic)) {
map.put("singlePic", "http://alioss.atlimg.com/lmerp/images/" + pic);
}
}
return JsonResult.success("获取福位列表成功!", list);
}
/**
* 通过福位编号或者已逝者姓名查询的福位列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/findBlessUsingList", method = RequestMethod.POST)
@ApiOperation(value = "通过福位编号或者已逝者姓名查询的福位列表", httpMethod = "POST", notes = "通过福位编号或者已逝者姓名查询的福位列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "selectText", value = "搜索条件", required = true, dataType = "String", paramType = "query")
})
@ResponseBody
public JsonResult findBlessList(String phone, String selectText, HttpServletRequest request, HttpServletResponse response) throws IOException {
String donorIds = "";
List<Map<String, Object>> selfList = Lists.newArrayList();
if (StringUtils.isNotBlank(phone)) {
DonorVo vo = new DonorVo();
vo.setPhone(phone);
List<DonorDto> donor = donorService.findNoDel(vo);
if (donor.size() > 0) {
for (int i = 0; i < donor.size(); i++) {
if (i == donor.size() - 1) {
donorIds += donor.get(i).getId().toString();
} else {
donorIds += donor.get(i).getId().toString() + ",";
}
}
}
}
if (StringUtils.isNotBlank(donorIds)) {
selfList = blessService.findConnectBlessUsingList(donorIds);
}
List<Map<String, Object>> list = blessService.findBlessUsingList(selectText);
for (Map<String, Object> map : list) {
String id = map.get("id").toString();
String pic = map.get("singlePic").toString();
if (StringUtils.isNotBlank(pic)) {
map.put("singlePic", "http://alioss.atlimg.com/lmerp/images/" + pic);
}
String isMySelf = "0";
if (selfList.size() > 0) {
for (Map<String, Object> item : selfList) {
String itemId = item.get("id").toString();
if(itemId.equals(id)){
isMySelf = "1";
break;
}
}
}
map.put("isMySelf",isMySelf);
}
return JsonResult.success("获取福位列表成功!", list);
}
/**
* 新增订单
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ApiOperation(value = "新增订单", httpMethod = "POST", notes = "新增订单", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "pic", value = "下单人头像url", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "nickName", value = "下单人昵称", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "phone", value = "手机号码", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "remark", value = "用户备注", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "blessUsingId", value = "福位id", required = true, dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "sum", value = "总数量", required = true, dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "ageLimit", value = "次数(节气数)", required = true, dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "totalPrice", value = "总价格", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "confirmTimeStr", value = "祭祀时间(yyyy-MM-dd HH)", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "confirmEndTimeStr", value = "祭祀结束时间(yyyy-MM-dd HH)", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "orderItemJson", value = "订单详情集合json({'productLinkId(规格id)':'11', 'name(规格名称)','22, 'num(数量)','price(价格)','11'})", required = true, dataType = "String", paramType = "query")
})
@ResponseBody
public JsonResult add(OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) {
if (StringUtils.isBlank(vo.getConfirmTimeStr())) {
return JsonResult.failed("祭扫时间不可为空");
}
OshServicesOrderVo returnVo = oshServicesOrderSerice.insertOrder(vo);
Map<String, Object> result = Maps.newHashMap();
result.put("orderId", returnVo.getId());
result.put("code", returnVo.getCode());
result.put("createDate", new Date().getTime());
result.put("payPrice", returnVo.getTotalPrice());
return JsonResult.success("新增请求成功", result);
}
/**
* 支付
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/wxPay", method = RequestMethod.POST)
@ApiOperation(value = "支付", httpMethod = "POST", notes = "支付", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "phone", value = "手机号码", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "code", value = "订单编码", required = true, dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "wxCode", value = "微信的code", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "payChooseType", value = "支付类型(0:APP 1:H5 2:JSAPI 3:小程序)", required = true, dataType = "String", paramType = "query"),
})
@ResponseBody
public JsonResult pay(OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) throws Exception {
OshServicesOrderVo result = oshServicesOrderSerice.getViewByCode(vo);
String totalPrice = result.getTotalPrice() + "";
if ("0.0".equals(totalPrice)) {
return JsonResult.failed("订单价格异常,支付失败");
}
if ("0".equals(vo.getPayChooseType())) {
return JsonResult.success("支付请求成功", oshServicesOrderSerice.doUnifiedOrder(vo.getCode(), totalPrice));
} else if ("1".equals(vo.getPayChooseType())) {
return JsonResult.success("支付请求成功", oshServicesOrderSerice.doUnifiedOrderForH5(vo.getCode(), vo.getPayType(), totalPrice));
} else if ("2".equals(vo.getPayChooseType())) {
return JsonResult.success("支付请求成功", oshServicesOrderSerice.doUnifiedOrderForJSAPI(vo.getCode(), totalPrice, vo.getOpenId()));
} else {
return JsonResult.success("支付请求成功", oshServicesOrderSerice.doUnifiedOrderForAppletJSAPI(vo.getCode(), totalPrice, vo.getOpenId()));
}
}
/**
* 支付回调
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/wxPayBack", method = RequestMethod.POST)
@ApiOperation(value = "支付回调", httpMethod = "POST", notes = "支付回调", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "resXml", value = "微信签名", required = true, dataType = "String", paramType = "query"),
})
@ResponseBody
public String wxPayBack(OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) throws Exception {
return oshServicesOrderSerice.payBack(request);
}
/**
* 订单详情
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/view", method = RequestMethod.POST)
@ApiOperation(value = "订单详情", httpMethod = "POST", notes = "订单详情", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "订单编号", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult view(OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) {
Map map = oshServicesOrderSerice.view(vo);
return JsonResult.success("详情请求成功", map);
}
/**
* 查看评价详情
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/evaluateView", method = RequestMethod.POST)
@ApiOperation(value = "查看评价详情", httpMethod = "POST", notes = "查看评价详情", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "订单编号", required = true, dataType = "Long", paramType = "query")
})
@ResponseBody
public JsonResult evaluateView(OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> map = oshServicesOrderSerice.evaluateView(vo);
return JsonResult.success("评价详情请求成功", map);
}
/**
* 订单评价
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/evaluate", method = RequestMethod.POST)
@ApiOperation(value = "订单评价", httpMethod = "POST", notes = "订单评价", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "订单编号", required = true, dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "evaluateLevel", value = "评价星级", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "evaluateText", value = "评价内容", required = false, dataType = "String", paramType = "query")
})
@ResponseBody
public JsonResult evaluate(OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) {
oshServicesOrderSerice.evaluate(vo);
return JsonResult.success("评价成功");
}
/**
* 订单评价列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/evaluateList", method = RequestMethod.POST)
@ApiOperation(value = "订单评价列表", httpMethod = "POST", notes = "订单评价列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "productId", value = "商品编号", required = true, dataType = "Long", paramType = "query"),
})
@ResponseBody
public JsonResult evaluateList(OshServicesOrderVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("获取评价列表成功", oshServicesOrderSerice.findEvaluateList(vo));
}
}
package com.atlgroupasia.servicecenter.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/services/specification")
@Api(tags = "商品规格型接口")
public class ApiOshServicesSpecificationController {
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.service.OshServicesSerice;
import com.atlgroupasia.servicecenter.service.OshServicesTypeSerice;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.vo.OshServicesTypeVo;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@RestController
@RequestMapping("/api/services/type")
@Api(tags = "商品类型接口")
public class ApiOshServicesTypeController {
@Autowired
private OshServicesTypeSerice oshServicesTypeSerice;
/**
* 商品列表
*
* @throws IOException
* @author heshenmi
* 2017年9月26日 下午6:26:53
*/
@RequestMapping(value = "/list", method = RequestMethod.POST)
@ApiOperation(value = "商品列表", httpMethod = "POST", notes = "商品列表", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
})
@ResponseBody
public JsonResult list(OshServicesTypeVo vo, HttpServletRequest request, HttpServletResponse response) {
return JsonResult.success("列表请求成功", oshServicesTypeSerice.findList(vo));
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.dto.OshParamsDto;
import com.atlgroupasia.servicecenter.service.ParamsService;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/api/params")
@Api(tags = "参数接口")
public class ApiParamsController {
@Resource
private ParamsService paramsService;
@RequestMapping(value = "/go/find-no-del", method = RequestMethod.POST)
@ApiOperation(value = "福位启用详情", httpMethod = "POST", notes = "福位启用详情接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "paramsId", value = "查询参数id", required = true, dataType = "Integer", paramType = "query")
})
@ResponseBody
public JsonResult findNoDel(Integer paramsId) {
try {
OshParamsDto oshParams= paramsService.findNoDel(paramsId);
return JsonResult.success("查询成功",oshParams);
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("查询失败,请稍候再试!");
}
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.dto.BlessEnableDto;
import com.atlgroupasia.servicecenter.dto.UserBlessUsingDto;
import com.atlgroupasia.servicecenter.entity.*;
import com.atlgroupasia.servicecenter.service.*;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.vo.UserBlessUsingVo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@RestController
@RequestMapping("/api/userBlessUsing")
@Api(tags = "福位启用接口")
public class ApiUserBlessUsingController {
@Autowired
private UserBlessUsingService userBlessUsingService;
@Autowired
private BlessEnableService blessEnableService;
@Autowired
private SpecificationsService specificationsService;
@Autowired
private TempleService templeService;
@Autowired
private MaintainPriceService maintainPriceService;
@Autowired
private MaintainOrderService maintainOrderSerivice;
@Autowired
private MemorialHallService memorialHallService;
@Autowired
private DonateOrderService donateOrderService;
@Autowired
private UserService userService;
@Autowired
private BlessService blessService;
@Autowired
private MaintainOrderService maintainOrderService;
/**
* 服务中心晋塔申请新增保存
*
* @param userBlessUsing
* @param response
* @param request
* @throws IOException
*/
@RequestMapping(value = "/new-user-bless", method = RequestMethod.POST)
@ApiOperation(value = "服务中心晋塔申请新增保存", httpMethod = "POST", notes = "晋塔申请", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "relation", value = "与往生者的关系", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "name", value = "往生者姓名", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "blessId", value = "福位id", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "blessIdx", value = "福位中的第几个", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "sex", value = "性别", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "birthdayStr", value = "出生日期", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "identify", value = "身份证号", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "deathDayStr", value = "往生日期", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "usingWayAshes", value = "骨灰", required = false, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "usingWayKeepsake", value = "其他", required = false, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "usingTimeStr", value = "晋塔安奉时间", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "isMemory", value = "是否添加纪念日提醒", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "deathProve", value = "死亡证明", required = false, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "cremationProve", value = "火化证明", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "arrImg", value = "其他证明", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "payYears", value = "管理年限", required = false, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "payMoney", value = "交款总额", required = false, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "payName", value = "交款人", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "payType", value = "交款方式", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "maintainPriceId", value = "维护费表id", required = false, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "maintainPrice", value = "每年维护费", required = false, dataType = "Integer", paramType = "query"),
})
@ResponseBody
public JsonResult newBrand(UserBlessUsingVo userBlessUsing, MaintainOrder maintainOrder, HttpServletResponse response, HttpServletRequest request) throws IOException {
try {
userBlessUsing.setType(0);
userBlessUsing.setCreateTime(new Date());
userBlessUsing.setTempleId(memorialHallService.findNoDel(blessService.findNoDel(userBlessUsing.getBlessId()).getMemorialHallId()).getTempleId());
userBlessUsing.setUpdatetime(new Date());
String birthdayStr1 = userBlessUsing.getBirthdayStr();
String usingUsingTimeStr = userBlessUsing.getUsingTimeStr();
String deathDayStr = userBlessUsing.getDeathDayStr();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
Date birthday = simpleDateFormat.parse(birthdayStr1);
Date deathDay = simpleDateFormat.parse(deathDayStr);
Date usingUsingTime = simpleDateFormat.parse(usingUsingTimeStr);
userBlessUsing.setBirthday(birthday);
userBlessUsing.setUsingTime(deathDay);
userBlessUsing.setDeathDay(usingUsingTime);
userBlessUsing.setState(0);
String phone = donateOrderService.findOrderState5(userBlessUsing.getBlessId());
User user = userService.findNoDel(phone);
User user1 = new User();
BlessEnable blessEnable = new BlessEnable();
if (user==null){
user1.setPhone(phone);
user1.setCreateTime(new Date());
userService.batchNewEntity(user1);
userBlessUsing.setRelationId(user1.getId());
blessEnable = blessEnableService.getForBless(userBlessUsing.getBlessId(), userBlessUsing.getBlessIdx());
blessEnable.setUserId(user1.getId());
blessEnable.setEnableState(1);
userBlessUsing.setEnableId(blessEnable.getId());
blessEnableService.update(blessEnable);
userBlessUsingService.batchNewEntity(userBlessUsing);
}else {
userBlessUsing.setRelationId(user.getId());
blessEnable = blessEnableService.getForBless(userBlessUsing.getBlessId(), userBlessUsing.getBlessIdx());
blessEnable.setUserId(user.getId());
blessEnable.setEnableState(1);
userBlessUsing.setEnableId(blessEnable.getId());
blessEnableService.update(blessEnable);
userBlessUsingService.batchNewEntity(userBlessUsing);
}
if (maintainOrder!=null){
maintainOrder.setBlessId(userBlessUsing.getBlessId());
maintainOrder.setBlessIdx(userBlessUsing.getBlessIdx());
maintainOrder.setPayType(0);
maintainOrder.setPayTime(new Date());
maintainOrder.setState(0);
maintainOrder.setPrice(maintainOrder.getMaintainPrice());
maintainOrderService.batchNewEntity(maintainOrder);
}
Integer blessId = userBlessUsing.getBlessId();
Bless bless = blessService.findNoDel(blessId);
HashMap<String, Object> map = new HashMap<>();
if (bless!=null){
String codeNumber = bless.getCodeNumber();
map.put("codeNumber",codeNumber);
map.put("createTime",userBlessUsing.getCreateTime());
map.put("enableState",blessEnable.getEnableState());
}
return JsonResult.success("申请成功,请耐心等待!!!",map);
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("申请失败,请稍后重试!!!");
}
}
@RequestMapping(value = "/query-user-bless", method = RequestMethod.POST)
@ApiOperation(value = "查看福位启用详情", httpMethod = "POST", notes = "查看福位启用详情接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "福位id", required = true, dataType = "Integer", paramType = "query")
})
@ResponseBody
public JsonResult queryUserBless(Integer id, HttpServletResponse response, HttpServletRequest request) throws IOException {
try {
Integer specificationsId = blessService.findNoDel(id).getSpecificationsId();
Specifications specifications = specificationsService.findNoDel(specificationsId);
System.out.println(specifications.getNumber());
if (null == blessEnableService.findAllNoDelByBlessId(id) || blessEnableService.findAllNoDelByBlessId(id).size() == 0) {
List<BlessEnable> blessEnableList = new ArrayList<BlessEnable>();
//查询福位位数
for (int i = 0; i < specifications.getNumber(); i++) {
BlessEnable enable = new BlessEnable();
enable.setBlessId(id);
enable.setEnableState(0);
enable.setCreateTime(new Date());
enable.setBlessIndex(i + 1);
blessEnableList.add(enable);
}
for (int i = 0; i < blessEnableList.size(); i++) {
blessEnableService.batchNewEntity(blessEnableList.get(i));
}
return JsonResult.success("请求成功", blessEnableList);
} else {
List<BlessEnableDto> blesses = blessEnableService.findAllNoDelByBlessId(id);
for (int i = 0; i < blesses.size(); i++) {
Integer blessEnableId = blesses.get(i).getId();
UserBlessUsing userBlessUsing = userBlessUsingService.findByBlessEnableId(blessEnableId);
if (userBlessUsing != null) {
blesses.get(i).setBlessUsingName(userBlessUsing.getName());
blesses.get(i).setUserBlessUsingId(userBlessUsing.getId());
}
}
return JsonResult.success("请求成功", blesses);
}
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("查看失败,请稍后重试");
}
}
@RequestMapping(value = "/go/new-user-bless", method = RequestMethod.POST)
@ApiOperation(value = "启用接口", httpMethod = "POST", notes = "启用接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "blessId", value = "福位id", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "idx", value = "福位的第几个位置", required = true, dataType = "Integer", paramType = "query")
})
@ResponseBody
public JsonResult goAddBlessUsing(Integer idx, Integer blessId) {
try {
int specificationsId = blessService.findNoDel(blessId).getSpecificationsId();
int templeId = templeService.findNoDelByMemorialHallId(memorialHallService.findNoDel(blessService.findNoDel(blessId).getMemorialHallId()).getTempleId()).getId();
MaintainPrice maintainPrice = maintainPriceService.findMaintainPrice(specificationsId, templeId);
MaintainOrder maintainOrder = maintainOrderSerivice.findNoDelByBlessIdAndIdx(blessId, idx);
HashMap<String, Object> map = new HashMap<>();
map.put("blessId", blessId);
map.put("idx", idx);
if (maintainOrder == null) {
map.put("isBuy", 0);
if (maintainPrice == null) {
map.put("maintainPrice", "0");
} else {
map.put("maintainPrice", maintainPrice);
}
return JsonResult.success("请求成功", map);
} else {
map.put("isBuy", 1);
map.put("maintainOrder", maintainOrder);
return JsonResult.success("请求成功", map);
}
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("请求失败,请稍候重试");
}
}
@RequestMapping(value = "/go/select-user-bless", method = RequestMethod.POST)
@ApiOperation(value = "福位启用详情", httpMethod = "POST", notes = "福位启用详情接口", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "userBlessUsingId", value = "福位启用id", required = true, dataType = "Integer", paramType = "query")
})
@ResponseBody
public JsonResult goSelectBless(Integer userBlessUsingId) {
try {
UserBlessUsingDto userBlessUsing = userBlessUsingService.selectRest(userBlessUsingId);
if (userBlessUsing == null) {
return JsonResult.failed("该福位尚无启用信息");
} else {
return JsonResult.success("获取详情成功", userBlessUsing);
}
} catch (Exception e) {
e.printStackTrace();
return JsonResult.failed("查询失败,请稍候再试!");
}
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.dto.OshParamsDto;
import com.atlgroupasia.servicecenter.entity.Sms;
import com.atlgroupasia.servicecenter.entity.User;
import com.atlgroupasia.servicecenter.exception.BusinessException;
import com.atlgroupasia.servicecenter.service.ParamsService;
import com.atlgroupasia.servicecenter.service.SmsService;
import com.atlgroupasia.servicecenter.service.UserService;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.utils.Md5Utils;
import io.swagger.annotations.*;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
@RestController
@RequestMapping("/api/user")
@Api(tags = "用户接口")
@CrossOrigin(origins = "*",maxAge = 3600)
public class ApiUserController {
@Resource
private ParamsService paramsService;
@Autowired
private SmsService smsService;
@Autowired
private UserService userService;
@RequestMapping(value = "/login", method = RequestMethod.POST)
@ApiOperation(value = "登录", httpMethod = "POST", notes = "登录", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "loginName", value = "登录名", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "password", value = "密码", required = false, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "code", value = "验证码", required = false, dataType = "Integer", paramType = "query"),
})
@ResponseBody
public JsonResult login(String loginName, String password, String code) {
if(StringUtils.isNotBlank(code)){
return smsService.getUserCode(loginName,code,0);
}else {
if(StringUtils.isBlank(loginName)|| StringUtils.isBlank(password)){
return JsonResult.failed("账号或密码不能为空");
}else{
User user = userService.getUserByMobile(loginName);
if(null == user){
return JsonResult.failed("账号不存在");
}else{
String dbPassword = user.getPassword();
String pwd = DigestUtils.md5Hex(password);
if (!StringUtils.equals(pwd, dbPassword)) {
return JsonResult.failed("密码错误");
}else {
if(user.getState().compareTo(1) == 0){
return JsonResult.failed("该账号被禁用");
}else {
String token = Md5Utils.parseMD5("" + user.getId()+new Date());
user.setSysToken(token);
userService.updateToken(user);
return JsonResult.success("登录成功", token);
}
}
}
}
}
}
@RequestMapping(value = "/sendCode", method = RequestMethod.POST)
@ApiOperation(value = "发送短信", httpMethod = "POST", notes = "发送短信", response = JsonResult.class)
@ApiResponses(@ApiResponse(code = 200, message = "请求成功", response = JsonResult.class))
@ApiImplicitParams({
@ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String", paramType = "query"),
})
@ResponseBody
public JsonResult sendCode(String mobile) {
return smsService.sendVerifyCode(mobile,0,"1");
}
}
package com.atlgroupasia.servicecenter.controller;
import com.atlgroupasia.servicecenter.service.UserService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/api/userPost")
@Api(tags = "邮寄消费接口")
@CrossOrigin(origins = "*",maxAge = 3600)
public class ApiUserPostController {
@Resource
private UserService userService;
// @RequestMapping(value="/mod-user-state",method= RequestMethod.POST)
// public void disableUser(Integer id, String postCompany, String postNumber, HttpServletResponse response, HttpServletRequest request) throws IOException {
// try {
//
// UserPost userPost = userPostService.find(id);
// JSONObject result = new JSONObject();
// User user = userService.find(userPost.getUserId());
// /*******************判断用户余额*****************/
// if(user.getMoney().compareTo(userPost.getPrice())==-1){
// ControllerHelper.sendErrorJson(response, "该用户金额不足,请先充值");
// return ;
// }
// /***************扣除用户余额*******/
// user.setMoney(user.getMoney().subtract(userPost.getPrice()));
// userService.update(user);
//
// /**************************钱包消息**************/
// WalletRecord walletRecord = new WalletRecord();
// walletRecord.setPayState(0);
// walletRecord.setUserId(user.getId());
// walletRecord.setOperateId(admin.getId());
// walletRecord.setType(3);
// walletRecord.setCreateTime(new Date());
// walletRecord.setRemark("邮寄消费");
// walletRecord.setAmount(userPost.getPrice());
// walletRecordService.newEntity(walletRecord);
// /**************************更新邮寄消息************/
// String[] columns = {"post_company","post_number","post_time","state"};
// Object[] params = {postCompany,postNumber,new Date(),2};
// userPostService.update(id, columns, params);
// result.put("info", "邮寄成功");
// ControllerHelper.sendSuccessJson(response,result);
// } catch (Exception e) {
// e.printStackTrace();
// ControllerHelper.sendErrorJson(response,"账号失败,请刷新后重试");
// }
// }
}
package com.atlgroupasia.servicecenter.controller;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
/**
* 功能描述: <br>统一控制器
* 〈〉
* @since: 1.0.0
* @Author:Momo
* @Date: 2019/5/26 17:01
*/
public class BaseController {
@Autowired
private HttpServletRequest request;
/**
* 获取userId
* @return
*/
protected Long getUserId() {
Object userId = request.getAttribute("userId");
if (Objects.isNull(userId)) {
return null;
}
if (StringUtils.isBlank(userId.toString())) {
return null;
}
return Long.parseLong(userId.toString());
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import com.atlgroupasia.servicecenter.utils.OssUtil;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class ActivityDto {
private Integer id;
private String pic;//图片
private String coverPic;//封面
private String title;//标题
private String province;//省份
private String city;//城市
private String area;//区域
private String provinceCode;//省份代码
private String cityCode;//城市代码
private String areaCode;//区域代码
private String address;//地址
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date beginTime;//开始时间
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyStartTime;//报名开始时间
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyEndTime;//报名结束时间
private Integer templeId;//寺庙id
private String master;//主办方
private String phone;//电话
private Integer totalNumber;//总人数
private Integer applyNumber;//已报名人数
private String content;//活动详情
private List<ShuttleDto> shuttles;
private String activityTime;
private String templeName;
private String templeContactPhone;
private Integer state;
private String stateStr;//活动状态
private String beginStr;
private String endStr;
private Integer isApply;
private Integer appointmentId;
private String beginTimeStr;
private String endTimeStr;
private String applyStartTimeStr;
private String applyEndTimeStr;
private String templeProvince;
private String templeCity;
private String templeArea;
private String coverPicStr;
public Date getApplyStartTime() {
return applyStartTime;
}
public void setApplyStartTime(Date applyStartTime) {
this.applyStartTime = applyStartTime;
this.applyStartTimeStr = DateUtils.DateToString(applyStartTime, DateUtils.formatStr_yyyyMMddHHmm);
}
public Date getApplyEndTime() {
return applyEndTime;
}
public void setApplyEndTime(Date applyEndTime) {
this.applyEndTime = applyEndTime;
this.applyEndTimeStr = DateUtils.DateToString(applyEndTime, DateUtils.formatStr_yyyyMMddHHmm);
}
public Integer getAppointmentId() {
return appointmentId;
}
public void setAppointmentId(Integer appointmentId) {
this.appointmentId = appointmentId;
}
public Integer getIsApply() {
return isApply;
}
public void setIsApply(Integer isApply) {
this.isApply = isApply;
}
public String getBeginStr() {
return beginStr;
}
public void setBeginStr(String beginStr) {
this.beginStr = beginStr;
}
public String getEndStr() {
return endStr;
}
public void setEndStr(String endStr) {
this.endStr = endStr;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPic() {
return pic;
}
public void setPic(String pic) {
this.pic = pic;
}
public String getCoverPic() {
return coverPic;
}
public void setCoverPic(String coverPic) {
this.coverPic = coverPic;
coverPicStr= OssUtil.IMG_ACCESS_URL +"/"+coverPic;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
this.beginTimeStr = DateUtils.DateToString(beginTime, DateUtils.formatStr_yyyyMMddHHmm);
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
this.endTimeStr = DateUtils.DateToString(endTime, DateUtils.formatStr_yyyyMMddHHmm);
}
public Integer getTempleId() {
return templeId;
}
public void setTempleId(Integer templeId) {
this.templeId = templeId;
}
public String getMaster() {
return master;
}
public void setMaster(String master) {
this.master = master;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Integer getTotalNumber() {
return totalNumber;
}
public void setTotalNumber(Integer totalNumber) {
this.totalNumber = totalNumber;
}
public Integer getApplyNumber() {
return applyNumber;
}
public void setApplyNumber(Integer applyNumber) {
this.applyNumber = applyNumber;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getActivityTime() {
return activityTime;
}
public void setActivityTime(String activityTime) {
this.activityTime = activityTime;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
if(state == 0){
this.stateStr = "未开始";
}else if(state == 1){
this.stateStr = "已开始";
}else{
this.stateStr = "已结束";
}
this.state = state;
}
public String getStateStr() {
return stateStr;
}
public void setStateStr(String stateStr) {
this.stateStr = stateStr;
}
public String getBeginTimeStr() {
return beginTimeStr;
}
public void setBeginTimeStr(String beginTimeStr) {
this.beginTimeStr = beginTimeStr;
}
public String getEndTimeStr() {
return endTimeStr;
}
public void setEndTimeStr(String endTimeStr) {
this.endTimeStr = endTimeStr;
}
public String getTempleName() {
return templeName;
}
public void setTempleName(String templeName) {
this.templeName = templeName;
}
public String getTempleContactPhone() {
return templeContactPhone;
}
public void setTempleContactPhone(String templeContactPhone) {
this.templeContactPhone = templeContactPhone;
}
public String getApplyStartTimeStr() {
return applyStartTimeStr;
}
public void setApplyStartTimeStr(String applyStartTimeStr) {
this.applyStartTimeStr = applyStartTimeStr;
}
public String getApplyEndTimeStr() {
return applyEndTimeStr;
}
public void setApplyEndTimeStr(String applyEndTimeStr) {
this.applyEndTimeStr = applyEndTimeStr;
}
public List<ShuttleDto> getShuttles() {
return shuttles;
}
public void setShuttles(List<ShuttleDto> shuttles) {
this.shuttles = shuttles;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getProvinceCode() {
return provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public String getAreaCode() {
return areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getTempleProvince() {
return templeProvince;
}
public void setTempleProvince(String templeProvince) {
this.templeProvince = templeProvince;
}
public String getTempleCity() {
return templeCity;
}
public void setTempleCity(String templeCity) {
this.templeCity = templeCity;
}
public String getTempleArea() {
return templeArea;
}
public void setTempleArea(String templeArea) {
this.templeArea = templeArea;
}
public String getCoverPicStr() {
return coverPicStr;
}
public void setCoverPicStr(String coverPicStr) {
this.coverPicStr = coverPicStr;
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.dto;
import lombok.Data;
/**
* @Description:地區
*
* @author ZYP 2017-3-19
*
*/
@Data
public class AreaDto {
private Integer id;
private String areaCode;
private String name;
private String cityCode;
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.entity.UserBlessUsing;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import com.atlgroupasia.servicecenter.utils.OssUtil;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class BlessDto implements Serializable {
private Integer id;//福位id
private Integer columnId;//柱id
private Integer memorialHallId;//纪念馆id
private String layer;//在第几层
private Integer recordId;//记录id
private BigDecimal priceRate;//价格比例
private BigDecimal basePrice;//基价格
private BigDecimal price;//总价格
private Integer rankId;//等级id
private Integer positionId;//方位id
private Integer fashionId;//款式id
private Integer specificationsId;//规格id
private String singlePic;//单层图片
private Integer lockSingle;//锁单
private String allPic;//全景图片
private String codeNumber;//编号
private String serialNumber;//序号
private Integer enable;//序号
private Integer saleTag;//0未卖出 1交易中 2已完成
private BigDecimal percent;//折扣
private Integer isShelves;//上下架
private String fashionSinglePic;//款式图片
private String ddNumber;
private String columnName;
private String columnLayer;
private Integer templeId;
private String templeName;//寺庙名称
private String templeProvince;//寺庙省份
private String memorialName;//纪念馆名称
private String institutionName;
private String memorialFloor;
private String fashionName;
private String rankName;
private String positionName;
private String specificationsName;
private String specificationsNumber;
private String donateName;
private String donatePhone;
private String donateTime;
private Integer companyId;
private BigDecimal columnPercent;
private String priceSumStr;
private BigDecimal blessPercentPrice;//折扣后价格
private String saleTagStr;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
private String donateImg;
private String blessVoucherPic;
private String blessVoucherPicStr;
private String createTimeStr;//创建时间字符串
private BigDecimal priceSum;//该柱总价格
private Integer sum;//福位总数
private Integer isCart;
private Integer personNumber;
private Integer bindNumber;
private Integer blessSaleSum;
private Integer partitionId;
private String partitionName;
private String coverPicStr;
private String saleStateName;
private String startStr;
/***********************OSH*********************/
private String fashionPic;//款式图片
private String coverPic;
private String floors;
private Integer ddoId;
private String ddName;
private String ddPhone;
private String ddIdentify;
private String hallName;
private String ddoNumbers;
private List<UserBlessUsing> usings;
private Integer idx;
private Integer state;
private Integer donorId;
private String donateAddress;
private String stateStr;
private String ddAddress;
private String address;
private String province;
private String city;
private String area;
private String enableStateName;
private String blessInformation;
private Integer enableSuccessStateNumber;
private Integer itemStatus;
private Integer blessVoucher;
private String blessVoucherStr;
public String getSaleTagStr() {
if(null != saleTag){
if(saleTag.compareTo(0) == 0){
return "未售";
}else if(saleTag.compareTo(1) == 0){
return "售中";
}else if(saleTag.compareTo(2) == 0){
return "售出";
}
}
return "";
}
public void setSaleTagStr(String saleTagStr) {
this.saleTagStr = saleTagStr;
}
public String getCreateTimeStr() {
if(null == createTime){
return createTimeStr ="";
}
this.createTimeStr = DateUtils.DateToString(createTime, DateUtils.formatStr_yyyyMMddHHmmss);
if(createTimeStr == null){
return "";
}
return createTimeStr;
}
public void setCreateTimeStr(String createTimeStr) {
this.createTimeStr = createTimeStr;
}
public String getCoverPic() {
return coverPic;
}
public void setCoverPic(String coverPic) {
this.coverPic = coverPic;
coverPicStr= OssUtil.IMG_ACCESS_URL +"/"+coverPic;
}
public String getFloors() {
return floors;
}
public void setFloors(String floors) {
this.floors = floors;
}
public String getDdName() {
return ddName;
}
public void setDdName(String ddName) {
this.ddName = ddName;
}
public String getDdPhone() {
return ddPhone;
}
public void setDdPhone(String ddPhone) {
this.ddPhone = ddPhone;
}
public String getDdIdentify() {
return ddIdentify;
}
public void setDdIdentify(String ddIdentify) {
this.ddIdentify = ddIdentify;
}
public String getHallName() {
return hallName;
}
public void setHallName(String hallName) {
this.hallName = hallName;
}
public List<UserBlessUsing> getUsings() {
return usings;
}
public void setUsings(List<UserBlessUsing> usings) {
this.usings = usings;
}
public Integer getIdx() {
return idx;
}
public void setIdx(Integer idx) {
this.idx = idx;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
public String getStateStr() {
return stateStr;
}
public void setStateStr(String stateStr) {
this.stateStr = stateStr;
}
public String getDdAddress() {
return ddAddress;
}
public void setDdAddress(String ddAddress) {
this.ddAddress = ddAddress;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getEnableStateName() {
return enableStateName;
}
public void setEnableStateName(String enableStateName) {
this.enableStateName = enableStateName;
}
public Integer getEnableSuccessStateNumber() {
return enableSuccessStateNumber;
}
public void setEnableSuccessStateNumber(Integer enableSuccessStateNumber) {
this.enableSuccessStateNumber = enableSuccessStateNumber;
}
public String getDonateImg() {
return donateImg;
}
public void setDonateImg(String donateImg) {
this.donateImg = donateImg;
}
public String getCoverPicStr() {
return coverPicStr;
}
public void setCoverPicStr(String coverPicStr) {
this.coverPicStr = coverPicStr;
}
public Integer getBlessVoucher() {
return blessVoucher;
}
public void setBlessVoucher(Integer blessVoucher) {
this.blessVoucher = blessVoucher;
if (blessVoucher==0){
blessVoucherStr="服务商代保管";
}else if (blessVoucher==1){
blessVoucherStr="已申领纸质转为自保管";
}else {
blessVoucherStr="现场领取";
}
}
public String getBlessVoucherStr() {
return blessVoucherStr;
}
public void setBlessVoucherStr(String blessVoucherStr) {
this.blessVoucherStr = blessVoucherStr;
}
public String getBlessVoucherPic() {
return blessVoucherPic;
}
public void setBlessVoucherPic(String blessVoucherPic) {
this.blessVoucherPic = blessVoucherPic;
blessVoucherPicStr=OssUtil.IMG_ACCESS_URL+"/"+blessVoucherPic;
}
public String getBlessVoucherPicStr() {
return blessVoucherPicStr;
}
public void setBlessVoucherPicStr(String blessVoucherPicStr) {
this.blessVoucherPicStr = blessVoucherPicStr;
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class BlessEnableDto implements Serializable {
private Integer id;//福位启用id
private Integer userId;//用户id
private Integer blessId;//福位id
private Integer blessIndex;//福位位数
private Integer enableState;//启用状态
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String stateStr;
private String singlePic;//款式图
private Integer number;//数量
private String blessUsingName;//数量
private Integer userBlessUsingId;
public String getStateStr() {
if(this.enableState==0){
return "未启用";
}else if(this.enableState==1){
return "待审核";
}else if(this.enableState==2){
return "未通过";
}else{
return "已启用";
}
}
public void setStateStr(String stateStr) {
this.stateStr = stateStr;
}
}
package com.atlgroupasia.servicecenter.dto;
import lombok.Data;
import java.util.LinkedList;
/**
* @Description:城市
*
* @author ZYP 2017-3-19
*
*/
@Data
public class CityDto {
private Integer id;
private String name;//名稱
private String cityCode;//城市ID
private String provinceCode;//省份id
private String provinceName;
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.entity.Bless;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class ColumnDto implements Serializable {
private Integer id;//列id
private Integer recordId;//记录id
private String name;//列名称
private BigDecimal basePrice;//基价格
private Integer positionId;//方位id
private Integer rankId;//等级id
private Integer fashionId;//款式id
private Integer specificationsId;//规格id
private Integer templeId;//寺庙id
private Integer memorialHallId;//纪念馆id
private Integer institutionId;//机构id//楼阁
private Integer layerSum;//层的数量
private String singlePic;//单层图
private String allPic;//全景图
private Integer isSel;//是否被卖出 0为未卖出 1为已卖出 2为部分售出
private Integer lockSingle;//是否认捐单中 0为否 1为是
private BigDecimal percent;//折扣
private Integer isShelves;//是否上架 0上架 1下架
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String createTimeStr;
private BigDecimal price;
private String fashionName;//款式名称
private String fashionUrl;//款式URL地址
private String memorialHallName;//纪念馆名称
private BigDecimal blessSumPrice;//柱的总价
private String templeProvince;//寺庙省份
private String templeName;//寺庙名称
private String institutionName;//楼阁名称
private String memorialHallFloor;//纪念馆所在层数
private String partitionName;//分区名称
private String positionName;//方位名称
private String specificationsName;//规格名称
private Integer isCart;//是否在购物车中
private String fashionSinglePic;//款式单层图
private String planPic;//款式平面图
private Integer sum;//数量
private BigDecimal priceSum;//价钱总数
private String rankName;//等级名称
private String subscriptionOrdernumber;//认捐单号
private Integer blessSum;
private String isSelName;//卖出状态
private Integer companyId;//主公司id
private Integer manageId;//管理机构id
private List<Bless> blesseList;//福位集合
private BigDecimal columnPercentPrice;//折扣后价格
private Integer cartId;//购物车id
private Integer columnNum;
private Integer blessSaleSum;//福位售出总数
private Integer blessLockSum;//福位锁定总数
private String ColumnIds;
public String getCreateTimeStr() {
if(createTime == null){
return "";
}
this.createTimeStr = DateUtils.DateToString(createTime, DateUtils.formatStr_yyyyMMddHHmmss);
if(createTimeStr == null){
return "";
}
return createTimeStr;
}
public void setCreateTimeStr(String createTimeStr) {
this.createTimeStr = createTimeStr;
}
public void setBlessSumPrice(BigDecimal blessSumPrice) {
if(blessSumPrice == null){
this.blessSumPrice = new BigDecimal(0);
}else{
this.blessSumPrice = blessSumPrice;
}
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.entity.Bless;
import com.atlgroupasia.servicecenter.entity.OrderMessage;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class DonateOrderDto {
private Integer id;//助捐单id
private Integer donorId;//助捐人id
private String donorName;//捐建人姓名
private String linkedName;//联系人
private String linkedPhone;//联系人电话
private String identity;//捐建人身份证
private String address;//通讯地址
private String numbers;//助捐单号
private Integer agencyId;//推广商id
private Integer merits;//功德证 0为免费代管 1为寄送并自己保管
private Integer voucher;//使用凭证 0为免费代管 1为寄送并自己保管
private Integer state;//支付状态 0为等待支付 1为已支付 2取消订单
private Integer determineState;//确定交易状态 1为自确定 2为平台确定
private Integer source;//来源 0为自建 1为平台创建
private Integer send;//捐建书
private String reason;//审核失败理由
private Integer pressConfirm;//0为未催促 1为促催确认
private BigDecimal price;//价格
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date outTime;//过期时间
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date confirmTime;//确认时间
private String blessIds;//福位id
private Integer blessNum;//福位数量
private Integer companyId;//公司id
private Integer isDonate;//是否 捐建发起的订单 0为助捐区 1为捐建区
private Integer realPayment;//实际付款方式
private String img;//图片
private String instruction;//说明
private BigDecimal discountPrice;//折扣后金额
private Integer belongSubscriptionOrderId;//属于哪个认捐单
private String changePriceRemark;
private String donateImg;
private String sqImg;
private String qtImg;
private Integer advanceState;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
private Integer isView;
private String serialNumber;
private String welcomeName;
/***********************OSH*****************/
private Integer welcomeType;
private String phone;
private String specificationsName;//规格名称
private String fashionName;//款式名称
private String fashionPic;//款式图
private Integer specificationsNumber;//款式位数
private String memorialHallName;//纪念馆名称
private String templeName;//寺庙名称
private String templeAddress;//寺庙地址
private String year;//年份
private String month;//月份
private String day;//日期
private BigDecimal BlessPrice;//福位价格
private String capitalBlessPrice;//大写价格
private String blessCodeNumber;//福位编号
private String blessSerialNumber;
private String donorPic;//捐建人头像
public Integer getBelongSubscriptionOrderId() {
return belongSubscriptionOrderId;
}
public void setBelongSubscriptionOrderId(Integer belongSubscriptionOrderId) {
this.belongSubscriptionOrderId = belongSubscriptionOrderId;
}
private String differTime;
private Integer sideType;//内部或外部
private String donatePersonName;//新捐建人
private String orderPerson;//下单人
private String originalDonate;//原捐建人
private String agencyIdentify;//认捐人身份证
private String createTimeStr;
private List<Bless> blessList;
private String subscriptionOrderNumber;//认捐单号
private List<OrderMessage> orderMessageList;
private Integer donateOrderSum;//助捐单数量
private String blessLayer;//福位所在层
private String stateStr;
private String sourceStr;
private String agencyName;
public String getCreateTimeStr() {
if(createTime == null){
return createTimeStr ="";
}
this.createTimeStr = DateUtils.DateToString(createTime, DateUtils.formatStr_yyyyMMddHHmmss);
if(createTimeStr == null){
return "";
}
return createTimeStr;
}
public void setCreateTimeStr(String createTimeStr) {
this.createTimeStr = createTimeStr;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
switch (state){
case 0:
stateStr="等待支付";
break;
case 1:
stateStr="支付超时";
break;
case 2:
stateStr="审核不通过";
break;
case 3:
stateStr="审核成功";
break;
case 4:
stateStr="取消订单";
break;
case 5:
stateStr="已完成";
break;
}
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
if (source==0){
sourceStr="自建";
}else {
sourceStr="平台创建";
}
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import lombok.Data;
import java.util.Date;
@Data
public class DonorDto {
private Integer id;//捐建人id
private Integer companyId;
private String name;//捐建人姓名
private String pic;//头像
private String phone;//手机号绑定(作为登入账号)
private String identify;//身份证
private String password;//登入密码
private String identifyJustPic;//身份证正面照
private String identifyBackPic;//身份证反面照
private String province;//省份
private String city;//城市
private String area;//区域
private String address;//通讯地址
private String email;//邮箱
private String linkedName;//联系人
private String linkedPhone;//联系电话
private Integer authentication;//是否认证 0为未认证 1为已认证
private Integer provinceCode;//省份Code
private Integer cityCode;//城市Code
private Integer areaCode;//区域Code
private String reason;//理由
private String linkedBakPhone;
private String linkedBakName;
private Integer isService;
/*private Integer privacy;//隐私保护 0为可查看 1为不可查看 2为申请授权中
private Integer agencyId;//推广商id
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
private String createTimeStr;//创建时间字符串
private Integer isPrivacy;//是否授权
private Integer agencyDonorId;//经销商与捐建人关系id
private Integer agencyId;//推广机构的名称
private String agencyName;//推广机构的名称
public String getCreateTimeStr() {
this.createTimeStr = DateUtils.DateToString(createTime, DateUtils.formatStr_yyyyMMddHHmmss);
if(createTimeStr == null){
return "";
}
return createTimeStr;
}
public void setCreateTimeStr(String createTimeStr) {
this.createTimeStr = createTimeStr;
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.Date;
@Data
public class GiveRecordDto {
private Integer id;
private Integer userId;
private Integer giveUserId;
private Integer referType;
private Integer referId;
private Integer blessId;
private String orderCode;
private Integer state;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String codeNumber;//福位编号
private Integer memorialHallId;//纪念馆id
private Integer positionId;//方位id
private Integer specificationsId;//规格id
private String memorialHallFashionName;//款式名字
private String singlePic;//款式图
private String giveUserName;//转赠人姓名
private String giveUserPhone;//转赠人手机号码
private String userName;//被转赠人姓名
private String userPhone;//被转赠人手机号码
private String memorialHallName;//纪念馆名字
private String positionName;//获取方位名字
private String specificationsName;//获取规格名字
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.dto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class MaintainOrderDto implements Serializable {
private Integer id;
private Integer blessId;
private Integer blessIdx;
private Integer maintainPriceId;
private Integer payYears;
private BigDecimal price;
private BigDecimal payMoney;
private String payName;
private Integer payType;
private Date dateTime;
private Integer state;
private Integer isDel;
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.entity.MaintainPrice;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
public class MaintainPriceDto implements Serializable {
private int id;
private int templeId;
private int specificationsId;
private BigDecimal price;
private BigDecimal priceYear;
private String name;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private List<MaintainPrice> maintainPriceList;
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.entity.Column;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class MemorialHallDto implements Serializable{
private Integer id;//纪念馆id
private Integer companyId;//SAAS公司id
private Integer manageId; //管理机构ID
private Integer templeId;//寺庙id
private Integer institutionId;//机构id
private String name;//纪念馆名称
private String introduce;//介绍
private String floor;//楼层
private String coverPic; //封面
private String pic;//图片
private String codePrefix;//编号前缀
private String serialPrefix;//序号前缀
private String url;//介绍url
private String linkName;//联系人
private String linkPhone;//联系电话
private String generalLayoutPic;//总平面图
private Integer isRec;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
private String blessNumber;//首页纪念馆福位数量
private Integer blessSum;//福位数量
private String createTimeStr;//创建时间字符串
private String templeName;//寺庙名称
private String institutionName;//机构名称或楼阁名称
private String templeProvince;//寺庙省份
private List<Column> columnList;//柱List
private String templeCity;//寺庙城市
private String templeArea;//寺庙区域
private Integer sum;//纪念馆数量
private Integer fashionCount;
private Integer layerCount;
private Integer columnCount;
private BigDecimal sumPrice;//总价格
private List<String> picList;
public List<Column> getColumnList() {
return columnList;
}
public void setColumnList(List<Column> columnList) {
this.columnList = columnList;
}
public String getCreateTimeStr() {
if(null == createTime){
return "";
}
this.createTimeStr = DateUtils.DateToString(createTime, DateUtils.formatStr_yyyyMMddHHmmss);
if(createTimeStr == null){
return "";
}
return createTimeStr;
}
public void setCreateTimeStr(String createTimeStr) {
this.createTimeStr = createTimeStr;
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class OrderMessageDto implements Serializable {
private Integer id;//订单日志id
private Integer orderType;//订单类型 0为认捐单 1为助捐单
private String content;//订单内容
private Integer donateOrderId;//订单id
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String createTimeStr;
private String orderNumber;//订单号
public String getCreateTimeStr() {
this.createTimeStr = DateUtils.DateToString(createTime, DateUtils.formatStr_yyyyMMddHHmmss);
if(createTimeStr == null){
return "";
}
return createTimeStr;
}
public void setCreateTimeStr(String createTimeStr) {
this.createTimeStr = createTimeStr;
}
}
package com.atlgroupasia.servicecenter.dto;
import com.atlgroupasia.servicecenter.utils.OssUtil;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class OshCartItemDto implements Serializable {
private Integer id;
private Integer userId;
private Integer productId;
private Integer quantity;
private String pic;
private String picUrl;
private String name;
private BigDecimal price;
private Integer templeId;//该购物车商品隶属哪个寺庙
private Integer productStock;
private Integer productSaleCount;
public OshCartItemDto() {
super();
}
public Integer getTempleId() {
return templeId;
}
public OshCartItemDto(Integer userId, Integer productId, Integer quantity) {
super();
this.userId = userId;
this.productId = productId;
this.quantity = quantity;
}
public String getPicUrl() {
return OssUtil.STATIC_IMG_URL + "/" + getPic();
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.dto;
import lombok.Data;
import java.util.List;
@Data
public class OshParamsDto {
private Integer id;
private String name;
private String value;
private Integer type;
private String remark;
private Integer isDel;
private List<OshParamsDto> paramsList;
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ProductAdDto {
private Integer id;
private String link;
private String pic;
private Integer weight;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date createTime;
private Date updatetime;
private Integer isDel;
private Integer productId;
private Integer templeId;
private String title;
private String mtName;
private String firstPic;
private String productName;//商品名称
private BigDecimal productPrice;//商品价格
private Integer productStock;//商品库存
}
package com.atlgroupasia.servicecenter.dto;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class ProductDto {
private Integer id;
private Integer templeId;
private String serial;
private String name;
private Integer productTypeId;
private BigDecimal originPrice;
private BigDecimal price;
private String unit;
private Integer stock;
private Integer warningStock;
private Integer isShelves;
private String content;
private String firstPic;
private String pics;
private Date createTime;
private Integer creatorId;
private Integer saleCount;
/*******************************OSH****************/
private String templeName;
private String productTypeName;
private List<String> picList;
private String coverPic;
private Integer productIndex;
private Integer CartSum;//该商品存在购物车内的数量
}
package com.atlgroupasia.servicecenter.dto;
import lombok.Data;
/**
* @Description:省份表(安卓的不想找插件,所以后台代写一个省市区三级联动数据)
*
* @author ZYP 2017-3-19
*
*/
@Data
public class ProvinceDto {
private Integer id;
private String provinceCode;//省份編碼
private String name;//省份名稱
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ShuttleDto implements Serializable {
private Integer id;
private Integer templeId;
private Integer type;
private Integer relationId;
private Integer site;
private String province;
private String city;
private String area;
private String provinceCode;
private String cityCode;
private String areaCode;
private String address;
//
// @JSONField(format="yyyy-MM-dd HH:mm")
// private Date time;
private String time;
@JSONField(format="yyyy-MM-dd HH:mm")
private Date shuttleTime;
// @JSONField(format="yyyy-MM-dd HH:mm")
// private Date endTime;
//
private String endTime;
private BigDecimal price;
private String phone;
private Integer passengers;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String templeName;
private String contactPhone;
private String timeStr;
private String shuttleTimeStr;
public void setShuttleTime(Date shuttleTime) {
this.shuttleTime = shuttleTime;
this.shuttleTimeStr = DateUtils.DateToString(shuttleTime, DateUtils.formatStr_yyyyMMddHHmm);
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SpecificationsDto implements Serializable {
private Integer id;//规格id
private String name;//名称
private Integer companyId;//企业id
private Integer number;//规格位数
private Integer weight;//权重
private Integer isDefault;//是否默认
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
private String createTimeStr;//创建时间字符串
public String getCreateTimeStr() {
this.createTimeStr = DateUtils.DateToString(createTime, DateUtils.formatStr_yyyyMMddHHmmss);
if(createTimeStr == null){
return "";
}
return createTimeStr;
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.atlgroupasia.servicecenter.entity.Bless;
import com.atlgroupasia.servicecenter.entity.OshCartItem;
import com.atlgroupasia.servicecenter.entity.Product;
import com.atlgroupasia.servicecenter.entity.ProductAd;
import com.atlgroupasia.servicecenter.utils.DateUtils;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class TempleDto implements Serializable {
private Integer id;//寺庙id
private Integer companyId;//总公司id
private Integer manageId;//公司id
private String sequenceNumber;//序号
private String name;//寺庙名称
private String pic;//图片
private String coverPic; //封面图片
private String certificatePic;//证书公章
private String donateModelPic;//捐建书模版
private String blessVoucherPic;//福位凭证模版
private String moralityCardPic;//功德证
private String remark;//寺庙介绍
private BigDecimal maintainPrice;//维护费
private Integer provinceCode;
private String contactPhone;
private Integer cityCode;
private Integer areaCode;
private String province;//省份
private String city;//城市
private String area;//区域
private String address;//详情地址
private String bankNumber;
private String bankName;
private String bankUserName;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
private String createTimeStr;
private List<Bless> blessList;
/****************************OSH***************/
private Integer applySum;
private List<OshCartItem> cartItemList;
private List<ProductAd> productAdList;
private List<Product> productList;
private Integer userId;
public String getCreateTimeStr() {
if(null == this.createTime){
return "";
}
this.createTimeStr = DateUtils.DateToString(createTime, DateUtils.formatStr_yyyyMMddHHmmss);
if(createTimeStr == null){
return "";
}
return createTimeStr;
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author Administrator
*
*/
@Data
public class UserBlessUsingDto implements Serializable {
private Integer id; //主键id
private Integer relationId;//启用人id
private Integer type; //0前端用户开启,1后端管理员开启
private Integer blessId;//对应的福位
private Integer blessIdx;//bless idx 对应福位中哪一个
private String relation;//与往生者的关系
private String name;//往生者姓名
private Integer sex;//性别 0 0为男,1为女
@JSONField(format = "yyyy-MM-dd")
private Date birthday;//公历生日
private String birthdayLunar;//农历生日
private String identify;//省份证号码
@JSONField(format="yyyy-MM-dd")
private Date deathDay;//死亡公历日期
private String deathDayLunar;//死亡农历日期
private Integer usingWayAshes;//启用方式(骨灰)0否 1.是
private Integer usingWayKeepsake;//启用方式(纪念品) 0否 1是
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date usingTime;//晋塔安奉时间
private Integer isYingling;//是否迎灵
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date yinglingTime;//迎灵时间
private String deathProve;//死亡证明
private String cremationProve;//火化证明
private BigDecimal money;//维护费
private String remarks;//备注
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//申请时间
private Integer state;//状态:0待审核;1:已开启;2未通过
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date reviewTime;//审核时间
private String reason;//拒绝理由
private Date updatetime;//更新时间
private Integer isDel;
private Integer templeId;//启用纪念馆id
private Integer enableId;//启用福位id
private Integer isMemory;//是否提醒
private String arrImg;//其他证明
private String usingWayStr;
private String blessInformation;
private String sexStr;
private String templeName;
private String address;
private String hallName;
private String codeNumber;
private String userPhone;
private String adminPhone;
private BigDecimal maintainPrice;
private String columnName;
private String fashionName;
private String positionName;
private String spName;
private Integer number;
private String userName;
private String adminName;
private String province;
private String city;
private String area;
private String donorName;
private String floors;
private String serialNumber;
private String ddName;
private String ddIdentify;
private String ddPhone;
private String pic;
private String mrName;
private String layer;
private String ddAddress;
private Integer num;
private String stateStr;
private String typeStr;
private String numberStr;
private String payPassword;//支付密码
private String linkedPhone;
private String usingTimeStr;
private String birthdayStr;
private String deathdayStr;
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
if (type==0){
typeStr="前端";
}else {
typeStr="后台";
}
}
public String getUserName() {
if(userName==null||userName==""){
return "";
}
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
birthdayStr = sdf.format(birthday);
}
public String getBirthdayLunar() {
return birthdayLunar;
}
public void setBirthdayLunar(String birthdayLunar) {
this.birthdayLunar = birthdayLunar;
}
public String getIdentify() {
return identify;
}
public void setIdentify(String identify) {
this.identify = identify;
}
public Date getDeathDay() {
return deathDay;
}
public void setDeathDay(Date deathDay) {
this.deathDay = deathDay;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
deathdayStr = sdf.format(deathDay);
}
public Date getUsingTime() {
return usingTime;
}
public void setUsingTime(Date usingTime) {
this.usingTime = usingTime;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
usingTimeStr = sdf.format(usingTime);
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
if (state==0){
stateStr="待审核";
}else if (state==1){
stateStr="已开启";
}else {
stateStr="未通过";
}
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
if(this.sex==0){
this.sexStr="男";
}else{
this.sexStr="女";
}
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class UserDto implements Serializable {
private Integer id;
private String phone;
private String password;
private BigDecimal money;
private String pic;
private String name;
private String paymentPassword;//支付密码
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date lastLoginTime;
private Integer state;
private String sysToken;
private String openid;//微信的openid
private String identify;
private String identifyJustPic;
private String identifyBackPic;
private String province;
private String city;
private String area;
private String code;
private String address;
private Integer examine;
private String provinceCode;
private String cityCode;
private String areaCode;
private Integer blessNum;
private String picUrl;
private Integer applyUserId;//申请人id
private String applyUserName;//申请人姓名
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class UserPostDto {
private Integer id;//主键id
private Integer userId;//用户id
private Integer blessId;//福位id
private BigDecimal price;//邮费价格
private String name;//收件人
private String phone;//收件人电话
private String address;//收件地址
private Integer certificateType;//邮寄证书类型 0为功德证 1为福位证 2为捐款书
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;//申请邮寄时间
private Integer type;//申请类型 0 首次申请;1补寄
private String postCompany;//物流公司
private String postNumber;//物流单号
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date postTime;//寄出时间
private Integer state;//状态:0未支付;1已支付待邮寄;2已寄出
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//订单创建时间
private String mfName;//更新时间
private String codeNumber;
private String hallName;
private String fashionName;
private String userPhone;
private String allPic;
private String mpName;
private String msName;
private String fashionPic;
private String postTimeStr;
private String certificateTypeStr;
public Integer getCertificateType() {
return certificateType;
}
public void setCertificateType(Integer certificateType) {
this.certificateType = certificateType;
if(certificateType==0){
this.certificateTypeStr="功德证";
}else if(certificateType==1){
this.certificateTypeStr="福位证";
}else if(certificateType==2){
this.certificateTypeStr="捐赠书";
}
}
}
package com.atlgroupasia.servicecenter.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class WalletRecordDto {
private Integer id;
private Integer userId;
private Integer payState;
private Integer operateId;
private Integer type;
private String typeStr;
private String remark;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date createTime;
private BigDecimal amount;
private Integer isDel;
private String userName;
private String operateName;
private String dateStr;
public String getTypeStr() {
if(this.type==0){
return "订单支付";
}else if(this.type==1){
return "会员充值";
}else if(this.type==2){
return "商家调整";
}else if(this.type==3){
return "邮寄消费";
}else if(this.type==4){
return "启用福位";
}else{
return "预约服务";
}
}
public void setTypeStr(String typeStr) {
this.typeStr = typeStr;
}
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class Activity implements Serializable {
private Integer id;
private String pic;//图片
private String coverPic;//封面
private String title;//标题
private String province;//省份
private String city;//城市
private String area;//区域
private String provinceCode;//省份代码
private String cityCode;//城市代码
private String areaCode;//区域代码
private String address;//地址
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date beginTime;//开始时间
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyStartTime;//报名开始时间
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyEndTime;//报名结束时间
private Integer templeId;//寺庙id
private String master;//主办方
private String phone;//电话
private Integer totalNumber;//总人数
private Integer applyNumber;//已报名人数
private String content;//活动详情
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
/**
* @Description:地區
*
* @author ZYP 2017-3-19
*
*/
@Data
public class Area {
private Integer id;
private String areaCode;
private String name;
private String cityCode;
}
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class Bless {
private Integer id;//福位id
private Integer columnId;//柱id
private Integer memorialHallId;//纪念馆id
private String layer;//在第几层
private Integer recordId;//记录id
private BigDecimal priceRate;//价格比例
private BigDecimal basePrice;//基价格
private BigDecimal price;//总价格
private Integer rankId;//等级id
private Integer positionId;//方位id
private Integer fashionId;//款式id
private Integer specificationsId;//规格id
private String singlePic;//单层图片
private Integer lockSingle;//锁单
private String allPic;//全景图片
private String codeNumber;//编号
private String serialNumber;//序号
private Integer enable;//序号
private Integer saleTag;//0未卖出 1交易中 2已完成
private BigDecimal percent;//折扣
private Integer isShelves;//上下架
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.Date;
@Data
public class BlessEnable {
private Integer id;//福位启用id
private Integer userId;//用户id
private Integer blessId;//福位id
private Integer blessIndex;//福位位数
private Integer enableState;//启用状态
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
import java.util.LinkedList;
/**
* @Description:城市
*
* @author ZYP 2017-3-19
*
*/
@Data
public class City {
private Integer id;
private String name;//名稱
private String cityCode;//城市ID
private String provinceCode;//省份id
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class Column implements Serializable {
private Integer id;//列id
private Integer recordId;//记录id
private String name;//列名称
private BigDecimal basePrice;//基价格
private Integer positionId;//方位id
private Integer rankId;//等级id
private Integer fashionId;//款式id
private Integer specificationsId;//规格id
private Integer templeId;//寺庙id
private Integer memorialHallId;//纪念馆id
private Integer institutionId;//机构id//楼阁
private Integer layerSum;//层的数量
private String singlePic;//单层图
private String allPic;//全景图
private Integer isSel;//是否被卖出 0为未卖出 1为已卖出 2为部分售出
private Integer lockSingle;//是否认捐单中 0为否 1为是
private BigDecimal percent;//折扣
private Integer isShelves;//是否上架 0上架 1下架
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class DonateOrder {
private Integer id;//助捐单id
private Integer donorId;//助捐人id
private String donorName;//捐建人姓名
private String linkedName;//联系人
private String linkedPhone;//联系人电话
private String identity;//捐建人身份证
private String address;//通讯地址
private String numbers;//助捐单号
private Integer agencyId;//推广商id
private Integer merits;//功德证 0为免费代管 1为寄送并自己保管
private Integer voucher;//使用凭证 0为免费代管 1为寄送并自己保管
private Integer state;//支付状态 0为等待支付 1为已支付 2取消订单
private Integer determineState;//确定交易状态 1为自确定 2为平台确定
private Integer source;//来源 0为自建 1为平台创建
private Integer send;//捐建书
private String reason;//审核失败理由
private Integer pressConfirm;//0为未催促 1为促催确认
private BigDecimal price;//价格
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date outTime;//过期时间
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date confirmTime;//确认时间
private String blessIds;//福位id
private Integer blessNum;//福位数量
private Integer companyId;//公司id
private Integer isDonate;//是否 捐建发起的订单 0为助捐区 1为捐建区
private Integer realPayment;//实际付款方式
private String img;//图片
private String instruction;//说明
private BigDecimal discountPrice;//折扣后金额
private Integer belongSubscriptionOrderId;//属于哪个认捐单
private String changePriceRemark;
private String donateImg;
private String sqImg;
private String qtImg;
private Integer advanceState;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
private Integer isView;
}
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
@Data
public class Donor {
private Integer id;//捐建人id
private Integer companyId;
private String name;//捐建人姓名
private String pic;//头像
private String phone;//手机号绑定(作为登入账号)
private String identify;//身份证
private String password;//登入密码
private String identifyJustPic;//身份证正面照
private String identifyBackPic;//身份证反面照
private String province;//省份
private String city;//城市
private String area;//区域
private String address;//通讯地址
private String email;//邮箱
private String linkedName;//联系人
private String linkedPhone;//联系电话
private Integer authentication;//是否认证 0为未认证 1为已认证
private Integer provinceCode;//省份Code
private Integer cityCode;//城市Code
private Integer areaCode;//区域Code
private String reason;//理由
private String linkedBakPhone;
private String linkedBakName;
private Integer isService;
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.Date;
@Data
public class GiveRecord {
private Integer id;
private Integer userId;
private Integer giveUserId;
private Integer referType;
private Integer referId;
private Integer blessId;
private String orderCode;
private Integer state;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class MaintainOrder implements Serializable {
private Integer id;
private Integer blessId;
private Integer blessIdx;
private Integer maintainPriceId;
private Integer payYears;
private BigDecimal price;
private BigDecimal maintainPrice;
private BigDecimal payMoney;
private String payName;
private Integer payType;
private Date payTime;
private Integer state;
private Integer isDel;
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class MaintainPrice {
private int id;
private int templeId;
private int specificationsId;
private BigDecimal price;
private Integer priceYear;
private String name;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
@Data
public class MemorialHall {
private Integer id;//纪念馆id
private Integer companyId;//SAAS公司id
private Integer manageId; //管理机构ID
private Integer templeId;//寺庙id
private Integer institutionId;//机构id
private String name;//纪念馆名称
private String introduce;//介绍
private String floor;//楼层
private String coverPic; //封面
private String pic;//图片
private String codePrefix;//编号前缀
private String serialPrefix;//序号前缀
private String url;//介绍url
private String linkName;//联系人
private String linkPhone;//联系电话
private String generalLayoutPic;//总平面图
private Integer isRec;
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.Date;
@Data
public class OrderMessage {
private Integer id;//订单日志id
private Integer orderType;//订单类型 0为认捐单 1为助捐单
private String content;//订单内容
private Integer donateOrderId;//订单id
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
@Data
public class OshCartItem {
private Integer id;
private Integer userId;
private Integer productId;
private Integer quantity;
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
@Data
public class OshParams {
private Integer id;
private String name;
private String value;
private Integer type;
private String remark;
private Integer isDel;
}
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class Product {
private Integer id;
private Integer templeId;
private String serial;
private String name;
private Integer productTypeId;
private BigDecimal originPrice;
private BigDecimal price;
private String unit;
private Integer stock;
private Integer warningStock;
private Integer isShelves;
private String content;
private String firstPic;
private String pics;
private Date createTime;
private Integer creatorId;
private Integer saleCount;
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.Date;
@Data
public class ProductAd {
private Integer id;
private String link;
private String pic;
private Integer weight;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date createTime;
private Date updatetime;
private Integer isDel;
private Integer productId;
private Integer templeId;
private String title;
}
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
import java.util.LinkedList;
/**
* @Description:省份表(安卓的不想找插件,所以后台代写一个省市区三级联动数据)
*
* @author ZYP 2017-3-19
*
*/
@Data
public class Province {
private Integer id;
private String provinceCode;//省份編碼
private String name;//省份名稱
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class Shuttle implements Serializable {
private Integer id;
private Integer templeId;
private Integer type;
private Integer relationId;
private Integer site;
private String province;
private String city;
private String area;
private String provinceCode;
private String cityCode;
private String areaCode;
private String address;
private String time;
@JSONField(format = "yyyy-MM-dd HH:mm")
private Date shuttleTime;
private String endTime;
private BigDecimal price;
private String phone;
private Integer passengers;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.entity;
import lombok.Data;
import java.util.Date;
@Data
public class Sms {
private Long id;
private Integer type;
private String phonenumber;
private String verifycode;
private Integer state;
private Date createtime;
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class Specifications implements Serializable{
private Integer id;//规格id
private String name;//名称
private Integer companyId;//企业id
private Integer number;//规格位数
private Integer weight;//权重
private Integer isDefault;//是否默认
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class Temple {
private Integer id;//寺庙id
private Integer companyId;//总公司id
private Integer manageId;//公司id
private String sequenceNumber;//序号
private String name;//寺庙名称
private String pic;//图片
private String coverPic; //封面图片
private String certificatePic;//证书公章
private String donateModelPic;//捐建书模版
private String blessVoucherPic;//福位凭证模版
private String moralityCardPic;//功德证
private String remark;//寺庙介绍
private BigDecimal maintainPrice;//维护费
private Integer provinceCode;
private Integer cityCode;
private Integer areaCode;
private String province;//省份
private String city;//城市
private String area;//区域
private String address;//详情地址
private String bankNumber;
private String bankName;
private String bankUserName;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class User implements Serializable {
private Integer id;
private String phone;
private String password;
private BigDecimal money;
private String pic;
private String name;
private String paymentPassword;//支付密码
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date lastLoginTime;
private Integer state;
private String sysToken;
private String openId;//微信的openid
private String identify;
private String identifyJustPic;
private String identifyBackPic;
private String province;
private String city;
private String area;
private String code;
private String address;
private Integer examine;
private String provinceCode;
private String cityCode;
private String areaCode;
private Integer blessNum;
private String picUrl;
private Integer applyUserId;//申请人id
private String applyUserName;//申请人姓名
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author Administrator
*
*/
@Data
public class UserBlessUsing {
private Integer id; //主键id
private Integer relationId;//启用人id
private Integer type; //0前端用户开启,1后端管理员开启
private Integer blessId;//对应的福位
private Integer blessIdx;//bless idx 对应福位中哪一个
private String relation;//与往生者的关系
private String name;//往生者姓名
private Integer sex;//性别 0 0为男,1为女
@JSONField(format = "yyyy-MM-dd")
private Date birthday;//公历生日
private String birthdayLunar;//农历生日
private String identify;//省份证号码
@JSONField(format="yyyy-MM-dd")
private Date deathDay;//死亡公历日期
private String deathDayLunar;//死亡农历日期
private Integer usingWayAshes;//启用方式(骨灰)0否 1.是
private Integer usingWayKeepsake;//启用方式(纪念品) 0否 1是
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date usingTime;//晋塔安奉时间
private Integer isYingling;//是否迎灵
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date yinglingTime;//迎灵时间
private String deathProve;//死亡证明
private String cremationProve;//火化证明
private BigDecimal money;//维护费
private String remarks;//备注
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//申请时间
private Integer state;//状态:0待审核;1:已开启;2未通过
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date reviewTime;//审核时间
private String reason;//拒绝理由
private Date updatetime;//更新时间
private Integer isDel;
private Integer templeId;//启用纪念馆id
private Integer enableId;//启用福位id
private Integer isMemory;//是否提醒
private String arrImg;//其他证明
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class UserPost implements Serializable {
private Integer id;//主键id
private Integer userId;//用户id
private Integer blessId;//福位id
private BigDecimal price;//邮费价格
private String name;//收件人
private String phone;//收件人电话
private String address;//收件地址
private Integer certificateType;//邮寄证书类型 0为功德证 1为福位证 2为捐款书
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;//申请邮寄时间
private Integer type;//申请类型 0 首次申请;1补寄
private String postCompany;//物流公司
private String postNumber;//物流单号
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date postTime;//寄出时间
private Integer state;//状态:0未支付;1已支付待邮寄;2已寄出
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//订单创建时间
private String certificateTypeStr;
public Integer getCertificateType() {
return certificateType;
}
public void setCertificateType(Integer certificateType) {
this.certificateType = certificateType;
if(certificateType==0){
this.certificateTypeStr="功德证";
}else if(certificateType==1){
this.certificateTypeStr="福位证";
}else if(certificateType==2){
this.certificateTypeStr="捐赠书";
}
}
}
package com.atlgroupasia.servicecenter.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class WalletRecord implements Serializable {
private Integer id;
private Integer userId;
private Integer payState;
private Integer operateId;
private Integer type;
private String typeStr;
private String remark;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private BigDecimal amount;
private Integer isDel;
public String getTypeStr() {
if (this.type == 0) {
return "订单支付";
} else if (this.type == 1) {
return "会员充值";
} else if (this.type == 2) {
return "商家调整";
} else if (this.type == 3) {
return "邮寄消费";
} else if (this.type == 4) {
return "启用福位";
} else {
return "预约服务";
}
}
public void setTypeStr(String typeStr) {
this.typeStr = typeStr;
}
}
package com.atlgroupasia.servicecenter.exception;
/**
* BusinessException
*
* @author whj
* @date 2018/7/29 22:09
*/
public class BusinessException extends RuntimeException {
private static final long serialVersionUID = -1790076293118354171L;
public BusinessException() {
super();
}
public BusinessException(String msg) {
super(msg);
}
}
package com.atlgroupasia.servicecenter.interceptor;
import com.atlgroupasia.servicecenter.utils.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
@Component
public class TokenInterceptor extends HandlerInterceptorAdapter {
@Autowired
private RedisUtil redisUtil;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String token = request.getHeader("token");
// if (StringUtils.isEmpty(token)) {
// request.setAttribute("userId", null);
// } else {
// AtlUserVo atlUser = (AtlUserVo) redisUtil.get(token);
// if(atlUser == null){
// request.setAttribute("userId", null);
// }else {
// request.setAttribute("userId", atlUser.getId());
// }
// }
String deviceId = request.getHeader("deviceId");
request.setAttribute("deviceId", deviceId);
String source = request.getHeader("source");
request.setAttribute("source", source);
String os = request.getHeader("os");
request.setAttribute("os", os);
return super.preHandle(request, response, handler);
}
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.ActivityDto;
import java.util.List;
public interface ActivityMapper {
List<ActivityDto> findAllNoDel();
}
package com.atlgroupasia.servicecenter.mapper;
public interface AreaMapper {
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.BlessEnableDto;
import com.atlgroupasia.servicecenter.entity.BlessEnable;
import java.util.List;
public interface BlessEnableMapper {
List<BlessEnableDto> findAllNoDelByBlessId(Integer blessId);
void batchNewEntitys(List<Object[]> params);
void batchNewEntity(BlessEnable blessEnable);
BlessEnable getForBless(Integer blessId, Integer blessIdx);
void update(BlessEnable blessEnable);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.BlessDto;
import com.atlgroupasia.servicecenter.dto.TempleDto;
import com.atlgroupasia.servicecenter.entity.Bless;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface BlessMapper {
List<TempleDto> findMyBlessList(Integer donorId);
List<BlessDto>querySimpleBlessList(List blessIds);
List<BlessDto> selectBless1(Integer id);
Bless findNoDel(Integer id);
BlessDto selectBless(Integer blessId);
List<Map<String, Object>> findBlessUsingList(@Param("selectText")String selectText);
List<Map<String, Object>> findConnectBlessUsingList(List blessIds);
}
package com.atlgroupasia.servicecenter.mapper;
public interface CityMapper {
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.entity.DonateOrder;
import java.util.List;
public interface DonateOrderMapper {
List<DonateOrder>findMyOrder(String donorIds);
List<DonateOrder> findByBlessId(Integer id);
List<Integer> findMyOrder1(String donorIds);
String findOrderState5(Integer blessId);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.DonorDto;
import com.atlgroupasia.servicecenter.entity.Donor;
import java.util.List;
public interface DonorMapper {
List<DonorDto> findNoDel(Donor donor);
Donor findNoDelByPhone(String phone);
Donor findByIdentify(String identify);
void batchEntity(Donor donor1);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.entity.GiveRecord;
public interface GiveRecordMapper {
void batchEntity(GiveRecord giveRecord);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.entity.MaintainOrder;
public interface MaintainOrderMapper {
MaintainOrder findNoDelByBlessIdAndIdx(Integer blessId,Integer blessIdx);
void batchNewEntity(MaintainOrder maintainOrder);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.entity.MaintainPrice;
public interface MaintainPriceMapper {
MaintainPrice findMaintainPrice(Integer specificationsId, Integer templeId);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.entity.MemorialHall;
public interface MemorialHallMapper {
MemorialHall findNoDel(Integer memorialHallId);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.vo.OshServicesAdVo;
import java.util.List;
import java.util.Map;
public interface OshServicesAdMapper {
/*查询广告列表*/
List<Map<String, Object>> findList(OshServicesAdVo vo);
/*查询广告详情*/
List<Map<String, Object>> view(OshServicesAdVo vo);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import java.util.List;
import java.util.Map;
public interface OshServicesMapper {
/*商品列表*/
List<Map<String, Object>> findList(OshServicesVo vo);
/*商品详情*/
Map<String, Object> view(OshServicesVo vo);
/*通过商品id查询所有规格*/
List<Map<String, Object>> findSpecificationByServiceId(OshServicesVo vo);
/*查询商品最低价格*/
List<Map<String, Object>> getLowPrice(OshServicesVo vo);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderItemVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import java.util.List;
import java.util.Map;
public interface OshServicesOrderItemMapper {
/*查询订单详情列表*/
List<Map<String, Object>> findList(OshServicesOrderItemVo vo);
/*新增订单详情*/
void insert(OshServicesOrderItemVo vo);
/*查询订单详情明细列表*/
List<Map<String, Object>> findItemList(OshServicesOrderItemVo vo);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface OshServicesOrderMapper {
/*订单列表*/
List<Map<String, Object>> findList(OshServicesOrderVo vo);
/*订单评价详情*/
Map<String, Object> evaluateView(OshServicesOrderVo vo);
/*订单评价*/
void evaluate(OshServicesOrderVo vo);
/*查询已评价订单列表*/
List<Map<String, Object>> findEvaluateList(OshServicesOrderVo vo);
/*查询好评评价订单条数*/
List<Map<String, Object>> findRateListByOrderId(OshServicesOrderVo vo);
/*新增订单*/
void insert(OshServicesOrderVo vo);
/*订单详情*/
Map<String, Object> view(OshServicesOrderVo vo);
/*订单支付*/
void payOrder(OshServicesOrderVo vo);
/*通过订单编码查询订单*/
OshServicesOrderVo getViewByCode(OshServicesOrderVo vo);
/*查看订单提交视频和图片列表*/
List<Map<String, Object>> videoAndImageList(@Param("orderId") Long orderId);
/*查看未观看视频列表*/
List<Map<String, Object>> findVideoListUnWatch(Long orderId);
}
package com.atlgroupasia.servicecenter.mapper;
public interface OshServicesOrderMessageMapper {
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderRecordVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import java.util.List;
import java.util.Map;
public interface OshServicesOrderRecordMapper {
/*新增订单操作记录*/
void insert(OshServicesOrderRecordVo vo);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.vo.OshServicesSpecificationVo;
import java.util.List;
import java.util.Map;
public interface OshServicesSpecificationMapper {
/*规格列表*/
List<Map<String, Object>> findList(OshServicesSpecificationVo vo);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.vo.OshServicesTypeVo;
import java.util.List;
import java.util.Map;
public interface OshServicesTypeMapper {
/*商品分类列表*/
public List<Map<String, Object>> findList(OshServicesTypeVo vo);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.OshParamsDto;
public interface ParamsMapper {
OshParamsDto findNoDel(Integer paramsId);
}
package com.atlgroupasia.servicecenter.mapper;
public interface ProvinceMapper {
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.entity.Sms;
import org.apache.ibatis.annotations.Param;
public interface SmsMapper {
int deleteByPrimaryKey(Long id);
int insert(Sms record);
int insertSelective(Sms record);
Sms selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(Sms record);
int updateByPrimaryKey(Sms record);
String getTime(@Param("mobile") String mobile, @Param("type") Integer type);
void updateState(@Param("id") Long id, @Param("state") int state);
Sms getSmsVerifyCode(@Param("mobile") String mobile, @Param("verifyCode") String verifyCode, @Param("type") int type);
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.entity.Specifications;
public interface SpecificationsMapper {
Specifications find(Integer specificationsId);
Specifications findNoDel(Integer specificationsId);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.entity.Temple;
import java.util.List;
import java.util.Map;
public interface TempleMapper {
Map<String,Object> findByIds(List Ids);
Temple findNoDelByMemorialHallId(Integer templeId);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.dto.UserBlessUsingDto;
import com.atlgroupasia.servicecenter.entity.UserBlessUsing;
import java.util.List;
public interface UserBlessUsingMapper {
List<UserBlessUsing>findAllNoDelcolumn(Integer blessId);
UserBlessUsing findByBlessEnableId(Integer blessEnableId);
UserBlessUsingDto selectRest(Integer userBlessUsingid);
void batchNewEntity(UserBlessUsing userBlessUsing);
}
package com.atlgroupasia.servicecenter.mapper;
import com.atlgroupasia.servicecenter.entity.User;
public interface UserMapper {
User findNoDel(String phone);
User getUserByMobile(String phone);
void updateByPhone(User user);
void batchNewEntity(User user);
void updateToken(User user);
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.dto.ActivityDto;
import com.atlgroupasia.servicecenter.mapper.ActivityMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class ActivitySerice {
@Resource
private ActivityMapper activityMapper;
public List<ActivityDto> findAllNoDel() {
return activityMapper.findAllNoDel();
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.mapper.AreaMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class AreaService {
@Resource
private AreaMapper areaMapper;
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.dto.BlessEnableDto;
import com.atlgroupasia.servicecenter.entity.BlessEnable;
import com.atlgroupasia.servicecenter.mapper.BlessEnableMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
public class BlessEnableService {
@Resource
private BlessEnableMapper blessEnableMapper;
public List<BlessEnableDto> findAllNoDelByBlessId(Integer blessId) {
return blessEnableMapper.findAllNoDelByBlessId(blessId);
}
public void batchNewEntitys(List<BlessEnable> blessEnableList) {
List<Object[]> params = new ArrayList<Object[]>();
for(BlessEnable enable : blessEnableList){
Object[] obj = {enable.getUserId(),enable.getBlessId(),enable.getBlessIndex(),enable.getCreateTime()};
params.add(obj);
}
blessEnableMapper.batchNewEntitys(params);
}
public void batchNewEntity(BlessEnable blessEnable) {
blessEnableMapper.batchNewEntity(blessEnable);
}
public BlessEnable getForBless(Integer blessId, Integer blessIdx) {
return blessEnableMapper.getForBless(blessId,blessIdx);
}
public void update(BlessEnable blessEnable) {
blessEnableMapper.update(blessEnable);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.dto.BlessDto;
import com.atlgroupasia.servicecenter.dto.DonorDto;
import com.atlgroupasia.servicecenter.entity.*;
import com.atlgroupasia.servicecenter.mapper.*;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.utils.OssUtil;
import com.atlgroupasia.servicecenter.utils.StringUtilSS;
import com.atlgroupasia.servicecenter.vo.DonorVo;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
public class BlessService {
@Resource
private BlessMapper blessMapper;
@Resource
private DonateOrderMapper donateOrderMapper;
@Resource
private UserBlessUsingMapper userBlessUsingMapper;
@Resource
private SpecificationsMapper specificationsMapper;
@Resource
private TempleMapper templeMapper;
public List findMyBlessList(String donorIds){
List<DonateOrder> myOrder = donateOrderMapper.findMyOrder(donorIds);
List<Integer> blessIdList = new ArrayList<Integer>();
for (DonateOrder donateOrder : myOrder) {
for (String str: StringUtilSS.split(donateOrder.getBlessIds(),",")){
blessIdList.add(Integer.parseInt(str));
}
}
List<BlessDto> blessList = blessMapper.querySimpleBlessList(blessIdList);
List<Integer> templeIdList = new ArrayList<Integer>();
for (BlessDto bless : blessList) {
bless.setFashionSinglePic(OssUtil.STATIC_IMG_URL + "/" + bless.getFashionSinglePic());
Integer blessId = bless.getId();
Integer specificationsId = bless.getSpecificationsId();
Specifications specifications = specificationsMapper.find(specificationsId);
Integer number = specifications.getNumber();
List<UserBlessUsing> userBlessUsingList = userBlessUsingMapper.findAllNoDelcolumn( blessId);
if (userBlessUsingList.size()==0){
bless.setStateStr("未启用");
}
if (userBlessUsingList.size()<number&&userBlessUsingList.size()>0){
bless.setStateStr("部分启用");
}
if (userBlessUsingList.size()==number){
bless.setStateStr("已启用");
}
bless.setSpecificationsNumber(number.toString());
templeIdList.add(bless.getTempleId());
}
//Map<String, Object> map = templeMapper.findByIds(templeIdList);
/**map.put("blessList",blessList);
List list = Lists.newArrayList();
for (Map.Entry<String, Object> stringObjectEntry : map.entrySet()) {
list.add(stringObjectEntry);
}**/
return blessList;
}
public BlessDto selectBless1(Integer id) {
List<BlessDto> blessList = blessMapper.selectBless1(id);
BlessDto bless = blessList.get(0);
List<DonateOrder> byBlessId = donateOrderMapper.findByBlessId(bless.getId());
for (int i = 0; i < byBlessId.size(); i++) {
Integer voucher = byBlessId.get(i).getVoucher();
bless.setBlessVoucher(voucher);
}
return bless;
}
public Bless findNoDel(Integer id) {
Bless bless = blessMapper.findNoDel(id);
return bless;
}
public List findConnectBlessUsingList(String donorIds) {
List<DonateOrder> myOrder = donateOrderMapper.findMyOrder(donorIds);
List<Integer> blessIdList = new ArrayList<Integer>();
for (DonateOrder donateOrder : myOrder) {
for (String str: StringUtilSS.split(donateOrder.getBlessIds(),",")){
blessIdList.add(Integer.parseInt(str));
}
}
if(blessIdList.size()>0){
List list = blessMapper.findConnectBlessUsingList(blessIdList);
return list;
}else {
return Lists.newArrayList();
}
}
public List findBlessUsingList(String selectText) {
List list = blessMapper.findBlessUsingList(selectText);
return list;
}
public List<Integer> findMyBless(String donorIds) {
List<Integer> donorIdList= donateOrderMapper.findMyOrder1(donorIds);
return donorIdList;
}
public List<DonateOrder> findMyBless1(String donorIds) {
List<DonateOrder> donorIdList= donateOrderMapper.findMyOrder(donorIds);
return donorIdList;
}
public BlessDto selectBless(Integer blessId) {
return blessMapper.selectBless(blessId);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.User;
import com.atlgroupasia.servicecenter.mapper.CityMapper;
import com.atlgroupasia.servicecenter.mapper.UserMapper;
import com.atlgroupasia.servicecenter.vo.AtlUserVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class CityService {
@Resource
private CityMapper cityMapper;
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.DonateOrder;
import com.atlgroupasia.servicecenter.mapper.DonateOrderMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DonateOrderService {
@Resource
private DonateOrderMapper donateOrderMapper;
public String findOrderState5(Integer blessId) {
return donateOrderMapper.findOrderState5(blessId);
}
public List<DonateOrder> findByBlessId(Integer blessId) {
return donateOrderMapper.findByBlessId(blessId);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.dto.DonorDto;
import com.atlgroupasia.servicecenter.entity.DonateOrder;
import com.atlgroupasia.servicecenter.entity.Donor;
import com.atlgroupasia.servicecenter.mapper.DonorMapper;
import com.atlgroupasia.servicecenter.vo.DonorVo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class DonorService {
@Resource
private DonorMapper donorMapper;
public List<DonorDto> findNoDel(DonorVo donorVo) {
Donor donor = new Donor();
BeanUtils.copyProperties(donorVo,donor);
return donorMapper.findNoDel(donor);
}
public Donor findNoDelByPhone(String phone) {
return donorMapper.findNoDelByPhone(phone);
}
public Donor findByIdentify(String identify) {
return donorMapper.findByIdentify(identify);
}
public void batchEntity(Donor donor1) {
donorMapper.batchEntity(donor1);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.GiveRecord;
import com.atlgroupasia.servicecenter.entity.User;
import com.atlgroupasia.servicecenter.mapper.GiveRecordMapper;
import com.atlgroupasia.servicecenter.mapper.UserMapper;
import com.atlgroupasia.servicecenter.vo.AtlUserVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class GiveRecordService {
@Resource
private GiveRecordMapper giveRecordMapper;
public void batchEntity(GiveRecord giveRecord) {
giveRecordMapper.batchEntity(giveRecord);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.MaintainOrder;
import com.atlgroupasia.servicecenter.mapper.DonorMapper;
import com.atlgroupasia.servicecenter.mapper.MaintainOrderMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class MaintainOrderService {
@Resource
private DonorMapper donorMapper;
@Resource
private MaintainOrderMapper maintainOrderMapper;
public MaintainOrder findNoDelByBlessIdAndIdx(Integer blessId,Integer blessIdx) {
return maintainOrderMapper.findNoDelByBlessIdAndIdx(blessId,blessIdx);
}
public void batchNewEntity(MaintainOrder maintainOrder) {
maintainOrderMapper.batchNewEntity(maintainOrder);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.MaintainPrice;
import com.atlgroupasia.servicecenter.mapper.DonorMapper;
import com.atlgroupasia.servicecenter.mapper.MaintainPriceMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class MaintainPriceService {
@Resource
private DonorMapper donorMapper;
@Resource
private MaintainPriceMapper maintainPriceMapper;
public MaintainPrice findMaintainPrice(Integer specificationsId, Integer templeId) {
return maintainPriceMapper.findMaintainPrice(specificationsId,templeId);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.MemorialHall;
import com.atlgroupasia.servicecenter.mapper.DonorMapper;
import com.atlgroupasia.servicecenter.mapper.MemorialHallMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class MemorialHallService {
@Resource
private DonorMapper donorMapper;
@Resource
private MemorialHallMapper memorialHallMapper;
public MemorialHall findNoDel(Integer memorialHallId) {
return memorialHallMapper.findNoDel(memorialHallId);
}
}
package com.atlgroupasia.servicecenter.service;
import lombok.Data;
@Data
public class MemorialHallVo {
private Integer id;//纪念馆id
private Integer companyId;//SAAS公司id
private Integer manageId; //管理机构ID
private Integer templeId;//寺庙id
private Integer institutionId;//机构id
private String name;//纪念馆名称
private String introduce;//介绍
private String floor;//楼层
private String coverPic; //封面
private String pic;//图片
private String codePrefix;//编号前缀
private String serialPrefix;//序号前缀
private String url;//介绍url
private String linkName;//联系人
private String linkPhone;//联系电话
private String generalLayoutPic;//总平面图
private Integer isRec;
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.mapper.OshServicesAdMapper;
import com.atlgroupasia.servicecenter.mapper.OshServicesTypeMapper;
import com.atlgroupasia.servicecenter.vo.OshServicesAdVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class OshServicesAdSerice {
@Resource
private OshServicesAdMapper oshServicesAdMapper;
public List<Map<String, Object>> findList(OshServicesAdVo vo) {
return oshServicesAdMapper.findList(vo);
}
public List<Map<String, Object>> view(OshServicesAdVo vo) {
return oshServicesAdMapper.view(vo);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.mapper.OshServicesOrderItemMapper;
import com.atlgroupasia.servicecenter.mapper.OshServicesOrderMapper;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderItemVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class OshServicesOrderItemSerice {
@Resource
private OshServicesOrderItemMapper oshServicesOrderItemMapper;
public List<Map<String, Object>> findList(OshServicesOrderItemVo vo) {
return oshServicesOrderItemMapper.findList(vo);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.mapper.OshServicesOrderMapper;
import com.atlgroupasia.servicecenter.mapper.OshServicesOrderMessageMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class OshServicesOrderMessageSerice {
@Resource
private OshServicesOrderMessageMapper oshServicesOrderMessageMapper;
}
package com.atlgroupasia.servicecenter.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.atlgroupasia.servicecenter.mapper.OshServicesOrderItemMapper;
import com.atlgroupasia.servicecenter.mapper.OshServicesOrderMapper;
import com.atlgroupasia.servicecenter.mapper.OshServicesOrderRecordMapper;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderItemVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderRecordVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Random;
@Service
public class OshServicesOrderRecordSerice {
@Resource
private OshServicesOrderRecordMapper oshServicesOrderRecordMapper;
@Transactional(rollbackFor = Exception.class)
public void insert(OshServicesOrderRecordVo vo) {
oshServicesOrderRecordMapper.insert(vo);
}
}
package com.atlgroupasia.servicecenter.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.atlgroupasia.servicecenter.mapper.*;
import com.atlgroupasia.servicecenter.utils.*;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderItemVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderRecordVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import com.github.wxpay.sdk.WXPay;
import com.github.wxpay.sdk.WXPayConstants;
import com.github.wxpay.sdk.WXPayUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.Console;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
@Slf4j
public class OshServicesOrderSerice {
public static final String SPBILL_CREATE_IP = "47.96.123.150";
public static final String NOTIFY_URL = "http://userapi.atlxm.com/api/services/order/wxPayBack";
public static final String TRADE_TYPE_APP = "APP";
public static final String TRADE_TYPE_H5 = "MWEB";
public static final String TRADE_TYPE_JSAPI = "JSAPI";
public static final String PAY_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder";
@Resource
private OshServicesOrderMapper oshServicesOrderMapper;
@Resource
private OshServicesOrderItemMapper oshServicesOrderItemMapper;
@Resource
private OshServicesOrderRecordMapper oshServicesOrderRecordMapper;
public List<Map<String, Object>> findList(OshServicesOrderVo vo) {
return oshServicesOrderMapper.findList(vo);
}
public List<Map<String, Object>> findOrderList(OshServicesOrderVo vo) {
return oshServicesOrderMapper.findList(vo);
}
public List<Map<String, Object>> findVideoListUnWatch(Long orderId) {
return oshServicesOrderMapper.findVideoListUnWatch(orderId);
}
public Map<String, Object> evaluateView(OshServicesOrderVo vo) {
Map<String, Object> map = oshServicesOrderMapper.evaluateView(vo);
List<Map<String, Object>> videoList = oshServicesOrderMapper.videoAndImageList(vo.getId());
for (Map<String, Object> item : videoList) {
List<String> imageList = Lists.newArrayList();
String imageUrls = item.get("imageUrls").toString();
if (StringUtil.isNotBlank(imageUrls)) {
String[] imageUrlArr = imageUrls.split(",");
for (String str : imageUrlArr) {
imageList.add(str);
}
}
item.put("imageUrls",imageList);
}
map.put("videoList", videoList);
return map;
}
@Transactional(rollbackFor = Exception.class)
public void evaluate(OshServicesOrderVo vo) {
oshServicesOrderMapper.evaluate(vo);
recordOrder("9 ", vo.getId());
}
public Map<String, Object> view(OshServicesOrderVo vo) {
Map<String, Object> result = oshServicesOrderMapper.view(vo);
OshServicesOrderItemVo itemVo = new OshServicesOrderItemVo();
itemVo.setOrderId(vo.getId());
List<Map<String, Object>> itemList = oshServicesOrderItemMapper.findItemList(itemVo);
result.put("itemList", itemList);
return result;
}
public List<Map<String, Object>> findEvaluateList(OshServicesOrderVo vo) {
return oshServicesOrderMapper.findEvaluateList(vo);
}
public OshServicesOrderVo getViewByCode(OshServicesOrderVo vo) {
return oshServicesOrderMapper.getViewByCode(vo);
}
public List<Map<String, Object>> findRateListByOrderId(OshServicesOrderVo vo) {
return oshServicesOrderMapper.findRateListByOrderId(vo);
}
@Transactional(rollbackFor = Exception.class)
public OshServicesOrderVo insertOrder(OshServicesOrderVo vo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
vo.setConfirmTime(sdf.parse(vo.getConfirmTimeStr()));
vo.setConfirmEndTime(sdf.parse(vo.getConfirmEndTimeStr()));
} catch (Exception e) {
e.printStackTrace();
}
Random random = new Random();
Date now = new Date();
String code = "DD" + now.getTime() + random.nextInt(9999);
vo.setCode(code);
oshServicesOrderMapper.insert(vo);
Long id = vo.getId();
String itemJson = vo.getOrderItemJson();
JSONArray array = JSONArray.parseArray(itemJson);
for (int i = 0; i < array.size(); i++) {
com.alibaba.fastjson.JSONObject obj = array.getJSONObject(i);
OshServicesOrderItemVo itemVo = JSONObject.toJavaObject(obj, OshServicesOrderItemVo.class);
itemVo.setOrderId(id);
oshServicesOrderItemMapper.insert(itemVo);
}
recordOrder("1", id);
return vo;
}
/*订单操作记录*/
@Transactional(rollbackFor = Exception.class)
public void recordOrder(String state, Long orderId) {
OshServicesOrderRecordVo vo = new OshServicesOrderRecordVo();
vo.setOrderId(orderId);
vo.setState(state);
oshServicesOrderRecordMapper.insert(vo);
}
@Transactional(rollbackFor = Exception.class)
public String payBack(HttpServletRequest request) {
String resXml = HttpUtils.parse(request);
log.error("------------支付回调进入:"+resXml);
WXConfigUtil config = null;
try {
config = new WXConfigUtil();
} catch (Exception e) {
e.printStackTrace();
}
WXPay wxpay = new WXPay(config);
String xmlBack = "";
Map<String, String> notifyMap = null;
try {
notifyMap = WXPayUtil.xmlToMap(resXml); // 调用官方SDK转换成map类型数据
if (wxpay.isPayResultNotifySignatureValid(notifyMap)) {//验证签名是否有效,有效则进一步处理
String return_code = notifyMap.get("return_code");//状态
String out_trade_no = notifyMap.get("out_trade_no");//商户订单号
if (return_code.equals("SUCCESS")) {
if (out_trade_no != null) {
// 注意特殊情况:订单已经退款,但收到了支付结果成功的通知,不应把商户的订单状态从退款改成支付成功
// 注意特殊情况:微信服务端同样的通知可能会多次发送给商户系统,所以数据持久化之前需要检查是否已经处理过了,处理了直接返回成功标志
//业务数据持久化
OshServicesOrderVo vo = new OshServicesOrderVo();
vo.setCode(out_trade_no);
OshServicesOrderVo servicesOrderVo = oshServicesOrderMapper.getViewByCode(vo);
if ("2".equals(servicesOrderVo.getStatus())) {
xmlBack = "<xml>" + "<return_code><![CDATA[SUCCESS]]></return_code>" + "<return_msg><![CDATA[OK]]></return_msg>" + "</xml> ";
} else {
oshServicesOrderMapper.payOrder(vo);
recordOrder("2", servicesOrderVo.getId());
log.info("微信手机支付回调成功订单号:{}", out_trade_no);
xmlBack = "<xml>" + "<return_code><![CDATA[SUCCESS]]></return_code>" + "<return_msg><![CDATA[OK]]></return_msg>" + "</xml> ";
}
} else {
log.info("微信手机支付回调失败订单号:{}", out_trade_no);
xmlBack = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>" + "<return_msg><![CDATA[报文为空]]></return_msg>" + "</xml> ";
}
}
return xmlBack;
} else {
// 签名错误,如果数据里没有sign字段,也认为是签名错误
//失败的数据要不要存储?
log.error("手机支付回调通知签名错误");
xmlBack = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>" + "<return_msg><![CDATA[报文为空]]></return_msg>" + "</xml> ";
return xmlBack;
}
} catch (Exception e) {
log.error("手机支付回调通知失败", e);
xmlBack = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>" + "<return_msg><![CDATA[报文为空]]></return_msg>" + "</xml> ";
}
return xmlBack;
}
public Map doUnifiedOrder(String code, String payPrice) throws Exception {
try {
WXConfigUtil config = new WXConfigUtil();
WXPay wxpay = new WXPay(config);
Map<String, String> data = new HashMap<>();
//生成商户订单号,不可重复
data.put("appid", config.getAppID());
data.put("mch_id", config.getMchID());
data.put("nonce_str", WXPayUtil.generateNonceStr());
String body = "服务订单支付";
data.put("body", body);
data.put("out_trade_no", code);
double price = Double.parseDouble(payPrice)*100;
data.put("total_fee", new Double(price).intValue()+"");
//自己的服务器IP地址
data.put("spbill_create_ip",SPBILL_CREATE_IP);
//异步通知地址(请注意必须是外网)
//http://userapi.atlxm.com/api/services/order/wxPayBack
data.put("notify_url", NOTIFY_URL);
//交易类型
data.put("trade_type", TRADE_TYPE_APP);
//附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据
data.put("sign", WXPayUtil.generateSignature(data, config.getKey(),
WXPayConstants.SignType.MD5));
//使用官方API请求预付订单
Map<String, String> response = wxpay.unifiedOrder(data);
log.info(response.toString());
if ("SUCCESS".equals(response.get("return_code"))) {//主要返回以下5个参数
Map<String, String> param = new HashMap<>();
param.put("appid", config.getAppID());
param.put("partnerid", response.get("mch_id"));
param.put("prepayid", response.get("prepay_id"));
param.put("package", "prepayid="+ response.get("prepay_id"));
param.put("noncestr", response.get("nonce_str"));
param.put("timestamp", System.currentTimeMillis() / 1000 + "");
param.put("sign", WXPayUtil.generateSignature(param, config.getKey(),
WXPayConstants.SignType.MD5));
return param;
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("下单失败");
}
throw new Exception("下单失败");
}
public Map doUnifiedOrderForH5(String code, String payType, String payPrice) throws Exception {
try {
WXOfficeConfigUtil config = new WXOfficeConfigUtil();
WXPay wxpay = new WXPay(config);
Map<String, String> data = new HashMap<>();
//生成商户订单号,不可重复
data.put("appid", config.getAppID());
data.put("mch_id", config.getMchID());
data.put("nonce_str", WXPayUtil.generateNonceStr());
String body = "服务订单支付";
data.put("body", body);
data.put("out_trade_no", code);
double price = Double.parseDouble(payPrice)*100;
data.put("total_fee", new Double(price).intValue()+"");
//自己的服务器IP地址
data.put("spbill_create_ip",SPBILL_CREATE_IP);
//异步通知地址(请注意必须是外网)
//http://userapi.atlxm.com/api/services/order/wxPayBack
data.put("notify_url", NOTIFY_URL);
//交易类型
data.put("trade_type", TRADE_TYPE_H5);
Map<String, Object> result = Maps.newHashMap();
Map<String, Object> h5Info = Maps.newHashMap();
if("0".equals(payType)){
h5Info.put("type","Android");
h5Info.put("app_name","安泰乐");
h5Info.put("package_name","com.atlcare.app");
}else if("1".equals(payType)){
h5Info.put("type","IOS");
h5Info.put("app_name","安泰乐");
h5Info.put("bundle_id","com.atl-life.app");
}else {
h5Info.put("type","Wap");
h5Info.put("wap_url","安泰乐"); //需要提供参数
h5Info.put("wap_name","待祭祀支付");
}
result.put("h5_info",h5Info);
data.put("scene_info", result.toString());
//附加数据,在查询API和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据
/* data.put("sign", WXPayUtil.generateSignature(data, config.getKey(),
WXPayConstants.SignType.MD5));*/
//使用官方API请求预付订单
Map<String, String> response = wxpay.unifiedOrder(data);
log.info(response.toString());
if ("SUCCESS".equals(response.get("return_code"))) {//主要返回以下5个参数
Map<String, String> param = new HashMap<>();
param.put("appId", config.getAppID());
param.put("package", "prepay_id="+response.get("prepay_id"));
param.put("nonceStr", response.get("nonce_str"));
param.put("timeStamp", System.currentTimeMillis() / 1000 + "");
param.put("signType", "MD5");
String sign = WXPayUtil.generateSignature(param, config.getKey(),
WXPayConstants.SignType.MD5);
param.put("sign", sign);
log.info("返回app接口:"+param.toString());
return param;
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("下单失败");
}
throw new Exception("下单失败");
}
public Map doUnifiedOrderForJSAPI(String code, String payPrice, String openId) throws Exception {
try {
WXOfficeConfigUtil config = new WXOfficeConfigUtil();
WXPay wxpay = new WXPay(config);
Map<String, String> data = new HashMap<>();
//生成商户订单号,不可重复
data.put("appid", "wxbd6cf7b619de70d9");
data.put("mch_id", config.getMchID());
data.put("nonce_str", WXPayUtil.generateNonceStr());
String body = "服务订单支付";
data.put("body", body);
data.put("out_trade_no", code);
double price = Double.parseDouble(payPrice)*100;
data.put("total_fee", new Double(price).intValue()+"");
//自己的服务器IP地址
data.put("spbill_create_ip",SPBILL_CREATE_IP);
//异步通知地址(请注意必须是外网)
//http://userapi.atlxm.com/api/services/order/wxPayBack
data.put("notify_url", NOTIFY_URL);
//交易类型
data.put("trade_type", TRADE_TYPE_JSAPI);
data.put("openid", openId);
Map<String, String> response = wxpay.unifiedOrder(data);
log.info(response.toString());
if ("SUCCESS".equals(response.get("return_code"))) {//主要返回以下5个参数
Map<String, String> param = new HashMap<>();
param.put("appId", config.getAppID());
param.put("package", "prepay_id="+response.get("prepay_id"));
param.put("nonceStr", response.get("nonce_str"));
param.put("timeStamp", System.currentTimeMillis() / 1000 + "");
param.put("signType", "MD5");
String sign = WXPayUtil.generateSignature(param, config.getKey(),
WXPayConstants.SignType.MD5);
param.put("sign", sign);
log.info("返回app接口:"+param.toString());
return param;
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("下单失败");
}
throw new Exception("下单失败");
}
public Map doUnifiedOrderForAppletJSAPI(String code, String payPrice, String openId) throws Exception {
try {
WXAppletConfigUtil config = new WXAppletConfigUtil();
WXPay wxpay = new WXPay(config);
Map<String, String> data = new HashMap<>();
//生成商户订单号,不可重复
data.put("appid", config.getAppID()); // 小程序appid
data.put("mch_id", config.getMchID());
data.put("nonce_str", WXPayUtil.generateNonceStr());
String body = "服务订单支付";
data.put("body", body);
data.put("out_trade_no", code);
double price = Double.parseDouble(payPrice)*100;
data.put("total_fee", new Double(price).intValue()+"");
//自己的服务器IP地址
data.put("spbill_create_ip",SPBILL_CREATE_IP);
//异步通知地址(请注意必须是外网)
//http://userapi.atlxm.com/api/services/order/wxPayBack
data.put("notify_url", NOTIFY_URL);
//交易类型
data.put("trade_type", TRADE_TYPE_JSAPI);
data.put("openid", openId);
Map<String, String> response = wxpay.unifiedOrder(data);
log.info(response.toString());
if ("SUCCESS".equals(response.get("return_code"))) {//主要返回以下5个参数
Map<String, String> param = new HashMap<>();
param.put("appId", config.getAppID());
param.put("package", "prepay_id="+response.get("prepay_id"));
param.put("nonceStr", response.get("nonce_str"));
param.put("timeStamp", System.currentTimeMillis() / 1000 + "");
param.put("signType", "MD5");
String sign = WXPayUtil.generateSignature(param, config.getKey(),
WXPayConstants.SignType.MD5);
param.put("sign", sign);
log.info("返回app接口:"+param.toString());
return param;
}
} catch (Exception e) {
e.printStackTrace();
throw new Exception("下单失败");
}
throw new Exception("下单失败");
}
public List<Map<String, Object>> videoAndImageList(Long orderId){
return oshServicesOrderMapper.videoAndImageList(orderId);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.dto.ActivityDto;
import com.atlgroupasia.servicecenter.mapper.ActivityMapper;
import com.atlgroupasia.servicecenter.mapper.OshServicesMapper;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderItemVo;
import com.atlgroupasia.servicecenter.vo.OshServicesOrderVo;
import com.atlgroupasia.servicecenter.vo.OshServicesSpecificationVo;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Map;
@Service
public class OshServicesSerice {
@Resource
private OshServicesMapper oshServicesMapper;
@Resource
private OshServicesOrderSerice oshServicesOrderSerice;
public List<Map<String, Object>> findList(OshServicesVo vo) {
return oshServicesMapper.findList(vo);
}
public Map<String, Object> view(OshServicesVo vo) {
Map<String, Object> result = oshServicesMapper.view(vo);
List<Map<String, Object>> priceList = oshServicesMapper.getLowPrice(vo);
result.put("price",priceList.get(0).get("price").toString());
if(priceList.size()>1){
result.put("priceB",priceList.get(priceList.size()-1).get("price").toString());
}else {
result.put("priceB","");
}
Object picsObj = result.get("pics");
List<String> prcsList = Lists.newArrayList();
if (null != picsObj) {
String[] picsArr = picsObj.toString().split(",");
for (int i = 0; i < picsArr.length; i++) {
if(i != 0){
prcsList.add(picsArr[i]);
}
}
result.put("pics", prcsList);
}
OshServicesOrderVo orderVo = new OshServicesOrderVo();
orderVo.setProductId(vo.getId());
List<Map<String, Object>> evaluateList = oshServicesOrderSerice.findEvaluateList(orderVo);
if (evaluateList.size() > 0) {
Map<String , Object> objectMap = evaluateList.get(0);
String httpStart = "http://alioss.atlimg.com/lmerp/images/";
String pic = objectMap.get("pic").toString();
if (!pic.startsWith("http")) {
String endPic = httpStart + pic;
objectMap.put("pic", endPic);
}
result.put("evaluateList", objectMap);
result.put("evaluateCount", evaluateList.size());
} else {
result.put("evaluateList", "");
result.put("evaluateCount", 0);
}
if (evaluateList.size() > 0) {
List<Map<String, Object>> countList = oshServicesOrderSerice.findRateListByOrderId(orderVo);
float num = (float) countList.size() / evaluateList.size() * 100;
DecimalFormat df = new DecimalFormat("0.00");//格式化小数
String s = df.format(num);
result.put("rate", s);
} else {
result.put("rate", 0);
}
return result;
}
public List<Map<String, Object>> findSpecificationByServiceId(OshServicesVo vo) {
return oshServicesMapper.findSpecificationByServiceId(vo);
}
public List<Map<String, Object>> getLowPrice(OshServicesVo vo){
return oshServicesMapper.getLowPrice(vo);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.mapper.OshServicesSpecificationMapper;
import com.atlgroupasia.servicecenter.mapper.OshServicesTypeMapper;
import com.atlgroupasia.servicecenter.vo.OshServicesSpecificationVo;
import com.atlgroupasia.servicecenter.vo.OshServicesVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class OshServicesSpecificationSerice {
@Resource
private OshServicesSpecificationMapper oshServicesSpecificationMapper;
public List<Map<String, Object>> findList(OshServicesSpecificationVo vo) {
return oshServicesSpecificationMapper.findList(vo);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.mapper.OshServicesMapper;
import com.atlgroupasia.servicecenter.mapper.OshServicesTypeMapper;
import com.atlgroupasia.servicecenter.vo.OshServicesTypeVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class OshServicesTypeSerice {
@Resource
private OshServicesTypeMapper oshServicesTypeMapper;
public List<Map<String, Object>> findList(OshServicesTypeVo vo) {
return oshServicesTypeMapper.findList(vo);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.dto.OshParamsDto;
import com.atlgroupasia.servicecenter.mapper.ParamsMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class ParamsService {
@Resource
private ParamsMapper paramsMapper;
public OshParamsDto findNoDel(Integer paramsId) {
return paramsMapper.findNoDel(paramsId);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.User;
import com.atlgroupasia.servicecenter.mapper.UserMapper;
import com.atlgroupasia.servicecenter.vo.AtlUserVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class ProvinceService {
@Resource
private ProvinceService provinceService;
}
package com.atlgroupasia.servicecenter.service;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.exceptions.ClientException;
import com.atlgroupasia.servicecenter.common.Constants;
import com.atlgroupasia.servicecenter.entity.Sms;
import com.atlgroupasia.servicecenter.entity.User;
import com.atlgroupasia.servicecenter.exception.BusinessException;
import com.atlgroupasia.servicecenter.mapper.SmsMapper;
import com.atlgroupasia.servicecenter.mapper.UserMapper;
import com.atlgroupasia.servicecenter.utils.AliCloudUtil;
import com.atlgroupasia.servicecenter.utils.JsonResult;
import com.atlgroupasia.servicecenter.utils.MomoUtils;
import com.atlgroupasia.servicecenter.utils.SmsUtils;
import com.github.pagehelper.util.StringUtil;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/5/24 22:30
* @Version 1.0
*/
@Service
public class SmsService {
@Resource
private SmsMapper smsMapper;
@Resource
private UserMapper userMapper;
/**
* 查询用户短信验证码
* 〈〉
*
* @since: 1.0.0
* @Author:Momo
* @Date: 2019/5/26 12:41
*/
public JsonResult getUserCode(String mobile, String code, Integer type) {
Date now = new Date();
Sms sms = smsMapper.getSmsVerifyCode(mobile, code, type);
if(null != sms){
Date createtime = sms.getCreatetime();
Long diference = (now.getTime() - createtime.getTime())/1000;
if(diference > 60){
return JsonResult.failed("验证码无效");
}else{
return JsonResult.success("登录成功");
}
}else {
return JsonResult.failed("验证码无效");
}
}
/**
* 功能描述: <br>短信发送
* 〈〉
*
* @since: 1.0.0
* @Author:Momo
* @Date: 2019/5/26 12:41
*/
public JsonResult sendVerifyCode(String mobile, Integer type, String templateId ) {
if (type == null) {
return JsonResult.failed("参数异常");
}
//校验短信发送间隔
String createTime = smsMapper.getTime(mobile, type);
if (StringUtil.isNotEmpty(createTime)) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
// 发送时间
LocalDateTime time =
LocalDateTime.parse(createTime, formatter).plusMinutes(1L);
if (time.isAfter(LocalDateTime.now())) {
return JsonResult.failed("短信发送频繁,请1分钟后重试!");
}
}
Boolean isMatch = MomoUtils.phone(mobile);
if(!isMatch){
return JsonResult.failed("请输入正确的手机号!");
}
String verifyCode = RandomUtils.nextInt(100000, 1000000) + "";
Sms sms = new Sms();
sms.setPhonenumber(mobile);
sms.setVerifycode(verifyCode);
sms.setCreatetime(new Date());
sms.setType(type);
sms.setState(0);
smsMapper.insert(sms);
try {
String result = SmsUtils.sendSms(mobile,verifyCode,templateId);
JSONObject json = JSONObject.fromObject(result);
String code = json.get("code").toString();
if ("2".equals(code)) {
smsMapper.updateState(sms.getId(), 1);
return JsonResult.success("验证码发送成功!");
} else {
smsMapper.updateState(sms.getId(), 2);
return JsonResult.failed("验证码发送失败!");
}
} catch (IOException e) {
smsMapper.updateState(sms.getId(), 2);
e.printStackTrace();
return JsonResult.failed("验证码发送失败!");
}
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.Specifications;
import com.atlgroupasia.servicecenter.mapper.SpecificationsMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class SpecificationsService {
@Resource
private SpecificationsMapper specificationsMapper;
public Specifications findNoDel(Integer specificationsId) {
return specificationsMapper.findNoDel(specificationsId);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.Temple;
import com.atlgroupasia.servicecenter.mapper.DonorMapper;
import com.atlgroupasia.servicecenter.mapper.TempleMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class TempleService {
@Resource
private DonorMapper donorMapper;
@Resource
private TempleMapper templeMapper;
public Temple findNoDelByMemorialHallId(Integer templeId){
return templeMapper.findNoDelByMemorialHallId(templeId);
}
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.dto.UserBlessUsingDto;
import com.atlgroupasia.servicecenter.entity.DonateOrder;
import com.atlgroupasia.servicecenter.entity.UserBlessUsing;
import com.atlgroupasia.servicecenter.mapper.DonateOrderMapper;
import com.atlgroupasia.servicecenter.mapper.UserBlessUsingMapper;
import com.atlgroupasia.servicecenter.vo.UserBlessUsingVo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class UserBlessUsingService {
@Resource
private UserBlessUsingMapper userBlessUsingMapper;
@Resource
private DonateOrderMapper donateOrderMapper;
public UserBlessUsing findByBlessEnableId(Integer blessEnableId) {
return userBlessUsingMapper.findByBlessEnableId(blessEnableId);
}
public UserBlessUsingDto selectRest(Integer userBlessUsingId) {
UserBlessUsingDto userBlessUsingDto = userBlessUsingMapper.selectRest(userBlessUsingId);
Integer blessId = userBlessUsingDto.getBlessId();
List<DonateOrder> byBlessId = donateOrderMapper.findByBlessId(blessId);
for (DonateOrder donateOrder : byBlessId) {
userBlessUsingDto.setDonorName(donateOrder.getDonorName());
}
return userBlessUsingDto;
}
public void batchNewEntity(UserBlessUsingVo vo) {
UserBlessUsing userBlessUsing = new UserBlessUsing();
BeanUtils.copyProperties(vo, userBlessUsing);
userBlessUsingMapper.batchNewEntity(userBlessUsing);
}
// public String getDateConvert(String timeStr, Integer state, HttpServletRequest request, HttpServletResponse response) throws IOException {
// try {
// JSONObject result = new JSONObject();
// Integer year = 0;
// Integer month = 0;
// Integer day = 0;
// Date dateTime = DateUtils.getDate2(timeStr);
// //转换成yyyyMMdd格式
// String dateStr = DateUtils.getDateYYYYMMDD(dateTime);
// if (state.compareTo(0) == 0) {//新历
// /********************获取是否闰月End*******************************/
// //String dateTimeStr = CalendarUtil.lunarToSolar(dateStr, isLeapMonth);
// String dateTimeStr = CalendarUtil.solarToLunar(dateStr);
// //String时间转换成Date
// Date solarDate = DateUtils.getDate(dateTimeStr);
//
// //给年月日赋值
// year = Integer.parseInt(DateUtils.getYear(solarDate));
// month = Integer.parseInt(DateUtils.getMonth(solarDate));
// day = Integer.parseInt(DateUtils.getDay(solarDate));
// result.put("lunar", Lunar.oneDay(year, month, day));
//
// } else {//阴历
// //获取阴历日期
// //String lunarDateStr = CalendarUtil.solarToLunar(dateStr);
//
// boolean isLeapMonth = true;
// //获取传输过来的年份
// String timeYear = DateUtils.getYear(dateTime);
// //获取传输过来的月份
// Integer timeMonth = Integer.parseInt(DateUtils.getMonth(dateTime));
// //通过年份获取的当前年份的闰月(0为没有闰月)
// Integer LeapMonth = CalendarUtil.getLeapMonth(Integer.parseInt(timeYear));
// if (LeapMonth.compareTo(0) != 0) {// 0 代表没有闰月
// isLeapMonth = false;
// } else {
// if (timeMonth.compareTo(LeapMonth) != 0) {
// isLeapMonth = false;
// }
// }
// String lunarDateStr = CalendarUtil.lunarToSolar(dateStr, isLeapMonth);
//
// //String时间转换成Date
// Date lunarDate = DateUtils.getDate(lunarDateStr);
//
// //给年月日赋值
// year = Integer.parseInt(DateUtils.getYear(lunarDate));
// month = Integer.parseInt(DateUtils.getMonth(lunarDate));
// day = Integer.parseInt(DateUtils.getDay(lunarDate));
// }
// result.put("year", year);
// result.put("month", month);
// result.put("day", day);
//
// } catch (Exception e) {
//// ControllerHelper.sendErrorJson(response, "修改日期失败,请刷新后重试,谢谢!", e);
// }
// }
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.mapper.UserMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class UserPostService {
@Resource
private UserMapper userMapper;
}
package com.atlgroupasia.servicecenter.service;
import com.atlgroupasia.servicecenter.entity.User;
import com.atlgroupasia.servicecenter.mapper.UserMapper;
import com.atlgroupasia.servicecenter.vo.AtlUserVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class UserService {
@Resource
private UserMapper userMapper;
public User findNoDel(String phone) {
return userMapper.findNoDel(phone);
}
public User getUserByMobile(String phone) {
return userMapper.getUserByMobile(phone);
}
public void updateByPhone(AtlUserVo atlUserVo) {
User user = new User();
user.setOpenId(atlUserVo.getOpenId());
user.setPassword(atlUserVo.getLoginPassword());
user.setName(atlUserVo.getRealName());
userMapper.updateByPhone(user);
}
public void batchNewEntity(User user) {
userMapper.batchNewEntity(user);
}
public void updateToken(User user) {
userMapper.updateToken(user);
}
}
package com.atlgroupasia.servicecenter.utils;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.common.utils.BinaryUtil;
import com.aliyun.oss.model.*;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import net.sf.json.JSONObject;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URL;
import java.util.*;
/**
* @Name:阿里云相关工具类
* @Author: Lijc
* @Date: 2019/5/26 13:38
* @Version 1.0
*/
public class AliCloudUtil {
//产品名称:云通信短信API产品,开发者无需替换
static final String product = "Dysmsapi";
//产品域名,开发者无需替换
static final String domain = "dysmsapi.aliyuncs.com";
// TODO 此处需要替换成开发者自己的AK(在阿里云访问控制台寻找)
static final String accessKeyId = "LTAIl0pnwkyt2p9c";
static final String accessKeySecret = "VbnNOkCMq6VOt9EH3Q34WTA3eeax44";
static final String bucket = "appsub";
static final String endpoint = "oss-cn-hangzhou.aliyuncs.com";
static final String aLiUrl = "https://appsub.oss-cn-hangzhou.aliyuncs.com/";
/**
* 获取阿里云OSS客户端对象
* @return ossClient
*/
public static OSSClient getOSSClient(){
return new OSSClient(endpoint,accessKeyId, accessKeySecret);
}
/**
* 短信发送
* @param mobile
* @param templateCode
* @param json
* @return
* @throws ClientException
*/
public static CommonResponse sendSms(String mobile, String templateCode, JSONObject json) throws ClientException {
DefaultProfile profile = DefaultProfile.getProfile("default", accessKeyId, accessKeySecret);
IAcsClient client = new DefaultAcsClient(profile);
CommonRequest request = new CommonRequest();
//request.setProtocol(ProtocolType.HTTPS);
request.setMethod(MethodType.POST);
request.setDomain("dysmsapi.aliyuncs.com");
request.setVersion("2017-05-25");
request.setAction("SendSms");
request.putQueryParameter("PhoneNumbers", mobile);
request.putQueryParameter("SignName", "安泰乐");
request.putQueryParameter("TemplateCode", templateCode);
request.putQueryParameter("TemplateParam", json.toString());
try {
CommonResponse response = client.getCommonResponse(request);
System.out.println(response.getData());
return response;
} catch (ServerException e) {
e.printStackTrace();
} catch (ClientException e) {
e.printStackTrace();
}
return null;
}
// public static byte[] getPolicy(Integer day){
// //生成Policy
// JSONObject policy = new JSONObject();
// //生成格林威治天文台的标准时间
// Date date = DateUtil.getNextDay(new Date(), day);
// String nowAsISO = DateUtil.getISO8601Timestamp(date);
//
// //生成conditions
// List<Object> conditions = new ArrayList<>();
// Map<String, Object> map = new HashMap<>();
// map.put("bucket", bucket);
// conditions.add(map);
// List<String> list = new ArrayList<>();
// list.add("starts-with");
// list.add("$key");
// list.add("time/");
// conditions.add(list);
// policy.put("expiration", nowAsISO);
// policy.put("conditions", conditions);
//
// byte[] policyStr = Base64.encodeBase64(policy.toString().getBytes());
//
// return policyStr;
// }
public static Map<String, String> getOssSign() {
// 创建上传Object的Metadata
ObjectMetadata meta = new ObjectMetadata();
// 设置自定义元信息name的值为my-data
meta.addUserMetadata("property", "property-value");
// 创建OSSClient实例
OSSClient ossClient = null;
// 使用访问OSS
String dir = "time/";
String host = "http://" + bucket + "." + endpoint;
try {
ossClient = new OSSClient(endpoint, accessKeyId,accessKeySecret);
long expireTime = 30;
long expireEndTime = System.currentTimeMillis() + expireTime * 1000;
Date expiration = new Date(expireEndTime);
PolicyConditions policyConds = new PolicyConditions();
policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE, 0, 1048576000);
policyConds.addConditionItem(MatchMode.StartWith, PolicyConditions.COND_KEY, dir);
String postPolicy = ossClient.generatePostPolicy(expiration, policyConds);
byte[] binaryData = postPolicy.getBytes("utf-8");
String encodedPolicy = BinaryUtil.toBase64String(binaryData);
String postSignature = ossClient.calculatePostSignature(postPolicy);
Map<String, String> respMap = new LinkedHashMap<String, String>();
respMap.put("policy", encodedPolicy);
respMap.put("signature", postSignature);
respMap.put("accessid", accessKeyId);
respMap.put("dir", dir);
respMap.put("host", host);
respMap.put("expire", String.valueOf(expireEndTime / 1000));
return respMap;
} catch (Exception e) {
e.printStackTrace();
} finally {
if(ossClient != null) {
ossClient.shutdown();
}
}
return null;
}
/**
* 从OSS服务中下载所需文件到本地临时文件
* @return
*/
public static String downloadOSS(String objectName){
String basePath="/Users/Momo/Desktop/Momo/temp";
// objectName.substring(44,objectName.length())
objectName = "uni-app/12312312312.mp4";
OSSClient ossClient = null;
String filePath = "";
try{
//创建OSSClient实例,用于操作oss空间
ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
//指定文件保存路径
filePath = basePath+"/"+objectName;
//判断文件目录是否存在,不存在则创建
File file = new File(filePath);
if (!file.exists()){
file.mkdirs();
}
//判断保存文件名是否加后缀
if (objectName.contains(".")){
//指定文件保存名称
filePath = filePath+"/"+objectName.substring(objectName.lastIndexOf("/")+1);
}
//获取OSS文件并保存到本地指定路径中,此文件路径一定要存在,若保存目录不存在则报错,若保存文件名已存在则覆盖本地文件
ossClient.getObject(new GetObjectRequest(bucket,objectName),new File(filePath));
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
throw new RuntimeException(e.getMessage());
}finally {
//关闭oss连接
if (ossClient != null){
ossClient.shutdown();
}
}
return filePath;
}
public static String uploadFile(String url){
File file = new File(url);
String resultStr = null;
String[] fo = new String[] { "", "" };
OSSClient ossClient = null;
try {
// 以输入流的形式上传文件
InputStream is = new FileInputStream(file);
// 文件名
String timefile = "image/";
String fileName = file.getName();
fileName = timefile + fileName;
// logger.info("上传到路径" + folder + fileName);
// 文件大小
Long fileSize = file.length();
// 创建上传Object的Metadata
ObjectMetadata metadata = new ObjectMetadata();
// 上传的文件的长度
metadata.setContentLength(is.available());
// 指定该Object被下载时的网页的缓存行为
metadata.setCacheControl("no-cache");
// 指定该Object下设置Header
metadata.setHeader("Pragma", "no-cache");
// 指定该Object被下载时的内容编码格式
metadata.setContentEncoding("utf-8");
// 文件的MIME,定义文件的类型及网页编码,决定浏览器将以什么形式、什么编码读取文件。如果用户没有指定则根据Key或文件名的扩展名生成,
// 如果没有扩展名则填默认值application/octet-stream
metadata.setContentType(getContentType(fileName));
// 指定该Object被下载时的名称(指示MINME用户代理如何显示附加的文件,打开或下载,及文件名称)
// metadata.setContentDisposition("filename/filesize=" + fileName + "/" + fileSize + "Byte.");
// 上传文件 (上传文件流的形式)
ossClient = getOSSClient();
PutObjectResult putResult = ossClient.putObject(bucket, fileName, is, metadata);
// 解析结果
resultStr = putResult.getETag();
fo[1] = fileName;
fo[0] = resultStr;
ossClient.shutdown();
} catch (Exception e) {
e.printStackTrace();
}
return aLiUrl+fo[1];
}
/**
* 通过文件名判断并获取OSS服务文件上传时文件的contentType
*
* @param fileName
* 文件名
* @return 文件的contentType
*/
public static String getContentType(String fileName) {
// 文件的后缀名
String fileExtension = fileName.substring(fileName.lastIndexOf("."));
if (".bmp".equalsIgnoreCase(fileExtension)) {
return "image/bmp";
}
if (".gif".equalsIgnoreCase(fileExtension)) {
return "image/gif";
}
if (".jpeg".equalsIgnoreCase(fileExtension) || ".jpg".equalsIgnoreCase(fileExtension)
|| ".png".equalsIgnoreCase(fileExtension)) {
return "image/jpeg";
}
if (".html".equalsIgnoreCase(fileExtension)) {
return "text/html";
}
if (".txt".equalsIgnoreCase(fileExtension)) {
return "text/plain";
}
if (".vsd".equalsIgnoreCase(fileExtension)) {
return "application/vnd.visio";
}
if (".ppt".equalsIgnoreCase(fileExtension) || "pptx".equalsIgnoreCase(fileExtension)) {
return "application/vnd.ms-powerpoint";
}
if (".doc".equalsIgnoreCase(fileExtension) || "docx".equalsIgnoreCase(fileExtension)) {
return "application/msword";
}
if (".xml".equalsIgnoreCase(fileExtension)) {
return "text/xml";
}
if (".mp4".equalsIgnoreCase(fileExtension)) {
return "video/mp4";
}
// 默认返回类型
return "image/jpeg";
}
/**
* 获得url链接
*
* @param
* @return
*/
public static String getUrl(String fileName) {
// 设置URL过期时间为10年 3600l* 1000*24*365*10
Date expiration = new Date(new Date().getTime() + 3600l * 1000 * 24 * 365 * 10);
// 生成URL
URL url = getOSSClient().generatePresignedUrl(bucket, fileName, expiration);
if (url != null) {
return url.toString();
}
return "获网址路径出错";
}
}
package com.atlgroupasia.servicecenter.utils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.imageio.stream.FileImageInputStream;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/30 17:53
* @Version 1.0
*/
public class Base64Utils {
/**
* 字符串转图片
*
* @param base64Str
* @return
*/
public static byte[] decode(String base64Str) {
byte[] b = null;
BASE64Decoder decoder = new BASE64Decoder();
try {
b = decoder.decodeBuffer(replaceEnter(base64Str));
} catch (IOException e) {
e.printStackTrace();
}
return b;
}
/**
* 图片转字符串
*
* @param image
* @return
*/
public static String encode(byte[] image) {
BASE64Encoder decoder = new BASE64Encoder();
return replaceEnter(decoder.encode(image));
}
public static String encode(String uri) {
BASE64Encoder encoder = new BASE64Encoder();
return replaceEnter(encoder.encode(uri.getBytes()));
}
/**
* @return
* @path 图片路径
*/
public static byte[] imageTobyte(String path) {
byte[] data = null;
FileImageInputStream input = null;
try {
input = new FileImageInputStream(new File(path));
ByteArrayOutputStream output = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int numBytesRead = 0;
while ((numBytesRead = input.read(buf)) != -1) {
output.write(buf, 0, numBytesRead);
}
data = output.toByteArray();
output.close();
input.close();
} catch (Exception e) {
e.printStackTrace();
}
return data;
}
public static String replaceEnter(String str) {
String reg = "[\n-\r]";
Pattern p = Pattern.compile(reg);
Matcher m = p.matcher(str);
return m.replaceAll("");
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
public class BeanUtils {
}
package com.atlgroupasia.servicecenter.utils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class CalendarUtil {
// private static final Logger logger = LoggerFactory.getLogger(CalendarUtil.class);
// 计算阴历日期参照1900年到2049年
private final static int[] LUNAR_INFO = {
0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,
0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,
0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,
0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,
0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,
0x06ca0,0x0b550,0x15355,0x04da0,0x0a5d0,0x14573,0x052d0,0x0a9a8,0x0e950,0x06aa0,
0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,
0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b5a0,0x195a6,
0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,
0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,
0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,
0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,
0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,
0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,
0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0
};
// 允许输入的最小年份
private final static int MIN_YEAR = 1900;
// 允许输入的最大年份
private final static int MAX_YEAR = 2049;
// 当年是否有闰月
private static boolean isLeapYear;
// 阳历日期计算起点
private final static String START_DATE = "19000130";
/**
* 计算阴历 {@code year}年闰哪个月 1-12 , 没闰传回 0
* @param year 阴历年
* @return (int)月份
* @author liu 2015-1-5
*/
public static int getLeapMonth(int year) {
return (int) (LUNAR_INFO[year - 1900] & 0xf);
}
/**
* 计算阴历{@code year}年闰月多少天
* @param year 阴历年
* @return (int)天数
* @author liu 2015-1-5
*/
private static int getLeapMonthDays(int year) {
if(getLeapMonth(year)!=0){
if((LUNAR_INFO[year - 1900] & 0xf0000)==0){
return 29;
}else {
return 30;
}
}else{
return 0;
}
}
/**
* 计算阴历{@code lunarYeay}年{@code month}月的天数
* @param lunarYeay 阴历年
* @param month 阴历月
* @return (int)该月天数
* @throws Exception
* @author liu 2015-1-5
*/
private static int getMonthDays(int lunarYeay, int month) throws Exception {
if ((month > 31) || (month < 0)) {
throw(new Exception("月份有错!"));
}
// 0X0FFFF[0000 {1111 1111 1111} 1111]中间12位代表12个月,1为大月,0为小月
int bit = 1 << (16-month);
if(((LUNAR_INFO[lunarYeay - 1900] & 0x0FFFF)&bit)==0){
return 29;
}else {
return 30;
}
}
/**
* 计算阴历{@code year}年的总天数
* @param year 阴历年
* @return (int)总天数
* @author liu 2015-1-5
*/
private static int getYearDays(int year) {
int sum = 29*12;
for(int i=0x8000;i>=0x8;i>>=1){
if((LUNAR_INFO[year-1900]&0xfff0&i)!=0){
sum++;
}
}
return sum+getLeapMonthDays(year);
}
/**
* 计算两个阳历日期相差的天数。
* @param startDate 开始时间
* @param endDate 截至时间
* @return (int)天数
* @author liu 2017-3-2
*/
private static int daysBetween(Date startDate, Date endDate) {
int days = 0;
//将转换的两个时间对象转换成Calendar对象
Calendar can1 = Calendar.getInstance();
can1.setTime(startDate);
Calendar can2 = Calendar.getInstance();
can2.setTime(endDate);
//拿出两个年份
int year1 = can1.get(Calendar.YEAR);
int year2 = can2.get(Calendar.YEAR);
//天数
Calendar can = null;
//如果can1 < can2
//减去小的时间在这一年已经过了的天数
//加上大的时间已过的天数
if(can1.before(can2)){
days -= can1.get(Calendar.DAY_OF_YEAR);
days += can2.get(Calendar.DAY_OF_YEAR);
can = can1;
}else{
days -= can2.get(Calendar.DAY_OF_YEAR);
days += can1.get(Calendar.DAY_OF_YEAR);
can = can2;
}
for (int i = 0; i < Math.abs(year2-year1); i++) {
//获取小的时间当前年的总天数
days += can.getActualMaximum(Calendar.DAY_OF_YEAR);
//再计算下一年。
can.add(Calendar.YEAR, 1);
}
return days;
}
/**
* 检查阴历日期是否合法
* @param lunarYear 阴历年
* @param lunarMonth 阴历月
* @param lunarDay 阴历日
* @param leapMonthFlag 闰月标志
* @throws Exception
*/
private static void checkLunarDate(int lunarYear, int lunarMonth, int lunarDay, boolean leapMonthFlag) throws Exception {
if ((lunarYear < MIN_YEAR) || (lunarYear > MAX_YEAR)) {
throw(new Exception("非法农历年份!"));
}
if ((lunarMonth < 1) || (lunarMonth > 12)) {
throw(new Exception("非法农历月份!"));
}
if ((lunarDay < 1) || (lunarDay > 30)) { // 中国的月最多30天
throw(new Exception("非法农历天数!"));
}
int leap = getLeapMonth(lunarYear);// 计算该年应该闰哪个月
if ((leapMonthFlag == true) && (lunarMonth != leap)) {
throw(new Exception("非法闰月!"));
}
}
/**
* 阴历转换为阳历
* @param lunarDate 阴历日期,格式YYYYMMDD
* @param leapMonthFlag 是否为闰月
* @return 阳历日期,格式:YYYYMMDD
* @throws Exception
* @author liu 2015-1-5
*/
public static String lunarToSolar(String lunarDate, boolean leapMonthFlag) throws Exception{
int lunarYear = Integer.parseInt(lunarDate.substring(0, 4));
int lunarMonth = Integer.parseInt(lunarDate.substring(4, 6));
int lunarDay = Integer.parseInt(lunarDate.substring(6, 8));
checkLunarDate(lunarYear, lunarMonth, lunarDay, leapMonthFlag);
int offset = 0;
for (int i = MIN_YEAR; i < lunarYear; i++) {
int yearDaysCount = getYearDays(i); // 求阴历某年天数
offset += yearDaysCount;
}
//计算该年闰几月
int leapMonth = getLeapMonth(lunarYear);
if(leapMonthFlag & leapMonth != lunarMonth){
throw(new Exception("您输入的闰月标志有误!"));
}
//当年没有闰月或月份早于闰月或和闰月同名的月份
if(leapMonth==0|| (lunarMonth < leapMonth) || (lunarMonth==leapMonth && !leapMonthFlag)){
for (int i = 1; i < lunarMonth; i++) {
int tempMonthDaysCount = getMonthDays(lunarYear, i);
offset += tempMonthDaysCount;
}
// 检查日期是否大于最大天
if (lunarDay > getMonthDays(lunarYear, lunarMonth)) {
throw(new Exception("不合法的农历日期!"));
}
offset += lunarDay; // 加上当月的天数
}else{//当年有闰月,且月份晚于或等于闰月
for (int i = 1; i < lunarMonth; i++) {
int tempMonthDaysCount = getMonthDays(lunarYear, i);
offset += tempMonthDaysCount;
}
if (lunarMonth>leapMonth) {
int temp = getLeapMonthDays(lunarYear); // 计算闰月天数
offset += temp; // 加上闰月天数
if (lunarDay > getMonthDays(lunarYear, lunarMonth)) {
throw(new Exception("不合法的农历日期!"));
}
offset += lunarDay;
}else { // 如果需要计算的是闰月,则应首先加上与闰月对应的普通月的天数
// 计算月为闰月
int temp = getMonthDays(lunarYear, lunarMonth); // 计算非闰月天数
offset += temp;
if (lunarDay > getLeapMonthDays(lunarYear)) {
throw(new Exception("不合法的农历日期!"));
}
offset += lunarDay;
}
}
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy:MM:dd");
Date myDate = null;
myDate = formatter.parse(START_DATE);
Calendar c = Calendar.getInstance();
c.setTime(myDate);
c.add(Calendar.DATE, offset);
myDate = c.getTime();
return dateFormat.format(myDate);
}
/**
* 阳历日期转换为阴历日期
* @param solarDate 阳历日期,格式YYYYMMDD
* @return 阴历日期
* @throws Exception
* @author liu 2015-1-5
*/
public static String solarToLunar(String solarDate) throws Exception{
int i;
int temp = 0;
int lunarYear;
int lunarMonth; //农历月份
int lunarDay; //农历当月第几天
boolean leapMonthFlag =false;
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
Date myDate = null;
Date startDate = null;
try {
myDate = formatter.parse(solarDate);
startDate = formatter.parse(START_DATE);
} catch (ParseException e) {
e.printStackTrace();
}
int offset = daysBetween(startDate,myDate);
for (i = MIN_YEAR; i <= MAX_YEAR; i++){
temp = getYearDays(i); //求当年农历年天数
if (offset - temp < 1){
break;
}else{
offset -= temp;
}
}
lunarYear = i;
int leapMonth = getLeapMonth(lunarYear);//计算该年闰哪个月
//设定当年是否有闰月
if (leapMonth > 0){
isLeapYear = true;
}else{
isLeapYear = false;
}
for (i = 1; i<=12; i++) {
if(i==leapMonth+1 && isLeapYear){
temp = getLeapMonthDays(lunarYear);
isLeapYear = false;
leapMonthFlag = true;
i--;
}else{
temp = getMonthDays(lunarYear, i);
}
offset -= temp;
if(offset<=0){
break;
}
}
offset += temp;
lunarMonth = i;
lunarDay = offset;
return lunarYear+":"+lunarMonth+":"+lunarDay;
/* return "阴历:"+lunarYear+"年"+(leapMonthFlag&(lunarMonth==leapMonth)?"闰":"")+lunarMonth+"月"+lunarDay+"日"; */
}
public static void main(String[] args) throws Exception {
Integer s= getLeapMonth(2017);
String solarDate = "20170621";
String aa = "20170527";
String yindate = solarToLunar(solarDate);//阳历日期转换为阴历日期
String yangdate = lunarToSolar(aa, false);//阴历转换为阳历
System.out.println(yindate);
System.out.println(yangdate);
System.out.println(s);
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
import java.util.HashMap;
public class Constant {
//private static Logger logger = LoggerFactory.getLogger(Constant.class);
public static PropertiesHelper helper = new PropertiesHelper("system.properties");
// 新浪的根据IP地址返回对应的省市URL
public static String IP_CONVERT_URL = "http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=xml&ip=";
public static boolean DeBug = helper.getBoolean("debug");
public static boolean WxDeBug = helper.getBoolean("wx_debug");
public interface SMS_API{
public final static String APP_ID = "C85572079";
public final static String APP_KEY = "1ef4f297ca31b9c79c9f446d2334454c";
}
// 验证码有效时间5分钟
public static final long CODE_VALIDATE_TIME = 5 * 60 * 1000;
public interface PRODUCT_TYPE {
public int IS_LEAF = 0;
public int NOT_LEAF = 1;
}
public interface DEPARTMENT {
public int IS_LEAF = 0;
public int NOT_LEAF = 1;
}
//===============分区类型 begin================
public interface PARTITION_TYPE{
public final static int SUB_ORDER = 0;
public final static int DONATE_ORDER = 1;
public final static int PACK_ORDER = 2;
}
//===============分区类型 end================
//===============验证============
public static final String PARAMS_ERROR = "参数错误,请联系开发人员";
//===========================参数类型====================================
//0:价格参数设置
public interface PARAMS_TYPE{
public Integer PRAISE = 0;
}
//================预约类型 begin================
public interface APPOINTMENT_TYPE{
public final static Integer TEMPLE = 0;
public final static Integer ACTIVITY = 1;
}
//===============预约类型 end================
//===============广告类型 begin================
public interface AD_TYPE_INDEX{
public Integer STORE_INDEX = 0;
public Integer WX_INDEX = 1;
public Integer APP_INDEX = 2;
}
public interface AD_TYPE_STR{
public String STORE_STR = "商城";
public String WX_STR = "微信";
public String APP_STR = "app";
}
public static HashMap<Integer, String> AD_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(AD_TYPE_INDEX.STORE_INDEX, AD_TYPE_STR.STORE_STR);
MAP.put(AD_TYPE_INDEX.WX_INDEX, AD_TYPE_STR.WX_STR);
MAP.put(AD_TYPE_INDEX.APP_INDEX, AD_TYPE_STR.APP_STR);
return MAP;
}
//===============广告类型 end================
//==============登录标识 start================
public interface LOGIN{
public final static String COMPANY_USER = "company_user";
}
//===============登录标识 end================
//===============状态 begin================
public interface USER_STATE_INDEX{
public Integer NORMAL_INDEX = 0;
public Integer DISABLE_INDEX = 1;
}
public interface USER_STATE_STR{
public String NORMAL_STR = "正常";
public String DISABLE_STR = "禁用";
}
public static HashMap<Integer, String> USER_STATE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(USER_STATE_INDEX.NORMAL_INDEX, USER_STATE_STR.NORMAL_STR);
MAP.put(USER_STATE_INDEX.DISABLE_INDEX, USER_STATE_STR.DISABLE_STR);
return MAP;
}
//===============状态 end================
//===============性别 begin================
public interface SEX_INDEX{
public Integer WOMAN_INDEX = 0;
public Integer MAN_INDEX = 1;
}
public interface SEX_STR{
public String WOMAN_STR = "女";
public String MAN_STR = "男";
}
public static HashMap<Integer, String> SEX_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(SEX_INDEX.WOMAN_INDEX, SEX_STR.WOMAN_STR);
MAP.put(SEX_INDEX.MAN_INDEX, SEX_STR.MAN_STR);
return MAP;
}
//===============性别 end================
//===============注册平台 begin================
public interface USER_REGISTER_PLATFORM_INDEX{
public Integer PC_INDEX = 0;
public Integer WX_INDEX = 1;
public Integer ANDROID_INDEX = 2;
public Integer IOS_INDEX = 3;
}
public interface USER_REGISTER_PLATFORM_STR{
public String PC_STR = "pc";
public String WX_STR = "微信";
public String ANDROID_STR = "安卓";
public String IOS_STR = "ios";
}
public static HashMap<Integer, String> USER_REGISTER_PLATFORM_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(USER_REGISTER_PLATFORM_INDEX.PC_INDEX, USER_REGISTER_PLATFORM_STR.PC_STR);
MAP.put(USER_REGISTER_PLATFORM_INDEX.WX_INDEX, USER_REGISTER_PLATFORM_STR.WX_STR);
MAP.put(USER_REGISTER_PLATFORM_INDEX.ANDROID_INDEX, USER_REGISTER_PLATFORM_STR.ANDROID_STR);
MAP.put(USER_REGISTER_PLATFORM_INDEX.IOS_INDEX, USER_REGISTER_PLATFORM_STR.IOS_STR);
return MAP;
}
//===============注册平台 end================
//===============订单状态 begin================
public interface ORDER_INFO_STATE_INDEX{
public String CLOSE_INDEX = "-1";
public String WAIT_PAY_INDEX = "0";
public String PAID_INDEX = "1.0";
public String WAIT_CONFIRM_INDEX = "2";
public String WAIT_COMMINT_INDEX = "3";
public String SUCCESS_INDEX = "4";
}
public interface ORDER_INFO_STATE_STR{
public String CLOSE_STR = "交易关闭";
public String WAIT_PAY_STR = "未付款";
public String PAID_STR = "已支付";
public String WAIT_CONFIRM_STR = "待收货";
public String WAIT_COMMINT_STR = "待评价";
public String SUCCESS_STR = " 交易成功";
}
public static HashMap<String, String> ORDER_INFO_STATE_MAP(){
HashMap<String, String> MAP = new HashMap<String, String>();
MAP.put(ORDER_INFO_STATE_INDEX.CLOSE_INDEX, ORDER_INFO_STATE_STR.CLOSE_STR);
MAP.put(ORDER_INFO_STATE_INDEX.WAIT_PAY_INDEX, ORDER_INFO_STATE_STR.WAIT_PAY_STR);
MAP.put(ORDER_INFO_STATE_INDEX.PAID_INDEX, ORDER_INFO_STATE_STR.PAID_STR);
MAP.put(ORDER_INFO_STATE_INDEX.WAIT_CONFIRM_INDEX, ORDER_INFO_STATE_STR.WAIT_CONFIRM_STR);
MAP.put(ORDER_INFO_STATE_INDEX.WAIT_COMMINT_INDEX, ORDER_INFO_STATE_STR.WAIT_COMMINT_STR);
MAP.put(ORDER_INFO_STATE_INDEX.SUCCESS_INDEX, ORDER_INFO_STATE_STR.SUCCESS_STR);
return MAP;
}
//===============订单状态 end================
//===============商品参数类型 begin================
public interface PARAMS_TYPE_INDEX{
public Integer OPTION_INDEX = 0;
public Integer FILL_INDEX = 1;
}
public interface PARAMS_TYPE_STR{
public String OPTION_STR = "可选项";
public String FILL_STR = "自填项";
}
public static HashMap<Integer, String> PARAMS_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PARAMS_TYPE_INDEX.OPTION_INDEX, PARAMS_TYPE_STR.OPTION_STR);
MAP.put(PARAMS_TYPE_INDEX.FILL_INDEX, PARAMS_TYPE_STR.FILL_STR);
return MAP;
}
//===============商品参数类型 end================
//===============分销商类型 begin================
public interface DISTRIBUTOR_TYPE_INDEX{
public Integer COMPANY_INDEX = 0;//公司
public Integer PERSONAL_INDEX = 1;//个人
}
public interface DISTRIBUTOR_TYPE_STR{
public String COMPANY_STR = "公司";
public String PERSONAL_STR = "个人";
}
/**
* 分销商类型
* @author liuxueqin
* @return
* @data 2017年4月24日 下午2:45:06
*/
public static HashMap<Integer, String> DISTRIBUTOR_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(DISTRIBUTOR_TYPE_INDEX.COMPANY_INDEX, DISTRIBUTOR_TYPE_STR.COMPANY_STR);
MAP.put(DISTRIBUTOR_TYPE_INDEX.PERSONAL_INDEX, DISTRIBUTOR_TYPE_STR.PERSONAL_STR);
return MAP;
}
//===============分销商类型 end================
//===============分销商状态 begin================
public interface DISTRIBUTOR_STATE_INDEX{
public Integer AUDIT_INDEX = 0;
public Integer NORMAL_INDEX = 1;
public Integer DISABLE_INDEX = 2;
public Integer FAIL_INDEX = 3;
}
public interface DISTRIBUTOR_STATE_STR{
public String AUDIT_STR = "审核中";
public String NORMAL_STR = "正常";
public String DISABLE_STR = "禁用";
public String FAIL_STR = "审核失败";
}
/**
* 分销商状态
* @author liuxueqin
* @return
* @data 2017年4月24日 下午2:59:35
*/
public static HashMap<Integer, String> DISTRIBUTOR_STATE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(DISTRIBUTOR_STATE_INDEX.AUDIT_INDEX, DISTRIBUTOR_STATE_STR.AUDIT_STR);
MAP.put(DISTRIBUTOR_STATE_INDEX.NORMAL_INDEX, DISTRIBUTOR_STATE_STR.NORMAL_STR);
MAP.put(DISTRIBUTOR_STATE_INDEX.DISABLE_INDEX, DISTRIBUTOR_STATE_STR.DISABLE_STR);
MAP.put(DISTRIBUTOR_STATE_INDEX.FAIL_INDEX, DISTRIBUTOR_STATE_STR.FAIL_STR);
return MAP;
}
//===============分销商状态 end================
//===============仓库类型 begin================
public interface WAREHOUSE_TYPE_INDEX{
public Integer COMPANY_INDEX = 0;
public Integer BONDED_INDEX = 1;
public Integer OVERSEAS_INDEX = 2;
}
public interface WAREHOUSE_TYPE_STR{
public String COMPANY_STR = "公司仓";
public String BONDED_STR = "保税仓";
public String OVERSEAS_STR = "海外仓";
}
/**
* 仓库类型
* @author lanyuping
* @return
* @date 2017年4月28日 上午10:22:34
*/
public static HashMap<Integer, String> WAREHOUSE_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(WAREHOUSE_TYPE_INDEX.COMPANY_INDEX, WAREHOUSE_TYPE_STR.COMPANY_STR);
MAP.put(WAREHOUSE_TYPE_INDEX.BONDED_INDEX, WAREHOUSE_TYPE_STR.BONDED_STR);
MAP.put(WAREHOUSE_TYPE_INDEX.OVERSEAS_INDEX, WAREHOUSE_TYPE_STR.OVERSEAS_STR);
return MAP;
}
//===============仓库类型 end================
//===============仓库状态 begin================
public interface WAREHOUSE_STATE_INDEX{
public Integer NORMAL_INDEX = 0;
public Integer DISABLE_INDEX = 1;
}
public interface WAREHOUSE_STATE_STR{
public String NORMAL_STR = "正常";
public String DISABLE_STR = "禁用";
}
/**
* 仓库状态
* @author lanyuping
* @return
* @date 2017年4月28日 上午10:22:34
*/
public static HashMap<Integer, String> WAREHOUSE_STATE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(USER_STATE_INDEX.NORMAL_INDEX, USER_STATE_STR.NORMAL_STR);
MAP.put(USER_STATE_INDEX.DISABLE_INDEX, USER_STATE_STR.DISABLE_STR);
return MAP;
}
//===============仓库状态 end================
//===============请购单状态 begin================
public interface PREPURCHASE_STATE_INDEX{
public Integer AUDIT_INDEX = 0;
public Integer FAIL_INDEX = 1;
public Integer AUDITED_INDEX = 2;
public Integer PURCHASE_INDEX = 3;
}
public interface PREPURCHASE_STATE_STR{
public String AUDIT_STR = "待审核";
public String FAILL_STR = "被驳回";
public String AUDITED_STR = "已审核";//待采购
public String PURCHASE_STR = "已采购";
}
/**
* 请购单状态
* @author liuxueqin
* @return
* @data 2017年4月28日 上午9:44:37
*/
public static HashMap<Integer, String> PREPURCHASE_STATE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PREPURCHASE_STATE_INDEX.AUDIT_INDEX, PREPURCHASE_STATE_STR.AUDIT_STR);
MAP.put(PREPURCHASE_STATE_INDEX.FAIL_INDEX, PREPURCHASE_STATE_STR.FAILL_STR);
MAP.put(PREPURCHASE_STATE_INDEX.AUDITED_INDEX, PREPURCHASE_STATE_STR.AUDITED_STR);
MAP.put(PREPURCHASE_STATE_INDEX.PURCHASE_INDEX, PREPURCHASE_STATE_STR.PURCHASE_STR);
return MAP;
}
//===============请购单状态 end================
//===============采购单状态 begin================
public interface PURCHASE_STATE_INDEX{
public Integer CANCEL_INDEX = -1;//撤销
public Integer AUDIT_INDEX = 0;//待审核
public Integer FAIL_INDEX = 1;//被驳回
public Integer AUDITED_INDEX = 2;//已审核
public Integer PRODUCING_INDEX = 3;//生产中
public Integer COMPLETE_INDEX = 4;//生产完成
public Integer PARTIAL_RECEIPT_INDEX = 5;//部分收货
public Integer IS_OVER_INDEX = 6;//已完结
public Integer DRAFT_INDEX = 7;//存草稿
}
public interface PURCHASE_STATE_STR{
public String CANCEL_STR = "撤销";//-1
public String AUDIT_STR = "待审核";//0
public String FAILL_STR = "被驳回";//1
public String AUDITED_STR = "待生产";//待收货//2
public String PRODUCING_STR = "待收货";//生产中//3
public String COMPLETE_STR = "待收货";//生成完成//4
public String PARTIAL_RECEIPT_STR = "部分收货";//5
public String IS_OVER_STR = "已完结";//6
public String DRAFT_STR = "存草稿";//7
}
/**
* 采购单状态
* @author liuxueqin
* @return
* @data 2017年4月28日 上午9:44:37
*/
public static HashMap<Integer, String> PURCHASE_STATE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PURCHASE_STATE_INDEX.CANCEL_INDEX, PURCHASE_STATE_STR.CANCEL_STR);
MAP.put(PURCHASE_STATE_INDEX.AUDIT_INDEX, PURCHASE_STATE_STR.AUDIT_STR);
MAP.put(PURCHASE_STATE_INDEX.FAIL_INDEX, PURCHASE_STATE_STR.FAILL_STR);
MAP.put(PURCHASE_STATE_INDEX.AUDITED_INDEX, PURCHASE_STATE_STR.AUDITED_STR);
MAP.put(PURCHASE_STATE_INDEX.PARTIAL_RECEIPT_INDEX, PURCHASE_STATE_STR.PARTIAL_RECEIPT_STR);
MAP.put(PURCHASE_STATE_INDEX.IS_OVER_INDEX, PURCHASE_STATE_STR.IS_OVER_STR);
MAP.put(PURCHASE_STATE_INDEX.PRODUCING_INDEX, PURCHASE_STATE_STR.PRODUCING_STR);
MAP.put(PURCHASE_STATE_INDEX.COMPLETE_INDEX, PURCHASE_STATE_STR.COMPLETE_STR);
MAP.put(PURCHASE_STATE_INDEX.DRAFT_INDEX, PURCHASE_STATE_STR.DRAFT_STR);
return MAP;
}
//===============采购单状态 end================
//===============采购单类型 begin================
public interface PURCHASE_TYPE_INDEX{
public Integer DEPOSIT_PURCHASE_INDEX = 0;//定金采购
public Integer FULL_PURCHASE_INDEX = 1;//全款采购
}
public interface PURCHASE_TYPE_STR{
public String DEPOSIT_PURCHA_STR = "定金采购";
public String FULL_PURCHASE_STR = "全款采购";
}
/**
* 采购单类型
* @author liuxueqin
* @return
* @data 2017年4月24日 下午2:45:06
*/
public static HashMap<Integer, String> PURCHASE_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PURCHASE_TYPE_INDEX.DEPOSIT_PURCHASE_INDEX, PURCHASE_TYPE_STR.DEPOSIT_PURCHA_STR);
MAP.put(PURCHASE_TYPE_INDEX.FULL_PURCHASE_INDEX, PURCHASE_TYPE_STR.FULL_PURCHASE_STR);
return MAP;
}
//===============采购单类型 end================
//===============商品状态 begin================
public interface PRODUCT_STATE_INDEX{
public Integer NEW_INDEX = 0;
public Integer SALE_INDEX = 1;
public Integer OFF_SALE_INDEX = 2;
}
public interface PRODUCT_STATE_STR{
public String NEW_STR = "新品";
public String SALE_STR = "在售";
public String OFF_SALE_STR = "下架";
}
/**
* 商品状态
* @author lanyuping
* @return
* @data 2017年4月24日 下午2:45:06
*/
public static HashMap<Integer, String> PRODUCT_STATE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PRODUCT_STATE_INDEX.NEW_INDEX, PRODUCT_STATE_STR.NEW_STR);
MAP.put(PRODUCT_STATE_INDEX.SALE_INDEX, PRODUCT_STATE_STR.SALE_STR);
MAP.put(PRODUCT_STATE_INDEX.OFF_SALE_INDEX, PRODUCT_STATE_STR.OFF_SALE_STR);
return MAP;
}
//===============商品状态 end================
//===============商品发货类型 begin================
public interface PRODUCT_SEND_TYPE_INDEX{
public Integer BONDED_INDEX = 0;
public Integer OVERSEAS_INDEX = 1;
}
public interface PRODUCT_SEND_TYPE_STR{
public String BONDED_STR = "保税仓";
public String OVERSEAS_STR = "海外直邮";
}
/**
* 商品发货类型
* @author lanyuping
* @return
* @data 2017年4月24日 下午2:45:06
*/
public static HashMap<Integer, String> PRODUCT_SEND_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PRODUCT_SEND_TYPE_INDEX.BONDED_INDEX, PRODUCT_SEND_TYPE_STR.BONDED_STR);
MAP.put(PRODUCT_SEND_TYPE_INDEX.OVERSEAS_INDEX, PRODUCT_SEND_TYPE_STR.OVERSEAS_STR);
return MAP;
}
//===============商品发货类型 end================
//===============商品税费承担方 begin================
public interface PRODUCT_RATE_BEAR_INDEX{
public Integer DISTRIBUTOR_INDEX = 0;
public Integer SUPPLIER_INDEX = 1;
}
public interface PRODUCT_RATE_BEAR_STR{
public String DISTRIBUTOR_STR = "分销商";
public String SUPPLIER_STR = "供应商";
}
/**
* 商品税费承担方
* @author lanyuping
* @return
* @data 2017年4月24日 下午2:45:06
*/
public static HashMap<Integer, String> PRODUCT_RATE_BEAR_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PRODUCT_RATE_BEAR_INDEX.DISTRIBUTOR_INDEX, PRODUCT_RATE_BEAR_STR.DISTRIBUTOR_STR);
MAP.put(PRODUCT_RATE_BEAR_INDEX.SUPPLIER_INDEX, PRODUCT_RATE_BEAR_STR.SUPPLIER_STR);
return MAP;
}
//===============商品税费承担方 end================
//===============付款单类型 begin================
public interface PAYMENT_TYPE_INDEX{
public Integer ADVANCE_CHARGE_INDEX = 0;//预付款
public Integer FULL_PAYMENT_INDEX = 1;//全额申请
}
public interface PAYMENT_TYPE_STR{
public String ADVANCE_CHARGE_STR = "预付款";
public String FULL_PAYMENT_STR = "全额申请";
}
/**
* 付款单类型
* @author liuxueqin
* @return
* @data 2017年5月2日 下午7:08:46
*/
public static HashMap<Integer, String> PAYMENT_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PAYMENT_TYPE_INDEX.ADVANCE_CHARGE_INDEX, PAYMENT_TYPE_STR.ADVANCE_CHARGE_STR);
MAP.put(PAYMENT_TYPE_INDEX.FULL_PAYMENT_INDEX, PAYMENT_TYPE_STR.FULL_PAYMENT_STR);
return MAP;
}
//===============分销商类型 end================
//===============付款单付款方式类型 begin================
public interface PAYMENT_PAY_TYPE_INDEX{
public Integer CASH_TRANSFER_INDEX = 0;//现金支付
public Integer BANK_TRANSFER_INDEX = 1;//银行转账
}
public interface PAYMENT_PAY_TYPE_STR{
public String CASH_TRANSFER_STR = "现金支付";
public String BANK_TRANSFER_STR = "银行转账";
}
/**
* 付款单付款方式
* @author liuxueqin
* @return
* @data 2017年5月2日 下午7:08:46
*/
public static HashMap<Integer, String> PAYMENT_PAY_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PAYMENT_PAY_TYPE_INDEX.CASH_TRANSFER_INDEX, PAYMENT_PAY_TYPE_STR.CASH_TRANSFER_STR);
MAP.put(PAYMENT_PAY_TYPE_INDEX.BANK_TRANSFER_INDEX, PAYMENT_PAY_TYPE_STR.BANK_TRANSFER_STR);
return MAP;
}
//===============付款单付款方式类型 end================
//===============付款单状态 begin================
public interface PAYMENT_STATE_INDEX{
public Integer AUDIT_INDEX = 0;
public Integer PENDING_PAYMENT_INDEX = 1;
public Integer PAID_INDEX = 2;
}
public interface PAYMENT_STATE_STR{
public String AUDIT_STR = "待审核";
public String PENDING_PAYMENT_STR = "待付款";
public String PAID_STR = "已付款";
}
/**
* 付款单状态
* @author liuxueqin
* @return
* @data 2017年5月2日 下午7:17:03
*/
public static HashMap<Integer, String> PAYMENT_STATE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(PAYMENT_STATE_INDEX.AUDIT_INDEX, PAYMENT_STATE_STR.AUDIT_STR);
MAP.put(PAYMENT_STATE_INDEX.PENDING_PAYMENT_INDEX, PAYMENT_STATE_STR.PENDING_PAYMENT_STR);
MAP.put(PAYMENT_STATE_INDEX.PAID_INDEX, PAYMENT_STATE_STR.PAID_STR);
return MAP;
}
//===============付款单状态 end================
//===============入库类型 begin================
public interface STORAGE_TYPE_INDEX{
public Integer PURCHASE_STORAGE_INDEX = 0;
public Integer PRODUCTION_STORAGE_INDEX = 1;
public Integer MISCELLANEOUS_STORAGE_INDEX = 2;
public Integer BORROW_INDEX = 3;
public Integer USE_INDEX = 4;
public Integer DAMAGE_INDEX = 5;
}
public interface STORAGE_TYPE_STR{
public String PURCHASE_STORAGE_STR = "采购单入库";
public String PRODUCTION_STORAGE_STR = "生产单入库";
public String MISCELLANEOUS_STORAGE_STR = "杂项入库";
public String BORROW_STR = "借用";
public String USE_STR = "领用";
public String DAMAGE_STR = "报损/报残";
}
/**
* 入库类型
* @author liuxueqin
* @return
* @data 2017年5月2日 下午7:17:03
*/
public static HashMap<Integer, String> STORAGE_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(STORAGE_TYPE_INDEX.PURCHASE_STORAGE_INDEX, STORAGE_TYPE_STR.PURCHASE_STORAGE_STR);
MAP.put(STORAGE_TYPE_INDEX.PRODUCTION_STORAGE_INDEX, STORAGE_TYPE_STR.PRODUCTION_STORAGE_STR);
MAP.put(STORAGE_TYPE_INDEX.MISCELLANEOUS_STORAGE_INDEX, STORAGE_TYPE_STR.MISCELLANEOUS_STORAGE_STR);
MAP.put(STORAGE_TYPE_INDEX.BORROW_INDEX, STORAGE_TYPE_STR.BORROW_STR);
MAP.put(STORAGE_TYPE_INDEX.USE_INDEX, STORAGE_TYPE_STR.USE_STR);
MAP.put(STORAGE_TYPE_INDEX.DAMAGE_INDEX, STORAGE_TYPE_STR.DAMAGE_STR);
return MAP;
}
//===============入库类型 end================
//===============锁单支付类型状态 begin================
public interface LOCK_ORDER_INFO_PAY_TYPE_INDEX{
public Integer LINE = 0; //线下支付
public Integer ONLINE = 1; //在线支付
}
public interface LOCK_ORDER_INFO_PAY_TYPE_STR{
public String LINE = "线下支付";
public String ONLINE = "在线支付";
}
public static HashMap<Integer, String> LOCK_ORDER_INFO_PAY_TYPE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(LOCK_ORDER_INFO_PAY_TYPE_INDEX.LINE, LOCK_ORDER_INFO_PAY_TYPE_STR.LINE);
MAP.put(LOCK_ORDER_INFO_PAY_TYPE_INDEX.ONLINE, LOCK_ORDER_INFO_PAY_TYPE_STR.ONLINE);
return MAP;
}
//===============锁单订单状态 end================
//===============锁单支付平台状态 begin================
public interface LOCK_ORDER_INFO_PAYMENT_INDEX{
public Integer NONE = 0; //-
public Integer ALI = 1; //支付宝
public Integer WEIXIN = 2; //微信
public Integer SCORE = 3; //积分
}
public interface LOCK_ORDER_INFO_PAYMENT_STR{
public String NONE = "-";
public String ALI = "支付宝";
public String WEIXIN = "微信";
public String SCORE = "积分";
}
public static HashMap<Integer, String> LOCK_ORDER_INFO_PAYMENT_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(LOCK_ORDER_INFO_PAYMENT_INDEX.NONE, LOCK_ORDER_INFO_PAYMENT_STR.NONE);
MAP.put(LOCK_ORDER_INFO_PAYMENT_INDEX.ALI, LOCK_ORDER_INFO_PAYMENT_STR.ALI);
MAP.put(LOCK_ORDER_INFO_PAYMENT_INDEX.WEIXIN, LOCK_ORDER_INFO_PAYMENT_STR.WEIXIN);
MAP.put(LOCK_ORDER_INFO_PAYMENT_INDEX.SCORE, LOCK_ORDER_INFO_PAYMENT_STR.SCORE);
return MAP;
}
//===============锁单平台状态 end================
//===============锁单订单状态 begin================
public interface LOCK_ORDER_INFO_STATE_INDEX{
public Integer NO_EXAMINE = -2; //未通过审核
public Integer CLOSE = -1; //已关闭
public Integer WAIT_PAY = 0; //待付款
public Integer WAIT_EXAMINE = 1; //待审核
public Integer NO_ALLOT = 2;// 待分配
public Integer SUCCESS = 3;// 已完成
}
public interface LOCK_ORDER_INFO_STATE_STR{
public String NO_EXAMINE = "未通过审核";
public String CLOSE = "已关闭";
public String WAIT_PAY = "待付款";
public String WAIT_EXAMINE = "待审核";
public String NO_ALLOT = " 待分配";
public String SUCCESS = " 已完成";
}
public static HashMap<Integer, String> LOCK_ORDER_INFO_STATE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(LOCK_ORDER_INFO_STATE_INDEX.NO_EXAMINE, LOCK_ORDER_INFO_STATE_STR.NO_EXAMINE);
MAP.put(LOCK_ORDER_INFO_STATE_INDEX.CLOSE, LOCK_ORDER_INFO_STATE_STR.CLOSE);
MAP.put(LOCK_ORDER_INFO_STATE_INDEX.WAIT_PAY, LOCK_ORDER_INFO_STATE_STR.WAIT_PAY);
MAP.put(LOCK_ORDER_INFO_STATE_INDEX.WAIT_EXAMINE, LOCK_ORDER_INFO_STATE_STR.WAIT_EXAMINE);
MAP.put(LOCK_ORDER_INFO_STATE_INDEX.NO_ALLOT, LOCK_ORDER_INFO_STATE_STR.NO_ALLOT);
MAP.put(LOCK_ORDER_INFO_STATE_INDEX.SUCCESS, LOCK_ORDER_INFO_STATE_STR.SUCCESS);
return MAP;
}
//===============锁单订单状态 end================
//===============锁单详情状态 begin================
public interface LOCK_ORDER_ITEM_STATE_INDEX{
public Integer NO_ALLOT = 0; //未分配
public Integer ALLOTING = 1; //部分分配
public Integer ALLOTED = 2;// 已分配
}
public interface LOCK_ORDER_ITEM_STATE_STR{
public String NO_ALLOT = "未分配";
public String ALLOTING = "部分分配";
public String ALLOTED = "已分配";
}
public static HashMap<Integer, String> LOCK_ORDER_ITEM_STATE_MAP(){
HashMap<Integer, String> MAP = new HashMap<Integer, String>();
MAP.put(LOCK_ORDER_ITEM_STATE_INDEX.NO_ALLOT, LOCK_ORDER_ITEM_STATE_STR.NO_ALLOT);
MAP.put(LOCK_ORDER_ITEM_STATE_INDEX.ALLOTING, LOCK_ORDER_ITEM_STATE_STR.ALLOTING);
MAP.put(LOCK_ORDER_ITEM_STATE_INDEX.ALLOTED, LOCK_ORDER_ITEM_STATE_STR.ALLOTED);
return MAP;
}
//===============锁单详情状态 end================
//===============推广商类型 begin================
public interface DRP_TREE_ID{
public final static Integer COMPANY = 0;
public final static Integer PERSON = 1;
public final static Integer INNER = 0;
public final static Integer OUTER = 1;
}
//===============推广商类型 end================
//===============认捐单过期天,单begin================
public interface LOCKING{
public final static Integer DAYNUMBER = 30;
public final static Integer SINGLENUMBER = 3;
}
//===============认捐单过期天,单 end================
//===============邮箱begin================
public interface EMAIL_163{
public static final String SERVER_HOST = "smtp.163.com";
public static final String SERVER_PORT = "465";
public static final boolean VALIDATE = true;
// 实际发送者
public static final String USER_NAME = "tbb_power@163.com";
//密码
public static final String PASSWORD = "tbbPower2017";
//设置发送人邮箱地址
public static final String FROM_ADDRESS = "tbb_power@163.com";
//主题
public static final String EMAIL_SUBJECT = "拓宝邮件";
}
//===============邮箱End================
}
package com.atlgroupasia.servicecenter.utils;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/5/29 16:25
* @Version 1.0
*/
public class DateUtils {
public static final String formatStr_yyyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss";
public static final String formatStr_yyyyMMddHHmm = "yyyy-MM-dd HH:mm";
public static final String formatStr_yyyyMMddHH = "yyyy-MM-dd HH";
public static final String formatStr_yyyyMMdd = "yyyy-MM-dd";
public static final String formatStr_yyyy年MM月dd日HHmm = "yyyy年MM月dd日 HH:mm";
public static final String formatStr_yyyy年MM月dd日 = "yyyy年MM月dd日";
public static final String formatStr_yyyyMMddStr = "yyyyMMdd";
public static final String formatStr_MMdd_EE_HHmm = "MM/dd EEEE HH:mm";
public static final String formatStr_yyyy = "yyyy";
public static final String formatStr_HHmm = "HH:mm";
public static final String formatStr_MMdd = "MM/dd";
public static final String formatStr_dd = "dd";
public static final String formatStr_MMdd2 = "MM月dd日";
public static final String formatStr_MMddHHmm = "MM-dd HH:mm";
public static final String formatStr_yyyyMMddHHmmss1 = "yyyy/MM/dd HH:mm:ss";
public static final String formatStr_yyyyMMddHHmmss2 = "yyyyMMddHHmmss";
public static final String formatStr_yyyyMMddHHmmssSS = "yyyyMMddHHmmssSS";
public static final String formatStr_HHMMSS = "HH:mm:ss";
public static final String formatStr_MM = "MM";
public DateUtils() {
}
public static String DateToString(long timestamp, String toFormatStr) {
try {
return (new SimpleDateFormat(toFormatStr)).format(timestamp);
} catch (Exception var4) {
var4.printStackTrace();
return "";
}
}
public static String DateToString(Date date, String toFormatStr) {
try {
return (new SimpleDateFormat(toFormatStr)).format(date);
} catch (Exception var3) {
var3.printStackTrace();
return "";
}
}
public static String DateToString(java.sql.Date date, String toFormatStr) {
try {
return (new SimpleDateFormat(toFormatStr)).format(date);
} catch (Exception var3) {
var3.printStackTrace();
return "";
}
}
public static Date StringToDate(String dateString, String strFormat) {
try {
Date date = (new SimpleDateFormat(strFormat)).parse(dateString);
return date;
} catch (ParseException var3) {
var3.printStackTrace();
return null;
}
}
public static Timestamp stringToTimestamp(String dateString, String strFormat) {
return new Timestamp(StringToDate(dateString, strFormat).getTime());
}
public static Timestamp stringToTimestampAddDays(String dateString, String strFormat, int days) {
return new Timestamp(StringToDate(dateString, strFormat).getTime() + (long)(days * 1000 * 60 * 60 * 24));
}
public static java.sql.Date toSQLDate(Date date) {
return new java.sql.Date(date.getTime());
}
public static Timestamp toTimestamp(Date date) {
return new Timestamp(date.getTime());
}
public static Timestamp toTimestamp(java.sql.Date date) {
return new Timestamp(date.getTime());
}
public static Date toUtilDate(java.sql.Date date) {
return new Date(date.getTime());
}
public static String getSomeDate(int day, Date now, String format) {
try {
Calendar date = Calendar.getInstance();
date.setTime(now);
date.add(5, day);
return DateToString(date.getTime(), format);
} catch (Exception var4) {
var4.printStackTrace();
return "";
}
}
public static String getSomeDate(int day) {
try {
Calendar date = Calendar.getInstance();
date.add(5, -day);
return DateToString(date.getTime(), "yyyy-MM-dd");
} catch (Exception var2) {
var2.printStackTrace();
return "";
}
}
public static Date getDateBefore(Date date, int day) {
Calendar now = Calendar.getInstance();
now.setTime(date);
now.set(5, now.get(5) - day);
return now.getTime();
}
public static Date getDateAfter(Date date, int day) {
Calendar now = Calendar.getInstance();
now.setTime(date);
now.set(5, now.get(5) + day);
return now.getTime();
}
public static boolean compareEqualDate(Date date1, Date date2) {
try {
String c1 = DateToString(date1, "yyyy-MM-dd");
String c2 = DateToString(date2, "yyyy-MM-dd");
return c1.equals(c2);
} catch (Exception var4) {
var4.printStackTrace();
return false;
}
}
public static boolean compareDate(Date date1, Date date2) {
try {
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
c1.setTime(date1);
c2.setTime(date2);
return !c1.before(c2);
} catch (Exception var4) {
var4.printStackTrace();
return true;
}
}
public static String getMaxDate(String date1, String date2) {
Date comDate1 = StringToDate(date1, "yyyy-MM-dd");
Date comDate2 = StringToDate(date2, "yyyy-MM-dd");
return comDate1.after(comDate2) ? date1 : date2;
}
public static Date getMaxDate(Date date1, Date date2) {
return date1.after(date2) ? date1 : date2;
}
public static String getDateByYear(Date date, int year) {
try {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(1, year);
return DateToString(cal.getTime(), "yyyy-MM-dd");
} catch (Exception var3) {
var3.printStackTrace();
return "";
}
}
public static Integer getMonthSpace(String date1, String date2) throws ParseException {
Integer result = 0;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
c1.setTime(sdf.parse(date1));
c2.setTime(sdf.parse(date2));
result = c2.get(2) - c1.get(2);
return result == 0 ? 1 : Math.abs(result);
}
public static String getNowTime(String type) {
SimpleDateFormat df = new SimpleDateFormat(type);
return df.format(new Date());
}
public static String DateToStringForyyyyMMddHHmmss(Date createTime) {
return DateToString(createTime, "yyyy-MM-dd HH:mm:ss");
}
public static String DateToStringForyyyyMMdd(Date createTime) {
return DateToString(createTime, "yyyy-MM-dd");
}
public static Date getCodeTime() {
Date now = new Date();
Date codeTime = new Date(now.getTime() - 300000L);
return codeTime;
}
public static Integer daysBetween(String date1, String date2) throws ParseException {
Date smdate = StringToDate(date1, "yyyy-MM-dd");
Date bdate = StringToDate(date2, "yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
cal.setTime(smdate);
long time1 = cal.getTimeInMillis();
cal.setTime(bdate);
long time2 = cal.getTimeInMillis();
long between_days = (time2 - time1) / 86400000L;
return Integer.parseInt(String.valueOf(between_days));
}
public static List<Date> getBetweenDates(String start, String end) {
Date stateDate = StringToDate(start, "yyyy-MM-dd");
Date endDate = StringToDate(end, "yyyy-MM-dd");
List<Date> result = new ArrayList();
result.add(stateDate);
Calendar cal = Calendar.getInstance();
cal.setTime(stateDate);
boolean bContinue = true;
while(bContinue) {
cal.add(5, 1);
if (!endDate.after(cal.getTime())) {
break;
}
result.add(cal.getTime());
}
result.add(endDate);
return result;
}
public static String differTime(Date date, Date outTime) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String string = simpleDateFormat.format(date);
String OutTime = simpleDateFormat.format(outTime);
System.out.print(OutTime);
if (compareDate(outTime, date)) {
try {
long between = simpleDateFormat.parse(OutTime).getTime() - simpleDateFormat.parse(string).getTime();
long day = between / 86400000L;
long hour = between / 3600000L - day * 24L;
long minute = between / 60000L - day * 24L * 60L - hour * 60L;
long second = between / 1000L - day * 24L * 60L * 60L - hour * 60L * 60L - minute * 60L;
String hourStr = String.valueOf(hour);
String minuteStr = String.valueOf(minute);
String secondStr = String.valueOf(second);
return String.format("%02d", Integer.parseInt(hourStr)) + ":" + String.format("%02d", Integer.parseInt(minuteStr)) + ":" + String.format("%02d", Integer.parseInt(secondStr));
} catch (ParseException var18) {
var18.printStackTrace();
}
}
return null;
}
public static String getYear(Date createTime) {
return DateToString(createTime, "yyyy");
}
public static String getMonth(Date createTime) {
return DateToString(createTime, "MM");
}
public static String getDay(Date createTime) {
return DateToString(createTime, "dd");
}
public static String getHHmm(Date createTime) {
return DateToString(createTime, "HH:mm");
}
public static String getMMdd(Date createTime) {
return DateToString(createTime, "MM/dd");
}
public static String getyyyyMMdddHHmmStr(Date createTime) {
return DateToString(createTime, "yyyy年MM月dd日 HH:mm");
}
public static Date getDate(String dateStr) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd");
Date date = sdf.parse(dateStr);
return date;
}
public static Date getDate2(String dateStr) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(dateStr);
return date;
}
public static String getDateYYYYMMDD(Date date) {
return DateToString(date, "yyyyMMdd");
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.security.MessageDigest;
/**
* @author dataochen
* @Description
* @date: 2017/11/7 17:49
*/
public class HttpSendUtil {
/**
* 向指定URL发送GET方法的请求
*
* @param url
* 发送请求的URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return URL 所代表远程资源的响应结果
*/
public static String sendGet(String url, String param) {
String result = "";
BufferedReader in = null;
try {
String urlNameString = url + "?" + param;
URL realUrl = new URL(urlNameString);
// 打开和URL之间的连接
URLConnection connection = realUrl.openConnection();
// 设置通用的请求属性
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
connection.setRequestProperty("Content-Type", "text/xml");
// 建立实际的连接
connection.connect();
// 定义 BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(
connection.getInputStream() ));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("发送GET请求出现异常!" + e);
e.printStackTrace();
}
// 使用finally块来关闭输入流
finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return result;
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url
* 发送请求的 URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public static String sendPost(String url, String param) {
PrintWriter out = null;
BufferedReader in = null;
String result = "";
try {
URL realUrl = new URL(url);
// 打开和URL之间的连接
URLConnection conn = realUrl.openConnection();
// 设置通用的请求属性
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("Content-Type", "text/xml");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
// 获取URLConnection对象对应的输出流
out = new PrintWriter(conn.getOutputStream());
// 发送请求参数
out.print(param);
// flush输出流的缓冲
out.flush();
// 定义BufferedReader输入流来读取URL的响应
in = new BufferedReader(
new InputStreamReader(conn.getInputStream() ));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("发送 POST 请求出现异常!"+e);
e.printStackTrace();
}
//使用finally块来关闭输出流、输入流
finally{
try{
if(out!=null){
out.close();
}
if(in!=null){
in.close();
}
}
catch(IOException ex){
ex.printStackTrace();
}
}
return result;
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.nio.charset.Charset;
/**
* @author dataochen
* @Description
* @date: 2017/11/7 17:49
*/
@Slf4j
public class HttpUtils {
private static CloseableHttpClient httpClient;
static {
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
cm.setMaxTotal(100);
cm.setDefaultMaxPerRoute(20);
cm.setDefaultMaxPerRoute(50);
httpClient = HttpClients.custom().setConnectionManager(cm).build();
}
public static String get(String url) {
CloseableHttpResponse response = null;
BufferedReader in = null;
String result = "";
try {
HttpGet httpGet = new HttpGet(url);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(30000).setConnectionRequestTimeout(30000).setSocketTimeout(30000).build();
httpGet.setConfig(requestConfig);
httpGet.setConfig(requestConfig);
httpGet.addHeader("Content-type", "application/json; charset=utf-8");
httpGet.setHeader("Accept", "application/json");
response = httpClient.execute(httpGet);
in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer sb = new StringBuffer("");
String line = "";
String NL = System.getProperty("line.separator");
while ((line = in.readLine()) != null) {
sb.append(line + NL);
}
in.close();
result = sb.toString();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (null != response) {
response.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return result;
}
public static String post(String url, String jsonString) {
CloseableHttpResponse response = null;
BufferedReader in = null;
String result = "";
try {
HttpPost httpPost = new HttpPost(url);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(30000).setConnectionRequestTimeout(30000).setSocketTimeout(30000).build();
httpPost.setConfig(requestConfig);
httpPost.setConfig(requestConfig);
httpPost.addHeader("Content-type", "application/json; charset=utf-8");
httpPost.setHeader("Accept", "application/json");
httpPost.setEntity(new StringEntity(jsonString, Charset.forName("UTF-8")));
response = httpClient.execute(httpPost);
in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer sb = new StringBuffer("");
String line = "";
String NL = System.getProperty("line.separator");
while ((line = in.readLine()) != null) {
sb.append(line + NL);
}
in.close();
result = sb.toString();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (null != response) {
response.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return result;
}
public static String parse(HttpServletRequest request) {
BufferedReader buf = null;
try {
buf = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
StringBuilder sb = new StringBuilder();
String line = null;
while (null != (line = buf.readLine())) {
sb.append(line);
}
if (sb.length() > 0) {
return sb.toString();
}
} catch (Exception e) {
log.error("weimob parse request error!", e);
return null;
} finally {
try {
buf.close();
} catch (Exception e) {
log.error("weimob parse request error!", e);
}
}
return null;
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
import com.atlgroupasia.servicecenter.common.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
/**
* JsonResult
* @author whj
* @date 2018/7/29 22:19
*/
@Data
@ApiModel
public class JsonResult {
@ApiModelProperty(name = "success", value = "是否正常通讯")
private Boolean success = Boolean.TRUE;
@ApiModelProperty(name = "status", value = "状态码,200:OK,401:未登录,500:错误")
private String status;
@ApiModelProperty(name = "message", value = "消息描述")
private String message;
@ApiModelProperty(name = "data", value = "返回数据")
private Object data;
public static JsonResult success() {
JsonResult res = new JsonResult();
res.setMessage("成功");
res.setStatus(Constants.RESPONSE_STATUS_200);
return res;
}
public static JsonResult success(String msg) {
JsonResult res = new JsonResult();
res.setMessage(msg);
res.setStatus(Constants.RESPONSE_STATUS_200);
return res;
}
public static JsonResult success(String msg, Object data) {
JsonResult res = new JsonResult();
res.setMessage(msg);
res.setStatus(Constants.RESPONSE_STATUS_200);
res.setData(data);
return res;
}
public static JsonResult failed() {
JsonResult res = new JsonResult();
res.setMessage("失败");
res.setStatus(Constants.RESPONSE_STATUS_500);
return res;
}
public static JsonResult failed(String msg) {
JsonResult res = new JsonResult();
res.setMessage(msg);
res.setStatus(Constants.RESPONSE_STATUS_500);
return res;
}
public static JsonResult notLogin() {
JsonResult res = new JsonResult();
res.setMessage("请登录");
res.setStatus(Constants.RESPONSE_STATUS_401);
return res;
}
}
package com.atlgroupasia.servicecenter.utils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
public class Lunar {
final private static long[] lunarInfo = new long[] { 0x04bd8, 0x04ae0,
0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0,
0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540,
0x0d6a0, 0x0ada2, 0x095b0, 0x14977, 0x04970, 0x0a4b0, 0x0b4b5,
0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970,
0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3,
0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0,
0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0,
0x0b550, 0x15355, 0x04da0, 0x0a5d0, 0x14573, 0x052d0, 0x0a9a8,
0x0e950, 0x06aa0, 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570,
0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, 0x096d0, 0x04dd5,
0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b5a0,
0x195a6, 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50,
0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5, 0x04970, 0x064b0,
0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0,
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7,
0x025d0, 0x092d0, 0x0cab5, 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50,
0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, 0x07954,
0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260,
0x0ea65, 0x0d530, 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0,
0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0, 0x056d0,
0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20,
0x0ada0 };
final private static int[] year20 = new int[] { 1, 4, 1, 2, 1, 2, 1, 1, 2,
1, 2, 1 };
final private static int[] year19 = new int[] { 0, 3, 0, 1, 0, 1, 0, 0, 1,
0, 1, 0 };
final private static int[] year2000 = new int[] { 0, 3, 1, 2, 1, 2, 1, 1,
2, 1, 2, 1 };
public final static String[] nStr1 = new String[] { "", "正", "二", "三", "四",
"五", "六", "七", "八", "九", "十", "冬月", "腊月" };
private final static String[] Gan = new String[] { "甲", "乙", "丙", "丁", "戊",
"己", "庚", "辛", "壬", "癸" };
private final static String[] Zhi = new String[] { "子", "丑", "寅", "卯", "辰",
"巳", "午", "未", "申", "酉", "戌", "亥" };
private final static String[] Animals = new String[] { "鼠", "牛", "虎", "兔",
"龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪" };
private final static String[] solarTerm = new String[] { "小寒", "大寒", "立春",
"雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑",
"立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至" };
private final static String[] sFtv = new String[] { "0101*元旦", "0214 情人节",
"0308 妇女节", "0312 植树节", "0315 消费者权益日", "0401 愚人节", "0501 劳动节",
"0504 青年节", "0512 护士节", "0601 儿童节", "0701 建党节", "0801 建军节",
"0808 父亲节", "0909 mzd逝世纪念", "0910 教师节", "0928 孔子诞辰", "1001*国庆节",
"1006 老人节", "1024 联合国日", "1112 孙中山诞辰", "1220 澳门回归", "1225 圣诞节",
"1226 mzd诞辰" };
private final static String[] lFtv = new String[] { "0101*农历春节",
"0115 元宵节", "0505 端午节", "0707 七夕情人节", "0815 中秋节", "0909 重阳节",
"1208 腊八节", "1224 小年", "0100*除夕" };
/**
* 传回农历 y年的总天数
*
* @param y
* @return
*/
final private static int lYearDays(int y) {
int i, sum = 348;
for (i = 0x8000; i > 0x8; i >>= 1) {
if ((lunarInfo[y - 1900] & i) != 0)
sum += 1;
}
return (sum + leapDays(y));
}
/**
* 传回农历 y年闰月的天数
*
* @param y
* @return
*/
final private static int leapDays(int y) {
if (leapMonth(y) != 0) {
if ((lunarInfo[y - 1900] & 0x10000) != 0)
return 30;
else
return 29;
} else
return 0;
}
/**
* 传回农历 y年闰哪个月 1-12 , 没闰传回 0
*
* @param y
* @return
*/
final private static int leapMonth(int y) {
return (int) (lunarInfo[y - 1900] & 0xf);
}
/**
* 传回农历 y年m月的总天数
*
* @param y
* @param m
* @return
*/
final private static int monthDays(int y, int m) {
if ((lunarInfo[y - 1900] & (0x10000 >> m)) == 0)
return 29;
else
return 30;
}
/**
* 传回农历 y年的生肖
*
* @param y
* @return
*/
final public static String AnimalsYear(int y) {
return Animals[(y - 4) % 12];
}
/**
* 传入 月日的offset 传回干支,0=甲子
*
* @param num
* @return
*/
final private static String cyclicalm(int num) {
return (Gan[num % 10] + Zhi[num % 12]);
}
/**
* 传入 offset 传回干支, 0=甲子
*
* @param y
* @return
*/
final public static String cyclical(int y) {
int num = y - 1900 + 36;
return (cyclicalm(num));
}
/**
* 传出农历.year0 .month1 .day2 .yearCyl3 .monCyl4 .dayCyl5 .isLeap6
*
* @param y
* @param m
* @return
*/
final private long[] Lunar(int y, int m) {
long[] nongDate = new long[7];
int i = 0, temp = 0, leap = 0;
Date baseDate = new GregorianCalendar(1900 + 1900, 1, 31).getTime();
Date objDate = new GregorianCalendar(y + 1900, m, 1).getTime();
long offset = (objDate.getTime() - baseDate.getTime()) / 86400000L;
if (y < 2000)
offset += year19[m - 1];
if (y > 2000)
offset += year20[m - 1];
if (y == 2000)
offset += year2000[m - 1];
nongDate[5] = offset + 40;
nongDate[4] = 14;
for (i = 1900; i < 2050 && offset > 0; i++) {
temp = lYearDays(i);
offset -= temp;
nongDate[4] += 12;
}
if (offset < 0) {
offset += temp;
i--;
nongDate[4] -= 12;
}
nongDate[0] = i;
nongDate[3] = i - 1864;
leap = leapMonth(i); // 闰哪个月
nongDate[6] = 0;
for (i = 1; i < 13 && offset > 0; i++) {
// 闰月
if (leap > 0 && i == (leap + 1) && nongDate[6] == 0) {
--i;
nongDate[6] = 1;
temp = leapDays((int) nongDate[0]);
} else {
temp = monthDays((int) nongDate[0], i);
}
// 解除闰月
if (nongDate[6] == 1 && i == (leap + 1))
nongDate[6] = 0;
offset -= temp;
if (nongDate[6] == 0)
nongDate[4]++;
}
if (offset == 0 && leap > 0 && i == leap + 1) {
if (nongDate[6] == 1) {
nongDate[6] = 0;
} else {
nongDate[6] = 1;
--i;
--nongDate[4];
}
}
if (offset < 0) {
offset += temp;
--i;
--nongDate[4];
}
nongDate[1] = i;
nongDate[2] = offset + 1;
return nongDate;
}
/**
* 传出y年m月d日对应的农历.year0 .month1 .day2 .yearCyl3 .monCyl4 .dayCyl5 .isLeap6
*
* @param y
* @param m
* @param d
* @return
*/
final public static long[] calElement(int y, int m, int d) {
long[] nongDate = new long[7];
int i = 0, temp = 0, leap = 0;
Date baseDate = new GregorianCalendar(0 + 1900, 0, 31).getTime();
Date objDate = new GregorianCalendar(y, m - 1, d).getTime();
long offset = (objDate.getTime() - baseDate.getTime()) / 86400000L;
nongDate[5] = offset + 40;
nongDate[4] = 14;
for (i = 1900; i < 2050 && offset > 0; i++) {
temp = lYearDays(i);
offset -= temp;
nongDate[4] += 12;
}
if (offset < 0) {
offset += temp;
i--;
nongDate[4] -= 12;
}
nongDate[0] = i;
nongDate[3] = i - 1864;
leap = leapMonth(i); // 闰哪个月
nongDate[6] = 0;
for (i = 1; i < 13 && offset > 0; i++) {
// 闰月
if (leap > 0 && i == (leap + 1) && nongDate[6] == 0) {
--i;
nongDate[6] = 1;
temp = leapDays((int) nongDate[0]);
} else {
temp = monthDays((int) nongDate[0], i);
}
// 解除闰月
if (nongDate[6] == 1 && i == (leap + 1))
nongDate[6] = 0;
offset -= temp;
if (nongDate[6] == 0)
nongDate[4]++;
}
if (offset == 0 && leap > 0 && i == leap + 1) {
if (nongDate[6] == 1) {
nongDate[6] = 0;
} else {
nongDate[6] = 1;
--i;
--nongDate[4];
}
}
if (offset < 0) {
offset += temp;
--i;
--nongDate[4];
}
nongDate[1] = i;
nongDate[2] = offset + 1;
return nongDate;
}
public final static String getChinaDate(int day) {
String a = "";
if (day == 10)
return "初十";
if (day == 20)
return "二十";
if (day == 30)
return "三十";
int two = (int) ((day) / 10);
if (two == 0)
a = "初";
if (two == 1)
a = "十";
if (two == 2)
a = "廿";
if (two == 3)
a = "三";
int one = (int) (day % 10);
switch (one) {
case 1:
a += "一";
break;
case 2:
a += "二";
break;
case 3:
a += "三";
break;
case 4:
a += "四";
break;
case 5:
a += "五";
break;
case 6:
a += "六";
break;
case 7:
a += "七";
break;
case 8:
a += "八";
break;
case 9:
a += "九";
break;
}
return a;
}
public final static String getMonth(int month) {
String a = "";
switch (month) {
case 1:
a = "正月";
break;
case 2:
a = "二月";
break;
case 3:
a = "三月";
break;
case 4:
a = "四月";
break;
case 5:
a = "五月";
break;
case 6:
a = "六月";
break;
case 7:
a = "七月";
break;
case 8:
a = "八月";
break;
case 9:
a = "九月";
break;
case 10:
a = "十月";
break;
case 11:
a = "冬月";
break;
case 12:
a = "腊月";
break;
}
return a;
}
public static String today() {
Calendar today = Calendar.getInstance(Locale.SIMPLIFIED_CHINESE);
int year = today.get(Calendar.YEAR);
int month = today.get(Calendar.MONTH) + 1;
int date = today.get(Calendar.DATE);
long[] l = calElement(year, month, date);
StringBuffer sToday = new StringBuffer();
try {
sToday.append(sdf.format(today.getTime()));
sToday.append(" 农历");
sToday.append(cyclical(year));
sToday.append('(');
sToday.append(AnimalsYear(year));
sToday.append(")年");
sToday.append(nStr1[(int) l[1]]);
sToday.append("月");
sToday.append(getChinaDate((int) (l[2])));
return sToday.toString();
} finally {
sToday = null;
}
}
public static String oneDay(int year,int month,int day) {
/*long[] l = calElement(year, month, day);
StringBuffer sToday = new StringBuffer();
try {
sToday.append(cyclical(year));
sToday.append("年");
sToday.append(year);
sToday.append(" ");
sToday.append(nStr1[(int) l[1]]);
sToday.append("月");
sToday.append(" ");
sToday.append(getChinaDate((int) (l[2])));
return sToday.toString();
} finally {
sToday = null;
}*/
String sToday = cyclical(year)+"年("+year+") "+getMonth(month)+getChinaDate(day);
return sToday;
}
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy年M月d日 EEEEE");
/**
* 农历日历工具使用演示
*
* @param args
*/
public static void main(String[] args) {
Integer year = 2019;
Integer month = 10;
Integer day = 23;
System.out.println(cyclical(year));
System.out.println(getMonth(month));
System.out.println(getChinaDate(day));
}
}
package com.atlgroupasia.servicecenter.utils;
import java.security.MessageDigest;
/**
* @author dataochen
* @Description
* @date: 2017/11/7 17:49
*/
public class Md5Utils {
public static final String parseMD5(String s) {
if (s == null) {
return null;
} else {
char[] hexDigits = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
try {
byte[] strTemp = s.getBytes();
MessageDigest mdTemp = MessageDigest.getInstance("MD5");
mdTemp.update(strTemp);
byte[] md = mdTemp.digest();
int j = md.length;
char[] str = new char[j * 2];
int k = 0;
for(int i = 0; i < j; ++i) {
byte byte0 = md[i];
str[k++] = hexDigits[byte0 >>> 4 & 15];
str[k++] = hexDigits[byte0 & 15];
}
return new String(str);
} catch (Exception var10) {
return null;
}
}
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/9 21:59
* @Version 1.0
*/
public class MomoUtils {
/**
* 手机正则表达式
* @param phone
* @return
*/
public static Boolean phone (String phone){
String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phone);
boolean isMatch = m.matches();
return isMatch;
}
}
package com.atlgroupasia.servicecenter.utils;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.common.utils.BinaryUtil;
import com.aliyun.oss.model.*;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import net.sf.json.JSONObject;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URL;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @Name:阿里云相关工具类
* @Author: Lijc
* @Date: 2019/5/26 13:38
* @Version 1.0
*/
public class OpenIdUtil {
/**
* 获取微信用户信息
* @param code 微信端的CODE
* @return
*/
public static String oauth2GetOpenid(String code) throws Exception{
WXConfigUtil config = new WXConfigUtil();
String appid = config.getAppID();
String appsecret = config.getAppSecret();
//授权(必填)
String grant_type = "authorization_code";
//URL
String requestUrl = "https://api.weixin.qq.com/sns/oauth2/access_token";
//请求参数
String params = "appid=" + appid + "&secret=" + appsecret + "&code=" + code + "&grant_type=" + grant_type;
//发送请求
String data = HttpSendUtil.sendGet(requestUrl, params);
//解析相应内容(转换成json对象)
JSONObject json = JSONObject.fromObject(data);
//用户的唯一标识(openid)
String openId = String.valueOf(json.get("openid"));
return openId;
}
}
package com.atlgroupasia.servicecenter.utils;
import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.ObjectMetadata;
import com.aliyun.oss.model.PutObjectResult;
import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;
public class OssUtil {
public static final Boolean Debug = Constant.helper.getBoolean("oss_debug");
public static final String ALIYUN_KEY = Debug? "LTAIQiZSXr0FGu8Y" :"LTAIQiZSXr0FGu8Y";
//public static final String ALIYUN_KEY = Debug? "ssjxDg6TcZeoowWn" : "ssjxDg6TcZeoowWn";
public static final String ALIYUN_SECRET= Debug ? "31MplnqH0g5Pa3b2Dc9p2rSS0Pkcnf":"31MplnqH0g5Pa3b2Dc9p2rSS0Pkcnf";
//public static final String ALIYUN_SECRET= Debug ? "AzZATQTtpJw2O1o2k470wmokyLpOHS":"AzZATQTtpJw2O1o2k470wmokyLpOHS";
public static final String END_POINT = Debug?"http://oss-cn-hangzhou.aliyuncs.com":"http://oss-cn-hangzhou.aliyuncs.com";
//public static final String END_POINT = Debug? "http://oss-cn-beijing.aliyuncs.com":"http://oss-cn-beijing.aliyuncs.com";
public static final String BUCKET = Debug ? "atlimg":"atlimg";
//public static final String BUCKET = Debug ? "zhishan-test":"zhishan-";
public static final String IMG_FOLDER = Debug ? "lmerp/images/" : "lmerp/images/";
//public static final String IMG_FOLDER = Debug ? "kjerp/images/" : "lmerp/images/";
// public static final String IMG_FOLDER1 = Debug ? "kjerp/images/" : "assets/ATL_IMG/";
public static final String FILE_FOLDER = Debug ? "lmerp/file/" : "lmerp/file/";
//public static final String FILE_FOLDER = Debug ? "kjerp/file/" : "lmerp/file/";
//图片路径根据设置的 folder 取图片 -- zhangjunhaoThe specified bucket does not exist.
public static final String FILE_ACCESS_URL = Debug ? "http://alioss.atlimg.com/lmerp/file" : "http://alioss.atlimg.com/lmerp/file";
//public static final String FILE_ACCESS_URL = Debug ? "http://file.test.zhishangsoft.com/kjerp/file" : "http://file.zhishangsoft.com/lmerp/file";
public static final String IMG_ACCESS_URL = Debug ? "http://alioss.atlimg.com/lmerp/images" : "http://alioss.atlimg.com/lmerp/images";
//public static final String IMG_ACCESS_URL = Debug ? "http://img.test.zhishangsoft.com/kjerp/images" : "http://img.zhishangsoft.com/lmerp/images";
// public static final String IMG_ACCESS_URL1 = Debug ? "http://img.test.zhishangsoft.com/kjerp/images" : "http://sd.antaile.net/assets/ATL_IMG";
public static final String STATIC_IMG_URL = Debug ? "http://alioss.atlimg.com/lmerp/images" : "http://alioss.atlimg.com/lmerp/images";
//public static final String STATIC_IMG_URL = Debug ? "http://img.test.zhishangsoft.com/kjerp/images" : "http://img.zhishangsoft.com/lmerp/images";
//@100w_100h_1e_1c 自动剪裁 @felix
//@100-1ci 内切圆
//@100w_100h_1e_1c_10-2ci 圆角矩形
public static final OSSClient client = new OSSClient(END_POINT, ALIYUN_KEY, ALIYUN_SECRET);
/**
* 上传文件
*
* @author felix @date 2015-4-16 下午5:56:38
* @param file
* @param saveName
* @return
* @throws OSSException
* @throws ClientException
* @throws IOException
*/
public static String uploadFile(MultipartFile file, String saveName) throws OSSException, ClientException, IOException{
saveName = IMG_FOLDER+saveName;
ObjectMetadata meta = new ObjectMetadata();
meta.setContentLength(file.getSize());
// OSSClient client = new OSSClient(END_POINT, ALIYUN_KEY, ALIYUN_SECRET);
PutObjectResult result = client.putObject(BUCKET, saveName, file.getInputStream(), meta);
return result.getETag();
}
//
// public static String uploadFile1(MultipartFile file,String saveName) throws OSSException, ClientException, IOException{
// saveName = IMG_FOLDER1+saveName;
// ObjectMetadata meta = new ObjectMetadata();
// meta.setContentLength(file.getSize());
//// OSSClient client = new OSSClient(END_POINT, ALIYUN_KEY, ALIYUN_SECRET);
// PutObjectResult result = client.putObject(BUCKET, saveName, file.getInputStream(), meta);
// return result.getETag();
// }
/**
* 本地文件上传
*
* @author felix @date 2015-4-16 下午5:54:26
* @throws OSSException
* @throws ClientException
* @throws FileNotFoundException
*/
public static void uploadFile() throws OSSException, ClientException, FileNotFoundException{
File file = new File("D:\\aaa.jpg");
ObjectMetadata meta = new ObjectMetadata();
meta.setContentLength(file.length());
// OSSClient client = new OSSClient(END_POINT, ALIYUN_KEY, ALIYUN_SECRET);
PutObjectResult result = client.putObject(BUCKET, new Date().getTime()+"", new FileInputStream(file), meta);
System.out.println(result.getETag());
}
/**
* 上传文件
*
* @author felix @date 2015-4-16 下午5:56:38
* @param file
* @param saveName
* @return
* @throws OSSException
* @throws ClientException
* @throws IOException
*/
public static String uploadFile(File file,String saveName,boolean isImg) throws OSSException, ClientException, IOException{
System.out.println("the save name is " + saveName);
ObjectMetadata meta = new ObjectMetadata();
meta.setContentLength(file.length());
// OSSClient client = new OSSClient(END_POINT, ALIYUN_KEY, ALIYUN_SECRET);
PutObjectResult result = client.putObject(BUCKET, (isImg ? IMG_FOLDER : FILE_FOLDER)+saveName, new FileInputStream(file), meta);
return result.getETag();
}
/**
* 将bufferedImage图片上传到阿里云
* @author ZYP 2016-11-9
* @param bf 图片流
* @return
* @throws IOException
*
*/
public static String saveQrCodeImg(BufferedImage bf) throws IOException{
//创建储存图片二进制流的输出流
ByteArrayOutputStream bs = new ByteArrayOutputStream();
//将bufferedImage写进输出流里,格式为png
ImageIO.write(bf, "png", bs);
//将二进制数据写进ByteArrayOutputStream
InputStream is = new ByteArrayInputStream(bs.toByteArray());
//上传到阿里云
String saveName = java.util.UUID.randomUUID().toString()+".png";
ObjectMetadata meta = new ObjectMetadata();
client.putObject(BUCKET, IMG_FOLDER+saveName, is, meta);
return saveName;
}
/**
* 上传文件
*
* @author felix @date 2015-4-16 下午5:56:38
* @param file
* @param saveName
* @return
* @throws OSSException
* @throws ClientException
* @throws IOException
*/
public static String uploadFile(MultipartFile file, String saveName, boolean isImg) throws OSSException, ClientException, IOException{
ObjectMetadata meta = new ObjectMetadata();
meta.setContentLength(file.getSize());
PutObjectResult result = client.putObject(BUCKET, (isImg ? IMG_FOLDER : FILE_FOLDER)+saveName, file.getInputStream(), meta);
return result.getETag();
}
/**
* 上传文件
*
* @author linweiqin @date 2015-4-16 下午5:56:38
* @param file
* @param saveName
* @return
* @throws OSSException
* @throws ClientException
* @throws IOException
*/
public static String uploadFile(URL urlObj,String saveName) throws OSSException, ClientException, IOException{
saveName = IMG_FOLDER + saveName;
ObjectMetadata meta = new ObjectMetadata();
meta.setContentLength(urlObj.openStream().available());
PutObjectResult result = client.putObject(BUCKET, saveName, urlObj.openStream(), meta);
return result.getETag();
}
public static void main(String[] args) throws OSSException, ClientException, MalformedURLException, IOException {
String url = "http://wx.qlogo.cn/mmopen/kYrW27Xk2HB31Ve9wCKlxDDJzTp6ONFVtL338V38jRqGZ5h4oibkfIbnPVGHIGPuYR5ibalLt7W0hIQicJiaeTkpjSiaQIllYZCQ6/0";
String saveName= java.util.UUID.randomUUID().toString();
OssUtil.uploadFile(new URL(url), saveName);
System.out.println("121");
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
import java.io.File;
import java.io.FileReader;
import java.io.InputStream;
import java.util.Properties;
public class PropertiesHelper {
private Properties properties;
public PropertiesHelper(String fileName) {
try {
this.properties = new Properties();
InputStream in = this.getClass().getClassLoader().getResourceAsStream(fileName);
this.properties.load(in);
in.close();
} catch (Exception var3) {
var3.printStackTrace();
}
}
public PropertiesHelper(String path, String fileName) throws Exception {
File file = new File(path + fileName);
this.properties = new Properties();
FileReader reader = new FileReader(file);
this.properties.load(reader);
reader.close();
}
public PropertiesHelper(Properties properties) {
this.properties = properties;
}
public boolean contains(Object key) {
return this.properties.containsKey(key);
}
public <V> V get(PropertiesHelper.Converter<V> converter, String key) {
String value = this.properties.getProperty(key);
if (value == null) {
throw new IllegalArgumentException(key + " is missing.");
} else {
return converter.convert(value.trim());
}
}
public <V> V get(PropertiesHelper.Converter<V> converter, String key, String defaultValue) {
return !this.properties.containsKey(key) ? converter.convert(defaultValue) : converter.convert(this.properties.getProperty(key).trim());
}
public boolean getBoolean(String key) {
String value = this.properties.getProperty(key);
if (value == null) {
throw new IllegalArgumentException(key + " is missing.");
} else {
return Boolean.parseBoolean(value.trim());
}
}
public boolean getBoolean(String key, boolean defaultValue) {
return !this.properties.containsKey(key) ? defaultValue : Boolean.parseBoolean(this.properties.getProperty(key).trim());
}
public int getInt(String key) {
String value = this.properties.getProperty(key);
if (value == null) {
throw new IllegalArgumentException(key + " is missing.");
} else {
return Integer.parseInt(value.trim());
}
}
public int getInt(String key, int defaultValue) {
return !this.properties.containsKey(key) ? defaultValue : Integer.parseInt(this.properties.getProperty(key).trim());
}
public long getLong(String key) {
String value = this.properties.getProperty(key);
if (value == null) {
throw new IllegalArgumentException(key + " is missing.");
} else {
return Long.parseLong(value.trim());
}
}
public long getLong(String key, long defaultValue) {
return !this.properties.containsKey(key) ? defaultValue : Long.parseLong(this.properties.getProperty(key).trim());
}
public String getString(String key) {
String value = this.properties.getProperty(key);
if (value != null && value.length() != 0) {
return value.trim();
} else {
throw new IllegalArgumentException(key + " is missing.");
}
}
public String getString(String key, String defaultValue) {
return this.properties.getProperty(key, defaultValue).trim();
}
public String getCHString(String key) {
String value = this.properties.getProperty(key);
if (value != null && value.length() != 0) {
return value.trim().split(",")[0];
} else {
throw new IllegalArgumentException(key + " is missing.");
}
}
public String getENString(String key) {
String value = this.properties.getProperty(key);
if (value != null && value.length() != 0) {
return value.trim().split(",")[1];
} else {
throw new IllegalArgumentException(key + " is missing.");
}
}
public interface Converter<V> {
V convert(String var1);
}
}
package com.atlgroupasia.servicecenter.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.stereotype.Component;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
* @Name: Redis工具类
* @Author: Lijc
* @Date: 2019/4/8 16:05
* @Version 1.0
*/
@SuppressWarnings("unchecked")
@Component
public class RedisUtil {
private final static Logger logger = LoggerFactory.getLogger(RedisUtil.class);
@SuppressWarnings("rawtypes")
@Autowired
private RedisTemplate redisTemplate;
/**
* 写入缓存
* @param key
* @param value
* @return
*/
public boolean set(final String key, Object value) {
boolean result = false;
try {
ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
operations.set(key, value);
result = true;
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
/**
* 写入缓存设置时效时间
* @param key
* @param value
* @return
*/
public boolean set(final String key, Object value, Long expireTime) {
boolean result = false;
try {
ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
operations.set(key, value);
redisTemplate.expire(key, expireTime, TimeUnit.SECONDS);
result = true;
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
/**
* 批量删除对应的value
* @param keys
*/
public void remove(final String... keys) {
for (String key : keys) {
remove(key);
}
}
/**
* 批量删除key
* @param pattern
*/
public void removePattern(final String pattern) {
Set<Serializable> keys = redisTemplate.keys(pattern);
if (keys.size() > 0)
redisTemplate.delete(keys);
}
/**
* 删除对应的value
* @param key
*/
public void remove(final String key) {
if (exists(key)) {
redisTemplate.delete(key);
}
}
/**
* 判断缓存中是否有对应的value
* @param key
* @return
*/
public boolean exists(final String key) {
return redisTemplate.hasKey(key);
}
/**
* 读取缓存
* @param key
* @return
*/
public Object get(final String key) {
Object result = null;
ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
result = operations.get(key);
return result;
}
/**
* 哈希 添加
* @param key
* @param hashKey
* @param value
*/
public void hmSet(String key, Object hashKey, Object value){
HashOperations<String, Object, Object> hash = redisTemplate.opsForHash();
hash.put(key,hashKey,value);
}
/**
* 哈希获取数据
* @param key
* @param hashKey
* @return
*/
public Object hmGet(String key, Object hashKey){
HashOperations<String, Object, Object> hash = redisTemplate.opsForHash();
return hash.get(key,hashKey);
}
/**
* 列表添加
* @param k
* @param v
*/
public void lPush(String k,Object v){
ListOperations<String, Object> list = redisTemplate.opsForList();
list.rightPush(k,v);
}
/**
* 列表获取
* @param k
* @param l
* @param l1
* @return
*/
public List<Object> lRange(String k, long l, long l1){
ListOperations<String, Object> list = redisTemplate.opsForList();
return list.range(k,l,l1);
}
/**
* 集合添加
* @param key
* @param value
*/
public void add(String key,Object value){
SetOperations<String, Object> set = redisTemplate.opsForSet();
set.add(key,value);
}
/**
* 集合获取
* @param key
* @return
*/
public Set<Object> setMembers(String key){
SetOperations<String, Object> set = redisTemplate.opsForSet();
return set.members(key);
}
/**
* 有序集合添加
* @param key
* @param value
* @param scoure
*/
public void zAdd(String key,Object value,double scoure){
ZSetOperations<String, Object> zset = redisTemplate.opsForZSet();
zset.add(key,value,scoure);
}
/**
* 有序集合获取
* @param key
* @param scoure
* @param scoure1
* @return
*/
public Set<Object> rangeByScore(String key,double scoure,double scoure1){
ZSetOperations<String, Object> zset = redisTemplate.opsForZSet();
return zset.rangeByScore(key, scoure, scoure1);
}
/**
* 缓存List数据
* @param key 缓存的键值
* @param dataList 待缓存的List数据
* @return 缓存的对象
*/
public <T> ListOperations<String, T> setCacheList(String key,List<T> dataList)
{
ListOperations listOperation = redisTemplate.opsForList();
if(null != dataList)
{
int size = dataList.size();
for(int i = 0; i < size ; i ++)
{
listOperation.rightPush(key,dataList.get(i));
}
}
return listOperation;
}
/**
* 获得缓存的list对象
* @param key 缓存的键值
* @return 缓存键值对应的数据
*/
public <T> List<T> getCacheList(String key)
{
List<T> dataList = new ArrayList<T>();
ListOperations<String,T> listOperation = redisTemplate.opsForList();
Long size = listOperation.size(key);
for(int i = 0 ; i < size ; i ++)
{
dataList.add((T) listOperation.leftPop(key));
}
return dataList;
}
}
package com.atlgroupasia.servicecenter.utils;
import org.apache.http.NameValuePair;
import sun.net.www.http.HttpClient;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
/**
* @Name:
* @Author: Lijc
* @Date: 2019/6/9 21:59
* @Version 1.0
*/
public class SmsUtils {
private final static String APPID = "C85572079";
private final static String APIKEY = "1ef4f297ca31b9c79c9f446d2334454c";
private final static String URL = "https://106.ihuyi.com/webservice/sms.php?method=Submit";
//发送短信,uid,pwd,参数值请向企信通申请, tel:发送的手机号, content:发送的内容
public static String sendSms(String tel, String content, String templateId) throws IOException {
//http://106.ihuyi.com/webservice/sms.php?method=Submit&account=APIID&password=APIKEY&mobile=手机号码&templateid=1&content=1234
// 创建StringBuffer对象用来操作字符串
StringBuffer sb = new StringBuffer(URL);
// 向StringBuffer追加用户名
sb.append("&account=" + APPID);
// 向StringBuffer追加密码(密码采用MD5 32位 小写)
sb.append("&password=" +APIKEY);//在此申请企信通uid,并进行配置密码
// 向StringBuffer追加手机号码
sb.append("&mobile=" + tel);
// 向StringBuffer追加消息内容转URL标准码
sb.append("&templateid=" + templateId);
sb.append("&content=" + URLEncoder.encode(content, "UTF-8"));
sb.append("&format=" + "json");
// 创建url对象
java.net.URL url = new URL(sb.toString());
// 打开url连接
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// 设置url请求方式 ‘get’ 或者 ‘post’
connection.setRequestMethod("POST");
// 发送
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
// 返回发送结果
String inputline = in.readLine();
return inputline;
}
}
package com.atlgroupasia.servicecenter.utils;
import org.apache.commons.lang.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
public class StringUtilSS {
public static final String EMPTY = "";
public static final int INDEX_NOT_FOUND = -1;
private static final int PAD_LIMIT = 8192;
public StringUtilSS() {
}
public static boolean isEmpty(String str) {
return str == null || str.length() == 0;
}
public static boolean isNotEmpty(String str) {
return !isEmpty(str);
}
public static boolean isBlank(String str) {
int strLen;
if (str != null && (strLen = str.length()) != 0) {
for(int i = 0; i < strLen; ++i) {
if (!Character.isWhitespace(str.charAt(i))) {
return false;
}
}
return true;
} else {
return true;
}
}
public static boolean isNotBlank(String str) {
return !isBlank(str);
}
/** @deprecated */
public static String clean(String str) {
return str == null ? "" : str.trim();
}
public static String trim(String str) {
return str == null ? null : str.trim();
}
public static String trimToNull(String str) {
String ts = trim(str);
return isEmpty(ts) ? null : ts;
}
public static String trimToEmpty(String str) {
return str == null ? "" : str.trim();
}
public static String strip(String str) {
return strip(str, (String)null);
}
public static String stripToNull(String str) {
if (str == null) {
return null;
} else {
str = strip(str, (String)null);
return str.length() == 0 ? null : str;
}
}
public static String stripToEmpty(String str) {
return str == null ? "" : strip(str, (String)null);
}
public static String strip(String str, String stripChars) {
if (isEmpty(str)) {
return str;
} else {
str = stripStart(str, stripChars);
return stripEnd(str, stripChars);
}
}
public static String stripStart(String str, String stripChars) {
int strLen;
if (str != null && (strLen = str.length()) != 0) {
int start = 0;
if (stripChars == null) {
while(start != strLen && Character.isWhitespace(str.charAt(start))) {
++start;
}
} else {
if (stripChars.length() == 0) {
return str;
}
while(start != strLen && stripChars.indexOf(str.charAt(start)) != -1) {
++start;
}
}
return str.substring(start);
} else {
return str;
}
}
public static String stripEnd(String str, String stripChars) {
int end;
if (str != null && (end = str.length()) != 0) {
if (stripChars == null) {
while(end != 0 && Character.isWhitespace(str.charAt(end - 1))) {
--end;
}
} else {
if (stripChars.length() == 0) {
return str;
}
while(end != 0 && stripChars.indexOf(str.charAt(end - 1)) != -1) {
--end;
}
}
return str.substring(0, end);
} else {
return str;
}
}
public static String[] stripAll(String[] strs) {
return stripAll(strs, (String)null);
}
public static String[] stripAll(String[] strs, String stripChars) {
int strsLen;
if (strs != null && (strsLen = strs.length) != 0) {
String[] newArr = new String[strsLen];
for(int i = 0; i < strsLen; ++i) {
newArr[i] = strip(strs[i], stripChars);
}
return newArr;
} else {
return strs;
}
}
public static boolean equals(String str1, String str2) {
return str1 == null ? str2 == null : str1.equals(str2);
}
public static boolean equalsIgnoreCase(String str1, String str2) {
return str1 == null ? str2 == null : str1.equalsIgnoreCase(str2);
}
public static int indexOf(String str, char searchChar) {
return isEmpty(str) ? -1 : str.indexOf(searchChar);
}
public static int indexOf(String str, char searchChar, int startPos) {
return isEmpty(str) ? -1 : str.indexOf(searchChar, startPos);
}
public static int indexOf(String str, String searchStr) {
return str != null && searchStr != null ? str.indexOf(searchStr) : -1;
}
public static int ordinalIndexOf(String str, String searchStr, int ordinal) {
if (str != null && searchStr != null && ordinal > 0) {
if (searchStr.length() == 0) {
return 0;
} else {
int found = 0;
int index = -1;
do {
index = str.indexOf(searchStr, index + 1);
if (index < 0) {
return index;
}
++found;
} while(found < ordinal);
return index;
}
} else {
return -1;
}
}
public static int indexOf(String str, String searchStr, int startPos) {
if (str != null && searchStr != null) {
return searchStr.length() == 0 && startPos >= str.length() ? str.length() : str.indexOf(searchStr, startPos);
} else {
return -1;
}
}
public static int lastIndexOf(String str, char searchChar) {
return isEmpty(str) ? -1 : str.lastIndexOf(searchChar);
}
public static int lastIndexOf(String str, char searchChar, int startPos) {
return isEmpty(str) ? -1 : str.lastIndexOf(searchChar, startPos);
}
public static int lastIndexOf(String str, String searchStr) {
return str != null && searchStr != null ? str.lastIndexOf(searchStr) : -1;
}
public static int lastIndexOf(String str, String searchStr, int startPos) {
return str != null && searchStr != null ? str.lastIndexOf(searchStr, startPos) : -1;
}
public static boolean contains(String str, char searchChar) {
if (isEmpty(str)) {
return false;
} else {
return str.indexOf(searchChar) >= 0;
}
}
public static boolean contains(String str, String searchStr) {
if (str != null && searchStr != null) {
return str.indexOf(searchStr) >= 0;
} else {
return false;
}
}
public static boolean containsIgnoreCase(String str, String searchStr) {
return str != null && searchStr != null ? contains(str.toUpperCase(), searchStr.toUpperCase()) : false;
}
public static int indexOfAny(String str, char[] searchChars) {
if (!isEmpty(str) && !ArrayUtils.isEmpty(searchChars)) {
for(int i = 0; i < str.length(); ++i) {
char ch = str.charAt(i);
for(int j = 0; j < searchChars.length; ++j) {
if (searchChars[j] == ch) {
return i;
}
}
}
return -1;
} else {
return -1;
}
}
public static int indexOfAny(String str, String searchChars) {
return !isEmpty(str) && !isEmpty(searchChars) ? indexOfAny(str, searchChars.toCharArray()) : -1;
}
public static int indexOfAnyBut(String str, char[] searchChars) {
if (!isEmpty(str) && !ArrayUtils.isEmpty(searchChars)) {
label27:
for(int i = 0; i < str.length(); ++i) {
char ch = str.charAt(i);
for(int j = 0; j < searchChars.length; ++j) {
if (searchChars[j] == ch) {
continue label27;
}
}
return i;
}
return -1;
} else {
return -1;
}
}
public static int indexOfAnyBut(String str, String searchChars) {
if (!isEmpty(str) && !isEmpty(searchChars)) {
for(int i = 0; i < str.length(); ++i) {
if (searchChars.indexOf(str.charAt(i)) < 0) {
return i;
}
}
return -1;
} else {
return -1;
}
}
public static boolean containsOnly(String str, char[] valid) {
if (valid != null && str != null) {
if (str.length() == 0) {
return true;
} else if (valid.length == 0) {
return false;
} else {
return indexOfAnyBut(str, valid) == -1;
}
} else {
return false;
}
}
public static boolean containsOnly(String str, String validChars) {
return str != null && validChars != null ? containsOnly(str, validChars.toCharArray()) : false;
}
public static boolean containsNone(String str, char[] invalidChars) {
if (str != null && invalidChars != null) {
int strSize = str.length();
int validSize = invalidChars.length;
for(int i = 0; i < strSize; ++i) {
char ch = str.charAt(i);
for(int j = 0; j < validSize; ++j) {
if (invalidChars[j] == ch) {
return false;
}
}
}
return true;
} else {
return true;
}
}
public static boolean containsNone(String str, String invalidChars) {
return str != null && invalidChars != null ? containsNone(str, invalidChars.toCharArray()) : true;
}
// public static int indexOfAny(String str, String[] searchStrs) {
// if (str != null && searchStrs != null) {
// int sz = searchStrs.length;
// int ret = 2147483647;
// int tmp = false;
//
// for(int i = 0; i < sz; ++i) {
// String search = searchStrs[i];
// if (search != null) {
// int tmp = str.indexOf(search);
// if (tmp != -1 && tmp < ret) {
// ret = tmp;
// }
// }
// }
//
// return ret == 2147483647 ? -1 : ret;
// } else {
// return -1;
// }
// }
//
// public static int lastIndexOfAny(String str, String[] searchStrs) {
// if (str != null && searchStrs != null) {
// int sz = searchStrs.length;
// int ret = -1;
// int tmp = false;
//
// for(int i = 0; i < sz; ++i) {
// String search = searchStrs[i];
// if (search != null) {
// int tmp = str.lastIndexOf(search);
// if (tmp > ret) {
// ret = tmp;
// }
// }
// }
//
// return ret;
// } else {
// return -1;
// }
// }
public static String substring(String str, int start) {
if (str == null) {
return null;
} else {
if (start < 0) {
start += str.length();
}
if (start < 0) {
start = 0;
}
return start > str.length() ? "" : str.substring(start);
}
}
public static String substring(String str, int start, int end) {
if (str == null) {
return null;
} else {
if (end < 0) {
end += str.length();
}
if (start < 0) {
start += str.length();
}
if (end > str.length()) {
end = str.length();
}
if (start > end) {
return "";
} else {
if (start < 0) {
start = 0;
}
if (end < 0) {
end = 0;
}
return str.substring(start, end);
}
}
}
public static String left(String str, int len) {
if (str == null) {
return null;
} else if (len < 0) {
return "";
} else {
return str.length() <= len ? str : str.substring(0, len);
}
}
public static String right(String str, int len) {
if (str == null) {
return null;
} else if (len < 0) {
return "";
} else {
return str.length() <= len ? str : str.substring(str.length() - len);
}
}
public static String mid(String str, int pos, int len) {
if (str == null) {
return null;
} else if (len >= 0 && pos <= str.length()) {
if (pos < 0) {
pos = 0;
}
return str.length() <= pos + len ? str.substring(pos) : str.substring(pos, pos + len);
} else {
return "";
}
}
public static String substringBefore(String str, String separator) {
if (!isEmpty(str) && separator != null) {
if (separator.length() == 0) {
return "";
} else {
int pos = str.indexOf(separator);
return pos == -1 ? str : str.substring(0, pos);
}
} else {
return str;
}
}
public static String substringAfter(String str, String separator) {
if (isEmpty(str)) {
return str;
} else if (separator == null) {
return "";
} else {
int pos = str.indexOf(separator);
return pos == -1 ? "" : str.substring(pos + separator.length());
}
}
public static String substringBeforeLast(String str, String separator) {
if (!isEmpty(str) && !isEmpty(separator)) {
int pos = str.lastIndexOf(separator);
return pos == -1 ? str : str.substring(0, pos);
} else {
return str;
}
}
public static String substringAfterLast(String str, String separator) {
if (isEmpty(str)) {
return str;
} else if (isEmpty(separator)) {
return "";
} else {
int pos = str.lastIndexOf(separator);
return pos != -1 && pos != str.length() - separator.length() ? str.substring(pos + separator.length()) : "";
}
}
public static String substringBetween(String str, String tag) {
return substringBetween(str, tag, tag);
}
public static String substringBetween(String str, String open, String close) {
if (str != null && open != null && close != null) {
int start = str.indexOf(open);
if (start != -1) {
int end = str.indexOf(close, start + open.length());
if (end != -1) {
return str.substring(start + open.length(), end);
}
}
return null;
} else {
return null;
}
}
public static String[] substringsBetween(String str, String open, String close) {
if (str != null && !isEmpty(open) && !isEmpty(close)) {
int strLen = str.length();
if (strLen == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY;
} else {
int closeLen = close.length();
int openLen = open.length();
List list = new ArrayList();
int end;
for(int pos = 0; pos < strLen - closeLen; pos = end + closeLen) {
int start = str.indexOf(open, pos);
if (start < 0) {
break;
}
start += openLen;
end = str.indexOf(close, start);
if (end < 0) {
break;
}
list.add(str.substring(start, end));
}
return list.size() > 0 ? (String[])list.toArray(new String[list.size()]) : null;
}
} else {
return null;
}
}
/** @deprecated */
public static String getNestedString(String str, String tag) {
return substringBetween(str, tag, tag);
}
/** @deprecated */
public static String getNestedString(String str, String open, String close) {
return substringBetween(str, open, close);
}
public static String[] split(String str) {
return split(str, (String)null, -1);
}
public static String[] split(String str, char separatorChar) {
return splitWorker(str, separatorChar, false);
}
public static String[] split(String str, String separatorChars) {
return splitWorker(str, separatorChars, -1, false);
}
public static String[] split(String str, String separatorChars, int max) {
return splitWorker(str, separatorChars, max, false);
}
public static String[] splitByWholeSeparator(String str, String separator) {
return splitByWholeSeparator(str, separator, -1);
}
public static String[] splitByWholeSeparator(String str, String separator, int max) {
if (str == null) {
return null;
} else {
int len = str.length();
if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY;
} else if (separator != null && !"".equals(separator)) {
int separatorLength = separator.length();
ArrayList substrings = new ArrayList();
int numberOfSubstrings = 0;
int beg = 0;
int end = 0;
while(end < len) {
end = str.indexOf(separator, beg);
if (end > -1) {
if (end > beg) {
++numberOfSubstrings;
if (numberOfSubstrings == max) {
end = len;
substrings.add(str.substring(beg));
} else {
substrings.add(str.substring(beg, end));
beg = end + separatorLength;
}
} else {
beg = end + separatorLength;
}
} else {
substrings.add(str.substring(beg));
end = len;
}
}
return (String[])substrings.toArray(new String[substrings.size()]);
} else {
return split(str, (String)null, max);
}
}
}
public static String[] splitPreserveAllTokens(String str) {
return splitWorker(str, (String)null, -1, true);
}
public static String[] splitPreserveAllTokens(String str, char separatorChar) {
return splitWorker(str, separatorChar, true);
}
private static String[] splitWorker(String str, char separatorChar, boolean preserveAllTokens) {
if (str == null) {
return null;
} else {
int len = str.length();
if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY;
} else {
List list = new ArrayList();
int i = 0;
int start = 0;
boolean match = false;
boolean lastMatch = false;
while(true) {
while(i < len) {
if (str.charAt(i) == separatorChar) {
if (match || preserveAllTokens) {
list.add(str.substring(start, i));
match = false;
lastMatch = true;
}
++i;
start = i;
} else {
lastMatch = false;
match = true;
++i;
}
}
if (match || preserveAllTokens && lastMatch) {
list.add(str.substring(start, i));
}
return (String[])list.toArray(new String[list.size()]);
}
}
}
}
public static String[] splitPreserveAllTokens(String str, String separatorChars) {
return splitWorker(str, separatorChars, -1, true);
}
public static String[] splitPreserveAllTokens(String str, String separatorChars, int max) {
return splitWorker(str, separatorChars, max, true);
}
private static String[] splitWorker(String str, String separatorChars, int max, boolean preserveAllTokens) {
if (str == null) {
return null;
} else {
int len = str.length();
if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY;
} else {
List list = new ArrayList();
int sizePlus1 = 1;
int i = 0;
int start = 0;
boolean match = false;
boolean lastMatch = false;
if (separatorChars != null) {
if (separatorChars.length() != 1) {
label89:
while(true) {
while(true) {
if (i >= len) {
break label89;
}
if (separatorChars.indexOf(str.charAt(i)) >= 0) {
if (match || preserveAllTokens) {
lastMatch = true;
if (sizePlus1++ == max) {
i = len;
lastMatch = false;
}
list.add(str.substring(start, i));
match = false;
}
++i;
start = i;
} else {
lastMatch = false;
match = true;
++i;
}
}
}
} else {
char sep = separatorChars.charAt(0);
label73:
while(true) {
while(true) {
if (i >= len) {
break label73;
}
if (str.charAt(i) == sep) {
if (match || preserveAllTokens) {
lastMatch = true;
if (sizePlus1++ == max) {
i = len;
lastMatch = false;
}
list.add(str.substring(start, i));
match = false;
}
++i;
start = i;
} else {
lastMatch = false;
match = true;
++i;
}
}
}
}
} else {
label105:
while(true) {
while(true) {
if (i >= len) {
break label105;
}
if (Character.isWhitespace(str.charAt(i))) {
if (match || preserveAllTokens) {
lastMatch = true;
if (sizePlus1++ == max) {
i = len;
lastMatch = false;
}
list.add(str.substring(start, i));
match = false;
}
++i;
start = i;
} else {
lastMatch = false;
match = true;
++i;
}
}
}
}
if (match || preserveAllTokens && lastMatch) {
list.add(str.substring(start, i));
}
return (String[])list.toArray(new String[list.size()]);
}
}
}
/** @deprecated */
public static String concatenate(Object[] array) {
return join((Object[])array, (String)null);
}
public static String join(Object[] array) {
return join((Object[])array, (String)null);
}
public static String join(Object[] array, char separator) {
return array == null ? null : join(array, separator, 0, array.length);
}
public static String join(Object[] array, char separator, int startIndex, int endIndex) {
if (array == null) {
return null;
} else {
int bufSize = endIndex - startIndex;
if (bufSize <= 0) {
return "";
} else {
bufSize *= (array[startIndex] == null ? 16 : array[startIndex].toString().length()) + 1;
StringBuffer buf = new StringBuffer(bufSize);
for(int i = startIndex; i < endIndex; ++i) {
if (i > startIndex) {
buf.append(separator);
}
if (array[i] != null) {
buf.append(array[i]);
}
}
return buf.toString();
}
}
}
public static String join(Object[] array, String separator) {
return array == null ? null : join(array, separator, 0, array.length);
}
public static String join(Object[] array, String separator, int startIndex, int endIndex) {
if (array == null) {
return null;
} else {
if (separator == null) {
separator = "";
}
int bufSize = endIndex - startIndex;
if (bufSize <= 0) {
return "";
} else {
bufSize *= (array[startIndex] == null ? 16 : array[startIndex].toString().length()) + separator.length();
StringBuffer buf = new StringBuffer(bufSize);
for(int i = startIndex; i < endIndex; ++i) {
if (i > startIndex) {
buf.append(separator);
}
if (array[i] != null) {
buf.append(array[i]);
}
}
return buf.toString();
}
}
}
public static String join(Iterator iterator, char separator) {
if (iterator == null) {
return null;
} else if (!iterator.hasNext()) {
return "";
} else {
Object first = iterator.next();
if (!iterator.hasNext()) {
return ObjectUtils.toString(first);
} else {
StringBuffer buf = new StringBuffer(256);
if (first != null) {
buf.append(first);
}
while(iterator.hasNext()) {
buf.append(separator);
Object obj = iterator.next();
if (obj != null) {
buf.append(obj);
}
}
return buf.toString();
}
}
}
public static String join(Iterator iterator, String separator) {
if (iterator == null) {
return null;
} else if (!iterator.hasNext()) {
return "";
} else {
Object first = iterator.next();
if (!iterator.hasNext()) {
return ObjectUtils.toString(first);
} else {
StringBuffer buf = new StringBuffer(256);
if (first != null) {
buf.append(first);
}
while(iterator.hasNext()) {
if (separator != null) {
buf.append(separator);
}
Object obj = iterator.next();
if (obj != null) {
buf.append(obj);
}
}
return buf.toString();
}
}
}
public static String join(Collection collection, char separator) {
return collection == null ? null : join(collection.iterator(), separator);
}
public static String join(Collection collection, String separator) {
return collection == null ? null : join(collection.iterator(), separator);
}
/** @deprecated */
public static String deleteSpaces(String str) {
return str == null ? null : CharSetUtils.delete(str, " \t\r\n\b");
}
public static String deleteWhitespace(String str) {
if (isEmpty(str)) {
return str;
} else {
int sz = str.length();
char[] chs = new char[sz];
int count = 0;
for(int i = 0; i < sz; ++i) {
if (!Character.isWhitespace(str.charAt(i))) {
chs[count++] = str.charAt(i);
}
}
if (count == sz) {
return str;
} else {
return new String(chs, 0, count);
}
}
}
public static String removeStart(String str, String remove) {
if (!isEmpty(str) && !isEmpty(remove)) {
return str.startsWith(remove) ? str.substring(remove.length()) : str;
} else {
return str;
}
}
public static String removeEnd(String str, String remove) {
if (!isEmpty(str) && !isEmpty(remove)) {
return str.endsWith(remove) ? str.substring(0, str.length() - remove.length()) : str;
} else {
return str;
}
}
public static String remove(String str, String remove) {
return !isEmpty(str) && !isEmpty(remove) ? replace(str, remove, "", -1) : str;
}
public static String remove(String str, char remove) {
if (!isEmpty(str) && str.indexOf(remove) != -1) {
char[] chars = str.toCharArray();
int pos = 0;
for(int i = 0; i < chars.length; ++i) {
if (chars[i] != remove) {
chars[pos++] = chars[i];
}
}
return new String(chars, 0, pos);
} else {
return str;
}
}
public static String replaceOnce(String text, String repl, String with) {
return replace(text, repl, with, 1);
}
public static String replace(String text, String repl, String with) {
return replace(text, repl, with, -1);
}
public static String replace(String text, String repl, String with, int max) {
if (!isEmpty(text) && !isEmpty(repl) && with != null && max != 0) {
int start = 0;
int end = text.indexOf(repl, start);
if (end == -1) {
return text;
} else {
int replLength = repl.length();
int increase = with.length() - replLength;
increase = increase < 0 ? 0 : increase;
increase *= max < 0 ? 16 : (max > 64 ? 64 : max);
StringBuffer buf;
for(buf = new StringBuffer(text.length() + increase); end != -1; end = text.indexOf(repl, start)) {
buf.append(text.substring(start, end)).append(with);
start = end + replLength;
--max;
if (max == 0) {
break;
}
}
buf.append(text.substring(start));
return buf.toString();
}
} else {
return text;
}
}
public static String replaceChars(String str, char searchChar, char replaceChar) {
return str == null ? null : str.replace(searchChar, replaceChar);
}
public static String replaceChars(String str, String searchChars, String replaceChars) {
if (!isEmpty(str) && !isEmpty(searchChars)) {
if (replaceChars == null) {
replaceChars = "";
}
boolean modified = false;
int replaceCharsLength = replaceChars.length();
int strLength = str.length();
StringBuffer buf = new StringBuffer(strLength);
for(int i = 0; i < strLength; ++i) {
char ch = str.charAt(i);
int index = searchChars.indexOf(ch);
if (index >= 0) {
modified = true;
if (index < replaceCharsLength) {
buf.append(replaceChars.charAt(index));
}
} else {
buf.append(ch);
}
}
if (modified) {
return buf.toString();
} else {
return str;
}
} else {
return str;
}
}
/** @deprecated */
public static String overlayString(String text, String overlay, int start, int end) {
return (new StringBuffer(start + overlay.length() + text.length() - end + 1)).append(text.substring(0, start)).append(overlay).append(text.substring(end)).toString();
}
public static String overlay(String str, String overlay, int start, int end) {
if (str == null) {
return null;
} else {
if (overlay == null) {
overlay = "";
}
int len = str.length();
if (start < 0) {
start = 0;
}
if (start > len) {
start = len;
}
if (end < 0) {
end = 0;
}
if (end > len) {
end = len;
}
if (start > end) {
int temp = start;
start = end;
end = temp;
}
return (new StringBuffer(len + start - end + overlay.length() + 1)).append(str.substring(0, start)).append(overlay).append(str.substring(end)).toString();
}
}
public static String chomp(String str) {
if (isEmpty(str)) {
return str;
} else if (str.length() == 1) {
char ch = str.charAt(0);
return ch != '\r' && ch != '\n' ? str : "";
} else {
int lastIdx = str.length() - 1;
char last = str.charAt(lastIdx);
if (last == '\n') {
if (str.charAt(lastIdx - 1) == '\r') {
--lastIdx;
}
} else if (last != '\r') {
++lastIdx;
}
return str.substring(0, lastIdx);
}
}
public static String chomp(String str, String separator) {
if (!isEmpty(str) && separator != null) {
return str.endsWith(separator) ? str.substring(0, str.length() - separator.length()) : str;
} else {
return str;
}
}
/** @deprecated */
public static String chompLast(String str) {
return chompLast(str, "\n");
}
/** @deprecated */
public static String chompLast(String str, String sep) {
if (str.length() == 0) {
return str;
} else {
String sub = str.substring(str.length() - sep.length());
return sep.equals(sub) ? str.substring(0, str.length() - sep.length()) : str;
}
}
/** @deprecated */
public static String getChomp(String str, String sep) {
int idx = str.lastIndexOf(sep);
if (idx == str.length() - sep.length()) {
return sep;
} else {
return idx != -1 ? str.substring(idx) : "";
}
}
/** @deprecated */
public static String prechomp(String str, String sep) {
int idx = str.indexOf(sep);
return idx != -1 ? str.substring(idx + sep.length()) : str;
}
/** @deprecated */
public static String getPrechomp(String str, String sep) {
int idx = str.indexOf(sep);
return idx != -1 ? str.substring(0, idx + sep.length()) : "";
}
public static String chop(String str) {
if (str == null) {
return null;
} else {
int strLen = str.length();
if (strLen < 2) {
return "";
} else {
int lastIdx = strLen - 1;
String ret = str.substring(0, lastIdx);
char last = str.charAt(lastIdx);
return last == '\n' && ret.charAt(lastIdx - 1) == '\r' ? ret.substring(0, lastIdx - 1) : ret;
}
}
}
/** @deprecated */
public static String chopNewline(String str) {
int lastIdx = str.length() - 1;
if (lastIdx <= 0) {
return "";
} else {
char last = str.charAt(lastIdx);
if (last == '\n') {
if (str.charAt(lastIdx - 1) == '\r') {
--lastIdx;
}
} else {
++lastIdx;
}
return str.substring(0, lastIdx);
}
}
/** @deprecated */
public static String escape(String str) {
return StringEscapeUtils.escapeJava(str);
}
public static String repeat(String str, int repeat) {
if (str == null) {
return null;
} else if (repeat <= 0) {
return "";
} else {
int inputLength = str.length();
if (repeat != 1 && inputLength != 0) {
if (inputLength == 1 && repeat <= 8192) {
return padding(repeat, str.charAt(0));
} else {
int outputLength = inputLength * repeat;
switch(inputLength) {
case 1:
char ch = str.charAt(0);
char[] output1 = new char[outputLength];
for(int i = repeat - 1; i >= 0; --i) {
output1[i] = ch;
}
return new String(output1);
case 2:
char ch0 = str.charAt(0);
char ch1 = str.charAt(1);
char[] output2 = new char[outputLength];
for(int i = repeat * 2 - 2; i >= 0; --i) {
output2[i] = ch0;
output2[i + 1] = ch1;
--i;
}
return new String(output2);
default:
StringBuffer buf = new StringBuffer(outputLength);
for(int i = 0; i < repeat; ++i) {
buf.append(str);
}
return buf.toString();
}
}
} else {
return str;
}
}
}
private static String padding(int repeat, char padChar) throws IndexOutOfBoundsException {
if (repeat < 0) {
throw new IndexOutOfBoundsException("Cannot pad a negative amount: " + repeat);
} else {
char[] buf = new char[repeat];
for(int i = 0; i < buf.length; ++i) {
buf[i] = padChar;
}
return new String(buf);
}
}
public static String rightPad(String str, int size) {
return rightPad(str, size, ' ');
}
public static String rightPad(String str, int size, char padChar) {
if (str == null) {
return null;
} else {
int pads = size - str.length();
if (pads <= 0) {
return str;
} else {
return pads > 8192 ? rightPad(str, size, String.valueOf(padChar)) : str.concat(padding(pads, padChar));
}
}
}
public static String rightPad(String str, int size, String padStr) {
if (str == null) {
return null;
} else {
if (isEmpty(padStr)) {
padStr = " ";
}
int padLen = padStr.length();
int strLen = str.length();
int pads = size - strLen;
if (pads <= 0) {
return str;
} else if (padLen == 1 && pads <= 8192) {
return rightPad(str, size, padStr.charAt(0));
} else if (pads == padLen) {
return str.concat(padStr);
} else if (pads < padLen) {
return str.concat(padStr.substring(0, pads));
} else {
char[] padding = new char[pads];
char[] padChars = padStr.toCharArray();
for(int i = 0; i < pads; ++i) {
padding[i] = padChars[i % padLen];
}
return str.concat(new String(padding));
}
}
}
public static String leftPad(String str, int size) {
return leftPad(str, size, ' ');
}
public static String leftPad(String str, int size, char padChar) {
if (str == null) {
return null;
} else {
int pads = size - str.length();
if (pads <= 0) {
return str;
} else {
return pads > 8192 ? leftPad(str, size, String.valueOf(padChar)) : padding(pads, padChar).concat(str);
}
}
}
public static String leftPad(String str, int size, String padStr) {
if (str == null) {
return null;
} else {
if (isEmpty(padStr)) {
padStr = " ";
}
int padLen = padStr.length();
int strLen = str.length();
int pads = size - strLen;
if (pads <= 0) {
return str;
} else if (padLen == 1 && pads <= 8192) {
return leftPad(str, size, padStr.charAt(0));
} else if (pads == padLen) {
return padStr.concat(str);
} else if (pads < padLen) {
return padStr.substring(0, pads).concat(str);
} else {
char[] padding = new char[pads];
char[] padChars = padStr.toCharArray();
for(int i = 0; i < pads; ++i) {
padding[i] = padChars[i % padLen];
}
return (new String(padding)).concat(str);
}
}
}
public static String center(String str, int size) {
return center(str, size, ' ');
}
public static String center(String str, int size, char padChar) {
if (str != null && size > 0) {
int strLen = str.length();
int pads = size - strLen;
if (pads <= 0) {
return str;
} else {
str = leftPad(str, strLen + pads / 2, padChar);
str = rightPad(str, size, padChar);
return str;
}
} else {
return str;
}
}
public static String center(String str, int size, String padStr) {
if (str != null && size > 0) {
if (isEmpty(padStr)) {
padStr = " ";
}
int strLen = str.length();
int pads = size - strLen;
if (pads <= 0) {
return str;
} else {
str = leftPad(str, strLen + pads / 2, padStr);
str = rightPad(str, size, padStr);
return str;
}
} else {
return str;
}
}
public static String upperCase(String str) {
return str == null ? null : str.toUpperCase();
}
public static String lowerCase(String str) {
return str == null ? null : str.toLowerCase();
}
public static String capitalize(String str) {
int strLen;
return str != null && (strLen = str.length()) != 0 ? (new StringBuffer(strLen)).append(Character.toTitleCase(str.charAt(0))).append(str.substring(1)).toString() : str;
}
/** @deprecated */
public static String capitalise(String str) {
return capitalize(str);
}
public static String uncapitalize(String str) {
int strLen;
return str != null && (strLen = str.length()) != 0 ? (new StringBuffer(strLen)).append(Character.toLowerCase(str.charAt(0))).append(str.substring(1)).toString() : str;
}
/** @deprecated */
public static String uncapitalise(String str) {
return uncapitalize(str);
}
//
// public static String swapCase(String str) {
// int strLen;
// if (str != null && (strLen = str.length()) != 0) {
// StringBuffer buffer = new StringBuffer(strLen);
// char ch = false;
//
// for(int i = 0; i < strLen; ++i) {
// char ch = str.charAt(i);
// if (Character.isUpperCase(ch)) {
// ch = Character.toLowerCase(ch);
// } else if (Character.isTitleCase(ch)) {
// ch = Character.toLowerCase(ch);
// } else if (Character.isLowerCase(ch)) {
// ch = Character.toUpperCase(ch);
// }
//
// buffer.append(ch);
// }
//
// return buffer.toString();
// } else {
// return str;
// }
// }
/** @deprecated */
public static String capitaliseAllWords(String str) {
return WordUtils.capitalize(str);
}
public static int countMatches(String str, String sub) {
if (!isEmpty(str) && !isEmpty(sub)) {
int count = 0;
for(int idx = 0; (idx = str.indexOf(sub, idx)) != -1; idx += sub.length()) {
++count;
}
return count;
} else {
return 0;
}
}
public static boolean isAlpha(String str) {
if (str == null) {
return false;
} else {
int sz = str.length();
for(int i = 0; i < sz; ++i) {
if (!Character.isLetter(str.charAt(i))) {
return false;
}
}
return true;
}
}
public static boolean isAlphaSpace(String str) {
if (str == null) {
return false;
} else {
int sz = str.length();
for(int i = 0; i < sz; ++i) {
if (!Character.isLetter(str.charAt(i)) && str.charAt(i) != ' ') {
return false;
}
}
return true;
}
}
public static boolean isAlphanumeric(String str) {
if (str == null) {
return false;
} else {
int sz = str.length();
for(int i = 0; i < sz; ++i) {
if (!Character.isLetterOrDigit(str.charAt(i))) {
return false;
}
}
return true;
}
}
public static boolean isAlphanumericSpace(String str) {
if (str == null) {
return false;
} else {
int sz = str.length();
for(int i = 0; i < sz; ++i) {
if (!Character.isLetterOrDigit(str.charAt(i)) && str.charAt(i) != ' ') {
return false;
}
}
return true;
}
}
public static boolean isAsciiPrintable(String str) {
if (str == null) {
return false;
} else {
int sz = str.length();
for(int i = 0; i < sz; ++i) {
if (!CharUtils.isAsciiPrintable(str.charAt(i))) {
return false;
}
}
return true;
}
}
public static boolean isNumeric(String str) {
if (str == null) {
return false;
} else {
int sz = str.length();
for(int i = 0; i < sz; ++i) {
if (!Character.isDigit(str.charAt(i))) {
return false;
}
}
return true;
}
}
public static boolean isNumericSpace(String str) {
if (str == null) {
return false;
} else {
int sz = str.length();
for(int i = 0; i < sz; ++i) {
if (!Character.isDigit(str.charAt(i)) && str.charAt(i) != ' ') {
return false;
}
}
return true;
}
}
public static boolean isWhitespace(String str) {
if (str == null) {
return false;
} else {
int sz = str.length();
for(int i = 0; i < sz; ++i) {
if (!Character.isWhitespace(str.charAt(i))) {
return false;
}
}
return true;
}
}
public static String defaultString(String str) {
return str == null ? "" : str;
}
public static String defaultString(String str, String defaultStr) {
return str == null ? defaultStr : str;
}
public static String defaultIfEmpty(String str, String defaultStr) {
return isEmpty(str) ? defaultStr : str;
}
public static String reverse(String str) {
return str == null ? null : (new StringBuffer(str)).reverse().toString();
}
public static String reverseDelimited(String str, char separatorChar) {
if (str == null) {
return null;
} else {
String[] strs = split(str, separatorChar);
ArrayUtils.reverse(strs);
return join((Object[])strs, separatorChar);
}
}
/** @deprecated */
public static String reverseDelimitedString(String str, String separatorChars) {
if (str == null) {
return null;
} else {
String[] strs = split(str, separatorChars);
ArrayUtils.reverse(strs);
return separatorChars == null ? join((Object[])strs, ' ') : join((Object[])strs, separatorChars);
}
}
public static String abbreviate(String str, int maxWidth) {
return abbreviate(str, 0, maxWidth);
}
public static String abbreviate(String str, int offset, int maxWidth) {
if (str == null) {
return null;
} else if (maxWidth < 4) {
throw new IllegalArgumentException("Minimum abbreviation width is 4");
} else if (str.length() <= maxWidth) {
return str;
} else {
if (offset > str.length()) {
offset = str.length();
}
if (str.length() - offset < maxWidth - 3) {
offset = str.length() - (maxWidth - 3);
}
if (offset <= 4) {
return str.substring(0, maxWidth - 3) + "...";
} else if (maxWidth < 7) {
throw new IllegalArgumentException("Minimum abbreviation width with offset is 7");
} else {
return offset + (maxWidth - 3) < str.length() ? "..." + abbreviate(str.substring(offset), maxWidth - 3) : "..." + str.substring(str.length() - (maxWidth - 3));
}
}
}
public static String difference(String str1, String str2) {
if (str1 == null) {
return str2;
} else if (str2 == null) {
return str1;
} else {
int at = indexOfDifference(str1, str2);
return at == -1 ? "" : str2.substring(at);
}
}
public static int indexOfDifference(String str1, String str2) {
if (str1 == str2) {
return -1;
} else if (str1 != null && str2 != null) {
int i;
for(i = 0; i < str1.length() && i < str2.length() && str1.charAt(i) == str2.charAt(i); ++i) {
}
return i >= str2.length() && i >= str1.length() ? -1 : i;
} else {
return 0;
}
}
public static int getLevenshteinDistance(String s, String t) {
if (s != null && t != null) {
int n = s.length();
int m = t.length();
if (n == 0) {
return m;
} else if (m == 0) {
return n;
} else {
int[] p = new int[n + 1];
int[] d = new int[n + 1];
int i;
for(i = 0; i <= n; p[i] = i++) {
}
for(int j = 1; j <= m; ++j) {
char t_j = t.charAt(j - 1);
d[0] = j;
for(i = 1; i <= n; ++i) {
int cost = s.charAt(i - 1) == t_j ? 0 : 1;
d[i] = Math.min(Math.min(d[i - 1] + 1, p[i] + 1), p[i - 1] + cost);
}
int[] _d = p;
p = d;
d = _d;
}
return p[n];
}
} else {
throw new IllegalArgumentException("Strings must not be null");
}
}
}
package com.atlgroupasia.servicecenter.utils;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.security.MessageDigest;
/**
* @author dataochen
* @Description
* @date: 2017/11/7 17:49
*/
public class StringUtils {
public static String getSha1(String str) {
char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f' };
try {
MessageDigest mdTemp = MessageDigest.getInstance("SHA1");
mdTemp.update(str.getBytes("UTF-8"));
byte[] md = mdTemp.digest();
int j = md.length;
char buf[] = new char[j * 2];
int k = 0;
for (int i = 0; i < j; i++) {
byte byte0 = md[i];
buf[k++] = hexDigits[byte0 >>> 4 & 0xf];
buf[k++] = hexDigits[byte0 & 0xf];
}
return new String(buf);
} catch (Exception e) {
return null;
}
}
public static final String parseMD5(String s) {
if (s == null) {
return null;
} else {
char[] hexDigits = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
try {
byte[] strTemp = s.getBytes();
MessageDigest mdTemp = MessageDigest.getInstance("MD5");
mdTemp.update(strTemp);
byte[] md = mdTemp.digest();
int j = md.length;
char[] str = new char[j * 2];
int k = 0;
for(int i = 0; i < j; ++i) {
byte byte0 = md[i];
str[k++] = hexDigits[byte0 >>> 4 & 15];
str[k++] = hexDigits[byte0 & 15];
}
return new String(str);
} catch (Exception var10) {
return null;
}
}
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
import java.util.regex.Pattern;
/**
* 功能描述: <br>手机验证工具
* 〈〉
* @since: 1.0.0
* @Author:Momo
* @Date: 2019/5/23 23:36
*/
public class VerificationUtil {
/**
* 手机号正则表达式
*/
public static final String MOBILE_REG = "^1[0-9]{10}$";
/**
* 验证是否是手机号码
*
* @param mobile 手机号码
* @return boolean
*/
public static boolean isMobile(String mobile) {
return mobile != null && Pattern.matches(MOBILE_REG, mobile);
}
}
package com.atlgroupasia.servicecenter.utils;
import com.github.wxpay.sdk.WXPayConfig;
import lombok.extern.slf4j.Slf4j;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
/**
* @author saodiseng
* @date 2019/2/18
*/
@Slf4j
public class WXAppletConfigUtil implements WXPayConfig {
private byte[] certData;
public static final String KEY = "1234567890ABCDEFGHIJabcdefghijkl";
public static final String MCH_ID = "1312767401";
/*微信小程序*/
public static final String APP_ID = "wx17a656b5f0566853";
public static final String APP_SECRET = "c8144dfbcf716166612d722002fc1e26";
public WXAppletConfigUtil() throws Exception {
String certPath = "/www/wwwroot/userapi.atlxm.com/apiclient_cert.p12";
//String certPath = "D:\\java\\apiclient_cert.p12";
File file = new File(certPath);
InputStream certStream = new FileInputStream(file);
this.certData = new byte[(int) file.length()];
certStream.read(this.certData);
certStream.close();
}
@Override
public String getAppID() {
return APP_ID;
}
//parnerid,商户号
@Override
public String getMchID() {
return MCH_ID;
}
@Override
public String getKey() {
return KEY;
}
public String getAppSecret() {
return APP_SECRET;
}
@Override
public InputStream getCertStream() {
ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
return certBis;
}
@Override
public int getHttpConnectTimeoutMs() {
return 8000;
}
@Override
public int getHttpReadTimeoutMs() {
return 10000;
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
import com.github.wxpay.sdk.WXPayConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ClassUtils;
import java.io.*;
/**
* @author saodiseng
* @date 2019/2/18
*/
@Slf4j
public class WXConfigUtil implements WXPayConfig {
private byte[] certData;
public static final String KEY = "1234567890ABCDEFGHIJabcdefghijkl";
public static final String MCH_ID = "1312767401";
/*微信*/
public static final String APP_ID = "wx2aa1a590d0886398";
public static final String APP_SECRET = "fc53adfd9315f5e3cf823523c742bcd1";
public WXConfigUtil() throws Exception {
String certPath = "/www/wwwroot/userapi.atlxm.com/apiclient_cert.p12";
File file = new File(certPath);
InputStream certStream = new FileInputStream(file);
this.certData = new byte[(int) file.length()];
certStream.read(this.certData);
certStream.close();
}
@Override
public String getAppID() {
return APP_ID;
}
//parnerid,商户号
@Override
public String getMchID() {
return MCH_ID;
}
@Override
public String getKey() {
return KEY;
}
public String getAppSecret() {
return APP_SECRET;
}
@Override
public InputStream getCertStream() {
ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
return certBis;
}
@Override
public int getHttpConnectTimeoutMs() {
return 8000;
}
@Override
public int getHttpReadTimeoutMs() {
return 10000;
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.utils;
import com.github.wxpay.sdk.WXPayConfig;
import lombok.extern.slf4j.Slf4j;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
/**
* @author saodiseng
* @date 2019/2/18
*/
@Slf4j
public class WXOfficeConfigUtil implements WXPayConfig {
private byte[] certData;
public static final String KEY = "1234567890ABCDEFGHIJabcdefghijkl";
public static final String MCH_ID = "1312767401";
/*微信公众号*/
public static final String APP_ID = "wxbd6cf7b619de70d9";
public static final String APP_SECRET = "79a5044ac7856522eacc9f824013febb";
public WXOfficeConfigUtil() throws Exception {
String certPath = "/www/wwwroot/userapi.atlxm.com/apiclient_cert.p12";
File file = new File(certPath);
InputStream certStream = new FileInputStream(file);
this.certData = new byte[(int) file.length()];
certStream.read(this.certData);
certStream.close();
}
@Override
public String getAppID() {
return APP_ID;
}
//parnerid,商户号
@Override
public String getMchID() {
return MCH_ID;
}
@Override
public String getKey() {
return KEY;
}
public String getAppSecret() {
return APP_SECRET;
}
@Override
public InputStream getCertStream() {
ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
return certBis;
}
@Override
public int getHttpConnectTimeoutMs() {
return 8000;
}
@Override
public int getHttpReadTimeoutMs() {
return 10000;
}
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class ActivityVo implements Serializable {
private Integer id;
private String pic;//图片
private String coverPic;//封面
private String title;//标题
private String province;//省份
private String city;//城市
private String area;//区域
private String provinceCode;//省份代码
private String cityCode;//城市代码
private String areaCode;//区域代码
private String address;//地址
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date beginTime;//开始时间
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyStartTime;//报名开始时间
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyEndTime;//报名结束时间
private Integer templeId;//寺庙id
private String master;//主办方
private String phone;//电话
private Integer totalNumber;//总人数
private Integer applyNumber;//已报名人数
private String content;//活动详情
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
/**
* @Description:地區
*
* @author ZYP 2017-3-19
*
*/
@Data
public class AreaVo {
private Integer id;
private String areaCode;
private String name;
private String cityCode;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class AtlUserVo implements Serializable{
private Long id;
private String nickName;
private String realName;
private String mobilePhone;
private String loginPassword;
private String payPassword;
private String openId;
private String avaterImageUrl;
private Integer cloudSpaceUsage;
private String remark;
private Integer createBy;
private String createTime;
private Integer updateBy;
private String updateTime;
private Integer state;
private Integer sex;
private Date birthday;
private String birthdayType;
private String signature;
private Date loginDate;
private String clientId;
private String isSysPush;
private String isScPush;
private String isRemPush;
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class BlessEnableVo implements Serializable {
private Integer id;//福位启用id
private Integer userId;//用户id
private Integer blessId;//福位id
private Integer blessIndex;//福位位数
private Integer enableState;//启用状态
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class BlessVo {
private Integer id;//福位id
private Integer columnId;//柱id
private Integer memorialHallId;//纪念馆id
private String layer;//在第几层
private Integer recordId;//记录id
private BigDecimal priceRate;//价格比例
private BigDecimal basePrice;//基价格
private BigDecimal price;//总价格
private Integer rankId;//等级id
private Integer positionId;//方位id
private Integer fashionId;//款式id
private Integer specificationsId;//规格id
private String singlePic;//单层图片
private Integer lockSingle;//锁单
private String allPic;//全景图片
private String codeNumber;//编号
private String serialNumber;//序号
private Integer enable;//序号
private Integer saleTag;//0未卖出 1交易中 2已完成
private BigDecimal percent;//折扣
private Integer isShelves;//上下架
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.util.LinkedList;
/**
* @Description:城市
*
* @author ZYP 2017-3-19
*
*/
@Data
public class CityVo {
private Integer id;
private String name;//名稱
private String cityCode;//城市ID
private String provinceCode;//省份id
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ColumnVo implements Serializable {
private Integer id;//列id
private Integer recordId;//记录id
private String name;//列名称
private BigDecimal basePrice;//基价格
private Integer positionId;//方位id
private Integer rankId;//等级id
private Integer fashionId;//款式id
private Integer specificationsId;//规格id
private Integer templeId;//寺庙id
private Integer memorialHallId;//纪念馆id
private Integer institutionId;//机构id//楼阁
private Integer layerSum;//层的数量
private String singlePic;//单层图
private String allPic;//全景图
private Integer isSel;//是否被卖出 0为未卖出 1为已卖出 2为部分售出
private Integer lockSingle;//是否认捐单中 0为否 1为是
private BigDecimal percent;//折扣
private Integer isShelves;//是否上架 0上架 1下架
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class DonateOrderVo {
private Integer id;//助捐单id
private Integer donorId;//助捐人id
private String donorName;//捐建人姓名
private String linkedName;//联系人
private String linkedPhone;//联系人电话
private String identity;//捐建人身份证
private String address;//通讯地址
private String numbers;//助捐单号
private Integer agencyId;//推广商id
private Integer merits;//功德证 0为免费代管 1为寄送并自己保管
private Integer voucher;//使用凭证 0为免费代管 1为寄送并自己保管
private Integer state;//支付状态 0为等待支付 1为已支付 2取消订单
private Integer determineState;//确定交易状态 1为自确定 2为平台确定
private Integer source;//来源 0为自建 1为平台创建
private Integer send;//捐建书
private String reason;//审核失败理由
private Integer pressConfirm;//0为未催促 1为促催确认
private BigDecimal price;//价格
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date outTime;//过期时间
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date confirmTime;//确认时间
private String blessIds;//福位id
private Integer blessNum;//福位数量
private Integer companyId;//公司id
private Integer isDonate;//是否 捐建发起的订单 0为助捐区 1为捐建区
private Integer realPayment;//实际付款方式
private String img;//图片
private String instruction;//说明
private BigDecimal discountPrice;//折扣后金额
private Integer belongSubscriptionOrderId;//属于哪个认捐单
private String changePriceRemark;
private String donateImg;
private String sqImg;
private String qtImg;
private Integer advanceState;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
private Integer isView;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class DonorVo implements Serializable {
private Integer id;//捐建人id
private Integer companyId;
private String name;//捐建人姓名
private String pic;//头像
private String phone;//手机号绑定(作为登入账号)
private String identify;//身份证
private String password;//登入密码
private String identifyJustPic;//身份证正面照
private String identifyBackPic;//身份证反面照
private String province;//省份
private String city;//城市
private String area;//区域
private String address;//通讯地址
private String email;//邮箱
private String linkedName;//联系人
private String linkedPhone;//联系电话
private Integer authentication;//是否认证 0为未认证 1为已认证
private Integer provinceCode;//省份Code
private Integer cityCode;//城市Code
private Integer areaCode;//区域Code
private String reason;//理由
private String linkedBakPhone;
private String linkedBakName;
private Integer isService;
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.Date;
@Data
public class GiveRecordVo {
private Integer id;
private Integer userId;
private Integer giveUserId;
private Integer referType;
private Integer referId;
private Integer blessId;
private String orderCode;
private Integer state;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
\ No newline at end of file
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class MaintainOrderVo implements Serializable {
private Integer id;
private Integer blessId;
private Integer blessIdx;
private Integer maintainPriceId;
private Integer payYears;
private BigDecimal price;
private BigDecimal payMoney;
private String payName;
private Integer payType;
private Date dateTime;
private Integer state;
private Integer isDel;
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class MaintainPriceVo implements Serializable {
private int id;
private int templeId;
private int specificationsId;
private BigDecimal price;
private BigDecimal priceYear;
private String name;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.Date;
@Data
public class OrderMessageVo {
private Integer id;//订单日志id
private Integer orderType;//订单类型 0为认捐单 1为助捐单
private String content;//订单内容
private Integer donateOrderId;//订单id
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class OshCartItemVo implements Serializable {
private Integer id;
private Integer userId;
private Integer productId;
private Integer quantity;
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.util.List;
@Data
public class OshParamsVo {
private Integer id;
private String name;
private String value;
private Integer type;
private String remark;
private Integer isDel;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.util.Date;
@Data
public class OshServicesAdVo {
private Long id;
private Long orderId;
private String state;
private String remark;
private Date createTime;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.util.Date;
@Data
public class OshServicesOrderItemVo {
private Long id;
private Long orderId;
private Long productLinkId;
private String name;
private Integer num;
private double price;
private Long createUserId;
private String remark;
private Date createTime;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.util.Date;
@Data
public class OshServicesOrderMessageVo {
private Long orderId;
private String state;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.util.Date;
@Data
public class OshServicesOrderRecordVo {
private Long id;
private Long orderId;
private Date createTime;
private String state;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.util.Date;
@Data
public class OshServicesOrderVo {
private String phone;
private Long id;
private Long productId;
private Long blessId;
private Long blessUsingId;
private String code;
private Long userId;
private Long sum;
private Long ageLimit;
private double totalPrice;
private double payPrice;
private String status;
private String confirmTimeStr;
private Date confirmTime;
private Date confirmEndTime;
private String confirmEndTimeStr;
private Long createUserId;
private Date createTime;
private String evaluateLevel;
private String evaluateText;
private String orderItemJson;
/*微信支付签名*/
private String resXml;
private String remark;
private String payType;
private String wxCode;
private String nickName;
private String pic;
private String openId;
private String payChooseType;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.util.Date;
@Data
public class OshServicesSpecificationVo {
private Long id;
private String type;
private String name;
private Long serviceId;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class OshServicesTypeVo {
private Long id;
private String name;
private String remark;
private Date createTime;
private Long createUserId;
private Date updateTime;
private Long updateUserId;
private String isCombo;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class OshServicesVo {
private Long id;
private Long blessId;
private Long templeId;
private String code;
private String name;
private Long specification;
private Long type;
private BigDecimal price;
private String status;
private String description;
private String firstPic;
private String pics;
private Date createTime;
private Long createUserId;
private Date updateTime;
private Long updateUserId;
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.Date;
@Data
public class ProductAdVo {
private Integer id;
private String link;
private String pic;
private Integer weight;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date createTime;
private Date updatetime;
private Integer isDel;
private Integer productId;
private Integer templeId;
private String title;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ProductVo {
private Integer id;
private Integer templeId;
private String serial;
private String name;
private Integer productTypeId;
private BigDecimal originPrice;
private BigDecimal price;
private String unit;
private Integer stock;
private Integer warningStock;
private Integer isShelves;
private String content;
private String firstPic;
private String pics;
private Date createTime;
private Integer creatorId;
private Integer saleCount;
}
package com.atlgroupasia.servicecenter.vo;
import lombok.Data;
import java.util.LinkedList;
/**
* @Description:省份表(安卓的不想找插件,所以后台代写一个省市区三级联动数据)
*
* @author ZYP 2017-3-19
*
*/
@Data
public class ProvinceVo {
private Integer id;
private String provinceCode;//省份編碼
private String name;//省份名稱
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ShuttleVo implements Serializable {
private Integer id;
private Integer templeId;
private Integer type;
private Integer relationId;
private Integer site;
private String province;
private String city;
private String area;
private String provinceCode;
private String cityCode;
private String areaCode;
private String address;
private String time;
@JSONField(format = "yyyy-MM-dd HH:mm")
private Date shuttleTime;
private String endTime;
private BigDecimal price;
private String phone;
private Integer passengers;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
}
\ No newline at end of file
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.Date;
@Data
public class SpecificationsVo {
private Integer id;//规格id
private String name;//名称
private Integer companyId;//企业id
private Integer number;//规格位数
private Integer weight;//权重
private Integer isDefault;//是否默认
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class TempleVo {
private Integer id;//寺庙id
private Integer companyId;//总公司id
private Integer manageId;//公司id
private String sequenceNumber;//序号
private String name;//寺庙名称
private String pic;//图片
private String coverPic; //封面图片
private String certificatePic;//证书公章
private String donateModelPic;//捐建书模版
private String blessVoucherPic;//福位凭证模版
private String moralityCardPic;//功德证
private String remark;//寺庙介绍
private BigDecimal maintainPrice;//维护费
private Integer provinceCode;
private Integer cityCode;
private Integer areaCode;
private String province;//省份
private String city;//城市
private String area;//区域
private String address;//详情地址
private String bankNumber;
private String bankName;
private String bankUserName;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//创建时间
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author Administrator
*
*/
@Data
public class UserBlessUsingVo {
private Integer id; //主键id
private Integer relationId;//启用人id
private Integer type; //0前端用户开启,1后端管理员开启
private Integer blessId;//对应的福位
private Integer blessIdx;//bless idx 对应福位中哪一个
private String relation;//与往生者的关系
private String name;//往生者姓名
private Integer sex;//性别 0 0为男,1为女
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date birthday;//公历生日
private String birthdayStr;//公历生日
private String birthdayLunar;//农历生日
private String identify;//省份证号码
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date deathDay;//死亡公历日期
private String deathDayStr;
private String deathDayLunar;//死亡农历日期
private Integer usingWayAshes;//启用方式(骨灰)0否 1.是
private Integer usingWayKeepsake;//启用方式(其他) 0否 1是
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date usingTime;//晋塔安奉时间
private String usingTimeStr;
private Integer isYingling;//是否迎灵
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date yinglingTime;//迎灵时间
private String deathProve;//死亡证明
private String cremationProve;//火化证明
private BigDecimal money;//维护费
private String remarks;//备注
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//申请时间
private Integer state;//状态:0待审核;1:已开启;2未通过
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date reviewTime;//审核时间
private String reason;//拒绝理由
private Date updatetime;//更新时间
private Integer isDel;
private Integer templeId;//启用纪念馆id
private Integer enableId;//启用福位id
private Integer isMemory;//是否提醒
private String arrImg;//其他证明
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class UserPostVo implements Serializable {
private Integer id;//主键id
private Integer userId;//用户id
private Integer blessId;//福位id
private BigDecimal price;//邮费价格
private String name;//收件人
private String phone;//收件人电话
private String address;//收件地址
private Integer certificateType;//邮寄证书类型 0为功德证 1为福位证 2为捐款书
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date applyTime;//申请邮寄时间
private Integer type;//申请类型 0 首次申请;1补寄
private String postCompany;//物流公司
private String postNumber;//物流单号
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date postTime;//寄出时间
private Integer state;//状态:0未支付;1已支付待邮寄;2已寄出
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;//订单创建时间
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class UserVo implements Serializable{
private Integer id;
private String phone;
private String password;
private BigDecimal money;
private String pic;
private String name;
private String paymentPassword;//支付密码
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date lastLoginTime;
private Integer state;
private String sysToken;
private String openid;//微信的openid
private String identify;
private String identifyJustPic;
private String identifyBackPic;
private String province;
private String city;
private String area;
private String code;
private String address;
private Integer examine;
private String provinceCode;
private String cityCode;
private String areaCode;
}
package com.atlgroupasia.servicecenter.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class WalletRecordVo {
private Integer id;
private Integer userId;
private Integer payState;
private Integer operateId;
private Integer type;
private String remark;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private BigDecimal amount;
private Integer isDel;
}
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<!--<property name="LOG_HOME" value="/Users/Momo/Desktop/Momo/logs" />-->
<property name="LOG_HOME" value="/usr/local/antaile/api/logs" />
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/antaile.log.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>10MB</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- show parameters for hibernate sql 专为 Hibernate 定制 -->
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="TRACE"/>
<logger name="java.sql.Connection" level="DEBUG"/>
<logger name="java.sql.Statement" level="DEBUG"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
<!--日志异步到数据库 -->
<!--<appender name="DB" class="ch.qos.logback.classic.db.DBAppender">-->
<!--&lt;!&ndash;日志异步到数据库 &ndash;&gt;-->
<!--<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">-->
<!--&lt;!&ndash;连接池 &ndash;&gt;-->
<!--<dataSource class="com.mchange.v2.c3p0.ComboPooledDataSource">-->
<!--<driverClass>com.mysql.jdbc.Driver</driverClass>-->
<!--<url>jdbc:mysql://127.0.0.1:3306/databaseName</url>-->
<!--<user>root</user>-->
<!--<password>root</password>-->
<!--</dataSource>-->
<!--</connectionSource>-->
<!--</appender>-->
</configuration>
\ No newline at end of file
spring:
mvc:
view:
prefix: /WEB-INF/views/
suffix: .jsp
jackson:
# default-property-inclusion: non_null
serialization:
write_dates_as_timestamps: false
#���ݿ�����
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://lmerp001w.mysql.rds.aliyuncs.com/lmerp?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: test_erp
password: Fzii591com
type: com.alibaba.druid.pool.DruidDataSource
devtools:
restart:
enabled: true
additional-paths: src/main/java
#redis
redis:
# Redis数据库索引(默认为0)
database: 0
# Redis服务器地址
host: 47.98.96.174
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码(默认为空)
password: "root123!!"
#password: atl@redis_120726
jedis:
pool:
# 连接池最大连接数(使用负值表示没有限制)
max-active: 8
# 连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1
# 连接池中的最大空闲连接
max-idle: 8
# 连接池中的最小空闲连接
min-idle: 0
# 连接超时时间(毫秒)
timeout: 5000
server:
port: 8099
#����myba
#配置mybatis
mybatis:
mapper-locations: classpath:mapper/*.xml
#全局的映射,不用在xml文件写实体类的全路径
type-aliases-package: com.atlgroupasia.servicecenter
#开启驼峰映射
configuration:
map-underscore-to-camel-case: true
##配置分页插件
##pagehelper分页插件
#pagehelper:
# helper-dialect: mysql
# reasonable: true
# support-methods-arguments: true
# params: count=countSql
logging:
level:
com.atlgroupasia.servicecenter.servicecenter.mapper: debug
config:
classpath:Logback.xml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.ActivityMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findAllNoDel" parameterType="Date" resultType="com.atlgroupasia.servicecenter.dto.ActivityDto">
select * from osh_activity where is_del=0 and end_time >= NOW()
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.AreaMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.BlessEnableMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findAllNoDelByBlessId" parameterType="Integer"
resultType="com.atlgroupasia.servicecenter.dto.BlessEnableDto">
select * from osh_bless_enable
<where>
is_del=0 and bless_id = #{blessId}
</where>
</select>
<insert id="batchNewEntitys" parameterType="List">
insert into osh_bless_enable(user_id,bless_id,bless_index,create_time) values (?,?,?,?)
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</insert>
<insert id="batchNewEntity">
insert into osh_bless_enable(bless_id,bless_index,create_time,is_del) values (#{blessId},#{blessIndex},#{createTime},0)
</insert>
<select id="getForBless" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.entity.BlessEnable">
select * from osh_bless_enable
<where>
is_del = 0 and bless_id = #{blessId} and bless_index = #{blessIdx}
</where>
</select>
<update id="update" parameterType="com.atlgroupasia.servicecenter.entity.BlessEnable">
update osh_bless_enable set user_id = #{userId},enable_state = #{enableState}
<where>
id = #{id}
</where>
</update>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.BlessMapper">
<!--<sql id="List" >-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findMyBlessList" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.dto.TempleDto">
select * from drp_donor where is_del=0 and phone = #{phone}
</select>
<select id="findBlessUsingList" resultType="java.util.Map">
select distinct
b.id,
a.layer AS columnName,
a.serial_number as serialNumber,
IFNULL(b.name, '') as name,
date_format(b.death_day, '%Y-%m-%d') as deathDay,
IFNULL(d.name, '') as fashionName,
IFNULL(d.single_pic, '') as singlePic,
f.name AS templeName,
g.name AS layer
from mis_bless a
left join osh_user_bless_using b on b.bless_id = a.id
left join mis_memorial_hall_fashion d on d.id = a.fashion_id
LEFT JOIN mis_memorial_hall e ON e.id = a.memorial_hall_id
LEFT JOIN mis_temple f ON f.id = e.temple_id
LEFT JOIN mis_column g ON g.id = a.column_id
<where>
a.is_del = 0 AND b.death_day is NOT NULL and a.is_shelves = '0'
AND (a.code_number LIKE CONCAT('%',#{selectText},'%') OR a.serial_number LIKE CONCAT('%',#{selectText},'%') OR b.`name` LIKE CONCAT('%',#{selectText},'%'))
</where>
</select>
<select id="findConnectBlessUsingList" resultType="java.util.Map">
select distinct
b.id,
a.layer,
a.serial_number as serialNumber,
IFNULL(b.name, '') as name,
date_format(b.death_day, '%Y-%m-%d') as deathDay,
IFNULL(d.name, '') as fashionName,
IFNULL(d.single_pic, '') as singlePic,
f.name AS templeName,
g.name AS layer,
a.layer AS columnName
from mis_bless a
left join osh_user_bless_using b on b.bless_id = a.id
left join mis_memorial_hall_fashion d on d.id = a.fashion_id
LEFT JOIN mis_memorial_hall e ON e.id = a.memorial_hall_id
LEFT JOIN mis_temple f ON f.id = e.temple_id
LEFT JOIN mis_column g ON g.id = a.column_id
<where>
a.is_del = 0 AND b.death_day is NOT NULL and a.id in
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</where>
</select>
<select id="querySimpleBlessList" parameterType="String" resultType="com.atlgroupasia.servicecenter.dto.BlessDto">
select mb.*,mmhf.single_pic as fashionSinglePic,mt.name as temple_name,mt.id as temple_id,
mmhf.name as fashionName,mp.name as positionName,ms.number as person_number,
(select count(1) from drp_bless_bind bb where bb.bless_id = mb.id and is_del = 0 ) as bind_number,
ms.name as specificationsName,mc.name as columnName,mb.layer,mb.code_number
from mis_bless mb
left join mis_memorial_hall_fashion mmhf on mmhf.id=mb.fashion_id
left join mis_position mp on mp.id=mb.position_id
left join mis_specifications ms on ms.id=mb.specifications_id
left join mis_column mc on mc.id=mb.column_id
left join mis_temple mt on mt.id=mc.temple_id
<where>
mb.is_del = 0
and mb.id in
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</where>
group by mb.id
</select>
<select id="selectBless1" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.dto.BlessDto">
select mb.*,mc.name as columnName,mf.name as fashionName,mp.name as positionName,msp.name as specificationsName,
mmh.name as hallName,mmh.floor as floors,ddo.id as ddoId, ddo.numbers as ddoNumbers,ddo.donate_img as
donateImg,ddo.address as donateAddress,dd.name as ddName,dd.identify as
ddIdentify,mt.province as province,mt.city as city,mt.area as area, mt.address as address,
mt.name as templeName,mt.bless_voucher_pic as blessVoucherPic,mf.single_pic as coverPic,dd.id as donorId
from mis_bless mb left join mis_memorial_hall mmh on mb.memorial_hall_id = mmh.id
left join mis_temple mt on mt.id = mmh.temple_id
left join mis_memorial_hall_fashion mf on mb.fashion_id=mf.id left join mis_column mc on mc.id = mb.column_id
left join mis_specifications msp on msp.id = mb.specifications_id
left join mis_position mp on mp.id = mb.position_id
left join drp_donate_order_item doi on doi.bless_id = mb.id
left join drp_donate_order ddo on ddo.id = doi.order_id
left join drp_donor dd on dd.id=ddo.donor_id
<where>
mb.id = #{id} and mb.is_del = 0
</where>
</select>
<select id="selectBless" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.dto.BlessDto">
select mb.*,mc.name as columnName,mf.name as fashionName,mp.name as positionName,msp.name as specificationsName,
mmh.name as hallName,mmh.floor as floors,mt.province as province,mt.city as city,mt.area as area, mt.address as
address,
mt.name as templeName,mt.bless_voucher_pic as blessVoucherPic,mf.single_pic as coverPic
from mis_bless mb left join mis_memorial_hall mmh on mb.memorial_hall_id = mmh.id
left join mis_temple mt on mt.id = mmh.temple_id
left join mis_memorial_hall_fashion mf on mb.fashion_id=mf.id left join mis_column mc on mc.id = mb.column_id
left join mis_specifications msp on msp.id = mb.specifications_id
left join mis_position mp on mp.id = mb.position_id
<where>
mb.id = #{id} and mb.is_del = 0
</where>
</select>
<select id="findNoDel" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.entity.Bless">
select * from mis_bless
<where>
is_del=0 and id=#{id}
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.AreaMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.DonateOrderMapper">
<!--<sql id="List" >-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findMyOrder" parameterType="String" resultType="com.atlgroupasia.servicecenter.entity.DonateOrder">
<!--select-->
<!--<include refid="List"/>-->
<!--from drp_donor where is_del=0 and phone = #{phone}-->
select * from drp_donate_order where donor_id in (#{donorIds}) and is_del =0 and state =5;
</select>
<select id="findMyOrder1" parameterType="String" resultType="Integer">
<!--select-->
<!--<include refid="List"/>-->
<!--from drp_donor where is_del=0 and phone = #{phone}-->
select id from drp_donate_order where donor_id in (#{donorIds}) and is_del =0 and state =5;
</select>
<select id="findByBlessId" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.entity.DonateOrder">
SELECT *
FROM drp_donate_order
WHERE is_del=0
AND bless_ids
LIKE '%,"+blessId+",%' OR bless_ids LIKE '%,"+blessId+"%' OR bless_ids LIKE '%"+blessId+",%'
</select>
<select id="findOrderState5" parameterType="Integer" resultType="String">
select dd.linked_phone as phone from drp_donate_order dd
left join drp_donate_order_item ddoi on ddoi.order_id = dd.id
<where>
ddoi.bless_id = #{blessId} and ddoi.is_del = 0 and dd.is_del = 0 and dd.state = 5
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.DonorMapper">
<!--<sql id="List" >-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findNoDel" parameterType="com.atlgroupasia.servicecenter.entity.Donor" resultType="com.atlgroupasia.servicecenter.dto.DonorDto">
select * from drp_donor where is_del= 0 and phone = #{phone}
</select>
<select id="findNoDelByPhone" parameterType="String" resultType="com.atlgroupasia.servicecenter.entity.Donor">
select * from drp_donor where is_del= 0 and phone = #{phone}
</select>
<select id="findByIdentify" parameterType="String" resultType="com.atlgroupasia.servicecenter.entity.Donor">
select * from drp_donor
<where>
is_del=0 and identity = #{identity}
</where>
</select>
<insert id="batchEntity" parameterType="com.atlgroupasia.servicecenter.entity.Donor">
insert into drp_donor(company_id,name,pic,password,phone,identify,identify_just_pic,identify_back_pic,province_code,province,city,area,city_code,area_code,address,linked_name,linked_phone
,linked_bak_name,linked_bak_phone,authentication,create_time,is_service,is_del)
values (#{companyId},#{name},#{pic},#{password},#{phone},#{identify},#{identifyJustPic},#{identifyBackPic},#{provinceCode},#{province},#{city},#{area},#{cityCode},#{areaCode},#{address},#{linkedName},
#{linkedPhone},#{linkedBakName},#{linkedBakPhone},#{authentication},#{createTime},#{isService},0)
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.GiveRecordMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<insert id="batchEntity" parameterType="com.atlgroupasia.servicecenter.entity.GiveRecord">
insert into osh_give_record(user_id,give_user_id,refer_type,refer_id,bless_id,order_code,state,create_time,is_del)
values (#{userId},#{giveUserId},#{referType},#{referId},#{blessId},#{orderCode},#{state},#{createTime},#{state},0)
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.MaintainOrderMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findNoDelByBlessIdAndIdx" parameterType="com.atlgroupasia.servicecenter.entity.MaintainOrder" resultType="com.atlgroupasia.servicecenter.entity.MaintainOrder">
select * from drp_maintain_order where is_del=0 and bless_idx={blessIdx} and bless_id={blessId}
</select>
<insert id="batchNewEntity" parameterType="com.atlgroupasia.servicecenter.entity.MaintainOrder">
insert into drp_maintain_order(bless_id,bless_idx,maintain_price_id,pay_years,price,pay_money,pay_name,pay_type,pay_time,state,is_del)
values (#{blessId},#{blessIdx},#{maintainPriceId},#{payYears},#{price},#{payMoney},#{payName},#{payType},#{payTime},#{state},0)
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.MaintainPriceMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findNoDel" resultType="com.atlgroupasia.servicecenter.entity.MaintainPrice">
select * from osh_maintain_price
<where>
is_del=0 and specifications_id = #{specificationsId} and temple_id = #{templeId}
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.MemorialHallMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findNoDel" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.entity.MemorialHall">
select * from mis_memorial_hall where is_del=0 and id = #{memorialHallId}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.OshServicesAdMapper">
<select id="findList" resultType="java.util.Map">
select
id,
type,
url,
IFNULL(link_url, '') as linkUrl
from osh_services_ad
<where>
is_del = '0' and state = '1'
</where>
ORDER BY sort DESC
</select>
<select id="view" resultType="java.util.Map">
select
id,
title,
content
from osh_services_ad
<where>
id = #{id}
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.OshServicesMapper">
<select id="findList" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesVo" resultType="java.util.Map">
select distinct
a.id,
a.name,
a.first_pic as firstPic,
a.description,
b.is_combo as isCombo
from osh_services a
left join osh_services_type b on b.id = a.type
<where>
a.is_del = '0'
<if test="status != null and status != ''">
and a.status = #{status}
</if>
<if test="templeId != null and templeId != ''">
and a.temple_id = #{templeId}
</if>
<if test="name != null and name != ''">
and (a.name like concat('%',#{name},'%') or b.name like concat('%',#{name},'%'))
</if>
</where>
ORDER BY a.sort ASC
</select>
<select id="view" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesVo" resultType="java.util.Map">
select
id,
name,
price,
first_pic as firstPic,
IFNULL(pics, '') as pics,
remark,
content,
description
from osh_services a
<where>
is_del = '0' and id = #{id}
</where>
</select>
<select id="findSpecificationByServiceId" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesVo" resultType="java.util.Map">
select distinct
b.id,
d.name as specificationName,
d.price,
d.age_limit as ageLimit
from osh_services a
left join osh_services_specification_link b on b.service_id = a.id
left join osh_services_specification d on d.id = b.specification_id
<where>
a.is_del = '0' and b.is_del = '0' and a.status = '1'
<if test="id != null and id != ''">
and a.id = #{id}
</if>
</where>
ORDER BY d.sort ASC
</select>
<select id="getLowPrice" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesVo" resultType="java.util.Map">
select
b.id,
d.price
from osh_services a
left join osh_services_specification_link b on b.service_id = a.id
left join osh_services_specification d on d.id = b.specification_id
<where>
a.is_del = '0' and d.is_del = 0 and a.status = '1'
<if test="id != null and id != ''">
and a.id = #{id}
</if>
</where>
ORDER BY d.price ASC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.OshServicesOrderItemMapper">
<select id="findList" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesOrderItemVo"
resultType="java.util.Map">
select
a.id,
b.name as productName,
ss.price as price,
a.name as specificationName,
d.name as typeName,
IFNULL(b.first_pic, '') as firstPic,
a.num
from osh_services_order_item a
left join osh_services_specification_link e on e.id = a.product_link_id
left join osh_services_specification ss on ss.id = e.specification_id
left join osh_services b on b.id = e.service_id
left join osh_services_type d on d.id = b.type
<where>
a.is_del = '0'
<if test="orderId != null and orderId != ''">
and a.order_id = #{orderId}
</if>
</where>
ORDER BY a.price DESC
</select>
<select id="findItemList" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesOrderItemVo"
resultType="java.util.Map">
select
a.id,
b.name as productName,
b.price as productPrice,
a.name as specificationName,
b.first_pic as firstPic
from osh_services_order_item a
left join osh_services_specification_link d on d.id = a.product_link_id
left join osh_services b on b.id = d.service_id
<where>
a.is_del = '0'
<if test="orderId != null and orderId != ''">
and a.order_id = #{orderId}
</if>
</where>
ORDER BY a.price DESC
</select>
<insert id="insert" keyProperty="id" keyColumn="id" useGeneratedKeys="true">
INSERT INTO osh_services_order_item(order_id, product_link_id ,`name`, `num`, price, create_time, is_del)
VALUES(#{orderId}, #{productLinkId}, #{name}, #{num}, #{price}, NOW(), 0)
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.OshServicesOrderMapper">
<select id="findList" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesOrderVo" resultType="java.util.Map">
select distinct
a.id,
a.age_limit as ageLimit,
IFNULL(a.evaluate_level, '') as evaluateLevel,
IFNULL(d.name, '') as userName,
a.code,
a.status,
IFNULL(e.link_phone, '') as linkPhone,
a.total_price as tolalPrice,
date_format(a.confirm_time, '%Y-%m-%d ') AS confirmTime,
a.create_time as createTime,
IFNULL(a.remark, '') as remark,
IFNULL( b.serial_number, '') as codeNumber,
f.name AS templeName,
hf.name AS fashionName,
b.layer as columnName,
g.name AS layer
from osh_services_order a
left join osh_user_bless_using d on d.id = a.bless_using_id
left join mis_bless b on b.id = d.bless_id
LEFT JOIN mis_memorial_hall e ON e.id = b.memorial_hall_id
LEFT JOIN mis_temple f ON f.id = e.temple_id
LEFT JOIN mis_memorial_hall_fashion hf ON hf.id = b.fashion_id
LEFT JOIN mis_column g ON g.id = b.column_id
<where>
a.is_del = '0' and a.phone = #{phone}
<if test="status != null and status != '' and status != 3">
and a.status = #{status}
</if>
<if test="status == 1">
and a.create_time > date_sub(NOW(),interval 1 hour )
</if>
<if test="status == 2">
and a.confirm_time > NOW()
</if>
<if test="status == 3">
and a.status = '2' and NOW() > a.confirm_time
</if>
</where>
ORDER BY a.create_time DESC
</select>
<select id="view" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesOrderVo" resultType="java.util.Map">
SELECT
a.id,
a.remark,
b.serial_number AS serialNumber,
d.name AS userName,
f.name AS templeName,
g.name AS layer,
hf.name AS fashionName,
b.layer AS columnName,
a.code,
a.status,
a.total_price AS totalPrice,
date_format(a.confirm_time, '%Y-%m-%d') AS confirmTime,
date_format(a.create_time, '%Y-%m-%d') AS createTime
FROM
osh_services_order a
LEFT JOIN osh_user_bless_using d ON d.bless_id = a.bless_using_id
LEFT JOIN mis_bless b ON b.id = d.bless_id
LEFT JOIN mis_memorial_hall e ON e.id = b.memorial_hall_id
LEFT JOIN mis_temple f ON f.id = e.temple_id
LEFT JOIN mis_column g ON g.id = b.column_id
LEFT JOIN mis_memorial_hall_fashion hf ON hf.id = b.fashion_id
<where>
a.is_del = '0' and a.id = #{id}
</where>
</select>
<select id="findEvaluateList" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesOrderVo" resultType="java.util.Map">
select distinct
a.id,
d.name as serviceName,
s.name as specificationName,
a.nick_name as userName,
IFNULL(a.pic,'') as pic,
a.evaluate_level as evaluateLevel,
a.evaluate_text as evaluatetext
from osh_services_order a
left join osh_services_order_item i on i.order_id = a.id
left join osh_services_specification_link b on b.id = i.product_link_id
left join osh_services d on d.id = b.service_id
left join osh_services_specification s on s.id = b.specification_id
<where>
a.is_del = '0' and a.evaluate_time is not null
<if test="status != null and status != ''">
and i.product_link_id = #{producetId}
</if>
</where>
ORDER BY a.evaluate_time DESC
</select>
<select id="findRateListByOrderId" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesVo" resultType="java.util.Map">
select distinct
a.id
from osh_services_order a
left join osh_services_order_item b on b.order_id = a.id
left join osh_services_specification_link d on d.id = b.product_link_id
where a.is_del = '0' and a.evaluate_time is not null and a.evaluate_level > 3 and d.service_id = #{productId}
</select>
<select id="getViewByCode" parameterType="String" resultType="com.atlgroupasia.servicecenter.vo.OshServicesOrderVo">
select
id,
status,
total_price as totalPrice
from osh_services_order
where code = #{code}
</select>
<select id="evaluateView" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesOrderVo" resultType="java.util.Map">
select
a.id,
IFNULL( a.evaluate_level, '') as evaluateLevel,
IFNULL( a.evaluate_text, '') as evaluateText,
IFNULL(date_format(a.evaluate_time, '%Y-%m-%d %H'), '') as evaluateTime
from osh_services_order a
<where>
a.is_del = '0' and a.id = #{id}
</where>
</select>
<select id="videoAndImageList" parameterType="String" resultType="java.util.Map">
select
id,
IFNULL(image_urls, '') as imageUrls,
IFNULL(video_url, '') as videoUrl,
date_format(create_time, '%Y-%m-%d') as createTime
from osh_services_order_video
<where>
is_del = '0' and order_id = #{orderId}
</where>
</select>
<update id="evaluate" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesOrderVo">
update osh_services_order set
evaluate_level = #{evaluateLevel},
evaluate_text = #{evaluateText},
evaluate_time = NOW()
where id = #{id}
</update>
<update id="payOrder" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesOrderVo">
update osh_services_order set
pay_price = #{payPrice},
status = 2,
pay_way = 0,
pay_time = NOW()
where code = #{code}
</update>
<insert id="insert" keyProperty="id" keyColumn="id" useGeneratedKeys="true">
INSERT INTO osh_services_order(bless_using_id, code , phone, nick_name, pic, `sum`, age_limit, total_price, status, confirm_time,confirm_end_time, create_time, remark, is_del)
VALUES(#{blessUsingId}, #{code}, #{phone}, #{nickName}, #{pic}, #{sum}, #{ageLimit}, #{totalPrice}, 1 , #{confirmTime}, #{confirmEndTime}, NOW(), #{remark}, 0)
</insert>
<select id="findVideoListUnWatch" resultType="java.util.Map">
select
id,
is_watch as isWatch
from osh_services_order_video
<where>
is_del = 0 and order_id = #{orderId}
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.OshServicesOrderMessageMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.OshServicesOrderRecordMapper">
<insert id="insert" keyProperty="id" keyColumn="id" useGeneratedKeys="true">
INSERT INTO osh_services_order_record(order_id, state ,create_time, is_del)
VALUES(#{orderId}, #{state}, NOW(), 0)
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.OshServicesSpecificationMapper">
<select id="findList" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesSpecificationVo" resultType="java.util.Map">
select
id,
`name`
from osh_services_specification
<where>
is_del = '0'
<if test="type != null and type != ''">
and a.type = #{type}
</if>
</where>
ORDER BY sort DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.OshServicesTypeMapper">
<select id="findList" parameterType="com.atlgroupasia.servicecenter.vo.OshServicesTypeVo" resultType="java.util.Map">
select
id,
`name`,
image_url as imageUrl
from osh_services_type
<where>
is_del = '0'
<if test="isCombo != null and isCombo != ''">
and is_combo = #{isCombo}
</if>
</where>
ORDER BY sort DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.ParamsMapper">
<!--<sql id="List" >-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findNoDel" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.entity.OshParams">
select * from osh_params op
<where>
op.id=#{paramsId} and is_del=0
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.ProvinceMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.SmsMapper">
<resultMap id="BaseResultMap" type="com.atlgroupasia.servicecenter.entity.Sms">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="phoneNumber" jdbcType="VARCHAR" property="phonenumber" />
<result column="verifyCode" jdbcType="VARCHAR" property="verifycode" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
</resultMap>
<sql id="Base_Column_List">
id, type, phoneNumber, verifyCode, state, createTime
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sms
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sms
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.atlgroupasia.servicecenter.entity.Sms" keyProperty="id" keyColumn="id" useGeneratedKeys="true">
insert into sms (id, type, phoneNumber, verifyCode, state, createTime)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{phonenumber,jdbcType=VARCHAR},
#{verifycode,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER},
#{createtime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.atlgroupasia.servicecenter.entity.Sms">
insert into sms
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="type != null">
type,
</if>
<if test="phonenumber != null">
phoneNumber,
</if>
<if test="verifycode != null">
verifyCode,
</if>
<if test="state != null">
state,
</if>
<if test="createtime != null">
createTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="phonenumber != null">
#{phonenumber,jdbcType=VARCHAR},
</if>
<if test="verifycode != null">
#{verifycode,jdbcType=VARCHAR},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.atlgroupasia.servicecenter.entity.Sms">
update sms
<set>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="phonenumber != null">
phoneNumber = #{phonenumber,jdbcType=VARCHAR},
</if>
<if test="verifycode != null">
verifyCode = #{verifycode,jdbcType=VARCHAR},
</if>
<if test="state != null">
state = #{state,jdbcType=INTEGER},
</if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.atlgroupasia.servicecenter.entity.Sms">
update sms
set type = #{type,jdbcType=INTEGER},
phoneNumber = #{phonenumber,jdbcType=VARCHAR},
verifyCode = #{verifycode,jdbcType=VARCHAR},
state = #{state,jdbcType=INTEGER},
createTime = #{createtime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="getTime" resultType="java.lang.String">
select createTime
from sms where phoneNumber = #{mobile} and type = #{type}
order by createTime desc
limit 1
</select>
<update id="updateState">
UPDATE sms SET state = #{state} WHERE id= #{id}
</update>
<select id="getSmsVerifyCode" resultMap="BaseResultMap">
select
id,
type,
phoneNumber,
verifyCode,
state,
createTime
from sms
where 1=1
and phoneNumber = #{mobile}
and verifyCode = #{verifyCode}
and type = #{type}
and createTime &lt;= now()
order by id desc
limit 1
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.SpecificationsMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="find" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.entity.Specifications">
select * from mis_specifications where is_del=0 and id = #{specificationsId}
</select>
<select id="findNoDel" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.entity.Specifications">
select * from mis_specifications
<where>
is_del=0 and id=#{specificationsId}
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.TempleMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findByIds" parameterType="String" resultType="java.util.Map">
select id,name, create_time from mis_temple where id in
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.UserBlessUsingMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findAllNoDelcolumn" parameterType="Integer"
resultType="com.atlgroupasia.servicecenter.entity.UserBlessUsing">
select * from osh_user_bless_using where is_del=0 and bless_id = #{blessId}
</select>
<select id="findByBlessEnableId" parameterType="Integer"
resultType="com.atlgroupasia.servicecenter.entity.UserBlessUsing">
select * from osh_user_bless_using where is_del=0 and enable_id = #{blessEnableId}
</select>
<select id="selectRest" parameterType="Integer" resultType="com.atlgroupasia.servicecenter.dto.UserBlessUsingDto">
select ubu.*,mb.code_number as codeNumber,mb.serial_number as serialNumber,mc.name as columnName,mb.layer as
layer,
mf.name as fashionName,mp.name as positionName,msp.name as spName,mf.single_pic as pic,mt.name as
templeName,ou.name as adminName,oou.name as userName,
mmh.name as hallName,mmh.floor as floors
from osh_user_bless_using ubu left join mis_admin ou on ou.id = ubu.relation_id
left join mis_bless mb on ubu.bless_id = mb.id
left join osh_user oou on oou.id = ubu.relation_id
left join mis_memorial_hall mmh on mb.memorial_hall_id = mmh.id
left join mis_memorial_hall_fashion mf on mb.fashion_id=mf.id
left join mis_column mc on mc.id = mb.column_id
left join mis_specifications msp on msp.id = mb.specifications_id
left join mis_position mp on mp.id = mb.position_id
left join mis_temple mt on mt.id = mmh.temple_id
<where>
ubu.is_del = 0 and ubu.id=#{userBlessUsingId}
</where>
</select>
<insert id="batchNewEntity" parameterType="com.atlgroupasia.servicecenter.entity.UserBlessUsing">
insert into osh_user_bless_using(relation_id,type,bless_id,bless_idx,enable_id,temple_id,relation,name,sex,birthday,birthday_lunar,identify,death_day,death_day_lunar,using_way_ashes
,using_way_keepsake,using_time,death_prove,cremation_prove,is_memory,create_time,state,arr_img,is_del,money)
values (#{relationId},#{type},#{blessId},#{blessIdx},#{enableId},#{templeId},#{relation},#{name},#{sex},#{birthday},#{birthdayLunar},#{identify},#{deathDay}
,#{deathDayLunar},#{usingWayAshes},#{usingWayKeepsake},#{usingTime},#{deathProve},#{cremationProve},#{isMemory},#{createTime},#{state},#{arrImg},0,0)
</insert>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atlgroupasia.servicecenter.mapper.UserMapper">
<!--<sql id="List">-->
<!--id,-->
<!--name,-->
<!--a_id as aId-->
<!--</sql>-->
<select id="findNoDel" parameterType="String" resultType="com.atlgroupasia.servicecenter.entity.User">
select * from osh_user where is_del=0 and phone = #{phone}
</select>
<select id="getUserByMobile" parameterType="String" resultType="com.atlgroupasia.servicecenter.entity.User">
select id, phone, password, pic, state from osh_user where is_del=0 and phone = #{phone}
</select>
<update id="updateByPhone" >
update osh_user set name = #{name},openid=#{openId},password = #{password} where phone=#{phone}
</update>
<update id="updateToken">
update osh_user set sys_token = #{sysToken} where id = #{id}
</update>
<insert id="batchNewEntity">
insert into osh_user(phone)values (#{phone})
</insert>
</mapper>
debug=true
wx_debug=true
oss_debug=true
\ No newline at end of file
package com.atlgroupasia.servicecenter.servicecenter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest
@RunWith(SpringRunner.class)
class ServicecenterApplicationTests {
@Test
void contextLoads() {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment