|
|
@@ -54,8 +54,9 @@ public class AddDeptService { |
|
|
|
*/ |
|
|
|
public JsonResult add(AddDeptRequest addDeptRequest) { |
|
|
|
log.info("进入添加部门业务接口"); |
|
|
|
String userId = CurrentUserUtil.getUserId(); |
|
|
|
String tenantId = CurrentUserUtil.getTenantId(); |
|
|
|
User user = CurrentUserUtil.getUserInfo(); |
|
|
|
String userId = user.getId(); |
|
|
|
String tenantId = user.getTenantId(); |
|
|
|
JsonResult result = this.check(tenantId, addDeptRequest); |
|
|
|
if (0 != result.getCode()) { |
|
|
|
log.info("添加部门业务接口:校验失败:{}", result.getMsg()); |
|
|
@@ -79,7 +80,7 @@ public class AddDeptService { |
|
|
|
this.updateSuperAdminUser(userId, tenantId, dept); |
|
|
|
|
|
|
|
// 新增公路/路段与部门数据 |
|
|
|
addRoadAndSectionToDept(tenantId, dept.getId(), addDeptRequest.getRoadSectionDtoList()); |
|
|
|
this.addRoadAndSectionToDept(tenantId, dept.getId(), addDeptRequest.getRoadSectionDtoList()); |
|
|
|
|
|
|
|
log.info("添加部门业务接口:添加部门成功:{}"); |
|
|
|
return JsonResult.success(dept); |
|
|
@@ -156,6 +157,10 @@ public class AddDeptService { |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
private void addRoadAndSectionToDept(String tenantId, String deptId, List<RoadSectionDto> roadSectionDtoList) { |
|
|
|
if (CollectionUtil.isNotEmpty(roadSectionDtoList)) { |
|
|
|
log.info("新增部门公路/路段数据为空"); |
|
|
|
return; |
|
|
|
} |
|
|
|
List<RoadInformation> roadInformationList = new ArrayList<>(); |
|
|
|
List<Section> sectionList = new ArrayList<>(); |
|
|
|
RoadInformation road; |