作者 陈志颖

feat:调整合约删除和批量删除

@@ -653,7 +653,7 @@ func (repository *CooperationContractRepository) Remove(cooperationContract *dom @@ -653,7 +653,7 @@ func (repository *CooperationContractRepository) Remove(cooperationContract *dom
653 if err := cooperationContractUndertakerQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil { 653 if err := cooperationContractUndertakerQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
654 return nil, err 654 return nil, err
655 } else { 655 } else {
656 - if _, err := tx.Model(&cooperationContractUndertakerModels).WherePK().Delete(); err != nil { 656 + if _, err := tx.Model(&cooperationContractUndertakerModels).Delete(); err != nil {
657 return nil, err 657 return nil, err
658 } 658 }
659 } 659 }
@@ -663,7 +663,7 @@ func (repository *CooperationContractRepository) Remove(cooperationContract *dom @@ -663,7 +663,7 @@ func (repository *CooperationContractRepository) Remove(cooperationContract *dom
663 if err := cooperationContractRelevantQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil { 663 if err := cooperationContractRelevantQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
664 return nil, err 664 return nil, err
665 } else { 665 } else {
666 - if _, err := tx.Model(&cooperationContractRelevantModels).WherePK().Delete(); err != nil { 666 + if _, err := tx.Model(&cooperationContractRelevantModels).Delete(); err != nil {
667 return nil, err 667 return nil, err
668 } 668 }
669 } 669 }
@@ -710,7 +710,7 @@ func (repository *CooperationContractRepository) BatchRemove(cooperationContract @@ -710,7 +710,7 @@ func (repository *CooperationContractRepository) BatchRemove(cooperationContract
710 if err := cooperationContractUndertakerQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil { 710 if err := cooperationContractUndertakerQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
711 return nil, err 711 return nil, err
712 } else { 712 } else {
713 - if _, err := tx.Model(&cooperationContractUndertakerModels).WherePK().Delete(); err != nil { 713 + if _, err := tx.Model(&cooperationContractUndertakerModels).Delete(); err != nil {
714 return nil, err 714 return nil, err
715 } 715 }
716 } 716 }
@@ -720,7 +720,7 @@ func (repository *CooperationContractRepository) BatchRemove(cooperationContract @@ -720,7 +720,7 @@ func (repository *CooperationContractRepository) BatchRemove(cooperationContract
720 if err := cooperationContractRelevantQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil { 720 if err := cooperationContractRelevantQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
721 return nil, err 721 return nil, err
722 } else { 722 } else {
723 - if _, err := tx.Model(&cooperationContractRelevantModels).WherePK().Delete(); err != nil { 723 + if _, err := tx.Model(&cooperationContractRelevantModels).Delete(); err != nil {
724 return nil, err 724 return nil, err
725 } 725 }
726 } 726 }
@@ -12,9 +12,4 @@ func init() { @@ -12,9 +12,4 @@ func init() {
12 Logger = logrus.NewLogrusLogger() 12 Logger = logrus.NewLogrusLogger()
13 Logger.SetServiceName(constant.SERVICE_NAME) 13 Logger.SetServiceName(constant.SERVICE_NAME)
14 Logger.SetLevel(constant.LOG_LEVEL) 14 Logger.SetLevel(constant.LOG_LEVEL)
15 -  
16 - //if constant.ENABLE_KAFKA_LOG {  
17 - // w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOSTS, constant.TOPIC_LOG_STASH, false)  
18 - // Logger.AddHook(w)  
19 - //}  
20 } 15 }