From e01421ab2e9cd7b2f089d80c4f9ec460f2c7632a Mon Sep 17 00:00:00 2001
From: huangqizhen <15552608129@163.com>
Date: Tue, 11 Nov 2025 15:50:00 +0800
Subject: [PATCH] =?UTF-8?q?11.11=20=E4=BF=AE=E6=94=B9=E6=89=A7=E8=A1=8C?=
=?UTF-8?q?=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/example/demo/Mysql/MysqlServiceImpl.java | 9 +++++----
.../com/example/demo/security/SecurityConfig.java | 2 +-
.../resources/cashMapper/CashCollectionMapper.xml | 12 ++++++++----
src/main/resources/cashMapper/CashRefundMapper.xml | 12 ++++++++----
src/main/resources/mapper/AuditMapper.xml | 21 ++++++++++++++-------
src/main/resources/mapper/MarketMapper.xml | 13 +++++++++----
6 files changed, 45 insertions(+), 24 deletions(-)
diff --git a/src/main/java/com/example/demo/Mysql/MysqlServiceImpl.java b/src/main/java/com/example/demo/Mysql/MysqlServiceImpl.java
index bef5b69..d9f7aa1 100644
--- a/src/main/java/com/example/demo/Mysql/MysqlServiceImpl.java
+++ b/src/main/java/com/example/demo/Mysql/MysqlServiceImpl.java
@@ -26,6 +26,7 @@ import java.time.LocalDateTime;
import java.time.Month;
import java.time.format.DateTimeFormatter;
import java.util.*;
+import java.util.Date;
@Service
@@ -64,7 +65,7 @@ public class MysqlServiceImpl implements MysqlService {
@Override
- @Transactional(transactionManager = "mysqlTransactionManager") // 👈 保证插入和用户更新在一个事务
+ @Transactional(transactionManager = "mysqlTransactionManager",rollbackFor = Exception.class) // 👈 保证插入和用户更新在一个事务
public void getSqlserverData() throws Exception {
logger.info("开始从 SQL Server 同步数据到 MySQL");
@@ -357,7 +358,7 @@ public class MysqlServiceImpl implements MysqlService {
if (validZeroTypes.contains(data.gtype)) {
stmt.setInt(13, 0);
- stmt.setNull(20, 0);
+ stmt.setInt(20, 0);
stmt.setString(1, "ERPCZ_" + data.orderNumber);
} else if (validOneTypes.contains(data.gtype)) {
stmt.setInt(13, 1);
@@ -415,8 +416,8 @@ public class MysqlServiceImpl implements MysqlService {
} else {
stmt.setInt(17, 1);
}
-
- stmt.setTimestamp(18, data.cz_time);
+ Timestamp now = new Timestamp(System.currentTimeMillis());
+ stmt.setTimestamp(18, now);
stmt.setTimestamp(19, data.cz_time);
stmt.setString(21, data.uid);
}
diff --git a/src/main/java/com/example/demo/security/SecurityConfig.java b/src/main/java/com/example/demo/security/SecurityConfig.java
index 440eb38..3e6d045 100644
--- a/src/main/java/com/example/demo/security/SecurityConfig.java
+++ b/src/main/java/com/example/demo/security/SecurityConfig.java
@@ -60,7 +60,7 @@ public class SecurityConfig {
request
.requestMatchers( HttpMethod.POST,
// 用户不登录就可以访问的路径
- "/admin/login","/upload/**","/detailY/ERP","/home/java/haiwaiyanfa/gold1/**","/home/java/haiwaiyanfa/**","/statistics/**","/Mysql").permitAll()
+ "/admin/login","/upload/**","/detailY/ERP","/home/java/haiwaiyanfa/gold1/**","/home/java/haiwaiyanfa/**","/statistics/**","/Mysql/**").permitAll()
.requestMatchers(
"/error","alipay/**","/upload/**","/home/java/haiwaiyanfa/gold1/**","/home/java/haiwaiyanfa/**"
).permitAll()
diff --git a/src/main/resources/cashMapper/CashCollectionMapper.xml b/src/main/resources/cashMapper/CashCollectionMapper.xml
index beddb7e..0297002 100644
--- a/src/main/resources/cashMapper/CashCollectionMapper.xml
+++ b/src/main/resources/cashMapper/CashCollectionMapper.xml
@@ -265,9 +265,13 @@
left join admin a1 on cr.submitter_id = a1.id
left join admin a2 on cr.audit_id = a2.id
left join recharge_activity ra on ra.id = cr.activity
- where cr.id IN
-
- #{id}
-
+
+
+ cr.id IN
+
+ #{id}
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/cashMapper/CashRefundMapper.xml b/src/main/resources/cashMapper/CashRefundMapper.xml
index 8887167..8ae112d 100644
--- a/src/main/resources/cashMapper/CashRefundMapper.xml
+++ b/src/main/resources/cashMapper/CashRefundMapper.xml
@@ -380,10 +380,14 @@
\ No newline at end of file
diff --git a/src/main/resources/mapper/AuditMapper.xml b/src/main/resources/mapper/AuditMapper.xml
index 25cc1c4..1971aa2 100644
--- a/src/main/resources/mapper/AuditMapper.xml
+++ b/src/main/resources/mapper/AuditMapper.xml
@@ -169,13 +169,20 @@
select admin_name from admin where id = #{auditId}
-
+
update user set first_recharge = now() where jwcode = #{jwcode} and first_recharge is null
diff --git a/src/main/resources/mapper/MarketMapper.xml b/src/main/resources/mapper/MarketMapper.xml
index 496fe44..36f8994 100644
--- a/src/main/resources/mapper/MarketMapper.xml
+++ b/src/main/resources/mapper/MarketMapper.xml
@@ -39,9 +39,14 @@
select name from market where id=#{market}
\ No newline at end of file