【新增】题号位数根据系统参数生成
This commit is contained in:
@@ -28,6 +28,7 @@ import pc.exam.pp.module.exam.dal.mysql.specialty.ExamSpecialtyMapper;
|
||||
import pc.exam.pp.module.exam.utils.date.DateUtils;
|
||||
import pc.exam.pp.module.exam.utils.rabbitmq.RabbitmqUtils;
|
||||
import pc.exam.pp.module.exam.utils.uuid.IdUtils;
|
||||
import pc.exam.pp.module.infra.api.config.ConfigApi;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -70,6 +71,8 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
private EducationPaperQuMapper educationPaperQuMapper;
|
||||
@Autowired
|
||||
private IExamQuestionService examQuestionService;
|
||||
@Autowired
|
||||
private ConfigApi configApi;
|
||||
/**
|
||||
* 查询试题(hyc)
|
||||
*
|
||||
@@ -199,9 +202,10 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
// return examQuestionMapper.insert(examQuestion);
|
||||
Long loginTenantId = SecurityFrameworkUtils.getLoginTenantId();
|
||||
int count= examQuestionMapper.selectCountQu();
|
||||
|
||||
// 读取系统创建试题位数设置
|
||||
String number = configApi.getConfigValueByKey("qu_number");
|
||||
// 格式化为8位,不足前面补0
|
||||
String formattedNumber = String.format("%08d", ++count);
|
||||
String formattedNumber = String.format("%0" + number + "d", ++count);
|
||||
String quNum =loginTenantId +"-"+formattedNumber;
|
||||
examQuestion.setQuNum(quNum);
|
||||
return examQuestionMapper.insertExamQuestion(examQuestion);
|
||||
|
Reference in New Issue
Block a user