| @@ -0,0 +1,447 @@ | |||||
| # | |||||
| # A fatal error has been detected by the Java Runtime Environment: | |||||
| # | |||||
| # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000073ea8225, pid=12036, tid=16124 | |||||
| # | |||||
| # JRE version: Java(TM) SE Runtime Environment (8.0_40-b25) (build 1.8.0_40-b25) | |||||
| # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.40-b25 mixed mode windows-amd64 compressed oops) | |||||
| # Problematic frame: | |||||
| # V [jvm.dll+0x128225] | |||||
| # | |||||
| # 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 (0x000000001a6b6000): JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=16124, stack(0x000000001ac10000,0x000000001ad10000)] | |||||
| siginfo: ExceptionCode=0xc0000005, reading address 0x000000000000009b | |||||
| Registers: | |||||
| RAX=0x000000001ad0f301, RBX=0x000000001a6b6000, RCX=0x000000000000009b, RDX=0x0000000000000000 | |||||
| RSP=0x000000001ad0f2e0, RBP=0x000000000000009b, RSI=0x000000001ad0f3f8, RDI=0x0000000003668570 | |||||
| R8 =0x000000001a6b6000, R9 =0x0000000000000001, R10=0x0000000000008000, R11=0x000000001ad0f230 | |||||
| R12=0x0000000000000000, R13=0x000000001a6be518, R14=0x0000000000000000, R15=0x0000000000000000 | |||||
| RIP=0x0000000073ea8225, EFLAGS=0x0000000000010202 | |||||
| Top of Stack: (sp=0x000000001ad0f2e0) | |||||
| 0x000000001ad0f2e0: 000000001a6b6000 000000001a6b6000 | |||||
| 0x000000001ad0f2f0: 000000001ad0f3a8 00000000740ac6db | |||||
| 0x000000001ad0f300: 000000001a6b6000 00000000740c8f3d | |||||
| 0x000000001ad0f310: 0000000000000000 00000000748d9155 | |||||
| 0x000000001ad0f320: 000000001eb5faf0 00000000748e291e | |||||
| 0x000000001ad0f330: 000000001a6b6000 0000000000000000 | |||||
| 0x000000001ad0f340: 0000000000000000 0000000000000000 | |||||
| 0x000000001ad0f350: 000000000000009b 00000000748e1a15 | |||||
| 0x000000001ad0f360: 000000001ad0f3f8 000000001ad0f3d0 | |||||
| 0x000000001ad0f370: 0000000000000001 000000001eb5faf0 | |||||
| 0x000000001ad0f380: 000000000000009b 00000000748c53b3 | |||||
| 0x000000001ad0f390: 000000001ad0f4c0 0000000000000001 | |||||
| 0x000000001ad0f3a0: 0000000000000001 000000001eb5faf0 | |||||
| 0x000000001ad0f3b0: 0000000000000001 0000000000000000 | |||||
| 0x000000001ad0f3c0: 0000000000000000 0000000000000000 | |||||
| 0x000000001ad0f3d0: 0000000000000001 00000000748c5571 | |||||
| Instructions: (pc=0x0000000073ea8225) | |||||
| 0x0000000073ea8205: cc cc cc cc cc cc cc cc cc cc cc 48 83 ec 28 48 | |||||
| 0x0000000073ea8215: 85 c9 75 07 33 c0 48 83 c4 28 c3 48 89 5c 24 20 | |||||
| 0x0000000073ea8225: 48 8b 19 48 85 db 74 20 48 83 fb 37 74 1a 48 8b | |||||
| 0x0000000073ea8235: 13 48 8b cb ff 52 10 84 c0 74 0d 48 8b c3 48 8b | |||||
| Register to memory mapping: | |||||
| RAX=0x000000001ad0f301 is pointing into the stack for thread: 0x000000001a6b6000 | |||||
| RBX=0x000000001a6b6000 is a thread | |||||
| RCX=0x000000000000009b is an unknown value | |||||
| RDX=0x0000000000000000 is an unknown value | |||||
| RSP=0x000000001ad0f2e0 is pointing into the stack for thread: 0x000000001a6b6000 | |||||
| RBP=0x000000000000009b is an unknown value | |||||
| RSI=0x000000001ad0f3f8 is pointing into the stack for thread: 0x000000001a6b6000 | |||||
| RDI=0x0000000003668570 is an unknown value | |||||
| R8 =0x000000001a6b6000 is a thread | |||||
| R9 =0x0000000000000001 is an unknown value | |||||
| R10=0x0000000000008000 is an unknown value | |||||
| R11=0x000000001ad0f230 is pointing into the stack for thread: 0x000000001a6b6000 | |||||
| R12=0x0000000000000000 is an unknown value | |||||
| R13=0x000000001a6be518 is an unknown value | |||||
| R14=0x0000000000000000 is an unknown value | |||||
| R15=0x0000000000000000 is an unknown value | |||||
| Stack: [0x000000001ac10000,0x000000001ad10000], sp=0x000000001ad0f2e0, free space=1020k | |||||
| Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) | |||||
| V [jvm.dll+0x128225] | |||||
| V [jvm.dll+0x348f3d] | |||||
| C [jdwp.dll+0x21a15] | |||||
| C [jdwp.dll+0x53b3] | |||||
| C [jdwp.dll+0x5571] | |||||
| C [jdwp.dll+0xf0a8] | |||||
| C [jdwp.dll+0x1f2d5] | |||||
| C [jdwp.dll+0x1f4aa] | |||||
| V [jvm.dll+0x1bad48] | |||||
| V [jvm.dll+0x241914] | |||||
| V [jvm.dll+0x29848a] | |||||
| C [msvcr100.dll+0x21d9f] | |||||
| C [msvcr100.dll+0x21e3b] | |||||
| C [KERNEL32.DLL+0x17bd4] | |||||
| C [ntdll.dll+0x6ce51] | |||||
| --------------- P R O C E S S --------------- | |||||
| Java Threads: ( => current thread ) | |||||
| 0x0000000020d0b000 JavaThread "lettuce-eventExecutorLoop-1-7" daemon [_thread_blocked, id=1316, stack(0x00000000313f0000,0x00000000314f0000)] | |||||
| 0x0000000020d0c800 JavaThread "XNIO-1 task-5" [_thread_blocked, id=1152, stack(0x0000000028a60000,0x0000000028b60000)] | |||||
| 0x0000000020d08800 JavaThread "lettuce-eventExecutorLoop-1-6" daemon [_thread_blocked, id=8320, stack(0x00000000312f0000,0x00000000313f0000)] | |||||
| 0x0000000020d08000 JavaThread "XNIO-1 task-4" [_thread_blocked, id=10324, stack(0x00000000311f0000,0x00000000312f0000)] | |||||
| 0x0000000020d04000 JavaThread "lettuce-eventExecutorLoop-1-5" daemon [_thread_blocked, id=6848, stack(0x00000000310f0000,0x00000000311f0000)] | |||||
| 0x0000000020d02800 JavaThread "XNIO-1 task-3" [_thread_blocked, id=9060, stack(0x0000000030ff0000,0x00000000310f0000)] | |||||
| 0x0000000020d02000 JavaThread "lettuce-eventExecutorLoop-1-4" daemon [_thread_blocked, id=15328, stack(0x0000000030ef0000,0x0000000030ff0000)] | |||||
| 0x0000000020cfe800 JavaThread "XNIO-1 task-2" [_thread_blocked, id=15688, stack(0x0000000030df0000,0x0000000030ef0000)] | |||||
| 0x0000000020d01000 JavaThread "lettuce-eventExecutorLoop-1-3" daemon [_thread_blocked, id=11512, stack(0x0000000030af0000,0x0000000030bf0000)] | |||||
| 0x0000000020d00000 JavaThread "lettuce-eventExecutorLoop-1-2" daemon [_thread_blocked, id=11368, stack(0x00000000309f0000,0x0000000030af0000)] | |||||
| 0x0000000020d05800 JavaThread "lettuce-eventExecutorLoop-1-1" daemon [_thread_blocked, id=6732, stack(0x000000002ddf0000,0x000000002def0000)] | |||||
| 0x0000000020cfe000 JavaThread "lettuce-nioEventLoop-4-1" daemon [_thread_in_native, id=10212, stack(0x000000002b890000,0x000000002b990000)] | |||||
| 0x0000000020cff800 JavaThread "SessionValidationThread-1" daemon [_thread_blocked, id=13544, stack(0x0000000001790000,0x0000000001890000)] | |||||
| 0x0000000020d05000 JavaThread "XNIO-1 task-1" [_thread_blocked, id=12528, stack(0x0000000001690000,0x0000000001790000)] | |||||
| 0x0000000020d03800 JavaThread "DestroyJavaVM" [_thread_blocked, id=16312, stack(0x0000000003540000,0x0000000003640000)] | |||||
| 0x00000000200bd000 JavaThread "XNIO-1 Accept" [_thread_in_native, id=12964, stack(0x000000002f220000,0x000000002f320000)] | |||||
| 0x00000000200bc000 JavaThread "XNIO-1 I/O-8" [_thread_in_native, id=2240, stack(0x000000002f120000,0x000000002f220000)] | |||||
| 0x00000000200ba800 JavaThread "XNIO-1 I/O-7" [_thread_in_native, id=4428, stack(0x000000002f020000,0x000000002f120000)] | |||||
| 0x00000000200ba000 JavaThread "XNIO-1 I/O-6" [_thread_in_native, id=13256, stack(0x000000002ef20000,0x000000002f020000)] | |||||
| 0x00000000200b2800 JavaThread "XNIO-1 I/O-5" [_thread_in_native, id=10604, stack(0x000000002ee20000,0x000000002ef20000)] | |||||
| 0x00000000200b7000 JavaThread "XNIO-1 I/O-4" [_thread_in_native, id=12592, stack(0x000000002ed20000,0x000000002ee20000)] | |||||
| 0x00000000200b9000 JavaThread "XNIO-1 I/O-3" [_thread_in_native, id=7584, stack(0x000000002e380000,0x000000002e480000)] | |||||
| 0x00000000200b5800 JavaThread "XNIO-1 I/O-2" [_thread_in_native, id=16228, stack(0x000000002e280000,0x000000002e380000)] | |||||
| 0x00000000200b4800 JavaThread "XNIO-1 I/O-1" [_thread_in_native, id=13056, stack(0x000000002def0000,0x000000002dff0000)] | |||||
| 0x00000000200b6000 JavaThread "logback-8" daemon [_thread_blocked, id=13340, stack(0x000000002db30000,0x000000002dc30000)] | |||||
| 0x00000000200b7800 JavaThread "logback-7" daemon [_thread_blocked, id=100, stack(0x0000000001590000,0x0000000001690000)] | |||||
| 0x00000000200b1000 JavaThread "quartzScheduler_QuartzSchedulerThread" [_thread_blocked, id=14452, stack(0x000000002ec20000,0x000000002ed20000)] | |||||
| 0x00000000200b0000 JavaThread "quartzScheduler_Worker-10" [_thread_blocked, id=4452, stack(0x000000002eb20000,0x000000002ec20000)] | |||||
| 0x00000000200ae800 JavaThread "quartzScheduler_Worker-9" [_thread_blocked, id=16488, stack(0x000000002ea20000,0x000000002eb20000)] | |||||
| 0x00000000200b3000 JavaThread "quartzScheduler_Worker-8" [_thread_blocked, id=10376, stack(0x000000002e920000,0x000000002ea20000)] | |||||
| 0x00000000200b1800 JavaThread "quartzScheduler_Worker-7" [_thread_blocked, id=16016, stack(0x000000002e820000,0x000000002e920000)] | |||||
| 0x00000000200af800 JavaThread "quartzScheduler_Worker-6" [_thread_blocked, id=2816, stack(0x000000002e720000,0x000000002e820000)] | |||||
| 0x0000000020cfb800 JavaThread "quartzScheduler_Worker-5" [_thread_blocked, id=15152, stack(0x000000002e620000,0x000000002e720000)] | |||||
| 0x0000000020cf8000 JavaThread "quartzScheduler_Worker-4" [_thread_blocked, id=17172, stack(0x000000002e520000,0x000000002e620000)] | |||||
| 0x000000002296d800 JavaThread "quartzScheduler_Worker-3" [_thread_blocked, id=8972, stack(0x000000002dcf0000,0x000000002ddf0000)] | |||||
| 0x000000002296c800 JavaThread "quartzScheduler_Worker-2" [_thread_blocked, id=16532, stack(0x000000002d610000,0x000000002d710000)] | |||||
| 0x000000002296c000 JavaThread "quartzScheduler_Worker-1" [_thread_blocked, id=13484, stack(0x000000002cdb0000,0x000000002ceb0000)] | |||||
| 0x000000002296b000 JavaThread "IdleConnectionMonitorThread" daemon [_thread_blocked, id=6000, stack(0x000000002ca10000,0x000000002cb10000)] | |||||
| 0x0000000022969800 JavaThread "flowable-reset-expired-jobs" [_thread_blocked, id=15068, stack(0x000000002c910000,0x000000002ca10000)] | |||||
| 0x0000000022962000 JavaThread "flowable-acquire-timer-jobs" [_thread_blocked, id=11808, stack(0x000000002c810000,0x000000002c910000)] | |||||
| 0x0000000022969000 JavaThread "flowable-acquire-async-jobs" [_thread_blocked, id=11848, stack(0x000000002b9c0000,0x000000002bac0000)] | |||||
| 0x0000000022968000 JavaThread "logback-6" daemon [_thread_blocked, id=15164, stack(0x0000000022330000,0x0000000022430000)] | |||||
| 0x0000000022965000 JavaThread "logback-5" daemon [_thread_blocked, id=4184, stack(0x0000000020960000,0x0000000020a60000)] | |||||
| 0x0000000022960800 JavaThread "logback-4" daemon [_thread_blocked, id=6808, stack(0x000000002c0c0000,0x000000002c1c0000)] | |||||
| 0x0000000022964800 JavaThread "Druid-ConnectionPool-Destroy-191345497" daemon [_thread_blocked, id=5608, stack(0x000000002a4a0000,0x000000002a5a0000)] | |||||
| 0x0000000022963800 JavaThread "Druid-ConnectionPool-Create-191345497" daemon [_thread_blocked, id=2820, stack(0x0000000028090000,0x0000000028190000)] | |||||
| 0x0000000022966800 JavaThread "mysql-cj-abandoned-connection-cleanup" daemon [_thread_blocked, id=5096, stack(0x0000000027a00000,0x0000000027b00000)] | |||||
| 0x000000002295e800 JavaThread "IdleConnectionMonitorThread" daemon [_thread_blocked, id=5416, stack(0x000000002b790000,0x000000002b890000)] | |||||
| 0x0000000020cf7800 JavaThread "commons-pool-evictor-thread" daemon [_thread_blocked, id=6652, stack(0x0000000028560000,0x0000000028660000)] | |||||
| 0x0000000020cfd000 JavaThread "logback-3" daemon [_thread_blocked, id=1700, stack(0x00000000236b0000,0x00000000237b0000)] | |||||
| 0x0000000027418800 JavaThread "logback-2" daemon [_thread_blocked, id=10940, stack(0x00000000254d0000,0x00000000255d0000)] | |||||
| 0x000000001eb1b000 JavaThread "logback-1" daemon [_thread_blocked, id=11296, stack(0x0000000020ae0000,0x0000000020be0000)] | |||||
| 0x000000001ba33000 JavaThread "Service Thread" daemon [_thread_blocked, id=14292, stack(0x000000001cae0000,0x000000001cbe0000)] | |||||
| 0x000000001b9a7800 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=16036, stack(0x000000001c9e0000,0x000000001cae0000)] | |||||
| 0x000000001b9a7000 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=11920, stack(0x000000001c8e0000,0x000000001c9e0000)] | |||||
| 0x000000001b9a4000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=15668, stack(0x000000001c7e0000,0x000000001c8e0000)] | |||||
| 0x000000001b9a3800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=6432, stack(0x000000001c6e0000,0x000000001c7e0000)] | |||||
| 0x000000001a6c4800 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=17316, stack(0x000000001ae10000,0x000000001af10000)] | |||||
| 0x000000001a6c1800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=13888, stack(0x000000001ad10000,0x000000001ae10000)] | |||||
| =>0x000000001a6b6000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=16124, stack(0x000000001ac10000,0x000000001ad10000)] | |||||
| 0x000000001a6a5800 JavaThread "Attach Listener" daemon [_thread_blocked, id=13364, stack(0x000000001ab10000,0x000000001ac10000)] | |||||
| 0x000000001a658000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=15696, stack(0x000000001aa10000,0x000000001ab10000)] | |||||
| 0x0000000018647000 JavaThread "Finalizer" daemon [_thread_blocked, id=6740, stack(0x000000001a510000,0x000000001a610000)] | |||||
| 0x0000000018640000 JavaThread "Reference Handler" daemon [_thread_blocked, id=11248, stack(0x000000001a410000,0x000000001a510000)] | |||||
| Other Threads: | |||||
| 0x000000001863c000 VMThread [stack: 0x000000001a310000,0x000000001a410000] [id=2104] | |||||
| 0x000000001b996800 WatcherThread [stack: 0x000000001cbe0000,0x000000001cce0000] [id=5012] | |||||
| VM state:not at safepoint (normal execution) | |||||
| VM Mutex/Monitor currently owned by a thread: None | |||||
| Heap: | |||||
| PSYoungGen total 608768K, used 148173K [0x00000000d6f80000, 0x00000000ff900000, 0x0000000100000000) | |||||
| eden space 561664K, 22% used [0x00000000d6f80000,0x00000000decf3450,0x00000000f9400000) | |||||
| from space 47104K, 41% used [0x00000000fcb00000,0x00000000fde40168,0x00000000ff900000) | |||||
| to space 51712K, 0% used [0x00000000f9400000,0x00000000f9400000,0x00000000fc680000) | |||||
| ParOldGen total 259072K, used 124005K [0x0000000084e00000, 0x0000000094b00000, 0x00000000d6f80000) | |||||
| object space 259072K, 47% used [0x0000000084e00000,0x000000008c719700,0x0000000094b00000) | |||||
| Metaspace used 104981K, capacity 109236K, committed 109388K, reserved 1144832K | |||||
| class space used 12421K, capacity 13132K, committed 13184K, reserved 1048576K | |||||
| Card table byte_map: [0x0000000012c30000,0x0000000013010000] byte_map_base: 0x0000000012809000 | |||||
| Marking Bits: (ParMarkBitMap*) 0x0000000074584040 | |||||
| Begin Bits: [0x0000000013ab0000, 0x0000000015978000) | |||||
| End Bits: [0x0000000015978000, 0x0000000017840000) | |||||
| Polling page: 0x0000000000ff0000 | |||||
| CodeCache: size=245760Kb used=42160Kb max_used=44552Kb free=203599Kb | |||||
| bounds [0x0000000003870000, 0x0000000006430000, 0x0000000012870000] | |||||
| total_blobs=11285 nmethods=10620 adapters=584 | |||||
| compilation: enabled | |||||
| Compilation events (10 events): | |||||
| Event: 854.559 Thread 0x000000001b9a7800 14202 3 org.apache.ibatis.ognl.OgnlContext::getCurrentType (38 bytes) | |||||
| Event: 854.560 Thread 0x000000001b9a7800 nmethod 14202 0x0000000004a09390 code [0x0000000004a09520, 0x0000000004a09a08] | |||||
| Event: 854.563 Thread 0x000000001b9a7800 14203 3 org.apache.ibatis.ognl.OgnlContext::getPreviousType (53 bytes) | |||||
| Event: 854.563 Thread 0x000000001b9a7800 nmethod 14203 0x00000000056022d0 code [0x0000000005602480, 0x0000000005602a78] | |||||
| Event: 854.566 Thread 0x000000001b9a7800 14204 3 org.apache.ibatis.ognl.enhance.ExpressionCompiler::getInterfaceClass (51 bytes) | |||||
| Event: 854.567 Thread 0x000000001b9a7800 nmethod 14204 0x00000000056c05d0 code [0x00000000056c07c0, 0x00000000056c1028] | |||||
| Event: 854.567 Thread 0x000000001b9a7800 14205 ! 3 org.apache.ibatis.ognl.OgnlRuntime::getIndexedPropertyType (86 bytes) | |||||
| Event: 854.570 Thread 0x000000001b9a7800 nmethod 14205 0x0000000003fd3490 code [0x0000000003fd36e0, 0x0000000003fd4608] | |||||
| Event: 854.570 Thread 0x000000001b9a7800 14206 3 org.apache.ibatis.ognl.OgnlRuntime::getPropertyDescriptor (20 bytes) | |||||
| Event: 854.570 Thread 0x000000001b9a7800 nmethod 14206 0x0000000003ead390 code [0x0000000003ead520, 0x0000000003ead898] | |||||
| GC Heap History (10 events): | |||||
| Event: 54.739 GC heap before | |||||
| {Heap before GC invocations=24 (full 3): | |||||
| PSYoungGen total 631808K, used 622941K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 595456K, 100% used [0x00000000d6f80000,0x00000000fb500000,0x00000000fb500000) | |||||
| from space 36352K, 75% used [0x00000000fdc80000,0x00000000ff757438,0x0000000100000000) | |||||
| to space 38400K, 0% used [0x00000000fb500000,0x00000000fb500000,0x00000000fda80000) | |||||
| ParOldGen total 169472K, used 70174K [0x0000000084e00000, 0x000000008f380000, 0x00000000d6f80000) | |||||
| object space 169472K, 41% used [0x0000000084e00000,0x0000000089287890,0x000000008f380000) | |||||
| Metaspace used 82522K, capacity 85534K, committed 85760K, reserved 1124352K | |||||
| class space used 9947K, capacity 10483K, committed 10496K, reserved 1048576K | |||||
| Event: 54.765 GC heap after | |||||
| Heap after GC invocations=24 (full 3): | |||||
| PSYoungGen total 633856K, used 38394K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 595456K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000fb500000) | |||||
| from space 38400K, 99% used [0x00000000fb500000,0x00000000fda7eb78,0x00000000fda80000) | |||||
| to space 38400K, 0% used [0x00000000fda80000,0x00000000fda80000,0x0000000100000000) | |||||
| ParOldGen total 169472K, used 70790K [0x0000000084e00000, 0x000000008f380000, 0x00000000d6f80000) | |||||
| object space 169472K, 41% used [0x0000000084e00000,0x0000000089321b90,0x000000008f380000) | |||||
| Metaspace used 82522K, capacity 85534K, committed 85760K, reserved 1124352K | |||||
| class space used 9947K, capacity 10483K, committed 10496K, reserved 1048576K | |||||
| } | |||||
| Event: 59.357 GC heap before | |||||
| {Heap before GC invocations=25 (full 3): | |||||
| PSYoungGen total 633856K, used 633850K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 595456K, 100% used [0x00000000d6f80000,0x00000000fb500000,0x00000000fb500000) | |||||
| from space 38400K, 99% used [0x00000000fb500000,0x00000000fda7eb78,0x00000000fda80000) | |||||
| to space 38400K, 0% used [0x00000000fda80000,0x00000000fda80000,0x0000000100000000) | |||||
| ParOldGen total 169472K, used 70790K [0x0000000084e00000, 0x000000008f380000, 0x00000000d6f80000) | |||||
| object space 169472K, 41% used [0x0000000084e00000,0x0000000089321b90,0x000000008f380000) | |||||
| Metaspace used 93240K, capacity 96872K, committed 97024K, reserved 1134592K | |||||
| class space used 11076K, capacity 11702K, committed 11776K, reserved 1048576K | |||||
| Event: 59.504 GC heap after | |||||
| Heap after GC invocations=25 (full 3): | |||||
| PSYoungGen total 598016K, used 38373K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 559616K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000f9200000) | |||||
| from space 38400K, 99% used [0x00000000fda80000,0x00000000ffff9548,0x0000000100000000) | |||||
| to space 56320K, 0% used [0x00000000f9200000,0x00000000f9200000,0x00000000fc900000) | |||||
| ParOldGen total 169472K, used 91761K [0x0000000084e00000, 0x000000008f380000, 0x00000000d6f80000) | |||||
| object space 169472K, 54% used [0x0000000084e00000,0x000000008a79c4c8,0x000000008f380000) | |||||
| Metaspace used 93240K, capacity 96872K, committed 97024K, reserved 1134592K | |||||
| class space used 11076K, capacity 11702K, committed 11776K, reserved 1048576K | |||||
| } | |||||
| Event: 60.001 GC heap before | |||||
| {Heap before GC invocations=26 (full 3): | |||||
| PSYoungGen total 598016K, used 106501K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 559616K, 12% used [0x00000000d6f80000,0x00000000db207ff8,0x00000000f9200000) | |||||
| from space 38400K, 99% used [0x00000000fda80000,0x00000000ffff9548,0x0000000100000000) | |||||
| to space 56320K, 0% used [0x00000000f9200000,0x00000000f9200000,0x00000000fc900000) | |||||
| ParOldGen total 169472K, used 91761K [0x0000000084e00000, 0x000000008f380000, 0x00000000d6f80000) | |||||
| object space 169472K, 54% used [0x0000000084e00000,0x000000008a79c4c8,0x000000008f380000) | |||||
| Metaspace used 94683K, capacity 98274K, committed 98380K, reserved 1136640K | |||||
| class space used 11253K, capacity 11869K, committed 11904K, reserved 1048576K | |||||
| Event: 60.027 GC heap after | |||||
| Heap after GC invocations=26 (full 3): | |||||
| PSYoungGen total 615936K, used 16402K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 559616K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000f9200000) | |||||
| from space 56320K, 29% used [0x00000000f9200000,0x00000000fa2049e0,0x00000000fc900000) | |||||
| to space 54272K, 0% used [0x00000000fcb00000,0x00000000fcb00000,0x0000000100000000) | |||||
| ParOldGen total 169472K, used 115890K [0x0000000084e00000, 0x000000008f380000, 0x00000000d6f80000) | |||||
| object space 169472K, 68% used [0x0000000084e00000,0x000000008bf2ca20,0x000000008f380000) | |||||
| Metaspace used 94683K, capacity 98274K, committed 98380K, reserved 1136640K | |||||
| class space used 11253K, capacity 11869K, committed 11904K, reserved 1048576K | |||||
| } | |||||
| Event: 60.027 GC heap before | |||||
| {Heap before GC invocations=27 (full 4): | |||||
| PSYoungGen total 615936K, used 16402K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 559616K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000f9200000) | |||||
| from space 56320K, 29% used [0x00000000f9200000,0x00000000fa2049e0,0x00000000fc900000) | |||||
| to space 54272K, 0% used [0x00000000fcb00000,0x00000000fcb00000,0x0000000100000000) | |||||
| ParOldGen total 169472K, used 115890K [0x0000000084e00000, 0x000000008f380000, 0x00000000d6f80000) | |||||
| object space 169472K, 68% used [0x0000000084e00000,0x000000008bf2ca20,0x000000008f380000) | |||||
| Metaspace used 94683K, capacity 98274K, committed 98380K, reserved 1136640K | |||||
| class space used 11253K, capacity 11869K, committed 11904K, reserved 1048576K | |||||
| Event: 60.411 GC heap after | |||||
| Heap after GC invocations=27 (full 4): | |||||
| PSYoungGen total 615936K, used 0K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 559616K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000f9200000) | |||||
| from space 56320K, 0% used [0x00000000f9200000,0x00000000f9200000,0x00000000fc900000) | |||||
| to space 54272K, 0% used [0x00000000fcb00000,0x00000000fcb00000,0x0000000100000000) | |||||
| ParOldGen total 259072K, used 123997K [0x0000000084e00000, 0x0000000094b00000, 0x00000000d6f80000) | |||||
| object space 259072K, 47% used [0x0000000084e00000,0x000000008c717700,0x0000000094b00000) | |||||
| Metaspace used 94683K, capacity 98274K, committed 98380K, reserved 1136640K | |||||
| class space used 11253K, capacity 11869K, committed 11904K, reserved 1048576K | |||||
| } | |||||
| Event: 230.903 GC heap before | |||||
| {Heap before GC invocations=28 (full 4): | |||||
| PSYoungGen total 615936K, used 559616K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 559616K, 100% used [0x00000000d6f80000,0x00000000f9200000,0x00000000f9200000) | |||||
| from space 56320K, 0% used [0x00000000f9200000,0x00000000f9200000,0x00000000fc900000) | |||||
| to space 54272K, 0% used [0x00000000fcb00000,0x00000000fcb00000,0x0000000100000000) | |||||
| ParOldGen total 259072K, used 123997K [0x0000000084e00000, 0x0000000094b00000, 0x00000000d6f80000) | |||||
| object space 259072K, 47% used [0x0000000084e00000,0x000000008c717700,0x0000000094b00000) | |||||
| Metaspace used 99900K, capacity 103790K, committed 103884K, reserved 1140736K | |||||
| class space used 11821K, capacity 12479K, committed 12544K, reserved 1048576K | |||||
| Event: 230.921 GC heap after | |||||
| Heap after GC invocations=28 (full 4): | |||||
| PSYoungGen total 608768K, used 19712K [0x00000000d6f80000, 0x00000000ff900000, 0x0000000100000000) | |||||
| eden space 561664K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000f9400000) | |||||
| from space 47104K, 41% used [0x00000000fcb00000,0x00000000fde40168,0x00000000ff900000) | |||||
| to space 51712K, 0% used [0x00000000f9400000,0x00000000f9400000,0x00000000fc680000) | |||||
| ParOldGen total 259072K, used 124005K [0x0000000084e00000, 0x0000000094b00000, 0x00000000d6f80000) | |||||
| object space 259072K, 47% used [0x0000000084e00000,0x000000008c719700,0x0000000094b00000) | |||||
| Metaspace used 99900K, capacity 103790K, committed 103884K, reserved 1140736K | |||||
| class space used 11821K, capacity 12479K, committed 12544K, reserved 1048576K | |||||
| } | |||||
| Deoptimization events (10 events): | |||||
| Event: 445.785 Thread 0x0000000020cfe800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000003ac48c0 method=java.util.AbstractList$Itr.next()Ljava/lang/Object; @ 14 | |||||
| Event: 602.775 Thread 0x0000000020d02800 Uncommon trap: reason=range_check action=none pc=0x0000000003c889dc method=sun.reflect.generics.parser.SignatureParser.current()C @ 34 | |||||
| Event: 602.818 Thread 0x0000000020d02800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000004f5680c method=java.util.Date.normalize()Lsun/util/calendar/BaseCalendar$Date; @ 45 | |||||
| Event: 602.899 Thread 0x0000000020d02800 Uncommon trap: reason=unhandled action=none pc=0x0000000003a1a708 method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 602.987 Thread 0x0000000020d02800 Uncommon trap: reason=unhandled action=none pc=0x0000000003a1a708 method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 602.991 Thread 0x0000000020d02800 Uncommon trap: reason=unhandled action=none pc=0x0000000003a1a708 method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 602.997 Thread 0x0000000020d02800 Uncommon trap: reason=unhandled action=none pc=0x0000000003a1a708 method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 602.999 Thread 0x0000000020d02800 Uncommon trap: reason=unhandled action=none pc=0x0000000003a1a708 method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 603.044 Thread 0x0000000020d02800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000003ac48c0 method=java.util.AbstractList$Itr.next()Ljava/lang/Object; @ 14 | |||||
| Event: 714.941 Thread 0x0000000020d08000 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000003ac48c0 method=java.util.AbstractList$Itr.next()Ljava/lang/Object; @ 14 | |||||
| Internal exceptions (10 events): | |||||
| Event: 711.696 Thread 0x0000000020d08000 Exception <a 'java/lang/reflect/InvocationTargetException'> (0x00000000ddac4d18) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\runtime\reflection.cpp, line 1080] | |||||
| Event: 711.696 Thread 0x0000000020d08000 Exception <a 'java/lang/reflect/InvocationTargetException'> (0x00000000ddac5510) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\runtime\reflection.cpp, line 1080] | |||||
| Event: 711.697 Thread 0x0000000020d08000 Exception <a 'java/lang/reflect/InvocationTargetException'> (0x00000000ddac5d08) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\runtime\reflection.cpp, line 1080] | |||||
| Event: 711.697 Thread 0x0000000020d08000 Exception <a 'java/lang/reflect/InvocationTargetException'> (0x00000000ddac6500) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\runtime\reflection.cpp, line 1080] | |||||
| Event: 711.701 Thread 0x0000000020d08000 Exception <a 'java/lang/reflect/InvocationTargetException'> (0x00000000ddadd0f0) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\runtime\reflection.cpp, line 1080] | |||||
| Event: 711.990 Thread 0x0000000020d08000 Exception <a 'java/lang/ClassNotFoundException': java/lang/ObjectCustomizer> (0x00000000ddf4f6a0) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 210] | |||||
| Event: 711.991 Thread 0x0000000020d08000 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 22> (0x00000000ddf52c00) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\interpreter\interpreterRuntime.cpp, line 366] | |||||
| Event: 712.000 Thread 0x0000000020d08000 Exception <a 'java/lang/ClassNotFoundException': org/springframework/jdbc/support/SQLErrorCodesCustomizer> (0x00000000ddf9bee8) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\classfile\systemDictionary.cpp, line§%±ÿ@†@ | |||||
| Event: 712.003 Thread 0x0000000020d08000 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 80> (0x00000000ddfaae80) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\interpreter\interpreterRuntime.cpp, line 366] | |||||
| Event: 714.915 Thread 0x0000000020d08000 Exception <a 'java/lang/reflect/InvocationTargetException'> (0x00000000de196358) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\runtime\reflection.cpp, line 1080] | |||||
| Events (10 events): | |||||
| Event: 840.729 Thread 0x000000001b9a3800 flushing nmethod 0x000000000574fa10 | |||||
| Event: 840.729 Thread 0x000000001b9a3800 flushing nmethod 0x0000000005757850 | |||||
| Event: 840.729 Thread 0x000000001b9a3800 flushing nmethod 0x000000000576ca10 | |||||
| Event: 850.879 Thread 0x000000001b9a4000 flushing nmethod 0x00000000057d1590 | |||||
| Event: 850.879 Thread 0x000000001b9a4000 flushing nmethod 0x000000000583b990 | |||||
| Event: 854.561 Thread 0x000000001b9a7800 flushing nmethod 0x0000000005e4d850 | |||||
| Event: 860.771 Executing VM operation: RevokeBias | |||||
| Event: 860.771 Executing VM operation: RevokeBias done | |||||
| Event: 863.930 Executing VM operation: RedefineClasses | |||||
| Event: 864.011 Executing VM operation: RedefineClasses done | |||||
| Dynamic libraries: | |||||
| 0x00007ff7c2ea0000 - 0x00007ff7c2ed7000 C:\soft-install\JDK8\JDK8\bin\javaw.exe | |||||
| 0x00007ff808320000 - 0x00007ff808510000 C:\WINDOWS\SYSTEM32\ntdll.dll | |||||
| 0x00007ff8063d0000 - 0x00007ff806482000 C:\WINDOWS\System32\KERNEL32.DLL | |||||
| 0x00007ff805880000 - 0x00007ff805b24000 C:\WINDOWS\System32\KERNELBASE.dll | |||||
| 0x00007ff806be0000 - 0x00007ff806c83000 C:\WINDOWS\System32\ADVAPI32.dll | |||||
| 0x00007ff806c90000 - 0x00007ff806d2e000 C:\WINDOWS\System32\msvcrt.dll | |||||
| 0x00007ff807280000 - 0x00007ff807317000 C:\WINDOWS\System32\sechost.dll | |||||
| 0x00007ff807610000 - 0x00007ff807730000 C:\WINDOWS\System32\RPCRT4.dll | |||||
| 0x00007ff806a40000 - 0x00007ff806bd5000 C:\WINDOWS\System32\USER32.dll | |||||
| 0x00007ff8055c0000 - 0x00007ff8055e1000 C:\WINDOWS\System32\win32u.dll | |||||
| 0x00007ff806a10000 - 0x00007ff806a36000 C:\WINDOWS\System32\GDI32.dll | |||||
| 0x00007ff8053f0000 - 0x00007ff805586000 C:\WINDOWS\System32\gdi32full.dll | |||||
| 0x00007ff805770000 - 0x00007ff80580e000 C:\WINDOWS\System32\msvcp_win.dll | |||||
| 0x00007ff8055f0000 - 0x00007ff8056ea000 C:\WINDOWS\System32\ucrtbase.dll | |||||
| 0x00007ffff59e0000 - 0x00007ffff5c64000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.1016_none_9e7a36bbe461dae4\COMCTL32.dll | |||||
| 0x00007ff807e20000 - 0x00007ff808155000 C:\WINDOWS\System32\combase.dll | |||||
| 0x00007ff8056f0000 - 0x00007ff805770000 C:\WINDOWS\System32\bcryptPrimitives.dll | |||||
| 0x00007ff8071e0000 - 0x00007ff80720e000 C:\WINDOWS\System32\IMM32.DLL | |||||
| 0x0000000074900000 - 0x00000000749d2000 C:\soft-install\JDK8\JDK8\jre\bin\msvcr100.dll | |||||
| 0x0000000073d80000 - 0x0000000074603000 C:\soft-install\JDK8\JDK8\jre\bin\server\jvm.dll | |||||
| 0x00007ff8071d0000 - 0x00007ff8071d8000 C:\WINDOWS\System32\PSAPI.DLL | |||||
| 0x00007ff800840000 - 0x00007ff80084a000 C:\WINDOWS\SYSTEM32\VERSION.dll | |||||
| 0x00007ffffb6e0000 - 0x00007ffffb704000 C:\WINDOWS\SYSTEM32\WINMM.dll | |||||
| 0x00007fffff380000 - 0x00007fffff389000 C:\WINDOWS\SYSTEM32\WSOCK32.dll | |||||
| 0x00007ff807210000 - 0x00007ff80727f000 C:\WINDOWS\System32\WS2_32.dll | |||||
| 0x00007ffffb490000 - 0x00007ffffb4bd000 C:\WINDOWS\SYSTEM32\winmmbase.dll | |||||
| 0x00007ff805830000 - 0x00007ff80587a000 C:\WINDOWS\System32\cfgmgr32.dll | |||||
| 0x0000000073c90000 - 0x0000000073c9f000 C:\soft-install\JDK8\JDK8\jre\bin\verify.dll | |||||
| 0x0000000073c60000 - 0x0000000073c89000 C:\soft-install\JDK8\JDK8\jre\bin\java.dll | |||||
| 0x00000000748c0000 - 0x00000000748f5000 C:\soft-install\JDK8\JDK8\jre\bin\jdwp.dll | |||||
| 0x00000000748b0000 - 0x00000000748b8000 C:\soft-install\JDK8\JDK8\jre\bin\npt.dll | |||||
| 0x0000000073c30000 - 0x0000000073c53000 C:\soft-install\JDK8\JDK8\jre\bin\instrument.dll | |||||
| 0x0000000073c10000 - 0x0000000073c26000 C:\soft-install\JDK8\JDK8\jre\bin\zip.dll | |||||
| 0x00007ff807730000 - 0x00007ff807e17000 C:\WINDOWS\System32\SHELL32.dll | |||||
| 0x00007ff8064f0000 - 0x00007ff806599000 C:\WINDOWS\System32\shcore.dll | |||||
| 0x00007ff805b90000 - 0x00007ff806312000 C:\WINDOWS\System32\windows.storage.dll | |||||
| 0x00007ff8051e0000 - 0x00007ff805203000 C:\WINDOWS\System32\profapi.dll | |||||
| 0x00007ff805210000 - 0x00007ff80525a000 C:\WINDOWS\System32\powrprof.dll | |||||
| 0x00007ff8051d0000 - 0x00007ff8051e0000 C:\WINDOWS\System32\UMPDC.dll | |||||
| 0x00007ff806490000 - 0x00007ff8064e2000 C:\WINDOWS\System32\shlwapi.dll | |||||
| 0x00007ff805280000 - 0x00007ff805291000 C:\WINDOWS\System32\kernel.appcore.dll | |||||
| 0x00007ff805810000 - 0x00007ff805827000 C:\WINDOWS\System32\cryptsp.dll | |||||
| 0x00000000748a0000 - 0x00000000748a9000 C:\soft-install\JDK8\JDK8\jre\bin\dt_socket.dll | |||||
| 0x00007fffeb320000 - 0x00007fffeb336000 C:\WINDOWS\system32\napinsp.dll | |||||
| 0x00007fffea5a0000 - 0x00007fffea5ba000 C:\WINDOWS\system32\pnrpnsp.dll | |||||
| 0x00007ff8049d0000 - 0x00007ff804a37000 C:\WINDOWS\System32\mswsock.dll | |||||
| 0x00007ff804720000 - 0x00007ff8047eb000 C:\WINDOWS\SYSTEM32\DNSAPI.dll | |||||
| 0x00007ff807600000 - 0x00007ff807608000 C:\WINDOWS\System32\NSI.dll | |||||
| 0x00007ff8046e0000 - 0x00007ff80471a000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL | |||||
| 0x00007ffffd1e0000 - 0x00007ffffd1ee000 C:\WINDOWS\System32\winrnr.dll | |||||
| 0x00007ffffef40000 - 0x00007ffffef5c000 C:\WINDOWS\system32\NLAapi.dll | |||||
| 0x00007ffff7a40000 - 0x00007ffff7a55000 C:\WINDOWS\system32\wshbth.dll | |||||
| 0x00007ffffeec0000 - 0x00007ffffef37000 C:\WINDOWS\System32\fwpuclnt.dll | |||||
| 0x00007ff805590000 - 0x00007ff8055b6000 C:\WINDOWS\System32\bcrypt.dll | |||||
| 0x00007ffffbbb0000 - 0x00007ffffbbba000 C:\Windows\System32\rasadhlp.dll | |||||
| 0x0000000074890000 - 0x000000007489d000 C:\soft-install\JDK8\JDK8\jre\bin\management.dll | |||||
| 0x0000000073bf0000 - 0x0000000073c0a000 C:\soft-install\JDK8\JDK8\jre\bin\net.dll | |||||
| 0x0000000073bd0000 - 0x0000000073be1000 C:\soft-install\JDK8\JDK8\jre\bin\nio.dll | |||||
| 0x0000000073ba0000 - 0x0000000073bc4000 C:\soft-install\JDK8\JDK8\jre\bin\sunec.dll | |||||
| 0x00007ff804540000 - 0x00007ff804573000 C:\WINDOWS\system32\rsaenh.dll | |||||
| 0x00007ff8050f0000 - 0x00007ff805115000 C:\WINDOWS\SYSTEM32\USERENV.dll | |||||
| 0x00007ff804ba0000 - 0x00007ff804bac000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll | |||||
| 0x00007fffff150000 - 0x00007fffff166000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL | |||||
| 0x00007fffff800000 - 0x00007fffff81c000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL | |||||
| 0x0000000074880000 - 0x000000007488b000 C:\soft-install\JDK8\JDK8\jre\bin\sunmscapi.dll | |||||
| 0x00007ff8052a0000 - 0x00007ff8053e9000 C:\WINDOWS\System32\CRYPT32.dll | |||||
| 0x00007ff805260000 - 0x00007ff805272000 C:\WINDOWS\System32\MSASN1.dll | |||||
| 0x00007ffffdc80000 - 0x00007ffffde74000 C:\WINDOWS\SYSTEM32\dbghelp.dll | |||||
| VM Arguments: | |||||
| jvm_args: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:52559 -javaagent:C:\soft-install\jee-2019-09\eclipse\configuration\org.eclipse.osgi\412\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8 | |||||
| java_command: com.iformall.UserApplication | |||||
| java_class_path (initial): C:\project\formall\formallWu\formallProject\mallinkAdmin\target\classes;C:\Users\alascor\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\alascor\.m2\repository\javax\xml\bind\jaxb-api\2.3.0\jaxb-api-2.3.0.jar;C:\project\formall\formallWu\formallProject\mallinkService\target\classes;C:\Users\alascor\.m2\repository\net\sf\dozer\dozer\5.5.1\dozer-5.5.1.jar;C:\Users\alascor\.m2\repository\commons-beanutils\commons-beanutils\1.9.1\commons-beanutils-1.9.1.jar;C:\Users\alascor\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\Users\alascor\.m2\repository\org\apache\commons\commons-lang3\3.8\commons-lang3-3.8.jar;C:\Users\alascor\.m2\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;C:\Users\alascor\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.30\jcl-over-slf4j-1.7.30.jar;C:\Users\alascor\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.2.5.RELEASE\spring-boot-starter-web-2.2.5.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\boot\spring-boot-starter\2.2.5.RELEASE\spring-boot-starter-2.2.5.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\boot\spring-boot\2.2.5.RELEASE\spring-boot-2.2.5.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-core\5.2.4.RELEASE\spring-core-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-jcl\5.2.4.RELEASE\spring-jcl-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-context\5.2.4.RELEASE\spring-context-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-aop\5.2.4.RELEASE\spring-aop-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-beans\5.2.4.RELEASE\spring-beans-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-expression\5.2.4.RELEASE\spring-expression-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\boot\spring-boot-autoc | |||||
| Launcher Type: SUN_STANDARD | |||||
| Environment Variables: | |||||
| JAVA_HOME=C:\soft-install\JDK8\JDK8 | |||||
| CLASSPATH=.;C:\soft-install\JDK8\JDK8\lib;C:\soft-install\JDK8\JDK8\lib\tools.jar | |||||
| PATH=C:/soft-install/JDK8/JDK8/bin/../jre/bin/server;C:/soft-install/JDK8/JDK8/bin/../jre/bin;C:/soft-install/JDK8/JDK8/bin/../jre/lib/amd64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\soft-install\Git\cmd\;%installation home%\bin\;C:\Users\alascor\AppData\Local\Microsoft\WindowsApps;C:\soft-install\JDK8\JDK8\bin;C:\soft-install\JDK8\JDK8\jre\bin;C:\soft-install\apache-maven-3.3.9\apache-maven-3.3.9\bin;;C:\Users\alascor\Desktop; | |||||
| USERNAME=alascor | |||||
| 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 18362 (10.0.18362.959) | |||||
| CPU:total 8 (4 cores per cpu, 2 threads per core) family 6 model 60 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, clmul, erms, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2 | |||||
| Memory: 4k page, physical 8068152k(1413072k free), swap 14621752k(5906776k free) | |||||
| vm_info: Java HotSpot(TM) 64-Bit Server VM (25.40-b25) for windows-amd64 JRE (1.8.0_40-b25), built on Feb 10 2015 21:53:57 by "java_re" with MS VC++ 10.0 (VS2010) | |||||
| time: Mon Aug 17 15:00:20 2020 | |||||
| elapsed time: 864 seconds (0d 0h 14m 24s) | |||||
| @@ -0,0 +1,439 @@ | |||||
| # | |||||
| # A fatal error has been detected by the Java Runtime Environment: | |||||
| # | |||||
| # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000063358225, pid=13284, tid=8664 | |||||
| # | |||||
| # JRE version: Java(TM) SE Runtime Environment (8.0_40-b25) (build 1.8.0_40-b25) | |||||
| # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.40-b25 mixed mode windows-amd64 compressed oops) | |||||
| # Problematic frame: | |||||
| # V [jvm.dll+0x128225] | |||||
| # | |||||
| # 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 (0x000000001a159800): JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=8664, stack(0x000000001a6b0000,0x000000001a7b0000)] | |||||
| siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000030 | |||||
| Registers: | |||||
| RAX=0x000000001a7af301, RBX=0x000000001a159800, RCX=0x0000000000000030, RDX=0x0000000000000000 | |||||
| RSP=0x000000001a7af2f0, RBP=0x0000000000000030, RSI=0x000000001a7af408, RDI=0x0000000002f68570 | |||||
| R8 =0x000000001a159800, R9 =0x0000000000000001, R10=0x0000000000008000, R11=0x000000001a7af240 | |||||
| R12=0x0000000000000000, R13=0x000000001a161ef8, R14=0x0000000000000000, R15=0x0000000000000000 | |||||
| RIP=0x0000000063358225, EFLAGS=0x0000000000010206 | |||||
| Top of Stack: (sp=0x000000001a7af2f0) | |||||
| 0x000000001a7af2f0: 0000000000000001 0000000020780220 | |||||
| 0x000000001a7af300: 000000001a7af4d0 000000006355c6db | |||||
| 0x000000001a7af310: 000000001a159800 0000000063578f3d | |||||
| 0x000000001a7af320: 0000000000000000 0000000061f39155 | |||||
| 0x000000001a7af330: 00000000239139f8 0000000061f4291e | |||||
| 0x000000001a7af340: 000000001a159800 0000000000000000 | |||||
| 0x000000001a7af350: 0000000000000000 0000000000000000 | |||||
| 0x000000001a7af360: 0000000000000030 0000000061f41a15 | |||||
| 0x000000001a7af370: 000000001a7af408 000000001a7af3e0 | |||||
| 0x000000001a7af380: 0000000000000001 00000000239139f8 | |||||
| 0x000000001a7af390: 0000000000000030 0000000061f253b3 | |||||
| 0x000000001a7af3a0: 000000001a7af4d0 0000000000000001 | |||||
| 0x000000001a7af3b0: 0000000000000001 00000000239139f8 | |||||
| 0x000000001a7af3c0: 0000000000000001 0000000000000000 | |||||
| 0x000000001a7af3d0: 0000000000000000 0000000000000000 | |||||
| 0x000000001a7af3e0: 0000000000000001 0000000061f25571 | |||||
| Instructions: (pc=0x0000000063358225) | |||||
| 0x0000000063358205: cc cc cc cc cc cc cc cc cc cc cc 48 83 ec 28 48 | |||||
| 0x0000000063358215: 85 c9 75 07 33 c0 48 83 c4 28 c3 48 89 5c 24 20 | |||||
| 0x0000000063358225: 48 8b 19 48 85 db 74 20 48 83 fb 37 74 1a 48 8b | |||||
| 0x0000000063358235: 13 48 8b cb ff 52 10 84 c0 74 0d 48 8b c3 48 8b | |||||
| Register to memory mapping: | |||||
| RAX=0x000000001a7af301 is pointing into the stack for thread: 0x000000001a159800 | |||||
| RBX=0x000000001a159800 is a thread | |||||
| RCX=0x0000000000000030 is an unknown value | |||||
| RDX=0x0000000000000000 is an unknown value | |||||
| RSP=0x000000001a7af2f0 is pointing into the stack for thread: 0x000000001a159800 | |||||
| RBP=0x0000000000000030 is an unknown value | |||||
| RSI=0x000000001a7af408 is pointing into the stack for thread: 0x000000001a159800 | |||||
| RDI=0x0000000002f68570 is an unknown value | |||||
| R8 =0x000000001a159800 is a thread | |||||
| R9 =0x0000000000000001 is an unknown value | |||||
| R10=0x0000000000008000 is an unknown value | |||||
| R11=0x000000001a7af240 is pointing into the stack for thread: 0x000000001a159800 | |||||
| R12=0x0000000000000000 is an unknown value | |||||
| R13=0x000000001a161ef8 is an unknown value | |||||
| R14=0x0000000000000000 is an unknown value | |||||
| R15=0x0000000000000000 is an unknown value | |||||
| Stack: [0x000000001a6b0000,0x000000001a7b0000], sp=0x000000001a7af2f0, free space=1020k | |||||
| Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) | |||||
| V [jvm.dll+0x128225] | |||||
| V [jvm.dll+0x348f3d] | |||||
| C [jdwp.dll+0x21a15] | |||||
| C [jdwp.dll+0x53b3] | |||||
| C [jdwp.dll+0x5571] | |||||
| C [jdwp.dll+0xf0a8] | |||||
| C [jdwp.dll+0x1f2d5] | |||||
| C [jdwp.dll+0x1f4aa] | |||||
| V [jvm.dll+0x1bad48] | |||||
| V [jvm.dll+0x241914] | |||||
| V [jvm.dll+0x29848a] | |||||
| C [msvcr100.dll+0x21d9f] | |||||
| C [msvcr100.dll+0x21e3b] | |||||
| C [KERNEL32.DLL+0x17bd4] | |||||
| C [ntdll.dll+0x6ce51] | |||||
| --------------- P R O C E S S --------------- | |||||
| Java Threads: ( => current thread ) | |||||
| 0x000000001d677000 JavaThread "lettuce-eventExecutorLoop-1-3" daemon [_thread_blocked, id=10548, stack(0x00000000358d0000,0x00000000359d0000)] | |||||
| 0x000000001d676000 JavaThread "lettuce-eventExecutorLoop-1-2" daemon [_thread_blocked, id=10660, stack(0x0000000034710000,0x0000000034810000)] | |||||
| 0x000000001d66f800 JavaThread "lettuce-eventExecutorLoop-1-1" daemon [_thread_blocked, id=12824, stack(0x0000000034610000,0x0000000034710000)] | |||||
| 0x000000001d675800 JavaThread "lettuce-nioEventLoop-4-1" daemon [_thread_in_native, id=1608, stack(0x0000000033500000,0x0000000033600000)] | |||||
| 0x000000001d671800 JavaThread "SessionValidationThread-1" daemon [_thread_blocked, id=13280, stack(0x0000000031eb0000,0x0000000031fb0000)] | |||||
| 0x000000001f61b800 JavaThread "XNIO-1 task-1" [_thread_blocked, id=10388, stack(0x0000000031db0000,0x0000000031eb0000)] | |||||
| 0x000000001fdfb000 JavaThread "DestroyJavaVM" [_thread_blocked, id=7892, stack(0x0000000002f70000,0x0000000003070000)] | |||||
| 0x000000001f625000 JavaThread "XNIO-1 Accept" [_thread_in_native, id=4816, stack(0x0000000032db0000,0x0000000032eb0000)] | |||||
| 0x000000001f622000 JavaThread "XNIO-1 I/O-8" [_thread_in_native, id=7856, stack(0x0000000032cb0000,0x0000000032db0000)] | |||||
| 0x000000001f623000 JavaThread "XNIO-1 I/O-7" [_thread_in_native, id=10348, stack(0x0000000032bb0000,0x0000000032cb0000)] | |||||
| 0x000000001f623800 JavaThread "XNIO-1 I/O-6" [_thread_in_native, id=10032, stack(0x0000000032ab0000,0x0000000032bb0000)] | |||||
| 0x000000001f628000 JavaThread "XNIO-1 I/O-5" [_thread_in_native, id=3784, stack(0x00000000325b0000,0x00000000326b0000)] | |||||
| 0x000000001f626000 JavaThread "XNIO-1 I/O-4" [_thread_in_native, id=12560, stack(0x00000000324b0000,0x00000000325b0000)] | |||||
| 0x000000001f627800 JavaThread "XNIO-1 I/O-3" [_thread_in_native, id=12968, stack(0x00000000323b0000,0x00000000324b0000)] | |||||
| 0x000000001f626800 JavaThread "XNIO-1 I/O-2" [_thread_in_native, id=12712, stack(0x00000000322b0000,0x00000000323b0000)] | |||||
| 0x000000001f624800 JavaThread "XNIO-1 I/O-1" [_thread_in_native, id=256, stack(0x00000000321b0000,0x00000000322b0000)] | |||||
| 0x000000001f620800 JavaThread "logback-8" daemon [_thread_blocked, id=12584, stack(0x0000000028ee0000,0x0000000028fe0000)] | |||||
| 0x000000001f61d800 JavaThread "quartzScheduler_QuartzSchedulerThread" [_thread_blocked, id=13084, stack(0x0000000031560000,0x0000000031660000)] | |||||
| 0x000000001f61f000 JavaThread "quartzScheduler_Worker-10" [_thread_blocked, id=5140, stack(0x00000000326b0000,0x00000000327b0000)] | |||||
| 0x000000001f61c000 JavaThread "quartzScheduler_Worker-9" [_thread_blocked, id=12384, stack(0x0000000031850000,0x0000000031950000)] | |||||
| 0x0000000029ac8800 JavaThread "quartzScheduler_Worker-8" [_thread_blocked, id=4156, stack(0x0000000031750000,0x0000000031850000)] | |||||
| 0x0000000029ac7000 JavaThread "quartzScheduler_Worker-7" [_thread_blocked, id=6352, stack(0x000000002f430000,0x000000002f530000)] | |||||
| 0x0000000029ac6800 JavaThread "quartzScheduler_Worker-6" [_thread_blocked, id=7332, stack(0x000000002f330000,0x000000002f430000)] | |||||
| 0x0000000029ac8000 JavaThread "quartzScheduler_Worker-5" [_thread_blocked, id=5604, stack(0x000000002f230000,0x000000002f330000)] | |||||
| 0x0000000029ac5800 JavaThread "quartzScheduler_Worker-4" [_thread_blocked, id=10288, stack(0x000000002b5e0000,0x000000002b6e0000)] | |||||
| 0x0000000029ac4000 JavaThread "quartzScheduler_Worker-3" [_thread_blocked, id=6804, stack(0x000000002b220000,0x000000002b320000)] | |||||
| 0x0000000029ac9800 JavaThread "quartzScheduler_Worker-2" [_thread_blocked, id=12800, stack(0x000000002b120000,0x000000002b220000)] | |||||
| 0x0000000029ac5000 JavaThread "quartzScheduler_Worker-1" [_thread_blocked, id=10148, stack(0x0000000027f60000,0x0000000028060000)] | |||||
| 0x0000000029abc800 JavaThread "IdleConnectionMonitorThread" daemon [_thread_blocked, id=2768, stack(0x000000002c980000,0x000000002ca80000)] | |||||
| 0x0000000029ac2800 JavaThread "flowable-reset-expired-jobs" [_thread_blocked, id=12804, stack(0x0000000028060000,0x0000000028160000)] | |||||
| 0x0000000029ac1000 JavaThread "flowable-acquire-timer-jobs" [_thread_blocked, id=8388, stack(0x0000000001180000,0x0000000001280000)] | |||||
| 0x0000000029ac0800 JavaThread "flowable-acquire-async-jobs" [_thread_blocked, id=3512, stack(0x0000000001080000,0x0000000001180000)] | |||||
| 0x0000000029ac2000 JavaThread "logback-7" daemon [_thread_blocked, id=4908, stack(0x0000000000f80000,0x0000000001080000)] | |||||
| 0x0000000029abf800 JavaThread "logback-6" daemon [_thread_blocked, id=12572, stack(0x0000000027e60000,0x0000000027f60000)] | |||||
| 0x0000000029abb000 JavaThread "logback-5" daemon [_thread_blocked, id=2392, stack(0x0000000021b60000,0x0000000021c60000)] | |||||
| 0x0000000029abd800 JavaThread "logback-4" daemon [_thread_blocked, id=7496, stack(0x000000001f020000,0x000000001f120000)] | |||||
| 0x0000000029abe000 JavaThread "logback-3" daemon [_thread_blocked, id=11384, stack(0x0000000027240000,0x0000000027340000)] | |||||
| 0x0000000029aba800 JavaThread "Druid-ConnectionPool-Destroy-1007094494" daemon [_thread_blocked, id=3104, stack(0x000000002cb50000,0x000000002cc50000)] | |||||
| 0x000000001fdfe000 JavaThread "Druid-ConnectionPool-Create-1007094494" daemon [_thread_blocked, id=12700, stack(0x00000000290c0000,0x00000000291c0000)] | |||||
| 0x000000001fe02000 JavaThread "mysql-cj-abandoned-connection-cleanup" daemon [_thread_blocked, id=9432, stack(0x0000000028c60000,0x0000000028d60000)] | |||||
| 0x000000001fdff800 JavaThread "IdleConnectionMonitorThread" daemon [_thread_blocked, id=1948, stack(0x0000000028de0000,0x0000000028ee0000)] | |||||
| 0x000000001fe01000 JavaThread "commons-pool-evictor-thread" daemon [_thread_blocked, id=12956, stack(0x00000000275e0000,0x00000000276e0000)] | |||||
| 0x000000001fdfc000 JavaThread "logback-2" daemon [_thread_blocked, id=12756, stack(0x000000001ea90000,0x000000001eb90000)] | |||||
| 0x000000001e386000 JavaThread "logback-1" daemon [_thread_blocked, id=8500, stack(0x00000000203c0000,0x00000000204c0000)] | |||||
| 0x000000001b4d2000 JavaThread "Service Thread" daemon [_thread_blocked, id=10652, stack(0x000000001c580000,0x000000001c680000)] | |||||
| 0x000000001b441000 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=10520, stack(0x000000001c480000,0x000000001c580000)] | |||||
| 0x000000001b440000 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=12608, stack(0x000000001c380000,0x000000001c480000)] | |||||
| 0x000000001b43d800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=1536, stack(0x000000001c280000,0x000000001c380000)] | |||||
| 0x000000001b3b6800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=9612, stack(0x000000001c180000,0x000000001c280000)] | |||||
| 0x000000001a165000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=12716, stack(0x000000001a8b0000,0x000000001a9b0000)] | |||||
| 0x000000001a164000 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=10864, stack(0x000000001a7b0000,0x000000001a8b0000)] | |||||
| =>0x000000001a159800 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=8664, stack(0x000000001a6b0000,0x000000001a7b0000)] | |||||
| 0x000000001a145000 JavaThread "Attach Listener" daemon [_thread_blocked, id=10980, stack(0x000000001a5b0000,0x000000001a6b0000)] | |||||
| 0x000000001a0f7800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=11068, stack(0x000000001a4b0000,0x000000001a5b0000)] | |||||
| 0x00000000180f8800 JavaThread "Finalizer" daemon [_thread_blocked, id=12876, stack(0x0000000019fb0000,0x000000001a0b0000)] | |||||
| 0x00000000180f2000 JavaThread "Reference Handler" daemon [_thread_blocked, id=9572, stack(0x0000000019eb0000,0x0000000019fb0000)] | |||||
| Other Threads: | |||||
| 0x00000000180ee000 VMThread [stack: 0x0000000019db0000,0x0000000019eb0000] [id=432] | |||||
| 0x000000001b3b5000 WatcherThread [stack: 0x000000001c680000,0x000000001c780000] [id=1436] | |||||
| VM state:not at safepoint (normal execution) | |||||
| VM Mutex/Monitor currently owned by a thread: None | |||||
| Heap: | |||||
| PSYoungGen total 629248K, used 61596K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 584704K, 6% used [0x00000000d6f80000,0x00000000d9723b28,0x00000000faa80000) | |||||
| from space 44544K, 47% used [0x00000000fd480000,0x00000000fe9036d0,0x0000000100000000) | |||||
| to space 43008K, 0% used [0x00000000faa80000,0x00000000faa80000,0x00000000fd480000) | |||||
| ParOldGen total 238080K, used 117995K [0x0000000084e00000, 0x0000000093680000, 0x00000000d6f80000) | |||||
| object space 238080K, 49% used [0x0000000084e00000,0x000000008c13afd8,0x0000000093680000) | |||||
| Metaspace used 103233K, capacity 107294K, committed 107340K, reserved 1144832K | |||||
| class space used 12255K, capacity 12927K, committed 12928K, reserved 1048576K | |||||
| Card table byte_map: [0x0000000012710000,0x0000000012af0000] byte_map_base: 0x00000000122e9000 | |||||
| Marking Bits: (ParMarkBitMap*) 0x0000000063a34040 | |||||
| Begin Bits: [0x0000000013590000, 0x0000000015458000) | |||||
| End Bits: [0x0000000015458000, 0x0000000017320000) | |||||
| Polling page: 0x00000000009f0000 | |||||
| CodeCache: size=245760Kb used=40297Kb max_used=42500Kb free=205462Kb | |||||
| bounds [0x0000000003350000, 0x0000000005d50000, 0x0000000012350000] | |||||
| total_blobs=10999 nmethods=10337 adapters=581 | |||||
| compilation: enabled | |||||
| Compilation events (10 events): | |||||
| Event: 211.438 Thread 0x000000001b441000 13525 1 com.alibaba.druid.pool.DruidPooledPreparedStatement::isPooled (5 bytes) | |||||
| Event: 211.438 Thread 0x000000001b441000 nmethod 13525 0x00000000045112d0 code [0x0000000004511420, 0x0000000004511530] | |||||
| Event: 212.828 Thread 0x000000001b441000 13526 3 com.mysql.cj.protocol.Resultset$Type::fromValue (42 bytes) | |||||
| Event: 212.829 Thread 0x000000001b441000 nmethod 13526 0x000000000598a3d0 code [0x000000000598a560, 0x000000000598aa68] | |||||
| Event: 212.829 Thread 0x000000001b441000 13527 3 com.mysql.cj.protocol.Resultset$Type::values (10 bytes) | |||||
| Event: 212.830 Thread 0x000000001b441000 nmethod 13527 0x0000000003db2950 code [0x0000000003db2ac0, 0x0000000003db2da8] | |||||
| Event: 212.874 Thread 0x000000001b441000 13528 3 org.springframework.transaction.support.DefaultTransactionStatus::hasTransaction (13 bytes) | |||||
| Event: 212.875 Thread 0x000000001b441000 nmethod 13528 0x000000000476c390 code [0x000000000476c4e0, 0x000000000476c690] | |||||
| Event: 212.896 Thread 0x000000001b43d800 13529 % 4 java.util.HashMap::forEach @ 36 (103 bytes) | |||||
| Event: 212.905 Thread 0x000000001b43d800 nmethod 13529% 0x0000000003917e10 code [0x0000000003917f60, 0x0000000003918258] | |||||
| GC Heap History (10 events): | |||||
| Event: 68.202 GC heap before | |||||
| {Heap before GC invocations=24 (full 3): | |||||
| PSYoungGen total 634880K, used 634876K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 605696K, 100% used [0x00000000d6f80000,0x00000000fbf00000,0x00000000fbf00000) | |||||
| from space 29184K, 99% used [0x00000000fe380000,0x00000000fffff1e8,0x0000000100000000) | |||||
| to space 33280K, 0% used [0x00000000fbf00000,0x00000000fbf00000,0x00000000fdf80000) | |||||
| ParOldGen total 164352K, used 70560K [0x0000000084e00000, 0x000000008ee80000, 0x00000000d6f80000) | |||||
| object space 164352K, 42% used [0x0000000084e00000,0x00000000892e82a8,0x000000008ee80000) | |||||
| Metaspace used 83438K, capacity 86412K, committed 86656K, reserved 1126400K | |||||
| class space used 10011K, capacity 10528K, committed 10624K, reserved 1048576K | |||||
| Event: 68.232 GC heap after | |||||
| Heap after GC invocations=24 (full 3): | |||||
| PSYoungGen total 629248K, used 23366K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 605696K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000fbf00000) | |||||
| from space 23552K, 99% used [0x00000000fbf00000,0x00000000fd5d18f0,0x00000000fd600000) | |||||
| to space 34816K, 0% used [0x00000000fde00000,0x00000000fde00000,0x0000000100000000) | |||||
| ParOldGen total 164352K, used 86745K [0x0000000084e00000, 0x000000008ee80000, 0x00000000d6f80000) | |||||
| object space 164352K, 52% used [0x0000000084e00000,0x000000008a2b6648,0x000000008ee80000) | |||||
| Metaspace used 83438K, capacity 86412K, committed 86656K, reserved 1126400K | |||||
| class space used 10011K, capacity 10528K, committed 10624K, reserved 1048576K | |||||
| } | |||||
| Event: 72.333 GC heap before | |||||
| {Heap before GC invocations=25 (full 3): | |||||
| PSYoungGen total 629248K, used 629062K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 605696K, 100% used [0x00000000d6f80000,0x00000000fbf00000,0x00000000fbf00000) | |||||
| from space 23552K, 99% used [0x00000000fbf00000,0x00000000fd5d18f0,0x00000000fd600000) | |||||
| to space 34816K, 0% used [0x00000000fde00000,0x00000000fde00000,0x0000000100000000) | |||||
| ParOldGen total 164352K, used 86745K [0x0000000084e00000, 0x000000008ee80000, 0x00000000d6f80000) | |||||
| object space 164352K, 52% used [0x0000000084e00000,0x000000008a2b6648,0x000000008ee80000) | |||||
| Metaspace used 94394K, capacity 98050K, committed 98176K, reserved 1136640K | |||||
| class space used 11217K, capacity 11837K, committed 11904K, reserved 1048576K | |||||
| Event: 72.365 GC heap after | |||||
| Heap after GC invocations=25 (full 3): | |||||
| PSYoungGen total 620032K, used 34800K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 585216K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000fab00000) | |||||
| from space 34816K, 99% used [0x00000000fde00000,0x00000000ffffc310,0x0000000100000000) | |||||
| to space 43520K, 0% used [0x00000000fab00000,0x00000000fab00000,0x00000000fd580000) | |||||
| ParOldGen total 164352K, used 97846K [0x0000000084e00000, 0x000000008ee80000, 0x00000000d6f80000) | |||||
| object space 164352K, 59% used [0x0000000084e00000,0x000000008ad8dab0,0x000000008ee80000) | |||||
| Metaspace used 94394K, capacity 98050K, committed 98176K, reserved 1136640K | |||||
| class space used 11217K, capacity 11837K, committed 11904K, reserved 1048576K | |||||
| } | |||||
| Event: 72.434 GC heap before | |||||
| {Heap before GC invocations=26 (full 3): | |||||
| PSYoungGen total 620032K, used 52077K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 585216K, 2% used [0x00000000d6f80000,0x00000000d805f420,0x00000000fab00000) | |||||
| from space 34816K, 99% used [0x00000000fde00000,0x00000000ffffc310,0x0000000100000000) | |||||
| to space 43520K, 0% used [0x00000000fab00000,0x00000000fab00000,0x00000000fd580000) | |||||
| ParOldGen total 164352K, used 97846K [0x0000000084e00000, 0x000000008ee80000, 0x00000000d6f80000) | |||||
| object space 164352K, 59% used [0x0000000084e00000,0x000000008ad8dab0,0x000000008ee80000) | |||||
| Metaspace used 94698K, capacity 98274K, committed 98380K, reserved 1136640K | |||||
| class space used 11259K, capacity 11869K, committed 11904K, reserved 1048576K | |||||
| Event: 72.460 GC heap after | |||||
| Heap after GC invocations=26 (full 3): | |||||
| PSYoungGen total 585728K, used 497K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 585216K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000fab00000) | |||||
| from space 512K, 97% used [0x00000000fab00000,0x00000000fab7c568,0x00000000fab80000) | |||||
| to space 44544K, 0% used [0x00000000fd480000,0x00000000fd480000,0x0000000100000000) | |||||
| ParOldGen total 164352K, used 132343K [0x0000000084e00000, 0x000000008ee80000, 0x00000000d6f80000) | |||||
| object space 164352K, 80% used [0x0000000084e00000,0x000000008cf3dc38,0x000000008ee80000) | |||||
| Metaspace used 94698K, capacity 98274K, committed 98380K, reserved 1136640K | |||||
| class space used 11259K, capacity 11869K, committed 11904K, reserved 1048576K | |||||
| } | |||||
| Event: 72.460 GC heap before | |||||
| {Heap before GC invocations=27 (full 4): | |||||
| PSYoungGen total 585728K, used 497K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 585216K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000fab00000) | |||||
| from space 512K, 97% used [0x00000000fab00000,0x00000000fab7c568,0x00000000fab80000) | |||||
| to space 44544K, 0% used [0x00000000fd480000,0x00000000fd480000,0x0000000100000000) | |||||
| ParOldGen total 164352K, used 132343K [0x0000000084e00000, 0x000000008ee80000, 0x00000000d6f80000) | |||||
| object space 164352K, 80% used [0x0000000084e00000,0x000000008cf3dc38,0x000000008ee80000) | |||||
| Metaspace used 94698K, capacity 98274K, committed 98380K, reserved 1136640K | |||||
| class space used 11259K, capacity 11869K, committed 11904K, reserved 1048576K | |||||
| Event: 72.838 GC heap after | |||||
| Heap after GC invocations=27 (full 4): | |||||
| PSYoungGen total 585728K, used 0K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 585216K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000fab00000) | |||||
| from space 512K, 0% used [0x00000000fab00000,0x00000000fab00000,0x00000000fab80000) | |||||
| to space 44544K, 0% used [0x00000000fd480000,0x00000000fd480000,0x0000000100000000) | |||||
| ParOldGen total 238080K, used 117987K [0x0000000084e00000, 0x0000000093680000, 0x00000000d6f80000) | |||||
| object space 238080K, 49% used [0x0000000084e00000,0x000000008c138fd8,0x0000000093680000) | |||||
| Metaspace used 94698K, capacity 98274K, committed 98380K, reserved 1136640K | |||||
| class space used 11259K, capacity 11869K, committed 11904K, reserved 1048576K | |||||
| } | |||||
| Event: 83.655 GC heap before | |||||
| {Heap before GC invocations=28 (full 4): | |||||
| PSYoungGen total 585728K, used 585216K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 585216K, 100% used [0x00000000d6f80000,0x00000000fab00000,0x00000000fab00000) | |||||
| from space 512K, 0% used [0x00000000fab00000,0x00000000fab00000,0x00000000fab80000) | |||||
| to space 44544K, 0% used [0x00000000fd480000,0x00000000fd480000,0x0000000100000000) | |||||
| ParOldGen total 238080K, used 117987K [0x0000000084e00000, 0x0000000093680000, 0x00000000d6f80000) | |||||
| object space 238080K, 49% used [0x0000000084e00000,0x000000008c138fd8,0x0000000093680000) | |||||
| Metaspace used 101747K, capacity 105768K, committed 105932K, reserved 1142784K | |||||
| class space used 12090K, capacity 12734K, committed 12800K, reserved 1048576K | |||||
| Event: 83.670 GC heap after | |||||
| Heap after GC invocations=28 (full 4): | |||||
| PSYoungGen total 629248K, used 21005K [0x00000000d6f80000, 0x0000000100000000, 0x0000000100000000) | |||||
| eden space 584704K, 0% used [0x00000000d6f80000,0x00000000d6f80000,0x00000000faa80000) | |||||
| from space 44544K, 47% used [0x00000000fd480000,0x00000000fe9036d0,0x0000000100000000) | |||||
| to space 43008K, 0% used [0x00000000faa80000,0x00000000faa80000,0x00000000fd480000) | |||||
| ParOldGen total 238080K, used 117995K [0x0000000084e00000, 0x0000000093680000, 0x00000000d6f80000) | |||||
| object space 238080K, 49% used [0x0000000084e00000,0x000000008c13afd8,0x0000000093680000) | |||||
| Metaspace used 101747K, capacity 105768K, committed 105932K, reserved 1142784K | |||||
| class space used 12090K, capacity 12734K, committed 12800K, reserved 1048576K | |||||
| } | |||||
| Deoptimization events (10 events): | |||||
| Event: 121.623 Thread 0x000000001f61b800 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 121.624 Thread 0x000000001f61b800 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 121.624 Thread 0x000000001f61b800 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 121.625 Thread 0x000000001f61b800 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 121.626 Thread 0x000000001f61b800 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 121.626 Thread 0x000000001f61b800 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 121.627 Thread 0x000000001f61b800 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 121.628 Thread 0x000000001f61b800 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 121.654 Thread 0x000000001f61b800 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Event: 202.783 Thread 0x000000001fe01000 Uncommon trap: reason=unhandled action=none pc=0x0000000003fc6f8c method=java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; @ 44 | |||||
| Internal exceptions (10 events): | |||||
| Event: 82.990 Thread 0x000000001f61b800 Exception <a 'java/lang/ExceptionInInitializerError'> (0x00000000f91f6a70) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\oops\instanceKlass.cpp, line 943] | |||||
| Event: 83.540 Thread 0x000000001d675800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 70> (0x00000000fa0038d8) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\interpreter\interpreterRuntime.cpp, line 366] | |||||
| Event: 83.540 Thread 0x000000001d675800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 65> (0x00000000fa004718) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\interpreter\interpreterRuntime.cpp, line 366] | |||||
| Event: 83.671 Thread 0x000000001d675800 Implicit null exception at 0x0000000004e9b2c7 to 0x0000000004ea1391 | |||||
| Event: 121.269 Thread 0x000000001f61b800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 27> (0x00000000d7ca4e20) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\interpreter\interpreterRuntime.cpp, line 366] | |||||
| Event: 121.288 Thread 0x000000001f61b800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 80> (0x00000000d823b7b8) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\interpreter\interpreterRuntime.cpp, line 366] | |||||
| Event: 121.578 Thread 0x000000001f61b800 Implicit null exception at 0x000000000364835a to 0x0000000003648483 | |||||
| Event: 121.578 Thread 0x000000001f61b800 Implicit null exception at 0x0000000004ae1c46 to 0x0000000004ae1d82 | |||||
| Event: 121.578 Thread 0x000000001f61b800 Implicit null exception at 0x0000000005a0e0de to 0x0000000005a0e2ae | |||||
| Event: 121.587 Thread 0x000000001f61b800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 23> (0x00000000d86a4418) thrown at [D:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u40\2855\hotspot\src\share\vm\interpreter\interpreterRuntime.cpp, line 366] | |||||
| Events (10 events): | |||||
| Event: 202.783 loading class redis/clients/jedis/util/IOUtils done | |||||
| Event: 202.783 Thread 0x000000001fe01000 Uncommon trap: trap_request=0xffffffa7 fr.pc=0x0000000003fc6f8c | |||||
| Event: 202.783 Thread 0x000000001fe01000 DEOPT PACKING pc=0x0000000003fc6f8c sp=0x00000000276dd820 | |||||
| Event: 202.783 Thread 0x000000001fe01000 DEOPT UNPACKING pc=0x000000000339582a sp=0x00000000276dd718 mode 2 | |||||
| Event: 214.763 Executing VM operation: RedefineClasses | |||||
| Event: 214.825 Executing VM operation: RedefineClasses done | |||||
| Event: 214.844 Executing VM operation: ChangeBreakpoints | |||||
| Event: 214.849 Executing VM operation: ChangeBreakpoints done | |||||
| Event: 219.419 Executing VM operation: RedefineClasses | |||||
| Event: 219.484 Executing VM operation: RedefineClasses done | |||||
| Dynamic libraries: | |||||
| 0x00007ff618ba0000 - 0x00007ff618bd7000 C:\soft-install\JDK8\JDK8\bin\javaw.exe | |||||
| 0x00007ff92dba0000 - 0x00007ff92dd90000 C:\WINDOWS\SYSTEM32\ntdll.dll | |||||
| 0x00007ff92cd00000 - 0x00007ff92cdb2000 C:\WINDOWS\System32\KERNEL32.DLL | |||||
| 0x00007ff92adb0000 - 0x00007ff92b054000 C:\WINDOWS\System32\KERNELBASE.dll | |||||
| 0x00007ff92c4c0000 - 0x00007ff92c563000 C:\WINDOWS\System32\ADVAPI32.dll | |||||
| 0x00007ff92da40000 - 0x00007ff92dade000 C:\WINDOWS\System32\msvcrt.dll | |||||
| 0x00007ff92d8d0000 - 0x00007ff92d967000 C:\WINDOWS\System32\sechost.dll | |||||
| 0x00007ff92c180000 - 0x00007ff92c2a0000 C:\WINDOWS\System32\RPCRT4.dll | |||||
| 0x00007ff92c570000 - 0x00007ff92c705000 C:\WINDOWS\System32\USER32.dll | |||||
| 0x00007ff92abd0000 - 0x00007ff92abf1000 C:\WINDOWS\System32\win32u.dll | |||||
| 0x00007ff92bc50000 - 0x00007ff92bc76000 C:\WINDOWS\System32\GDI32.dll | |||||
| 0x00007ff92b9c0000 - 0x00007ff92bb56000 C:\WINDOWS\System32\gdi32full.dll | |||||
| 0x00007ff92bb60000 - 0x00007ff92bbfe000 C:\WINDOWS\System32\msvcp_win.dll | |||||
| 0x00007ff92acb0000 - 0x00007ff92adaa000 C:\WINDOWS\System32\ucrtbase.dll | |||||
| 0x00007ff920ef0000 - 0x00007ff921174000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.1016_none_9e7a36bbe461dae4\COMCTL32.dll | |||||
| 0x00007ff92c9c0000 - 0x00007ff92ccf5000 C:\WINDOWS\System32\combase.dll | |||||
| 0x00007ff92ac00000 - 0x00007ff92ac80000 C:\WINDOWS\System32\bcryptPrimitives.dll | |||||
| 0x00007ff92bc80000 - 0x00007ff92bcae000 C:\WINDOWS\System32\IMM32.DLL | |||||
| 0x0000000061f60000 - 0x0000000062032000 C:\soft-install\JDK8\JDK8\jre\bin\msvcr100.dll | |||||
| 0x0000000063230000 - 0x0000000063ab3000 C:\soft-install\JDK8\JDK8\jre\bin\server\jvm.dll | |||||
| 0x00007ff92c7a0000 - 0x00007ff92c7a8000 C:\WINDOWS\System32\PSAPI.DLL | |||||
| 0x00007ff928160000 - 0x00007ff928169000 C:\WINDOWS\SYSTEM32\WSOCK32.dll | |||||
| 0x00007ff9256d0000 - 0x00007ff9256da000 C:\WINDOWS\SYSTEM32\VERSION.dll | |||||
| 0x00007ff927ff0000 - 0x00007ff928014000 C:\WINDOWS\SYSTEM32\WINMM.dll | |||||
| 0x00007ff92d630000 - 0x00007ff92d69f000 C:\WINDOWS\System32\WS2_32.dll | |||||
| 0x00007ff927b70000 - 0x00007ff927b9d000 C:\WINDOWS\SYSTEM32\WINMMBASE.dll | |||||
| 0x00007ff92bc00000 - 0x00007ff92bc4a000 C:\WINDOWS\System32\cfgmgr32.dll | |||||
| 0x0000000063140000 - 0x000000006314f000 C:\soft-install\JDK8\JDK8\jre\bin\verify.dll | |||||
| 0x0000000063110000 - 0x0000000063139000 C:\soft-install\JDK8\JDK8\jre\bin\java.dll | |||||
| 0x0000000061f20000 - 0x0000000061f55000 C:\soft-install\JDK8\JDK8\jre\bin\jdwp.dll | |||||
| 0x0000000061f10000 - 0x0000000061f18000 C:\soft-install\JDK8\JDK8\jre\bin\npt.dll | |||||
| 0x00000000630e0000 - 0x0000000063103000 C:\soft-install\JDK8\JDK8\jre\bin\instrument.dll | |||||
| 0x00000000630c0000 - 0x00000000630d6000 C:\soft-install\JDK8\JDK8\jre\bin\zip.dll | |||||
| 0x00007ff92ce70000 - 0x00007ff92d557000 C:\WINDOWS\System32\SHELL32.dll | |||||
| 0x00007ff92c7d0000 - 0x00007ff92c879000 C:\WINDOWS\System32\shcore.dll | |||||
| 0x00007ff92b230000 - 0x00007ff92b9b2000 C:\WINDOWS\System32\windows.storage.dll | |||||
| 0x00007ff92aaa0000 - 0x00007ff92aac3000 C:\WINDOWS\System32\profapi.dll | |||||
| 0x00007ff92aad0000 - 0x00007ff92ab1a000 C:\WINDOWS\System32\powrprof.dll | |||||
| 0x00007ff92aa50000 - 0x00007ff92aa60000 C:\WINDOWS\System32\UMPDC.dll | |||||
| 0x00007ff92c2a0000 - 0x00007ff92c2f2000 C:\WINDOWS\System32\shlwapi.dll | |||||
| 0x00007ff92aa80000 - 0x00007ff92aa91000 C:\WINDOWS\System32\kernel.appcore.dll | |||||
| 0x00007ff92b210000 - 0x00007ff92b227000 C:\WINDOWS\System32\cryptsp.dll | |||||
| 0x0000000061f00000 - 0x0000000061f09000 C:\soft-install\JDK8\JDK8\jre\bin\dt_socket.dll | |||||
| 0x00007ff920c60000 - 0x00007ff920c76000 C:\WINDOWS\system32\napinsp.dll | |||||
| 0x00007ff916320000 - 0x00007ff91633a000 C:\WINDOWS\system32\pnrpnsp.dll | |||||
| 0x00007ff92a250000 - 0x00007ff92a2b7000 C:\WINDOWS\System32\mswsock.dll | |||||
| 0x00007ff929fa0000 - 0x00007ff92a06b000 C:\WINDOWS\SYSTEM32\DNSAPI.dll | |||||
| 0x00007ff92c4b0000 - 0x00007ff92c4b8000 C:\WINDOWS\System32\NSI.dll | |||||
| 0x00007ff929f60000 - 0x00007ff929f9a000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL | |||||
| 0x00007ff918540000 - 0x00007ff91854e000 C:\WINDOWS\System32\winrnr.dll | |||||
| 0x00007ff926820000 - 0x00007ff92683c000 C:\WINDOWS\system32\NLAapi.dll | |||||
| 0x00007ff910540000 - 0x00007ff910555000 C:\WINDOWS\system32\wshbth.dll | |||||
| 0x00007ff920ac0000 - 0x00007ff920b37000 C:\WINDOWS\System32\fwpuclnt.dll | |||||
| 0x00007ff92ac80000 - 0x00007ff92aca6000 C:\WINDOWS\System32\bcrypt.dll | |||||
| 0x00007ff91e450000 - 0x00007ff91e45a000 C:\Windows\System32\rasadhlp.dll | |||||
| 0x0000000061ef0000 - 0x0000000061efd000 C:\soft-install\JDK8\JDK8\jre\bin\management.dll | |||||
| 0x00000000630a0000 - 0x00000000630ba000 C:\soft-install\JDK8\JDK8\jre\bin\net.dll | |||||
| 0x0000000063080000 - 0x0000000063091000 C:\soft-install\JDK8\JDK8\jre\bin\nio.dll | |||||
| 0x0000000063050000 - 0x0000000063074000 C:\soft-install\JDK8\JDK8\jre\bin\sunec.dll | |||||
| 0x00007ff929dc0000 - 0x00007ff929df3000 C:\WINDOWS\system32\rsaenh.dll | |||||
| 0x00007ff92a970000 - 0x00007ff92a995000 C:\WINDOWS\SYSTEM32\USERENV.dll | |||||
| 0x00007ff92a420000 - 0x00007ff92a42c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll | |||||
| 0x00007ff922200000 - 0x00007ff922216000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL | |||||
| 0x00007ff922390000 - 0x00007ff9223ac000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL | |||||
| 0x0000000061ee0000 - 0x0000000061eeb000 C:\soft-install\JDK8\JDK8\jre\bin\sunmscapi.dll | |||||
| 0x00007ff92b0c0000 - 0x00007ff92b209000 C:\WINDOWS\System32\CRYPT32.dll | |||||
| 0x00007ff92aa60000 - 0x00007ff92aa72000 C:\WINDOWS\System32\MSASN1.dll | |||||
| 0x00007ff9153c0000 - 0x00007ff9155b4000 C:\WINDOWS\SYSTEM32\dbghelp.dll | |||||
| VM Arguments: | |||||
| jvm_args: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:53298 -javaagent:C:\soft-install\jee-2019-09\eclipse\configuration\org.eclipse.osgi\412\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8 | |||||
| java_command: com.iformall.UserApplication | |||||
| java_class_path (initial): C:\project\formall\formallWu\formallProject\mallinkAdmin\target\classes;C:\Users\alascor\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\alascor\.m2\repository\javax\xml\bind\jaxb-api\2.3.0\jaxb-api-2.3.0.jar;C:\project\formall\formallWu\formallProject\mallinkService\target\classes;C:\Users\alascor\.m2\repository\net\sf\dozer\dozer\5.5.1\dozer-5.5.1.jar;C:\Users\alascor\.m2\repository\commons-beanutils\commons-beanutils\1.9.1\commons-beanutils-1.9.1.jar;C:\Users\alascor\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\Users\alascor\.m2\repository\org\apache\commons\commons-lang3\3.8\commons-lang3-3.8.jar;C:\Users\alascor\.m2\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;C:\Users\alascor\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.30\jcl-over-slf4j-1.7.30.jar;C:\Users\alascor\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.2.5.RELEASE\spring-boot-starter-web-2.2.5.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\boot\spring-boot-starter\2.2.5.RELEASE\spring-boot-starter-2.2.5.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\boot\spring-boot\2.2.5.RELEASE\spring-boot-2.2.5.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-core\5.2.4.RELEASE\spring-core-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-jcl\5.2.4.RELEASE\spring-jcl-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-context\5.2.4.RELEASE\spring-context-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-aop\5.2.4.RELEASE\spring-aop-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-beans\5.2.4.RELEASE\spring-beans-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\spring-expression\5.2.4.RELEASE\spring-expression-5.2.4.RELEASE.jar;C:\Users\alascor\.m2\repository\org\springframework\boot\spring-boot-autoc | |||||
| Launcher Type: SUN_STANDARD | |||||
| Environment Variables: | |||||
| JAVA_HOME=C:\soft-install\JDK8\JDK8 | |||||
| CLASSPATH=.;C:\soft-install\JDK8\JDK8\lib;C:\soft-install\JDK8\JDK8\lib\tools.jar | |||||
| PATH=C:/soft-install/JDK8/JDK8/bin/../jre/bin/server;C:/soft-install/JDK8/JDK8/bin/../jre/bin;C:/soft-install/JDK8/JDK8/bin/../jre/lib/amd64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\soft-install\Git\cmd\;%installation home%\bin\;C:\Users\alascor\AppData\Local\Microsoft\WindowsApps;C:\soft-install\JDK8\JDK8\bin;C:\soft-install\JDK8\JDK8\jre\bin;C:\soft-install\apache-maven-3.3.9\apache-maven-3.3.9\bin;;C:\Users\alascor\Desktop; | |||||
| USERNAME=alascor | |||||
| 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 18362 (10.0.18362.959) | |||||
| CPU:total 8 (4 cores per cpu, 2 threads per core) family 6 model 60 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, clmul, erms, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2 | |||||
| Memory: 4k page, physical 8068152k(1438196k free), swap 14621752k(5397372k free) | |||||
| vm_info: Java HotSpot(TM) 64-Bit Server VM (25.40-b25) for windows-amd64 JRE (1.8.0_40-b25), built on Feb 10 2015 21:53:57 by "java_re" with MS VC++ 10.0 (VS2010) | |||||
| time: Wed Aug 19 19:03:22 2020 | |||||
| elapsed time: 219 seconds (0d 0h 3m 39s) | |||||
| @@ -2,6 +2,7 @@ package com.iformall.config; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -142,6 +143,23 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("baseCUserTokenRedisTemplate") | |||||
| public RedisTemplate<String, BaseCUserEntity> getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, BaseCUserEntity> template = new RedisTemplate<String, BaseCUserEntity>(); | |||||
| Jackson2JsonRedisSerializer<BaseCUserEntity> j = new Jackson2JsonRedisSerializer<BaseCUserEntity>(BaseCUserEntity.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("mallRedisTemplate") | @Bean("mallRedisTemplate") | ||||
| public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | ||||
| RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | ||||
| @@ -212,4 +230,21 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("cUserBasicInfoRedisTemplate") | |||||
| public RedisTemplate<String, WxCUserBasicInfo> getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxCUserBasicInfo> template = new RedisTemplate<String, WxCUserBasicInfo>(); | |||||
| Jackson2JsonRedisSerializer<WxCUserBasicInfo> j = new Jackson2JsonRedisSerializer<WxCUserBasicInfo>(WxCUserBasicInfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxCouponChannel; | import com.iformall.domain.po.WxCouponChannel; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxCouponChannelMapper; | import com.iformall.mapper.WxCouponChannelMapper; | ||||
| import com.iformall.mapper.WxMerchantMapper; | import com.iformall.mapper.WxMerchantMapper; | ||||
| @@ -56,7 +57,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @Override | @Override | ||||
| public void run() { | public void run() { | ||||
| String param = merchant.getWeappScene(); | String param = merchant.getWeappScene(); | ||||
| ResultData resultData = qrCodeService.uploadQrcode(merchant, 1, pageUrl, param, 0, "", "", "店铺详情"); | |||||
| ResultData resultData = qrCodeService.uploadQrcode(merchant, 1, pageUrl, param, 0, "", "", "店铺详情",EnumPayWay.PAY_WAY_WECHAT); | |||||
| Map<String, String> map = (Map) resultData.data; | Map<String, String> map = (Map) resultData.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -82,7 +83,9 @@ public class WxAppinfoController extends BaseController { | |||||
| @Override | @Override | ||||
| public void run() { | public void run() { | ||||
| String param = couponChannel.getWeappScene(); | String param = couponChannel.getWeappScene(); | ||||
| ResultData resultData = qrCodeService.uploadQrcode(couponChannel,1,pageUrl,param,0,"","","券"); | |||||
| //暂时只有微信二维码,有别的码,需要加字段 | |||||
| ResultData resultData = qrCodeService.uploadQrcode(couponChannel,1,pageUrl,param,0,"","","券",EnumPayWay.PAY_WAY_WECHAT); | |||||
| Map<String,String> map = (Map)resultData.data; | Map<String,String> map = (Map)resultData.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -125,7 +128,7 @@ public class WxAppinfoController extends BaseController { | |||||
| qrCodeService.exportQrcode(request, response, | qrCodeService.exportQrcode(request, response, | ||||
| getTenantInfo(), type, pageUrl, sceneParam, | getTenantInfo(), type, pageUrl, sceneParam, | ||||
| withText, text1, text2, | withText, text1, text2, | ||||
| name); | |||||
| name,EnumPayWay.PAY_WAY_WECHAT); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| throw new MallinkException(Result.ERROR, "下载异常"); | throw new MallinkException(Result.ERROR, "下载异常"); | ||||
| @@ -76,7 +76,7 @@ public class BaseController { | |||||
| } | } | ||||
| /** | /** | ||||
| * 处理集团新增修改所需租户信息 | |||||
| * 处理集团新增修改所需租户信息(广场独立修改,集团修改全部) | |||||
| * ifParentUpdateTenantInfo | * ifParentUpdateTenantInfo | ||||
| */ | */ | ||||
| public TenantEntity ifParentUpdateTenantInfo() { | public TenantEntity ifParentUpdateTenantInfo() { | ||||
| @@ -88,6 +88,23 @@ public class BaseController { | |||||
| return info; | return info; | ||||
| } | } | ||||
| /** | |||||
| * 处理集团新增修改所需租户信息(各广场和集团独立修改) | |||||
| * ifParentUpdateTenantInfo | |||||
| */ | |||||
| public TenantEntity ifParentUpdateAloneTenantInfo(){ | |||||
| TenantEntity info = this.getTenantInfo(); | |||||
| if(StringUtils.isBlank(info.getTenantId())){ | |||||
| info.setTenantId(info.getParentTenantId()); | |||||
| info.setParentTenantId(null); | |||||
| } | |||||
| if(getUser().getTenantId().equals(info.getTenantId())){ | |||||
| return info; | |||||
| } | |||||
| new Exception("权限不足,只能独立操作"); | |||||
| return null; | |||||
| } | |||||
| public String getIpAddr() { | public String getIpAddr() { | ||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | ||||
| String ipaddress = IPUtil.getIpAddr(request); | String ipaddress = IPUtil.getIpAddr(request); | ||||
| @@ -0,0 +1,56 @@ | |||||
| package com.iformall.controller.basic; | |||||
| import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.lang.reflect.Method; | |||||
| import java.util.*; | |||||
| @RestController | |||||
| @RequestMapping("enum") | |||||
| @Api(description="枚举接口") | |||||
| public class EnumController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @SystemControllerLog(description = "会员管理-标签获取") | |||||
| @ApiOperation(value="获取枚举对象", notes="根据获取枚举类名获取枚举对象") | |||||
| @GetMapping("/getEnum/{type}") | |||||
| public ResultData getEnum(@PathVariable("type") String type) { | |||||
| if(StringUtils.isBlank(type)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| String className = "com.iformall.enums." + type; | |||||
| List<Map<String, String>> list = new ArrayList<Map<String, String>>(); | |||||
| try { | |||||
| // 1.得到枚举类对象 | |||||
| Class<Enum> clz = (Class<Enum>) Class.forName(className); | |||||
| // 2.得到所有枚举常量 | |||||
| Object[] objects = clz.getEnumConstants(); | |||||
| Method getCode = clz.getMethod("getCode"); | |||||
| Method getMessage = clz.getMethod("getMessage"); | |||||
| Map<String, String> map = null; | |||||
| for (Object obj : objects) { | |||||
| map = new HashMap<String, String>(); | |||||
| map.put("code", getCode.invoke(obj).toString()); | |||||
| map.put("message", getMessage.invoke(obj).toString()); | |||||
| list.add(map); | |||||
| } | |||||
| } catch (Exception e) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"数据不存在"); | |||||
| } | |||||
| if(list.size() == 0){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"数据不存在"); | |||||
| } | |||||
| return new ResultData(list); | |||||
| } | |||||
| } | |||||
| @@ -12,6 +12,8 @@ import com.iformall.domain.po.WxProfitSharingReceiver; | |||||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | import com.iformall.domain.vo.WxMerchantTradeDetailVo; | ||||
| import com.iformall.domain.vo.WxMerchantTradeVo; | import com.iformall.domain.vo.WxMerchantTradeVo; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import com.iformall.enums.EnumMerchantStatus; | |||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.QrCodeService; | import com.iformall.service.QrCodeService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| @@ -90,6 +92,25 @@ public class WxMerchantController extends BaseController { | |||||
| final PageInfo<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | final PageInfo<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("获取商户ID,名称接口") | |||||
| @GetMapping("IdAndNamelist") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "type", value = "类型", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true) | |||||
| }) | |||||
| @SystemControllerLog(description = "商户-列表") | |||||
| public ResultData IdAndNamelist(Integer type,Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | |||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | |||||
| wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC); | |||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||||
| wxMerchant.setType(type); | |||||
| wxMerchant.setCarVendorType(0); | |||||
| return new ResultData(wxMerchantService.queryIdAndNames(wxMerchant)); | |||||
| } | |||||
| @ApiOperation("ETCP商户列表") | @ApiOperation("ETCP商户列表") | ||||
| @@ -145,7 +166,9 @@ public class WxMerchantController extends BaseController { | |||||
| //加载二维码图片 | //加载二维码图片 | ||||
| String pageUrl = Constant.mainPageUrl; | String pageUrl = Constant.mainPageUrl; | ||||
| String param = "t:md:"+resultData.data; | String param = "t:md:"+resultData.data; | ||||
| ResultData resultQrCode = qrCodeService.uploadQrcode(wxMerchant,1,pageUrl,param,0,"","","店铺详情"); | |||||
| //这里暂时只有微信二维码,后续有别的二维码,再加字段 | |||||
| ResultData resultQrCode = qrCodeService.uploadQrcode(wxMerchant,1,pageUrl,param,0,"","","店铺详情",EnumPayWay.PAY_WAY_WECHAT); | |||||
| Map<String,String> map = (Map)resultQrCode.data; | Map<String,String> map = (Map)resultQrCode.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -156,7 +179,8 @@ public class WxMerchantController extends BaseController { | |||||
| return resultData; | return resultData; | ||||
| } | } | ||||
| @ApiOperation("更新商户接口") | @ApiOperation("更新商户接口") | ||||
| @PostMapping("updateMerchant") | @PostMapping("updateMerchant") | ||||
| @SystemControllerLog(description = "商户-更新") | @SystemControllerLog(description = "商户-更新") | ||||
| @@ -172,7 +196,7 @@ public class WxMerchantController extends BaseController { | |||||
| public ResultData updateMerchantAccount(@RequestBody WxMerchant wxMerchant) { | public ResultData updateMerchantAccount(@RequestBody WxMerchant wxMerchant) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::updateMerchantAccount"); | logger.debug("[" + getIpAddr() + "] WxMerchantController::updateMerchantAccount"); | ||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | wxMerchant.updateTenantInfo(getTenantInfo()); | ||||
| return wxMerchantService.updateMerchantAccount(wxMerchant); | |||||
| return wxMerchantService.updateMerchantAccount(wxMerchant,EnumPayWay.PAY_WAY_WECHAT); | |||||
| } | } | ||||
| @ApiOperation("更新管理员接口") | @ApiOperation("更新管理员接口") | ||||
| @@ -2,6 +2,7 @@ package com.iformall.controller.basic; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.TenantIgnore; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -13,17 +14,20 @@ import com.iformall.enums.EnumInvestUserType; | |||||
| import com.iformall.enums.EnumUserAdmin; | import com.iformall.enums.EnumUserAdmin; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.shiro.PasswordHelper; | import com.iformall.shiro.PasswordHelper; | ||||
| import com.iformall.sms.EnumSMSChannel; | |||||
| import com.iformall.utils.Constant; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.beans.factory.annotation.Qualifier; | |||||
| import org.springframework.data.redis.core.RedisTemplate; | |||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.concurrent.TimeUnit; | |||||
| @RestController | @RestController | ||||
| @Api(description = "初始化相关接口") | @Api(description = "初始化相关接口") | ||||
| @@ -64,6 +68,9 @@ public class WxProjectConfigController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxAuthorizerInfoService wxAuthorizerInfoService; | WxAuthorizerInfoService wxAuthorizerInfoService; | ||||
| @Autowired | |||||
| WxWeappExtSetService wxWeappExtSetService; | |||||
| @Autowired | @Autowired | ||||
| WxScoreRulesService wxScoreRulesService; | WxScoreRulesService wxScoreRulesService; | ||||
| @@ -85,10 +92,15 @@ public class WxProjectConfigController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| MallUserInfoService mallUserInfoService; | MallUserInfoService mallUserInfoService; | ||||
| @Autowired | |||||
| @Qualifier("openRedisTemplate") | |||||
| RedisTemplate<String, String> openRedisTemplate; | |||||
| @ApiOperation("添加商场基础数据") | @ApiOperation("添加商场基础数据") | ||||
| @GetMapping(value = "/init/{id}") | @GetMapping(value = "/init/{id}") | ||||
| @SystemControllerLog(description = "商场基础数据") | @SystemControllerLog(description = "商场基础数据") | ||||
| @TenantIgnore | |||||
| public ResultData init(@PathVariable Long id) { | public ResultData init(@PathVariable Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::init"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::init"); | ||||
| try { | try { | ||||
| @@ -105,6 +117,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| @ApiOperation("查询商场集团列表") | @ApiOperation("查询商场集团列表") | ||||
| @GetMapping(value = "/mallList") | @GetMapping(value = "/mallList") | ||||
| @SystemControllerLog(description = "商场基础数据") | @SystemControllerLog(description = "商场基础数据") | ||||
| @TenantIgnore | |||||
| public ResultData getMallList(@ModelAttribute WxMall wxMall, Integer pageNum, Integer pageSize) { | public ResultData getMallList(@ModelAttribute WxMall wxMall, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getMallList"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getMallList"); | ||||
| try { | try { | ||||
| @@ -117,12 +130,44 @@ public class WxProjectConfigController extends BaseController { | |||||
| logger.error(e.getMessage(),e); | logger.error(e.getMessage(),e); | ||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | return new ResultData(ErrorCode.SYS_SERVER_ERROR); | ||||
| } | } | ||||
| } | |||||
| @ApiOperation("查询商场集团列表(选择子集团)") | |||||
| @GetMapping(value = "/mallListbyMall") | |||||
| @SystemControllerLog(description = "商场基础数据") | |||||
| @TenantIgnore | |||||
| public ResultData mallListbyMall(@ModelAttribute WxMall wxMall) { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::mallListbyMall"); | |||||
| try { | |||||
| if(wxMall == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if(wxMall.getId() == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| TenantEntity TenantEntity = new TenantEntity(){{ | |||||
| setTenantId(wxMall.getId().toString()); | |||||
| }}; | |||||
| WxMall parentWxMall = wxMallService.getByTenantInfo(TenantEntity); | |||||
| if(parentWxMall == null || parentWxMall.getSaleType() != 100 | |||||
| || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | |||||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||||
| } | |||||
| List<WxMall> list = wxMallService.listAsSelectMall(wxMall.getId()); | |||||
| return new ResultData(list); | |||||
| }catch (Exception e){ | |||||
| logger.error(e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| } | } | ||||
| @ApiOperation("添加修改商场集团") | @ApiOperation("添加修改商场集团") | ||||
| @PostMapping("/init/mall") | @PostMapping("/init/mall") | ||||
| @SystemControllerLog(description = "商场集团-更新") | @SystemControllerLog(description = "商场集团-更新") | ||||
| @TenantIgnore | |||||
| public ResultData initMall(@RequestBody WxMall wxMall) { | public ResultData initMall(@RequestBody WxMall wxMall) { | ||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMall"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMall"); | ||||
| try { | try { | ||||
| @@ -132,15 +177,18 @@ public class WxProjectConfigController extends BaseController { | |||||
| }else{ | }else{ | ||||
| wxMall.setGroupSupport(EnumGroupSupport.NOT_SUPPORT.getCode()); | wxMall.setGroupSupport(EnumGroupSupport.NOT_SUPPORT.getCode()); | ||||
| } | } | ||||
| if(StringUtils.isBlank(wxMall.getBusinessHours())){ | |||||
| if(wxMall.getId() == null && StringUtils.isBlank(wxMall.getBusinessHours())){ | |||||
| wxMall.setBusinessHours("[]"); | wxMall.setBusinessHours("[]"); | ||||
| } | } | ||||
| if(StringUtils.isBlank(wxMall.getIntroduction())){ | |||||
| if(wxMall.getId() == null && StringUtils.isBlank(wxMall.getIntroduction())){ | |||||
| wxMall.setIntroduction(""); | wxMall.setIntroduction(""); | ||||
| } | } | ||||
| if(StringUtils.isBlank(wxMall.getImg())){ | |||||
| if(wxMall.getId() == null && StringUtils.isBlank(wxMall.getImg())){ | |||||
| wxMall.setImg(""); | wxMall.setImg(""); | ||||
| } | } | ||||
| if(wxMall.getId() == null && StringUtils.isBlank(wxMall.getWeapNote())){ | |||||
| wxMall.setWeapNote("{}"); | |||||
| } | |||||
| wxProjectConfigService.initMall(wxMall); | wxProjectConfigService.initMall(wxMall); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -153,6 +201,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| @ApiOperation("添加修改商场楼座信息") | @ApiOperation("添加修改商场楼座信息") | ||||
| @PostMapping("/init/building") | @PostMapping("/init/building") | ||||
| @SystemControllerLog(description = "商场楼座-更新") | @SystemControllerLog(description = "商场楼座-更新") | ||||
| @TenantIgnore | |||||
| public ResultData initBuilding(@RequestBody List<WxMallBuilding> wxMallBuildings) { | public ResultData initBuilding(@RequestBody List<WxMallBuilding> wxMallBuildings) { | ||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initBuilding"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initBuilding"); | ||||
| try { | try { | ||||
| @@ -176,6 +225,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| @ApiOperation("添加修改特殊商户号信息") | @ApiOperation("添加修改特殊商户号信息") | ||||
| @PostMapping("/init/payAccount") | @PostMapping("/init/payAccount") | ||||
| @SystemControllerLog(description = "特殊商户号-更新") | @SystemControllerLog(description = "特殊商户号-更新") | ||||
| @TenantIgnore | |||||
| public ResultData initPayAccount(@RequestBody WxPayAccount wxPayAccount) { | public ResultData initPayAccount(@RequestBody WxPayAccount wxPayAccount) { | ||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPayAccount"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPayAccount"); | ||||
| try { | try { | ||||
| @@ -215,6 +265,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| @ApiOperation("添加修改小程序信息") | @ApiOperation("添加修改小程序信息") | ||||
| @PostMapping("/init/appinfo") | @PostMapping("/init/appinfo") | ||||
| @SystemControllerLog(description = "小程序信息-更新") | @SystemControllerLog(description = "小程序信息-更新") | ||||
| @TenantIgnore | |||||
| public ResultData initAppinfo(@RequestBody WxAppinfo wxAppinfo) { | public ResultData initAppinfo(@RequestBody WxAppinfo wxAppinfo) { | ||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAppinfo"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAppinfo"); | ||||
| try { | try { | ||||
| @@ -234,6 +285,34 @@ public class WxProjectConfigController extends BaseController { | |||||
| wxAppinfoService.saveOrUpdate(wxAppinfo); | wxAppinfoService.saveOrUpdate(wxAppinfo); | ||||
| WxAuthorizerInfo wxAuthorizerInfo = new WxAuthorizerInfo(); | |||||
| wxAuthorizerInfo.updateTenantInfo(wxAppinfo); | |||||
| wxAuthorizerInfo.setType(wxAppinfo.getType()); | |||||
| wxAuthorizerInfo.setAuthorizerAppid(wxAppinfo.getAppId()); | |||||
| if(wxAppinfo.getId() == null && wxAuthorizerInfo.getAuthorizationStatus() == null){ | |||||
| wxAuthorizerInfo.setAuthorizationStatus(0);//授权状态,0为已授权,1为已取消授权 | |||||
| wxAuthorizerInfo.setAuthTime(new Date()); | |||||
| } | |||||
| if(wxAppinfo.getId() == null && wxAuthorizerInfo.getBaseStatus() == null){ | |||||
| wxAuthorizerInfo.setBaseStatus(0);//微信基础版本设置状态,0为已设置,1为设置失败 | |||||
| wxAuthorizerInfo.setBaseTime(new Date()); | |||||
| } | |||||
| if(wxAppinfo.getId() == null && wxAuthorizerInfo.getDomainStatus() == null){ | |||||
| wxAuthorizerInfo.setDomainStatus(0);//服务器域名设置状态,0为已设置,1为设置失败 | |||||
| wxAuthorizerInfo.setDomainTime(new Date()); | |||||
| } | |||||
| if(wxAppinfo.getId() == null && wxAuthorizerInfo.getWebdomainStatus() == null){ | |||||
| wxAuthorizerInfo.setWebdomainStatus(0);//服务器业务域名设置状态,0为已设置,1为设置失败 | |||||
| wxAuthorizerInfo.setWebdomainTime(new Date()); | |||||
| } | |||||
| if(wxAppinfo.getId() == null && StringUtils.isBlank(wxAuthorizerInfo.getRefreshToken())){ | |||||
| wxAuthorizerInfo.setRefreshToken(""); | |||||
| } | |||||
| if(wxAppinfo.getId() == null && StringUtils.isBlank(wxAuthorizerInfo.getAccessToken())){ | |||||
| wxAuthorizerInfo.setAccessToken(""); | |||||
| } | |||||
| wxAuthorizerInfoService.saveOrUpdate(wxAuthorizerInfo); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| }catch (Exception e){ | }catch (Exception e){ | ||||
| logger.error(e.getMessage(),e); | logger.error(e.getMessage(),e); | ||||
| @@ -247,6 +326,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| @ApiOperation("添加修改商场后台管理帐号") | @ApiOperation("添加修改商场后台管理帐号") | ||||
| @PostMapping("/init/userInfo") | @PostMapping("/init/userInfo") | ||||
| @SystemControllerLog(description = "商场后台管理帐号-更新") | @SystemControllerLog(description = "商场后台管理帐号-更新") | ||||
| @TenantIgnore | |||||
| public ResultData initUserInfo(@RequestBody MallUserInfo userInfo) { | public ResultData initUserInfo(@RequestBody MallUserInfo userInfo) { | ||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initUserInfo"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initUserInfo"); | ||||
| try { | try { | ||||
| @@ -271,7 +351,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| PasswordHelper passwordHelper = new PasswordHelper(); | PasswordHelper passwordHelper = new PasswordHelper(); | ||||
| passwordHelper.encryptPassword(userInfo); | passwordHelper.encryptPassword(userInfo); | ||||
| userInfo.setIsAdmin(EnumUserAdmin.ADMIN.getCode()); | userInfo.setIsAdmin(EnumUserAdmin.ADMIN.getCode()); | ||||
| userInfo.setInvestRule(EnumInvestUserType.MANAGER.getCode()); | |||||
| userInfo.setInvestRule(EnumInvestUserType.ALL.getCode()); | |||||
| wxProjectConfigService.initUserInfo(userInfo); | wxProjectConfigService.initUserInfo(userInfo); | ||||
| }else{ | }else{ | ||||
| @@ -306,58 +386,56 @@ public class WxProjectConfigController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @ApiOperation("添加修改商场短信配置") | |||||
| @PostMapping("/init/msgConfig") | |||||
| @SystemControllerLog(description = "商场后短信配置-更新") | |||||
| public ResultData initMsgConfig(@RequestBody WxMsgConfig wxMsgConfig) { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMsgConfig"); | |||||
| try { | |||||
| if(StringUtils.isBlank(wxMsgConfig.getTenantId())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if(StringUtils.isBlank(wxMsgConfig.getAppid())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if(wxMsgConfig.getSmsChannel() == null){ | |||||
| wxMsgConfig.setSmsChannel(EnumSMSChannel.WIWIDE.getCode()); | |||||
| } | |||||
| if(wxMsgConfig.getSmsChannel() == EnumSMSChannel.WIWIDE.getCode()){ | |||||
| wxMsgConfig.setSecret("7305150347587283553aa8898e7dbf20"); | |||||
| wxMsgConfig.setPublickey("MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvh8j/zagfxQdnSh5OIic\\r" + | |||||
| "\\nMzN+MuRuWQJPjgu4Gza4+gX3j5Ln2xNDBOTjpwyuLBjh/JcBd1cGO3lAaKCwcaix\\r" + | |||||
| "\\nsmhTq56wVXXUMgDiAChu4ud8FSvRc8G8tdZAirKVAIi3NW+/pYgpWBs/0wnF8hz4\\r" + | |||||
| "\\n8no4pyJHl9Jc1LH3VNIMz8vqzKUPc4ack4pFUXlcNj6C+sBlaurmI4/vwLqNxBGs\\r" + | |||||
| "\\n7/zyM7dv6oy3DSU/Y1qBArM1YPjfL2dNun8rmtPgJvlPwXqA7uoHPwQ2Ym3aUn59\\r" + | |||||
| "\\npkS7QI6IE8uuqNkfSte8BXLd2nIqPLFxLYLDmdll7eoyRblHcHqAYSj8stK6StC7\\r" + | |||||
| "\\nDNryNKEjTEwbgf9trUI0uvF1pfgTy2gpclnY69FtD/m0+FvLyorMq+nmBqYMjka5\\r" + | |||||
| "\\nK0txDQJPOa7gsi//uXd/cJW2SAXY9MSO1AfMi8Xq/YKRQzN9FW5iapskXFHca7uX\\r" + | |||||
| "\\ng5NhH7flr6DW+QInFlpoN6WIEAuDF1aj4O49Ikm3WxwhTqnvEkdSCfivpYQkp9Sh\\r" + | |||||
| "\\n4kQ/SQdxuT7VX+Nz6k+uMx2z4cySk33bHi0KoHbA9QFGg/54Qd0+eU4qZnd4mrgh\\r" + | |||||
| "\\nhH7/QQhL7Z9eF1U5UPrsHq2Vq3rEnN+tYQ26AuKeU8vzTxBrC/SxC6C/SMFt3f/Y\\r" + | |||||
| "\\nnuFh1UnNJZleZwyQt+ZdGO0CAwEAAQ=="); | |||||
| wxMsgConfig.setBid("465565"); | |||||
| wxMsgConfig.setAccount("15626593768"); | |||||
| wxMsgConfig.setNotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receivemsg/" + wxMsgConfig.getTenantId()); | |||||
| wxMsgConfig.setModelnotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receivemodel/" + wxMsgConfig.getTenantId()); | |||||
| wxMsgConfig.setVerifynotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receiveverifymodel/" + wxMsgConfig.getTenantId()); | |||||
| } | |||||
| if(wxMsgConfig.getTotal() == null){ | |||||
| wxMsgConfig.setTotal((long) 100000); | |||||
| } | |||||
| wxMsgConfig.setRecharge((long) 0); | |||||
| wxMsgConfig.setRemains(wxMsgConfig.getTotal()); | |||||
| wxMsgConfig.setReminderstatus(0); | |||||
| wxMsgConfigService.saveOrUpdate(wxMsgConfig); | |||||
| return new ResultData(); | |||||
| }catch (Exception e){ | |||||
| logger.error(e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| } | |||||
| // @ApiOperation("添加修改商场短信配置") | |||||
| // @PostMapping("/init/msgConfig") | |||||
| // @SystemControllerLog(description = "商场后短信配置-更新") | |||||
| // public ResultData initMsgConfig(@RequestBody WxMsgConfig wxMsgConfig) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMsgConfig"); | |||||
| // try { | |||||
| // if(StringUtils.isBlank(wxMsgConfig.getTenantId())){ | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| // } | |||||
| // if(wxMsgConfig.getSmsChannel() == null){ | |||||
| // wxMsgConfig.setSmsChannel(EnumSMSChannel.WIWIDE.getCode()); | |||||
| // } | |||||
| // if(wxMsgConfig.getSmsChannel() == EnumSMSChannel.WIWIDE.getCode()){ | |||||
| // wxMsgConfig.setSecret("7305150347587283553aa8898e7dbf20"); | |||||
| // wxMsgConfig.setPublickey("MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvh8j/zagfxQdnSh5OIic\\r" + | |||||
| // "\\nMzN+MuRuWQJPjgu4Gza4+gX3j5Ln2xNDBOTjpwyuLBjh/JcBd1cGO3lAaKCwcaix\\r" + | |||||
| // "\\nsmhTq56wVXXUMgDiAChu4ud8FSvRc8G8tdZAirKVAIi3NW+/pYgpWBs/0wnF8hz4\\r" + | |||||
| // "\\n8no4pyJHl9Jc1LH3VNIMz8vqzKUPc4ack4pFUXlcNj6C+sBlaurmI4/vwLqNxBGs\\r" + | |||||
| // "\\n7/zyM7dv6oy3DSU/Y1qBArM1YPjfL2dNun8rmtPgJvlPwXqA7uoHPwQ2Ym3aUn59\\r" + | |||||
| // "\\npkS7QI6IE8uuqNkfSte8BXLd2nIqPLFxLYLDmdll7eoyRblHcHqAYSj8stK6StC7\\r" + | |||||
| // "\\nDNryNKEjTEwbgf9trUI0uvF1pfgTy2gpclnY69FtD/m0+FvLyorMq+nmBqYMjka5\\r" + | |||||
| // "\\nK0txDQJPOa7gsi//uXd/cJW2SAXY9MSO1AfMi8Xq/YKRQzN9FW5iapskXFHca7uX\\r" + | |||||
| // "\\ng5NhH7flr6DW+QInFlpoN6WIEAuDF1aj4O49Ikm3WxwhTqnvEkdSCfivpYQkp9Sh\\r" + | |||||
| // "\\n4kQ/SQdxuT7VX+Nz6k+uMx2z4cySk33bHi0KoHbA9QFGg/54Qd0+eU4qZnd4mrgh\\r" + | |||||
| // "\\nhH7/QQhL7Z9eF1U5UPrsHq2Vq3rEnN+tYQ26AuKeU8vzTxBrC/SxC6C/SMFt3f/Y\\r" + | |||||
| // "\\nnuFh1UnNJZleZwyQt+ZdGO0CAwEAAQ=="); | |||||
| // wxMsgConfig.setBid("465565"); | |||||
| // wxMsgConfig.setAccount("15626593768"); | |||||
| // wxMsgConfig.setNotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receivemsg/" + wxMsgConfig.getTenantId()); | |||||
| // wxMsgConfig.setModelnotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receivemodel/" + wxMsgConfig.getTenantId()); | |||||
| // wxMsgConfig.setVerifynotifyurl("https://admin.malls.iformall.com/wxMsgCallback/receiveverifymodel/" + wxMsgConfig.getTenantId()); | |||||
| // } | |||||
| // if(wxMsgConfig.getTotal() == null){ | |||||
| // wxMsgConfig.setTotal((long) 100000); | |||||
| // } | |||||
| // wxMsgConfig.setRecharge((long) 0); | |||||
| // wxMsgConfig.setRemains(wxMsgConfig.getTotal()); | |||||
| // wxMsgConfig.setReminderstatus(0); | |||||
| // wxMsgConfigService.saveOrUpdate(wxMsgConfig); | |||||
| // return new ResultData(); | |||||
| // }catch (Exception e){ | |||||
| // logger.error(e.getMessage(),e); | |||||
| // return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| // } | |||||
| // } | |||||
| @ApiOperation("添加修改停车场配置") | @ApiOperation("添加修改停车场配置") | ||||
| @PostMapping("/init/park") | @PostMapping("/init/park") | ||||
| @SystemControllerLog(description = "商场停车场配置-更新") | @SystemControllerLog(description = "商场停车场配置-更新") | ||||
| @TenantIgnore | |||||
| public ResultData initPark(@RequestBody WxPark wxPark) { | public ResultData initPark(@RequestBody WxPark wxPark) { | ||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPark"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPark"); | ||||
| try { | try { | ||||
| @@ -370,19 +448,19 @@ public class WxProjectConfigController extends BaseController { | |||||
| if(wxPark.getNumber() == null){ | if(wxPark.getNumber() == null){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| if(StringUtils.isBlank(wxPark.getVendorParams())){ | |||||
| if(wxPark.getId() == null && StringUtils.isBlank(wxPark.getVendorParams())){ | |||||
| wxPark.setVendorParams("{}"); | wxPark.setVendorParams("{}"); | ||||
| } | } | ||||
| if(wxPark.getVendorType() == null){ | |||||
| if(wxPark.getId() == null && wxPark.getVendorType() == null){ | |||||
| wxPark.setVendorType(0); | wxPark.setVendorType(0); | ||||
| } | } | ||||
| if(StringUtils.isBlank(wxPark.getParkId())){ | |||||
| if(wxPark.getId() == null && StringUtils.isBlank(wxPark.getParkId())){ | |||||
| wxPark.setParkId("0"); | wxPark.setParkId("0"); | ||||
| } | } | ||||
| if(StringUtils.isBlank(wxPark.getStopFee())){ | |||||
| if(wxPark.getId() == null && StringUtils.isBlank(wxPark.getStopFee())){ | |||||
| wxPark.setStopFee(""); | wxPark.setStopFee(""); | ||||
| } | } | ||||
| if(wxPark.getEntryExit() == null){ | |||||
| if(wxPark.getId() == null && wxPark.getEntryExit() == null){ | |||||
| wxPark.setEntryExit(1); | wxPark.setEntryExit(1); | ||||
| } | } | ||||
| wxParkService.saveOrUpdate(wxPark); | wxParkService.saveOrUpdate(wxPark); | ||||
| @@ -393,73 +471,74 @@ public class WxProjectConfigController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @ApiOperation("添加修改迈外迪信息") | |||||
| @PostMapping("/init/wiwidi") | |||||
| @SystemControllerLog(description = "迈外迪信息配置-更新") | |||||
| public ResultData initWiwidi(@RequestBody WxWiWideInfo wxWiWideInfo) { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPark"); | |||||
| try { | |||||
| if(StringUtils.isBlank(wxWiWideInfo.getTenantId())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| wxWiWideInfoService.saveOrUpdate(wxWiWideInfo); | |||||
| return new ResultData(); | |||||
| }catch (Exception e){ | |||||
| logger.error(e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| } | |||||
| @ApiOperation("添加修改微信公众账号的基本信息") | |||||
| @PostMapping("/init/authorizer") | |||||
| @SystemControllerLog(description = "微信公众账号的基本信息-更新") | |||||
| public ResultData initAuthorizer(@RequestBody WxAuthorizerInfo wxAuthorizerInfo) { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAuthorizer"); | |||||
| try { | |||||
| if(StringUtils.isBlank(wxAuthorizerInfo.getTenantId())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if(wxAuthorizerInfo.getAuthorizationStatus() == null){ | |||||
| wxAuthorizerInfo.setAuthorizationStatus(0);//授权状态,0为已授权,1为已取消授权 | |||||
| wxAuthorizerInfo.setAuthTime(new Date()); | |||||
| } | |||||
| if(wxAuthorizerInfo.getBaseStatus() == null){ | |||||
| wxAuthorizerInfo.setBaseStatus(0);//微信基础版本设置状态,0为已设置,1为设置失败 | |||||
| wxAuthorizerInfo.setBaseTime(new Date()); | |||||
| } | |||||
| if(wxAuthorizerInfo.getDomainStatus() == null){ | |||||
| wxAuthorizerInfo.setDomainStatus(0);//服务器域名设置状态,0为已设置,1为设置失败 | |||||
| wxAuthorizerInfo.setDomainTime(new Date()); | |||||
| } | |||||
| if(wxAuthorizerInfo.getWebdomainStatus() == null){ | |||||
| wxAuthorizerInfo.setWebdomainStatus(0);//服务器业务域名设置状态,0为已设置,1为设置失败 | |||||
| wxAuthorizerInfo.setWebdomainTime(new Date()); | |||||
| } | |||||
| if(StringUtils.isNotBlank(wxAuthorizerInfo.getCurrentVersion()) | |||||
| && wxAuthorizerInfo.getReleaseTime() != null){ | |||||
| wxAuthorizerInfo.setReleaseTime(new Date()); | |||||
| } | |||||
| if(StringUtils.isNotBlank(wxAuthorizerInfo.getOpenAppid()) | |||||
| && wxAuthorizerInfo.getBindOpenTime() != null){ | |||||
| wxAuthorizerInfo.setBindOpenTime(new Date()); | |||||
| } | |||||
| if(StringUtils.isBlank(wxAuthorizerInfo.getRefreshToken())){ | |||||
| wxAuthorizerInfo.setRefreshToken(""); | |||||
| } | |||||
| if(StringUtils.isBlank(wxAuthorizerInfo.getAccessToken())){ | |||||
| wxAuthorizerInfo.setAccessToken(""); | |||||
| } | |||||
| wxAuthorizerInfoService.saveOrUpdate(wxAuthorizerInfo); | |||||
| return new ResultData(); | |||||
| }catch (Exception e){ | |||||
| logger.error(e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| } | |||||
| // @ApiOperation("添加修改迈外迪信息") | |||||
| // @PostMapping("/init/wiwidi") | |||||
| // @SystemControllerLog(description = "迈外迪信息配置-更新") | |||||
| // public ResultData initWiwidi(@RequestBody WxWiWideInfo wxWiWideInfo) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPark"); | |||||
| // try { | |||||
| // if(StringUtils.isBlank(wxWiWideInfo.getTenantId())){ | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| // } | |||||
| // wxWiWideInfoService.saveOrUpdate(wxWiWideInfo); | |||||
| // return new ResultData(); | |||||
| // }catch (Exception e){ | |||||
| // logger.error(e.getMessage(),e); | |||||
| // return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| // } | |||||
| // } | |||||
| // @ApiOperation("添加修改微信公众账号的基本信息") | |||||
| // @PostMapping("/init/authorizer") | |||||
| // @SystemControllerLog(description = "微信公众账号的基本信息-更新") | |||||
| // public ResultData initAuthorizer(@RequestBody WxAuthorizerInfo wxAuthorizerInfo) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAuthorizer"); | |||||
| // try { | |||||
| // if(StringUtils.isBlank(wxAuthorizerInfo.getTenantId())){ | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| // } | |||||
| // if(wxAuthorizerInfo.getAuthorizationStatus() == null){ | |||||
| // wxAuthorizerInfo.setAuthorizationStatus(0);//授权状态,0为已授权,1为已取消授权 | |||||
| // wxAuthorizerInfo.setAuthTime(new Date()); | |||||
| // } | |||||
| // if(wxAuthorizerInfo.getBaseStatus() == null){ | |||||
| // wxAuthorizerInfo.setBaseStatus(0);//微信基础版本设置状态,0为已设置,1为设置失败 | |||||
| // wxAuthorizerInfo.setBaseTime(new Date()); | |||||
| // } | |||||
| // if(wxAuthorizerInfo.getDomainStatus() == null){ | |||||
| // wxAuthorizerInfo.setDomainStatus(0);//服务器域名设置状态,0为已设置,1为设置失败 | |||||
| // wxAuthorizerInfo.setDomainTime(new Date()); | |||||
| // } | |||||
| // if(wxAuthorizerInfo.getWebdomainStatus() == null){ | |||||
| // wxAuthorizerInfo.setWebdomainStatus(0);//服务器业务域名设置状态,0为已设置,1为设置失败 | |||||
| // wxAuthorizerInfo.setWebdomainTime(new Date()); | |||||
| // } | |||||
| // if(StringUtils.isNotBlank(wxAuthorizerInfo.getCurrentVersion()) | |||||
| // && wxAuthorizerInfo.getReleaseTime() != null){ | |||||
| // wxAuthorizerInfo.setReleaseTime(new Date()); | |||||
| // } | |||||
| // if(StringUtils.isNotBlank(wxAuthorizerInfo.getOpenAppid()) | |||||
| // && wxAuthorizerInfo.getBindOpenTime() != null){ | |||||
| // wxAuthorizerInfo.setBindOpenTime(new Date()); | |||||
| // } | |||||
| // if(StringUtils.isBlank(wxAuthorizerInfo.getRefreshToken())){ | |||||
| // wxAuthorizerInfo.setRefreshToken(""); | |||||
| // } | |||||
| // if(StringUtils.isBlank(wxAuthorizerInfo.getAccessToken())){ | |||||
| // wxAuthorizerInfo.setAccessToken(""); | |||||
| // } | |||||
| // wxAuthorizerInfoService.saveOrUpdate(wxAuthorizerInfo); | |||||
| // return new ResultData(); | |||||
| // }catch (Exception e){ | |||||
| // logger.error(e.getMessage(),e); | |||||
| // return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| // } | |||||
| // } | |||||
| @ApiOperation("查询商场基础数据") | @ApiOperation("查询商场基础数据") | ||||
| @GetMapping(value = "/getinit/{id}") | @GetMapping(value = "/getinit/{id}") | ||||
| @SystemControllerLog(description = "商场基础数据") | @SystemControllerLog(description = "商场基础数据") | ||||
| @TenantIgnore | |||||
| public ResultData getinit(@PathVariable Long id) { | public ResultData getinit(@PathVariable Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getinit"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getinit"); | ||||
| try { | try { | ||||
| @@ -549,17 +628,58 @@ public class WxProjectConfigController extends BaseController { | |||||
| @ApiOperation("集团新增修改子广场") | @ApiOperation("集团新增修改子广场") | ||||
| @PostMapping("/init/submall") | @PostMapping("/init/submall") | ||||
| @SystemControllerLog(description = "子广场-更新") | @SystemControllerLog(description = "子广场-更新") | ||||
| public ResultData initSubmall(@RequestBody WxMall wxMall) { | |||||
| @TenantIgnore | |||||
| public ResultData initSubmall(@RequestBody Map<String, Object> map) { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initSubmall"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initSubmall"); | ||||
| try { | try { | ||||
| if(StringUtils.isBlank(wxMall.getTenantId())){ | |||||
| String tenantId = (String) map.get("tenantId"); | |||||
| List<String> subTenantIds = (List<String>) map.get("subTenantIds"); | |||||
| if(StringUtils.isBlank(tenantId)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| if(StringUtils.isBlank(wxMall.getParentTenantId())){ | |||||
| // if(subTenantIds == null || subTenantIds.length == 0){ | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| // } | |||||
| TenantEntity TenantEntity = new TenantEntity(){{ | |||||
| setTenantId(tenantId); | |||||
| }}; | |||||
| WxMall parentWxMall = wxMallService.getByTenantInfo(TenantEntity); | |||||
| if(parentWxMall == null || parentWxMall.getSaleType() != 100 | |||||
| || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | |||||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||||
| } | |||||
| wxProjectConfigService.initSubmall(tenantId,subTenantIds); | |||||
| return new ResultData(); | |||||
| }catch (Exception e){ | |||||
| logger.error(e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| } | |||||
| @ApiOperation("刷集团商场历史数据(五分钟内只能掉一次)") | |||||
| @PostMapping("/init/after/group") | |||||
| @SystemControllerLog(description = "商场-数据更新") | |||||
| @TenantIgnore | |||||
| public ResultData initAfterGroup(@RequestBody Map<String, Object> map) { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAfterGroup"); | |||||
| try { | |||||
| String tenantId = (String) map.get("tenantId"); | |||||
| List<String> subTenantIds = (List<String>) map.get("subTenantIds"); | |||||
| String subTenantIdStrs = null; | |||||
| if(StringUtils.isBlank(tenantId)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| if(subTenantIds == null || subTenantIds.size() == 0){ | |||||
| //return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| }else{ | |||||
| subTenantIdStrs = StringUtils.join(subTenantIds, ','); | |||||
| } | |||||
| TenantEntity TenantEntity = new TenantEntity(){{ | TenantEntity TenantEntity = new TenantEntity(){{ | ||||
| setTenantId(wxMall.getParentTenantId()); | |||||
| setTenantId(tenantId); | |||||
| }}; | }}; | ||||
| WxMall parentWxMall = wxMallService.getByTenantInfo(TenantEntity); | WxMall parentWxMall = wxMallService.getByTenantInfo(TenantEntity); | ||||
| if(parentWxMall == null || parentWxMall.getSaleType() != 100 | if(parentWxMall == null || parentWxMall.getSaleType() != 100 | ||||
| @@ -567,8 +687,18 @@ public class WxProjectConfigController extends BaseController { | |||||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| } | } | ||||
| String[] tenantIds = wxMall.getTenantId().split(","); | |||||
| wxProjectConfigService.initSubmall(wxMall.getParentTenantId(),tenantIds); | |||||
| StringBuilder sb = new StringBuilder(); | |||||
| sb.append(Constant.INTERFACE_VISIT_LIMIT_KEY).append("initAfterGroup"); | |||||
| String key = sb.toString(); | |||||
| boolean hasKey = openRedisTemplate.hasKey(key); | |||||
| if(hasKey){ | |||||
| return new ResultData(ErrorCode.TOO_MANY_REQUEST); | |||||
| }else{ | |||||
| openRedisTemplate.opsForValue().set(key,"1",3000, TimeUnit.SECONDS); | |||||
| } | |||||
| // String join = StringUtils.join(subTenantIds, ','); | |||||
| wxProjectConfigService.initAfterGroup(tenantId,subTenantIdStrs); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| }catch (Exception e){ | }catch (Exception e){ | ||||
| @@ -577,5 +707,37 @@ public class WxProjectConfigController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @ApiOperation("查询ext数据") | |||||
| @GetMapping(value = "/getExt/{appId}") | |||||
| @SystemControllerLog(description = "商场基础数据") | |||||
| @TenantIgnore | |||||
| public ResultData getExt(@PathVariable String appId) { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getExt"); | |||||
| try { | |||||
| if(StringUtils.isBlank(appId)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| WxWeappExtSet byAppId = wxWeappExtSetService.getByAppId(appId); | |||||
| return new ResultData(byAppId); | |||||
| }catch (Exception e){ | |||||
| logger.error(e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| } | |||||
| @ApiOperation("添加修改ext数据配置") | |||||
| @PostMapping("/init/appExt") | |||||
| @SystemControllerLog(description = "商场ext数据配置-更新") | |||||
| @TenantIgnore | |||||
| public ResultData initAppExt(@RequestBody WxWeappExtSet wxWeappExtSet) { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAppExt"); | |||||
| try { | |||||
| wxWeappExtSetService.updateById(wxWeappExtSet); | |||||
| return new ResultData(); | |||||
| }catch (Exception e){ | |||||
| logger.error(e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,114 @@ | |||||
| package com.iformall.controller.contract; | |||||
| import java.util.ArrayList; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.WxFlowModel; | |||||
| import com.iformall.domain.po.WxPropertyContract; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||||
| import com.iformall.enums.EnumContractOperationType; | |||||
| import com.iformall.enums.EnumFlowContractType; | |||||
| import com.iformall.enums.EnumFlowKey; | |||||
| import com.iformall.enums.EnumRentShopType; | |||||
| import com.iformall.service.WxFlowService; | |||||
| @RestController | |||||
| public class WxContractBaseController extends BaseController{ | |||||
| @Autowired | |||||
| private WxFlowService wxFlowService; | |||||
| protected Map<String,Object> generateFlowParams(EnumFlowKey flowType,EnumFlowContractType contractType,String remark,Long contractId,Long wholeProperyId) { | |||||
| Map<String,Object> map = new HashMap<String,Object>(); | |||||
| map.put("businessType", flowType.getCode()); | |||||
| map.put("remark", remark); | |||||
| map.put("businessId", String.valueOf(contractId)); | |||||
| //租金+物业合同时用到 | |||||
| if (null != wholeProperyId) { | |||||
| map.put("wholeProperyId", String.valueOf(wholeProperyId)); | |||||
| } | |||||
| List<Map> variablesList = new ArrayList<Map>(); | |||||
| Map contractTypeMap = new HashMap<String,Object>(); | |||||
| contractTypeMap.put("key","contractType"); | |||||
| contractTypeMap.put("value",String.valueOf(contractType.getCode())); | |||||
| variablesList.add(contractTypeMap); | |||||
| Map contractNumberMap = new HashMap<String,Object>(); | |||||
| contractNumberMap.put("key","contractNumber"); | |||||
| contractNumberMap.put("value", String.valueOf(contractId)); | |||||
| variablesList.add(contractNumberMap); | |||||
| map.put("variables", variablesList); | |||||
| return map; | |||||
| } | |||||
| protected boolean rentPropertyHasWorkFlow(WxRentPropertyContractVo rpvo) { | |||||
| WxFlowModel wxFlowModel = new WxFlowModel(); | |||||
| if (rpvo.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.WHOLE_SHOP.getCode()); | |||||
| }else if (rpvo.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.WHOLE_POINT.getCode()); | |||||
| } | |||||
| wxFlowModel.updateTenantInfo(rpvo); | |||||
| List<WxFlowModel> flows = wxFlowService.getModelBybusiness(wxFlowModel); | |||||
| if (null != flows && flows.size() > 0) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| protected boolean rentContractHasWorkFlow(WxRentContract wxRentContract) { | |||||
| WxFlowModel wxFlowModel = new WxFlowModel(); | |||||
| if(wxRentContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { | |||||
| if (wxRentContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.RENT.getCode()); | |||||
| }else if (wxRentContract.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.RENT_POINT.getCode()); | |||||
| } | |||||
| }else { | |||||
| if (wxRentContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.WHOLE_SHOP.getCode()); | |||||
| }else if (wxRentContract.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.WHOLE_POINT.getCode()); | |||||
| } | |||||
| } | |||||
| wxFlowModel.updateTenantInfo(wxRentContract); | |||||
| List<WxFlowModel> flows = wxFlowService.getModelBybusiness(wxFlowModel); | |||||
| if (null != flows && flows.size() > 0) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| protected boolean propertyContractHasWorkFlow(WxPropertyContract wxPropertyContract) { | |||||
| WxFlowModel wxFlowModel = new WxFlowModel(); | |||||
| if(wxPropertyContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { | |||||
| if (wxPropertyContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.PROPERTY.getCode()); | |||||
| }else if (wxPropertyContract.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.PROPERTY_POINT.getCode()); | |||||
| } | |||||
| }else { | |||||
| if (wxPropertyContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.WHOLE_SHOP.getCode()); | |||||
| }else if (wxPropertyContract.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.WHOLE_POINT.getCode()); | |||||
| } | |||||
| } | |||||
| wxFlowModel.updateTenantInfo(wxPropertyContract); | |||||
| List<WxFlowModel> flows = wxFlowService.getModelBybusiness(wxFlowModel); | |||||
| if (null != flows && flows.size() > 0) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| } | |||||
| @@ -1,7 +1,9 @@ | |||||
| package com.iformall.controller.contract; | package com.iformall.controller.contract; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | import com.iformall.annotation.UserDataRuleAnnotation; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -9,8 +11,15 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxBillProperty; | import com.iformall.domain.po.WxBillProperty; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.enums.EnumContractOperationType; | |||||
| import com.iformall.enums.EnumContractType; | import com.iformall.enums.EnumContractType; | ||||
| import com.iformall.enums.EnumFlowContractType; | |||||
| import com.iformall.enums.EnumFlowKey; | |||||
| import com.iformall.enums.EnumIsPreview; | import com.iformall.enums.EnumIsPreview; | ||||
| import com.iformall.enums.EnumRentContractAppStatus; | |||||
| import com.iformall.enums.EnumRentContractStatus; | |||||
| import com.iformall.enums.EnumRentShopType; | |||||
| import com.iformall.enums.EnumRentStartType; | import com.iformall.enums.EnumRentStartType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxPropertyContractMapper; | import com.iformall.mapper.WxPropertyContractMapper; | ||||
| @@ -26,6 +35,9 @@ import org.springframework.web.bind.annotation.*; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -34,7 +46,7 @@ import java.util.Map; | |||||
| */ | */ | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxPropertyContract") | @RequestMapping("wxPropertyContract") | ||||
| public class WxPropertyContractController extends BaseController { | |||||
| public class WxPropertyContractController extends WxContractBaseController { | |||||
| private Logger logger = LoggerFactory.getLogger(this.getClass()); | private Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -51,14 +63,29 @@ public class WxPropertyContractController extends BaseController { | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @SystemControllerLog(description = "物业合同-列表") | |||||
| public ResultData list(@ModelAttribute WxPropertyContract wxPropertyContract, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxPropertyContract wxPropertyContract, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::list"); | logger.debug("[" + getIpAddr() + "] WxPropertyContractController::list"); | ||||
| if (null == wxPropertyContract) { | if (null == wxPropertyContract) { | ||||
| wxPropertyContract = new WxPropertyContract(); | wxPropertyContract = new WxPropertyContract(); | ||||
| } | } | ||||
| wxPropertyContract.updateTenantInfo(getTenantInfo()); | wxPropertyContract.updateTenantInfo(getTenantInfo()); | ||||
| Map<String, Object> result = wxPropertyContractService.listAsPage(wxPropertyContract, pageNum, pageSize); | |||||
| Map<String, Object> result = new HashMap<>(); | |||||
| PageInfo<WxPropertyContract> pageInfo = wxPropertyContractService.listAsPage(wxPropertyContract, pageNum, pageSize); | |||||
| Integer hasFlow = null; | |||||
| if (null != pageInfo && null != pageInfo.getList()) { | |||||
| for (WxPropertyContract wpc : pageInfo.getList()) { | |||||
| if (null == hasFlow) { | |||||
| if(propertyContractHasWorkFlow(wpc)) { | |||||
| hasFlow = 1; | |||||
| }else { | |||||
| hasFlow = 0; | |||||
| } | |||||
| } | |||||
| wpc.setFlowHas(hasFlow); | |||||
| } | |||||
| } | |||||
| result.put("pageInfo", pageInfo); | |||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @@ -100,19 +127,9 @@ public class WxPropertyContractController extends BaseController { | |||||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName()); | return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName()); | ||||
| } | } | ||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "物业合同-删除") | |||||
| public ResultData delete(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::delete"); | |||||
| wxPropertyContractService.deleteById(id); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| @SystemControllerLog(description = "物业合同-根据ID查询") | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::findById"); | logger.debug("[" + getIpAddr() + "] WxPropertyContractController::findById"); | ||||
| WxBillProperty wxBillProperty = new WxBillProperty(); | WxBillProperty wxBillProperty = new WxBillProperty(); | ||||
| @@ -126,6 +143,114 @@ public class WxPropertyContractController extends BaseController { | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * 作废 | |||||
| * @param wxRentContract | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("/unvalid") | |||||
| @SystemControllerLog(description = "物业合同-作废合同") | |||||
| public ResultData unvalid(@RequestBody WxPropertyContract proertyContract) { | |||||
| WxPropertyContract contract = wxPropertyContractService.getSimpleDetail(proertyContract.getId()); | |||||
| if (null == contract) { | |||||
| return new ResultData(Result.ERROR, "合同不存在."); | |||||
| } | |||||
| if (contract.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() || | |||||
| (contract.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue() | |||||
| && (contract.getApplyStatus().intValue() == EnumRentContractAppStatus.REJECT.getCode().intValue() || | |||||
| contract.getApplyStatus().intValue() == EnumRentContractAppStatus.SETBACK.getCode().intValue()))) { | |||||
| contract.setStatus(EnumRentContractStatus.INVALID.getCode()); | |||||
| contract.setUpdatetime(new Date()); | |||||
| try { | |||||
| wxPropertyContractService.updatePropertyContract(contract); | |||||
| return new ResultData(contract); | |||||
| }catch(Exception e) { | |||||
| logger.error(" WxPropertyContract unvalid error.",e); | |||||
| return new ResultData(Result.ERROR,"系统错误"); | |||||
| } | |||||
| }else { | |||||
| return new ResultData(Result.ERROR, "合同状态不允许作废.只能作废草稿或者履约拒绝的合同。"); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * 终止 | |||||
| * @param id | |||||
| * @param status | |||||
| * @return | |||||
| */ | |||||
| @PostMapping("endContract") | |||||
| @SystemControllerLog(description = "物业合同-终止合同") | |||||
| public ResultData endContract(@RequestBody WxPropertyContract proertyContract) { | |||||
| proertyContract.updateTenantInfo(getTenantInfo()); | |||||
| wxPropertyContractService.endContract(proertyContract); | |||||
| return new ResultData(proertyContract); | |||||
| } | |||||
| @GetMapping("effective") | |||||
| @ApiImplicitParams({}) | |||||
| @SystemControllerLog(description = "物业合同-合同生效") | |||||
| public ResultData effective(@RequestBody WxPropertyContract proertyContract) { | |||||
| WxPropertyContract contract = wxPropertyContractService.getSimpleDetail(proertyContract.getId()); | |||||
| if (null == contract) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"物业合同不存在"); | |||||
| } | |||||
| //查询是否有审批流程 | |||||
| if(propertyContractHasWorkFlow(contract)) { | |||||
| return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"物业合同存在工作流,不允许直接生效。"); | |||||
| } | |||||
| if (contract.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"租赁合同状态为草稿才能进行此操作"); | |||||
| } | |||||
| wxPropertyContractService.updatePropertyContractStatus(proertyContract.getId()); | |||||
| return new ResultData(Result.SUCCESS,"合同生效成功!"); | |||||
| } | |||||
| @PostMapping("apply") | |||||
| @SystemControllerLog(description = "物业合同-提交审批") | |||||
| public ResultData apply(@RequestBody WxPropertyContract proertyContract) { | |||||
| MallUserInfo user = getUser(); | |||||
| WxPropertyContract contract = wxPropertyContractService.getSimpleDetail(proertyContract.getId()); | |||||
| if (null == contract) { | |||||
| return new ResultData(Result.ERROR, "编号["+contract.getId()+"]未找到租金合同"); | |||||
| } | |||||
| //查询是否有审批流程 | |||||
| if(propertyContractHasWorkFlow(contract)) { | |||||
| return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"租赁合同存在工作流,不允许直接生效。"); | |||||
| } | |||||
| if(contract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { | |||||
| if (contract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| contract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_PRO_CONTRACT, EnumFlowContractType.PROPERTY, contract.getRemark(), contract.getId(),null)); | |||||
| }else if (contract.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| contract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_PRO_POINT_CONTRACT, EnumFlowContractType.PROPERTY_POINT, contract.getRemark(), contract.getId(),null)); | |||||
| } | |||||
| }else { | |||||
| if (contract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| contract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_PRO_CONTRACT, EnumFlowContractType.WHOLE_SHOP, contract.getRemark(), contract.getId(),null)); | |||||
| }else if (contract.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| contract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_PRO_POINT_CONTRACT, EnumFlowContractType.WHOLE_POINT, contract.getRemark(), contract.getId(),null)); | |||||
| } | |||||
| } | |||||
| return wxPropertyContractService.apply(contract,user); | |||||
| } | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "物业合同-删除") | |||||
| public ResultData delete(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::delete"); | |||||
| wxPropertyContractService.deleteById(id); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| @RequestMapping("/download") | @RequestMapping("/download") | ||||
| @SystemControllerLog(description = "物业合同-下载") | @SystemControllerLog(description = "物业合同-下载") | ||||
| @@ -134,37 +259,29 @@ public class WxPropertyContractController extends BaseController { | |||||
| wxPropertyContractService.download(request, response); | wxPropertyContractService.download(request, response); | ||||
| } | } | ||||
| @GetMapping("/getPropertyContractStatusInfo") | |||||
| @SystemControllerLog(description = "物业合同-状态信息") | |||||
| public ResultData getPropertyContractStatusInfo(@ModelAttribute WxPropertyContract wxPropertyContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getPropertyContractStatusInfo"); | |||||
| wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractStatusInfo(wxPropertyContract)); | |||||
| } | |||||
| @GetMapping("/endPropertyContract") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "物业合同-终止") | |||||
| public ResultData endRentContract(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::endRentContract"); | |||||
| return wxPropertyContractService.endRentContract(id); | |||||
| } | |||||
| // @GetMapping("/getPropertyContractStatusInfo") | |||||
| // @SystemControllerLog(description = "物业合同-状态信息") | |||||
| // public ResultData getPropertyContractStatusInfo(@ModelAttribute WxPropertyContract wxPropertyContract) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getPropertyContractStatusInfo"); | |||||
| // wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||||
| // return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractStatusInfo(wxPropertyContract)); | |||||
| // } | |||||
| @GetMapping("/getRentContractList") | |||||
| @SystemControllerLog(description = "物业合同-查询列表") | |||||
| public ResultData getRentContractList(@ModelAttribute WxPropertyContract wxPropertyContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getRentContractList"); | |||||
| wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractList(wxPropertyContract)); | |||||
| } | |||||
| // @GetMapping("/getRentContractList") | |||||
| // @SystemControllerLog(description = "物业合同-查询列表") | |||||
| // public ResultData getRentContractList(@ModelAttribute WxPropertyContract wxPropertyContract) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getRentContractList"); | |||||
| // wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||||
| // return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractList(wxPropertyContract)); | |||||
| // } | |||||
| @GetMapping("/endPropertyContractByRentContractId") | |||||
| @ApiImplicitParam(name = "rentContractId", value = "rentContractId", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "物业合同-根据租赁合同终止") | |||||
| public ResultData endPropertyContractByRentContractId(Long rentContractId) { | |||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::endPropertyContractByRentContractId"); | |||||
| return wxPropertyContractService.endPropertyContractByRentContractId(rentContractId); | |||||
| } | |||||
| // @GetMapping("/endPropertyContractByRentContractId") | |||||
| // @ApiImplicitParam(name = "rentContractId", value = "rentContractId", dataType = "Long", paramType = "query", required = true) | |||||
| // @SystemControllerLog(description = "物业合同-根据租赁合同终止") | |||||
| // public ResultData endPropertyContractByRentContractId(Long rentContractId) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxPropertyContractController::endPropertyContractByRentContractId"); | |||||
| // return wxPropertyContractService.endPropertyContractByRentContractId(rentContractId); | |||||
| // } | |||||
| @GetMapping("/hasRentContract") | @GetMapping("/hasRentContract") | ||||
| @ApiImplicitParam(name = "rentContractId", value = "rentContractId", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "rentContractId", value = "rentContractId", dataType = "Long", paramType = "query", required = true) | ||||
| @@ -182,15 +299,6 @@ public class WxPropertyContractController extends BaseController { | |||||
| return wxPropertyContractService.updatePropertyContractStatus(wxPropertyContract.getId()); | return wxPropertyContractService.updatePropertyContractStatus(wxPropertyContract.getId()); | ||||
| } | } | ||||
| @PostMapping("endContract") | |||||
| @SystemControllerLog(description = "物业合同-终止合同") | |||||
| public ResultData endContract(@RequestBody WxPropertyContract wxPropertyContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::endContract"); | |||||
| wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||||
| wxPropertyContractService.endContract(wxPropertyContract); | |||||
| return new ResultData(); | |||||
| } | |||||
| /** | /** | ||||
| * 预览账单展示,编辑账期,后端生成账单金额 | * 预览账单展示,编辑账期,后端生成账单金额 | ||||
| * @param wxPropertyContract | * @param wxPropertyContract | ||||
| @@ -208,4 +316,5 @@ public class WxPropertyContractController extends BaseController { | |||||
| List<WxBillProperty> result = wxPropertyContractService.buildProperty(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false); | List<WxBillProperty> result = wxPropertyContractService.buildProperty(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,79 +0,0 @@ | |||||
| package com.iformall.controller.contract; | |||||
| import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxPropertyContract; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.enums.EnumContractType; | |||||
| import com.iformall.enums.EnumRentStartType; | |||||
| import com.iformall.service.WxPropertyContractService; | |||||
| import com.iformall.service.WxRentPropertyContractService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| /** | |||||
| * @author: furunxin | |||||
| * @Date: 2020/7/20 18:11 | |||||
| * @Description: | |||||
| */ | |||||
| @Slf4j | |||||
| @RestController | |||||
| @Api(description = "物业合同续签") | |||||
| @RequestMapping("wxPropertyContractExtension") | |||||
| public class WxPropertyContractExtensionController extends BaseController { | |||||
| @Autowired | |||||
| private WxPropertyContractService wxPropertyContractService; | |||||
| @Autowired | |||||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||||
| @GetMapping("getMerchantList") | |||||
| @SystemControllerLog(description = "获取可续签商户列表") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "shopType", value = "店铺类型 1:店铺 2:多经点位", dataType = "Integer", paramType = "query", required = true)}) | |||||
| public ResultData getMerchantList(Integer shopType) throws Exception{ | |||||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||||
| wxPropertyContract.updateTenantInfo(getTenantInfo()); | |||||
| wxPropertyContract.setRentShopType(shopType); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getMerchantList(wxPropertyContract)); | |||||
| } | |||||
| @PostMapping("add") | |||||
| @SystemControllerLog(description = "物业合同-新增") | |||||
| public ResultData add(@RequestBody WxPropertyContract wxPropertyContract) { | |||||
| log.debug("[" + getIpAddr() + "] WxPropertyContractController::add"); | |||||
| MallUserInfo user = getUser(); | |||||
| wxPropertyContract.updateTenantInfo(user); | |||||
| wxPropertyContract.setAdjustPeriodHandle(); | |||||
| Integer contractType = wxRentPropertyContractService.getContractType(wxPropertyContract.getRentShopType(), wxPropertyContract.getOperationType(), EnumContractType.PROPERTY.getCode()); | |||||
| wxPropertyContract.setContractType(contractType); | |||||
| if(wxPropertyContract.getRentStartType()!=null && wxPropertyContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| wxPropertyContract.setRentalStartDate(wxPropertyContract.getStartDate()); | |||||
| } | |||||
| return wxPropertyContractService.saveOrUpdate2(wxPropertyContract, user.getId(), user.getName()); | |||||
| } | |||||
| @PostMapping("update") | |||||
| @SystemControllerLog(description = "物业合同-修改") | |||||
| public ResultData update(@RequestBody WxPropertyContract wxPropertyContract) { | |||||
| log.debug("[" + getIpAddr() + "] WxPropertyContractController::update"); | |||||
| MallUserInfo user = getUser(); | |||||
| wxPropertyContract.updateTenantInfo(user); | |||||
| wxPropertyContract.setAdjustPeriodHandle(); | |||||
| //第三步提交 SWITCH | |||||
| return wxPropertyContractService.saveOrUpdate2(wxPropertyContract, user.getId(), user.getName()); | |||||
| } | |||||
| } | |||||
| @@ -1,5 +1,7 @@ | |||||
| package com.iformall.controller.contract; | package com.iformall.controller.contract; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | import com.iformall.annotation.UserDataRuleAnnotation; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| @@ -7,9 +9,17 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.base.BaseEntity.SortField; | |||||
| import com.iformall.enums.EnumContractOperationType; | |||||
| import com.iformall.enums.EnumContractType; | import com.iformall.enums.EnumContractType; | ||||
| import com.iformall.enums.EnumFlowContractType; | |||||
| import com.iformall.enums.EnumFlowKey; | |||||
| import com.iformall.enums.EnumFromType; | import com.iformall.enums.EnumFromType; | ||||
| import com.iformall.enums.EnumIsPreview; | import com.iformall.enums.EnumIsPreview; | ||||
| import com.iformall.enums.EnumRentContractAppStatus; | |||||
| import com.iformall.enums.EnumRentContractStatus; | |||||
| import com.iformall.enums.EnumRentShopType; | |||||
| import com.iformall.enums.EnumRentStartType; | import com.iformall.enums.EnumRentStartType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBillPropertyMapper; | import com.iformall.mapper.WxBillPropertyMapper; | ||||
| @@ -28,6 +38,8 @@ import org.springframework.web.bind.annotation.*; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Collection; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -38,7 +50,7 @@ import java.util.Map; | |||||
| */ | */ | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxRentContract") | @RequestMapping("wxRentContract") | ||||
| public class WxRentContractController extends BaseController { | |||||
| public class WxRentContractController extends WxContractBaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -51,83 +63,53 @@ public class WxRentContractController extends BaseController { | |||||
| private WxMerchantService wxMerchantService; | private WxMerchantService wxMerchantService; | ||||
| @Autowired | @Autowired | ||||
| private WxRentContractMapper wxRentContractMapper; | private WxRentContractMapper wxRentContractMapper; | ||||
| @Autowired | @Autowired | ||||
| WxBillRentMapper wxBillRentMapper; | WxBillRentMapper wxBillRentMapper; | ||||
| @Autowired | @Autowired | ||||
| WxBillPropertyMapper wxBillPropertyMapper; | WxBillPropertyMapper wxBillPropertyMapper; | ||||
| @Autowired | @Autowired | ||||
| private WxRentPropertyContractService wxRentPropertyContractService; | private WxRentPropertyContractService wxRentPropertyContractService; | ||||
| @GetMapping("autolatePay") | |||||
| @SystemControllerLog(description = "autolatePay") | |||||
| public ResultData autolatePay(String startDate, String endDate) throws Exception{ | |||||
| try { | |||||
| logger.info("账单滞纳金更新开始"); | |||||
| wxBillRentMapper.insertBillAction(); | |||||
| wxBillPropertyMapper.insertBillAction(); | |||||
| wxBillRentMapper.autoAddLatePayPrice(); | |||||
| wxBillPropertyMapper.autoAddLatePayPrice(); | |||||
| logger.info("账单滞纳金更新结束"); | |||||
| }catch (Exception e){ | |||||
| logger.error("LatePayBillActionSchedule error! message:{}",e.getMessage()); | |||||
| logger.error("LatePayBillActionSchedule error!",e); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @GetMapping("getDateDiff") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "endtDate", value = "结束时间", dataType = "string", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "获取两个时间相差,返回n月零n天") | |||||
| public ResultData getDateDiff(String startDate, String endDate) throws Exception{ | |||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| Map<String,Integer> map = new HashMap<>(); | |||||
| int[] array = DateUtils.getDiff(sd.parse(startDate),sd.parse(endDate)); | |||||
| map.put("month",array[0]); | |||||
| map.put("day",array[1]); | |||||
| return new ResultData(map); | |||||
| } | |||||
| @Autowired | |||||
| private WxShopService wxShopService; | |||||
| @Autowired | |||||
| WxPropertyContractService wxPropertyContractService; | |||||
| @UserDataRuleAnnotation("rent_contract_list") | @UserDataRuleAnnotation("rent_contract_list") | ||||
| @GetMapping("/list") | @GetMapping("/list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @SystemControllerLog(description = "租赁合同-列表") | |||||
| public ResultData list(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::list"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::list"); | ||||
| if (null == wxRentContract) { | if (null == wxRentContract) { | ||||
| wxRentContract = new WxRentContract(); | wxRentContract = new WxRentContract(); | ||||
| } | } | ||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | wxRentContract.updateTenantInfo(getTenantInfo()); | ||||
| Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | |||||
| return new ResultData(result); | |||||
| wxRentContract.setSortColumns(SortField.Createtime_DESC); | |||||
| //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | |||||
| PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize); | |||||
| Integer hasFlow = null; | |||||
| if (null != page && null != page.getList()) { | |||||
| for (WxRentContract wrc: page.getList()) { | |||||
| if (null == hasFlow) { | |||||
| if(rentContractHasWorkFlow(wrc)) { | |||||
| hasFlow = 1; | |||||
| }else { | |||||
| hasFlow = 0; | |||||
| } | |||||
| } | |||||
| wrc.setFlowHas(hasFlow); | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | |||||
| } | } | ||||
| /** | /** | ||||
| * 预览账单展示,编辑账期,后端生成账单金额 | |||||
| * 新增第一步 | |||||
| * @param wxRentContract | * @param wxRentContract | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| @PostMapping("buildBillPriceList") | |||||
| @SystemControllerLog(description = "租赁合同-生成账单列表金额") | |||||
| public ResultData buildBillPriceList(@RequestBody WxRentContract wxRentContract) throws Exception{ | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); | |||||
| WxRentContract dbRent = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| dbRent.setPreviewBillRentList(wxRentContract.getPreviewBillRentList()); | |||||
| if(dbRent.getRentStartType()!=null && dbRent.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| dbRent.setRentalStartDate(dbRent.getStartDate()); | |||||
| } | |||||
| List<WxBillRent> result = wxRentContractService.buildRent(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false); | |||||
| return new ResultData(result); | |||||
| } | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| @SystemControllerLog(description = "租赁合同-添加") | @SystemControllerLog(description = "租赁合同-添加") | ||||
| public ResultData add(@RequestBody WxRentContract wxRentContract) { | public ResultData add(@RequestBody WxRentContract wxRentContract) { | ||||
| @@ -137,13 +119,12 @@ public class WxRentContractController extends BaseController { | |||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | ||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | wxRentContract.setBusDiscountTime(new Integer(0)); | ||||
| } | } | ||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| wxMerchant.setName(wxRentContract.getMerchantName()); | |||||
| wxMerchant.setId(wxRentContract.getMerchantId()); | |||||
| if (wxMerchantService.hasMerchant(wxMerchant)) { | |||||
| return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | |||||
| } | |||||
| //WxMerchant wxMerchant = new WxMerchant(); | |||||
| //wxMerchant.setName(wxRentContract.getMerchantName()); | |||||
| //wxMerchant.setId(wxRentContract.getMerchantId()); | |||||
| // if (wxMerchantService.hasMerchant(wxMerchant)) { | |||||
| // return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | |||||
| // } | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxRentContract.updateTenantInfo(user); | wxRentContract.updateTenantInfo(user); | ||||
| wxRentContract.setAdjustPeriodHandle(); | wxRentContract.setAdjustPeriodHandle(); | ||||
| @@ -154,50 +135,9 @@ public class WxRentContractController extends BaseController { | |||||
| return wxRentContractService.save(wxRentContract, user.getId(),user.getName(),oldDate); | return wxRentContractService.save(wxRentContract, user.getId(),user.getName(),oldDate); | ||||
| } | } | ||||
| @PostMapping("updateRentStartTime") | |||||
| @SystemControllerLog(description = "租赁合同-更新租赁开始日期") | |||||
| public ResultData updateRentStartTime(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentStartTime"); | |||||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| rentContract.setRentalStartDate(wxRentContract.getRentalStartDate()); | |||||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||||
| if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| rentContract.setRentalStartDate(rentContract.getStartDate()); | |||||
| } | |||||
| MallUserInfo user = getUser(); | |||||
| rentContract.updateTenantInfo(user); | |||||
| rentContract.setAdjustPeriodHandle(); | |||||
| rentContract.setRentStartType(wxRentContract.getRentStartType()); | |||||
| return wxRentContractService.update(rentContract, user.getId(),user.getName(), EnumFromType.SWITCH.getCode(),oldDate); | |||||
| } | |||||
| @PostMapping("update") | |||||
| @SystemControllerLog(description = "租赁合同-更新") | |||||
| public ResultData update(@RequestBody WxRentContract rentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::update"); | |||||
| if(StringUtils.isBlank(rentContract.getBusDiscountRatio())){ | |||||
| rentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | |||||
| rentContract.updateTenantInfo(user); | |||||
| rentContract.setAdjustPeriodHandle(); | |||||
| rentContract.setRentPriceHandle(); | |||||
| Date oldDate = rentContract.getRentalStartDate(); | |||||
| if(rentContract.getRentStartType()!=null && rentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| rentContract.setRentalStartDate(rentContract.getStartDate()); | |||||
| } | |||||
| ResultData update = null; | |||||
| try { | |||||
| update = wxRentContractService.update(rentContract, user.getId(), user.getName(), EnumFromType.OTHER.getCode(), oldDate); | |||||
| } catch (MallinkException e) { | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| return update; | |||||
| } | |||||
| /** | /** | ||||
| * 防止前端3秒重复提交 | |||||
| * 新增第二步 防止前端3秒重复提交 | |||||
| * @param wxRentContract | * @param wxRentContract | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| @@ -218,7 +158,12 @@ public class WxRentContractController extends BaseController { | |||||
| } | } | ||||
| return wxRentContractService.update(wxRentContract, user.getId(),user.getName(),EnumFromType.OTHER.getCode(),oldDate); | return wxRentContractService.update(wxRentContract, user.getId(),user.getName(),EnumFromType.OTHER.getCode(),oldDate); | ||||
| } | } | ||||
| /** | |||||
| * 新增第三步 | |||||
| * @param wxRentContract | |||||
| * @return | |||||
| */ | |||||
| @PostMapping("updateFile") | @PostMapping("updateFile") | ||||
| @SystemControllerLog(description = "租赁合同-更新文件") | @SystemControllerLog(description = "租赁合同-更新文件") | ||||
| public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | ||||
| @@ -235,19 +180,10 @@ public class WxRentContractController extends BaseController { | |||||
| wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | ||||
| } | } | ||||
| return wxRentContractService.updateFile(wxRentContract, user.getId(),user.getName(),oldDate); | return wxRentContractService.updateFile(wxRentContract, user.getId(),user.getName(),oldDate); | ||||
| } | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "租赁合同-删除") | |||||
| public ResultData delete(String id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::delete"); | |||||
| return wxRentContractService.deleteById(id); | |||||
| } | |||||
| } | |||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| @SystemControllerLog(description = "租赁合同-查找") | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::findById"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::findById"); | ||||
| // 同步欠缴状态 | // 同步欠缴状态 | ||||
| @@ -262,64 +198,331 @@ public class WxRentContractController extends BaseController { | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| @PostMapping("update") | |||||
| @SystemControllerLog(description = "租赁合同-更新") | |||||
| public ResultData update(@RequestBody WxRentContract rentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::update"); | |||||
| WxRentContract cure = wxRentContractService.getSimpleDeatil(rentContract.getId()); | |||||
| if (null == cure) { | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"租赁合同未查询到"); | |||||
| } | |||||
| if (cure.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() || | |||||
| (cure.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue() | |||||
| && (cure.getApplyStatus().intValue()== EnumRentContractAppStatus.REJECT.getCode().intValue() || | |||||
| cure.getApplyStatus().intValue()== EnumRentContractAppStatus.SETBACK.getCode().intValue()))) { | |||||
| if(StringUtils.isBlank(rentContract.getBusDiscountRatio())){ | |||||
| rentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | |||||
| rentContract.updateTenantInfo(user); | |||||
| rentContract.setAdjustPeriodHandle(); | |||||
| rentContract.setRentPriceHandle(); | |||||
| Date oldDate = rentContract.getRentalStartDate(); | |||||
| if(rentContract.getRentStartType()!=null && rentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| rentContract.setRentalStartDate(rentContract.getStartDate()); | |||||
| } | |||||
| ResultData update = null; | |||||
| try { | |||||
| update = wxRentContractService.update(rentContract, user.getId(), user.getName(), EnumFromType.OTHER.getCode(), oldDate); | |||||
| } catch (MallinkException e) { | |||||
| return new ResultData(update.code,update.message); | |||||
| } | |||||
| return update; | |||||
| }else { | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"当前合同状态不允许修改"); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * 查询商户可用商铺 | |||||
| * @param merchantId | |||||
| * @param contractId | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("/merchantShops") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "merchantId", value = "merchantId", dataType = "Long", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "contractId", value = "contractId", dataType = "Long", paramType = "query", required = true)}) | |||||
| public ResultData merchantShops(Long merchantId,Long contractId) { | |||||
| List<Long> shopList = wxMerchantService.getMerchantShopIds(merchantId); | |||||
| if (null == shopList) { | |||||
| return new ResultData(Result.ERROR,"商户未绑定店铺!"); | |||||
| } | |||||
| WxRentContract rentq = new WxRentContract(); | |||||
| rentq.setStatuss(EnumRentContractStatus.getValidStatus()); | |||||
| rentq.updateTenantInfo(getUser()); | |||||
| List<WxRentContract> rentContractList = wxRentContractService.findList(rentq); | |||||
| List<Long> rentShopList = new ArrayList<Long>(); | |||||
| if (null != rentContractList) { | |||||
| for (WxRentContract rent : rentContractList) { | |||||
| List<Long> shopidlist = rent.shopIdsByRentInfo(); | |||||
| if (null != shopidlist) { | |||||
| for (Long sid: shopidlist) { | |||||
| if (!rentShopList.contains(sid)) { | |||||
| rentShopList.add(sid); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| //如果是新建,或者修改,此时能查询出来未在有效合同里面的店铺 | |||||
| //如果是续签,则还能查询出来合同本身的店铺 | |||||
| List<Long> currentContractShopIds = null; | |||||
| if (null != contractId) { | |||||
| WxRentContract rentContract = wxRentContractService.getSimpleDeatil(contractId); | |||||
| if (null == rentContract) { | |||||
| return new ResultData(Result.ERROR,"租金合同不存在!"); | |||||
| } | |||||
| if (rentContract.getStatus().intValue() != EnumRentContractStatus.PAING.getCode() | |||||
| && rentContract.getStatus().intValue() != EnumRentContractStatus.OUT_DATE.getCode()) { | |||||
| return new ResultData(Result.ERROR,"租金合同状态为计租中或者正常到期才能续签。"); | |||||
| } | |||||
| currentContractShopIds = rentContract.shopIdsByRentInfo(); | |||||
| if (null != currentContractShopIds) { | |||||
| currentContractShopIds.stream().filter(si -> shopList.contains(si)); | |||||
| } | |||||
| } | |||||
| //去掉正常状态的合同里的店铺 | |||||
| shopList.stream().filter(s -> !rentShopList.contains(s)); | |||||
| List<WxShop> shops = wxShopService.getByIds(shopList); | |||||
| //再加上合同里面店铺 | |||||
| if(null != currentContractShopIds && currentContractShopIds.size() > 0 ) { | |||||
| List<WxShop> contractShops = wxShopService.getByIds(currentContractShopIds); | |||||
| contractShops.stream().filter( cs -> !shopList.contains(cs.getId())); | |||||
| shops.addAll(contractShops); | |||||
| } | |||||
| return new ResultData(shops); | |||||
| } | |||||
| /** | |||||
| * 查询商户计租中或者正常到期的合同 | |||||
| * @param wxRentContract | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("getXuQianRentContract") | |||||
| @ApiImplicitParams({}) | |||||
| public ResultData getRentContractList(@ModelAttribute WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||||
| wxRentContract.setStatuss(EnumRentContractStatus.getValidStatus()); | |||||
| wxRentContract.setSortColumn(BaseEntity.SortField.Createtime_DESC.getValue()); | |||||
| PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, 1, 100000); | |||||
| if (null != page && null != page.getList()) { | |||||
| List<Map<String, Object>> retList = new ArrayList<Map<String, Object>>(); | |||||
| for (WxRentContract wr:page.getList()) { | |||||
| retList.add(wxRentContractService.getById(wr.getId())); | |||||
| } | |||||
| return new ResultData(retList); | |||||
| // List<WxRentContract> painglist = new ArrayList<WxRentContract>(); | |||||
| // painglist.addAll(page.getList()); | |||||
| // painglist.stream().filter( p -> p.getStatus().intValue()==EnumRentContractStatus.PAING.getCode().intValue()); | |||||
| // if (painglist.size()>0) { | |||||
| // return new ResultData(wxRentContractService.getById(painglist.get(0).getId())); | |||||
| // }else { | |||||
| // List<WxRentContract> outdatelist = new ArrayList<WxRentContract>(); | |||||
| // outdatelist.addAll(page.getList()); | |||||
| // outdatelist.stream().filter( p -> p.getStatus().intValue()==EnumRentContractStatus.OUT_DATE.getCode().intValue()); | |||||
| // if (outdatelist.size() > 0 ) { | |||||
| // return new ResultData(wxRentContractService.getById(outdatelist.get(0).getId())); | |||||
| // } | |||||
| // } | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| /** | |||||
| * 作废 | |||||
| * @param wxRentContract | |||||
| * @return | |||||
| */ | |||||
| @PostMapping("/unvalid") | |||||
| @SystemControllerLog(description = "租金合同-作废合同") | |||||
| public ResultData unvalid(@RequestBody WxRentContract wxRentContract) { | |||||
| WxRentContract contract = wxRentContractService.getSimpleDeatil(wxRentContract.getId()); | |||||
| if (null == contract) { | |||||
| return new ResultData(Result.ERROR, "合同不存在."); | |||||
| } | |||||
| if (contract.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() || | |||||
| (contract.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue() | |||||
| && (contract.getApplyStatus().intValue() == EnumRentContractAppStatus.REJECT.getCode().intValue() || | |||||
| contract.getApplyStatus().intValue() == EnumRentContractAppStatus.SETBACK.getCode().intValue()))) { | |||||
| contract.setStatus(EnumRentContractStatus.INVALID.getCode()); | |||||
| contract.setUpdatetime(new Date()); | |||||
| wxRentContractService.updateRentContract(contract); | |||||
| if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||||
| WxPropertyContract propertyContract = wxPropertyContractService.getSimpleDetail(wxRentContract.getPropertyId()); | |||||
| propertyContract.setStatus(EnumRentContractStatus.INVALID.getCode()); | |||||
| propertyContract.setUpdatetime(new Date()); | |||||
| wxPropertyContractService.updatePropertyContract(propertyContract); | |||||
| } | |||||
| return new ResultData(); | |||||
| }else { | |||||
| return new ResultData(Result.ERROR, "合同状态不允许作废.只能作废草稿或者履约拒绝的合同。"); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * 终止 | |||||
| * @param id | |||||
| * @param status | |||||
| * @return | |||||
| */ | |||||
| @PostMapping("endContract") | |||||
| @SystemControllerLog(description = "租赁合同-终止合同") | |||||
| public ResultData endContract(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::endContract"); | |||||
| WxRentContract contract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| if (contract == null) { | |||||
| return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); | |||||
| } | |||||
| wxRentContract.updateTenantInfo(contract); | |||||
| wxRentContractService.endContract(wxRentContract); | |||||
| //租金+物业的终止 | |||||
| if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||||
| WxPropertyContract wpc = new WxPropertyContract(); | |||||
| wpc.setId(wxRentContract.getPropertyId()); | |||||
| wxPropertyContractService.endContract(wpc); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @RequestMapping("/download") | @RequestMapping("/download") | ||||
| public void download(HttpServletRequest request, HttpServletResponse response){ | public void download(HttpServletRequest request, HttpServletResponse response){ | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::download"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::download"); | ||||
| wxRentContractService.download(request,response); | wxRentContractService.download(request,response); | ||||
| } | } | ||||
| @GetMapping("/getRentContractStatusInfo") | |||||
| @SystemControllerLog(description = "租赁合同-获取合同状态信息") | |||||
| public ResultData getRentContractStatusInfo(@ModelAttribute WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractStatusInfo"); | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxRentContractService.getRentContractStatusInfo(wxRentContract)); | |||||
| } | |||||
| @GetMapping("/endRentContract") | |||||
| @GetMapping("getDateDiff") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "status", value = "status", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "租赁合同-终结合同") | |||||
| public ResultData endRentContract(Long id,Integer status) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::endRentContract"); | |||||
| return wxRentContractService.endRentContract(id,status); | |||||
| @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "endtDate", value = "结束时间", dataType = "string", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "获取两个时间相差,返回n月零n天") | |||||
| public ResultData getDateDiff(String startDate, String endDate) throws Exception{ | |||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| Map<String,Integer> map = new HashMap<>(); | |||||
| int[] array = DateUtils.getDiff(sd.parse(startDate),sd.parse(endDate)); | |||||
| map.put("month",array[0]); | |||||
| map.put("day",array[1]); | |||||
| return new ResultData(map); | |||||
| } | } | ||||
| @PostMapping("updateMerchant") | |||||
| @SystemControllerLog(description = "租赁合同-更新商户") | |||||
| public ResultData updateMerchant(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMerchant"); | |||||
| return wxRentContractService.updateMerchant(wxRentContract); | |||||
| @PostMapping("effective") | |||||
| @ApiImplicitParams({}) | |||||
| @SystemControllerLog(description = "租金合同-合同生效") | |||||
| public ResultData effective(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); | |||||
| WxRentContract contract = wxRentContractService.getSimpleDeatil(wxRentContract.getId()); | |||||
| if (null == contract) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"租赁合同不存在"); | |||||
| } | |||||
| //查询是否有审批流程 | |||||
| if(rentContractHasWorkFlow(contract)) { | |||||
| return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"租赁合同存在工作流,不允许直接生效。"); | |||||
| } | |||||
| if (contract.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"租赁合同状态为草稿才能进行此操作"); | |||||
| } | |||||
| // //店铺是否存在其他有效合同里面 | |||||
| // boolean result = wxRentContractService.hasOtherValidContractShop(contract); | |||||
| // if (result) { | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"店铺已经在其他计租中或者已签约未到期的合同里面了。"); | |||||
| // } | |||||
| try { | |||||
| validConfilit(contract); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| wxRentContractService.updateRentContractStatus(wxRentContract.getId()); | |||||
| if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||||
| wxPropertyContractService.updatePropertyContractStatus(wxRentContract.getPropertyId()); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS,"合同生效成功!"); | |||||
| } | } | ||||
| private void validConfilit(WxRentContract rentContract) throws Exception { | |||||
| //判断是否该合同的时间和有效的合同是否冲突 | |||||
| List<Long> shopIds = rentContract.shopIdsByRentInfo(); | |||||
| for (Long sid: shopIds) { | |||||
| WxRentContract rcq = new WxRentContract(); | |||||
| rcq.setStatuss(EnumRentContractStatus.getValidStatus()); | |||||
| rcq.setQueryShopId(sid); | |||||
| List<WxRentContract> crcs = wxRentContractService.findList(rcq); | |||||
| if (null != crcs) { | |||||
| for (WxRentContract crc : crcs) { | |||||
| if((rentContract.getRentalEndDate().before(crc.getRentalStartDate()) && rentContract.getRentalStartDate().after(new Date())) || | |||||
| rentContract.getRentalStartDate().after(crc.getRentalEndDate())) { | |||||
| }else { | |||||
| throw new MallinkException(Result.ERROR, "店铺["+sid+"]的计租时间区间与合同["+crc.getContractNumber()+"]有冲突。"); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @PostMapping("apply") | |||||
| @SystemControllerLog(description = "租赁合同-提交审批") | |||||
| public ResultData apply(@RequestBody WxRentContract wxRentContract) { | |||||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| if (null == rentContract) { | |||||
| return new ResultData(Result.ERROR, "编号["+wxRentContract.getId()+"]未找到租金合同"); | |||||
| } | |||||
| MallUserInfo user = getUser(); | |||||
| //查询是否有审批流程 | |||||
| if(rentContractHasWorkFlow(rentContract)) { | |||||
| return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"租赁合同存在工作流,不允许直接生效。"); | |||||
| } | |||||
| try { | |||||
| validConfilit(rentContract); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| if(rentContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { | |||||
| if (rentContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| rentContract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_RENT_CONTRACT, EnumFlowContractType.RENT, wxRentContract.getRemark(), wxRentContract.getId(),null)); | |||||
| }else if (rentContract.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| rentContract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_SHOP_CONTRACT, EnumFlowContractType.RENT_POINT, wxRentContract.getRemark(), wxRentContract.getId(),null)); | |||||
| } | |||||
| }else { | |||||
| if (rentContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| rentContract.setFlowParams(generateFlowParams(EnumFlowKey.NNEW_RENT_CONTRACT, EnumFlowContractType.WHOLE_SHOP, wxRentContract.getRemark(), wxRentContract.getId(),wxRentContract.getPropertyId())); | |||||
| }else if (rentContract.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| rentContract.setFlowParams(generateFlowParams(EnumFlowKey.NEW_RENT_POINT_CONTRACT, EnumFlowContractType.WHOLE_POINT, wxRentContract.getRemark(), wxRentContract.getId(),wxRentContract.getPropertyId())); | |||||
| } | |||||
| } | |||||
| return wxRentContractService.apply(rentContract,user); | |||||
| } | |||||
| @GetMapping("getRentContractList") | @GetMapping("getRentContractList") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @SystemControllerLog(description = "租赁合同-列表") | |||||
| public ResultData getRentContractList(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { | |||||
| public ResultData getRentContractList(@ModelAttribute WxRentContract wxRentContract, Integer validStatus, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractList"); | ||||
| if (null == wxRentContract) wxRentContract = new WxRentContract(); | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | wxRentContract.updateTenantInfo(getTenantInfo()); | ||||
| if (1 == validStatus) { | |||||
| wxRentContract.setStatuss(EnumRentContractStatus.getValidStatus()); | |||||
| } | |||||
| return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | ||||
| } | } | ||||
| @GetMapping("exportContract") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "租赁合同-导出合同") | |||||
| public void exportContract(Long id,HttpServletRequest request, HttpServletResponse response){ | |||||
| wxRentContractService.exportContract(request,response,id); | |||||
| } | |||||
| @PostMapping("updateRentContractStatus") | |||||
| @SystemControllerLog(description = "租赁合同-更新合同状态") | |||||
| public ResultData updateRentContractStatus(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentContractStatus"); | |||||
| return wxRentContractService.updateRentContractStatus(wxRentContract.getId()); | |||||
| } | |||||
| @GetMapping("getPayAccountInfo") | @GetMapping("getPayAccountInfo") | ||||
| @SystemControllerLog(description = "租赁合同-获取甲方账户") | @SystemControllerLog(description = "租赁合同-获取甲方账户") | ||||
| public ResultData getPayAccountInfo() { | public ResultData getPayAccountInfo() { | ||||
| @@ -337,6 +540,137 @@ public class WxRentContractController extends BaseController { | |||||
| } | } | ||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } | } | ||||
| // @GetMapping("/del") | |||||
| // @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| // @SystemControllerLog(description = "租赁合同-删除") | |||||
| // public ResultData delete(String id) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::delete"); | |||||
| // return wxRentContractService.deleteById(id); | |||||
| // } | |||||
| @GetMapping("/hasRentStatus") | |||||
| public ResultData hasRentStatus(@ModelAttribute WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::hasRentStatus"); | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||||
| return wxRentContractService.hasRentStatus(wxRentContract); | |||||
| } | |||||
| @GetMapping("/hasContractNumber") | |||||
| public ResultData hasContractNumber(@ModelAttribute WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::hasContractNumber"); | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||||
| return wxRentContractService.hasContractNumber(wxRentContract); | |||||
| } | |||||
| @GetMapping("getMerchantList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "shopType", value = "店铺类型 1:店铺 2:多经点位", dataType = "Integer", paramType = "query", required = true)}) | |||||
| public ResultData getMerchantList(Integer shopType) throws Exception{ | |||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | |||||
| wxMerchant.setRentShopType(shopType); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMerchantService.getMerchantList(wxMerchant)); | |||||
| } | |||||
| @GetMapping("autolatePay") | |||||
| @SystemControllerLog(description = "autolatePay") | |||||
| public ResultData autolatePay(String startDate, String endDate) throws Exception{ | |||||
| try { | |||||
| logger.info("账单滞纳金更新开始"); | |||||
| wxBillRentMapper.insertBillAction(); | |||||
| wxBillPropertyMapper.insertBillAction(); | |||||
| wxBillRentMapper.autoAddLatePayPrice(); | |||||
| wxBillPropertyMapper.autoAddLatePayPrice(); | |||||
| logger.info("账单滞纳金更新结束"); | |||||
| }catch (Exception e){ | |||||
| logger.error("LatePayBillActionSchedule error! message:{}",e.getMessage()); | |||||
| logger.error("LatePayBillActionSchedule error!",e); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| /** | |||||
| * 预览账单展示,编辑账期,后端生成账单金额 | |||||
| * @param wxRentContract | |||||
| * @return | |||||
| */ | |||||
| @PostMapping("buildBillPriceList") | |||||
| public ResultData buildBillPriceList(@RequestBody WxRentContract wxRentContract) throws Exception{ | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); | |||||
| WxRentContract dbRent = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| dbRent.setPreviewBillRentList(wxRentContract.getPreviewBillRentList()); | |||||
| if(dbRent.getRentStartType()!=null && dbRent.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| dbRent.setRentalStartDate(dbRent.getStartDate()); | |||||
| } | |||||
| List<WxBillRent> result = wxRentContractService.buildRent(getUserId(),dbRent, EnumIsPreview.YES.getCode(), false); | |||||
| return new ResultData(result); | |||||
| } | |||||
| @PostMapping("updateRentStartTime") | |||||
| @SystemControllerLog(description = "租赁合同-更新租赁开始日期") | |||||
| public ResultData updateRentStartTime(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentStartTime"); | |||||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| rentContract.setRentalStartDate(wxRentContract.getRentalStartDate()); | |||||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||||
| if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| rentContract.setRentalStartDate(rentContract.getStartDate()); | |||||
| } | |||||
| MallUserInfo user = getUser(); | |||||
| rentContract.updateTenantInfo(user); | |||||
| rentContract.setAdjustPeriodHandle(); | |||||
| rentContract.setRentStartType(wxRentContract.getRentStartType()); | |||||
| return wxRentContractService.update(rentContract, user.getId(),user.getName(), EnumFromType.SWITCH.getCode(),oldDate); | |||||
| } | |||||
| // @GetMapping("exportContract") | |||||
| // @ApiImplicitParams({ | |||||
| // @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)}) | |||||
| // @SystemControllerLog(description = "租赁合同-导出合同") | |||||
| // public void exportContract(Long id,HttpServletRequest request, HttpServletResponse response){ | |||||
| // wxRentContractService.exportContract(request,response,id); | |||||
| // } | |||||
| // @GetMapping("/getRentContractStatusInfo") | |||||
| // @SystemControllerLog(description = "租赁合同-获取合同状态信息") | |||||
| // public ResultData getRentContractStatusInfo(@ModelAttribute WxRentContract wxRentContract) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractStatusInfo"); | |||||
| // wxRentContract.updateTenantInfo(getTenantInfo()); | |||||
| // return new ResultData(Result.SUCCESS, "查询成功", wxRentContractService.getRentContractStatusInfo(wxRentContract)); | |||||
| // } | |||||
| // @PostMapping("updateMerchant") | |||||
| // @SystemControllerLog(description = "租赁合同-更新商户") | |||||
| // public ResultData updateMerchant(@RequestBody WxRentContract wxRentContract) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMerchant"); | |||||
| // return wxRentContractService.updateMerchant(wxRentContract); | |||||
| // } | |||||
| @PostMapping("updateRentContractStatus") | |||||
| @SystemControllerLog(description = "租赁合同-更新合同状态") | |||||
| public ResultData updateRentContractStatus(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentContractStatus"); | |||||
| return wxRentContractService.updateRentContractStatus(wxRentContract.getId()); | |||||
| } | |||||
| @PostMapping("savePayAccountInfo") | @PostMapping("savePayAccountInfo") | ||||
| @SystemControllerLog(description = "租赁合同-保存甲方账户") | @SystemControllerLog(description = "租赁合同-保存甲方账户") | ||||
| @@ -367,30 +701,6 @@ public class WxRentContractController extends BaseController { | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxRentContractService.getMerchants(wxRentContract)); | return new ResultData(Result.SUCCESS, "查询成功", wxRentContractService.getMerchants(wxRentContract)); | ||||
| } | } | ||||
| @GetMapping("/hasRentStatus") | |||||
| @SystemControllerLog(description = "查询店铺租赁状态") | |||||
| public ResultData hasRentStatus(@ModelAttribute WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::hasRentStatus"); | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||||
| return wxRentContractService.hasRentStatus(wxRentContract); | |||||
| } | |||||
| @GetMapping("/hasContractNumber") | |||||
| @SystemControllerLog(description = "租赁合同-检查合同编号是否存在") | |||||
| public ResultData hasContractNumber(@ModelAttribute WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::hasContractNumber"); | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||||
| return wxRentContractService.hasContractNumber(wxRentContract); | |||||
| } | |||||
| @PostMapping("endContract") | |||||
| @SystemControllerLog(description = "租赁合同-终止合同") | |||||
| public ResultData endContract(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::endContract"); | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||||
| wxRentContractService.endContract(wxRentContract); | |||||
| return new ResultData(); | |||||
| } | |||||
| @GetMapping("/getContractByContractNumber") | @GetMapping("/getContractByContractNumber") | ||||
| @SystemControllerLog(description = "租赁合同-通过合同编号查询信息") | @SystemControllerLog(description = "租赁合同-通过合同编号查询信息") | ||||
| @@ -400,6 +710,28 @@ public class WxRentContractController extends BaseController { | |||||
| return wxRentContractService.getContractByContractNumber(wxRentContract); | return wxRentContractService.getContractByContractNumber(wxRentContract); | ||||
| } | } | ||||
| @GetMapping("/init") | |||||
| public ResultData init() { | |||||
| List<WxRentContract> clist = wxRentContractService.findList(new WxRentContract()); | |||||
| for (WxRentContract wrc: clist) { | |||||
| List<Long> shopIds = wrc.shopIdsByRentInfo(); | |||||
| if (null != shopIds) { | |||||
| List<WxShop> shops = wxShopService.getByIds(shopIds); | |||||
| String shopName = ""; | |||||
| for (WxShop shop : shops) { | |||||
| shopName = shopName +","+shop.getShopNumber(); | |||||
| } | |||||
| if(!StringUtils.isBlank(shopName)) { | |||||
| wrc.setShopName(shopName); | |||||
| wxRentContractService.updateRentContract(wrc); | |||||
| } | |||||
| } | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| } | } | ||||
| @@ -1,146 +0,0 @@ | |||||
| package com.iformall.controller.contract; | |||||
| import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.domain.po.WxShop; | |||||
| import com.iformall.enums.EnumContractType; | |||||
| import com.iformall.enums.EnumFromType; | |||||
| import com.iformall.enums.EnumRentStartType; | |||||
| import com.iformall.service.WxRentContractService; | |||||
| import com.iformall.service.WxRentPropertyContractService; | |||||
| import com.iformall.service.WxShopService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| /** | |||||
| * @author: furunxin | |||||
| * @Date: 2020/7/14 11:21 | |||||
| * @Description: | |||||
| */ | |||||
| @Slf4j | |||||
| @RestController | |||||
| @Api(description = "租赁合同续签") | |||||
| @RequestMapping("wxRentContractExtension") | |||||
| public class WxRentContractExtensionController extends BaseController { | |||||
| @Autowired | |||||
| private WxRentContractService wxRentContractService; | |||||
| @Autowired | |||||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||||
| @GetMapping("searchMerchant") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "merchantName", value = "商户名称", dataType = "string", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "shopType", value = "店铺类型 1:店铺 2:多经点位", dataType = "Integer", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "商户搜索") | |||||
| public ResultData searchMerchant(String merchantName,Integer shopType) throws Exception{ | |||||
| WxRentContract wxRentContract = new WxRentContract(); | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | |||||
| wxRentContract.setMerchantName(merchantName); | |||||
| wxRentContract.setRentShopType(shopType); | |||||
| List<Map<String,Object>> result = wxRentContractService.searchMerchantByname(wxRentContract); | |||||
| return new ResultData(result); | |||||
| } | |||||
| @GetMapping("getContractInfo") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "merchantId", value = "商户id", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "根据商户id查询该商户计租中合同信息") | |||||
| public ResultData getContractInfo(Long merchantId) throws Exception{ | |||||
| WxRentContract wxRentContract = new WxRentContract(); | |||||
| wxRentContract.setMerchantId(merchantId); | |||||
| wxRentContract = wxRentContractService.getByMerchantId(wxRentContract); | |||||
| Map<String, Object> data = wxRentContractService.getById(wxRentContract.getId()); | |||||
| return new ResultData(data); | |||||
| } | |||||
| @GetMapping("getAllContractInfo") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "merchantId", value = "商户id", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "根据商户id查询该商户下所有合同") | |||||
| public ResultData getAllContractInfo(Long merchantId) throws Exception{ | |||||
| WxRentContract wxRentContract = new WxRentContract(); | |||||
| wxRentContract.setMerchantId(merchantId); | |||||
| List<WxRentContract> rentContracts = wxRentContractService.getAllContractByMerchantId(wxRentContract); | |||||
| return new ResultData(rentContracts); | |||||
| } | |||||
| @PostMapping("extension") | |||||
| @SystemControllerLog(description = "租赁合同续签") | |||||
| public ResultData extension(@RequestBody WxRentContract wxRentContract) { | |||||
| log.debug("[" + getIpAddr() + "] WxRentContractExtensionController::add"); | |||||
| Integer contractType = wxRentPropertyContractService.getContractType(wxRentContract.getRentShopType(), wxRentContract.getOperationType(), EnumContractType.RENT.getCode()); | |||||
| wxRentContract.setContractType(contractType); | |||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | |||||
| wxRentContract.updateTenantInfo(user); | |||||
| //wxRentContract.setTenantId("789"); | |||||
| //wxRentContract.setParentTenantId("788"); | |||||
| //user.setId(Long.parseLong("321127266275430400")); | |||||
| //user.setUsername("alitest"); | |||||
| wxRentContract.setAdjustPeriodHandle(); | |||||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||||
| if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||||
| } | |||||
| return wxRentContractService.extension(wxRentContract, user.getId(),user.getName(),oldDate); | |||||
| } | |||||
| @PostMapping("updateMoney") | |||||
| @SystemControllerLog(description = "租赁合同续签-更新金额") | |||||
| public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) { | |||||
| log.debug("[" + getIpAddr() + "] WxRentContractExtensionController::updateMoney"); | |||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | |||||
| wxRentContract.updateTenantInfo(user); | |||||
| wxRentContract.setAdjustPeriodHandle(); | |||||
| wxRentContract.setRentPriceHandle(); | |||||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||||
| if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||||
| } | |||||
| return wxRentContractService.extensionUpdate(wxRentContract, user.getId(),user.getName(), EnumFromType.OTHER.getCode(),oldDate); | |||||
| } | |||||
| @PostMapping("updateFile") | |||||
| @SystemControllerLog(description = "租赁合同续签-更新文件") | |||||
| public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | |||||
| log.debug("[" + getIpAddr() + "] WxRentContractExtensionController::updateFile"); | |||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | |||||
| wxRentContract.updateTenantInfo(user); | |||||
| wxRentContract.setAdjustPeriodHandle(); | |||||
| wxRentContract.setRentPriceHandle(); | |||||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||||
| if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||||
| } | |||||
| return wxRentContractService.extensionUpdateFile(wxRentContract, user.getId(),user.getName(),oldDate); | |||||
| } | |||||
| } | |||||
| @@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*; | |||||
| */ | */ | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxRentPropertyContract") | @RequestMapping("wxRentPropertyContract") | ||||
| public class WxRentPropertyContractController extends BaseController { | |||||
| public class WxRentPropertyContractController extends WxContractBaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -33,33 +33,48 @@ public class WxRentPropertyContractController extends BaseController { | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @SystemControllerLog(description = "租赁物业合同-列表") | |||||
| public ResultData list(@ModelAttribute WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::list"); | logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::list"); | ||||
| if (null == wxRentPropertyContractVo) { | if (null == wxRentPropertyContractVo) { | ||||
| wxRentPropertyContractVo = new WxRentPropertyContractVo(); | wxRentPropertyContractVo = new WxRentPropertyContractVo(); | ||||
| } | } | ||||
| wxRentPropertyContractVo.updateTenantInfo(getTenantInfo()); | wxRentPropertyContractVo.updateTenantInfo(getTenantInfo()); | ||||
| final PageInfo<WxRentPropertyContractVo> page = wxRentPropertyContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); | |||||
| PageInfo<WxRentPropertyContractVo> page = wxRentPropertyContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); | |||||
| Integer hasFlow = null; | |||||
| if (null != page && null != page.getList()) { | |||||
| for (WxRentPropertyContractVo wrc: page.getList()) { | |||||
| if (null == hasFlow) { | |||||
| if(rentPropertyHasWorkFlow(wrc)) { | |||||
| hasFlow = 1; | |||||
| }else { | |||||
| hasFlow = 0; | |||||
| } | |||||
| } | |||||
| wrc.setFlowHas(hasFlow); | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | @ApiOperation("根据id查询接口") | ||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "租赁物业合同-根据id查询接口") | |||||
| public ResultData findById(Long id) { | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "rentId", value = "租金合同编号", dataType = "Long", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "propertyId", value = "物业合同编号", dataType = "Long", paramType = "query", required = true)}) | |||||
| public ResultData findById(Long rentId,Long propertyId) { | |||||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::findById"); | logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::findById"); | ||||
| return wxRentPropertyContractService.getContractInfo(id); | |||||
| return wxRentPropertyContractService.getContractInfo(rentId,propertyId); | |||||
| } | } | ||||
| @ApiOperation("合同审批详情") | @ApiOperation("合同审批详情") | ||||
| @GetMapping("/getContractApplyInfo") | @GetMapping("/getContractApplyInfo") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "租赁物业合同-合同审批详情") | |||||
| public ResultData getContractApplyInfo(Long id) { | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "rentId", value = "租金合同编号", dataType = "Long", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "propertyId", value = "物业合同编号", dataType = "Long", paramType = "query", required = true)}) | |||||
| public ResultData getContractApplyInfo(Long rentId,Long propertyId) { | |||||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::getContractApplyInfo"); | logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::getContractApplyInfo"); | ||||
| return wxRentPropertyContractService.getContractApplyInfo(id); | |||||
| return wxRentPropertyContractService.getContractApplyInfo(rentId,propertyId); | |||||
| } | } | ||||
| @PostMapping("insertRentForCreate") | @PostMapping("insertRentForCreate") | ||||
| @@ -63,16 +63,15 @@ public class WxUserStructureController extends BaseController { | |||||
| public ResultData findUserSexStructure(Date startTime, Date endTime) { | public ResultData findUserSexStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserSexStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserSexStructure"); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(getTenantInfo()); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| //保密 | //保密 | ||||
| dto.setSex(EnumCUserBaseInfoSex.UNKNOWN.getCode()); | dto.setSex(EnumCUserBaseInfoSex.UNKNOWN.getCode()); | ||||
| long secrecy = wxCUserBasicInfoService.findCountBySex(dto); | |||||
| long secrecy = wxCUserBasicInfoService.findCountBySex(getTenantInfo(),dto); | |||||
| dto.setSex(EnumCUserBaseInfoSex.MALE.getCode()); | dto.setSex(EnumCUserBaseInfoSex.MALE.getCode()); | ||||
| long boy = wxCUserBasicInfoService.findCountBySex(dto); | |||||
| long boy = wxCUserBasicInfoService.findCountBySex(getTenantInfo(),dto); | |||||
| dto.setSex(EnumCUserBaseInfoSex.FEMALE.getCode()); | dto.setSex(EnumCUserBaseInfoSex.FEMALE.getCode()); | ||||
| long girl = wxCUserBasicInfoService.findCountBySex(dto); | |||||
| long girl = wxCUserBasicInfoService.findCountBySex(getTenantInfo(),dto); | |||||
| Long all = secrecy + boy + girl; | Long all = secrecy + boy + girl; | ||||
| List<UserStructureVo> vos = new ArrayList<>(); | List<UserStructureVo> vos = new ArrayList<>(); | ||||
| vos.add(getVo(boy, all, "男", 1)); | vos.add(getVo(boy, all, "男", 1)); | ||||
| @@ -87,10 +86,9 @@ public class WxUserStructureController extends BaseController { | |||||
| public ResultData findUserAgeStructure(Date startTime, Date endTime) { | public ResultData findUserAgeStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserAgeStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserAgeStructure"); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(getTenantInfo()); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long all = wxCUserBasicInfoService.findCount(dto); | |||||
| long all = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto); | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | List<UserStructureVo> vos = new ArrayList<>(); | ||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| for (EnumAgeInfo a : EnumAgeInfo.values()) { | for (EnumAgeInfo a : EnumAgeInfo.values()) { | ||||
| @@ -99,7 +97,7 @@ public class WxUserStructureController extends BaseController { | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| c.set(Calendar.MINUTE, 0); | c.set(Calendar.MINUTE, 0); | ||||
| c.set(Calendar.SECOND, 0); | c.set(Calendar.SECOND, 0); | ||||
| long count = getCountByAge(a, c, dto); | |||||
| long count = getCountByAge(ifParentUpdateTenantInfo(),a, c, dto); | |||||
| vos.add(getVo(count, all, a.getDesc(), a.getSortNum())); | vos.add(getVo(count, all, a.getDesc(), a.getSortNum())); | ||||
| } | } | ||||
| return new ResultData(vos); | return new ResultData(vos); | ||||
| @@ -111,14 +109,17 @@ public class WxUserStructureController extends BaseController { | |||||
| public ResultData findUserLevelStructure(Date startTime, Date endTime) { | public ResultData findUserLevelStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserAgeStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserAgeStructure"); | ||||
| WxLevelConfig wxLevelConfig = new WxLevelConfig(); | WxLevelConfig wxLevelConfig = new WxLevelConfig(); | ||||
| wxLevelConfig.updateTenantInfo(getTenantInfo()); | |||||
| if(StringUtils.isNotBlank(ifParentUpdateTenantInfo().getParentTenantId())){ | |||||
| wxLevelConfig.setTenantId(ifParentUpdateTenantInfo().getParentTenantId()); | |||||
| }else{ | |||||
| wxLevelConfig.setTenantId(ifParentUpdateTenantInfo().getTenantId()); | |||||
| } | |||||
| wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); | wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); | ||||
| List<WxLevelConfig> levelList = wxLevelConfigService.findList(wxLevelConfig); | List<WxLevelConfig> levelList = wxLevelConfigService.findList(wxLevelConfig); | ||||
| for( int i = 0; i < levelList.size(); i++) { | for( int i = 0; i < levelList.size(); i++) { | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(getTenantInfo()); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| if (i + 1 < levelList.size()) { | if (i + 1 < levelList.size()) { | ||||
| @@ -128,7 +129,7 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setLevelStartScore(levelList.get(i).getPoints()); | dto.setLevelStartScore(levelList.get(i).getPoints()); | ||||
| } | } | ||||
| long all = wxCUserBasicInfoService.findCountByScore(dto); | |||||
| long all = wxCUserBasicInfoService.findCountByScore(ifParentUpdateTenantInfo(),dto); | |||||
| levelList.get(i).setCount(all); | levelList.get(i).setCount(all); | ||||
| } | } | ||||
| @@ -139,7 +140,7 @@ public class WxUserStructureController extends BaseController { | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| other.setCount(wxCUserBasicInfoService.findCount(dto) | |||||
| other.setCount(wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto) | |||||
| - levelList.stream().map(WxLevelConfig::getCount).reduce(Long::sum).orElse(0L)); | - levelList.stream().map(WxLevelConfig::getCount).reduce(Long::sum).orElse(0L)); | ||||
| levelList.add(other); | levelList.add(other); | ||||
| @@ -152,11 +153,10 @@ public class WxUserStructureController extends BaseController { | |||||
| public ResultData findCarLevelStructure(Date startTime, Date endTime) { | public ResultData findCarLevelStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findCarLevelStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findCarLevelStructure"); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(getTenantInfo()); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long total = wxCUserBasicInfoService.findCount(dto); | |||||
| long total = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto); | |||||
| dto.updateTenantInfo(getTenantInfo()); | |||||
| long userCountWithCar = wxCUserCarService.countUser(dto); | long userCountWithCar = wxCUserCarService.countUser(dto); | ||||
| Map userWithCar = new HashMap(); | Map userWithCar = new HashMap(); | ||||
| @@ -193,12 +193,11 @@ public class WxUserStructureController extends BaseController { | |||||
| @SystemControllerLog(description = "会员管理-查询会员手机品牌结构") | @SystemControllerLog(description = "会员管理-查询会员手机品牌结构") | ||||
| public ResultData findUserPhoneBandStructure(Date startTime, Date endTime) { | public ResultData findUserPhoneBandStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserPhoneBandStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserPhoneBandStructure"); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long total = wxCUserBasicInfoService.findCount(dto); | |||||
| long total = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| List<WxTags> tagList = new ArrayList<>(); | List<WxTags> tagList = new ArrayList<>(); | ||||
| @@ -231,12 +230,11 @@ public class WxUserStructureController extends BaseController { | |||||
| @SystemControllerLog(description = "会员管理-查询会员活跃结构") | @SystemControllerLog(description = "会员管理-查询会员活跃结构") | ||||
| public ResultData findUserActivityStructure(Date startTime, Date endTime) { | public ResultData findUserActivityStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserActivityStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserActivityStructure"); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long total = wxCUserBasicInfoService.findCount(dto); | |||||
| long total = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| List<WxTags> tagList = new ArrayList<>(); | List<WxTags> tagList = new ArrayList<>(); | ||||
| @@ -304,7 +302,7 @@ public class WxUserStructureController extends BaseController { | |||||
| //微信用户数据 | //微信用户数据 | ||||
| long wxTotalCount = wxCUserService.findCount(dto);//总量 | long wxTotalCount = wxCUserService.findCount(dto);//总量 | ||||
| //微信用户数据 | //微信用户数据 | ||||
| long memTotalCount = wxCUserBasicInfoService.findCount(dto);//总量 | |||||
| long memTotalCount = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto);//总量 | |||||
| map.put("wxTotalCount",wxTotalCount); | map.put("wxTotalCount",wxTotalCount); | ||||
| map.put("memTotalCount",memTotalCount); | map.put("memTotalCount",memTotalCount); | ||||
| @@ -317,7 +315,7 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setStartTime(today); | dto.setStartTime(today); | ||||
| dto.setEndTime(null); | dto.setEndTime(null); | ||||
| long wxTodayCount = wxCUserService.findCount(dto);//今天新增 | long wxTodayCount = wxCUserService.findCount(dto);//今天新增 | ||||
| long memTodayCount = wxCUserBasicInfoService.findCount(dto);//今天新增 | |||||
| long memTodayCount = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto);//今天新增 | |||||
| map.put("wxTodayCount",wxTodayCount); | map.put("wxTodayCount",wxTodayCount); | ||||
| map.put("memTodayCount",memTodayCount); | map.put("memTodayCount",memTodayCount); | ||||
| @@ -330,7 +328,7 @@ public class WxUserStructureController extends BaseController { | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long wxYesterdayCount = wxCUserService.findCount(dto); | long wxYesterdayCount = wxCUserService.findCount(dto); | ||||
| long memYesterdayCount = wxCUserBasicInfoService.findCount(dto); | |||||
| long memYesterdayCount = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto); | |||||
| if (wxYesterdayCount > 0) { | if (wxYesterdayCount > 0) { | ||||
| double yesterday = (double) (wxTodayCount - wxYesterdayCount) / wxYesterdayCount * 100; | double yesterday = (double) (wxTodayCount - wxYesterdayCount) / wxYesterdayCount * 100; | ||||
| double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | ||||
| @@ -360,7 +358,7 @@ public class WxUserStructureController extends BaseController { | |||||
| List<UserCountVo> wxCountList = new ArrayList<>();//每日新增会员数 | List<UserCountVo> wxCountList = new ArrayList<>();//每日新增会员数 | ||||
| List<UserCountVo> wxCounts = wxCUserService.findCountHistory(dto);//每日新增会员数 | List<UserCountVo> wxCounts = wxCUserService.findCountHistory(dto);//每日新增会员数 | ||||
| List<UserCountVo> memCountList = new ArrayList<>();//每日新增会员数 | List<UserCountVo> memCountList = new ArrayList<>();//每日新增会员数 | ||||
| List<UserCountVo> memCounts = wxCUserBasicInfoService.findCountHistory(dto);//每日新增会员数 | |||||
| List<UserCountVo> memCounts = wxCUserBasicInfoService.findCountHistory(ifParentUpdateTenantInfo(),dto);//每日新增会员数 | |||||
| SimpleDateFormat sdf; | SimpleDateFormat sdf; | ||||
| SimpleDateFormat fsdf; | SimpleDateFormat fsdf; | ||||
| @@ -440,9 +438,8 @@ public class WxUserStructureController extends BaseController { | |||||
| && memCountList.get(0).getTotalCount() != null | && memCountList.get(0).getTotalCount() != null | ||||
| && memCountList.get(0).getTotalCount() == 0) { | && memCountList.get(0).getTotalCount() == 0) { | ||||
| WxCUserBasicInfoDto pdto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto pdto = new WxCUserBasicInfoDto(); | ||||
| pdto.updateTenantInfo(tenantEntity); | |||||
| pdto.setEndTime(startTime); | pdto.setEndTime(startTime); | ||||
| memCountList.get(0).setTotalCount(wxCUserBasicInfoService.findCount(pdto)); | |||||
| memCountList.get(0).setTotalCount(wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),pdto)); | |||||
| } | } | ||||
| for (int i = 1; i < memCountList.size(); i++){ | for (int i = 1; i < memCountList.size(); i++){ | ||||
| if ( memCountList.get(i).getTotalCount() != null && | if ( memCountList.get(i).getTotalCount() != null && | ||||
| @@ -559,7 +556,7 @@ public class WxUserStructureController extends BaseController { | |||||
| } | } | ||||
| private long getCountByAge(EnumAgeInfo a, Calendar c, WxCUserBasicInfoDto dto) { | |||||
| private long getCountByAge(TenantEntity tenantInfo, EnumAgeInfo a, Calendar c, WxCUserBasicInfoDto dto) { | |||||
| if (a.getStart() != 0 || a.getEnd() != 0) { | if (a.getStart() != 0 || a.getEnd() != 0) { | ||||
| c.add(Calendar.YEAR, -a.getEnd()); | c.add(Calendar.YEAR, -a.getEnd()); | ||||
| Date startTime = c.getTime(); | Date startTime = c.getTime(); | ||||
| @@ -575,7 +572,7 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setBirthEndTime(null); | dto.setBirthEndTime(null); | ||||
| } | } | ||||
| return wxCUserBasicInfoService.findCountByAge(dto); | |||||
| return wxCUserBasicInfoService.findCountByAge(tenantInfo,dto); | |||||
| } | } | ||||
| private UserStructureVo getVo(long count, long all, String name, Integer num) { | private UserStructureVo getVo(long count, long all, String name, Integer num) { | ||||
| @@ -646,7 +643,7 @@ public class WxUserStructureController extends BaseController { | |||||
| return new ResultData(ErrorCode.MEM_SCORE_NOT_ENOUGH); | return new ResultData(ErrorCode.MEM_SCORE_NOT_ENOUGH); | ||||
| } | } | ||||
| // 2. 扣减积分 | // 2. 扣减积分 | ||||
| wxScoreRulesService.reduceScore(EnumScoreType.MEM_REDUCE, info, reason, score); | |||||
| wxScoreRulesService.reduceScore(getTenantInfo(),EnumScoreType.MEM_REDUCE, info, reason, score); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -60,7 +60,7 @@ public class WxCampaignController extends BaseController { | |||||
| if (wxCampaign.getStatus() != null && wxCampaign.getStatus() == -1) { | if (wxCampaign.getStatus() != null && wxCampaign.getStatus() == -1) { | ||||
| wxCampaign.setStatus(null); | wxCampaign.setStatus(null); | ||||
| } | } | ||||
| wxCampaign.updateTenantInfo(getTenantInfo()); | |||||
| wxCampaign.updateTenantInfo(ifParentUpdateTenantInfo()); | |||||
| wxCampaign.setSortColumns(BaseEntity.SortField.CreateTime_DESC,BaseEntity.SortField.Id_DESC); | wxCampaign.setSortColumns(BaseEntity.SortField.CreateTime_DESC,BaseEntity.SortField.Id_DESC); | ||||
| final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -78,7 +78,7 @@ public class WxCampaignController extends BaseController { | |||||
| wxCampaign.setCouponIds(JSONArray.toJSONString(new String[0])); | wxCampaign.setCouponIds(JSONArray.toJSONString(new String[0])); | ||||
| } | } | ||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCampaign.updateTenantInfo(getTenantInfo()); | |||||
| wxCampaign.updateTenantInfo(ifParentUpdateAloneTenantInfo()); | |||||
| wxCampaignService.saveOrUpdate(wxCampaign); | wxCampaignService.saveOrUpdate(wxCampaign); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -89,7 +89,7 @@ public class WxCampaignController extends BaseController { | |||||
| public ResultData addByPath(@RequestBody WxCampaign wxCampaign) { | public ResultData addByPath(@RequestBody WxCampaign wxCampaign) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCampaignController::addByPath"); | logger.debug("[" + getIpAddr() + "] WxCampaignController::addByPath"); | ||||
| wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | wxCampaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCampaign.updateTenantInfo(getTenantInfo()); | |||||
| wxCampaign.updateTenantInfo(ifParentUpdateAloneTenantInfo()); | |||||
| wxCampaignService.addForPath(wxCampaign); | wxCampaignService.addForPath(wxCampaign); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -99,7 +99,7 @@ public class WxCampaignController extends BaseController { | |||||
| @SystemControllerLog(description = "宣传页-id更新") | @SystemControllerLog(description = "宣传页-id更新") | ||||
| public ResultData update(@RequestBody WxCampaign wxCampaign) { | public ResultData update(@RequestBody WxCampaign wxCampaign) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCampaignController::update"); | logger.debug("[" + getIpAddr() + "] WxCampaignController::update"); | ||||
| ifParentUpdateAloneTenantInfo(); | |||||
| if (StringUtils.isNotBlank(wxCampaign.getCouponIds())) { | if (StringUtils.isNotBlank(wxCampaign.getCouponIds())) { | ||||
| String[] arys = wxCampaign.getCouponIds().split(","); | String[] arys = wxCampaign.getCouponIds().split(","); | ||||
| wxCampaign.setCouponIds(JSON.toJSONString(arys)); | wxCampaign.setCouponIds(JSON.toJSONString(arys)); | ||||
| @@ -114,6 +114,7 @@ public class WxCampaignController extends BaseController { | |||||
| @SystemControllerLog(description = "宣传页-更新状态") | @SystemControllerLog(description = "宣传页-更新状态") | ||||
| public ResultData updateStatus(@RequestBody WxCampaign wxCampaign) { | public ResultData updateStatus(@RequestBody WxCampaign wxCampaign) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCampaignController::updateStatus"); | logger.debug("[" + getIpAddr() + "] WxCampaignController::updateStatus"); | ||||
| ifParentUpdateAloneTenantInfo(); | |||||
| WxCampaign campaign = wxCampaignService.getById(wxCampaign.getId()); | WxCampaign campaign = wxCampaignService.getById(wxCampaign.getId()); | ||||
| // check coupon 状态 | // check coupon 状态 | ||||
| if (campaign.getType().equals(EnumCampaignType.STABLE.getCode())) { | if (campaign.getType().equals(EnumCampaignType.STABLE.getCode())) { | ||||
| @@ -146,6 +147,7 @@ public class WxCampaignController extends BaseController { | |||||
| @SystemControllerLog(description = "宣传页-删除") | @SystemControllerLog(description = "宣传页-删除") | ||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCampaignController::delete"); | logger.debug("[" + getIpAddr() + "] WxCampaignController::delete"); | ||||
| ifParentUpdateAloneTenantInfo(); | |||||
| wxCampaignService.deleteById(id); | wxCampaignService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @@ -159,7 +161,6 @@ public class WxCampaignController extends BaseController { | |||||
| WxCampaign wxCampaign = wxCampaignService.getById(id); | WxCampaign wxCampaign = wxCampaignService.getById(id); | ||||
| if (wxCampaign != null) { | if (wxCampaign != null) { | ||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | WxCouponChannel wxCouponChannel = new WxCouponChannel(); | ||||
| wxCouponChannel.updateTenantInfo(getTenantInfo()); | |||||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | ||||
| wxCouponChannel.setSubTargetId(wxCampaign.getId()); | wxCouponChannel.setSubTargetId(wxCampaign.getId()); | ||||
| wxCouponChannel.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | wxCouponChannel.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | ||||
| @@ -10,6 +10,7 @@ import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.dto.WxCouponChannelDto; | import com.iformall.domain.dto.WxCouponChannelDto; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import com.iformall.mapper.WxCouponChannelMapper; | import com.iformall.mapper.WxCouponChannelMapper; | ||||
| @@ -82,7 +83,9 @@ public class WxCouponChannelController extends BaseController { | |||||
| if(couponChannel!=null){ | if(couponChannel!=null){ | ||||
| String pageUrl = Constant.mainPageUrl; | String pageUrl = Constant.mainPageUrl; | ||||
| String param = couponChannel.getWeappScene(); | String param = couponChannel.getWeappScene(); | ||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(couponChannel,1,pageUrl,param,0,"","","券"); | |||||
| //此处只有微信二维码,别的二维码需要加字段 | |||||
| ResultData resultDataQ = qrCodeService.uploadQrcode(couponChannel,1,pageUrl,param,0,"","","券",EnumPayWay.PAY_WAY_WECHAT); | |||||
| Map<String,String> map = (Map)resultDataQ.data; | Map<String,String> map = (Map)resultDataQ.data; | ||||
| if(map!=null && map.get("url") !=null) { | if(map!=null && map.get("url") !=null) { | ||||
| String url = map.get("url"); | String url = map.get("url"); | ||||
| @@ -57,10 +57,14 @@ public class WxCouponController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @SystemControllerLog(description = "券投放-列表") | @SystemControllerLog(description = "券投放-列表") | ||||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Integer dataType) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | ||||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | if (wxCoupon == null) wxCoupon = new WxCoupon(); | ||||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||||
| if(null != dataType && dataType == 1){ | |||||
| wxCoupon.updateTenantInfo(ifParentUpdateTenantInfo()); | |||||
| }else{ | |||||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||||
| } | |||||
| return wxCouponService.list(wxCoupon, pageNum, pageSize); //全列表 | return wxCouponService.list(wxCoupon, pageNum, pageSize); //全列表 | ||||
| } | } | ||||
| @@ -6,9 +6,11 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxCouponOrder; | |||||
| import com.iformall.domain.vo.WxCouponOrderBVo; | import com.iformall.domain.vo.WxCouponOrderBVo; | ||||
| import com.iformall.enums.EnumAppType; | import com.iformall.enums.EnumAppType; | ||||
| import com.iformall.enums.EnumPayType; | import com.iformall.enums.EnumPayType; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxAppinfoService; | import com.iformall.service.WxAppinfoService; | ||||
| import com.iformall.service.WxCouponOrderService; | import com.iformall.service.WxCouponOrderService; | ||||
| @@ -93,8 +95,15 @@ public class WxCouponOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| WxCouponOrder wxCouponOrder = wxCouponOrderService.getById(couponOrderId); | |||||
| if (wxCouponOrder == null) { | |||||
| logger.error("券ID不存在:" + couponOrderId); | |||||
| throw new MallinkException(ErrorCode.COUPON_ORDER_IS_NULL); | |||||
| } | |||||
| WxAppinfo appinfoQ = new WxAppinfo(); | WxAppinfo appinfoQ = new WxAppinfo(); | ||||
| appinfoQ.updateTenantInfo(getTenantInfo()); | appinfoQ.updateTenantInfo(getTenantInfo()); | ||||
| appinfoQ.setPlat(EnumPayWay.getEnum(wxCouponOrder.getPayVendor()).getPlat().getCode()); | |||||
| appinfoQ.setType(EnumAppType.B.getCode()); | appinfoQ.setType(EnumAppType.B.getCode()); | ||||
| PageInfo<WxAppinfo> appinfoPageInfo = wxAppinfoService.listAsPage(appinfoQ, 1, 1); | PageInfo<WxAppinfo> appinfoPageInfo = wxAppinfoService.listAsPage(appinfoQ, 1, 1); | ||||
| if (appinfoPageInfo.getList().size() > 0) { | if (appinfoPageInfo.getList().size() > 0) { | ||||
| @@ -10,6 +10,7 @@ import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.enums.EnumCouponPasswordStatus; | import com.iformall.enums.EnumCouponPasswordStatus; | ||||
| import com.iformall.enums.EnumCouponStatus; | import com.iformall.enums.EnumCouponStatus; | ||||
| import com.iformall.enums.EnumCouponValidType; | import com.iformall.enums.EnumCouponValidType; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.PushLimitService; | import com.iformall.service.PushLimitService; | ||||
| import com.iformall.service.WxCouponPasswordService; | import com.iformall.service.WxCouponPasswordService; | ||||
| @@ -127,7 +128,8 @@ public class WxCouponPresentController extends BaseController { | |||||
| } | } | ||||
| wxCouponPresent.setCouponName(wxCoupon.getTitle()); | wxCouponPresent.setCouponName(wxCoupon.getTitle()); | ||||
| wxCouponPresentService.add(wxCouponPresent, list, phoneSet); | |||||
| //只需要给一端发就可以了。默认给微信小程序发 | |||||
| wxCouponPresentService.add(wxCouponPresent, list, phoneSet,EnumPayWay.PAY_WAY_WECHAT); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -8,6 +8,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.dto.OrderSaveDto; | import com.iformall.domain.dto.OrderSaveDto; | ||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxCouponChannel; | import com.iformall.domain.po.WxCouponChannel; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| @@ -16,8 +17,10 @@ import com.iformall.domain.vo.WxMerchantSubsidyVo; | |||||
| import com.iformall.domain.vo.WxOrderQueryVo; | import com.iformall.domain.vo.WxOrderQueryVo; | ||||
| import com.iformall.enums.EnumCouponChannelStatus; | import com.iformall.enums.EnumCouponChannelStatus; | ||||
| import com.iformall.enums.EnumCouponChannelType; | import com.iformall.enums.EnumCouponChannelType; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.enums.EnumUserType; | import com.iformall.enums.EnumUserType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxCUserService; | import com.iformall.service.WxCUserService; | ||||
| import com.iformall.service.WxCouponChannelService; | import com.iformall.service.WxCouponChannelService; | ||||
| import com.iformall.service.WxCouponService; | import com.iformall.service.WxCouponService; | ||||
| @@ -56,6 +59,9 @@ public class WxOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCouponService wxCouponService; | private WxCouponService wxCouponService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -165,7 +171,11 @@ public class WxOrderController extends BaseController { | |||||
| } | } | ||||
| try { | try { | ||||
| WxCUser user = wxCUserService.getById(orderSaveDto.getUserId()); | |||||
| WxCUserBasicInfo user = wxCUserBasicInfoService.getById(orderSaveDto.getUserId()); | |||||
| if(null == user) { | |||||
| logger.error("wxcuser未找到:"+orderSaveDto.getUserId()); | |||||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||||
| } | |||||
| //用于标记当前操作人为A端用户 | //用于标记当前操作人为A端用户 | ||||
| user.setOperatorType(EnumUserType.MALLUSER.getCode()); | user.setOperatorType(EnumUserType.MALLUSER.getCode()); | ||||
| user.setOperatorId(getUserId()); | user.setOperatorId(getUserId()); | ||||
| @@ -178,7 +188,7 @@ public class WxOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.COUPON_IS_NOT_FREE); | return new ResultData(ErrorCode.COUPON_IS_NOT_FREE); | ||||
| } | } | ||||
| // 免费券 | // 免费券 | ||||
| order = wxOrderService.saveFreeOrderForCoupon(user, coupon, orderSaveDto.getCouponChannelId(), orderSaveDto.getFormId(), null); | |||||
| order = wxOrderService.saveFreeOrderForCoupon(user, coupon, orderSaveDto.getCouponChannelId(), orderSaveDto.getFormId(), null,EnumPayWay.PAY_WAY_NOT_UNPAY_CREDIT); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -35,29 +35,29 @@ public class WxSubsidyController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxSubsidyService wxSubsidyService; | private WxSubsidyService wxSubsidyService; | ||||
| @ApiOperation("补贴扫码支付发起") | |||||
| @GetMapping("prePay") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "amount", value = "金额", dataType = "String", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "商城补贴-补贴扫码支付发起") | |||||
| public void subsidyPrepay(String amount, HttpServletResponse response) throws Exception { | |||||
| String ipStr = getIpAddr(); | |||||
| logger.info("subsidyPrepay: " + ipStr + "-" + amount); | |||||
| MallUserInfo userInfo = getUser(); | |||||
| ResultData resultData = wxSubsidyService.createSubsidy(userInfo, ipStr, amount); | |||||
| if (resultData.code == 200) { | |||||
| String codeUrl = ((Map<String, String>) resultData.data).get("code_url"); | |||||
| BufferedImage image = PayUtil.getQRCodeImge(codeUrl); | |||||
| response.setContentType("image/jpeg"); | |||||
| response.setHeader("Pragma", "no-cache"); | |||||
| response.setHeader("Cache-Control", "no-cache"); | |||||
| response.setIntHeader("Expires", -1); | |||||
| ImageIO.write(image, "JPEG", response.getOutputStream()); | |||||
| } else { | |||||
| throw new MallinkException(resultData.code, resultData.message); | |||||
| } | |||||
| } | |||||
| // @ApiOperation("补贴扫码支付发起") | |||||
| // @GetMapping("prePay") | |||||
| // @ApiImplicitParams({ | |||||
| // @ApiImplicitParam(name = "amount", value = "金额", dataType = "String", paramType = "query", required = true)}) | |||||
| // @SystemControllerLog(description = "商城补贴-补贴扫码支付发起") | |||||
| // public void subsidyPrepay(String amount, HttpServletResponse response) throws Exception { | |||||
| // String ipStr = getIpAddr(); | |||||
| // logger.info("subsidyPrepay: " + ipStr + "-" + amount); | |||||
| // MallUserInfo userInfo = getUser(); | |||||
| // ResultData resultData = wxSubsidyService.createSubsidy(userInfo, ipStr, amount); | |||||
| // if (resultData.code == 200) { | |||||
| // String codeUrl = ((Map<String, String>) resultData.data).get("code_url"); | |||||
| // BufferedImage image = PayUtil.getQRCodeImge(codeUrl); | |||||
| // | |||||
| // response.setContentType("image/jpeg"); | |||||
| // response.setHeader("Pragma", "no-cache"); | |||||
| // response.setHeader("Cache-Control", "no-cache"); | |||||
| // response.setIntHeader("Expires", -1); | |||||
| // ImageIO.write(image, "JPEG", response.getOutputStream()); | |||||
| // } else { | |||||
| // throw new MallinkException(resultData.code, resultData.message); | |||||
| // } | |||||
| // } | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -7,7 +7,6 @@ import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl; | |||||
| import cn.afterturn.easypoi.handler.inter.IExcelDataHandler; | import cn.afterturn.easypoi.handler.inter.IExcelDataHandler; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxTags; | import com.iformall.domain.po.WxTags; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.CUserBaseInfoT; | import com.iformall.domain.vo.CUserBaseInfoT; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | import com.iformall.service.WxCUserBasicInfoService; | ||||
| import com.iformall.service.WxTagsService; | import com.iformall.service.WxTagsService; | ||||
| @@ -62,7 +61,7 @@ public class AsyncTask { | |||||
| public void importExcelData(File file, MallUserInfo user, String importKey) { | public void importExcelData(File file, MallUserInfo user, String importKey) { | ||||
| ImportParams params = new ImportParams(); | ImportParams params = new ImportParams(); | ||||
| // 需要验证 | // 需要验证 | ||||
| params.setImportFields(new String[]{"姓名", "性别", "手机号*", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "标签", "成长值", "积分"}); | |||||
| params.setImportFields(new String[]{"姓名", "性别", "手机号*", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "成长值", "积分"}); | |||||
| IExcelDataHandler<CUserBaseInfoT> handler = new AsyncTask.UserExcelHandler(); | IExcelDataHandler<CUserBaseInfoT> handler = new AsyncTask.UserExcelHandler(); | ||||
| handler.setNeedHandlerFields(new String[]{"手机号*"}); | handler.setNeedHandlerFields(new String[]{"手机号*"}); | ||||
| params.setNeedVerify(true); | params.setNeedVerify(true); | ||||
| @@ -92,7 +92,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | ||||
| } else { | } else { | ||||
| info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | ||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(info); | |||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(ifParentUpdateTenantInfo()); | |||||
| for (WxLevelConfig levelConfig : levelList) { | for (WxLevelConfig levelConfig : levelList) { | ||||
| if (info.getPoins() >= levelConfig.getPoints()) { | if (info.getPoins() >= levelConfig.getPoints()) { | ||||
| info.setLevel(levelConfig.getLevel()); | info.setLevel(levelConfig.getLevel()); | ||||
| @@ -107,7 +107,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| WxCUserTags uTag = wxCUserTagsService.getById(info.getTagId()); | WxCUserTags uTag = wxCUserTagsService.getById(info.getTagId()); | ||||
| if (uTag != null && StringUtils.isNotBlank(uTag.getTags())) { | if (uTag != null && StringUtils.isNotBlank(uTag.getTags())) { | ||||
| List<Long> ids = JSONObject.parseArray(uTag.getTags(), Long.class); | List<Long> ids = JSONObject.parseArray(uTag.getTags(), Long.class); | ||||
| info.setTagsList(wxCUserTagsService.findTagList(info, ids)); | |||||
| info.setTagsList(wxCUserTagsService.findTagList(ifParentUpdateTenantInfo(), ids)); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -147,9 +147,9 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| wxCUserBasicInfo.setName(null); | wxCUserBasicInfo.setName(null); | ||||
| } | } | ||||
| } | } | ||||
| wxCUserBasicInfo.updateTenantInfo(getTenantInfo()); | |||||
| wxCUserBasicInfo.setSortColumns(BaseEntity.SortField.ActiveTime_DESC); | |||||
| PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageNum, pageSize); | |||||
| wxCUserBasicInfo.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| // wxCUserBasicInfo.setSortColumns(BaseEntity.SortField.ActiveTime_DESC); | |||||
| PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(ifParentUpdateTenantInfo(),wxCUserBasicInfo, pageNum, pageSize); | |||||
| if (page.getSize() > 0) { | if (page.getSize() > 0) { | ||||
| for (WxCUserBasicInfo info : page.getList()) { | for (WxCUserBasicInfo info : page.getList()) { | ||||
| @@ -163,7 +163,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| private int checkUniquePhone(String phone, TenantEntity tenantEntity) { | private int checkUniquePhone(String phone, TenantEntity tenantEntity) { | ||||
| WxCUserBasicInfo baseInfoQ = new WxCUserBasicInfo(); | WxCUserBasicInfo baseInfoQ = new WxCUserBasicInfo(); | ||||
| baseInfoQ.setPhone(phone); | baseInfoQ.setPhone(phone); | ||||
| baseInfoQ.updateTenantInfo(tenantEntity); | |||||
| baseInfoQ.undateFinalTenantId(getTenantInfo()); | |||||
| return wxCUserBasicInfoService.countUser(baseInfoQ); | return wxCUserBasicInfoService.countUser(baseInfoQ); | ||||
| } | } | ||||
| @@ -182,11 +182,11 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| if(wxCUserBasicInfo.getBirthdate() != null && wxCUserBasicInfo.getBirthdate().after(new Date())){ | if(wxCUserBasicInfo.getBirthdate() != null && wxCUserBasicInfo.getBirthdate().after(new Date())){ | ||||
| return new ResultData(ErrorCode.USER_BIRTHDATE_AFTER.getCode(), "出生日期大于当前日期"); | return new ResultData(ErrorCode.USER_BIRTHDATE_AFTER.getCode(), "出生日期大于当前日期"); | ||||
| } | } | ||||
| wxCUserBasicInfo.updateTenantInfo(tenantEntity); | |||||
| if (StringUtils.isNotBlank(wxCUserBasicInfo.getTagIds())) { | if (StringUtils.isNotBlank(wxCUserBasicInfo.getTagIds())) { | ||||
| WxCUserTags record = new WxCUserTags(); | WxCUserTags record = new WxCUserTags(); | ||||
| record.setUserId(oldInfo.getId()); | record.setUserId(oldInfo.getId()); | ||||
| record.updateTenantInfo(tenantEntity); | |||||
| // record.updateTenantInfo(tenantEntity); | |||||
| record.setTenantId(oldInfo.getFinalTenantId()); | |||||
| PageInfo<WxCUserTags> page = wxCUserTagsService.listAsPage(record, 1, 1); | PageInfo<WxCUserTags> page = wxCUserTagsService.listAsPage(record, 1, 1); | ||||
| if (page.getSize() > 0) { | if (page.getSize() > 0) { | ||||
| WxCUserTags t = page.getList().get(0); | WxCUserTags t = page.getList().get(0); | ||||
| @@ -226,8 +226,6 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| if (info == null) | if (info == null) | ||||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | return new ResultData(ErrorCode.USER_IS_EMPTY); | ||||
| info.updateTenantInfo(getTenantInfo()); | |||||
| setUserInfoTag(info); | setUserInfoTag(info); | ||||
| setUserInfoLevel(info); | setUserInfoLevel(info); | ||||
| setUserInfoCar(info); | setUserInfoCar(info); | ||||
| @@ -315,8 +313,8 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| basicInfo.updateTenantInfo(getTenantInfo()); | |||||
| int exportDataCount = wxCUserBasicInfoService.exportDataCount(basicInfo); | |||||
| basicInfo.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| int exportDataCount = wxCUserBasicInfoService.exportDataCount(ifParentUpdateTenantInfo(),basicInfo); | |||||
| return new ResultData(exportDataCount); | return new ResultData(exportDataCount); | ||||
| @@ -338,8 +336,8 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| basicInfo.updateTenantInfo(getTenantInfo()); | |||||
| wxCUserBasicInfoService.exportData(basicInfo, request, response); | |||||
| basicInfo.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| wxCUserBasicInfoService.exportData(ifParentUpdateTenantInfo(),basicInfo, request, response); | |||||
| } | } | ||||
| @@ -568,4 +566,29 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| return wxCUserBasicInfoService.updateStatus(wxCUserBasicInfo); | return wxCUserBasicInfoService.updateStatus(wxCUserBasicInfo); | ||||
| } | } | ||||
| @ApiOperation("根据手机号迁移") | |||||
| @PostMapping("/cuserOldToNew") | |||||
| @SystemControllerLog(description = "会员管理-迁移数据") | |||||
| public ResultData cuserOldToNew(@RequestBody Map<String,String> map) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::cuserOldToNew"); | |||||
| String oldCuserPhone = (String) map.get("oldCuserPhone"); | |||||
| String newCuserPhone = (String) map.get("newCuserPhone"); | |||||
| if(StringUtils.isNotBlank(oldCuserPhone) && StringUtils.isNotBlank(newCuserPhone)){ | |||||
| WxCUserBasicInfo oldCuser = wxCUserBasicInfoService.findInfoByPhone(ifParentUpdateTenantInfo(), oldCuserPhone); | |||||
| WxCUserBasicInfo newCuser = wxCUserBasicInfoService.findInfoByPhone(ifParentUpdateTenantInfo(), newCuserPhone); | |||||
| if(null != oldCuser && null != newCuser){ | |||||
| if(!oldCuserPhone.equals(newCuserPhone)){ | |||||
| wxCUserBasicInfoService.cuserOldToNew(oldCuser.getId(),newCuser.getId()); | |||||
| return new ResultData(); | |||||
| }else{ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"同一个用户"); | |||||
| } | |||||
| }else{ | |||||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | |||||
| } | |||||
| }else{ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -141,14 +141,13 @@ public class WxCUserDataController extends BaseController { | |||||
| //Date startDate = DateUtils.getDateFromString(startdate + " 00:00:00","yyyy-MM-dd HH:mm:ss").getTime(); | //Date startDate = DateUtils.getDateFromString(startdate + " 00:00:00","yyyy-MM-dd HH:mm:ss").getTime(); | ||||
| //Date endDate = DateUtils.getDateFromString(systemTime + " 23:59:59","yyyy-MM-dd HH:mm:ss").getTime(); | //Date endDate = DateUtils.getDateFromString(systemTime + " 23:59:59","yyyy-MM-dd HH:mm:ss").getTime(); | ||||
| WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | ||||
| wxCUserBasicInfoDto.updateTenantInfo(tenantEntity); | |||||
| wxCUserBasicInfoDto.setStartTime(null); | wxCUserBasicInfoDto.setStartTime(null); | ||||
| wxCUserBasicInfoDto.setEndTime(null); | wxCUserBasicInfoDto.setEndTime(null); | ||||
| map.put("growCount", wxCUserBasicInfoService.findGrowUserCount(wxCUserBasicInfoDto)); | |||||
| map.put("growCount", wxCUserBasicInfoService.findGrowUserCount(ifParentUpdateTenantInfo())); | |||||
| //全部导入的 | //全部导入的 | ||||
| map.put("importCount", wxCUserBasicInfoService.findImportUserCount(wxCUserBasicInfoDto)); | |||||
| map.put("importCount", wxCUserBasicInfoService.findImportUserCount(ifParentUpdateTenantInfo())); | |||||
| //全部 | //全部 | ||||
| map.put("allHistoryUserCount", wxCUserBasicInfoService.findCount(wxCUserBasicInfoDto)); | |||||
| map.put("allHistoryUserCount", wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),wxCUserBasicInfoDto)); | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } | } | ||||
| @@ -8,6 +8,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxCreditHistory; | import com.iformall.domain.po.WxCreditHistory; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxCreditHistoryVo; | import com.iformall.domain.vo.WxCreditHistoryVo; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCreditHistoryService; | import com.iformall.service.WxCreditHistoryService; | ||||
| @@ -42,7 +43,12 @@ public class WxCreditHistoryController extends BaseController { | |||||
| public ResultData list(@ModelAttribute WxCreditHistory wxCreditHistory, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCreditHistory wxCreditHistory, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::list"); | logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::list"); | ||||
| if (null == wxCreditHistory) wxCreditHistory = new WxCreditHistory(); | if (null == wxCreditHistory) wxCreditHistory = new WxCreditHistory(); | ||||
| wxCreditHistory.updateTenantInfo(getTenantInfo()); | |||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ | |||||
| wxCreditHistory.setTenantId(tenantEntity.getParentTenantId()); | |||||
| }else{ | |||||
| wxCreditHistory.setTenantId(tenantEntity.getTenantId()); | |||||
| } | |||||
| final PageInfo<WxCreditHistoryVo> page = wxCreditHistoryService.listAsPageMore(wxCreditHistory, pageNum, pageSize); | final PageInfo<WxCreditHistoryVo> page = wxCreditHistoryService.listAsPageMore(wxCreditHistory, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -111,7 +117,13 @@ public class WxCreditHistoryController extends BaseController { | |||||
| @GetMapping("exportData") | @GetMapping("exportData") | ||||
| @SystemControllerLog(description = "积分历史-导出数据") | @SystemControllerLog(description = "积分历史-导出数据") | ||||
| public void exportData(@ModelAttribute WxCreditHistory wxCreditHistory, HttpServletRequest request, HttpServletResponse response) { | public void exportData(@ModelAttribute WxCreditHistory wxCreditHistory, HttpServletRequest request, HttpServletResponse response) { | ||||
| wxCreditHistory.updateTenantInfo(getTenantInfo()); | |||||
| // wxCreditHistory.updateTenantInfo(getTenantInfo()); | |||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ | |||||
| wxCreditHistory.setTenantId(tenantEntity.getParentTenantId()); | |||||
| }else{ | |||||
| wxCreditHistory.setTenantId(tenantEntity.getTenantId()); | |||||
| } | |||||
| wxCreditHistoryService.exportData(request, response, wxCreditHistory); | wxCreditHistoryService.exportData(request, response, wxCreditHistory); | ||||
| } | } | ||||
| @@ -120,7 +132,13 @@ public class WxCreditHistoryController extends BaseController { | |||||
| @SystemControllerLog(description = "积分历史-积分统计概览") | @SystemControllerLog(description = "积分历史-积分统计概览") | ||||
| public ResultData getCreditSummary(@ModelAttribute WxCreditHistory wxCreditHistory) { | public ResultData getCreditSummary(@ModelAttribute WxCreditHistory wxCreditHistory) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::getCreditSummary"); | logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::getCreditSummary"); | ||||
| wxCreditHistory.updateTenantInfo(getTenantInfo()); | |||||
| // wxCreditHistory.updateTenantInfo(getTenantInfo()); | |||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ | |||||
| wxCreditHistory.setTenantId(tenantEntity.getParentTenantId()); | |||||
| }else{ | |||||
| wxCreditHistory.setTenantId(tenantEntity.getTenantId()); | |||||
| } | |||||
| return wxCreditHistoryService.getCreditSummary(wxCreditHistory); | return wxCreditHistoryService.getCreditSummary(wxCreditHistory); | ||||
| } | } | ||||
| @@ -4,6 +4,8 @@ import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -45,9 +47,14 @@ public class WxLevelConfigController extends BaseController { | |||||
| public ResultData list(@ModelAttribute WxLevelConfig wxLevelConfig, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxLevelConfig wxLevelConfig, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::list"); | logger.debug("[" + getIpAddr() + "] WxLevelConfigController::list"); | ||||
| if (null == wxLevelConfig) wxLevelConfig = new WxLevelConfig(); | if (null == wxLevelConfig) wxLevelConfig = new WxLevelConfig(); | ||||
| wxLevelConfig.updateTenantInfo(getTenantInfo()); | |||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ | |||||
| wxLevelConfig.setTenantId(tenantEntity.getParentTenantId()); | |||||
| }else{ | |||||
| wxLevelConfig.setTenantId(tenantEntity.getTenantId()); | |||||
| } | |||||
| wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); | wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); | ||||
| final PageInfo<WxLevelConfig> page = wxLevelConfigService.listAsPage(wxLevelConfig, pageNum, pageSize); | |||||
| final PageInfo<WxLevelConfig> page = wxLevelConfigService.listAsPage(tenantEntity,wxLevelConfig, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -57,7 +64,10 @@ public class WxLevelConfigController extends BaseController { | |||||
| public ResultData add(@RequestBody List<WxLevelConfig> levelConfigs) { | public ResultData add(@RequestBody List<WxLevelConfig> levelConfigs) { | ||||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); | logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); | ||||
| try { | try { | ||||
| wxLevelConfigService.batchSave(getTenantInfo(), levelConfigs); | |||||
| if (StringUtils.isNotBlank(ifParentUpdateTenantInfo().getParentTenantId())) { | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | |||||
| } | |||||
| wxLevelConfigService.batchSave(ifParentUpdateTenantInfo(), levelConfigs); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| return new ResultData(ErrorCode.DB_FAIL); | return new ResultData(ErrorCode.DB_FAIL); | ||||
| @@ -71,7 +81,10 @@ public class WxLevelConfigController extends BaseController { | |||||
| public ResultData updateCapabilities(@RequestBody List<WxLevelConfig> levelConfigs) { | public ResultData updateCapabilities(@RequestBody List<WxLevelConfig> levelConfigs) { | ||||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); | logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); | ||||
| try { | try { | ||||
| wxLevelConfigService.batchUpdateCapabilities(getTenantInfo(), levelConfigs); | |||||
| if (StringUtils.isNotBlank(ifParentUpdateTenantInfo().getParentTenantId())) { | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | |||||
| } | |||||
| wxLevelConfigService.batchUpdateCapabilities(ifParentUpdateTenantInfo(), levelConfigs); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| return new ResultData(ErrorCode.DB_FAIL); | return new ResultData(ErrorCode.DB_FAIL); | ||||
| @@ -84,6 +97,9 @@ public class WxLevelConfigController extends BaseController { | |||||
| @SystemControllerLog(description = "会员等级权益-删除") | @SystemControllerLog(description = "会员等级权益-删除") | ||||
| public ResultData delete(@RequestBody WxLevelConfig wxLevelConfig) { | public ResultData delete(@RequestBody WxLevelConfig wxLevelConfig) { | ||||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::delete"); | logger.debug("[" + getIpAddr() + "] WxLevelConfigController::delete"); | ||||
| if (StringUtils.isNotBlank(ifParentUpdateTenantInfo().getParentTenantId())) { | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | |||||
| } | |||||
| wxLevelConfigService.deleteById(wxLevelConfig.getId()); | wxLevelConfigService.deleteById(wxLevelConfig.getId()); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @@ -30,7 +30,7 @@ public class WxScoreRulesController extends BaseController { | |||||
| @SystemControllerLog(description = "成长值-配置") | @SystemControllerLog(description = "成长值-配置") | ||||
| public ResultData list() { | public ResultData list() { | ||||
| logger.debug("[" + getIpAddr() + "] WxScoreRulesController::list"); | logger.debug("[" + getIpAddr() + "] WxScoreRulesController::list"); | ||||
| WxScoreRules scoreRules = wxScoreRulesService.getScoreRules(getTenantInfo()); | |||||
| WxScoreRules scoreRules = wxScoreRulesService.getScoreRules(ifParentUpdateTenantInfo()); | |||||
| if (scoreRules.getCreditLocked() == null) { | if (scoreRules.getCreditLocked() == null) { | ||||
| scoreRules.setCreditLocked(EnumCreditLockedStatus.OPEN.getCode()); | scoreRules.setCreditLocked(EnumCreditLockedStatus.OPEN.getCode()); | ||||
| } | } | ||||
| @@ -42,7 +42,7 @@ public class WxScoreRulesController extends BaseController { | |||||
| @SystemControllerLog(description = "成长值-积分-配置-新增") | @SystemControllerLog(description = "成长值-积分-配置-新增") | ||||
| public ResultData add(@RequestBody WxScoreRules wxScoreRules) { | public ResultData add(@RequestBody WxScoreRules wxScoreRules) { | ||||
| logger.debug("[" + getIpAddr() + "] WxScoreRulesController::add"); | logger.debug("[" + getIpAddr() + "] WxScoreRulesController::add"); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | ||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | ||||
| } | } | ||||
| @@ -56,7 +56,7 @@ public class WxScoreRulesController extends BaseController { | |||||
| @SystemControllerLog(description = "积分-配置") | @SystemControllerLog(description = "积分-配置") | ||||
| public ResultData creditRulesList() { | public ResultData creditRulesList() { | ||||
| logger.debug("[" + getIpAddr() + "] WxScoreRulesController::list"); | logger.debug("[" + getIpAddr() + "] WxScoreRulesController::list"); | ||||
| WxScoreRules scoreRules = wxScoreRulesService.getCreditRules(getTenantInfo()); | |||||
| WxScoreRules scoreRules = wxScoreRulesService.getCreditRules(ifParentUpdateTenantInfo()); | |||||
| return new ResultData(scoreRules); | return new ResultData(scoreRules); | ||||
| } | } | ||||
| @@ -71,7 +71,7 @@ public class WxScoreRulesController extends BaseController { | |||||
| if (null == wxScoreRules.getCreditLocked()) { | if (null == wxScoreRules.getCreditLocked()) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "creditLocked不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "creditLocked不能为空"); | ||||
| } | } | ||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | ||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | ||||
| } | } | ||||
| @@ -47,10 +47,11 @@ public class MyShiroRealm extends AuthorizingRealm { | |||||
| throw new UnknownAccountException(ErrorCode.USER_IS_EMPTY.getMessage()); | throw new UnknownAccountException(ErrorCode.USER_IS_EMPTY.getMessage()); | ||||
| } | } | ||||
| // 租户1为预留系统管理端 | // 租户1为预留系统管理端 | ||||
| if(user.getTenantId().equals("1")) { | |||||
| // 只支持租户为1的用户 | |||||
| throw new UnknownAccountException("租户不支持"); | |||||
| } | |||||
| // if(user.getTenantId().equals("1")) { | |||||
| // // 只支持租户为1的用户 | |||||
| // throw new UnknownAccountException("租户不支持"); | |||||
| // } | |||||
| if(user.getStatus()==null || | if(user.getStatus()==null || | ||||
| !EnumMallUserStatus.VALID.getCode().equals(user.getStatus())) {//用户被禁用 | !EnumMallUserStatus.VALID.getCode().equals(user.getStatus())) {//用户被禁用 | ||||
| throw new DisabledAccountException(ErrorCode.USER_IS_LOCKED.getMessage()); | throw new DisabledAccountException(ErrorCode.USER_IS_LOCKED.getMessage()); | ||||
| @@ -23,8 +23,8 @@ public class PasswordHelper { | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| MallUserInfo user = new MallUserInfo(); | MallUserInfo user = new MallUserInfo(); | ||||
| user.setUsername("sadmin"); | |||||
| user.setPassword("fm2020admin"); | |||||
| user.setUsername("fmoperator"); | |||||
| user.setPassword("fm202008admin"); | |||||
| PasswordHelper passwordHelper = new PasswordHelper(); | PasswordHelper passwordHelper = new PasswordHelper(); | ||||
| passwordHelper.encryptPassword(user); | passwordHelper.encryptPassword(user); | ||||
| System.out.println(user); | System.out.println(user); | ||||
| @@ -98,6 +98,45 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| if ("wx_logic_permission".equals(tableName)) { | if ("wx_logic_permission".equals(tableName)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if ("wx_score_rules".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_level_config".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_c_user_basic_info".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_credit_history".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_score_history".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_c_user_tags".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_weapp_ext_set".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_msg_validationcode_model".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| /*if ("wx_flow_config".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_msg_config".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_mall_building".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_mall_floor".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_park".equals(tableName)) { | |||||
| return true; | |||||
| }*/ | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -166,6 +205,30 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| if ("wx_weapp_release_status".equals(tableName)) { | if ("wx_weapp_release_status".equals(tableName)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if ("wx_c_user_basic_info".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("mem_coupon_from_dsp".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_msg_validationcode_model".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| /* if ("wx_flow_config".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_msg_config".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_mall_building".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_mall_floor".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_park".equals(tableName)) { | |||||
| return true; | |||||
| }*/ | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -195,8 +258,6 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| return true; | return true; | ||||
| if ("com.iformall.mapper.WxCouponMapper.findCouponListCount".equals(ms.getId())) | if ("com.iformall.mapper.WxCouponMapper.findCouponListCount".equals(ms.getId())) | ||||
| return true; | return true; | ||||
| if ("com.iformall.mapper.WxCouponMapper.findCouponListCount".equals(ms.getId())) | |||||
| return true; | |||||
| if ("com.iformall.mapper.WxBusinessMapper.businessDataList".equals(ms.getId())) | if ("com.iformall.mapper.WxBusinessMapper.businessDataList".equals(ms.getId())) | ||||
| return true; | return true; | ||||
| if ("com.iformall.mapper.WxBusinessMapper.devoteList".equals(ms.getId())) | if ("com.iformall.mapper.WxBusinessMapper.devoteList".equals(ms.getId())) | ||||
| @@ -221,6 +282,10 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| return true; | return true; | ||||
| if ("com.iformall.mapper.WxBillAllMapper.getReceiveAndPayBillAsPage".equals(ms.getId())) | if ("com.iformall.mapper.WxBillAllMapper.getReceiveAndPayBillAsPage".equals(ms.getId())) | ||||
| return true; | return true; | ||||
| if ("com.iformall.mapper.wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit".equals(ms.getId())) | |||||
| return true; | |||||
| if ("com.iformall.mapper.wxFlowConfigMapper.wxFlowConfigInit".equals(ms.getId())) | |||||
| return true; | |||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| @@ -63,8 +63,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -54,12 +54,12 @@ spring: | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | ||||
| bucketname: formall | bucketname: formall | ||||
| filehost: malinkadmin | filehost: malinkadmin | ||||
| filedomain: https://formall.oss-accelerate.aliyuncs.com | |||||
| filedomain: https://formall.oss-cn-beijing.aliyuncs.com | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -11,7 +11,7 @@ ALTER TABLE `wx_user_visit` | |||||
| ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`; | ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`; | ||||
| CREATE OR REPLACE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER VIEW `mallink`.`view_touch_user` AS SELECT | |||||
| CREATE OR REPLACE VIEW `mallink`.`view_touch_user` AS SELECT | |||||
| date_format( `u`.`day_date`, '%Y-%m-%d' ) AS `xTime`, | date_format( `u`.`day_date`, '%Y-%m-%d' ) AS `xTime`, | ||||
| `u`.`tenant_id` AS `tenant_id`, | `u`.`tenant_id` AS `tenant_id`, | ||||
| `u`.`parent_tenant_id` AS `parent_tenant_id`, | `u`.`parent_tenant_id` AS `parent_tenant_id`, | ||||
| @@ -58,7 +58,7 @@ GROUP BY | |||||
| ) | ) | ||||
| ); | ); | ||||
| CREATE OR REPLACE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER VIEW `mallink`.`view_coupon_data` AS SELECT | |||||
| CREATE OR REPLACE VIEW `mallink`.`view_coupon_data` AS SELECT | |||||
| `baseInfo`.`createTime` AS `createTime`, | `baseInfo`.`createTime` AS `createTime`, | ||||
| `baseInfo`.`couponId` AS `couponId`, | `baseInfo`.`couponId` AS `couponId`, | ||||
| `baseInfo`.`couponUserCount` AS `couponUserCount`, | `baseInfo`.`couponUserCount` AS `couponUserCount`, | ||||
| @@ -0,0 +1,46 @@ | |||||
| update mall_sale_type set menus = '[1, 2, 5, 6, 8, 10, 50, 101, 102, 104, 105, 106, 108, 203, 204, 206, 207, 501, 502, 503, 504, 505, 506, 507, 511, 512, 522, 523, 509, 591, 595, 601, 605, 621, 622, 623, 624, 625, 626, 627, 671, 901, 902]' where id=100 | |||||
| CREATE PROCEDURE `init_after_group`(IN tenantId VARCHAR(25),IN subTenantIds VARCHAR(250)) | |||||
| BEGIN | |||||
| DECLARE tableName VARCHAR(50); | |||||
| DECLARE end_flag INT DEFAULT FALSE; | |||||
| DECLARE err_flag INT DEFAULT FALSE; | |||||
| DECLARE table_cursor CURSOR FOR SELECT DISTINCT TABLE_NAME FROM information_schema.COLUMNS WHERE COLUMN_NAME = 'parent_tenant_id' AND TABLE_NAME NOT LIKE 'view%' AND TABLE_NAME != 'wx_mall'; | |||||
| DECLARE CONTINUE HANDLER FOR NOT FOUND SET end_flag = TRUE; | |||||
| DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET err_flag = TRUE; | |||||
| START TRANSACTION; | |||||
| OPEN table_cursor; | |||||
| read_loop: LOOP | |||||
| FETCH table_cursor INTO tableName; | |||||
| IF end_flag THEN | |||||
| LEAVE read_loop; | |||||
| END IF; | |||||
| SET @old_data_sql = CONCAT("UPDATE ",tableName," SET parent_tenant_id = NULL WHERE parent_tenant_id = '",tenantId,"';"); | |||||
| PREPARE stmt_old FROM @old_data_sql; | |||||
| EXECUTE stmt_old; | |||||
| DEALLOCATE PREPARE stmt_old; | |||||
| IF ISNULL(subTenantIds)=0 and LENGTH(trim(subTenantIds))>0 THEN | |||||
| SET @new_data_sql = CONCAT("UPDATE ",tableName," SET parent_tenant_id = '",tenantId,"' WHERE FIND_IN_SET(tenant_id ,'",subTenantIds,"');"); | |||||
| PREPARE stmt_new FROM @new_data_sql; | |||||
| EXECUTE stmt_new; | |||||
| DEALLOCATE PREPARE stmt_new; | |||||
| END IF; | |||||
| END LOOP; | |||||
| CLOSE table_cursor; | |||||
| IF err_flag THEN | |||||
| ROLLBACK; | |||||
| ELSE | |||||
| COMMIT; | |||||
| END IF; | |||||
| END; | |||||
| --两张表做手动初始化 | |||||
| --wx_c_user_basic_info ---final_tenant_id | |||||
| --wx_c_user_tags ---tenant_id(同final_tenant_id) | |||||
| ---------- | |||||
| -----积分设置和成长值等级设置使用集团规则 | |||||
| -----注意:店铺等级折扣设置之前是使用子广场设置,使用集团版后需重新设置 | |||||
| ---------- | |||||
| @@ -0,0 +1,136 @@ | |||||
| ALTER TABLE `wx_c_user` | |||||
| ADD COLUMN `user_id` bigint(11) COMMENT '用户ID' AFTER `active_time`; | |||||
| update `wx_c_user` set user_id = id where id in (select id from wx_c_user_basic_info); | |||||
| create table wx_c_user_basic_info_20200826 like wx_c_user_basic_info; | |||||
| insert into wx_c_user_basic_info_20200826 select * from wx_c_user_basic_info; | |||||
| ALTER TABLE `wx_c_user_basic_info` | |||||
| ADD COLUMN `final_tenant_id` varchar(5) NOT NULL COMMENT '归属租户ID' AFTER `parent_tenant_id`; | |||||
| update wx_c_user_basic_info set final_tenant_id = parent_tenant_id where parent_tenant_id is not null and trim(parent_tenant_id) != ""; | |||||
| update wx_c_user_basic_info set final_tenant_id = tenant_id where (parent_tenant_id is null or trim(parent_tenant_id) = ""); | |||||
| -----注意重复数据--注意重复数据 | |||||
| ALTER TABLE wx_c_user_basic_info ADD UNIQUE INDEX `PHONE_UNIQUE`(`final_tenant_id`, `phone`) USING BTREE; | |||||
| ALTER TABLE `wx_c_user_basic_info` | |||||
| ADD COLUMN `login_count` int(11) DEFAULT 0 COMMENT '登陆次数' AFTER `active_time`; | |||||
| update wx_c_user_basic_info wcubi set wcubi.login_count = (select wcu.login_count from wx_c_user wcu where wcu.id=wcubi.id); | |||||
| ALTER TABLE `wx_c_user_basic_info` | |||||
| ADD COLUMN `avatar_url` VARCHAR(225) DEFAULT 0 COMMENT '头像地址' AFTER `nick_name`; | |||||
| update wx_c_user_basic_info wcubi set wcubi.avatar_url = (select wcu.avatar_url from wx_c_user wcu where wcu.id=wcubi.id); | |||||
| ALTER TABLE `wx_c_user_basic_info` | |||||
| MODIFY COLUMN `phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '微信用户绑定的手机号' AFTER `final_tenant_id`; | |||||
| ALTER TABLE `wx_c_user_basic_info` | |||||
| MODIFY COLUMN `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '租户ID' AFTER `id`; | |||||
| ALTER TABLE `wx_coupon_order` | |||||
| ADD COLUMN `pay_vendor` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '订单渠道,EnumPayWay.class'; | |||||
| UPDATE wx_coupon_order o INNER JOIN wx_pay_order po ON po.order_id = o.`id` SET o.pay_vendor = po.pay_vendor; | |||||
| ---刷新完之后把DEFAULT 1 去掉 | |||||
| ALTER TABLE `wx_card_spend` | |||||
| ADD COLUMN `remark` VARCHAR(30) DEFAULT NULL COMMENT '备注'; | |||||
| ALTER TABLE `wx_appinfo` | |||||
| ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT 'app平台 1:微信 2:阿里 3:头条'; | |||||
| ALTER TABLE `wx_profit_sharing_receiver` | |||||
| ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '平台 1:微信 2:阿里 3:头条'; | |||||
| create table wx_rent_contract_20200826 like wx_rent_contract; | |||||
| insert into wx_rent_contract_20200826 select * from wx_rent_contract; | |||||
| ALTER TABLE wx_rent_contract DROP COLUMN shop_id; | |||||
| create table wx_property_contract_20200826 like wx_property_contract; | |||||
| insert into wx_property_contract_20200826 select * from wx_property_contract; | |||||
| ALTER TABLE wx_property_contract DROP COLUMN shop_id; | |||||
| ALTER TABLE `wx_rent_contract` ADD COLUMN `shop_name` VARCHAR(100) COMMENT '店铺名称'; | |||||
| //待刷语句 | |||||
| //刷shop_name字段,合同状态为4(即将到期)更新为计租中,合同状态为8(补录),9(续签)更新为草稿。租金合同rentinfo | |||||
| UPDATE wx_rent_contract SET STATUS = 3 , apply_status = 2 WHERE STATUS = 4 AND apply_status = 1; | |||||
| UPDATE wx_property_contract SET STATUS = 3 WHERE STATUS = 4; | |||||
| UPDATE wx_rent_contract SET STATUS = 1 WHERE STATUS = 8 AND apply_status = 0; | |||||
| UPDATE wx_rent_contract SET STATUS = 10 WHERE STATUS = 8 AND apply_status = 1; | |||||
| UPDATE wx_rent_contract SET STATUS = 1 WHERE STATUS = 9; | |||||
| UPDATE wx_rent_contract wrc INNER JOIN wx_shop s ON wrc.shop_id = s.id SET rent_info = JSON_ARRAY(s.*) WHERE wrc.rent_info IS NULL; | |||||
| ALTER TABLE `wx_rent_contract` | |||||
| ADD COLUMN `from_id` BIGINT(20) DEFAULT NULL COMMENT '来源ID,针对续签,从哪个合同续签'; | |||||
| ALTER TABLE `wx_c_user_car` | |||||
| ADD COLUMN `vendor_person_id` VARCHAR(100) DEFAULT NULL COMMENT '停车场的会员ID'; | |||||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (593, '开发人员专用', 50, 'Y', NULL, 1, NULL, NULL, 'developer', 'icon-shenpiguanli', 0, 593); | |||||
| ALTER TABLE `wx_mall` | |||||
| MODIFY COLUMN `img_url` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商场图标' AFTER `service_phone`, | |||||
| MODIFY COLUMN `img_url_h` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商场图标_横' AFTER `img_url`; | |||||
| CREATE DEFINER=`root`@`%` PROCEDURE `cuser_old_to_new`(IN `oldCuserId` bigint,IN `newCuserId` bigint) | |||||
| BEGIN | |||||
| DECLARE err_flag INT DEFAULT FALSE; | |||||
| DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET err_flag = TRUE; | |||||
| UPDATE wx_c_user SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||||
| UPDATE wx_activity_join SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||||
| UPDATE wx_c_user_tags SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||||
| UPDATE wx_game_action_log SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||||
| UPDATE wx_order_group SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||||
| UPDATE wx_order_press SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||||
| UPDATE wx_question_log SET user_id = newCuserId WHERE user_id = oldCuserId ; | |||||
| UPDATE wx_c_user_car SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_c_user_from_b SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_coupon_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_credit_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_pay_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_refund_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_score_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_card_spend SET owner_id = newCuserId WHERE owner_id = oldCuserId ; | |||||
| UPDATE wx_coupon_order SET owner_id = newCuserId WHERE owner_id = oldCuserId ; | |||||
| UPDATE wx_credit_history SET operator_id = newCuserId WHERE operator_type in (1,2) and operator_id = oldCuserId ; | |||||
| UPDATE wx_c_user_basic_info SET phone = phone + '(作废)',`status` = 1 WHERE id = oldCuserId ; | |||||
| IF err_flag THEN | |||||
| ROLLBACK; | |||||
| ELSE | |||||
| COMMIT; | |||||
| END IF; | |||||
| END | |||||
| @@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Value; | |||||
| import org.springframework.boot.SpringApplication; | import org.springframework.boot.SpringApplication; | ||||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | import org.springframework.boot.autoconfigure.SpringBootApplication; | ||||
| import org.springframework.context.annotation.Bean; | import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.EnableAspectJAutoProxy; | |||||
| /** | /** | ||||
| * @author chenkx | * @author chenkx | ||||
| @@ -16,6 +17,7 @@ import org.springframework.context.annotation.Bean; | |||||
| @MapperScan(basePackages = {"com.iformall.mapper"}) | @MapperScan(basePackages = {"com.iformall.mapper"}) | ||||
| @EnableEncryptableProperties | @EnableEncryptableProperties | ||||
| @EnableRocketMQ | @EnableRocketMQ | ||||
| @EnableAspectJAutoProxy(exposeProxy = true) | |||||
| public class BApplication { | public class BApplication { | ||||
| @Value("${fm.exception}") | @Value("${fm.exception}") | ||||
| @@ -2,6 +2,7 @@ package com.iformall.config; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -107,6 +108,23 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("baseCUserTokenRedisTemplate") | |||||
| public RedisTemplate<String, BaseCUserEntity> getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, BaseCUserEntity> template = new RedisTemplate<String, BaseCUserEntity>(); | |||||
| Jackson2JsonRedisSerializer<BaseCUserEntity> j = new Jackson2JsonRedisSerializer<BaseCUserEntity>(BaseCUserEntity.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("mallRedisTemplate") | @Bean("mallRedisTemplate") | ||||
| public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | ||||
| RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | ||||
| @@ -175,6 +193,23 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("cUserBasicInfoRedisTemplate") | |||||
| public RedisTemplate<String, WxCUserBasicInfo> getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxCUserBasicInfo> template = new RedisTemplate<String, WxCUserBasicInfo>(); | |||||
| Jackson2JsonRedisSerializer<WxCUserBasicInfo> j = new Jackson2JsonRedisSerializer<WxCUserBasicInfo>(WxCUserBasicInfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("stringValueOperations") | @Bean("stringValueOperations") | ||||
| public ValueOperations<String, String> getStringValueOperations(RedisConnectionFactory connectionFactory) { | public ValueOperations<String, String> getStringValueOperations(RedisConnectionFactory connectionFactory) { | ||||
| StringRedisTemplate template = new StringRedisTemplate(); | StringRedisTemplate template = new StringRedisTemplate(); | ||||
| @@ -95,12 +95,13 @@ public class WxCUserController extends BaseController { | |||||
| if (wxCUserFromB == null) { | if (wxCUserFromB == null) { | ||||
| //TODO phone可能为空 | //TODO phone可能为空 | ||||
| String phone = wxCUser.getPhone(); | String phone = wxCUser.getPhone(); | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.findInfoByPhone(bUser, phone); | |||||
| //查询会员信息 | //查询会员信息 | ||||
| List<WxCUserBasicInfo> byPhone = wxCUserBasicInfoService.findByPhone(bUser, phone); | |||||
| //List<WxCUserBasicInfo> byPhone = wxCUserBasicInfoService.findByPhone(bUser, phone); | |||||
| //存在会员信息 | //存在会员信息 | ||||
| if (!byPhone.isEmpty()) { | |||||
| if (wxCUserBasicInfo != null) { | |||||
| //更新会员信息 | //更新会员信息 | ||||
| WxCUserBasicInfo wxCUserBasicInfo = byPhone.get(0); | |||||
| if (!StringUtils.isEmpty(wxCUserFromBDto.getName())) { | if (!StringUtils.isEmpty(wxCUserFromBDto.getName())) { | ||||
| wxCUserBasicInfo.setName(wxCUserFromBDto.getName()); | wxCUserBasicInfo.setName(wxCUserFromBDto.getName()); | ||||
| } | } | ||||
| @@ -116,7 +117,7 @@ public class WxCUserController extends BaseController { | |||||
| wxCUserBasicInfo.setPhone(wxCUser.getPhone()); | wxCUserBasicInfo.setPhone(wxCUser.getPhone()); | ||||
| wxCUserBasicInfo.setUpdateDate(new Date()); | wxCUserBasicInfo.setUpdateDate(new Date()); | ||||
| wxCUserBasicInfoService.update(wxCUserBasicInfo); | wxCUserBasicInfoService.update(wxCUserBasicInfo); | ||||
| wxScoreRulesService.addScore(EnumScoreType.COMPLETE_INFO, wxCUserBasicInfo); | |||||
| wxScoreRulesService.addScore(getTenantInfo(),EnumScoreType.COMPLETE_INFO, wxCUserBasicInfo); | |||||
| //增加积分 | //增加积分 | ||||
| addCredit(wxCUserBasicInfo, EnumScoreType.COMPLETE_INFO, wxCUserFromBDto.getUserId(), wxCUserFromB); | addCredit(wxCUserBasicInfo, EnumScoreType.COMPLETE_INFO, wxCUserFromBDto.getUserId(), wxCUserFromB); | ||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, wxCUserBasicInfo); | wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, wxCUserBasicInfo); | ||||
| @@ -133,7 +134,7 @@ public class WxCUserController extends BaseController { | |||||
| } else { | } else { | ||||
| //新增来自B端的会员 | //新增来自B端的会员 | ||||
| long cUserId = idWorker.nextId(); | long cUserId = idWorker.nextId(); | ||||
| WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo(); | |||||
| wxCUserBasicInfo = new WxCUserBasicInfo(); | |||||
| wxCUserBasicInfo.setId(cUserId); | wxCUserBasicInfo.setId(cUserId); | ||||
| if (!StringUtils.isEmpty(wxCUserFromBDto.getName())) { | if (!StringUtils.isEmpty(wxCUserFromBDto.getName())) { | ||||
| wxCUserBasicInfo.setName(wxCUserFromBDto.getName()); | wxCUserBasicInfo.setName(wxCUserFromBDto.getName()); | ||||
| @@ -177,7 +178,7 @@ public class WxCUserController extends BaseController { | |||||
| } | } | ||||
| wxCUserBasicInfo.setPhone(wxCUser.getPhone()); | wxCUserBasicInfo.setPhone(wxCUser.getPhone()); | ||||
| wxCUserBasicInfoService.update(wxCUserBasicInfo); | wxCUserBasicInfoService.update(wxCUserBasicInfo); | ||||
| wxScoreRulesService.addScore(EnumScoreType.COMPLETE_INFO, wxCUserBasicInfo); | |||||
| wxScoreRulesService.addScore(getTenantInfo(),EnumScoreType.COMPLETE_INFO, wxCUserBasicInfo); | |||||
| //增加积分 | //增加积分 | ||||
| addCredit(wxCUserBasicInfo, EnumScoreType.COMPLETE_INFO, wxCUserFromBDto.getUserId(), wxCUserFromB); | addCredit(wxCUserBasicInfo, EnumScoreType.COMPLETE_INFO, wxCUserFromBDto.getUserId(), wxCUserFromB); | ||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, wxCUserBasicInfo); | wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, wxCUserBasicInfo); | ||||
| @@ -10,6 +10,7 @@ import com.iformall.domain.vo.WxCouponActionLogVo; | |||||
| import com.iformall.domain.vo.WxCouponSendVo; | import com.iformall.domain.vo.WxCouponSendVo; | ||||
| import com.iformall.enums.EnumCouponSendSendType; | import com.iformall.enums.EnumCouponSendSendType; | ||||
| import com.iformall.enums.EnumCouponSendStatus; | import com.iformall.enums.EnumCouponSendStatus; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxCUserMapper; | import com.iformall.mapper.WxCUserMapper; | ||||
| import com.iformall.service.WxCouponActionLogService; | import com.iformall.service.WxCouponActionLogService; | ||||
| @@ -101,7 +102,7 @@ public class WxCouponSendController extends BaseController { | |||||
| wxCouponSend.setSendType(EnumCouponSendSendType.MERCHANT.getCode()); | wxCouponSend.setSendType(EnumCouponSendSendType.MERCHANT.getCode()); | ||||
| wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode()); | wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode()); | ||||
| try { | try { | ||||
| wxCouponSendService.handSel(wxCouponSend, Long.parseLong(cUserId)); | |||||
| wxCouponSendService.handSel(wxCouponSend, Long.parseLong(cUserId),EnumPayWay.PAY_WAY_NOT_UNPAY_MERCHANT); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("注券异常: ", e); | logger.error("注券异常: ", e); | ||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| @@ -253,7 +253,7 @@ public class WxInfoController extends BaseController { | |||||
| logger.info("getSuperOpenId: openId >>>"+openId ); | logger.info("getSuperOpenId: openId >>>"+openId ); | ||||
| MallUserInfo user = mallUserInfoService.getByBOpenId(openId, tenantEntity); | MallUserInfo user = mallUserInfoService.getByBOpenId(openId, tenantEntity); | ||||
| if(user == null) { | if(user == null) { | ||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION, retMap); | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(),"当前微信["+openId+"]未绑定后台管理员账号", retMap); | |||||
| } | } | ||||
| if(user.getStatus().equals(EnumMallUserStatus.NOT_VALID.getCode())) { | if(user.getStatus().equals(EnumMallUserStatus.NOT_VALID.getCode())) { | ||||
| logger.error(ErrorCode.USER_IS_LOCKED.getMessage()); | logger.error(ErrorCode.USER_IS_LOCKED.getMessage()); | ||||
| @@ -261,7 +261,7 @@ public class WxInfoController extends BaseController { | |||||
| } | } | ||||
| if(!mallUserRoleService.checkIsMobileAdmin(user)) { | if(!mallUserRoleService.checkIsMobileAdmin(user)) { | ||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION, retMap); | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(),user.getName()+"非超管或者没有数据塔台权限", retMap); | |||||
| } | } | ||||
| retMap.put("phone", user.getPhone()); | retMap.put("phone", user.getPhone()); | ||||
| @@ -375,7 +375,7 @@ public class WxInfoController extends BaseController { | |||||
| MallUserInfo user = mallUserInfoService.getByPhone(phone, tenantEntity); | MallUserInfo user = mallUserInfoService.getByPhone(phone, tenantEntity); | ||||
| if(user == null) { | if(user == null) { | ||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION, resultMap); | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(),"手机号["+phone+"]非绑定后台管理员账号", resultMap); | |||||
| } | } | ||||
| if (mallUserRoleService.checkIsMobileAdmin(user)) { | if (mallUserRoleService.checkIsMobileAdmin(user)) { | ||||
| resultMap.put("phone", user.getPhone()); | resultMap.put("phone", user.getPhone()); | ||||
| @@ -386,7 +386,7 @@ public class WxInfoController extends BaseController { | |||||
| return new ResultData(resultMap); | return new ResultData(resultMap); | ||||
| } else { | } else { | ||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION, resultMap); | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(),user.getName()+"不是超管或者没有数据塔台的权限", resultMap); | |||||
| } | } | ||||
| } else { | } else { | ||||
| return new ResultData(ErrorCode.PHONE_DECODE_ERR, resultMap); | return new ResultData(ErrorCode.PHONE_DECODE_ERR, resultMap); | ||||
| @@ -67,25 +67,26 @@ public class WxMemController extends BaseController { | |||||
| WxMerchantBUser bUser = getUser(); | WxMerchantBUser bUser = getUser(); | ||||
| WxCUser cUser = userService.getById(id); | |||||
| if(cUser == null) { | |||||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | |||||
| } | |||||
| // WxCUser cUser = userService.getById(id); | |||||
| // if(cUser == null) { | |||||
| // return new ResultData(ErrorCode.USER_IS_EMPTY); | |||||
| // } | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUser.getId()); | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(id); | |||||
| if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | ||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | ||||
| } | } | ||||
| WxCUserVo userVo = new WxCUserVo(); | WxCUserVo userVo = new WxCUserVo(); | ||||
| org.springframework.beans.BeanUtils.copyProperties(cUser, userVo); | |||||
| org.springframework.beans.BeanUtils.copyProperties(wxCUserBasicInfo, userVo); | |||||
| userVo.setScore(wxCUserBasicInfo.getPoins()); | |||||
| if (wxCUserBasicInfo != null) { | |||||
| userVo.setName(wxCUserBasicInfo.getName()); | |||||
| userVo.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||||
| userVo.setSex(wxCUserBasicInfo.getSex()); | |||||
| userVo.setAddress(wxCUserBasicInfo.getAddress()); | |||||
| } | |||||
| // if (wxCUserBasicInfo != null) { | |||||
| // userVo.setName(wxCUserBasicInfo.getName()); | |||||
| // userVo.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||||
| // userVo.setSex(wxCUserBasicInfo.getSex()); | |||||
| // userVo.setAddress(wxCUserBasicInfo.getAddress()); | |||||
| // } | |||||
| userVo.setLevelName(WxLevelConfigService.DEFAULT_LEVEL); | userVo.setLevelName(WxLevelConfigService.DEFAULT_LEVEL); | ||||
| userVo.setDiscountRate(WxLevelConfigService.DEFAULT_MERCHANT_DISCOUNT); | userVo.setDiscountRate(WxLevelConfigService.DEFAULT_MERCHANT_DISCOUNT); | ||||
| @@ -93,7 +94,7 @@ public class WxMemController extends BaseController { | |||||
| if (userVo.getScore() != null) { | if (userVo.getScore() != null) { | ||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(userVo.getTenantId()); | |||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(wxCUserBasicInfo.getFinalTenantId()); | |||||
| String level = WxLevelConfigService.DEFAULT_LEVEL; | String level = WxLevelConfigService.DEFAULT_LEVEL; | ||||
| Long levelId = 0L; | Long levelId = 0L; | ||||
| @@ -4,6 +4,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.enums.EnumMsgSend; | import com.iformall.enums.EnumMsgSend; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.WxCUserService; | import com.iformall.service.WxCUserService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxProfitSharingReceiverService; | import com.iformall.service.WxProfitSharingReceiverService; | ||||
| @@ -72,7 +73,7 @@ public class WxMerchantController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "账号名称不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "账号名称不能为空"); | ||||
| } | } | ||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | wxMerchant.updateTenantInfo(getTenantInfo()); | ||||
| return wxMerchantService.updateMerchantAccount(wxMerchant); | |||||
| return wxMerchantService.updateMerchantAccount(wxMerchant,EnumPayWay.PAY_WAY_WECHAT); | |||||
| } | } | ||||
| @ApiOperation("删除分账账户") | @ApiOperation("删除分账账户") | ||||
| @@ -58,12 +58,6 @@ public class WxMicroPayController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | private WxCUserBasicInfoService wxCUserBasicInfoService; | ||||
| @Autowired | |||||
| private WxCUserService wxCUserService; | |||||
| @Autowired | |||||
| private PosCouponOrderVerifyService posCouponOrderVerifyService; | |||||
| @ApiOperation(value = "付款码支付订单", notes = "params:{\"authCode\":\"String\",\"totalFee\":\"支付金额\"},\n" + | @ApiOperation(value = "付款码支付订单", notes = "params:{\"authCode\":\"String\",\"totalFee\":\"支付金额\"},\n" + | ||||
| "注意:\n" + | "注意:\n" + | ||||
| "提醒1:提交支付请求后微信会同步返回支付结果。当返回结果为“系统错误”时,商户系统等待5秒后调用【查询订单API】,查询支付实际交易结果;当返回结果为“USERPAYING”时,商户系统可设置间隔时间(建议10秒)重新查询支付结果,直到支付成功或超时(建议30秒);\n" + | "提醒1:提交支付请求后微信会同步返回支付结果。当返回结果为“系统错误”时,商户系统等待5秒后调用【查询订单API】,查询支付实际交易结果;当返回结果为“USERPAYING”时,商户系统可设置间隔时间(建议10秒)重新查询支付结果,直到支付成功或超时(建议30秒);\n" + | ||||
| @@ -75,27 +69,30 @@ public class WxMicroPayController extends BaseController { | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String authCode = paramMap.get("authCode"); | String authCode = paramMap.get("authCode"); | ||||
| String totalFeeStr = paramMap.get("totalFee"); | String totalFeeStr = paramMap.get("totalFee"); | ||||
| return saveMicopayOrder(authCode, totalFeeStr, EnumPayWay.PAY_WAY_WECHAT_MA, request); | |||||
| } | |||||
| if (StringUtils.isBlank(authCode)) { | |||||
| private ResultData saveMicopayOrder(String authCode,String totalFeeStr,EnumPayWay payWay,HttpServletRequest request) { | |||||
| if (StringUtils.isBlank(authCode)) { | |||||
| logger.error("authCode不能为空"); | logger.error("authCode不能为空"); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "authCode不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "authCode不能为空"); | ||||
| } | } | ||||
| if (StringUtils.isBlank(totalFeeStr)) { | |||||
| logger.error("totalFee不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "totalFee不能为空"); | |||||
| } | |||||
| if (!checkAuthCode(authCode)) { | if (!checkAuthCode(authCode)) { | ||||
| logger.error("authCode不符合规则"); | logger.error("authCode不符合规则"); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "authCode不符合规则"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "authCode不符合规则"); | ||||
| } | } | ||||
| String ipStr = IPUtil.getIpAddr(request); | |||||
| if (StringUtils.isBlank(totalFeeStr)) { | |||||
| logger.error("totalFee不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "totalFee不能为空"); | |||||
| } | |||||
| String ipStr = IPUtil.getIpAddr(request); | |||||
| WxMerchantBUser user = getUser(); | WxMerchantBUser user = getUser(); | ||||
| WxOrder order = null; | WxOrder order = null; | ||||
| try { | try { | ||||
| order = wxOrderService.saveMicroPayOrder(user, totalFeeStr); | |||||
| order = wxOrderService.saveMicroPayOrder(user, totalFeeStr,payWay); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("saveMicopayOrder 1" + e.getMessage()); | logger.error("saveMicopayOrder 1" + e.getMessage()); | ||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| @@ -110,27 +107,29 @@ public class WxMicroPayController extends BaseController { | |||||
| record.setAuthCode(authCode); | record.setAuthCode(authCode); | ||||
| record.setPayAmount(order.getPayment()); | record.setPayAmount(order.getPayment()); | ||||
| record.setIp(ipStr); | record.setIp(ipStr); | ||||
| try { | try { | ||||
| return wxPayOrderService.createMicroPayOrder(user, record, EnumPayWay.PAY_WAY_WECHAT); | |||||
| return wxPayOrderService.createMicroPayOrder(user, record, payWay, null); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("payment wechat, order create error, req 3: " + record.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order create error, req 3: " + record.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| @ApiOperation(value = "查询付款码支付订单", notes = "{\"payOrderId\":\"String\",\"orderId\":\"String\"}") | @ApiOperation(value = "查询付款码支付订单", notes = "{\"payOrderId\":\"String\",\"orderId\":\"String\"}") | ||||
| @PostMapping("order_query") | @PostMapping("order_query") | ||||
| public ResultData queryMicopayOrder(@RequestBody Map<String, String> paramMap) { | public ResultData queryMicopayOrder(@RequestBody Map<String, String> paramMap) { | ||||
| logger.info("queryMicopayOrder: " + paramMap.toString()); | logger.info("queryMicopayOrder: " + paramMap.toString()); | ||||
| WxMerchantBUser user = getUser(); | |||||
| String payOrderIdStr = paramMap.get("payOrderId"); | String payOrderIdStr = paramMap.get("payOrderId"); | ||||
| String orderIdStr = paramMap.get("orderId"); | String orderIdStr = paramMap.get("orderId"); | ||||
| return queryMicopayOrder(payOrderIdStr,orderIdStr,EnumPayWay.PAY_WAY_WECHAT_MA); | |||||
| } | |||||
| private ResultData queryMicopayOrder(String payOrderIdStr,String orderIdStr,EnumPayWay payWay) { | |||||
| WxMerchantBUser user = getUser(); | |||||
| if (StringUtils.isBlank(payOrderIdStr)) { | if (StringUtils.isBlank(payOrderIdStr)) { | ||||
| logger.error("payOrderId不能为空"); | logger.error("payOrderId不能为空"); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "payOrderId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "payOrderId不能为空"); | ||||
| @@ -146,14 +145,14 @@ public class WxMicroPayController extends BaseController { | |||||
| payOrderId = Long.valueOf(payOrderIdStr); | payOrderId = Long.valueOf(payOrderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| payOrderId = 0L; | payOrderId = 0L; | ||||
| logger.error("payOrderId参数不正确: " + paramMap.toString()); | |||||
| logger.error("payOrderId参数不正确: " + payOrderIdStr); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| try { | try { | ||||
| orderId = Long.valueOf(orderIdStr); | orderId = Long.valueOf(orderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| orderId = 0L; | orderId = 0L; | ||||
| logger.error("orderId参数不正确: " + paramMap.toString()); | |||||
| logger.error("orderId参数不正确: " + orderIdStr); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| @@ -164,16 +163,17 @@ public class WxMicroPayController extends BaseController { | |||||
| record.setOrderId(orderId); | record.setOrderId(orderId); | ||||
| try { | try { | ||||
| ResultData resultData = wxPayOrderService.payOrderQuery(user, record); | |||||
| ResultData resultData = wxPayOrderService.payOrderQuery(user, record, payWay); | |||||
| return resultData; | return resultData; | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("payment wechat, order query error, req 2: " + record.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order query error, req 2: " + record.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("payment wechat, order query error, req 3: " + record.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order query error, req 3: " + record.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.PAY_ORDER_QUERY_ERROR, e.getMessage()); | return new ResultData(ErrorCode.PAY_ORDER_QUERY_ERROR, e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| @ApiOperation(value = "撤销付款码支付订单", notes = "{\"payOrderId\":\"String\",\"orderId\":\"String\"}") | @ApiOperation(value = "撤销付款码支付订单", notes = "{\"payOrderId\":\"String\",\"orderId\":\"String\"}") | ||||
| @PostMapping("order_reverse") | @PostMapping("order_reverse") | ||||
| @@ -208,20 +208,26 @@ public class WxMicroPayController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| WxPayOrder record = new WxPayOrder(); | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setId(payOrderId); | |||||
| record.setPayOrderNo(payOrderIdStr); | |||||
| record.setBUserId(getUser().getId()); | |||||
| record.setOrderId(orderId); | |||||
| // WxPayOrder record = new WxPayOrder(); | |||||
| // record.updateTenantInfo(getTenantInfo()); | |||||
| // record.setId(payOrderId); | |||||
| // record.setPayOrderNo(payOrderIdStr); | |||||
| // record.setBUserId(getUser().getId()); | |||||
| // record.setOrderId(orderId); | |||||
| WxPayOrder po = wxPayOrderService.getById(payOrderId); | |||||
| if (null == po) { | |||||
| return new ResultData(ErrorCode.PAY_ORDER_NOT_FOUND); | |||||
| } | |||||
| //record.setPayVendor(po.getPayVendor()); | |||||
| try { | try { | ||||
| return wxPayOrderService.payOrderReverse(record); | |||||
| return wxPayOrderService.payOrderReverse(po); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("payment wechat, order query error, req 2: " + record.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order query error, req 2: " + po.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("payment wechat, order query error, req 3: " + record.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order query error, req 3: " + po.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| @@ -311,7 +317,7 @@ public class WxMicroPayController extends BaseController { | |||||
| } | } | ||||
| // 获取C用户 | // 获取C用户 | ||||
| WxCUser cUser = null; | |||||
| WxCUserBasicInfo cUser = null; | |||||
| if (StringUtils.isNotBlank(cUserIdStr)) { | if (StringUtils.isNotBlank(cUserIdStr)) { | ||||
| Long cUserId = 0L; | Long cUserId = 0L; | ||||
| try { | try { | ||||
| @@ -321,12 +327,9 @@ public class WxMicroPayController extends BaseController { | |||||
| logger.error("cUserId参数不正确: " + paramMap.toString()); | logger.error("cUserId参数不正确: " + paramMap.toString()); | ||||
| return new ResultData(ErrorCode.SYS_CLASSCAST_ERROR); | return new ResultData(ErrorCode.SYS_CLASSCAST_ERROR); | ||||
| } | } | ||||
| cUser = wxCUserService.getById(cUserId); | |||||
| cUser = wxCUserBasicInfoService.getById(cUserId); | |||||
| } else { | } else { | ||||
| WxCUser userQ = new WxCUser(); | |||||
| userQ.updateTenantInfo(user); | |||||
| userQ.setPhone(phone); | |||||
| cUser = wxCUserService.getByObject(userQ); | |||||
| cUser = wxCUserBasicInfoService.findInfoByPhone(user,phone); | |||||
| } | } | ||||
| if (cUser == null) { | if (cUser == null) { | ||||
| logger.error("cUser不存在: " + cUserIdStr); | logger.error("cUser不存在: " + cUserIdStr); | ||||
| @@ -342,12 +345,13 @@ public class WxMicroPayController extends BaseController { | |||||
| WxOrder order = null; | WxOrder order = null; | ||||
| try { | try { | ||||
| order = wxOrderService.saveMicroPayOrderV2(user, cUser, payment); | order = wxOrderService.saveMicroPayOrderV2(user, cUser, payment); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("saveMicopayOrder 1" + e.getMessage()); | |||||
| logger.error("saveMicopayOrder 1" + e.getMessage(),e); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("saveMicopayOrder 2" + e.getMessage()); | |||||
| logger.error("saveMicopayOrder 2" + e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.ORDER_IS_FAIL, e.getMessage()); | return new ResultData(ErrorCode.ORDER_IS_FAIL, e.getMessage()); | ||||
| } | } | ||||
| @@ -372,12 +376,16 @@ public class WxMicroPayController extends BaseController { | |||||
| @PostMapping("pay_order_create_v2") | @PostMapping("pay_order_create_v2") | ||||
| public ResultData saveMicopayPayOrder(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { | public ResultData saveMicopayPayOrder(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { | ||||
| logger.info("saveMicopayPayOrder: " + paramMap.toString()); | logger.info("saveMicopayPayOrder: " + paramMap.toString()); | ||||
| WxMerchantBUser user = getUser(); | |||||
| String orderIdStr = paramMap.get("orderId"); | String orderIdStr = paramMap.get("orderId"); | ||||
| String couponOrderIdStr = paramMap.get("couponOrderId"); | String couponOrderIdStr = paramMap.get("couponOrderId"); | ||||
| String authCode = paramMap.get("authCode"); | String authCode = paramMap.get("authCode"); | ||||
| String payPriceStr = paramMap.get("payPrice"); | String payPriceStr = paramMap.get("payPrice"); | ||||
| return saveMicopayPayOrder(orderIdStr, couponOrderIdStr, authCode, payPriceStr, EnumPayWay.PAY_WAY_WECHAT_MA, request); | |||||
| } | |||||
| private ResultData saveMicopayPayOrder(String orderIdStr,String couponOrderIdStr,String authCode,String payPriceStr, | |||||
| EnumPayWay payWay, HttpServletRequest request) { | |||||
| WxMerchantBUser user = getUser(); | |||||
| if (StringUtils.isBlank(orderIdStr)) { | if (StringUtils.isBlank(orderIdStr)) { | ||||
| logger.error("orderId不能为空"); | logger.error("orderId不能为空"); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | ||||
| @@ -413,7 +421,7 @@ public class WxMicroPayController extends BaseController { | |||||
| orderId = Long.valueOf(orderIdStr); | orderId = Long.valueOf(orderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| orderId = 0L; | orderId = 0L; | ||||
| logger.error("orderId参数不正确: " + paramMap.toString()); | |||||
| logger.error("orderId参数不正确: " + orderIdStr); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| @@ -428,7 +436,7 @@ public class WxMicroPayController extends BaseController { | |||||
| couponOrderId = Long.valueOf(couponOrderIdStr); | couponOrderId = Long.valueOf(couponOrderIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| couponOrderId = 0L; | couponOrderId = 0L; | ||||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | |||||
| logger.error("couponOrderId参数不正确: " + couponOrderIdStr); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| wxCouponOrder = wxCouponOrderService.getById(couponOrderId); | wxCouponOrder = wxCouponOrderService.getById(couponOrderId); | ||||
| @@ -438,18 +446,19 @@ public class WxMicroPayController extends BaseController { | |||||
| Integer remainPrice = payPrice; | Integer remainPrice = payPrice; | ||||
| if (wxCouponOrder != null) { | if (wxCouponOrder != null) { | ||||
| try { | try { | ||||
| couponPayOrder = wxCouponOrderService.microPayPreVerify(microOrder, wxCouponOrder, wxMerchantBUser, payPrice); | |||||
| remainPrice = microOrder.getPayment() - couponPayOrder.getPayAmount(); | |||||
| couponPayOrder = wxCouponOrderService.microPayPreVerify(microOrder, wxCouponOrder, wxMerchantBUser, payPrice,payWay,ipStr,authCode); | |||||
| //remainPrice = microOrder.getPayment() - couponPayOrder.getPayAmount(); | |||||
| remainPrice = couponPayOrder.getPayAmount(); | |||||
| // 更新实际支付金额 | // 更新实际支付金额 | ||||
| WxOrder updateOrder = new WxOrder(); | WxOrder updateOrder = new WxOrder(); | ||||
| updateOrder.setId(microOrder.getId()); | updateOrder.setId(microOrder.getId()); | ||||
| updateOrder.setPayment(remainPrice); | updateOrder.setPayment(remainPrice); | ||||
| wxOrderService.saveOrUpdate(updateOrder); | wxOrderService.saveOrUpdate(updateOrder); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("核销异常: " + e.getMessage()); | |||||
| logger.error("核销异常: " + e.getMessage(),e); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("核销异常: " + e.getMessage()); | |||||
| logger.error("核销异常: " + e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.VERIFY_ERROR, e.getMessage()); | return new ResultData(ErrorCode.VERIFY_ERROR, e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| @@ -464,41 +473,48 @@ public class WxMicroPayController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "authCode不符合规则"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "authCode不符合规则"); | ||||
| } | } | ||||
| WxPayOrder record = new WxPayOrder(); | |||||
| record.updateTenantInfo(user); | |||||
| record.setOrderId(microOrder.getId()); | |||||
| record.setCUserId(microOrder.getCUserId()); | |||||
| record.setAuthCode(authCode); | |||||
| record.setPayAmount(remainPrice); | |||||
| record.setIp(ipStr); | |||||
| // WxPayOrder record = new WxPayOrder(); | |||||
| // record.updateTenantInfo(user); | |||||
| // record.setOrderId(microOrder.getId()); | |||||
| // record.setCUserId(microOrder.getCUserId()); | |||||
| // record.setAuthCode(authCode); | |||||
| // record.setPayAmount(remainPrice); | |||||
| // record.setIp(ipStr); | |||||
| WxPayOrder qpo = new WxPayOrder(); | |||||
| qpo.setOrderId(microOrder.getId()); | |||||
| WxPayOrder po = wxPayOrderService.getByObj(qpo); | |||||
| if (null == po) { | |||||
| return new ResultData(ErrorCode.PAY_ORDER_NOT_FOUND); | |||||
| } | |||||
| try { | try { | ||||
| return wxPayOrderService.createMicroPayOrder(user, record, EnumPayWay.PAY_WAY_WECHAT); | |||||
| return wxPayOrderService.createMicroPayOrder(user, po, payWay, null); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order create error, req 2: " + po.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("payment wechat, order create error, req 3: " + record.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order create error, req 3: " + po.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | ||||
| } | } | ||||
| } else { | } else { | ||||
| // 支付完成 | // 支付完成 | ||||
| couponPayOrder.setIp(ipStr); | couponPayOrder.setIp(ipStr); | ||||
| try { | try { | ||||
| wxPayOrderService.handleMicroOrderPaySuccessForVerify(user, couponPayOrder); | |||||
| wxPayOrderService.handleMicroOrderPaySuccessForVerify(user, couponPayOrder,payWay); | |||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| map.put("end", "1"); | map.put("end", "1"); | ||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("payment wechat, order create error, req 2: " + couponPayOrder.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order create error, req 2: " + couponPayOrder.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("payment wechat, order create error, req 3: " + couponPayOrder.toString() + ", e:" + e.getMessage()); | |||||
| logger.error("payment wechat, order create error, req 3: " + couponPayOrder.toString() + ", e:" + e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| private Boolean checkAuthCode(String authCode) { | private Boolean checkAuthCode(String authCode) { | ||||
| if (authCode.length() == 18) { | if (authCode.length() == 18) { | ||||
| String head = authCode.substring(0, 2); | String head = authCode.substring(0, 2); | ||||
| @@ -86,6 +86,30 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| if ("wx_user_channel".equals(tableName)) { | if ("wx_user_channel".equals(tableName)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if ("wx_score_rules".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_level_config".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_c_user_basic_info".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_credit_history".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_score_history".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_c_user_tags".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_weapp_ext_set".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_msg_validationcode_model".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| // wx_profit_sharing_receiver | // wx_profit_sharing_receiver | ||||
| // wx_profit_sharing_result | // wx_profit_sharing_result | ||||
| return false; | return false; | ||||
| @@ -150,6 +174,9 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| if ("wx_weapp_release_status".equals(tableName)) { | if ("wx_weapp_release_status".equals(tableName)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if ("mem_coupon_from_dsp".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -62,8 +62,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -57,8 +57,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -4,7 +4,8 @@ package com.iformall.aop; | |||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.iformall.annotation.RedisCache; | import com.iformall.annotation.RedisCache; | ||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.service.WxCUserTokenService; | |||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.service.CUserTokenService; | |||||
| import com.iformall.utils.HashUtil; | import com.iformall.utils.HashUtil; | ||||
| import com.iformall.utils.RedisLock; | import com.iformall.utils.RedisLock; | ||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
| @@ -48,7 +49,7 @@ public class RedisCacheAspect { | |||||
| RedisLock redisLock; | RedisLock redisLock; | ||||
| @Autowired | @Autowired | ||||
| private WxCUserTokenService userTokenService; | |||||
| private CUserTokenService cUserTokenService; | |||||
| @Pointcut("@annotation(com.iformall.annotation.RedisCache)") | @Pointcut("@annotation(com.iformall.annotation.RedisCache)") | ||||
| public void cacheAspect() { | public void cacheAspect() { | ||||
| @@ -66,14 +67,14 @@ public class RedisCacheAspect { | |||||
| } | } | ||||
| log.info("token>>>>>>>>>>>>>>>"+token); | log.info("token>>>>>>>>>>>>>>>"+token); | ||||
| String tenantId; | String tenantId; | ||||
| WxCUser wxCUser = null ; | |||||
| BaseCUserEntity cUser = null ; | |||||
| if(StringUtils.isNotBlank(token)) { | if(StringUtils.isNotBlank(token)) { | ||||
| wxCUser = userTokenService.getByToken(token); | |||||
| cUser = cUserTokenService.getByToken(token); | |||||
| } | } | ||||
| if (Objects.isNull(wxCUser) || wxCUser.getExpireTime().getTime() < System.currentTimeMillis()) { | |||||
| if (Objects.isNull(cUser) || cUser.getExpireTime().getTime() < System.currentTimeMillis()) { | |||||
| tenantId = "0"; | tenantId = "0"; | ||||
| } else { | } else { | ||||
| tenantId = wxCUser.getTenantId(); | |||||
| tenantId = cUser.getTenantId(); | |||||
| } | } | ||||
| // 请求参数 | // 请求参数 | ||||
| @@ -2,6 +2,7 @@ package com.iformall.config; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -107,6 +108,40 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("baseCUserTokenRedisTemplate") | |||||
| public RedisTemplate<String, BaseCUserEntity> getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, BaseCUserEntity> template = new RedisTemplate<String, BaseCUserEntity>(); | |||||
| Jackson2JsonRedisSerializer<BaseCUserEntity> j = new Jackson2JsonRedisSerializer<BaseCUserEntity>(BaseCUserEntity.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("cUserBasicInfoRedisTemplate") | |||||
| public RedisTemplate<String, WxCUserBasicInfo> getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxCUserBasicInfo> template = new RedisTemplate<String, WxCUserBasicInfo>(); | |||||
| Jackson2JsonRedisSerializer<WxCUserBasicInfo> j = new Jackson2JsonRedisSerializer<WxCUserBasicInfo>(WxCUserBasicInfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("mallRedisTemplate") | @Bean("mallRedisTemplate") | ||||
| public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | ||||
| RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | ||||
| @@ -2,6 +2,8 @@ package com.iformall.controller; | |||||
| import cn.binarywang.wx.miniapp.api.WxMaService; | import cn.binarywang.wx.miniapp.api.WxMaService; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| @@ -16,6 +18,8 @@ import com.iformall.utils.IPUtil; | |||||
| import com.iformall.utils.MaUtil; | import com.iformall.utils.MaUtil; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.beans.factory.annotation.Qualifier; | |||||
| import org.springframework.data.redis.core.RedisTemplate; | |||||
| import org.springframework.web.bind.WebDataBinder; | import org.springframework.web.bind.WebDataBinder; | ||||
| import org.springframework.web.bind.annotation.InitBinder; | import org.springframework.web.bind.annotation.InitBinder; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| @@ -27,8 +31,6 @@ import java.beans.PropertyEditorSupport; | |||||
| import java.text.ParseException; | import java.text.ParseException; | ||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | |||||
| import java.util.Objects; | |||||
| @RestController | @RestController | ||||
| public class BaseController { | public class BaseController { | ||||
| @@ -47,6 +49,10 @@ public class BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | private WxCUserBasicInfoService wxCUserBasicInfoService; | ||||
| @Autowired | |||||
| @Qualifier("baseCUserTokenRedisTemplate") | |||||
| RedisTemplate<String, BaseCUserEntity> baseCUserTokenRedisTemplate; | |||||
| @InitBinder | @InitBinder | ||||
| public void InitBinder(WebDataBinder dataBinder) { | public void InitBinder(WebDataBinder dataBinder) { | ||||
| dataBinder.registerCustomEditor(Date.class, new PropertyEditorSupport() { | dataBinder.registerCustomEditor(Date.class, new PropertyEditorSupport() { | ||||
| @@ -93,10 +99,20 @@ public class BaseController { | |||||
| return cUserId; | return cUserId; | ||||
| } | } | ||||
| public Long getMemberId() { | |||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||||
| Long memberId = (Long) request.getAttribute(Constant.LOGIN_MEMBER_KEY); | |||||
| if(memberId == null){ | |||||
| throw new MallinkException(ErrorCode.USER_IS_NOT_MEMBER); | |||||
| } | |||||
| return memberId; | |||||
| } | |||||
| /** | /** | ||||
| * 微信端获取当前用户 wx_c_user,非会员 | |||||
| * 请尽量多用getTenantId, getUserId | * 请尽量多用getTenantId, getUserId | ||||
| */ | */ | ||||
| public WxCUser getUser() { | |||||
| public WxCUser getWxCUser() { | |||||
| Long cUserId = getUserId(); | Long cUserId = getUserId(); | ||||
| WxCUser user = wxCUserService.getById(cUserId); | WxCUser user = wxCUserService.getById(cUserId); | ||||
| if (user == null) { | if (user == null) { | ||||
| @@ -112,6 +128,18 @@ public class BaseController { | |||||
| return user; | return user; | ||||
| } | } | ||||
| /** | |||||
| * | |||||
| */ | |||||
| public WxCUserBasicInfo getMember() { | |||||
| Long memberId = getMemberId(); | |||||
| WxCUserBasicInfo member = wxCUserBasicInfoService.getById(memberId); | |||||
| if (member == null) { | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||||
| } | |||||
| return member; | |||||
| } | |||||
| public WxAppinfo getAppInfo(String appId) { | public WxAppinfo getAppInfo(String appId) { | ||||
| return wxAppinfoService.getByAppId(appId); | return wxAppinfoService.getByAppId(appId); | ||||
| } | } | ||||
| @@ -139,48 +167,65 @@ public class BaseController { | |||||
| } | } | ||||
| public void saveToBasicInfo(WxCUser user) { | |||||
| public Long saveToBasicInfoByCUser(String userPhone,String userName,String avatarUrl,Integer sex,Long userId) { | |||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| String phone = user.getPhone(); | |||||
| if (phone != null && phone.contains("*")) { | |||||
| phone = user.getVerifyCodePhone(); | |||||
| if (StringUtils.isBlank(userPhone)) | |||||
| return null; | |||||
| WxCUserBasicInfo byId = null; | |||||
| if (null != userId) { | |||||
| byId = wxCUserBasicInfoService.getById(userId); | |||||
| } | } | ||||
| if (StringUtils.isBlank(phone)) | |||||
| return; | |||||
| List<WxCUserBasicInfo> list = wxCUserBasicInfoService.findByPhone(tenantEntity, phone); | |||||
| if (list.size() > 0) { | |||||
| WxCUserBasicInfo basicInfo = list.get(0); | |||||
| // 微信名称,统一成微信昵称 | |||||
| if (!Objects.equals(basicInfo.getNickName(), user.getNickName())) { | |||||
| basicInfo.setNickName(user.getNickName()); | |||||
| } | |||||
| // 性别 | |||||
| if (basicInfo.getSex() == null) { | |||||
| basicInfo.setSex(user.getGender()); | |||||
| } | |||||
| // 成长值 | |||||
| if (Objects.nonNull(user.getScore())) { | |||||
| basicInfo.setPoins(user.getScore()); | |||||
| } | |||||
| // 积分 | |||||
| if (Objects.nonNull(user.getCredit())) { | |||||
| basicInfo.setCredit(user.getCredit()); | |||||
| // List<WxCUserBasicInfo> list = wxCUserBasicInfoService.findByPhone(tenantEntity, phone); | |||||
| WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(tenantEntity, userPhone); | |||||
| if (basicInfo != null) { | |||||
| if(byId != null && !byId.getPhone().equals(basicInfo.getPhone())){ | |||||
| return Long.valueOf(-1); | |||||
| } | } | ||||
| wxCUserBasicInfoService.updateObj(basicInfo, user); | |||||
| } else { | |||||
| // WxCUserBasicInfo basicInfo = list.get(0); | |||||
| // 微信名称,统一成微信昵称 | |||||
| // if (!Objects.equals(basicInfo.getNickName(), user.getNickName())) { | |||||
| // basicInfo.setNickName(user.getNickName()); | |||||
| // } | |||||
| // // 性别 | |||||
| // if (basicInfo.getSex() == null) { | |||||
| // basicInfo.setSex(user.getGender()); | |||||
| // } | |||||
| // // 成长值 | |||||
| // if (Objects.nonNull(user.getScore())) { | |||||
| // basicInfo.setPoins(user.getScore()); | |||||
| // } | |||||
| // // 积分 | |||||
| // if (Objects.nonNull(user.getCredit())) { | |||||
| // basicInfo.setCredit(user.getCredit()); | |||||
| // } | |||||
| //wxCUserBasicInfoService.updateObj(basicInfo, user); | |||||
| return basicInfo.getId(); | |||||
| } else if(byId != null){ | |||||
| byId.setPhone(userPhone); | |||||
| byId.setNickName(userName); | |||||
| byId.setAvatarUrl(avatarUrl); | |||||
| byId.setSex(sex); | |||||
| wxCUserBasicInfoService.update(byId); | |||||
| return byId.getId(); | |||||
| }else{ | |||||
| Date cur = new Date(); | Date cur = new Date(); | ||||
| WxCUserBasicInfo basicInfo = new WxCUserBasicInfo(); | |||||
| basicInfo.setId(user.getId()); | |||||
| basicInfo.updateTenantInfo(tenantEntity); | |||||
| basicInfo.setPhone(phone); | |||||
| basicInfo.setNickName(user.getNickName()); | |||||
| basicInfo.setSex(user.getGender()); | |||||
| basicInfo.setPoins(user.getScore()); | |||||
| basicInfo = new WxCUserBasicInfo(); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| basicInfo.setId(idWorker.nextId()); | |||||
| basicInfo.undateFinalTenantId(tenantEntity); | |||||
| basicInfo.setPhone(userPhone); | |||||
| basicInfo.setNickName(userName); | |||||
| basicInfo.setAvatarUrl(avatarUrl); | |||||
| basicInfo.setSex(sex); | |||||
| basicInfo.setLoginCount(1); | |||||
| basicInfo.setActiveTime(cur); | |||||
| basicInfo.setCreateDate(cur); | basicInfo.setCreateDate(cur); | ||||
| basicInfo.setUpdateDate(cur); | basicInfo.setUpdateDate(cur); | ||||
| basicInfo.setCredit(user.getCredit()); | |||||
| wxCUserBasicInfoService.save(basicInfo); | wxCUserBasicInfoService.save(basicInfo); | ||||
| return basicInfo.getId(); | |||||
| } | } | ||||
| } | } | ||||
| @@ -189,4 +234,6 @@ public class BaseController { | |||||
| String ipaddress = IPUtil.getIpAddr(request); | String ipaddress = IPUtil.getIpAddr(request); | ||||
| return ipaddress; | return ipaddress; | ||||
| } | } | ||||
| } | } | ||||
| @@ -35,7 +35,7 @@ public class WxActivityController extends BaseController { | |||||
| @GetMapping("/queryStatus") | @GetMapping("/queryStatus") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData queryStatus(Long id) { | public ResultData queryStatus(Long id) { | ||||
| return new ResultData(wxActivityService.queryStatus(id, getUserId())); | |||||
| return new ResultData(wxActivityService.queryStatus(id, getMemberId())); | |||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | @ApiOperation("根据id查询接口") | ||||
| @@ -43,7 +43,7 @@ public class WxActivityController extends BaseController { | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| WxActivity wxActivity = wxActivityService.getById(id); | WxActivity wxActivity = wxActivityService.getById(id); | ||||
| Integer status = wxActivityService.queryStatus(id, getUserId()); | |||||
| Integer status = wxActivityService.queryStatus(id, getMemberId()); | |||||
| Map<String, Object> data = new HashMap<>(); | Map<String, Object> data = new HashMap<>(); | ||||
| data.put("activity", wxActivity); | data.put("activity", wxActivity); | ||||
| data.put("status", status); | data.put("status", status); | ||||
| @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.WxActivity; | import com.iformall.domain.po.WxActivity; | ||||
| import com.iformall.domain.po.WxActivityJoin; | import com.iformall.domain.po.WxActivityJoin; | ||||
| @@ -41,9 +42,11 @@ public class WxActivityJoinController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData list(@ModelAttribute WxActivityJoin wxActivityJoin, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxActivityJoin wxActivityJoin, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxActivityJoin) wxActivityJoin = new WxActivityJoin(); | |||||
| if (null == wxActivityJoin) { | |||||
| wxActivityJoin = new WxActivityJoin(); | |||||
| } | |||||
| wxActivityJoin.updateTenantInfo(getTenantInfo()); | wxActivityJoin.updateTenantInfo(getTenantInfo()); | ||||
| wxActivityJoin.setUserId(getUserId()); | |||||
| wxActivityJoin.setUserId(getMemberId()); | |||||
| wxActivityJoin.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | wxActivityJoin.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | ||||
| final PageInfo<WxActivity> page = wxActivityJoinService.clistAsPage(wxActivityJoin, pageNum, pageSize); | final PageInfo<WxActivity> page = wxActivityJoinService.clistAsPage(wxActivityJoin, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -55,9 +58,10 @@ public class WxActivityJoinController extends BaseController { | |||||
| if (wxActivityJoin.getActivityId() == null) { | if (wxActivityJoin.getActivityId() == null) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "activityId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "activityId不能为空"); | ||||
| } | } | ||||
| WxCUserBasicInfo member = getMember(); | |||||
| wxActivityJoin.updateTenantInfo(getTenantInfo()); | wxActivityJoin.updateTenantInfo(getTenantInfo()); | ||||
| wxActivityJoin.setUserId(getUserId()); | |||||
| wxActivityJoin.setNickName(getUser().getNickName()); | |||||
| wxActivityJoin.setUserId(member.getId()); | |||||
| wxActivityJoin.setNickName(member.getNickName()); | |||||
| if (StringUtils.isNotEmpty(wxActivityJoin.getAnswer())) { | if (StringUtils.isNotEmpty(wxActivityJoin.getAnswer())) { | ||||
| List<WxActivityJoinQuestionAnswer> wxActivityJoinQuestionAnswers = JSONArray.parseArray(wxActivityJoin.getAnswer(), WxActivityJoinQuestionAnswer.class); | List<WxActivityJoinQuestionAnswer> wxActivityJoinQuestionAnswers = JSONArray.parseArray(wxActivityJoin.getAnswer(), WxActivityJoinQuestionAnswer.class); | ||||
| List<WxActivityJoinQuestionAnswer> collect = wxActivityJoinQuestionAnswers.stream().filter(answer -> answer != null).collect(Collectors.toList()); | List<WxActivityJoinQuestionAnswer> collect = wxActivityJoinQuestionAnswers.stream().filter(answer -> answer != null).collect(Collectors.toList()); | ||||
| @@ -78,7 +82,7 @@ public class WxActivityJoinController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "activityId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "activityId不能为空"); | ||||
| } | } | ||||
| wxActivityJoin.updateTenantInfo(getTenantInfo()); | wxActivityJoin.updateTenantInfo(getTenantInfo()); | ||||
| wxActivityJoin.setUserId(getUserId()); | |||||
| wxActivityJoin.setUserId(getMemberId()); | |||||
| return wxActivityJoinService.sign(wxActivityJoin); | return wxActivityJoinService.sign(wxActivityJoin); | ||||
| } | } | ||||
| @@ -11,6 +11,7 @@ import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import com.iformall.enums.EnumCampaignStatus; | import com.iformall.enums.EnumCampaignStatus; | ||||
| import com.iformall.enums.EnumCouponChannelType; | import com.iformall.enums.EnumCouponChannelType; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.WxCampaignService; | import com.iformall.service.WxCampaignService; | ||||
| import com.iformall.service.WxCouponChannelService; | import com.iformall.service.WxCouponChannelService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| @@ -78,7 +79,7 @@ public class WxCampaignController extends BaseController { | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "sourceId", value = "", dataType = "Long", paramType = "query", required = true), | @ApiImplicitParam(name = "sourceId", value = "", dataType = "Long", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "targetId", value = "", dataType = "Long", paramType = "query", required = true)}) | @ApiImplicitParam(name = "targetId", value = "", dataType = "Long", paramType = "query", required = true)}) | ||||
| public ResultData move(Long sourceId, Long targetId) { | |||||
| public ResultData move(Long sourceId, Long targetId,EnumPayWay payWay) { | |||||
| WxCampaign source = wxCampaignService.getById(sourceId); | WxCampaign source = wxCampaignService.getById(sourceId); | ||||
| WxCampaign target = wxCampaignService.getById(targetId); | WxCampaign target = wxCampaignService.getById(targetId); | ||||
| if (source == null || target == null) { | if (source == null || target == null) { | ||||
| @@ -15,6 +15,9 @@ import com.iformall.domain.vo.WxMerchantVo; | |||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.park.ParkFactory; | |||||
| import com.iformall.service.park.impl.etcp.EtcpHelper; | |||||
| import com.iformall.service.park.impl.util.ParkHelper; | |||||
| import com.iformall.utils.car.*; | import com.iformall.utils.car.*; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -37,12 +40,6 @@ import java.util.Map; | |||||
| public class WxCarController extends BaseController { | public class WxCarController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| ETCPUtil etcp = new ETCPUtil(); | |||||
| TJDUtil tjd = new TJDUtil(); | |||||
| CYFUtil cyf = new CYFUtil(); | |||||
| @Autowired | @Autowired | ||||
| WxParkService wxParkService; | WxParkService wxParkService; | ||||
| @@ -70,12 +67,22 @@ public class WxCarController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxCreditHistoryService wxCreditHistoryService; | WxCreditHistoryService wxCreditHistoryService; | ||||
| @Autowired | |||||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Autowired | |||||
| ParkFactory parkFactory; | |||||
| @Autowired | |||||
| ParkHelper parkHelper; | |||||
| @Autowired | |||||
| EtcpHelper etcpHelper; | |||||
| private WxPark getCurrentPark(TenantEntity tenantEntity) { | private WxPark getCurrentPark(TenantEntity tenantEntity) { | ||||
| WxPark parkQ = new WxPark(); | WxPark parkQ = new WxPark(); | ||||
| parkQ.updateTenantInfo(tenantEntity); | parkQ.updateTenantInfo(tenantEntity); | ||||
| WxPark wxPark = wxParkService.getByObj(parkQ); | WxPark wxPark = wxParkService.getByObj(parkQ); | ||||
| // 1, get mall's park | |||||
| // future use redis to optimize | |||||
| return wxPark; | return wxPark; | ||||
| } | } | ||||
| @@ -98,152 +105,28 @@ public class WxCarController extends BaseController { | |||||
| @ApiOperation(value = "初始化/etcp共同登录", notes = "{\"phone\":\"string\"}") | @ApiOperation(value = "初始化/etcp共同登录", notes = "{\"phone\":\"string\"}") | ||||
| @PostMapping("/init") | @PostMapping("/init") | ||||
| public ResultData init(@RequestBody Map<String, String> paramMap) { | public ResultData init(@RequestBody Map<String, String> paramMap) { | ||||
| WxCUser user = getUser(); | |||||
| // 1, get mall's park | // 1, get mall's park | ||||
| WxPark park = getCurrentPark(getTenantInfo()); | WxPark park = getCurrentPark(getTenantInfo()); | ||||
| // 2. get vendor params | // 2. get vendor params | ||||
| if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | ||||
| return initForEtcp(paramMap, user, park); | |||||
| } else if (park.getVendorType().equals(EnumCarVendor.CAR_TJD.getCode()) || | |||||
| park.getVendorType().equals(EnumCarVendor.CAR_DAHUA.getCode()) || | |||||
| park.getVendorType().equals(EnumCarVendor.CAR_SHANGAN.getCode()) || | |||||
| park.getVendorType().equals(EnumCarVendor.CAR_BOLINK.getCode())) { | |||||
| Map resultMap = new HashMap(); | |||||
| resultMap.put("vendor", park.getVendorType()); | |||||
| return new ResultData(resultMap); | |||||
| } | |||||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "登录失败"); | |||||
| } | |||||
| private ResultData initForEtcp(Map<String, String> paramMap, WxCUser user, WxPark park) { | |||||
| String phone = paramMap.get("phone"); | |||||
| if (StringUtils.isBlank(phone) && StringUtils.isBlank(user.getPhone()) && StringUtils.isBlank(user.getVerifyCodePhone())) { | |||||
| logger.error("手机号为空,请授权手机号"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "手机号为空,请授权手机号"); | |||||
| } | |||||
| if (!StringUtils.isBlank(user.getPhone()) && !user.getPhone().contains("*")) { | |||||
| phone = user.getPhone(); | |||||
| } else { | |||||
| phone = user.getVerifyCodePhone(); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString("url"); | |||||
| String appId = objParams.getString("appId"); | |||||
| String merchantNo = objParams.getString("merchantNo"); | |||||
| String merchantKey = objParams.getString("merchantKey"); | |||||
| String version = objParams.getString("version"); | |||||
| String ret = ""; | |||||
| try { | |||||
| ret = etcp.userSignin(url, appId, merchantNo, merchantKey, version, phone); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("ETCP failed: " + e.getMessage()); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getIntValue("code") == EnumETCPCode.SUCCESS.getCode()) { | |||||
| // 获取绑定的车牌 | |||||
| JSONObject dataObj = retObj.getJSONObject("data"); | |||||
| dataObj.put("vendor", EnumCarVendor.CAR_ETCP.getCode()); | |||||
| String etcpToken = dataObj.getString("token"); | |||||
| try { | |||||
| JSONObject dataObj1 = etcpSyncCarNumbers(park, user.getId(), park.getVendorType(), | |||||
| url, merchantNo, merchantKey, version, | |||||
| etcpToken); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("ETCP cmd error: " + e.getMessage()); | |||||
| } | |||||
| // c端必须保存此token | |||||
| return new ResultData(dataObj); | |||||
| } else { | |||||
| logger.error("共同登录失败: " + phone); | |||||
| return new ResultData(ErrorCode.ETCP_LOGIN_FAIL.getCode(), "共同登录失败"); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * ETCP同步 | |||||
| * | |||||
| * @param tenantEntity | |||||
| * @param cUserId | |||||
| * @param iVendorType | |||||
| * @param url | |||||
| * @param merchantNo | |||||
| * @param merchantKey | |||||
| * @param version | |||||
| * @param etcpToken | |||||
| * @return | |||||
| */ | |||||
| private JSONObject etcpSyncCarNumbers(TenantEntity tenantEntity, Long cUserId, int iVendorType, | |||||
| String url, String merchantNo, String merchantKey, String version, | |||||
| String etcpToken) { | |||||
| String ret; | |||||
| JSONObject retObj; | |||||
| /*{"code": 0,"msg": "ok","data": {"number": 3,"carList": ["晋 BMZ105","云 C12345"]}} */ | |||||
| try { | |||||
| ret = etcp.carNum(url, merchantNo, merchantKey, version, etcpToken); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("ETCP failed: " + e.getMessage()); | |||||
| throw new MallinkException(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| retObj = JSON.parseObject(ret); | |||||
| JSONObject dataObj1 = retObj.getJSONObject("data"); | |||||
| dataObj1.put("vendor", iVendorType); | |||||
| JSONArray arr = dataObj1.getJSONArray("carList"); | |||||
| WxCUserCar queryUserCar = new WxCUserCar(); | |||||
| queryUserCar.setCUserId(cUserId); | |||||
| List<WxCUserCar> uclist = wxCUserCarService.getList(queryUserCar); | |||||
| // 删除ETCP不存在 | |||||
| for (WxCUserCar userCar : uclist) { | |||||
| boolean bExist = isExistInArray(arr, userCar.getCarNumber()); | |||||
| if (!bExist) { | |||||
| wxCUserCarService.deleteById(userCar.getId()); | |||||
| uclist.remove(userCar); | |||||
| } | |||||
| } | |||||
| // 添加ETCP的 | |||||
| for (int i = 0; i < arr.size(); i++) { | |||||
| String _carNum = arr.getString(i); | |||||
| boolean bExist = isExistInList(uclist, _carNum); | |||||
| if (!bExist) { | |||||
| Date curr = new Date(); | |||||
| WxCUserCar userCar = new WxCUserCar(); | |||||
| userCar.setCUserId(cUserId); | |||||
| userCar.updateTenantInfo(tenantEntity); | |||||
| userCar.setCarNumber(_carNum); | |||||
| userCar.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | |||||
| userCar.setCreateDate(curr); | |||||
| userCar.setUpdateDate(curr); | |||||
| wxCUserCarService.saveOrUpdate(userCar); | |||||
| } | |||||
| } | |||||
| return dataObj1; | |||||
| } | |||||
| private boolean isExistInArray(JSONArray arr, String carNumber) { | |||||
| boolean bExist = false; | |||||
| for (int i = 0; i < arr.size(); i++) { | |||||
| // check carNum+cUserId是否存在, 不存在新建 | |||||
| String _carNum = arr.getString(i); | |||||
| if (carNumber.equals(_carNum)) { | |||||
| bExist = true; | |||||
| break; | |||||
| } | |||||
| } | |||||
| return bExist; | |||||
| } | |||||
| private boolean isExistInList(List<WxCUserCar> list, String carNumber) { | |||||
| boolean bExist = false; | |||||
| for (WxCUserCar userCar : list) { | |||||
| if (carNumber.equals(userCar.getCarNumber())) { | |||||
| bExist = true; | |||||
| break; | |||||
| } | |||||
| } | |||||
| return bExist; | |||||
| return etcpHelper.initForEtcp(paramMap, getMemberId(), park); | |||||
| }else { | |||||
| try { | |||||
| String vendorPersonId = parkFactory.getParkService(park.getVendorType()).initLogin(paramMap, park, getMember()); | |||||
| Map resultMap = new HashMap(); | |||||
| resultMap.put("vendor", park.getVendorType()); | |||||
| //有的厂家没有初始化 | |||||
| if (!StringUtils.isBlank(vendorPersonId)) { | |||||
| resultMap.put("vendorPersonId", vendorPersonId); | |||||
| } | |||||
| return new ResultData(resultMap); | |||||
| } catch (Exception e) { | |||||
| logger.error("park init error",e); | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| } | |||||
| //return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "登录失败"); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -255,197 +138,30 @@ public class WxCarController extends BaseController { | |||||
| @ApiOperation(value = "绑车牌", notes = "ETCP:={\"etcpToken\":\"string\",\"carNumber\":\"string\"}, TJD:={\"carNumber\":\"string\"}") | @ApiOperation(value = "绑车牌", notes = "ETCP:={\"etcpToken\":\"string\",\"carNumber\":\"string\"}, TJD:={\"carNumber\":\"string\"}") | ||||
| @PostMapping("/bindCar") | @PostMapping("/bindCar") | ||||
| public ResultData bindCar(@RequestBody Map<String, String> paramMap) { | public ResultData bindCar(@RequestBody Map<String, String> paramMap) { | ||||
| WxCUserBasicInfo member = getMember(); | |||||
| // 1, get mall's park | // 1, get mall's park | ||||
| WxPark park = getCurrentPark(getTenantInfo()); | WxPark park = getCurrentPark(getTenantInfo()); | ||||
| // 2. get vendor params | // 2. get vendor params | ||||
| if (park.getVendorType() == EnumCarVendor.CAR_ETCP.getCode()) { | if (park.getVendorType() == EnumCarVendor.CAR_ETCP.getCode()) { | ||||
| return etcpBindCar(paramMap, park, getUserId()); | |||||
| } else if (park.getVendorType() == EnumCarVendor.CAE_CYF.getCode()){ | |||||
| return cyfBindCar(paramMap,park,getUser()); | |||||
| } else { | |||||
| // 内部操作 | |||||
| return bindCar(paramMap, park, getUserId()); | |||||
| } | |||||
| } | |||||
| private ResultData etcpBindCar(Map<String, String> paramMap, WxPark park, Long cuUserId) { | |||||
| String etcpToken = paramMap.get("etcpToken"); | |||||
| if (StringUtils.isBlank(etcpToken)) { | |||||
| logger.error("etcpToken为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| } | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| logger.error("carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString("url"); | |||||
| String merchantNo = objParams.getString("merchantNo"); | |||||
| String merchantKey = objParams.getString("merchantKey"); | |||||
| String version = objParams.getString("version"); | |||||
| String ret = ""; | |||||
| try { | |||||
| ret = etcp.bindCar(url, merchantNo, merchantKey, version, etcpToken, carNumber, null); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("ETCP failed: " + e.getMessage()); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getIntValue("code") == 0) { | |||||
| addCarInfoToDB(carNumber, EnumCarVendor.CAR_ETCP, park, cuUserId); | |||||
| JSONObject dataObj = retObj.getJSONObject("data"); | |||||
| return new ResultData(dataObj); | |||||
| return etcpHelper.etcpBindCar(paramMap, park, member.getId()); | |||||
| } else { | } else { | ||||
| String message = retObj.getString("message"); | |||||
| logger.error("绑车牌失败: " + carNumber); | |||||
| return new ResultData(ErrorCode.ETCP_BIND_FAIL.getCode(), message, retObj); | |||||
| //有的厂家绑定车牌时才会有会员信息 | |||||
| String vendorPersonId; | |||||
| try { | |||||
| vendorPersonId = parkFactory.getParkService(park.getVendorType()).bindCar(paramMap, park, member); | |||||
| if(StringUtils.isBlank(vendorPersonId)) { | |||||
| return new ResultData(Result.ERROR,"厂商会员ID未返回"); | |||||
| } | |||||
| return parkHelper.bindCar(paramMap, park, member.getId(),vendorPersonId); | |||||
| } catch (Exception e) { | |||||
| logger.error("park bindCar error",e); | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| private ResultData bindCar(Map<String, String> paramMap, WxPark park, Long cuUserId) { | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| logger.error("carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| try { | |||||
| addCarInfoToDB(carNumber, EnumCarVendor.getEnum(park.getVendorType()), park, cuUserId); | |||||
| } catch (MallinkException e) { | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(500, e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| private void addCarInfoToDB(String carNumber, EnumCarVendor carVendor, WxPark park, Long cuUserId) { | |||||
| // 插入车牌 | |||||
| Date curr = new Date(); | |||||
| WxCUserCar userCar = new WxCUserCar(); | |||||
| userCar.setCUserId(getUserId()); | |||||
| userCar.updateTenantInfo(park); | |||||
| userCar.setCarNumber(carNumber); | |||||
| userCar.setVendorType(carVendor.getCode()); | |||||
| userCar.setCreateDate(curr); | |||||
| userCar.setUpdateDate(curr); | |||||
| wxCUserCarService.saveOrUpdate(userCar); | |||||
| // 成长值 | |||||
| wxScoreRulesService.addScore(EnumScoreType.BIND_CAR, userCar); | |||||
| //增加积分 | |||||
| addCredit(park, cuUserId); | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_CAR,getUserId()); | |||||
| } | |||||
| private ResultData tjdBindCar(@RequestBody Map<String, String> paramMap, WxPark park, Long cuUserId) { | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| logger.error("carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| String carNumColor = paramMap.get("carNumColor"); | |||||
| //if (StringUtils.isBlank(carNumColor)) { | |||||
| // logger.error("carNumColor为空"); | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumColor为空"); | |||||
| //} | |||||
| Long newCarId = 0L; | |||||
| String outCarId = paramMap.get("outCarId"); | |||||
| if (StringUtils.isBlank(outCarId)) { | |||||
| logger.warn("outCarId为空"); | |||||
| newCarId = wxCUserCarService.getNewCarID(); | |||||
| outCarId = String.valueOf(newCarId); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString("url"); | |||||
| String partner = objParams.getString("partner"); | |||||
| String key = objParams.getString("key"); | |||||
| String version = objParams.getString("version"); | |||||
| String ret = tjd.registerCar(url, partner, key, version, | |||||
| carNumber, carNumColor, null, outCarId); | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| retObj.put("vendor", park.getVendorType()); | |||||
| if (retObj.getString("returnCode").equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) { | |||||
| ResultData e = tjdInsertToDB(carNumber, newCarId, retObj, park, cuUserId); | |||||
| if (e != null) return e; | |||||
| return new ResultData(retObj); | |||||
| } else { | |||||
| return new ResultData(ErrorCode.CAR_BIND_FAIL.getCode(), "绑车牌失败", retObj); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * @description 车易付会员车辆信息注册 | |||||
| * @Params [paramMap, park, wxCUser] | |||||
| * @return com.iformall.common.ResultData | |||||
| * @Author furunxin | |||||
| * @Date 2020/7/8 下午10:23 | |||||
| **/ | |||||
| private ResultData cyfBindCar(@RequestBody Map<String, String> paramMap, WxPark park,WxCUser wxCUser) { | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| logger.error("carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String token = objParams.getString("token"); | |||||
| int feeGroupId = objParams.getIntValue("feeGroupId"); | |||||
| String ret = cyf.registerCar(token,park.getNumber(),feeGroupId,park.getParkingId(),carNumber,wxCUser.getId(),wxCUser.getNickName()); | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getIntValue("result") == 1){ | |||||
| addCarInfoToDB(carNumber, EnumCarVendor.getEnum(park.getVendorType()), park, wxCUser.getId()); | |||||
| }else { | |||||
| return new ResultData(ErrorCode.CAR_BIND_FAIL.getCode(), "绑车牌失败", retObj); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private ResultData tjdInsertToDB(String carNumber, Long newCarId, JSONObject retObj, WxPark park, Long cuUserId) { | |||||
| String carId = retObj.getString("carId"); | |||||
| // 插入车牌 | |||||
| Date curr = new Date(); | |||||
| WxCUserCar userCar = new WxCUserCar(); | |||||
| userCar.setId(newCarId); | |||||
| userCar.setCUserId(cuUserId); | |||||
| userCar.updateTenantInfo(park); | |||||
| userCar.setCarNumber(carNumber); | |||||
| userCar.setVendorType(EnumCarVendor.CAR_TJD.getCode()); | |||||
| JSONObject jo = new JSONObject(); | |||||
| jo.put("carId", carId); | |||||
| userCar.setVendorParams(JSON.toJSONString(jo)); | |||||
| userCar.setCreateDate(curr); | |||||
| userCar.setUpdateDate(curr); | |||||
| try { | |||||
| wxCUserCarService.save(userCar); | |||||
| wxScoreRulesService.addScore(EnumScoreType.BIND_CAR, userCar); | |||||
| //增加积分 | |||||
| addCredit(park, cuUserId); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "TJD保存车牌失败, e:" + e.getMessage()); | |||||
| } | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_CAR, getUserId()); | |||||
| return null; | |||||
| } | |||||
| //-----增加积分start----- | |||||
| private void addCredit(WxPark park, Long cuUserId){ | |||||
| WxCreditHistory wxCreditHistory = new WxCreditHistory(); | |||||
| wxCreditHistory.setCUserId(cuUserId); | |||||
| wxCreditHistory.updateTenantInfo(park); | |||||
| wxCreditHistory.setCreateDate(new Date()); | |||||
| wxCreditHistory.setCreditType(EnumScoreType.BIND_CAR.getCode()); | |||||
| wxCreditHistory.setOperatorType(EnumUserType.CUSER.getCode()); | |||||
| wxCreditHistory.setOperatorId(cuUserId); | |||||
| wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | |||||
| } | |||||
| /** | /** | ||||
| * 解绑车牌 | * 解绑车牌 | ||||
| * | * | ||||
| @@ -463,117 +179,19 @@ public class WxCarController extends BaseController { | |||||
| // 1, get mall's park | // 1, get mall's park | ||||
| WxPark park = getCurrentPark(getTenantInfo()); | WxPark park = getCurrentPark(getTenantInfo()); | ||||
| if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | ||||
| return etcpUnbindCar(paramMap, park, getUserId()); | |||||
| return etcpHelper.etcpUnbindCar(paramMap, park, getMemberId()); | |||||
| } else { | } else { | ||||
| return unbindCar(paramMap, park, getUserId()); | |||||
| } | |||||
| } | |||||
| private ResultData etcpUnbindCar(Map<String, String> paramMap, WxPark park, Long cuUserId) { | |||||
| String etcpToken = paramMap.get("etcpToken"); | |||||
| if (StringUtils.isBlank(etcpToken)) { | |||||
| logger.error("etcpToken为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| } | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| logger.error("carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString("url"); | |||||
| String merchantNo = objParams.getString("merchantNo"); | |||||
| String merchantKey = objParams.getString("merchantKey"); | |||||
| String version = objParams.getString("version"); | |||||
| String ret = ""; | |||||
| try { | |||||
| ret = etcp.unbindCar(url, merchantNo, merchantKey, version, etcpToken, carNumber); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("ETCP failed: " + e.getMessage()); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getIntValue("code") == 0) { | |||||
| try { | try { | ||||
| WxCUserCar userCar = new WxCUserCar(); | |||||
| userCar.setCUserId(cuUserId); | |||||
| userCar.updateTenantInfo(park); | |||||
| userCar.setCarNumber(carNumber); | |||||
| wxCUserCarService.deleteByObj(userCar); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "解绑车牌数据库错误, e:" + e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } else { | |||||
| String message = retObj.getString("message"); | |||||
| logger.error("解绑车牌失败"); | |||||
| return new ResultData(ErrorCode.ETCP_UNBIND_FAIL.getCode(), message, retObj); | |||||
| parkFactory.getParkService(park.getVendorType()).unbindCar(paramMap, park, getMember()); | |||||
| return parkHelper.unbindCar(paramMap, park, getMemberId()); | |||||
| } catch (Exception e) { | |||||
| logger.error("park unbindCar error",e); | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| private ResultData unbindCar(Map<String, String> paramMap, WxPark park, Long cuUserId) { | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| logger.error("carNumber为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| try { | |||||
| WxCUserCar userCar = new WxCUserCar(); | |||||
| userCar.updateTenantInfo(park); | |||||
| userCar.setCUserId(cuUserId); | |||||
| userCar.setCarNumber(carNumber); | |||||
| wxCUserCarService.deleteByObj(userCar); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "解绑车牌数据库错误, e:" + e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| private ResultData tjdUnbindCar(@RequestBody Map<String, String> paramMap, WxPark park) { | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| WxCUserCar queryOne = new WxCUserCar(); | |||||
| queryOne.setCarNumber(carNumber); | |||||
| queryOne.updateTenantInfo(park); | |||||
| queryOne.setCUserId(getUserId()); | |||||
| WxCUserCar userCar = wxCUserCarService.getOne(queryOne); | |||||
| if (userCar != null) { | |||||
| String params = userCar.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String carId = objParams.getString("carId"); | |||||
| params = park.getVendorParams(); | |||||
| String url = objParams.getString("url"); | |||||
| String partner = objParams.getString("partner"); | |||||
| String key = objParams.getString("key"); | |||||
| String version = objParams.getString("version"); | |||||
| String ret = tjd.writeOffCar(url, partner, key, version, carId); | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getString("returnCode").equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) { | |||||
| try { | |||||
| wxCUserCarService.deleteByObj(userCar); | |||||
| } catch (Exception e) { | |||||
| logger.error("解绑车牌数据库错误, e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "解绑车牌数据库错误, e:" + e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } else { | |||||
| return new ResultData(ErrorCode.CAR_UNBIND_FAIL, "解绑车牌失败"); | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| /** | /** | ||||
| * 停车费 | * 停车费 | ||||
| * | * | ||||
| @@ -620,152 +238,14 @@ public class WxCarController extends BaseController { | |||||
| // 1, get mall's park | // 1, get mall's park | ||||
| WxPark park = getCurrentPark(getTenantInfo()); | WxPark park = getCurrentPark(getTenantInfo()); | ||||
| if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | ||||
| return etcpCarStopFee(paramMap, park); | |||||
| } else if (park.getVendorType().equals(EnumCarVendor.CAR_TJD.getCode())) { | |||||
| return tjdCarStopFee(paramMap, park); | |||||
| } else if (park.getVendorType().equals(EnumCarVendor.CAR_DAHUA.getCode())) { | |||||
| return dahuaCarStopFee(paramMap, park); | |||||
| } else if (park.getVendorType().equals(EnumCarVendor.CAR_BOLINK.getCode())) { | |||||
| return bolinkCarStopFee(paramMap, park); | |||||
| }else if (park.getVendorType().equals(EnumCarVendor.CAE_CYF.getCode())){ | |||||
| return cyfCarStopFee(paramMap,park); | |||||
| } | |||||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "停车费获取失败"); | |||||
| } | |||||
| private ResultData dahuaCarStopFee(Map<String, String> paramMap, WxPark park) { | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| String result = DaHuaUtil.plateCharge(carNumber, park.getParkId()); | |||||
| logger.info("大华查询车辆费用接口返回值:{}", result); | |||||
| JSONObject jsonObject = JSONObject.parseObject(result); | |||||
| String code = jsonObject.getString("code"); | |||||
| if (!code.equals(DaHuaUtil.SUCCESS_CODE)) { | |||||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "停车费获取失败"); | |||||
| } | |||||
| Object data = jsonObject.get("data"); | |||||
| return new ResultData(data); | |||||
| } | |||||
| private ResultData etcpCarStopFee(@RequestBody Map<String, String> paramMap, WxPark park) { | |||||
| String etcpToken = paramMap.get("etcpToken"); | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(etcpToken)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| } | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString("url"); | |||||
| String appId = objParams.getString("appId"); | |||||
| String merchantNo = objParams.getString("merchantNo"); | |||||
| String merchantKey = objParams.getString("merchantKey"); | |||||
| String version = objParams.getString("version"); | |||||
| String ret = ""; | |||||
| try { | |||||
| ret = etcp.orderUnpay(url, appId, merchantNo, merchantKey, version, etcpToken, carNumber); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("ETCP failed: " + e.getMessage()); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getIntValue("code") == 0) { | |||||
| JSONObject feeObj = retObj.getJSONArray("data").getJSONObject(0); | |||||
| /* | |||||
| Date currentDate = new Date(); | |||||
| WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | |||||
| wxCarCmdLog.setTenantId(user.getTenantId()); | |||||
| wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | |||||
| wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_UNPAY.getCode()); | |||||
| String feeStr = JSON.toJSONString(feeObj); | |||||
| wxCarCmdLog.setCmdJson(feeStr); | |||||
| wxCarCmdLog.setCreateDate(currentDate); | |||||
| wxCarCmdLog.setUpdateDate(currentDate); | |||||
| try { | |||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | |||||
| } catch (Exception e) { | |||||
| logger.error("etcpOrderUnpay: 入库错误:" + feeStr); | |||||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "入库错误", feeStr); | |||||
| } | |||||
| */ | |||||
| return new ResultData(Result.SUCCESS, "停车费获取成功", feeObj); | |||||
| } else { | |||||
| String message = retObj.getString("message"); | |||||
| return new ResultData(ErrorCode.ETCP_STOP_FEE_FAIL.getCode(), message, retObj); | |||||
| } | |||||
| } | |||||
| private ResultData tjdCarStopFee(@RequestBody Map<String, String> paramMap, WxPark park) { | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString(TJDUtil.TJD_URL); | |||||
| String partner = objParams.getString(TJDUtil.TJD_ACCOUNT); | |||||
| String key = objParams.getString(TJDUtil.TJD_ACCOUNT_KEY); | |||||
| String version = objParams.getString(TJDUtil.TJD_VERSION); | |||||
| String ret = tjd.infoForFreeMins(url, partner, key, version, carNumber); | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getString(TJDUtil.TJD_RETURN_CODE).equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) { | |||||
| return new ResultData(retObj); | |||||
| } else { | |||||
| return new ResultData(ErrorCode.TJD_STOP_FEE_FAIL.getCode(), "停车费获取失败"); | |||||
| } | |||||
| } | |||||
| private ResultData cyfCarStopFee(@RequestBody Map<String, String> paramMap, WxPark park){ | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String token = objParams.getString("token"); | |||||
| String ret = cyf.getCarStopFee(token,park.getParkingId(),carNumber); | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getIntValue("result") == 1){ | |||||
| return new ResultData(retObj); | |||||
| }else { | |||||
| return new ResultData(ErrorCode.CYF_STOP_FEE_FAIL.getCode(), "停车费获取失败"); | |||||
| } | |||||
| } | |||||
| private String getETCPBusinessID(Long merchantId) { | |||||
| String businessId; | |||||
| WxMerchant wxMerchant = wxMerchantService.getById(merchantId); | |||||
| String carParams = wxMerchant.getCarParams(); | |||||
| JSONObject objParams1 = JSON.parseObject(carParams); | |||||
| businessId = objParams1.getString("businessId"); | |||||
| return businessId; | |||||
| } | |||||
| private ResultData bolinkCarStopFee(@RequestBody Map<String, String> paramMap, WxPark park) { | |||||
| String carNumber = paramMap.get("carNumber"); | |||||
| if (StringUtils.isBlank(carNumber)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString(BoLinkUtil.BOLINK_URL); | |||||
| String comid = objParams.getString(BoLinkUtil.BOLINK_COMID); | |||||
| String unionId = objParams.getString(BoLinkUtil.BOLINK_UNION_ID); | |||||
| String key = objParams.getString(BoLinkUtil.BOLINK_KEY); | |||||
| String ret = BoLinkUtil.getStopFee(url, comid, unionId, key, carNumber); | |||||
| if (ret != null) { | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| JSONObject dataObj = retObj.getJSONObject(BoLinkUtil.BOLINK_DATA); | |||||
| if (dataObj.getIntValue(BoLinkUtil.BOLINK_STATE) == BoLinkUtil.BOLINK_SUCCESS) { | |||||
| return new ResultData(dataObj); | |||||
| } else { | |||||
| return new ResultData(ErrorCode.BOLINK_STOP_FEE_FAIL); | |||||
| } | |||||
| return etcpHelper.etcpCarStopFee(paramMap, park); | |||||
| } else { | } else { | ||||
| return new ResultData(ErrorCode.BOLINK_STOP_FEE_FAIL); | |||||
| try { | |||||
| return parkFactory.getParkService(park.getVendorType()).carStopFee(paramMap, park); | |||||
| } catch (Exception e) { | |||||
| logger.error("park getCarStopFee error",e); | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -802,7 +282,7 @@ public class WxCarController extends BaseController { | |||||
| WxCouponOrderCarCVo userCar = null; | WxCouponOrderCarCVo userCar = null; | ||||
| WxCouponOrder userCarQ = new WxCouponOrder(); | WxCouponOrder userCarQ = new WxCouponOrder(); | ||||
| userCarQ.updateTenantInfo(park); | userCarQ.updateTenantInfo(park); | ||||
| userCarQ.setCUserId(getUserId()); | |||||
| userCarQ.setCUserId(getMemberId()); | |||||
| userCarQ.setId(couponOrderId); | userCarQ.setId(couponOrderId); | ||||
| userCarQ.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()); | userCarQ.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()); | ||||
| List<WxCouponOrderCarCVo> list = wxCouponOrderService.carListCUserVo(userCarQ); | List<WxCouponOrderCarCVo> list = wxCouponOrderService.carListCUserVo(userCarQ); | ||||
| @@ -811,161 +291,25 @@ public class WxCarController extends BaseController { | |||||
| } | } | ||||
| if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | if (park.getVendorType().equals(EnumCarVendor.CAR_ETCP.getCode())) { | ||||
| String etcpToken = paramMap.get("etcpToken"); | |||||
| if (StringUtils.isBlank(etcpToken)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString("url"); | |||||
| String merchantNo = objParams.getString("merchantNo"); | |||||
| String merchantKey = objParams.getString("merchantKey"); | |||||
| String version = objParams.getString("version"); | |||||
| String businessId = ""; | |||||
| // 获取merchantId | |||||
| WxMerchantVo merchantVo = null; | |||||
| if (userCar.getMerchantVoList().size() > 0) { | |||||
| merchantVo = userCar.getMerchantVoList().get(0); | |||||
| } | |||||
| // 优先从从商户表里取 | |||||
| businessId = getETCPBusinessID(merchantVo.getId()); | |||||
| if (StringUtils.isBlank(businessId)) { | |||||
| // 1期只有一个虚拟商户,可以写在商场配置里 | |||||
| businessId = objParams.getString("businessId"); | |||||
| } | |||||
| String ret = ""; | |||||
| try { | |||||
| ret = etcp.bCouponRecord(url, merchantNo, merchantKey, version, | |||||
| etcpToken, park.getParkId(), businessId, carNumber, String.valueOf(userCar.getCouponFreeId())); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("ETCP failed: " + e.getMessage()); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getIntValue("code") == EnumETCPCode.SUCCESS.getCode()) { | |||||
| // 券状态设为已使用 | |||||
| WxCouponOrder couponOrder = new WxCouponOrder(); | |||||
| couponOrder.setId(userCar.getId()); | |||||
| couponOrder.updateTenantInfo(park); | |||||
| couponOrder.setUpdateDate(new Date()); | |||||
| couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | |||||
| try { | |||||
| wxCouponOrderService.saveOrUpdate(couponOrder); | |||||
| } catch (Exception e) { | |||||
| logger.error("券包状态更新失败:" + couponOrderIdStr); | |||||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "券包状态更新失败"); | |||||
| } | |||||
| return new ResultData(); | |||||
| } else { | |||||
| return new ResultData(ErrorCode.ETCP_QUAN_SEND_FAIL.getCode(), retObj.getString("message")); | |||||
| } | |||||
| } else if (park.getVendorType().equals(EnumCarVendor.CAR_TJD.getCode())) { | |||||
| String tradeId = paramMap.get("tradeId"); | |||||
| String accountId = paramMap.get("accountId"); | |||||
| if (StringUtils.isBlank(tradeId)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "tradeId为空"); | |||||
| } | |||||
| if (StringUtils.isBlank(accountId)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "accountId为空"); | |||||
| } | |||||
| WxCoupon coupon = couponService.getById(userCar.getCouponId()); | |||||
| if (coupon == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "券为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString(TJDUtil.TJD_URL); | |||||
| String partner = objParams.getString(TJDUtil.TJD_ACCOUNT); | |||||
| String key = objParams.getString(TJDUtil.TJD_ACCOUNT_KEY); | |||||
| String version = objParams.getString(TJDUtil.TJD_VERSION); | |||||
| String amount = ""; | |||||
| if (coupon.getUnit().equals(EnumCouponUnit.MONEY.getCode())) { | |||||
| amount = coupon.getPriceStr(); | |||||
| } else { | |||||
| amount = String.valueOf(coupon.getPrice()* 60); | |||||
| } | |||||
| String ret = tjd.deductionForDetail(url, partner, key, version, | |||||
| tradeId, accountId, String.valueOf(userCar.getId()), | |||||
| coupon.getUnit().toString(), amount); | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getString(TJDUtil.TJD_RETURN_CODE).equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) { | |||||
| return new ResultData(); | |||||
| } else { | |||||
| return new ResultData(ErrorCode.CAR_DEDUCE_FEE_FAIL.getCode(), "停车费抵扣失败"); | |||||
| } | |||||
| } else if (park.getVendorType().equals(EnumCarVendor.CAR_SHANGAN.getCode())) { | |||||
| WxCoupon coupon = couponService.getById(userCar.getCouponId()); | |||||
| if (coupon == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "券为空"); | |||||
| } | |||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString(ShangAnUtil.SHANGAN_URL); | |||||
| String key = objParams.getString(ShangAnUtil.SHANGAN_KEY); | |||||
| String parkNumber = objParams.getString(ShangAnUtil.SHANGAN_PARK_NUMBER); | |||||
| String couponModelId = coupon.getUnit().toString(); | |||||
| String position = ""; | |||||
| if (coupon.getUnit().equals(EnumCouponUnit.MONEY.getCode())) { | |||||
| position = coupon.getPrice().toString(); | |||||
| } else { | |||||
| position = String.valueOf(coupon.getPrice()* 60); | |||||
| } | |||||
| String ret = ShangAnUtil.couponSend(url, key, parkNumber, couponModelId, userCar.getExpiredTime(), carNumber, position); | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getString(ShangAnUtil.SHANGAN_STATUS).equalsIgnoreCase(ShangAnUtil.SHANGAN_SUCCESS)) { | |||||
| // 停车券-核销 | |||||
| try { | |||||
| wxCouponOrderService.shangAnVerify(userCar.getId()); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } else { | |||||
| return new ResultData(ErrorCode.SHANGAN_COUPON_FAIL.getCode(), retObj.getString(ShangAnUtil.SHANGAN_ERROR_CODE)); | |||||
| } | |||||
| } else if (park.getVendorType().equals(EnumCarVendor.CAR_BOLINK.getCode())) { | |||||
| String orderId = paramMap.get("orderId"); | |||||
| if (StringUtils.isBlank(orderId)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId为空"); | |||||
| } | |||||
| return etcpHelper.getCoupon(paramMap, park, userCar,carNumber); | |||||
| } else { | |||||
| WxCoupon coupon = couponService.getById(userCar.getCouponId()); | WxCoupon coupon = couponService.getById(userCar.getCouponId()); | ||||
| if (coupon == null) { | if (coupon == null) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "券为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "券为空"); | ||||
| } | } | ||||
| String params = park.getVendorParams(); | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString(BoLinkUtil.BOLINK_URL); | |||||
| String comid = objParams.getString(BoLinkUtil.BOLINK_COMID); | |||||
| String unionId = objParams.getString(BoLinkUtil.BOLINK_UNION_ID); | |||||
| String key = objParams.getString(BoLinkUtil.BOLINK_KEY); | |||||
| String amount = ""; | |||||
| if (coupon.getUnit().equals(EnumCouponUnit.MONEY.getCode())) { | |||||
| amount = coupon.getPriceStr(); | |||||
| } else { | |||||
| amount = String.valueOf(coupon.getPrice()* 60); | |||||
| } | |||||
| String ret = BoLinkUtil.couponSend(url, comid, unionId, key, | |||||
| carNumber, | |||||
| orderId, | |||||
| coupon.getUnit().toString(), amount); | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| JSONObject dataObj = retObj.getJSONObject(BoLinkUtil.BOLINK_DATA); | |||||
| if (dataObj.getIntValue(BoLinkUtil.BOLINK_STATE) == BoLinkUtil.BOLINK_SUCCESS) { | |||||
| return new ResultData(dataObj); | |||||
| } else { | |||||
| return new ResultData(ErrorCode.CAR_DEDUCE_FEE_FAIL); | |||||
| } | |||||
| } | |||||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "优免券领取失败"); | |||||
| try { | |||||
| ResultData rs = parkFactory.getParkService(park.getVendorType()).useCoupon(paramMap, park, userCar, coupon, carNumber); | |||||
| if (rs.code == Result.SUCCESS) { | |||||
| etcpHelper.updateWxCouponOrderUsed(userCar, park); | |||||
| return new ResultData(); | |||||
| }else { | |||||
| return new ResultData(rs.code,rs.message); | |||||
| } | |||||
| } catch (Exception e) { | |||||
| logger.error("park getCoupon error",e); | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @ApiOperation("券包分页列表接口") | @ApiOperation("券包分页列表接口") | ||||
| @@ -975,13 +319,12 @@ public class WxCarController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | ||||
| }) | }) | ||||
| public ResultData list(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | ||||
| if (pageNum == null || pageSize == null) { | if (pageNum == null || pageSize == null) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderCarCVo(); | if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderCarCVo(); | ||||
| wxCouponOrder.updateTenantInfo(getTenantInfo()); | wxCouponOrder.updateTenantInfo(getTenantInfo()); | ||||
| wxCouponOrder.setCUserId(getUserId()); | |||||
| wxCouponOrder.setCUserId(getMemberId()); | |||||
| if (wxCouponOrder.getCouponOrderStatus() == null) | if (wxCouponOrder.getCouponOrderStatus() == null) | ||||
| wxCouponOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | wxCouponOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | ||||
| else if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()) | else if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()) | ||||
| @@ -997,72 +340,10 @@ public class WxCarController extends BaseController { | |||||
| /// 1, get mall's park | /// 1, get mall's park | ||||
| WxPark park = getCurrentPark(getTenantInfo()); | WxPark park = getCurrentPark(getTenantInfo()); | ||||
| if (park.getVendorType() == EnumCarVendor.CAR_ETCP.getCode()) { | if (park.getVendorType() == EnumCarVendor.CAR_ETCP.getCode()) { | ||||
| ResultData e = etcpParkStatus(park); | |||||
| ResultData e = etcpHelper.etcpParkStatus(park); | |||||
| if (e != null) return e; | if (e != null) return e; | ||||
| } | } | ||||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "车场不支持"); | return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "车场不支持"); | ||||
| } | } | ||||
| private ResultData etcpParkStatus(WxPark park) { | |||||
| String params = park.getVendorParams(); | |||||
| if (params == null) { | |||||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "车场不支持"); | |||||
| } | |||||
| JSONObject objParams = JSON.parseObject(params); | |||||
| String url = objParams.getString("url"); | |||||
| String merchantNo = objParams.getString("merchantNo"); | |||||
| String merchantKey = objParams.getString("merchantKey"); | |||||
| String version = objParams.getString("version"); | |||||
| if (park.getParkingId() == null) { | |||||
| // those code is not supported | |||||
| /* | |||||
| String lat = objParams.getString("lat"); | |||||
| String lon = objParams.getString("lon"); | |||||
| String radius = objParams.getString("radius"); | |||||
| String ret = etcp.parkingInfo(url, merchantNo, merchantKey, version, lat, lon, radius); | |||||
| logger.info(ret); | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getIntValue("code") == EnumETCPCode.SUCCESS.getCode()) { | |||||
| JSONObject retData = retObj.getJSONObject("data"); | |||||
| if (retData != null) { | |||||
| JSONArray retDataList = retData.getJSONArray("list"); | |||||
| if (retDataList != null) { | |||||
| JSONObject parkData = retDataList.getJSONObject(0); | |||||
| if (parkData != null) { | |||||
| String parkId = parkData.getString("id"); | |||||
| objParams.put("parkId", parkId); | |||||
| params = JSON.toJSONString(objParams); | |||||
| park.setVendorParams(params); | |||||
| park.setParkingId(parkId); | |||||
| wxParkService.saveOrUpdate(park); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| */ | |||||
| } | |||||
| if (park.getParkingId() != null) { | |||||
| String ret = ""; | |||||
| try { | |||||
| ret = etcp.parkingStatus(url, merchantNo, merchantKey, version, park.getParkingId()); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("ETCP failed: " + e.getMessage()); | |||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||||
| } | |||||
| JSONObject retObj = JSON.parseObject(ret); | |||||
| if (retObj.getIntValue("code") == EnumETCPCode.SUCCESS.getCode()) { | |||||
| if (retObj.get("data") != null) { | |||||
| return new ResultData(retObj.getJSONObject("data")); | |||||
| } | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | } | ||||
| @@ -1,30 +1,51 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import java.math.BigDecimal; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxCardInfo; | |||||
| import com.iformall.domain.po.WxCardSpend; | |||||
| import com.iformall.domain.po.WxCouponMerchant; | |||||
| import com.iformall.domain.po.WxCouponOrder; | |||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxOrder; | |||||
| import com.iformall.domain.vo.WxCardSpendVo; | import com.iformall.domain.vo.WxCardSpendVo; | ||||
| import com.iformall.enums.EnumCreditLockedStatus; | import com.iformall.enums.EnumCreditLockedStatus; | ||||
| import com.iformall.enums.EnumMerchantStatus; | import com.iformall.enums.EnumMerchantStatus; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.*; | |||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxCardInfoService; | |||||
| import com.iformall.service.WxCardSpendService; | |||||
| import com.iformall.service.WxCouponOrderService; | |||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxOrderService; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import java.math.BigDecimal; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * @author Stormeye Wu wuguoqiang@iformall.com | * @author Stormeye Wu wuguoqiang@iformall.com | ||||
| @@ -53,23 +74,23 @@ public class WxCardPayController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxCUserBasicInfoService wxCUserBasicInfoService; | WxCUserBasicInfoService wxCUserBasicInfoService; | ||||
| @ApiOperation(value = "C端扫B端储值卡支付订单", notes = "params:{\"cardId\":\"String\",\"merchantId\":\"String\",\"totalFee\":\"String(元)\"}") | |||||
| @ApiOperation(value = "微信C端扫B端储值卡支付订单", notes = "params:{\"cardId\":\"String\",\"merchantId\":\"String\",\"totalFee\":\"String(元)\"}") | |||||
| @PostMapping("order_create") | @PostMapping("order_create") | ||||
| public ResultData saveCardPayOrder(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { | public ResultData saveCardPayOrder(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { | ||||
| String ipStr = getIpAddr(); | |||||
| logger.info("saveCardPayOrder: " + ipStr + " :" + paramMap.toString()); | |||||
| String cardIdStr = paramMap.get("cardId"); | |||||
| String merchantStr = paramMap.get("merchantId"); | |||||
| String totalFeeStr = paramMap.get("totalFee"); | |||||
| return saveCardPayOrder(getMemberId(),cardIdStr,merchantStr,totalFeeStr,EnumPayWay.PAY_WAY_WECHAT); | |||||
| } | |||||
| WxCUser user = getUser(); | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(user.getId()); | |||||
| private ResultData saveCardPayOrder(Long cUserId,String cardIdStr,String merchantStr,String totalFeeStr,EnumPayWay payWay) { | |||||
| String ipStr = getIpAddr(); | |||||
| logger.info("saveCardPayOrder: " + ipStr + " : cUserId:{} , cardIdStr:{},merchantStr:{},totalFeeStr:{}",cUserId,cardIdStr,cardIdStr,cardIdStr); | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUserId); | |||||
| if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | ||||
| logger.error(ErrorCode.MEMBER_IS_LOCKED.getMessage()); | logger.error(ErrorCode.MEMBER_IS_LOCKED.getMessage()); | ||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | ||||
| } | } | ||||
| String cardIdStr = paramMap.get("cardId"); | |||||
| String merchantStr = paramMap.get("merchantId"); | |||||
| String totalFeeStr = paramMap.get("totalFee"); | |||||
| if (StringUtils.isBlank(cardIdStr) || cardIdStr.equalsIgnoreCase(Constant.UNDEFINED)) { | if (StringUtils.isBlank(cardIdStr) || cardIdStr.equalsIgnoreCase(Constant.UNDEFINED)) { | ||||
| logger.error("cardId不能为空"); | logger.error("cardId不能为空"); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cardId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cardId不能为空"); | ||||
| @@ -115,7 +136,7 @@ public class WxCardPayController extends BaseController { | |||||
| //查看所有者与扫码者是否为一致 | //查看所有者与扫码者是否为一致 | ||||
| WxCouponOrder couponOrder = wxCouponOrderService.getById(cardId); | WxCouponOrder couponOrder = wxCouponOrderService.getById(cardId); | ||||
| if (!couponOrder.getOwnerId().equals(getUserId())) { | |||||
| if (!couponOrder.getOwnerId().equals(cUserId)) { | |||||
| logger.error("卡已被领取: " + cardIdStr); | logger.error("卡已被领取: " + cardIdStr); | ||||
| return new ResultData(ErrorCode.CARD_TRANSFERED); | return new ResultData(ErrorCode.CARD_TRANSFERED); | ||||
| } | } | ||||
| @@ -134,7 +155,7 @@ public class WxCardPayController extends BaseController { | |||||
| WxOrder order = null; | WxOrder order = null; | ||||
| try { | try { | ||||
| order = wxOrderService.saveCardPayOrder(merchant, getUserId(), totalFeeStr, payment); | |||||
| order = wxOrderService.saveCardPayOrder(merchant, cUserId, totalFeeStr, payment,payWay); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("saveCardPayOrder 1" + e.getMessage()); | logger.error("saveCardPayOrder 1" + e.getMessage()); | ||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| @@ -146,14 +167,15 @@ public class WxCardPayController extends BaseController { | |||||
| WxCardSpend record = new WxCardSpend(); | WxCardSpend record = new WxCardSpend(); | ||||
| record.updateTenantInfo(merchant); | record.updateTenantInfo(merchant); | ||||
| record.setCardId(cardId); | record.setCardId(cardId); | ||||
| record.setOwnerId(getUserId()); | |||||
| record.setOwnerId(cUserId); | |||||
| record.setMerchantId(merchantId); | record.setMerchantId(merchantId); | ||||
| record.setOrderId(order.getId()); | record.setOrderId(order.getId()); | ||||
| record.setIp(ipStr); | record.setIp(ipStr); | ||||
| record.setDeductionAmount(payment); | record.setDeductionAmount(payment); | ||||
| record.setRemark("操作于["+payWay.getMessage()+"("+payWay.getCode()+")]"); | |||||
| try { | try { | ||||
| return wxCardSpendService.createCardSpend(record, order, couponMerchant); | |||||
| return wxCardSpendService.createCardSpend(record, order, couponMerchant,payWay); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("card spend error, req 2: " + record.toString() + ", e:" + e.getMessage()); | logger.error("card spend error, req 2: " + record.toString() + ", e:" + e.getMessage()); | ||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| @@ -162,7 +184,8 @@ public class WxCardPayController extends BaseController { | |||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | return new ResultData(ErrorCode.PAY_ORDER_ERROR, e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| @ApiOperation("C端扫B端储值卡交易流水列表接口") | @ApiOperation("C端扫B端储值卡交易流水列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -171,9 +194,13 @@ public class WxCardPayController extends BaseController { | |||||
| public ResultData cardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend, Integer pageNum, Integer pageSize) { | public ResultData cardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend, Integer pageNum, Integer pageSize) { | ||||
| String ipStr = getIpAddr(); | String ipStr = getIpAddr(); | ||||
| logger.info("list: " + ipStr + " :" + wxCardSpend.toString()); | logger.info("list: " + ipStr + " :" + wxCardSpend.toString()); | ||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | |||||
| return cardSpendList(wxCardSpend,getMemberId(), pageNum, pageSize); | |||||
| } | |||||
| private ResultData cardSpendList(WxCardSpendVo wxCardSpend,Long cUserId,Integer pageNum, Integer pageSize) { | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | |||||
| wxCardSpend.updateTenantInfo(getTenantInfo()); | wxCardSpend.updateTenantInfo(getTenantInfo()); | ||||
| wxCardSpend.setOwnerId(getUserId()); | |||||
| wxCardSpend.setOwnerId(cUserId); | |||||
| final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | final PageInfo<WxCardSpendVo> page = wxCardSpendService.listAsPage(wxCardSpend, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -183,9 +210,13 @@ public class WxCardPayController extends BaseController { | |||||
| public ResultData sumCardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend) { | public ResultData sumCardSpendList(@ModelAttribute WxCardSpendVo wxCardSpend) { | ||||
| String ipStr = getIpAddr(); | String ipStr = getIpAddr(); | ||||
| logger.info("sumCardSpendList: " + ipStr + " :" + wxCardSpend.toString()); | logger.info("sumCardSpendList: " + ipStr + " :" + wxCardSpend.toString()); | ||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | |||||
| return sumCardSpendList(wxCardSpend, getMemberId()); | |||||
| } | |||||
| private ResultData sumCardSpendList(WxCardSpendVo wxCardSpend,Long cUserId) { | |||||
| if (wxCardSpend == null) wxCardSpend = new WxCardSpendVo(); | |||||
| wxCardSpend.updateTenantInfo(getTenantInfo()); | wxCardSpend.updateTenantInfo(getTenantInfo()); | ||||
| wxCardSpend.setOwnerId(getUserId()); | |||||
| wxCardSpend.setOwnerId(cUserId); | |||||
| final List<Map<String, Object>> mapList = wxCardSpendService.sumCardSpendForOwner(wxCardSpend); | final List<Map<String, Object>> mapList = wxCardSpendService.sumCardSpendForOwner(wxCardSpend); | ||||
| return new ResultData(mapList); | return new ResultData(mapList); | ||||
| } | } | ||||
| @@ -5,6 +5,7 @@ import com.iformall.annotation.RedisCache; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.WxCouponOrder; | import com.iformall.domain.po.WxCouponOrder; | ||||
| @@ -57,7 +58,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| StringRedisTemplate stringRedisTemplate; | StringRedisTemplate stringRedisTemplate; | ||||
| @RedisCache(expireTime = 100) | |||||
| //@RedisCache(expireTime = 100) | |||||
| @ApiOperation("券包分页列表接口") | @ApiOperation("券包分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -65,12 +66,11 @@ public class WxCouponOrderController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | ||||
| }) | }) | ||||
| public ResultData list(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | ||||
| if (pageNum == null || pageSize == null) { | if (pageNum == null || pageSize == null) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderCVo(); | if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderCVo(); | ||||
| wxCouponOrder.setCUserId(getUserId()); | |||||
| wxCouponOrder.setCUserId(getMemberId()); | |||||
| if (wxCouponOrder.getCouponOrderStatus() == null) | if (wxCouponOrder.getCouponOrderStatus() == null) | ||||
| wxCouponOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC, BaseEntity.SortField.Id_DESC); | wxCouponOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC, BaseEntity.SortField.Id_DESC); | ||||
| else if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()) | else if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()) | ||||
| @@ -112,7 +112,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| if (wxCouponOrderCVo == null) { | if (wxCouponOrderCVo == null) { | ||||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | ||||
| } | } | ||||
| if (!wxCouponOrderCVo.getCUserId().equals(getUserId())) { | |||||
| if (!wxCouponOrderCVo.getCUserId().equals(getMemberId())) { | |||||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | ||||
| } | } | ||||
| WxCouponCVo wxCouponCVo = null; | WxCouponCVo wxCouponCVo = null; | ||||
| @@ -245,7 +245,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| cardCVo = new WxCardCVo(); | cardCVo = new WxCardCVo(); | ||||
| } | } | ||||
| cardCVo.updateTenantInfo(getTenantInfo()); | cardCVo.updateTenantInfo(getTenantInfo()); | ||||
| cardCVo.setOwnerId(getUserId()); | |||||
| cardCVo.setOwnerId(getMemberId()); | |||||
| if(StringUtils.isNotBlank(cardCVo.getStatusStr())) { | if(StringUtils.isNotBlank(cardCVo.getStatusStr())) { | ||||
| String [] statusAttr = cardCVo.getStatusStr().split(","); | String [] statusAttr = cardCVo.getStatusStr().split(","); | ||||
| List<Integer> tmpList = new ArrayList<Integer>(); | List<Integer> tmpList = new ArrayList<Integer>(); | ||||
| @@ -272,12 +272,11 @@ public class WxCouponOrderController extends BaseController { | |||||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) | @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) | ||||
| }) | }) | ||||
| public ResultData cardDetail(String couponOrderId) { | public ResultData cardDetail(String couponOrderId) { | ||||
| if (couponOrderId == null || couponOrderId.equalsIgnoreCase(Constant.UNDEFINED) ) { | if (couponOrderId == null || couponOrderId.equalsIgnoreCase(Constant.UNDEFINED) ) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| return wxCouponOrderService.cardDetailCUserVo(getUserId(), couponOrderId); | |||||
| return wxCouponOrderService.cardDetailCUserVo(getMemberId(), couponOrderId); | |||||
| } | } | ||||
| @ApiOperation(value = "卡转赠领取") | @ApiOperation(value = "卡转赠领取") | ||||
| @@ -298,7 +297,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cUserId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cUserId不能为空"); | ||||
| } | } | ||||
| //当前领取人 | //当前领取人 | ||||
| wxCouponOrder.setOwnerId(getUserId()); | |||||
| wxCouponOrder.setOwnerId(getMemberId()); | |||||
| //转赠者与当前领取人是否为同一个 | //转赠者与当前领取人是否为同一个 | ||||
| if (cUserId.equals(wxCouponOrder.getOwnerId())) { | if (cUserId.equals(wxCouponOrder.getOwnerId())) { | ||||
| logger.info("转赠人与卡所有者相同"); | logger.info("转赠人与卡所有者相同"); | ||||
| @@ -316,7 +315,6 @@ public class WxCouponOrderController extends BaseController { | |||||
| @ApiImplicitParam(name = "cUserId", value = "转赠者", dataType = "Long", paramType = "query", required = true), | @ApiImplicitParam(name = "cUserId", value = "转赠者", dataType = "Long", paramType = "query", required = true), | ||||
| }) | }) | ||||
| public ResultData queryCardStatus(@ModelAttribute WxCouponOrder wxCouponOrder) { | public ResultData queryCardStatus(@ModelAttribute WxCouponOrder wxCouponOrder) { | ||||
| //coupon_order_id判断 | //coupon_order_id判断 | ||||
| Long id = wxCouponOrder.getId(); | Long id = wxCouponOrder.getId(); | ||||
| if (id == null) { | if (id == null) { | ||||
| @@ -332,7 +330,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "updateDate不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "updateDate不能为空"); | ||||
| } | } | ||||
| //当前领取人 | //当前领取人 | ||||
| wxCouponOrder.setOwnerId(getUserId()); | |||||
| wxCouponOrder.setOwnerId(getMemberId()); | |||||
| return wxCouponOrderService.queryCardStatus(wxCouponOrder); | return wxCouponOrderService.queryCardStatus(wxCouponOrder); | ||||
| } | } | ||||
| @@ -340,8 +338,8 @@ public class WxCouponOrderController extends BaseController { | |||||
| @GetMapping("checkH5CouponOrder") | @GetMapping("checkH5CouponOrder") | ||||
| public ResultData checkH5CouponOrder() { | public ResultData checkH5CouponOrder() { | ||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| WxCUser user = getUser(); | |||||
| memCouponFromDspService.couponOrderFromDsp(tenantEntity, user.getPhone()); | |||||
| WxCUserBasicInfo member = getMember(); | |||||
| memCouponFromDspService.couponOrderFromDsp(tenantEntity, member.getPhone()); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -32,6 +32,9 @@ public class WxCouponPasswordController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxOrderService orderService; | private WxOrderService orderService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService userService; | |||||
| @ApiOperation(value = "根据卡密领卡", notes = "{\"password\":\"String\",\"formId\":\"String\"}") | @ApiOperation(value = "根据卡密领卡", notes = "{\"password\":\"String\",\"formId\":\"String\"}") | ||||
| @PostMapping("getCouponOrderByPassword") | @PostMapping("getCouponOrderByPassword") | ||||
| @@ -39,6 +42,11 @@ public class WxCouponPasswordController extends BaseController { | |||||
| logger.info("getCouponOrderByPassword: " + getIpAddr() + params.toString()); | logger.info("getCouponOrderByPassword: " + getIpAddr() + params.toString()); | ||||
| String password = params.get("password"); | String password = params.get("password"); | ||||
| String formId = params.get("formId"); | String formId = params.get("formId"); | ||||
| return getCouponOrderByPassword(password, formId, getMemberId(),EnumPayWay.PAY_WAY_NOT_UNPAY_PASSWD); | |||||
| } | |||||
| private ResultData getCouponOrderByPassword(String password,String formId,Long memberId,EnumPayWay payWay) { | |||||
| if (StringUtils.isBlank(password) || password.equalsIgnoreCase(Constant.UNDEFINED)) { | if (StringUtils.isBlank(password) || password.equalsIgnoreCase(Constant.UNDEFINED)) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "password不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "password不能为空"); | ||||
| } | } | ||||
| @@ -58,7 +66,13 @@ public class WxCouponPasswordController extends BaseController { | |||||
| return new ResultData(500, e.getMessage()); | return new ResultData(500, e.getMessage()); | ||||
| } | } | ||||
| WxCUser cuUser = getUser(); | |||||
| WxCUserBasicInfo member = userService.getById(memberId); | |||||
| if(member == null) { | |||||
| logger.error("会员用户未找到: " + memberId); | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "会员用户未找到" + memberId); | |||||
| } | |||||
| WxCoupon coupon = couponService.getById(couponPassword.getCouponId()); | WxCoupon coupon = couponService.getById(couponPassword.getCouponId()); | ||||
| if (coupon == null) { | if (coupon == null) { | ||||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | return new ResultData(ErrorCode.COUPON_IS_EMPTY); | ||||
| @@ -75,7 +89,7 @@ public class WxCouponPasswordController extends BaseController { | |||||
| // 3. 领取free coupon | // 3. 领取free coupon | ||||
| try { | try { | ||||
| WxOrder order = orderService.saveFreeOrderForCoupon(cuUser, coupon, null, formId, couponPassword.getId()); | |||||
| WxOrder order = orderService.saveFreeOrderForCoupon(member, coupon, null, formId, couponPassword.getId(),payWay); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| setCouponPasswordStatus(couponPassword, EnumCouponPasswordStatus.getEnum(pwdStatus)); | setCouponPasswordStatus(couponPassword, EnumCouponPasswordStatus.getEnum(pwdStatus)); | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -1,7 +1,9 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.WxCreditHistory; | import com.iformall.domain.po.WxCreditHistory; | ||||
| import com.iformall.service.WxCreditHistoryService; | import com.iformall.service.WxCreditHistoryService; | ||||
| @@ -10,6 +12,9 @@ import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -19,6 +24,8 @@ import org.springframework.web.bind.annotation.*; | |||||
| @Slf4j | @Slf4j | ||||
| public class WxCreditHistoryController extends BaseController{ | public class WxCreditHistoryController extends BaseController{ | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxCreditHistoryService wxCreditHistoryService; | private WxCreditHistoryService wxCreditHistoryService; | ||||
| @@ -29,8 +36,10 @@ public class WxCreditHistoryController extends BaseController{ | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxCreditHistory wxCreditHistory, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCreditHistory wxCreditHistory, Integer pageNum, Integer pageSize) { | ||||
| log.debug("[" + getIpAddr() + "] WxCreditHistoryController::list"); | log.debug("[" + getIpAddr() + "] WxCreditHistoryController::list"); | ||||
| if (null == wxCreditHistory) wxCreditHistory = new WxCreditHistory(); | |||||
| wxCreditHistory.setCUserId(getUserId()); | |||||
| if (null == wxCreditHistory){ | |||||
| wxCreditHistory = new WxCreditHistory(); | |||||
| } | |||||
| wxCreditHistory.setCUserId(getMemberId()); | |||||
| wxCreditHistory.setSortColumns(BaseEntity.SortField.CreateDate_DESC,BaseEntity.SortField.Id_DESC); | wxCreditHistory.setSortColumns(BaseEntity.SortField.CreateDate_DESC,BaseEntity.SortField.Id_DESC); | ||||
| final PageInfo<WxCreditHistory> page = wxCreditHistoryService.listAsPage(wxCreditHistory, pageNum, pageSize); | final PageInfo<WxCreditHistory> page = wxCreditHistoryService.listAsPage(wxCreditHistory, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -4,10 +4,7 @@ import com.github.pagehelper.Page; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCouponOrder; | |||||
| import com.iformall.domain.po.WxGame; | |||||
| import com.iformall.domain.po.WxGameActionLog; | |||||
| import com.iformall.domain.po.WxGameTemplate; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.enums.EnumGameStatus; | import com.iformall.enums.EnumGameStatus; | ||||
| import com.iformall.service.WxCouponOrderService; | import com.iformall.service.WxCouponOrderService; | ||||
| import com.iformall.service.WxGameService; | import com.iformall.service.WxGameService; | ||||
| @@ -72,17 +69,14 @@ public class WxGameController extends BaseController { | |||||
| @ApiImplicitParam(name = "gameId", value = "游戏ID", dataType = "String", paramType = "query", required = true), | @ApiImplicitParam(name = "gameId", value = "游戏ID", dataType = "String", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "orderId", value = "券订单ID", dataType = "String", paramType = "query", required = true)}) | @ApiImplicitParam(name = "orderId", value = "券订单ID", dataType = "String", paramType = "query", required = true)}) | ||||
| public ResultData addActionLog(@RequestBody Map<String,String> paramMap) { | public ResultData addActionLog(@RequestBody Map<String,String> paramMap) { | ||||
| Long gameIdL = null; | |||||
| Long orderIdL = null; | |||||
| try { | try { | ||||
| gameIdL = Long.valueOf(paramMap.get("gameId")); | |||||
| orderIdL = Long.valueOf(paramMap.get("orderId")); | |||||
| Long gameIdL = Long.valueOf(paramMap.get("gameId")); | |||||
| Long orderIdL = Long.valueOf(paramMap.get("orderId")); | |||||
| return wxGameService.addActionLog(getMemberId(), gameIdL, orderIdL); | |||||
| } catch (Exception e){ | } catch (Exception e){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| } | } | ||||
| return wxGameService.addActionLog(getUserId(), gameIdL, orderIdL); | |||||
| } | } | ||||
| @ApiOperation("添加游戏参与记录") | @ApiOperation("添加游戏参与记录") | ||||
| @@ -90,13 +84,12 @@ public class WxGameController extends BaseController { | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "gameId", value = "游戏ID", dataType = "String", paramType = "query", required = true)}) | @ApiImplicitParam(name = "gameId", value = "游戏ID", dataType = "String", paramType = "query", required = true)}) | ||||
| public ResultData getCount(String gameId) { | public ResultData getCount(String gameId) { | ||||
| Long gameIdL = null; | |||||
| try { | try { | ||||
| gameIdL = Long.valueOf(gameId); | |||||
| Long gameIdL = Long.valueOf(gameId); | |||||
| return wxGameService.getCount(gameIdL,getMemberId()); | |||||
| } catch (Exception e){ | } catch (Exception e){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| } | } | ||||
| return wxGameService.getCount(gameIdL,getUserId()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -56,7 +56,7 @@ public class WxLiveController extends BaseController { | |||||
| @GetMapping("/replayList") | @GetMapping("/replayList") | ||||
| public ResultData getLiveReplay(Integer room_id, Integer start, Integer limit) { | public ResultData getLiveReplay(Integer room_id, Integer start, Integer limit) { | ||||
| ResultData resultData = new ResultData(); | ResultData resultData = new ResultData(); | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| try { | try { | ||||
| WxMaService wxMaService = getWeappService(user.getAppId()); | WxMaService wxMaService = getWeappService(user.getAppId()); | ||||
| resultData.data = wxMaService.getLiveService().getLiveReplay(room_id,start,limit); | resultData.data = wxMaService.getLiveService().getLiveReplay(room_id,start,limit); | ||||
| @@ -2,10 +2,13 @@ package com.iformall.controller; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxAppinfo; | |||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.domain.po.WxMsgValidationcode; | import com.iformall.domain.po.WxMsgValidationcode; | ||||
| import com.iformall.enums.EnumAssignTagsTrigger; | import com.iformall.enums.EnumAssignTagsTrigger; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.Constant; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -27,29 +30,28 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxMsgValidationcodeService wxMsgValidationcodeService; | private WxMsgValidationcodeService wxMsgValidationcodeService; | ||||
| @Autowired | |||||
| private WxMerchantBUserService wxMerchantBUserService; | |||||
| @Autowired | |||||
| private WxMerchantService wxMerchantService; | |||||
| @Autowired | @Autowired | ||||
| private WxCUserService wxCUserService; | private WxCUserService wxCUserService; | ||||
| @Autowired | @Autowired | ||||
| private WxCUserTagsService wxCUserTagsService; | private WxCUserTagsService wxCUserTagsService; | ||||
| @Autowired | |||||
| private WxAppinfoService WxAppinfoService; | |||||
| @GetMapping("sendvalidationcode") | @GetMapping("sendvalidationcode") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), | @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true)}) | @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true)}) | ||||
| public ResultData sendvalidationcode(String phone, Integer type) { | public ResultData sendvalidationcode(String phone, Integer type) { | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.updateTenantInfo(getTenantInfo()); | wxMsgValidationcode.updateTenantInfo(getTenantInfo()); | ||||
| wxMsgValidationcode.setPhone(phone); | wxMsgValidationcode.setPhone(phone); | ||||
| wxMsgValidationcode.setType(type); | wxMsgValidationcode.setType(type); | ||||
| wxMsgValidationcode.setAppid(user.getAppId()); | |||||
| //只需要一端发就可以了 | |||||
| WxAppinfo appinfo = WxAppinfoService.getCAppInfo(getTenantInfo(), EnumPayWay.PAY_WAY_WECHAT); | |||||
| wxMsgValidationcode.setAppid(appinfo.getAppId()); | |||||
| return wxMsgValidationcodeService.sendvalidationcode(wxMsgValidationcode); | return wxMsgValidationcodeService.sendvalidationcode(wxMsgValidationcode); | ||||
| } | } | ||||
| @@ -59,26 +61,44 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true), | @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "code", value = "验证码", dataType = "String", paramType = "query", required = true)}) | @ApiImplicitParam(name = "code", value = "验证码", dataType = "String", paramType = "query", required = true)}) | ||||
| public ResultData hasvalidationcode(String phone, Integer type, String code) { | public ResultData hasvalidationcode(String phone, Integer type, String code) { | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.updateTenantInfo(getTenantInfo()); | wxMsgValidationcode.updateTenantInfo(getTenantInfo()); | ||||
| wxMsgValidationcode.setPhone(phone); | wxMsgValidationcode.setPhone(phone); | ||||
| wxMsgValidationcode.setType(type); | wxMsgValidationcode.setType(type); | ||||
| wxMsgValidationcode.setCode(code); | wxMsgValidationcode.setCode(code); | ||||
| wxMsgValidationcode.setAppid(user.getAppId()); | |||||
| //只需要一端发就可以了 | |||||
| WxAppinfo appinfo = WxAppinfoService.getCAppInfo(getTenantInfo(), EnumPayWay.PAY_WAY_WECHAT); | |||||
| wxMsgValidationcode.setAppid(appinfo.getAppId()); | |||||
| //wxMsgValidationcode.setAppid(user.getAppId()); | |||||
| ResultData rd = wxMsgValidationcodeService.hasvalidationcode(wxMsgValidationcode); | ResultData rd = wxMsgValidationcodeService.hasvalidationcode(wxMsgValidationcode); | ||||
| if (rd.code == Result.SUCCESS) { | if (rd.code == Result.SUCCESS) { | ||||
| // 更新到basicinfo | |||||
| Long userId = user.getId(); | |||||
| if (user.basicInfoIs()) { | |||||
| userId = user.getUserId(); | |||||
| } | |||||
| Long basicUserId = saveToBasicInfoByCUser(phone, user.getNickName(), user.getAvatarUrl(), user.getGender(), userId); | |||||
| if (null != basicUserId) { | |||||
| if(basicUserId.intValue() == -1){ | |||||
| return rd; | |||||
| } | |||||
| user.setUserId(basicUserId); | |||||
| } | |||||
| // 更新 WxCUser | // 更新 WxCUser | ||||
| user.setVerifyCodePhone(phone); | user.setVerifyCodePhone(phone); | ||||
| user.setUpdateDate(new Date()); | user.setUpdateDate(new Date()); | ||||
| wxCUserService.saveOrUpdate(user); | wxCUserService.saveOrUpdate(user); | ||||
| // 更新到basicinfo | |||||
| saveToBasicInfo(user); | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE,user); | wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE,user); | ||||
| String key = Constant.tokenPrev + user.getToken(); | |||||
| if(baseCUserTokenRedisTemplate.hasKey(key)){ | |||||
| baseCUserTokenRedisTemplate.delete(key); | |||||
| } | |||||
| } | } | ||||
| return rd; | return rd; | ||||
| } | } | ||||
| } | } | ||||
| @@ -65,7 +65,11 @@ public class WxOrderController extends BaseController { | |||||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | ||||
| @PostMapping("save") | @PostMapping("save") | ||||
| public ResultData saveOrder(@RequestBody OrderSaveDto orderSaveDto) { | public ResultData saveOrder(@RequestBody OrderSaveDto orderSaveDto) { | ||||
| logger.info("OrderSave: " + orderSaveDto); | |||||
| return saveOrder(orderSaveDto,getMemberId(),EnumPayWay.PAY_WAY_WECHAT); | |||||
| } | |||||
| private ResultData saveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay) { | |||||
| logger.info("OrderSave: " + orderSaveDto); | |||||
| if (orderSaveDto.getCouponChannelId() == null) { | if (orderSaveDto.getCouponChannelId() == null) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | ||||
| } | } | ||||
| @@ -77,10 +81,9 @@ public class WxOrderController extends BaseController { | |||||
| ResultData resultData = couponChannelCheck(orderSaveDto, wxCouponChannel); | ResultData resultData = couponChannelCheck(orderSaveDto, wxCouponChannel); | ||||
| if (resultData != null) return resultData; | if (resultData != null) return resultData; | ||||
| WxCUser user = getUser(); | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(user.getId()); | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUserId); | |||||
| if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | ||||
| logger.info("会员权益被锁定:cUserId:" + user.getId()); | |||||
| logger.info("会员权益被锁定:cUserId:" + cUserId); | |||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | ||||
| } | } | ||||
| @@ -93,7 +96,7 @@ public class WxOrderController extends BaseController { | |||||
| } | } | ||||
| //判断是否是拼团订单,如果是拼团订单,判断现在进行中的,和已完成的数量是否超出券的限制 | //判断是否是拼团订单,如果是拼团订单,判断现在进行中的,和已完成的数量是否超出券的限制 | ||||
| if (coupon.getType().equals(EnumCouponType.COUPON_GROUP.getCode())) { | if (coupon.getType().equals(EnumCouponType.COUPON_GROUP.getCode())) { | ||||
| int ordercount = wxOrderService.countUserCouponGroupOrder(user.getId(),coupon.getId()); | |||||
| int ordercount = wxOrderService.countUserCouponGroupOrder(cUserId,coupon.getId()); | |||||
| if (ordercount>=coupon.getUseLimitQuantity()) { | if (ordercount>=coupon.getUseLimitQuantity()) { | ||||
| return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF.getCode(),"您当前此券的有效拼团数量达到券的限购次数。"); | return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF.getCode(),"您当前此券的有效拼团数量达到券的限购次数。"); | ||||
| } | } | ||||
| @@ -141,7 +144,7 @@ public class WxOrderController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| resultData = couponUserCheck(user, wxCouponCVo); | |||||
| resultData = couponUserCheck(wxCUserBasicInfo, wxCouponCVo); | |||||
| if (resultData != null) return resultData; | if (resultData != null) return resultData; | ||||
| Long couponId = orderSaveDto.getCouponId() == null ? wxCouponChannel.getCouponId() : orderSaveDto.getCouponId(); | Long couponId = orderSaveDto.getCouponId() == null ? wxCouponChannel.getCouponId() : orderSaveDto.getCouponId(); | ||||
| @@ -153,7 +156,7 @@ public class WxOrderController extends BaseController { | |||||
| boolean isPress = orderSaveDto.getPress() != null ? orderSaveDto.getPress() : false; | boolean isPress = orderSaveDto.getPress() != null ? orderSaveDto.getPress() : false; | ||||
| try { | try { | ||||
| WxOrder order = wxOrderService.saveOrderForCoupon(user, coupon, orderSaveDto, isPress); | |||||
| WxOrder order = wxOrderService.saveOrderForCoupon(wxCUserBasicInfo, coupon, orderSaveDto, isPress,payWay); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -163,8 +166,8 @@ public class WxOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.ORDER_IS_FAIL, e.getMessage()); | return new ResultData(ErrorCode.ORDER_IS_FAIL, e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| private ResultData couponUserCheck(WxCUser user, WxCouponCVo coupon) { | |||||
| private ResultData couponUserCheck(WxCUserBasicInfo user, WxCouponCVo coupon) { | |||||
| if (coupon.getConditions() == null) return null; | if (coupon.getConditions() == null) return null; | ||||
| JSONObject jo = null; | JSONObject jo = null; | ||||
| try { | try { | ||||
| @@ -174,22 +177,22 @@ public class WxOrderController extends BaseController { | |||||
| } | } | ||||
| if (jo != null) { | if (jo != null) { | ||||
| if (jo.getIntValue("type") == EnumCouponConditionType.NEW_MEMBER.getCode()){ | if (jo.getIntValue("type") == EnumCouponConditionType.NEW_MEMBER.getCode()){ | ||||
| WxCUserBasicInfo cUserBasicInfo = wxCUserBasicInfoService.getById(user.getId()); | |||||
| if (cUserBasicInfo != null && cUserBasicInfo.getActRecord() > 0) | |||||
| if (user != null && user.getActRecord() > 0) | |||||
| return new ResultData(ErrorCode.COUPON_ONLY_FOR_NEW_MEMBER); | return new ResultData(ErrorCode.COUPON_ONLY_FOR_NEW_MEMBER); | ||||
| if (wxOrderService.countCouponConditionType1(user) > 0) | |||||
| if (wxOrderService.countCouponConditionType1(coupon.getTenantId(),user.getId()) > 0) | |||||
| return new ResultData(ErrorCode.COUPON_ALREADY_IN_NEW_MEMBER); | return new ResultData(ErrorCode.COUPON_ALREADY_IN_NEW_MEMBER); | ||||
| }else if (jo.getIntValue("type") == EnumCouponConditionType.SCORE_SCOPE.getCode()){ | }else if (jo.getIntValue("type") == EnumCouponConditionType.SCORE_SCOPE.getCode()){ | ||||
| int max = jo.getIntValue("max"); | int max = jo.getIntValue("max"); | ||||
| int min = jo.getIntValue("min"); | int min = jo.getIntValue("min"); | ||||
| if (max!=0 && min ==0 && user.getScore() > max) { | |||||
| if (max!=0 && min ==0 && user.getPoins() > max) { | |||||
| return new ResultData(ErrorCode.COUPON_SCORE_NOT_IN_RANGE); | return new ResultData(ErrorCode.COUPON_SCORE_NOT_IN_RANGE); | ||||
| } | } | ||||
| if (max==0 && min !=0 && user.getScore() < min) { | |||||
| if (max==0 && min !=0 && user.getPoins() < min) { | |||||
| return new ResultData(ErrorCode.COUPON_SCORE_NOT_IN_RANGE); | return new ResultData(ErrorCode.COUPON_SCORE_NOT_IN_RANGE); | ||||
| } | } | ||||
| if (max!=0 && min !=0 && (user.getScore() < min || user.getScore() > max)) { | |||||
| if (max!=0 && min !=0 && (user.getPoins() < min || user.getPoins() > max)) { | |||||
| return new ResultData(ErrorCode.COUPON_SCORE_NOT_IN_RANGE); | return new ResultData(ErrorCode.COUPON_SCORE_NOT_IN_RANGE); | ||||
| } | } | ||||
| } | } | ||||
| @@ -283,8 +286,10 @@ public class WxOrderController extends BaseController { | |||||
| }) | }) | ||||
| public ResultData list(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | ||||
| // c端用户应该只能看到自己的订单 | // c端用户应该只能看到自己的订单 | ||||
| if (wxOrder == null) wxOrder = new WxOrder(); | |||||
| wxOrder.setCUserId(getUserId()); | |||||
| if (wxOrder == null){ | |||||
| wxOrder = new WxOrder(); | |||||
| } | |||||
| wxOrder.setCUserId(getMemberId()); | |||||
| wxOrder.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | wxOrder.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | ||||
| final PageInfo<WxOrderCouponVo> page = wxOrderService.listCUserVoAsPage(wxOrder, pageNum, pageSize); | final PageInfo<WxOrderCouponVo> page = wxOrderService.listCUserVoAsPage(wxOrder, pageNum, pageSize); | ||||
| @@ -324,7 +329,7 @@ public class WxOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常"); | ||||
| } | } | ||||
| wxOrder.setId(id); | wxOrder.setId(id); | ||||
| wxOrder.setCUserId(getUserId()); | |||||
| wxOrder.setCUserId(getMemberId()); | |||||
| WxOrderCouponVo wxOrderCVo = wxOrderService.detailCUserVo(wxOrder); | WxOrderCouponVo wxOrderCVo = wxOrderService.detailCUserVo(wxOrder); | ||||
| if (wxOrderCVo == null) | if (wxOrderCVo == null) | ||||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | ||||
| @@ -404,7 +409,12 @@ public class WxOrderController extends BaseController { | |||||
| WxOrder order = null; | WxOrder order = null; | ||||
| try { | try { | ||||
| order = wxOrderService.getUnPaidOrder(getUser(), wxCoupon); | |||||
| WxCUserBasicInfo member = wxCUserBasicInfoService.getById(getMemberId()); | |||||
| if(member == null) { | |||||
| logger.error("会员用户未找到: " + getMemberId()); | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "会员用户未找到" + getMemberId()); | |||||
| } | |||||
| order = wxOrderService.getUnPaidOrder(member, wxCoupon); | |||||
| if (order != null) { | if (order != null) { | ||||
| return new ResultData(Result.SUCCESS, "查询成功", order); | return new ResultData(Result.SUCCESS, "查询成功", order); | ||||
| } else { | } else { | ||||
| @@ -424,7 +434,7 @@ public class WxOrderController extends BaseController { | |||||
| public ResultData pressOrderList(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | public ResultData pressOrderList(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | ||||
| // c端用户应该只能看到自己的订单 | // c端用户应该只能看到自己的订单 | ||||
| if (wxOrder == null) wxOrder = new WxOrder(); | if (wxOrder == null) wxOrder = new WxOrder(); | ||||
| wxOrder.setCUserId(getUserId()); | |||||
| wxOrder.setCUserId(getMemberId()); | |||||
| wxOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | wxOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | ||||
| final PageInfo<WxOrderCouponPressVo> page = wxOrderService.listPressVoAsPage(wxOrder, pageNum, pageSize); | final PageInfo<WxOrderCouponPressVo> page = wxOrderService.listPressVoAsPage(wxOrder, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -3,6 +3,7 @@ package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxOrderGroup; | import com.iformall.domain.po.WxOrderGroup; | ||||
| import com.iformall.domain.vo.WxOrderGroupMarketing; | import com.iformall.domain.vo.WxOrderGroupMarketing; | ||||
| @@ -49,7 +50,7 @@ public class WxOrderGroupController extends BaseController { | |||||
| wxOrderGroup.setRemainPeople(1); | wxOrderGroup.setRemainPeople(1); | ||||
| wxOrderGroup.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode()); | wxOrderGroup.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode()); | ||||
| wxOrderGroup.updateTenantInfo(getTenantInfo()); | wxOrderGroup.updateTenantInfo(getTenantInfo()); | ||||
| return wxOrderGroupService.queryRemainOne(wxOrderGroup, getUserId()); | |||||
| return wxOrderGroupService.queryRemainOne(wxOrderGroup, getMemberId()); | |||||
| } | } | ||||
| @@ -61,7 +62,7 @@ public class WxOrderGroupController extends BaseController { | |||||
| }) | }) | ||||
| public ResultData queryOrderGroup(Integer pageNum, Integer pageSize) { | public ResultData queryOrderGroup(Integer pageNum, Integer pageSize) { | ||||
| WxOrder wxOrder = new WxOrder(); | WxOrder wxOrder = new WxOrder(); | ||||
| wxOrder.setCUserId(getUserId()); | |||||
| wxOrder.setCUserId(getMemberId()); | |||||
| wxOrder.updateTenantInfo(getTenantInfo()); | wxOrder.updateTenantInfo(getTenantInfo()); | ||||
| final PageInfo<Map<String, Object>> page = wxOrderGroupService.queryOrderGroup(wxOrder, pageNum, pageSize); | final PageInfo<Map<String, Object>> page = wxOrderGroupService.queryOrderGroup(wxOrder, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -118,7 +119,7 @@ public class WxOrderGroupController extends BaseController { | |||||
| if (wxOrderGroup.getId() == null) { | if (wxOrderGroup.getId() == null) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id不能为空"); | ||||
| } | } | ||||
| wxOrderGroup.setUserId(getUserId()); | |||||
| wxOrderGroup.setUserId(getMemberId()); | |||||
| wxOrderGroup.updateTenantInfo(getTenantInfo()); | wxOrderGroup.updateTenantInfo(getTenantInfo()); | ||||
| return wxOrderGroupService.queryAttendStatus(wxOrderGroup); | return wxOrderGroupService.queryAttendStatus(wxOrderGroup); | ||||
| } | } | ||||
| @@ -33,11 +33,13 @@ import com.iformall.enums.EnumOrderStatus; | |||||
| import com.iformall.enums.EnumPayStatus; | import com.iformall.enums.EnumPayStatus; | ||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxAppinfoService; | |||||
| import com.iformall.service.WxCUserBasicInfoService; | import com.iformall.service.WxCUserBasicInfoService; | ||||
| import com.iformall.service.WxCouponService; | import com.iformall.service.WxCouponService; | ||||
| import com.iformall.service.WxOrderService; | import com.iformall.service.WxOrderService; | ||||
| import com.iformall.service.WxPayAccountService; | import com.iformall.service.WxPayAccountService; | ||||
| import com.iformall.service.WxPayOrderService; | import com.iformall.service.WxPayOrderService; | ||||
| import com.iformall.service.pay.entity.PayExtraParam; | |||||
| import com.iformall.utils.IPUtil; | import com.iformall.utils.IPUtil; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| @@ -66,7 +68,16 @@ public class WxPayOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCouponService wxCouponService; | private WxCouponService wxCouponService; | ||||
| @Autowired | |||||
| private WxAppinfoService wxAppinfoService; | |||||
| /** | |||||
| * 微信支付 | |||||
| * @param paramMap | |||||
| * @param request | |||||
| * @return | |||||
| * @throws Exception | |||||
| */ | |||||
| //@ApiOperation(value = "发起微信小程序支付订单", notes = "{\"orderId\":\"string\"}") | //@ApiOperation(value = "发起微信小程序支付订单", notes = "{\"orderId\":\"string\"}") | ||||
| @RequestMapping(value = "/create", method = RequestMethod.POST) | @RequestMapping(value = "/create", method = RequestMethod.POST) | ||||
| public ResultData _create(@RequestBody Map<String, String> paramMap, HttpServletRequest request) throws Exception { | public ResultData _create(@RequestBody Map<String, String> paramMap, HttpServletRequest request) throws Exception { | ||||
| @@ -77,16 +88,28 @@ public class WxPayOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | ||||
| } | } | ||||
| WxCUser user = getUser(); | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(user.getId()); | |||||
| WxCUser user = getWxCUser(); | |||||
| if (!user.basicInfoIs()) { | |||||
| logger.error("暂未成为会员,请授权手机号"); | |||||
| return new ResultData(ErrorCode.USER_IS_NOT_MEMBER.getCode(), "暂未成为会员,请授权手机号"); | |||||
| } | |||||
| return _create(orderIdStr,user.getUserId(),EnumPayWay.PAY_WAY_WECHAT,user.getAppId(),new PayExtraParam("openId",user.getOpenId()),request); | |||||
| } | |||||
| private ResultData _create(String orderIdStr,Long userId, EnumPayWay payWay,String appId,PayExtraParam parm,HttpServletRequest request) { | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(userId); | |||||
| if ( null == wxCUserBasicInfo) { | |||||
| logger.error("会员用户不存在."+userId); | |||||
| return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(),"会员用户不存在."+userId); | |||||
| } | |||||
| if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | ||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | ||||
| } | } | ||||
| WxAppinfo appInfo = getAppInfo(user.getAppId()); | |||||
| WxAppinfo appInfo = getAppInfo(appId); | |||||
| if(appInfo == null) { | if(appInfo == null) { | ||||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | ||||
| } | } | ||||
| Long orderId = 0L; | Long orderId = 0L; | ||||
| try { | try { | ||||
| orderId = Long.valueOf(orderIdStr); | orderId = Long.valueOf(orderIdStr); | ||||
| @@ -97,7 +120,7 @@ public class WxPayOrderController extends BaseController { | |||||
| record.setOrderId(orderId); | record.setOrderId(orderId); | ||||
| try { | try { | ||||
| record.setIp(IPUtil.getIpAddr(request)); | record.setIp(IPUtil.getIpAddr(request)); | ||||
| return wxPayOrderService.createPayOrder(appInfo, user, record, EnumPayWay.PAY_WAY_WECHAT); | |||||
| return wxPayOrderService.createPayOrder(appInfo, wxCUserBasicInfo, record, payWay,parm); | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage()); | logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage()); | ||||
| return new ResultData(e.getErrorCode(), e.getMessage()); | return new ResultData(e.getErrorCode(), e.getMessage()); | ||||
| @@ -183,10 +206,12 @@ public class WxPayOrderController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| //查询微信订单状态并更新 | //查询微信订单状态并更新 | ||||
| WxCUser user = getUser(); | |||||
| WxAppinfo appInfo = getAppInfo(user.getAppId()); | |||||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(payOrder, EnumPayWay.getEnum(payOrder.getPayVendor())); | |||||
| //WxCUser user = getUser(); | |||||
| //WxAppinfo appInfo = getAppInfo(user.getAppId()); | |||||
| if (null == appInfo) { | if (null == appInfo) { | ||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, "当前用户appId["+user.getAppId()+"]找不到appInfo"); | |||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, "当前支付类型["+payOrder.getPayVendor()+"]找不到C端appInfo"); | |||||
| } | } | ||||
| WxPayAccount payAccount = wxPayAccountService.getById(appInfo.getPayId()); | WxPayAccount payAccount = wxPayAccountService.getById(appInfo.getPayId()); | ||||
| try { | try { | ||||
| @@ -2,6 +2,7 @@ package com.iformall.controller; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxOrderPress; | import com.iformall.domain.po.WxOrderPress; | ||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| @@ -153,10 +154,8 @@ public class WxPressOrderController extends BaseController { | |||||
| logger.error("此砍价订单被锁定, orderId: " + orderIdStr); | logger.error("此砍价订单被锁定, orderId: " + orderIdStr); | ||||
| return new ResultData(ErrorCode.TOO_MANY_REQUEST); | return new ResultData(ErrorCode.TOO_MANY_REQUEST); | ||||
| } | } | ||||
| Long cUserId = getUserId(); | |||||
| // 检查此人是否已参与砍价 | // 检查此人是否已参与砍价 | ||||
| boolean hadJoin = wxOrderPressService.checkCUserHasJoin(order, cUserId); | |||||
| boolean hadJoin = wxOrderPressService.checkCUserHasJoin(order, getMemberId()); | |||||
| if (hadJoin) { | if (hadJoin) { | ||||
| redisLock.unlock(orderIdStr, timeStr); | redisLock.unlock(orderIdStr, timeStr); | ||||
| logger.error("用户已参与砍价"); | logger.error("用户已参与砍价"); | ||||
| @@ -164,7 +163,7 @@ public class WxPressOrderController extends BaseController { | |||||
| } | } | ||||
| try { | try { | ||||
| WxOrderPress orderPress = wxOrderPressService.pressCouponJoin(order, wxCouponCVo, cUserId); | |||||
| WxOrderPress orderPress = wxOrderPressService.pressCouponJoin(order, wxCouponCVo, getMemberId()); | |||||
| if (orderPress != null) { | if (orderPress != null) { | ||||
| // 更新砍价信息 | // 更新砍价信息 | ||||
| Integer index = order.getPressCurrentNum() + 1; | Integer index = order.getPressCurrentNum() + 1; | ||||
| @@ -242,11 +241,11 @@ public class WxPressOrderController extends BaseController { | |||||
| logger.error("订单不存在:" + orderId); | logger.error("订单不存在:" + orderId); | ||||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | ||||
| } | } | ||||
| if(order.getCUserId().equals(getUserId())) { | |||||
| if(order.getCUserId().equals(getMemberId())) { | |||||
| ret.put("status", EnumOrderPressStatus.FIRST.getCode()); | ret.put("status", EnumOrderPressStatus.FIRST.getCode()); | ||||
| return new ResultData(ret); | return new ResultData(ret); | ||||
| } | } | ||||
| int status = wxOrderPressService.pressCouponStatus(order, getUserId()); | |||||
| int status = wxOrderPressService.pressCouponStatus(order, getMemberId()); | |||||
| ret.put("status", status); | ret.put("status", status); | ||||
| return new ResultData(ret); | return new ResultData(ret); | ||||
| } | } | ||||
| @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxQuestion; | import com.iformall.domain.po.WxQuestion; | ||||
| import com.iformall.domain.po.WxQuestionConfig; | import com.iformall.domain.po.WxQuestionConfig; | ||||
| import com.iformall.domain.po.WxQuestionLog; | import com.iformall.domain.po.WxQuestionLog; | ||||
| @@ -67,7 +68,7 @@ public class WxQuestionController extends BaseController { | |||||
| while(q.hasNext()){ | while(q.hasNext()){ | ||||
| WxQuestion x = q.next(); | WxQuestion x = q.next(); | ||||
| wxQuestionLog.setQuestionId(x.getId()); | wxQuestionLog.setQuestionId(x.getId()); | ||||
| wxQuestionLog.setUserId(getUserId()); | |||||
| wxQuestionLog.setUserId(getMemberId()); | |||||
| wxQuestionLog.updateTenantInfo(wxQuestionConfig); | wxQuestionLog.updateTenantInfo(wxQuestionConfig); | ||||
| if(wxQuestionService.findLogList(wxQuestionLog).size()>0){ | if(wxQuestionService.findLogList(wxQuestionLog).size()>0){ | ||||
| @@ -104,10 +105,10 @@ public class WxQuestionController extends BaseController { | |||||
| } | } | ||||
| wxQuestionLog.setAnswer(JSONObject.toJSONString(as)); | wxQuestionLog.setAnswer(JSONObject.toJSONString(as)); | ||||
| wxCUserTagsService.assignTags(as, wxCUserBasicInfoService.getById(getUserId())); | |||||
| wxCUserTagsService.assignTags(as, wxCUserBasicInfoService.getById(getMemberId())); | |||||
| } | } | ||||
| wxQuestionLog.setUserId(getUserId()); | |||||
| wxQuestionLog.setUserId(getMemberId()); | |||||
| wxQuestionService.saveOrUpdateLog(wxQuestionLog); | wxQuestionService.saveOrUpdateLog(wxQuestionLog); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -1,7 +1,9 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.WxScoreHistory; | import com.iformall.domain.po.WxScoreHistory; | ||||
| import com.iformall.service.WxScoreHistoryService; | import com.iformall.service.WxScoreHistoryService; | ||||
| @@ -28,8 +30,8 @@ public class WxScoreHistoryController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData list(Integer pageNum, Integer pageSize) { | public ResultData list(Integer pageNum, Integer pageSize) { | ||||
| WxScoreHistory wxScoreHistory = new WxScoreHistory(); | WxScoreHistory wxScoreHistory = new WxScoreHistory(); | ||||
| wxScoreHistory.updateTenantInfo(getTenantInfo()); | |||||
| wxScoreHistory.setCUserId(getUserId()); | |||||
| // wxScoreHistory.updateTenantInfo(getTenantInfo()); | |||||
| wxScoreHistory.setCUserId(getMemberId()); | |||||
| wxScoreHistory.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | wxScoreHistory.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | ||||
| final PageInfo<WxScoreHistory> page = wxScoreHistoryService.listAsPage(wxScoreHistory, pageNum, pageSize); | final PageInfo<WxScoreHistory> page = wxScoreHistoryService.listAsPage(wxScoreHistory, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -53,9 +53,6 @@ public class WxUserGrantController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private boolean isFmOpen; | private boolean isFmOpen; | ||||
| @Autowired | |||||
| private WxCUserTokenService userTokenService; | |||||
| @Autowired | @Autowired | ||||
| private WxCUserService wxCUserService; | private WxCUserService wxCUserService; | ||||
| @@ -98,6 +95,7 @@ public class WxUserGrantController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxMallService mallService; | WxMallService mallService; | ||||
| /** | /** | ||||
| * 微信消息服务验证 | * 微信消息服务验证 | ||||
| * | * | ||||
| @@ -135,7 +133,7 @@ public class WxUserGrantController extends BaseController { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| @AuthIgnore | @AuthIgnore | ||||
| @TenantIgnore | |||||
| @TenantIgnore | |||||
| @PostMapping("/login") | @PostMapping("/login") | ||||
| @ApiOperation(value = "用户登录", notes = "{\"appId\":\"string\",\"code\":\"string\",\"scene\":\"string\",\"sceneAddress\":\"string\",\"latitude\":\"string\",\"longitude\":\"string\",\"systemInfo\":\"string\"}") | @ApiOperation(value = "用户登录", notes = "{\"appId\":\"string\",\"code\":\"string\",\"scene\":\"string\",\"sceneAddress\":\"string\",\"latitude\":\"string\",\"longitude\":\"string\",\"systemInfo\":\"string\"}") | ||||
| public ResultData userLogin(@RequestBody Map<String, String> map) { | public ResultData userLogin(@RequestBody Map<String, String> map) { | ||||
| @@ -172,10 +170,20 @@ public class WxUserGrantController extends BaseController { | |||||
| } | } | ||||
| WxMall wxMall = mallService.getById(Long.valueOf(wxAuthorizerInfo.getTenantId())); | WxMall wxMall = mallService.getById(Long.valueOf(wxAuthorizerInfo.getTenantId())); | ||||
| resultMap.put("selectedMall", wxMall.getTenantId()); | |||||
| // 集团版,获取子集团list | // 集团版,获取子集团list | ||||
| List<WxMall> mallList = null; | List<WxMall> mallList = null; | ||||
| if (wxAuthorizerInfo.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode())) { | |||||
| mallList = mallService.getSubByParentTenantId(wxAuthorizerInfo.getTenantId()); | |||||
| if(StringUtils.isNotBlank(wxMall.getParentTenantId())){ | |||||
| mallList = mallService.getSubByParentTenantId(wxMall.getParentTenantId()); | |||||
| } | |||||
| if (wxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode())) { | |||||
| mallList = mallService.getSubByParentTenantId(wxMall.getTenantId()); | |||||
| } | |||||
| if(mallList != null && mallList.size() >0){ | |||||
| mallList.stream().forEach(cs -> { | |||||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(cs.getTenantInfo(), EnumPayWay.PAY_WAY_WECHAT); | |||||
| cs.setAppId(cAppInfo.getAppId()); | |||||
| }); | |||||
| resultMap.put("subMalls", JSON.toJSONString(mallList)); | resultMap.put("subMalls", JSON.toJSONString(mallList)); | ||||
| } | } | ||||
| @@ -220,7 +228,7 @@ public class WxUserGrantController extends BaseController { | |||||
| if (null != session) { | if (null != session) { | ||||
| logger.info("sessionResultDetail: [openid]" + session.getOpenid()+",[sessionkey]"+session.getSessionKey()+",[unionid]"+session.getUnionid()); | logger.info("sessionResultDetail: [openid]" + session.getOpenid()+",[sessionkey]"+session.getSessionKey()+",[unionid]"+session.getUnionid()); | ||||
| } | } | ||||
| //获取会话密钥(session_key) | //获取会话密钥(session_key) | ||||
| session_key = session.getSessionKey(); | session_key = session.getSessionKey(); | ||||
| openId = session.getOpenid(); | openId = session.getOpenid(); | ||||
| @@ -267,35 +275,37 @@ public class WxUserGrantController extends BaseController { | |||||
| resultMap.put("token", token); | resultMap.put("token", token); | ||||
| request.setAttribute(Constant.LOGIN_USER_KEY, oldUser.getId()); | request.setAttribute(Constant.LOGIN_USER_KEY, oldUser.getId()); | ||||
| request.setAttribute(Constant.TENANT_ID, wxAuthorizerInfo.getTenantId()); | |||||
| request.setAttribute(Constant.TENANT_ID, oldUser.getTenantId()); | |||||
| if(StringUtils.isBlank(oldUser.getParentTenantId()) && StringUtils.isNotBlank(wxMall.getParentTenantId())){ | if(StringUtils.isBlank(oldUser.getParentTenantId()) && StringUtils.isNotBlank(wxMall.getParentTenantId())){ | ||||
| oldUser.setParentTenantId(wxMall.getParentTenantId()); | oldUser.setParentTenantId(wxMall.getParentTenantId()); | ||||
| request.setAttribute(Constant.PARENT_TENANT_ID, wxMall.getParentTenantId()); | |||||
| } | |||||
| if(StringUtils.isNotBlank(oldUser.getParentTenantId())){ | |||||
| request.setAttribute(Constant.PARENT_TENANT_ID, oldUser.getParentTenantId()); | |||||
| } | } | ||||
| // 老用户,给出来已选中的mall | // 老用户,给出来已选中的mall | ||||
| if (mallList != null) { | |||||
| WxMall selectedMall = null; | |||||
| if (StringUtils.isNotBlank(oldUser.getParentTenantId())) { | |||||
| final String lastSubTenant = oldUser.getTenantId(); | |||||
| List<WxMall> selMallList = mallList.stream().filter(ml -> ml.getTenantId().equalsIgnoreCase(lastSubTenant)).collect(Collectors.toList()); | |||||
| if (selMallList.size() > 0) { | |||||
| selectedMall = selMallList.get(0); | |||||
| } | |||||
| } | |||||
| if (selectedMall == null){ | |||||
| WxMall firstMall = mallList.get(0); | |||||
| if (firstMall != null) { | |||||
| selectedMall = firstMall; | |||||
| } | |||||
| } | |||||
| if (selectedMall != null) { | |||||
| request.setAttribute(Constant.PARENT_TENANT_ID, selectedMall.getParentTenantId()); | |||||
| resultMap.put("selectedMall", selectedMall.getTenantId()); | |||||
| oldUser.setParentTenantId(selectedMall.getParentTenantId()); | |||||
| } | |||||
| } | |||||
| // if (mallList != null) { | |||||
| // WxMall selectedMall = null; | |||||
| // if (StringUtils.isNotBlank(oldUser.getParentTenantId())) { | |||||
| // final String lastSubTenant = oldUser.getTenantId(); | |||||
| // List<WxMall> selMallList = mallList.stream().filter(ml -> ml.getTenantId().equalsIgnoreCase(lastSubTenant)).collect(Collectors.toList()); | |||||
| // if (selMallList.size() > 0) { | |||||
| // selectedMall = selMallList.get(0); | |||||
| // } | |||||
| // } | |||||
| // if (selectedMall == null){ | |||||
| // WxMall firstMall = mallList.get(0); | |||||
| // if (firstMall != null) { | |||||
| // selectedMall = firstMall; | |||||
| // } | |||||
| // } | |||||
| // if (selectedMall != null) { | |||||
| // request.setAttribute(Constant.TENANT_ID, selectedMall.getTenantId()); | |||||
| // resultMap.put("selectedMall", selectedMall.getTenantId()); | |||||
| //// oldUser.setParentTenantId(selectedMall.getParentTenantId()); | |||||
| // } | |||||
| // } | |||||
| oldUser.setRegisterIp(ipaddress); | oldUser.setRegisterIp(ipaddress); | ||||
| oldUser.setSessionKey(session_key); | oldUser.setSessionKey(session_key); | ||||
| @@ -329,7 +339,7 @@ public class WxUserGrantController extends BaseController { | |||||
| } | } | ||||
| oldUser.setLoginCount(oldUser.getLoginCount() + 1); | oldUser.setLoginCount(oldUser.getLoginCount() + 1); | ||||
| userTokenService.saveOrUpdate(oldUser); | |||||
| wxCUserService.saveOrUpdate(oldUser); | |||||
| // 登录后处理 | // 登录后处理 | ||||
| int score = wxCUserService.actionAfterLogin(oldUser, boolFindByUnionId); | int score = wxCUserService.actionAfterLogin(oldUser, boolFindByUnionId); | ||||
| @@ -364,22 +374,25 @@ public class WxUserGrantController extends BaseController { | |||||
| extraInfo.put("systemInfo", JSONObject.parseObject(systemInfo)); | extraInfo.put("systemInfo", JSONObject.parseObject(systemInfo)); | ||||
| newUser.setExtraInfo(extraInfo.toJSONString()); | newUser.setExtraInfo(extraInfo.toJSONString()); | ||||
| } | } | ||||
| newUser.setLoginCount(0); | |||||
| newUser.setLoginCount(1); | |||||
| userTokenService.saveOrUpdate(newUser); | |||||
| wxCUserService.saveOrUpdate(newUser); | |||||
| resultMap.put("token", token); | resultMap.put("token", token); | ||||
| request.setAttribute(Constant.LOGIN_USER_KEY, newUser.getId()); | request.setAttribute(Constant.LOGIN_USER_KEY, newUser.getId()); | ||||
| request.setAttribute(Constant.TENANT_ID, newUser.getTenantId()); | request.setAttribute(Constant.TENANT_ID, newUser.getTenantId()); | ||||
| if (mallList != null) { | |||||
| WxMall firstMall = mallList.get(0); | |||||
| if (firstMall != null) { | |||||
| // 默认选中第一个mall, 或者经纬度最近的那个 | |||||
| request.setAttribute(Constant.PARENT_TENANT_ID, firstMall.getTenantId()); | |||||
| resultMap.put("selectedMall", firstMall.getTenantId()); | |||||
| newUser.setParentTenantId(firstMall.getTenantId()); | |||||
| } | |||||
| } | |||||
| if(StringUtils.isNotBlank(newUser.getParentTenantId())){ | |||||
| request.setAttribute(Constant.PARENT_TENANT_ID, newUser.getParentTenantId()); | |||||
| } | |||||
| // if (mallList != null) { | |||||
| // WxMall firstMall = mallList.get(0); | |||||
| // if (firstMall != null) { | |||||
| // // 默认选中第一个mall, 或者经纬度最近的那个 | |||||
| // request.setAttribute(Constant.TENANT_ID, firstMall.getTenantId()); | |||||
| // resultMap.put("selectedMall", firstMall.getTenantId()); | |||||
| // newUser.setParentTenantId(firstMall.getTenantId()); | |||||
| // } | |||||
| // } | |||||
| // 登录后处理 | // 登录后处理 | ||||
| int score = wxCUserService.actionAfterLogin(newUser, null); | int score = wxCUserService.actionAfterLogin(newUser, null); | ||||
| @@ -404,13 +417,13 @@ public class WxUserGrantController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "parentTenantId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "parentTenantId不能为空"); | ||||
| } | } | ||||
| WxCUser user = getUser(); | |||||
| if (user.getTenantId().equalsIgnoreCase(tenantId)) { | |||||
| WxCUser user = getWxCUser(); | |||||
| if (user.getParentTenantId().equalsIgnoreCase(parentTenantId)) { | |||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | ||||
| request.setAttribute(Constant.TENANT_ID, tenantId); | request.setAttribute(Constant.TENANT_ID, tenantId); | ||||
| request.setAttribute(Constant.PARENT_TENANT_ID, parentTenantId); | request.setAttribute(Constant.PARENT_TENANT_ID, parentTenantId); | ||||
| user.setParentTenantId(parentTenantId); | |||||
| userTokenService.saveOrUpdate(user); | |||||
| user.setTenantId(tenantId); | |||||
| wxCUserService.saveOrUpdate(user); | |||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -423,9 +436,9 @@ public class WxUserGrantController extends BaseController { | |||||
| String scene = map.get("scene"); | String scene = map.get("scene"); | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| if (StringUtils.isBlank(user.getScene()) || | if (StringUtils.isBlank(user.getScene()) || | ||||
| user.getScene().equalsIgnoreCase(Constant.UNDEFINED)) { | |||||
| user.getScene().equalsIgnoreCase(Constant.UNDEFINED)) { | |||||
| if(StringUtils.isNotBlank(scene) && scene.equalsIgnoreCase(Constant.UNDEFINED)) { | if(StringUtils.isNotBlank(scene) && scene.equalsIgnoreCase(Constant.UNDEFINED)) { | ||||
| user.setScene(scene); | user.setScene(scene); | ||||
| wxCUserService.updateScene(user); | wxCUserService.updateScene(user); | ||||
| @@ -442,7 +455,7 @@ public class WxUserGrantController extends BaseController { | |||||
| String longitude = map.get("longitude"); | String longitude = map.get("longitude"); | ||||
| String latitude = map.get("latitude"); | String latitude = map.get("latitude"); | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| if (!StringUtils.isBlank(longitude)) | if (!StringUtils.isBlank(longitude)) | ||||
| user.setLongitude(BigDecimal.valueOf(Double.valueOf(longitude))); | user.setLongitude(BigDecimal.valueOf(Double.valueOf(longitude))); | ||||
| if (!StringUtils.isBlank(latitude)) | if (!StringUtils.isBlank(latitude)) | ||||
| @@ -458,7 +471,7 @@ public class WxUserGrantController extends BaseController { | |||||
| String systemInfo = map.get("systemInfo"); | String systemInfo = map.get("systemInfo"); | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| if (StringUtils.isNotBlank(systemInfo)) { | if (StringUtils.isNotBlank(systemInfo)) { | ||||
| JSONObject extraInfo = new JSONObject(); | JSONObject extraInfo = new JSONObject(); | ||||
| extraInfo.put("systemInfo", JSONObject.parseObject(systemInfo)); | extraInfo.put("systemInfo", JSONObject.parseObject(systemInfo)); | ||||
| @@ -516,7 +529,7 @@ public class WxUserGrantController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv不能为空"); | ||||
| } | } | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| if (user != null) { | if (user != null) { | ||||
| logger.debug(user.toString()); | logger.debug(user.toString()); | ||||
| @@ -552,10 +565,23 @@ public class WxUserGrantController extends BaseController { | |||||
| user.setLanguage(userInfo.getLanguage()); | user.setLanguage(userInfo.getLanguage()); | ||||
| wxCUserService.saveOrUpdate(updateUser); | wxCUserService.saveOrUpdate(updateUser); | ||||
| if(user.getUserId() != null){ | |||||
| WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo(); | |||||
| wxCUserBasicInfo.setId(user.getUserId()); | |||||
| wxCUserBasicInfo.setSex(user.getGender()); | |||||
| wxCUserBasicInfo.setAvatarUrl(user.getAvatarUrl()); | |||||
| wxCUserBasicInfoService.update(wxCUserBasicInfo); | |||||
| } | |||||
| String key = Constant.tokenPrev + user.getToken(); | |||||
| if(baseCUserTokenRedisTemplate.hasKey(key)){ | |||||
| baseCUserTokenRedisTemplate.delete(key); | |||||
| } | |||||
| if(bFirstNickName) { | if(bFirstNickName) { | ||||
| // 首次获取昵称 | // 首次获取昵称 | ||||
| // 成长值 | // 成长值 | ||||
| wxScoreRulesService.addScore(EnumScoreType.WECHAT_PERSION, user); | |||||
| wxScoreRulesService.addScore(getTenantInfo(),EnumScoreType.WECHAT_PERSION, user); | |||||
| //增加积分 | //增加积分 | ||||
| wxCUserService.addCredit(user, EnumScoreType.WECHAT_PERSION); | wxCUserService.addCredit(user, EnumScoreType.WECHAT_PERSION); | ||||
| } | } | ||||
| @@ -599,7 +625,7 @@ public class WxUserGrantController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv 不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv 不能为空"); | ||||
| } | } | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| if (user == null) { | if (user == null) { | ||||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | return new ResultData(ErrorCode.USER_IS_EMPTY); | ||||
| @@ -623,22 +649,42 @@ public class WxUserGrantController extends BaseController { | |||||
| user.setCountryCode(phoneNoInfo.getCountryCode()); | user.setCountryCode(phoneNoInfo.getCountryCode()); | ||||
| if (isFirstPhone) { | if (isFirstPhone) { | ||||
| //检查是否存在会员信息 如果有 赋值积分 | //检查是否存在会员信息 如果有 赋值积分 | ||||
| WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(tenantEntity, user.getPhone()); | |||||
| if (basicInfo != null ) { | |||||
| int credit = user.getCredit() == null ? 0 : user.getCredit(); | |||||
| int score = user.getScore() == null ? 0 : user.getScore(); | |||||
| int memScore = basicInfo.getPoins() == null ? 0 : basicInfo.getPoins(); | |||||
| int memCredit = basicInfo.getCredit() == null ? 0 : basicInfo.getCredit(); | |||||
| user.setCredit(memCredit + credit); | |||||
| user.setScore(memScore + score); | |||||
| // WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(tenantEntity, user.getPhone()); | |||||
| // if (basicInfo != null ) { | |||||
| // int credit = user.getCredit() == null ? 0 : user.getCredit(); | |||||
| // int score = user.getScore() == null ? 0 : user.getScore(); | |||||
| // int memScore = basicInfo.getPoins() == null ? 0 : basicInfo.getPoins(); | |||||
| // int memCredit = basicInfo.getCredit() == null ? 0 : basicInfo.getCredit(); | |||||
| // user.setCredit(memCredit + credit); | |||||
| // user.setScore(memScore + score); | |||||
| // } | |||||
| } | |||||
| if (!user.getPhone().contains("*")) { // 用户手机非加密 | |||||
| String phone = user.getPhone(); | |||||
| if (phone != null && phone.contains("*")) { | |||||
| phone = user.getVerifyCodePhone(); | |||||
| } | |||||
| // 更新到basicinfo | |||||
| Long userBasicId = saveToBasicInfoByCUser(phone, user.getNickName(), user.getAvatarUrl(), user.getGender(), user.getUserId()); | |||||
| if (null != userBasicId) { | |||||
| if(userBasicId.intValue() == -1){ | |||||
| return new ResultData(ErrorCode.USER_PHONE_IS_FOUND); | |||||
| } | |||||
| user.setUserId(userBasicId); | |||||
| } | } | ||||
| wxCUserService.saveOrUpdate(user); | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE, user); | |||||
| } | |||||
| String key = Constant.tokenPrev + user.getToken(); | |||||
| if(baseCUserTokenRedisTemplate.hasKey(key)){ | |||||
| baseCUserTokenRedisTemplate.delete(key); | |||||
| } | } | ||||
| wxCUserService.saveOrUpdate(user); | |||||
| if(isFirstPhone) { | if(isFirstPhone) { | ||||
| // 首次授权, 增加成长值及积分 | // 首次授权, 增加成长值及积分 | ||||
| // 成长值 | // 成长值 | ||||
| user.setScore(user.getScore() + wxScoreRulesService.addScore(EnumScoreType.WECHAT_PHONE, user)); | |||||
| wxScoreRulesService.addScore(getTenantInfo(),EnumScoreType.WECHAT_PHONE, user); | |||||
| // 增加积分 | // 增加积分 | ||||
| wxCUserService.addCredit(user, EnumScoreType.WECHAT_PHONE); | wxCUserService.addCredit(user, EnumScoreType.WECHAT_PHONE); | ||||
| // 外部注券 | // 外部注券 | ||||
| @@ -655,12 +701,6 @@ public class WxUserGrantController extends BaseController { | |||||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "解密并保存出错", resultMap); | return new ResultData(ErrorCode.DB_FAIL.getCode(), "解密并保存出错", resultMap); | ||||
| } | } | ||||
| if (!user.getPhone().contains("*")) { // 用户手机非加密 | |||||
| // 更新到basicinfo | |||||
| saveToBasicInfo(user); | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_PHONE, user); | |||||
| } | |||||
| return new ResultData(resultMap); | return new ResultData(resultMap); | ||||
| } | } | ||||
| @@ -673,7 +713,7 @@ public class WxUserGrantController extends BaseController { | |||||
| @ApiOperation(value = "判断用户是否完成授权", notes = "") | @ApiOperation(value = "判断用户是否完成授权", notes = "") | ||||
| public ResultData checkWechatStatus() { | public ResultData checkWechatStatus() { | ||||
| Map resultMap = new HashMap(); | Map resultMap = new HashMap(); | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| if (StringUtils.isNoneEmpty(user.getNickName())) { | if (StringUtils.isNoneEmpty(user.getNickName())) { | ||||
| resultMap.put("nickName", user.getNickName()); | resultMap.put("nickName", user.getNickName()); | ||||
| } else { | } else { | ||||
| @@ -704,7 +744,7 @@ public class WxUserGrantController extends BaseController { | |||||
| @ApiOperation(value = "判断用户是否完成昵称授权", notes = "") | @ApiOperation(value = "判断用户是否完成昵称授权", notes = "") | ||||
| public ResultData checkUserStatus() { | public ResultData checkUserStatus() { | ||||
| Map resultMap = new HashMap(); | Map resultMap = new HashMap(); | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| if (StringUtils.isNoneEmpty(user.getNickName())) { | if (StringUtils.isNoneEmpty(user.getNickName())) { | ||||
| resultMap.put("nickName", user.getNickName()); | resultMap.put("nickName", user.getNickName()); | ||||
| } else { | } else { | ||||
| @@ -723,7 +763,7 @@ public class WxUserGrantController extends BaseController { | |||||
| @ApiOperation(value = "判断用户是否完成手机授权", notes = "") | @ApiOperation(value = "判断用户是否完成手机授权", notes = "") | ||||
| public ResultData checkPhoneStatus() { | public ResultData checkPhoneStatus() { | ||||
| Map resultMap = new HashMap(); | Map resultMap = new HashMap(); | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| if (StringUtils.isNotBlank(user.getPhone())) { | if (StringUtils.isNotBlank(user.getPhone())) { | ||||
| resultMap.put("phone", user.getPhone()); | resultMap.put("phone", user.getPhone()); | ||||
| } else { | } else { | ||||
| @@ -739,19 +779,34 @@ public class WxUserGrantController extends BaseController { | |||||
| return new ResultData(Result.SUCCESS, "是老用户,已完成手机号授权", resultMap); | return new ResultData(Result.SUCCESS, "是老用户,已完成手机号授权", resultMap); | ||||
| } | } | ||||
| @RedisCache | |||||
| // @RedisCache //导致更改手机号后数据更新不及时 | |||||
| @ApiOperation("获取当前用户信息") | @ApiOperation("获取当前用户信息") | ||||
| @GetMapping("/userinfo") | @GetMapping("/userinfo") | ||||
| public ResultData getUserInfo() { | public ResultData getUserInfo() { | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| WxCUserVo userVo = new WxCUserVo(); | WxCUserVo userVo = new WxCUserVo(); | ||||
| org.springframework.beans.BeanUtils.copyProperties(user, userVo); | org.springframework.beans.BeanUtils.copyProperties(user, userVo); | ||||
| userVo.setScore(0); | |||||
| userVo.setCredit(0); | |||||
| if(user.basicInfoIs()){ | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(user.getUserId()); | |||||
| if (wxCUserBasicInfo != null) { | |||||
| userVo.setScore(wxCUserBasicInfo.getPoins()); | |||||
| userVo.setCredit(wxCUserBasicInfo.getCredit()); | |||||
| userVo.setName(wxCUserBasicInfo.getName()); | |||||
| userVo.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||||
| userVo.setSex(wxCUserBasicInfo.getSex()); | |||||
| userVo.setAddress(wxCUserBasicInfo.getAddress()); | |||||
| userVo.setStatus(wxCUserBasicInfo.getStatus()); | |||||
| } | |||||
| } | |||||
| if (userVo.getScore() == null) | if (userVo.getScore() == null) | ||||
| userVo.setScore(0); | userVo.setScore(0); | ||||
| Integer levelScore = 0; | Integer levelScore = 0; | ||||
| Integer levelTarget= 0; | Integer levelTarget= 0; | ||||
| userVo.setLevelName(WxLevelConfigService.DEFAULT_LEVEL); | userVo.setLevelName(WxLevelConfigService.DEFAULT_LEVEL); | ||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(user.getTenantId()); | |||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(getTenantInfo()); | |||||
| if (levelList.size() > 0) | if (levelList.size() > 0) | ||||
| levelTarget = levelList.get(0).getPoints(); | levelTarget = levelList.get(0).getPoints(); | ||||
| for (int i = 0; i<levelList.size(); i++) { | for (int i = 0; i<levelList.size(); i++) { | ||||
| @@ -776,31 +831,19 @@ public class WxUserGrantController extends BaseController { | |||||
| userVo.setUpgradeScore(levelTarget-userVo.getScore()); | userVo.setUpgradeScore(levelTarget-userVo.getScore()); | ||||
| } | } | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(user.getId()); | |||||
| if (wxCUserBasicInfo != null) { | |||||
| userVo.setName(wxCUserBasicInfo.getName()); | |||||
| userVo.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||||
| userVo.setSex(wxCUserBasicInfo.getSex()); | |||||
| userVo.setAddress(wxCUserBasicInfo.getAddress()); | |||||
| userVo.setStatus(wxCUserBasicInfo.getStatus()); | |||||
| } | |||||
| return new ResultData(userVo); | return new ResultData(userVo); | ||||
| } | } | ||||
| @ApiOperation("当前用户名下是否有车") | @ApiOperation("当前用户名下是否有车") | ||||
| @GetMapping("/carCount") | @GetMapping("/carCount") | ||||
| public ResultData carCount() { | public ResultData carCount() { | ||||
| WxCUser user = getUser(); | |||||
| WxCUserBasicInfo member = getMember(); | |||||
| WxCUserCar userCar = new WxCUserCar(); | WxCUserCar userCar = new WxCUserCar(); | ||||
| userCar.updateTenantInfo(user); | |||||
| userCar.setCUserId(user.getId()); | |||||
| userCar.setCUserId(member.getId()); | |||||
| Integer count = wxCUserCarService.countUserCar(userCar); | Integer count = wxCUserCarService.countUserCar(userCar); | ||||
| if (count > 0) { | if (count > 0) { | ||||
| Map returnMap = new HashMap(); | Map returnMap = new HashMap(); | ||||
| String phone = user.getPhone(); | |||||
| if (phone.contains("*")) | |||||
| phone = user.getVerifyCodePhone(); | |||||
| String phone = member.getPhone(); | |||||
| returnMap.put("phone", phone); | returnMap.put("phone", phone); | ||||
| returnMap.put("count", count); | returnMap.put("count", count); | ||||
| return new ResultData(Result.SUCCESS, "count获取成功", returnMap); | return new ResultData(Result.SUCCESS, "count获取成功", returnMap); | ||||
| @@ -815,8 +858,7 @@ public class WxUserGrantController extends BaseController { | |||||
| @GetMapping("/carList") | @GetMapping("/carList") | ||||
| public ResultData getCarList() { | public ResultData getCarList() { | ||||
| WxCUserCar userCar = new WxCUserCar(); | WxCUserCar userCar = new WxCUserCar(); | ||||
| userCar.updateTenantInfo(getTenantInfo()); | |||||
| userCar.setCUserId(getUserId()); | |||||
| userCar.setCUserId(getMemberId()); | |||||
| List<WxCUserCar> list = wxCUserCarService.getList(userCar); | List<WxCUserCar> list = wxCUserCarService.getList(userCar); | ||||
| return new ResultData(Result.SUCCESS, "获取查询成功", list); | return new ResultData(Result.SUCCESS, "获取查询成功", list); | ||||
| } | } | ||||
| @@ -842,7 +884,7 @@ public class WxUserGrantController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv 不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv 不能为空"); | ||||
| } | } | ||||
| WxCUser user = getUser(); | |||||
| WxCUser user = getWxCUser(); | |||||
| String session_key = user.getSessionKey(); | String session_key = user.getSessionKey(); | ||||
| try { | try { | ||||
| @@ -870,8 +912,6 @@ public class WxUserGrantController extends BaseController { | |||||
| public ResultData updateUserInfo(@RequestBody WxCUserBasicInfo wxCUserBasicInfo) { | public ResultData updateUserInfo(@RequestBody WxCUserBasicInfo wxCUserBasicInfo) { | ||||
| if (wxCUserBasicInfo == null) | if (wxCUserBasicInfo == null) | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| if (wxCUserBasicInfoService.getById(getUserId()) == null) | |||||
| return new ResultData(ErrorCode.USER_IS_NOT_MEMBER); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| @@ -880,15 +920,15 @@ public class WxUserGrantController extends BaseController { | |||||
| wxCUserBasicInfo.getSex() != null || | wxCUserBasicInfo.getSex() != null || | ||||
| wxCUserBasicInfo.getAddress() != null) { | wxCUserBasicInfo.getAddress() != null) { | ||||
| WxCUserBasicInfo record = new WxCUserBasicInfo(); | WxCUserBasicInfo record = new WxCUserBasicInfo(); | ||||
| record.updateTenantInfo(tenantEntity); | |||||
| record.setId(getMemberId()); | |||||
| record.setName(wxCUserBasicInfo.getName()); | record.setName(wxCUserBasicInfo.getName()); | ||||
| record.setAvatarUrl(wxCUserBasicInfo.getAvatarUrl()); | |||||
| record.setBirthdate(wxCUserBasicInfo.getBirthdate()); | record.setBirthdate(wxCUserBasicInfo.getBirthdate()); | ||||
| record.setSex(wxCUserBasicInfo.getSex()); | record.setSex(wxCUserBasicInfo.getSex()); | ||||
| record.setAddress(wxCUserBasicInfo.getAddress()); | record.setAddress(wxCUserBasicInfo.getAddress()); | ||||
| record.setId(getUserId()); | |||||
| record.setUpdateDate(new Date()); | record.setUpdateDate(new Date()); | ||||
| wxCUserBasicInfoService.update(record); | wxCUserBasicInfoService.update(record); | ||||
| wxScoreRulesService.addScore(EnumScoreType.COMPLETE_INFO, record); | |||||
| wxScoreRulesService.addScore(tenantEntity,EnumScoreType.COMPLETE_INFO, record); | |||||
| //增加积分 | //增加积分 | ||||
| WxCreditHistory wxCreditHistory = new WxCreditHistory(); | WxCreditHistory wxCreditHistory = new WxCreditHistory(); | ||||
| wxCreditHistory.setCUserId(record.getId()); | wxCreditHistory.setCUserId(record.getId()); | ||||
| @@ -896,7 +936,7 @@ public class WxUserGrantController extends BaseController { | |||||
| wxCreditHistory.setCreateDate(new Date()); | wxCreditHistory.setCreateDate(new Date()); | ||||
| wxCreditHistory.setCreditType(EnumScoreType.COMPLETE_INFO.getCode()); | wxCreditHistory.setCreditType(EnumScoreType.COMPLETE_INFO.getCode()); | ||||
| wxCreditHistory.setOperatorType(EnumUserType.CUSER.getCode()); | wxCreditHistory.setOperatorType(EnumUserType.CUSER.getCode()); | ||||
| wxCreditHistory.setOperatorId(getUserId()); | |||||
| wxCreditHistory.setOperatorId(getMemberId()); | |||||
| wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | ||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, record); | wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, record); | ||||
| } | } | ||||
| @@ -911,14 +951,13 @@ public class WxUserGrantController extends BaseController { | |||||
| @RequestMapping("/getDiscountInfo") | @RequestMapping("/getDiscountInfo") | ||||
| @ApiOperation(value = "获取用户折扣率", notes = "") | @ApiOperation(value = "获取用户折扣率", notes = "") | ||||
| public ResultData getDiscountInfo() { | public ResultData getDiscountInfo() { | ||||
| WxCUser user = getUser(); | |||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(user.getTenantId()); | |||||
| WxCUserBasicInfo member = getMember(); | |||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(getTenantInfo()); | |||||
| String level = WxLevelConfigService.DEFAULT_LEVEL; | String level = WxLevelConfigService.DEFAULT_LEVEL; | ||||
| Long levelId = 0L; | Long levelId = 0L; | ||||
| for (WxLevelConfig levelConfig : levelList) { | for (WxLevelConfig levelConfig : levelList) { | ||||
| if (user.getScore() >= levelConfig.getPoints()) { | |||||
| if (member.getPoins() >= levelConfig.getPoints()) { | |||||
| if (levelConfig.getDiscountEnable().equals(EnumLevelConfigDiscountStatus.ENABLE.getCode())) | if (levelConfig.getDiscountEnable().equals(EnumLevelConfigDiscountStatus.ENABLE.getCode())) | ||||
| levelId = levelConfig.getId(); | levelId = levelConfig.getId(); | ||||
| level = levelConfig.getLevel(); | level = levelConfig.getLevel(); | ||||
| @@ -930,7 +969,7 @@ public class WxUserGrantController extends BaseController { | |||||
| List<WxLevelMerchantCVo> levelMerchantList = wxLevelConfigService.findListCVo(levelMerchant); | List<WxLevelMerchantCVo> levelMerchantList = wxLevelConfigService.findListCVo(levelMerchant); | ||||
| Map<String, Object> result = new HashMap(); | Map<String, Object> result = new HashMap(); | ||||
| result.put("id", user.getId()); | |||||
| result.put("id", member.getId()); | |||||
| result.put("level", level); | result.put("level", level); | ||||
| result.put("levelMerchantList", levelMerchantList); | result.put("levelMerchantList", levelMerchantList); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| @@ -5,9 +5,9 @@ import com.iformall.annotation.AuthIgnore; | |||||
| import com.iformall.annotation.TenantIgnore; | import com.iformall.annotation.TenantIgnore; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.TenantThreadLocal; | import com.iformall.common.TenantThreadLocal; | ||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCUserTokenService; | |||||
| import com.iformall.service.CUserTokenService; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -27,7 +27,7 @@ import javax.servlet.http.HttpServletResponse; | |||||
| @Component | @Component | ||||
| public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | ||||
| @Autowired | @Autowired | ||||
| private WxCUserTokenService userTokenService; | |||||
| private CUserTokenService cUserTokenService; | |||||
| @Override | @Override | ||||
| public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | ||||
| @@ -59,18 +59,20 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||||
| } | } | ||||
| // 查询token信息 | // 查询token信息 | ||||
| WxCUser wxCUser = userTokenService.getByToken(token); | |||||
| if(wxCUser == null || wxCUser.getExpireTime().getTime() < System.currentTimeMillis()){ | |||||
| BaseCUserEntity cUser = cUserTokenService.getByToken(token); | |||||
| if(cUser == null || cUser.getExpireTime().getTime() < System.currentTimeMillis()){ | |||||
| throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | ||||
| } | } | ||||
| //设置userId到request里,后续根据userId,获取用户信息 | //设置userId到request里,后续根据userId,获取用户信息 | ||||
| request.setAttribute(Constant.LOGIN_USER_KEY, wxCUser.getId()); | |||||
| request.setAttribute(Constant.TENANT_ID, wxCUser.getTenantId()); | |||||
| if (StringUtils.isNotBlank(wxCUser.getParentTenantId())) { | |||||
| request.setAttribute(Constant.PARENT_TENANT_ID, wxCUser.getParentTenantId()); | |||||
| request.setAttribute(Constant.LOGIN_USER_KEY, cUser.getId()); | |||||
| request.setAttribute(Constant.TENANT_ID, cUser.getTenantId()); | |||||
| if (StringUtils.isNotBlank(cUser.getParentTenantId())) { | |||||
| request.setAttribute(Constant.PARENT_TENANT_ID, cUser.getParentTenantId()); | |||||
| } | |||||
| if(cUser.basicInfoIs()){ | |||||
| request.setAttribute(Constant.LOGIN_MEMBER_KEY, cUser.getUserId()); | |||||
| } | } | ||||
| //如果是要不需要自动设置tenantI信息 | //如果是要不需要自动设置tenantI信息 | ||||
| TenantIgnore tenantIgnoreAnnotation = null; | TenantIgnore tenantIgnoreAnnotation = null; | ||||
| @@ -82,9 +84,8 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||||
| if(tenantIgnoreAnnotation != null){ | if(tenantIgnoreAnnotation != null){ | ||||
| TenantThreadLocal.remove(); | TenantThreadLocal.remove(); | ||||
| }else { | }else { | ||||
| TenantThreadLocal.setCurrentThreadTenant(wxCUser.getTenantId(), wxCUser.getParentTenantId()); | |||||
| TenantThreadLocal.setCurrentThreadTenant(cUser.getTenantId(), cUser.getParentTenantId()); | |||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -1,8 +1,8 @@ | |||||
| package com.iformall.resolver; | package com.iformall.resolver; | ||||
| import com.iformall.annotation.LoginUser; | import com.iformall.annotation.LoginUser; | ||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.service.WxCUserTokenService; | |||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.service.CUserTokenService; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.core.MethodParameter; | import org.springframework.core.MethodParameter; | ||||
| @@ -22,11 +22,11 @@ import org.springframework.web.method.support.ModelAndViewContainer; | |||||
| @Component | @Component | ||||
| public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { | public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { | ||||
| @Autowired | @Autowired | ||||
| private WxCUserTokenService userTokenService; | |||||
| private CUserTokenService cUserTokenService; | |||||
| @Override | @Override | ||||
| public boolean supportsParameter(MethodParameter parameter) { | public boolean supportsParameter(MethodParameter parameter) { | ||||
| return parameter.getParameterType().isAssignableFrom(WxCUser.class) && parameter.hasParameterAnnotation(LoginUser.class); | |||||
| return parameter.getParameterType().isAssignableFrom(BaseCUserEntity.class) && parameter.hasParameterAnnotation(LoginUser.class); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -39,7 +39,7 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu | |||||
| } | } | ||||
| //获取用户信息 | //获取用户信息 | ||||
| WxCUser user = userTokenService.getByToken((String)object); | |||||
| BaseCUserEntity user = cUserTokenService.getByToken((String)object); | |||||
| return user; | return user; | ||||
| } | } | ||||
| @@ -86,6 +86,30 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| if ("wx_user_channel".equals(tableName)) { | if ("wx_user_channel".equals(tableName)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if ("wx_score_rules".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_level_config".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_c_user_basic_info".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_credit_history".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_score_history".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_c_user_tags".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_weapp_ext_set".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_msg_validationcode_model".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| // wx_profit_sharing_receiver | // wx_profit_sharing_receiver | ||||
| // wx_profit_sharing_result | // wx_profit_sharing_result | ||||
| return false; | return false; | ||||
| @@ -156,6 +180,9 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| if ("wx_weapp_release_status".equals(tableName)) { | if ("wx_weapp_release_status".equals(tableName)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if ("mem_coupon_from_dsp".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -62,8 +62,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -57,8 +57,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -2,6 +2,7 @@ package com.iformall.config; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -142,6 +143,40 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("baseCUserTokenRedisTemplate") | |||||
| public RedisTemplate<String, BaseCUserEntity> getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, BaseCUserEntity> template = new RedisTemplate<String, BaseCUserEntity>(); | |||||
| Jackson2JsonRedisSerializer<BaseCUserEntity> j = new Jackson2JsonRedisSerializer<BaseCUserEntity>(BaseCUserEntity.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("cUserBasicInfoRedisTemplate") | |||||
| public RedisTemplate<String, WxCUserBasicInfo> getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxCUserBasicInfo> template = new RedisTemplate<String, WxCUserBasicInfo>(); | |||||
| Jackson2JsonRedisSerializer<WxCUserBasicInfo> j = new Jackson2JsonRedisSerializer<WxCUserBasicInfo>(WxCUserBasicInfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("mallRedisTemplate") | @Bean("mallRedisTemplate") | ||||
| public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | ||||
| RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | ||||
| @@ -9,6 +9,7 @@ import com.iformall.domain.vo.WxCarCYFVo; | |||||
| import com.iformall.enums.EnumCarCmd; | import com.iformall.enums.EnumCarCmd; | ||||
| import com.iformall.enums.EnumCarVendor; | import com.iformall.enums.EnumCarVendor; | ||||
| import com.iformall.enums.EnumCouponSendSendType; | import com.iformall.enums.EnumCouponSendSendType; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.car.CYFUtil; | import com.iformall.utils.car.CYFUtil; | ||||
| import com.iformall.utils.car.TJDUtil; | import com.iformall.utils.car.TJDUtil; | ||||
| @@ -33,28 +34,31 @@ import java.util.Map; | |||||
| */ | */ | ||||
| @Slf4j | @Slf4j | ||||
| @RestController | |||||
| @RequestMapping("/carCallback") | |||||
| //@RestController | |||||
| //@RequestMapping("/carCallback") | |||||
| public class WxCarCYFCallBackController extends BaseController { | public class WxCarCYFCallBackController extends BaseController { | ||||
| @Autowired | |||||
| //@Autowired | |||||
| WxParkService wxParkService; | WxParkService wxParkService; | ||||
| @Autowired | |||||
| //@Autowired | |||||
| WxCarCmdLogService wxCarCmdLogService; | WxCarCmdLogService wxCarCmdLogService; | ||||
| @Autowired | |||||
| //@Autowired | |||||
| WxCUserService wxCUserService; | WxCUserService wxCUserService; | ||||
| @Autowired | |||||
| //@Autowired | |||||
| WxCUserCarService wxCUserCarService; | WxCUserCarService wxCUserCarService; | ||||
| @Autowired | |||||
| //@Autowired | |||||
| WxCouponSendService wxCouponSendService; | WxCouponSendService wxCouponSendService; | ||||
| @Autowired | |||||
| // @Autowired | |||||
| WxCarPayRecordService wxCarPayRecordService; | WxCarPayRecordService wxCarPayRecordService; | ||||
| //@Autowired | |||||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| /** | /** | ||||
| * @description 车易付 车辆入场通知 | * @description 车易付 车辆入场通知 | ||||
| * @Params [paramMap] | * @Params [paramMap] | ||||
| @@ -62,7 +66,7 @@ public class WxCarCYFCallBackController extends BaseController { | |||||
| * @Author furunxin | * @Author furunxin | ||||
| * @Date 2020/7/8 上午8:27 | * @Date 2020/7/8 上午8:27 | ||||
| **/ | **/ | ||||
| @PostMapping(value = "/cyfParkInCallback") | |||||
| //@PostMapping(value = "/cyfParkInCallback") | |||||
| public Map cyfParkInCallback(@RequestBody Map<String, Object> paramMap) { | public Map cyfParkInCallback(@RequestBody Map<String, Object> paramMap) { | ||||
| log.info("["+getIpAddr()+"] cyfParkInCallback: " + paramMap.toString()); | log.info("["+getIpAddr()+"] cyfParkInCallback: " + paramMap.toString()); | ||||
| //解析车易付参数 | //解析车易付参数 | ||||
| @@ -113,8 +117,8 @@ public class WxCarCYFCallBackController extends BaseController { | |||||
| boolean bFirst = true; | boolean bFirst = true; | ||||
| for (WxCUserCar userCar : userCarList) { | for (WxCUserCar userCar : userCarList) { | ||||
| userCar.setParentTenantId(park.getParentTenantId()); | userCar.setParentTenantId(park.getParentTenantId()); | ||||
| wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar); | |||||
| WxCUser cUser = wxCUserService.getById(userCar.getCUserId()); | |||||
| wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar,EnumPayWay.PAY_WAY_NOT_UNPAY_CAR_STOP); | |||||
| WxCUserBasicInfo cUser = wxCUserBasicInfoService.getById(userCar.getCUserId()); | |||||
| if(cUser != null){ | if(cUser != null){ | ||||
| if(bFirst) { | if(bFirst) { | ||||
| phoneStrs = cUser.getPhone(); | phoneStrs = cUser.getPhone(); | ||||
| @@ -163,7 +167,7 @@ public class WxCarCYFCallBackController extends BaseController { | |||||
| * @Author furunxin | * @Author furunxin | ||||
| * @Date 2020/7/12 上午9:00 | * @Date 2020/7/12 上午9:00 | ||||
| **/ | **/ | ||||
| @PostMapping(value = "/cyfParkOutCallback") | |||||
| //@PostMapping(value = "/cyfParkOutCallback") | |||||
| public Map cyfParkOutCallback(@RequestBody WxCarCYFVo param) { | public Map cyfParkOutCallback(@RequestBody WxCarCYFVo param) { | ||||
| String requestJson = JSONObject.toJSONString(param); | String requestJson = JSONObject.toJSONString(param); | ||||
| log.info("["+getIpAddr()+"cyfParkOutCallback: " + requestJson); | log.info("["+getIpAddr()+"cyfParkOutCallback: " + requestJson); | ||||
| @@ -10,6 +10,7 @@ import com.iformall.enums.EnumCarCmd; | |||||
| import com.iformall.enums.EnumCarVendor; | import com.iformall.enums.EnumCarVendor; | ||||
| import com.iformall.enums.EnumCouponSendSendType; | import com.iformall.enums.EnumCouponSendSendType; | ||||
| import com.iformall.enums.EnumETCPCode; | import com.iformall.enums.EnumETCPCode; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import com.iformall.utils.car.ETCPUtil; | import com.iformall.utils.car.ETCPUtil; | ||||
| @@ -56,6 +57,9 @@ public class WxCarETCPCallBackController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxCUserService wxCUserService; | WxCUserService wxCUserService; | ||||
| @Autowired | |||||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||||
| /** | /** | ||||
| @@ -358,8 +362,8 @@ public class WxCarETCPCallBackController extends BaseController { | |||||
| boolean bFirst = true; | boolean bFirst = true; | ||||
| for (WxCUserCar userCar : userCarList) { | for (WxCUserCar userCar : userCarList) { | ||||
| userCar.setParentTenantId(park.getParentTenantId()); | userCar.setParentTenantId(park.getParentTenantId()); | ||||
| wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar); | |||||
| WxCUser cUser = wxCUserService.getById(userCar.getCUserId()); | |||||
| wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar,EnumPayWay.PAY_WAY_NOT_UNPAY_CAR_STOP); | |||||
| WxCUserBasicInfo cUser = wxCUserBasicInfoService.getById(userCar.getCUserId()); | |||||
| if(cUser != null){ | if(cUser != null){ | ||||
| if(bFirst) { | if(bFirst) { | ||||
| phoneStrs = cUser.getPhone(); | phoneStrs = cUser.getPhone(); | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.*; | |||||
| import com.iformall.enums.EnumCarCmd; | import com.iformall.enums.EnumCarCmd; | ||||
| import com.iformall.enums.EnumCarVendor; | import com.iformall.enums.EnumCarVendor; | ||||
| import com.iformall.enums.EnumCouponSendSendType; | import com.iformall.enums.EnumCouponSendSendType; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import com.iformall.utils.car.TJDUtil; | import com.iformall.utils.car.TJDUtil; | ||||
| @@ -51,6 +52,9 @@ public class WxCarTJDCallBackController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxCUserService wxCUserService; | WxCUserService wxCUserService; | ||||
| @Autowired | |||||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| /** | /** | ||||
| * 注册车牌 | * 注册车牌 | ||||
| * @param paramMap | * @param paramMap | ||||
| @@ -165,8 +169,8 @@ public class WxCarTJDCallBackController extends BaseController { | |||||
| boolean bFirst = true; | boolean bFirst = true; | ||||
| for (WxCUserCar userCar : userCarList) { | for (WxCUserCar userCar : userCarList) { | ||||
| userCar.setParentTenantId(park.getParentTenantId()); | userCar.setParentTenantId(park.getParentTenantId()); | ||||
| wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar); | |||||
| WxCUser cUser = wxCUserService.getById(userCar.getCUserId()); | |||||
| wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar,EnumPayWay.PAY_WAY_NOT_UNPAY_CAR_STOP); | |||||
| WxCUserBasicInfo cUser = wxCUserBasicInfoService.getById(userCar.getCUserId()); | |||||
| if(cUser != null){ | if(cUser != null){ | ||||
| if(bFirst) { | if(bFirst) { | ||||
| phoneStrs = cUser.getPhone(); | phoneStrs = cUser.getPhone(); | ||||
| @@ -0,0 +1,345 @@ | |||||
| package com.iformall.controller.callback; | |||||
| import com.alibaba.fastjson.JSON; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.enums.EnumCarCmd; | |||||
| import com.iformall.enums.EnumCarVendor; | |||||
| import com.iformall.enums.EnumCouponSendSendType; | |||||
| import com.iformall.enums.EnumETCPCode; | |||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.exception.MallinkException; | |||||
| import com.iformall.service.*; | |||||
| import com.iformall.service.park.ParkFactory; | |||||
| import com.iformall.service.park.entity.ParkNotifyParam; | |||||
| import com.iformall.utils.DateUtils; | |||||
| import com.iformall.utils.car.CYFUtil; | |||||
| import com.iformall.utils.car.ETCPUtil; | |||||
| import com.iformall.utils.car.TJDUtil; | |||||
| import org.apache.commons.collections.CollectionUtils; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import java.text.ParseException; | |||||
| import java.text.SimpleDateFormat; | |||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| @RestController | |||||
| public class WxParkCallBackBaseController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| WxParkService wxParkService; | |||||
| @Autowired | |||||
| WxCUserCarService wxCUserCarService; | |||||
| @Autowired | |||||
| WxMerchantService wxMerchantService; | |||||
| @Autowired | |||||
| WxCarCmdLogService wxCarCmdLogService; | |||||
| @Autowired | |||||
| WxCouponSendService wxCouponSendService; | |||||
| @Autowired | |||||
| WxCarPayRecordService wxCarPayRecordService; | |||||
| @Autowired | |||||
| WxCUserService wxCUserService; | |||||
| @Autowired | |||||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |||||
| @Autowired | |||||
| ParkFactory parkFactory; | |||||
| private WxCarCmdLog saveWxCarCmdLog(EnumCarVendor vendor,EnumCarCmd cmdType,Object sourceParam,ParkNotifyParam param) throws MallinkException { | |||||
| Date currentDate = new Date(); | |||||
| WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | |||||
| wxCarCmdLog.setVendorType(vendor.getCode()); | |||||
| wxCarCmdLog.setCmdType(cmdType.getCode()); | |||||
| wxCarCmdLog.setCmdJson(JSON.toJSONString(sourceParam)); | |||||
| wxCarCmdLog.setCreateDate(currentDate); | |||||
| wxCarCmdLog.setUpdateDate(currentDate); | |||||
| String parkId = param.getParkId(); | |||||
| WxPark parkQ = new WxPark(); | |||||
| parkQ.setVendorType(vendor.getCode()); | |||||
| parkQ.setParkingId(parkId); | |||||
| WxPark park = wxParkService.getByObj(parkQ); | |||||
| if (park == null) { | |||||
| logger.error(parkId+"车场未找到"); | |||||
| throw new MallinkException(Result.ERROR,parkId+"车场未找到"); | |||||
| } else { | |||||
| wxCarCmdLog.updateTenantInfo(park); | |||||
| } | |||||
| // Object synId = paramMap.get(synIdkey); | |||||
| // // 检查是否有重复数据 | |||||
| // HashMap<String, Object> map = new HashMap<String, Object>(); | |||||
| // map.put("synId", synId); | |||||
| // map.put("cmdType", cmdType.getCode()); | |||||
| // if (StringUtils.isNotBlank(wxCarCmdLog.getTenantId())) { | |||||
| // map.put("tenantId", wxCarCmdLog.getTenantId()); | |||||
| // } | |||||
| // if (StringUtils.isNotBlank(wxCarCmdLog.getParentTenantId())) { | |||||
| // map.put("parentTenantId", wxCarCmdLog.getParentTenantId()); | |||||
| // } | |||||
| // WxCarCmdLog carCmdLog = wxCarCmdLogService.getBySynId(map); | |||||
| // if(carCmdLog != null) { | |||||
| // logger.error("par WxCarCmdLog synId已入库: " + paramMap.toString()); | |||||
| // } | |||||
| try { | |||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | |||||
| } catch (Exception e) { | |||||
| logger.error("parkInCallBack: 入库错误 " + e.getMessage() ,e); | |||||
| throw new MallinkException(Result.ERROR,parkId+", WxCarCmdLog入库错误"); | |||||
| } | |||||
| return wxCarCmdLog; | |||||
| } | |||||
| private WxCarPayRecord saveWxCarPayRecord(Object sourceParam,ParkNotifyParam param,WxCarCmdLog wxCarCmdLog,String phone) throws MallinkException { | |||||
| try { | |||||
| String parkName = param.getParkName(); | |||||
| // 保存WxCarPayRecord | |||||
| WxCarPayRecord record = new WxCarPayRecord(); | |||||
| record.updateTenantInfo(wxCarCmdLog); | |||||
| record.setVendorType(wxCarCmdLog.getVendorType()); | |||||
| record.setSynId(param.getSynId()); | |||||
| record.setParkId(param.getParkId()); | |||||
| record.setParkName(parkName); | |||||
| //record.setUserType(userType); | |||||
| record.setPlateNumber(param.getCarNumber()); | |||||
| record.setEntranceTime(param.getEntranceTime()); | |||||
| record.setExitTime(param.getOutTime()); | |||||
| if (null != record.getEntranceTime() && null != record.getExitTime()) { | |||||
| Long stayedTime = (record.getExitTime().getTime() - record.getEntranceTime().getTime())/ 1000; | |||||
| record.setStayedTime(stayedTime); | |||||
| } | |||||
| record.setFee(param.getFee()); | |||||
| //record.setFixParkingId(fixParkingId); | |||||
| //record.setRemainingDays(remainingDays); | |||||
| record.setPhone(phone); | |||||
| record.updateTenantInfo(wxCarCmdLog); | |||||
| WxCarPayRecord query = new WxCarPayRecord(); | |||||
| //query.updateTenantInfo(park); | |||||
| //query.setParkId(etcpParkId.toString()); | |||||
| query.setSynId(param.getSynId()); | |||||
| PageInfo<WxCarPayRecord> page = wxCarPayRecordService.findCarPayListByPage(query,1,1); | |||||
| if(page != null && CollectionUtils.isNotEmpty(page.getList())){ | |||||
| record.setId(page.getList().get(0).getId()); | |||||
| } | |||||
| wxCarPayRecordService.saveOrUpdate(record); | |||||
| return record; | |||||
| } catch (Exception e) { | |||||
| logger.error("WxCarPayRecord: 入库错误",e); | |||||
| throw new MallinkException(Result.ERROR,param.getParkId()+"parkInCallBack: WxCarPayRecord入库错误"); | |||||
| } | |||||
| } | |||||
| protected Result parkInCallBack(EnumCarVendor vendor,EnumCarCmd cmdType,Object sourceParam) { | |||||
| ParkNotifyParam param = parkFactory.getParkCallbackService(vendor.getCode()).parseInNoticyParam(sourceParam); | |||||
| //添加wxCarCmdLog | |||||
| WxCarCmdLog wxCarCmdLog = null; | |||||
| try { | |||||
| wxCarCmdLog = saveWxCarCmdLog(vendor, cmdType, sourceParam, param); | |||||
| }catch(MallinkException e) { | |||||
| return new Result(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| String carNumber = param.getCarNumber(); | |||||
| String phoneStrs = ""; | |||||
| // 停车发券 | |||||
| if (!StringUtils.isBlank(carNumber)) { | |||||
| // 根据车牌查找用户 | |||||
| WxCUserCar userCarQ = new WxCUserCar(); | |||||
| if (StringUtils.isNotBlank(wxCarCmdLog.getTenantId())) { | |||||
| userCarQ.setTenantId(wxCarCmdLog.getTenantId()); | |||||
| } | |||||
| userCarQ.setCarNumber(carNumber); | |||||
| userCarQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | |||||
| // TODO 可能多用户关联同一张车牌 | |||||
| List<WxCUserCar> userCarList = wxCUserCarService.getList(userCarQ); | |||||
| boolean bFirst = true; | |||||
| for (WxCUserCar userCar : userCarList) { | |||||
| userCar.setParentTenantId(wxCarCmdLog.getParentTenantId()); | |||||
| wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar,EnumPayWay.PAY_WAY_NOT_UNPAY_CAR_STOP); | |||||
| WxCUserBasicInfo cUser = wxCUserBasicInfoService.getById(userCar.getCUserId()); | |||||
| if(cUser != null){ | |||||
| if(bFirst) { | |||||
| phoneStrs = cUser.getPhone(); | |||||
| bFirst = false; | |||||
| } else { | |||||
| phoneStrs += "," + cUser.getPhone(); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| try { | |||||
| saveWxCarPayRecord(sourceParam, param, wxCarCmdLog, phoneStrs); | |||||
| }catch(MallinkException e) { | |||||
| return new Result(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| return new Result(); | |||||
| } | |||||
| protected Result parkOutCallBack(EnumCarVendor vendor,EnumCarCmd cmdType,Object sourceParam) { | |||||
| ParkNotifyParam param = parkFactory.getParkCallbackService(vendor.getCode()).parseOutNoticyParam(sourceParam); | |||||
| WxCarCmdLog wxCarCmdLog = null; | |||||
| try { | |||||
| wxCarCmdLog = saveWxCarCmdLog(vendor, cmdType, sourceParam, param); | |||||
| }catch(MallinkException e) { | |||||
| return new Result(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| try { | |||||
| saveWxCarPayRecord(sourceParam,param, wxCarCmdLog, null); | |||||
| }catch(MallinkException e) { | |||||
| return new Result(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| return new Result(); | |||||
| } | |||||
| protected Result unbindCarCallBack(EnumCarVendor vendor,EnumCarCmd cmdType,Object sourceParam) { | |||||
| ParkNotifyParam param = parkFactory.getParkCallbackService(vendor.getCode()).parseUnbindNoticyParam(sourceParam); | |||||
| WxCarCmdLog wxCarCmdLog = null; | |||||
| try { | |||||
| wxCarCmdLog = saveWxCarCmdLog(vendor, cmdType, sourceParam, param); | |||||
| }catch(MallinkException e) { | |||||
| return new Result(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| String carNumber = param.getCarNumber(); | |||||
| WxCUserCar userCarQ = new WxCUserCar(); | |||||
| userCarQ.setVendorType(vendor.getCode()); | |||||
| userCarQ.setCarNumber(carNumber); | |||||
| // 数据库里删除,保持同步 | |||||
| try { | |||||
| wxCUserCarService.deleteByObj(userCarQ); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| } | |||||
| // 营销 - 短信 | |||||
| return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage()); | |||||
| } | |||||
| protected Result paidCallback(EnumCarVendor vendor,EnumCarCmd cmdType,Object sourceParam) { | |||||
| ParkNotifyParam param = parkFactory.getParkCallbackService(vendor.getCode()).parsePaidNoticyParam(sourceParam); | |||||
| WxCarCmdLog carCmdLogQ = new WxCarCmdLog(); | |||||
| String parkId = param.getParkId(); | |||||
| WxPark parkQ = new WxPark(); | |||||
| parkQ.setVendorType(vendor.getCode()); | |||||
| parkQ.setParkingId(parkId); | |||||
| WxPark park = wxParkService.getByObj(parkQ); | |||||
| if (park == null) { | |||||
| logger.error(parkId+"车场未找到"); | |||||
| throw new MallinkException(Result.ERROR,parkId+"车场未找到"); | |||||
| } else { | |||||
| carCmdLogQ.updateTenantInfo(park); | |||||
| } | |||||
| carCmdLogQ.setVendorType(vendor.getCode()); | |||||
| carCmdLogQ.setCmdType(cmdType.getCode()); | |||||
| carCmdLogQ.setSynId(param.getParkOrderId()); | |||||
| carCmdLogQ.setPlateNumber(param.getCarNumber()); | |||||
| // 检查是否有重复数据 | |||||
| String paidServiceFee = param.getPaidServiceFee(); | |||||
| String fee = param.getFee(); | |||||
| carCmdLogQ.setCmdType(cmdType.getCode()); | |||||
| carCmdLogQ.setPlateNumber(param.getCarNumber()); | |||||
| carCmdLogQ.setOrderId(param.getParkOrderId()); | |||||
| carCmdLogQ.setFee(fee); | |||||
| carCmdLogQ.setFeeTime(dateFormat.format(param.getPayTime())); | |||||
| WxCarCmdLog carCmdLog = wxCarCmdLogService.getByOrderId(carCmdLogQ); | |||||
| if(carCmdLog != null) { | |||||
| logger.error("ETCP order paid 已入库: " + param.getParkOrderId()); | |||||
| } | |||||
| Date currentDate = new Date(); | |||||
| WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | |||||
| wxCarCmdLog.updateTenantInfo(park); | |||||
| if(carCmdLog != null) { | |||||
| // 如果有15分钟的已支付的数据,自动覆盖 | |||||
| wxCarCmdLog.setId(carCmdLog.getId()); | |||||
| } | |||||
| wxCarCmdLog.setVendorType(vendor.getCode()); | |||||
| wxCarCmdLog.setCmdType(cmdType.getCode()); | |||||
| wxCarCmdLog.setCmdJson(JSON.toJSONString(sourceParam)); | |||||
| wxCarCmdLog.setCreateDate(currentDate); | |||||
| wxCarCmdLog.setUpdateDate(currentDate); | |||||
| try { | |||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | |||||
| } catch (Exception e) { | |||||
| logger.error("etcpPaidCallback: 入库错误 ",e); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "wxCarCmdLog入库错误"); | |||||
| } | |||||
| try { | |||||
| // 保存WxCarPayRecord | |||||
| WxCarPayRecord record = new WxCarPayRecord(); | |||||
| record.setSynId(param.getParkOrderId()); | |||||
| record.setFee(fee); | |||||
| record.setFeeTime(param.getPayTime()); | |||||
| record.setPaidServiceFee(paidServiceFee); | |||||
| record.setVendorType(wxCarCmdLog.getVendorType()); | |||||
| record.setPlateNumber(param.getCarNumber()); | |||||
| record.updateTenantInfo(park); | |||||
| WxCarPayRecord query = new WxCarPayRecord(); | |||||
| query.setSynId(param.getParkOrderId()); | |||||
| PageInfo<WxCarPayRecord> page = wxCarPayRecordService.findCarPayListByPage(query,1,2); | |||||
| if(page != null && page.getList().size() > 0){ | |||||
| if(page.getList().size() >= 2){ | |||||
| wxCarPayRecordService.saveOrUpdate(record); | |||||
| } else { | |||||
| WxCarPayRecord r = page.getList().get(0); | |||||
| if(r.getFeeTime() == null) { | |||||
| // 无缴费信息, 更新 | |||||
| record.setId(r.getId()); | |||||
| wxCarPayRecordService.saveOrUpdate(record); | |||||
| } else { | |||||
| // 缴费时间在15分钟以内,更新之前的数据, ETCP会把之前的缴费自动退款 | |||||
| if(DateUtils.isInDate15Mins(param.getPayTime(), r.getFeeTime())) { | |||||
| record.setId(r.getId()); | |||||
| } | |||||
| wxCarPayRecordService.saveOrUpdate(record); | |||||
| } | |||||
| } | |||||
| } else { | |||||
| wxCarPayRecordService.saveOrUpdate(record); | |||||
| } | |||||
| } catch (Exception e) { | |||||
| logger.error("WxCarPayRecord: 缴费更新错误 " +e.getMessage(),e); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "WxCarPayRecord入库错误"); | |||||
| //return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||||
| } | |||||
| // 营销 - 短信 | |||||
| return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage()); | |||||
| } | |||||
| } | |||||
| @@ -68,7 +68,7 @@ public class WxPayBillController extends BaseController { | |||||
| try { | try { | ||||
| paramMap = WxPayment.xmlToMap(resultxml); | paramMap = WxPayment.xmlToMap(resultxml); | ||||
| logger.info("微信支付回调, notify, param: " + paramMap.toString() ); | logger.info("微信支付回调, notify, param: " + paramMap.toString() ); | ||||
| String response = wxPayBillService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| String response = wxPayBillService.notify(paramMap, EnumPayWay.PAY_WAY_WECHAT); | |||||
| logger.info("微信支付回调, notify success, req : " + resultxml + ", resp: " + response.toString()); | logger.info("微信支付回调, notify success, req : " + resultxml + ", resp: " + response.toString()); | ||||
| return response; | return response; | ||||
| } catch (BizMessageException e) { | } catch (BizMessageException e) { | ||||
| @@ -120,7 +120,7 @@ public class WxPayBillController extends BaseController { | |||||
| xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | ||||
| logger.info(xml); | logger.info(xml); | ||||
| paramMap = WxPayment.xmlToMap(xml); | paramMap = WxPayment.xmlToMap(xml); | ||||
| response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WECHAT); | |||||
| logger.info("refund wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | logger.info("refund wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | ||||
| return response; | return response; | ||||
| } catch (BizMessageException e) { | } catch (BizMessageException e) { | ||||
| @@ -159,7 +159,7 @@ public class WxPayBillController extends BaseController { | |||||
| xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | ||||
| paramMap = WxPayment.xmlToMap(xml); | paramMap = WxPayment.xmlToMap(xml); | ||||
| logger.info("share wxpay, notify, param: " + xml ); | logger.info("share wxpay, notify, param: " + xml ); | ||||
| response = wxPayBillService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| response = wxPayBillService.notify(paramMap, EnumPayWay.PAY_WAY_WECHAT); | |||||
| logger.info("share wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | logger.info("share wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | ||||
| return response; | return response; | ||||
| } catch (BizMessageException e) { | } catch (BizMessageException e) { | ||||
| @@ -136,7 +136,7 @@ public class WxPayController extends BaseController { | |||||
| FmInsideNotifyRefundSuccessMsg refundSuccessMsg = new FmInsideNotifyRefundSuccessMsg(); | FmInsideNotifyRefundSuccessMsg refundSuccessMsg = new FmInsideNotifyRefundSuccessMsg(); | ||||
| refundSuccessMsg.setMsgType(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode()); | refundSuccessMsg.setMsgType(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode()); | ||||
| refundSuccessMsg.setDelayTimeLevel(3); | refundSuccessMsg.setDelayTimeLevel(3); | ||||
| refundSuccessMsg.setPayWay(EnumPayWay.PAY_WAY_WEAPP.getCode()); | |||||
| refundSuccessMsg.setPayWay(EnumPayWay.PAY_WAY_WECHAT.getCode()); | |||||
| refundSuccessMsg.setJsonMsg(jsonMsg); | refundSuccessMsg.setJsonMsg(jsonMsg); | ||||
| // response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | // response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | ||||
| @@ -180,7 +180,7 @@ public class WxPayController extends BaseController { | |||||
| xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | ||||
| paramMap = WxPayment.xmlToMap(xml); | paramMap = WxPayment.xmlToMap(xml); | ||||
| logger.info("share wxpay, notify, param: " + xml ); | logger.info("share wxpay, notify, param: " + xml ); | ||||
| response = wxPayOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| response = wxPayOrderService.shareNotify(paramMap, EnumPayWay.PAY_WAY_WECHAT); | |||||
| logger.info("share wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | logger.info("share wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | ||||
| return response; | return response; | ||||
| } catch (BizMessageException e) { | } catch (BizMessageException e) { | ||||
| @@ -209,62 +209,62 @@ public class WxPayController extends BaseController { | |||||
| * @return 接收微信异步通知 | * @return 接收微信异步通知 | ||||
| * @throws Exception 可能产生的任何异常 | * @throws Exception 可能产生的任何异常 | ||||
| */ | */ | ||||
| @RequestMapping(value = "/subsidyPay", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| @ResponseBody | |||||
| public String _subsidyPayNotify(HttpServletRequest request) throws IOException, JDOMException { | |||||
| logger.info("[" +getIpAddr() + "] 补贴微信支付回调"); | |||||
| InputStream inStream = request.getInputStream(); | |||||
| ByteArrayOutputStream outSteam = new ByteArrayOutputStream(); | |||||
| byte[] buffer = new byte[1024]; | |||||
| int len = 0; | |||||
| while ((len = inStream.read(buffer)) != -1) { | |||||
| outSteam.write(buffer, 0, len); | |||||
| } | |||||
| String resultxml = new String(outSteam.toByteArray(), Charset.forName("UTF-8")); | |||||
| logger.info(resultxml); | |||||
| outSteam.close(); | |||||
| inStream.close(); | |||||
| Map<String, String> paramMap = null; | |||||
| try { | |||||
| paramMap = WxPayment.xmlToMap(resultxml); | |||||
| logger.info("微信支付回调, notify, param: " + paramMap.toString() ); | |||||
| String response = wxSubsidyService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| logger.info("微信支付回调, notify success, req : " + resultxml + ", resp: " + response.toString()); | |||||
| return response; | |||||
| } catch (BizMessageException e) { | |||||
| if (paramMap == null) { | |||||
| logger.error("微信支付回调, order create error, e: " + e.getMessage()); | |||||
| } else { | |||||
| logger.error("微信支付回调, order create error, req: " + resultxml + ", e: " + e.getMessage()); | |||||
| } | |||||
| SortedMap resultMap = new TreeMap<>(); | |||||
| resultMap.put("return_code", "FAIL"); | |||||
| resultMap.put("return_msg", e.getMessage()); | |||||
| return XmlUtil.getRequestXml(resultMap); | |||||
| } catch (MallinkException e) { | |||||
| if (paramMap == null) { | |||||
| logger.error("微信支付回调, order create error, e: " + e.getMessage()); | |||||
| } else { | |||||
| logger.error("微信支付回调, order create error, req: " + resultxml + ", e: " + e.getMessage()); | |||||
| } | |||||
| SortedMap resultMap = new TreeMap<>(); | |||||
| resultMap.put("return_code", "FAIL"); | |||||
| resultMap.put("return_msg", e.getMessage()); | |||||
| return XmlUtil.getRequestXml(resultMap); | |||||
| } catch (Exception e) { | |||||
| if (paramMap == null) { | |||||
| logger.error("微信支付回调, order create error, e: " + e.getMessage()); | |||||
| } else { | |||||
| logger.error("微信支付回调, order create error, req: " + resultxml + ", e: " + e.getMessage()); | |||||
| } | |||||
| SortedMap resultMap = new TreeMap(); | |||||
| resultMap.put("return_code", "FAIL"); | |||||
| resultMap.put("return_msg", e.getMessage()); | |||||
| return XmlUtil.getRequestXml(resultMap); | |||||
| } | |||||
| } | |||||
| // @RequestMapping(value = "/subsidyPay", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| // @ResponseBody | |||||
| // public String _subsidyPayNotify(HttpServletRequest request) throws IOException, JDOMException { | |||||
| // logger.info("[" +getIpAddr() + "] 补贴微信支付回调"); | |||||
| // InputStream inStream = request.getInputStream(); | |||||
| // ByteArrayOutputStream outSteam = new ByteArrayOutputStream(); | |||||
| // byte[] buffer = new byte[1024]; | |||||
| // int len = 0; | |||||
| // while ((len = inStream.read(buffer)) != -1) { | |||||
| // outSteam.write(buffer, 0, len); | |||||
| // } | |||||
| // String resultxml = new String(outSteam.toByteArray(), Charset.forName("UTF-8")); | |||||
| // logger.info(resultxml); | |||||
| // | |||||
| // outSteam.close(); | |||||
| // inStream.close(); | |||||
| // | |||||
| // Map<String, String> paramMap = null; | |||||
| // | |||||
| // try { | |||||
| // paramMap = WxPayment.xmlToMap(resultxml); | |||||
| // logger.info("微信支付回调, notify, param: " + paramMap.toString() ); | |||||
| // String response = wxSubsidyService.notify(paramMap, EnumPayWay.PAY_WAY_WECHAT); | |||||
| // logger.info("微信支付回调, notify success, req : " + resultxml + ", resp: " + response.toString()); | |||||
| // return response; | |||||
| // } catch (BizMessageException e) { | |||||
| // if (paramMap == null) { | |||||
| // logger.error("微信支付回调, order create error, e: " + e.getMessage()); | |||||
| // } else { | |||||
| // logger.error("微信支付回调, order create error, req: " + resultxml + ", e: " + e.getMessage()); | |||||
| // } | |||||
| // SortedMap resultMap = new TreeMap<>(); | |||||
| // resultMap.put("return_code", "FAIL"); | |||||
| // resultMap.put("return_msg", e.getMessage()); | |||||
| // return XmlUtil.getRequestXml(resultMap); | |||||
| // } catch (MallinkException e) { | |||||
| // if (paramMap == null) { | |||||
| // logger.error("微信支付回调, order create error, e: " + e.getMessage()); | |||||
| // } else { | |||||
| // logger.error("微信支付回调, order create error, req: " + resultxml + ", e: " + e.getMessage()); | |||||
| // } | |||||
| // SortedMap resultMap = new TreeMap<>(); | |||||
| // resultMap.put("return_code", "FAIL"); | |||||
| // resultMap.put("return_msg", e.getMessage()); | |||||
| // return XmlUtil.getRequestXml(resultMap); | |||||
| // } catch (Exception e) { | |||||
| // if (paramMap == null) { | |||||
| // logger.error("微信支付回调, order create error, e: " + e.getMessage()); | |||||
| // } else { | |||||
| // logger.error("微信支付回调, order create error, req: " + resultxml + ", e: " + e.getMessage()); | |||||
| // } | |||||
| // SortedMap resultMap = new TreeMap(); | |||||
| // resultMap.put("return_code", "FAIL"); | |||||
| // resultMap.put("return_msg", e.getMessage()); | |||||
| // return XmlUtil.getRequestXml(resultMap); | |||||
| // } | |||||
| // } | |||||
| } | } | ||||
| @@ -0,0 +1,107 @@ | |||||
| package com.iformall.controller.callback.cyf; | |||||
| import com.alibaba.fastjson.JSON; | |||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.controller.callback.WxParkCallBackBaseController; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.vo.WxCarCYFVo; | |||||
| import com.iformall.enums.EnumCarCmd; | |||||
| import com.iformall.enums.EnumCarVendor; | |||||
| import com.iformall.enums.EnumCouponSendSendType; | |||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.*; | |||||
| import com.iformall.utils.car.CYFUtil; | |||||
| import com.iformall.utils.car.TJDUtil; | |||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.apache.commons.collections.CollectionUtils; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| /** | |||||
| * @author: furunxin | |||||
| * @Date: 2020/7/6 15:29 | |||||
| * @Description: 车易付回调接口 | |||||
| */ | |||||
| @Slf4j | |||||
| @RestController | |||||
| @RequestMapping("/carCallback") | |||||
| public class WxCarCYFCallBackController extends WxParkCallBackBaseController { | |||||
| @Autowired | |||||
| WxParkService wxParkService; | |||||
| @Autowired | |||||
| WxCarCmdLogService wxCarCmdLogService; | |||||
| @Autowired | |||||
| WxCUserService wxCUserService; | |||||
| @Autowired | |||||
| WxCUserCarService wxCUserCarService; | |||||
| @Autowired | |||||
| WxCouponSendService wxCouponSendService; | |||||
| @Autowired | |||||
| WxCarPayRecordService wxCarPayRecordService; | |||||
| @Autowired | |||||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| /** | |||||
| * @description 车易付 车辆入场通知 | |||||
| * @Params [paramMap] | |||||
| * @return com.iformall.common.Result | |||||
| * @Author furunxin | |||||
| * @Date 2020/7/8 上午8:27 | |||||
| **/ | |||||
| @PostMapping(value = "/cyfParkInCallback") | |||||
| public Result cyfParkInCallback(@RequestBody Map<String, Object> paramMap) { | |||||
| log.info("["+getIpAddr()+"] cyfParkInCallback: " + paramMap.toString()); | |||||
| //解析车易付参数 | |||||
| return super.parkInCallBack(EnumCarVendor.CAE_CYF, EnumCarCmd.CAR_CYF_CALLBACK_PARK_IN, paramMap); | |||||
| } | |||||
| /** | |||||
| * @description 车易付 车辆离场通知 | |||||
| * @Params [param] | |||||
| * @return java.util.Map | |||||
| * @Author furunxin | |||||
| * @Date 2020/7/12 上午9:00 | |||||
| **/ | |||||
| @PostMapping(value = "/cyfParkOutCallback") | |||||
| public Result cyfParkOutCallback(@RequestBody WxCarCYFVo param) { | |||||
| String requestJson = JSONObject.toJSONString(param); | |||||
| log.info("["+getIpAddr()+"cyfParkOutCallback: " + requestJson); | |||||
| return super.parkOutCallBack(EnumCarVendor.CAE_CYF, EnumCarCmd.CAR_CYF_CALLBACK_PARK_OUT, param); | |||||
| } | |||||
| @PostMapping(value = "/cyfUnbindCallback") | |||||
| public Result cyfUnbindCallback(@RequestBody Map<String, Object> paramMap) { | |||||
| log.info("["+getIpAddr()+"] cyfParkInCallback: " + paramMap.toString()); | |||||
| //解析车易付参数 | |||||
| return super.unbindCarCallBack(EnumCarVendor.CAE_CYF, EnumCarCmd.CAR_CYF_CALLBACK_UNBIND, paramMap); | |||||
| } | |||||
| @PostMapping(value = "/cyfPaidCallback") | |||||
| public Result cyfPaidCallback(@RequestBody Map<String, Object> paramMap) { | |||||
| log.info("["+getIpAddr()+"] cyfParkInCallback: " + paramMap.toString()); | |||||
| //解析车易付参数 | |||||
| return super.paidCallback(EnumCarVendor.CAE_CYF, EnumCarCmd.CAR_CYF_CALLBACK_PAID, paramMap); | |||||
| } | |||||
| } | |||||
| @@ -63,8 +63,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -58,8 +58,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -2,6 +2,7 @@ package com.iformall.config; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -127,6 +128,40 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("baseCUserTokenRedisTemplate") | |||||
| public RedisTemplate<String, BaseCUserEntity> getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, BaseCUserEntity> template = new RedisTemplate<String, BaseCUserEntity>(); | |||||
| Jackson2JsonRedisSerializer<BaseCUserEntity> j = new Jackson2JsonRedisSerializer<BaseCUserEntity>(BaseCUserEntity.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("cUserBasicInfoRedisTemplate") | |||||
| public RedisTemplate<String, WxCUserBasicInfo> getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxCUserBasicInfo> template = new RedisTemplate<String, WxCUserBasicInfo>(); | |||||
| Jackson2JsonRedisSerializer<WxCUserBasicInfo> j = new Jackson2JsonRedisSerializer<WxCUserBasicInfo>(WxCUserBasicInfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("mallRedisTemplate") | @Bean("mallRedisTemplate") | ||||
| public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | ||||
| RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | ||||
| @@ -35,14 +35,16 @@ public class MqBaseConsumer { | |||||
| @Autowired | @Autowired | ||||
| private FmInsideCouponVerifyMsgServiceImpl fmInsideCouponVerifyMsgService; | private FmInsideCouponVerifyMsgServiceImpl fmInsideCouponVerifyMsgService; | ||||
| @Autowired | @Autowired | ||||
| private FmInsideCLoginMsgServiceImpl fmInsideCLoginMsgService; | |||||
| @Autowired | |||||
| private MqBaseProducer mqBaseProducer; | private MqBaseProducer mqBaseProducer; | ||||
| @Autowired | |||||
| private FmInsideNotifyPaySuccessMsgServiceImpl fmInsideNotifyPaySuccessMsgService; | |||||
| //@Autowired | |||||
| //private FmInsideNotifyPaySuccessMsgServiceImpl fmInsideNotifyPaySuccessMsgService; | |||||
| @Autowired | @Autowired | ||||
| private FmInsideNotifyRefundSuccessMsgServiceImpl fmInsideNotifyRefundSuccessMsgService; | private FmInsideNotifyRefundSuccessMsgServiceImpl fmInsideNotifyRefundSuccessMsgService; | ||||
| @Autowired | |||||
| UpdateCouponStockMsgServiceImpl updateCouponStockMsgService; | |||||
| //@Autowired | |||||
| //UpdateCouponStockMsgServiceImpl updateCouponStockMsgService; | |||||
| @@ -88,19 +90,22 @@ public class MqBaseConsumer { | |||||
| } else if(EnumMsgRecordType.INSIDE_C_LOGIN.getCode().equals(baseMsg.getMsgType())) { | } else if(EnumMsgRecordType.INSIDE_C_LOGIN.getCode().equals(baseMsg.getMsgType())) { | ||||
| // 内部消息 - c端登录 | // 内部消息 - c端登录 | ||||
| FmInsideCLoginMsg msg = (FmInsideCLoginMsg)JsonUtil.readValue(message,FmInsideCLoginMsg.class); | FmInsideCLoginMsg msg = (FmInsideCLoginMsg)JsonUtil.readValue(message,FmInsideCLoginMsg.class); | ||||
| fmInsideCouponVerifyMsgService.send(msg); | |||||
| } else if(EnumMsgRecordType.INSIDE_NOTIFY_PAY_SUCCESS.getCode().equals(baseMsg.getMsgType())) { | |||||
| fmInsideCLoginMsgService.send(msg); | |||||
| } | |||||
| //else if(EnumMsgRecordType.INSIDE_NOTIFY_PAY_SUCCESS.getCode().equals(baseMsg.getMsgType())) { | |||||
| // 内部消息 - 微信支付通知 | // 内部消息 - 微信支付通知 | ||||
| FmInsideNotifyPaySuccessMsg msg = (FmInsideNotifyPaySuccessMsg)JsonUtil.readValue(message,FmInsideNotifyPaySuccessMsg.class); | |||||
| fmInsideNotifyPaySuccessMsgService.send(msg); | |||||
| } else if(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode().equals(baseMsg.getMsgType())) { | |||||
| //FmInsideNotifyPaySuccessMsg msg = (FmInsideNotifyPaySuccessMsg)JsonUtil.readValue(message,FmInsideNotifyPaySuccessMsg.class); | |||||
| //fmInsideNotifyPaySuccessMsgService.send(msg); | |||||
| //} | |||||
| else if(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode().equals(baseMsg.getMsgType())) { | |||||
| // 内部消息 - 微信退款通知 | // 内部消息 - 微信退款通知 | ||||
| FmInsideNotifyRefundSuccessMsg msg = (FmInsideNotifyRefundSuccessMsg)JsonUtil.readValue(message,FmInsideNotifyRefundSuccessMsg.class); | FmInsideNotifyRefundSuccessMsg msg = (FmInsideNotifyRefundSuccessMsg)JsonUtil.readValue(message,FmInsideNotifyRefundSuccessMsg.class); | ||||
| fmInsideNotifyRefundSuccessMsgService.send(msg); | fmInsideNotifyRefundSuccessMsgService.send(msg); | ||||
| } else if (EnumMsgRecordType.COUPON_STOCK.getCode().equals(baseMsg.getMsgType())) { | |||||
| UpdateCouponStockMsg msg = (UpdateCouponStockMsg)JsonUtil.readValue(message,UpdateCouponStockMsg.class); | |||||
| updateCouponStockMsgService.send(msg); | |||||
| } | |||||
| } | |||||
| //else if (EnumMsgRecordType.COUPON_STOCK.getCode().equals(baseMsg.getMsgType())) { | |||||
| // UpdateCouponStockMsg msg = (UpdateCouponStockMsg)JsonUtil.readValue(message,UpdateCouponStockMsg.class); | |||||
| // updateCouponStockMsgService.send(msg); | |||||
| //} | |||||
| //baseMsg.setMsgStatus(EnumMsgRecordStatus.CONSUME_SUCC.getCode()); | //baseMsg.setMsgStatus(EnumMsgRecordStatus.CONSUME_SUCC.getCode()); | ||||
| //wxMsgRecordMapper.updateByBaseMsg(baseMsg); | //wxMsgRecordMapper.updateByBaseMsg(baseMsg); | ||||
| }catch (Throwable e){ | }catch (Throwable e){ | ||||
| @@ -64,8 +64,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -57,8 +57,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -2,6 +2,7 @@ package com.iformall.config; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -105,6 +106,40 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("baseCUserTokenRedisTemplate") | |||||
| public RedisTemplate<String, BaseCUserEntity> getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, BaseCUserEntity> template = new RedisTemplate<String, BaseCUserEntity>(); | |||||
| Jackson2JsonRedisSerializer<BaseCUserEntity> j = new Jackson2JsonRedisSerializer<BaseCUserEntity>(BaseCUserEntity.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("cUserBasicInfoRedisTemplate") | |||||
| public RedisTemplate<String, WxCUserBasicInfo> getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxCUserBasicInfo> template = new RedisTemplate<String, WxCUserBasicInfo>(); | |||||
| Jackson2JsonRedisSerializer<WxCUserBasicInfo> j = new Jackson2JsonRedisSerializer<WxCUserBasicInfo>(WxCUserBasicInfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("mallRedisTemplate") | @Bean("mallRedisTemplate") | ||||
| public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | ||||
| RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | ||||
| @@ -41,7 +41,7 @@ public class PosServiceImpl implements PosService { | |||||
| private final WxMallService mallService; | private final WxMallService mallService; | ||||
| private final PosMallConfigService posMallConfigService; | private final PosMallConfigService posMallConfigService; | ||||
| private final WxCUserService cUserService; | |||||
| private final WxCUserBasicInfoService cUserBasicInfoService; | |||||
| private final WxLevelConfigService levelConfigService; | private final WxLevelConfigService levelConfigService; | ||||
| private final WxCouponOrderService couponOrderService; | private final WxCouponOrderService couponOrderService; | ||||
| private final WxMerchantService merchantService; | private final WxMerchantService merchantService; | ||||
| @@ -286,7 +286,7 @@ public class PosServiceImpl implements PosService { | |||||
| dataMap.put(WxPayConstant.ORDER_AMOUNT_LEFT, orderAmountLeftStr); | dataMap.put(WxPayConstant.ORDER_AMOUNT_LEFT, orderAmountLeftStr); | ||||
| } | } | ||||
| WxCUser user = null; | |||||
| WxCUserBasicInfo user = null; | |||||
| if (StringUtils.isNotBlank(cardIdStr)) { | if (StringUtils.isNotBlank(cardIdStr)) { | ||||
| Long cardId; | Long cardId; | ||||
| try { | try { | ||||
| @@ -299,7 +299,7 @@ public class PosServiceImpl implements PosService { | |||||
| if (couponOrder == null) { | if (couponOrder == null) { | ||||
| throw new MallinkException(ErrorCode.CARD_IS_NOT_FOUND); | throw new MallinkException(ErrorCode.CARD_IS_NOT_FOUND); | ||||
| } | } | ||||
| user = cUserService.getById(couponOrder.getOwnerId()); | |||||
| user = cUserBasicInfoService.getById(couponOrder.getOwnerId()); | |||||
| } else { | } else { | ||||
| if (StringUtils.isBlank(memIdStr) && StringUtils.isBlank(memPhoneStr)) { | if (StringUtils.isBlank(memIdStr) && StringUtils.isBlank(memPhoneStr)) { | ||||
| errParam2(WxPayConstant.MEM_ID, WxPayConstant.MEM_PHONE); | errParam2(WxPayConstant.MEM_ID, WxPayConstant.MEM_PHONE); | ||||
| @@ -687,8 +687,8 @@ public class PosServiceImpl implements PosService { | |||||
| return couponOrderCVo; | return couponOrderCVo; | ||||
| } | } | ||||
| private WxCUser getMemUser(TenantEntity tenantEntity, String memIdStr, String memPhoneStr) { | |||||
| WxCUser user = null; | |||||
| private WxCUserBasicInfo getMemUser(TenantEntity tenantEntity, String memIdStr, String memPhoneStr) { | |||||
| WxCUserBasicInfo user = null; | |||||
| if (StringUtils.isNotBlank(memIdStr)) { | if (StringUtils.isNotBlank(memIdStr)) { | ||||
| Long memId; | Long memId; | ||||
| try { | try { | ||||
| @@ -697,14 +697,10 @@ public class PosServiceImpl implements PosService { | |||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), e.getMessage()); | throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), e.getMessage()); | ||||
| } | } | ||||
| user = cUserService.getById(memId); | |||||
| user = cUserBasicInfoService.getById(memId); | |||||
| } | } | ||||
| if (StringUtils.isNotBlank(memPhoneStr)) { | if (StringUtils.isNotBlank(memPhoneStr)) { | ||||
| WxCUser q = new WxCUser(); | |||||
| q.updateTenantInfo(tenantEntity); | |||||
| q.setPhone(memPhoneStr); | |||||
| user = cUserService.getByObject(q); | |||||
| user = cUserBasicInfoService.findInfoByPhone(tenantEntity,memPhoneStr); | |||||
| } | } | ||||
| return user; | return user; | ||||
| } | } | ||||
| @@ -718,16 +714,17 @@ public class PosServiceImpl implements PosService { | |||||
| * @param merchantId | * @param merchantId | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| private JSONObject getMemLevelDiscount(PromotionCalc promotionCalc, Integer discountConfig, TenantEntity tenantEntity, WxCUser user, Long merchantId) { | |||||
| private JSONObject getMemLevelDiscount(PromotionCalc promotionCalc, Integer discountConfig, | |||||
| TenantEntity tenantEntity, WxCUserBasicInfo user, Long merchantId) { | |||||
| JSONObject discountObj = new JSONObject(); | JSONObject discountObj = new JSONObject(); | ||||
| Integer discount = 100; | Integer discount = 100; | ||||
| if (discountConfig.equals(EnumPosEnableType.Enable.getCode())) { | if (discountConfig.equals(EnumPosEnableType.Enable.getCode())) { | ||||
| String level = WxLevelConfigService.DEFAULT_LEVEL; | String level = WxLevelConfigService.DEFAULT_LEVEL; | ||||
| // 1. 会员级别Level | // 1. 会员级别Level | ||||
| List<WxLevelConfig> levelList = levelConfigService.getByTenantId(tenantEntity.getTenantId()); | |||||
| List<WxLevelConfig> levelList = levelConfigService.getByTenantInfo(tenantEntity); | |||||
| Long levelId = 0L; | Long levelId = 0L; | ||||
| for (WxLevelConfig levelConfig : levelList) { | for (WxLevelConfig levelConfig : levelList) { | ||||
| if (user.getScore() >= levelConfig.getPoints()) { | |||||
| if (user.getPoins() >= levelConfig.getPoints()) { | |||||
| if (levelConfig.getDiscountEnable().equals(EnumLevelConfigDiscountStatus.ENABLE.getCode())) | if (levelConfig.getDiscountEnable().equals(EnumLevelConfigDiscountStatus.ENABLE.getCode())) | ||||
| levelId = levelConfig.getId(); | levelId = levelConfig.getId(); | ||||
| level = levelConfig.getLevel(); | level = levelConfig.getLevel(); | ||||
| @@ -912,7 +909,7 @@ public class PosServiceImpl implements PosService { | |||||
| errParam2(WxPayConstant.MEM_ID, WxPayConstant.MEM_PHONE); | errParam2(WxPayConstant.MEM_ID, WxPayConstant.MEM_PHONE); | ||||
| } | } | ||||
| // 10. 获取会员信息 | // 10. 获取会员信息 | ||||
| WxCUser user = getMemUser(merchant, memIdStr, memPhoneStr); | |||||
| WxCUserBasicInfo user = getMemUser(merchant, memIdStr, memPhoneStr); | |||||
| if (user == null) { | if (user == null) { | ||||
| logger.error(ErrorCode.USER_NOT_MEMBER.getMessage()); | logger.error(ErrorCode.USER_NOT_MEMBER.getMessage()); | ||||
| throw new MallinkException(ErrorCode.USER_NOT_MEMBER); | throw new MallinkException(ErrorCode.USER_NOT_MEMBER); | ||||
| @@ -1179,7 +1176,7 @@ public class PosServiceImpl implements PosService { | |||||
| throw new MallinkException(ErrorCode.POS_COUPON_REFUND_ERROR.getCode(), errMesg); | throw new MallinkException(ErrorCode.POS_COUPON_REFUND_ERROR.getCode(), errMesg); | ||||
| } | } | ||||
| // 10. 获取会员信息 | // 10. 获取会员信息 | ||||
| WxCUser user = getMemUser(merchant, memIdStr, memPhoneStr); | |||||
| WxCUserBasicInfo user = getMemUser(merchant, memIdStr, memPhoneStr); | |||||
| if (user == null) { | if (user == null) { | ||||
| logger.error(ErrorCode.USER_NOT_MEMBER.getMessage()); | logger.error(ErrorCode.USER_NOT_MEMBER.getMessage()); | ||||
| throw new MallinkException(ErrorCode.USER_NOT_MEMBER); | throw new MallinkException(ErrorCode.USER_NOT_MEMBER); | ||||
| @@ -1424,7 +1421,12 @@ public class PosServiceImpl implements PosService { | |||||
| creditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | creditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | ||||
| creditHistory.setOperatorId(buUserId); | creditHistory.setOperatorId(buUserId); | ||||
| creditHistory.setCUserId(couponOrderCVo.getcUserId()); | creditHistory.setCUserId(couponOrderCVo.getcUserId()); | ||||
| creditHistory.updateTenantInfo(couponOrderCVo); | |||||
| // creditHistory.updateTenantInfo(couponOrderCVo); | |||||
| if(StringUtils.isNotBlank(couponOrderCVo.getParentTenantId())){ | |||||
| creditHistory.setTenantId(couponOrderCVo.getParentTenantId()); | |||||
| }else{ | |||||
| creditHistory.setTenantId(couponOrderCVo.getTenantId()); | |||||
| } | |||||
| creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); | creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode()); | ||||
| creditHistory.setCouponId(couponOrderCVo.getCouponId()); | creditHistory.setCouponId(couponOrderCVo.getCouponId()); | ||||
| int num = creditHistoryService.cancelCredit(creditHistory); | int num = creditHistoryService.cancelCredit(creditHistory); | ||||
| @@ -1600,7 +1602,7 @@ public class PosServiceImpl implements PosService { | |||||
| throw new MallinkException(ErrorCode.CARD_IS_NOT_FOUND); | throw new MallinkException(ErrorCode.CARD_IS_NOT_FOUND); | ||||
| } | } | ||||
| if (StringUtils.isNotBlank(memIdStr) || StringUtils.isNotBlank(memPhoneStr)) { | if (StringUtils.isNotBlank(memIdStr) || StringUtils.isNotBlank(memPhoneStr)) { | ||||
| WxCUser cuUser = getMemUser(merchant, memIdStr, memPhoneStr); | |||||
| WxCUserBasicInfo cuUser = getMemUser(merchant, memIdStr, memPhoneStr); | |||||
| if (cuUser == null) { | if (cuUser == null) { | ||||
| logger.error(ErrorCode.USER_NOT_MEMBER.getMessage()); | logger.error(ErrorCode.USER_NOT_MEMBER.getMessage()); | ||||
| throw new MallinkException(ErrorCode.USER_NOT_MEMBER); | throw new MallinkException(ErrorCode.USER_NOT_MEMBER); | ||||
| @@ -2172,6 +2174,7 @@ public class PosServiceImpl implements PosService { | |||||
| WxCouponOrder updateCO = new WxCouponOrder(); | WxCouponOrder updateCO = new WxCouponOrder(); | ||||
| updateCO.setId(couponOrderId); | updateCO.setId(couponOrderId); | ||||
| updateCO.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | updateCO.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | ||||
| updateCO.setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||||
| couponOrderMapper.updateById(updateCO); | couponOrderMapper.updateById(updateCO); | ||||
| } | } | ||||
| WxCouponOrderCVo couponOrderCVo = couponOrderService.detailCUserVo(posPayOrderNo); | WxCouponOrderCVo couponOrderCVo = couponOrderService.detailCUserVo(posPayOrderNo); | ||||
| @@ -2179,7 +2182,7 @@ public class PosServiceImpl implements PosService { | |||||
| // 3. 成长值 | // 3. 成长值 | ||||
| try { | try { | ||||
| WxOrder scoreOrder = orderMapper.selectById(couponOrderCVo.getOrderId()); | WxOrder scoreOrder = orderMapper.selectById(couponOrderCVo.getOrderId()); | ||||
| int point = scoreRulesService.addScore2(EnumScoreType.CONSUMPTION, scoreOrder, couponOrderCVo.getBusinessId()); | |||||
| int point = scoreRulesService.addScore2(merchantBUser,EnumScoreType.CONSUMPTION, scoreOrder, couponOrderCVo.getBusinessId()); | |||||
| scoreCreditCalc.setScore(scoreCreditCalc.getScore() + point); | scoreCreditCalc.setScore(scoreCreditCalc.getScore() + point); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("交易核销成长值异常:" + e.getMessage()); | logger.error("交易核销成长值异常:" + e.getMessage()); | ||||
| @@ -2272,7 +2275,7 @@ public class PosServiceImpl implements PosService { | |||||
| WxCardSpend cardSpend = cardSpendService.getById(cardSpendId); | WxCardSpend cardSpend = cardSpendService.getById(cardSpendId); | ||||
| if (cardSpend != null) { | if (cardSpend != null) { | ||||
| cardSpend.setOrderId(order.getId()); | cardSpend.setOrderId(order.getId()); | ||||
| cardSpendService.cardSpendForPosPay(scoreCreditCalc, cardSpend, merchant, buUser); | |||||
| cardSpendService.cardSpendForPosPay(scoreCreditCalc, cardSpend, merchant, buUser,payOrder.getPayVendor()); | |||||
| } else { | } else { | ||||
| logger.error("卡支付ID未发现: " + cardSpendId); | logger.error("卡支付ID未发现: " + cardSpendId); | ||||
| throw new MallinkException(ErrorCode.POS_CARD_ORDER_NOT_FOUND); | throw new MallinkException(ErrorCode.POS_CARD_ORDER_NOT_FOUND); | ||||
| @@ -2343,7 +2346,7 @@ public class PosServiceImpl implements PosService { | |||||
| try { | try { | ||||
| WxOrder scoreOrder = orderMapper.selectById(order.getId()); | WxOrder scoreOrder = orderMapper.selectById(order.getId()); | ||||
| scoreOrder.setPayment(neuPaymentAmount); | scoreOrder.setPayment(neuPaymentAmount); | ||||
| int point = scoreRulesService.addScore2(EnumScoreType.CONSUMPTION, scoreOrder, merchant.getBusinessId()); | |||||
| int point = scoreRulesService.addScore2(scoreOrder,EnumScoreType.CONSUMPTION, scoreOrder, merchant.getBusinessId()); | |||||
| scoreCreditCalc.setScore(scoreCreditCalc.getScore() + point); | scoreCreditCalc.setScore(scoreCreditCalc.getScore() + point); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("交易核销成长值异常:" + e.getMessage()); | logger.error("交易核销成长值异常:" + e.getMessage()); | ||||
| @@ -4,7 +4,7 @@ spring: | |||||
| include: rabbitMQ | include: rabbitMQ | ||||
| # JDBC | # JDBC | ||||
| datasource: | datasource: | ||||
| url: jdbc:mysql://202.165.179.86:3306/mallinkDevGroup1?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||||
| url: jdbc:mysql://202.165.179.86:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true | |||||
| username: root | username: root | ||||
| password: fm2020test | password: fm2020test | ||||
| type: com.alibaba.druid.pool.DruidDataSource | type: com.alibaba.druid.pool.DruidDataSource | ||||
| @@ -62,8 +62,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -56,8 +56,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||
| @@ -2,6 +2,7 @@ package com.iformall.config; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -127,6 +128,40 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("baseCUserTokenRedisTemplate") | |||||
| public RedisTemplate<String, BaseCUserEntity> getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, BaseCUserEntity> template = new RedisTemplate<String, BaseCUserEntity>(); | |||||
| Jackson2JsonRedisSerializer<BaseCUserEntity> j = new Jackson2JsonRedisSerializer<BaseCUserEntity>(BaseCUserEntity.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("cUserBasicInfoRedisTemplate") | |||||
| public RedisTemplate<String, WxCUserBasicInfo> getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxCUserBasicInfo> template = new RedisTemplate<String, WxCUserBasicInfo>(); | |||||
| Jackson2JsonRedisSerializer<WxCUserBasicInfo> j = new Jackson2JsonRedisSerializer<WxCUserBasicInfo>(WxCUserBasicInfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("mallRedisTemplate") | @Bean("mallRedisTemplate") | ||||
| public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { | ||||
| RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); | ||||
| @@ -3,10 +3,7 @@ package com.iformall.schedule; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | import com.iformall.domain.dto.WxCUserBasicInfoDto; | ||||
| import com.iformall.domain.po.WxChartDataEntity; | |||||
| import com.iformall.domain.po.WxCouponOrder; | |||||
| import com.iformall.domain.po.WxMall; | |||||
| import com.iformall.domain.po.WxMerchantTradeDaily; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.EnumCarCmd; | import com.iformall.enums.EnumCarCmd; | ||||
| import com.iformall.enums.EnumChartType; | import com.iformall.enums.EnumChartType; | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.mapper.WxMallMapper; | import com.iformall.mapper.WxMallMapper; | ||||
| import com.iformall.service.WxPropertyContractService; | import com.iformall.service.WxPropertyContractService; | ||||
| import com.iformall.service.WxRentContractService; | import com.iformall.service.WxRentContractService; | ||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -18,11 +19,11 @@ import java.util.List; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| */ | */ | ||||
| @Slf4j | |||||
| @Component | @Component | ||||
| public class ContractSchedule { | public class ContractSchedule { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxRentContractService wxRentContractService; | private WxRentContractService wxRentContractService; | ||||
| @@ -36,27 +37,47 @@ public class ContractSchedule { | |||||
| /** | /** | ||||
| * 凌晨5分 | * 凌晨5分 | ||||
| */ | */ | ||||
| @Scheduled(cron = "0 5 0 * * ?") | |||||
| public void sendMsg() { | |||||
| logger.info("合同状态更新开始"); | |||||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||||
| for (WxMall wxMall : wxMalls) { | |||||
| TenantEntity tenantEntity = wxMall.getTenantInfo(); | |||||
| WxRentContract wxRentContract = new WxRentContract(); | |||||
| wxRentContract.updateTenantInfo(tenantEntity); | |||||
| logger.info("租赁合同状态更新开始"); | |||||
| wxRentContractService.updateStatus(wxRentContract); | |||||
| logger.info("租赁合同状态更新结束"); | |||||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||||
| wxPropertyContract.updateTenantInfo(tenantEntity); | |||||
| logger.info("物业合同状态更新开始"); | |||||
| wxPropertyContractService.updateStatus(wxPropertyContract); | |||||
| logger.info("物业合同状态更新结束"); | |||||
| } | |||||
| logger.info("合同状态更新结束"); | |||||
| @Scheduled(cron = "0 0/2 * * * ?") | |||||
| public void updateContractStatus() { | |||||
| //更新合同状态,正常到期 | |||||
| //查询计租中的合同,找到商户,然后根据商户,如果商户有到期的(租金、物业)合同,则合同状态更新为到期。 | |||||
| //如果店铺没有有效合同,则释放店铺,不停用商户 | |||||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||||
| for (WxMall wxMall : wxMalls) { | |||||
| try { | |||||
| //租金合同 | |||||
| wxRentContractService.outDateContract(wxMall); | |||||
| }catch(Exception e) { | |||||
| log.error("rentcontract outDate error.",e); | |||||
| } | |||||
| try { | |||||
| //物业合同 | |||||
| wxPropertyContractService.outDateContract(wxMall); | |||||
| }catch(Exception e) { | |||||
| log.error("propertycontract outDate error.",e); | |||||
| } | |||||
| } | |||||
| // log.info("合同状态更新开始"); | |||||
| // List<WxMall> wxMalls = wxMallMapper.findList(null); | |||||
| // for (WxMall wxMall : wxMalls) { | |||||
| // TenantEntity tenantEntity = wxMall.getTenantInfo(); | |||||
| // WxRentContract wxRentContract = new WxRentContract(); | |||||
| // wxRentContract.updateTenantInfo(tenantEntity); | |||||
| // log.info("租赁合同状态更新开始"); | |||||
| // wxRentContractService.updateStatus(wxRentContract); | |||||
| // log.info("租赁合同状态更新结束"); | |||||
| // | |||||
| // WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||||
| // wxPropertyContract.updateTenantInfo(tenantEntity); | |||||
| // log.info("物业合同状态更新开始"); | |||||
| // wxPropertyContractService.updateStatus(wxPropertyContract); | |||||
| // log.info("物业合同状态更新结束"); | |||||
| // } | |||||
| log.info("合同状态更新结束"); | |||||
| } | } | ||||
| @@ -120,6 +120,7 @@ public class CouponOrderExpiringSchedule { | |||||
| WxAppinfo appinfo = new WxAppinfo(); | WxAppinfo appinfo = new WxAppinfo(); | ||||
| appinfo.updateTenantInfo(co); | appinfo.updateTenantInfo(co); | ||||
| //appinfo.setType(EnumAppType.B.getCode()); | //appinfo.setType(EnumAppType.B.getCode()); | ||||
| appinfo.setPlat(EnumPayWay.getEnum(co.getPayVendor()).getPlat().getCode()); | |||||
| appinfo.setType(EnumAppType.C.getCode()); | appinfo.setType(EnumAppType.C.getCode()); | ||||
| appinfo = wxAppinfoMapper.findList(appinfo).get(0); | appinfo = wxAppinfoMapper.findList(appinfo).get(0); | ||||
| @@ -166,7 +167,7 @@ public class CouponOrderExpiringSchedule { | |||||
| // 未设置通道费差 | // 未设置通道费差 | ||||
| wxSharingOrderDto.setShareAmount(wxPayOrder.getShareAmount()); | wxSharingOrderDto.setShareAmount(wxPayOrder.getShareAmount()); | ||||
| } | } | ||||
| wxProfitSharingOrderService.finishSharingOrder(wxSharingOrderDto); | |||||
| wxProfitSharingOrderService.finishSharingOrder(wxSharingOrderDto,wxPayOrder.getPayVendor()); | |||||
| } | } | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| @@ -46,6 +46,9 @@ public class CouponSendSchedule { | |||||
| @Autowired | @Autowired | ||||
| private WxCUserBasicInfoMapper wxCUserBasicInfoMapper; | private WxCUserBasicInfoMapper wxCUserBasicInfoMapper; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Autowired | @Autowired | ||||
| private WxCouponSendMapper wxCouponSendMapper; | private WxCouponSendMapper wxCouponSendMapper; | ||||
| @@ -130,10 +133,9 @@ public class CouponSendSchedule { | |||||
| if (sendCount > 0) { | if (sendCount > 0) { | ||||
| WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | ||||
| wxCUserBasicInfoDto.updateTenantInfo(tenantEntity); | |||||
| wxCUserBasicInfoDto.setLevelStartScore(levelStartScore); | wxCUserBasicInfoDto.setLevelStartScore(levelStartScore); | ||||
| wxCUserBasicInfoDto.setLevelEndScore(levelEndScore); | wxCUserBasicInfoDto.setLevelEndScore(levelEndScore); | ||||
| List<WxCUserBasicInfo> wxCUserBasicInfoList = wxCUserBasicInfoMapper.findListByScore(wxCUserBasicInfoDto); | |||||
| List<WxCUserBasicInfo> wxCUserBasicInfoList = wxCUserBasicInfoService.findListByScore(tenantEntity,wxCUserBasicInfoDto); | |||||
| logger.info("定时发券:给LEVEL[" + l.getLevel() + | logger.info("定时发券:给LEVEL[" + l.getLevel() + | ||||
| "]积分[" + levelStartScore + "-" + levelEndScore + "]发券" + sendCount + "张"); | "]积分[" + levelStartScore + "-" + levelEndScore + "]发券" + sendCount + "张"); | ||||
| @@ -189,7 +191,7 @@ public class CouponSendSchedule { | |||||
| // 发放免费券 | // 发放免费券 | ||||
| try { | try { | ||||
| WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs.getCouponId(), null); | |||||
| WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs.getCouponId(), null,EnumPayWay.PAY_WAY_NOT_UNPAY_SYSTEM_SEND); | |||||
| wxCouponActionLogService.addOne(tenantEntity, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | wxCouponActionLogService.addOne(tenantEntity, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("定时发券:发券失败 levelId=" + l.getId() + " couponId=" + cs.getCouponId() + " userId=" + cu.getId() + e.getMessage()); | logger.error("定时发券:发券失败 levelId=" + l.getId() + " couponId=" + cs.getCouponId() + " userId=" + cu.getId() + e.getMessage()); | ||||
| @@ -283,7 +285,7 @@ public class CouponSendSchedule { | |||||
| today.add(Calendar.DAY_OF_YEAR, beforeDays); | today.add(Calendar.DAY_OF_YEAR, beforeDays); | ||||
| Date end = today.getTime(); | Date end = today.getTime(); | ||||
| List<WxCUserBasicInfo> wxCUserBasicInfoList = wxCUserBasicInfoMapper.findBirthdayList(mall.getTenantId(), df.format(begin.getTime()), df.format(end.getTime())); | |||||
| List<WxCUserBasicInfo> wxCUserBasicInfoList = wxCUserBasicInfoService.findBirthdayList(tenantEntity, df.format(begin.getTime()), df.format(end.getTime())); | |||||
| if (CollectionUtils.isEmpty(wxCUserBasicInfoList)) { | if (CollectionUtils.isEmpty(wxCUserBasicInfoList)) { | ||||
| logger.info("生日发券: {} 满足发券的用户列表为空 wxCUserBasicInfoList = {}, 任务跳过不执行", mall.getName(), wxCUserBasicInfoList); | logger.info("生日发券: {} 满足发券的用户列表为空 wxCUserBasicInfoList = {}, 任务跳过不执行", mall.getName(), wxCUserBasicInfoList); | ||||
| return; | return; | ||||
| @@ -294,7 +296,7 @@ public class CouponSendSchedule { | |||||
| //本次之前的20分钟 | //本次之前的20分钟 | ||||
| now.set(Calendar.MINUTE, now.get(Calendar.MINUTE) - 30); | now.set(Calendar.MINUTE, now.get(Calendar.MINUTE) - 30); | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", wxCUserBasicInfo.getTenantId()); | |||||
| params.put("tenantId", mall.getTenantId()); | |||||
| params.put("cUserId", wxCUserBasicInfo.getId()); | params.put("cUserId", wxCUserBasicInfo.getId()); | ||||
| params.put("couponId", null); | params.put("couponId", null); | ||||
| params.put("startTime", startTime); | params.put("startTime", startTime); | ||||
| @@ -319,7 +321,7 @@ public class CouponSendSchedule { | |||||
| for (WxCUserBasicInfo cu : newUserList) { | for (WxCUserBasicInfo cu : newUserList) { | ||||
| // 发放生日券 | // 发放生日券 | ||||
| try { | try { | ||||
| WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs.getCouponId(), null); | |||||
| WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs.getCouponId(), null,EnumPayWay.PAY_WAY_NOT_UNPAY_SYSTEM_SEND); | |||||
| wxCouponActionLogService.addOne(tenantEntity, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | wxCouponActionLogService.addOne(tenantEntity, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | ||||
| couponSendedUsers.add(cu); | couponSendedUsers.add(cu); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -25,56 +25,56 @@ public class MsgReSendSchedule { | |||||
| @Autowired | @Autowired | ||||
| private MqBaseProducer mqBaseProducer; | private MqBaseProducer mqBaseProducer; | ||||
| @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | |||||
| //@Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | |||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void msgReSend() { | public void msgReSend() { | ||||
| logger.info("消息重发开始..."); | |||||
| //消息重发 | |||||
| WxMsgRecord msgRecord = new WxMsgRecord(); | |||||
| msgRecord.setMsgStatus(EnumMsgRecordStatus.SEND_FAIL.getCode()); | |||||
| List<WxMsgRecord> recordList = wxMsgRecordService.findList(msgRecord); | |||||
| for (WxMsgRecord wxMsgRecord:recordList) { | |||||
| logger.info("消息重发:{}",wxMsgRecord.getMsgJson()); | |||||
| TenantEntity tenantEntity = wxMsgRecord.getTenantInfo(); | |||||
| try { | |||||
| if(EnumMsgRecordType.INSIDE_ORDER_SUCCESS.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| //内部消息 - 下订单成功 | |||||
| FmInsideOrderSuccessMsg msg = (FmInsideOrderSuccessMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideOrderSuccessMsg.class); | |||||
| msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| msg.updateTenantInfo(tenantEntity); | |||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| }else if(EnumMsgRecordType.INSIDE_COUPON_VERIFY.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| FmInsideCouponVerifyMsg msg = (FmInsideCouponVerifyMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideCouponVerifyMsg.class); | |||||
| msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| msg.updateTenantInfo(tenantEntity); | |||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| }else if(EnumMsgRecordType.INSIDE_C_LOGIN.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| FmInsideCLoginMsg msg = (FmInsideCLoginMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideCLoginMsg.class); | |||||
| msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| msg.updateTenantInfo(tenantEntity); | |||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| }else if(EnumMsgRecordType.INSIDE_NOTIFY_PAY_SUCCESS.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| FmInsideNotifyPaySuccessMsg msg = (FmInsideNotifyPaySuccessMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideNotifyPaySuccessMsg.class); | |||||
| msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| msg.updateTenantInfo(tenantEntity); | |||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| }else if(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| FmInsideNotifyRefundSuccessMsg msg = (FmInsideNotifyRefundSuccessMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideNotifyRefundSuccessMsg.class); | |||||
| msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| msg.updateTenantInfo(tenantEntity); | |||||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| } | |||||
| } catch (Exception e) { | |||||
| e.printStackTrace(); | |||||
| logger.error("消息重发错误:" + e.getMessage()); | |||||
| } | |||||
| } | |||||
| logger.info("消息重发结束..."); | |||||
| // logger.info("消息重发开始..."); | |||||
| // //消息重发 | |||||
| // WxMsgRecord msgRecord = new WxMsgRecord(); | |||||
| // msgRecord.setMsgStatus(EnumMsgRecordStatus.SEND_FAIL.getCode()); | |||||
| // List<WxMsgRecord> recordList = wxMsgRecordService.findList(msgRecord); | |||||
| // for (WxMsgRecord wxMsgRecord:recordList) { | |||||
| // logger.info("消息重发:{}",wxMsgRecord.getMsgJson()); | |||||
| // TenantEntity tenantEntity = wxMsgRecord.getTenantInfo(); | |||||
| // try { | |||||
| // if(EnumMsgRecordType.INSIDE_ORDER_SUCCESS.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| // //内部消息 - 下订单成功 | |||||
| // FmInsideOrderSuccessMsg msg = (FmInsideOrderSuccessMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideOrderSuccessMsg.class); | |||||
| // msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| // msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| // msg.updateTenantInfo(tenantEntity); | |||||
| // mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // }else if(EnumMsgRecordType.INSIDE_COUPON_VERIFY.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| // FmInsideCouponVerifyMsg msg = (FmInsideCouponVerifyMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideCouponVerifyMsg.class); | |||||
| // msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| // msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| // msg.updateTenantInfo(tenantEntity); | |||||
| // mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // }else if(EnumMsgRecordType.INSIDE_C_LOGIN.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| // FmInsideCLoginMsg msg = (FmInsideCLoginMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideCLoginMsg.class); | |||||
| // msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| // msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| // msg.updateTenantInfo(tenantEntity); | |||||
| // mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // }else if(EnumMsgRecordType.INSIDE_NOTIFY_PAY_SUCCESS.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| // FmInsideNotifyPaySuccessMsg msg = (FmInsideNotifyPaySuccessMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideNotifyPaySuccessMsg.class); | |||||
| // msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| // msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| // msg.updateTenantInfo(tenantEntity); | |||||
| // mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // }else if(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| // FmInsideNotifyRefundSuccessMsg msg = (FmInsideNotifyRefundSuccessMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideNotifyRefundSuccessMsg.class); | |||||
| // msg.setMsgType(wxMsgRecord.getMsgType()); | |||||
| // msg.setReceiver(wxMsgRecord.getReceiver()); | |||||
| // msg.updateTenantInfo(tenantEntity); | |||||
| // mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| // } | |||||
| // } catch (Exception e) { | |||||
| // e.printStackTrace(); | |||||
| // logger.error("消息重发错误:" + e.getMessage()); | |||||
| // } | |||||
| // } | |||||
| // logger.info("消息重发结束..."); | |||||
| } | } | ||||
| @@ -5,6 +5,8 @@ import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.mapper.*; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.aop.framework.AopContext; | import org.springframework.aop.framework.AopContext; | ||||
| @@ -16,29 +18,21 @@ import org.springframework.transaction.annotation.Transactional; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.domain.po.WxAppinfo; | |||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxOrder; | |||||
| import com.iformall.domain.po.WxPayAccount; | |||||
| import com.iformall.domain.po.WxPayOrder; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.enums.EnumAppType; | import com.iformall.enums.EnumAppType; | ||||
| import com.iformall.enums.EnumOrderStatus; | import com.iformall.enums.EnumOrderStatus; | ||||
| import com.iformall.enums.EnumOrderType; | import com.iformall.enums.EnumOrderType; | ||||
| import com.iformall.enums.EnumPayStatus; | import com.iformall.enums.EnumPayStatus; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.enums.EnumRefundStatus; | import com.iformall.enums.EnumRefundStatus; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxAppinfoMapper; | |||||
| import com.iformall.mapper.WxCUserMapper; | |||||
| import com.iformall.mapper.WxCouponMapper; | |||||
| import com.iformall.mapper.WxOrderGroupMapper; | |||||
| import com.iformall.mapper.WxOrderMapper; | |||||
| import com.iformall.mapper.WxPayAccountMapper; | |||||
| import com.iformall.mapper.WxPayOrderMapper; | |||||
| import com.iformall.service.WxAppinfoService; | import com.iformall.service.WxAppinfoService; | ||||
| import com.iformall.service.WxOrderService; | import com.iformall.service.WxOrderService; | ||||
| import com.iformall.service.WxPayOrderService; | import com.iformall.service.WxPayOrderService; | ||||
| import com.iformall.service.WxRefundOrderService; | import com.iformall.service.WxRefundOrderService; | ||||
| import com.iformall.service.helper.WxPayOrderServiceHelper; | import com.iformall.service.helper.WxPayOrderServiceHelper; | ||||
| import com.iformall.service.pay.PayServiceFactory; | |||||
| import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| @Component | @Component | ||||
| @@ -68,9 +62,12 @@ public class OrderExpiringSchedule { | |||||
| @Autowired | @Autowired | ||||
| WxPayOrderMapper wxPayOrderMapper; | WxPayOrderMapper wxPayOrderMapper; | ||||
| @Autowired | @Autowired | ||||
| WxCUserMapper wxCUserMapper; | WxCUserMapper wxCUserMapper; | ||||
| @Autowired | |||||
| WxCUserBasicInfoMapper wxCUserBasicInfoMapper; | |||||
| @Autowired | @Autowired | ||||
| WxAppinfoService wxAppinfoService; | WxAppinfoService wxAppinfoService; | ||||
| @@ -81,9 +78,20 @@ public class OrderExpiringSchedule { | |||||
| @Autowired | @Autowired | ||||
| WxPayOrderService wxPayOrderService; | WxPayOrderService wxPayOrderService; | ||||
| @Autowired | |||||
| PayServiceFactory payServiceFactory; | |||||
| @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void orderExpireSchedule() { | public void orderExpireSchedule() { | ||||
| for (EnumPayWay payWay: EnumPayWay.values()) { | |||||
| if(null != payWay.getPlat()) { | |||||
| orderExpireSchedule(payWay); | |||||
| } | |||||
| } | |||||
| } | |||||
| private void orderExpireSchedule(EnumPayWay payWay) { | |||||
| Map dateMap = new HashMap(); | Map dateMap = new HashMap(); | ||||
| Date curDate = new Date(); | Date curDate = new Date(); | ||||
| @@ -98,7 +106,7 @@ public class OrderExpiringSchedule { | |||||
| List<WxOrder> orderCoupons = wxOrderMapper.findListOfUnpaidOrderByDate(dateMap); | List<WxOrder> orderCoupons = wxOrderMapper.findListOfUnpaidOrderByDate(dateMap); | ||||
| orderCoupons.stream().forEach( o -> { | orderCoupons.stream().forEach( o -> { | ||||
| try { | try { | ||||
| proxy.orderExpired(o,true); | |||||
| proxy.orderExpired(o,true,payWay); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("券过期失败" + e.getMessage()); | logger.error("券过期失败" + e.getMessage()); | ||||
| } | } | ||||
| @@ -112,7 +120,7 @@ public class OrderExpiringSchedule { | |||||
| List<WxOrder> orderPresss = wxOrderMapper.findListOfCompleteUnPaidPressOrderByDate(dateMap); | List<WxOrder> orderPresss = wxOrderMapper.findListOfCompleteUnPaidPressOrderByDate(dateMap); | ||||
| orderPresss.stream().forEach( o -> { | orderPresss.stream().forEach( o -> { | ||||
| try { | try { | ||||
| proxy.orderPressExpired(o, true,true); | |||||
| proxy.orderPressExpired(o, true,true,payWay); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("砍价券支付过期失败" + e.getMessage()); | logger.error("砍价券支付过期失败" + e.getMessage()); | ||||
| } | } | ||||
| @@ -123,7 +131,7 @@ public class OrderExpiringSchedule { | |||||
| orderPresss = wxOrderMapper.findListOfUnpaidPressOrderByDate(dateMap); | orderPresss = wxOrderMapper.findListOfUnpaidPressOrderByDate(dateMap); | ||||
| orderPresss.stream().forEach( o -> { | orderPresss.stream().forEach( o -> { | ||||
| try { | try { | ||||
| proxy.orderPressExpired(o, false,true); | |||||
| proxy.orderPressExpired(o, false,true,payWay); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("砍价券过期失败" +e.getMessage()); | logger.error("砍价券过期失败" +e.getMessage()); | ||||
| } | } | ||||
| @@ -135,7 +143,7 @@ public class OrderExpiringSchedule { | |||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode()); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | ||||
| try { | try { | ||||
| proxy.orderGroupExpired((WxOrder) o,true,true); | |||||
| proxy.orderGroupExpired((WxOrder) o,true,true,payWay); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("拼团取消失败" + e.getMessage()); | logger.error("拼团取消失败" + e.getMessage()); | ||||
| } | } | ||||
| @@ -147,7 +155,7 @@ public class OrderExpiringSchedule { | |||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_OVERTIME.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_OVERTIME.getCode()); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | ||||
| try { | try { | ||||
| proxy.expiredAndReturnMoney((WxOrder) o,false); | |||||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("拼团过期退款失败" + e.getMessage()); | logger.error("拼团过期退款失败" + e.getMessage()); | ||||
| } | } | ||||
| @@ -158,8 +166,7 @@ public class OrderExpiringSchedule { | |||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | ||||
| try { | try { | ||||
| proxy.orderGroupBreak((WxOrder) o); | |||||
| proxy.returnMoney((WxOrder) o); | |||||
| proxy.returnMoney((WxOrder) o,payWay); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("拼团券下架退款失败" + e.getMessage()); | logger.error("拼团券下架退款失败" + e.getMessage()); | ||||
| } | } | ||||
| @@ -169,7 +176,7 @@ public class OrderExpiringSchedule { | |||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode()); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | ||||
| try { | try { | ||||
| proxy.expiredAndReturnMoney((WxOrder) o,true); | |||||
| proxy.expiredAndReturnMoney((WxOrder) o,true,payWay); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("参团失败退款失败" + e.getMessage()); | logger.error("参团失败退款失败" + e.getMessage()); | ||||
| } | } | ||||
| @@ -179,7 +186,7 @@ public class OrderExpiringSchedule { | |||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_SCHEDU_REFUND.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_SCHEDU_REFUND.getCode()); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | ||||
| try { | try { | ||||
| proxy.expiredAndReturnMoney((WxOrder) o,false); | |||||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("参团失败退款失败" + e.getMessage()); | logger.error("参团失败退款失败" + e.getMessage()); | ||||
| } | } | ||||
| @@ -188,13 +195,13 @@ public class OrderExpiringSchedule { | |||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void expiredAndReturnMoney(WxOrder wxOrder,boolean checkRealPay) { | |||||
| orderGroupExpired(wxOrder,checkRealPay,false); | |||||
| returnMoney(wxOrder); | |||||
| public void expiredAndReturnMoney(WxOrder wxOrder,boolean checkRealPay,EnumPayWay payWay) throws MallinkException, Exception { | |||||
| orderGroupExpired(wxOrder,checkRealPay,false,payWay); | |||||
| returnMoney(wxOrder,payWay); | |||||
| } | } | ||||
| public boolean wxPaySuccess(WxOrder order,boolean autoReHandle) { | |||||
| public boolean wxPaySuccess(WxOrder order,boolean autoReHandle,EnumPayWay payWay) throws MallinkException, Exception { | |||||
| WxPayOrder payOrderq = new WxPayOrder(); | WxPayOrder payOrderq = new WxPayOrder(); | ||||
| payOrderq.setOrderId(order.getId()); | payOrderq.setOrderId(order.getId()); | ||||
| List<WxPayOrder> payorderlist = wxPayOrderMapper.findList(payOrderq); | List<WxPayOrder> payorderlist = wxPayOrderMapper.findList(payOrderq); | ||||
| @@ -205,12 +212,21 @@ public class OrderExpiringSchedule { | |||||
| if (null == wxpayOrder) { | if (null == wxpayOrder) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| WxCUser user = wxCUserMapper.selectById(wxpayOrder.getCUserId()); | |||||
| WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(wxpayOrder.getCUserId()); | |||||
| //找不到用户,问题单,不能删 | //找不到用户,问题单,不能删 | ||||
| if (null == user) { | if (null == user) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| WxAppinfo appInfo = wxAppinfoService.getByAppId(user.getAppId()); | |||||
| // WxCUser cuUser = new WxCUser(); | |||||
| // cuUser.updateTenantInfo(order); | |||||
| // cuUser.setUserId(user.getId()); | |||||
| // WxCUser cUser = wxCUserMapper.selectOne(new QueryWrapper(cuUser)); | |||||
| // //找不到用户,问题单,不能删 | |||||
| // if (null == cUser) { | |||||
| // return true; | |||||
| // } | |||||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(order, payWay); | |||||
| //WxAppinfo appInfo = wxAppinfoService.getByAppId(cUser.getAppId()); | |||||
| //找不到appInfo,问题单,不能删 | //找不到appInfo,问题单,不能删 | ||||
| if(appInfo == null) { | if(appInfo == null) { | ||||
| return true; | return true; | ||||
| @@ -220,12 +236,13 @@ public class OrderExpiringSchedule { | |||||
| if (null == payAccount) { | if (null == payAccount) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| Map<String, String> retMap = WxPayOrderServiceHelper.wxOrderPayStatusMap(wxpayOrder, order, appInfo, payAccount); | |||||
| int status = WxPayOrderServiceHelper.getPayStatusFromMap(retMap, wxpayOrder.getPayOrderNo()); | |||||
| //Map<String, String> retMap = WxPayOrderServiceHelper.wxOrderPayStatusMap(wxpayOrder, order, appInfo, payAccount); | |||||
| //int status = WxPayOrderServiceHelper.getPayStatusFromMap(retMap, wxpayOrder.getPayOrderNo()); | |||||
| PayQueryAdapterResult payResult = payServiceFactory.getPayAdapterService(wxpayOrder.getPayVendor()).queryPayStatus(wxpayOrder, order, appInfo, payAccount); | |||||
| //如果是支付成功,并且需要重试成功流程, | //如果是支付成功,并且需要重试成功流程, | ||||
| if (EnumPayStatus.PAY_STATUS_SUCCESS.getCode() == status) { | |||||
| if (EnumPayStatus.PAY_STATUS_SUCCESS.getCode().intValue() == payResult.getCode()) { | |||||
| if (autoReHandle) { | if (autoReHandle) { | ||||
| wxPayOrderService.handleSuccessOrder(wxpayOrder, order, retMap,true); | |||||
| wxPayOrderService.handleSuccessOrder(wxpayOrder, order, payResult,true); | |||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -234,9 +251,9 @@ public class OrderExpiringSchedule { | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void orderExpired(WxOrder order,boolean checkRealPay) { | |||||
| public void orderExpired(WxOrder order,boolean checkRealPay,EnumPayWay payWay) throws MallinkException, Exception { | |||||
| if (checkRealPay) { | if (checkRealPay) { | ||||
| if (wxPaySuccess(order,true)) { | |||||
| if (wxPaySuccess(order,true,payWay)) { | |||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| @@ -244,7 +261,7 @@ public class OrderExpiringSchedule { | |||||
| wxOrderService.stockBack(order); | wxOrderService.stockBack(order); | ||||
| // 微信 关单 | // 微信 关单 | ||||
| wxOrderService.orderClose(order); | |||||
| wxOrderService.orderClose(order,payWay); | |||||
| // 订单状态更改 | // 订单状态更改 | ||||
| WxOrder updateOrder = new WxOrder(); | WxOrder updateOrder = new WxOrder(); | ||||
| @@ -257,9 +274,9 @@ public class OrderExpiringSchedule { | |||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void orderPressExpired(WxOrder order, boolean payExpired,boolean checkRealPay) { | |||||
| public void orderPressExpired(WxOrder order, boolean payExpired,boolean checkRealPay,EnumPayWay payWay) throws MallinkException, Exception { | |||||
| if (checkRealPay) { | if (checkRealPay) { | ||||
| if (wxPaySuccess(order,true)) { | |||||
| if (wxPaySuccess(order,true,payWay)) { | |||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| @@ -283,9 +300,9 @@ public class OrderExpiringSchedule { | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void orderGroupExpired(WxOrder order,boolean checkRealPay,boolean stockBack) { | |||||
| public void orderGroupExpired(WxOrder order,boolean checkRealPay,boolean stockBack,EnumPayWay payWay) throws MallinkException, Exception { | |||||
| if (checkRealPay) { | if (checkRealPay) { | ||||
| if (wxPaySuccess(order,true)) { | |||||
| if (wxPaySuccess(order,true,payWay)) { | |||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| @@ -302,34 +319,48 @@ public class OrderExpiringSchedule { | |||||
| wxOrderService.stockBack(order); | wxOrderService.stockBack(order); | ||||
| } | } | ||||
| // 微信 关单 | // 微信 关单 | ||||
| wxOrderService.orderClose(updateOrder); | |||||
| wxOrderService.orderClose(updateOrder,payWay); | |||||
| logger.info("拼团订单: " + order.getId() + " create at " + order.getCreateDate() + " expired at " + curDate); | logger.info("拼团订单: " + order.getId() + " create at " + order.getCreateDate() + " expired at " + curDate); | ||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| public void orderGroupBreak(WxOrder order) { | |||||
| Date curDate = new Date(); | |||||
| WxOrder updateOrder = new WxOrder(); | |||||
| updateOrder.setId(order.getId()); | |||||
| updateOrder.updateTenantInfo(order); | |||||
| updateOrder.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_BREAK.getCode()); | |||||
| updateOrder.setUpdateDate(curDate); | |||||
| wxOrderMapper.updateById(updateOrder); | |||||
| } | |||||
| /** | /** | ||||
| * 回调会再次扣减库存 | * 回调会再次扣减库存 | ||||
| * @param order | * @param order | ||||
| * @throws Exception | |||||
| * @throws MallinkException | |||||
| */ | */ | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void returnMoney(WxOrder order) { | |||||
| public void returnMoney(WxOrder order,EnumPayWay payWay) throws MallinkException, Exception { | |||||
| //支付成功的才退款 | //支付成功的才退款 | ||||
| if (!wxPaySuccess(order,false)) { | |||||
| if (!wxPaySuccess(order,false,payWay)) { | |||||
| return; | return; | ||||
| } | } | ||||
| // 查找支付订单 | |||||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||||
| payOrderQ.updateTenantInfo(order); | |||||
| payOrderQ.setCUserId(order.getCUserId()); | |||||
| payOrderQ.setOrderId(order.getId()); | |||||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||||
| WxPayOrder payOrder = null; | |||||
| List<WxPayOrder> list = wxPayOrderMapper.findList(payOrderQ); | |||||
| if (list.size() > 0) { | |||||
| if (list.size() > 1) { | |||||
| logger.error("TODO: payOrder成功记录应该只有一条????!!!"); | |||||
| } | |||||
| logger.warn(""); | |||||
| payOrder = list.get(0); | |||||
| } | |||||
| if (payOrder == null) { | |||||
| logger.error("支付订单不存在(payOrder不存在)"); | |||||
| return ; | |||||
| } | |||||
| //获取APP信息 | //获取APP信息 | ||||
| WxAppinfo appinfo = new WxAppinfo(); | WxAppinfo appinfo = new WxAppinfo(); | ||||
| appinfo.updateTenantInfo(order); | appinfo.updateTenantInfo(order); | ||||
| appinfo.setPlat(EnumPayWay.getEnum(payOrder.getPayVendor()).getPlat().getCode()); | |||||
| appinfo.setType(EnumAppType.C.getCode()); | appinfo.setType(EnumAppType.C.getCode()); | ||||
| appinfo = wxAppinfoMapper.findList(appinfo).get(0); | appinfo = wxAppinfoMapper.findList(appinfo).get(0); | ||||
| Date limitDate = DateUtils.getTimeAfterDays(360, order.getCreateDate()); | Date limitDate = DateUtils.getTimeAfterDays(360, order.getCreateDate()); | ||||
| @@ -22,6 +22,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxUserVisit; | import com.iformall.domain.po.WxUserVisit; | ||||
| import com.iformall.enums.EnumAppType; | import com.iformall.enums.EnumAppType; | ||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.WxAppinfoService; | import com.iformall.service.WxAppinfoService; | ||||
| import com.iformall.service.WxUserVisitService; | import com.iformall.service.WxUserVisitService; | ||||
| @@ -64,8 +64,8 @@ spring: | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| username: zhengfangyuan@iformall.com | |||||
| password: xnydCeUzofB2h8qp # 授权密码 | |||||
| username: service@iformall.com | |||||
| password: jGvApygXN7wc5SzN # 授权密码 | |||||
| properties: | properties: | ||||
| mail: | mail: | ||||
| smtp: | smtp: | ||||