From 829e553a0a7c6195dd1f40bd2bb704b8ae7e0bcf Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 12 Sep 2023 17:57:10 +0800 Subject: [PATCH] update --- .../hdl_self_support_for_school.go | 76 ++++++++++++++++++ app/router/admin_router.go | 2 + ...自营学校(教师信息导入模板).xls | Bin 0 -> 18432 bytes 3 files changed, 78 insertions(+) create mode 100644 static/template/自营学校(教师信息导入模板).xls 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 8714862..1891a15 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 @@ -11,7 +11,9 @@ import ( "applet/app/e" "applet/app/enum" "applet/app/utils" + "github.com/360EntSecGroup-Skylar/excelize" "github.com/gin-gonic/gin" + "path" "time" ) @@ -683,6 +685,80 @@ func SelfSupportForSchoolAddTeacher(c *gin.Context) { return } +func SelfSupportForSchoolImportTeacher(c *gin.Context) { + enterpriseIdStr := c.DefaultQuery("enterprise_id", "") + enterpriseId := utils.StrToInt(enterpriseIdStr) + enterpriseDb := db.EnterpriseDb{} + enterpriseDb.Set() + enterprise, err := enterpriseDb.GetEnterprise(enterpriseId) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + if enterprise == nil { + e.OutErr(c, e.ERR_NO_DATA, "未查询到对应记录") + return + } + files, _ := c.FormFile("file") + dst := path.Join("./static/upload", files.Filename) + err = c.SaveUploadedFile(files, dst) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + xlsx, err := excelize.OpenFile(dst) + rows := xlsx.GetRows("Sheet" + "1") + for key, row := range rows { + if key > 0 && (row[0] != "" && row[1] != "") { + idNo := row[0] + name := row[1] + //1、查找当前身份是否已存在 + userIdentityDb := db.UserIdentityDb{} + userIdentityDb.Set(0) + isHasUserIdentity, err := userIdentityDb.UserIdentityExist(enterpriseId, idNo) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + if isHasUserIdentity != nil { + continue + } + + now := time.Now() + //2、新增身份信息 + userIdentity := &model.UserIdentity{ + Uid: 0, + Name: name, + IdNo: idNo, + Kind: enum.UserIdentityKindForCommon, + Identity: enum.UserIdentityForSelfSupportForTeacher, + EnterpriseId: enterpriseId, + State: enum.UserIdentityStateForNormal, + Memo: "", + CreateAt: now.Format("2006-01-02 15:04:05"), + UpdateAt: now.Format("2006-01-02 15:04:05"), + } + insertAffected, err := userIdentityDb.UserIdentityInsert(userIdentity) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + if insertAffected <= 0 { + e.OutErr(c, e.ERR_DB_ORM, "新增身份数据失败") + return + } + } + } + + e.OutSuc(c, "success", nil) + return +} + +func SelfSupportForSchoolDownloadTemplateExcel(c *gin.Context) { + e.OutSuc(c, "/", nil) + return +} + func SelfSupportForSchoolOrdList(c *gin.Context) { var req md.SelfSupportForSchoolOrdListReq err := c.ShouldBindJSON(&req) diff --git a/app/router/admin_router.go b/app/router/admin_router.go index 79c6554..8d0a0bc 100644 --- a/app/router/admin_router.go +++ b/app/router/admin_router.go @@ -204,6 +204,8 @@ func rEnterpriseManage(r *gin.RouterGroup) { r.DELETE("/selfSupportForSchool/classDelete/:id", hdl.SelfSupportForSchoolClassDelete) //"自营-学校"班级删除 r.POST("/selfSupportForSchool/addWorker", hdl.SelfSupportForSchoolAddWorker) //"自营-学校"添加工作人员 r.POST("/selfSupportForSchool/addTeacher", hdl.SelfSupportForSchoolAddTeacher) //"自营-学校"添加老师 + r.POST("/selfSupportForSchool/importTeacher", hdl.SelfSupportForSchoolImportTeacher) //"自营-学校"导入老师 + r.GET("/selfSupportForSchool/downloadTemplateExcel", hdl.SelfSupportForSchoolDownloadTemplateExcel) //"自营-学校"下载表格模板 r.POST("/selfSupportForSchool/ordList", hdl.SelfSupportForSchoolOrdList) //"自营-学校"订单列表 r.POST("/selfSupportForSchool/arrearsOrdList", hdl.SelfSupportForSchoolArrearsOrdList) //"自营-学校"订单欠费列表 r.POST("/selfSupportForSchool/arrearsOrdDebtRepay", hdl.SelfSupportForSchoolArrearsOrdDebtRepay) //"自营-学校"订单欠费催缴 diff --git a/static/template/自营学校(教师信息导入模板).xls b/static/template/自营学校(教师信息导入模板).xls new file mode 100644 index 0000000000000000000000000000000000000000..86f424e7994dc682cb8711eedf1e3e30793bd9e5 GIT binary patch literal 18432 zcmeHO30M?I)9zgsSWpDykV9ZW1mu!a@B&0IDtIGm5EOI~yihO*i3B{*D5xljC-Ds4 z_Zh_l6-5-If+)m9MMS|{KMkVj{#7%~GVIQ7(Eoq_=gaqey-&|kUHx`dbyfHD^v<=b zy7xBjH>o5t$%m+rPZABH#-j7!8Z(u22r-8Xy#FMTNN6G)BXplxg>+xg~iK66~L=!*b*p~2lO#66lNmZ0Ez6;G6NJ2pK zB+xv7M8Yw$B>*fQeP|!YK#ZT3wvW~QX)}TKhLLZ`6!=9_w(keM5KY+xDKkhcTu;Rc z3X)x;{usM0Z6D*g2MP^ILkLlk0VabigVe!PSi3r&k zvE0=gIB<3v$@io97E?zn>evR3JaUw(^E*Xxg}Lkx;1`lCv2xxf=9X(KN7Ffx>g zAyC5=RP=(G-B`Y&Gqk0sHM-1P&kGeJ&j3AxhM>VFX8Kf&}0Lv6XCqox?Q>+KAE|;v$8&k|jH|z_p z+l0dCHGw$5kiemrES$V{TpY@p>I^YxKzO5xb+caT1idtx*gJX`1IO^c6Ty%MSLkb6ZxHA$ zKUn$-F1oy&j+FdTIcXeNOwu^={Ip)U>ZI_Y-%nedwjhoEfGbgkPWuDxC%8JL z>Cw?NzZcc6e81Z(u%{$LXQ~N0A+jD1LdIt_pDI zc$DX->9|1U;k%1>y1G=Hs?q)l3nZFe4i{9)7tIptlUZmuY4RuU%3Rl`2#rZfGde~U z58j}t5`K!XmrNmsmI}Ov(TAfr8XIDg7DdCVO{o!NnG6WVA&w=mGKH(u)Kux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