作者 陈志颖

fix:分红预算错误报告

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