|
|
@@ -6,6 +6,8 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.tr.core.exception.TRExcCode;
|
|
|
import cn.tr.core.strategy.LoginUserStrategy;
|
|
|
+import cn.tr.module.smart.app.controller.dto.WxDoctorClinicFinishDTO;
|
|
|
+import cn.tr.module.smart.app.controller.dto.WxDoctorClinicQuestionDTO;
|
|
|
import cn.tr.module.smart.app.controller.dto.WxDoctorClinicRoomDTO;
|
|
|
import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomVO;
|
|
|
import cn.tr.module.smart.common.dto.BizDeptDTO;
|
|
|
@@ -22,6 +24,7 @@ import cn.tr.module.smart.wx.controller.vo.BizWxDeptQuestionVO;
|
|
|
import cn.tr.module.smart.wx.dto.BizClinicAddOrEditDTO;
|
|
|
import cn.tr.module.smart.wx.dto.BizWxAppletClinicQueryDTO;
|
|
|
import cn.tr.module.smart.wx.dto.BizWxAppletFinishClinicDTO;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -66,6 +69,9 @@ public class BizClinicRoomServiceImpl implements IBizClinicRoomService {
|
|
|
@Autowired
|
|
|
private IBizQuestionService bizQuestionService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IBizQuestionAnswerService bizQuestionAnswerService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IBizDeptService bizDeptService;
|
|
|
|
|
|
@@ -333,6 +339,49 @@ public class BizClinicRoomServiceImpl implements IBizClinicRoomService {
|
|
|
return baseRepository.selectByClinicRoomAndPatientList(source);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param finishDTO
|
|
|
+ * @description: 手术结束
|
|
|
+ * @author wangzl
|
|
|
+ * @date 2025/7/14
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean finishClinic(WxDoctorClinicFinishDTO finishDTO) {
|
|
|
+ BizClinicRoomPO clinicRoom = baseRepository.selectById(finishDTO.getClinicId());
|
|
|
+ if (ObjectUtil.isNull(clinicRoom)) {
|
|
|
+ throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "手术信息不存在");
|
|
|
+ }
|
|
|
+ if (ClinicPhaseEnums.AFTER.equals(clinicRoom.getClinicStatus())) {
|
|
|
+ throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "手术已结束,无法结束手术");
|
|
|
+ }
|
|
|
+ int update = baseRepository.update(null, new LambdaUpdateWrapper<BizClinicRoomPO>()
|
|
|
+ .set(BizClinicRoomPO::getClinicStatus, ClinicPhaseEnums.AFTER)
|
|
|
+ .set(BizClinicRoomPO::getClinicEndTime, finishDTO.getClinicEndTime())
|
|
|
+ .eq(BizClinicRoomPO::getId, finishDTO.getClinicId()));
|
|
|
+ return update != 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param clinicId
|
|
|
+ * @description: 术前问卷信息
|
|
|
+ * @author wangzl
|
|
|
+ * @date 2025/7/14
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public WxDoctorClinicQuestionDTO selectQuestionnaire(String clinicId) {
|
|
|
+ BizClinicRoomPO bizClinicRoomPO = baseRepository.selectById(clinicId);
|
|
|
+ if (ObjectUtil.isNull(bizClinicRoomPO)) {
|
|
|
+ throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "手术信息不存在");
|
|
|
+ }
|
|
|
+ WxDoctorClinicQuestionDTO questionDTO = new WxDoctorClinicQuestionDTO();
|
|
|
+ questionDTO.setClinicId(clinicId);
|
|
|
+ questionDTO.setPatientName(bizClinicRoomPO.getPatientName());
|
|
|
+ questionDTO.setPatientGender(bizClinicRoomPO.getPatientGender());
|
|
|
+ questionDTO.setPatientAge(bizClinicRoomPO.getPatientAge());
|
|
|
+ questionDTO.setQuestionnaire(bizQuestionAnswerService.stdSelectWxAppletPreSurgeryQuestionnaire(clinicId));
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 微信小程序基于医生已填写的信息更新数据
|
|
|
*/
|