GetPatientInfoController.java 1.91 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
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;
}
}