作者 陈志颖

fix:分红预算错误报告

@@ -763,12 +763,18 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -763,12 +763,18 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
763 // 分析成功和失败原因 763 // 分析成功和失败原因
764 successfullyCount := len(dividendsEstimatesSaved) 764 successfullyCount := len(dividendsEstimatesSaved)
765 // 错误原因收集,返回第一个可能的原因 765 // 错误原因收集,返回第一个可能的原因
766 - var failedReason []string 766 + failedReason := make([]string, 0)
767 for _, v := range estimateFailedDividendsOrders { 767 for _, v := range estimateFailedDividendsOrders {
768 failedReason = append(failedReason, v) 768 failedReason = append(failedReason, v)
769 } 769 }
  770 + var failedReasonStr string
  771 + if len(failedReason) > 0 {
  772 + failedReasonStr = failedReason[0]
  773 + } else {
  774 + failedReasonStr = "无"
  775 + }
770 return map[string]interface{}{ 776 return map[string]interface{}{
771 - "report": fmt.Sprintf("已完成%d笔单订单分红预算,生成%d笔单分红预算,%d笔订单分红预算失败,失败原因:%s", len(estimateSuccessfullyDividendsOrders), successfullyCount, len(estimateFailedDividendsOrders), failedReason[0]), 777 + "report": fmt.Sprintf("已完成%d笔单订单分红预算,生成%d笔单分红预算,%d笔订单分红预算失败,失败原因:%s", len(estimateSuccessfullyDividendsOrders), successfullyCount, len(estimateFailedDividendsOrders), failedReasonStr),
772 }, nil 778 }, nil
773 } 779 }
774 } 780 }