|
|
@ -268,6 +268,31 @@ public class WisdomCarService implements IWisdomCarService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void bindingCar(WisdomCarDto.BindingCar param, Long userId) { |
|
|
|
//查询平车id是否存在
|
|
|
|
Integer carIsExist = wisdomcarDao.findCarIsExist(param.getCarId()); |
|
|
|
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); |
|
|
|
} |
|
|
|
//查询任务是否是分诊环节的任务ID
|
|
|
|
Integer taskIsTriageTask = stepTaskDao.findTaskIsTriageTask(param.getTaskSubId()); |
|
|
|
if (0 == taskIsTriageTask){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
//查询患者是否存在
|
|
|
|
Integer patientIsExist = patientProjectDao.findPatientIsExist(param.getProjectId()); |
|
|
|
if (0 == patientIsExist){ |
|
|
|
throw new BaseException(Constant.PATIENT_NOT_FOUND); |
|
|
|
} |
|
|
|
//开始时间不能大于当前时间,结束时间不能小于开始时间
|
|
|
|
System.out.println(System.currentTimeMillis()); |
|
|
|
if (param.getEndTime() < param.getStartTime() || param.getStartTime() > System.currentTimeMillis()){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
// 判断平车是否在运行中
|
|
|
|
long count = wisdomcarDao.countUsed(param.getCarId(), param.getStartTime(), param.getEndTime()); |
|
|
|
if (count >0) { |
|
|
|