package com.lyms.talkonlineweb.controller;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.lyms.talkonlineweb.constants.ErrorCodeConstants;
import com.lyms.talkonlineweb.domain.LymsFavor;
import com.lyms.talkonlineweb.domain.LymsHdepart;
import com.lyms.talkonlineweb.result.BaseResponse;
import com.lyms.talkonlineweb.service.PatientInfoService;
import com.lyms.talkonlineweb.task.GetPatientInfoTask;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.w3c.dom.stylesheets.LinkStyle;
import java.util.List;
import java.util.Map;
/**
* 医院患者信息接收
*/
@RestController
@RequestMapping("getPatient")
public class GetPatientInfoController {
@Autowired
private GetPatientInfoTask getPatientInfoTask;
/**
* 保存医院患者信息
* @param param
* @return
*/
@PostMapping("savePatient")
public BaseResponse savePatient(@RequestBody List<Map> param){
BaseResponse baseResponse=new BaseResponse();
if(CollectionUtils.isEmpty(param)){
baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
baseResponse.setErrormsg("参数为空");
return baseResponse;
}
try {
getPatientInfoTask.getPatient(param);
baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
baseResponse.setErrormsg("成功");
} catch (Exception e) {
e.printStackTrace();
baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
baseResponse.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION);
}
return baseResponse;
}
}