|
@@ -16,6 +16,7 @@ import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -32,6 +33,7 @@ import java.util.List;
|
|
|
@Api("报告指标检查")
|
|
|
@RestController
|
|
|
@RequestMapping("/app/medical/result")
|
|
|
+@Slf4j
|
|
|
public class ReportIndicatorResultController extends AppBaseController {
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
@@ -47,6 +49,7 @@ public class ReportIndicatorResultController extends AppBaseController {
|
|
|
@ApiOperation("根据报告ID查询所有指标结果")
|
|
|
@GetMapping("/listByReport/{reportId}")
|
|
|
public R listByReportId(@PathVariable("reportId") Long reportId) {
|
|
|
+ log.info("根据报告ID查询所有指标结果 {}",reportId);
|
|
|
try {
|
|
|
List<ReportIndicatorResult> list = reportIndicatorResultService.listByReportId(reportId);
|
|
|
return R.ok().put("data",list);
|
|
@@ -63,6 +66,8 @@ public class ReportIndicatorResultController extends AppBaseController {
|
|
|
@ApiOperation("分页查询报告指标检查结果列表")
|
|
|
@GetMapping("/page")
|
|
|
public R page(ReportIndicatorResultQueryDto queryDto) {
|
|
|
+ log.info("分页查询报告指标检查结果列表 {}",queryDto);
|
|
|
+
|
|
|
try {
|
|
|
PageHelper.startPage(queryDto.getPageNum(), queryDto.getPageSize());
|
|
|
List<ReportIndicatorResult> list = reportIndicatorResultService.selectPageList(queryDto);
|
|
@@ -81,6 +86,8 @@ public class ReportIndicatorResultController extends AppBaseController {
|
|
|
@ApiOperation("根据指标ID查询所有结果")
|
|
|
@GetMapping("/listByIndicator/{indicatorId}")
|
|
|
public R listByIndicatorId(@PathVariable("indicatorId") Long indicatorId) {
|
|
|
+ log.info("根据指标ID查询所有结果 {}",indicatorId);
|
|
|
+
|
|
|
try {
|
|
|
List<ReportIndicatorResult> list = reportIndicatorResultService.listByIndicatorId(indicatorId);
|
|
|
return R.ok().put("data",list);
|
|
@@ -97,6 +104,8 @@ public class ReportIndicatorResultController extends AppBaseController {
|
|
|
@ApiOperation("查询检查结果详情")
|
|
|
@GetMapping("/{resultId}")
|
|
|
public R getById(@PathVariable("resultId") Long resultId) {
|
|
|
+ log.info("查询检查结果详情 {}",resultId);
|
|
|
+
|
|
|
try {
|
|
|
ReportIndicatorResult result = reportIndicatorResultService.getById(resultId);
|
|
|
MedicalIndicator indicator = null;
|
|
@@ -118,6 +127,8 @@ public class ReportIndicatorResultController extends AppBaseController {
|
|
|
@ApiOperation("新增检查结果")
|
|
|
@PostMapping("/add")
|
|
|
public R add(@RequestBody ReportIndicatorResult result) {
|
|
|
+ log.info("新增检查结果 {}",result);
|
|
|
+
|
|
|
try {
|
|
|
boolean success = reportIndicatorResultService.save(result);
|
|
|
if (success) {
|
|
@@ -135,6 +146,8 @@ public class ReportIndicatorResultController extends AppBaseController {
|
|
|
@ApiOperation("获取指定报告的指标分类")
|
|
|
@GetMapping("/getAllCateByReportId")
|
|
|
public R getAllIndicatorByReportId(@RequestParam("reportId") Long reportId) {
|
|
|
+ log.info("获取指定报告的指标分类 {}",reportId);
|
|
|
+
|
|
|
List<ReportAllIndicatorCateDTO> allIndicatorByReportId = reportIndicatorResultService.getAllIndicatorByReportId(reportId);
|
|
|
return R.ok().put("data",allIndicatorByReportId);
|
|
|
}
|
|
@@ -146,6 +159,8 @@ public class ReportIndicatorResultController extends AppBaseController {
|
|
|
@ApiOperation("批量新增检查结果")
|
|
|
@PostMapping("/batchAdd")
|
|
|
public R batchAdd(@RequestBody List<ReportIndicatorResult> results) {
|
|
|
+ log.info("批量新增检查结果 {}",results);
|
|
|
+
|
|
|
try {
|
|
|
int successCount = 0;
|
|
|
for (ReportIndicatorResult result : results) {
|
|
@@ -172,6 +187,8 @@ public class ReportIndicatorResultController extends AppBaseController {
|
|
|
@ApiOperation("更新检查结果")
|
|
|
@PutMapping("/update")
|
|
|
public R update(@RequestBody ReportIndicatorResult result) {
|
|
|
+ log.info("更新检查结果 {}",result);
|
|
|
+
|
|
|
try {
|
|
|
boolean success = reportIndicatorResultService.update(result);
|
|
|
if (success) {
|
|
@@ -192,6 +209,8 @@ public class ReportIndicatorResultController extends AppBaseController {
|
|
|
@ApiOperation("删除检查结果")
|
|
|
@DeleteMapping("/{resultId}")
|
|
|
public R delete(@PathVariable("resultId") Long resultId) {
|
|
|
+ log.info("删除检查结果 {}",resultId);
|
|
|
+
|
|
|
try {
|
|
|
boolean success = reportIndicatorResultService.deleteById(resultId);
|
|
|
if (success) {
|