@@ -165,6 +165,14 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context) { | |||||
e.OutErr(c, e.ERR_DB_ORM, errors.New("更新退款就餐记录状态失败2")) | e.OutErr(c, e.ERR_DB_ORM, errors.New("更新退款就餐记录状态失败2")) | ||||
return | return | ||||
} | } | ||||
//2、处理订单状态 | |||||
err5 := svc.JudgePackageOrdOrdState(returnDay.OutTradeNo) | |||||
if err5 != nil { | |||||
_ = session.Rollback() | |||||
e.OutErr(c, e.ERR, err5.Error()) | |||||
return | |||||
} | |||||
} | } | ||||
returnDay.Memo = req.Memo | returnDay.Memo = req.Memo | ||||
@@ -179,14 +187,6 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context) { | |||||
e.OutErr(c, e.ERR_DB_ORM, errors.New("更新退款订单记录状态失败1")) | e.OutErr(c, e.ERR_DB_ORM, errors.New("更新退款订单记录状态失败1")) | ||||
return | return | ||||
} | } | ||||
//2、处理订单状态 | |||||
err5 := svc.JudgePackageOrdOrdState(returnDay.OutTradeNo) | |||||
if err5 != nil { | |||||
_ = session.Rollback() | |||||
e.OutErr(c, e.ERR, err5.Error()) | |||||
return | |||||
} | |||||
} | } | ||||
err = session.Commit() | err = session.Commit() | ||||
@@ -261,13 +261,6 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context, req md.CentralKitch | |||||
return | return | ||||
} | } | ||||
//2、处理订单状态 | |||||
err5 := svc.JudgePackageOrdOrdState(returnDay.OutTradeNo) | |||||
if err5 != nil { | |||||
_ = session.Rollback() | |||||
return err5 | |||||
} | |||||
updateAck1, err4 := centralKitchenForSchoolUserWithDayDb.CentralKitchenForSchoolUserWithDayUpdate(userWithDay.Id, userWithDay, "state") | updateAck1, err4 := centralKitchenForSchoolUserWithDayDb.CentralKitchenForSchoolUserWithDayUpdate(userWithDay.Id, userWithDay, "state") | ||||
if err4 != nil { | if err4 != nil { | ||||
_ = session.Rollback() | _ = session.Rollback() | ||||
@@ -335,5 +328,20 @@ func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context, req md.CentralKitch | |||||
time.Sleep(20 * time.Millisecond) //TODO::避免频繁调用 | time.Sleep(20 * time.Millisecond) //TODO::避免频繁调用 | ||||
} | } | ||||
return session.Commit() | |||||
session.Commit() | |||||
//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 | |||||
} | } |