|
|
|
@ -7,6 +7,7 @@ import com.docus.server.archive.constans.SyncConstant;
|
|
|
|
import com.docus.server.archive.converter.MzsyPatientInfoConverter;
|
|
|
|
import com.docus.server.archive.converter.MzsyPatientInfoConverter;
|
|
|
|
import com.docus.server.archive.entity.PowerUser;
|
|
|
|
import com.docus.server.archive.entity.PowerUser;
|
|
|
|
import com.docus.server.archive.entity.TBasic;
|
|
|
|
import com.docus.server.archive.entity.TBasic;
|
|
|
|
|
|
|
|
import com.docus.server.archive.entity.TBasicZkInfo;
|
|
|
|
import com.docus.server.archive.mapper.PowerUserMapper;
|
|
|
|
import com.docus.server.archive.mapper.PowerUserMapper;
|
|
|
|
import com.docus.server.archive.mapper.TBasicMapper;
|
|
|
|
import com.docus.server.archive.mapper.TBasicMapper;
|
|
|
|
import com.docus.server.archive.service.PatientInfoSyncService;
|
|
|
|
import com.docus.server.archive.service.PatientInfoSyncService;
|
|
|
|
@ -53,7 +54,7 @@ public class MzsyPatientInfoSyncServiceImpl implements PatientInfoSyncService {
|
|
|
|
public void syncByModifyTimeAndCyrq(String cyrqStart, String startTime) {
|
|
|
|
public void syncByModifyTimeAndCyrq(String cyrqStart, String startTime) {
|
|
|
|
int size = 1000;
|
|
|
|
int size = 1000;
|
|
|
|
int pageNumber = 1;
|
|
|
|
int pageNumber = 1;
|
|
|
|
log.info("参数"+cyrqStart+startTime);
|
|
|
|
log.info("参数" + cyrqStart + startTime);
|
|
|
|
while (true) {
|
|
|
|
while (true) {
|
|
|
|
List<MzsyPatientInfoView> patientInfoViews = mzsyPatientInfoViewMapper.pageByViwe(cyrqStart, startTime, pageNumber, size);
|
|
|
|
List<MzsyPatientInfoView> patientInfoViews = mzsyPatientInfoViewMapper.pageByViwe(cyrqStart, startTime, pageNumber, size);
|
|
|
|
if (Func.isNotEmpty(patientInfoViews)) {
|
|
|
|
if (Func.isNotEmpty(patientInfoViews)) {
|
|
|
|
@ -62,11 +63,11 @@ public class MzsyPatientInfoSyncServiceImpl implements PatientInfoSyncService {
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
List<String> collect = basicList.stream().map(TBasic::getAttending).collect(Collectors.toList());
|
|
|
|
List<String> collect = basicList.stream().map(TBasic::getAttending).collect(Collectors.toList());
|
|
|
|
List<PowerUser> byUserNames = powerUserMapper.findByUserNames(collect);
|
|
|
|
List<PowerUser> byUserNames = powerUserMapper.findByUserNames(collect);
|
|
|
|
if(ObjectUtil.isNotEmpty(byUserNames)){
|
|
|
|
if (ObjectUtil.isNotEmpty(byUserNames)) {
|
|
|
|
Map<String, String> map = byUserNames.stream().collect(Collectors.toMap(PowerUser::getUserName, PowerUser::getName));
|
|
|
|
Map<String, String> map = byUserNames.stream().collect(Collectors.toMap(PowerUser::getUserName, PowerUser::getName));
|
|
|
|
for (TBasic tBasic : basicList) {
|
|
|
|
for (TBasic tBasic : basicList) {
|
|
|
|
String attending = tBasic.getAttending();
|
|
|
|
String attending = tBasic.getAttending();
|
|
|
|
if(ObjectUtil.isNotEmpty(attending)) {
|
|
|
|
if (ObjectUtil.isNotEmpty(attending)) {
|
|
|
|
tBasic.setAttendingName(map.get(attending));
|
|
|
|
tBasic.setAttendingName(map.get(attending));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -125,7 +126,7 @@ public class MzsyPatientInfoSyncServiceImpl implements PatientInfoSyncService {
|
|
|
|
tBasic.setFileSource(iuBasic.getFileSource());
|
|
|
|
tBasic.setFileSource(iuBasic.getFileSource());
|
|
|
|
tBasic.setUpdateTime(nowDate);
|
|
|
|
tBasic.setUpdateTime(nowDate);
|
|
|
|
updateBasicList.add(tBasic);
|
|
|
|
updateBasicList.add(tBasic);
|
|
|
|
if(ObjectUtil.isNotEmpty(iuBasic.getLeaveMethod())){
|
|
|
|
if (ObjectUtil.isNotEmpty(iuBasic.getLeaveMethod())) {
|
|
|
|
tBasic.setLeaveMethod(iuBasic.getLeaveMethod());
|
|
|
|
tBasic.setLeaveMethod(iuBasic.getLeaveMethod());
|
|
|
|
leaveMethodList.add(tBasic);
|
|
|
|
leaveMethodList.add(tBasic);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -135,7 +136,7 @@ public class MzsyPatientInfoSyncServiceImpl implements PatientInfoSyncService {
|
|
|
|
iuBasic.setCreateTime(nowDate);
|
|
|
|
iuBasic.setCreateTime(nowDate);
|
|
|
|
iuBasic.setUpdateTime(nowDate);
|
|
|
|
iuBasic.setUpdateTime(nowDate);
|
|
|
|
iuBasic.setIsArchive(0);
|
|
|
|
iuBasic.setIsArchive(0);
|
|
|
|
if(ObjectUtil.isNotEmpty(iuBasic.getLeaveMethod())){
|
|
|
|
if (ObjectUtil.isNotEmpty(iuBasic.getLeaveMethod())) {
|
|
|
|
leaveMethodList.add(iuBasic);
|
|
|
|
leaveMethodList.add(iuBasic);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
insertBasicList.add(iuBasic);
|
|
|
|
insertBasicList.add(iuBasic);
|
|
|
|
@ -143,12 +144,38 @@ public class MzsyPatientInfoSyncServiceImpl implements PatientInfoSyncService {
|
|
|
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(insertBasicList)) {
|
|
|
|
if (Func.isNotEmpty(insertBasicList)) {
|
|
|
|
tBasicMapper.insertBatch(insertBasicList);
|
|
|
|
tBasicMapper.insertBatch(insertBasicList);
|
|
|
|
|
|
|
|
syncZkInfo(insertBasicList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (Func.isNotEmpty(updateBasicList)) {
|
|
|
|
if (Func.isNotEmpty(updateBasicList)) {
|
|
|
|
tBasicMapper.updateBatch(updateBasicList);
|
|
|
|
tBasicMapper.updateBatch(updateBasicList);
|
|
|
|
|
|
|
|
syncZkInfo(updateBasicList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (Func.isNotEmpty(leaveMethodList)) {
|
|
|
|
if (Func.isNotEmpty(leaveMethodList)) {
|
|
|
|
tBasicMapper.updateExtend(leaveMethodList);
|
|
|
|
tBasicMapper.updateExtend(leaveMethodList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 同步转科信息
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private void syncZkInfo(List<TBasic> tBasicList) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
for (TBasic tBasic : tBasicList) {
|
|
|
|
|
|
|
|
List<TBasicZkInfo> tBasicZkInfoList = mzsyPatientInfoViewMapper.listZkInfo(tBasic.getJzh());
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(tBasicZkInfoList)) {
|
|
|
|
|
|
|
|
tBasicMapper.delZkInfo(tBasic.getPatientId());
|
|
|
|
|
|
|
|
for (TBasicZkInfo tBasicZkInfo : tBasicZkInfoList) {
|
|
|
|
|
|
|
|
tBasicZkInfo.setId(idService.getDateSeq());
|
|
|
|
|
|
|
|
tBasicZkInfo.setPatientId(tBasic.getPatientId());
|
|
|
|
|
|
|
|
tBasicZkInfo.setCreateTime(new Date());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
tBasicMapper.addZkInfo(tBasicZkInfoList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
log.error("添加转科信息出错了:" + e.getMessage(), e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|