|
|
@ -36,10 +36,7 @@ import org.springframework.transaction.annotation.Propagation; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import java.util.ArrayList; |
|
|
import java.util.*; |
|
|
import java.util.Date; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -925,17 +922,20 @@ public class DockServiceImpl implements DockService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<DockVo.DeptInfo> getDeptView() { |
|
|
public List<DockVo.DeptInfo> getDeptView() { |
|
|
// 当前时间
|
|
|
return oracleViewDao.getDeptView(); |
|
|
Date endTime = new Date(); |
|
|
|
|
|
// 一小时前的时间
|
|
|
|
|
|
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000); |
|
|
|
|
|
return oracleViewDao.getDeptView(startTime, endTime); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void syncDeptView(List<DockVo.DeptInfo> sysDepts) { |
|
|
public void syncDeptView(List<DockVo.DeptInfo> sysDepts) { |
|
|
if(CollUtil.isNotEmpty(sysDepts)){ |
|
|
if(CollUtil.isNotEmpty(sysDepts)){ |
|
|
for (DockVo.DeptInfo sysDept : 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 dockDept = new DockDept(); |
|
|
dockDept.setDeptName(sysDept.getDeptName()); |
|
|
dockDept.setDeptName(sysDept.getDeptName()); |
|
|
dockDept.setDeptCode(sysDept.getDeptCode()); |
|
|
dockDept.setDeptCode(sysDept.getDeptCode()); |
|
|
@ -947,15 +947,20 @@ public class DockServiceImpl implements DockService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<DockVo.EmplInfo> getEmplView() { |
|
|
public List<DockVo.EmplInfo> getEmplView() { |
|
|
Date endTime = new Date(); |
|
|
return oracleViewDao.getEmplView(); |
|
|
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000); |
|
|
|
|
|
return oracleViewDao.getEmplView(startTime, endTime); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void syncEmplView(List<DockVo.EmplInfo> sysEmpls) { |
|
|
public void syncEmplView(List<DockVo.EmplInfo> sysEmpls) { |
|
|
if(CollUtil.isNotEmpty(sysEmpls)){ |
|
|
if(CollUtil.isNotEmpty(sysEmpls)){ |
|
|
for (DockVo.EmplInfo sysEmpl : 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 dockEmpl = new DockEmpl(); |
|
|
dockEmpl.setEmplName(sysEmpl.getEmplName()); |
|
|
dockEmpl.setEmplName(sysEmpl.getEmplName()); |
|
|
dockEmpl.setEmplCode(sysEmpl.getEmplCode()); |
|
|
dockEmpl.setEmplCode(sysEmpl.getEmplCode()); |
|
|
@ -970,54 +975,27 @@ public class DockServiceImpl implements DockService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<DockVo.PatientBasicInfo> getPatientBasicView() { |
|
|
public List<DockVo.PatientVisitInfo> getPatientVisitView(Date startTime) { |
|
|
Date endTime = new Date(); |
|
|
if(ObjectUtil.isNull(startTime)){ |
|
|
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000); |
|
|
//如果是空,取一年前的时间
|
|
|
return oracleViewDao.getPatientBasicView(startTime, endTime); |
|
|
startTime = DateUtil.offset(new Date(), DateField.YEAR, -1); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@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); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public List<DockVo.PatientVisitInfo> getPatientVisitView() { |
|
|
|
|
|
Date endTime = new Date(); |
|
|
Date endTime = new Date(); |
|
|
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000); |
|
|
|
|
|
return oracleViewDao.getPatientVisitView(startTime, endTime); |
|
|
return oracleViewDao.getPatientVisitView(startTime, endTime); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@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)){ |
|
|
if(CollUtil.isNotEmpty(sysVisits)){ |
|
|
for (DockVo.PatientVisitInfo sysVisit : sysVisits) { |
|
|
for (DockVo.PatientVisitInfo sysVisit : sysVisits) { |
|
|
|
|
|
//根据就诊流水号查询就诊信息是否存在
|
|
|
|
|
|
DockPatientVisitInfoExample example = new DockPatientVisitInfoExample(); |
|
|
|
|
|
example.createCriteria().andVisitNoEqualTo(sysVisit.getVisitNo()); |
|
|
|
|
|
long l = dockPatientVisitInfoMapper.countByExample(example); |
|
|
|
|
|
if(l>0){ |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
DockPatientVisitInfo dockPatientVisit = new DockPatientVisitInfo(); |
|
|
DockPatientVisitInfo dockPatientVisit = new DockPatientVisitInfo(); |
|
|
dockPatientVisit.setVisitNo(sysVisit.getVisitNo()); |
|
|
dockPatientVisit.setVisitNo(sysVisit.getVisitNo()); |
|
|
dockPatientVisit.setPatientNo(sysVisit.getPatientNo()); |
|
|
dockPatientVisit.setPatientNo(sysVisit.getPatientNo()); |
|
|
@ -1058,15 +1036,53 @@ public class DockServiceImpl implements DockService { |
|
|
dockPatientVisit.setAllergyDrug(sysVisit.getAllergyDrug()); |
|
|
dockPatientVisit.setAllergyDrug(sysVisit.getAllergyDrug()); |
|
|
dockPatientVisit.setSync(String.valueOf(0)); |
|
|
dockPatientVisit.setSync(String.valueOf(0)); |
|
|
dockPatientVisitInfoMapper.insertSelective(dockPatientVisit); |
|
|
dockPatientVisitInfoMapper.insertSelective(dockPatientVisit); |
|
|
|
|
|
visitList.add(sysVisit); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
return visitList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<DockVo.DiagnosisInfo> getDiagnosisView() { |
|
|
public List<DockVo.PatientBasicInfo> getPatientBasicView(List<String> patientNos) { |
|
|
Date endTime = new Date(); |
|
|
return oracleViewDao.getPatientBasicView(patientNos); |
|
|
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000); |
|
|
} |
|
|
return oracleViewDao.getDiagnosisView(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); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public List<DockVo.DiagnosisInfo> getDiagnosisView(List<String> visitNos) { |
|
|
|
|
|
return oracleViewDao.getDiagnosisView(visitNos); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@ -1087,10 +1103,8 @@ public class DockServiceImpl implements DockService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<DockVo.MedicationInfo> getMedicationView() { |
|
|
public List<DockVo.MedicationInfo> getMedicationView(List<String> visitNos) { |
|
|
Date endTime = new Date(); |
|
|
return oracleViewDao.getMedicationView(visitNos); |
|
|
Date startTime = new Date(System.currentTimeMillis() - 60 * 60 * 1000); |
|
|
|
|
|
return oracleViewDao.getMedicationView(startTime, endTime); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@ -1109,4 +1123,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; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|