Browse Source

feature:任务单经销商获取逻辑修改

sunxinyuan 1 year ago
parent
commit
ee88ef8a64
1 changed files with 7 additions and 0 deletions
  1. 7 0
      opms_parent/app/service/work/deliver_order.go

+ 7 - 0
opms_parent/app/service/work/deliver_order.go

@@ -84,6 +84,12 @@ func (s DeliverOrderService) Get(ctx context.Context, id int) (*work.DeliverOrde
 	if err != nil {
 		return nil, err
 	}
+	Contract, err := s.ContractDao.Where("id =?", ent.ContractId).One()
+	if err != nil {
+		return nil, err
+	}
+	ent.DistributorId = Contract.DistributorId
+	ent.DistributorName = Contract.DistributorName
 	if ent == nil {
 		return nil, myerrors.TipsError("工单不存在")
 	}
@@ -101,6 +107,7 @@ func (s DeliverOrderService) Get(ctx context.Context, id int) (*work.DeliverOrde
 	if product == nil {
 		product = []*work.DeliverOrderProduct{}
 	}
+
 	proj, err := s.ProjBusinessDao.Where("id = ?", ent.ProjectId).One()
 	if err != nil {
 		return nil, err