作者 陈志颖

合并分支 'dev' 到 'test'

fix:分红退货单分红状态更新



查看合并请求 !33
@@ -893,6 +893,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -893,6 +893,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
893 dividendsGoodCount = dividendsGoodCount + 1 893 dividendsGoodCount = dividendsGoodCount + 1
894 } 894 }
895 } 895 }
  896 +
896 if dividendsGoodCount == len(dividendsReturnedOrderFound.Goods) { // 2已分红 897 if dividendsGoodCount == len(dividendsReturnedOrderFound.Goods) { // 2已分红
897 dividendsReturnedOrdersFound[i].DividendStatus = 2 898 dividendsReturnedOrdersFound[i].DividendStatus = 2
898 } else if dividendsGoodCount > 0 && dividendsGoodCount < len(dividendsReturnedOrderFound.Goods) { // 3部分分红 899 } else if dividendsGoodCount > 0 && dividendsGoodCount < len(dividendsReturnedOrderFound.Goods) { // 3部分分红
@@ -60,24 +60,36 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -60,24 +60,36 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
60 "orgId": orderGood.OrgId, 60 "orgId": orderGood.OrgId,
61 }) 61 })
62 if err != nil { 62 if err != nil {
  63 + var orderNumber string
  64 + if orderGood.DividendsOrderNumber != "" {
  65 + orderNumber = orderGood.DividendsOrderNumber
  66 + } else {
  67 + orderNumber = orderGood.DividendsReturnedOrderNumber
  68 + }
63 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{ 69 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
64 DividendsUser: nil, 70 DividendsUser: nil,
65 DividendsParticipateType: 0, 71 DividendsParticipateType: 0,
66 DividendsStage: 0, 72 DividendsStage: 0,
67 DividendsAmount: 0, 73 DividendsAmount: 0,
68 - OrderOrReturnedOrderNumber: orderGood.DividendsOrderNumber, 74 + OrderOrReturnedOrderNumber: orderNumber,
69 IsSuccessfully: false, 75 IsSuccessfully: false,
70 Reason: "共创合约错误", 76 Reason: "共创合约错误",
71 }) 77 })
72 continue 78 continue
73 } 79 }
74 if cooperationContract == nil { 80 if cooperationContract == nil {
  81 + var orderNumber string
  82 + if orderGood.DividendsOrderNumber != "" {
  83 + orderNumber = orderGood.DividendsOrderNumber
  84 + } else {
  85 + orderNumber = orderGood.DividendsReturnedOrderNumber
  86 + }
75 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{ 87 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
76 DividendsUser: nil, 88 DividendsUser: nil,
77 DividendsParticipateType: 0, 89 DividendsParticipateType: 0,
78 DividendsStage: 0, 90 DividendsStage: 0,
79 DividendsAmount: 0, 91 DividendsAmount: 0,
80 - OrderOrReturnedOrderNumber: orderGood.DividendsOrderNumber, 92 + OrderOrReturnedOrderNumber: orderNumber,
81 IsSuccessfully: false, 93 IsSuccessfully: false,
82 Reason: "共创合约" + orderGood.CooperationContractNumber + "不存在", 94 Reason: "共创合约" + orderGood.CooperationContractNumber + "不存在",
83 }) 95 })
@@ -92,12 +104,18 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -92,12 +104,18 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
92 //"notPause": true, 104 //"notPause": true,
93 }) 105 })
94 if err != nil { 106 if err != nil {
  107 + var orderNumber string
  108 + if orderGood.DividendsOrderNumber != "" {
  109 + orderNumber = orderGood.DividendsOrderNumber
  110 + } else {
  111 + orderNumber = orderGood.DividendsReturnedOrderNumber
  112 + }
95 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{ 113 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
96 DividendsUser: nil, 114 DividendsUser: nil,
97 DividendsParticipateType: 0, 115 DividendsParticipateType: 0,
98 DividendsStage: 0, 116 DividendsStage: 0,
99 DividendsAmount: 0, 117 DividendsAmount: 0,
100 - OrderOrReturnedOrderNumber: orderGood.DividendsOrderNumber, 118 + OrderOrReturnedOrderNumber: orderNumber,
101 IsSuccessfully: false, 119 IsSuccessfully: false,
102 Reason: "共创项目" + orderGood.CooperationContractNumber + "查询错误", 120 Reason: "共创项目" + orderGood.CooperationContractNumber + "查询错误",
103 }) 121 })
@@ -105,12 +123,18 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -105,12 +123,18 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
105 //return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 123 //return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
106 } 124 }
107 if cooperationProject == nil { 125 if cooperationProject == nil {
  126 + var orderNumber string
  127 + if orderGood.DividendsOrderNumber != "" {
  128 + orderNumber = orderGood.DividendsOrderNumber
  129 + } else {
  130 + orderNumber = orderGood.DividendsReturnedOrderNumber
  131 + }
108 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{ 132 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
109 DividendsUser: nil, 133 DividendsUser: nil,
110 DividendsParticipateType: 0, 134 DividendsParticipateType: 0,
111 DividendsStage: 0, 135 DividendsStage: 0,
112 DividendsAmount: 0, 136 DividendsAmount: 0,
113 - OrderOrReturnedOrderNumber: orderGood.DividendsOrderNumber, 137 + OrderOrReturnedOrderNumber: orderNumber,
114 IsSuccessfully: false, 138 IsSuccessfully: false,
115 Reason: "共创项目" + orderGood.CooperationContractNumber + "已结束或不存在", 139 Reason: "共创项目" + orderGood.CooperationContractNumber + "已结束或不存在",
116 }) 140 })
@@ -316,7 +340,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -316,7 +340,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
316 DividendsParticipateType: domain.UNDERTAKER, 340 DividendsParticipateType: domain.UNDERTAKER,
317 DividendsStage: dividendsIncentivesRuleMatched.DividendsIncentivesStage, 341 DividendsStage: dividendsIncentivesRuleMatched.DividendsIncentivesStage,
318 DividendsAmount: -undertakerDividendsAmount, 342 DividendsAmount: -undertakerDividendsAmount,
319 - OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsOrderNumber, 343 + OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsReturnedOrderNumber,
320 IsSuccessfully: true, 344 IsSuccessfully: true,
321 }) 345 })
322 } 346 }
@@ -342,7 +366,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -342,7 +366,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
342 DividendsParticipateType: domain.REFERRER, 366 DividendsParticipateType: domain.REFERRER,
343 DividendsStage: dividendsIncentivesRuleMatched.DividendsIncentivesStage, 367 DividendsStage: dividendsIncentivesRuleMatched.DividendsIncentivesStage,
344 DividendsAmount: -referrerDividendsAmount, 368 DividendsAmount: -referrerDividendsAmount,
345 - OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsOrderNumber, 369 + OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsReturnedOrderNumber,
346 IsSuccessfully: true, 370 IsSuccessfully: true,
347 }) 371 })
348 } 372 }
@@ -369,7 +393,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo @@ -369,7 +393,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
369 DividendsParticipateType: domain.SALESMAN, 393 DividendsParticipateType: domain.SALESMAN,
370 DividendsStage: dividendsIncentivesRuleMatched.DividendsIncentivesStage, 394 DividendsStage: dividendsIncentivesRuleMatched.DividendsIncentivesStage,
371 DividendsAmount: -salesmanDividendsAmount, 395 DividendsAmount: -salesmanDividendsAmount,
372 - OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsOrderNumber, 396 + OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsReturnedOrderNumber,
373 IsSuccessfully: true, 397 IsSuccessfully: true,
374 }) 398 })
375 } 399 }