|
@@ -208,7 +208,7 @@ func (s *StoreEntry) NeckRingLogList(ctx context.Context, req *pasturePb.SearchN
|
|
|
}, nil
|
|
|
}
|
|
|
|
|
|
-func (s *StoreEntry) OutboundApply(ctx context.Context, req *pasturePb.OutboundApplyCreatedRequest) error {
|
|
|
+func (s *StoreEntry) OutboundApply(ctx context.Context, req *pasturePb.OutboundApplyItem) error {
|
|
|
currentUser, err := s.GetCurrentSystemUser(ctx)
|
|
|
if err != nil {
|
|
|
return xerr.Custom("登录人信息失效")
|
|
@@ -361,3 +361,46 @@ func (s *StoreEntry) OutboundAudit(ctx context.Context, req *pasturePb.OutboundA
|
|
|
|
|
|
return nil
|
|
|
}
|
|
|
+
|
|
|
+func (s *StoreEntry) OutboundDetail(ctx context.Context, id int64) (*pasturePb.OutboundDetailResponse, error) {
|
|
|
+ outbound, err := s.GetOutboundById(ctx, id)
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ outboundLogs, err := s.GetOutboundLogsByOutboundId(ctx, id)
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ outTypeMap := s.OutTypeMap()
|
|
|
+ auditStatusMap := s.AuditStatusMap()
|
|
|
+ applicantAtFormat, examineAtFormat := "", ""
|
|
|
+ if outbound.ApplicantAt > 0 {
|
|
|
+ applicantAtFormat = time.Unix(outbound.ApplicantAt, 0).Format(model.LayoutTime)
|
|
|
+ }
|
|
|
+ if outbound.ExamineAt > 0 {
|
|
|
+ examineAtFormat = time.Unix(outbound.ExamineAt, 0).Format(model.LayoutTime)
|
|
|
+ }
|
|
|
+ return &pasturePb.OutboundDetailResponse{
|
|
|
+ Code: http.StatusOK,
|
|
|
+ Message: "ok",
|
|
|
+ Data: &pasturePb.OutboundApplyDetail{
|
|
|
+ Id: outbound.Id,
|
|
|
+ Number: outbound.Number,
|
|
|
+ OutType: outbound.OutType,
|
|
|
+ OutTypeName: outTypeMap[outbound.OutType],
|
|
|
+ AuditStatus: outbound.AuditStatus,
|
|
|
+ AuditStatusName: auditStatusMap[outbound.AuditStatus],
|
|
|
+ ApplicantName: outbound.ApplicantName,
|
|
|
+ ApplicantRemarks: outbound.ApplicantRemarks,
|
|
|
+ ExamineName: outbound.ExamineName,
|
|
|
+ ExamineRemarks: outbound.ExamineRemarks,
|
|
|
+ ApplicantAtFormat: applicantAtFormat,
|
|
|
+ ExamineAtFormat: examineAtFormat,
|
|
|
+ GoodsItem: &pasturePb.OutboundApplyItem{
|
|
|
+ OutType: outbound.OutType,
|
|
|
+ Goods: model.OutboundLogSlice(outboundLogs).ToPB(),
|
|
|
+ ApplicantRemarks: outbound.ApplicantRemarks,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }, nil
|
|
|
+}
|