10 changed files with 256 additions and 4 deletions
@ -0,0 +1,58 @@ |
|||||
|
package com.ccsens.question.api; |
||||
|
|
||||
|
import com.ccsens.cloudutil.annotation.MustLogin; |
||||
|
import com.ccsens.question.bean.dto.PatientReportSearchDto; |
||||
|
import com.ccsens.question.bean.vo.PatientReportSearchVo; |
||||
|
import com.ccsens.question.service.IPatientReportService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import io.swagger.annotations.*; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: whj |
||||
|
* @time: 2021/3/10 15:03 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Api(tags = "报告单搜索",value = "报告单搜索条件,搜索") |
||||
|
@RestController |
||||
|
@RequestMapping("/patientReport") |
||||
|
public class PatientReportSearchController { |
||||
|
@Resource |
||||
|
private IPatientReportService patientReportService; |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "查询搜索条件",notes = "whj 查询搜索条件") |
||||
|
@ApiImplicitParams({ |
||||
|
@ApiImplicitParam(name = "json", value = "查询搜索条件", required = true) |
||||
|
}) |
||||
|
@RequestMapping(value="/searchParam", method = RequestMethod.POST) |
||||
|
public JsonResponse<PatientReportSearchVo.SearchParam> searchParam(@RequestBody @ApiParam @Valid QueryDto<PatientReportSearchDto.SearchParam> dto){ |
||||
|
log.info("查询搜索条件:{}", dto); |
||||
|
List<PatientReportSearchVo.SearchParam> params = patientReportService.searchParam(dto.getParam()); |
||||
|
log.info("查询搜索条件已完成:{}", params); |
||||
|
return JsonResponse.newInstance().ok(params); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "根据条件搜索报告单",notes = "whj 搜索报告单") |
||||
|
@ApiImplicitParams({ |
||||
|
@ApiImplicitParam(name = "json", value = "查询搜索条件", required = true) |
||||
|
}) |
||||
|
@RequestMapping(value="/search", method = RequestMethod.POST) |
||||
|
public JsonResponse<PatientReportSearchVo.Search> search(@RequestBody @ApiParam @Valid QueryDto<PatientReportSearchDto.SearchList> dto){ |
||||
|
log.info("搜索报告单:{}", dto); |
||||
|
List<PatientReportSearchVo.Search> params = patientReportService.search(dto.getParam()); |
||||
|
log.info("搜索报告单已完成"); |
||||
|
return JsonResponse.newInstance().ok(params); |
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.ccsens.question.bean.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: whj |
||||
|
* @time: 2021/3/10 16:21 |
||||
|
*/ |
||||
|
public class PatientReportSearchDto { |
||||
|
@Data |
||||
|
@ApiModel("搜索条件-请求参数") |
||||
|
public static class SearchParam{ |
||||
|
@ApiModelProperty("查询类型") |
||||
|
@NotEmpty(message = "请输入查询报告单类型") |
||||
|
private String parentCode; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("搜索报告单参数列表-请求") |
||||
|
public static class SearchList { |
||||
|
private List<Search> codes; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("搜索报告单参数-请求") |
||||
|
public static class Search { |
||||
|
@NotEmpty(message="请选择查询类型") |
||||
|
private String code; |
||||
|
private Integer start; |
||||
|
private Integer end; |
||||
|
} |
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
package com.ccsens.question.bean.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: whj |
||||
|
* @time: 2021/3/10 16:06 |
||||
|
*/ |
||||
|
public class PatientReportSearchVo { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("搜索条件-响应") |
||||
|
public static class SearchParam { |
||||
|
private Long id; |
||||
|
private String code; |
||||
|
private String name; |
||||
|
private byte optionStatus; |
||||
|
private String parentCode; |
||||
|
private List<SearchParam> children = new ArrayList<>(); |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("搜索-响应") |
||||
|
public static class Search { |
||||
|
private Long id; |
||||
|
private String name; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue