Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
walker-sheng 2020-12-30 11:00:58 +08:00
commit 4127d7d58b
3 changed files with 6 additions and 7 deletions

View File

@ -360,6 +360,7 @@ public class ExamService implements IExamService{
if (StringUtils.hasText(queryVO.getCreatorName())) {
SysUserExample sysUserExample = new SysUserExample();
sysUserExample.createCriteria().andNameLike(String.format("%%%s%%", queryVO.getCreatorName()));
sysUserExample.or().andNicknameLike(String.format("%%%s%%", queryVO.getCreatorName()));
List<Long> createrIdList = sysUserMapper.selectByExample(sysUserExample).stream()
.map(SysUser::getId).collect(Collectors.toList());
if (createrIdList.size() == 0) {

View File

@ -482,7 +482,7 @@ public class RunPlanDraftService implements IRunPlanDraftService {
RunPlanVO planVO = getRunPlanById(planId);
MapVO mapVO = this.iMapService.getMapDetail(planVO.getMapId());
if (Objects.nonNull(inputData.getDepartureInterval())) {
String max = planVO.getTripList().stream().map(RunPlanTripVO::getServiceNumber).max(Comparator.naturalOrder()).orElse("0");
String max = planVO.getTripList().stream().map(RunPlanTripVO::getServiceNumber).max(Comparator.comparingInt(Integer::parseInt)).orElse("0");
// 当前已有最大服务号
int maxServiceNumber = Integer.parseInt(max);
inputData.setServiceNumber(String.format("%03d", ++maxServiceNumber));
@ -538,7 +538,7 @@ public class RunPlanDraftService implements IRunPlanDraftService {
// 数据校验
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(serviceConfig.getTimes() > 0 && serviceConfig.getIntervals() >= 30);
RunPlanVO planVO = getRunPlanById(planId);
String max = planVO.getTripList().stream().map(RunPlanTripVO::getServiceNumber).max(Comparator.naturalOrder()).orElse("");
String max = planVO.getTripList().stream().map(RunPlanTripVO::getServiceNumber).max(Comparator.comparingInt(Integer::parseInt)).orElse("");
// 查询最大服务号
int maxServiceNumber = Integer.parseInt(max);
List<RunPlanTripVO> tripVOList = planVO.getTripList().stream()

View File

@ -92,13 +92,11 @@ public class RunPlanTemplateService implements IRunPlanTemplateService {
templatePlan.setId(oldPlan.getId());
runPlanTemplateDAO.updateByPrimaryKeyWithBLOBs(templatePlan);
// 更新版本
RunPlanTemplateVersionExample versionExample = new RunPlanTemplateVersionExample();
versionExample.createCriteria().andPlanIdEqualTo(oldPlan.getId());
RunPlanTemplateVersion version = runPlanTemplateVersionDAO.selectByExample(versionExample).get(0);
version.setId(null);
version.setVersion(VersionUtil.generateNext(version.getVersion()));
RunPlanTemplateVersion version = new RunPlanTemplateVersion();
version.setPlanId(oldPlan.getId());
version.setUpdateTime(LocalDateTime.now());
version.setCreatorId(userVO.getId());
version.setVersion(VersionUtil.generateNext(findVersion(oldPlan.getId())));
runPlanTemplateVersionDAO.insert(version);
}
}