DengBiao před 1 rokem
rodič
revize
9f3720a8fd
12 změnil soubory, kde provedl 46 přidání a 32 odebrání
  1. +4
    -4
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +2
    -2
      app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go
  3. +2
    -2
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go
  4. +2
    -2
      app/admin/svc/enterprise_manage/svc_self_support_for_school.go
  5. +1
    -1
      app/customer/hdl/hdl_central_kitchen_for_school_order.go
  6. +4
    -4
      app/customer/hdl/hdl_user_identity.go
  7. +1
    -1
      app/customer/hdl/self_support_for_school/hdl_faceCollection.go
  8. +3
    -3
      app/customer/svc/order/svc_central_kitchen_for_school_order.go
  9. +2
    -2
      app/customer/svc/svc_auth.go
  10. +10
    -9
      app/customer/svc/svc_central_kitchen_for_school_package.go
  11. +14
    -1
      app/customer/svc/svc_curl_smart_pay.go
  12. +1
    -1
      app/customer/svc/svc_pay.go

+ 4
- 4
app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go Zobrazit soubor

@@ -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 {


+ 2
- 2
app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go Zobrazit soubor

@@ -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,


+ 2
- 2
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go Zobrazit soubor

@@ -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()


+ 2
- 2
app/admin/svc/enterprise_manage/svc_self_support_for_school.go Zobrazit soubor

@@ -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


+ 1
- 1
app/customer/hdl/hdl_central_kitchen_for_school_order.go Zobrazit soubor

@@ -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 {


+ 4
- 4
app/customer/hdl/hdl_user_identity.go Zobrazit soubor

@@ -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)


+ 1
- 1
app/customer/hdl/self_support_for_school/hdl_faceCollection.go Zobrazit soubor

@@ -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


+ 3
- 3
app/customer/svc/order/svc_central_kitchen_for_school_order.go Zobrazit soubor

@@ -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) {


+ 2
- 2
app/customer/svc/svc_auth.go Zobrazit soubor

@@ -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)


+ 10
- 9
app/customer/svc/svc_central_kitchen_for_school_package.go Zobrazit soubor

@@ -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
}


+ 14
- 1
app/customer/svc/svc_curl_smart_pay.go Zobrazit soubor

@@ -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{}) {


+ 1
- 1
app/customer/svc/svc_pay.go Zobrazit soubor

@@ -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
}



Načítá se…
Zrušit
Uložit