|
@@ -1,28 +1,32 @@
|
|
package cn.com.qmth.stmms.ms.log.controller;
|
|
package cn.com.qmth.stmms.ms.log.controller;
|
|
|
|
|
|
import cn.com.qmth.stmms.ms.commons.utils.specification.PagingAndSortingDTO;
|
|
import cn.com.qmth.stmms.ms.commons.utils.specification.PagingAndSortingDTO;
|
|
-import cn.com.qmth.stmms.ms.core.domain.MarkLog;
|
|
|
|
-import cn.com.qmth.stmms.ms.core.domain.MarkLogOperType;
|
|
|
|
|
|
+import cn.com.qmth.stmms.ms.core.domain.*;
|
|
|
|
+import cn.com.qmth.stmms.ms.core.domain.user.Role;
|
|
import cn.com.qmth.stmms.ms.core.repository.MarkLogRepo;
|
|
import cn.com.qmth.stmms.ms.core.repository.MarkLogRepo;
|
|
-//import io.swagger.annotations.Api;
|
|
|
|
-//import io.swagger.annotations.ApiOperation;
|
|
|
|
-//import io.swagger.annotations.ApiParam;
|
|
|
|
|
|
+import cn.com.qmth.stmms.ms.core.repository.PaperRepo;
|
|
|
|
+import cn.com.qmth.stmms.ms.core.repository.WorkRepo;
|
|
|
|
+import cn.com.qmth.stmms.ms.core.vo.Subject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Sort;
|
|
import org.springframework.data.domain.Sort;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.persistence.criteria.Predicate;
|
|
import javax.persistence.criteria.Predicate;
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import java.text.ParseException;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
+//import io.swagger.annotations.Api;
|
|
|
|
+//import io.swagger.annotations.ApiOperation;
|
|
|
|
+//import io.swagger.annotations.ApiParam;
|
|
|
|
+
|
|
//@Api(tags = "纪检审计接口controller")
|
|
//@Api(tags = "纪检审计接口controller")
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("api/marklog")
|
|
@RequestMapping("api/marklog")
|
|
@@ -31,13 +35,19 @@ public class MarkLogController {
|
|
@Autowired
|
|
@Autowired
|
|
MarkLogRepo markLogRepo;
|
|
MarkLogRepo markLogRepo;
|
|
|
|
|
|
-// @ApiOperation(value = "纪检审计查询接口")
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ PaperRepo paperRepo;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ WorkRepo workRepo;
|
|
|
|
+
|
|
|
|
+ // @ApiOperation(value = "纪检审计查询接口")
|
|
@GetMapping("/selectMarkLog")
|
|
@GetMapping("/selectMarkLog")
|
|
public PagingAndSortingDTO selectMarkLog(
|
|
public PagingAndSortingDTO selectMarkLog(
|
|
// @ApiParam(value = "科目", required = false)
|
|
// @ApiParam(value = "科目", required = false)
|
|
- @RequestParam(required = false) String subject,
|
|
|
|
|
|
+ @RequestParam(required = false) String subject,
|
|
// @ApiParam(value = "准考证号", required = false)
|
|
// @ApiParam(value = "准考证号", required = false)
|
|
- @RequestParam(required = false) Long examNumber,
|
|
|
|
|
|
+ @RequestParam(required = false) Long examNumber,
|
|
// @ApiParam(value = "学生姓名", required = false)
|
|
// @ApiParam(value = "学生姓名", required = false)
|
|
@RequestParam(required = false) String studentName,
|
|
@RequestParam(required = false) String studentName,
|
|
// @ApiParam(value = "操作类型(1:分档,2:打分,3:回评档位,4:回评分数,5:档位打回,6:档位打回回评,7:一键定档,8:标准卷设置)", required = false)
|
|
// @ApiParam(value = "操作类型(1:分档,2:打分,3:回评档位,4:回评分数,5:档位打回,6:档位打回回评,7:一键定档,8:标准卷设置)", required = false)
|
|
@@ -47,8 +57,8 @@ public class MarkLogController {
|
|
// @ApiParam(value = "结束时间", required = false)
|
|
// @ApiParam(value = "结束时间", required = false)
|
|
@RequestParam(required = false) String endTime,
|
|
@RequestParam(required = false) String endTime,
|
|
@RequestParam(required = false) Long workId,
|
|
@RequestParam(required = false) Long workId,
|
|
- @RequestParam Integer curPage,
|
|
|
|
- @RequestParam Integer pageSize) {
|
|
|
|
|
|
+ @RequestParam Integer curPage,
|
|
|
|
+ @RequestParam Integer pageSize) {
|
|
Pageable pageable = new PageRequest(curPage, pageSize, Sort.Direction.DESC, "createTime");
|
|
Pageable pageable = new PageRequest(curPage, pageSize, Sort.Direction.DESC, "createTime");
|
|
Specification<MarkLog> specification = (root, query, cb) -> {
|
|
Specification<MarkLog> specification = (root, query, cb) -> {
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
@@ -84,6 +94,7 @@ public class MarkLogController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 采集日志
|
|
* 采集日志
|
|
|
|
+ *
|
|
* @param subject
|
|
* @param subject
|
|
* @param examNumber
|
|
* @param examNumber
|
|
* @param studentName
|
|
* @param studentName
|
|
@@ -139,4 +150,59 @@ public class MarkLogController {
|
|
return new PagingAndSortingDTO(result.getNumber(), result.getSize(), result.getTotalPages(),
|
|
return new PagingAndSortingDTO(result.getNumber(), result.getSize(), result.getTotalPages(),
|
|
result.getTotalElements(), result.getContent());
|
|
result.getTotalElements(), result.getContent());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 采集成功记录日志
|
|
|
|
+ *
|
|
|
|
+ * @param workId
|
|
|
|
+ * @param request
|
|
|
|
+ * @return
|
|
|
|
+ * @throws ParseException
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "/saveCollectLog", method = RequestMethod.POST)
|
|
|
|
+ public Object saveCollectLog(Long workId, HttpServletRequest request) throws ParseException {
|
|
|
|
+ //取采集用户id
|
|
|
|
+ Long clientUserId = Long.valueOf(request.getParameter("clientUserId"));
|
|
|
|
+ //取采集用户名称
|
|
|
|
+ String clientUsername = request.getParameter("clientUsername");
|
|
|
|
+ //学生信息
|
|
|
|
+ String name = request.getParameter("name");
|
|
|
|
+ //科目信息
|
|
|
|
+ Integer subjectId = Integer.valueOf(request.getParameter("subjectId"));
|
|
|
|
+ //准考证号
|
|
|
|
+ String examNumber = request.getParameter("examNumber");
|
|
|
|
+ //试卷信息
|
|
|
|
+ List<Paper> paperList = paperRepo.findByWorkIdAndExamNumber(workId, examNumber);
|
|
|
|
+ Paper paper = paperList.get(0);
|
|
|
|
+
|
|
|
|
+ Integer operType = MarkLogOperType.COLLECT.getId();
|
|
|
|
+ Subject subject = Subject.values()[subjectId - 1];
|
|
|
|
+
|
|
|
|
+ Work work = workRepo.findOne(workId);
|
|
|
|
+
|
|
|
|
+ MarkLog markLog = new MarkLog();
|
|
|
|
+ markLog.setCreateUserId(clientUserId);
|
|
|
|
+ markLog.setCreateUserName(clientUsername);
|
|
|
|
+ markLog.setCreateRole(Role.COLLECTOR.getName());
|
|
|
|
+ markLog.setSubject(subject.toString());
|
|
|
|
+ markLog.setExamNumber(examNumber);
|
|
|
|
+ markLog.setStudentName(name);
|
|
|
|
+ markLog.setOperType(operType);
|
|
|
|
+ markLog.setWorkId(workId);
|
|
|
|
+ markLog.setWorkName(work.getName());
|
|
|
|
+ markLog.setPaperId(paper.getId());
|
|
|
|
+ markLog.setStage(MarkStage.INIT);
|
|
|
|
+ //识别方式
|
|
|
|
+ String manual = request.getParameter("manual");
|
|
|
|
+ markLog.setRemark("0".equals(manual) ? "正常扫描" : "1".equals(manual) ? "手工绑定" : null);
|
|
|
|
+ //操作时间
|
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ String time = request.getParameter("time");
|
|
|
|
+ markLog.setCreateTime(formatter.parse(time));
|
|
|
|
+ //登录时间
|
|
|
|
+ String clientUserLoginTime = request.getParameter("clientUserLoginTime");
|
|
|
|
+ markLog.setLoginTime(formatter.parse(clientUserLoginTime));
|
|
|
|
+ //退出时间(没有退出时间)
|
|
|
|
+ return markLogRepo.saveAndFlush(markLog);
|
|
|
|
+ }
|
|
}
|
|
}
|