From d7b128f6ebf15043829e4134cbccf5f54a7050fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=99=BD=E7=BE=8E=E5=B9=B3?= <1102247926@qq.com>
Date: Tue, 15 Jul 2025 08:36:40 +0800
Subject: [PATCH] =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E4=B8=A4=E4=B8=AA=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E5=BA=93=E8=BF=9B=E8=A1=8C=E5=90=8C=E6=AD=A5=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=EF=BC=8C=E5=B9=B6=E4=B8=94=E4=BF=9D=E6=8C=81=E4=BA=8B?=
=?UTF-8?q?=E5=8A=A1=E4=B8=80=E8=87=B4=E6=80=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 23 -
.idea/CopilotChatHistory.xml | 92 +
.idea/CopilotWebChatHistory.xml | 1567 +++++++++++++++++
.idea/compiler.xml | 3 +-
.idea/dataSources.local.xml | 12 +
.idea/dataSources.xml | 18 +
.idea/encodings.xml | 6 +
.idea/misc.xml | 12 +
.idea/uiDesigner.xml | 124 ++
.idea/workspace.xml | 293 ++-
IntegraManager.iml | 192 --
LICENSE | 201 ---
README.md | 37 -
pom.xml | 20 +-
.../ServiceAreaOperatorsController.java | 2 +-
.../com/nmgs/MyEnvironmentPostProcessor.java | 92 +-
.../nmgs/common/GlobalExceptionHandler.java | 46 +
.../com/nmgs/config/DataSourceConfig.java | 172 ++
.../java/com/nmgs/config/MybatisConfig.java | 136 +-
.../nmgs/controller/FileUploadController.java | 29 +-
.../com/nmgs/controller/InitController.java | 17 -
.../com/nmgs/controller/WebSocketRedis.java | 2 +-
.../nmgs/mapper/IntegrationListMapper.java | 71 -
.../com/nmgs/mapper/IntegrationListMapper.xml | 319 ----
.../mapper/PayIntegrationNumberMapper.java | 35 -
.../mapper/PayIntegrationNumberMapper.xml | 21 -
.../com/nmgs/mapper/ServiceAreaMapper.java | 60 -
.../com/nmgs/mapper/ServiceAreaMapper.xml | 236 ---
.../com/nmgs/mapper/ServiceAreaPicMapper.java | 30 -
.../com/nmgs/mapper/ServiceAreaPicMapper.xml | 11 -
.../nmgs/{mapper => mappercommon}/Mapper.java | 4 +-
.../nmgs/{mapper => mappercommon}/Mapper.xml | 2 +-
.../mysqlmapper/AppointmentInfoMyMapper.java | 18 +
.../mysqlmapper/AppointmentInfoMyMapper.xml | 46 +
.../mysqlmapper/CafterTableMyMapper.java | 19 +
.../mysqlmapper/CafterTableMyMapper.xml | 57 +
.../mysqlmapper/IntegralLeavingMyMapper.java | 17 +
.../mysqlmapper/IntegralLeavingMyMapper.xml | 27 +
.../mysqlmapper/IntegralSignMyMapper.java | 23 +
.../mysqlmapper/IntegralSignMyMapper.xml | 18 +
.../mysqlmapper/IntegrationListMyMapper.java | 17 +
.../mysqlmapper/IntegrationListMyMapper.xml | 27 +
.../mysqlmapper/OperatorsMyMapper.java | 55 +
.../mysqlmapper/OperatorsMyMapper.xml | 84 +
.../mysqlmapper/UserTableMysqlMapper.java | 28 +
.../mysqlmapper/UserTableMysqlMapper.xml | 61 +
.../mysqlmapper/UserVehicleMyMapper.java | 28 +
.../mysqlmapper/UserVehicleMyMapper.xml | 86 +
.../oraclemapper/AppointmentInfoMapper.java | 18 +
.../oraclemapper/AppointmentInfoMapper.xml | 46 +
.../oraclemapper/CafterTableMapper.java | 19 +
.../oraclemapper/CafterTableMapper.xml | 58 +
.../oraclemapper/IntegralLeavingMapper.java | 17 +
.../oraclemapper/IntegralLeavingMapper.xml | 27 +
.../oraclemapper/IntegralSignMapper.java | 23 +
.../oraclemapper/IntegralSignMapper.xml | 18 +
.../oraclemapper/IntegrationListMapper.java | 17 +
.../oraclemapper/IntegrationListMapper.xml | 34 +
.../oraclemapper}/OperatorsMapper.java | 19 +-
.../oraclemapper}/OperatorsMapper.xml | 70 +-
.../oraclemapper/UserTableMapper.java | 29 +
.../oraclemapper/UserTableMapper.xml | 61 +
.../oraclemapper/UserVehicleMapper.java | 28 +
.../oraclemapper/UserVehicleMapper.xml | 86 +
.../service/IPayIntegrationNumberService.java | 59 -
.../impl/ApponintmentInfoServiceImpl.java | 378 ++--
.../nmgs/service/impl/CommonServiceImpl.java | 2 +-
.../com/nmgs/service/impl/ExcelDateImpl.java | 9 -
.../service/impl/IntegralAppServiceImpl.java | 2 +-
.../impl/IntegralLevelMessageServiceImpl.java | 50 +-
.../nmgs/service/impl/IntegralSeriveImpl.java | 2 +-
.../service/impl/IntegralSignServiceImpl.java | 140 +-
.../impl/IntegralStarSetupServiceImpl.java | 6 +-
.../impl/IntegrationListServiceImpl.java | 2 +-
.../service/impl/MessagePushServiceImpl.java | 2 +-
.../service/impl/OperatorsServiceImpl.java | 28 +-
.../impl/PayIntegrationNumberServiceImpl.java | 219 ---
.../service/impl/QCodeInfoServiceImpl.java | 1037 +++--------
.../service/impl/RotationServiceImpl.java | 2 +-
.../com/nmgs/service/impl/SelectDataImpl.java | 3 +-
.../SerivceAreaOperationMealServiceImpl.java | 2 +-
.../impl/ServiceAreaPicServiceImpl.java | 5 +-
.../service/impl/ServiceAreaServiceImpl.java | 10 +-
.../impl/ServiceAreaSpecialServiceImpl.java | 2 +-
.../impl/SolveUserAndVehcleServiceImpl.java | 4 +-
.../service/impl/UserTableServiceImpl.java | 159 +-
.../service/impl/UserVehicleServiceImpl.java | 226 ++-
.../service/impl/VehicleScoreServiceImpl.java | 2 +-
.../java/com/nmgs/util/DataSourceUtil.java | 48 +
.../java/com/nmgs/util/HttpClientUtil.java | 2 -
src/main/java/com/nmgs/util/ImageUtils.java | 3 +-
src/main/java/com/nmgs/util/OcrUtil.java | 176 ++
src/main/java/com/nmgs/util/PubTools.java | 12 +-
src/main/java/com/nmgs/util/main.java | 2 +-
.../resources/static/application.properties | 53 +-
95 files changed, 4688 insertions(+), 3025 deletions(-)
delete mode 100644 .gitignore
create mode 100644 .idea/CopilotChatHistory.xml
create mode 100644 .idea/CopilotWebChatHistory.xml
create mode 100644 .idea/dataSources.local.xml
create mode 100644 .idea/dataSources.xml
create mode 100644 .idea/encodings.xml
create mode 100644 .idea/misc.xml
create mode 100644 .idea/uiDesigner.xml
delete mode 100644 IntegraManager.iml
delete mode 100644 LICENSE
delete mode 100644 README.md
create mode 100644 src/main/java/com/nmgs/common/GlobalExceptionHandler.java
create mode 100644 src/main/java/com/nmgs/config/DataSourceConfig.java
delete mode 100644 src/main/java/com/nmgs/controller/InitController.java
delete mode 100644 src/main/java/com/nmgs/mapper/IntegrationListMapper.java
delete mode 100644 src/main/java/com/nmgs/mapper/IntegrationListMapper.xml
delete mode 100644 src/main/java/com/nmgs/mapper/PayIntegrationNumberMapper.java
delete mode 100644 src/main/java/com/nmgs/mapper/PayIntegrationNumberMapper.xml
delete mode 100644 src/main/java/com/nmgs/mapper/ServiceAreaMapper.java
delete mode 100644 src/main/java/com/nmgs/mapper/ServiceAreaMapper.xml
delete mode 100644 src/main/java/com/nmgs/mapper/ServiceAreaPicMapper.java
delete mode 100644 src/main/java/com/nmgs/mapper/ServiceAreaPicMapper.xml
rename src/main/java/com/nmgs/{mapper => mappercommon}/Mapper.java (91%)
rename src/main/java/com/nmgs/{mapper => mappercommon}/Mapper.xml (93%)
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/AppointmentInfoMyMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/AppointmentInfoMyMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/CafterTableMyMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/CafterTableMyMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralLeavingMyMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralLeavingMyMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralSignMyMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralSignMyMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/IntegrationListMyMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/IntegrationListMyMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/OperatorsMyMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/OperatorsMyMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/UserVehicleMyMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/mysqlmapper/UserVehicleMyMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/AppointmentInfoMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/AppointmentInfoMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/CafterTableMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/CafterTableMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/IntegralLeavingMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/IntegralLeavingMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/IntegralSignMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/IntegralSignMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/IntegrationListMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/IntegrationListMapper.xml
rename src/main/java/com/nmgs/{mapper => mapperset/oraclemapper}/OperatorsMapper.java (74%)
rename src/main/java/com/nmgs/{mapper => mapperset/oraclemapper}/OperatorsMapper.xml (50%)
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.xml
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/UserVehicleMapper.java
create mode 100644 src/main/java/com/nmgs/mapperset/oraclemapper/UserVehicleMapper.xml
delete mode 100644 src/main/java/com/nmgs/service/IPayIntegrationNumberService.java
delete mode 100644 src/main/java/com/nmgs/service/impl/PayIntegrationNumberServiceImpl.java
create mode 100644 src/main/java/com/nmgs/util/DataSourceUtil.java
create mode 100644 src/main/java/com/nmgs/util/OcrUtil.java
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index a1c2a23..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Compiled class file
-*.class
-
-# Log file
-*.log
-
-# BlueJ files
-*.ctxt
-
-# Mobile Tools for Java (J2ME)
-.mtj.tmp/
-
-# Package Files #
-*.jar
-*.war
-*.nar
-*.ear
-*.zip
-*.tar.gz
-*.rar
-
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
diff --git a/.idea/CopilotChatHistory.xml b/.idea/CopilotChatHistory.xml
new file mode 100644
index 0000000..2455bc4
--- /dev/null
+++ b/.idea/CopilotChatHistory.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/CopilotWebChatHistory.xml b/.idea/CopilotWebChatHistory.xml
new file mode 100644
index 0000000..6527f35
--- /dev/null
+++ b/.idea/CopilotWebChatHistory.xml
@@ -0,0 +1,1567 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 2d3568f..10e8010 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -7,13 +7,12 @@
-
+
-
diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml
new file mode 100644
index 0000000..92ce326
--- /dev/null
+++ b/.idea/dataSources.local.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+ master_key
+ nmgjtjt
+
+ user_and_system_sources
+
+
+
\ No newline at end of file
diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
new file mode 100644
index 0000000..47fc13f
--- /dev/null
+++ b/.idea/dataSources.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ oracle.19
+ true
+ false
+ oracle.jdbc.OracleDriver
+ jdbc:oracle:thin:@10.15.0.12:1521:ORAL
+
+
+
+
+
+ $ProjectFileDir$
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..63e9001
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..0c1b5d4
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..2b63946
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d645138..a5151a0 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,16 +3,76 @@
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -75,80 +135,97 @@
- {
- "keyToString": {
- "Application.DivPassDataImpl.executor": "Run",
- "Application.ImageUtils.executor": "Run",
- "Application.PubTools.executor": "Run",
- "Application.QCodeInfoServiceImpl.executor": "Debug",
- "Application.SensitiveFilter.executor": "Run",
- "Application.main.executor": "Run",
- "Application.redisConfigUtil.executor": "Debug",
- "Maven.IntegraManager [clean].executor": "Run",
- "Maven.IntegraManager [install].executor": "Run",
- "Maven.IntegralManager [clean].executor": "Run",
- "Maven.IntegralManager [install].executor": "Run",
- "Maven.IntegralManager [validate].executor": "Run",
- "Maven.IntegralManagerSys [clean].executor": "Run",
- "Maven.IntegralManagerSys [install].executor": "Run",
- "Maven.devProject [clean].executor": "Run",
- "Maven.devProject [install].executor": "Run",
- "Maven.dev_project [clean].executor": "Run",
- "Maven.dev_project [install].executor": "Run",
- "Maven.special_event [clean].executor": "Run",
- "Maven.special_event [install].executor": "Run",
- "Maven.special_event [org.apache.maven.plugins:maven-assembly-plugin:3.3.0:single].executor": "Run",
- "Maven.special_event [org.springframework.boot:spring-boot-maven-plugin:2.7.11:repackage].executor": "Run",
- "Maven.special_event [package].executor": "Run",
- "Maven.special_event [validate].executor": "Run",
- "RunOnceActivity.OpenProjectViewOnStart": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "TomEE Server.special_event.executor": "Debug",
- "Tomcat Server.Tomcat 9.0.80.executor": "Debug",
- "deletionFromPopupRequiresConfirmation": "false",
- "git-widget-placeholder": "master",
- "kotlin-language-version-configured": "true",
- "last_opened_file_path": "D:/workspace/IntegralManager",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "project.structure.last.edited": "Modules",
- "project.structure.proportion": "0.15",
- "project.structure.side.proportion": "0.37169158",
- "settings.editor.selected.configurable": "reference.settings.project.maven.importing",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -164,11 +241,11 @@
-
+
-
+
@@ -250,6 +327,8 @@
+
+
@@ -360,9 +439,15 @@
+
+
+
+
+
+
@@ -537,7 +622,52 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -731,7 +861,31 @@
1739870419806
-
+
+
+ 1740463493215
+
+
+
+ 1740463493215
+
+
+
+ 1746519427010
+
+
+
+ 1746519427011
+
+
+
+ 1746759881177
+
+
+
+ 1746759881177
+
+
@@ -764,7 +918,10 @@
-
+
+
+
+
@@ -779,6 +936,16 @@
111
+
+ file://$PROJECT_DIR$/src/main/java/com/nmgs/util/redisConfigUtil.java
+ 13
+
+
+
+ file://$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/UserTableServiceImpl.java
+ 116
+
+
diff --git a/IntegraManager.iml b/IntegraManager.iml
deleted file mode 100644
index 0326c76..0000000
--- a/IntegraManager.iml
+++ /dev/null
@@ -1,192 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/README.md b/README.md
deleted file mode 100644
index 75a92c3..0000000
--- a/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# IntegralManager
-
-#### 介绍
-天润科丰小程序后台接口
-
-#### 软件架构
-采用springbbot +mybatisplus +tomcat +负载均衡
-
-
-#### 安装教程
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### 使用说明
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### 参与贡献
-
-1. Fork 本仓库
-2. 新建 Feat_xxx 分支
-3. 提交代码
-4. 新建 Pull Request
-
-
-#### 特技
-
-1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
-2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
-3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
-4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
-5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
-6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
diff --git a/pom.xml b/pom.xml
index 47198b6..ca4a609 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
com.example
- IntegraManager
+ IntegralManager
1.0-SNAPSHOT
war
@@ -53,7 +53,7 @@
mysql
mysql-connector-java
- 8.0.23
+ 8.0.11
@@ -147,11 +147,6 @@
hibernate-validator
6.2.0.Final
-
com.tetragramato
custom-spring-boot-resttemplate
@@ -224,6 +219,17 @@
commons-io
2.4
+
+
+ com.aliyun
+ ocr_api20210707
+ 3.1.2
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jta-atomikos
+
diff --git a/src/main/java/com/nmgs/AppController/ServiceAreaOperatorsController.java b/src/main/java/com/nmgs/AppController/ServiceAreaOperatorsController.java
index f0ec2c2..bdb71a7 100644
--- a/src/main/java/com/nmgs/AppController/ServiceAreaOperatorsController.java
+++ b/src/main/java/com/nmgs/AppController/ServiceAreaOperatorsController.java
@@ -2,7 +2,7 @@ package com.nmgs.AppController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.config.ResultData;
import com.nmgs.entity.ServiceAreaOperators;
-import com.nmgs.mapper.OperatorsMapper;
+import com.nmgs.mapperset.oraclemapper.OperatorsMapper;
import com.nmgs.service.IOperatorsService;
import com.nmgs.util.TokenUtil;
import io.swagger.annotations.Api;
diff --git a/src/main/java/com/nmgs/MyEnvironmentPostProcessor.java b/src/main/java/com/nmgs/MyEnvironmentPostProcessor.java
index ca600f5..ffdef76 100644
--- a/src/main/java/com/nmgs/MyEnvironmentPostProcessor.java
+++ b/src/main/java/com/nmgs/MyEnvironmentPostProcessor.java
@@ -10,6 +10,8 @@ import org.springframework.core.env.PropertiesPropertySource;
import java.io.File;
import java.io.FileInputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.Properties;
@Configuration
@@ -36,38 +38,80 @@ public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor {
if (!fileNewproperties.exists()) {
fileNewproperties.createNewFile();
}
- properties.load(new FileInputStream(path));
+ properties.load(Files.newInputStream(Paths.get(path)));
String DBType = properties.getProperty("DBType") == null ? "1" : properties.getProperty("DBType");
- Newproperties.load(new FileInputStream(NewPath));
+ Newproperties.load(Files.newInputStream(Paths.get(NewPath)));
properties.setProperty("spring.logback.logPath",PathUtil.TomcatPath+"/logs");
- properties.setProperty("spring.datasource.url",properties.getProperty("DBUrl"));
- properties.setProperty("spring.datasource.username",properties.getProperty("DBUserName"));
- properties.setProperty("spring.datasource.password",PassWordUtils.decrypt(properties.getProperty("DBPassWord")));
+ properties.setProperty("spring.datasource.primary.jdbc-url", properties.getProperty("DBUrl"));
+ properties.setProperty("spring.datasource.primary.username", properties.getProperty("DBUserName"));
+ properties.setProperty("spring.datasource.primary.password", PassWordUtils.decrypt(properties.getProperty("DBPassWord")));
+ properties.setProperty("spring.datasource.main.jdbc-url", properties.getProperty("DBUrl"));
+ properties.setProperty("spring.datasource.main.username", properties.getProperty("DBUserName"));
+ properties.setProperty("spring.datasource.main.password", PassWordUtils.decrypt(properties.getProperty("DBPassWord")));
if(DBType.equals("1")){
- properties.setProperty("spring.datasource.driver-class-name",Newproperties.getProperty("sqlClassName"));
- properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("sqlvalidationQuery"));
- properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("sqlvalidationQuery"));
+ properties.setProperty("spring.datasource.primary.driver-class-name", Newproperties.getProperty("sqlClassName"));
+ properties.setProperty("spring.datasource.primary.validationQuery", Newproperties.getProperty("sqlvalidationQuery"));
+ properties.setProperty("spring.datasource.primary.hikari.connection-test-query", Newproperties.getProperty("sqlvalidationQuery"));
+ properties.setProperty("spring.datasource.main.driver-class-name", Newproperties.getProperty("sqlClassName"));
+ properties.setProperty("spring.datasource.main.validationQuery", Newproperties.getProperty("sqlvalidationQuery"));
+ properties.setProperty("spring.datasource.main.hikari.connection-test-query", Newproperties.getProperty("sqlvalidationQuery"));
}else if(DBType.equals("2")){
- properties.setProperty("spring.datasource.driver-class-name",Newproperties.getProperty("OracleClassName"));
- properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("OraclevalidationQuery"));
- properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("OraclevalidationQuery"));
+ properties.setProperty("spring.datasource.primary.driver-class-name", Newproperties.getProperty("OracleClassName"));
+ properties.setProperty("spring.datasource.primary.validationQuery", Newproperties.getProperty("OraclevalidationQuery"));
+ properties.setProperty("spring.datasource.primary.hikari.connection-test-query", Newproperties.getProperty("OraclevalidationQuery"));
+ properties.setProperty("spring.datasource.main.driver-class-name", Newproperties.getProperty("OracleClassName"));
+ properties.setProperty("spring.datasource.main.validationQuery", Newproperties.getProperty("OraclevalidationQuery"));
+ properties.setProperty("spring.datasource.main.hikari.connection-test-query", Newproperties.getProperty("OraclevalidationQuery"));
}else if(DBType.equals("3")){
- properties.setProperty("spring.datasource.driver-class-name",Newproperties.getProperty("DMClassName"));
- properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("DMvalidationQuery"));
- properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("DMvalidationQuery"));
+ properties.setProperty("spring.datasource.primary.driver-class-name", Newproperties.getProperty("DMClassName"));
+ properties.setProperty("spring.datasource.primary.validationQuery", Newproperties.getProperty("DMvalidationQuery"));
+ properties.setProperty("spring.datasource.primary.hikari.connection-test-query", Newproperties.getProperty("DMvalidationQuery"));
+ properties.setProperty("spring.datasource.main.driver-class-name", Newproperties.getProperty("DMClassName"));
+ properties.setProperty("spring.datasource.main.validationQuery", Newproperties.getProperty("DMvalidationQuery"));
+ properties.setProperty("spring.datasource.main.hikari.connection-test-query", Newproperties.getProperty("DMvalidationQuery"));
}else if(DBType.equals("4")){
- properties.setProperty("spring.datasource.driver-class-name",Newproperties.getProperty("MySQLClassName"));
- properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("MySQLvalidationQuery"));
- properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("MySQLvalidationQuery"));
+ properties.setProperty("spring.datasource.primary.driver-class-name", Newproperties.getProperty("MySQLClassName"));
+ properties.setProperty("spring.datasource.primary.validationQuery", Newproperties.getProperty("MySQLvalidationQuery"));
+ properties.setProperty("spring.datasource.primary.hikari.connection-test-query", Newproperties.getProperty("MySQLvalidationQuery"));
+ properties.setProperty("spring.datasource.main.driver-class-name", Newproperties.getProperty("MySQLClassName"));
+ properties.setProperty("spring.datasource.main.validationQuery", Newproperties.getProperty("MySQLvalidationQuery"));
+ properties.setProperty("spring.datasource.main.hikari.connection-test-query", Newproperties.getProperty("MySQLvalidationQuery"));
+ }
+ String BakDBType = properties.getProperty("BakDBType") == null ? "1" : properties.getProperty("BakDBType");
+ properties.setProperty("spring.datasource.bak.jdbc-url", properties.getProperty("BAKDBUrl"));
+ properties.setProperty("spring.datasource.bak.username", properties.getProperty("BAKDBUserName"));
+ properties.setProperty("spring.datasource.bak.password", PassWordUtils.decrypt(properties.getProperty("BAKDBPassWord")));
+ if (BakDBType.equals("1")) {
+ properties.setProperty("spring.datasource.bak.driver-class-name", Newproperties.getProperty("sqlClassName"));
+ properties.setProperty("spring.datasource.bak.validationQuery", Newproperties.getProperty("sqlvalidationQuery"));
+ properties.setProperty("spring.datasource.bak.hikari.connection-test-query", Newproperties.getProperty("sqlvalidationQuery"));
+ } else if (BakDBType.equals("2")) {
+ properties.setProperty("spring.datasource.bak.driver-class-name", Newproperties.getProperty("OracleClassName"));
+ properties.setProperty("spring.datasource.bak.validationQuery", Newproperties.getProperty("OraclevalidationQuery"));
+ properties.setProperty("spring.datasource.bak.hikari.connection-test-query", Newproperties.getProperty("OraclevalidationQuery"));
+ } else if (BakDBType.equals("3")) {
+ properties.setProperty("spring.datasource.bak.driver-class-name", Newproperties.getProperty("DMClassName"));
+ properties.setProperty("spring.datasource.bak.validationQuery", Newproperties.getProperty("DMvalidationQuery"));
+ properties.setProperty("spring.datasource.bak.hikari.connection-test-query", Newproperties.getProperty("DMvalidationQuery"));
+ } else if (BakDBType.equals("4")) {
+ properties.setProperty("spring.datasource.bak.driver-class-name", Newproperties.getProperty("MySQLClassName"));
+ properties.setProperty("spring.datasource.bak.validationQuery", Newproperties.getProperty("MySQLvalidationQuery"));
+ properties.setProperty("spring.datasource.bak.hikari.connection-test-query", Newproperties.getProperty("MySQLvalidationQuery"));
}
System.out.println("---------------------------IntegralManager本次载入数据库----------------------");
- System.out.println("server.port: " + properties.getProperty("server.port"));
- System.out.println("server.ip: " + properties.getProperty("server.ip"));
-
- System.out.println(" url : " + properties.getProperty("spring.datasource.url"));
- System.out.println(" username : " + properties.getProperty("spring.datasource.username"));
- System.out.println(" password : " + properties.getProperty("spring.datasource.password"));
- System.out.println(" driver-class-name : " + properties.getProperty("spring.datasource.driver-class-name"));
+ System.out.println(" url : " + properties.getProperty("spring.datasource.primary.jdbc-url"));
+ System.out.println(" username : " + properties.getProperty("spring.datasource.primary.username"));
+ System.out.println(" password : " + properties.getProperty("spring.datasource.primary.password"));
+ System.out.println(" driver-class-name : " + properties.getProperty("spring.datasource.primary.driver-class-name"));
+ System.out.println(" bakurl : " + properties.getProperty("spring.datasource.bak.jdbc-url"));
+ System.out.println(" bakusername : " + properties.getProperty("spring.datasource.bak.username"));
+ System.out.println(" bakpassword : " + properties.getProperty("spring.datasource.bak.password"));
+ System.out.println(" bakdriver-class-name : " + properties.getProperty("spring.datasource.bak.driver-class-name"));
+ System.out.println(" mainurl : " + properties.getProperty("spring.datasource.main.jdbc-url"));
+ System.out.println(" mainusername : " + properties.getProperty("spring.datasource.main.username"));
+ System.out.println(" mainpassword : " + properties.getProperty("spring.datasource.main.password"));
+ System.out.println(" maindriver-class-name : " + properties.getProperty("spring.datasource.main.driver-class-name"));
+ System.out.println("---------------------------IntegralManager本次载入数据库----------------------");
//环境名称随意取,但尽量不能和其他环境名称相同,避免不生效
PropertiesPropertySource propertySource = new PropertiesPropertySource("environmentPostProcessor", properties);
PropertiesPropertySource newPropertySource = new PropertiesPropertySource("newEnvironmentPostProcessor", Newproperties);
diff --git a/src/main/java/com/nmgs/common/GlobalExceptionHandler.java b/src/main/java/com/nmgs/common/GlobalExceptionHandler.java
new file mode 100644
index 0000000..a05e971
--- /dev/null
+++ b/src/main/java/com/nmgs/common/GlobalExceptionHandler.java
@@ -0,0 +1,46 @@
+package com.nmgs.common;
+
+import com.nmgs.config.ResultData;
+import com.nmgs.util.LogUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.dao.DataAccessException;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+import java.sql.SQLException;
+
+@Slf4j
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+
+ @ExceptionHandler(DataAccessException.class)
+ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+ public ResultData handleDataAccessException(DataAccessException e) {
+ LogUtil.WriteLog_Error("数据库操作失败:" + e.getMessage(),"GlobalExceptionHandler");
+ return ResultData.fail("数据库操作失败" );
+ }
+
+ @ExceptionHandler(SQLException.class)
+ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+ public ResultData handleSQLException(SQLException e) {
+ LogUtil.WriteLog_Error("数据库SQL执行失败:" + e.getMessage(),"GlobalExceptionHandler");
+ return ResultData.fail("数据库SQL执行失败");
+ }
+
+ @ExceptionHandler(IllegalArgumentException.class)
+ @ResponseStatus(HttpStatus.BAD_REQUEST)
+ public ResultData handleIllegalArgumentException(IllegalArgumentException e) {
+ LogUtil.WriteLog_Error("参数错误:" + e.getMessage(),"GlobalExceptionHandler");
+ return ResultData.fail("参数错误" );
+ }
+
+ @ExceptionHandler(Exception.class)
+ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+ public ResultData handleGenericException(Exception e) {
+ LogUtil.WriteLog_Error("服务器内部错误:" + e.getMessage(),"GlobalExceptionHandler");
+ return ResultData.fail("服务器内部错误" );
+ }
+}
diff --git a/src/main/java/com/nmgs/config/DataSourceConfig.java b/src/main/java/com/nmgs/config/DataSourceConfig.java
new file mode 100644
index 0000000..c75abfb
--- /dev/null
+++ b/src/main/java/com/nmgs/config/DataSourceConfig.java
@@ -0,0 +1,172 @@
+package com.nmgs.config;
+
+import com.atomikos.icatch.jta.UserTransactionImp;
+import com.atomikos.icatch.jta.UserTransactionManager;
+import com.mysql.cj.jdbc.MysqlXADataSource;
+import com.nmgs.util.PropertiesUtil;
+import com.trkf.PasswordEncryption.PassWordUtils;
+import com.zaxxer.hikari.HikariDataSource;
+import oracle.jdbc.xa.client.OracleXADataSource;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.jdbc.DataSourceBuilder;
+import org.springframework.boot.jta.atomikos.AtomikosDataSourceBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.springframework.transaction.jta.JtaTransactionManager;
+
+import javax.sql.DataSource;
+import javax.sql.XADataSource;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+import java.sql.SQLException;
+
+@Configuration
+@EnableTransactionManagement
+public class DataSourceConfig {
+
+
+
+ @Bean
+ public UserTransaction localuserTransaction() throws SystemException {
+ UserTransactionImp userTransactionImp = new UserTransactionImp();
+ userTransactionImp.setTransactionTimeout(6000);
+ return userTransactionImp;
+ }
+
+ @Bean
+ public TransactionManager localtransactionManager() throws SystemException {
+ UserTransactionManager userTransactionManager = new UserTransactionManager();
+ userTransactionManager.setForceShutdown(false);
+ userTransactionManager.setTransactionTimeout(6000);
+ return userTransactionManager;
+ }
+
+ @Bean
+ public JtaTransactionManager jtatransactionManager(
+ UserTransaction localuserTransaction,
+ TransactionManager localtransactionManager) {
+ JtaTransactionManager jtaTransactionManager = new JtaTransactionManager(localuserTransaction, localtransactionManager);
+ jtaTransactionManager.setDefaultTimeout(6000);
+ return jtaTransactionManager;
+ }
+ /**
+ * 将这个对象放入spring容器中(交给Spring管理)
+ * @ConfigurationProperties 自动配置属性
+ */
+ @Bean
+ @ConfigurationProperties(prefix = "spring.datasource.primary")
+ public XADataSource getDataSourcePrimary() throws SQLException {
+ // 创建XA连接池
+ if("2".equals(PropertiesUtil.getValue("DBType"))){
+ OracleXADataSource oracleXADataSource = new OracleXADataSource();
+ oracleXADataSource.setURL(PropertiesUtil.getValue("DBUrl"));
+ oracleXADataSource.setUser(PropertiesUtil.getValue("DBUserName"));
+ oracleXADataSource.setPassword(PassWordUtils.decrypt(PropertiesUtil.getValue("DBPassWord")));
+ return oracleXADataSource;
+ }else if("4".equals(PropertiesUtil.getValue("DBType"))){
+ MysqlXADataSource oracleXADataSource = new MysqlXADataSource();
+ oracleXADataSource.setURL(PropertiesUtil.getValue("DBUrl"));
+ oracleXADataSource.setUser(PropertiesUtil.getValue("DBUserName"));
+ oracleXADataSource.setPassword(PassWordUtils.decrypt(PropertiesUtil.getValue("DBPassWord")));
+ return oracleXADataSource;
+ }
+ return null;
+ }
+
+
+ @Bean(name = "primaryDataSource")
+ @DependsOn({"getDataSourcePrimary","jtatransactionManager"})
+ public DataSource primaryDataSource(@Qualifier("getDataSourcePrimary") XADataSource xaDataSource) {
+ AtomikosDataSourceBean atomikosDataSourceBean = new AtomikosDataSourceBean();
+ //atomikosDataSourceBean.setXaDataSourceClassName("com.zaxxer.hikari.HikariXADataSource");
+ // 必须为数据源指定唯一标识
+ atomikosDataSourceBean.setUniqueResourceName("oracleDataSource");
+ atomikosDataSourceBean.setMinPoolSize(3);
+ atomikosDataSourceBean.setMaxPoolSize(25);
+ atomikosDataSourceBean.setMaxIdleTime(60000);
+ //获取连接的最大等待时间(单位:秒),超时抛出异常。默认 0(无限等待),建议设为 30 秒。
+ atomikosDataSourceBean.setBorrowConnectionTimeout(300);
+ // 每分钟检查空闲连接(单位:秒)
+ atomikosDataSourceBean.setMaintenanceInterval(60);
+ //事务超时后强制回收连接的等待时间(单位:秒),默认为 0(不启用)。
+ atomikosDataSourceBean.setReapTimeout(20); // 事务超时20秒后回收:
+ atomikosDataSourceBean.setXaDataSource(xaDataSource);
+ return atomikosDataSourceBean;
+
+ }
+
+ /**
+ * 将这个对象放入spring容器中(交给Spring管理)
+ * @ConfigurationProperties 自动配置属性
+ */
+ @Bean
+ @ConfigurationProperties(prefix = "spring.datasource.bak")
+ public XADataSource getDataSourceBak() throws SQLException {
+ // 创建XA连接池
+ // 创建XA连接池
+ if("2".equals(PropertiesUtil.getValue("BakDBType"))){
+ OracleXADataSource oracleXADataSource = new OracleXADataSource();
+ oracleXADataSource.setURL(PropertiesUtil.getValue("BAKDBUrl"));
+ oracleXADataSource.setUser(PropertiesUtil.getValue("BAKDBUserName"));
+ oracleXADataSource.setPassword(PassWordUtils.decrypt(PropertiesUtil.getValue("BAKDBPassWord")));
+ return oracleXADataSource;
+ }else if("4".equals(PropertiesUtil.getValue("BakDBType"))){
+ MysqlXADataSource oracleXADataSource = new MysqlXADataSource();
+ oracleXADataSource.setURL(PropertiesUtil.getValue("BAKDBUrl"));
+ oracleXADataSource.setUser(PropertiesUtil.getValue("BAKDBUserName"));
+ oracleXADataSource.setPassword(PassWordUtils.decrypt(PropertiesUtil.getValue("BAKDBPassWord")));
+ return oracleXADataSource;
+ }
+ return null;
+ }
+ @Bean(name = "bakDataSource")
+ @DependsOn({"getDataSourceBak","jtatransactionManager"})
+ public DataSource bakDataSource(@Qualifier("getDataSourceBak") XADataSource xaDataSource) {
+ AtomikosDataSourceBean atomikosDataSourceBean = new AtomikosDataSourceBean();
+ //atomikosDataSourceBean.setXaDataSourceClassName("com.zaxxer.hikari.HikariXADataSource");
+ // 必须为数据源指定唯一标识
+ atomikosDataSourceBean.setUniqueResourceName("mysqlDataSource");
+ atomikosDataSourceBean.setMinPoolSize(2);
+ atomikosDataSourceBean.setMaxPoolSize(50);
+ // 空闲连接保留 300 秒(5分钟)
+ atomikosDataSourceBean.setMaxIdleTime(60000);
+ atomikosDataSourceBean.setTestQuery("select 1");
+ //获取连接的最大等待时间(单位:秒),超时抛出异常。默认 0(无限等待),建议设为 30 秒。
+ atomikosDataSourceBean.setBorrowConnectionTimeout(300);
+ // 每分钟检查空闲连接(单位:秒)
+ atomikosDataSourceBean.setMaintenanceInterval(60);
+ //事务超时后强制回收连接的等待时间(单位:秒),默认为 0(不启用)。
+ atomikosDataSourceBean.setReapTimeout(20); // 事务超时20秒后回收:
+ atomikosDataSourceBean.setXaDataSource(xaDataSource);
+ return atomikosDataSourceBean;
+
+ }
+
+
+ @Bean(name = "commonDataSource")
+ @ConfigurationProperties(prefix = "spring.datasource.main")
+ public DataSource commonDataSource() {
+ return DataSourceBuilder.create().type(HikariDataSource.class).build();
+ }
+ public static DataSource initSource(String sourceType){
+ DataSourceConfig dsc=new DataSourceConfig();
+ try{
+ if("PRIMARY".equals(sourceType)){
+ return (DataSource) dsc.getDataSourcePrimary();
+ }else if("BAK".equals(sourceType)){
+ return (DataSource)dsc.getDataSourcePrimary();
+ }else if("COMMON".equals(sourceType)){
+ return dsc.commonDataSource();
+ }
+
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+}
+
diff --git a/src/main/java/com/nmgs/config/MybatisConfig.java b/src/main/java/com/nmgs/config/MybatisConfig.java
index a1c7589..aa43581 100644
--- a/src/main/java/com/nmgs/config/MybatisConfig.java
+++ b/src/main/java/com/nmgs/config/MybatisConfig.java
@@ -1,13 +1,25 @@
package com.nmgs.config;
import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.nmgs.util.PropertiesUtil;
+import org.apache.ibatis.logging.stdout.StdOutImpl;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
-//@Configuration
+import javax.sql.DataSource;
+
+@Configuration
public class MybatisConfig {
- // @Bean
+ @Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
if(PropertiesUtil.getValue("DBType").equals("1")){
@@ -21,19 +33,109 @@ public class MybatisConfig {
}
return interceptor;
}
- /**
- *旧版
- *分页插件
- */
-// @Bean
-// public PaginationInterceptor paginationInterceptor() {
-// PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
-// // 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
-// // paginationInterceptor.setOverflow(false);
-// // 设置最大单页限制数量,默认 500 条,-1 不受限制
-// // paginationInterceptor.setLimit(500);
-// // 开启 count 的 join 优化,只针对部分 left join
-// paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
-// return paginationInterceptor;
-// }
+
+ @Configuration
+ @MapperScan(
+ basePackages = "com.nmgs.mapperset.mysqlmapper",
+ sqlSessionFactoryRef = "mysqlSqlSessionFactory"
+ )
+ public static class MysqlMyBatisConfig {
+
+ @Autowired
+ @Qualifier("bakDataSource")
+ private DataSource bakDataSource;
+ @Autowired
+ @Qualifier("mybatisPlusInterceptor")
+ private MybatisPlusInterceptor mybatisPlusInterceptor;
+
+ @Bean
+ public SqlSessionFactory mysqlSqlSessionFactory() throws Exception {
+ SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+ if(bakDataSource==null){
+ bakDataSource=DataSourceConfig.initSource("BAK");
+ }
+ sessionFactory.setDataSource(bakDataSource);
+ MybatisConfiguration configuration = new MybatisConfiguration();
+ configuration.addInterceptor(mybatisPlusInterceptor );
+ // 配置打印sql语句
+ if("Y".equals(PropertiesUtil.getValue("mybatislogImplEnabled"))){
+ configuration.setLogImpl(StdOutImpl.class);
+ }
+ sessionFactory.setConfiguration(configuration);
+ sessionFactory.setMapperLocations(
+ new PathMatchingResourcePatternResolver()
+ .getResources("classpath:com/nmgs/mapperset/mysqlmapper/*.xml")
+ );
+ return sessionFactory.getObject();
+ }
+ }
+
+ @Configuration
+ @MapperScan(
+ basePackages = "com.nmgs.mapperset.oraclemapper",
+ sqlSessionFactoryRef = "oracleSqlSessionFactory"
+ )
+ public static class OracleMyBatisConfig {
+
+ @Autowired
+ @Qualifier("primaryDataSource")
+ private DataSource primaryDataSource;
+ @Autowired
+ @Qualifier("mybatisPlusInterceptor")
+ private MybatisPlusInterceptor mybatisPlusInterceptor;
+ @Bean
+ public SqlSessionFactory oracleSqlSessionFactory() throws Exception {
+ SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+ sessionFactory.setDataSource(primaryDataSource);
+ if(primaryDataSource==null){
+ primaryDataSource=DataSourceConfig.initSource("PRIMARY");
+ }
+ MybatisConfiguration configuration = new MybatisConfiguration();
+ configuration.addInterceptor(mybatisPlusInterceptor );
+ // 配置打印sql语句
+ if("Y".equals(PropertiesUtil.getValue("mybatislogImplEnabled"))){
+ configuration.setLogImpl(StdOutImpl.class);
+ }
+ sessionFactory.setConfiguration(configuration);
+ sessionFactory.setMapperLocations(
+ new PathMatchingResourcePatternResolver()
+ .getResources("classpath:com/nmgs/mapperset/oraclemapper/*.xml")
+ );
+ return sessionFactory.getObject();
+ }
+ }
+ @Configuration
+ @MapperScan(
+ basePackages = "com.nmgs.mappercommon",
+ sqlSessionFactoryRef = "commonSqlSessionFactory"
+ )
+ public static class commonMyBatisConfig {
+
+ @Autowired
+ @Qualifier("commonDataSource")
+ private DataSource commonDataSource;
+ @Autowired
+ @Qualifier("mybatisPlusInterceptor")
+ private MybatisPlusInterceptor mybatisPlusInterceptor;
+ @Bean
+ public SqlSessionFactory commonSqlSessionFactory() throws Exception {
+ SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+ if(commonDataSource==null){
+ commonDataSource=DataSourceConfig.initSource("COMMON");
+ }
+ sessionFactory.setDataSource(commonDataSource);
+ MybatisConfiguration configuration = new MybatisConfiguration();
+ configuration.addInterceptor(mybatisPlusInterceptor );
+ // 配置打印sql语句
+ if("Y".equals(PropertiesUtil.getValue("mybatislogImplEnabled"))){
+ configuration.setLogImpl(StdOutImpl.class);
+ }
+ sessionFactory.setConfiguration(configuration);
+ sessionFactory.setMapperLocations(
+ new PathMatchingResourcePatternResolver()
+ .getResources("classpath:com/nmgs/mappercommon/*.xml")
+ );
+ return sessionFactory.getObject();
+ }
+ }
}
diff --git a/src/main/java/com/nmgs/controller/FileUploadController.java b/src/main/java/com/nmgs/controller/FileUploadController.java
index c7c1ef9..abb8ee7 100644
--- a/src/main/java/com/nmgs/controller/FileUploadController.java
+++ b/src/main/java/com/nmgs/controller/FileUploadController.java
@@ -34,10 +34,7 @@ public class FileUploadController {
String os = props.getProperty("os.name").toLowerCase();
String fileAddressLocal = PathUtil.uploadPath + "/" + PubTools.getCurrentDateYMD();
if (os.startsWith("win")) {
- // fileAddressLocal = PropertiesUtil.getValue("fileAddressWin");
fileAddressLocal = fileAddressLocal.replace("/", "\\");
- } else {
- // fileAddressLocal = PropertiesUtil.getValue("fileAddressLinux");
}
LogUtil.WriteLog_Info("附件上传接口====fileAddressLocal====" + fileAddressLocal, "FileUploadController");
if (!PubTools.isNull(fileAddressLocal)) {
@@ -56,36 +53,13 @@ public class FileUploadController {
} else {
return ResultData.fail("上传附件失败:附件类型不匹配");
}
-
- /* File dest = new File(PropertiesUtil.getValue("fileTemp"), fileName);
- System.out.println(filedata.getOriginalFilename());
- // 使用下面的jar包
- FileUtils.copyInputStreamToFile(filedata.getInputStream(), dest);
- File fileTemp = new File(PropertiesUtil.getValue("fileTemp") + "/" + fileName);
- if (!fileTemp.exists()) {
- return ResultData.success(2, "附件上传失败");
- }
- String imageBase64 = ImageUtils.getImgFileToBase64(PropertiesUtil.getValue("fileTemp") + "/" + fileName);
- if (fileTemp.exists()) {
- fileTemp.delete();
- }*/
byte[] bytes = filedata.getBytes();
String imageBase64 = ImageUtils.byteToBase64(bytes);
if (PubTools.isNull(imageBase64)) {
- return ResultData.success(2, "附件解析失败");
+ return ResultData.fail(-1, "附件解析失败");
}
String addWaterImage = ImageUtils.addImageWaterMark(imageBase64, "仅用于内蒙古交通货运车辆积分会员认证", fileName);
if (!PubTools.isNull(addWaterImage)) {
- /*// ImageUtils.delFile(fileName, false);
- byte[] imageBytes = Base64.getDecoder().decode(addWaterImage);
- // 创建文件
- File file = new File(fileAddressLocal, fileName); // 指定上传位置
- if (file.exists()) {
- file.delete();
- }
- // 保存文件
- LogUtil.WriteLog_Info("附件开始上传到服务器===========" + PubTools.getCurrentDate(), "FileUploadController");
- FileUtils.writeByteArrayToFile(file, imageBytes);*/
LogUtil.WriteLog_Info("附件上传到服务器结束===========" + PubTools.getCurrentDate(), "FileUploadController");
} else if ("-9999".equals(addWaterImage)) {
throw new Exception("附件添加水印失败");
@@ -93,7 +67,6 @@ public class FileUploadController {
}
LogUtil.WriteLog_Info("附件上传接口执行结束===========" + PubTools.getCurrentDate(), "FileUploadController");
} catch (Exception e) {
- e.printStackTrace();
return ResultData.fail("上传附件失败:" + e.getMessage());
}
return ResultData.success("上传成功", fileName, 1);
diff --git a/src/main/java/com/nmgs/controller/InitController.java b/src/main/java/com/nmgs/controller/InitController.java
deleted file mode 100644
index f60e497..0000000
--- a/src/main/java/com/nmgs/controller/InitController.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.nmgs.controller;
-
-import io.swagger.annotations.Api;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-
-@Component
-@Api(tags = "项目启动初始化")
-public class InitController {
-
- @PostConstruct
- public void init() {
- // 初始化代码
- System.out.println("初始化方法被调用");
- }
-}
diff --git a/src/main/java/com/nmgs/controller/WebSocketRedis.java b/src/main/java/com/nmgs/controller/WebSocketRedis.java
index 3f5eb94..1522716 100644
--- a/src/main/java/com/nmgs/controller/WebSocketRedis.java
+++ b/src/main/java/com/nmgs/controller/WebSocketRedis.java
@@ -22,7 +22,7 @@ import java.io.IOException;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicInteger;
-@Component
+//@Component
@ServerEndpoint(value = "/webSocketCheck/{userId}")
public class WebSocketRedis {
Log log= LogFactory.getLog(WebSocketRedis.class);
diff --git a/src/main/java/com/nmgs/mapper/IntegrationListMapper.java b/src/main/java/com/nmgs/mapper/IntegrationListMapper.java
deleted file mode 100644
index 2b70882..0000000
--- a/src/main/java/com/nmgs/mapper/IntegrationListMapper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.nmgs.mapper;
-
-
-import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
-import com.nmgs.entity.IntegrationList;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface IntegrationListMapper extends MppBaseMapper {
-
-
- /**
- * 获取用户增加积分清单
- * @param params
- * @return
- */
- List getUserAddIntegation(@Param("params") Map params);
-
- /**
- * 获取用户消费积分清单
- * @param params
- * @return
- */
- List getUserPayIntegation(@Param("params") Map params);
-
- Integer getMaxId();
-
- /**
- * 获取每日积分增长量
- * @param param
- * @return
- */
- List> getIntegrationGrowTotal(@Param("params")Map param);
-
- /**
- * 获取车辆积分增长量排名前十
- * @param params
- * @return
- */
- List> getCarIntegrationGrowTotal(@Param("params")Map params);
-
- /**
- * 获取月增长积分、消费积分
- * @param params
- * @return
- */
- Map getMonthFeeTotal(@Param("params")Map params);
-
- /**
- * 消费积分分类占比
- * @param params
- * @return
- */
- List> getFeeTypeTotal(@Param("params")Map params);
-
- /**
- * 根据日期获取排名积分奖励情况
- * @param params
- * @return
- */
- List getAMEScoreByTime(@Param("params") Map params);
-
- @Select("select max(list.TOTALADDINTEGRATION) from INTEGRATION_LIST_TABLE list where list.USERID = #{id}")
- BigDecimal getTotalAddIntegrationByUserId(@Param("id")Integer id);
-}
diff --git a/src/main/java/com/nmgs/mapper/IntegrationListMapper.xml b/src/main/java/com/nmgs/mapper/IntegrationListMapper.xml
deleted file mode 100644
index 05e807d..0000000
--- a/src/main/java/com/nmgs/mapper/IntegrationListMapper.xml
+++ /dev/null
@@ -1,319 +0,0 @@
-
-
-
-
-
- SELECT MAX(ID) FROM INTEGRATION_LIST_TABLE
-
-
-
- select
- list.ID,
- list.ACARNO ,
- list.LASTINTEGRATION,
- list.PAYINTEGRATION ,
- list.RESTINTEGRATION,
- list.PAYTIME,
- case
- when list.PAYTYPE = 'P' then '加油'
- when list.PAYTYPE = 'PM' then '加油里程'
- when list.PAYTYPE = 'M' then '里程'
- else ''end as PAYTYPE
- from integration_list_table list
-
- and list.PAYTYPE in ('P','PM','M')
-
-
-
- AND list.ACARNO LIKE #{aCarNo}
-
-
-
-
-
- select
- list.ID,
- list.ACARNO ,
- list.LASTINTEGRATION,
- list.PAYINTEGRATION ,
- list.RESTINTEGRATION,
- list.PAYTIME,
- case
- when list.PAYTYPE = 'C' then '餐饮消费'
- else ''end as PAYTYPE,
- area.VALUE as serviceAreaName
- from integration_list_table list
- left join cafter_table caf on caf.INTEGRATIONLISTID = list.id
- left join service_area_operators_table operation on operation.JOBNUMBER = caf.USERJOBNUMBER
- left join service_area_table area on area.ID = operation.SERVICEAREAID
-
- and list.PAYTYPE in ('C')
-
-
-
- AND list.ACARNO LIKE #{aCarNo}
-
-
-
-
-
-
- select
- sum(list.PAYINTEGRATION/100.00) as TOTALCOUNT
- from INTEGRATION_LIST_TABLE list
-
- and list.PAYTYPE not in ('FC','FP')
-
-
-
- AND list.PAYTIME >= dateadd(day,0,#{params.startTime})
-
-
- AND list.PAYTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= STR_TO_DATE(#{params.startTime}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
- AND list.PAYTIME < dateadd(day,0,#{params.endTime})
-
-
- AND list.PAYTIME < TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME < TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME < STR_TO_DATE(#{params.endTime}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
-
-
- SELECT RESULT.* FROM ( select
- CONCAT(SUBSTR(list.ACARNO,0,INSTR(list.ACARNO,'_')-1),CONCAT(CONCAT('(',color.TEXT),')')) as ACARNO,
- sum(list.PAYINTEGRATION/100.00) as TOTALCOUNT
- from
- integration_list_table list
- left join platecolor_text color on color.VALUE = SUBSTR(list.ACARNO,INSTR(list.ACARNO,'_')+1)
-
- and list.PAYTYPE in ('AM','AP')
-
-
-
- AND list.PAYTIME >= dateadd(day,0,#{params.classDateBeginQuery})
-
-
- AND list.PAYTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= STR_TO_DATE(#{params.classDateBeginQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
- AND list.PAYTIME <= dateadd(day,0,#{params.classDateEndQuery})
-
-
- AND list.PAYTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME <= STR_TO_DATE(#{params.classDateEndQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
- GROUP BY ACARNO,color.TEXT
- order by TOTALCOUNT desc) RESULT where
- ROWNUM <= 10
-
-
-
- select
- sum(case when list.PAYTYPE not in ('FC','FP') then list.PAYINTEGRATION/100.00 else 0 end ) as ATOTAL,
- sum(case when list.PAYTYPE in ('FC','FP') then list.PAYINTEGRATION/100.00 else 0 end ) FTOTAL
- from
- integration_list_table list
-
-
-
-
- AND list.PAYTIME >= dateadd(day,0,#{params.classDateBeginQuery})
-
-
- AND list.PAYTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= STR_TO_DATE(#{params.classDateBeginQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
- AND list.PAYTIME <= dateadd(day,0,#{params.classDateEndQuery})
-
-
- AND list.PAYTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME <= STR_TO_DATE(#{params.classDateEndQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
- select
- 'FC' as PEYTYPE,
- peytype.TEXT as PEYTYPENAME,
- NVL(sum(case when list.PAYTYPE in ('FC') then list.PAYINTEGRATION/100.00 else 0 end ),0) as FTOTAL
- from
- PEYTYPE_TEXT peytype
- left join integration_list_table list on peytype.VALUE = list.PAYTYPE
-
- and peytype.VALUE in ('FC')
-
-
-
- AND list.PAYTIME >= dateadd(day,0,#{params.classDateBeginQuery})
-
-
- AND list.PAYTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= STR_TO_DATE(#{params.classDateBeginQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
- AND list.PAYTIME <= dateadd(day,0,#{params.classDateEndQuery})
-
-
- AND list.PAYTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME <= STR_TO_DATE(#{params.classDateEndQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
- GROUP BY peytype.VALUE,peytype.TEXT
- UNION ALL
- select
- 'FP' as PEYTYPE,
- peytype.TEXT as PEYTYPENAME,
- nvl(sum(case when list.PAYTYPE in ('FP') then list.PAYINTEGRATION/100.00 else 0 end ),0) as FTOTAL
- from
- PEYTYPE_TEXT peytype
- left join integration_list_table list on peytype.VALUE = list.PAYTYPE
-
- and peytype.VALUE in ('FP')
-
-
-
- AND list.PAYTIME >= dateadd(day,0,#{params.classDateBeginQuery})
-
-
- AND list.PAYTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME >= STR_TO_DATE(#{params.classDateBeginQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
- AND list.PAYTIME <= dateadd(day,0,#{params.classDateEndQuery})
-
-
- AND list.PAYTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.PAYTIME <= STR_TO_DATE(#{params.classDateEndQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
- GROUP BY peytype.VALUE,peytype.TEXT
-
-
-
-
-
- select
- *
- from integration_list_table list
-
- and list.PAYTYPE in ('AME')
-
-
-
- AND list.MONTHMILEGRANTTIME >= dateadd(day,0,#{params.startTime})
-
-
- AND list.MONTHMILEGRANTTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.MONTHMILEGRANTTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.MONTHMILEGRANTTIME >= STR_TO_DATE(#{params.startTime}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
- AND list.MONTHMILEGRANTTIME < dateadd(day,0,#{params.endTime})
-
-
- AND list.MONTHMILEGRANTTIME < TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.MONTHMILEGRANTTIME < TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND list.MONTHMILEGRANTTIME < STR_TO_DATE(#{params.endTime}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapper/PayIntegrationNumberMapper.java b/src/main/java/com/nmgs/mapper/PayIntegrationNumberMapper.java
deleted file mode 100644
index 9d5dd8f..0000000
--- a/src/main/java/com/nmgs/mapper/PayIntegrationNumberMapper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.nmgs.mapper;
-
-import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
-import com.nmgs.entity.PayIntegrationNumber;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-
-@Mapper
-public interface PayIntegrationNumberMapper extends MppBaseMapper {
-
-
- /**
- * 获取配置信息
- * @return
- */
- List getPayIntegrationNumberList();
-
- /**
- * 获取最大id
- * @return
- */
- Integer getMaxId();
-
-
- /**
- * 根据类型获取配置的积分
- * @param type
- * @return
- */
- @Select("SELECT pay.ID,pay.VALUE,pay.type FROM pay_integration_number_table pay where pay.type=#{type}")
- PayIntegrationNumber getAuScore(@Param("type") String type);
-}
diff --git a/src/main/java/com/nmgs/mapper/PayIntegrationNumberMapper.xml b/src/main/java/com/nmgs/mapper/PayIntegrationNumberMapper.xml
deleted file mode 100644
index 619c365..0000000
--- a/src/main/java/com/nmgs/mapper/PayIntegrationNumberMapper.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
- SELECT MAX(ID) FROM pay_integration_number_table
-
-
-
- SELECT
- pay.ID,
- pay.VALUE/100.00 as VALUE,
- pay.type,
- pey.TEXT as typeName
- FROM pay_integration_number_table pay
- left join PEYTYPE_TEXT pey on pey.VALUE = pay.TYPE
-
-
-
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapper/ServiceAreaMapper.java b/src/main/java/com/nmgs/mapper/ServiceAreaMapper.java
deleted file mode 100644
index d2a7983..0000000
--- a/src/main/java/com/nmgs/mapper/ServiceAreaMapper.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.nmgs.mapper;
-
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
-import com.nmgs.entity.ServiceArea;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface ServiceAreaMapper extends MppBaseMapper {
- /**
- * 分页查找岗位数据
- * @param page
- * @param params
- * @return
- */
- Page getServiceAreaList(Page page, @Param("params") Map params);
-
- /**
- * 获取最大id
- * @return
- */
- Integer getMaxId();
-
- /**
- *获取服务区类型数据
- * @return
- */
- List> selectServiceTypeList();
-
- /**
- *获取服务区服务种类数据
- * @return
- */
- List> selectServiceKindList();
-
- /**
- * 根据日期获取服务器核销次数前五
- * @param params
- * @return
- */
- List> getServiceAreaCafCount(@Param("params") Map params);
- /**
- * 根据日期获取服务器积分消费排名
- * @param params
- * @return
- */
- List> getServiceAreaCafTotal(@Param("params")Map params);
-
- /**
- * 服务器积分消费占比
- * @param params
- * @return
- */
- List> getServiceAreaFee(@Param("params")Map params);
-}
diff --git a/src/main/java/com/nmgs/mapper/ServiceAreaMapper.xml b/src/main/java/com/nmgs/mapper/ServiceAreaMapper.xml
deleted file mode 100644
index 3245c29..0000000
--- a/src/main/java/com/nmgs/mapper/ServiceAreaMapper.xml
+++ /dev/null
@@ -1,236 +0,0 @@
-
-
-
-
-
-
-
-
- select
- area.ID,
- area.AREANAME,
- area.SERVICETYPE,
- area.SERVICEKIND,
- LISTAGG(kind.TEXT,', ') WITHIN GROUP(ORDER BY kind.VALUE) as serviceKindName,
- type.TEXT as serviceTypeName
- from
- service_area_table area
- left join service_area_kind_text kind on INSTR(area.SERVICEKIND,kind.VALUE) > 0
- left join service_area_TYPE_text type on type.VALUE = area.SERVICETYPE
-
-
-
-
- AND area.AREANAME LIKE #{areaName}
-
-
-
-
- AND area.SERVICETYPE = #{params.serviceType}
-
-
-
-
- and INSTR(area.SERVICEKIND,#{params.serviceKindQuery}) > 0
-
-
- GROUP BY area.ID,area.AREANAME,area.SERVICETYPE,area.SERVICEKIND,type.TEXT
-
-
-
-
- select
- area.ID,
- area.AREANAME,
- area.SERVICETYPE,
- area.SERVICEKIND,
- GROUP_CONCAT(kind.TEXT ORDER BY kind.VALUE) as serviceKindName,
- type.TEXT as serviceTypeName
- from
- service_area_table area
- left join service_area_kind_text kind on INSTR(area.SERVICEKIND,kind.VALUE) > 0
- left join service_area_TYPE_text type on type.VALUE = area.SERVICETYPE
-
-
-
-
- AND area.AREANAME LIKE #{areaNameQuery}
-
-
-
-
- AND area.SERVICETYPE = #{params.serviceTypeQuery}
-
-
-
-
- and INSTR(area.SERVICEKIND,#{params.serviceKindQuery}) > 0
-
-
- GROUP BY area.ID
-
-
-
-
-
- SELECT * FROM service_area_TYPE_text sub order by sub.VALUE
-
-
-
-
- SELECT * FROM service_area_kind_text p order by p.VALUE
-
-
-
-
-
- SELECT MAX(ID) FROM SERVICE_AREA_TABLE
-
-
-
-
- SELECT RESULT.* FROM (
- select
- area.ID as ID,
- area.AREANAME as AREANAME,
- count(caf.id) as FEECOUNT
- from service_area_table area
- left join service_area_operators_table operation on operation.SERVICEAREAID = area.ID
- left join cafter_table caf on operation.JOBNUMBER = caf.USERJOBNUMBER
-
-
-
- AND caf.CAFTERTIME >= dateadd(day,0,#{params.classDateBeginQuery})
-
-
- AND caf.CAFTERTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME >= STR_TO_DATE(#{params.classDateBeginQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
- AND caf.CAFTERTIME <= dateadd(day,0,#{params.classDateEndQuery})
-
-
- AND caf.CAFTERTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME <= STR_TO_DATE(#{params.classDateEndQuery}, '%Y-%m-%d %H:%i:%s')
-
-
- left join WEIXN_USER_TABLE u on u.ID = caf.USERID
- left join integration_list_table list on list.ID = caf.INTEGRATIONLISTID
- GROUP BY area.ID,area.AREANAME
- order by FEECOUNT desc
- ) RESULT where
- ROWNUM <= 5
-
-
-
-
- SELECT RESULT.* FROM (
- select
- area.ID as ID,
- area.AREANAME as AREANAME,
- case when sum(list.PAYINTEGRATION) is not null then sum(list.PAYINTEGRATION/100.00) else 0 end as FEETOTAL
- from service_area_table area
- left join service_area_operators_table operation on operation.SERVICEAREAID = area.ID
- left join cafter_table caf on operation.JOBNUMBER = caf.USERJOBNUMBER
-
-
-
- AND caf.CAFTERTIME >= dateadd(day,0,#{params.classDateBeginQuery})
-
-
- AND caf.CAFTERTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME >= STR_TO_DATE(#{params.classDateBeginQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
- AND caf.CAFTERTIME <= dateadd(day,0,#{params.classDateEndQuery})
-
-
- AND caf.CAFTERTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME <= STR_TO_DATE(#{params.classDateEndQuery}, '%Y-%m-%d %H:%i:%s')
-
-
- left join WEIXN_USER_TABLE u on u.ID = caf.USERID
- left join integration_list_table list on list.ID = caf.INTEGRATIONLISTID
- GROUP BY area.ID,area.AREANAME
- order by FEETOTAL desc
- ) RESULT where
- ROWNUM <= 5
-
-
-
-
-
- select
- area.ID as ID,
- area.AREANAME as AREANAME,
- case when sum(list.PAYINTEGRATION) is not null then sum(list.PAYINTEGRATION/100.00) else 0 end as FEETOTAL
- from service_area_table area
- left join service_area_operators_table operation on operation.SERVICEAREAID = area.ID
- left join cafter_table caf on operation.JOBNUMBER = caf.USERJOBNUMBER
-
-
-
- AND caf.CAFTERTIME >= dateadd(day,0,#{params.classDateBeginQuery})
-
-
- AND caf.CAFTERTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME >= TO_DATE(#{params.classDateBeginQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME >= STR_TO_DATE(#{params.classDateBeginQuery}, '%Y-%m-%d %H:%i:%s')
-
-
-
-
-
-
- AND caf.CAFTERTIME <= dateadd(day,0,#{params.classDateEndQuery})
-
-
- AND caf.CAFTERTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME <= TO_DATE(#{params.classDateEndQuery}, 'SYYYY-MM-DD HH24:MI:SS')
-
-
- AND caf.CAFTERTIME <= STR_TO_DATE(#{params.classDateEndQuery}, '%Y-%m-%d %H:%i:%s')
-
-
- left join WEIXN_USER_TABLE u on u.ID = caf.USERID
- left join integration_list_table list on list.ID = caf.INTEGRATIONLISTID
- GROUP BY area.ID,area.AREANAME
- order by FEETOTAL desc
-
-
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapper/ServiceAreaPicMapper.java b/src/main/java/com/nmgs/mapper/ServiceAreaPicMapper.java
deleted file mode 100644
index dd551ec..0000000
--- a/src/main/java/com/nmgs/mapper/ServiceAreaPicMapper.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.nmgs.mapper;
-
-
-import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
-import com.nmgs.entity.ServiceAreaPic;
-import org.apache.ibatis.annotations.Delete;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface ServiceAreaPicMapper extends MppBaseMapper {
-
- /**
- * 获取最大id
- * @return
- */
- Integer getMaxId();
-
-
- @Delete("delete from service_area_pic_table where SERVICEID=#{id}")
- int deletePicByAreaId(@Param("id") Integer id);
-
- @Select("select ID,SERVICEID,PICDATA from service_area_pic_table where SERVICEID=#{params.id}")
- List getAreaPic(@Param("params")Map params);
-
-}
diff --git a/src/main/java/com/nmgs/mapper/ServiceAreaPicMapper.xml b/src/main/java/com/nmgs/mapper/ServiceAreaPicMapper.xml
deleted file mode 100644
index f1f6840..0000000
--- a/src/main/java/com/nmgs/mapper/ServiceAreaPicMapper.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
- SELECT MAX(ID) FROM service_area_pic_table
-
-
-
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapper/Mapper.java b/src/main/java/com/nmgs/mappercommon/Mapper.java
similarity index 91%
rename from src/main/java/com/nmgs/mapper/Mapper.java
rename to src/main/java/com/nmgs/mappercommon/Mapper.java
index 04954be..eafc9cc 100644
--- a/src/main/java/com/nmgs/mapper/Mapper.java
+++ b/src/main/java/com/nmgs/mappercommon/Mapper.java
@@ -1,4 +1,4 @@
-package com.nmgs.mapper;
+package com.nmgs.mappercommon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -10,7 +10,7 @@ import java.util.List;
import java.util.Map;
-@org.apache.ibatis.annotations.Mapper
+//@org.apache.ibatis.annotations.Mapper
public interface Mapper extends BaseMapper {
diff --git a/src/main/java/com/nmgs/mapper/Mapper.xml b/src/main/java/com/nmgs/mappercommon/Mapper.xml
similarity index 93%
rename from src/main/java/com/nmgs/mapper/Mapper.xml
rename to src/main/java/com/nmgs/mappercommon/Mapper.xml
index 891fc45..58bdb1d 100644
--- a/src/main/java/com/nmgs/mapper/Mapper.xml
+++ b/src/main/java/com/nmgs/mappercommon/Mapper.xml
@@ -2,7 +2,7 @@
-
+
${sql}
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/AppointmentInfoMyMapper.java b/src/main/java/com/nmgs/mapperset/mysqlmapper/AppointmentInfoMyMapper.java
new file mode 100644
index 0000000..d206203
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/AppointmentInfoMyMapper.java
@@ -0,0 +1,18 @@
+package com.nmgs.mapperset.mysqlmapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface AppointmentInfoMyMapper {
+
+ /**
+ * 新增用户车辆信息
+ * @param param
+ * @return
+ */
+ public int addAppointmentInfo(@Param("params") Map param);
+ public int updateConpleteStatus(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/AppointmentInfoMyMapper.xml b/src/main/java/com/nmgs/mapperset/mysqlmapper/AppointmentInfoMyMapper.xml
new file mode 100644
index 0000000..e2d8d75
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/AppointmentInfoMyMapper.xml
@@ -0,0 +1,46 @@
+
+
+
+
+ update APPOINTMENT_INFO_TABLE
+ set COMPLETESTATUS=#{params.completeStatus}
+ where ORDERID = #{params.orderId}
+
+
+ insert into APPOINTMENT_INFO_TABLE(ID,USERID,ACARNO,APPOINTMENTTYPE,APPOINTMENTTIME,APPOINTMENTLINEID,
+ CREATETIME,SERVICEAREAID,MEALS,MEALSCOUNT,COMPLETESTATUS,INTEGRATIONLISTID,
+ SERVICEOPERATIONID,TOTALINTEGRAL,ORDERID)
+ values (#{params.maxId},${params.userId},#{params.acarno},#{params.appointmenttype},
+
+ dateadd(day,0,#{params.appointtime}),
+
+
+ TO_DATE(#{params.appointtime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.appointtime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.appointtime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.appointmentlineid},
+
+ dateadd(day,0,#{params.createtime}),
+
+
+ TO_DATE(#{params.createtime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.createtime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.createtime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.serviceareaId},#{params.meals},#{params.mealscount},#{params.completeStatus},#{params.integrationListId},
+ #{params.serviceOperationId,jdbcType=VARCHAR},#{params.totalIntegral},#{params.orderId})
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/CafterTableMyMapper.java b/src/main/java/com/nmgs/mapperset/mysqlmapper/CafterTableMyMapper.java
new file mode 100644
index 0000000..6912411
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/CafterTableMyMapper.java
@@ -0,0 +1,19 @@
+package com.nmgs.mapperset.mysqlmapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface CafterTableMyMapper {
+
+ /**
+ * 新增用户车辆信息
+ * @param param
+ * @return
+ */
+ public int addcafter(@Param("params") Map param);
+ public int updatecafter(@Param("params") Map param);
+ public int updatecafterConpleteStatus(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/CafterTableMyMapper.xml b/src/main/java/com/nmgs/mapperset/mysqlmapper/CafterTableMyMapper.xml
new file mode 100644
index 0000000..c11f9e6
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/CafterTableMyMapper.xml
@@ -0,0 +1,57 @@
+
+
+
+
+ update CAFTER_TABLE
+ set rollback=#{params.rollback}
+
+
+ ,ROLLBACKTIME = dateadd(day,0,#{params.rollbackTime})
+
+
+ ,ROLLBACKTIME= TO_DATE(#{params.rollbackTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,ROLLBACKTIME= TO_DATE(#{params.rollbackTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,ROLLBACKTIME= STR_TO_DATE(#{params.rollbackTime}, '%Y-%m-%d %H:%i:%s')
+
+
+
+ ,INTEGRALROLLBACK=#{params.integralrollback}
+
+ where ORDERID = #{params.orderId} AND USERJOBNUMBER= #{params.serverOperationId}
+
+
+ insert into CAFTER_TABLE(ID,
+ ACARNO,
+ USERID,
+ CAFTERTIME,
+ USERJOBNUMBER,
+ TRIMINTEGRAL,
+ INTEGRATIONLISTID,
+ ORDERID,CONTENT) values (#{params.maxId},#{params.acarNo},#{params.userId},
+
+ dateadd(day,0,#{params.cafterTime}),
+
+
+ TO_DATE(#{params.cafterTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.cafterTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.cafterTime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.userJobnumber}, #{params.trimintegral},#{params.integrationListId},#{params.orderId},#{params.content})
+
+
+ update CAFTER_TABLE
+ set COMPLETESTATUS=#{params.completeStatus}
+ where ORDERID = #{params.orderId}
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralLeavingMyMapper.java b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralLeavingMyMapper.java
new file mode 100644
index 0000000..65f6e7d
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralLeavingMyMapper.java
@@ -0,0 +1,17 @@
+package com.nmgs.mapperset.mysqlmapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface IntegralLeavingMyMapper {
+
+ /**
+ * 新增用户车辆信息
+ * @param param
+ * @return
+ */
+ public int addIntegralLeaving(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralLeavingMyMapper.xml b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralLeavingMyMapper.xml
new file mode 100644
index 0000000..74be044
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralLeavingMyMapper.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ insert into INTEGRAL_LEAVEMESSAGE_TABLE(ID,USERID,POSITION,MESSAGE,CREATETIME,REPLYSTATUS)
+ values(#{params.maxId},(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID=#{params.openId}),
+ #{params.positon},#{params.message},
+
+ dateadd(day,0,#{params.currentDate}),
+
+
+ TO_DATE(#{params.currentDate}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.currentDate}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.currentDate}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.replyStatus})
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralSignMyMapper.java b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralSignMyMapper.java
new file mode 100644
index 0000000..3ee319a
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralSignMyMapper.java
@@ -0,0 +1,23 @@
+package com.nmgs.mapperset.mysqlmapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface IntegralSignMyMapper {
+
+ /**
+ * 新增用户签到信息
+ * @param param
+ * @return
+ */
+ public int addIntegralSign(@Param("params") Map param);
+ /**
+ * 修改用户签到信息
+ * @param param
+ * @return
+ */
+ public int updateIntegralSign(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralSignMyMapper.xml b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralSignMyMapper.xml
new file mode 100644
index 0000000..fb0fb16
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegralSignMyMapper.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ insert into INTEGRAL_SIGN_TABLE(USERID,MONTH,DAY${params.dayvalue})
+ values((SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID=#{params.openId}),
+ #{params.month},'Y')
+
+
+ UPDATE INTEGRAL_SIGN_TABLE set Day${params.dayvalue}='Y' where USERID=(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID=#{params.openId})
+ AND MONTH=#{params.month}
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegrationListMyMapper.java b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegrationListMyMapper.java
new file mode 100644
index 0000000..654c61a
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegrationListMyMapper.java
@@ -0,0 +1,17 @@
+package com.nmgs.mapperset.mysqlmapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface IntegrationListMyMapper {
+
+ /**
+ * 新增用户签到积分信息
+ * @param param
+ * @return
+ */
+ public int addIntegralList(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegrationListMyMapper.xml b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegrationListMyMapper.xml
new file mode 100644
index 0000000..36fa5bb
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/IntegrationListMyMapper.xml
@@ -0,0 +1,27 @@
+
+
+
+
+ INSERT INTO integration_list_table ( ID, USERID,ACARNO, LASTINTEGRATION, TOTALADDINTEGRATION,PAYINTEGRATION, RESTINTEGRATION,
+ PAYTIME, PAYTYPE,CPENABLEINTEGRATION,OGENABLEINTEGRATION )
+ values(#{params.maxid},#{params.userId},#{params.acarNo},#{params.lastintegration},#{params.totalintegration},
+ #{params.payintegration},#{params.restintegration},
+
+ dateadd(day,0,#{params.payTime}),
+
+
+ TO_DATE(#{params.payTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.payTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.payTime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.paytype},#{params.cpenableintegration},#{params.ogenableintegration})
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/OperatorsMyMapper.java b/src/main/java/com/nmgs/mapperset/mysqlmapper/OperatorsMyMapper.java
new file mode 100644
index 0000000..53bcdd4
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/OperatorsMyMapper.java
@@ -0,0 +1,55 @@
+package com.nmgs.mapperset.mysqlmapper;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
+import com.nmgs.entity.ServiceAreaOperators;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+//@Mapper
+public interface OperatorsMyMapper extends MppBaseMapper {
+
+ /**
+ * 分页查询运营人员数据
+ *
+ * @param page
+ * @param params
+ * @return
+ */
+ Page getOperatorsList(Page page, @Param("params") Map params);
+
+
+ /**
+ * 获取员工角色
+ *
+ * @return
+ */
+ List> selectRoleListList();
+
+ /**
+ * 获取服务区
+ *
+ * @return
+ */
+ List> selectServiceAreaList();
+
+
+ /**
+ * 获取最大id
+ *
+ * @return
+ */
+ Integer getMaxId();
+
+ /**
+ * 根据工号获取数据
+ *
+ * @return
+ */
+ List getOperationByJobNumber(@Param("jobNumber") String jobNumber);
+
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/OperatorsMyMapper.xml b/src/main/java/com/nmgs/mapperset/mysqlmapper/OperatorsMyMapper.xml
new file mode 100644
index 0000000..d7294eb
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/OperatorsMyMapper.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+ SELECT
+ oper.ID,
+ oper.JOBNUMBER,
+ oper.JOBNUMBERINFO,
+ oper.ROLEID,
+ oper.SERVICEAREAID,
+ oper.USERNAME,
+ oper.PASSWORD,
+ r.VALUE as roleName,
+ area.AREANAME as serviceAreaName
+ FROM
+ service_area_operators_table oper
+ LEFT JOIN service_area_table area on area.ID = oper.SERVICEAREAID
+ LEFT JOIN service_area_operators_role_text r on r.ID = oper.ROLEID
+
+
+
+
+
+ AND oper.USERNAME LIKE #{userNameQuery}
+
+
+
+
+ AND oper.SERVICEAREAID = #{params.serviceAreaQuery}
+
+
+
+
+
+
+ AND oper.JOBNUMBER LIKE #{jobNumberQuery}
+
+
+ ORDER BY oper.JOBNUMBER
+
+
+
+ SELECT *
+ FROM service_area_operators_role_text sub
+ order by sub.ID
+
+
+
+
+ SELECT area.ID, area.AREANAME
+ FROM SERVICE_AREA_TABLE area
+ order by area.ID
+
+
+
+
+ SELECT MAX(ID)
+ FROM service_area_operators_table
+
+
+
+ SELECT oper.ID,
+ oper.JOBNUMBER,
+ oper.JOBNUMBERINFO,
+ oper.ROLEID,
+ oper.SERVICEAREAID,
+ oper.USERNAME,
+ oper.PASSWORD,
+ r.VALUE as roleName,
+ area.AREANAME as serviceAreaName,
+ saoc.INPUTMENEY AS inputMeney
+ FROM service_area_operators_table oper
+ LEFT JOIN service_area_table area on area.ID = oper.SERVICEAREAID
+ LEFT JOIN service_area_operators_role_text r on r.ID = oper.ROLEID
+ LEFT JOIN SERVICE_AREA_OPERATORS_COMPANY_TEXT saoc on saoc.ID = oper.COMPANYID
+ where JOBNUMBER = #{jobNumber}
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.java b/src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.java
new file mode 100644
index 0000000..3315667
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.java
@@ -0,0 +1,28 @@
+package com.nmgs.mapperset.mysqlmapper;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface UserTableMysqlMapper {
+
+ /**
+ * 新增用户
+ * @param param
+ * @return
+ */
+ public int addUser(@Param("params") Map param);
+
+ /**
+ * 用户信息修改
+ * @return
+ */
+ public int updateUser(@Param("params") Map param);
+ /**
+ * 用户信息修改
+ * @return
+ */
+ public int updateUserById(@Param("params") Map param);
+}
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.xml b/src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.xml
new file mode 100644
index 0000000..d9cecc0
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.xml
@@ -0,0 +1,61 @@
+
+
+
+
+ update WEIXN_USER_TABLE set CERTIFICATION=#{params.certification} ,NUMBERPICNAME=#{params.filename}
+
+ ,phone=#{params.phone}
+
+
+ ,REALNAME=#{params.realName}
+
+
+ ,IDNUMBER=#{params.idNumber}
+
+
+ ,CREATETIME <= dateadd(day,0,#{params.createTime})
+
+
+ ,CREATETIME= TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CREATETIME= TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CREATETIME= STR_TO_DATE(#{params.createTime}, '%Y-%m-%d %H:%i:%s')
+
+ where OPENID=#{params.openid}
+
+
+ insert into WEIXN_USER_TABLE(ID,OPENID,USERNAME,CREATETIME,ENABLEINTEGRATION,STARLEVEL,OILENABLEINTEGRATION,GASENABLEINTEGRATION,
+ SPENABLEINTEGRATION,CAFENABLEINTEGRATION,CERTIFICATION,OGENABLEINTEGRATION,CPENABLEINTEGRATION,REFERRERCODE)
+ values(#{params.userid},#{params.openid},#{params.username}
+
+ ,dateadd(day,0,#{params.createTime})
+
+
+ ,TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,STR_TO_DATE(#{params.createTime}, '%Y-%m-%d %H:%i:%s')
+
+ ,0,0,0,0,0,0,0,0,0,#{params.REFERRERCODE})
+
+
+ update WEIXN_USER_TABLE SET
+
+ CPENABLEINTEGRATION=#{params.enabledTICp},
+
+
+ OGENABLEINTEGRATION=#{params.enabledTIOG},
+
+ ENABLEINTEGRATION= #{params.enabledTI}
+ where OPENID=#{params.userId}
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/UserVehicleMyMapper.java b/src/main/java/com/nmgs/mapperset/mysqlmapper/UserVehicleMyMapper.java
new file mode 100644
index 0000000..e20a440
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/UserVehicleMyMapper.java
@@ -0,0 +1,28 @@
+package com.nmgs.mapperset.mysqlmapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface UserVehicleMyMapper {
+
+ /**
+ * 新增用户车辆信息
+ * @param param
+ * @return
+ */
+ public int addUserVehicle(@Param("params") Map param);
+ /**
+ * 修改用户车辆信息
+ * @param param
+ * @return
+ */
+ public int updateUserVehicle(@Param("params") Map param);
+ /**
+ * 删除用户车辆信息
+ * @return
+ */
+ public int delUserVehcile(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/mysqlmapper/UserVehicleMyMapper.xml b/src/main/java/com/nmgs/mapperset/mysqlmapper/UserVehicleMyMapper.xml
new file mode 100644
index 0000000..4ffa2e7
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/mysqlmapper/UserVehicleMyMapper.xml
@@ -0,0 +1,86 @@
+
+
+
+
+ update user_vehicle_table
+ set CERTIFICATION=#{params.certification}
+
+
+ ,CANCELTIME = dateadd(day,0,#{params.cancelTime})
+
+
+ ,CANCELTIME= TO_DATE(#{params.cancelTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CANCELTIME= TO_DATE(#{params.cancelTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CANCELTIME= STR_TO_DATE(#{params.cancelTime}, '%Y-%m-%d %H:%i:%s')
+
+
+
+
+ ,CREATETIME = dateadd(day,0,#{params.createTime})
+
+
+ ,CREATETIME= TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CREATETIME= TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CREATETIME= STR_TO_DATE(#{params.createTime}, '%Y-%m-%d %H:%i:%s')
+
+
+
+ ,LICENSEPICNAME=#{params.licensepic}
+
+
+ ,PERMITPICNAME=#{params.permitpic}
+
+
+ ,VEHICLEPICNAME=#{params.vehiclePic}
+
+
+ ,REFERRERCODE=#{params.referrerCode}
+
+
+ ,CHECKUSERNAME=#{params.checkName}
+
+
+ ,CHECKUSERNUMBER=#{params.checkUserNumber}
+
+ where USERID=#{params.userId} AND ACARNO=#{params.aCarNo}
+
+ AND ${params.commonCondition}
+
+
+
+ insert into user_vehicle_table(USERID,ACARNO,CREATETIME,CERTIFICATION)
+ values((SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID=#{params.openid}),#{params.aCarNo},
+
+ dateadd(day,0,#{params.createTime}),
+
+
+ TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.createTime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.certification})
+
+
+
+ delete from user_vehicle_table where USERID=#{params.userId} AND ACARNO=#{params.aCarNo}
+
+ AND ${params.commonCondition}
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/AppointmentInfoMapper.java b/src/main/java/com/nmgs/mapperset/oraclemapper/AppointmentInfoMapper.java
new file mode 100644
index 0000000..0dade8a
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/AppointmentInfoMapper.java
@@ -0,0 +1,18 @@
+package com.nmgs.mapperset.oraclemapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface AppointmentInfoMapper {
+
+ /**
+ * 新增用户车辆信息
+ * @param param
+ * @return
+ */
+ public int addAppointmentInfo(@Param("params") Map param);
+ public int updateConpleteStatus(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/AppointmentInfoMapper.xml b/src/main/java/com/nmgs/mapperset/oraclemapper/AppointmentInfoMapper.xml
new file mode 100644
index 0000000..98bcfa3
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/AppointmentInfoMapper.xml
@@ -0,0 +1,46 @@
+
+
+
+
+ update APPOINTMENT_INFO_TABLE
+ set COMPLETESTATUS=#{params.completeStatus}
+ where ORDERID = #{params.orderId}
+
+
+ insert into APPOINTMENT_INFO_TABLE(ID,USERID,ACARNO,APPOINTMENTTYPE,APPOINTMENTTIME,APPOINTMENTLINEID,
+ CREATETIME,SERVICEAREAID,MEALS,MEALSCOUNT,COMPLETESTATUS,INTEGRATIONLISTID,
+ SERVICEOPERATIONID,TOTALINTEGRAL,ORDERID)
+ values (#{params.maxId},${params.userId},#{params.acarno},#{params.appointmenttype},
+
+ dateadd(day,0,#{params.appointtime}),
+
+
+ TO_DATE(#{params.appointtime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.appointtime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.appointtime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.appointmentlineid},
+
+ dateadd(day,0,#{params.createtime}),
+
+
+ TO_DATE(#{params.createtime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.createtime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.createtime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.serviceareaId},#{params.meals},#{params.mealscount},#{params.completeStatus},#{params.integrationListId},
+ #{params.serviceOperationId,jdbcType=VARCHAR},#{params.totalIntegral},#{params.orderId})
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/CafterTableMapper.java b/src/main/java/com/nmgs/mapperset/oraclemapper/CafterTableMapper.java
new file mode 100644
index 0000000..99e00a3
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/CafterTableMapper.java
@@ -0,0 +1,19 @@
+package com.nmgs.mapperset.oraclemapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface CafterTableMapper {
+
+ /**
+ * 新增用户车辆信息
+ * @param param
+ * @return
+ */
+ public int addcafter(@Param("params") Map param);
+ public int updatecafter(@Param("params") Map param);
+ public int updatecafterConpleteStatus(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/CafterTableMapper.xml b/src/main/java/com/nmgs/mapperset/oraclemapper/CafterTableMapper.xml
new file mode 100644
index 0000000..abf876f
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/CafterTableMapper.xml
@@ -0,0 +1,58 @@
+
+
+
+
+ update CAFTER_TABLE
+ set rollback=#{params.rollback}
+
+
+ ,ROLLBACKTIME = dateadd(day,0,#{params.rollbackTime})
+
+
+ ,ROLLBACKTIME= TO_DATE(#{params.rollbackTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,ROLLBACKTIME= TO_DATE(#{params.rollbackTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,ROLLBACKTIME= STR_TO_DATE(#{params.cancelTime}, '%Y-%m-%d %H:%i:%s')
+
+
+
+ ,INTEGRALROLLBACK=#{params.integralrollback}
+
+ where ORDERID = #{params.orderId} AND USERJOBNUMBER= #{params.serverOperationId}
+
+
+ update CAFTER_TABLE
+ set COMPLETESTATUS=#{params.completeStatus}
+ where ORDERID = #{params.orderId}
+
+
+ insert into CAFTER_TABLE(ID,
+ ACARNO,
+ USERID,
+ CAFTERTIME,
+ USERJOBNUMBER,
+ TRIMINTEGRAL,
+ INTEGRATIONLISTID,
+ ORDERID,CONTENT) values (#{params.maxId},#{params.acarNo},#{params.userId},
+
+ dateadd(day,0,#{params.cafterTime}),
+
+
+ TO_DATE(#{params.cafterTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.cafterTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.cafterTime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.userJobnumber}, #{params.trimintegral},#{params.integrationListId},#{params.orderId},#{params.content})
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralLeavingMapper.java b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralLeavingMapper.java
new file mode 100644
index 0000000..14b3dae
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralLeavingMapper.java
@@ -0,0 +1,17 @@
+package com.nmgs.mapperset.oraclemapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface IntegralLeavingMapper {
+
+ /**
+ * 新增用户车辆信息
+ * @param param
+ * @return
+ */
+ public int addIntegralLeaving(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralLeavingMapper.xml b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralLeavingMapper.xml
new file mode 100644
index 0000000..e29e508
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralLeavingMapper.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ insert into INTEGRAL_LEAVEMESSAGE_TABLE(ID,USERID,POSITION,MESSAGE,CREATETIME,REPLYSTATUS)
+ values(#{params.maxId},(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID=#{params.openId}),
+ #{params.positon},#{params.message},
+
+ dateadd(day,0,#{params.currentDate}),
+
+
+ TO_DATE(#{params.currentDate}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.currentDate}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.currentDate}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.replyStatus})
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralSignMapper.java b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralSignMapper.java
new file mode 100644
index 0000000..376f655
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralSignMapper.java
@@ -0,0 +1,23 @@
+package com.nmgs.mapperset.oraclemapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface IntegralSignMapper {
+
+ /**
+ * 新增用户签到信息
+ * @param param
+ * @return
+ */
+ public int addIntegralSign(@Param("params") Map param);
+ /**
+ * 修改用户签到信息
+ * @param param
+ * @return
+ */
+ public int updateIntegralSign(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralSignMapper.xml b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralSignMapper.xml
new file mode 100644
index 0000000..d9d0dfa
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegralSignMapper.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ insert into INTEGRAL_SIGN_TABLE(USERID,MONTH,DAY${params.dayvalue})
+ values((SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID=#{params.openId}),
+ #{params.month},'Y')
+
+
+ UPDATE INTEGRAL_SIGN_TABLE set Day${params.dayvalue}='Y' where USERID=(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID=#{params.openId})
+ AND MONTH=#{params.month}
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/IntegrationListMapper.java b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegrationListMapper.java
new file mode 100644
index 0000000..27b6120
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegrationListMapper.java
@@ -0,0 +1,17 @@
+package com.nmgs.mapperset.oraclemapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface IntegrationListMapper {
+
+ /**
+ * 新增用户签到积分信息
+ * @param param
+ * @return
+ */
+ public int addIntegralList(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/IntegrationListMapper.xml b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegrationListMapper.xml
new file mode 100644
index 0000000..e8aaf4f
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/IntegrationListMapper.xml
@@ -0,0 +1,34 @@
+
+
+
+
+ INSERT INTO integration_list_table ( ID, USERID,ACARNO, LASTINTEGRATION,
+
+ TOTALADDINTEGRATION,
+
+ PAYINTEGRATION, RESTINTEGRATION,
+ PAYTIME, PAYTYPE,CPENABLEINTEGRATION,OGENABLEINTEGRATION )
+ values(#{params.maxid},#{params.userId},#{params.acarNo},#{params.lastintegration},
+
+ #{params.totalintegration},
+
+ #{params.payintegration},#{params.restintegration},
+
+ dateadd(day,0,#{params.payTime}),
+
+
+ TO_DATE(#{params.payTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.payTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.payTime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.paytype},#{params.cpenableintegration},#{params.ogenableintegration})
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapper/OperatorsMapper.java b/src/main/java/com/nmgs/mapperset/oraclemapper/OperatorsMapper.java
similarity index 74%
rename from src/main/java/com/nmgs/mapper/OperatorsMapper.java
rename to src/main/java/com/nmgs/mapperset/oraclemapper/OperatorsMapper.java
index 4ac6fdc..375bd15 100644
--- a/src/main/java/com/nmgs/mapper/OperatorsMapper.java
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/OperatorsMapper.java
@@ -1,52 +1,55 @@
-package com.nmgs.mapper;
+package com.nmgs.mapperset.oraclemapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.nmgs.entity.ServiceAreaOperators;
-import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
-@Mapper
+//@Mapper
public interface OperatorsMapper extends MppBaseMapper {
/**
* 分页查询运营人员数据
+ *
* @param page
* @param params
* @return
*/
- Page getOperatorsList(Page page, @Param("params")Map params);
-
+ Page getOperatorsList(Page page, @Param("params") Map params);
/**
* 获取员工角色
+ *
* @return
*/
- List> selectRoleListList();
+ List> selectRoleListList();
/**
* 获取服务区
+ *
* @return
*/
- List> selectServiceAreaList();
+ List> selectServiceAreaList();
/**
* 获取最大id
+ *
* @return
*/
Integer getMaxId();
/**
* 根据工号获取数据
+ *
* @return
*/
- List getOperationByJobNumber(@Param("jobNumber")String jobNumber);
+ List getOperationByJobNumber(@Param("jobNumber") String jobNumber);
}
diff --git a/src/main/java/com/nmgs/mapper/OperatorsMapper.xml b/src/main/java/com/nmgs/mapperset/oraclemapper/OperatorsMapper.xml
similarity index 50%
rename from src/main/java/com/nmgs/mapper/OperatorsMapper.xml
rename to src/main/java/com/nmgs/mapperset/oraclemapper/OperatorsMapper.xml
index aad784d..52e3009 100644
--- a/src/main/java/com/nmgs/mapper/OperatorsMapper.xml
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/OperatorsMapper.xml
@@ -2,22 +2,22 @@
-
+
SELECT
- oper.ID,
- oper.JOBNUMBER,
- oper.JOBNUMBERINFO,
- oper.ROLEID,
- oper.SERVICEAREAID,
- oper.USERNAME,
- oper.PASSWORD,
- r.VALUE as roleName,
- area.AREANAME as serviceAreaName
+ oper.ID,
+ oper.JOBNUMBER,
+ oper.JOBNUMBERINFO,
+ oper.ROLEID,
+ oper.SERVICEAREAID,
+ oper.USERNAME,
+ oper.PASSWORD,
+ r.VALUE as roleName,
+ area.AREANAME as serviceAreaName
FROM
- service_area_operators_table oper
+ service_area_operators_table oper
LEFT JOIN service_area_table area on area.ID = oper.SERVICEAREAID
LEFT JOIN service_area_operators_role_text r on r.ID = oper.ROLEID
@@ -44,38 +44,40 @@
- SELECT * FROM service_area_operators_role_text sub order by sub.ID
+ SELECT *
+ FROM service_area_operators_role_text sub
+ order by sub.ID
- SELECT area.ID,area.AREANAME FROM SERVICE_AREA_TABLE area order by area.ID
+ SELECT area.ID, area.AREANAME
+ FROM SERVICE_AREA_TABLE area
+ order by area.ID
-
-
- SELECT MAX(ID) FROM service_area_operators_table
+
+ SELECT MAX(ID)
+ FROM service_area_operators_table
-
- SELECT
- oper.ID,
- oper.JOBNUMBER,
- oper.JOBNUMBERINFO,
- oper.ROLEID,
- oper.SERVICEAREAID,
- oper.USERNAME,
- oper.PASSWORD,
- r.VALUE as roleName,
- area.AREANAME as serviceAreaName,
- saoc.INPUTMENEY AS inputMeney
- FROM
- service_area_operators_table oper
- LEFT JOIN service_area_table area on area.ID = oper.SERVICEAREAID
- LEFT JOIN service_area_operators_role_text r on r.ID = oper.ROLEID
- LEFT JOIN SERVICE_AREA_OPERATORS_COMPANY_TEXT saoc on saoc.ID = oper.COMPANYID
- where JOBNUMBER=#{jobNumber}
+
+ SELECT oper.ID,
+ oper.JOBNUMBER,
+ oper.JOBNUMBERINFO,
+ oper.ROLEID,
+ oper.SERVICEAREAID,
+ oper.USERNAME,
+ oper.PASSWORD,
+ r.VALUE as roleName,
+ area.AREANAME as serviceAreaName,
+ saoc.INPUTMENEY AS inputMeney
+ FROM service_area_operators_table oper
+ LEFT JOIN service_area_table area on area.ID = oper.SERVICEAREAID
+ LEFT JOIN service_area_operators_role_text r on r.ID = oper.ROLEID
+ LEFT JOIN SERVICE_AREA_OPERATORS_COMPANY_TEXT saoc on saoc.ID = oper.COMPANYID
+ where JOBNUMBER = #{jobNumber}
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.java b/src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.java
new file mode 100644
index 0000000..736e49a
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.java
@@ -0,0 +1,29 @@
+package com.nmgs.mapperset.oraclemapper;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface UserTableMapper {
+
+ /**
+ * 新增用户
+ * @param param
+ * @return
+ */
+ public int addUser(@Param("params") Map param);
+
+ /**
+ * 用户信息修改
+ * @return
+ */
+ public int updateUser(@Param("params") Map param);
+ /**
+ * 用户信息修改
+ * @return
+ */
+ public int updateUserById(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.xml b/src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.xml
new file mode 100644
index 0000000..814801f
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.xml
@@ -0,0 +1,61 @@
+
+
+
+
+ update WEIXN_USER_TABLE set CERTIFICATION=#{params.certification} ,NUMBERPICNAME=#{params.filename}
+
+ ,phone=#{params.phone}
+
+
+ ,REALNAME=#{params.realName}
+
+
+ ,IDNUMBER=#{params.idNumber}
+
+
+ ,CREATETIME <= dateadd(day,0,#{params.createTime})
+
+
+ ,CREATETIME= TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CREATETIME= TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CREATETIME= STR_TO_DATE(#{params.createTime}, '%Y-%m-%d %H:%i:%s')
+
+ where OPENID=#{params.openid}
+
+
+ insert into WEIXN_USER_TABLE(ID,OPENID,USERNAME,CREATETIME,ENABLEINTEGRATION,STARLEVEL,OILENABLEINTEGRATION,GASENABLEINTEGRATION,
+ SPENABLEINTEGRATION,CAFENABLEINTEGRATION,CERTIFICATION,OGENABLEINTEGRATION,CPENABLEINTEGRATION,REFERRERCODE)
+ values(#{params.userid},#{params.openid},#{params.username}
+
+ ,dateadd(day,0,#{params.createTime})
+
+
+ ,TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,STR_TO_DATE(#{params.createTime}, '%Y-%m-%d %H:%i:%s')
+
+ ,0,0,0,0,0,0,0,0,0,#{params.REFERRERCODE})
+
+
+ update WEIXN_USER_TABLE SET
+
+ CPENABLEINTEGRATION=#{params.enabledTICp},
+
+
+ OGENABLEINTEGRATION=#{params.enabledTIOG},
+
+ ENABLEINTEGRATION= #{params.enabledTI}
+ where OPENID=#{params.userId}
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/UserVehicleMapper.java b/src/main/java/com/nmgs/mapperset/oraclemapper/UserVehicleMapper.java
new file mode 100644
index 0000000..d6f2c93
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/UserVehicleMapper.java
@@ -0,0 +1,28 @@
+package com.nmgs.mapperset.oraclemapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+//@Mapper
+public interface UserVehicleMapper {
+
+ /**
+ * 新增用户车辆信息
+ * @param param
+ * @return
+ */
+ public int addUserVehicle(@Param("params") Map param);
+ /**
+ * 修改用户车辆信息
+ * @param param
+ * @return
+ */
+ public int updateUserVehicle(@Param("params") Map param);
+ /**
+ * 删除用户车辆信息
+ * @return
+ */
+ public int delUserVehcile(@Param("params") Map param);
+
+}
diff --git a/src/main/java/com/nmgs/mapperset/oraclemapper/UserVehicleMapper.xml b/src/main/java/com/nmgs/mapperset/oraclemapper/UserVehicleMapper.xml
new file mode 100644
index 0000000..ea9c323
--- /dev/null
+++ b/src/main/java/com/nmgs/mapperset/oraclemapper/UserVehicleMapper.xml
@@ -0,0 +1,86 @@
+
+
+
+
+ update user_vehicle_table
+ set CERTIFICATION=#{params.certification}
+
+
+ ,CANCELTIME = dateadd(day,0,#{params.cancelTime})
+
+
+ ,CANCELTIME= TO_DATE(#{params.cancelTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CANCELTIME= TO_DATE(#{params.cancelTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CANCELTIME= STR_TO_DATE(#{params.cancelTime}, '%Y-%m-%d %H:%i:%s')
+
+
+
+
+ ,CREATETIME = dateadd(day,0,#{params.createTime})
+
+
+ ,CREATETIME= TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CREATETIME= TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss')
+
+
+ ,CREATETIME= STR_TO_DATE(#{params.createTime}, '%Y-%m-%d %H:%i:%s')
+
+
+
+ ,LICENSEPICNAME=#{params.licensepic}
+
+
+ ,PERMITPICNAME=#{params.permitpic}
+
+
+ ,VEHICLEPICNAME=#{params.vehiclePic}
+
+
+ ,REFERRERCODE=#{params.referrerCode}
+
+
+ ,CHECKUSERNAME=#{params.checkName}
+
+
+ ,CHECKUSERNUMBER=#{params.checkUserNumber}
+
+ where USERID=#{params.userId} AND ACARNO=#{params.aCarNo}
+
+ AND ${params.commonCondition}
+
+
+
+ insert into user_vehicle_table(USERID,ACARNO,CREATETIME,CERTIFICATION)
+ values((SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID=#{params.openid}),#{params.aCarNo},
+
+ dateadd(day,0,#{params.createTime}),
+
+
+ TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ TO_DATE(#{params.createTime}, 'YYYY-MM-DD HH24:mi:ss'),
+
+
+ STR_TO_DATE(#{params.createTime}, '%Y-%m-%d %H:%i:%s'),
+
+ #{params.certification})
+
+
+
+ delete from user_vehicle_table where USERID=#{params.userId} AND ACARNO=#{params.aCarNo}
+
+ AND ${params.commonCondition}
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/nmgs/service/IPayIntegrationNumberService.java b/src/main/java/com/nmgs/service/IPayIntegrationNumberService.java
deleted file mode 100644
index 5bb3374..0000000
--- a/src/main/java/com/nmgs/service/IPayIntegrationNumberService.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.nmgs.service;
-
-
-import com.alibaba.fastjson.JSONArray;
-import com.nmgs.entity.PayIntegrationNumber;
-
-import java.util.List;
-import java.util.Map;
-
-public interface IPayIntegrationNumberService {
-
- /**
- * 获取配置信息
- * @return
- */
- List getPayIntegrationNumberList();
-
- /**
- * 保存配置信息
- * @param payIntegrationNumber
- * @return
- */
- int savePayIntegrationNumber(List payIntegrationNumber);
-
- /**
- * 获取每日积分增长量
- * @param params
- * @return
- */
- JSONArray getIntegrationGrowTotal(Map params);
-
- /**
- * 获取车辆积分增长量排名
- * @param params
- * @return
- */
- List> getCarIntegrationGrowTotal(Map params);
-
- /**
- * 月增长积分,月消费积分
- * @param params
- * @return
- */
- Map getMonthFeeTotal(Map params);
-
- /**
- * 获取消费积分分类占比
- * @param params
- * @return
- */
- List> getFeeTypeTotal(Map params);
-
- /**
- * 获取里程积分各路段占比
- * @param params
- * @return
- */
- List> getMileScoreType(Map params);
-}
diff --git a/src/main/java/com/nmgs/service/impl/ApponintmentInfoServiceImpl.java b/src/main/java/com/nmgs/service/impl/ApponintmentInfoServiceImpl.java
index 64539a9..99dda4d 100644
--- a/src/main/java/com/nmgs/service/impl/ApponintmentInfoServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/ApponintmentInfoServiceImpl.java
@@ -3,18 +3,27 @@ package com.nmgs.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.nmgs.entity.Consistant;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
+import com.nmgs.mapperset.mysqlmapper.AppointmentInfoMyMapper;
+import com.nmgs.mapperset.mysqlmapper.CafterTableMyMapper;
+import com.nmgs.mapperset.mysqlmapper.IntegrationListMyMapper;
+import com.nmgs.mapperset.mysqlmapper.UserTableMysqlMapper;
+import com.nmgs.mapperset.oraclemapper.AppointmentInfoMapper;
+import com.nmgs.mapperset.oraclemapper.CafterTableMapper;
+import com.nmgs.mapperset.oraclemapper.IntegrationListMapper;
+import com.nmgs.mapperset.oraclemapper.UserTableMapper;
import com.nmgs.service.AppointmentInfoService;
import com.nmgs.service.UserTableService;
import com.nmgs.util.*;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.math.BigDecimal;
+import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -34,6 +43,53 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
public void setMessagePushServiceImpl(MessagePushServiceImpl messagePushServiceImpl) {
this.messagePushServiceImpl = messagePushServiceImpl;
}
+ public IntegrationListMapper integrationListMapper;
+ @Autowired
+ public void setIntegrationListMapper(IntegrationListMapper integrationListMapper) {
+ this.integrationListMapper = integrationListMapper;
+ }
+ public IntegrationListMyMapper integrationListMyMapper;
+ @Autowired
+ public void setIntegrationListMyMapper(IntegrationListMyMapper integrationListMyMapper) {
+ this.integrationListMyMapper = integrationListMyMapper;
+ }
+ public UserTableMapper userTableMapper;
+ @Autowired
+ public void setUserTableMapper(UserTableMapper userTableMapper) {
+ this.userTableMapper = userTableMapper;
+ }
+ public UserTableMysqlMapper userTableMyMapper;
+ @Autowired
+ public void setUserTableMyMapper(UserTableMysqlMapper userTableMapper) {
+ this.userTableMyMapper = userTableMapper;
+ }
+ public UserTableMysqlMapper userTableMysqlMapper;
+ @Autowired
+ public void setUserTableMysqlMapper(UserTableMysqlMapper userTableMysqlMapper) {
+ this.userTableMysqlMapper = userTableMysqlMapper;
+ }
+ public CafterTableMapper cafterTableMapper;
+ @Autowired
+ public void setCafterTableMapper(CafterTableMapper cafterTableMapper) {
+ this.cafterTableMapper = cafterTableMapper;
+ }
+ public CafterTableMyMapper cafterTableMyMapper;
+ @Autowired
+ public void setCafterTableMyMapper(CafterTableMyMapper cafterTableMyMapper) {
+ this.cafterTableMyMapper = cafterTableMyMapper;
+ }
+ public AppointmentInfoMyMapper appointmentInfoMyMapper;
+ @Autowired
+ public void setAppointmentInfoMyMapper(AppointmentInfoMyMapper appointmentInfoMyMapper) {
+ this.appointmentInfoMyMapper = appointmentInfoMyMapper;
+ }
+
+ public AppointmentInfoMapper appointmentInfoMapper;
+
+ @Autowired
+ public void setAppointmentInfoMapper(AppointmentInfoMapper appointmentInfoMapper) {
+ this.appointmentInfoMapper = appointmentInfoMapper;
+ }
private static String sql="SELECT\n" +
"\tROWNUM AS num,\n" +
"\tait.ID,\n" +
@@ -262,7 +318,7 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
}
@Override
- @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
+ @Transactional(value = "jtatransactionManager",timeout = 100)
public JSONObject commit(String openId,String appointmentType,
String appointmentId,String aCarNo,
String serviceId,String operatorId,
@@ -271,7 +327,6 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
JSONObject retJo=new JSONObject();
String ret="-2";// -1 代表接口处理失败 1 处理成功 2 用户不存在 3 兑换积分大于用户可用积分 4 二维码信息过期 5 商户不存在 6 积分类型与消费方式不匹配 7 商户角色未设置 8 用户已冻结
String jobNumber = "";//商户工号
- try{
String currentDate=PubTools.getCurrentDate();
if("2".equals(appointmentType)) {//餐饮预约需要扣除积分
Map mapMealId = new HashMap();
@@ -294,28 +349,15 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
}
double discountMoney = PubTools.isNull(mealTotalMoney)?0.0:Double.parseDouble(mealTotalMoney);
double rebateIntegrateSave = 0.0;
-
- //查询预约的套餐总金额,由于可以多选和数量,所以需要遍历
- /* if (!PubTools.isNull(mealId)) {
- String[] spliMeal = mealId.split(",");
- String[] splitCount = mealIdCount.split(",");
- for (int k = 0; k < spliMeal.length; k++) {
- mapMealId.put(spliMeal[k], splitCount[k]);
- String mealSql = "select tt.MEALPRICE AS TOTALMONEY from SERVICE_AREA_OPERATION_MEAL_TABLE tt where tt.ID =" + spliMeal[k];
- Map select = this.mapperI.select(mealSql);
- discountMoney += PubTools.isEmpty(select.get("TOTALMONEY")) ? 0.0 : Double.parseDouble(select.get("TOTALMONEY").toString()) * Integer.parseInt(splitCount[k]);
- }
- }*/
-
retJo.put("ENABLEINTEGRATIONBEFORE", PubTools.doubleSave1(Double.parseDouble(CPENABLEINTEGRATION)));
String sqlFc = sqlTemp.replace("@TYPE@", "FC");//查询餐饮的兑换比例
List selectforlistFc = this.mapperI.selectforlist(sqlFc);
//判断兑换积分是否够本次折扣
int rebateInFc = 1;
- if (selectforlistFc.size() > 0) {
+ if (!selectforlistFc.isEmpty()) {
Map o = (Map) selectforlistFc.get(0);
BigDecimal bd = BigDecimal.valueOf(Double.parseDouble(o.get("VALUE").toString()));
- bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
+ bd = bd.setScale(1, RoundingMode.HALF_UP);
rebateInFc = bd.intValue();
}
//根据折扣金额计算积分
@@ -332,7 +374,6 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
rebateIntegrateSave = rebateIntegrateIFcZK;
retJo.put("PAYINTEGRAL", rebateIntegrateIFcZK);
}
-
String serivceOperatorRole = "SELECT saot.ID,saot.USERNAME,saot.ROLEID,saot.JOBNUMBER,saot.SERVICEAREAID FROM SERVICE_AREA_OPERATORS_TABLE saot" +
" WHERE saot.ID=" + operatorId + "";
List serviceOperatorList = this.mapperI.selectforlist(serivceOperatorRole);
@@ -342,39 +383,21 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
}
String integralListId = "";//积分流水的ID
String enabledIntegral = "";//本次消费之后,剩余的餐饮积分
- // if (serviceforlist != null && serviceforlist.size() > 0) {
- double restEnabled = Double.parseDouble(ENABLEINTEGRATION);
- double lastEnabled = Double.parseDouble(ENABLEINTEGRATION);
- double cpEnabled = Double.parseDouble(CPENABLEINTEGRATION);
- // for (int k = 0; k < serviceforlist.size(); k++) {
- // Map oTemp = (Map) serviceforlist.get(k);
- //String serverOperationId = oTemp.get("JOBNUMBER").toString();
- /*String serverOperationId = operatorId;
- String mealIds = oTemp.get("MEALIDS").toString();//按照服务区分组的套餐ID
- String mealPrices = oTemp.get("MEALPRICES").toString();//按照服务区分组的套餐ID
-
- String[] splitMeal = mealIds.split(",");
- String[] splitMealPrice = mealPrices.split(",");
- double totalConsumeMoney = 0.0;
- for (int H = 0; H < splitMeal.length; H++) {
- System.out.println("splitMeal[H]===="+splitMeal[H]);
- String sMealCount = mapMealId.get(splitMeal[H]);
- double sMealPrice = Double.parseDouble(splitMealPrice[H]);
- totalConsumeMoney += Integer.parseInt(sMealCount) * sMealPrice;
- }*/
- //double consumeInteger = totalConsumeMoney * rebateInFc;
- double consumeInteger = rebateIntegrateIFcZK;
- //1、积分流水记录新加
- String sqlMax = "select COALESCE(max(ID),0) AS ID from integration_list_table";
- List selectforlistMax = this.mapperI.selectforlist(sqlMax);
- int maxId = 1;
- if (selectforlistMax.size() > 0) {
- Map o = (Map) selectforlistMax.get(0);
- maxId = Integer.parseInt(o.get("ID").toString());
- }
- restEnabled = restEnabled - consumeInteger;
- cpEnabled = cpEnabled - consumeInteger;
- String cafterSql = "INSERT INTO integration_list_table ( ID, USERID, LASTINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTIME, PAYTYPE,OGENABLEINTEGRATION,CPENABLEINTEGRATION )\n" +
+ double restEnabled = Double.parseDouble(ENABLEINTEGRATION);
+ double lastEnabled = Double.parseDouble(ENABLEINTEGRATION);
+ double cpEnabled = Double.parseDouble(CPENABLEINTEGRATION);
+ double consumeInteger = rebateIntegrateIFcZK;
+ //1、积分流水记录新加
+ String sqlMax = "select COALESCE(max(ID),0) AS ID from integration_list_table";
+ List selectforlistMax = this.mapperI.selectforlist(sqlMax);
+ int maxId = 1;
+ if (selectforlistMax.size() > 0) {
+ Map o = (Map) selectforlistMax.get(0);
+ maxId = Integer.parseInt(o.get("ID").toString());
+ }
+ restEnabled = restEnabled - consumeInteger;
+ cpEnabled = cpEnabled - consumeInteger;
+ /* String cafterSql = "INSERT INTO integration_list_table ( ID, USERID, LASTINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTYPE,PAYTIME ,OGENABLEINTEGRATION,CPENABLEINTEGRATION )\n" +
"VALUES\n" +
"\t(\n" +
"\t\t" + (maxId + 10) + ",\n" +
@@ -382,91 +405,134 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
"\t\t" + PubTools.doubleSave1(lastEnabled * 100) + ",\n" +
"\t\t" + PubTools.doubleSave1(consumeInteger * 100) + ",\n" +
"\t\t" + PubTools.doubleSave1((restEnabled * 100)) + ",\n" +
- "\t\tto_date('" + rollbackTime + "','yyyy-MM-dd HH24:mi:ss'),\n" +
- "\t'FCA', \n";
- if ("4".equals(DBType)) {
- cafterSql = "INSERT INTO integration_list_table ( ID, USERID, LASTINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTIME, PAYTYPE,OGENABLEINTEGRATION,CPENABLEINTEGRATION )\n" +
- "VALUES\n" +
- "\t(\n" +
- "\t\t" + (maxId + 10) + ",\n" +
- "\t\t" + userIdNew + ",\n" +
- "\t\t" + PubTools.doubleSave1(lastEnabled * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1(consumeInteger * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1((restEnabled * 100)) + ",\n" +
- "\t\tstr_to_date('" + rollbackTime + "','%Y-%m-%d %H:%i:%s'),\n" +
- "\t'FCA', \n";
- }
+ "\t'FCA', \n";
+ if ("2".equals(DBType)) {
+ cafterSql += "\t\tto_date('" + rollbackTime + "','yyyy-MM-dd HH24:mi:ss'),\n";
+ } else if ("4".equals(DBType)) {
+ cafterSql += "\t\tstr_to_date('" + rollbackTime + "','%Y-%m-%d %H:%i:%s'),\n";
+ }
+ cafterSql += "\t" + PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION)) * 100)) + ", \n" +
+ "\t" + PubTools.doubleSave1(cpEnabled * 100) + " ";
+ cafterSql += "\t)";
+ this.mapperI.insert(cafterSql);*/
- cafterSql += "\t" + PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION)) * 100)) + ", \n" +
- "\t" + PubTools.doubleSave1(cpEnabled * 100) + " ";
- cafterSql += "\t)";
- this.mapperI.insert(cafterSql);
- lastEnabled = lastEnabled - consumeInteger;
- if (PubTools.isNull(integralListId)) {
- integralListId = (maxId + 10) + "";
- } else {
- integralListId += "," + (maxId + 10);
- }
- LogUtil.WriteLog_Info("积分核减=====积分流水已插入", "ApponintmentInfoServiceImpl");
- //2、新加一条消费记录
- String sqlIntegralList = "insert into CAFTER_TABLE(ID,\n" +
- "ACARNO,\n" +
- "USERID,\n" +
- "CAFTERTIME,\n" +
- "USERJOBNUMBER,\n" +
- "TRIMINTEGRAL," +
- "INTEGRATIONLISTID,\n" +
- "ORDERID) values (\n" +
- " (select COALESCE(max(t.ID),0)+1 from CAFTER_TABLE t),''," +
- "" + userIdNew + ",to_date('" + rollbackTime + "','yyyy-MM-dd HH24:mi:ss'),'" + jobNumber + "','SUCCESS'," + (maxId + 10) + ",'" + operatorId + "'" +
- ")";
- if ("4".equals(DBType)) {
- sqlIntegralList = "insert into CAFTER_TABLE(ID,\n" +
- "ACARNO,\n" +
- "USERID,\n" +
- "CAFTERTIME,\n" +
- "USERJOBNUMBER,\n" +
- "TRIMINTEGRAL," +
- "INTEGRATIONLISTID,\n" +
- "ORDERID) values (\n" +
- " (select COALESCE(max(t.ID),0)+1 from CAFTER_TABLE t),''," +
- "" + userIdNew + ",str_to_date('" + rollbackTime + "','%Y-%m-%d %H:%i:%s'),'" + jobNumber + "','SUCCESS'," + (maxId + 10) + ",'" + jobNumber + "'" +
- ")";
- }
- this.mapperI.insert(sqlIntegralList);
- LogUtil.WriteLog_Info("积分核减=====消费记录已插入", "ApponintmentInfoServiceImpl");
- // }
+
+ Map integralList = new HashMap<>();
+ integralList.put("maxid",(maxId + 10));
+ integralList.put("userId",userIdNew);
+ integralList.put("acarNo","");
+ integralList.put("lastintegration",PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION) * 100));
+ integralList.put("payintegration",PubTools.doubleSave1(rebateIntegrateSave * 100));
+ integralList.put("restintegration",PubTools.doubleSave1(((Double.parseDouble(ENABLEINTEGRATION) - rebateIntegrateSave) * 100)));
+ integralList.put("payTime",rollbackTime);
+ integralList.put("paytype","FCA");
+ integralList.put("DBTYPE",DBType);
+ integralList.put("cpenableintegration",PubTools.doubleSave1(cpEnabled * 100));
+ integralList.put("ogenableintegration", PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION)) * 100)));
+ this.integrationListMapper.addIntegralList(integralList);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ integralList.put("DBTYPEBAK",bakDBType);
+ this.integrationListMyMapper.addIntegralList(integralList);
+
+ }
+ LogUtil.WriteLog_Info("餐饮预约=====积分流水已插入", "ApponintmentInfoServiceImpl");
+ //2、新加一条消费记录
String currentDate1 = PubTools.getCurrentDateNoStr().replace("-","").trim()+PubTools.getlinkNo();
- String sqlTemp2 = "insert into APPOINTMENT_INFO_TABLE(ID,USERID,ACARNO,APPOINTMENTTYPE,APPOINTMENTTIME,APPOINTMENTLINEID,CREATETIME,SERVICEAREAID,MEALS,MEALSCOUNT,COMPLETESTATUS,INTEGRATIONLISTID,SERVICEOPERATIONID,TOTALINTEGRAL,ORDERID) " +
- " values((SELECT COALESCE(MAX(ID),0)+1 FROM APPOINTMENT_INFO_TABLE ),(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='" + openId + "'),'" + aCarNo + "'," + Integer.parseInt(appointmentType) + ",to_date('" + dateTime + "','YYYY-MM-DD HH24:MI:SS')," + (PubTools.isNull(appointmentId) ? -1 : appointmentId) + ",to_date('" + currentDate + "','YYYY-MM-DD HH24:MI:SS')," + (PubTools.isNull(serviceId) ? -1 : serviceId) + ",'" + mealId + "','" + mealIdCount + "','N','" + integralListId + "',"+operatorId+",'"+mealTotalMoney+"','"+currentDate1+"') ";
- if ("4".equals(DBType)) {
- sqlTemp2 = "insert into APPOINTMENT_INFO_TABLE(ID,USERID,ACARNO,APPOINTMENTTYPE,APPOINTMENTTIME,APPOINTMENTLINEID,CREATETIME,SERVICEAREAID,MEALS,MEALSCOUNT,COMPLETESTATUS,INTEGRATIONLISTID,SERVICEOPERATIONID,TOTALINTEGRAL,ORDERID) " +
- " values((SELECT COALESCE(MAX(t.ID),0)+1 FROM APPOINTMENT_INFO_TABLE t),(SELECT ID FROM WEIXN_USER_TABLE tt WHERE tt.OPENID='" + openId + "'),'" + aCarNo + "'," + Integer.parseInt(appointmentType) + ",str_to_date('" + dateTime + "','%Y-%m-%d %H:%i:%s')," + (PubTools.isNull(appointmentId) ? -1 : appointmentId) + ",str_to_date('" + currentDate + "','%Y-%m-%d %H:%i:%s')," + (PubTools.isNull(serviceId) ? -1 : serviceId) + ",'" + mealId + "','" + mealIdCount + "','N','" + integralListId + "',"+operatorId+",'"+mealTotalMoney+"','"+currentDate1+"') ";
+ String maxIdCafeSql="select COALESCE(max(t.ID),0)+1 as ID from CAFTER_TABLE t";
+ List maxIdCafeSqlMax = this.mapperI.selectforlist(maxIdCafeSql);
+ int maxIdCafe = 1;
+ if (!maxIdCafeSqlMax.isEmpty()) {
+ Map o = (Map) maxIdCafeSqlMax.get(0);
+ maxIdCafe = Integer.parseInt(o.get("ID").toString());
+ }
+ Map cafetparam = new HashMap<>();
+ cafetparam.put("maxId",maxIdCafe);
+ cafetparam.put("acarNo","");
+ cafetparam.put("userId",userIdNew);
+ cafetparam.put("cafterTime",rollbackTime);
+ cafetparam.put("userJobnumber",jobNumber);
+ cafetparam.put("trimintegral","SUCCESS");
+ cafetparam.put("integrationListId",(maxId + 10));
+ cafetparam.put("orderId",currentDate1);
+ cafetparam.put("content",operatorId);
+ cafetparam.put("DBTYPE",DBType);
+ this.cafterTableMapper.addcafter(cafetparam);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ cafetparam.put("DBTYPEBAK",bakDBType);
+ this.cafterTableMyMapper.addcafter(cafetparam);
+ }
+ if (PubTools.isNull(integralListId)) {
+ integralListId = (maxId + 10) + "";
+ } else {
+ integralListId += "," + (maxId + 10);
}
- this.mapperI.insert(sqlTemp2);
+ String maxIdAppSql="SELECT COALESCE(MAX(ID),0)+1 AS ID FROM APPOINTMENT_INFO_TABLE ";
+ List maxIdApps = this.mapperI.selectforlist(maxIdAppSql);
+ //判断兑换积分是否够本次折扣
+ int maxIdApp = 1;
+ if (!maxIdApps.isEmpty()) {
+ Map o = (Map) maxIdApps.get(0);
+ maxIdApp = Integer.parseInt(o.get("ID").toString());
+ }
+ Map appointparam = new HashMap<>();
+ appointparam.put("maxId",maxIdApp);
+ appointparam.put("acarno",aCarNo);
+ appointparam.put("userId","(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='" + openId + "')");
+ appointparam.put("appointmenttype",Integer.parseInt(appointmentType));
+ appointparam.put("appointtime",dateTime);
+ appointparam.put("appointmentlineid",(PubTools.isNull(appointmentId) ? -1 : appointmentId));
+ appointparam.put("createtime",currentDate);
+ appointparam.put("serviceareaId",(PubTools.isNull(serviceId) ? -1 : serviceId));
+ appointparam.put("meals",mealId);
+ appointparam.put("mealscount",mealIdCount);
+ appointparam.put("completeStatus","N");
+ appointparam.put("integrationListId",integralListId);
+ appointparam.put("serviceOperationId",operatorId+"");
+ appointparam.put("totalIntegral",mealTotalMoney);
+ appointparam.put("orderId",currentDate1);
+ appointparam.put("DBTYPE",DBType);
+ this.appointmentInfoMapper.addAppointmentInfo(appointparam);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ appointparam.put("DBTYPEBAK",bakDBType);
+ this.appointmentInfoMyMapper.addAppointmentInfo(appointparam);
+ }
+ LogUtil.WriteLog_Info("餐饮预约=====消费记录已插入", "ApponintmentInfoServiceImpl");
//3、计算用户可用积分
String sql = "select " +
" ut.ID ,ut.OPENID ,COALESCE(ut.ENABLEINTEGRATION,0) AS ENABLEINTEGRATION,COALESCE(ut.CPENABLEINTEGRATION,0) AS CPENABLEINTEGRATION,COALESCE(ut.OGENABLEINTEGRATION,0) AS OGENABLEINTEGRATION" +
" from WEIXN_USER_TABLE ut " +
" where 1=1 AND ut.OPENID='" + openId + "'";
List selectforlist1 = this.mapperI.selectforlist(sql);
- if (selectforlist1.size() > 0) {
+ if (!selectforlist1.isEmpty()) {
Object objT = selectforlist1.get(0);
Map obj1T = (Map) objT;
- Double enabledT = Double.parseDouble(obj1T.get("ENABLEINTEGRATION").toString());
+ double enabledT = Double.parseDouble(obj1T.get("ENABLEINTEGRATION").toString());
BigDecimal bd = BigDecimal.valueOf(enabledT - rebateIntegrateSave * 100);
- bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
+ bd = bd.setScale(1, RoundingMode.HALF_UP);
double enabledTI = bd.doubleValue();
- Double enabledTCp = Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
+ double enabledTCp = Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
BigDecimal bdcp = BigDecimal.valueOf(enabledTCp - rebateIntegrateSave * 100);
- bdcp = bdcp.setScale(1, BigDecimal.ROUND_HALF_UP);
+ bdcp = bdcp.setScale(1, RoundingMode.HALF_UP);
double enabledTICp = bdcp.doubleValue();
- String sqlUpdate = "update WEIXN_USER_TABLE SET ENABLEINTEGRATION=" + enabledTI + " ,CPENABLEINTEGRATION=" + enabledTICp + " " +
- " where 1=1 AND OPENID='" + openId + "'";
- this.mapperI.update(sqlUpdate);
enabledIntegral = PubTools.doubleSave1(enabledTICp / 100) + "";
retJo.put("ENABLEINTEGRATION", enabledIntegral);
retJo.put("ORDERID", currentDate1);
+ Map userParams=new HashMap();
+ userParams.put("userId",openId);
+ userParams.put("enabledTI",enabledTI);
+ userParams.put("enabledTICp",enabledTICp);
+ userParams.put("DBTYPE",DBType);
+ this.userTableMapper.updateUserById(userParams);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ userParams.put("DBTYPEBAK",bakDBType);
+ this.userTableMyMapper.updateUserById(userParams);
+ }
+
+
LogUtil.WriteLog_Info("用户更新可用积分完成", "ApponintmentInfoServiceImpl");
}
@@ -478,30 +544,49 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
//}
}else{
String currentDate1 = PubTools.getCurrentDate().replace("-","").trim()+PubTools.getlinkNo();
- String sqlTemp2="insert into APPOINTMENT_INFO_TABLE(ID,USERID,ACARNO,APPOINTMENTTYPE,APPOINTMENTTIME,APPOINTMENTLINEID,CREATETIME,SERVICEAREAID,MEALS,MEALSCOUNT,COMPLETESTATUS,ORDERID) " +
+ /* String sqlTemp2="insert into APPOINTMENT_INFO_TABLE(ID,USERID,ACARNO,APPOINTMENTTYPE,APPOINTMENTTIME,APPOINTMENTLINEID,CREATETIME,SERVICEAREAID,MEALS,MEALSCOUNT,COMPLETESTATUS,ORDERID) " +
" values((SELECT COALESCE(MAX(ID),0)+1 FROM APPOINTMENT_INFO_TABLE ),(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='"+openId+"'),'"+aCarNo+"',"+Integer.parseInt(appointmentType)+",to_date('"+dateTime+"','YYYY-MM-DD HH24:MI:SS'),"+(PubTools.isNull(appointmentId)?-1:appointmentId)+",to_date('"+currentDate+"','YYYY-MM-DD HH24:MI:SS'),"+(PubTools.isNull(serviceId)?-1:serviceId)+",'"+mealId+"','"+mealIdCount+"','N','"+currentDate1+"') ";
if("4".equals(DBType)){
sqlTemp2="insert into APPOINTMENT_INFO_TABLE(ID,USERID,ACARNO,APPOINTMENTTYPE,APPOINTMENTTIME,APPOINTMENTLINEID,CREATETIME,SERVICEAREAID,MEALS,MEALSCOUNT,COMPLETESTATUS,ORDERID) " +
" values((SELECT COALESCE(MAX(t.ID),0)+1 FROM APPOINTMENT_INFO_TABLE t),(SELECT ID FROM WEIXN_USER_TABLE tt WHERE tt.OPENID='"+openId+"'),'"+aCarNo+"',"+Integer.parseInt(appointmentType)+",str_to_date('"+dateTime+"','%Y-%m-%d %H:%i:%s'),"+(PubTools.isNull(appointmentId)?-1:appointmentId)+",str_to_date('"+currentDate+"','%Y-%m-%d %H:%i:%s'),"+(PubTools.isNull(serviceId)?-1:serviceId)+",'"+mealId+"','"+mealIdCount+"','N','"+currentDate1+"') ";
}
- this.mapperI.insert(sqlTemp2);
+ this.mapperI.insert(sqlTemp2);*/
+ String maxIdAppSql="SELECT COALESCE(MAX(ID),0)+1 AS ID FROM APPOINTMENT_INFO_TABLE ";
+ List maxIdApps = this.mapperI.selectforlist(maxIdAppSql);
+ //判断兑换积分是否够本次折扣
+ int maxIdApp = 1;
+ if (!maxIdApps.isEmpty()) {
+ Map o = (Map) maxIdApps.get(0);
+ maxIdApp = Integer.parseInt(o.get("ID").toString());
+ }
+ Map appointparam = new HashMap<>();
+ appointparam.put("maxId",maxIdApp);
+ appointparam.put("acarno",aCarNo);
+ appointparam.put("userId","(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='" + openId + "')");
+ appointparam.put("appointmenttype",Integer.parseInt(appointmentType));
+ appointparam.put("appointtime",dateTime);
+ appointparam.put("appointmentlineid",(PubTools.isNull(appointmentId) ? -1 : appointmentId));
+ appointparam.put("createtime",currentDate);
+ appointparam.put("serviceareaId",(PubTools.isNull(serviceId) ? -1 : serviceId));
+ appointparam.put("meals",mealId);
+ appointparam.put("mealscount",mealIdCount);
+ appointparam.put("completeStatus","M");
+ appointparam.put("integrationListId","");
+ appointparam.put("serviceOperationId",operatorId);
+ appointparam.put("totalIntegral",mealTotalMoney);
+ appointparam.put("orderId",currentDate1);
+ appointparam.put("DBTYPE",DBType);
+ this.appointmentInfoMapper.addAppointmentInfo(appointparam);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ appointparam.put("DBTYPEBAK",bakDBType);
+ this.appointmentInfoMyMapper.addAppointmentInfo(appointparam);
+ }
+
retJo.put("ORDERID", currentDate1);
}
ret="1";
-
retJo.put("ret",ret);
- }catch (Exception e){
- e.printStackTrace();
- LogUtil.WriteLog_Error("预约记录提交失败===>"+e.getMessage(),"ApponintmentInfoServiceImpl");
- ret="-1";
- retJo.put("ret",ret);
- //Consistant.map.remove(content);
- retJo.put("code",-1);
- retJo.put("msg","提交预约记录接口出错");
- retJo.put("data","");
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
- return retJo;
- }
return retJo;
}
@@ -589,9 +674,7 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
// ja.add(jo);
}
}
- //map.put("MEALINFO",ja);
}
- //listRet.add(ja);
}else{
listRet=ret;
}
@@ -662,25 +745,4 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
return content;
}
- /**
- * 修改已经过期的数据状态为 O
- */
-
- public void updateCompleteStastus() {
- String selStr = "select t.id FROM APPOINTMENT_INFO_TABLE t WHERE t.COMPLETESTATUS='N'";
- String sql = "update APPOINTMENT_INFO_TABLE set COMPLETESTATUS='O' WHERE COMPLETESTATUS='N'";
- if ("2".equals(DBType)) {
- selStr += " and t.APPOINTMENTTIME 0 && !PubTools.isEmpty(selectforlist.get(0))) {
- this.mapperI.update(sql);
- }
- }
-
}
diff --git a/src/main/java/com/nmgs/service/impl/CommonServiceImpl.java b/src/main/java/com/nmgs/service/impl/CommonServiceImpl.java
index e1f6cd0..b16c965 100644
--- a/src/main/java/com/nmgs/service/impl/CommonServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/CommonServiceImpl.java
@@ -1,7 +1,7 @@
package com.nmgs.service.impl;
import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PubTools;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/src/main/java/com/nmgs/service/impl/ExcelDateImpl.java b/src/main/java/com/nmgs/service/impl/ExcelDateImpl.java
index c320843..d6c2367 100644
--- a/src/main/java/com/nmgs/service/impl/ExcelDateImpl.java
+++ b/src/main/java/com/nmgs/service/impl/ExcelDateImpl.java
@@ -1,16 +1,7 @@
package com.nmgs.service.impl;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
-import com.nmgs.util.LogUtil;
-import com.nmgs.util.PubTools;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.math.BigDecimal;
-import java.util.*;
-
@Service
public class ExcelDateImpl {
diff --git a/src/main/java/com/nmgs/service/impl/IntegralAppServiceImpl.java b/src/main/java/com/nmgs/service/impl/IntegralAppServiceImpl.java
index 635a0f2..0a93536 100644
--- a/src/main/java/com/nmgs/service/impl/IntegralAppServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/IntegralAppServiceImpl.java
@@ -1,6 +1,6 @@
package com.nmgs.service.impl;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.util.LogUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
diff --git a/src/main/java/com/nmgs/service/impl/IntegralLevelMessageServiceImpl.java b/src/main/java/com/nmgs/service/impl/IntegralLevelMessageServiceImpl.java
index e59bbec..ea16c36 100644
--- a/src/main/java/com/nmgs/service/impl/IntegralLevelMessageServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/IntegralLevelMessageServiceImpl.java
@@ -1,7 +1,8 @@
package com.nmgs.service.impl;
-import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
+import com.nmgs.mapperset.mysqlmapper.IntegralLeavingMyMapper;
+import com.nmgs.mapperset.oraclemapper.IntegralLeavingMapper;
import com.nmgs.service.IntegralLevelMessageService;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
@@ -9,13 +10,28 @@ import com.nmgs.util.PubTools;
import com.nmgs.util.SensitiveFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
@Service
public class IntegralLevelMessageServiceImpl implements IntegralLevelMessageService {
@Autowired
public Mapper mapperI;
+
+ public IntegralLeavingMapper integralLeavingMapper;
+ @Autowired
+ public void setIntegralLeavingMapper(IntegralLeavingMapper integralLeavingMapper) {
+ this.integralLeavingMapper = integralLeavingMapper;
+ }
+ public IntegralLeavingMyMapper integralLeavingMyMapper;
+ @Autowired
+ public void setIntegralLeavingMapper(IntegralLeavingMyMapper integralLeavingMapper) {
+ this.integralLeavingMyMapper = integralLeavingMapper;
+ }
+
private static String DBType=PropertiesUtil.getValue("DBType");
@Autowired
SensitiveFilter sensitiveFilter;
@@ -66,23 +82,27 @@ public class IntegralLevelMessageServiceImpl implements IntegralLevelMessageServ
}
@Override
+ @Transactional(value = "jtatransactionManager",timeout = 10)
public int commit(String userId, String positon, String message) {
int ret=1;
- try{
String currentDate=PubTools.getCurrentDate();
-
message = sensitiveFilter.replaceSensitiveWord(message);
-
- String sql="insert into INTEGRAL_LEAVEMESSAGE_TABLE(ID,USERID,POSITION,MESSAGE,CREATETIME,REPLYSTATUS) " +
- " values((SELECT NVL(MAX(ID),0)+1 FROM INTEGRAL_LEAVEMESSAGE_TABLE ),(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='"+userId+"'),'"+positon+"','"+message+"',to_date('"+currentDate+"','YYYY-MM-DD HH24:MI:SS'),'N') ";
- if("4".equals(DBType)) {
- sql="insert into INTEGRAL_LEAVEMESSAGE_TABLE(ID,USERID,POSITION,MESSAGE,CREATETIME,REPLYSTATUS) " +
- " values((SELECT COALESCE(MAX(tt.ID),0)+1 FROM INTEGRAL_LEAVEMESSAGE_TABLE tt ),(SELECT t.ID FROM WEIXN_USER_TABLE t WHERE t.OPENID='"+userId+"'),'"+positon+"','"+message+"',str_to_date('"+currentDate+"','%Y-%m-%d %H:%i:%s'),'N') ";
- }
- this.mapperI.insert(sql);
- }catch (Exception e){
- LogUtil.WriteLog_Error("插入反馈记录失败===>"+e.getMessage(),"IntegralLevelMessageServiceImpl");
- return ret=-1;
+ String sqlTemp="SELECT COALESCE(MAX(ID),0)+1 as MAXID FROM INTEGRAL_LEAVEMESSAGE_TABLE ";
+ Map select = this.mapperI.select(sqlTemp);
+ int maxId = Integer.parseInt(select.get("MAXID").toString());
+ Map params=new HashMap<>();
+ params.put("DBTYPE",DBType);
+ params.put("maxId",maxId);
+ params.put("openId",userId);
+ params.put("positon",positon);
+ params.put("message",message);
+ params.put("currentDate",currentDate);
+ params.put("replyStatus","N");
+ ret=integralLeavingMapper.addIntegralLeaving(params);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ params.put("DBTYPEBAK",bakDBType);
+ ret=integralLeavingMyMapper.addIntegralLeaving(params);
}
return ret;
}
diff --git a/src/main/java/com/nmgs/service/impl/IntegralSeriveImpl.java b/src/main/java/com/nmgs/service/impl/IntegralSeriveImpl.java
index f077041..0043469 100644
--- a/src/main/java/com/nmgs/service/impl/IntegralSeriveImpl.java
+++ b/src/main/java/com/nmgs/service/impl/IntegralSeriveImpl.java
@@ -1,7 +1,7 @@
package com.nmgs.service.impl;
import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.service.UserTableService;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
diff --git a/src/main/java/com/nmgs/service/impl/IntegralSignServiceImpl.java b/src/main/java/com/nmgs/service/impl/IntegralSignServiceImpl.java
index 889ff41..c8829bf 100644
--- a/src/main/java/com/nmgs/service/impl/IntegralSignServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/IntegralSignServiceImpl.java
@@ -2,8 +2,13 @@ package com.nmgs.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
-import com.nmgs.service.IntegralLevelMessageService;
+import com.nmgs.mappercommon.Mapper;
+import com.nmgs.mapperset.mysqlmapper.IntegralSignMyMapper;
+import com.nmgs.mapperset.mysqlmapper.IntegrationListMyMapper;
+import com.nmgs.mapperset.mysqlmapper.UserTableMysqlMapper;
+import com.nmgs.mapperset.oraclemapper.IntegralSignMapper;
+import com.nmgs.mapperset.oraclemapper.IntegrationListMapper;
+import com.nmgs.mapperset.oraclemapper.UserTableMapper;
import com.nmgs.service.IntegralSignService;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
@@ -14,6 +19,7 @@ import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -21,6 +27,41 @@ import java.util.Map;
public class IntegralSignServiceImpl implements IntegralSignService {
@Autowired
public Mapper mapperI;
+
+ public IntegralSignMapper integralSignMapper;
+ @Autowired
+ public void setIntegralSignMapper(IntegralSignMapper integralSignMapper) {
+ this.integralSignMapper = integralSignMapper;
+ }
+ public IntegralSignMyMapper integralSignMyMapper;
+ @Autowired
+ public void setIntegralSignMyMapper(IntegralSignMyMapper integralSignMapper) {
+ this.integralSignMyMapper = integralSignMapper;
+ }
+/*
+ public IntegrationListMapper integrationListMapper;
+ @Autowired
+ public void setIntegrationListMapper(IntegrationListMapper integrationListMapper) {
+ this.integrationListMapper = integrationListMapper;
+ }
+
+ public IntegrationListMyMapper integrationListMyMapper;
+ @Autowired
+ public void setIntegrationListMyMapper(IntegrationListMyMapper integrationListMyMapper) {
+ this.integrationListMyMapper = integrationListMyMapper;
+ }
+
+ public UserTableMapper userTableMapper;
+ @Autowired
+ public void setUserTableMapper(UserTableMapper userTableMapper) {
+ this.userTableMapper = userTableMapper;
+ }
+ public UserTableMysqlMapper userTableMysqlMapper;
+ @Autowired
+ public void setUserTableMysqlMapper(UserTableMysqlMapper userTableMysqlMapper) {
+ this.userTableMysqlMapper = userTableMysqlMapper;
+ }*/
+
private static String DBType= PropertiesUtil.getValue("DBType");
private String sql="SELECT ist.USERID,\n" +
"ist.MONTH,\n" +
@@ -97,36 +138,46 @@ public class IntegralSignServiceImpl implements IntegralSignService {
}
@Override
- @Transactional(isolation = Isolation.READ_COMMITTED )
+ @Transactional(value = "jtatransactionManager",timeout = 50)
public int commit(String userId, String signDate) {
int ret=-1;
String currentDate = PubTools.getCurrentDate().substring(0,10);
//判断是否是当前日
if(!signDate.equals(currentDate)){
- return ret =2;
+ return 2;
}
- try{
//先查询人员本月是否有签到记录
- String yM=signDate.substring(0,7);
+ String yM=signDate.substring(0,7);
String date=signDate.substring(8);
String sqlExists=sql+" AND ist.USERID=(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='"+userId+"') AND ist.MONTH ='"+yM+"' ";
List list= this.mapperI.selectforlist(sqlExists);
if(list.size()>0){//说明已经有签到记录
- String sqlTemp="UPDATE INTEGRAL_SIGN_TABLE SET DAY"+date+" ='Y'" +
- " where USERID=(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='"+userId+"') AND MONTH ='"+yM+"'";
- this.mapperI.insert(sqlTemp);
+ Map paramsUpdate=new HashMap<>();
+ paramsUpdate.put("dayvalue",date);
+ paramsUpdate.put("openId",userId);
+ paramsUpdate.put("month",yM);
+ ret=integralSignMapper.updateIntegralSign(paramsUpdate);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ paramsUpdate.put("DBTYPEBAK",bakDBType);
+ ret=integralSignMyMapper.updateIntegralSign(paramsUpdate);
+ }
}else{
- String sqlTemp="insert into INTEGRAL_SIGN_TABLE(USERID,MONTH) " +
- " values((SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='"+userId+"'),'"+yM+"') ";
- this.mapperI.insert(sqlTemp);
- String sqlTempUpdate="UPDATE INTEGRAL_SIGN_TABLE SET DAY"+date+" ='Y'" +
- " where USERID=(SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='"+userId+"') AND MONTH ='"+yM+"'";
- this.mapperI.insert(sqlTempUpdate);
+ Map paramsUpdate=new HashMap<>();
+ paramsUpdate.put("dayvalue",date);
+ paramsUpdate.put("openId",userId);
+ paramsUpdate.put("month",yM);
+ ret=integralSignMapper.addIntegralSign(paramsUpdate);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ paramsUpdate.put("DBTYPEBAK",bakDBType);
+ ret=integralSignMyMapper.addIntegralSign(paramsUpdate);
+ }
}
//查询签到一次加多少积分
- String signIntegral="SELECT COALESCE(VALUE,0) AS PAYINTEGRAL FROM PAY_INTEGRATION_NUMBER_TABLE WHERE TYPE='AS'";
+ /* String signIntegral="SELECT COALESCE(VALUE,0) AS PAYINTEGRAL FROM PAY_INTEGRATION_NUMBER_TABLE WHERE TYPE='AS'";
Map select = this.mapperI.select(signIntegral);
double payIntegral=Double.parseDouble(select.get("PAYINTEGRAL").toString()) ;
if(payIntegral>0.0){
@@ -167,21 +218,25 @@ public class IntegralSignServiceImpl implements IntegralSignService {
OGENABLEINTEGRATION= PubTools.doubleSave1(OGENABLEINTEGRATION+payIntegral*0.6);
CPENABLEINTEGRATION= PubTools.doubleSave1(CPENABLEINTEGRATION+payIntegral*0.4);
- String cafterSql="INSERT INTO integration_list_table ( ID, USERID, LASTINTEGRATION,TOTALADDINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTIME, PAYTYPE,CPENABLEINTEGRATION,OGENABLEINTEGRATION )\n" +
- "VALUES\n" +
- "\t(\n" +
- "\t\t"+(maxId+1)+",\n" +
- "\t\t"+userMainId+"," +
- "\t\t"+PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION))+",\n" +
- "\t\t"+PubTools.doubleSave1(totalAddIntegral+payIntegral)+",\n" +
- "\t\t"+PubTools.doubleSave1(payIntegral)+",\n" +
- "\t\t"+PubTools.doubleSave1((Double.parseDouble(ENABLEINTEGRATION)+payIntegral))+",\n" +
- "\t\tto_date('"+PubTools.getCurrentDate()+"','yyyy-MM-dd HH24:mi:ss'),\n" +
- "\t'"+payType+"',\n" +
- "\t'"+PubTools.doubleSave1(CPENABLEINTEGRATION)+"', \n" +
- "\t'"+PubTools.doubleSave1(OGENABLEINTEGRATION)+"' \n" +
- "\t)";
- this.mapperI.insert(cafterSql);
+ Map integralListParams=new HashMap<>();
+ integralListParams.put("DBTYPE",DBType);
+ integralListParams.put("maxid",(maxId+1));
+ integralListParams.put("userId",userId);
+ integralListParams.put("lastintegration",PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION)));
+ integralListParams.put("totalintegration",PubTools.doubleSave1(totalAddIntegral+payIntegral));
+ integralListParams.put("payintegration",PubTools.doubleSave1(payIntegral));
+ integralListParams.put("restintegration",PubTools.doubleSave1((Double.parseDouble(ENABLEINTEGRATION)+payIntegral)));
+ integralListParams.put("payTime",PubTools.getCurrentDate());
+ integralListParams.put("payType",payType);
+ integralListParams.put("cpenableintegration",PubTools.doubleSave1(CPENABLEINTEGRATION));
+ integralListParams.put("ogenableintegration",PubTools.doubleSave1(OGENABLEINTEGRATION));
+ this.integrationListMapper.addIntegralList(integralListParams);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ integralListParams.put("DBTYPEBAK",bakDBType);
+ ret=integrationListMyMapper.addIntegralList(integralListParams);
+ }
+
LogUtil.WriteLog_Info("人员签到积分流水记录已插入","IntegralSignServiceImpl");
//3、计算用户可用积分
String sql="select " +
@@ -206,19 +261,20 @@ public class IntegralSignServiceImpl implements IntegralSignService {
BigDecimal bdco = BigDecimal.valueOf(enabledTOG+payIntegral*0.6);
bdco = bdco.setScale(1, BigDecimal.ROUND_HALF_UP);
double enabledTIOG =bdco.doubleValue();
- String sqlUpdate="update WEIXN_USER_TABLE SET ENABLEINTEGRATION="+enabledTI+",CPENABLEINTEGRATION="+enabledTICp+",OGENABLEINTEGRATION="+enabledTIOG+" " +
- " where 1=1 AND ID="+userMainId+"";
- this.mapperI.update(sqlUpdate);
+ Map userTableParams=new HashMap<>();
+ userTableParams.put("enabledTI",enabledTI);
+ userTableParams.put("enabledTICp",enabledTICp);
+ userTableParams.put("enabledTIOG",enabledTIOG);
+ userTableParams.put("userId",userMainId);
+ this.userTableMapper.updateUserById(userTableParams);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ integralListParams.put("DBTYPEBAK",bakDBType);
+ ret=this.userTableMysqlMapper.updateUserById(userTableParams);
+ }
LogUtil.WriteLog_Info("用户更新可用积分完成","QCodeInfoServiceImpl");
}
- }
-
- ret=1;
- }catch (Exception e){
- LogUtil.WriteLog_Error("插入反馈记录失败===>"+e.getMessage(),"IntegralLevelMessageServiceImpl");
- ret=-1;
-
- }
+ }*/
return ret;
}
}
diff --git a/src/main/java/com/nmgs/service/impl/IntegralStarSetupServiceImpl.java b/src/main/java/com/nmgs/service/impl/IntegralStarSetupServiceImpl.java
index c1b9210..6a17a8a 100644
--- a/src/main/java/com/nmgs/service/impl/IntegralStarSetupServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/IntegralStarSetupServiceImpl.java
@@ -1,16 +1,12 @@
package com.nmgs.service.impl;
-import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PubTools;
-import oracle.sql.CLOB;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
@Service
public class IntegralStarSetupServiceImpl {
diff --git a/src/main/java/com/nmgs/service/impl/IntegrationListServiceImpl.java b/src/main/java/com/nmgs/service/impl/IntegrationListServiceImpl.java
index 2252b59..3020b34 100644
--- a/src/main/java/com/nmgs/service/impl/IntegrationListServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/IntegrationListServiceImpl.java
@@ -1,6 +1,6 @@
package com.nmgs.service.impl;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.service.IntegrationListService;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
diff --git a/src/main/java/com/nmgs/service/impl/MessagePushServiceImpl.java b/src/main/java/com/nmgs/service/impl/MessagePushServiceImpl.java
index 8b2a3a5..42d8f38 100644
--- a/src/main/java/com/nmgs/service/impl/MessagePushServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/MessagePushServiceImpl.java
@@ -3,7 +3,7 @@ package com.nmgs.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.nmgs.entity.HttpParamDto;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.util.HttpClientUtil;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PubTools;
diff --git a/src/main/java/com/nmgs/service/impl/OperatorsServiceImpl.java b/src/main/java/com/nmgs/service/impl/OperatorsServiceImpl.java
index 7c68cbc..11b1dcd 100644
--- a/src/main/java/com/nmgs/service/impl/OperatorsServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/OperatorsServiceImpl.java
@@ -3,14 +3,11 @@ package com.nmgs.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.entity.ServiceAreaOperators;
-import com.nmgs.mapper.OperatorsMapper;
+import com.nmgs.mapperset.mysqlmapper.OperatorsMyMapper;
+import com.nmgs.mapperset.oraclemapper.OperatorsMapper;
import com.nmgs.service.IOperatorsService;
-import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
-import com.nmgs.util.PubTools;
import com.trkf.PasswordEncryption.PassWordUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -22,14 +19,15 @@ import java.util.Map;
@Service
-@Transactional
+@Transactional(value = "jtatransactionManager", timeout = 100)
public class OperatorsServiceImpl implements IOperatorsService {
@Autowired
private OperatorsMapper operatorsMapper;
+ @Autowired
+ private OperatorsMyMapper operatorsMyMapper;
- public static Logger logger = LoggerFactory.getLogger(OperatorsServiceImpl.class);
/**
@@ -51,7 +49,7 @@ public class OperatorsServiceImpl implements IOperatorsService {
page = operatorsMapper.getOperatorsList(page,params);
//给密码解密
List records = page.getRecords();
- if(null != records && records.size() > 0){
+ if (null != records && !records.isEmpty()) {
for (ServiceAreaOperators record : records) {
record.setPassWord(PassWordUtils.decrypt(record.getPassWord()));
}
@@ -78,7 +76,7 @@ public class OperatorsServiceImpl implements IOperatorsService {
if(null == operators.getId()){
//先判断工号是否已经存在,存在不让保存数据
List operationByJobNumber = operatorsMapper.getOperationByJobNumber(operators.getJobNumber());
- if(null != operationByJobNumber && operationByJobNumber.size() > 0){
+ if (null != operationByJobNumber && !operationByJobNumber.isEmpty()) {
return -2;
}
//查询当前数据中id的最大值,给id赋值
@@ -109,7 +107,7 @@ public class OperatorsServiceImpl implements IOperatorsService {
}
//先判断工号是否已经存在,存在不让保存数据
List operationByJobNumber = operatorsMapper.getOperationByJobNumber(operators.getJobNumber());
- if(null != operationByJobNumber && operationByJobNumber.size() > 0){
+ if (null != operationByJobNumber && !operationByJobNumber.isEmpty()) {
if(operationByJobNumber.get(0).getId() != operators.getId()){
return -2;
}
@@ -144,7 +142,7 @@ public class OperatorsServiceImpl implements IOperatorsService {
public int deleteOperators(List operators)throws Exception {
//如果没有数据或数据为空,直接返回0
- if(null == operators || operators.size() == 0){
+ if (null == operators || operators.isEmpty()) {
return 0;
}
@@ -199,7 +197,7 @@ public class OperatorsServiceImpl implements IOperatorsService {
//先根据工号查询用户信息
List operationByJobNumber = operatorsMapper.getOperationByJobNumber((String) params.get("jobNumber"));
//如果根据工号找到,再匹配密码是否正确
- if(null != operationByJobNumber && operationByJobNumber.size() > 0){
+ if (null != operationByJobNumber && !operationByJobNumber.isEmpty()) {
ServiceAreaOperators serviceAreaOper=operationByJobNumber.get(0);
//String decryptPassWord = PassWordUtils.decrypt(operationByJobNumber.get(0).getPassWord());
String enPassWord = PassWordUtils.encrypt((String)params.get("password"));
@@ -209,9 +207,9 @@ public class OperatorsServiceImpl implements IOperatorsService {
lambdaQueryWrapper.eq(null != serviceAreaOper.getId(),
ServiceAreaOperators::getId,
serviceAreaOper.getId());
-
- return operatorsMapper.update(serviceAreaOper,lambdaQueryWrapper);
-
+ operatorsMapper.update(serviceAreaOper, lambdaQueryWrapper);
+ operatorsMyMapper.update(serviceAreaOper, lambdaQueryWrapper);
+ return 1;
}else{
return -1;
diff --git a/src/main/java/com/nmgs/service/impl/PayIntegrationNumberServiceImpl.java b/src/main/java/com/nmgs/service/impl/PayIntegrationNumberServiceImpl.java
deleted file mode 100644
index 63bf13d..0000000
--- a/src/main/java/com/nmgs/service/impl/PayIntegrationNumberServiceImpl.java
+++ /dev/null
@@ -1,219 +0,0 @@
-package com.nmgs.service.impl;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.nmgs.entity.*;
-import com.nmgs.mapper.*;
-import com.nmgs.service.IPayIntegrationNumberService;
-import com.nmgs.util.PropertiesUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
-import java.util.*;
-
-
-@Service
-@Transactional
-@Slf4j
-public class PayIntegrationNumberServiceImpl implements IPayIntegrationNumberService {
-
-
- @Autowired
- private PayIntegrationNumberMapper payIntegrationNumberMapper;
-
- @Autowired
- private IntegrationListMapper integrationListMapper;
-
-
-
- @Override
- public List getPayIntegrationNumberList() {
-
- List payList = payIntegrationNumberMapper.getPayIntegrationNumberList();
- return payList;
- }
-
-
- @Override
- public int savePayIntegrationNumber(List payIntegrationNumbers) {
-
- int res = 0;
- //如果数据为空,直接返回
- if(null == payIntegrationNumbers || payIntegrationNumbers.isEmpty()){
- return 0;
- }
- for (PayIntegrationNumber payIntegrationNumber : payIntegrationNumbers) {
- payIntegrationNumber.setValue(payIntegrationNumber.getValue().multiply(new BigDecimal(100)));
- //判断传回的值中,id是否有值,没有就是新增
- if(null == payIntegrationNumber.getId()){
- //查询当前数据中id的最大值,给id赋值
- Integer maxId = payIntegrationNumberMapper.getMaxId();
- //如果为空则赋值成1
- if(null == maxId){
- maxId = 1;
- }else{
- maxId = maxId+1;
- }
- //给密码加密
- payIntegrationNumber.setId(maxId);
- res = payIntegrationNumberMapper.insert(payIntegrationNumber);
- }else{
- //设置修改条件,根据id修改
- LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>();
- lambdaQueryWrapper.eq(null != payIntegrationNumber.getId(),
- PayIntegrationNumber::getId,
- payIntegrationNumber.getId());
-
- res = payIntegrationNumberMapper.update(payIntegrationNumber,lambdaQueryWrapper);
- }
- }
- return res;
- }
-
-
-
- @Override
- public JSONArray getIntegrationGrowTotal(Map params) {
- JSONArray jsonArray = new JSONArray();
-
- //从配置文件中读取数据库连接类型
- params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
-
- //判断是日统计还是月统计
- Boolean greenTotalCollectionType = (Boolean) params.get("greenTotalCollectionType");
-
- SimpleDateFormat format =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- List> collectionDate = new ArrayList<>();
- Date currentDate = null;
- Date endDate= null;
- try {
- currentDate= format.parse((String) params.get("classDateBeginQuery"));;//DateUtility.parse(startTime)
- endDate= format.parse((String) params.get("classDateEndQuery")); //endTime.parse(endTime)
-/* List dateSplits = new ArrayList<>();
-
- dateSplits = DateSplitUtils.splitDate(currentDate, endDate, DateSplitUtils.IntervalType.DAY,1);
-
- for (DateSplitUtils.DateSplit dateSplit : dateSplits) {
- Map date = new HashMap<>();
- date.put("startTime", dateSplit.getStartDateTimeStr());
- date.put("endTime", dateSplit.getEndDateTimeStr());
- collectionDate.add(date);
- }*/
- //设置数据总条数
- for (int i = 0; i < collectionDate.size(); i++) {
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
- LocalDate date = LocalDate.parse(collectionDate.get(i).get("startTime").substring(0,10), formatter);
- int dayOfMonth = date.getDayOfMonth();
- JSONObject dateTime = new JSONObject();
- dateTime.put("dateName", dayOfMonth + "号");
- dateTime.put("dateCount", 0);
- jsonArray.add(dateTime);
- }
- for (int i = 0; i < collectionDate.size(); i++) {
- Map param = new HashMap<>();
- //从配置文件中读取数据库连接类型
- param.put("DBTYPE", PropertiesUtil.getValue("DBType"));
- //构建参数
- param.put("startTime", collectionDate.get(i).get("startTime"));
- param.put("endTime", collectionDate.get(i).get("endTime"));
- //调用接口,取值
- List> userTotal = integrationListMapper.getIntegrationGrowTotal(param);
- if (null != userTotal && !userTotal.isEmpty() && null != userTotal.get(0)) {
- //给对应位置的时间段赋值
- JSONObject jSONObject = (JSONObject) jsonArray.get(i);
- jSONObject.put("dateCount", userTotal.get(0).get("TOTALCOUNT"));
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- log.info("查询数据失败" + e);
- }
- return jsonArray;
- }
-
-
-
- @Override
- public List> getCarIntegrationGrowTotal(Map params) {
- List> res = new ArrayList<>();
-
- //从配置文件中读取数据库连接类型
- params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
- //判断是日统计还是月统计
- SimpleDateFormat format =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- try {
- format.parse((String) params.get("classDateBeginQuery"));;//DateUtility.parse(startTime)
- format.parse((String) params.get("classDateEndQuery")); //endTime.parse(endTime)
- res = integrationListMapper.getCarIntegrationGrowTotal(params);
- return res;
- } catch (Exception e) {
- log.info("查询数据失败" + e);
- return res;
- }
- }
-
- @Override
- public Map getMonthFeeTotal(Map params) {
- Map res = new HashMap<>();
-
- //从配置文件中读取数据库连接类型
- params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
- //判断是日统计还是月统计
- SimpleDateFormat format =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- try {
- format.parse((String) params.get("classDateBeginQuery"));;//DateUtility.parse(startTime)
- format.parse((String) params.get("classDateEndQuery")); //endTime.parse(endTime)
- res = integrationListMapper.getMonthFeeTotal(params);
- return res;
- } catch (Exception e) {
- log.info("查询数据失败" + e);
- return res;
- }
- }
-
- @Override
- public List> getFeeTypeTotal(Map params) {
- List> res = new ArrayList<>();
-
- //从配置文件中读取数据库连接类型
- params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
- //判断是日统计还是月统计
- SimpleDateFormat format =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- try {
- format.parse((String) params.get("classDateBeginQuery"));;//DateUtility.parse(startTime)
- format.parse((String) params.get("classDateEndQuery")); //endTime.parse(endTime)
- res = integrationListMapper.getFeeTypeTotal(params);
- return res;
- } catch (Exception e) {
- log.info("查询数据失败" + e);
- return res;
- }
- }
-
-
- @Override
- public List> getMileScoreType(Map params) {
- List> res = new ArrayList<>();
-
- //从配置文件中读取数据库连接类型
- params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
- //判断是日统计还是月统计
- SimpleDateFormat format =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- try {
- format.parse((String) params.get("classDateBeginQuery"));;//DateUtility.parse(startTime)
- format.parse((String) params.get("classDateEndQuery")); //endTime.parse(endTime)
- //res = vehicleScoreMapper.getMileScoreType(params);
- return res;
- } catch (Exception e) {
- log.info("查询数据失败" + e);
- return res;
- }
- }
-}
diff --git a/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java b/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java
index e2faf01..70a4565 100644
--- a/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java
@@ -2,21 +2,28 @@ package com.nmgs.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.nmgs.entity.Consistant;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
+import com.nmgs.mapperset.mysqlmapper.AppointmentInfoMyMapper;
+import com.nmgs.mapperset.mysqlmapper.CafterTableMyMapper;
+import com.nmgs.mapperset.mysqlmapper.IntegrationListMyMapper;
+import com.nmgs.mapperset.mysqlmapper.UserTableMysqlMapper;
+import com.nmgs.mapperset.oraclemapper.AppointmentInfoMapper;
+import com.nmgs.mapperset.oraclemapper.CafterTableMapper;
+import com.nmgs.mapperset.oraclemapper.IntegrationListMapper;
+import com.nmgs.mapperset.oraclemapper.UserTableMapper;
import com.nmgs.service.UserTableService;
import com.nmgs.util.*;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.math.BigDecimal;
import java.math.BigInteger;
+import java.math.RoundingMode;
import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
+import java.util.*;
@Service
@Transactional
@@ -43,7 +50,53 @@ public class QCodeInfoServiceImpl {
public void setMessagePushServiceImpl(MessagePushServiceImpl messagePushServiceImpl) {
this.messagePushServiceImpl = messagePushServiceImpl;
}
+ public IntegrationListMapper integrationListMapper;
+ @Autowired
+ public void setIntegrationListMapper(IntegrationListMapper integrationListMapper) {
+ this.integrationListMapper = integrationListMapper;
+ }
+ public IntegrationListMyMapper integrationListMyMapper;
+ @Autowired
+ public void setIntegrationListMyMapper(IntegrationListMyMapper integrationListMyMapper) {
+ this.integrationListMyMapper = integrationListMyMapper;
+ }
+ public UserTableMapper userTableMapper;
+ @Autowired
+ public void setUserTableMapper(UserTableMapper userTableMapper) {
+ this.userTableMapper = userTableMapper;
+ }
+ public UserTableMysqlMapper userTableMyMapper;
+ @Autowired
+ public void setUserTableMyMapper(UserTableMysqlMapper userTableMapper) {
+ this.userTableMyMapper = userTableMapper;
+ }
+ public UserTableMysqlMapper userTableMysqlMapper;
+ @Autowired
+ public void setUserTableMysqlMapper(UserTableMysqlMapper userTableMysqlMapper) {
+ this.userTableMysqlMapper = userTableMysqlMapper;
+ }
+ public CafterTableMapper cafterTableMapper;
+ @Autowired
+ public void setCafterTableMapper(CafterTableMapper cafterTableMapper) {
+ this.cafterTableMapper = cafterTableMapper;
+ }
+ public CafterTableMyMapper cafterTableMyMapper;
+ @Autowired
+ public void setCafterTableMyMapper(CafterTableMyMapper cafterTableMyMapper) {
+ this.cafterTableMyMapper = cafterTableMyMapper;
+ }
+ public AppointmentInfoMyMapper appointmentInfoMyMapper;
+ @Autowired
+ public void setAppointmentInfoMyMapper(AppointmentInfoMyMapper appointmentInfoMyMapper) {
+ this.appointmentInfoMyMapper = appointmentInfoMyMapper;
+ }
+
+ public AppointmentInfoMapper appointmentInfoMapper;
+ @Autowired
+ public void setAppointmentInfoMapper(AppointmentInfoMapper appointmentInfoMapper) {
+ this.appointmentInfoMapper = appointmentInfoMapper;
+ }
/**
*利用redis做缓存
* @param openId 用户微信iD
@@ -145,102 +198,6 @@ public class QCodeInfoServiceImpl {
return content;
}
- /**
- *
- * @param openId 用户微信iD
- * @param integrateType 积分类型
- * @param rebateIntegrate 兑换积分
- * @return
- */
- public String getQcodeInfoByUserId(String openId, String integrateType, String rebateIntegrate){
- JSONObject jo=new JSONObject();
- jo.put("openId",openId);
- jo.put("integrateType",integrateType);
- jo.put("rebateIntegrate",rebateIntegrate);
- jo.put("createTime",PubTools.getCurrentDate());//二维码生成时间,20s之后过期
-
- //判断用户是否被冻结
-
- List userStarByOepnIdTemp = this.userTableService.getUserByOpenId(openId);
-
- if(userStarByOepnIdTemp.size()<1){
- return "-2";
- }else {
- Object obj = userStarByOepnIdTemp.get(0);
- Map obj1 = (Map) obj;
-
- String certification = obj1.get("CERTIFICATION").toString();//认证状态
- if ("5".equals(certification)) {
- return "-3";
- }
- }
-
- //生成一个二维码流水号
- //xxxx xxxx(8位时间戳16进制) |xxxx(4位流水序号16进制)|xxxx(4位兑换积分16进制)|xxxx(4位校验码,16进制)"}
- String content="";
- String dateTimes=df.format(new Date());
- String serialsT="";
- String rebateIntegrateT=rebateIntegrate;
- Random random = new Random();
- int res = 1000+random.nextInt(9000);
- int serials = Consistant.serials+1;
- Consistant.serials=serials;
- if(serials<10){
- serialsT="000"+serials;
- }else if(serials >=10 && serials<100){
- serialsT="00"+serials;
- Consistant.serials=serials;
- }else if(serials >=10 && serials<100){
- serialsT="00"+serials;
- }else if(serials >=100 && serials<1000){
- serialsT="0"+serials;
- }else if(serials >=1000 && serials<10000){
- serialsT=""+serials;
- }else{
- serialsT="1000";
- Consistant.serials=999;
- }
- Long seconds = (new Date()).getTime()/1000;
- String dataStr=Long.toHexString(seconds);
- String serialsTStr=Integer.toHexString(Integer.parseInt(serialsT));
- if(serialsTStr.length()<4){
- int diff= 4 - serialsTStr.length() ;
- if(diff==3){
- serialsTStr="000"+serialsTStr;
- }else if(diff==2){
- serialsTStr="00"+serialsTStr;
- }else if(diff==1){
- serialsTStr="0"+serialsTStr;
- }
- }
- String rebateIntegrateTStr=Integer.toHexString(Integer.parseInt(rebateIntegrateT));
- if(rebateIntegrateTStr.length()<4){
- int diff= 4 - rebateIntegrateTStr.length() ;
- if(diff==3){
- rebateIntegrateTStr="000"+rebateIntegrateTStr;
- }else if(diff==2){
- rebateIntegrateTStr="00"+rebateIntegrateTStr;
- }else if(diff==1){
- rebateIntegrateTStr="0"+rebateIntegrateTStr;
- }
- }
- String resStr=Integer.toHexString(res);
- if(resStr.length()<4){
- int diff= 4 - resStr.length() ;
- if(diff==3){
- resStr="000"+resStr;
- }else if(diff==2){
- resStr="00"+resStr;
- }else if(diff==1){
- resStr="0"+resStr;
- }
- }
- content= dataStr+"|" +serialsTStr+"|"+ rebateIntegrateTStr +"|"+resStr;
- // content= dateTimes+"|" +serialsT +"|"+rebateIntegrateT+"|"+res;
- LogUtil.WriteLog_Info("用户:"+openId+"---->核销积分"+integrateType+"生成的流水号======"+content,"QCodeInfoServiceImpl");
- Consistant.map.put(content,jo);
- return content;
- }
/**
* @param content 二维码内容
@@ -259,543 +216,19 @@ public class QCodeInfoServiceImpl {
return "1";
}
- /**
- *
- * @param content 二维码流水号
- * @param serverOperationId 商超用户ID
- * @param payMoney 实际支付金额
- * @return
- */
- @Transactional(rollbackFor = {Exception.class,RuntimeException.class})
- public JSONObject solveQcode(String content, String serverOperationId,String orderId, Double payMoney,Double discountMoneyBefore,Double discountMoney) throws Exception {
- String ret="-2";// -1 代表接口处理失败 1 处理成功 2 用户不存在 3 兑换积分大于用户可用积分 4 二维码信息过期 5 商户不存在 6 积分类型与消费方式不匹配 7 商户角色未设置 8 用户已冻结 9 折扣金额与消费积分不一致 10 请重新生成二维码 11 订单中商户与核销中的商户不匹配 12 订单已核销
- JSONObject retJo=new JSONObject();
- String openId="";
- try{
- LogUtil.WriteLog_Info("积分核减操作开始====="+PubTools.getCurrentDate()+"=======params==={content:"+content+",serverOperationId:"+serverOperationId+",discountMoney:"+discountMoney+"}","QCodeInfoServiceImpl");
- //查询金额与积分的兑换比例,一元兑换积分
- String sqlTemp="select t.VALUE/100 AS VALUE ,t.EVERYMONEY/100 AS EVERYMONEY from PAY_INTEGRATION_NUMBER_TABLE t where t.TYPE='@TYPE@'";
- String rollbackTime=PubTools.getCurrentDate();
- Object content1 = Consistant.map.get(content);
- if(content1 != null){
- JSONObject joMap=(JSONObject)content1;
- openId= PubTools.isEmpty(joMap.get("openId"))?"":joMap.get("openId").toString();
- String integrateTypeParam= PubTools.isEmpty(joMap.get("integrateType"))?"":joMap.get("integrateType").toString();
- String rebateIntegrate= PubTools.isEmpty(joMap.get("rebateIntegrate"))?"":joMap.get("rebateIntegrate").toString();
- String createTime= PubTools.isEmpty(joMap.get("createTime"))?"":joMap.get("createTime").toString();
- Long s = PubTools.dateDiff(createTime, rollbackTime, "S");
- LogUtil.WriteLog_Info("二维码生成时间长度====="+s,"QCodeInfoServiceImpl");
- retJo.put("openId",openId);
-
- String integrateType="";
- String consumeIntegral="";
- String enabledIntegral="";
- int userIdNew=0;
- //校验用户状态
- List userByOpenId = userTableService.getUserByOpenId(openId);
- Object obj = userByOpenId.get(0);
- Map obj1 = (Map) obj;
- String certification = obj1.get("CERTIFICATION").toString();//认证状态
- if(userByOpenId.size()<1){
- Object contentNew = Consistant.map.get(content);
- if(!PubTools.isEmpty(contentNew)){
- Consistant.map.remove(content);
- }
- ret="2";
- retJo.put("ret",ret);
- return retJo;
- }
- if ("5".equals(certification)) {
- ret = "8";
- retJo.put("ret", ret);
- Object contentNew = Consistant.map.get(content);
- if(!PubTools.isEmpty(contentNew)){
- Consistant.map.remove(content);
- }
- return retJo;
- }
-
- //先查询商户角色
- String serviceRole = "";
- String inputMoney = "";//是否需要商户端输入金额
- String serivceOperatorRole = "SELECT saot.ID,saot.USERNAME,saot.ROLEID,saot.SERVICEAREAID,saoc.INPUTMENEY FROM SERVICE_AREA_OPERATORS_TABLE saot,SERVICE_AREA_OPERATORS_COMPANY_TEXT saoc " +
- " WHERE saoc.ID = saot.COMPANYID AND saot.JOBNUMBER='" + serverOperationId + "'";
- List serviceOperatorList = this.mapperI.selectforlist(serivceOperatorRole);
- if (serviceOperatorList.size() < 1) {//商户不存在
- ret = "5";
- retJo.put("ret", ret);
- return retJo;
- }
- boolean isCheckDiscountMoney=false;
- if(userByOpenId.size()>0){
- //String startLevel= obj1.get("STARLEVEL").toString();//星级
- String ENABLEINTEGRATION = obj1.get("ENABLEINTEGRATION").toString();//用户可用公共积分
- String OILENABLEINTEGRATION = obj1.get("OILENABLEINTEGRATION").toString();//加油可用积分
- String GASENABLEINTEGRATION = obj1.get("GASENABLEINTEGRATION").toString();//加气可用积分
- String SPENABLEINTEGRATION = obj1.get("SPENABLEINTEGRATION").toString();//消费可用积分
- String CAFENABLEINTEGRATION = obj1.get("CAFENABLEINTEGRATION").toString();//餐饮可用积分
- String OGENABLEINTEGRATION = obj1.get("OGENABLEINTEGRATION").toString();//加油、加气可用积分
- String CPENABLEINTEGRATION = obj1.get("CPENABLEINTEGRATION").toString();//餐饮、消费可用积分
- userIdNew = Integer.parseInt(obj1.get("ID").toString());//人员id
- if (s > 30) {
- Consistant.map.remove(content);
- ret = "4";
- retJo.put("ret", ret);
- return retJo;
- }
- //核验商户角色与积分消费类型是否匹配
-
- if (serviceOperatorList.size() >0 ) {
- //校验用户与角色出示二维码积分消费类型是否匹配
- Map mapServiceOperator = (Map) serviceOperatorList.get(0);
- serviceRole = mapServiceOperator.get("ROLEID").toString();
- /* serviceAreaId = mapServiceOperator.get("SERVICEAREAID").toString();*/
- inputMoney = mapServiceOperator.get("INPUTMENEY").toString();
- }
- if("1".equals(inputMoney)){
- isCheckDiscountMoney=true;
- }
- //根据商户角色判断消费类型
- if (PubTools.isNull(serviceRole)) {
- LogUtil.WriteLog_Info("商户角色未设置", "QCodeInfoServiceImpl");
- ret = "7";
- retJo.put("ret", ret);
- return retJo;
- } else {
- if ("3".equals(serviceRole) || "1".equals(serviceRole)) {
- if (!"FPG".equals(integrateTypeParam)) {
- ret = "6";
- retJo.put("ret", ret);
- Consistant.map.remove(content);
- return retJo;
- }
- }
- if ("2".equals(serviceRole) || "4".equals(serviceRole)) {
- if (!"FCS".equals(integrateTypeParam) && !"FCA".equals(integrateTypeParam)) {
- ret = "6";
- retJo.put("ret", ret);
- Consistant.map.remove(content);
- return retJo;
- }
- }
- //如果是餐饮预约, 则直接改了状态即可
- /* if("FCA".equals(integrateTypeParam)){
- String updateAppointSql="UPDATE APPOINTMENT_INFO_TABLE SET COMPLETESTATUS='Y' WHERE ID="+rebateIntegrate;
- this.mapperI.update(updateAppointSql);
- LogUtil.WriteLog_Info("积分核减=====修改预约记录为已核销", "QCodeInfoServiceImpl");
- ret = "1";
- retJo.put("ret", ret);
- return retJo;
- }
-*/
-
-
- if ("1".equals(serviceRole)) {
- integrateType = "FP";
- } else if ("2".equals(serviceRole)) {
- integrateType = "FC";
- } else if ("3".equals(serviceRole)) {
- integrateType = "FG";
- } else if ("4".equals(serviceRole)) {
- integrateType = "FS";
- } else {
-
- }
- }
- //查询用户累积获取的总积分
- String totalAddIntegralSql = "SELECT COALESCE(MAX(ilt.TOTALADDINTEGRATION),0) AS TOTALADDINTEGRATION FROM INTEGRATION_LIST_TABLE ilt,WEIXN_USER_TABLE ut WHERE ilt.USERID = ut.ID AND ut.OPENID='" + openId + "'";
- double totalAddIntegral = 0.0;
- double rebateIntegrateSave = 0.0;
- switch (integrateType) {
- case "FP"://加油
- retJo.put("ENABLEINTEGRATIONBEFORE", PubTools.doubleSave1(Double.parseDouble(OGENABLEINTEGRATION)));
- String sqlFp = sqlTemp.replace("@TYPE@", integrateType);
- List selectforlist = this.mapperI.selectforlist(sqlFp);
- //判断兑换积分是否够本次折扣
- int rebateIn = 1;
- if (selectforlist.size() > 0) {
- Map o = (Map) selectforlist.get(0);
- BigDecimal bd = BigDecimal.valueOf(Double.parseDouble(o.get("VALUE").toString()));
- bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
- rebateIn=bd.intValue();
- }
- //根据折扣金额计算积分
- Double rebateIntegrateI = Double.parseDouble(rebateIntegrate);
- Double rebateIntegrateIZK=PubTools.doubleSave1(discountMoney*rebateIn);
- //double enabledIntegFc=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(CAFENABLEINTEGRATION);
- if(isCheckDiscountMoney){
- if((rebateIntegrateIZK - rebateIntegrateI) != 0){
- ret = "9";
- retJo.put("PAYINTEGRAL", rebateIntegrateI);
- retJo.put("discountMoney", rebateIntegrateIZK);
- retJo.put("ret", ret);
- return retJo;
- }
- }
- //double enabledInteg=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(OILENABLEINTEGRATION);
- double enabledInteg = Double.parseDouble(OGENABLEINTEGRATION);
- if (rebateIntegrateI > enabledInteg) {
- ret = "3";
- retJo.put("PAYINTEGRAL", rebateIntegrateI);
- retJo.put("ret", ret);
- return retJo;
- } else {
- rebateIntegrateSave=rebateIntegrateI;
- retJo.put("PAYINTEGRAL", rebateIntegrateI);
- }
- break;
- case "FG"://加气
- retJo.put("ENABLEINTEGRATIONBEFORE", PubTools.doubleSave1(Double.parseDouble(OGENABLEINTEGRATION)));
- String sqlFg = sqlTemp.replace("@TYPE@", integrateType);
- List selectforlistFg = this.mapperI.selectforlist(sqlFg);
- //判断兑换积分是否够本次折扣
- int rebateInFg = 1;
- if (selectforlistFg.size() > 0) {
- Map o = (Map) selectforlistFg.get(0);
- BigDecimal bd = BigDecimal.valueOf(Double.parseDouble(o.get("VALUE").toString()));
- bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
- rebateInFg=bd.intValue();
- }
- //根据折扣金额计算积分
- // int rebateIntegrateI=Integer.parseInt(rebateIntegrate);
- Double rebateIntegrateIFgZk=PubTools.doubleSave1(discountMoney*rebateInFg);
- Double rebateIntegrateIFg = Double.parseDouble(rebateIntegrate);
- // double enabledIntegFg=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(GASENABLEINTEGRATION);
-
- //折扣金额与输入的积分是否一致
- if(isCheckDiscountMoney) {
- if ((rebateIntegrateIFgZk - rebateIntegrateIFg) != 0) {
- ret = "9";
- retJo.put("PAYINTEGRAL", rebateIntegrateIFg);
- retJo.put("discountMoney", rebateIntegrateIFgZk);
- retJo.put("ret", ret);
- return retJo;
- }
- }
- double enabledIntegFg = Double.parseDouble(OGENABLEINTEGRATION);
- if (rebateIntegrateIFg > enabledIntegFg) {
- ret = "3";
- retJo.put("PAYINTEGRAL", rebateIntegrateIFg);
- retJo.put("ret", ret);
- return retJo;
- } else {
- rebateIntegrateSave=rebateIntegrateIFg;
- retJo.put("PAYINTEGRAL", rebateIntegrateIFg);
- }
- break;
- case "FC"://餐饮
- retJo.put("ENABLEINTEGRATIONBEFORE", PubTools.doubleSave1(Double.parseDouble(CPENABLEINTEGRATION)));
- String sqlFc = sqlTemp.replace("@TYPE@", integrateType);
- List selectforlistFc = this.mapperI.selectforlist(sqlFc);
- //判断兑换积分是否够本次折扣
- int rebateInFc = 1;
- if (selectforlistFc.size() > 0) {
- Map o = (Map) selectforlistFc.get(0);
- BigDecimal bd = BigDecimal.valueOf(Double.parseDouble(o.get("VALUE").toString()));
- bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
- rebateInFc=bd.intValue();
- }
- //根据折扣金额计算积分
- Double rebateIntegrateIFcZK=discountMoney*rebateInFc;
- Double rebateIntegrateIFc = Double.parseDouble(rebateIntegrate);
- //double enabledIntegFc=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(CAFENABLEINTEGRATION);
- if(isCheckDiscountMoney) {
- if ((rebateIntegrateIFcZK - rebateIntegrateIFc) != 0) {
- ret = "9";
- retJo.put("PAYINTEGRAL", rebateIntegrateIFc);
- retJo.put("discountMoney", rebateIntegrateIFcZK);
- retJo.put("ret", ret);
- return retJo;
- }
- }
- double enabledIntegFc = Double.parseDouble(CPENABLEINTEGRATION);
- if (rebateIntegrateIFc > enabledIntegFc) {
- ret = "3";
- retJo.put("PAYINTEGRAL", rebateIntegrateIFc);
- retJo.put("ret", ret);
- return retJo;
- } else {
- //进行积分核减
- rebateIntegrateSave=rebateIntegrateIFc;
- retJo.put("PAYINTEGRAL", rebateIntegrateIFc);
- }
- break;
- case "FS"://消费
- retJo.put("ENABLEINTEGRATIONBEFORE", PubTools.doubleSave1(Double.parseDouble(CPENABLEINTEGRATION)));
- String sqlFs = sqlTemp.replace("@TYPE@", integrateType);
- List selectforlistFs = this.mapperI.selectforlist(sqlFs);
- //判断兑换积分是否够本次折扣
- int rebateInFs = 1;
- if (selectforlistFs.size() > 0) {
- Map o = (Map) selectforlistFs.get(0);
- BigDecimal bd = BigDecimal.valueOf(Double.parseDouble(o.get("VALUE").toString()));
- bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
- rebateInFs=bd.intValue();
- }
- //根据折扣金额计算积分
-
- // int rebateIntegrateI=Integer.parseInt(rebateIntegrate);
- Double rebateIntegrateIFsZK=discountMoney*rebateInFs;
- Double rebateIntegrateIFs = Double.parseDouble(rebateIntegrate);
- //double enabledIntegFs=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(SPENABLEINTEGRATION);
-
-
- //double enabledIntegFc=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(CAFENABLEINTEGRATION);
- if(isCheckDiscountMoney) {
- if ((rebateIntegrateIFsZK - rebateIntegrateIFs) != 0) {
- ret = "9";
- retJo.put("PAYINTEGRAL", rebateIntegrateIFs);
- retJo.put("discountMoney", rebateIntegrateIFsZK);
- retJo.put("ret", ret);
- return retJo;
- }
- }
- double enabledIntegFs = Double.parseDouble(CPENABLEINTEGRATION);
- if (rebateIntegrateIFs > enabledIntegFs) {
- ret = "3";
- retJo.put("PAYINTEGRAL", rebateIntegrateIFs);
- retJo.put("ret", ret);
- return retJo;
- } else {
- //进行积分核减
- rebateIntegrateSave=rebateIntegrateIFs;
- retJo.put("PAYINTEGRAL", rebateIntegrateIFs);
- }
- break;
- default:
- break;
- }
-
-
- //进行积分核减
- /* List selectforlistTotalAdd = this.mapperI.selectforlist(totalAddIntegralSql);
- if (selectforlistTotalAdd.size() > 0) {
- Map o = (Map) selectforlistTotalAdd.get(0);
- totalAddIntegral = Double.parseDouble(o.get("TOTALADDINTEGRATION").toString());
- }*/
- //1、积分流水记录新加
- String sqlMax = "select COALESCE(max(ID),0) AS ID from integration_list_table";
- List selectforlistMax = this.mapperI.selectforlist(sqlMax);
- //判断兑换积分是否够本次折扣
- int maxId = 1;
- if (selectforlistMax.size() > 0) {
- Map o = (Map) selectforlistMax.get(0);
- maxId = Integer.parseInt(o.get("ID").toString());
- }
- String cafterSql = "INSERT INTO integration_list_table ( ID, USERID, LASTINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTIME, PAYTYPE,OGENABLEINTEGRATION,CPENABLEINTEGRATION )\n" +
- "VALUES\n" +
- "\t(\n" +
- "\t\t" + (maxId + 10) + ",\n" +
- "\t\t"+userIdNew+",\n" +
- "\t\t" + PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION) * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1(rebateIntegrateSave * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1(((Double.parseDouble(ENABLEINTEGRATION) - rebateIntegrateSave) * 100)) + ",\n" +
- "\t\tto_date('" + rollbackTime + "','yyyy-MM-dd HH24:mi:ss'),\n" +
- "\t'" + integrateType + "', \n" ;
- if("4".equals(DBType)){
- cafterSql = "INSERT INTO integration_list_table ( ID, USERID, LASTINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTIME, PAYTYPE,OGENABLEINTEGRATION,CPENABLEINTEGRATION )\n" +
- "VALUES\n" +
- "\t(\n" +
- "\t\t" + (maxId + 10) + ",\n" +
- "\t\t"+userIdNew+",\n" +
- "\t\t" + PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION) * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1(rebateIntegrateSave * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1(((Double.parseDouble(ENABLEINTEGRATION) - rebateIntegrateSave) * 100)) + ",\n" +
- "\t\tstr_to_date('" + rollbackTime + "','%Y-%m-%d %H:%i:%s'),\n" +
- "\t'" + integrateType + "', \n" ;
- }
-
-
- if("FP".equals(integrateType) || "FG".equals(integrateType)){
- cafterSql += "\t" + PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION) - rebateIntegrateSave) * 100)) + ", \n" +
- "\t" + PubTools.doubleSave1(Double.parseDouble(CPENABLEINTEGRATION) * 100) + " \n" ;
- }else if("FC".equals(integrateType) || "FS".equals(integrateType)) {
- cafterSql +="\t" + PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION)) * 100)) + ", \n" +
- "\t" + PubTools.doubleSave1((Double.parseDouble(CPENABLEINTEGRATION) - rebateIntegrateSave) * 100)+" " ;
- }else{
-
- }
- cafterSql+= "\t)";
- this.mapperI.insert(cafterSql);
- consumeIntegral=rebateIntegrateSave+"";
- LogUtil.WriteLog_Info("积分核减=====积分流水已插入", "QCodeInfoServiceImpl");
- //2、新加一条消费记录
- String sqlIntegralList = "insert into CAFTER_TABLE(ID,\n" +
- "ACARNO,\n" +
- "USERID,\n" +
- "CAFTERTIME,\n" +
- "USERJOBNUMBER,\n" +
- "TRIMINTEGRAL," +
- "INTEGRATIONLISTID,\n" +
- "ORDERID,CONTENT) values (\n" +
- " (select COALESCE(max(t.ID),0)+1 from CAFTER_TABLE t),''," +
- "" + userIdNew + ",to_date('" + rollbackTime + "','yyyy-MM-dd HH24:mi:ss'),'" + serverOperationId + "','SUCCESS'," + (maxId + 10) + ",'" + orderId + "','" + content + "'" +
- ")";
- if("4".equals(DBType)){
- sqlIntegralList = "insert into CAFTER_TABLE(ID,\n" +
- "ACARNO,\n" +
- "USERID,\n" +
- "CAFTERTIME,\n" +
- "USERJOBNUMBER,\n" +
- "TRIMINTEGRAL," +
- "INTEGRATIONLISTID,\n" +
- "ORDERID,CONTENT) values (\n" +
- " (select COALESCE(max(t.ID),0)+1 from CAFTER_TABLE t),''," +
- "" + userIdNew + ",str_to_date('" + rollbackTime + "','%Y-%m-%d %H:%i:%s'),'" + serverOperationId + "','SUCCESS'," + (maxId + 10) + ",'" + orderId + "','" + content + "'" +
- ")";
- }
- this.mapperI.insert(sqlIntegralList);
- //进行预约核销
- /*String appointMentSql="";
- if("FS".equals(integrateType)){
- appointMentSql="SELECT ID FROM APPOINTMENT_INFO_TABLE t where t.SERVICEAREAID='"+serviceAreaId+"' AND t.USERID='"+userIdNew+"' AND APPOINTMENTTIME=to_date('"+rollbackTime+"','YYYY-MM-DD') AND t.COMPLETESTATUS='N' AND t.APPOINTMENTTYPE=3 ORDER BY t.CREATETIME ";
- }else if("FC".equals(integrateType)){
- appointMentSql="SELECT ID FROM APPOINTMENT_INFO_TABLE t where t.SERVICEAREAID='"+serviceAreaId+"' AND t.USERID='"+userIdNew+"' AND APPOINTMENTTIME=to_date('"+rollbackTime+"','YYYY-MM-DD') AND t.COMPLETESTATUS='N' AND t.APPOINTMENTTYPE=2 ORDER BY t.CREATETIME ";
- }
- if(!PubTools.isNull(appointMentSql)){
- List appointList = this.mapperI.selectforlist(appointMentSql);
- if(appointList.size()>0){
- Map map=(Map)appointList.get(0);
- int appointId=Integer.parseInt(map.get("ID").toString());
- String updateAppointSql="UPDATE APPOINTMENT_INFO_TABLE SET COMPLETESTATUS='Y',INTEGRATIONLISTID="+(maxId + 10)+" WHERE ID="+appointId+"";
- this.mapperI.update(updateAppointSql);
- LogUtil.WriteLog_Info("积分核减=====修改预约记录为已核销", "QCodeInfoServiceImpl");
- }
- }*/
- LogUtil.WriteLog_Info("积分核减=====消费记录已插入", "QCodeInfoServiceImpl");
- //3、计算用户可用积分
- String sql = "select " +
- " ut.ID ,ut.OPENID ,COALESCE(ut.ENABLEINTEGRATION,0) AS ENABLEINTEGRATION,COALESCE(ut.CPENABLEINTEGRATION,0) AS CPENABLEINTEGRATION,COALESCE(ut.OGENABLEINTEGRATION,0) AS OGENABLEINTEGRATION" +
- " from WEIXN_USER_TABLE ut " +
- " where 1=1 AND ut.OPENID='" + openId + "'";
- List selectforlist1 = this.mapperI.selectforlist(sql);
- if (selectforlist1.size() > 0) {
- Object objT = selectforlist1.get(0);
- Map obj1T = (Map) objT;
- Double enabledT = Double.parseDouble(obj1T.get("ENABLEINTEGRATION").toString());
- BigDecimal bd = BigDecimal.valueOf(enabledT - rebateIntegrateSave * 100);
- bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
- double enabledTI = bd.doubleValue();
- Double enabledTCp = Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
- BigDecimal bdcp = BigDecimal.valueOf(enabledTCp - rebateIntegrateSave * 100);
- bdcp = bdcp.setScale(1, BigDecimal.ROUND_HALF_UP);
- double enabledTICp = bdcp.doubleValue();
-
- Double enabledTPG = Double.parseDouble(obj1T.get("OGENABLEINTEGRATION").toString());
- BigDecimal bdcpPG = BigDecimal.valueOf(enabledTPG - rebateIntegrateSave * 100);
- BigDecimal bdcpPg = bdcpPG.setScale(1, BigDecimal.ROUND_HALF_UP);
- double enabledTIPG = bdcpPg.doubleValue();
- if("FP".equals(integrateType) || "FG".equals(integrateType)){
- String sqlUpdate = "update WEIXN_USER_TABLE SET ENABLEINTEGRATION=" + enabledTI + " ,OGENABLEINTEGRATION=" + enabledTIPG + " " +
- " where 1=1 AND OPENID='" + openId + "'";
- this.mapperI.update(sqlUpdate);
- enabledIntegral=PubTools.doubleSave1(enabledTIPG / 100)+"";
- retJo.put("ENABLEINTEGRATION",enabledIntegral);
- }else if("FC".equals(integrateType) || "FS".equals(integrateType)) {
- String sqlUpdate = "update WEIXN_USER_TABLE SET ENABLEINTEGRATION=" + enabledTI + " ,CPENABLEINTEGRATION=" + enabledTICp + " " +
- " where 1=1 AND OPENID='" + openId + "'";
- this.mapperI.update(sqlUpdate);
- enabledIntegral=PubTools.doubleSave1(enabledTICp / 100)+"";
- retJo.put("ENABLEINTEGRATION", enabledIntegral);
- }else{
-
- }
- LogUtil.WriteLog_Info("用户更新可用积分完成", "QCodeInfoServiceImpl");
- }
-
- Consistant.map.remove(content);
-
- //发送消息
- String integralTypePu="";
- if("FP".equals(integrateType)){
- integralTypePu="加油";
- }else if("FG".equals(integrateType)){
- integralTypePu="加气";
- }else if("FC".equals(integrateType)){
- integralTypePu="餐饮";
- }else if("FS".equals(integrateType)){
- integralTypePu="商超";
- }
- this.messagePushServiceImpl.pushMsg(openId,integralTypePu,"-"+consumeIntegral,enabledIntegral);
- }
- ret="1";
- //积分核减成功
-
- }else{
- //需要判断是否是餐饮预约
- String appointMentSql="select t.ID,t.SERVICEOPERATIONID,tt.JOBNUMBER,t.COMPLETESTATUS from APPOINTMENT_INFO_TABLE t,SERVICE_AREA_OPERATORS_TABLE tt where t.SERVICEOPERATIONID = tt.ID AND t.ORDERID='"+content+"'";
- List appointMentList = this.mapperI.selectforlist(appointMentSql);
- if(appointMentList != null && appointMentList.size()>0) {
- Map appointment = (Map) appointMentList.get(0);
- String appomintJob=appointment.get("JOBNUMBER").toString();
- String completeStatus=appointment.get("COMPLETESTATUS").toString();
- if("Y".equals(completeStatus)){
- if(!appomintJob.equals(serverOperationId)){//数据已核销
- ret = "12";
- retJo.put("ret", ret);
- return retJo;
- }
- }
- if(!appomintJob.equals(serverOperationId)){//说明订单中商户与核销的商户不符
- ret = "11";
- retJo.put("ret", ret);
- return retJo;
- }
- //先查询商户角色
- String serivceOperatorRole = "SELECT saot.ID,saot.USERNAME,saot.ROLEID,saot.SERVICEAREAID,saoc.INPUTMENEY FROM SERVICE_AREA_OPERATORS_TABLE saot,SERVICE_AREA_OPERATORS_COMPANY_TEXT saoc " +
- " WHERE saoc.ID = saot.COMPANYID AND saot.JOBNUMBER='" + serverOperationId + "'";
- List serviceOperatorList = this.mapperI.selectforlist(serivceOperatorRole);
- if (serviceOperatorList.size() < 1) {//商户不存在
- ret = "5";
- retJo.put("ret", ret);
- return retJo;
- }
- //如果是餐饮预约, 则直接改了状态即可
- String updateAppointSql = "UPDATE APPOINTMENT_INFO_TABLE SET COMPLETESTATUS='Y' WHERE ORDERID='"+content+"'";
- this.mapperI.update(updateAppointSql);
- LogUtil.WriteLog_Info("积分核减=====修改预约记录为已核销", "QCodeInfoServiceImpl");
- ret = "1";
- retJo.put("ret", ret);
- return retJo;
- }else{
- ret="4";
- retJo.put("ret",ret);
- return retJo;
- }
-
- }
- }catch (Exception e){
- e.printStackTrace();
- LogUtil.WriteLog_Error("积分核减操作失败====="+e.getMessage(),"QCodeInfoServiceImpl");
- ret="-1";
- retJo.put("ret",ret);
- //Consistant.map.remove(content);
- retJo.put("code",-1);
- retJo.put("msg","积分核减接口出错");
- retJo.put("data","");
- WebsocketUtil.sendMessage(openId,JSONObject.toJSONString(retJo));
- // WebsocketUtil.removeSession(openId);
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
- return retJo;
- }
- retJo.put("ret",ret);
- return retJo;
- }
-
public int failBackMoney(String content, String serverOperationId,String orderId) throws Exception {
return rollBackIntegral(content,serverOperationId,orderId);
}
- @Transactional(rollbackFor = {Exception.class,RuntimeException.class})
+ @Transactional(value = "jtatransactionManager",timeout = 100)
public int rollBackIntegral(String content, String serverOperationId,String orderId) throws Exception {
int ret=1;// -1 代表接口处理失败 1 处理成功 2 商户不存在 3订单已经退回 4 用户信息未找到
- try{
LogUtil.WriteLog_Info("调用红冲接口开始=====","QCodeInfoServiceImpl");
String sqlTemp="select t.ID,COALESCE(to_char(t.INTEGRATIONLISTID),'') AS INTEGRATIONLISTID,COALESCE(to_char(t.INTEGRALROLLBACK),'') AS INTEGRALROLLBACK,t.USERID from CAFTER_TABLE t where t.ORDERID = '"+orderId+"' AND t.USERJOBNUMBER='"+serverOperationId+"'";
if("4".equals(DBType)){
sqlTemp="select t.ID,COALESCE(CONVERT(t.INTEGRATIONLISTID,CHAR),'') AS INTEGRATIONLISTID,COALESCE(CONVERT(t.INTEGRALROLLBACK,CHAR),'') AS INTEGRALROLLBACK,t.USERID from CAFTER_TABLE t where t.ORDERID = '"+orderId+"' AND t.USERJOBNUMBER='"+serverOperationId+"'";
}
List selectforlist = this.mapperI.selectforlist(sqlTemp);
- if(selectforlist.size()<1){
+ if(selectforlist.isEmpty()){
ret=2;
return ret;
}else{
@@ -807,7 +240,7 @@ public class QCodeInfoServiceImpl {
//判断用户是否被锁定
String sqlUserTemp="SELECT ut.CERTIFICATION FROM WEIXN_USER_TABLE ut WHERE ID="+userId+"";
List userByOpenIdTemp = this.mapperI.selectforlist(sqlUserTemp);
- if(userByOpenIdTemp.size()<1){
+ if(userByOpenIdTemp.isEmpty()){
ret=4;
return ret;
}else {
@@ -835,7 +268,7 @@ public class QCodeInfoServiceImpl {
List selectforlistInt = this.mapperI.selectforlist(integralSql);
String rollbackTime=PubTools.getCurrentDate();
- if(selectforlistInt.size()>0){
+ if(!selectforlistInt.isEmpty()){
Map oIntegral =(Map) selectforlistInt.get(0);
String userid=PubTools.isEmpty(oIntegral.get("USERID"))?"": oIntegral.get("USERID").toString();
String payType=PubTools.isEmpty(oIntegral.get("PAYTYPE"))?"": oIntegral.get("PAYTYPE").toString();
@@ -844,7 +277,7 @@ public class QCodeInfoServiceImpl {
String sqlMax="select COALESCE(max(t.ID),0) AS ID from integration_list_table t";
List selectforlistMax = this.mapperI.selectforlist(sqlMax);
int maxId=1;
- if(selectforlistMax.size()>0){
+ if(!selectforlistMax.isEmpty()){
Map os =(Map) selectforlistMax.get(0);
maxId=Integer.parseInt(os.get("ID").toString()) ;
}
@@ -858,51 +291,52 @@ public class QCodeInfoServiceImpl {
String ENABLEINTEGRATION="0";
double OGENABLEINTEGRATION=0.0;
double CPENABLEINTEGRATION=0.0;
- if(userByOpenId.size()>0){
+ if(!userByOpenId.isEmpty()){
Object obj = userByOpenId.get(0);
Map obj1 = (Map) obj;
ENABLEINTEGRATION = obj1.get("ENABLEINTEGRATION").toString();//用户可用公共积分
OGENABLEINTEGRATION =Double.parseDouble(obj1.get("OGENABLEINTEGRATION").toString()) ;//用户可用加油、加气积分
CPENABLEINTEGRATION = Double.parseDouble(obj1.get("CPENABLEINTEGRATION").toString());//用户可用消费积分
}
- /* String totalAddIntegralSql="SELECT COALESCE(MAX(ilt.TOTALADDINTEGRATION),0) AS TOTALADDINTEGRATION FROM INTEGRATION_LIST_TABLE ilt,WEIXN_USER_TABLE ut WHERE ilt.USERID = ut.ID AND ut.ID="+userid+"";
- List selectforlistTotalAdd = this.mapperI.selectforlist(totalAddIntegralSql);
- double totalAddIntegral=0.0;
- if(selectforlistTotalAdd.size()>0){
- Map ot =(Map) selectforlistTotalAdd.get(0);
- totalAddIntegral =Double.parseDouble(ot.get("TOTALADDINTEGRATION").toString()) ;
- }*/
if("FG".equals(payType) || "FP".equals(payType)){//加油加气
OGENABLEINTEGRATION= PubTools.doubleSave1(OGENABLEINTEGRATION+Double.parseDouble(payIntegral));
}else {//消费
CPENABLEINTEGRATION= PubTools.doubleSave1(CPENABLEINTEGRATION+Double.parseDouble(payIntegral));
}
- String cafterSql="INSERT INTO integration_list_table ( ID, USERID,ACARNO, LASTINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTIME, PAYTYPE,CPENABLEINTEGRATION,OGENABLEINTEGRATION )\n" +
- "VALUES\n" +
- "\t(\n" +
- "\t\t"+(maxId+1)+",\n" +
- "\t\t'"+userid+"'," +
- "\t\t'"+aCarNo+"'," +
- "\t\t"+PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION))+",\n" +
- "\t\t"+PubTools.doubleSave1(Double.parseDouble(payIntegral))+",\n" +
- "\t\t"+PubTools.doubleSave1((Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(payIntegral)))+",\n" ;
- if("2".equals(DBType)){
- cafterSql+= "\t\tto_date('"+rollbackTime+"','yyyy-MM-dd HH24:mi:ss'),\n" ;
- }else if("4".equals(DBType)){
- cafterSql+= "\t\tstr_to_date('"+rollbackTime+"','%Y-%m-%d %H:%i:%s'),\n" ;
- }
- cafterSql+= "\t'TK',\n" +
- "\t'"+PubTools.doubleSave1(CPENABLEINTEGRATION)+"', \n" +
- "\t'"+PubTools.doubleSave1(OGENABLEINTEGRATION)+"' \n" +
- "\t)";
- this.mapperI.insert(cafterSql);
+ Map integralList = new HashMap<>();
+ integralList.put("maxid",(maxId + 10));
+ integralList.put("userId",userid);
+ integralList.put("acarNo","");
+ integralList.put("lastintegration",PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION)));
+ integralList.put("payintegration",PubTools.doubleSave1(Double.parseDouble(payIntegral)));
+ integralList.put("restintegration",PubTools.doubleSave1((Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(payIntegral))));
+ integralList.put("payTime",rollbackTime);
+ integralList.put("paytype","TK");
+ integralList.put("DBTYPE",DBType);
+ integralList.put("cpenableintegration",PubTools.doubleSave1(CPENABLEINTEGRATION));
+ integralList.put("ogenableintegration", PubTools.doubleSave1(OGENABLEINTEGRATION));
+ this.integrationListMapper.addIntegralList(integralList);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ integralList.put("DBTYPEBAK",bakDBType);
+ this.integrationListMyMapper.addIntegralList(integralList);
+
+ }
LogUtil.WriteLog_Info("积分恢复=====流水记录已插入","QCodeInfoServiceImpl");
- String updateCafe="UPDATE CAFTER_TABLE set ROLLBACK='SUCCESS',INTEGRALROLLBACK='"+(maxId+1)+"',ROLLBACKTIME=to_date('"+rollbackTime+"','yyyy-MM-dd HH24:mi:ss') WHERE ORDERID = '"+orderId+"' AND USERJOBNUMBER='"+serverOperationId+"'";
- if("4".equals(DBType)){
- updateCafe="UPDATE CAFTER_TABLE set ROLLBACK='SUCCESS',INTEGRALROLLBACK='"+(maxId+1)+"',ROLLBACKTIME=str_to_date('"+rollbackTime+"','%Y-%m-%d %H:%i:%s') WHERE ORDERID = '"+orderId+"' AND USERJOBNUMBER='"+serverOperationId+"'";
+ Map updateCafe=new HashMap<>();
+ updateCafe.put("rollback","SUCCESS");
+ updateCafe.put("integralrollback",(maxId+1));
+ updateCafe.put("rollbackTime",rollbackTime);
+ updateCafe.put("orderId",orderId);
+ updateCafe.put("serverOperationId",serverOperationId);
+ updateCafe.put("DBTYPE",DBType);
+ this.cafterTableMapper.updatecafter(updateCafe);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ updateCafe.put("DBTYPEBAK",bakDBType);
+ this.cafterTableMyMapper.updatecafter(updateCafe);
}
- this.mapperI.update(updateCafe);
LogUtil.WriteLog_Info("积分恢复=====消费记录已更新完成","QCodeInfoServiceImpl");
//3、计算用户可用积分
String sql="select " +
@@ -911,18 +345,18 @@ public class QCodeInfoServiceImpl {
" where 1=1 AND ut.ID="+userid+"";
List selectforlist1 = this.mapperI.selectforlist(sql);
double enabledIntegral = 0.0;
- if(selectforlist1.size()>0){
+ if(!selectforlist1.isEmpty()){
Object objT = selectforlist1.get(0);
Map obj1T = (Map) objT;
openId=obj1T.get("OPENID").toString();
- Double enabledT=Double.parseDouble(obj1T.get("ENABLEINTEGRATION").toString());
+ double enabledT=Double.parseDouble(obj1T.get("ENABLEINTEGRATION").toString());
BigDecimal bd = BigDecimal.valueOf(enabledT + Double.parseDouble(payIntegral));
- bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
+ bd = bd.setScale(1, RoundingMode.HALF_UP);
double enabledTI = bd.doubleValue();
- Double enabledTCp=Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
+ double enabledTCp=Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
BigDecimal bdcp = BigDecimal.valueOf(enabledTCp + Double.parseDouble(payIntegral));
- bdcp = bdcp.setScale(1, BigDecimal.ROUND_HALF_UP);
+ bdcp = bdcp.setScale(1, RoundingMode.HALF_UP);
double enabledTICp =0.0;
if("FC".equals(payType) || "FS".equals(payType)){
enabledTICp = bdcp.doubleValue();
@@ -931,9 +365,9 @@ public class QCodeInfoServiceImpl {
enabledTICp=enabledTCp;
}
- Double enabledTOG=Double.parseDouble(obj1T.get("OGENABLEINTEGRATION").toString());
+ double enabledTOG=Double.parseDouble(obj1T.get("OGENABLEINTEGRATION").toString());
BigDecimal bdco = BigDecimal.valueOf(enabledTOG +Double.parseDouble(payIntegral));
- bdco = bdco.setScale(1, BigDecimal.ROUND_HALF_UP);
+ bdco = bdco.setScale(1, RoundingMode.HALF_UP);
double enabledTIOG =0.0;
if("FG".equals(payType) || "FP".equals(payType)){
enabledTIOG = bdco.doubleValue();
@@ -941,9 +375,21 @@ public class QCodeInfoServiceImpl {
}else{
enabledTIOG=enabledTOG;
}
- String sqlUpdate="update WEIXN_USER_TABLE SET ENABLEINTEGRATION="+enabledTI+",CPENABLEINTEGRATION="+enabledTICp+",OGENABLEINTEGRATION="+enabledTIOG+" " +
- " where 1=1 AND ID="+userid+"";
- this.mapperI.update(sqlUpdate);
+ /* String sqlUpdate="update WEIXN_USER_TABLE SET ENABLEINTEGRATION="+enabledTI+",CPENABLEINTEGRATION="+enabledTICp+",OGENABLEINTEGRATION="+enabledTIOG+" " +
+ " where ID="+userid;
+ this.mapperI.update(sqlUpdate);*/
+ Map userParams=new HashMap();
+ userParams.put("userId",openId);
+ userParams.put("enabledTI",enabledTI);
+ userParams.put("enabledTICp",enabledTICp);
+ userParams.put("enabledTIOG",enabledTIOG);
+ userParams.put("DBTYPE",DBType);
+ this.userTableMapper.updateUserById(userParams);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ userParams.put("DBTYPEBAK",bakDBType);
+ this.userTableMyMapper.updateUserById(userParams);
+ }
LogUtil.WriteLog_Info("用户更新可用积分完成","QCodeInfoServiceImpl");
}
@@ -962,12 +408,6 @@ public class QCodeInfoServiceImpl {
this.messagePushServiceImpl.pushMsg(openId,integralTypePu,"+"+PubTools.doubleSave1(Double.parseDouble(payIntegral)/100)+"",(enabledIntegral/100)+"");
}
}
- }catch (Exception e){
- LogUtil.WriteLog_Error("退款恢复积分操作失败===="+e.getMessage(),"QCodeInfoServiceImpl");
- ret=-1;
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
- return ret;
- }
return ret;
}
@@ -1145,14 +585,13 @@ public class QCodeInfoServiceImpl {
* @param payMoney 实际支付金额
* @return
*/
- @Transactional(rollbackFor = {Exception.class,RuntimeException.class})
- public JSONObject solveQcodeRedis(String content, String serverOperationId,String orderId, Double payMoney,Double discountMoneyBefore,Double discountMoney) throws Exception {
+ @Transactional(value = "jtatransactionManager",timeout = 100)
+ public JSONObject solveQcodeRedis(String content, String serverOperationId,String orderId, Double payMoney,Double discountMoneyBefore,Double discountMoney){
String ret="-2";// -1 代表接口处理失败 1 处理成功 2 用户不存在 3 兑换积分大于用户可用积分 4 二维码信息过期 5 商户不存在 6 积分类型与消费方式不匹配 7 商户角色未设置 8 用户已冻结 9 折扣金额与消费积分不一致 10 请重新生成二维码 11 订单中商户与核销中的商户不匹配 12 订单已核销
JSONObject retJo=new JSONObject();
String openId="";
- try{
LogUtil.WriteLog_Info("积分核减操作开始====="+PubTools.getCurrentDate()+"=======params==={content:"+content+",serverOperationId:"+serverOperationId+",discountMoney:"+discountMoney+"}","QCodeInfoServiceImpl");
- //查询金额与积分的兑换比例,一元兑换积分
+ //查询金额与积分的兑换比例
String sqlTemp="select t.VALUE/100 AS VALUE ,t.EVERYMONEY/100 AS EVERYMONEY from PAY_INTEGRATION_NUMBER_TABLE t where t.TYPE='@TYPE@'";
String rollbackTime=PubTools.getCurrentDate();
Object content1 = Consistant.map.get(content);
@@ -1180,7 +619,6 @@ public class QCodeInfoServiceImpl {
retJo.put("openId",openId);
String integrateType="";
- String consumeIntegral="";
String enabledIntegral="";
int userIdNew=0;
//校验用户状态
@@ -1188,7 +626,7 @@ public class QCodeInfoServiceImpl {
Object obj = userByOpenId.get(0);
Map obj1 = (Map) obj;
String certification = obj1.get("CERTIFICATION").toString();//认证状态
- if(userByOpenId.size()<1){
+ if(userByOpenId.isEmpty()){
Object contentNew = Consistant.map.get(content);
if(!PubTools.isEmpty(contentNew)){
Consistant.map.remove(content);
@@ -1215,24 +653,18 @@ public class QCodeInfoServiceImpl {
String serivceOperatorRole = "SELECT saot.ID,saot.USERNAME,saot.ROLEID,saot.SERVICEAREAID,saoc.INPUTMENEY FROM SERVICE_AREA_OPERATORS_TABLE saot,SERVICE_AREA_OPERATORS_COMPANY_TEXT saoc " +
" WHERE saoc.ID = saot.COMPANYID AND saot.JOBNUMBER='" + serverOperationId + "'";
List serviceOperatorList = this.mapperI.selectforlist(serivceOperatorRole);
- if (serviceOperatorList.size() < 1) {//商户不存在
+ if (serviceOperatorList.isEmpty()) {//商户不存在
Object contentNew = Consistant.map.get(content);
if(!PubTools.isEmpty(contentNew)){
Consistant.map.remove(content);
}
- Long l = redisConfigUtil.delIntegral(content);
ret = "5";
retJo.put("ret", ret);
return retJo;
}
boolean isCheckDiscountMoney=false;
- if(userByOpenId.size()>0){
- //String startLevel= obj1.get("STARLEVEL").toString();//星级
+ if(!userByOpenId.isEmpty()){
String ENABLEINTEGRATION = obj1.get("ENABLEINTEGRATION").toString();//用户可用公共积分
- String OILENABLEINTEGRATION = obj1.get("OILENABLEINTEGRATION").toString();//加油可用积分
- String GASENABLEINTEGRATION = obj1.get("GASENABLEINTEGRATION").toString();//加气可用积分
- String SPENABLEINTEGRATION = obj1.get("SPENABLEINTEGRATION").toString();//消费可用积分
- String CAFENABLEINTEGRATION = obj1.get("CAFENABLEINTEGRATION").toString();//餐饮可用积分
String OGENABLEINTEGRATION = obj1.get("OGENABLEINTEGRATION").toString();//加油、加气可用积分
String CPENABLEINTEGRATION = obj1.get("CPENABLEINTEGRATION").toString();//餐饮、消费可用积分
userIdNew = Integer.parseInt(obj1.get("ID").toString());//人员id
@@ -1248,7 +680,7 @@ public class QCodeInfoServiceImpl {
}
//核验商户角色与积分消费类型是否匹配
- if (serviceOperatorList.size() >0 ) {
+ if (!serviceOperatorList.isEmpty()) {
//校验用户与角色出示二维码积分消费类型是否匹配
Map mapServiceOperator = (Map) serviceOperatorList.get(0);
serviceRole = mapServiceOperator.get("ROLEID").toString();
@@ -1270,7 +702,7 @@ public class QCodeInfoServiceImpl {
retJo.put("ret", ret);
return retJo;
} else {
- if ("3".equals(serviceRole) || "1".equals(serviceRole)) {
+ if ("3".equals(serviceRole) || "1".equals(serviceRole)) {//加油加气
if (!"FPG".equals(integrateTypeParam)) {
ret = "6";
retJo.put("ret", ret);
@@ -1278,11 +710,10 @@ public class QCodeInfoServiceImpl {
if(!PubTools.isEmpty(contentNew)){
Consistant.map.remove(content);
}
- Long l = redisConfigUtil.delIntegral(content);
return retJo;
}
}
- if ("2".equals(serviceRole) || "4".equals(serviceRole)) {
+ if ("2".equals(serviceRole) || "4".equals(serviceRole)) {//餐饮、商超
if (!"FCS".equals(integrateTypeParam) && !"FCA".equals(integrateTypeParam)) {
ret = "6";
retJo.put("ret", ret);
@@ -1290,20 +721,9 @@ public class QCodeInfoServiceImpl {
if(!PubTools.isEmpty(contentNew)){
Consistant.map.remove(content);
}
- Long l = redisConfigUtil.delIntegral(content);
return retJo;
}
}
- /* //如果是餐饮预约, 则直接改了状态即可
- if("FCA".equals(integrateTypeParam)){
- String updateAppointSql="UPDATE APPOINTMENT_INFO_TABLE SET COMPLETESTATUS='Y' WHERE ID="+rebateIntegrate;
- this.mapperI.update(updateAppointSql);
- LogUtil.WriteLog_Info("积分核减=====修改预约记录为已核销", "QCodeInfoServiceImpl");
- ret = "1";
- retJo.put("ret", ret);
- return retJo;
- }*/
-
if ("1".equals(serviceRole)) {
integrateType = "FP";
} else if ("2".equals(serviceRole)) {
@@ -1317,8 +737,6 @@ public class QCodeInfoServiceImpl {
}
}
//查询用户累积获取的总积分
- String totalAddIntegralSql = "SELECT COALESCE(MAX(ilt.TOTALADDINTEGRATION),0) AS TOTALADDINTEGRATION FROM INTEGRATION_LIST_TABLE ilt,WEIXN_USER_TABLE ut WHERE ilt.USERID = ut.ID AND ut.OPENID='" + openId + "'";
- double totalAddIntegral = 0.0;
double rebateIntegrateSave = 0.0;
switch (integrateType) {
case "FP"://加油
@@ -1327,7 +745,7 @@ public class QCodeInfoServiceImpl {
List selectforlist = this.mapperI.selectforlist(sqlFp);
//判断兑换积分是否够本次折扣
int rebateIn = 1;
- if (selectforlist.size() > 0) {
+ if (!selectforlist.isEmpty()) {
Map o = (Map) selectforlist.get(0);
BigDecimal bd = BigDecimal.valueOf(Double.parseDouble(o.get("VALUE").toString()));
bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
@@ -1336,7 +754,6 @@ public class QCodeInfoServiceImpl {
//根据折扣金额计算积分
Double rebateIntegrateI = Double.parseDouble(rebateIntegrate);
Double rebateIntegrateIZK=PubTools.doubleSave1(discountMoney*rebateIn);
- //double enabledIntegFc=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(CAFENABLEINTEGRATION);
if(isCheckDiscountMoney){
if((rebateIntegrateIZK - rebateIntegrateI) != 0){
ret = "9";
@@ -1346,7 +763,6 @@ public class QCodeInfoServiceImpl {
return retJo;
}
}
- //double enabledInteg=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(OILENABLEINTEGRATION);
double enabledInteg = Double.parseDouble(OGENABLEINTEGRATION);
if (rebateIntegrateI > enabledInteg) {
ret = "3";
@@ -1364,17 +780,15 @@ public class QCodeInfoServiceImpl {
List selectforlistFg = this.mapperI.selectforlist(sqlFg);
//判断兑换积分是否够本次折扣
int rebateInFg = 1;
- if (selectforlistFg.size() > 0) {
+ if (!selectforlistFg.isEmpty()) {
Map o = (Map) selectforlistFg.get(0);
BigDecimal bd = BigDecimal.valueOf(Double.parseDouble(o.get("VALUE").toString()));
bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
rebateInFg=bd.intValue();
}
//根据折扣金额计算积分
- // int rebateIntegrateI=Integer.parseInt(rebateIntegrate);
Double rebateIntegrateIFgZk=PubTools.doubleSave1(discountMoney*rebateInFg);
Double rebateIntegrateIFg = Double.parseDouble(rebateIntegrate);
- // double enabledIntegFg=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(GASENABLEINTEGRATION);
//折扣金额与输入的积分是否一致
if(isCheckDiscountMoney) {
@@ -1412,7 +826,6 @@ public class QCodeInfoServiceImpl {
//根据折扣金额计算积分
Double rebateIntegrateIFcZK=discountMoney*rebateInFc;
Double rebateIntegrateIFc = Double.parseDouble(rebateIntegrate);
- //double enabledIntegFc=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(CAFENABLEINTEGRATION);
if(isCheckDiscountMoney) {
if ((rebateIntegrateIFcZK - rebateIntegrateIFc) != 0) {
ret = "9";
@@ -1447,14 +860,8 @@ public class QCodeInfoServiceImpl {
rebateInFs=bd.intValue();
}
//根据折扣金额计算积分
-
- // int rebateIntegrateI=Integer.parseInt(rebateIntegrate);
Double rebateIntegrateIFsZK=discountMoney*rebateInFs;
Double rebateIntegrateIFs = Double.parseDouble(rebateIntegrate);
- //double enabledIntegFs=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(SPENABLEINTEGRATION);
-
-
- //double enabledIntegFc=Double.parseDouble(ENABLEINTEGRATION)+Double.parseDouble(CAFENABLEINTEGRATION);
if(isCheckDiscountMoney) {
if ((rebateIntegrateIFsZK - rebateIntegrateIFs) != 0) {
ret = "9";
@@ -1479,103 +886,68 @@ public class QCodeInfoServiceImpl {
default:
break;
}
-
-
//进行积分核减
- /* List selectforlistTotalAdd = this.mapperI.selectforlist(totalAddIntegralSql);
- if (selectforlistTotalAdd.size() > 0) {
- Map o = (Map) selectforlistTotalAdd.get(0);
- totalAddIntegral = Double.parseDouble(o.get("TOTALADDINTEGRATION").toString());
- }*/
//1、积分流水记录新加
String sqlMax = "select COALESCE(max(ID),0) AS ID from integration_list_table";
List selectforlistMax = this.mapperI.selectforlist(sqlMax);
//判断兑换积分是否够本次折扣
int maxId = 1;
- if (selectforlistMax.size() > 0) {
+ if (!selectforlistMax.isEmpty()) {
Map o = (Map) selectforlistMax.get(0);
maxId = Integer.parseInt(o.get("ID").toString());
}
- String cafterSql = "INSERT INTO integration_list_table ( ID, USERID, LASTINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTIME, PAYTYPE,OGENABLEINTEGRATION,CPENABLEINTEGRATION )\n" +
- "VALUES\n" +
- "\t(\n" +
- "\t\t" + (maxId + 10) + ",\n" +
- "\t\t"+userIdNew+",\n" +
- "\t\t" + PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION) * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1(rebateIntegrateSave * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1(((Double.parseDouble(ENABLEINTEGRATION) - rebateIntegrateSave) * 100)) + ",\n" +
- "\t\tto_date('" + rollbackTime + "','yyyy-MM-dd HH24:mi:ss'),\n" +
- "\t'" + integrateType + "', \n" ;
- if("4".equals(DBType)){
- cafterSql = "INSERT INTO integration_list_table ( ID, USERID, LASTINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTIME, PAYTYPE,OGENABLEINTEGRATION,CPENABLEINTEGRATION )\n" +
- "VALUES\n" +
- "\t(\n" +
- "\t\t" + (maxId + 10) + ",\n" +
- "\t\t"+userIdNew+",\n" +
- "\t\t" + PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION) * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1(rebateIntegrateSave * 100) + ",\n" +
- "\t\t" + PubTools.doubleSave1(((Double.parseDouble(ENABLEINTEGRATION) - rebateIntegrateSave) * 100)) + ",\n" +
- "\t\tstr_to_date('" + rollbackTime + "','%Y-%m-%d %H:%i:%s'),\n" +
- "\t'" + integrateType + "', \n" ;
- }
-
+ Map integralList = new HashMap<>();
+ integralList.put("maxid",(maxId + 10));
+ integralList.put("userId",userIdNew);
+ integralList.put("acarNo","");
+ integralList.put("lastintegration",PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION) * 100));
+ integralList.put("payintegration",PubTools.doubleSave1(rebateIntegrateSave * 100));
+ integralList.put("restintegration",PubTools.doubleSave1(((Double.parseDouble(ENABLEINTEGRATION) - rebateIntegrateSave) * 100)));
+ integralList.put("payTime",rollbackTime);
+ integralList.put("paytype",integrateType);
+ integralList.put("DBTYPE",DBType);
if("FP".equals(integrateType) || "FG".equals(integrateType)){
- cafterSql += "\t" + PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION) - rebateIntegrateSave) * 100)) + ", \n" +
- "\t" + PubTools.doubleSave1(Double.parseDouble(CPENABLEINTEGRATION) * 100) + " \n" ;
+ integralList.put("cpenableintegration",PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION) - rebateIntegrateSave) * 100)));
+ integralList.put("ogenableintegration", PubTools.doubleSave1(Double.parseDouble(CPENABLEINTEGRATION) * 100));
}else if("FC".equals(integrateType) || "FS".equals(integrateType)) {
- cafterSql +="\t" + PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION)) * 100)) + ", \n" +
- "\t" + PubTools.doubleSave1((Double.parseDouble(CPENABLEINTEGRATION) - rebateIntegrateSave) * 100)+" " ;
- }else{
+ integralList.put("cpenableintegration",PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION)) * 100)));
+ integralList.put("ogenableintegration",PubTools.doubleSave1((Double.parseDouble(CPENABLEINTEGRATION) - rebateIntegrateSave) * 100));
+ }
+ this.integrationListMapper.addIntegralList(integralList);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ integralList.put("DBTYPEBAK",bakDBType);
+ this.integrationListMyMapper.addIntegralList(integralList);
}
- cafterSql+= "\t)";
- this.mapperI.insert(cafterSql);
- consumeIntegral=rebateIntegrateSave+"";
LogUtil.WriteLog_Info("积分核减=====积分流水已插入", "QCodeInfoServiceImpl");
//2、新加一条消费记录
- String sqlIntegralList = "insert into CAFTER_TABLE(ID,\n" +
- "ACARNO,\n" +
- "USERID,\n" +
- "CAFTERTIME,\n" +
- "USERJOBNUMBER,\n" +
- "TRIMINTEGRAL," +
- "INTEGRATIONLISTID,\n" +
- "ORDERID,CONTENT) values (\n" +
- " (select COALESCE(max(t.ID),0)+1 from CAFTER_TABLE t),''," +
- "" + userIdNew + ",to_date('" + rollbackTime + "','yyyy-MM-dd HH24:mi:ss'),'" + serverOperationId + "','SUCCESS'," + (maxId + 10) + ",'" + orderId + "','" + content + "'" +
- ")";
- if("4".equals(DBType)){
- sqlIntegralList = "insert into CAFTER_TABLE(ID,\n" +
- "ACARNO,\n" +
- "USERID,\n" +
- "CAFTERTIME,\n" +
- "USERJOBNUMBER,\n" +
- "TRIMINTEGRAL," +
- "INTEGRATIONLISTID,\n" +
- "ORDERID,CONTENT) values (\n" +
- " (select COALESCE(max(t.ID),0)+1 from CAFTER_TABLE t),''," +
- "" + userIdNew + ",str_to_date('" + rollbackTime + "','%Y-%m-%d %H:%i:%s'),'" + serverOperationId + "','SUCCESS'," + (maxId + 10) + ",'" + orderId + "','" + content + "'" +
- ")";
+ String maxIdCafeSql="select COALESCE(max(t.ID),0)+1 as ID from CAFTER_TABLE t";
+ List maxIdCafeSqlMax = this.mapperI.selectforlist(maxIdCafeSql);
+ //判断兑换积分是否够本次折扣
+ int maxIdCafe = 1;
+ if (!maxIdCafeSqlMax.isEmpty()) {
+ Map o = (Map) maxIdCafeSqlMax.get(0);
+ maxIdCafe = Integer.parseInt(o.get("ID").toString());
+ }
+ Map cafetparam = new HashMap<>();
+ cafetparam.put("maxId",maxIdCafe);
+ cafetparam.put("acarNo","");
+ cafetparam.put("userId",userIdNew);
+ cafetparam.put("cafterTime",rollbackTime);
+ cafetparam.put("userJobnumber",serverOperationId);
+ cafetparam.put("trimintegral","SUCCESS");
+ cafetparam.put("integrationListId",(maxId + 10));
+ cafetparam.put("orderId",orderId);
+ cafetparam.put("content",content);
+ cafetparam.put("DBTYPE",DBType);
+ this.cafterTableMapper.addcafter(cafetparam);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ cafetparam.put("DBTYPEBAK",bakDBType);
+ this.cafterTableMyMapper.addcafter(cafetparam);
}
- this.mapperI.insert(sqlIntegralList);
- //进行预约核销
- /*String appointMentSql="";
- if("FS".equals(integrateType)){
- appointMentSql="SELECT ID FROM APPOINTMENT_INFO_TABLE t where t.SERVICEAREAID='"+serviceAreaId+"' AND t.USERID='"+userIdNew+"' AND APPOINTMENTTIME=to_date('"+rollbackTime+"','YYYY-MM-DD') AND t.COMPLETESTATUS='N' AND t.APPOINTMENTTYPE=3 ORDER BY t.CREATETIME ";
- }else if("FC".equals(integrateType)){
- appointMentSql="SELECT ID FROM APPOINTMENT_INFO_TABLE t where t.SERVICEAREAID='"+serviceAreaId+"' AND t.USERID='"+userIdNew+"' AND APPOINTMENTTIME=to_date('"+rollbackTime+"','YYYY-MM-DD') AND t.COMPLETESTATUS='N' AND t.APPOINTMENTTYPE=2 ORDER BY t.CREATETIME ";
- }
- if(!PubTools.isNull(appointMentSql)){
- List appointList = this.mapperI.selectforlist(appointMentSql);
- if(appointList.size()>0){
- Map map=(Map)appointList.get(0);
- int appointId=Integer.parseInt(map.get("ID").toString());
- String updateAppointSql="UPDATE APPOINTMENT_INFO_TABLE SET COMPLETESTATUS='Y',INTEGRATIONLISTID="+(maxId + 10)+" WHERE ID="+appointId+"";
- this.mapperI.update(updateAppointSql);
- LogUtil.WriteLog_Info("积分核减=====修改预约记录为已核销", "QCodeInfoServiceImpl");
- }
- }*/
LogUtil.WriteLog_Info("积分核减=====消费记录已插入", "QCodeInfoServiceImpl");
//3、计算用户可用积分
String sql = "select " +
@@ -1583,37 +955,43 @@ public class QCodeInfoServiceImpl {
" from WEIXN_USER_TABLE ut " +
" where 1=1 AND ut.OPENID='" + openId + "'";
List selectforlist1 = this.mapperI.selectforlist(sql);
- if (selectforlist1.size() > 0) {
+ if (!selectforlist1.isEmpty()) {
Object objT = selectforlist1.get(0);
Map obj1T = (Map) objT;
- Double enabledT = Double.parseDouble(obj1T.get("ENABLEINTEGRATION").toString());
+ double enabledT = Double.parseDouble(obj1T.get("ENABLEINTEGRATION").toString());
BigDecimal bd = BigDecimal.valueOf(enabledT - rebateIntegrateSave * 100);
- bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
+ bd = bd.setScale(1, RoundingMode.HALF_UP);
double enabledTI = bd.doubleValue();
- Double enabledTCp = Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
+ double enabledTCp = Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
BigDecimal bdcp = BigDecimal.valueOf(enabledTCp - rebateIntegrateSave * 100);
- bdcp = bdcp.setScale(1, BigDecimal.ROUND_HALF_UP);
+ bdcp = bdcp.setScale(1, RoundingMode.HALF_UP);
double enabledTICp = bdcp.doubleValue();
-
- Double enabledTPG = Double.parseDouble(obj1T.get("OGENABLEINTEGRATION").toString());
+ double enabledTPG = Double.parseDouble(obj1T.get("OGENABLEINTEGRATION").toString());
BigDecimal bdcpPG = BigDecimal.valueOf(enabledTPG - rebateIntegrateSave * 100);
- BigDecimal bdcpPg = bdcpPG.setScale(1, BigDecimal.ROUND_HALF_UP);
+ BigDecimal bdcpPg = bdcpPG.setScale(1, RoundingMode.HALF_UP);
double enabledTIPG = bdcpPg.doubleValue();
+ Map userParams=new HashMap();
+ userParams.put("userId",openId);
+ userParams.put("enabledTI",enabledTI);
if("FP".equals(integrateType) || "FG".equals(integrateType)){
- String sqlUpdate = "update WEIXN_USER_TABLE SET ENABLEINTEGRATION=" + enabledTI + " ,OGENABLEINTEGRATION=" + enabledTIPG + " " +
- " where 1=1 AND OPENID='" + openId + "'";
- this.mapperI.update(sqlUpdate);
+ userParams.put("enabledTIPG",enabledTIPG);
enabledIntegral=PubTools.doubleSave1(enabledTIPG / 100)+"";
retJo.put("ENABLEINTEGRATION",enabledIntegral);
}else if("FC".equals(integrateType) || "FS".equals(integrateType)) {
- String sqlUpdate = "update WEIXN_USER_TABLE SET ENABLEINTEGRATION=" + enabledTI + " ,CPENABLEINTEGRATION=" + enabledTICp + " " +
- " where 1=1 AND OPENID='" + openId + "'";
- this.mapperI.update(sqlUpdate);
+ userParams.put("enabledTICp",enabledTICp);
enabledIntegral=PubTools.doubleSave1(enabledTICp / 100)+"";
retJo.put("ENABLEINTEGRATION", enabledIntegral);
}else{
}
+ userParams.put("DBTYPE",DBType);
+ this.userTableMapper.updateUserById(userParams);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ userParams.put("DBTYPEBAK",bakDBType);
+ this.userTableMyMapper.updateUserById(userParams);
+ }
+
LogUtil.WriteLog_Info("用户更新可用积分完成", "QCodeInfoServiceImpl");
}
@@ -1634,9 +1012,8 @@ public class QCodeInfoServiceImpl {
}else if("FS".equals(integrateType)){
integralTypePu="商超";
}
- this.messagePushServiceImpl.pushMsg(openId,integralTypePu,"-"+consumeIntegral,enabledIntegral);
+ this.messagePushServiceImpl.pushMsg(openId,integralTypePu,"-"+rebateIntegrateSave,enabledIntegral);
}
- ret="1";
//积分核减成功
}else{
@@ -1665,14 +1042,21 @@ public class QCodeInfoServiceImpl {
String serivceOperatorRole = "SELECT saot.ID,saot.USERNAME,saot.ROLEID,saot.SERVICEAREAID,saoc.INPUTMENEY FROM SERVICE_AREA_OPERATORS_TABLE saot,SERVICE_AREA_OPERATORS_COMPANY_TEXT saoc " +
" WHERE saoc.ID = saot.COMPANYID AND saot.JOBNUMBER='" + serverOperationId + "'";
List serviceOperatorList = this.mapperI.selectforlist(serivceOperatorRole);
- if (serviceOperatorList.size() < 1) {//商户不存在
+ if (serviceOperatorList.isEmpty()) {//商户不存在
ret = "5";
retJo.put("ret", ret);
return retJo;
}
//如果是餐饮预约, 则直接改了状态即可
- String updateAppointSql = "UPDATE APPOINTMENT_INFO_TABLE SET COMPLETESTATUS='Y' WHERE ORDERID='" + content + "'";
- this.mapperI.update(updateAppointSql);
+ Map updateCafe=new HashMap<>();
+ updateCafe.put("completeStatus","Y");
+ updateCafe.put("orderId",content);
+ this.appointmentInfoMapper.updateConpleteStatus(updateCafe);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ updateCafe.put("DBTYPEBAK",bakDBType);
+ this.appointmentInfoMyMapper.updateConpleteStatus(updateCafe);
+ }
LogUtil.WriteLog_Info("积分核减=====修改预约记录为已核销", "QCodeInfoServiceImpl");
ret = "1";
retJo.put("openId", openId);
@@ -1686,19 +1070,6 @@ public class QCodeInfoServiceImpl {
}
}
- }catch (Exception e){
- LogUtil.WriteLog_Error("积分核减操作失败====="+e.getMessage(),"QCodeInfoServiceImpl");
- ret="-1";
- retJo.put("ret",ret);
- //Consistant.map.remove(content);
- retJo.put("code",-1);
- retJo.put("msg","积分核减接口出错");
- retJo.put("data","");
- WebsocketUtil.sendMessage(openId,JSONObject.toJSONString(retJo));
- // WebsocketUtil.removeSession(openId);
-
- throw new Exception(e);
- }
retJo.put("ret",ret);
return retJo;
}
diff --git a/src/main/java/com/nmgs/service/impl/RotationServiceImpl.java b/src/main/java/com/nmgs/service/impl/RotationServiceImpl.java
index 8e335d1..6683157 100644
--- a/src/main/java/com/nmgs/service/impl/RotationServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/RotationServiceImpl.java
@@ -1,6 +1,6 @@
package com.nmgs.service.impl;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
import com.nmgs.util.PubTools;
diff --git a/src/main/java/com/nmgs/service/impl/SelectDataImpl.java b/src/main/java/com/nmgs/service/impl/SelectDataImpl.java
index eca0e00..ae9f6c4 100644
--- a/src/main/java/com/nmgs/service/impl/SelectDataImpl.java
+++ b/src/main/java/com/nmgs/service/impl/SelectDataImpl.java
@@ -1,7 +1,7 @@
package com.nmgs.service.impl;
import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PubTools;
import org.springframework.beans.factory.annotation.Autowired;
@@ -10,7 +10,6 @@ import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
/**
* 下拉值查询
diff --git a/src/main/java/com/nmgs/service/impl/SerivceAreaOperationMealServiceImpl.java b/src/main/java/com/nmgs/service/impl/SerivceAreaOperationMealServiceImpl.java
index 24d47f1..7555590 100644
--- a/src/main/java/com/nmgs/service/impl/SerivceAreaOperationMealServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/SerivceAreaOperationMealServiceImpl.java
@@ -1,6 +1,6 @@
package com.nmgs.service.impl;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PubTools;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/src/main/java/com/nmgs/service/impl/ServiceAreaPicServiceImpl.java b/src/main/java/com/nmgs/service/impl/ServiceAreaPicServiceImpl.java
index 1155d54..fa17b26 100644
--- a/src/main/java/com/nmgs/service/impl/ServiceAreaPicServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/ServiceAreaPicServiceImpl.java
@@ -1,15 +1,12 @@
package com.nmgs.service.impl;
-import com.nmgs.mapper.Mapper;
-import com.nmgs.mapper.ServiceAreaPicMapper;
-import com.nmgs.service.IServiceAreaService;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
import com.nmgs.util.PubTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/main/java/com/nmgs/service/impl/ServiceAreaServiceImpl.java b/src/main/java/com/nmgs/service/impl/ServiceAreaServiceImpl.java
index c811b1b..356b67d 100644
--- a/src/main/java/com/nmgs/service/impl/ServiceAreaServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/ServiceAreaServiceImpl.java
@@ -1,9 +1,5 @@
package com.nmgs.service.impl;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.nmgs.entity.*;
-import com.nmgs.mapper.*;
+import com.nmgs.mappercommon.*;
import com.nmgs.service.IServiceAreaService;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
@@ -11,13 +7,9 @@ import com.nmgs.util.PubTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import java.text.SimpleDateFormat;
import java.util.*;
-import static com.nmgs.util.PubTools.ClobToString;
-
@Service
@Slf4j
diff --git a/src/main/java/com/nmgs/service/impl/ServiceAreaSpecialServiceImpl.java b/src/main/java/com/nmgs/service/impl/ServiceAreaSpecialServiceImpl.java
index 1af07b6..737b22a 100644
--- a/src/main/java/com/nmgs/service/impl/ServiceAreaSpecialServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/ServiceAreaSpecialServiceImpl.java
@@ -1,6 +1,6 @@
package com.nmgs.service.impl;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.service.IServiceAreaSpecialService;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PubTools;
diff --git a/src/main/java/com/nmgs/service/impl/SolveUserAndVehcleServiceImpl.java b/src/main/java/com/nmgs/service/impl/SolveUserAndVehcleServiceImpl.java
index a32a948..4b8489b 100644
--- a/src/main/java/com/nmgs/service/impl/SolveUserAndVehcleServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/SolveUserAndVehcleServiceImpl.java
@@ -1,14 +1,12 @@
package com.nmgs.service.impl;
-import cn.hutool.core.collection.ListUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.util.*;
diff --git a/src/main/java/com/nmgs/service/impl/UserTableServiceImpl.java b/src/main/java/com/nmgs/service/impl/UserTableServiceImpl.java
index 852e679..fae082b 100644
--- a/src/main/java/com/nmgs/service/impl/UserTableServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/UserTableServiceImpl.java
@@ -1,7 +1,9 @@
package com.nmgs.service.impl;
import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
+import com.nmgs.mapperset.mysqlmapper.UserTableMysqlMapper;
+import com.nmgs.mapperset.oraclemapper.UserTableMapper;
import com.nmgs.service.UserTableService;
import com.nmgs.util.*;
import oracle.sql.CLOB;
@@ -11,15 +13,28 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Blob;
-import java.sql.Clob;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
+//@Transactional
public class UserTableServiceImpl implements UserTableService {
@Autowired
public Mapper mapperI;
+
+ public UserTableMapper userTableMapperOracle;
+ public UserTableMysqlMapper userTableMysqlMapper;
+ @Autowired
+ public void setUserTableMapperOracle(UserTableMapper userTableMapperOracle) {
+ this.userTableMapperOracle = userTableMapperOracle;
+ }
+ @Autowired
+ public void setUserTableMysqlMapper(UserTableMysqlMapper userTableMysqlMapper) {
+ this.userTableMysqlMapper = userTableMysqlMapper;
+ }
+
private static String DBType= PropertiesUtil.getValue("DBType");
private static String sql="select " +
" ut.ID ,ut.OPENID ,ut.USERNAME ,ut.PHONE ," +
@@ -77,15 +92,15 @@ public class UserTableServiceImpl implements UserTableService {
}
@Override
- //@Transactional(rollbackFor={RuntimeException.class, Exception.class},propagation= Propagation.REQUIRED)
- public synchronized int addUser(String openId, String userName) {
+ @Transactional(value = "jtatransactionManager",timeout = 10)
+ public int addUser(String openId, String userName) {
int ret=-1;
//查询全部人员,给list赋值推荐码
List retlist = new ArrayList();
- if(PubTools.list.size()==0){
+ if(PubTools.list.isEmpty()){
String sqlTempQuery = "select ut.REFERRERCODE AS REFERRERCODE from WEIXN_USER_TABLE ut";
List list= this.mapperI.selectforlist(sqlTempQuery);
- if(list.size()>0) {
+ if(!list.isEmpty()) {
for (Object obj : list) {
Map obj1 = (Map) obj;
Object o = PubTools.isEmpty(obj1.get("REFERRERCODE"))?"":obj1.get("REFERRERCODE");
@@ -107,91 +122,100 @@ public class UserTableServiceImpl implements UserTableService {
if (select != null && select.get("MAXID") != null) {
userId = Integer.parseInt(select.get("MAXID").toString());
}
- redisConfigUtil.set("USER_ID", userId + "");
+ redisConfigUtil.set("USER_ID", (userId+1) + "");
}
- String sqlTemp="insert into WEIXN_USER_TABLE(ID,OPENID,USERNAME,CREATETIME,ENABLEINTEGRATION,STARLEVEL,OILENABLEINTEGRATION,GASENABLEINTEGRATION," +
- " SPENABLEINTEGRATION,CAFENABLEINTEGRATION,CERTIFICATION,OGENABLEINTEGRATION,CPENABLEINTEGRATION,REFERRERCODE) values(" + (userId + 1) + ",'" + openId + "','" + userName + "',to_date('" + PubTools.getCurrentDate() + "','yyyy-MM-dd HH24:mi:ss'),0,0,0,0,0,0,0,0,0,'" + REFERRERCODE + "')";
- if("4".equals(DBType)){
- sqlTemp="insert into WEIXN_USER_TABLE(ID,OPENID,USERNAME,CREATETIME,ENABLEINTEGRATION,STARLEVEL,OILENABLEINTEGRATION,GASENABLEINTEGRATION," +
- " SPENABLEINTEGRATION,CAFENABLEINTEGRATION,CERTIFICATION,OGENABLEINTEGRATION,CPENABLEINTEGRATION,REFERRERCODE) values(" + (userId + 1) + ",'" + openId + "','" + userName + "',str_to_date('" + PubTools.getCurrentDate() + "','%Y-%m-%d %H:%i:%s'),0,0,0,0,0,0,0,0,0,'" + REFERRERCODE + "')";
+ Map param=new HashMap<>();
+ param.put("DBTYPE",DBType);
+ param.put("userid",(userId+1));
+ param.put("openid",openId);
+ param.put("username",userName);
+ param.put("createTime", PubTools.getCurrentDate());
+ param.put("REFERRERCODE", REFERRERCODE);
+/* if("4".equals(DBType)){//mysql
+ ret=this.userTableMysqlMapper.addUser(param);
+ }else if("2".equals(DBType)){//oracle
+ ret=this.userTableMapperOracle.addUser(param);
}
- try{
- ret= this.mapperI.insert(sqlTemp);
- retlist.add(REFERRERCODE);
- PubTools.list=retlist;
- }catch (Exception e){
- LogUtil.WriteLog_Error("根据微信openid新增用户失败===>"+e.getMessage(),"UserTableServiceImpl");
- return ret=-1;
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ param.put("DBTYPEBAK",bakDBType);
+ if("4".equals(bakDBType)){//mysql
+ ret=this.userTableMysqlMapper.addUser(param);
+ }else if("2".equals(bakDBType)){//oracle
+ ret=this.userTableMapperOracle.addUser(param);
+ }
+ }*/
+ ret=this.userTableMapperOracle.addUser(param);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ param.put("DBTYPEBAK",bakDBType);
+ ret=this.userTableMysqlMapper.addUser(param);
}
+ retlist.add(REFERRERCODE);
+ PubTools.list=retlist;
return ret;
}
@Override
- // @Transactional(rollbackFor = {Exception.class, RuntimeException.class},propagation = Propagation.REQUIRED)
+ @Transactional(value = "jtatransactionManager",timeout = 10)
public int updateUser(String userId,String idNumber,String phone,String realName,String numberPic) {
- int ret=-1;
- try{
+ int ret = 1;
//图片加水印
String fileName = userId + "NUMPIC" + ".jpg";
LogUtil.WriteLog_Info("用户实名认证修改附件水印=开始===" + PubTools.getCurrentDate() + "====", "UserController");
- if (!PubTools.isNull(numberPic) && !numberPic.contains("NUMPIC")) {
+/* if (!PubTools.isNull(numberPic) && !numberPic.contains("NUMPIC")) {
LogUtil.WriteLog_Info("用户实名认证修改附件水印===IF里面=" + PubTools.getCurrentDate() + "====", "UserController");
String permitpicPic = ImageUtils.addImageWaterMark(numberPic, "仅用于内蒙古交通货运车辆积分会员认证", fileName);
LogUtil.WriteLog_Info("用户实名认证修改附件水印=完成===" + PubTools.getCurrentDate() + "====", "UserController");
if(!PubTools.isNull(permitpicPic)){
numberPic=permitpicPic;
}
- }
- if("2".equals(DBType)){
- numberPic=PubTools.StringToClob(numberPic);
- }
- fileName = PubTools.getCurrentDateYMD() + "/" + fileName;
- String sql="update WEIXN_USER_TABLE " +
- " set CERTIFICATION=2,CREATETIME=to_date('" + PubTools.getCurrentDate() + "','yyyy-MM-dd HH24:mi:ss'),NUMBERPICNAME='" + fileName + "'";
- if (!PubTools.isNull(realName)) {
- sql += ",REALNAME='" + realName + "'";
- }
- if (!PubTools.isNull(idNumber) && !idNumber.contains("*")) {
- sql += ",IDNUMBER='" + idNumber + "'";
- }
- if (!PubTools.isNull(phone)) {
- sql += ",PHONE='" + phone + "'";
- }
- /*if (!PubTools.isNull(numberPic)) {
- sql += ",NUMBERPIC=" + numberPic + "";
}*/
- sql += " where OPENID='" + userId + "'";
- if("4".equals(DBType)){
- sql="update WEIXN_USER_TABLE " +
- " set CERTIFICATION=2,CREATETIME=str_to_date('" + PubTools.getCurrentDate() + "','%Y-%m-%d %H:%i:%s') ,NUMBERPICNAME='" + fileName + "'";
- if (!PubTools.isNull(realName)) {
- sql += ",REALNAME='" + realName + "'";
+ fileName = PubTools.getCurrentDateYMD() + "/" + fileName;
+ int certification = 2;//审核中
+ //20250324 修改审批状态,根据OCR自动识别,姓名和身份证号
+ if (PubTools.getEnabledOcr() == 1) {
+ String picUrl = PubTools.HTTPS + fileName;
+ JSONObject idCard = OcrUtil.getAllText(picUrl, "IdCard");
+ String status = idCard.get("status").toString();
+ if ("error".equals(status)) {
+ ret = -98;
+ return ret;
}
- if (!PubTools.isNull(idNumber) && !idNumber.contains("*")) {
- sql += ",IDNUMBER='" + idNumber + "'";
+ JSONObject data = (JSONObject) idCard.get("data");
+ String idNumber1 = data.get("idNumber").toString();
+ String name = data.get("name").toString();
+ if (!PubTools.isNull(realName) && name.equals(realName) && !PubTools.isNull(idNumber) && !idNumber.contains("*") && idNumber1.equals(idNumber)) {
+ certification = 1;
+ ret = 100;
}
- if (!PubTools.isNull(phone)) {
- sql += ",PHONE='" + phone + "'";
+ if (!PubTools.isNull(realName) && !name.equals(realName)) {
+ ret = -97;
+ return ret;
+ }
+ if (!PubTools.isNull(realName) && !idNumber.contains("*") && !idNumber1.equals(idNumber)) {
+ ret = -96;
+ return ret;
}
- /* if (!PubTools.isNull(numberPic)) {
- sql += ",NUMBERPIC='" + numberPic + "'";
- }*/
- sql += " where OPENID='" + userId + "'";
}
- ret=this.mapperI.update(sql);
-
- //人员实名认证之后,需要积分表中加一条流水
-
- /* String sqlTemp="insert into integration_list_table(ID,USERID,LASTINTEGRATION,PAYINTEGRATION,RESTINTEGRATION,PAYTIME,PAYTYPE) " +
- " values((select max(temp.id)+1 from integration_list_table temp),"+userId+",0,(select t.VALUE from pay_integration_number_table t where t.TYPE='AU'),0,to_date('"+PubTools.getCurrentDate()+"','YYYY-MM-DD HH24:MI:SS'),'AU')";
- ret=this.mapperI.insert(sqlTemp);*/
+ //20250324 修改审批状态,根据OCR自动识别,姓名和身份证号 ,满足的话自动改成已审核
+ Map param=new HashMap<>();
+ param.put("DBTYPE",DBType);
+ param.put("certification",certification);
+ param.put("filename",fileName);
+ param.put("phone",phone);
+ param.put("realName", realName);
+ param.put("idNumber", idNumber);
+ param.put("createTime", PubTools.getCurrentDate());
+ param.put("openid", userId);
+ ret=this.userTableMapperOracle.updateUser(param);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ param.put("DBTYPEBAK",bakDBType);
+ ret=this.userTableMysqlMapper.updateUser(param);
- }catch (Exception e){
- LogUtil.WriteLog_Error("人员实名认证失败===>"+e.getMessage(),"UserTableServiceImpl");
- return ret=-1;
- //throw new RuntimeException();
- }
+ }
return ret;
}
@@ -292,6 +316,7 @@ public class UserTableServiceImpl implements UserTableService {
}
}
}catch (Exception e){
+ e.printStackTrace();
LogUtil.WriteLog_Error("根据微信openid查询用户详情失败===>"+e.getMessage(),"UserTableServiceImpl");
return retlist=null;
}
diff --git a/src/main/java/com/nmgs/service/impl/UserVehicleServiceImpl.java b/src/main/java/com/nmgs/service/impl/UserVehicleServiceImpl.java
index 57633be..e63fc14 100644
--- a/src/main/java/com/nmgs/service/impl/UserVehicleServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/UserVehicleServiceImpl.java
@@ -2,21 +2,18 @@ package com.nmgs.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
+import com.nmgs.mapperset.mysqlmapper.UserVehicleMyMapper;
+import com.nmgs.mapperset.oraclemapper.UserVehicleMapper;
import com.nmgs.service.UserVehicleService;
-import com.nmgs.util.ImageUtils;
-import com.nmgs.util.LogUtil;
-import com.nmgs.util.PropertiesUtil;
-import com.nmgs.util.PubTools;
-import oracle.sql.CLOB;
+import com.nmgs.util.*;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
-import java.sql.Blob;
-import java.sql.Clob;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -25,6 +22,16 @@ public class UserVehicleServiceImpl implements UserVehicleService {
@Autowired
public Mapper mapperI;
+ public UserVehicleMapper userVehicleMapper;
+ @Autowired
+ public void setUserVehicleMapper(UserVehicleMapper userVehicleMapper) {
+ this.userVehicleMapper = userVehicleMapper;
+ }
+ public UserVehicleMyMapper userVehicleMyMapper;
+ @Autowired
+ public void setUserVehicleMyMapper(UserVehicleMyMapper userVehicleMyMapper) {
+ this.userVehicleMyMapper = userVehicleMyMapper;
+ }
private static String DBType= PropertiesUtil.getValue("DBType");
private static String sql="select " +
@@ -76,10 +83,9 @@ public class UserVehicleServiceImpl implements UserVehicleService {
}
@Override
- // @Transactional(rollbackFor = {Exception.class, RuntimeException.class},propagation = Propagation.REQUIRED)
+ @Transactional(value = "jtatransactionManager")
public int addUserVehicle(JSONArray jsonArray) {
int ret=1;
- try{
String currentDate=PubTools.getCurrentDate();
if(jsonArray.size()>0){
String CREATETIME=PubTools.getCurrentDate() ;
@@ -121,60 +127,80 @@ public class UserVehicleServiceImpl implements UserVehicleService {
ret=2;//车辆信息已经存在
break;
}
- String sqlTemp2="insert into user_vehicle_table(USERID,ACARNO,CREATETIME,CERTIFICATION) " +
+ /* String sqlTemp2="insert into user_vehicle_table(USERID,ACARNO,CREATETIME,CERTIFICATION) " +
" values((SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='"+userId+"'),'"+aCarNo+"',to_date('"+CREATETIME+"','YYYY-MM-DD HH24:MI:SS'),0) ";
if("4".equals(DBType)){
sqlTemp2="insert into user_vehicle_table(USERID,ACARNO,CREATETIME,CERTIFICATION) " +
" values((SELECT ID FROM WEIXN_USER_TABLE WHERE OPENID='"+userId+"'),'"+aCarNo+"',str_to_date('"+CREATETIME+"','%Y-%m-%d %H:%i:%s'),0) ";
- }
- this.mapperI.insert(sqlTemp2);
+ }*/
+ Map params=new HashMap<>();
+ params.put("DBTYPE",DBType);
+ params.put("openid",userId);
+ params.put("aCarNo",aCarNo);
+ params.put("createTime",CREATETIME);
+ params.put("certification",0);
+ // this.mapperI.insert(sqlTemp2);
+ ret=userVehicleMapper.addUserVehicle(params);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ params.put("DBTYPEBAK",bakDBType);
+ userVehicleMyMapper.addUserVehicle(params);
+ }
}
}
- }catch (Exception e){
- LogUtil.WriteLog_Error("批量插入车牌失败===>"+e.getMessage(),"UserVehicleServiceImpl");
- ret=-1;
- throw new RuntimeException();
- }
return ret;
}
@Override
+ @Transactional(value = "jtatransactionManager")
public int cancelUserVehicle(String userId, String aCarNo) {
int ret=1;
- try{
- String CREATETIME=PubTools.getCurrentDate() ;
- String sqlQuery = "SELECT uvt.USERID,uvt.ACARNO,uvt.CERTIFICATION,uvt.PERMITPICNAME ,uvt.VEHICLEPICNAME ,uvt.LICENSEPICNAME from user_vehicle_table uvt where uvt.USERID=" + userId + " and uvt.ACARNO='" + aCarNo + "' AND uvt.CERTIFICATION not in(4)";
- List selectforlist = this.mapperI.selectforlist(sqlQuery);
- if(selectforlist.size()>0){
- Map obj1 = (Map)selectforlist.get(0);
- String certification = obj1.get("CERTIFICATION").toString();
- if (Integer.parseInt(certification) != 1) {
- String sqlDel = "DELETE FROM user_vehicle_table where USERID=" + userId + " and ACARNO='" + aCarNo + "' AND CERTIFICATION not in(1,4)";
- this.mapperI.update(sqlDel);
- if (!PubTools.isEmpty(obj1.get("PERMITPICNAME"))) {
- //需要删除附件
- ImageUtils.delFile(obj1.get("PERMITPICNAME").toString(), true);
- }
- if (!PubTools.isEmpty(obj1.get("VEHICLEPICNAME"))) {
- //需要删除附件
- ImageUtils.delFile(obj1.get("VEHICLEPICNAME").toString(), true);
- }
- if (!PubTools.isEmpty(obj1.get("LICENSEPICNAME"))) {
- //需要删除附件
- ImageUtils.delFile(obj1.get("LICENSEPICNAME").toString(), true);
- }
- }else{
- String sqlTemp = "update user_vehicle_table set CERTIFICATION=4,CANCELTIME=to_date('" + CREATETIME + "','YYYY-MM-DD HH24:MI:SS') where USERID=" + userId + " and ACARNO='" + aCarNo + "' AND CERTIFICATION=1";
- if ("4".equals(DBType)) {
- sqlTemp = "update user_vehicle_table set CERTIFICATION=4,CANCELTIME=str_to_date('" + CREATETIME + "','%Y-%m-%d %H:%i:%s') where USERID=" + userId + " and ACARNO='" + aCarNo + "' AND CERTIFICATION=1";
- }
- this.mapperI.update(sqlTemp);
+ String CREATETIME=PubTools.getCurrentDate() ;
+ String sqlQuery = "SELECT uvt.USERID,uvt.ACARNO,uvt.CERTIFICATION,uvt.PERMITPICNAME ,uvt.VEHICLEPICNAME ,uvt.LICENSEPICNAME from user_vehicle_table uvt where uvt.USERID=" + userId + " and uvt.ACARNO='" + aCarNo + "' AND uvt.CERTIFICATION not in(4)";
+ List selectforlist = this.mapperI.selectforlist(sqlQuery);
+ if(selectforlist.size()>0){
+ Map obj1 = (Map)selectforlist.get(0);
+ String certification = obj1.get("CERTIFICATION").toString();
+ if (Integer.parseInt(certification) != 1) {
+ Map params=new HashMap<>();
+ params.put("DBTYPE",DBType);
+ params.put("userId",userId);
+ params.put("aCarNo",aCarNo);
+ params.put("commonCondition","CERTIFICATION not in(1,4)");
+ ret=this.userVehicleMapper.delUserVehcile(params);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ params.put("DBTYPEBAK",bakDBType);
+ ret=userVehicleMyMapper.delUserVehcile(params);
+ }
+ /* if (!PubTools.isEmpty(obj1.get("PERMITPICNAME"))) {
+ //需要删除附件
+ ImageUtils.delFile(obj1.get("PERMITPICNAME").toString(), true);
+ }
+ if (!PubTools.isEmpty(obj1.get("VEHICLEPICNAME"))) {
+ //需要删除附件
+ ImageUtils.delFile(obj1.get("VEHICLEPICNAME").toString(), true);
+ }
+ if (!PubTools.isEmpty(obj1.get("LICENSEPICNAME"))) {
+ //需要删除附件
+ ImageUtils.delFile(obj1.get("LICENSEPICNAME").toString(), true);
+ }*/
+ }else{
+ Map params=new HashMap<>();
+ params.put("DBTYPE",DBType);
+ params.put("certification",4);
+ params.put("cancelTime",PubTools.getCurrentDate());
+ params.put("userId",userId);
+ params.put("aCarNo",aCarNo);
+ params.put("commonCondition","CERTIFICATION=1");
+ ret=this.userVehicleMapper.updateUserVehicle(params);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ params.put("DBTYPEBAK",bakDBType);
+ ret=userVehicleMyMapper.updateUserVehicle(params);
}
}
- }catch (Exception e){
- LogUtil.WriteLog_Error("根据用户id和车牌号取消绑定失败===>"+e.getMessage(),"UserVehicleServiceImpl");
- return ret=-1;
}
return ret;
}
@@ -259,86 +285,56 @@ public class UserVehicleServiceImpl implements UserVehicleService {
return retlist;
}
@Override
- //@Transactional(rollbackFor = {Exception.class, RuntimeException.class},propagation = Propagation.REQUIRED)
+ @Transactional(value = "jtatransactionManager")
public int updateUserVehicle(String userId,String aCarNo,String checkName,String checkUserNumber,String licensepic,
String permitpic,String vehiclePic,String certification,String referrerCode) {
int ret=1;
- try{
String fileNamePre = userId + "-" + aCarNo + "-";
String fileNameAfter = ".jpg";
- //图片加水印
+ /*//图片加水印
if (!PubTools.isNull(permitpic) && !permitpic.contains("PERPIC")) {
String permitpicPic = ImageUtils.addImageWaterMark(permitpic, "仅用于内蒙古交通货运车辆积分会员认证", fileNamePre + "PERPIC" + fileNameAfter);
if(!PubTools.isNull(permitpicPic)){
permitpic=permitpicPic;
}
- }
- //图片加水印
- if (!PubTools.isNull(licensepic) && !licensepic.contains("LICPIC")) {
- String permitpicPic = ImageUtils.addImageWaterMark(licensepic, "仅用于内蒙古交通货运车辆积分会员认证", fileNamePre + "LICPIC" + fileNameAfter);
- if(!PubTools.isNull(permitpicPic)){
- licensepic=permitpicPic;
- }
- }
- //图片加水印
- if (!PubTools.isNull(vehiclePic) && !vehiclePic.contains("VEHPIC")) {
- String permitpicPic = ImageUtils.addImageWaterMark(vehiclePic, "仅用于内蒙古交通货运车辆积分会员认证", fileNamePre + "VEHPIC" + fileNameAfter);
- if(!PubTools.isNull(permitpicPic)){
- vehiclePic=permitpicPic;
- }
- }
- String sql = "update user_vehicle_table " +
- " set CERTIFICATION=" + certification + "";
- if ("2".equals(DBType)) {
- sql += ",CREATETIME=to_date('" + PubTools.getCurrentDate() + "','yyyy-MM-dd HH24:mi:ss')";
- if (!PubTools.isNull(licensepic)) {
- // licensepic = PubTools.StringToClob(licensepic);
- // sql += ",LICENSEPIC=" + licensepic;
- sql += ",LICENSEPICNAME='" + PubTools.getCurrentDateYMD() + "/" + fileNamePre + "LICPIC" + fileNameAfter + "'";
- }
- if (!PubTools.isNull(permitpic)) {
- // permitpic = PubTools.StringToClob(permitpic);
- // sql += ",PERMITPIC=" + permitpic;
- sql += ",PERMITPICNAME='" + PubTools.getCurrentDateYMD() + "/" + fileNamePre + "PERPIC" + fileNameAfter + "'";
- }
- if (!PubTools.isNull(vehiclePic)) {
- // vehiclePic = PubTools.StringToClob(vehiclePic);
- // sql += ",VEHICLEPIC=" + vehiclePic;
- sql += ",VEHICLEPICNAME='" + PubTools.getCurrentDateYMD() + "/" + fileNamePre + "VEHPIC" + fileNameAfter + "'";
- }
- } else if ("4".equals(DBType)) {
- sql += ",CREATETIME=str_to_date('" + PubTools.getCurrentDate() + "','%Y-%m-%d %H:%i:%s')";
- if (!PubTools.isNull(licensepic)) {
- // sql += ",LICENSEPIC='" + licensepic + "'";
- sql += ",LICENSEPICNAME='" + PubTools.getCurrentDateYMD() + "/" + fileNamePre + "LICPIC" + fileNameAfter + "'";
- }
- if (!PubTools.isNull(permitpic)) {
- // sql += ",PERMITPIC='" + permitpic + "'";
- sql += ",PERMITPICNAME='" + PubTools.getCurrentDateYMD() + "/" + fileNamePre + "PERPIC" + fileNameAfter + "'";
+ }*/
+ //20250324 修改审批状态,根据OCR自动识别,姓名
+ if (PubTools.getEnabledOcr() == 1) {
+ String picUrl = PubTools.HTTPS + PubTools.getCurrentDateYMD() + "/" + fileNamePre + "PERPIC" + fileNameAfter;
+ JSONObject idCard = OcrUtil.getAllText(picUrl, "VehicleLicense");
+ String status = idCard.get("status").toString();
+ if ("error".equals(status)) {
+ ret = -98;
+ return ret;
}
- if (!PubTools.isNull(vehiclePic)) {
- // sql += ",VEHICLEPIC='" + vehiclePic + "'";
- sql += ",VEHICLEPICNAME='" + PubTools.getCurrentDateYMD() + "/" + fileNamePre + "VEHPIC" + fileNameAfter + "'";
+ JSONObject data = (JSONObject) idCard.get("data");
+ String name = data.get("name").toString();
+ if (!PubTools.isNull(checkName) && name.equals(checkName)) {
+ certification = "1";
+ ret = 100;
}
}
- if (!PubTools.isNull(referrerCode)) {
- sql += ",REFERRERCODE='" + referrerCode + "'";
- }
- if (!PubTools.isNull(checkName)) {
- sql += ",CHECKUSERNAME='" + checkName + "'";
- }
+ Map params=new HashMap<>();
+ params.put("DBTYPE",DBType);
+ params.put("certification",certification);
+ params.put("createTime",PubTools.getCurrentDate());
+ params.put("licensepic",PubTools.getCurrentDateYMD() + "/" + fileNamePre + "LICPIC" + fileNameAfter);
+ params.put("permitpic",PubTools.getCurrentDateYMD() + "/" + fileNamePre + "PERPIC" + fileNameAfter);
+ params.put("vehiclePic",PubTools.getCurrentDateYMD() + "/" + fileNamePre + "VEHPIC" + fileNameAfter);
+ params.put("referrerCode",referrerCode);
+ params.put("checkName",referrerCode);
+ params.put("userId",userId);
+ params.put("aCarNo",aCarNo);
if (!PubTools.isNull(checkUserNumber) && !checkUserNumber.contains("*")) {
- sql += ",CHECKUSERNUMBER='" + checkUserNumber + "'";
- }
- if (!PubTools.isNull(referrerCode)) {
- sql += ",REFERRERCODE='" + referrerCode + "'";
+ params.put("checkUserNumber",checkUserNumber);
}
- sql += " where USERID=" + userId + " and ACARNO='" + aCarNo + "' AND CERTIFICATION not in(4)";
-
- this.mapperI.insert(sql);
- }catch (Exception e){
- LogUtil.WriteLog_Error("批量修改车牌失败===>"+e.getMessage(),"UserVehicleServiceImpl");
- return ret=-1;
+ params.put("commonCondition","CERTIFICATION not in(4)");
+ //this.mapperI.insert(sql);
+ ret = userVehicleMapper.updateUserVehicle(params);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ String bakDBType = PropertiesUtil.getValue("BakDBType");
+ params.put("DBTYPEBAK",bakDBType);
+ ret=userVehicleMyMapper.updateUserVehicle(params);
}
return ret;
}
diff --git a/src/main/java/com/nmgs/service/impl/VehicleScoreServiceImpl.java b/src/main/java/com/nmgs/service/impl/VehicleScoreServiceImpl.java
index d763a69..b468e21 100644
--- a/src/main/java/com/nmgs/service/impl/VehicleScoreServiceImpl.java
+++ b/src/main/java/com/nmgs/service/impl/VehicleScoreServiceImpl.java
@@ -1,6 +1,6 @@
package com.nmgs.service.impl;
-import com.nmgs.mapper.Mapper;
+import com.nmgs.mappercommon.Mapper;
import com.nmgs.service.VehicleScoreService;
import com.nmgs.util.LogUtil;
import com.nmgs.util.PropertiesUtil;
diff --git a/src/main/java/com/nmgs/util/DataSourceUtil.java b/src/main/java/com/nmgs/util/DataSourceUtil.java
new file mode 100644
index 0000000..8c41ace
--- /dev/null
+++ b/src/main/java/com/nmgs/util/DataSourceUtil.java
@@ -0,0 +1,48 @@
+package com.nmgs.util;
+
+import com.trkf.PasswordEncryption.PassWordUtils;
+import com.zaxxer.hikari.HikariConfig;
+import com.zaxxer.hikari.HikariDataSource;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Component;
+
+import javax.sql.DataSource;
+
+@Component
+public class DataSourceUtil {
+ public static JdbcTemplate Hikar_DataSource_MYSQL() {
+ HikariConfig config = new HikariConfig();
+ JdbcTemplate jdbcTemplate = null;
+ try {
+ //数据库类型,1-sqlserver, 2-oracle,3-达梦,4-mysql
+ String BakDBType = PropertiesUtil.getValue("BakDBType");
+ String driverName = "com.mysql.cj.jdbc.Driver";
+ if (BakDBType.equals("1")) {
+ driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+ } else if (BakDBType.equals("2")) {
+ driverName = "oracle.jdbc.driver.OracleDriver";
+ } else if (BakDBType.equals("3")) {
+ driverName = "dm.jdbc.driver.DmDriver";
+ }
+ config.setDriverClassName(driverName);
+ config.setJdbcUrl(PropertiesUtil.getValue("BAKDBUrl"));
+ config.setUsername(PropertiesUtil.getValue("BAKDBUserName"));
+ config.setPoolName("DatebookHikariCPMysql");
+ config.setPassword(PassWordUtils.decrypt(PropertiesUtil.getValue("BAKDBPassWord")));
+ config.setMaximumPoolSize(10);
+ config.setMinimumIdle(2);
+ config.setConnectionTimeout(600000);
+ config.setConnectionTestQuery("select 1 from dual");
+ config.setAutoCommit(true);
+ DataSource ds = new HikariDataSource(config);
+ if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
+ jdbcTemplate = new JdbcTemplate(ds);
+ PubTools.jdbcTemplate = jdbcTemplate;
+ }
+ } catch (Exception e) {
+ LogUtil.WriteLog_Error("小程序备份库连接失败{}" + e.getMessage(), "DataSourceUtil");
+ return null;
+ }
+ return jdbcTemplate;
+ }
+}
diff --git a/src/main/java/com/nmgs/util/HttpClientUtil.java b/src/main/java/com/nmgs/util/HttpClientUtil.java
index 3ab722b..1f67ec9 100644
--- a/src/main/java/com/nmgs/util/HttpClientUtil.java
+++ b/src/main/java/com/nmgs/util/HttpClientUtil.java
@@ -12,8 +12,6 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Component;
import java.io.IOException;
import java.net.URI;
diff --git a/src/main/java/com/nmgs/util/ImageUtils.java b/src/main/java/com/nmgs/util/ImageUtils.java
index e6c282b..1f2eb41 100644
--- a/src/main/java/com/nmgs/util/ImageUtils.java
+++ b/src/main/java/com/nmgs/util/ImageUtils.java
@@ -167,8 +167,7 @@ public class ImageUtils {
}
return retStr;
} catch (Exception e) {
- e.printStackTrace();
- return retStr="";
+ return "-9999";
} finally {
inputStream.close();
}
diff --git a/src/main/java/com/nmgs/util/OcrUtil.java b/src/main/java/com/nmgs/util/OcrUtil.java
new file mode 100644
index 0000000..40bf194
--- /dev/null
+++ b/src/main/java/com/nmgs/util/OcrUtil.java
@@ -0,0 +1,176 @@
+package com.nmgs.util;
+
+import com.alibaba.fastjson.JSONObject;
+import com.aliyun.ocr_api20210707.models.RecognizeAllTextResponse;
+import com.aliyun.ocr_api20210707.models.RecognizeAllTextResponseBody;
+import com.aliyun.tea.TeaException;
+import com.aliyun.teautil.Common;
+import com.google.gson.internal.LinkedTreeMap;
+
+import java.util.Date;
+import java.util.List;
+
+public class OcrUtil {
+ public static com.aliyun.ocr_api20210707.Client createClient() throws Exception {
+ com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
+ // 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。
+ //.setAccessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
+ .setAccessKeyId("LTAI5t7qiwNZSMADaRUPHa6z")
+ // 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。
+ // .setAccessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"));
+ .setAccessKeySecret("yffcCbgV7Jl6QoeVYoLY7dpTMsecfo");
+ // 默认公网接入地址为"ocr-api.cn-hangzhou.aliyuncs.com",若您需要使用vpc域名访问,请确保您的ecs建立在杭州region,vpc接入地址为"ocr-api-vpc.cn-hangzhou.aliyuncs.com"
+ config.endpoint = "ocr-api.cn-hangzhou.aliyuncs.com";
+ return new com.aliyun.ocr_api20210707.Client(config);
+ }
+
+ /**
+ * 这个是同步接口
+ *
+ * @param picUrl
+ * @param ocrType
+ * @return
+ * @throws Exception
+ */
+ public static JSONObject getAllText(String picUrl, String ocrType) {
+ long starttime = new Date().getTime();
+ JSONObject retJson = new JSONObject();
+ try {
+ com.aliyun.ocr_api20210707.Client client = OcrUtil.createClient();
+ com.aliyun.ocr_api20210707.models.RecognizeAllTextRequest recognizeAllTextRequest = new com.aliyun.ocr_api20210707.models.RecognizeAllTextRequest()
+ .setUrl(picUrl)
+ .setType(ocrType);
+ com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
+ if (PubTools.isNull(picUrl)) {
+ retJson.put("status", "error");
+ retJson.put("data", "图片未找到");
+ }
+ RecognizeAllTextResponse resp = client.recognizeAllTextWithOptions(recognizeAllTextRequest, runtime);
+ RecognizeAllTextResponseBody.RecognizeAllTextResponseBodyData data = resp.body.data;
+ List subImages = data.getSubImages();
+ /*String jsonString = Common.toJSONString(resp.body.data);
+ JSONObject parse = (JSONObject) JSONObject.parse(jsonString);*/
+ Object data1 = subImages.get(0).getKvInfo().data;
+ JSONObject obj = null;
+ switch (ocrType) {
+ case "IdCard"://身份证识别
+ obj = getDataByIdcard((LinkedTreeMap) data1);
+ break;
+ case "DrivingLicense"://驾驶证识别
+ obj = getDataByDrivingLicense((LinkedTreeMap) data1);
+ break;
+ case "VehicleLicense"://行驶证识别
+ obj = getDataByVehicleLicense((LinkedTreeMap) data1);
+ break;
+ }
+ long endtime = new Date().getTime();
+ System.out.println("OCR识别用时====" + (endtime - starttime));
+ retJson.put("status", "success");
+ retJson.put("data", obj);
+ } catch (TeaException error) {
+ LogUtil.WriteLog_Error("TeaException:===>picUrl:{" + picUrl + "}===type:{" + ocrType + "}====>" + error.message, "OcrUtil");
+ retJson.put("status", "error");
+ retJson.put("data", "图片错误");
+ System.out.println("TeaException==========>" + error.getMessage());
+ // System.out.println("Recommend=====>" + error.getData().get("Recommend"));
+ // com.aliyun.teautil.Common.assertAsString(error.message);
+ } catch (Exception _error) {
+ TeaException error = new TeaException(_error.getMessage(), _error);
+ LogUtil.WriteLog_Error("TeaException(_error):===>picUrl:{" + picUrl + "}===type:{" + ocrType + "}====>" + error.message, "OcrUtil");
+ retJson.put("status", "error");
+ retJson.put("data", "图片错误");
+ System.out.println("Exception==========>" + error.getMessage());
+ }
+ return retJson;
+ }
+
+ //身份证解析
+ private static JSONObject getDataByIdcard(LinkedTreeMap resp) {
+ JSONObject jsonStr = new JSONObject();
+ //姓名
+ String name = PubTools.isEmpty(resp.get("name")) ? "" : resp.get("name").toString();
+ //住址
+ String address = PubTools.isEmpty(resp.get("address")) ? "" : resp.get("address").toString();
+ //民族
+ String ethnicity = PubTools.isEmpty(resp.get("ethnicity")) ? "" : resp.get("ethnicity").toString();
+ //性别
+ String sex = PubTools.isEmpty(resp.get("sex")) ? "" : resp.get("sex").toString();
+ //身份证号
+ String idNumber = PubTools.isEmpty(resp.get("idNumber")) ? "" : resp.get("idNumber").toString();
+ //出生日期
+ String birthDate = PubTools.isEmpty(resp.get("birthDate")) ? "" : resp.get("birthDate").toString();
+ jsonStr.put("name", name);
+ jsonStr.put("address", address);
+ jsonStr.put("ethnicity", ethnicity);
+ jsonStr.put("sex", sex);
+ jsonStr.put("idNumber", idNumber);
+ jsonStr.put("birthDate", birthDate);
+ return jsonStr;
+ }
+
+ //驾驶证解析
+ private static JSONObject getDataByDrivingLicense(LinkedTreeMap resp) {
+ JSONObject jsonStr = new JSONObject();
+ Integer subImageCount = (Integer) resp.get("subImageCount");
+ //住址
+ String address = PubTools.isEmpty(resp.get("address")) ? "" : resp.get("address").toString();
+ //民族
+ String ethnicity = PubTools.isEmpty(resp.get("ethnicity")) ? "" : resp.get("ethnicity").toString();
+ //性别
+ String sex = PubTools.isEmpty(resp.get("sex")) ? "" : resp.get("sex").toString();
+ //身份证号
+ String idNumber = PubTools.isEmpty(resp.get("licenseNumber")) ? "" : resp.get("licenseNumber").toString();
+ //出生日期
+ String birthDate = PubTools.isEmpty(resp.get("birthDate")) ? "" : resp.get("birthDate").toString();
+ //国籍
+ String nationality = PubTools.isEmpty(resp.get("nationality")) ? "" : resp.get("nationality").toString();
+ //初次领证日期
+ String initialIssueDate = PubTools.isEmpty(resp.get("initialIssueDate")) ? "" : resp.get("initialIssueDate").toString();
+ //准驾类型
+ String approvedType = PubTools.isEmpty(resp.get("approvedType")) ? "" : resp.get("approvedType").toString();
+ //发证单位
+ String issueAuthority = PubTools.isEmpty(resp.get("issueAuthority")) ? "" : resp.get("issueAuthority").toString();
+ //有效起始日期
+ String validFromDate = PubTools.isEmpty(resp.get("validFromDate")) ? "" : resp.get("validFromDate").toString();
+ //有效期限
+ String validPeriod = PubTools.isEmpty(resp.get("validPeriod")) ? "" : resp.get("validPeriod").toString();
+ jsonStr.put("address", address);
+ jsonStr.put("ethnicity", ethnicity);
+ jsonStr.put("sex", sex);
+ jsonStr.put("idNumber", idNumber);
+ jsonStr.put("nationality", nationality);
+ jsonStr.put("initialIssueDate", initialIssueDate);
+ jsonStr.put("approvedType", approvedType);
+ jsonStr.put("issueAuthority", issueAuthority);
+ jsonStr.put("validFromDate", validFromDate);
+ jsonStr.put("validPeriod", validPeriod);
+ return jsonStr;
+ }
+
+ //行驶证
+ private static JSONObject getDataByVehicleLicense(LinkedTreeMap resp) {
+ JSONObject jsonStr = new JSONObject();
+ //住址
+ String address = PubTools.isEmpty(resp.get("address")) ? "" : resp.get("address").toString();
+ //发证日期
+ String ethnicity = PubTools.isEmpty(resp.get("issueDate")) ? "" : resp.get("issueDate").toString();
+ //性别
+ String owner = PubTools.isEmpty(resp.get("owner")) ? "" : resp.get("owner").toString();
+ jsonStr.put("address", address);
+ jsonStr.put("ethnicity", ethnicity);
+ jsonStr.put("name", owner);
+ return jsonStr;
+ }
+
+ public static void main(String[] args_) throws Exception {
+ //String picUrl = "https://img.alicdn.com/tfs/TB1q5IeXAvoK1RjSZFNXXcxMVXa-483-307.jpg";
+ //String picUrl = "https://zhyw.nmgjtjt.com:9500/integralFile/20241204/029b1231163340f28b317cf158ec4f3dNUMPIC.jpg";
+ //String picUrl = "https://zhyw.nmgjtjt.com:9500/integralFile/20250324/3a12bfa8f49045d7be3242ae91bdd079NUMPIC.jpg";
+ //String ocrType = "IdCard";
+ String picUrl = "https://zhyw.nmgjtjt.com:9500/integralFile/20250324/12345678.jpg";
+
+ String ocrType = "DrivingLicense";
+ JSONObject allText = getAllText(picUrl, ocrType);
+ System.out.println(JSONObject.toJSONString(allText));
+ }
+}
diff --git a/src/main/java/com/nmgs/util/PubTools.java b/src/main/java/com/nmgs/util/PubTools.java
index 43a7506..130da7c 100644
--- a/src/main/java/com/nmgs/util/PubTools.java
+++ b/src/main/java/com/nmgs/util/PubTools.java
@@ -3,6 +3,7 @@ package com.nmgs.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import oracle.sql.CLOB;
+import org.springframework.jdbc.core.JdbcTemplate;
import java.io.File;
import java.lang.reflect.Array;
@@ -21,6 +22,7 @@ public class PubTools {
static SimpleDateFormat dfYYD=new SimpleDateFormat("yyyy-MM-dd");
static SimpleDateFormat dfYMD = new SimpleDateFormat("yyyyMMdd");
+ public static JdbcTemplate jdbcTemplate = null;
public static String HTTPS = PropertiesUtil.getValue("domainInteger") + File.separator;
/**
@@ -120,14 +122,18 @@ public class PubTools {
* @param diffType 差值类型(D 天数 ,S 秒数,H 小时,M 分钟)
* @return
*/
- public static Long dateDiff(String startTime,String endTime,String diffType) throws ParseException {
+ public static Long dateDiff(String startTime,String endTime,String diffType) {
long nd = 1000 * 24 * 60 * 60; //一天的毫秒数
long nh = 1000 * 60 * 60;//一小时的毫秒数据
long nm = 1000 * 60; //一分钟毫秒数
long ns = 1000;
- long diff;
+ long diff=0;
//获得两个时间的毫秒时间差异
- diff = df.parse(endTime).getTime() - df.parse(startTime).getTime();
+ try{
+ diff = df.parse(endTime).getTime() - df.parse(startTime).getTime();
+ }catch (Exception e){
+ e.printStackTrace();
+ }
// 计算差多少天
long day = diff / nd;
// 计算差多少小时
diff --git a/src/main/java/com/nmgs/util/main.java b/src/main/java/com/nmgs/util/main.java
index e86c583..7e604c9 100644
--- a/src/main/java/com/nmgs/util/main.java
+++ b/src/main/java/com/nmgs/util/main.java
@@ -79,7 +79,7 @@ public class main {
// System.out.println(Long.parseLong(memo,16));
System.out.println(PassWordUtils.encrypt("2zhLmcL"));
System.out.println(PassWordUtils.encrypt("123456"));
- System.out.println(PassWordUtils.decrypt("am5odi5AdTBvdGVIdEI3aHNyYms8ZD1C"));
+ System.out.println(PassWordUtils.decrypt("VHo1LVhrejBoRTtKgFp0TWVtcDxndXRx"));
// System.out.println(" 蒙K972X3 ".replace(" ","").trim());
// String str = "蒙蒙蒙蒙123456625";
// System.out.println(CRCUtil.CRC_AddData(10L,str));
diff --git a/src/main/resources/static/application.properties b/src/main/resources/static/application.properties
index 64c4b31..00434c2 100644
--- a/src/main/resources/static/application.properties
+++ b/src/main/resources/static/application.properties
@@ -11,17 +11,42 @@ server.servlet.encoding.force=true
spring.messages.encoding=UTF-8
spring.profiles.active=dev
# ?????
-spring.datasource.hikari.maximum-pool-size=100
-spring.datasource.hikari.auto-commit=true
-spring.datasource.hikari.idle-timeout=300000
-spring.datasource.hikari.pool-name=DatebookHikariCP
-spring.datasource.hikari.max-lifetime=600000
-spring.datasource.hikari.connection-timeout=600000
-spring.datasource.hikari.minimum-idle=5
-spring.datasource.hikari.allow-pool-suspension=true
-spring.datasource.hikari.register-mbeans=true
-spring.datasource.hikari.leak-detection-threshold=600000
-#??HikariCP??
+spring.datasource.main.hikari.maximum-pool-size=100
+spring.datasource.main.hikari.auto-commit=true
+spring.datasource.main.hikari.idle-timeout=300000
+spring.datasource.main.hikari.pool-name=DatebookHikariCP
+spring.datasource.main.hikari.max-lifetime=600000
+spring.datasource.main.hikari.connection-timeout=600000
+spring.datasource.main.hikari.minimum-idle=15
+spring.datasource.main.hikari.allow-pool-suspension=true
+spring.datasource.main.hikari.register-mbeans=true
+spring.datasource.main.hikari.leak-detection-threshold=300000
+spring.datasource.primary.hikari.maximum-pool-size=100
+spring.datasource.primary.hikari.auto-commit=true
+spring.datasource.primary.hikari.idle-timeout=300000
+spring.datasource.primary.hikari.pool-name=DatebookHikariCP
+spring.datasource.primary.hikari.max-lifetime=600000
+spring.datasource.primary.hikari.connection-timeout=600000
+spring.datasource.primary.hikari.minimum-idle=15
+spring.datasource.primary.hikari.allow-pool-suspension=true
+spring.datasource.primary.hikari.register-mbeans=true
+spring.datasource.primary.hikari.leak-detection-threshold=300000
+spring.datasource.bak.hikari.maximum-pool-size=100
+spring.datasource.bak.hikari.auto-commit=true
+spring.datasource.bak.hikari.idle-timeout=300000
+spring.datasource.bak.hikari.pool-name=DatebookHikariCP
+spring.datasource.bak.hikari.max-lifetime=600000
+spring.datasource.bak.hikari.connection-timeout=600000
+spring.datasource.bak.hikari.minimum-idle=15
+spring.datasource.bak.hikari.allow-pool-suspension=true
+spring.datasource.bak.hikari.register-mbeans=true
+spring.datasource.bak.hikari.leak-detection-threshold=300000
+
+
+
+
+
+
logging.level.com.zaxxer.hikari=DEBUG
spring.devtools.restart.enabled=true
spring.devtools.restart.additional-paths=src/main
@@ -72,4 +97,8 @@ MySQLvalidationQuery=SELECT 1
spring.web.resources.static-locations= classpath:/static/View/
Downfilepth= classpath:/static/tt.txt
-
+#??jta????
+spring.jta.enabled=true
+spring.jta.transaction-manager-id=integralManager
+spring.jta.log-dir=classpath:/static/View/logs
+spring.jta.atomikos.properties.log-base-name=IntegralManager.log