addacceptancelogic.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package logic
  2. import (
  3. IC "bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/config"
  4. "bp.jydev.jianyu360.cn/BaseService/biService/service"
  5. "context"
  6. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/svc"
  7. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type AddAcceptanceLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewAddAcceptanceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddAcceptanceLogic {
  16. return &AddAcceptanceLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. func (l *AddAcceptanceLogic) AddAcceptance(in *pb.AcceptanceReq) (*pb.AcceptanceResp, error) {
  23. // todo: add your logic here and delete this line
  24. productMap := map[string]string{}
  25. for _, v := range IC.IC.ProductArr {
  26. productMap[v] = "dk"
  27. }
  28. scProductMap := map[string]string{}
  29. for _, v := range IC.IC.ScProductArr {
  30. scProductMap[v] = "scdk"
  31. }
  32. return &pb.AcceptanceResp{
  33. ErrorCode: 0,
  34. Data: &pb.Acceptance{
  35. AcceptanceNo: service.AddAcceptance(in, IC.IC.DkPersonMap, IC.IC.ScDkPersonMap, IC.IC.EntId, productMap, scProductMap),
  36. },
  37. }, nil
  38. }