|
@@ -29,6 +29,7 @@ type ContractService interface {
|
|
|
ValidRuleTemplate(ctx iris.Context) (*viewmodels.TreeSectionContract, error)
|
|
|
ValidRuleSectionAdd(ctx iris.Context) (*viewmodels.TreeSectionContract, error)
|
|
|
ValidRuleSectionDelete(ctx iris.Context) (*viewmodels.TreeSectionContract, error)
|
|
|
+ ValidRuleSectionNot(ctx iris.Context) (*viewmodels.TreeSectionContract, error)
|
|
|
ValidRuleGet(ctx iris.Context) (*viewmodels.TreeSectionContract, error)
|
|
|
ValidRuleSerial(ctx iris.Context) (*viewmodels.TreeSectionContract, error)
|
|
|
ValidRuleContractAdd(ctx iris.Context) (*viewmodels.Contracts, error)
|
|
@@ -42,6 +43,7 @@ type ContractService interface {
|
|
|
ValidRuleContractPaid(ctx iris.Context) (*viewmodels.ContractsPaid, error)
|
|
|
ValidRuleContractPaidDel(ctx iris.Context) (*viewmodels.ContractsPaid, error)
|
|
|
|
|
|
+ // 项目节
|
|
|
Get(treeId int, bidsectionId int, projectId int, treeType int) *viewmodels.TreeSectionContract
|
|
|
GetSectionTreeContract(attribution string, bidsectionId int, projectId int, treeType int) []*viewmodels.Contracts
|
|
|
GetSecionTree(bidsectionId int, projectId int, treeType int) *viewmodels.TreeSectionContract
|
|
@@ -52,6 +54,7 @@ type ContractService interface {
|
|
|
SectionDelete(treeId int, bidsectionId int, projectId int, treeType int) error
|
|
|
MoveDepth(sectionData *viewmodels.TreeSectionContract, bidsectionId int, projectId int, treeType int) error
|
|
|
MoveSerial(sectionData *viewmodels.TreeSectionContract, bidsectionId int, projectId int, treeType int) error
|
|
|
+ GetSecionTreeNotContract(bidsectionId int, projectId int, treeType int) *viewmodels.TreeSectionContract
|
|
|
|
|
|
GetContract(contractId int) *viewmodels.Contracts
|
|
|
Add(contractData *viewmodels.Contracts, projectId int, bidsectionId int, treeId int) error
|
|
@@ -172,6 +175,23 @@ func (s *contractService) ValidRuleSectionDelete(ctx iris.Context) (*viewmodels.
|
|
|
return treeSectionVaild, nil
|
|
|
}
|
|
|
|
|
|
+func (s *contractService) ValidRuleSectionNot(ctx iris.Context) (*viewmodels.TreeSectionContract, error) {
|
|
|
+ treeSectionVaild := &viewmodels.TreeSectionContract{}
|
|
|
+ err := ctx.ReadForm(treeSectionVaild)
|
|
|
+ if err != nil {
|
|
|
+ log.Println("folder-ValidRule-ReadForm转换异常, error=", err)
|
|
|
+ return treeSectionVaild, err
|
|
|
+ }
|
|
|
+
|
|
|
+ err = treeSectionVaild.ValidateSectionNot()
|
|
|
+ if err != nil {
|
|
|
+ log.Println("参数验证错误, error=", err)
|
|
|
+ return treeSectionVaild, err
|
|
|
+ }
|
|
|
+
|
|
|
+ return treeSectionVaild, nil
|
|
|
+}
|
|
|
+
|
|
|
func (s *contractService) ValidRuleGet(ctx iris.Context) (*viewmodels.TreeSectionContract, error) {
|
|
|
treeSectionVaild := &viewmodels.TreeSectionContract{}
|
|
|
err := ctx.ReadForm(treeSectionVaild)
|
|
@@ -314,7 +334,7 @@ func (s *contractService) Add(contractData *viewmodels.Contracts, projectId int,
|
|
|
if contracts.Id == 0 {
|
|
|
return errors.New("未找到项目节")
|
|
|
}
|
|
|
- // k := int32(projectId)
|
|
|
+
|
|
|
// 2.项目节是没有合同
|
|
|
if contracts.ContractId != 0 {
|
|
|
return errors.New("该项目节上已经存在合同")
|