|
|
|
@ -11,6 +11,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
|
import com.ruoyi.common.utils.RequestParamsUtil;
|
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
|
import com.ruoyi.common.utils.file.FileUtils;
|
|
|
|
|
import com.ruoyi.common.utils.http.HttpUtils;
|
|
|
|
@ -25,11 +26,8 @@ import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import sun.misc.BASE64Decoder;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.ZoneId;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@ -501,4 +499,34 @@ public class AppController extends BaseController
|
|
|
|
|
return jsonObject;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 添加记录
|
|
|
|
|
*
|
|
|
|
|
* @param patientId 患者id
|
|
|
|
|
* @return {@code AjaxResult}
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("新增预约记录")
|
|
|
|
|
@Log(title = "App新增预约记录", businessType = BusinessType.INSERT)
|
|
|
|
|
@PostMapping("/record/add/{patientId}")
|
|
|
|
|
public AjaxResult addRecord(@PathVariable Long patientId)
|
|
|
|
|
{
|
|
|
|
|
TRecord tRecord = new TRecord();
|
|
|
|
|
tRecord.setHospitalId(SecurityUtils.getLoginUser().getUser().getHospitalId());
|
|
|
|
|
tRecord.setPatientId(patientId);
|
|
|
|
|
tRecord.setDoctorId(getUserId());
|
|
|
|
|
tRecord.setStatus("0");
|
|
|
|
|
tRecord.setCreateBy(getUsername());
|
|
|
|
|
tRecordService.insertTRecord(tRecord);
|
|
|
|
|
TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor();
|
|
|
|
|
tPatientHospitalDoctor.setHospitalId(tRecord.getHospitalId());
|
|
|
|
|
tPatientHospitalDoctor.setDoctorId(tRecord.getDoctorId());
|
|
|
|
|
tPatientHospitalDoctor.setPatientId(tRecord.getPatientId());
|
|
|
|
|
List<TPatientHospitalDoctor> tPHDs = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor);
|
|
|
|
|
if (tPHDs.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
itPatientHospitalDoctorService.insertTPatientHospitalDoctor(tPatientHospitalDoctor);
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success("预约成功。");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|