新增校验用户就诊卡信息切面类

This commit is contained in:
sangchengzhi
2026-03-04 16:23:41 +08:00
parent 7afc484640
commit 9cfc3b853c
9 changed files with 52 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="com.codeverse.userSettings.MarscodeWorkspaceAppSettingsState"> <component name="com.codeverse.userSettings.MarscodeWorkspaceAppSettingsState">
<option name="ckgOperationStatus" value="SUCCESS" /> <option name="ckgOperationStatus" value="DELETE" />
<option name="progress" value="0.9927478" /> <option name="lastCKGNotifyTime" value="1770603565559" />
</component> </component>
</project> </project>

View File

@@ -7,10 +7,10 @@
<map> <map>
<entry key="com.zeroturnaround.jrebel.FormatVersion" value="7.0.0" /> <entry key="com.zeroturnaround.jrebel.FormatVersion" value="7.0.0" />
<entry key="jrebelEnabled" value="true" /> <entry key="jrebelEnabled" value="true" />
<entry key="lastExternalPluginCheckTime" value="1760511839624" /> <entry key="lastExternalPluginCheckTime" value="1770600825542" />
</map> </map>
</option> </option>
<option name="version" value="11" /> <option name="version" value="15" />
</configuration> </configuration>
</facet> </facet>
</component> </component>

View File

@@ -6,8 +6,10 @@ import com.guahao.WebLog;
import com.guahao.api.counts.model.InterfaceCount; import com.guahao.api.counts.model.InterfaceCount;
import com.guahao.api.counts.service.InterfaceCountService; import com.guahao.api.counts.service.InterfaceCountService;
// import com.guahao.api.walkinto.service.PayService; // import com.guahao.api.walkinto.service.PayService;
import com.guahao.common.annotation.CheckPatientId;
import com.guahao.common.response.ErrorCode; import com.guahao.common.response.ErrorCode;
import com.guahao.common.response.ResponseResult; import com.guahao.common.response.ResponseResult;
import com.guahao.common.util.SafeUtil;
import com.guahao.common.util.XmlUtil; import com.guahao.common.util.XmlUtil;
import com.guahao.h5.hsjc.mapper.HsjcMapper; import com.guahao.h5.hsjc.mapper.HsjcMapper;
import com.guahao.h5.hsjc.service.HsjcService; import com.guahao.h5.hsjc.service.HsjcService;
@@ -63,6 +65,7 @@ public class HsjcController {
@RequestMapping("/opPacscx") @RequestMapping("/opPacscx")
@WebLog(description = "opPacscx") @WebLog(description = "opPacscx")
public Object opPacscx(Integer userId, String token, public Object opPacscx(Integer userId, String token,
String QueryCode, Integer QueryType, String StartTime, String EndTime) { String QueryCode, Integer QueryType, String StartTime, String EndTime) {

View File

@@ -174,8 +174,8 @@ public class ReserveController {
*/ */
@RequestMapping(value = "/opBillsPayedRefund", method = RequestMethod.POST) @RequestMapping(value = "/opBillsPayedRefund", method = RequestMethod.POST)
@WebLog(description = "opBillsPayedRefund") @WebLog(description = "opBillsPayedRefund")
// 移除了 @Transactional(rollbackFor = Exception.class) 注解,取消事务控制
public Object opBillsPayedRefund(HisRefundVo vo) { public Object opBillsPayedRefund(HisRefundVo vo) {
//可改造成callable多线程返回结果判断加快速度
try { try {
log.info("退费vo: {}", vo); log.info("退费vo: {}", vo);
// 1. 执行退号 // 1. 执行退号

View File

@@ -53,5 +53,5 @@ public interface UserCardMapper extends BaseMapper<UserCard> {
List<UserCardVo> selectByPatientId(@Param("patientId") String patientId); List<UserCardVo> selectByPatientId(@Param("patientId") String patientId);
List<String> selectByUserId(Integer uid); List<UserCard> selectByUserId(Integer userId);
} }

View File

@@ -1,11 +1,13 @@
package com.guahao.h5.user.service; package com.guahao.h5.user.service;
import com.guahao.common.Exception.LogicException; import com.guahao.common.Exception.LogicException;
import com.guahao.common.util.SafeUtil;
import com.guahao.common.util.SoapUtil; import com.guahao.common.util.SoapUtil;
import com.guahao.common.util.XmlUtil; import com.guahao.common.util.XmlUtil;
import com.guahao.h5.message.service.MessageCenterService; import com.guahao.h5.message.service.MessageCenterService;
import com.guahao.h5.message.vo.MessageCenterVo; import com.guahao.h5.message.vo.MessageCenterVo;
import com.guahao.h5.user.mapper.UserCardMapper; import com.guahao.h5.user.mapper.UserCardMapper;
import com.guahao.h5.user.model.UserCard;
import com.guahao.h5.user.model.UserCardVo; import com.guahao.h5.user.model.UserCardVo;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -26,6 +28,8 @@ public class UserCardService {
@Autowired @Autowired
private MessageCenterService messageCenterService; private MessageCenterService messageCenterService;
@Autowired
private SafeUtil safeUtil;
/** /**
* 查询本地所有就诊卡 * 查询本地所有就诊卡
@@ -67,6 +71,8 @@ public class UserCardService {
*/ */
public int queryUserCard(UserCardVo vo) throws Exception { public int queryUserCard(UserCardVo vo) throws Exception {
int resultInt = 0; int resultInt = 0;
// 清除该用户的缓存,确保下次查询能拿到最新数据
safeUtil.clearUserCardCache(vo.getUserId());
log.info("开始执行查询queryUserCard"); log.info("开始执行查询queryUserCard");
//isModify 0 -- 查询 1 -- 修改 //isModify 0 -- 查询 1 -- 修改
if (vo.getIsModify().equals("0")) { if (vo.getIsModify().equals("0")) {
@@ -246,6 +252,8 @@ public class UserCardService {
*/ */
public int insertUserCard(UserCardVo vo) throws Exception { public int insertUserCard(UserCardVo vo) throws Exception {
int resultInt = 0; int resultInt = 0;
// 清除该用户的缓存,确保下次查询能拿到最新数据
safeUtil.clearUserCardCache(vo.getUserId());
if (vo.getId() == null) { if (vo.getId() == null) {
resultInt = userCardMapper.selectCardCount(vo); resultInt = userCardMapper.selectCardCount(vo);
if (resultInt != 0) { if (resultInt != 0) {
@@ -340,6 +348,12 @@ public class UserCardService {
* 删除就诊卡 * 删除就诊卡
*/ */
public int deleteUserCard(Integer userId,Integer id) throws Exception { public int deleteUserCard(Integer userId,Integer id) throws Exception {
// 清除该用户的缓存,确保下次查询能拿到最新数据
safeUtil.clearUserCardCache(userId);
return userCardMapper.deleteUserCard(userId,id); return userCardMapper.deleteUserCard(userId,id);
} }
public List<UserCard> selectByUserId(Integer userId) {
return userCardMapper.selectByUserId(userId);
}
} }

View File

@@ -6,6 +6,7 @@ import com.guahao.common.Exception.LogicException;
import com.guahao.common.util.MD5Util; import com.guahao.common.util.MD5Util;
import com.guahao.common.util.VeDate; import com.guahao.common.util.VeDate;
import com.guahao.h5.user.mapper.UserMapper; import com.guahao.h5.user.mapper.UserMapper;
import com.guahao.h5.user.model.UserCard;
import com.guahao.h5.user.model.UserVo; import com.guahao.h5.user.model.UserVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -197,4 +198,25 @@ public class UserService {
} }
return userMapper.isBlack(userId); return userMapper.isBlack(userId);
} }
public Boolean hasUser(Integer userId, String patientId) {
//判断该id下是否有绑定所查的用户信息
List<UserCard> 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<UserCard> queryUserCardsByUserId(Integer userId) {
return userCardService.selectByUserId(userId);
}
} }

View File

@@ -13,6 +13,7 @@ import com.guahao.h5.token.service.TokenService;
import com.guahao.h5.token.vo.TokenVo; import com.guahao.h5.token.vo.TokenVo;
import com.guahao.h5.user.mapper.UserCardMapper; import com.guahao.h5.user.mapper.UserCardMapper;
import com.guahao.h5.user.mapper.UserMapper; 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.UserCardVo;
import com.guahao.h5.user.model.UserVo; import com.guahao.h5.user.model.UserVo;
import com.guahao.h5.user.service.UserService; import com.guahao.h5.user.service.UserService;
@@ -98,10 +99,10 @@ public class YbController {
String json = ybService.getPayAuthCode(qrcode,openid); String json = ybService.getPayAuthCode(qrcode,openid);
JSONObject jsonObject1 = JSON.parseObject(json); JSONObject jsonObject1 = JSON.parseObject(json);
String payAuthNo = jsonObject1.getString("pay_auth_no"); String payAuthNo = jsonObject1.getString("pay_auth_no");
List<String> cardList = userCardMapper.selectByUserId(uid); List<UserCard> cardList = userCardMapper.selectByUserId(uid);
if (cardList.size() > 0){ if (cardList.size() > 0){
cardList.forEach(cardNo -> { cardList.forEach(vo -> {
hsjcMapper.updatePayAuthNoList(payAuthNo,cardNo); hsjcMapper.updatePayAuthNoList(payAuthNo,vo.getCard_no());
}); });
} }
IDVO vo =userCardMapper.queryUserCardDefaltByOpenid(openid); IDVO vo =userCardMapper.queryUserCardDefaltByOpenid(openid);

View File

@@ -151,8 +151,9 @@
<select id="selectByPatientId" resultType="com.guahao.h5.user.model.UserCardVo"> <select id="selectByPatientId" resultType="com.guahao.h5.user.model.UserCardVo">
select * from user_card where patient_id = #{patientId} AND deleted = 0 select * from user_card where patient_id = #{patientId} AND deleted = 0
</select> </select>
<select id="selectByUserId" resultType="java.lang.String">
select card_no from user_card where user_id = #{uid} AND deleted = 0 <select id="selectByUserId" resultType="com.guahao.h5.user.model.UserCard">
select * from user_card where user_id = #{userId} AND deleted = 0
</select> </select>
<!--新增就诊卡--> <!--新增就诊卡-->