get_erp_user_logic.go 855 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package logic
  2. import (
  3. "context"
  4. "git.i2edu.net/i2/i2-bill-erp/internal/svc"
  5. "git.i2edu.net/i2/i2-bill-erp/transform"
  6. "git.i2edu.net/i2/go-zero/core/logx"
  7. )
  8. type GetErpUserLogic struct {
  9. ctx context.Context
  10. svcCtx *svc.ServiceContext
  11. logx.Logger
  12. }
  13. func NewGetErpUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetErpUserLogic {
  14. return &GetErpUserLogic{
  15. ctx: ctx,
  16. svcCtx: svcCtx,
  17. Logger: logx.WithContext(ctx),
  18. }
  19. }
  20. // 查看erp用户是否正常
  21. func (l *GetErpUserLogic) GetErpUser(in *transform.ErpUserReq) (*transform.ErpUserRes, error) {
  22. findOne, err := l.svcCtx.SysUserModel.FindOrgById(in.ErpId)
  23. if err != nil {
  24. return nil, err
  25. }
  26. res := &transform.ErpUserRes{}
  27. if findOne == nil {
  28. return res, nil
  29. }
  30. if findOne.OsId != 0 {
  31. res.OsId = findOne.OsId
  32. res.OsName = findOne.OsName
  33. }
  34. return res, nil
  35. }