|
|
|
@ -319,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查找用户
|
|
|
|
@ -327,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(generalPassword)); |
|
|
|
log.info("master新增用户信息:{}", sysUser); |
|
|
|
sysUserMapper.insertUser(sysUser); |
|
|
|
}else { |
|
|
|
sysUser.setUserId(users.get(0).getUserId()); |
|
|
|
log.info("master更新用户信息:{}", sysUser); |
|
|
|
sysUserMapper.updateUser(sysUser); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -467,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查找系统的部门信息
|
|
|
|
@ -474,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); |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -976,11 +983,11 @@ public class DockServiceImpl implements DockService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<DockVo.PatientVisitInfo> getPatientVisitView(Date startTime) { |
|
|
|
Date endTime = new Date(); |
|
|
|
if(ObjectUtil.isNull(startTime)){ |
|
|
|
//如果是空,取一年前的时间
|
|
|
|
startTime = DateUtil.offset(new Date(), DateField.YEAR, -1); |
|
|
|
//如果是空,查全部
|
|
|
|
endTime = null; |
|
|
|
} |
|
|
|
Date endTime = new Date(); |
|
|
|
return oracleViewDao.getPatientVisitView(startTime, endTime); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1007,7 +1014,9 @@ public class DockServiceImpl implements DockService { |
|
|
|
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()); |
|
|
|
|