| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportVo; |
| | | import com.yuanchu.limslaboratory.service.ReportService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | |
| | | @RestController |
| | | @RequestMapping("/report") |
| | | public class ReportController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | |
| | | @Resource |
| | | private ReportService reportService; |
| | | |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("提交") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验报告id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/submit") |
| | | public Result submit(Integer id) { |
| | | return Result.success(reportService.submit(id)); |
| | | } |
| | | |
| | | @ApiOperation("审核") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验报告id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "result", value = "审核结论", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/check") |
| | | public Result check(@RequestHeader("token") String token, Integer id, String result) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | return Result.success(reportService.check((String) unmarshal.get("name"), id, result)); |
| | | } |
| | | |
| | | @ApiOperation("删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验报告id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delreport") |
| | | public Result delreport(Integer id) { |
| | | return Result.success(reportService.delreport(id)); |
| | | } |
| | | |
| | | } |
| | | |