|
|
@@ -1136,9 +1136,18 @@ func CentralKitchenForSchoolReserveDetail(c *gin.Context) { |
|
|
|
} |
|
|
|
|
|
|
|
func CentralKitchenForSchoolOrdRefund(c *gin.Context) { |
|
|
|
//TODO:: 加锁 Redis 锁,防并发 |
|
|
|
getString, _ := cache.GetString(md.OrdRefundLockKeyForCentralKitchenSchool) |
|
|
|
if getString != "" { |
|
|
|
e.OutErr(c, e.ERR, "请稍等,存在其他订单退款处理中!") |
|
|
|
return |
|
|
|
} |
|
|
|
cache.Set(md.OrdRefundLockKeyForCentralKitchenSchool, "running") |
|
|
|
|
|
|
|
var req md.CentralKitchenForSchoolOrdRefundReq |
|
|
|
err := c.ShouldBindJSON(&req) |
|
|
|
if err != nil { |
|
|
|
cache.Del(md.OrdRefundLockKeyForCentralKitchenSchool) |
|
|
|
err = validate.HandleValidateErr(err) |
|
|
|
err1 := err.(e.E) |
|
|
|
e.OutErr(c, err1.Code, err1.Error()) |
|
|
@@ -1148,18 +1157,23 @@ func CentralKitchenForSchoolOrdRefund(c *gin.Context) { |
|
|
|
enterpriseDb.Set() |
|
|
|
enterprise, err := enterpriseDb.GetEnterprise(req.EnterpriseId) |
|
|
|
if err != nil { |
|
|
|
cache.Del(md.OrdRefundLockKeyForCentralKitchenSchool) |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
if enterprise == nil { |
|
|
|
cache.Del(md.OrdRefundLockKeyForCentralKitchenSchool) |
|
|
|
e.OutErr(c, e.ERR_NO_DATA, "未查询到对应记录") |
|
|
|
return |
|
|
|
} |
|
|
|
err = svc2.CentralKitchenForSchoolOrdRefund(req) |
|
|
|
if err != nil { |
|
|
|
cache.Del(md.OrdRefundLockKeyForCentralKitchenSchool) |
|
|
|
e.OutErr(c, e.ERR, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
cache.Del(md.OrdRefundLockKeyForCentralKitchenSchool) |
|
|
|
e.OutSuc(c, "success", nil) |
|
|
|
return |
|
|
|
} |
|
|
@@ -1190,7 +1204,7 @@ func CentralKitchenForSchoolBatchAskForLeave(c *gin.Context) { |
|
|
|
e.OutErr(c, e.ERR, "请稍等,存在其他退款处理中!") |
|
|
|
return |
|
|
|
} |
|
|
|
cache.Set(md.AuditLockKeyForCentralKitchenLockKey, "running") |
|
|
|
cache.Set(md.BatchAskForLeaveLockKeyForCentralKitchen, "running") |
|
|
|
utils.FilePutContents("DealCentralKitchenForSchoolBatchAskForLeave", "批量请假处理,开始时间:::"+time.Now().Format("2006-01-02 15:04:05")) |
|
|
|
|
|
|
|
Kind := c.DefaultQuery("kind", "1") |
|
|
@@ -1200,7 +1214,7 @@ func CentralKitchenForSchoolBatchAskForLeave(c *gin.Context) { |
|
|
|
var req md.CentralKitchenForSchoolBatchAskForLeaveReqBySchool |
|
|
|
err := c.ShouldBindJSON(&req) |
|
|
|
if err != nil { |
|
|
|
cache.Del(md.AuditLockKeyForCentralKitchenLockKey) |
|
|
|
cache.Del(md.BatchAskForLeaveLockKeyForCentralKitchen) |
|
|
|
err = validate.HandleValidateErr(err) |
|
|
|
err1 := err.(e.E) |
|
|
|
e.OutErr(c, err1.Code, err1.Error()) |
|
|
@@ -1218,7 +1232,7 @@ func CentralKitchenForSchoolBatchAskForLeave(c *gin.Context) { |
|
|
|
|
|
|
|
err = svc2.CentralKitchenForSchoolBatchAskForLeaveBySchool(req) |
|
|
|
if err != nil { |
|
|
|
cache.Del(md.AuditLockKeyForCentralKitchenLockKey) |
|
|
|
cache.Del(md.BatchAskForLeaveLockKeyForCentralKitchen) |
|
|
|
e.OutErr(c, e.ERR, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
@@ -1228,7 +1242,7 @@ func CentralKitchenForSchoolBatchAskForLeave(c *gin.Context) { |
|
|
|
var req md.CentralKitchenForSchoolBatchAskForLeaveReqByGrade |
|
|
|
err := c.ShouldBindJSON(&req) |
|
|
|
if err != nil { |
|
|
|
cache.Del(md.AuditLockKeyForCentralKitchenLockKey) |
|
|
|
cache.Del(md.BatchAskForLeaveLockKeyForCentralKitchen) |
|
|
|
err = validate.HandleValidateErr(err) |
|
|
|
err1 := err.(e.E) |
|
|
|
e.OutErr(c, err1.Code, err1.Error()) |
|
|
@@ -1246,7 +1260,7 @@ func CentralKitchenForSchoolBatchAskForLeave(c *gin.Context) { |
|
|
|
|
|
|
|
err = svc2.CentralKitchenForSchoolBatchAskForLeaveByGrade(req) |
|
|
|
if err != nil { |
|
|
|
cache.Del(md.AuditLockKeyForCentralKitchenLockKey) |
|
|
|
cache.Del(md.BatchAskForLeaveLockKeyForCentralKitchen) |
|
|
|
e.OutErr(c, e.ERR, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
@@ -1256,7 +1270,7 @@ func CentralKitchenForSchoolBatchAskForLeave(c *gin.Context) { |
|
|
|
var req md.CentralKitchenForSchoolBatchAskForLeaveReqByClass |
|
|
|
err := c.ShouldBindJSON(&req) |
|
|
|
if err != nil { |
|
|
|
cache.Del(md.AuditLockKeyForCentralKitchenLockKey) |
|
|
|
cache.Del(md.BatchAskForLeaveLockKeyForCentralKitchen) |
|
|
|
err = validate.HandleValidateErr(err) |
|
|
|
err1 := err.(e.E) |
|
|
|
e.OutErr(c, err1.Code, err1.Error()) |
|
|
@@ -1274,14 +1288,14 @@ func CentralKitchenForSchoolBatchAskForLeave(c *gin.Context) { |
|
|
|
|
|
|
|
err = svc2.CentralKitchenForSchoolBatchAskForLeaveByClass(req) |
|
|
|
if err != nil { |
|
|
|
cache.Del(md.AuditLockKeyForCentralKitchenLockKey) |
|
|
|
cache.Del(md.BatchAskForLeaveLockKeyForCentralKitchen) |
|
|
|
e.OutErr(c, e.ERR, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
break |
|
|
|
} |
|
|
|
|
|
|
|
cache.Del(md.AuditLockKeyForCentralKitchenLockKey) |
|
|
|
cache.Del(md.BatchAskForLeaveLockKeyForCentralKitchen) |
|
|
|
e.OutSuc(c, "success", nil) |
|
|
|
return |
|
|
|
} |
|
|
|