get_erp_user_logic.go 826 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 != "" {
  31. res.OsId = findOne.OsId
  32. }
  33. return res, nil
  34. }