Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.1.0^2
wanjing 1 year ago
parent
commit
3fa6cfa38d
2 changed files with 11 additions and 1 deletions
  1. +4
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/query/QueryDeptInfoService.java
  2. +7
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/road/RoadInformationServiceImpl.java

+ 4
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/query/QueryDeptInfoService.java View File

@@ -1,6 +1,7 @@
package com.tuoheng.admin.service.dept.query;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.conver.DeptConverMapper;
import com.tuoheng.admin.dto.RoadSectionDto;
@@ -176,6 +177,9 @@ public class QueryDeptInfoService {
sectionListTmp = new ArrayList<>();
sectionListTmp.add(section);
roadInformation = roadInformationMap.get(section.getRoadId());
if (ObjectUtil.isNull(roadInformation)) {
continue;
}
roadSectionDto.setRoad(roadInformation);
roadSectionDto.setSectionList(sectionListTmp);
roadSectionDtoList.add(roadSectionDto);

+ 7
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/road/RoadInformationServiceImpl.java View File

@@ -127,7 +127,13 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
entity.setTenantId(CurrentUserUtil.getTenantId());
} else {
//更新
if (this.getInformationListByCode(entity)) return JsonResult.error("公路已存在");
RoadInformation roadInformation = this.getOne(Wrappers.<RoadInformation>lambdaQuery().eq(RoadInformation::getId, entity.getId()));
String code = entity.getCode();
//当前公路的code是否重复判断
if(!code.equals(roadInformation.getCode())){
//code如果不存在则查询数据库中公路列表是否有重复的code
if (this.getInformationListByCode(entity)) return JsonResult.error("公路已存在");
}
entity.setUpdateUser(userId);
entity.setUpdateTime(DateUtils.now());
entity.setTenantId(CurrentUserUtil.getTenantId());

Loading…
Cancel
Save