package com.example.duplicate.controller; import com.example.duplicate.service.MedicalAdviceService; import com.example.utils.CommonResult; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** * @ClassName TaskController * @Description 佐医佑康OFD外部接口 * @Author linjj * @Date 2024/8/5 14:21 * @Version 1.0 */ @RestController @RequestMapping("/emr") @Api(value = "佐医佑康OFD外部接口", tags = "佐医佑康OFD外部接口") @Slf4j public class TaskController { @Autowired private MedicalAdviceService medicalAdviceService; @PostMapping("/patientInfoSync") @ApiOperation("根据出院时间范围上传患者") @ResponseBody public CommonResult patientInfoSync(@RequestParam @ApiParam(required = false, name = "startTime", value = "出院时间范围开始" ) String startTime, @RequestParam @ApiParam(required = false, name = "endTime", value = "出院时间范围结束" ) String endTime) throws Exception { if (StringUtils.isBlank(startTime)){ return CommonResult.failed("开始时间不能为空"); } if (StringUtils.isBlank(endTime)){ return CommonResult.failed("结束时间不能为空"); } return medicalAdviceService.medicalCompensate(startTime,endTime); } }