@ -252,7 +252,7 @@ public class WisdomCarService implements IWisdomCarService {
for ( ProjectVo . TaskSub taskSub : taskDetail . getTaskSubList ( ) ) {
StepTask stepTask = new StepTask ( ) ;
stepTask . setId ( snowflake . nextId ( ) ) ;
stepTask . setBatch ( 1L ) ;
stepTask . setBatch ( data . getId ( ) ) ;
stepTask . setPatientId ( patient . getId ( ) ) ;
stepTask . setTaskSubId ( taskSub . getTaskSubId ( ) ) ;
if ( CollectionUtil . isNotEmpty ( steps ) ) {
@ -304,17 +304,18 @@ public class WisdomCarService implements IWisdomCarService {
if ( 0 = = carIsExist ) {
throw new BaseException ( CodeEnum . WISDOM_CAR_IS_EXIST ) ;
}
//查询任务是否存在
Integer taskIsExist = stepTaskDao . findTaskIsExist ( param . getTaskSubId ( ) ) ;
if ( 0 = = taskIsExist ) {
throw new BaseException ( CodeEnum . TASK_IS_EXIST ) ;
}
// //查询任务是否存在
// Integer taskIsExist = stepTaskDao.findTaskIsExist(param.getTaskSubId());
// if (0 == taskIsExist){
// throw new BaseException(CodeEnum.TASK_IS_EXIST);
// }
//查询任务是否是分诊环节的任务ID
// Integer taskIsTriageTask = stepTaskDao.findTaskIsTriageTask(param.getTaskSubId());
// if (0 == taskIsTriageTask){
// throw new BaseException(CodeEnum.PARAM_ERROR);
// }
//查询患者是否存在
// TODO 患者校验需重设置
Integer patientIsExist = patientProjectDao . findPatientIsExist ( param . getProjectId ( ) ) ;
if ( 0 = = patientIsExist ) {
throw new BaseException ( Constant . PATIENT_NOT_FOUND ) ;
@ -331,6 +332,7 @@ public class WisdomCarService implements IWisdomCarService {
throw new BaseException ( CodeEnum . WISDOM_CAR_RUNNED ) ;
}
// 查询患者信息
// TODO 患者校验需重设置
PatientProjectExample projectExample = new PatientProjectExample ( ) ;
projectExample . createCriteria ( ) . andProjectIdEqualTo ( param . getProjectId ( ) ) ;
List < PatientProject > patientProjects = patientProjectDao . selectByExample ( projectExample ) ;
@ -345,7 +347,8 @@ public class WisdomCarService implements IWisdomCarService {
// 绑定平车
PatientWisdomCar pc = new PatientWisdomCar ( ) ;
pc . setId ( snowflake . nextId ( ) ) ;
pc . setTaskSubId ( param . getTaskSubId ( ) ) ;
// pc.setTaskSubId(param.getTaskSubId());
pc . setBatch ( param . getProjectId ( ) ) ;
pc . setPatientId ( patient . getId ( ) ) ;
pc . setCarId ( param . getCarId ( ) ) ;
pc . setStartTime ( param . getStartTime ( ) ) ;
@ -364,12 +367,7 @@ public class WisdomCarService implements IWisdomCarService {
}
// 更新患者数据中,尚未绑定平车的数据
patientDataDao . updateCarId ( pc . getId ( ) , param . getTaskSubId ( ) ) ;
// 添加分诊任务开始
com . ccsens . wisdomcar . bean . dto . ProjectDto . Start start = new com . ccsens . wisdomcar . bean . dto . ProjectDto . Start ( ) ;
start . setTaskSubId ( param . getTaskSubId ( ) ) ;
start . setStartTime ( param . getStartTime ( ) ) ;
projectService . start ( start , userId ) ;
patientDataDao . updateCarId ( pc . getId ( ) , param . getProjectId ( ) ) ;
}
@Override
@ -379,7 +377,7 @@ public class WisdomCarService implements IWisdomCarService {
@Override
public List < WisdomCarVo . BindingCarInfo > queryBindingCar ( WisdomCarDto . QueryInfo param ) {
List < WisdomCarVo . BindingCarInfo > bindingCarList = patientWisdomCarDao . queryBindingCarList ( param . getTaskSub Id ( ) ) ;
List < WisdomCarVo . BindingCarInfo > bindingCarList = patientWisdomCarDao . queryBindingCarList ( param . getProject Id ( ) ) ;
if ( CollectionUtil . isEmpty ( bindingCarList ) ) {
// log.info("未找到对应的任务");
// throw new BaseException(CodeEnum.PARAM_ERROR);