项目域名管理接口修改;生成区段实训时,如果所属计轴区段属于车辆段,跳过

This commit is contained in:
joylink_zhangsai 2021-11-30 16:28:53 +08:00
parent a5f30e905d
commit 5ea4b7af3e
4 changed files with 30 additions and 2 deletions

View File

@ -13,6 +13,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 项目域名管理接口
*/
@Slf4j
@RestController
@RequestMapping("/api/projectServer")
@ -47,4 +50,10 @@ public class ProjectServerController {
this.serverService.update(id, vo, accountVO);
}
@Role(RoleEnum.SuperAdmin)
@DeleteMapping("/{id}")
public void delete(@PathVariable Long id) {
this.serverService.delete(id);
}
}

View File

@ -7,11 +7,13 @@ import club.joylink.rtss.vo.project.ProjectServerQueryVO;
import club.joylink.rtss.vo.project.ProjectServerVO;
public interface ServerService {
public ProjectServerVO getByProject(Project project);
ProjectServerVO getByProject(Project project);
PageVO<ProjectServerVO> pagingQuery(ProjectServerQueryVO queryVO);
String create(ProjectServerVO vo, AccountVO accountVO);
void update(Long id, ProjectServerVO vo, AccountVO accountVO);
void delete(Long id);
}

View File

@ -14,6 +14,7 @@ import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.List;
@ -32,7 +33,14 @@ public class ServerServiceImpl implements ServerService {
example.createCriteria()
.andProjectEqualTo(project.name());
List<ProjectServer> projectServerList = this.projectServerDAO.selectByExample(example);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(projectServerList);
if (CollectionUtils.isEmpty(projectServerList)) {
example.clear();
example.createCriteria().andProjectEqualTo(Project.DEFAULT.name());
projectServerList = this.projectServerDAO.selectByExample(example);
}
if (CollectionUtils.isEmpty(projectServerList)) {
return null;
}
return new ProjectServerVO(projectServerList.get(0));
}
@ -78,4 +86,9 @@ public class ServerServiceImpl implements ServerService {
this.projectServerDAO.updateByPrimaryKey(projectServer);
}
}
@Override
public void delete(Long id) {
projectServerDAO.deleteByPrimaryKey(id);
}
}

View File

@ -37,6 +37,10 @@ public class SectionGeneratorNew implements GeneratorNew {
if (section.getStation() != null && section.getStation().isDepot()) {
continue;
}
Section axleCounterSection = section.findAxleCounterSection();
if (axleCounterSection != null && axleCounterSection.getStation().isDepot()) {
continue;
}
if(StringUtils.isEmpty(section.getName())){
continue;
}