|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- package hdl
-
- import (
- "applet/app/admin/lib/validate"
- "applet/app/admin/md"
- svc2 "applet/app/admin/svc/order"
- "applet/app/e"
- "applet/app/enum"
- "github.com/gin-gonic/gin"
- )
-
- func CentralKitchenForSchoolOrderRefundList(c *gin.Context) {
- var req md.CentralKitchenForSchoolOrderRefundListReq
- err := c.ShouldBindJSON(&req)
- if err != nil {
- err = validate.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- list, total, err := svc2.CentralKitchenForSchoolOrderRefundList(req)
- if err != nil {
- e.OutErr(c, e.ERR_DB_ORM, err.Error())
- return
- }
- e.OutSuc(c, map[string]interface{}{
- "list": list,
- "total": total,
- "audit_kind_list": []map[string]interface{}{
- {
- "name": "同意",
- "value": 1,
- },
- {
- "name": "拒绝",
- "value": 2,
- },
- },
- "kind_list": []map[string]interface{}{
- {
- "name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast),
- "value": enum.CentralKitchenForSchoolUserWithDayKindForBreakfast,
- },
- {
- "name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForLunch),
- "value": enum.CentralKitchenForSchoolUserWithDayKindForLunch,
- },
- {
- "name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForDinner),
- "value": enum.CentralKitchenForSchoolUserWithDayKindForDinner,
- },
- },
- "state_list": []map[string]interface{}{
- {
- "name": enum.CentralKitchenForSchoolUserRefundDayState.String(enum.CentralKitchenForSchoolUserRefundDayStateForAuditing),
- "value": enum.CentralKitchenForSchoolUserRefundDayStateForAuditing,
- },
- {
- "name": enum.CentralKitchenForSchoolUserRefundDayState.String(enum.CentralKitchenForSchoolUserRefundDayStateForAuditPass),
- "value": enum.CentralKitchenForSchoolUserRefundDayStateForAuditPass,
- },
- {
- "name": enum.CentralKitchenForSchoolUserRefundDayState.String(enum.CentralKitchenForSchoolUserRefundDayStateForAuditReject),
- "value": enum.CentralKitchenForSchoolUserRefundDayStateForAuditReject,
- },
- {
- "name": enum.CentralKitchenForSchoolUserRefundDayState.String(enum.CentralKitchenForSchoolUserRefundDayStateForAuditComplete),
- "value": enum.CentralKitchenForSchoolUserRefundDayStateForAuditComplete,
- },
- },
- "user_identity_kind_list": []map[string]interface{}{
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForCentralKitchenForStudent),
- "value": enum.UserIdentityForCentralKitchenForStudent,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForCentralKitchenForTeacher),
- "value": enum.UserIdentityForCentralKitchenForTeacher,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForCentralKitchenForWorker),
- "value": enum.UserIdentityForCentralKitchenForWorker,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForSelfSupportForStudent),
- "value": enum.UserIdentityForSelfSupportForStudent,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForSelfSupportForTeacher),
- "value": enum.UserIdentityForSelfSupportForTeacher,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForSelfSupportForWorker),
- "value": enum.UserIdentityForSelfSupportForWorker,
- },
- },
- }, nil)
- return
- }
-
- func CentralKitchenForSchoolOrderRefundAudit(c *gin.Context) {
- var req md.CentralKitchenForSchoolOrderRefundAuditReq
- err := c.ShouldBindJSON(&req)
- if err != nil {
- err = validate.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- err = svc2.CentralKitchenForSchoolOrderRefundAudit(req)
- if err != nil {
- e.OutErr(c, e.ERR, err.Error())
- return
- }
- e.OutSuc(c, "success", nil)
- return
- }
-
- func NursingHomeOrderRefundList(c *gin.Context) {
- var req md.NursingHomeOrderRefundListReq
- err := c.ShouldBindJSON(&req)
- if err != nil {
- err = validate.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- list, total, err := svc2.NursingHomeOrderRefundList(req)
- if err != nil {
- e.OutErr(c, e.ERR_DB_ORM, err.Error())
- return
- }
- e.OutSuc(c, map[string]interface{}{
- "list": list,
- "total": total,
- "audit_kind_list": []map[string]interface{}{
- {
- "name": "同意",
- "value": 1,
- },
- {
- "name": "拒绝",
- "value": 2,
- },
- },
- "kind_list": []map[string]interface{}{
- {
- "name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast),
- "value": enum.CentralKitchenForSchoolUserWithDayKindForBreakfast,
- },
- {
- "name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForLunch),
- "value": enum.CentralKitchenForSchoolUserWithDayKindForLunch,
- },
- {
- "name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForDinner),
- "value": enum.CentralKitchenForSchoolUserWithDayKindForDinner,
- },
- },
- "state_list": []map[string]interface{}{
- {
- "name": enum.CentralKitchenForSchoolUserRefundDayState.String(enum.CentralKitchenForSchoolUserRefundDayStateForAuditing),
- "value": enum.CentralKitchenForSchoolUserRefundDayStateForAuditing,
- },
- {
- "name": enum.CentralKitchenForSchoolUserRefundDayState.String(enum.CentralKitchenForSchoolUserRefundDayStateForAuditPass),
- "value": enum.CentralKitchenForSchoolUserRefundDayStateForAuditPass,
- },
- {
- "name": enum.CentralKitchenForSchoolUserRefundDayState.String(enum.CentralKitchenForSchoolUserRefundDayStateForAuditReject),
- "value": enum.CentralKitchenForSchoolUserRefundDayStateForAuditReject,
- },
- {
- "name": enum.CentralKitchenForSchoolUserRefundDayState.String(enum.CentralKitchenForSchoolUserRefundDayStateForAuditComplete),
- "value": enum.CentralKitchenForSchoolUserRefundDayStateForAuditComplete,
- },
- },
- "user_identity_kind_list": []map[string]interface{}{
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForCentralKitchenForStudent),
- "value": enum.UserIdentityForCentralKitchenForStudent,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForCentralKitchenForTeacher),
- "value": enum.UserIdentityForCentralKitchenForTeacher,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForCentralKitchenForWorker),
- "value": enum.UserIdentityForCentralKitchenForWorker,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForSelfSupportForStudent),
- "value": enum.UserIdentityForSelfSupportForStudent,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForSelfSupportForTeacher),
- "value": enum.UserIdentityForSelfSupportForTeacher,
- },
- {
- "name": enum.UserIdentity.String(enum.UserIdentityForSelfSupportForWorker),
- "value": enum.UserIdentityForSelfSupportForWorker,
- },
- },
- }, nil)
- return
- }
-
- func NursingHomeOrderRefundAudit(c *gin.Context) {
- var req md.CentralKitchenForSchoolOrderRefundAuditReq
- err := c.ShouldBindJSON(&req)
- if err != nil {
- err = validate.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- err = svc2.CentralKitchenForSchoolOrderRefundAudit(req)
- if err != nil {
- e.OutErr(c, e.ERR, err.Error())
- return
- }
- e.OutSuc(c, "success", nil)
- return
- }
|