作者 yangfu

批量导入数据修改

... ... @@ -21,7 +21,7 @@ func (ptr *PgBatchAddOrgService) BatchAddOrg(optUser *domain.OperateInfo, orgLis
if err != nil {
return err
}
_, orgs, err := orgRepository.Find(map[string]interface{}{"companyId": optUser.CompanyId})
_, orgs, err := orgRepository.Find(map[string]interface{}{"companyId": optUser.CompanyId, "limit": 10000})
if err != nil {
return err
}
... ... @@ -52,7 +52,7 @@ func (ptr *PgBatchAddOrgService) BatchAddOrg(optUser *domain.OperateInfo, orgLis
orgItem, err = createOrgService.CreateOrg(optUser, orgItem)
if err != nil {
return err
return fmt.Errorf("%v %v", item.OrgName, err.Error())
}
if _, ok := mapOrg[orgItem.OrgCode]; !ok {
mapOrg[orgItem.OrgCode] = orgItem
... ...
... ... @@ -90,7 +90,7 @@ func (ptr *PgBatchAddUserService) BatchAddUser2(optUser *domain.OperateInfo, use
if err != nil {
return err
}
_, orgs, err := orgRepository.Find(map[string]interface{}{"companyId": optUser.CompanyId})
_, orgs, err := orgRepository.Find(map[string]interface{}{"companyId": optUser.CompanyId, "limit": 10000})
if err != nil {
return err
}
... ... @@ -143,7 +143,7 @@ func (ptr *PgBatchAddUserService) BatchAddUser2(optUser *domain.OperateInfo, use
UpdatedAt: time.Now(),
}
if newUser, err = createUserService.CreateUser(nil, newUser, password); err != nil {
return err
return fmt.Errorf("%v %v", user.UserName, err.Error())
}
}
return nil
... ...