1、医共体数据同步调整,新增字段检测本院数据上次同步时间,目前2小时检查一次。

2、子医院向主体医院请求数据同步进行相应调整,同样新增医共体id是否失效的检测机制。
3、新增字段记录解绑时间,修改绑定数据时,修改绑定时间,记录初次绑定时间
debug
王绍全 5 days ago
parent 5c35c12675
commit 6b06efe91b
  1. 27
      src/main/java/com/ynxbd/common/dao/PatientDao.java
  2. 10
      src/main/java/com/ynxbd/common/service/GMCService.java

@ -208,6 +208,15 @@ public class PatientDao {
}); });
} }
/**
* 查询所有未领取健康卡的用户信息民族电话不能为空,一次读取15条信息
*/
public List<Patient> selectPatient4BatchUpdateHealthCard() {
String sql = "select * from patientBase where HealthCardID is null and ifNull(idCardNo,'') <> '' " +
"and ifNull(nation,'') <> '' and ifNull(tel, '') <> '' and callFlag=0 LIMIT 15";
return DataBase.select(sql, Patient.class);
}
/** /**
* 根据身份证查询患者 * 根据身份证查询患者
@ -244,7 +253,7 @@ public class PatientDao {
return false; return false;
} }
String sql = "update patientBase set deletedState=0, updateTime=now(), healthCardId=?, name=?, nation=?, tel=?, address=?, uuid=?, areaCode=?, areaAddress=?, patientId=?, empiId=?, gmcBindState=?, gmcCheckTime=?, " + String sql = "update patientBase set deletedState=0, bindDate=now(), healthCardId=?, name=?, nation=?, tel=?, address=?, uuid=?, areaCode=?, areaAddress=?, patientId=?, empiId=?, gmcBindState=?, gmcCheckTime=?, " +
" uniqueId=if(uniqueId is null or uniqueId = '', ?, uniqueId), " + " uniqueId=if(uniqueId is null or uniqueId = '', ?, uniqueId), " +
" gmcUniqueId=if(gmcUniqueId is null or gmcUniqueId = '', ?, gmcUniqueId) " + " gmcUniqueId=if(gmcUniqueId is null or gmcUniqueId = '', ?, gmcUniqueId) " +
" where id=? and openid=? and idCardNo=?"; " where id=? and openid=? and idCardNo=?";
@ -294,8 +303,8 @@ public class PatientDao {
*/ */
public boolean insert(boolean isMyself, Patient bindData) { public boolean insert(boolean isMyself, Patient bindData) {
bindData.setIsMyself(isMyself); bindData.setIsMyself(isMyself);
String sql = "insert into patientBase(bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, address, areaCode, areaAddress, isMyself, cardType, unionId, uniqueId, empiId, gmcUniqueId, gmcBindState, gmcCheckTime) " + String sql = "insert into patientBase(createTime, bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, address, areaCode, areaAddress, isMyself, cardType, unionId, uniqueId, empiId, gmcUniqueId, gmcBindState, gmcCheckTime) " +
" values(now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; " values(now(), now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
return DataBase.insert(sql, ps -> { return DataBase.insert(sql, ps -> {
setInsertPs(ps, bindData); setInsertPs(ps, bindData);
@ -310,8 +319,8 @@ public class PatientDao {
* @return bool * @return bool
*/ */
public int insertBatch(List<Patient> dataList) { public int insertBatch(List<Patient> dataList) {
String sql = "insert into patientBase(bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, address, areaCode, areaAddress, isMyself, cardType, unionId, uniqueId, empiId, gmcUniqueId, gmcBindState, gmcCheckTime %s) " + String sql = "insert into patientBase(createTime, bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, address, areaCode, areaAddress, isMyself, cardType, unionId, uniqueId, empiId, gmcUniqueId, gmcBindState, gmcCheckTime %s) " +
" values(now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? %s)"; " values(now(), now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? %s)";
List<Patient> hasIdList = new ArrayList<>(); List<Patient> hasIdList = new ArrayList<>();
List<Patient> noneIdList = new ArrayList<>(); List<Patient> noneIdList = new ArrayList<>();
@ -382,14 +391,6 @@ public class PatientDao {
} }
/**
* 查询所有未领取健康卡的用户信息民族电话不能为空,一次读取15条信息
*/
public List<Patient> selectPatient4BatchUpdateHealthCard() {
String sql = "select * from patientBase where HealthCardID is null and ifNull(idCardNo,'') <> '' " +
"and ifNull(nation,'') <> '' and ifNull(tel, '') <> '' and callFlag=0 LIMIT 15";
return DataBase.select(sql, Patient.class);
}
/** /**

@ -134,7 +134,7 @@ public class GMCService {
delRows = new PatientDao().delByIds(wxOpenId, removeIds); delRows = new PatientDao().delByIds(wxOpenId, removeIds);
} }
int addRows = addItems(addList); // 添加后会补充数据 int addRows = addDBPatients(addList); // 添加后会补充数据
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
String takeTime = (endTime - begTime) + "ms"; // 耗时 String takeTime = (endTime - begTime) + "ms"; // 耗时
@ -143,12 +143,12 @@ public class GMCService {
} }
/** /**
* 添加 * 本院数据补充
* *
* @param patients * @param patients 患者信息
* @return * @return int
*/ */
public int addItems(List<Patient> patients) { public int addDBPatients(List<Patient> patients) {
if (patients.isEmpty()) { if (patients.isEmpty()) {
return 0; return 0;
} }

Loading…
Cancel
Save