From 9cfc3b853c62bfe40fb6fd854c2c275ee9dbb3ba Mon Sep 17 00:00:00 2001
From: sangchengzhi <2305486879@qq.com>
Date: Wed, 4 Mar 2026 16:23:41 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=A1=E9=AA=8C=E7=94=A8?=
=?UTF-8?q?=E6=88=B7=E5=B0=B1=E8=AF=8A=E5=8D=A1=E4=BF=A1=E6=81=AF=E5=88=87?=
=?UTF-8?q?=E9=9D=A2=E7=B1=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/MarsCodeWorkspaceAppSettings.xml | 4 ++--
guahao.iml | 4 ++--
.../h5/hsjc/controller/HsjcController.java | 3 +++
.../reserve/controller/ReserveController.java | 2 +-
.../guahao/h5/user/mapper/UserCardMapper.java | 2 +-
.../h5/user/service/UserCardService.java | 14 ++++++++++++
.../guahao/h5/user/service/UserService.java | 22 +++++++++++++++++++
.../guahao/h5/yb/controller/YbController.java | 7 +++---
.../mybatis/mapper/user/UserCardMapper.xml | 5 +++--
9 files changed, 52 insertions(+), 11 deletions(-)
diff --git a/.idea/MarsCodeWorkspaceAppSettings.xml b/.idea/MarsCodeWorkspaceAppSettings.xml
index 6a2df49..9e5ec93 100644
--- a/.idea/MarsCodeWorkspaceAppSettings.xml
+++ b/.idea/MarsCodeWorkspaceAppSettings.xml
@@ -1,7 +1,7 @@
-
-
+
+
\ No newline at end of file
diff --git a/guahao.iml b/guahao.iml
index 8139851..ce25a09 100644
--- a/guahao.iml
+++ b/guahao.iml
@@ -7,10 +7,10 @@
-
+
diff --git a/src/main/java/com/guahao/h5/hsjc/controller/HsjcController.java b/src/main/java/com/guahao/h5/hsjc/controller/HsjcController.java
index 15f5c50..c9282dc 100644
--- a/src/main/java/com/guahao/h5/hsjc/controller/HsjcController.java
+++ b/src/main/java/com/guahao/h5/hsjc/controller/HsjcController.java
@@ -6,8 +6,10 @@ import com.guahao.WebLog;
import com.guahao.api.counts.model.InterfaceCount;
import com.guahao.api.counts.service.InterfaceCountService;
// import com.guahao.api.walkinto.service.PayService;
+import com.guahao.common.annotation.CheckPatientId;
import com.guahao.common.response.ErrorCode;
import com.guahao.common.response.ResponseResult;
+import com.guahao.common.util.SafeUtil;
import com.guahao.common.util.XmlUtil;
import com.guahao.h5.hsjc.mapper.HsjcMapper;
import com.guahao.h5.hsjc.service.HsjcService;
@@ -63,6 +65,7 @@ public class HsjcController {
@RequestMapping("/opPacscx")
@WebLog(description = "opPacscx")
+
public Object opPacscx(Integer userId, String token,
String QueryCode, Integer QueryType, String StartTime, String EndTime) {
diff --git a/src/main/java/com/guahao/h5/reserve/controller/ReserveController.java b/src/main/java/com/guahao/h5/reserve/controller/ReserveController.java
index de78abc..a8cb32b 100644
--- a/src/main/java/com/guahao/h5/reserve/controller/ReserveController.java
+++ b/src/main/java/com/guahao/h5/reserve/controller/ReserveController.java
@@ -174,8 +174,8 @@ public class ReserveController {
*/
@RequestMapping(value = "/opBillsPayedRefund", method = RequestMethod.POST)
@WebLog(description = "opBillsPayedRefund")
-// 移除了 @Transactional(rollbackFor = Exception.class) 注解,取消事务控制
public Object opBillsPayedRefund(HisRefundVo vo) {
+ //可改造成callable多线程,返回结果判断,加快速度
try {
log.info("退费vo: {}", vo);
// 1. 执行退号
diff --git a/src/main/java/com/guahao/h5/user/mapper/UserCardMapper.java b/src/main/java/com/guahao/h5/user/mapper/UserCardMapper.java
index f6ca388..b2cfbd3 100644
--- a/src/main/java/com/guahao/h5/user/mapper/UserCardMapper.java
+++ b/src/main/java/com/guahao/h5/user/mapper/UserCardMapper.java
@@ -53,5 +53,5 @@ public interface UserCardMapper extends BaseMapper {
List selectByPatientId(@Param("patientId") String patientId);
- List selectByUserId(Integer uid);
+ List selectByUserId(Integer userId);
}
diff --git a/src/main/java/com/guahao/h5/user/service/UserCardService.java b/src/main/java/com/guahao/h5/user/service/UserCardService.java
index 9422a2d..be36e9e 100644
--- a/src/main/java/com/guahao/h5/user/service/UserCardService.java
+++ b/src/main/java/com/guahao/h5/user/service/UserCardService.java
@@ -1,11 +1,13 @@
package com.guahao.h5.user.service;
import com.guahao.common.Exception.LogicException;
+import com.guahao.common.util.SafeUtil;
import com.guahao.common.util.SoapUtil;
import com.guahao.common.util.XmlUtil;
import com.guahao.h5.message.service.MessageCenterService;
import com.guahao.h5.message.vo.MessageCenterVo;
import com.guahao.h5.user.mapper.UserCardMapper;
+import com.guahao.h5.user.model.UserCard;
import com.guahao.h5.user.model.UserCardVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -26,6 +28,8 @@ public class UserCardService {
@Autowired
private MessageCenterService messageCenterService;
+ @Autowired
+ private SafeUtil safeUtil;
/**
* 查询本地所有就诊卡
@@ -67,6 +71,8 @@ public class UserCardService {
*/
public int queryUserCard(UserCardVo vo) throws Exception {
int resultInt = 0;
+ // 清除该用户的缓存,确保下次查询能拿到最新数据
+ safeUtil.clearUserCardCache(vo.getUserId());
log.info("开始执行查询queryUserCard");
//isModify 0 -- 查询 1 -- 修改
if (vo.getIsModify().equals("0")) {
@@ -246,6 +252,8 @@ public class UserCardService {
*/
public int insertUserCard(UserCardVo vo) throws Exception {
int resultInt = 0;
+ // 清除该用户的缓存,确保下次查询能拿到最新数据
+ safeUtil.clearUserCardCache(vo.getUserId());
if (vo.getId() == null) {
resultInt = userCardMapper.selectCardCount(vo);
if (resultInt != 0) {
@@ -340,6 +348,12 @@ public class UserCardService {
* 删除就诊卡
*/
public int deleteUserCard(Integer userId,Integer id) throws Exception {
+ // 清除该用户的缓存,确保下次查询能拿到最新数据
+ safeUtil.clearUserCardCache(userId);
return userCardMapper.deleteUserCard(userId,id);
}
+
+ public List selectByUserId(Integer userId) {
+ return userCardMapper.selectByUserId(userId);
+ }
}
diff --git a/src/main/java/com/guahao/h5/user/service/UserService.java b/src/main/java/com/guahao/h5/user/service/UserService.java
index cecca5b..7dda7ef 100644
--- a/src/main/java/com/guahao/h5/user/service/UserService.java
+++ b/src/main/java/com/guahao/h5/user/service/UserService.java
@@ -6,6 +6,7 @@ import com.guahao.common.Exception.LogicException;
import com.guahao.common.util.MD5Util;
import com.guahao.common.util.VeDate;
import com.guahao.h5.user.mapper.UserMapper;
+import com.guahao.h5.user.model.UserCard;
import com.guahao.h5.user.model.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -197,4 +198,25 @@ public class UserService {
}
return userMapper.isBlack(userId);
}
+ public Boolean hasUser(Integer userId, String patientId) {
+ //判断该id下是否有绑定所查的用户信息
+ List list = userCardService.selectByUserId(userId);
+
+ if (list == null || list.isEmpty()) {
+ return false;
+ }
+
+ // 检查用户是否绑定了特定的就诊卡号
+ for (UserCard userCard : list) {
+ if (patientId.equals(userCard.getCard_no())) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public List queryUserCardsByUserId(Integer userId) {
+ return userCardService.selectByUserId(userId);
+ }
}
diff --git a/src/main/java/com/guahao/h5/yb/controller/YbController.java b/src/main/java/com/guahao/h5/yb/controller/YbController.java
index dea7bdb..294ccd8 100644
--- a/src/main/java/com/guahao/h5/yb/controller/YbController.java
+++ b/src/main/java/com/guahao/h5/yb/controller/YbController.java
@@ -13,6 +13,7 @@ import com.guahao.h5.token.service.TokenService;
import com.guahao.h5.token.vo.TokenVo;
import com.guahao.h5.user.mapper.UserCardMapper;
import com.guahao.h5.user.mapper.UserMapper;
+import com.guahao.h5.user.model.UserCard;
import com.guahao.h5.user.model.UserCardVo;
import com.guahao.h5.user.model.UserVo;
import com.guahao.h5.user.service.UserService;
@@ -98,10 +99,10 @@ public class YbController {
String json = ybService.getPayAuthCode(qrcode,openid);
JSONObject jsonObject1 = JSON.parseObject(json);
String payAuthNo = jsonObject1.getString("pay_auth_no");
- List cardList = userCardMapper.selectByUserId(uid);
+ List cardList = userCardMapper.selectByUserId(uid);
if (cardList.size() > 0){
- cardList.forEach(cardNo -> {
- hsjcMapper.updatePayAuthNoList(payAuthNo,cardNo);
+ cardList.forEach(vo -> {
+ hsjcMapper.updatePayAuthNoList(payAuthNo,vo.getCard_no());
});
}
IDVO vo =userCardMapper.queryUserCardDefaltByOpenid(openid);
diff --git a/src/main/resources/mybatis/mapper/user/UserCardMapper.xml b/src/main/resources/mybatis/mapper/user/UserCardMapper.xml
index b7d871d..5c62dd3 100644
--- a/src/main/resources/mybatis/mapper/user/UserCardMapper.xml
+++ b/src/main/resources/mybatis/mapper/user/UserCardMapper.xml
@@ -151,8 +151,9 @@
-