diff --git a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go index fe84676..1e7e084 100644 --- a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go +++ b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go @@ -607,8 +607,8 @@ func GetBasicCentralKitchenForSchool(c *gin.Context) { IsOpenReportMealForDay: 0, IsOpenReportMealForMonth: 0, IsOpenReportMealForSemester: 0, - CreateAt: time.Time{}.Format("2006-01-02 15:04:05"), - UpdateAt: time.Time{}.Format("2006-01-02 15:04:05"), + CreateAt: time.Now().Format("2006-01-02 15:04:05"), + UpdateAt: time.Now().Format("2006-01-02 15:04:05"), } _, err2 := centralKitchenForSchoolSetDb.CentralKitchenForSchoolSetInsert(set) if err2 != nil { @@ -637,8 +637,8 @@ func GetBasicCentralKitchenForSchool(c *gin.Context) { BreakfastUnitPriceForTeacher: "0", LunchUnitPriceForTeacher: "0", DinnerUnitPriceForTeacher: "0", - CreateAt: time.Time{}.Format("2006-01-02 15:04:05"), - UpdateAt: time.Time{}.Format("2006-01-02 15:04:05"), + CreateAt: time.Now().Format("2006-01-02 15:04:05"), + UpdateAt: time.Now().Format("2006-01-02 15:04:05"), } _, err2 := centralKitchenForSchoolWithSpec.CentralKitchenForSchoolWithSpecInsert(spec) if err2 != nil { diff --git a/app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go b/app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go index a142f30..4de9856 100644 --- a/app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go +++ b/app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go @@ -567,7 +567,7 @@ func SelfSupportForSchoolAddWorker(c *gin.Context) { return } - now := time.Time{} + now := time.Now() //2、新增身份信息 userIdentity := &model.UserIdentity{ Uid: 0, @@ -618,7 +618,7 @@ func SelfSupportForSchoolAddTeacher(c *gin.Context) { return } - now := time.Time{} + now := time.Now() //2、新增身份信息 userIdentity := &model.UserIdentity{ Uid: 0, 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 eb70376..c445c2a 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 @@ -317,8 +317,8 @@ func CentralKitchenForSchoolStudentUpdate(req md.CentralKitchenForSchoolStudentU _, err = classWithUserDb.ClassWithUserInsertBySession(session, &model.ClassWithUser{ UserIdentityId: req.UserIdentityId, ClassId: req.ClassId, - CreateAt: time.Time{}.Format("2006-01-02 15:04:05"), - UpdateAt: time.Time{}.Format("2006-01-02 15:04:05"), + CreateAt: time.Now().Format("2006-01-02 15:04:05"), + UpdateAt: time.Now().Format("2006-01-02 15:04:05"), }) return session.Commit() diff --git a/app/admin/svc/enterprise_manage/svc_self_support_for_school.go b/app/admin/svc/enterprise_manage/svc_self_support_for_school.go index e8adb97..cba496c 100644 --- a/app/admin/svc/enterprise_manage/svc_self_support_for_school.go +++ b/app/admin/svc/enterprise_manage/svc_self_support_for_school.go @@ -389,8 +389,8 @@ func SelfSupportForSchoolStudentUpdate(req md.SelfSupportForSchoolStudentUpdateR _, err = classWithUserDb.ClassWithUserInsertBySession(session, &model.ClassWithUser{ UserIdentityId: req.UserIdentityId, ClassId: req.ClassId, - CreateAt: time.Time{}.Format("2006-01-02 15:04:05"), - UpdateAt: time.Time{}.Format("2006-01-02 15:04:05"), + CreateAt: time.Now().Format("2006-01-02 15:04:05"), + UpdateAt: time.Now().Format("2006-01-02 15:04:05"), }) //3、更新 self_support_for_user_face_info diff --git a/app/customer/hdl/hdl_central_kitchen_for_school_order.go b/app/customer/hdl/hdl_central_kitchen_for_school_order.go index db7a69a..ced36af 100644 --- a/app/customer/hdl/hdl_central_kitchen_for_school_order.go +++ b/app/customer/hdl/hdl_central_kitchen_for_school_order.go @@ -295,7 +295,7 @@ func CentralKitchenForSchoolMyReserve(c *gin.Context) { return } startDate := date + "-01" - startDateTime, _ := time.Parse("2006-01-02", startDate) + startDateTime, _ := time.ParseInLocation("2006-01-02", startDate, time.Local) endDate := startDateTime.AddDate(0, 1, -1).Format("2006-01-02") err, resp := svc.CentralKitchenForSchoolMyReserve(utils.StrToInt(userIdentityId), date, startDate, endDate) if err != nil { diff --git a/app/customer/hdl/hdl_user_identity.go b/app/customer/hdl/hdl_user_identity.go index b7aaf0c..e6f279b 100644 --- a/app/customer/hdl/hdl_user_identity.go +++ b/app/customer/hdl/hdl_user_identity.go @@ -37,7 +37,7 @@ func SaveCentralKitchenForSchoolUserIdentity(c *gin.Context) { return } - now := time.Time{} + now := time.Now() if isHasUserIdentity == nil { //2、新增身份信息 userIdentity := &model.UserIdentity{ @@ -137,7 +137,7 @@ func SaveSelfSupportForSchoolUserIdentity(c *gin.Context) { return } user := svc.GetUser(c) - now := time.Time{} + now := time.Now() var identity = enum.UserIdentityForSelfSupportForStudent var kind = enum.UserIdentityKindForCommon if req.Kind == enum.UserIdentityKindForWorker { @@ -293,7 +293,7 @@ func UpdateCentralKitchenForSchoolUserIdentity(c *gin.Context) { return } user := svc.GetUser(c) - now := time.Time{} + now := time.Now() //1、查询当前身份是否存在 userIdentityDb := db.UserIdentityDb{} userIdentityDb.Set(user.Id) @@ -360,7 +360,7 @@ func UpdateSelfSupportForSchoolUserIdentity(c *gin.Context) { return } user := svc.GetUser(c) - now := time.Time{} + now := time.Now() //1、查询当前身份是否存在 userIdentityDb := db.UserIdentityDb{} userIdentityDb.Set(user.Id) diff --git a/app/customer/hdl/self_support_for_school/hdl_faceCollection.go b/app/customer/hdl/self_support_for_school/hdl_faceCollection.go index 3ee2671..25b0c45 100644 --- a/app/customer/hdl/self_support_for_school/hdl_faceCollection.go +++ b/app/customer/hdl/self_support_for_school/hdl_faceCollection.go @@ -50,7 +50,7 @@ func EducateSceneTokenQuery(c *gin.Context) { StudentName: identity.Name, OutUserId: utils.IntToStr(identity.Id), SchoolStdCode: selfSupportForSchoolInfo.SchoolStdCode, - }, identity, userToken) + }, identity, userToken, selfSupportForSchoolInfo.Memo) if err != nil { e.OutErr(c, e.ERR, err.Error()) return diff --git a/app/customer/svc/order/svc_central_kitchen_for_school_order.go b/app/customer/svc/order/svc_central_kitchen_for_school_order.go index 7f6c03c..c8c4b63 100644 --- a/app/customer/svc/order/svc_central_kitchen_for_school_order.go +++ b/app/customer/svc/order/svc_central_kitchen_for_school_order.go @@ -47,9 +47,9 @@ func CentralKitchenForSchoolOrderRefund(req md.CentralKitchenForSchoolOrderRefun //2、判断是否为可退餐时间段 now := time.Now() - today, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02")) - centralKitchenForSchoolReserveMealTime, _ := time.Parse("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+cfg.Val+":00") - date, _ := time.Parse("2006-01-02", centralKitchenForSchoolUserWithDay.Date) + today, _ := time.ParseInLocation("2006-01-02", time.Now().Format("2006-01-02"), time.Local) + centralKitchenForSchoolReserveMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+cfg.Val+":00", time.Local) + date, _ := time.ParseInLocation("2006-01-02", centralKitchenForSchoolUserWithDay.Date, time.Local) if today.Equal(date) { //2.2、判断是否过了今日可订餐时间 if now.After(centralKitchenForSchoolReserveMealTime) { diff --git a/app/customer/svc/svc_auth.go b/app/customer/svc/svc_auth.go index c80e69a..d364589 100644 --- a/app/customer/svc/svc_auth.go +++ b/app/customer/svc/svc_auth.go @@ -20,8 +20,8 @@ func GetUser(c *gin.Context) *model.User { Avatar: "", Phone: "", Memo: "", - CreateAt: time.Time{}.Format("2006-01-02 15:04:05"), - UpdateAt: time.Time{}.Format("2006-01-02 15:04:05"), + CreateAt: time.Now().Format("2006-01-02 15:04:05"), + UpdateAt: time.Now().Format("2006-01-02 15:04:05"), } } return user.(*model.User) diff --git a/app/customer/svc/svc_central_kitchen_for_school_package.go b/app/customer/svc/svc_central_kitchen_for_school_package.go index 7eb34ef..174f350 100644 --- a/app/customer/svc/svc_central_kitchen_for_school_package.go +++ b/app/customer/svc/svc_central_kitchen_for_school_package.go @@ -29,7 +29,7 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) //2、查询出当前合适的package var m []model.CentralKitchenForSchoolPackage now := time.Now() - today, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02")) + today, _ := time.ParseInLocation("2006-01-02", time.Now().Format("2006-01-02"), time.Local) //err = db.Db.Where("enterprise_id =?", buyPackageReq.EnterpriseId).And("end_date > ?", now.Format("2006-01-02 15:04:05")).And("is_delete = 0").And("state = 1").Desc("end_date").Find(&m) //if err != nil { // return @@ -38,7 +38,7 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) if err != nil { return } - centralKitchenForSchoolReserveMealTime, _ := time.Parse("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+cfg.Val+":00") + centralKitchenForSchoolReserveMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+cfg.Val+":00", time.Local) //3、循环拼接数据 for _, v := range m { @@ -50,7 +50,7 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) } for _, v1 := range *centralKitchenForSchoolPackageWithDay { //3.1、判断是否小于今天 - date, _ := time.Parse("2006-01-02", v1.Date) + date, _ := time.ParseInLocation("2006-01-02", v1.Date, time.Local) if today.After(date) { continue } @@ -69,6 +69,7 @@ func CalcBySchoolTerm(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) } else { amount = centralKitchenForSchoolWithSpecData.BreakfastUnitPrice } + totalPrice += utils.StrToFloat64(amount) data = append(data, &model.CentralKitchenForSchoolUserWithDay{ Uid: uid, IdentityId: buyPackageReq.UserIdentityId, @@ -140,12 +141,12 @@ func CalcByMonth(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (tota //2、查询出当前合适的package var m []model.CentralKitchenForSchoolPackage now := time.Now() - today, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02")) + today, _ := time.ParseInLocation("2006-01-02", time.Now().Format("2006-01-02"), time.Local) err = db.Db.Where("enterprise_id =?", buyPackageReq.EnterpriseId).And("id =?", buyPackageReq.PackageId).And("is_delete = 0").And("state = 1").Find(&m) if err != nil { return } - centralKitchenForSchoolReserveMealTime, _ := time.Parse("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+cfg.Val+":00") + centralKitchenForSchoolReserveMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+cfg.Val+":00", time.Local) //3、循环拼接数据 for _, v := range m { @@ -157,7 +158,7 @@ func CalcByMonth(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (tota } for _, v1 := range *centralKitchenForSchoolPackageWithDay { //3.1、判断是否小于今天 - date, _ := time.Parse("2006-01-02", v1.Date) + date, _ := time.ParseInLocation("2006-01-02", v1.Date, time.Local) if today.After(date) { continue } @@ -247,13 +248,13 @@ func CalcByDay(uid int, isTeacher bool, buyPackageReq md2.BuyPackageReq) (totalP } now := time.Now() - today, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02")) - centralKitchenForSchoolReserveMealTime, _ := time.Parse("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+cfg.Val+":00") + today, _ := time.ParseInLocation("2006-01-02", time.Now().Format("2006-01-02"), time.Local) + centralKitchenForSchoolReserveMealTime, _ := time.ParseInLocation("2006-01-02 15:04:05", now.Format("2006-01-02")+" "+cfg.Val+":00", time.Local) //2、循环拼接数据 for _, v1 := range buyPackageReq.WithDays { //2.1、判断是否小于今天 - date, _ := time.Parse("2006-01-02", v1.Date) + date, _ := time.ParseInLocation("2006-01-02", v1.Date, time.Local) if today.After(date) { continue } diff --git a/app/customer/svc/svc_curl_smart_pay.go b/app/customer/svc/svc_curl_smart_pay.go index e9612c0..6e7ec77 100644 --- a/app/customer/svc/svc_curl_smart_pay.go +++ b/app/customer/svc/svc_curl_smart_pay.go @@ -165,7 +165,7 @@ func CurlAlipayTradeRefund(args md.CurlAlipayTradeRefundReq) (err error, resp in return nil, result.Data } -func CurlEducateSceneTokenQuery(args md.CurlEducateSceneTokenReq, userIdentity *model.UserIdentity, userToken string) (err error, resp interface{}) { +func CurlEducateSceneTokenQuery(args md.CurlEducateSceneTokenReq, userIdentity *model.UserIdentity, userToken, schoolName string) (err error, resp interface{}) { utils.FilePutContents("CurlEducateSceneTokenQuery", utils.SerializeStr(map[string]interface{}{ "args": args, })) @@ -289,7 +289,20 @@ func CurlEducateSceneTokenQuery(args md.CurlEducateSceneTokenReq, userIdentity * } } + //TODO:: school_face_pass_status && school_face_payment_status 都为 open 状态,则 签约信息同步“alipay.planet.ecocampus.api.roster.signUpInfo” 至 行业云 + CurlAlipayPlanetEcocampusApiRosterSignUpInfo(md.CurlAlipayPlanetEcocampusApiRosterSignUpInfoReq{ + FaceUid: info.UserId, + ParentUid: info.ParentUserId, + ParentLogonId: info.ParentLogonId, + RosterName: args.StudentName, + OutRosterCode: args.OutUserId, + SchoolCode: info.SchoolCode, + SchoolName: schoolName, + ScanFacePayStatus: "ON", + FaceOpenStatus: "ON", + }) return nil, result1.Data + } func CurlEducateSceneTokenCreateForApplet(args md.CurlEducateSceneTokenReq) (err error, resp interface{}) { diff --git a/app/customer/svc/svc_pay.go b/app/customer/svc/svc_pay.go index b68432e..510a9e6 100644 --- a/app/customer/svc/svc_pay.go +++ b/app/customer/svc/svc_pay.go @@ -33,7 +33,7 @@ func BuyPackage(c *gin.Context, req md.BuyPackageReq) (outTradeNo, tradeNo, tota err = errors.New("未查询到对应身份记录") return } - if userIdentity.Kind == enum2.UserIdentityForCentralKitchenForTeacher { + if userIdentity.Identity == enum2.UserIdentityForCentralKitchenForTeacher { isTeacher = true }