提交 6e55b74d authored 作者: 133's avatar 133

[zjm] bug提交

上级 2631ae94
......@@ -189,8 +189,8 @@ public enum LogType {
SEND_BACK_28(100018,SEND_BACK.id, SEND_BACK_1213.id,END.id , "上传了直属单位清退签字单据"),
SEND_BACK_29(100019,SEND_BACK.id, SEND_BACK_1209.id,SEND_BACK_1215.id , "单据未上传,继续等待相关单据上传"),
SEND_BACK_30(100020,SEND_BACK.id, SEND_BACK_1208.id,SEND_BACK_1217.id , "调用电子签章,等待审核"),
SEND_BACK_31(100021,SEND_BACK.id, SEND_BACK_1217.id,SEND_BACK_1219.id , "电签章调用审核通过,等待盖章出库"),
SEND_BACK_32(100022,SEND_BACK.id, SEND_BACK_1217.id,SEND_BACK_1208.id , "电签章调用审核不通过,等待重新出库"),
SEND_BACK_31(100021,SEND_BACK.id, SEND_BACK_1217.id,SEND_BACK_1219.id , "电签章调用审核通过,等待盖章出库"),
SEND_BACK_32(100022,SEND_BACK.id, SEND_BACK_1217.id,SEND_BACK_1208.id , "电签章调用审核不通过,等待重新出库"),
SEND_BACK_33(100023,SEND_BACK.id, SEND_BACK_1209.id,SEND_BACK_1220.id , "入库任务调用电子签章,等待审核"),
SEND_BACK_34(100024,SEND_BACK.id, SEND_BACK_1220.id,SEND_BACK_1218.id , "入库任务调用电子签章审核通过,等待盖章入库"),
SEND_BACK_35(100025,SEND_BACK.id, SEND_BACK_1220.id,SEND_BACK_1209.id , "入库任务调用电子签章审核不通过,等待重新入库"),
......@@ -200,7 +200,7 @@ public enum LogType {
SEND_BACK_39(100029,SEND_BACK.id, SEND_BACK_1206.id,END.id , "本次提交任务无装备,任务结束"),
SEND_BACK_40(100030,SEND_BACK.id, SEND_BACK_1208.id,END.id , "本次提交任务无装备,任务结束"),
SEND_BACK_41(100031,SEND_BACK.id, SEND_BACK_1215.id,END.id , "清退装备任务,上传了签收单据,任务结束"),
SEND_BACK_42(100032,SEND_BACK.id, SEND_BACK_1218.id,END.id , "签章入库成功,清退装备任务结束"),
SEND_BACK_42(100032,SEND_BACK.id, SEND_BACK_1218.id,END.id , "使用签章或上传相关单据,清退装备任务结束"),
......
......@@ -57,5 +57,14 @@ public class QuestionBackController {
return ResponseEntity.ok("删除成功");
}
/**
* 查询题库的情况
*/
@ApiOperation(value = "查询题库的情况")
@GetMapping("/getProblemCount")
public ResponseEntity getProblemCount() {
return ResponseEntity.ok(problemService.getProblemCount());
}
}
......@@ -36,6 +36,7 @@ public class Problem extends BaseEntity {
@ApiModelProperty(value = "题目答案")
private String problemAnswer;
// 1.选 2判断 3解答 4多选
@ApiModelProperty(value = "题目类型")
private Integer problemType;
......
package com.tykj.dev.device.questionbank.entity.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zjm
* @version 1.0.0
* @ClassName ProblemCountVo.java
* @Description TODO
* @createTime 2021年07月07日 13:15:00
*/
@NoArgsConstructor
@AllArgsConstructor
@Data
public class ProblemCountVo {
private Integer level;
private Integer count;
}
package com.tykj.dev.device.questionbank.service;
import com.tykj.dev.device.questionbank.entity.Problem;
import com.tykj.dev.device.questionbank.entity.vo.ProblemCountVo;
import com.tykj.dev.device.questionbank.entity.vo.ProblemPageVo;
import org.springframework.data.domain.Page;
import java.util.List;
import java.util.Map;
public interface ProblemService {
/**
......@@ -34,4 +36,6 @@ public interface ProblemService {
void deleteById(Integer id);
Page<Problem> pageProblemSelect(ProblemPageVo problemPageVo);
Map<Integer, Map<Integer,Integer>> getProblemCount();
}
......@@ -5,6 +5,7 @@ import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.device.questionbank.dao.ProblemDao;
import com.tykj.dev.device.questionbank.entity.Problem;
import com.tykj.dev.device.questionbank.entity.vo.ProblemCountVo;
import com.tykj.dev.device.questionbank.entity.vo.ProblemPageVo;
import com.tykj.dev.device.questionbank.service.ProblemService;
import com.tykj.dev.misc.base.StatusEnum;
......@@ -16,8 +17,7 @@ import org.springframework.data.jpa.domain.Specification;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
import java.util.*;
@Service
public class ProblemServiceImpl implements ProblemService {
......@@ -70,6 +70,39 @@ public class ProblemServiceImpl implements ProblemService {
});
}
@Override
public Map<Integer, Map<Integer,Integer>> getProblemCount() {
Map<Integer,Map<Integer,Integer>> map=new HashMap<>();
Map<String,Integer> stringIntegerMap=new HashMap<>();
problemDao.findAll().forEach(
problem -> {
String key=problem.getProblemType()+","+problem.getProblemLevel();
if (stringIntegerMap.containsKey(key)){
stringIntegerMap.put(key,stringIntegerMap.get(key)+1);
}else {
stringIntegerMap.put(key,1);
}
}
);
stringIntegerMap.forEach((k,v)->{
String [] strings= k.split(",");
Integer type= Integer.parseInt(strings[0]);
Integer level= Integer.parseInt(strings[1]);
if (map.containsKey(type)){
Map<Integer,Integer> levelMap= map.get(type);
levelMap.put(level,v);
map.put(type,levelMap);
}else {
Map<Integer,Integer> levelMap= new HashMap<>();
levelMap.put(level,v);
map.put(type,levelMap);
}
});
return map;
}
private Specification<Problem> getProblemSpecification(ProblemPageVo problemPageVo) {
PredicateBuilder<Problem> predicateBuilder = Specifications.and();
......
......@@ -385,7 +385,12 @@ public class TaskController {
if (billStatus==1250 ||billStatus==2223|| billStatus==8110){
return map;
}else {
return defaults(taskLogUserVos);
map= defaults(taskLogUserVos);
if (billStatus==1251 || billStatus==2224){
map.remove("1251");
map.remove("2224");
}
return map;
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论