作者 陈志颖

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

... ... @@ -653,7 +653,7 @@ func (repository *CooperationContractRepository) Remove(cooperationContract *dom
if err := cooperationContractUndertakerQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
return nil, err
} else {
if _, err := tx.Model(&cooperationContractUndertakerModels).WherePK().Delete(); err != nil {
if _, err := tx.Model(&cooperationContractUndertakerModels).Delete(); err != nil {
return nil, err
}
}
... ... @@ -663,7 +663,7 @@ func (repository *CooperationContractRepository) Remove(cooperationContract *dom
if err := cooperationContractRelevantQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
return nil, err
} else {
if _, err := tx.Model(&cooperationContractRelevantModels).WherePK().Delete(); err != nil {
if _, err := tx.Model(&cooperationContractRelevantModels).Delete(); err != nil {
return nil, err
}
}
... ... @@ -710,7 +710,7 @@ func (repository *CooperationContractRepository) BatchRemove(cooperationContract
if err := cooperationContractUndertakerQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
return nil, err
} else {
if _, err := tx.Model(&cooperationContractUndertakerModels).WherePK().Delete(); err != nil {
if _, err := tx.Model(&cooperationContractUndertakerModels).Delete(); err != nil {
return nil, err
}
}
... ... @@ -720,7 +720,7 @@ func (repository *CooperationContractRepository) BatchRemove(cooperationContract
if err := cooperationContractRelevantQuery.Where("cooperation_contract_number = ?", cooperationContract.CooperationContractNumber).Select(); err != nil {
return nil, err
} else {
if _, err := tx.Model(&cooperationContractRelevantModels).WherePK().Delete(); err != nil {
if _, err := tx.Model(&cooperationContractRelevantModels).Delete(); err != nil {
return nil, err
}
}
... ...
... ... @@ -12,9 +12,4 @@ func init() {
Logger = logrus.NewLogrusLogger()
Logger.SetServiceName(constant.SERVICE_NAME)
Logger.SetLevel(constant.LOG_LEVEL)
//if constant.ENABLE_KAFKA_LOG {
// w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOSTS, constant.TOPIC_LOG_STASH, false)
// Logger.AddHook(w)
//}
}
... ...