caipin 4 년 전
부모
커밋
d3942e7d82
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      conf/db.go
  2. 2 2
      services/contract_section_tree_service.go

+ 2 - 2
conf/db.go

@@ -29,7 +29,7 @@ var DbMasterList = []DbConfig{
 	},
 	// production
 	{
-		Host:      "192.168.1.158",
+		Host:      "192.168.1.26",
 		Port:      8066,
 		User:      "root",
 		Pwd:       "123456",
@@ -38,4 +38,4 @@ var DbMasterList = []DbConfig{
 	},
 }
 
-var DbMaster = DbMasterList[0]
+var DbMaster = DbMasterList[1]

+ 2 - 2
services/contract_section_tree_service.go

@@ -107,10 +107,10 @@ func (s *contractService) SectionAdd(sectionData *viewmodels.TreeSectionContract
 	attribution := fmt.Sprintf("%s%d-", sectionFather.Attribution, sectionFather.Serial)
 	code := fmt.Sprintf("%s%d", attribution, serial)
 	// 2-3获得新增ID
-	// lastId := s.treeContractDao.GetLastId()
+	lastId := s.treeContractDao.GetLastId()
 	// 新增项目节
 	sectionCM := &models.CmTreeContracts{}
-	// sectionCM.Id = lastId.Id
+	sectionCM.Id = lastId.Id + 1
 	sectionCM.TreeType = treeType
 	sectionCM.ParentId = sectionFather.TreeId
 	sectionCM.Name = sectionData.Name