diff --git a/app/admin/hdl/hdl_demo.go b/app/admin/hdl/hdl_demo.go index 19067c5..15f58ce 100644 --- a/app/admin/hdl/hdl_demo.go +++ b/app/admin/hdl/hdl_demo.go @@ -83,6 +83,7 @@ func DemoV1(c *gin.Context) { for _, v := range m { if recordsId[v.RecordsId] { repeatIds = append(repeatIds, v.Id) + centralKitchenForSchoolUserRefundDayDb.CentralKitchenForSchoolUserRefundDayDelete(v.Id) } recordsId[v.RecordsId] = true } diff --git a/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go b/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go index 26c3506..5270b82 100644 --- a/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go +++ b/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go @@ -1082,22 +1082,6 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis state = 4 stateZh = "已退款" } - //count3, err3 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoV2(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForWait, - // v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeStart, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeEnd, v.CentralKitchenForSchoolPackageOrdForReserve.Kind) - //if err1 != nil { - // return nil, 0, err3 - //} - //if count3 == 0 { - // count4, err4 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoV2(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForAlready, - // v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeStart, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeEnd, v.CentralKitchenForSchoolPackageOrdForReserve.Kind) - // if err1 != nil { - // return nil, 0, err4 - // } - // if count4 == 0 { - // state = 4 - // stateZh = "已退款" - // } - //} } } @@ -1225,9 +1209,11 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" idsStr := strings.Join(identityIds, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1267,6 +1253,7 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateErr>>>>>>>>>>>>>>>>>>>>>", err11.Error()) utils.FilePutContents("batchAskForLeaveJudgePackageOrdOrdStateErr", err11.Error()) } + fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateSuccess<<<<<<<<<<<<<<<<<<<<<") } }() @@ -1305,9 +1292,11 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" idsStr := strings.Join(identityIds, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1347,6 +1336,7 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateErr>>>>>>>>>>>>>>>>>>>>>", err11.Error()) utils.FilePutContents("batchAskForLeaveJudgePackageOrdOrdStateErr", err11.Error()) } + fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateSuccess<<<<<<<<<<<<<<<<<<<<<") } }() @@ -1385,9 +1375,11 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" idsStr := strings.Join(identityIds, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1427,6 +1419,7 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateErr>>>>>>>>>>>>>>>>>>>>>", err11.Error()) utils.FilePutContents("batchAskForLeaveJudgePackageOrdOrdStateErr", err11.Error()) } + fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateSuccess<<<<<<<<<<<<<<<<<<<<<") } }() @@ -1509,9 +1502,11 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1551,6 +1546,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateErr>>>>>>>>>>>>>>>>>>>>>", err11.Error()) utils.FilePutContents("batchAskForLeaveJudgePackageOrdOrdStateErr", err11.Error()) } + fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateSuccess<<<<<<<<<<<<<<<<<<<<<") } }() @@ -1589,9 +1585,11 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1631,6 +1629,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateErr>>>>>>>>>>>>>>>>>>>>>", err11.Error()) utils.FilePutContents("batchAskForLeaveJudgePackageOrdOrdStateErr", err11.Error()) } + fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateSuccess<<<<<<<<<<<<<<<<<<<<<") } }() @@ -1669,9 +1668,11 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1711,6 +1712,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateErr>>>>>>>>>>>>>>>>>>>>>", err11.Error()) utils.FilePutContents("batchAskForLeaveJudgePackageOrdOrdStateErr", err11.Error()) } + fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateSuccess<<<<<<<<<<<<<<<<<<<<<") } }() @@ -1782,9 +1784,11 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1824,6 +1828,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateErr>>>>>>>>>>>>>>>>>>>>>", err11.Error()) utils.FilePutContents("batchAskForLeaveJudgePackageOrdOrdStateErr", err11.Error()) } + fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateSuccess<<<<<<<<<<<<<<<<<<<<<") } }() @@ -1862,9 +1867,11 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1904,6 +1911,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateErr>>>>>>>>>>>>>>>>>>>>>", err11.Error()) utils.FilePutContents("batchAskForLeaveJudgePackageOrdOrdStateErr", err11.Error()) } + fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateSuccess<<<<<<<<<<<<<<<<<<<<<") } }() @@ -1942,9 +1950,11 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state =%d" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state =%d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) + sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1984,6 +1994,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateErr>>>>>>>>>>>>>>>>>>>>>", err11.Error()) utils.FilePutContents("batchAskForLeaveJudgePackageOrdOrdStateErr", err11.Error()) } + fmt.Println("batchAskForLeaveJudgePackageOrdOrdStateSuccess<<<<<<<<<<<<<<<<<<<<<") } }()