|
@@ -1,7 +1,6 @@
|
|
|
package com.yaoxiang.diagnosis.controller;
|
|
|
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
-import com.yaoxiang.diagnosis.authority.AuthCheck;
|
|
|
import com.yaoxiang.diagnosis.config.Constants;
|
|
|
import com.yaoxiang.diagnosis.dao.OptionRepo;
|
|
|
import com.yaoxiang.diagnosis.dao.QuestionRepo;
|
|
@@ -20,7 +19,6 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
@@ -28,16 +26,15 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.atomic.AtomicLong;
|
|
|
|
|
|
|
|
|
* @AUTHOR: DaiFengWen
|
|
|
* @DATE: Create in 2018/6/29 17:18
|
|
|
* @DESCRIPTION:
|
|
|
*/
|
|
|
-@Api(tags = "测试")
|
|
|
+@Api(tags = "专项诊断导出")
|
|
|
@RestController
|
|
|
-public class TestController {
|
|
|
+public class SpecialExportController {
|
|
|
@Resource
|
|
|
private OptionRepo optionRepo;
|
|
|
@Resource
|
|
@@ -55,76 +52,7 @@ public class TestController {
|
|
|
@Resource
|
|
|
private SpecialReportService specialReportService;
|
|
|
|
|
|
- private AtomicLong visitCount = new AtomicLong();
|
|
|
-
|
|
|
- private static final Logger logger = LoggerFactory.getLogger(TestController.class);
|
|
|
-
|
|
|
- @GetMapping("/")
|
|
|
- public String index() {
|
|
|
- return "hello";
|
|
|
- }
|
|
|
-
|
|
|
- @RequestMapping(value = "/test", method = RequestMethod.GET)
|
|
|
- public String test() {
|
|
|
- long cnt = visitCount.incrementAndGet();
|
|
|
- String name = SecurityUtil.getCurrentUser().getUser().getName();
|
|
|
- return name + " , Now is " + new Date() + " and visit times : " + cnt;
|
|
|
- }
|
|
|
-
|
|
|
- @RequestMapping(value = "/test2", method = RequestMethod.GET)
|
|
|
- public String test2() {
|
|
|
- long cnt = visitCount.incrementAndGet();
|
|
|
- String name = SecurityUtil.getCurrentUser().getUser().getName();
|
|
|
- return name + " , Now is " + new Date() + " and visit times : " + cnt;
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/test/info")
|
|
|
- @AuthCheck(role = "test")
|
|
|
- public AuthUser auth() {
|
|
|
- return SecurityUtil.getCurrentUser();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @GetMapping("/temp1")
|
|
|
- public void temp1() {
|
|
|
- List<Question> questions = questionRepo.findByPid(7);
|
|
|
- questions.sort((q1, q2) -> {
|
|
|
- int s1 = Math.abs(q1.getSection());
|
|
|
- int s2 = Math.abs(q2.getSection());
|
|
|
- if (s2 > s1) {
|
|
|
- return -1;
|
|
|
- } else if (s2 == s1) {
|
|
|
- if (q1.getSection() > q2.getSection()) {
|
|
|
- return 1;
|
|
|
- } else if (q1.getSection() < q2.getSection()) {
|
|
|
- return -1;
|
|
|
- } else {
|
|
|
- return 0;
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- return 1;
|
|
|
- }
|
|
|
- });
|
|
|
- Integer num = 1;
|
|
|
- for (Question question : questions) {
|
|
|
- question.setNumber(num++);
|
|
|
- questionRepo.save(question);
|
|
|
- }
|
|
|
- }
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(SpecialExportController.class);
|
|
|
|
|
|
@PostMapping("/upload")
|
|
|
public Result uploadMatter(@RequestBody MultipartFile file) throws Exception {
|