|
@@ -2,6 +2,7 @@ package cn.com.qmth.stmms.ms.admin.api;
|
|
|
|
|
|
import cn.com.qmth.stmms.ms.commons.utils.SqlUtil;
|
|
import cn.com.qmth.stmms.ms.commons.utils.SqlUtil;
|
|
import cn.com.qmth.stmms.ms.core.domain.Level;
|
|
import cn.com.qmth.stmms.ms.core.domain.Level;
|
|
|
|
+import cn.com.qmth.stmms.ms.core.domain.MarkLogOperType;
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkStage;
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkStage;
|
|
import cn.com.qmth.stmms.ms.core.domain.task.MarkTask;
|
|
import cn.com.qmth.stmms.ms.core.domain.task.MarkTask;
|
|
import cn.com.qmth.stmms.ms.core.repository.LevelRepo;
|
|
import cn.com.qmth.stmms.ms.core.repository.LevelRepo;
|
|
@@ -166,14 +167,14 @@ public class QualityAnalyseController {
|
|
if (Objects.nonNull(markTasks) && markTasks.size() > 0) {
|
|
if (Objects.nonNull(markTasks) && markTasks.size() > 0) {
|
|
Set<Long> markerIdSet = markTasks.stream().map(o -> o.getMarkerId()).collect(Collectors.toSet());
|
|
Set<Long> markerIdSet = markTasks.stream().map(o -> o.getMarkerId()).collect(Collectors.toSet());
|
|
Object o = StringUtils.join(markerIdSet.toArray(), ",");
|
|
Object o = StringUtils.join(markerIdSet.toArray(), ",");
|
|
- String sql = new StringBuffer("select t.create_user_name as userName, count(t.create_user_id) as sumCount from mark_log t where t.oper_type BETWEEN 10 and 12 and t.create_user_id in (").append(o).append(")").toString();
|
|
|
|
|
|
+ String sql = new StringBuffer("select t.create_user_name as userName, count(t.create_user_id) as sumCount from mark_log t where t.oper_type BETWEEN ").append(MarkLogOperType.SYSTEM_CALLBACK_LEVEl.getId()).append(" and ").append(MarkLogOperType.HANDLE_LEVEl.getId()).append(" and t.create_user_id in (").append(o).append(")").toString();
|
|
if (Objects.nonNull(startTime)) {
|
|
if (Objects.nonNull(startTime)) {
|
|
sql = sqlUtil.sqlConditionAnd(sql, new String[]{"t.create_time"}, new String[]{startTime}, new String[]{">="});
|
|
sql = sqlUtil.sqlConditionAnd(sql, new String[]{"t.create_time"}, new String[]{startTime}, new String[]{">="});
|
|
}
|
|
}
|
|
if (Objects.nonNull(endTime)) {
|
|
if (Objects.nonNull(endTime)) {
|
|
sql = sqlUtil.sqlConditionAnd(sql, new String[]{"t.create_time"}, new String[]{endTime}, new String[]{"<="});
|
|
sql = sqlUtil.sqlConditionAnd(sql, new String[]{"t.create_time"}, new String[]{endTime}, new String[]{"<="});
|
|
}
|
|
}
|
|
- sql = sqlUtil.sqlGroupBy(sql, "t.create_user_name");
|
|
|
|
|
|
+ sql = sqlUtil.sqlGroupBy(sql, "t.create_user_id");
|
|
list = sqlUtil.execSqlForMap(sql);
|
|
list = sqlUtil.execSqlForMap(sql);
|
|
}
|
|
}
|
|
return list;
|
|
return list;
|
|
@@ -190,7 +191,7 @@ public class QualityAnalyseController {
|
|
*/
|
|
*/
|
|
// @ApiOperation(value = "差值和报表接口")
|
|
// @ApiOperation(value = "差值和报表接口")
|
|
@RequestMapping(value = "distanceReport", method = RequestMethod.GET)
|
|
@RequestMapping(value = "distanceReport", method = RequestMethod.GET)
|
|
- public void distanceReport(
|
|
|
|
|
|
+ public List distanceReport(
|
|
// @ApiParam(value = "workId", required = true)
|
|
// @ApiParam(value = "workId", required = true)
|
|
@RequestParam Long workId,
|
|
@RequestParam Long workId,
|
|
// @ApiParam(value = "科目", required = true)
|
|
// @ApiParam(value = "科目", required = true)
|
|
@@ -201,6 +202,32 @@ public class QualityAnalyseController {
|
|
@RequestParam(required = false) String startTime,
|
|
@RequestParam(required = false) String startTime,
|
|
// @ApiParam(value = "结束时间", required = false)
|
|
// @ApiParam(value = "结束时间", required = false)
|
|
@RequestParam(required = false) String endTime) {
|
|
@RequestParam(required = false) String endTime) {
|
|
-
|
|
|
|
|
|
+ List list = null;
|
|
|
|
+ Specification<MarkTask> specification = (root, query, builder) -> {
|
|
|
|
+ List<Predicate> predicates = new ArrayList<>();
|
|
|
|
+ predicates.add(builder.equal(root.get("workId"), workId));
|
|
|
|
+ if (Objects.nonNull(subject)) {
|
|
|
|
+ predicates.add(builder.equal(root.get("subject"), subject));
|
|
|
|
+ }
|
|
|
|
+ if (Objects.nonNull(areaCode)) {
|
|
|
|
+ predicates.add(builder.equal(root.get("paper").get("areaCode"), areaCode));
|
|
|
|
+ }
|
|
|
|
+ return builder.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
|
+ };
|
|
|
|
+ List<MarkTask> markTasks = markTaskRepo.findAll(specification);
|
|
|
|
+ if (Objects.nonNull(markTasks) && markTasks.size() > 0) {
|
|
|
|
+ Set<Long> markerIdSet = markTasks.stream().map(o -> o.getMarkerId()).collect(Collectors.toSet());
|
|
|
|
+ Object o = StringUtils.join(markerIdSet.toArray(), ",");
|
|
|
|
+ String sql = new StringBuffer("select t.create_user_name as userName, sum(t.oper_data_after) as sumCount from mark_log t where t.oper_type = ").append(MarkLogOperType.LEVEl_DIFFERENCE.getId()).append(" and t.create_user_id in (").append(o).append(")").toString();
|
|
|
|
+ if (Objects.nonNull(startTime)) {
|
|
|
|
+ sql = sqlUtil.sqlConditionAnd(sql, new String[]{"t.create_time"}, new String[]{startTime}, new String[]{">="});
|
|
|
|
+ }
|
|
|
|
+ if (Objects.nonNull(endTime)) {
|
|
|
|
+ sql = sqlUtil.sqlConditionAnd(sql, new String[]{"t.create_time"}, new String[]{endTime}, new String[]{"<="});
|
|
|
|
+ }
|
|
|
|
+ sql = sqlUtil.sqlGroupBy(sql, "t.create_user_id");
|
|
|
|
+ list = sqlUtil.execSqlForMap(sql);
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
}
|
|
}
|
|
}
|
|
}
|