Compare commits

...

18 Commits

Author SHA1 Message Date
zhangye 53a3fd5496 修改同步 2 days ago
zhangye 2cc406cb1b Merge branch 'master' into hnsdlyy 2 days ago
zhangye fa92977196 修改同步 2 days ago
zhangye 6095354869 Merge remote-tracking branch 'origin/master' into hnsdlyy 2 days ago
zhangye 10169e7cc1 修改密码增加验证 2 days ago
zhangye d9eab31183 修改 2 days ago
zhangye 141c363a8c 修改患者查询权限 2 days ago
zhangye 21d4e30333 修改查看患者列表 2 days ago
zhangye b6a796759e 修改配置文件 2 days ago
zhangye 5028a01766 修改性别和婚姻状况的备注 3 days ago
zhangye 7e20c617f7 电力医院对接修改 3 days ago
zhangye 7f3419c473 添加日志,修改定时时间 3 days ago
zhangye 5884825801 修改定时任务 3 days ago
zhangye a5b0176cbe 修改同步相关代码 4 days ago
zhangye f689dbe4e9 电力医院修改视图同步和列表权限 4 days ago
zhangye a73f431bd5 Merge branch 'master' into hnsdlyy 4 days ago
ccsens_zhengzhichuan 3c55d80145 修改统计 1 month ago
ccsens_zhengzhichuan af9731e3cb 河南电力医院部署 1 month ago
  1. 2
      ruisi_java/pom.xml
  2. 2
      ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/enums/DataSourceType.java
  3. 2
      ruisi_java/ruisi-cc-framework/src/main/java/com/ccsens/framework/datasource/DynamicDataSource.java
  4. 4
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/DockVo.java
  5. 54
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/OracleViewDao.java
  6. 13
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/DockService.java
  7. 280
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java
  8. 175
      ruisi_java/ruisi-system/src/main/resources/mapper/system/OracleViewDao.xml
  9. 10
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/system/SysProfileController.java
  10. 35
      ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml
  11. 20
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/PmsController.java
  12. 11
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java
  13. 111
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalViwe.java
  14. 2
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsReportServiceImpl.java
  15. 4
      ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml
  16. 40
      ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml
  17. 32
      ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/PmsPatientDao.xml
  18. 21
      ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/RmsDao.xml
  19. 10
      ruisi_java/ruisi-web-examine/src/main/resources/application-prod.yml

2
ruisi_java/pom.xml

@ -20,7 +20,7 @@
<module>ruisi-quartz</module>
<module>ruisi-web-admin</module>
<module>ruisi-web-client</module>
<module>ruisi-web-examine</module>
<!-- <module>ruisi-web-examine</module>-->
</modules>
<packaging>pom</packaging>

2
ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/enums/DataSourceType.java

@ -17,7 +17,7 @@ public enum DataSourceType {
SLAVE,
/**
* 柳铁
* ORACLE
*/
ORACLE
}

2
ruisi_java/ruisi-cc-framework/src/main/java/com/ccsens/framework/datasource/DynamicDataSource.java

@ -44,7 +44,7 @@ public class DynamicDataSource extends AbstractRoutingDataSource {
DataSource dataSource;
Map<Object, DataSource> resolvedDataSources = super.getResolvedDataSources();
log.info("resolvedDataSources数据源池中的key: {}", resolvedDataSources.keySet());
// log.info("resolvedDataSources数据源池中的key: {}", resolvedDataSources.keySet());
if (CollUtil.isNotEmpty(resolvedDataSources) && resolvedDataSources.containsKey(dataSourceKey)) {
dataSource = resolvedDataSources.get(dataSourceKey);
}else {

4
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/DockVo.java

@ -35,6 +35,8 @@ public class DockVo {
@Data
@ApiModel("员工信息-EmplInfo")
public static class EmplInfo {
@ApiModelProperty(value = "院内的医生id")
private String id;
@ApiModelProperty(value = "姓名", required = true)
private String emplName;
@ -164,7 +166,7 @@ public class DockVo {
private String bedNumber;
@ApiModelProperty(value = "出院日期")
private Date dischargeDate;
private String dischargeDate;
@ApiModelProperty(value = "入院途径")
private String admissionMethod;

54
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/OracleViewDao.java

@ -1,5 +1,7 @@
package com.ccsens.system.persist.dao;
import com.ccsens.common.annotation.DataSource;
import com.ccsens.common.enums.DataSourceType;
import com.ccsens.system.domain.vo.DockVo;
import org.apache.ibatis.annotations.Param;
@ -13,52 +15,22 @@ import java.util.Map;
*/
public interface OracleViewDao {
/**
* 查询部门信息视图
* @param startTime 开始时间
* @param endTime 结束时间
* @return 部门信息列表
*/
List<DockVo.DeptInfo> getDeptView(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
@DataSource(value = DataSourceType.ORACLE)
List<DockVo.DeptInfo> getDeptView();
/**
* 查询员工信息视图
* @param startTime 开始时间
* @param endTime 结束时间
* @return 员工信息列表
*/
List<DockVo.EmplInfo> getEmplView(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
@DataSource(value = DataSourceType.ORACLE)
List<DockVo.EmplInfo> getEmplView();
/**
* 查询患者基本信息视图
* @param startTime 开始时间
* @param endTime 结束时间
* @return 患者基本信息列表
*/
List<DockVo.PatientBasicInfo> getPatientBasicView(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
@DataSource(value = DataSourceType.ORACLE)
List<DockVo.PatientBasicInfo> getPatientBasicView(@Param("patientNoList") List<String> patientNoList);
/**
* 查询患者就诊信息视图
* @param startTime 开始时间
* @param endTime 结束时间
* @return 患者就诊信息列表
*/
@DataSource(value = DataSourceType.ORACLE)
List<DockVo.PatientVisitInfo> getPatientVisitView(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
/**
* 查询诊断信息视图
* @param startTime 开始时间
* @param endTime 结束时间
* @return 诊断信息列表
*/
List<DockVo.DiagnosisInfo> getDiagnosisView(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
@DataSource(value = DataSourceType.ORACLE)
List<DockVo.DiagnosisInfo> getDiagnosisView(@Param("visitNoList") List<String> visitNoList);
/**
* 查询用药信息视图
* @param startTime 开始时间
* @param endTime 结束时间
* @return 用药信息列表
*/
List<DockVo.MedicationInfo> getMedicationView(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
@DataSource(value = DataSourceType.ORACLE)
List<DockVo.MedicationInfo> getMedicationView(@Param("visitNoList") List<String> visitNoList);
}

13
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/DockService.java

@ -7,6 +7,7 @@ import com.ccsens.system.domain.vo.DockVo;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* @Author zzc
@ -40,15 +41,17 @@ public interface DockService {
List<DockVo.EmplInfo> getEmplView();
void syncEmplView(List<DockVo.EmplInfo> sysEmpls);
List<DockVo.PatientBasicInfo> getPatientBasicView();
List<DockVo.PatientBasicInfo> getPatientBasicView(List<String> patientNos);
void syncPatientBasicView(List<DockVo.PatientBasicInfo> sysPatients);
List<DockVo.PatientVisitInfo> getPatientVisitView();
void syncPatientVisitView(List<DockVo.PatientVisitInfo> sysVisits);
List<DockVo.PatientVisitInfo> getPatientVisitView(Date startTime);
List<DockVo.PatientVisitInfo> syncPatientVisitView(List<DockVo.PatientVisitInfo> sysVisits);
List<DockVo.DiagnosisInfo> getDiagnosisView();
List<DockVo.DiagnosisInfo> getDiagnosisView(List<String> visitNos);
void syncDiagnosisView(List<DockVo.DiagnosisInfo> sysDiagnosis);
List<DockVo.MedicationInfo> getMedicationView();
List<DockVo.MedicationInfo> getMedicationView(List<String> visitNos);
void syncMedicationView(List<DockVo.MedicationInfo> sysMedications);
Date getPatientVisitLastDate();
}

280
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java

@ -36,10 +36,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -322,6 +319,7 @@ public class DockServiceImpl implements DockService {
@DataSource(value = DataSourceType.MASTER)
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void syncUmsUserMaster(List<SysUser> sysUsers) {
log.info("master开始同步用户数据:{}", sysUsers.size());
if (CollUtil.isNotEmpty(sysUsers)) {
for (SysUser sysUser : sysUsers) {
//根据code查找用户
@ -330,9 +328,12 @@ public class DockServiceImpl implements DockService {
List<SysUser> users = sysUserMapper.selectUserList(user);
if (CollUtil.isEmpty(users)) {
sysUser.setDeptId(hospitalId);
sysUser.setPassword(SecurityUtils.encryptPassword(user.getEmplCode() + generalPassword));
log.info("master新增用户信息:{}", sysUser);
sysUserMapper.insertUser(sysUser);
}else {
sysUser.setUserId(users.get(0).getUserId());
log.info("master更新用户信息:{}", sysUser);
sysUserMapper.updateUser(sysUser);
}
}
@ -389,7 +390,7 @@ public class DockServiceImpl implements DockService {
sysUser.setUserName("u_" + dockEmpl.getEmplCode());
sysUser.setNickName(dockEmpl.getEmplName());
sysUser.setEmplCode(dockEmpl.getEmplCode());
sysUser.setPassword(SecurityUtils.encryptPassword(generalPassword));
sysUser.setPassword(SecurityUtils.encryptPassword(dockEmpl.getEmplCode() + generalPassword));
//获取一年后的日期
sysUser.setValidDate(DateUtil.offset(new Date(), DateField.YEAR, 1));
sysUser.setDataPower(dataPower);
@ -470,6 +471,7 @@ public class DockServiceImpl implements DockService {
@DataSource(value = DataSourceType.MASTER)
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void syncUmsDeptMaster(List<SysDept> sysDepts) {
log.info("MASTER同步部门数据开始:{}",sysDepts.size());
if (CollUtil.isNotEmpty(sysDepts)) {
sysDepts.forEach(sysDept -> {
//根据code查找系统的部门信息
@ -477,10 +479,12 @@ public class DockServiceImpl implements DockService {
dept.setDeptCode(sysDept.getDeptCode());
List<SysDept> depts = sysDeptMapper.selectDeptList(dept);
if (CollUtil.isEmpty(depts)) {
log.info("MASTER新增部门:{}",sysDept);
sysDeptMapper.insertDept(sysDept);
} else {
SysDept sysDept1 = depts.get(0);
sysDept.setDeptId(sysDept1.getDeptId());
log.info("MASTER更新部门:{}",sysDept);
sysDeptMapper.updateDept(sysDept);
}
});
@ -512,7 +516,7 @@ public class DockServiceImpl implements DockService {
pmsPatient = pmsPatients.get(0);
disposePmsPatient(dockPatientBaseInfo, pmsPatient);
pmsPatient.setHospitalId(hospitalId);
pmsPatient.setUserId(CollUtil.isEmpty(sysUserList) ? null : sysUserList.get(0).getUserId());
pmsPatient.setCreateBy(CollUtil.isEmpty(sysUserList) ? null : sysUserList.get(0).getUserName());
pmsPatientMapper.updateByPrimaryKeySelective(pmsPatient);
} else {
//不存在则插入
@ -520,7 +524,7 @@ public class DockServiceImpl implements DockService {
pmsPatient.setId(IdUtil.getSnowflake().nextId());
disposePmsPatient(dockPatientBaseInfo, pmsPatient);
pmsPatient.setHospitalId(hospitalId);
pmsPatient.setUserId(CollUtil.isEmpty(sysUserList) ? null : sysUserList.get(0).getUserId());
pmsPatient.setCreateBy(CollUtil.isEmpty(sysUserList) ? null : sysUserList.get(0).getUserName());
pmsPatientMapper.insertSelective(pmsPatient);
}
//修改同步表数据的状态
@ -549,26 +553,34 @@ public class DockServiceImpl implements DockService {
//根据医生和部门信息查找业务表内对应的医生账号和部门id
String doctorName = "";
Long deptId = null;
String deptName = "";
//医生用户名
String doctor = dockPatientVisitInfo.getDoctor();
if (StrUtil.isNotEmpty(doctor)) {
String[] split = doctor.split("/");
if (split.length > 1) {
SysUser sysUser = new SysUser();
sysUser.setEmplCode(split[1]);
List<SysUser> sysUsers = sysUserMapper.selectUserList(sysUser);
if (CollUtil.isNotEmpty(sysUsers)) {
doctorName = sysUsers.get(0).getUserName();
}
SysUser sysUser = new SysUser();
sysUser.setEmplCode(doctor);
List<SysUser> sysUsers = sysUserMapper.selectUserList(sysUser);
if (CollUtil.isNotEmpty(sysUsers)) {
doctorName = sysUsers.get(0).getUserName();
}
// String[] split = doctor.split("/");
// if (split.length > 1) {
// SysUser sysUser = new SysUser();
// sysUser.setEmplCode(split[1]);
// List<SysUser> sysUsers = sysUserMapper.selectUserList(sysUser);
// if (CollUtil.isNotEmpty(sysUsers)) {
// doctorName = sysUsers.get(0).getUserName();
// }
// }
}
//部门id
if (StrUtil.isNotEmpty(dockPatientVisitInfo.getDepartment())) {
SysDept sysDept = new SysDept();
sysDept.setDeptName(dockPatientVisitInfo.getDepartment());
sysDept.setDeptCode(dockPatientVisitInfo.getDepartment());
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(sysDept);
if (CollUtil.isNotEmpty(sysDepts)) {
deptId = sysDepts.get(0).getDeptId();
deptName = sysDepts.get(0).getDeptName();
}
}
@ -588,7 +600,7 @@ public class DockServiceImpl implements DockService {
pmsPatient.setId(IdUtil.getSnowflake().nextId());
disposePmsPatient(dockPatientBaseInfos.get(0), pmsPatient);
//更新患者所属的部门和创建者信息,暂不考虑其他,每次都更新
pmsPatient.setHospitalId(ObjectUtil.isNull(deptId) ? hospitalId : deptId);
pmsPatient.setHospitalId(hospitalId);
if (StrUtil.isNotEmpty(doctorName)) {
pmsPatient.setCreateBy(doctorName);
}
@ -600,7 +612,7 @@ public class DockServiceImpl implements DockService {
} else {
pmsPatient = pmsPatients.get(0);
//更新患者所属的部门和创建者信息,暂不考虑其他,每次都更新
pmsPatient.setHospitalId(ObjectUtil.isNull(deptId) ? hospitalId : deptId);
pmsPatient.setHospitalId(hospitalId);
if (StrUtil.isNotEmpty(doctorName)) {
pmsPatient.setCreateBy(doctorName);
}
@ -615,12 +627,14 @@ public class DockServiceImpl implements DockService {
pmsPatientBody = pmsPatientBodies.get(0);
pmsPatientBody.setPatientId(pmsPatient.getId());
disposePmsPatientBody(dockPatientVisitInfo, pmsPatientBody);
pmsPatientBody.setDepartment(deptName);
pmsPatientBodyMapper.updateByPrimaryKeySelective(pmsPatientBody);
} else {
pmsPatientBody = new PmsPatientBody();
pmsPatientBody.setId(IdUtil.getSnowflake().nextId());
pmsPatientBody.setPatientId(pmsPatient.getId());
disposePmsPatientBody(dockPatientVisitInfo, pmsPatientBody);
pmsPatientBody.setDepartment(deptName);
pmsPatientBodyMapper.insertSelective(pmsPatientBody);
}
return pmsPatientBody;
@ -925,17 +939,20 @@ public class DockServiceImpl implements DockService {
@Override
public List<DockVo.DeptInfo> getDeptView() {
// 当前时间
Date endTime = new Date();
// 一小时前的时间
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000);
return oracleViewDao.getDeptView(startTime, endTime);
return oracleViewDao.getDeptView();
}
@Override
public void syncDeptView(List<DockVo.DeptInfo> sysDepts) {
if(CollUtil.isNotEmpty(sysDepts)){
for (DockVo.DeptInfo sysDept : sysDepts) {
//根据code和名称查询部门是否存在
DockDeptExample example = new DockDeptExample();
example.createCriteria().andDeptCodeEqualTo(sysDept.getDeptCode()).andDeptNameEqualTo(sysDept.getDeptName());
long l = dockDeptMapper.countByExample(example);
if(l>0){
continue;
}
DockDept dockDept = new DockDept();
dockDept.setDeptName(sysDept.getDeptName());
dockDept.setDeptCode(sysDept.getDeptCode());
@ -947,16 +964,22 @@ public class DockServiceImpl implements DockService {
@Override
public List<DockVo.EmplInfo> getEmplView() {
Date endTime = new Date();
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000);
return oracleViewDao.getEmplView(startTime, endTime);
return oracleViewDao.getEmplView();
}
@Override
public void syncEmplView(List<DockVo.EmplInfo> sysEmpls) {
if(CollUtil.isNotEmpty(sysEmpls)){
for (DockVo.EmplInfo sysEmpl : sysEmpls) {
//根据工号查询员工是否存在
DockEmplExample example = new DockEmplExample();
example.createCriteria().andEmplCodeEqualTo(sysEmpl.getEmplCode());
long l = dockEmplMapper.countByExample(example);
if(l>0){
continue;
}
DockEmpl dockEmpl = new DockEmpl();
dockEmpl.setId(Long.valueOf(sysEmpl.getId()));
dockEmpl.setEmplName(sysEmpl.getEmplName());
dockEmpl.setEmplCode(sysEmpl.getEmplCode());
dockEmpl.setEmplType(sysEmpl.getEmplType());
@ -970,54 +993,38 @@ public class DockServiceImpl implements DockService {
}
@Override
public List<DockVo.PatientBasicInfo> getPatientBasicView() {
public List<DockVo.PatientVisitInfo> getPatientVisitView(Date startTime) {
Date endTime = new Date();
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000);
return oracleViewDao.getPatientBasicView(startTime, endTime);
}
@Override
public void syncPatientBasicView(List<DockVo.PatientBasicInfo> sysPatients) {
if(CollUtil.isNotEmpty(sysPatients)){
for (DockVo.PatientBasicInfo sysPatient : sysPatients) {
DockPatientBaseInfo dockPatientBase = new DockPatientBaseInfo();
dockPatientBase.setName(sysPatient.getName());
dockPatientBase.setPatientNo(sysPatient.getPatientNo());
dockPatientBase.setIdCard(sysPatient.getIdCard());
dockPatientBase.setPhone(sysPatient.getPhone());
dockPatientBase.setSex(sysPatient.getSex());
dockPatientBase.setBirthday(sysPatient.getBirthday());
dockPatientBase.setEducationalStatus(sysPatient.getEducationalStatus());
dockPatientBase.setCareer(sysPatient.getCareer());
dockPatientBase.setMaritalStatus(sysPatient.getMaritalStatus());
dockPatientBase.setNation(sysPatient.getNation());
dockPatientBase.setNativePlace(sysPatient.getNativePlace());
dockPatientBase.setAddress(sysPatient.getAddress());
dockPatientBase.setDwellingState(sysPatient.getDwellingState());
dockPatientBase.setContactName(sysPatient.getContactName());
dockPatientBase.setContactMobile(sysPatient.getContactMobile());
dockPatientBase.setContactRelation(sysPatient.getContactRelation());
dockPatientBase.setAboBloodType(sysPatient.getAboBloodType());
dockPatientBase.setRhBloodType(sysPatient.getRhBloodType());
dockPatientBase.setBelief(sysPatient.getBelief());
dockPatientBase.setHobby(sysPatient.getHobby());
dockPatientBase.setSync(String.valueOf(0));
dockPatientBaseInfoMapper.insertSelective(dockPatientBase);
}
if(ObjectUtil.isNull(startTime)){
//如果是空,查全部
endTime = null;
}
}
@Override
public List<DockVo.PatientVisitInfo> getPatientVisitView() {
Date endTime = new Date();
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000);
return oracleViewDao.getPatientVisitView(startTime, endTime);
}
@Override
public void syncPatientVisitView(List<DockVo.PatientVisitInfo> sysVisits) {
public List<DockVo.PatientVisitInfo> syncPatientVisitView(List<DockVo.PatientVisitInfo> sysVisits) {
List<DockVo.PatientVisitInfo> visitList = new ArrayList<>();
if(CollUtil.isNotEmpty(sysVisits)){
for (DockVo.PatientVisitInfo sysVisit : sysVisits) {
//根据就诊流水号查询就诊信息是否存在
DockPatientVisitInfoExample example = new DockPatientVisitInfoExample();
example.createCriteria().andVisitNoEqualTo(sysVisit.getVisitNo());
long l = dockPatientVisitInfoMapper.countByExample(example);
if(l>0){
continue;
}
//根据医生id查找医生code
String doctorCode = sysVisit.getDoctor();
try {
DockEmpl dockEmpl = dockEmplMapper.selectByPrimaryKey(Long.valueOf(sysVisit.getDoctor()));
if(ObjectUtil.isNotNull(dockEmpl)){
doctorCode = dockEmpl.getEmplCode();
}
}catch (Exception e){
log.error("根据医生id查找医生code失败");
}
DockPatientVisitInfo dockPatientVisit = new DockPatientVisitInfo();
dockPatientVisit.setVisitNo(sysVisit.getVisitNo());
dockPatientVisit.setPatientNo(sysVisit.getPatientNo());
@ -1025,11 +1032,13 @@ public class DockServiceImpl implements DockService {
dockPatientVisit.setVisitType(sysVisit.getVisitType());
dockPatientVisit.setAge(sysVisit.getAge());
dockPatientVisit.setDepartment(sysVisit.getDepartment());
dockPatientVisit.setDoctor(sysVisit.getDoctor());
dockPatientVisit.setDoctor(doctorCode);
dockPatientVisit.setAdmissionDate(sysVisit.getAdmissionDate());
dockPatientVisit.setAdmissionCount(sysVisit.getAdmissionCount());
dockPatientVisit.setBedNumber(sysVisit.getBedNumber());
dockPatientVisit.setDischargeDate(sysVisit.getDischargeDate());
if(StrUtil.isNotEmpty(sysVisit.getDischargeDate())){
dockPatientVisit.setDischargeDate(DateUtil.parse(sysVisit.getDischargeDate(), "yyyy-MM-dd"));
}
dockPatientVisit.setAdmissionMethod(sysVisit.getAdmissionMethod());
dockPatientVisit.setDischargeMethod(sysVisit.getDischargeMethod());
dockPatientVisit.setHeight(sysVisit.getHeight());
@ -1058,19 +1067,112 @@ public class DockServiceImpl implements DockService {
dockPatientVisit.setAllergyDrug(sysVisit.getAllergyDrug());
dockPatientVisit.setSync(String.valueOf(0));
dockPatientVisitInfoMapper.insertSelective(dockPatientVisit);
visitList.add(sysVisit);
}
}
return visitList;
}
@Override
public List<DockVo.DiagnosisInfo> getDiagnosisView() {
Date endTime = new Date();
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000);
return oracleViewDao.getDiagnosisView(startTime, endTime);
public List<DockVo.PatientBasicInfo> getPatientBasicView(List<String> patientNos) {
// return oracleViewDao.getPatientBasicView(patientNos);
if (CollUtil.isEmpty(patientNos)) {
return new ArrayList<>();
}
List<DockVo.PatientBasicInfo> result = new ArrayList<>();
int batchSize = 100;
for (int i = 0; i < patientNos.size(); i += batchSize) {
int end = Math.min(i + batchSize, patientNos.size());
List<String> batchList = patientNos.subList(i, end);
result.addAll(oracleViewDao.getPatientBasicView(batchList));
}
return result;
}
@Override
public void syncPatientBasicView(List<DockVo.PatientBasicInfo> sysPatients) {
log.info("通过患者编号拉取到的患者信息:{}", sysPatients.size());
if(CollUtil.isNotEmpty(sysPatients)){
for (DockVo.PatientBasicInfo sysPatient : sysPatients) {
DockPatientBaseInfo dockPatientBase = new DockPatientBaseInfo();
dockPatientBase.setName(sysPatient.getName());
dockPatientBase.setPatientNo(sysPatient.getPatientNo());
dockPatientBase.setIdCard(sysPatient.getIdCard());
dockPatientBase.setPhone(sysPatient.getPhone());
//处理性别
if(StrUtil.isNotEmpty(sysPatient.getSex())){
if("1".equals(sysPatient.getSex())){
dockPatientBase.setSex("0");
}else if("0".equals(sysPatient.getSex())){
dockPatientBase.setSex("1");
}else {
dockPatientBase.setSex(sysPatient.getSex());
}
}
dockPatientBase.setBirthday(sysPatient.getBirthday());
dockPatientBase.setEducationalStatus(sysPatient.getEducationalStatus());
dockPatientBase.setCareer(sysPatient.getCareer());
//处理婚姻状况
if(StrUtil.isNotEmpty(sysPatient.getMaritalStatus())){
if ("0".equals(sysPatient.getMaritalStatus())){
dockPatientBase.setMaritalStatus("1");
}else if("1".equals(sysPatient.getMaritalStatus())){
dockPatientBase.setMaritalStatus("2");
}else if("2".equals(sysPatient.getMaritalStatus())){
dockPatientBase.setMaritalStatus("3");
}else if ("3".equals(sysPatient.getMaritalStatus())){
dockPatientBase.setMaritalStatus("4");
}else if ("4".equals(sysPatient.getMaritalStatus())){
dockPatientBase.setMaritalStatus("5");
}else {
dockPatientBase.setMaritalStatus(sysPatient.getMaritalStatus());
}
}
dockPatientBase.setNation(sysPatient.getNation());
dockPatientBase.setNativePlace(sysPatient.getNativePlace());
dockPatientBase.setAddress(sysPatient.getAddress());
dockPatientBase.setDwellingState(sysPatient.getDwellingState());
dockPatientBase.setContactName(sysPatient.getContactName());
dockPatientBase.setContactMobile(sysPatient.getContactMobile());
dockPatientBase.setContactRelation(sysPatient.getContactRelation());
dockPatientBase.setAboBloodType(sysPatient.getAboBloodType());
dockPatientBase.setRhBloodType(sysPatient.getRhBloodType());
dockPatientBase.setBelief(sysPatient.getBelief());
dockPatientBase.setHobby(sysPatient.getHobby());
dockPatientBase.setSync(String.valueOf(0));
dockPatientBaseInfoMapper.insertSelective(dockPatientBase);
}
}
}
@Override
public List<DockVo.DiagnosisInfo> getDiagnosisView(List<String> visitNos) {
// return oracleViewDao.getDiagnosisView(visitNos);
if (CollUtil.isEmpty(visitNos)) {
return new ArrayList<>();
}
List<DockVo.DiagnosisInfo> result = new ArrayList<>();
int batchSize = 100;
for (int i = 0; i < visitNos.size(); i += batchSize) {
int end = Math.min(i + batchSize, visitNos.size());
List<String> batchList = visitNos.subList(i, end);
result.addAll(oracleViewDao.getDiagnosisView(batchList));
}
return result;
}
@Override
public void syncDiagnosisView(List<DockVo.DiagnosisInfo> sysDiagnosis) {
log.info("通过就诊号拉取到的患者诊断信息:{}", sysDiagnosis.size());
if(CollUtil.isNotEmpty(sysDiagnosis)){
for (DockVo.DiagnosisInfo sysDiagnosi : sysDiagnosis) {
DockPatientDiagnosis dockDiagnosis = new DockPatientDiagnosis();
@ -1087,14 +1189,27 @@ public class DockServiceImpl implements DockService {
}
@Override
public List<DockVo.MedicationInfo> getMedicationView() {
Date endTime = new Date();
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000);
return oracleViewDao.getMedicationView(startTime, endTime);
public List<DockVo.MedicationInfo> getMedicationView(List<String> visitNos) {
// return oracleViewDao.getMedicationView(visitNos);
if (CollUtil.isEmpty(visitNos)) {
return new ArrayList<>();
}
List<DockVo.MedicationInfo> result = new ArrayList<>();
int batchSize = 100;
for (int i = 0; i < visitNos.size(); i += batchSize) {
int end = Math.min(i + batchSize, visitNos.size());
List<String> batchList = visitNos.subList(i, end);
result.addAll(oracleViewDao.getMedicationView(batchList));
}
return result;
}
@Override
public void syncMedicationView(List<DockVo.MedicationInfo> sysMedications) {
log.info("通过就诊号拉取到的患者用药信息:{}", sysMedications.size());
if(CollUtil.isNotEmpty(sysMedications)){
for (DockVo.MedicationInfo sysMedication : sysMedications) {
DockPatientMedicationInfo dockMedication = new DockPatientMedicationInfo();
@ -1109,4 +1224,15 @@ public class DockServiceImpl implements DockService {
}
}
@Override
public Date getPatientVisitLastDate() {
DockPatientVisitInfoExample example = new DockPatientVisitInfoExample();
example.setOrderByClause("admission_date desc limit 1");
List<DockPatientVisitInfo> dockPatientVisitInfos = dockPatientVisitInfoMapper.selectByExample(example);
if(CollUtil.isNotEmpty(dockPatientVisitInfos)){
return dockPatientVisitInfos.get(0).getAdmissionDate();
}
return null;
}
}

175
ruisi_java/ruisi-system/src/main/resources/mapper/system/OracleViewDao.xml

@ -6,160 +6,145 @@
<select id="getDeptView" resultType="com.ccsens.system.domain.vo.DockVo$DeptInfo">
select
dept_name as deptName,
dept_code as deptCode,
update_time as updateTime
dept_code as deptCode
from bs_his.V_LNPG_KSXX
<where>
<if test="startTime != null and endTime != null">
and update_time >= #{startTime}
and update_time &lt;= #{endTime}
</if>
</where>
order by update_time desc
</select>
<!-- 员工信息查询 -->
<select id="getEmplView" resultType="com.ccsens.system.domain.vo.DockVo$EmplInfo">
select
empl_name as emplName,
empl_code as emplCode,
empl_type as emplType,
dept_code as deptCode,
role_power as rolePower,
data_power as dataPower,
update_time as updateTime
doctor_id as id,
empl_name as emplName,
empl_code as emplCode,
empl_type as emplType,
dept_code as deptCode,
role_power as rolePower,
case
when substr(empl_code, 1, 1) = '6' then data_power_bq
else data_power_ks
end as dataPower
from bs_his.V_LNPG_YGXX
<where>
<if test="startTime != null and endTime != null">
and update_time >= #{startTime}
and update_time &lt;= #{endTime}
</if>
</where>
order by update_time desc
</select>
<!-- 患者基本信息查询 -->
<select id="getPatientBasicView" resultType="com.ccsens.system.domain.vo.DockVo$PatientBasicInfo">
select
name,
patient_no as patientNo,
id_card as idCard,
phone,
sex,
birthday,
educational_status as educationalStatus,
career,
marital_status as maritalStatus,
nation,
native_place as nativePlace,
address,
dwelling_state as dwellingState,
contact_name as contactName,
contact_mobile as contactMobile,
contact_relation as contactRelation,
abo_blood_type as aboBloodType,
rh_blood_type as rhBloodType,
belief,
hobby,
update_time as updateTime
name,
patient_no as patientNo,
idcard as idCard,
phone,
sex,
birthday,
educationalstatus as educationalStatus,
career,
maritalstatus as maritalStatus,
nation,
nativeplace as nativePlace,
address,
dwellingstate as dwellingState,
contactname as contactName,
contactmobile as contactMobile,
contactrelation as contactRelation,
abobloodtype as aboBloodType,
rhbloodtype as rhBloodType,
belief,
hobby
from bs_his.V_LNPG_BASICINFORMATION
<where>
<if test="startTime != null and endTime != null">
and update_time >= #{startTime}
and update_time &lt;= #{endTime}
<if test="patientNoList != null and patientNoList.size() > 0">
patient_no in
<foreach collection="patientNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by update_time desc
</select>
<!-- 患者就诊信息查询 -->
<select id="getPatientVisitView" resultType="com.ccsens.system.domain.vo.DockVo$PatientVisitInfo">
select
visit_no as visitNo,
visittype as visitType,
visitno as visitNo,
patient_no as patientNo,
id_card as idCard,
visit_type as visitType,
age,
department,
doctor,
admission_date as admissionDate,
admission_count as admissionCount,
bed_number as bedNumber,
discharge_date as dischargeDate,
admission_method as admissionMethod,
discharge_method as dischargeMethod,
admissiondate as admissionDate,
admissioncount as admissionCount,
bednumber as bedNumber,
dischargedate as dischargeDate,
admissionmethod as admissionMethod,
dischargemethod as dischargeMethod,
height,
weight,
tz,
temperature,
blood_pressure_shrink as bloodPressureShrink,
blood_pressure_diastole as bloodPressureDiastole,
bloodpressureshrink as bloodPressureShrink,
bloodpressurediastole as bloodPressureDiastole,
pulse,
creatinine,
oxygen_saturation as oxygenSaturation,
oxygensaturation as oxygenSaturation,
albumin,
total_protein as totalProtein,
vitamin_d3 as vitaminD3,
totalprotein as totalProtein,
vitamind3 as vitaminD3,
hematocrit,
dimer,
smoking_history as smokingHistory,
smoking_year as smokingYear,
smoking_quit as smokingQuit,
smoking_quit_year as smokingQuitYear,
drink_history as drinkHistory,
drink_year as drinkYear,
drink_quit as drinkQuit,
drink_quit_year as drinkQuitYear,
has_allergy as hasAllergy,
allergy_drug as allergyDrug,
update_time as updateTime
smokinghistory as smokingHistory,
smokingyear as smokingYear,
smokingquit as smokingQuit,
smokingquityear as smokingQuitYear,
drinkhistory as drinkHistory,
drinkyear as drinkYear,
drinkquit as drinkQuit,
drinkquityear as drinkQuitYear,
hasallergy as hasAllergy,
allergydrug as allergyDrug
from bs_his.V_LNPG_HZJZXX
<where>
<if test="startTime != null and endTime != null">
and update_time >= #{startTime}
and update_time &lt;= #{endTime}
and admissiondate >= #{startTime}
and admissiondate &lt;= #{endTime}
</if>
</where>
order by update_time desc
</select>
<!-- 诊断信息查询 -->
<select id="getDiagnosisView" resultType="com.ccsens.system.domain.vo.DockVo$DiagnosisInfo">
select
visit_no as visitNo,
diagnosis_type as diagnosisType,
is_main_diagnosis as isMainDiagnosis,
diagnosis_name as diagnosisName,
diagnosis_code as diagnosisCode,
diagnosis_date as diagnosisDate,
update_time as updateTime
visitno as visitNo,
diagnosistype as diagnosisType,
ismaindiagnosis as isMainDiagnosis,
diagnosisname as diagnosisName,
diagnosiscode as diagnosisCode,
diagnosisdate as diagnosisDate
from bs_his.V_LNPG_ZDXX
<where>
<if test="startTime != null and endTime != null">
and update_time >= #{startTime}
and update_time &lt;= #{endTime}
<if test="visitNoList != null and visitNoList.size() > 0">
visitno in
<foreach collection="visitNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by update_time desc
</select>
<!-- 用药信息查询 -->
<select id="getMedicationView" resultType="com.ccsens.system.domain.vo.DockVo$MedicationInfo">
select
visit_no as visitNo,
drug_name as drugName,
visitno as visitNo,
drugname as drugName,
dose,
unit,
frequency,
update_time as updateTime
frequency
from bs_his.V_LNPG_YYXX
<where>
<if test="startTime != null and endTime != null">
and update_time >= #{startTime}
and update_time &lt;= #{endTime}
<if test="visitNoList != null and visitNoList.size() > 0">
visitno in
<foreach collection="visitNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by update_time desc
</select>
</mapper>

10
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/system/SysProfileController.java

@ -66,6 +66,10 @@ public class SysProfileController extends BaseController {
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
//验证密码格式 长度大于8,包含数字、大小写字母、字符
if (!user.getPassword().matches("^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[~!@#$%^&*()_+`\\-={}:;'<>?,./]).{8,}$")) {
return error("修改用户'" + user.getUserName() + "'失败,密码格式错误,请输入8位以上,包含数字、大小写字母、特殊字符的密码");
}
user.setUserId(sysUser.getUserId());
user.setPassword(null);
user.setAvatar(null);
@ -97,6 +101,11 @@ public class SysProfileController extends BaseController {
if (SecurityUtils.matchesPassword(newPassword, password)) {
return error("新密码不能与旧密码相同");
}
//验证密码格式 长度大于8,包含数字、大小写字母、字符
if (!newPassword.matches("^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[~!@#$%^&*()_+`\\-={}:;'<>?,./]).{8,}$")) {
return error("新密码格式错误,请输入8位以上,包含数字、大小写字母、特殊字符的密码");
}
if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) {
// 更新缓存用户密码
loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
@ -126,4 +135,5 @@ public class SysProfileController extends BaseController {
}
return error("上传图片异常,请联系管理员");
}
}

35
ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml

@ -6,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://192.168.0.128:3306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://192.168.11.85:23306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Sxinf18aA
password: xian#2024!!!
# 从库数据源
slave:
# 从数据源开关/默认关闭
@ -62,13 +62,13 @@ spring:
# redis 配置
redis:
# 地址
host: localhost
host: 192.168.11.85
# 端口,默认为6379
port: 6379
port: 26379
# 数据库索引
database: 1
# 密码
password: 123456
password: redis111^#
# 连接超时时间
timeout: 10s
lettuce:
@ -88,7 +88,7 @@ app:
# 资源访问路径前缀 示例(/profile)
profileUrl: /profile
# 资源存储路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profilePath: /data/cgav2/server/profile/
profilePath: /data/cgav2/profile/
# 分布式ID-WorkID
workerId: 1
# 分布式ID-DataCenterID
@ -105,16 +105,15 @@ file:
imgDomain: http://116.204.40.58/ruisiClient/profile
reportDomain: /data/cgav2/server/profile
reportPath: /data/cgav2/server/profile
ldTemplate: /data/cgav2/server/profile/upload/dTemplate.xlsx
ldTjbgDir: /data/cgav2/server/profile/tjbg/
ldExportDir: /data/cgav2/server/profile/ldExport
ldZQTYDir: /data/cgav2/server/profile/ldZQTYExport
ldZQTYTemplate: /data/cgav2/server/profile/upload/2024年河津流调知情同意书模板-V1.docx
grPath: /data/cgav2/server/profile/grReportTemplate.docx
ysPath: /data/cgav2/server/profile/ysReportTemplate.docx
ldTemplate: /data/cgav2/profile/upload/dTemplate.xlsx
ldTjbgDir: /data/cgav2/profile/tjbg/
ldExportDir: /data/cgav2/profile/ldExport
ldZQTYDir: /data/cgav2/profile/ldZQTYExport
ldZQTYTemplate: /data/cgav2/profile/upload/2024年河津流调知情同意书模板-V1.docx
grPath: /data/cgav2/profile/grReportTemplate.docx
ysPath: /data/cgav2/profile/ysReportTemplate.docx
informed:
studySign: /data/cgav2/server/profile/studySign.png
template: /data/cgav2/server/profile/知情同意模板.docx
wordUrl: /data/cgav2/server/profile/informed/
prefixWord: /data/cgav2/server/profile/
studySign: /data/cgav2/profile/studySign.png
template: /data/cgav2/profile/知情同意模板.docx
wordUrl: /data/cgav2/profile/informed/
prefixWord: /data/cgav2/profile/

20
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/PmsController.java

@ -61,16 +61,6 @@ public class PmsController extends BaseController {
@ApiOperation("获取患者信息列表")
@PostMapping("/queryList")
public JsonResponse<PageInfo<PmsPatientVo.PatientList>> queryPatientList(@RequestBody @Validated BaseDto<PmsPatientDto.QueryPatient> dto) {
// List<PmsPatientVo.PatientList> list = new ArrayList<>();
// PmsPatientDto.QueryPatient param = dto.getParam();
// if (StrUtil.isNotEmpty(param.getSearchValue()) && param.getSearchValue().length() == 10) {
// //关键字不为空,且长度等于10,先查询院内his信息
// List<PmsPatientVo.PatientList> hisList = ltHisConnectionService.queryHisPatient(param.getSearchValue());
// if (CollUtil.isNotEmpty(hisList)) {
// list.addAll(hisList);
// }
// }
//获取用户的权限
LoginUser loginUser = SecurityUtils.getLoginUser();
@ -86,16 +76,6 @@ public class PmsController extends BaseController {
startPageOvertop(dto);
List<PmsPatientVo.PatientList> serverList = patientService.queryPatientList(dto.getParam(), dataScope, loginUser.getUserId(), loginUser.getUsername());
// if (CollUtil.isNotEmpty(serverList)) {
// list.addAll(serverList);
// }
// // 创建一个 TreeSet,通过 Comparator 根据 patientId 去重
// Set<PmsPatientVo.PatientList> uniqueSet = new TreeSet<>(
// Comparator.comparing(PmsPatientVo.PatientList::getPatientId)
// );
// uniqueSet.addAll(list);
// List<PmsPatientVo.PatientList> uniqueList = new ArrayList<>(uniqueSet);
return JsonResponse.ok(new PageInfo<>(serverList));
}

11
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java

@ -24,14 +24,16 @@ public class SyncHospitalData {
private DockService dockService;
@DataSource(value = DataSourceType.SLAVE)
// @Scheduled(cron = "0 */1 * * * ?")
@Scheduled(cron = "0 */5 * * * ?")
public void syncHospitalData() {
log.info("开始同步医院患者数据");
dockService.syncHospitalData();
}
@DataSource(value = DataSourceType.SLAVE)
// @Scheduled(cron = "0 */1 * * * ?")
@Scheduled(cron = "0 40 * * * ?")
public void syncDeptData() {
log.info("开始同步部门数据");
try {
List<SysDept> sysDepts = dockService.syncUmsDeptSlave();
syncDeptMaster(sysDepts);
@ -43,13 +45,15 @@ public class SyncHospitalData {
@DataSource(value = DataSourceType.MASTER)
public void syncDeptMaster(List<SysDept> sysDepts) {
log.info("master同步部门数据");
dockService.syncUmsDeptMaster(sysDepts);
}
@DataSource(value = DataSourceType.SLAVE)
// @Scheduled(cron = "0 */1 * * * ?")
@Scheduled(cron = "0 50 * * * ?")
public void syncUserData() {
log.info("开始同步用户数据");
try {
List<SysUser> sysUsers = dockService.syncUmsUserSlave();
syncUserMaster(sysUsers);
@ -60,6 +64,7 @@ public class SyncHospitalData {
@DataSource(value = DataSourceType.MASTER)
public void syncUserMaster(List<SysUser> sysUser) {
log.info("master同步用户数据");
dockService.syncUmsUserMaster(sysUser);
}
}

111
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalViwe.java

@ -4,6 +4,7 @@ import com.ccsens.common.annotation.DataSource;
import com.ccsens.common.core.domain.entity.SysDept;
import com.ccsens.common.core.domain.entity.SysUser;
import com.ccsens.common.enums.DataSourceType;
import com.ccsens.framework.datasource.DynamicDataSourceContextHolder;
import com.ccsens.system.domain.vo.DockVo;
import com.ccsens.system.service.DockService;
import lombok.extern.slf4j.Slf4j;
@ -11,7 +12,8 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author zy
@ -24,46 +26,87 @@ public class SyncHospitalViwe {
@Resource
private DockService dockService;
@DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?")
@DataSource(DataSourceType.SLAVE)
@Scheduled(cron = "0 0 * * * ?")
public void getDeptView() {
List<DockVo.DeptInfo> sysDepts = dockService.getDeptView();
syncDeptView(sysDepts);
log.info("开始拉取部门信息");
try {
List<DockVo.DeptInfo> sysDepts = dockService.getDeptView();
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.SLAVE.name());
syncDeptView(sysDepts);
}catch (Exception e){
log.error("部门信息拉取失败",e);
}
}
@DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?")
@DataSource(DataSourceType.SLAVE)
@Scheduled(cron = "0 10 * * * ?")
public void getEmplView() {
List<DockVo.EmplInfo> sysEmpls = dockService.getEmplView();
syncEmplView(sysEmpls);
}
log.info("开始拉取员工信息");
try {
List<DockVo.EmplInfo> sysEmpls = dockService.getEmplView();
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.SLAVE.name());
syncEmplView(sysEmpls);
}catch (Exception e){
log.error("员工信息拉取失败",e);
}
@DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?")
public void getPatientBasicView() {
List<DockVo.PatientBasicInfo> sysPatients = dockService.getPatientBasicView();
syncPatientBasicView(sysPatients);
}
@DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?")
public void getPatientVisitView() {
List<DockVo.PatientVisitInfo> sysVisits = dockService.getPatientVisitView();
syncPatientVisitView(sysVisits);
}
@DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?")
public void getDiagnosisView() {
List<DockVo.DiagnosisInfo> sysDiagnosis = dockService.getDiagnosisView();
syncDiagnosisView(sysDiagnosis);
}
@DataSource(DataSourceType.SLAVE)
@Scheduled(cron = "0 */5 * * * ?")
// @Scheduled(cron = "0 0 * * * ?")
public void getPatientBasicView() {
log.info("开始拉取患者就诊信息");
//先查询当前就诊信息最后的时间
Date startTime = dockService.getPatientVisitLastDate();
Set<String> patientNos = new HashSet<>();
Set<String> visitNos = new HashSet<>();
try {
//先通过时间查询就诊信息
List<DockVo.PatientVisitInfo> sysVisits = dockService.getPatientVisitView(startTime);
log.info("查到的就诊信息:{}", sysVisits.size());
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.SLAVE.name());
//同步就诊信息
List<DockVo.PatientVisitInfo> visitList = syncPatientVisitView(sysVisits);
//去除所有的患者编号,去重
patientNos = visitList.stream().map(DockVo.PatientVisitInfo::getPatientNo).collect(Collectors.toSet());
//取出所有的就诊号,去重
visitNos = visitList.stream().map(DockVo.PatientVisitInfo::getVisitNo).collect(Collectors.toSet());
}catch (Exception e){
log.error("患者就诊信息拉取失败",e);
}
log.info("开始拉取患者基本信息");
try {
log.info("就诊信息整理的患者编号:{}", patientNos.size());
//根据患者编号查基本信息
List<DockVo.PatientBasicInfo> sysPatients = dockService.getPatientBasicView(new ArrayList<>(patientNos));
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.SLAVE.name());
syncPatientBasicView(sysPatients);
}catch (Exception e){
log.error("患者基本信息拉取失败",e);
}
log.info("开始拉取患者用药和诊断信息");
try {
log.info("就诊信息整理的就诊编号:{}", visitNos.size());
//根据就诊号查诊断信息
List<DockVo.DiagnosisInfo> sysDiagnosis = dockService.getDiagnosisView(new ArrayList<>(visitNos));
//根据就诊号查用药信息
List<DockVo.MedicationInfo> sysMedications = dockService.getMedicationView(new ArrayList<>(visitNos));
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.SLAVE.name());
syncDiagnosisView(sysDiagnosis);
syncMedicationView(sysMedications);
}catch (Exception e){
log.error("患者用药和诊断信息拉取失败",e);
}
@DataSource(value = DataSourceType.ORACLE)
// @Scheduled(cron = "0 */10 * * * ?")
public void getMedicationView() {
List<DockVo.MedicationInfo> sysMedications = dockService.getMedicationView();
syncMedicationView(sysMedications);
}
@DataSource(value = DataSourceType.SLAVE)
@ -82,8 +125,8 @@ public class SyncHospitalViwe {
}
@DataSource(value = DataSourceType.SLAVE)
public void syncPatientVisitView(List<DockVo.PatientVisitInfo> sysVisits) {
dockService.syncPatientVisitView(sysVisits);
public List<DockVo.PatientVisitInfo> syncPatientVisitView(List<DockVo.PatientVisitInfo> sysVisits) {
return dockService.syncPatientVisitView(sysVisits);
}
@DataSource(value = DataSourceType.SLAVE)

2
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsReportServiceImpl.java

@ -106,7 +106,7 @@ public class AmsReportServiceImpl implements AmsReportService {
String url = amsDao.queryTemplate(dto.getScaleCode());
if (StrUtil.isEmpty(url)) {
//使用通用模版
url = "/data/cgav2/server/profile/gg_template.docx";
url = "/data/cgav2/profile/gg_template.docx";
}
HashMap<String, Object> params = new HashMap<>();

4
ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml

@ -19,10 +19,6 @@ spring:
url: jdbc:mysql://127.0.0.1:3306/ruisi_cga_yf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@200.1.8.115:1521:hisdb
# username: interface_lnpg
# password: interface_lnpg
oracle:
# 从数据源开关/默认关闭
enabled: false

40
ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml

@ -6,14 +6,14 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://192.168.0.128:3306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://192.168.11.85:23306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Sxinf18aA
password: xian#2024!!!
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url: jdbc:mysql://172.28.145.18:23306/ruisi_cga_whszxyjhyy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
enabled: true
url: jdbc:mysql://192.168.11.85:23306/ruisi_cga_hnsdlyy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: xian#2024!!!
oracle:
@ -69,13 +69,13 @@ spring:
# redis 配置
redis:
# 地址
host: localhost
host: 192.168.11.85
# 端口,默认为6379
port: 6379
port: 26379
# 数据库索引
database: 1
# 密码
password: 123456
password: redis111^#
# 连接超时时间
timeout: 10s
lettuce:
@ -109,35 +109,35 @@ app:
# 资源访问路径前缀 示例(/profile)
profileUrl: /profile
# 资源存储路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profilePath: /data/cgav2/server/profile
profilePath: /data/cgav2/profile
# 分布式ID-WorkID
workerId: 1
# 分布式ID-DataCenterID
dataCenterId: 1
file:
path: /data/cgav2/server/profile/
path: /data/cgav2/profile/
# webPath: http://172.16.40.155:59001/ruisi/client/#
webPath: https://rs.sxyfrs.com/ruisi/clienths/#
#domain: https://api.ccsens.com/test/
domain: http://116.204.40.58/ruisiClient
imgDomain: http://116.204.40.58/ruisiClient/profile
reportDomain: /data/cgav2/server/profile
reportPath: /data/cgav2/server/profile
grPath: /data/cgav2/server/profile/grReportTemplate.docx
ysPath: /data/cgav2/server/profile/ysReportTemplate.docx
allPath: /data/cgav2/server/profile/allReportTemplate.docx
reportDomain: /data/cgav2/profile
reportPath: /data/cgav2/profile
grPath: /data/cgav2/profile/grReportTemplate.docx
ysPath: /data/cgav2/profile/ysReportTemplate.docx
allPath: /data/cgav2/profile/allReportTemplate.docx
informed:
studySign: /data/cgav2/server/profile/studySign.png
template: /data/cgav2/server/profile/知情同意模板.docx
wordUrl: /data/cgav2/server/profile/informed/
prefixWord: /data/cgav2/server/
studySign: /data/cgav2/profile/studySign.png
template: /data/cgav2/profile/知情同意模板.docx
wordUrl: /data/cgav2/profile/informed/
prefixWord: /data/cgav2
#clientVersion: v1.6.8
#clientVersion: v1.8.1.0
#clientVersion: v1.8.2.0
clientVersion: v1.8.3.0
# 医院id,不同医院部署的时候需要修改
hospitalId: 106
generalPassword: cga123#
hospitalId: 180
generalPassword: hnsdlyy_123#

32
ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/PmsPatientDao.xml

@ -43,16 +43,13 @@
pp.id_card_type_other as idCardTypeOther,
pp.abo_blood_type as aboBloodType,
pp.rh_blood_type as rhBloodType,
MAX(ae.create_time) as lastEvaluationTime,
uu.nick_name as lastTesterName,
COUNT(ae.id) as evaluationCount,
(select nick_name from ums_user where user_name = pp.create_by and del_flag = 0) as creatorName,
pp.create_time as createTime
FROM
pms_patient pp
LEFT JOIN ems_evaluation ae on pp.id = ae.patient_id
LEFT JOIN ums_user uu on pp.create_by = uu.user_name
left join pms_patient_body pb on pp.id = pb.patient_id
left join ums_dept ud on pb.department = ud.dept_name
WHERE
pp.del_flag = 0
<if test="searchValue != null and searchValue != ''">
@ -65,16 +62,35 @@
or
pp.idcard like CONCAT('%',#{searchValue},'%')
or
pp.id = #{searchValue}
or
pb.outpatient_no like CONCAT('%',#{searchValue},'%')
)
</if>
<if test="idcard != null and idcard != ''">
and (pp.idcard = #{idcard} or pp.idcard = #{idcardEncrypt})
</if>
<!-- 权限 总测评师和测评师都是本部门及以下 -->
and uu.dept_id IN ( SELECT d.dept_id FROM ums_user u LEFT JOIN ums_dept d on (d.dept_id = u.dept_id or FIND_IN_SET(u.dept_id,ancestors))
WHERE user_id = #{userId}
)
<!-- &lt;!&ndash; 权限 总测评师和测评师都是本部门及以下 &ndash;&gt;-->
<!-- and uu.dept_id IN ( SELECT d.dept_id FROM ums_user u LEFT JOIN ums_dept d on (d.dept_id = u.dept_id or FIND_IN_SET(u.dept_id,ancestors))-->
<!-- WHERE user_id = #{userId}-->
<!-- )-->
<!--电力医院查看自己关联的部门信息-->
AND (
EXISTS (
SELECT 1 FROM ums_user WHERE user_id = #{userId} AND data_power = 'ALL'
)
OR
(
FIND_IN_SET(ud.dept_code,
(SELECT
CONCAT( d.dept_code, ',', u.data_power )
FROM
ums_user u LEFT JOIN ums_dept d on u.dept_id = d.dept_id and d.del_flag = 0
WHERE
u.user_id = #{userId})
)
)
)
<!-- <choose>-->
<!-- &lt;!&ndash; 测评师查看自己的患者 &ndash;&gt;-->

21
ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/RmsDao.xml

@ -1204,9 +1204,24 @@ group by ee.id
pp.idcard like CONCAT('%',#{dto.searchValue},'%')
)
</if>
<!-- 权限 总测评师和测评师都是本部门及以下 -->
and uu.dept_id IN ( SELECT d.dept_id FROM ums_user u LEFT JOIN ums_dept d on (d.dept_id = u.dept_id or FIND_IN_SET(u.dept_id,ancestors))
WHERE user_id = #{userId}
<!-- &lt;!&ndash; 权限 总测评师和测评师都是本部门及以下 &ndash;&gt;-->
<!-- and uu.dept_id IN ( SELECT d.dept_id FROM ums_user u LEFT JOIN ums_dept d on (d.dept_id = u.dept_id or FIND_IN_SET(u.dept_id,ancestors))-->
<!-- WHERE user_id = #{userId}-->
<!-- )-->
<!--电力医院查看自己关联的部门信息-->
AND (
EXISTS (
SELECT 1 FROM ums_user WHERE user_id = #{userId} AND data_power = 'ALL'
)
OR
(
FIND_IN_SET(uu.dept_id,
(SELECT
CONCAT(dept_id, ',', data_power)
FROM ums_user
WHERE user_id = #{userId})
)
)
)
group by ee.id
order by ee.create_time desc

10
ruisi_java/ruisi-web-examine/src/main/resources/application-prod.yml

@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://172.28.145.18:23306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://192.168.11.85:23306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: xian#2024!!!
# 从库数据源
@ -62,7 +62,7 @@ spring:
# redis 配置
redis:
# 地址
host: 172.28.147.15
host: 192.168.11.85
# 端口,默认为6379
port: 26379
# 数据库索引
@ -98,17 +98,17 @@ ht:
patientUrl: https://api.tall.wiki/ruisi/client/#
name: 认知功能评测云平台系统
file:
path: /data/ruisi/uploads/
path: /data/ruisi/server/uploads/
#domain: https://api.ccsens.com/test/
domain: http://localhost:8180/
imgDomain: https://api.tall.wiki/htageClient/profile
reportDomain: /data/cgav2/profile/report
reportPath: /data/cgav2/profile
reportPath: /data/ruisi/profile
informed:
studySign: /data/cgav2/profile/studySign.png
template: /data/cgav2/profile/知情同意模板.docx
wordUrl: /data/cgav2/profile/informed/
prefixWord: /data/ruisi
prefixWord: /data/ruisi/server
#clientVersion: v1.6.8
#clientVersion: v1.8.1.0
#clientVersion: v1.8.2.0

Loading…
Cancel
Save