|
|
@@ -344,14 +344,24 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context, req md.CentralKitch |
|
|
|
if err6 != nil { |
|
|
|
fmt.Println("dealReturnOrdMap_ERR::::", err6.Error()) |
|
|
|
//TODO::1、将 central_kitchen_for_school_user_refund_day 审核状态修改为`退款中` |
|
|
|
sql := fmt.Sprintf("update central_kitchen_for_school_user_refund_day set state =5, memo = '%s' where out_request_no = '%s'", err6.Error(), v.OutRequestNo) |
|
|
|
var sql string |
|
|
|
sql = fmt.Sprintf("update central_kitchen_for_school_user_refund_day set state =5, memo = '%s' where out_request_no = '%s'", err6.Error(), v.OutRequestNo) |
|
|
|
db.ExecuteOriginalSql(db.Db, sql) |
|
|
|
utils.FilePutContents("dealReturnOrdMap_ERR", utils.SerializeStr(map[string]interface{}{ |
|
|
|
"sql": sql, |
|
|
|
"err": err6.Error(), |
|
|
|
})) |
|
|
|
} else { |
|
|
|
//TODO::处理订单状态 |
|
|
|
err = svc.JudgePackageOrdOrdState(k) |
|
|
|
if err != nil { |
|
|
|
utils.FilePutContents("dealReturnOrdMap_judge_packageOrdState_ERR", utils.SerializeStr(map[string]interface{}{ |
|
|
|
"err": err.Error(), |
|
|
|
})) |
|
|
|
} |
|
|
|
} |
|
|
|
time.Sleep(100 * time.Millisecond) //TODO::避免频繁调用 |
|
|
|
|
|
|
|
time.Sleep(10 * time.Millisecond) //TODO::避免频繁调用 |
|
|
|
} |
|
|
|
|
|
|
|
//调用微信进行退款 |
|
|
@@ -376,36 +386,40 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context, req md.CentralKitch |
|
|
|
}, |
|
|
|
}, |
|
|
|
) |
|
|
|
fmt.Println(">>>>wxRefund<<<<", resp.Status) |
|
|
|
|
|
|
|
if err6 != nil { |
|
|
|
if err6 != nil { |
|
|
|
fmt.Println("dealReturnOrdMapForWx_ERR::::", err6.Error()) |
|
|
|
//TODO::1、将审核状态修改为`退款中` |
|
|
|
sql := fmt.Sprintf("update central_kitchen_for_school_user_refund_day set state =5, memo = '%s' where out_request_no = '%s'", err6.Error(), v.OutRequestNo) |
|
|
|
var sql string |
|
|
|
parts := strings.Split(err6.Error(), "Message: ") |
|
|
|
if len(parts) > 1 { |
|
|
|
// 去除"Message:"后面的换行符和空格 |
|
|
|
message := strings.TrimSpace(parts[1]) |
|
|
|
sql = fmt.Sprintf("update central_kitchen_for_school_user_refund_day set state =5, memo = '%s' where out_request_no = '%s'", message, v.OutRequestNo) |
|
|
|
} else { |
|
|
|
sql = fmt.Sprintf("update central_kitchen_for_school_user_refund_day set state =5, memo = '%s' where out_request_no = '%s'", err6.Error(), v.OutRequestNo) |
|
|
|
} |
|
|
|
db.ExecuteOriginalSql(db.Db, sql) |
|
|
|
utils.FilePutContents("dealReturnOrdMapForWx_ERR", utils.SerializeStr(map[string]interface{}{ |
|
|
|
"sql": sql, |
|
|
|
"err": err6.Error(), |
|
|
|
})) |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
//TODO::处理订单状态 |
|
|
|
err = svc.JudgePackageOrdOrdState(k) |
|
|
|
if err != nil { |
|
|
|
utils.FilePutContents("dealReturnOrdMapForWx_judge_packageOrdState_ERR", utils.SerializeStr(map[string]interface{}{ |
|
|
|
"err": err.Error(), |
|
|
|
})) |
|
|
|
} |
|
|
|
} |
|
|
|
fmt.Println(">>>>wxRefund<<<<", resp.Status) |
|
|
|
time.Sleep(100 * time.Millisecond) //TODO::避免频繁调用 |
|
|
|
|
|
|
|
time.Sleep(10 * time.Millisecond) //TODO::避免频繁调用 |
|
|
|
} |
|
|
|
//} |
|
|
|
|
|
|
|
//TODO:: 处理订单状态 |
|
|
|
for k, _ := range dealReturnOrdMap { |
|
|
|
err = svc.JudgePackageOrdOrdState(k) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
for k, _ := range dealReturnOrdMapForWx { |
|
|
|
err = svc.JudgePackageOrdOrdState(k) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
return |
|
|
|
} |