LymsInspectionReportController.java 2.71 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
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
package com.lyms.talkonlineweb.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lyms.talkonlineweb.annotation.TokenRequired;
import com.lyms.talkonlineweb.domain.LymsInspectionReport;
import com.lyms.talkonlineweb.domain.LymsPatient;
import com.lyms.talkonlineweb.result.BaseResponse;
import com.lyms.talkonlineweb.service.LymsInspectionReportService;
import com.lyms.talkonlineweb.service.LymsPatientService;
import com.lyms.talkonlineweb.util.StringUtil;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* 检查报告
*/
@RestController
@RequestMapping("insr")
@Log4j2
public class LymsInspectionReportController {
@Autowired
private LymsInspectionReportService lymsInspectionReportService;//检查报告

/**
* PC 检查报告 新增/修改
*
* @param inspectionReport
* @return
*/
@PostMapping("addOrUpdateInspectionReport")
@TokenRequired
public BaseResponse addOrUpdateInspectionReport(@RequestBody LymsInspectionReport inspectionReport) {
BaseResponse baseResponse = new BaseResponse();
try {
boolean b = lymsInspectionReportService.saveOrUpdate(inspectionReport);

baseResponse.setErrorcode(b?0:1);
baseResponse.setErrormsg(b?(null==inspectionReport.getId()?"注册成功!":"修改成功"):(null==inspectionReport.getId()?"注册失败!":"修改失败"));
} catch (Exception e) {
baseResponse.setErrorcode(1);
baseResponse.setErrormsg("系统异常");
e.printStackTrace();
}
return baseResponse;
}
/**
* PC 检查报告 查询病例下的检查报告
*
* @param pcid
* @return
*/
@GetMapping("queryInspectionReport")
@TokenRequired
public BaseResponse queryInspectionReport(Integer pcid) {
BaseResponse baseResponse = new BaseResponse();
try {
QueryWrapper<LymsInspectionReport> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(LymsInspectionReport::getPcid, pcid);
List<LymsInspectionReport> list = lymsInspectionReportService.list(queryWrapper.orderByDesc("checkdate"));
baseResponse.setErrorcode(0);
baseResponse.setErrormsg("成功");
baseResponse.setObject(list);
} catch (Exception e) {
baseResponse.setErrorcode(1);
baseResponse.setErrormsg("系统异常");
e.printStackTrace();
}
return baseResponse;
}
}