@@ -4,6 +4,7 @@ import ( | |||
"applet/app/customer/svc" | |||
svc2 "applet/app/customer/svc/order" | |||
"applet/app/db" | |||
"applet/app/db/model" | |||
"applet/app/e" | |||
"applet/app/enum" | |||
"applet/app/utils" | |||
@@ -80,11 +81,42 @@ func UserInfo(c *gin.Context) { | |||
e.OutErr(c, e.ERR, err2.Error()) | |||
return | |||
} | |||
if info != nil { | |||
tmp["parent_logon_id"] = info.ParentLogonId | |||
tmp["collect_face_type"] = info.CollectFaceType | |||
tmp["concentrate_school_face_pass_status"] = info.ConcentrateSchoolFacePassStatus | |||
if info == nil { | |||
selfSupportForSchoolInfoDb := db.SelfSupportForSchoolInfoDb{} | |||
selfSupportForSchoolInfoDb.Set(v.UserIdentity.EnterpriseId) | |||
selfSupportForSchoolInfo, err1 := selfSupportForSchoolInfoDb.GetSelfSupportForSchoolInfo() | |||
if err1 != nil { | |||
return | |||
} | |||
if selfSupportForSchoolInfo == nil { | |||
e.OutErr(c, e.ERR, "当前学校暂未完成《一脸通行入驻》") | |||
return | |||
} | |||
info = &model.SelfSupportForUserFaceInfo{ | |||
EnterpriseId: v.UserIdentity.EnterpriseId, | |||
UserIdentityId: v.UserIdentity.Id, | |||
CollectFaceType: 1, //默认个采 | |||
SchoolCode: selfSupportForSchoolInfo.SchoolCode, | |||
SchoolStdCode: selfSupportForSchoolInfo.SchoolStdCode, | |||
ParentUserId: "", | |||
ParentLogonId: "", | |||
UserId: "", | |||
SchoolFacePassStatus: "CLOSE", | |||
SchoolFacePaymentStatus: "CLOSE", | |||
ConcentrateSchoolFacePassStatus: 1, | |||
CreateAt: now.Format("2006-01-02 15:04:05"), | |||
UpdateAt: now.Format("2006-01-02 15:04:05"), | |||
} | |||
_, err3 := selfSupportForUserFaceInfoDb.SelfSupportForUserFaceInfoInsert(info) | |||
if err3 != nil { | |||
e.OutErr(c, e.ERR, err3.Error()) | |||
return | |||
} | |||
} | |||
tmp["parent_logon_id"] = info.ParentLogonId | |||
tmp["collect_face_type"] = info.CollectFaceType | |||
tmp["concentrate_school_face_pass_status"] = info.ConcentrateSchoolFacePassStatus | |||
} | |||
if v.UserIdentity.Identity == enum.UserIdentityForSelfSupportForWorker { | |||
@@ -287,3 +287,30 @@ func ConcentrateFacePassStudentList(c *gin.Context) { | |||
}, nil) | |||
return | |||
} | |||
func ConcentrateFacePassStudentConfirm(c *gin.Context) { | |||
userIdentityId := c.DefaultQuery("user_identity_id", "") | |||
userIdentityDb := db.UserIdentityDb{} | |||
userIdentityDb.Set(0) | |||
identity, err := userIdentityDb.GetUserIdentity(utils.StrToInt(userIdentityId)) | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
selfSupportForUserFaceInfoDb := db.SelfSupportForUserFaceInfoDb{} | |||
selfSupportForUserFaceInfoDb.Set(identity.Id) | |||
info, err := selfSupportForUserFaceInfoDb.GetSelfSupportForUserFaceInfo() | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
info.ConcentrateSchoolFacePassStatus = 2 //待确认状态 | |||
_, err = selfSupportForUserFaceInfoDb.SelfSupportForUserFaceInfoUpdate(info, "concentrate_school_face_pass_status") | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
e.OutSuc(c, "success", nil) | |||
return | |||
} |
@@ -258,30 +258,40 @@ func CurlEducateSceneTokenQuery(args md.CurlEducateSceneTokenReq, userIdentity * | |||
utils.Unserialize([]byte(utils.SerializeStr(result1.Data)), &res) | |||
if info == nil { | |||
var concentrateSchoolFacePassStatus = 1 | |||
if res["school_face_pass_status"] == "OPEN" { | |||
concentrateSchoolFacePassStatus = 3 | |||
} | |||
info = &model.SelfSupportForUserFaceInfo{ | |||
EnterpriseId: userIdentity.EnterpriseId, | |||
UserIdentityId: userIdentity.Id, | |||
CollectFaceType: 1, | |||
SchoolCode: res["school_code"], | |||
SchoolStdCode: res["school_std_code"], | |||
ParentUserId: res["parent_user_id"], | |||
ParentLogonId: res["parent_logon_id"], | |||
UserId: res["user_id"], | |||
SchoolFacePassStatus: res["school_face_pass_status"], | |||
SchoolFacePaymentStatus: res["school_face_payment_status"], | |||
CreateAt: now, | |||
UpdateAt: now, | |||
EnterpriseId: userIdentity.EnterpriseId, | |||
UserIdentityId: userIdentity.Id, | |||
CollectFaceType: 1, | |||
SchoolCode: res["school_code"], | |||
SchoolStdCode: res["school_std_code"], | |||
ParentUserId: res["parent_user_id"], | |||
ParentLogonId: res["parent_logon_id"], | |||
UserId: res["user_id"], | |||
SchoolFacePassStatus: res["school_face_pass_status"], | |||
SchoolFacePaymentStatus: res["school_face_payment_status"], | |||
ConcentrateSchoolFacePassStatus: concentrateSchoolFacePassStatus, | |||
CreateAt: now, | |||
UpdateAt: now, | |||
} | |||
_, err2 := selfSupportForUserFaceInfoDb.SelfSupportForUserFaceInfoInsert(info) | |||
if err2 != nil { | |||
return err2, nil | |||
} | |||
} else { | |||
var concentrateSchoolFacePassStatus = info.ConcentrateSchoolFacePassStatus | |||
if res["school_face_pass_status"] == "OPEN" { | |||
concentrateSchoolFacePassStatus = 3 | |||
} | |||
info.ParentUserId = res["parent_user_id"] | |||
info.ParentLogonId = res["parent_logon_id"] | |||
info.UserId = res["user_id"] | |||
info.SchoolFacePassStatus = res["school_face_pass_status"] | |||
info.SchoolFacePaymentStatus = res["school_face_payment_status"] | |||
info.ConcentrateSchoolFacePassStatus = concentrateSchoolFacePassStatus | |||
info.UpdateAt = now | |||
_, err2 := selfSupportForUserFaceInfoDb.SelfSupportForUserFaceInfoUpdate(info, "parent_user_id", "parent_logon_id", "user_id", "school_face_pass_status", "school_face_payment_status", "update_at") | |||
if err2 != nil { | |||
@@ -77,6 +77,7 @@ func rSelfSupportForSchool(r *gin.RouterGroup) { //自营学校 | |||
r.GET("/educateSceneTokenCreateForConcentratedCollectApplet", selfSupportForSchoolhdl.EducateSceneTokenCreateForConcentratedCollectApplet) // 自营学校-教育场景token生成处理器(作用于 跳转到集采小程序) | |||
r.GET("/educateFacepayApply", selfSupportForSchoolhdl.EducateFacepayApply) // 自营学校-创建刷脸支付开通标识 | |||
r.GET("/concentrateFacePassStudentList", selfSupportForSchoolhdl.ConcentrateFacePassStudentList) // 自营学校-集采学生列表 | |||
r.GET("/concentrateFacePassStudentConfirm", selfSupportForSchoolhdl.ConcentrateFacePassStudentConfirm) // 自营学校-集采学生确认 | |||
} | |||
func rUserIdentity(r *gin.RouterGroup) { //用户身份 | |||