|
@@ -0,0 +1,70 @@
|
|
|
|
+package cn.com.qmth.scancentral.controller.admin;
|
|
|
|
+
|
|
|
|
+import cn.com.qmth.scancentral.controller.BaseController;
|
|
|
|
+import cn.com.qmth.scancentral.service.ExamService;
|
|
|
|
+import cn.com.qmth.scancentral.vo.imagecheck.ImageCheckDetailVo;
|
|
|
|
+import cn.com.qmth.scancentral.vo.imagecheck.ImageCheckQuery;
|
|
|
|
+import cn.com.qmth.scancentral.vo.imagecheck.ImageCheckVo;
|
|
|
|
+import com.qmth.boot.api.annotation.Aac;
|
|
|
|
+import com.qmth.boot.api.constant.ApiConstant;
|
|
|
|
+import com.qmth.boot.core.collection.PageResult;
|
|
|
|
+import com.qmth.boot.tools.excel.ExcelWriter;
|
|
|
|
+import com.qmth.boot.tools.excel.enums.ExcelType;
|
|
|
|
+import com.qmth.boot.tools.iterator.PageListIterator;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.net.URLEncoder;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Collection;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+@RestController
|
|
|
|
+@Api(tags = "图片检查相关接口")
|
|
|
|
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/admin/check/image")
|
|
|
|
+@Aac(strict = false, auth = true)
|
|
|
|
+public class ImageCheckController extends BaseController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ExamService examService;
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询科目图片检查概况")
|
|
|
|
+ @PostMapping("/list")
|
|
|
|
+ public List<ImageCheckVo> list(@RequestParam String examId) {
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询图片检查异常(分页)")
|
|
|
|
+ @PostMapping(value = "/failed/page")
|
|
|
|
+ public PageResult<ImageCheckDetailVo> failedPage(ImageCheckQuery query) {
|
|
|
|
+ return new PageResult<>();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "导出图片检查异常")
|
|
|
|
+ @PostMapping(value = "/failed/export")
|
|
|
|
+ public void failedExport(ImageCheckQuery query, HttpServletResponse response) throws IOException {
|
|
|
|
+ String fileName = URLEncoder.encode("图片检查异常", "UTF-8");
|
|
|
|
+ response.setHeader("Content-Disposition", "inline; filename=" + fileName + ".xlsx");
|
|
|
|
+ response.setContentType("application/vnd.ms-excel");
|
|
|
|
+ ExcelWriter writer = ExcelWriter.create(ExcelType.XLSX);
|
|
|
|
+ PageListIterator<ImageCheckDetailVo> iterator = new PageListIterator<ImageCheckDetailVo>(5000) {
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Collection<ImageCheckDetailVo> getPageList(int pageNumber, int pageSize) {
|
|
|
|
+ query.setPageNumber(pageNumber);
|
|
|
|
+ query.setPageSize(pageSize);
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ writer.writeObjects("图片检查异常", null, ImageCheckDetailVo.class, iterator);
|
|
|
|
+ writer.output(response.getOutputStream());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|