Browse Source

编辑报告单时,将显示在历史报告单修改为1

sd
zhizhi wu 4 years ago
parent
commit
1bbf02f918
  1. 1
      ht/src/main/java/com/ccsens/ht/service/PatientReportService.java
  2. 111
      question/src/main/java/com/ccsens/question/service/PatientReportService.java

1
ht/src/main/java/com/ccsens/ht/service/PatientReportService.java

@ -150,6 +150,7 @@ public class PatientReportService implements IPatientReportService {
copy.setUrl(Constant.Ht.STRING_DEFAULT); copy.setUrl(Constant.Ht.STRING_DEFAULT);
copy.setQrCodeUrl(Constant.Ht.STRING_DEFAULT); copy.setQrCodeUrl(Constant.Ht.STRING_DEFAULT);
copy.setCompleteStatus(Constant.Ht.Report.COMPLETE_OK); copy.setCompleteStatus(Constant.Ht.Report.COMPLETE_OK);
copy.setShowStatus(Constant.Ht.Report.SHOW_HISTORY);
htPatientReportDao.updateByPrimaryKeySelective(copy); htPatientReportDao.updateByPrimaryKeySelective(copy);
log.info("成功编辑报告单信息"); log.info("成功编辑报告单信息");
HtPatientReportRecord record = new HtPatientReportRecord(); HtPatientReportRecord record = new HtPatientReportRecord();

111
question/src/main/java/com/ccsens/question/service/PatientReportService.java

@ -25,7 +25,6 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.pagehelper.StringUtil; import com.github.pagehelper.StringUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -69,35 +68,34 @@ public class PatientReportService implements IPatientReportService {
@Override @Override
public JsonResponse<PatientReportVo.Generate> generatePatientReport(PatientReportDto.Generate generate, Long userId) { public JsonResponse<PatientReportVo.Generate> generatePatientReport(PatientReportDto.Generate generate, Long userId) {
log.info("生成报告单请求参数:userId:{}, patientReport:{}", userId, generate); log.info("生成报告单请求参数:userId:{}, patientReport:{}", userId, generate);
// //查询医生信息 //查询医生信息
// HtDoctorExample doctorExample = new HtDoctorExample(); HtDoctorExample doctorExample = new HtDoctorExample();
// doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT); doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT);
// List<HtDoctor> doctors = htDoctorDao.selectByExample(doctorExample); List<HtDoctor> doctors = htDoctorDao.selectByExample(doctorExample);
// if (CollectionUtils.isEmpty(doctors)) { if (CollectionUtils.isEmpty(doctors)) {
// log.info("根据userId未找到审核通过的医生信息:{}", userId); log.info("根据userId未找到审核通过的医生信息:{}", userId);
// return JsonResponse.newInstance().ok(CodeEnum.PARAM_ERROR); return JsonResponse.newInstance().ok(CodeEnum.PARAM_ERROR);
// } }
// //查询病人信息 //查询病人信息
// HtPatient htPatient = htPatientMapper.selectByPrimaryKey(generate.getPatientId()); HtPatient htPatient = htPatientMapper.selectByPrimaryKey(generate.getPatientId());
// if (htPatient == null) { if (htPatient == null) {
// log.info("根据patientId未找到病友信息:{}", generate.getPatientId()); log.info("根据patientId未找到病友信息:{}", generate.getPatientId());
// return JsonResponse.newInstance().ok(CodeEnum.PARAM_ERROR); return JsonResponse.newInstance().ok(CodeEnum.PARAM_ERROR);
// } }
HtPatientReport htPatientReport = new HtPatientReport(); HtPatientReport htPatientReport = new HtPatientReport();
htPatientReport.setId(snowflake.nextId()); htPatientReport.setId(snowflake.nextId());
// htPatientReport.setDoctorId(doctors.get(0).getId()); htPatientReport.setDoctorId(doctors.get(0).getId());
htPatientReport.setUserId(userId);
htPatientReport.setPatientId(generate.getPatientId()); htPatientReport.setPatientId(generate.getPatientId());
// htPatientReport.setPatientIdcard(htPatient.getIdcard()); htPatientReport.setPatientIdcard(htPatient.getIdcard());
// htPatientReport.setPatientAge(StrUtil.isEmpty(htPatient.getIdcard()) ? null : (byte)IdcardUtil.getAgeByIdCard(htPatient.getIdcard())); htPatientReport.setPatientAge(StrUtil.isEmpty(htPatient.getIdcard()) ? null : (byte)IdcardUtil.getAgeByIdCard(htPatient.getIdcard()));
htPatientReport.setEvaluationCode(Constant.Ht.Report.PARENT_CODE); htPatientReport.setEvaluationCode(Constant.Ht.Report.PARENT_CODE);
htPatientReport.setName(Constant.Ht.Report.PARENT_NAME + DateUtil.today()); htPatientReport.setName(Constant.Ht.Report.PARENT_NAME + DateUtil.today());
htPatientReport.setReportTime(System.currentTimeMillis()); htPatientReport.setReportTime(System.currentTimeMillis());
// 查询医院信息 // 查询医院信息
// String hospital = htPositionDao.queryHospital(doctors.get(0).getPositionId()); String hospital = htPositionDao.queryHospital(doctors.get(0).getPositionId());
// htPatientReport.setHospital(hospital); htPatientReport.setHospital(hospital);
htPatientReportDao.insertSelective(htPatientReport); htPatientReportDao.insertSelective(htPatientReport);
log.info("生成病友报告单:{}", generate); log.info("生成病友报告单:{}", generate);
PatientReportVo.Generate generateVo = new PatientReportVo.Generate(); PatientReportVo.Generate generateVo = new PatientReportVo.Generate();
@ -152,6 +150,7 @@ public class PatientReportService implements IPatientReportService {
copy.setUrl(Constant.Ht.STRING_DEFAULT); copy.setUrl(Constant.Ht.STRING_DEFAULT);
copy.setQrCodeUrl(Constant.Ht.STRING_DEFAULT); copy.setQrCodeUrl(Constant.Ht.STRING_DEFAULT);
copy.setCompleteStatus(Constant.Ht.Report.COMPLETE_OK); copy.setCompleteStatus(Constant.Ht.Report.COMPLETE_OK);
copy.setShowStatus(Constant.Ht.Report.SHOW_HISTORY);
htPatientReportDao.updateByPrimaryKeySelective(copy); htPatientReportDao.updateByPrimaryKeySelective(copy);
log.info("成功编辑报告单信息"); log.info("成功编辑报告单信息");
HtPatientReportRecord record = new HtPatientReportRecord(); HtPatientReportRecord record = new HtPatientReportRecord();
@ -169,17 +168,17 @@ public class PatientReportService implements IPatientReportService {
public PageInfo<PatientReportVo.ReportName> queryReports(PatientReportDto.QueryReports query, Long userId) { public PageInfo<PatientReportVo.ReportName> queryReports(PatientReportDto.QueryReports query, Long userId) {
//查询医生信息 //查询医生信息
// HtDoctorExample doctorExample = new HtDoctorExample(); HtDoctorExample doctorExample = new HtDoctorExample();
// doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT); doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT);
// List<HtDoctor> doctors = htDoctorDao.selectByExample(doctorExample); List<HtDoctor> doctors = htDoctorDao.selectByExample(doctorExample);
// log.info("当前用户是否为医生:{}", CollectionUtil.isNotEmpty(doctors)); log.info("当前用户是否为医生:{}", CollectionUtil.isNotEmpty(doctors));
// 获取医生ID和病人ID // 获取医生ID和病人ID
Long patientId = null; Long patientId = null;
Long doctorId = null; Long doctorId = null;
if (query.getPatientId() != null) { if (query.getPatientId() != null) {
patientId = query.getPatientId(); patientId = query.getPatientId();
// } else if (CollectionUtil.isNotEmpty(doctors)) { } else if (CollectionUtil.isNotEmpty(doctors)) {
// doctorId = doctors.get(0).getId(); doctorId = doctors.get(0).getId();
} else { } else {
log.info("既无病人信息,有无医生信息,不允许查询"); log.info("既无病人信息,有无医生信息,不允许查询");
throw new BaseException(CodeEnum.PARAM_ERROR); throw new BaseException(CodeEnum.PARAM_ERROR);
@ -187,32 +186,34 @@ public class PatientReportService implements IPatientReportService {
//分页查询报告单列表 //分页查询报告单列表
PageHelper.startPage(query.getPageNum(), query.getPageSize()); PageHelper.startPage(query.getPageNum(), query.getPageSize());
List<PatientReportVo.ReportName> reportVos = htPatientReportDao.queryReportName(doctorId, patientId); List<PatientReportVo.ReportName> reportVos = htPatientReportDao.queryReportName(doctorId, patientId);
// if (CollectionUtils.isEmpty(reportVos)) { if (CollectionUtils.isEmpty(reportVos)) {
// return new PageInfo<>(reportVos); return new PageInfo<>(reportVos);
// } }
// if (CollectionUtil.isEmpty(doctors)) {
// return new PageInfo<>(reportVos);
// } if (CollectionUtil.isEmpty(doctors)) {
// HtDoctor doctor = doctors.get(0); return new PageInfo<>(reportVos);
// //查询下属职务 }
// List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId()); HtDoctor doctor = doctors.get(0);
// reportVos.forEach(reportVo -> { //查询下属职务
// List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId());
// //自己的可见详情 reportVos.forEach(reportVo -> {
// if (doctor.getId().equals(reportVo.getDoctorId())) {
// reportVo.setAuthority((byte)1); //自己的可见详情
// } else if (CollectionUtils.isEmpty(lowerPositionIds)) { if (doctor.getId().equals(reportVo.getDoctorId())) {
// reportVo.setAuthority((byte)0); reportVo.setAuthority((byte)1);
// } else { } else if (CollectionUtils.isEmpty(lowerPositionIds)) {
// HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(reportVo.getDoctorId()); reportVo.setAuthority((byte)0);
// //自己下属的可见详情 } else {
// if (lowerPositionIds.contains(reportDoctor.getPositionId())) { HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(reportVo.getDoctorId());
// reportVo.setAuthority((byte)1); //自己下属的可见详情
// } else { if (lowerPositionIds.contains(reportDoctor.getPositionId())) {
// reportVo.setAuthority((byte)0); reportVo.setAuthority((byte)1);
// } } else {
// } reportVo.setAuthority((byte)0);
// }); }
}
});
return new PageInfo<>(reportVos); return new PageInfo<>(reportVos);
} }
@ -405,7 +406,7 @@ public class PatientReportService implements IPatientReportService {
dateCell.setBorderBottom(null); dateCell.setBorderBottom(null);
dateCell.setBorderLeft(null); dateCell.setBorderLeft(null);
content.add(row2); content.add(row2);
log.info("导出列表:{}", content);
String path = PropUtil.imgDomain + "/" + PdfUtil.credatePdf(PropUtil.path, detail.getPatient().getHospital(), Constant.Ht.Report.PARENT_NAME, detail.getPatient().toPdfRow(), content, new PdfUtil.Margin()); String path = PropUtil.imgDomain + "/" + PdfUtil.credatePdf(PropUtil.path, detail.getPatient().getHospital(), Constant.Ht.Report.PARENT_NAME, detail.getPatient().toPdfRow(), content, new PdfUtil.Margin());
report.setUrl(path); report.setUrl(path);
htPatientReportDao.updateByPrimaryKeySelective(report); htPatientReportDao.updateByPrimaryKeySelective(report);
@ -606,4 +607,6 @@ public class PatientReportService implements IPatientReportService {
List<PatientReportSearchVo.Search> list = htPatientReportDao.search(param.getCodes()); List<PatientReportSearchVo.Search> list = htPatientReportDao.search(param.getCodes());
return list; return list;
} }
} }

Loading…
Cancel
Save