Bladeren bron

update

add_mode
DengBiao 1 jaar geleden
bovenliggende
commit
ff6ee56ec5
4 gewijzigde bestanden met toevoegingen van 138 en 22 verwijderingen
  1. +57
    -0
      app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go
  2. +12
    -0
      app/customer/md/md_curl_smart_pay.go
  3. +46
    -0
      app/customer/svc/svc_curl_smart_pay.go
  4. +23
    -22
      app/router/admin_router.go

+ 57
- 0
app/admin/hdl/enterprise_manage/hdl_self_support_for_school.go Bestand weergeven

@@ -780,3 +780,60 @@ func SelfSupportForSchoolArrearsOrdDebtCancel(c *gin.Context) {
e.OutSuc(c, resp, nil)
return
}

func SelfSupportForSchoolEducateSceneKidsClose(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
}

selfSupportForSchoolInfoDb := db.SelfSupportForSchoolInfoDb{}
selfSupportForSchoolInfoDb.Set(identity.EnterpriseId)
selfSupportForSchoolInfo, err := selfSupportForSchoolInfoDb.GetSelfSupportForSchoolInfo()
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if selfSupportForSchoolInfo == nil {
e.OutErr(c, e.ERR_NO_DATA, "当前学校暂未完成《一脸通行入驻》")
return
}

selfSupportForUserFaceInfoDb := db.SelfSupportForUserFaceInfoDb{}
selfSupportForUserFaceInfoDb.Set(identity.Id)
selfSupportForUserFaceInfo, err := selfSupportForUserFaceInfoDb.GetSelfSupportForUserFaceInfo()
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}

//请求支付宝 alipay.commerce.educate.scene.token.query(查询刷脸用户开通详细信息)
sysCfgDb := db.SysCfgDb{}
sysCfgDb.Set()
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.OpenAppletAppid, enum.OpenAppletAppPrivateKey, enum.OpenAppletPublicKey)
err, info := svc.CurlEducateSceneKidsClose(md2.CurlEducateSceneKidsCloseReq{
Config: struct {
AliAppId string `json:"ali_app_id" label:"支付宝开放平台-小程序-appid"`
AliPrivateKey string `json:"ali_private_key" label:"支付宝开放平台-小程序-应用私钥"`
AliPublicKey string `json:"ali_public_key" label:"支付宝开放平台-小程序-支付宝公钥"`
}{
AliAppId: sysCfg[enum.OpenAppletAppid],
AliPrivateKey: sysCfg[enum.OpenAppletAppPrivateKey],
AliPublicKey: sysCfg[enum.OpenAppletPublicKey],
},
CertNo: identity.IdNo,
SchoolStdCode: selfSupportForSchoolInfo.SchoolStdCode,
ParentUid: selfSupportForUserFaceInfo.ParentUserId,
UserId: selfSupportForUserFaceInfo.UserId,
})
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
}
e.OutSuc(c, info, nil)
return
}

+ 12
- 0
app/customer/md/md_curl_smart_pay.go Bestand weergeven

@@ -79,6 +79,18 @@ type CurlEducateSceneTokenReq struct {
OperatorUserId string `json:"operator_user_id" label:"采集人员的支付宝会员标识。(当sub_code为SCHOOL_PAYMENT_REMOTE_OPEN_ACCOUNT时,当前参数必选)"`
}

type CurlEducateSceneKidsCloseReq struct {
Config struct {
AliAppId string `json:"ali_app_id" label:"支付宝开放平台-小程序-appid"`
AliPrivateKey string `json:"ali_private_key" label:"支付宝开放平台-小程序-应用私钥"`
AliPublicKey string `json:"ali_public_key" label:"支付宝开放平台-小程序-支付宝公钥"`
} `json:"config" label:"配置信息"`
CertNo string `json:"cert_no" label:"身份证号码"`
UserId string `json:"user_id" label:"刷脸用户的UID"`
ParentUid string `json:"parent_uid" label:"开通一脸通行的支付宝UID,如果是家长为学生代开通,则为家长的UID"`
SchoolStdCode string `json:"school_std_code" label:"学校外标"`
}

type CurlEducateFacepayApplyReq struct {
Config struct {
AliAppId string `json:"ali_app_id" label:"支付宝开放平台-小程序-appid"`


+ 46
- 0
app/customer/svc/svc_curl_smart_pay.go Bestand weergeven

@@ -315,6 +315,52 @@ func CurlEducateSceneTokenQuery(args md.CurlEducateSceneTokenReq, userIdentity *

}

func CurlEducateSceneKidsClose(args md.CurlEducateSceneKidsCloseReq) (err error, resp interface{}) {
utils.FilePutContents("CurlEducateSceneKidsClose", utils.SerializeStr(map[string]interface{}{
"args": args,
}))

//1、TODO::生成用户信息token(使用 alipay.commerce.educate.scene.token.create 接口生成用户信息token)
url := cfg.SmartCanteenPay + "/alipay/faceCollection/educateSceneKidsClose"
bytes, err1 := utils.CurlPost(url, utils.Serialize(map[string]interface{}{
"config": map[string]string{
"ali_app_id": args.Config.AliAppId,
"ali_private_key": args.Config.AliPrivateKey,
"ali_public_key": args.Config.AliPublicKey,
},
"cert_no": args.CertNo,
"school_std_code": args.SchoolStdCode,
"user_id": args.UserId,
"parent_uid": args.ParentUid,
}), nil)
if err1 != nil {
return
}
var result struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data interface{} `json:"data"`
}
utils.FilePutContents("CurlEducateSceneKidsClose", utils.SerializeStr(result))
err = json.Unmarshal(bytes, &result)
if err != nil {
return
}
if result.Code != 0 {
if result.Msg != "" {
err = errors.New(result.Msg)
return
}
err = errors.New("请求智慧餐厅支付 异常/失败")
return
}
err = json.Unmarshal(utils.Serialize(result.Data), &resp)
if err != nil {
return
}
return nil, result.Data
}

func CurlEducateSceneTokenCreateForApplet(args md.CurlEducateSceneTokenReq) (err error, resp interface{}) {
utils.FilePutContents("CurlEducateSceneTokenCreateForApplet", utils.SerializeStr(map[string]interface{}{
"args": args,


+ 23
- 22
app/router/admin_router.go Bestand weergeven

@@ -154,28 +154,29 @@ func rEnterpriseManage(r *gin.RouterGroup) {
r.POST("/saveCentralKitchenForSchoolPackage", hdl.SaveCentralKitchenForSchoolPackage) //新增/编辑 "央厨-学校-套餐"
r.DELETE("/deleteCentralKitchenForSchoolPackage/:id", hdl.DeleteCentralKitchenForSchoolPackage) //删除 "央厨-学校-套餐"

r.POST("/selfSupportForSchool/userUpdate", hdl.SelfSupportForSchoolUserUpdate) //"自营-学校"用户编辑
r.POST("/selfSupportForSchool/userDelete", hdl.SelfSupportForSchoolUserDelete) //"自营-学校"用户删除
r.POST("/selfSupportForSchool/studentList", hdl.SelfSupportForSchoolStudentList) //"自营-学校"学生列表
r.POST("/selfSupportForSchool/studentUpdate", hdl.SelfSupportForSchoolStudentUpdate) //"自营-学校"学生编辑
r.POST("/selfSupportForSchool/studentDelete", hdl.SelfSupportForSchoolStudentDelete) //"自营-学校"学生删除
r.POST("/selfSupportForSchool/studentAdmission", hdl.SelfSupportForSchoolStudentAdmission) //"自营-学校"学生升学
r.POST("/selfSupportForSchool/teacherList", hdl.SelfSupportForSchoolTeacherList) //"自营-学校"教师列表
r.POST("/selfSupportForSchool/teacherUpdate", hdl.SelfSupportForSchoolTeacherUpdate) //"自营-学校"教师编辑
r.POST("/selfSupportForSchool/teacherDelete", hdl.SelfSupportForSchoolTeacherDelete) //"自营-学校"教师删除
r.POST("/selfSupportForSchool/workerList", hdl.SelfSupportForSchoolWorkerList) //"自营-学校"工作人员列表
r.POST("/selfSupportForSchool/workerUpdate", hdl.SelfSupportForSchoolWorkerUpdate) //"自营-学校"工作人员编辑
r.POST("/selfSupportForSchool/workerDelete", hdl.SelfSupportForSchoolWorkerDelete) //"自营-学校"工作人员删除
r.POST("/selfSupportForSchool/gradeList", hdl.SelfSupportForSchoolGradeList) //"自营-学校"年级列表
r.DELETE("/selfSupportForSchool/gradeDelete/:id", hdl.SelfSupportForSchoolGradeDelete) //"自营-学校"年级删除
r.POST("/selfSupportForSchool/classList", hdl.SelfSupportForSchoolClassList) //"自营-学校"班级列表
r.DELETE("/selfSupportForSchool/classDelete/:id", hdl.SelfSupportForSchoolClassDelete) //"自营-学校"班级删除
r.POST("/selfSupportForSchool/addWorker", hdl.SelfSupportForSchoolAddWorker) //"自营-学校"添加工作人员
r.POST("/selfSupportForSchool/addTeacher", hdl.SelfSupportForSchoolAddTeacher) //"自营-学校"添加老师
r.POST("/selfSupportForSchool/ordList", hdl.SelfSupportForSchoolOrdList) //"自营-学校"订单列表
r.POST("/selfSupportForSchool/arrearsOrdList", hdl.SelfSupportForSchoolArrearsOrdList) //"自营-学校"订单欠费列表
r.POST("/selfSupportForSchool/arrearsOrdDebtRepay", hdl.SelfSupportForSchoolArrearsOrdDebtRepay) //"自营-学校"订单欠费催缴
r.POST("/selfSupportForSchool/arrearsOrdDebtCancel", hdl.SelfSupportForSchoolArrearsOrdDebtCancel) //"自营-学校"撤销欠款
r.POST("/selfSupportForSchool/userUpdate", hdl.SelfSupportForSchoolUserUpdate) //"自营-学校"用户编辑
r.POST("/selfSupportForSchool/userDelete", hdl.SelfSupportForSchoolUserDelete) //"自营-学校"用户删除
r.POST("/selfSupportForSchool/studentList", hdl.SelfSupportForSchoolStudentList) //"自营-学校"学生列表
r.POST("/selfSupportForSchool/studentUpdate", hdl.SelfSupportForSchoolStudentUpdate) //"自营-学校"学生编辑
r.POST("/selfSupportForSchool/studentDelete", hdl.SelfSupportForSchoolStudentDelete) //"自营-学校"学生删除
r.POST("/selfSupportForSchool/studentAdmission", hdl.SelfSupportForSchoolStudentAdmission) //"自营-学校"学生升学
r.POST("/selfSupportForSchool/teacherList", hdl.SelfSupportForSchoolTeacherList) //"自营-学校"教师列表
r.POST("/selfSupportForSchool/teacherUpdate", hdl.SelfSupportForSchoolTeacherUpdate) //"自营-学校"教师编辑
r.POST("/selfSupportForSchool/teacherDelete", hdl.SelfSupportForSchoolTeacherDelete) //"自营-学校"教师删除
r.POST("/selfSupportForSchool/workerList", hdl.SelfSupportForSchoolWorkerList) //"自营-学校"工作人员列表
r.POST("/selfSupportForSchool/workerUpdate", hdl.SelfSupportForSchoolWorkerUpdate) //"自营-学校"工作人员编辑
r.POST("/selfSupportForSchool/workerDelete", hdl.SelfSupportForSchoolWorkerDelete) //"自营-学校"工作人员删除
r.POST("/selfSupportForSchool/gradeList", hdl.SelfSupportForSchoolGradeList) //"自营-学校"年级列表
r.DELETE("/selfSupportForSchool/gradeDelete/:id", hdl.SelfSupportForSchoolGradeDelete) //"自营-学校"年级删除
r.POST("/selfSupportForSchool/classList", hdl.SelfSupportForSchoolClassList) //"自营-学校"班级列表
r.DELETE("/selfSupportForSchool/classDelete/:id", hdl.SelfSupportForSchoolClassDelete) //"自营-学校"班级删除
r.POST("/selfSupportForSchool/addWorker", hdl.SelfSupportForSchoolAddWorker) //"自营-学校"添加工作人员
r.POST("/selfSupportForSchool/addTeacher", hdl.SelfSupportForSchoolAddTeacher) //"自营-学校"添加老师
r.POST("/selfSupportForSchool/ordList", hdl.SelfSupportForSchoolOrdList) //"自营-学校"订单列表
r.POST("/selfSupportForSchool/arrearsOrdList", hdl.SelfSupportForSchoolArrearsOrdList) //"自营-学校"订单欠费列表
r.POST("/selfSupportForSchool/arrearsOrdDebtRepay", hdl.SelfSupportForSchoolArrearsOrdDebtRepay) //"自营-学校"订单欠费催缴
r.POST("/selfSupportForSchool/arrearsOrdDebtCancel", hdl.SelfSupportForSchoolArrearsOrdDebtCancel) //"自营-学校"撤销欠款
r.POST("/selfSupportForSchool/educateSceneKidsClose", hdl.SelfSupportForSchoolEducateSceneKidsClose) //"自营-学校"人脸识别关闭

}



Laden…
Annuleren
Opslaan