|
@@ -265,6 +265,16 @@ func (s *contractService) Get(treeId int, bidsectionId int, projectId int) *view
|
|
|
section := s.treeContractDao.Get(treeId, bidsectionId, projectId)
|
|
|
// 2.构造数据
|
|
|
sectionVM := s.makeSectionView(section)
|
|
|
+ // 3.更新 上移和下一的限制
|
|
|
+ youngerBrotherList := s.treeContractDao.GetYoungerBrother(section.Serial, section.Depth, section.ParentId, bidsectionId, projectId)
|
|
|
+ if len(youngerBrotherList) == 0 {
|
|
|
+ sectionVM.IsEnd = true
|
|
|
+ }
|
|
|
+ sectionVM.ElderBrother = true
|
|
|
+ elderBrotherList := s.treeContractDao.GetElderBrother(section.Serial, section.Depth, section.ParentId, bidsectionId, projectId)
|
|
|
+ if len(elderBrotherList) == 0 {
|
|
|
+ sectionVM.ElderBrother = false
|
|
|
+ }
|
|
|
return sectionVM
|
|
|
}
|
|
|
|