From 61952a91b63a0f559d6d9c066fa16e0f8972d879 Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Mon, 22 May 2023 10:30:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 + api/shiyan/entry.go | 9 + api/shiyan/maptostruct/type.go | 79 + api/version1/entry.go | 9 + api/version1/user/type.go | 20 + apirouter/apishiyan/entry.go | 5 + apirouter/apishiyan/maptostruct.go | 20 + apirouter/entry.go | 14 + apirouter/v1/userRouters/pc.go | 19 + apirouter/v1/userRouters/type.go | 4 + config/configApp/server.go | 53 + config/configDatabase/database.go | 88 + config/configJson/org.json | 21 + config/configNosql/redis.go | 41 + go.mod | 54 + go.sum | 1144 +++++++++ identification/interceptor/authentication.go | 167 ++ identification/interceptor/identity.go | 161 ++ identification/interceptor/type.go | 16 + initialization/app/initServer.go | 19 + initialization/app/run.go | 26 + initialization/databaseinit/mysql.go | 131 + initialization/initviper/init_viper.go | 55 + initialization/initviper/initreload.go | 18 + initialization/nosql/redis.go | 19 + initialization/route/initRoute.go | 59 + main.go | 17 + middleware/cross_domain.go | 26 + middleware/grocerystore/redis.go | 415 ++++ middleware/snowflake/snowflake.go | 38 + middleware/snowflake/type.go | 21 + models/modelbookimg/archives_type.go | 45 + models/modelbookimg/bookattribute.go | 46 + models/modelbookimg/discussmsg.go | 48 + models/modelbookimg/graphicform.go | 72 + models/modelbookimg/reporting.go | 46 + models/modelbookimg/searchlog.go | 44 + models/modelbookimg/traceing.go | 49 + models/modelshonory/carrier_type.go | 42 + models/modelshonory/honorary_archives.go | 49 + models/modelshonory/photos_gallery.go | 47 + .../modelshr/administrative_organization.go | 63 + .../administrative_organization_type.go | 38 + models/modelshr/double_worker.go | 42 + models/modelshr/duties.go | 41 + models/modelshr/duties_class_leve.go | 37 + models/modelshr/emergency_contact.go | 46 + models/modelshr/empoweruser.go | 46 + models/modelshr/family_members.go | 46 + models/modelshr/inside_work_history.go | 48 + models/modelshr/inside_work_view.go | 39 + models/modelshr/job_class.go | 38 + models/modelshr/kingdee_log.go | 36 + models/modelshr/man_cont.go | 76 + models/modelshr/org_cont_type.go | 34 + models/modelshr/personarchives.go | 61 + models/modelshr/personnel.go | 54 + models/modelshr/personnel_change_record.go | 58 + models/modelshr/personnel_content.go | 67 + models/modelshr/personnel_education.go | 48 + models/modelshr/position.go | 53 + models/modelshr/position_level.go | 22 + models/modelshr/position_unify.go | 43 + models/modelshr/post_duties_job.go | 44 + models/modelshr/teamgroup.go | 36 + models/modelshr/user_post_duties.go | 82 + models/modelshr/work_history.go | 51 + models/modelskpi/app_flow_log.go | 119 + models/modelskpi/app_new_flow_log.go | 95 + models/modelskpi/approval_record.go | 97 + models/modelskpi/assesstarget.go | 64 + models/modelskpi/depart_dime_post_weight.go | 123 + .../modelskpi/department_dimension_weight.go | 64 + models/modelskpi/detailed_target.go | 73 + models/modelskpi/division_responsibilities.go | 77 + models/modelskpi/duty_flow_data.go | 81 + models/modelskpi/dutyclass.go | 62 + models/modelskpi/evaluation_process.go | 79 + models/modelskpi/evaluationtarget.go | 71 + models/modelskpi/flow_data_log.go | 26 + models/modelskpi/flow_log.go | 76 + models/modelskpi/flow_log_data.go | 71 + models/modelskpi/nature_flow_order.go | 86 + models/modelskpi/open_approval_change_log.go | 94 + models/modelskpi/operator_is_true.go | 69 + models/modelskpi/plan_versio.go | 65 + models/modelskpi/position_plan_version.go | 67 + models/modelskpi/post_metering_flow.go | 79 + models/modelskpi/post_nature_flow.go | 84 + models/modelskpi/post_sun_target.go | 62 + models/modelskpi/post_target.go | 77 + models/modelskpi/post_target_details.go | 77 + models/modelskpi/post_workflow_orders.go | 84 + models/modelskpi/qualitative_evaluation.go | 89 + .../qualitative_evaluation_scheme.go | 81 + .../modelskpi/qualitative_evaluation_view.go | 95 + models/modelskpi/qualitative_target.go | 75 + models/modelskpi/quan_people_config.go | 73 + models/modelskpi/quan_people_config_target.go | 76 + models/modelskpi/quan_post_config.go | 72 + models/modelskpi/quan_post_config_target.go | 75 + models/modelskpi/quantitative_config.go | 70 + models/modelskpi/rectification_measures.go | 72 + models/modelskpi/register.go | 65 + models/modelskpi/score_flow.go | 82 + models/modelskpi/sheme_people.go | 87 + models/modelskpi/son_target_father.go | 70 + models/modelskpi/target_department.go | 67 + .../target_detailed_relation_department.go | 84 + models/modelskpi/target_report.go | 69 + models/modelskpi/update_wechat_tempmsg.go | 71 + models/modelskpi/work_flow.go | 61 + models/modelskpi/work_flow_cont.go | 65 + models/modelskpi/work_flow_version.go | 61 + models/modelsschool/menu_operation.go | 12 + models/modelsschool/step_role_group.go | 48 + models/modelsschool/system_menu.go | 70 + models/modelsschool/system_role.go | 44 + models/modelsschool/system_user.go | 40 + models/modelsschool/system_user_attribute.go | 33 + models/modelsstorage/accesstoaddress.go | 65 + models/modelsstorage/material.go | 70 + models/modelsstorage/material_type.go | 61 + models/modelssystempermission/Untitled-1.json | 115 + models/modelssystempermission/appsystem.go | 62 + models/modelssystempermission/empower.go | 65 + models/modelssystempermission/role_empower.go | 64 + models/modelssystempermission/system_role.go | 60 + .../systemrole_empower.go | 65 + models/modelswechat/wechatUsers.go | 34 + models/myuser.go | 90 + models/systempermission/empower.go | 60 + models/wechatcallback/callbacklog.go | 18 + overall/appConfig.go | 51 + overall/database.go | 11 + overall/publicmethod/errorCode.go | 15 + overall/publicmethod/formatOutput.go | 231 ++ overall/publicmethod/log.go | 71 + overall/publicmethod/technique.go | 2135 +++++++++++++++++ overall/publicmethod/type.go | 293 +++ 140 files changed, 11976 insertions(+) create mode 100644 .gitignore create mode 100644 api/shiyan/entry.go create mode 100644 api/shiyan/maptostruct/type.go create mode 100644 api/version1/entry.go create mode 100644 api/version1/user/type.go create mode 100644 apirouter/apishiyan/entry.go create mode 100644 apirouter/apishiyan/maptostruct.go create mode 100644 apirouter/entry.go create mode 100644 apirouter/v1/userRouters/pc.go create mode 100644 apirouter/v1/userRouters/type.go create mode 100644 config/configApp/server.go create mode 100644 config/configDatabase/database.go create mode 100644 config/configJson/org.json create mode 100644 config/configNosql/redis.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 identification/interceptor/authentication.go create mode 100644 identification/interceptor/identity.go create mode 100644 identification/interceptor/type.go create mode 100644 initialization/app/initServer.go create mode 100644 initialization/app/run.go create mode 100644 initialization/databaseinit/mysql.go create mode 100644 initialization/initviper/init_viper.go create mode 100644 initialization/initviper/initreload.go create mode 100644 initialization/nosql/redis.go create mode 100644 initialization/route/initRoute.go create mode 100644 main.go create mode 100644 middleware/cross_domain.go create mode 100644 middleware/grocerystore/redis.go create mode 100644 middleware/snowflake/snowflake.go create mode 100644 middleware/snowflake/type.go create mode 100644 models/modelbookimg/archives_type.go create mode 100644 models/modelbookimg/bookattribute.go create mode 100644 models/modelbookimg/discussmsg.go create mode 100644 models/modelbookimg/graphicform.go create mode 100644 models/modelbookimg/reporting.go create mode 100644 models/modelbookimg/searchlog.go create mode 100644 models/modelbookimg/traceing.go create mode 100644 models/modelshonory/carrier_type.go create mode 100644 models/modelshonory/honorary_archives.go create mode 100644 models/modelshonory/photos_gallery.go create mode 100644 models/modelshr/administrative_organization.go create mode 100644 models/modelshr/administrative_organization_type.go create mode 100644 models/modelshr/double_worker.go create mode 100644 models/modelshr/duties.go create mode 100644 models/modelshr/duties_class_leve.go create mode 100644 models/modelshr/emergency_contact.go create mode 100644 models/modelshr/empoweruser.go create mode 100644 models/modelshr/family_members.go create mode 100644 models/modelshr/inside_work_history.go create mode 100644 models/modelshr/inside_work_view.go create mode 100644 models/modelshr/job_class.go create mode 100644 models/modelshr/kingdee_log.go create mode 100644 models/modelshr/man_cont.go create mode 100644 models/modelshr/org_cont_type.go create mode 100644 models/modelshr/personarchives.go create mode 100644 models/modelshr/personnel.go create mode 100644 models/modelshr/personnel_change_record.go create mode 100644 models/modelshr/personnel_content.go create mode 100644 models/modelshr/personnel_education.go create mode 100644 models/modelshr/position.go create mode 100644 models/modelshr/position_level.go create mode 100644 models/modelshr/position_unify.go create mode 100644 models/modelshr/post_duties_job.go create mode 100644 models/modelshr/teamgroup.go create mode 100644 models/modelshr/user_post_duties.go create mode 100644 models/modelshr/work_history.go create mode 100644 models/modelskpi/app_flow_log.go create mode 100644 models/modelskpi/app_new_flow_log.go create mode 100644 models/modelskpi/approval_record.go create mode 100644 models/modelskpi/assesstarget.go create mode 100644 models/modelskpi/depart_dime_post_weight.go create mode 100644 models/modelskpi/department_dimension_weight.go create mode 100644 models/modelskpi/detailed_target.go create mode 100644 models/modelskpi/division_responsibilities.go create mode 100644 models/modelskpi/duty_flow_data.go create mode 100644 models/modelskpi/dutyclass.go create mode 100644 models/modelskpi/evaluation_process.go create mode 100644 models/modelskpi/evaluationtarget.go create mode 100644 models/modelskpi/flow_data_log.go create mode 100644 models/modelskpi/flow_log.go create mode 100644 models/modelskpi/flow_log_data.go create mode 100644 models/modelskpi/nature_flow_order.go create mode 100644 models/modelskpi/open_approval_change_log.go create mode 100644 models/modelskpi/operator_is_true.go create mode 100644 models/modelskpi/plan_versio.go create mode 100644 models/modelskpi/position_plan_version.go create mode 100644 models/modelskpi/post_metering_flow.go create mode 100644 models/modelskpi/post_nature_flow.go create mode 100644 models/modelskpi/post_sun_target.go create mode 100644 models/modelskpi/post_target.go create mode 100644 models/modelskpi/post_target_details.go create mode 100644 models/modelskpi/post_workflow_orders.go create mode 100644 models/modelskpi/qualitative_evaluation.go create mode 100644 models/modelskpi/qualitative_evaluation_scheme.go create mode 100644 models/modelskpi/qualitative_evaluation_view.go create mode 100644 models/modelskpi/qualitative_target.go create mode 100644 models/modelskpi/quan_people_config.go create mode 100644 models/modelskpi/quan_people_config_target.go create mode 100644 models/modelskpi/quan_post_config.go create mode 100644 models/modelskpi/quan_post_config_target.go create mode 100644 models/modelskpi/quantitative_config.go create mode 100644 models/modelskpi/rectification_measures.go create mode 100644 models/modelskpi/register.go create mode 100644 models/modelskpi/score_flow.go create mode 100644 models/modelskpi/sheme_people.go create mode 100644 models/modelskpi/son_target_father.go create mode 100644 models/modelskpi/target_department.go create mode 100644 models/modelskpi/target_detailed_relation_department.go create mode 100644 models/modelskpi/target_report.go create mode 100644 models/modelskpi/update_wechat_tempmsg.go create mode 100644 models/modelskpi/work_flow.go create mode 100644 models/modelskpi/work_flow_cont.go create mode 100644 models/modelskpi/work_flow_version.go create mode 100644 models/modelsschool/menu_operation.go create mode 100644 models/modelsschool/step_role_group.go create mode 100644 models/modelsschool/system_menu.go create mode 100644 models/modelsschool/system_role.go create mode 100644 models/modelsschool/system_user.go create mode 100644 models/modelsschool/system_user_attribute.go create mode 100644 models/modelsstorage/accesstoaddress.go create mode 100644 models/modelsstorage/material.go create mode 100644 models/modelsstorage/material_type.go create mode 100644 models/modelssystempermission/Untitled-1.json create mode 100644 models/modelssystempermission/appsystem.go create mode 100644 models/modelssystempermission/empower.go create mode 100644 models/modelssystempermission/role_empower.go create mode 100644 models/modelssystempermission/system_role.go create mode 100644 models/modelssystempermission/systemrole_empower.go create mode 100644 models/modelswechat/wechatUsers.go create mode 100644 models/myuser.go create mode 100644 models/systempermission/empower.go create mode 100644 models/wechatcallback/callbacklog.go create mode 100644 overall/appConfig.go create mode 100644 overall/database.go create mode 100644 overall/publicmethod/errorCode.go create mode 100644 overall/publicmethod/formatOutput.go create mode 100644 overall/publicmethod/log.go create mode 100644 overall/publicmethod/technique.go create mode 100644 overall/publicmethod/type.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d6f0c7e --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# .gitignore +log +*.yaml +*.log + + diff --git a/api/shiyan/entry.go b/api/shiyan/entry.go new file mode 100644 index 0000000..feb505a --- /dev/null +++ b/api/shiyan/entry.go @@ -0,0 +1,9 @@ +package shiyan + +import "appPlatform/api/shiyan/maptostruct" + +type ApiEntry struct { + MapToStructApi maptostruct.ApiMethod +} + +var AppApiEntry = new(ApiEntry) diff --git a/api/shiyan/maptostruct/type.go b/api/shiyan/maptostruct/type.go new file mode 100644 index 0000000..164ee87 --- /dev/null +++ b/api/shiyan/maptostruct/type.go @@ -0,0 +1,79 @@ +package maptostruct + +import ( + "appPlatform/models/modelsstorage" + "appPlatform/overall/publicmethod" + "sync" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 协程设置 +var syncSeting = sync.WaitGroup{} +var syncSetings = sync.WaitGroup{} + +type readDataLock struct { + MaterialAry []MaterialCont `json:"materialary"` +} + +type MaterialCont struct { + modelsstorage.MaterialType + MaterialList []modelsstorage.Material `json:"materiallist"` +} + +// 菜单树 +type CaiDanShu struct { + MaterialCont + Child []CaiDanShu `json:"child"` +} + +// 实验入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "实验入口" + publicmethod.Result(0, outputCont, c) +} + +// 实验数据 +type shiyanType struct { + Name string `json:"name"` + Age int `json:"age"` + Time int32 `json:"time"` + Time1 int64 `json:"time1"` + Time2 float32 `json:"time2"` + Time3 float64 `json:"time3"` +} + +// 模拟回调 +type callBackCont struct { + MsgSignature string `json:"msg_signature"` + Timestamp string `json:"timestamp"` + Nonce string `json:"nonce"` + Echostr string `json:"echostr"` + DataType string `json:"datatype"` + SystemApp string `json:"systemapp"` + ToUsername string `json:"ToUserName"` + Agentid uint32 `json:"AgentID"` + Encrypt string `json:"encrypt"` +} + +// Hr username AND password +type hrUsernameAndPassword struct { + Username string `json:"username"` + Password string `json:"password"` + VerificationCode string `json:"verification_code"` + publicmethod.PublicName +} + +type XiaoZengTime struct { + DateTime string `json"datetime"` +} + +// 更新mini文本模板 +type UpdateMiniTemp struct { + Type int `json:"type"` //'类型(1:文本通知型;2:图文展示型;3:按钮交互型;4:投票选择型;5:多项选择型)' + Orderkey string `json:"orderkey"` //流程识别符 + Enforcer string `json:"enforcer"` //执行人 +} diff --git a/api/version1/entry.go b/api/version1/entry.go new file mode 100644 index 0000000..c8ebd07 --- /dev/null +++ b/api/version1/entry.go @@ -0,0 +1,9 @@ +package version1 + +import "appPlatform/api/version1/user" + +type ApiEntry struct { + UserApi user.ApiMethod //人员信息 +} + +var AppApiEntry = new(ApiEntry) diff --git a/api/version1/user/type.go b/api/version1/user/type.go new file mode 100644 index 0000000..6379675 --- /dev/null +++ b/api/version1/user/type.go @@ -0,0 +1,20 @@ +package user + +import ( + "appPlatform/overall/publicmethod" + "sync" + + "github.com/gin-gonic/gin" +) + +type ApiMethod struct{} + +// 人员入口 +func (a *ApiMethod) Index(c *gin.Context) { + outputCont := publicmethod.MapOut[string]() + outputCont["index"] = "人员入口" + publicmethod.Result(0, outputCont, c) +} + +// 协程设置 +var syncSeting = sync.WaitGroup{} diff --git a/apirouter/apishiyan/entry.go b/apirouter/apishiyan/entry.go new file mode 100644 index 0000000..ad09277 --- /dev/null +++ b/apirouter/apishiyan/entry.go @@ -0,0 +1,5 @@ +package apishiyan + +//Api实验 + +type ApiRouter struct{} diff --git a/apirouter/apishiyan/maptostruct.go b/apirouter/apishiyan/maptostruct.go new file mode 100644 index 0000000..a325296 --- /dev/null +++ b/apirouter/apishiyan/maptostruct.go @@ -0,0 +1,20 @@ +package apishiyan + +import ( + "appPlatform/api/shiyan" + + "github.com/gin-gonic/gin" +) + +//实验 + +func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) { + apiRouter := router.Group("shiyan") + + var methodBinding = shiyan.AppApiEntry.MapToStructApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + + } +} diff --git a/apirouter/entry.go b/apirouter/entry.go new file mode 100644 index 0000000..d01f9ec --- /dev/null +++ b/apirouter/entry.go @@ -0,0 +1,14 @@ +package apirouter + +import ( + "appPlatform/apirouter/apishiyan" + userrouters "appPlatform/apirouter/v1/userRouters" +) + +// 路由结构 +type RouterGroup struct { + ShiyanApi apishiyan.ApiRouter + UserRouter userrouters.ApiRouter +} + +var RouterGroupEntry = new(RouterGroup) diff --git a/apirouter/v1/userRouters/pc.go b/apirouter/v1/userRouters/pc.go new file mode 100644 index 0000000..2259f09 --- /dev/null +++ b/apirouter/v1/userRouters/pc.go @@ -0,0 +1,19 @@ +package userrouters + +import ( + "appPlatform/api/version1" + + "github.com/gin-gonic/gin" +) + +// 权限管理PC端 +func (a *ApiRouter) RouterGroupPc(router *gin.RouterGroup) { + apiRouter := router.Group("user") + + var methodBinding = version1.AppApiEntry.UserApi + { + apiRouter.GET("", methodBinding.Index) //入口 + apiRouter.POST("", methodBinding.Index) //入口 + + } +} diff --git a/apirouter/v1/userRouters/type.go b/apirouter/v1/userRouters/type.go new file mode 100644 index 0000000..307e29b --- /dev/null +++ b/apirouter/v1/userRouters/type.go @@ -0,0 +1,4 @@ +package userrouters + +//系统权限 +type ApiRouter struct{} diff --git a/config/configApp/server.go b/config/configApp/server.go new file mode 100644 index 0000000..60d50e8 --- /dev/null +++ b/config/configApp/server.go @@ -0,0 +1,53 @@ +package configApp + +//服务基础配置 +type Server struct { + Appsetup appsetup `mapstructure:"appsetup" json:"appsetup" yaml:"appsetup"` + Logsetup logsetup `mapstructure:"logconfig" json:"logconfig" yaml:"logconfig"` + Captcha captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"` + RedisPrefixStr redisPrefixStr `mapstructure:"redisprefix" json:"redisprefix" yaml:"redisprefix"` + WechatCompany wechatCompany `mapstructure:"wechatcompany" json:"wechatcompany" yaml:"wechatcompany"` //企业ID + WechatSchool wechatConfig `mapstructure:"wechatschool" json:"wechatschool" yaml:"wechatschool"` //知行学院 + WechatKpi wechatConfig `mapstructure:"wechatkpi" json:"wechatkpi" yaml:"wechatkpi"` //绩效考核 +} + +//服务配置详情 +type appsetup struct { + Port int `mapstructure:"port" json:"port" yaml:"port"` + Readtime int `mapstructure:"readtime" json:"readtime" yaml:"readtime"` + Writetime int `mapstructure:"writetime" json:"writetime" yaml:"writetime"` + AppKey string `mapstructure:"appkey" json:"appkey" yaml:"appkey"` + DefaultPassword string `mapstructure:"password" json:"password" yaml:"password"` + PreFix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` + WebUrl string `mapstructure:"weburl" json:"weburl" yaml:"weburl"` + PcbUrl string `mapstructure:"pcurl" json:"pcurl" yaml:"pcurl"` +} + +//日志配置 +type logsetup struct { + Path string `mapstructure:"path" json:"path" yaml:"path"` +} + +//验证码相关 +type captcha struct { + KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"` // 验证码长度 + ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"` // 验证码宽度 + ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"` // 验证码高度 +} + +type redisPrefixStr struct { + PreFix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` // redis键前缀 + Alias string `mapstructure:"alias" json:"alias" yaml:"alias"` // redis键前缀 +} + +//企业微信基础配置 +type wechatCompany struct { + CompanyId string `mapstructure:"companyid" json:"companyid" yaml:"companyid"` // 企业ID +} + +type wechatConfig struct { + Agentid string `mapstructure:"agentid" json:"agentid" yaml:"agentid"` // Agentid + Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` // Secret + Token string `mapstructure:"token" json:"token" yaml:"token"` // Token + Encodingaeskey string `mapstructure:"encodingaeskey" json:"encodingaeskey" yaml:"encodingaeskey"` // EncodingAESKey +} diff --git a/config/configDatabase/database.go b/config/configDatabase/database.go new file mode 100644 index 0000000..d0f9bec --- /dev/null +++ b/config/configDatabase/database.go @@ -0,0 +1,88 @@ +package configDatabase + +import ( + "fmt" + "time" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type MysqlSetUp struct { + MasterMysql MasterMysqlSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + AppPlatformDatabase MasterMysqlSetUp `mapstructure:"appPlatformDatabase" json:"appPlatformDatabase" yaml:"appPlatformDatabase"` //应用平台 + //其他数据库依次添加 + WechatMysql MasterMysqlSetUp `mapstructure:"wechat" json:"wechat" yaml:"wechat"` //微信数据库 + HrMysql MasterMysqlSetUp `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"` //HR数据库 + FileBookDate MasterMysqlSetUp `mapstructure:"fileBookDate" json:"fileBookDate" yaml:"fileBookDate"` //文档属性数据库 + ErrorSubjectDate MasterMysqlSetUp `mapstructure:"errorSubjectDate" json:"errorSubjectDate" yaml:"errorSubjectDate"` //错题库 + MyTestDate MasterMysqlSetUp `mapstructure:"myTestDate" json:"myTestDate" yaml:"myTestDate"` //自我测验 + ImageTextDate MasterMysqlSetUp `mapstructure:"imageTextDate" json:"imageTextDate" yaml:"imageTextDate"` //图文信息数据库 + ScoringDetailsDate MasterMysqlSetUp `mapstructure:"scoringDetailsDate" json:"scoringDetailsDate" yaml:"scoringDetailsDate"` //计分明细数据库 + QuestionsAnswersDate MasterMysqlSetUp `mapstructure:"questionsAnswersDate" json:"questionsAnswersDate" yaml:"questionsAnswersDate"` //趣味问答 + BillboardDate MasterMysqlSetUp `mapstructure:"billboardDate" json:"billboardDate" yaml:"billboardDate"` //风云榜统计数据库 + HealthReportDate MasterMysqlSetUp `mapstructure:"healthReportDate" json:"healthReportDate" yaml:"healthReportDate"` //健康上报数据库 + KpiDate MasterMysqlSetUp `mapstructure:"kpiDate" json:"kpiDate" yaml:"kpiDate"` //绩效考核数据库 + WechatCallBackLogDate MasterMysqlSetUp `mapstructure:"wechatCallBackLogDate" json:"wechatCallBackLogDate" yaml:"wechatCallBackLogDate"` //企业微信回调记录 + Managearchives MasterMysqlSetUp `mapstructure:"managearchives" json:"managearchives" yaml:"managearchives"` //管理档案 + SystemPermission MasterMysqlSetUp `mapstructure:"systempermission" json:"systempermission" yaml:"systempermission"` //系统权限配置数据库 + Storage MasterMysqlSetUp `mapstructure:"storage" json:"storage" yaml:"storage"` //仓储系统数据库 +} + +type MasterMysqlSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Charset string `mapstructure:"charset" json:"charset" yaml:"charset"` // 编码方式 + ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"` // 是否自动转换时间 + Loc string `mapstructure:"loc" json:"loc" yaml:"loc"` // 时区 + Name string `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + UserName string `mapstructure:"username" json:"username" yaml:"username"` // 账号 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 最大空闲数 + MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 最大链接数 + GormLog bool `mapstructure:"gorm_log" json:"gorm_log" yaml:"gorm_log"` // 是否开启Gorm全局日志 +} + +func (m *MasterMysqlSetUp) SqlDsn() (dsnStr string) { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset) + if m.ParseTime { + dsnStr = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=%v&parseTime=%v&loc=%v", m.UserName, m.PassWord, m.UrlPath, m.Port, m.Name, m.Charset, m.ParseTime, m.Loc) + } + return +} + +func (m *MasterMysqlSetUp) OpenSql() *gorm.DB { + sqlConfig := mysql.Config{ + DSN: m.SqlDsn(), // DSN + DefaultStringSize: 255, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if m.GormLog { + if opDb, err := gorm.Open(mysql.New(sqlConfig), &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + }); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + sqlDb.SetConnMaxLifetime(5 * time.Minute) + return opDb + } + } else { + if opDb, err := gorm.Open(mysql.New(sqlConfig)); err != nil { + return nil + } else { + sqlDb, _ := opDb.DB() + sqlDb.SetMaxIdleConns(m.MaxIdleConns) + sqlDb.SetMaxOpenConns(m.MaxOpenConns) + sqlDb.SetConnMaxLifetime(5 * time.Minute) + return opDb + } + } + +} diff --git a/config/configJson/org.json b/config/configJson/org.json new file mode 100644 index 0000000..3e1c3ef --- /dev/null +++ b/config/configJson/org.json @@ -0,0 +1,21 @@ +{ + "group":[ + { + "old":3, + "new":2 + } + ], + "department":[ + { + "newgroup":2, + "old":1, + "new":14 + }, + { + "newgroup":2, + "old":2, + "new":13 + } + ], + "workshopsection":[] +} \ No newline at end of file diff --git a/config/configNosql/redis.go b/config/configNosql/redis.go new file mode 100644 index 0000000..b93ab50 --- /dev/null +++ b/config/configNosql/redis.go @@ -0,0 +1,41 @@ +package confignosql + +import ( + "context" + "fmt" + + "github.com/go-redis/redis/v8" +) + +type RedisSetUp struct { + MasterRedis RedisConfitSetUp `mapstructure:"master" json:"master" yaml:"master"` //主数据库 + MasterRedis1 RedisConfitSetUp `mapstructure:"master1" json:"master1" yaml:"master1"` //主数据库 + MasterRedis2 RedisConfitSetUp `mapstructure:"master2" json:"master1" yaml:"master2"` //主数据库 + MasterRedis3 RedisConfitSetUp `mapstructure:"master3" json:"master1" yaml:"master3"` //主数据库 + MasterRedis4 RedisConfitSetUp `mapstructure:"master4" json:"master1" yaml:"master4"` //主数据库 + MasterRedis5 RedisConfitSetUp `mapstructure:"master5" json:"master1" yaml:"master5"` //主数据库 +} + +type RedisConfitSetUp struct { + UrlPath string `mapstructure:"url_path" json:"url_path" yaml:"url_path"` // 服务器地址 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + Name int `mapstructure:"name" json:"name" yaml:"name"` // 数据库名称 + PassWord string `mapstructure:"password" json:"password" yaml:"password"` // 密码 +} + +func (r *RedisConfitSetUp) OpenRedis() *redis.Client { + address := fmt.Sprintf("%v:%v", r.UrlPath, r.Port) + fmt.Printf("开启%v Redis库 %v\n", address, r.Name) + redisClient := redis.NewClient(&redis.Options{ + Addr: address, + Password: r.PassWord, + DB: r.Name, + }) + pingLink, err := redisClient.Ping(context.Background()).Result() + if err != nil { + fmt.Printf("%v Redis链接失败!原因:%v\n", r.Name, err) + } else { + fmt.Printf("%v Redis链接成功!=====>%v\n", r.Name, pingLink) + } + return redisClient +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ccc47e9 --- /dev/null +++ b/go.mod @@ -0,0 +1,54 @@ +module appPlatform + +go 1.18 + +require ( + github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13 + github.com/fsnotify/fsnotify v1.5.4 + github.com/gin-gonic/gin v1.8.1 + github.com/go-redis/redis/v8 v8.11.5 + github.com/mitchellh/mapstructure v1.5.0 + github.com/mojocn/base64Captcha v1.3.5 + github.com/mozillazg/go-pinyin v0.19.0 + github.com/spf13/viper v1.12.0 + gorm.io/driver/mysql v1.3.5 + gorm.io/gorm v1.23.8 +) + +require ( + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.10.0 // indirect + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/goccy/go-json v0.9.7 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/magiconair/properties v1.8.6 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.3.0 // indirect + github.com/ugorji/go/codec v1.2.7 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect + golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..f1d8dd0 --- /dev/null +++ b/go.sum @@ -0,0 +1,1144 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aws/aws-sdk-go v1.42.27/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc= +github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/casbin/casbin/v2 v2.37.4/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= +github.com/casbin/casbin/v2 v2.51.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= +github.com/casbin/gorm-adapter/v3 v3.7.3/go.mod h1:7mwHmC2phiw6N4gDWlzi+c4DUX7zaVmQC/hINsRgBDg= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/emicklei/proto v1.9.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13 h1:SO0hu+Lqk8ZsKmk7iUgRW5sA5Dapm5vGqUthx0Gh/kM= +github.com/flipped-aurora/gin-vue-admin/server v0.0.0-20220724010254-afab1fdbce13/go.mod h1:6XkcinjHeTsfYUk3IseBHy+0f8JP1lwsxHP+UzrxYEw= +github.com/flipped-aurora/ws v1.0.2/go.mod h1:RdyM2Fnvxx7f7A6WSmU1aAhDrQIAVW7LS/0LsAUE5mE= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6/go.mod h1:YxOVT5+yHzKvwhsiSIWmbAYM3Dr9AEEbER2dVayfBkg= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w= +github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/glebarez/go-sqlite v1.16.0/go.mod h1:i8/JtqoqzBAFkrUTxbQFkQ05odCOds3j7NlDaXjqiPY= +github.com/glebarez/sqlite v1.4.3/go.mod h1:FcJlwP9scnxlQ5zxyl0+bn/qFjYcqG4eRvKYhs39QAQ= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.14/go.mod h1:gwrgJS15eCUgjLpMjBJmbZezCsw88LmgeEip0M63doA= +github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= +github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-redis/redis/v8 v8.11.0/go.mod h1:DLomh7y2e3ggQXQLd1YgmvIfecPJoFl7WU5SOQ/r06M= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= +github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gookit/color v1.3.1/go.mod h1:R3ogXq2B9rTbXoSHJ1HyUVAZ3poOJHpd9nQmyGZsfvQ= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.8+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.11.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.10.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.15.0/go.mod h1:D/zyOyXiaM1TmVWnOM18p0xdDtdakRBa0RsVGI3U3bw= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jordan-wright/email v0.0.0-20200824153738-3f5bafa1cd84/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= +github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= +github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/mojocn/base64Captcha v1.3.1/go.mod h1:wAQCKEc5bDujxKRmbT6/vTnTt5CjStQ8bRfPWUuz/iY= +github.com/mojocn/base64Captcha v1.3.5 h1:Qeilr7Ta6eDtG4S+tQuZ5+hO+QHbiGAJdi4PfoagaA0= +github.com/mojocn/base64Captcha v1.3.5/go.mod h1:/tTTXn4WTpX9CfrmipqRytCpJ27Uw3G6I7NcP2WwcmY= +github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= +github.com/mozillazg/go-pinyin v0.19.0 h1:p+J8/kjJ558KPvVGYLvqBhxf8jbZA2exSLCs2uUVN8c= +github.com/mozillazg/go-pinyin v0.19.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/qiniu/api.v7/v7 v7.4.1/go.mod h1:VE5oC5rkE1xul0u1S2N0b2Uxq9/6hZzhyqjgK25XDcM= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/richardlehane/mscfb v1.0.3/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= +github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shirou/gopsutil v3.20.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil/v3 v3.22.5/go.mod h1:so9G9VzeHt/hsd0YwqprnjHnfARAUktauykSbr+y2gA= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/songzhibin97/gkit v1.1.1/go.mod h1:V4E7H6DQuxX17xpLOqyH1j51GQctKBIIV3i2r5xkE5s= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= +github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= +github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= +github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E= +github.com/swaggo/gin-swagger v1.3.0/go.mod h1:oy1BRA6WvgtCp848lhxce7BnWH4C8Bxa0m5SkWx+cS0= +github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y= +github.com/swaggo/swag v1.7.0/go.mod h1:BdPIL73gvS9NBsdi7M1JOxLvlbfvNRaBP8m6WT6Aajo= +github.com/tencentyun/cos-go-sdk-v5 v0.7.19/go.mod h1:wQBO5HdAkLjj2q6XQiIfDSP8DXDNrppDRw2Kp/1BODA= +github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc= +github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= +github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/unrolled/secure v1.0.7/go.mod h1:uGc1OcRF8gCVBA+ANksKmvM85Hka6SZtQIbrKc3sHS4= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xuri/efp v0.0.0-20210322160811-ab561f5b45e3/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/excelize/v2 v2.4.1/go.mod h1:rSu0C3papjzxQA3sdK8cU544TebhrPUoTOaGPIh0Q1A= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opentelemetry.io/otel v1.0.0-RC2/go.mod h1:w1thVQ7qbAy8MHb0IFj8a5Q2QU0l2ksf8u/CN8m3NOM= +go.opentelemetry.io/otel/sdk v1.0.0-RC2/go.mod h1:fgwHyiDn4e5k40TD9VX243rOxXR+jzsWBZYA2P5jpEw= +go.opentelemetry.io/otel/trace v1.0.0-RC2/go.mod h1:JPQ+z6nNw9mqEGT8o3eoPTdnNI+Aj5JcxEsVGREIAy4= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201120155355-20be4ac4bd6e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/mysql v1.0.3/go.mod h1:twGxftLBlFgNVNakL7F+P/x9oYqoymG3YYT8cAfI9oI= +gorm.io/driver/mysql v1.3.3/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U= +gorm.io/driver/mysql v1.3.5 h1:iWBTVW/8Ij5AG4e0G/zqzaJblYkBI1VIL1LG2HUGsvY= +gorm.io/driver/mysql v1.3.5/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c= +gorm.io/driver/postgres v1.3.4/go.mod h1:y0vEuInFKJtijuSGu9e5bs5hzzSzPK+LancpKpvbRBw= +gorm.io/driver/sqlserver v1.3.2/go.mod h1:w25Vrx2BG+CJNUu/xKbFhaKlGxT/nzRkhWCCoptX8tQ= +gorm.io/gorm v1.20.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= +gorm.io/gorm v1.20.11/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= +gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.8 h1:h8sGJ+biDgBA1AD1Ha9gFCx7h8npU7AsLdlkX0n2TpE= +gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/plugin/dbresolver v1.1.0/go.mod h1:tpImigFAEejCALOttyhWqsy4vfa2Uh/vAUVnL5IRF7Y= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.33.9/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.33.11/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.34.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.4/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.5/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.7/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.8/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.10/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.15/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.16/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.17/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.18/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.20/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.22/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.35.24/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.35.25/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.35.26/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.9.5/go.mod h1:umuo2EP2oDSBnD3ckjaVUXMrmeAw8C8OSICVa0iFf60= +modernc.org/ccgo/v3 v3.10.0/go.mod h1:c0yBmkRFi7uW4J7fwx/JiijwOjeAeR2NoSaRVFPmjMw= +modernc.org/ccgo/v3 v3.11.0/go.mod h1:dGNposbDp9TOZ/1KBxghxtUp/bzErD0/0QW4hhSaBMI= +modernc.org/ccgo/v3 v3.11.1/go.mod h1:lWHxfsn13L3f7hgGsGlU28D9eUOf6y3ZYHKoPaKU0ag= +modernc.org/ccgo/v3 v3.11.3/go.mod h1:0oHunRBMBiXOKdaglfMlRPBALQqsfrCKXgw9okQ3GEw= +modernc.org/ccgo/v3 v3.12.4/go.mod h1:Bk+m6m2tsooJchP/Yk5ji56cClmN6R1cqc9o/YtbgBQ= +modernc.org/ccgo/v3 v3.12.6/go.mod h1:0Ji3ruvpFPpz+yu+1m0wk68pdr/LENABhTrDkMDWH6c= +modernc.org/ccgo/v3 v3.12.8/go.mod h1:Hq9keM4ZfjCDuDXxaHptpv9N24JhgBZmUG5q60iLgUo= +modernc.org/ccgo/v3 v3.12.11/go.mod h1:0jVcmyDwDKDGWbcrzQ+xwJjbhZruHtouiBEvDfoIsdg= +modernc.org/ccgo/v3 v3.12.14/go.mod h1:GhTu1k0YCpJSuWwtRAEHAol5W7g1/RRfS4/9hc9vF5I= +modernc.org/ccgo/v3 v3.12.18/go.mod h1:jvg/xVdWWmZACSgOiAhpWpwHWylbJaSzayCqNOJKIhs= +modernc.org/ccgo/v3 v3.12.20/go.mod h1:aKEdssiu7gVgSy/jjMastnv/q6wWGRbszbheXgWRHc8= +modernc.org/ccgo/v3 v3.12.21/go.mod h1:ydgg2tEprnyMn159ZO/N4pLBqpL7NOkJ88GT5zNU2dE= +modernc.org/ccgo/v3 v3.12.22/go.mod h1:nyDVFMmMWhMsgQw+5JH6B6o4MnZ+UQNw1pp52XYFPRk= +modernc.org/ccgo/v3 v3.12.25/go.mod h1:UaLyWI26TwyIT4+ZFNjkyTbsPsY3plAEB6E7L/vZV3w= +modernc.org/ccgo/v3 v3.12.29/go.mod h1:FXVjG7YLf9FetsS2OOYcwNhcdOLGt8S9bQ48+OP75cE= +modernc.org/ccgo/v3 v3.12.36/go.mod h1:uP3/Fiezp/Ga8onfvMLpREq+KUjUmYMxXPO8tETHtA8= +modernc.org/ccgo/v3 v3.12.38/go.mod h1:93O0G7baRST1vNj4wnZ49b1kLxt0xCW5Hsa2qRaZPqc= +modernc.org/ccgo/v3 v3.12.43/go.mod h1:k+DqGXd3o7W+inNujK15S5ZYuPoWYLpF5PYougCmthU= +modernc.org/ccgo/v3 v3.12.46/go.mod h1:UZe6EvMSqOxaJ4sznY7b23/k13R8XNlyWsO5bAmSgOE= +modernc.org/ccgo/v3 v3.12.47/go.mod h1:m8d6p0zNps187fhBwzY/ii6gxfjob1VxWb919Nk1HUk= +modernc.org/ccgo/v3 v3.12.50/go.mod h1:bu9YIwtg+HXQxBhsRDE+cJjQRuINuT9PUK4orOco/JI= +modernc.org/ccgo/v3 v3.12.51/go.mod h1:gaIIlx4YpmGO2bLye04/yeblmvWEmE4BBBls4aJXFiE= +modernc.org/ccgo/v3 v3.12.53/go.mod h1:8xWGGTFkdFEWBEsUmi+DBjwu/WLy3SSOrqEmKUjMeEg= +modernc.org/ccgo/v3 v3.12.54/go.mod h1:yANKFTm9llTFVX1FqNKHE0aMcQb1fuPJx6p8AcUx+74= +modernc.org/ccgo/v3 v3.12.55/go.mod h1:rsXiIyJi9psOwiBkplOaHye5L4MOOaCjHg1Fxkj7IeU= +modernc.org/ccgo/v3 v3.12.56/go.mod h1:ljeFks3faDseCkr60JMpeDb2GSO3TKAmrzm7q9YOcMU= +modernc.org/ccgo/v3 v3.12.57/go.mod h1:hNSF4DNVgBl8wYHpMvPqQWDQx8luqxDnNGCMM4NFNMc= +modernc.org/ccgo/v3 v3.12.60/go.mod h1:k/Nn0zdO1xHVWjPYVshDeWKqbRWIfif5dtsIOCUVMqM= +modernc.org/ccgo/v3 v3.12.66/go.mod h1:jUuxlCFZTUZLMV08s7B1ekHX5+LIAurKTTaugUr/EhQ= +modernc.org/ccgo/v3 v3.12.67/go.mod h1:Bll3KwKvGROizP2Xj17GEGOTrlvB1XcVaBrC90ORO84= +modernc.org/ccgo/v3 v3.12.73/go.mod h1:hngkB+nUUqzOf3iqsM48Gf1FZhY599qzVg1iX+BT3cQ= +modernc.org/ccgo/v3 v3.12.81/go.mod h1:p2A1duHoBBg1mFtYvnhAnQyI6vL0uw5PGYLSIgF6rYY= +modernc.org/ccgo/v3 v3.12.84/go.mod h1:ApbflUfa5BKadjHynCficldU1ghjen84tuM5jRynB7w= +modernc.org/ccgo/v3 v3.12.86/go.mod h1:dN7S26DLTgVSni1PVA3KxxHTcykyDurf3OgUzNqTSrU= +modernc.org/ccgo/v3 v3.12.90/go.mod h1:obhSc3CdivCRpYZmrvO88TXlW0NvoSVvdh/ccRjJYko= +modernc.org/ccgo/v3 v3.12.92/go.mod h1:5yDdN7ti9KWPi5bRVWPl8UNhpEAtCjuEE7ayQnzzqHA= +modernc.org/ccgo/v3 v3.13.1/go.mod h1:aBYVOUfIlcSnrsRVU8VRS35y2DIfpgkmVkYZ0tpIXi4= +modernc.org/ccgo/v3 v3.15.9/go.mod h1:md59wBwDT2LznX/OTCPoVS6KIsdRgY8xqQwBV+hkTH0= +modernc.org/ccgo/v3 v3.15.10/go.mod h1:wQKxoFn0ynxMuCLfFD09c8XPUCc8obfchoVR9Cn0fI8= +modernc.org/ccgo/v3 v3.15.12/go.mod h1:VFePOWoCd8uDGRJpq/zfJ29D0EVzMSyID8LCMWYbX6I= +modernc.org/ccgo/v3 v3.15.14/go.mod h1:144Sz2iBCKogb9OKwsu7hQEub3EVgOlyI8wMUPGKUXQ= +modernc.org/ccgo/v3 v3.15.15/go.mod h1:z5qltXjU4PJl0pE5nhYQCvA9DhPHiWsl5GWl89+NSYE= +modernc.org/ccgo/v3 v3.15.16/go.mod h1:XbKRMeMWMdq712Tr5ECgATYMrzJ+g9zAZEj2ktzBe24= +modernc.org/ccgo/v3 v3.15.17/go.mod h1:bofnFkpRFf5gLY+mBZIyTW6FEcp26xi2lgOFk2Rlvs0= +modernc.org/ccgo/v3 v3.15.18/go.mod h1:/2lv3WjHyanEr2sAPdGKRC38n6f0werut9BRXUjjX+A= +modernc.org/ccgo/v3 v3.15.19/go.mod h1:TDJj+DxR26pkDteH2E5WQDj/xlmtsX7JdzkJkaZhOVU= +modernc.org/ccgo/v3 v3.16.2/go.mod h1:w55kPTAqvRMAYS3Lwij6qhqIuBEYS3Z8QtDkjD8cnik= +modernc.org/ccorpus v1.11.1/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v1.9.8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= +modernc.org/libc v1.9.11/go.mod h1:NyF3tsA5ArIjJ83XB0JlqhjTabTCHm9aX4XMPHyQn0Q= +modernc.org/libc v1.11.0/go.mod h1:2lOfPmj7cz+g1MrPNmX65QCzVxgNq2C5o0jdLY2gAYg= +modernc.org/libc v1.11.2/go.mod h1:ioIyrl3ETkugDO3SGZ+6EOKvlP3zSOycUETe4XM4n8M= +modernc.org/libc v1.11.5/go.mod h1:k3HDCP95A6U111Q5TmG3nAyUcp3kR5YFZTeDS9v8vSU= +modernc.org/libc v1.11.6/go.mod h1:ddqmzR6p5i4jIGK1d/EiSw97LBcE3dK24QEwCFvgNgE= +modernc.org/libc v1.11.11/go.mod h1:lXEp9QOOk4qAYOtL3BmMve99S5Owz7Qyowzvg6LiZso= +modernc.org/libc v1.11.13/go.mod h1:ZYawJWlXIzXy2Pzghaf7YfM8OKacP3eZQI81PDLFdY8= +modernc.org/libc v1.11.16/go.mod h1:+DJquzYi+DMRUtWI1YNxrlQO6TcA5+dRRiq8HWBWRC8= +modernc.org/libc v1.11.19/go.mod h1:e0dgEame6mkydy19KKaVPBeEnyJB4LGNb0bBH1EtQ3I= +modernc.org/libc v1.11.24/go.mod h1:FOSzE0UwookyT1TtCJrRkvsOrX2k38HoInhw+cSCUGk= +modernc.org/libc v1.11.26/go.mod h1:SFjnYi9OSd2W7f4ct622o/PAYqk7KHv6GS8NZULIjKY= +modernc.org/libc v1.11.27/go.mod h1:zmWm6kcFXt/jpzeCgfvUNswM0qke8qVwxqZrnddlDiE= +modernc.org/libc v1.11.28/go.mod h1:Ii4V0fTFcbq3qrv3CNn+OGHAvzqMBvC7dBNyC4vHZlg= +modernc.org/libc v1.11.31/go.mod h1:FpBncUkEAtopRNJj8aRo29qUiyx5AvAlAxzlx9GNaVM= +modernc.org/libc v1.11.34/go.mod h1:+Tzc4hnb1iaX/SKAutJmfzES6awxfU1BPvrrJO0pYLg= +modernc.org/libc v1.11.37/go.mod h1:dCQebOwoO1046yTrfUE5nX1f3YpGZQKNcITUYWlrAWo= +modernc.org/libc v1.11.39/go.mod h1:mV8lJMo2S5A31uD0k1cMu7vrJbSA3J3waQJxpV4iqx8= +modernc.org/libc v1.11.42/go.mod h1:yzrLDU+sSjLE+D4bIhS7q1L5UwXDOw99PLSX0BlZvSQ= +modernc.org/libc v1.11.44/go.mod h1:KFq33jsma7F5WXiYelU8quMJasCCTnHK0mkri4yPHgA= +modernc.org/libc v1.11.45/go.mod h1:Y192orvfVQQYFzCNsn+Xt0Hxt4DiO4USpLNXBlXg/tM= +modernc.org/libc v1.11.47/go.mod h1:tPkE4PzCTW27E6AIKIR5IwHAQKCAtudEIeAV1/SiyBg= +modernc.org/libc v1.11.49/go.mod h1:9JrJuK5WTtoTWIFQ7QjX2Mb/bagYdZdscI3xrvHbXjE= +modernc.org/libc v1.11.51/go.mod h1:R9I8u9TS+meaWLdbfQhq2kFknTW0O3aw3kEMqDDxMaM= +modernc.org/libc v1.11.53/go.mod h1:5ip5vWYPAoMulkQ5XlSJTy12Sz5U6blOQiYasilVPsU= +modernc.org/libc v1.11.54/go.mod h1:S/FVnskbzVUrjfBqlGFIPA5m7UwB3n9fojHhCNfSsnw= +modernc.org/libc v1.11.55/go.mod h1:j2A5YBRm6HjNkoSs/fzZrSxCuwWqcMYTDPLNx0URn3M= +modernc.org/libc v1.11.56/go.mod h1:pakHkg5JdMLt2OgRadpPOTnyRXm/uzu+Yyg/LSLdi18= +modernc.org/libc v1.11.58/go.mod h1:ns94Rxv0OWyoQrDqMFfWwka2BcaF6/61CqJRK9LP7S8= +modernc.org/libc v1.11.71/go.mod h1:DUOmMYe+IvKi9n6Mycyx3DbjfzSKrdr/0Vgt3j7P5gw= +modernc.org/libc v1.11.75/go.mod h1:dGRVugT6edz361wmD9gk6ax1AbDSe0x5vji0dGJiPT0= +modernc.org/libc v1.11.82/go.mod h1:NF+Ek1BOl2jeC7lw3a7Jj5PWyHPwWD4aq3wVKxqV1fI= +modernc.org/libc v1.11.86/go.mod h1:ePuYgoQLmvxdNT06RpGnaDKJmDNEkV7ZPKI2jnsvZoE= +modernc.org/libc v1.11.87/go.mod h1:Qvd5iXTeLhI5PS0XSyqMY99282y+3euapQFxM7jYnpY= +modernc.org/libc v1.11.88/go.mod h1:h3oIVe8dxmTcchcFuCcJ4nAWaoiwzKCdv82MM0oiIdQ= +modernc.org/libc v1.11.98/go.mod h1:ynK5sbjsU77AP+nn61+k+wxUGRx9rOFcIqWYYMaDZ4c= +modernc.org/libc v1.11.101/go.mod h1:wLLYgEiY2D17NbBOEp+mIJJJBGSiy7fLL4ZrGGZ+8jI= +modernc.org/libc v1.12.0/go.mod h1:2MH3DaF/gCU8i/UBiVE1VFRos4o523M7zipmwH8SIgQ= +modernc.org/libc v1.14.1/go.mod h1:npFeGWjmZTjFeWALQLrvklVmAxv4m80jnG3+xI8FdJk= +modernc.org/libc v1.14.2/go.mod h1:MX1GBLnRLNdvmK9azU9LCxZ5lMyhrbEMK8rG3X/Fe34= +modernc.org/libc v1.14.3/go.mod h1:GPIvQVOVPizzlqyRX3l756/3ppsAgg1QgPxjr5Q4agQ= +modernc.org/libc v1.14.6/go.mod h1:2PJHINagVxO4QW/5OQdRrvMYo+bm5ClpUFfyXCYl9ak= +modernc.org/libc v1.14.7/go.mod h1:f8xfWXW8LW41qb4X5+huVQo5dcfPlq7Cbny2TDheMv0= +modernc.org/libc v1.14.8/go.mod h1:9+JCLb1MWSY23smyOpIPbd5ED+rSS/ieiDWUpdyO3mo= +modernc.org/libc v1.14.10/go.mod h1:y1MtIWhwpJFpLYm6grAThtuXJKEsY6xkdZmXbRngIdo= +modernc.org/libc v1.14.11/go.mod h1:l5/Mz/GrZwOqzwRHA3abgSCnSeJzzTl+Ify0bAwKbAw= +modernc.org/libc v1.14.12/go.mod h1:fJdoe23MHu2ruPQkFPPqCpToDi5cckzsbmkI6Ez0LqQ= +modernc.org/libc v1.15.0/go.mod h1:H1OKCu+NYa9+uQG8WsP7DndMBP61I4PWH8ivWhbdoWQ= +modernc.org/libc v1.15.1/go.mod h1:CoZ2riUhSNTAP4bADwpxkLCyJK9SbbMvle0YRzkRT/I= +modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= +modernc.org/memory v1.0.5/go.mod h1:B7OYswTRnfGg+4tDH1t1OeUNnsy2viGTdME4tzd+IjM= +modernc.org/memory v1.0.6/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.0.7/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.16.0/go.mod h1:Jwe13ItpESZ+78K5WS6+AjXsUg+JvirsjN3iIDO4C8k= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/tcl v1.11.2/go.mod h1:BRzgpajcGdS2qTxniOx9c/dcxjlbA7p12eJNmiriQYo= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.3.2/go.mod h1:PEU2oK2OEA1CfzDTd+8E908qEXhC9s0MfyKp5LZsd+k= +nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/identification/interceptor/authentication.go b/identification/interceptor/authentication.go new file mode 100644 index 0000000..f6a17fc --- /dev/null +++ b/identification/interceptor/authentication.go @@ -0,0 +1,167 @@ +package interceptor + +import ( + "fmt" + "appPlatform/middleware/grocerystore" + "appPlatform/models/modelshr" + "appPlatform/overall" + "appPlatform/overall/publicmethod" + + "github.com/gin-gonic/gin" + "github.com/mitchellh/mapstructure" +) + +// 身份验证器 +func IdentificationToken() gin.HandlerFunc { + return func(c *gin.Context) { + userToken := c.Request.Header.Get("token") + randomNumber := c.Request.Header.Get("number") + ContentType := c.Request.Header.Get("Content-Type") + Origin := c.Request.Header.Get("Origin") + userAgent := c.Request.Header.Get("User-Agent") + + if ContentType == "" || userToken == "" || userAgent == "" || randomNumber == "" { + iii := publicmethod.MapOut[string]() + iii["ContentType"] = ContentType + iii["userToken"] = userToken + iii["userAgent"] = userAgent + iii["Origin"] = Origin + iii["randomNumber"] = randomNumber + publicmethod.Result(2001, "请输入关键信息数据!", c) + c.Abort() + return + } + //设定redis Key名称 + redisKey := fmt.Sprintf("Authentication:ApiAuthent_%v", userToken) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS3) + tokenInfo, isTrue := redisClient.HashGetAll(redisKey) + if isTrue != true { + iii := publicmethod.MapOut[string]() + iii["ContentType"] = ContentType + iii["userToken"] = userToken + iii["userAgent"] = userAgent + iii["Origin"] = Origin + iii["randomNumber"] = randomNumber + iii["redisKey"] = redisKey + iii["isTrue"] = isTrue + publicmethod.Result(2002, "您的指令不正确!或已经超时!请重新获取指令!", c) + c.Abort() + return + } + var validator ValidatorToken + identityErr := mapstructure.Decode(tokenInfo, &validator) + if identityErr != nil { + publicmethod.Result(2003, "对不起!身份验证失败!", c) + c.Abort() + return + } + + //密码加密 + var passWordMd5 publicmethod.Md5Encryption + passWordMd5.Md5EncryptionInit(validator.PassWord) + passWordMd5Str := passWordMd5.Md5EncryptionAlgorithm() + + var empowerUser modelshr.EmpowerUser + userErr := empowerUser.GetCont(map[string]interface{}{"userkey": validator.UserKey, "password": passWordMd5Str}, "verification_code") + if userErr != nil { + publicmethod.Result(2000, userErr, c) + return + } + + //头文件加密 + //ContentType + var ContentTypeMd5 publicmethod.Md5Encryption + ContentTypeMd5.Md5EncryptionInit(ContentType) + if empowerUser.VerificationCode != "" { + ContentTypeMd5.AppKey = empowerUser.VerificationCode + } + + fmt.Printf("ContentTypeMd5Str ----->%v\n", ContentTypeMd5) + + ContentTypeMd5Str := ContentTypeMd5.Md5EncryptionAlgorithm() + //Origin + var OriginMd5 publicmethod.Md5Encryption + OriginMd5.Md5EncryptionInit(Origin) + if empowerUser.VerificationCode != "" { + OriginMd5.AppKey = empowerUser.VerificationCode + } + originMd5Str := OriginMd5.Md5EncryptionAlgorithm() + //userAgent + var userAgentMd5 publicmethod.Md5Encryption + userAgentMd5.Md5EncryptionInit(userAgent) + if empowerUser.VerificationCode != "" { + userAgentMd5.AppKey = empowerUser.VerificationCode + } + + userAgentMd5Str := userAgentMd5.Md5EncryptionAlgorithm() + + //随机数加密 + var randomNumberMd5 publicmethod.Md5Encryption + randomNumberMd5.Md5EncryptionInit(validator.Number) + if empowerUser.VerificationCode != "" { + randomNumberMd5.AppKey = empowerUser.VerificationCode + } + + numberMd5 := randomNumberMd5.Md5EncryptionAlgorithm() + + //用户名加密 + var userKeyMd5 publicmethod.Md5Encryption + userKeyMd5.Md5EncryptionInit(validator.UserKey) + if empowerUser.VerificationCode != "" { + userKeyMd5.AppKey = empowerUser.VerificationCode + } + + userKeyMd5Str := userKeyMd5.Md5EncryptionAlgorithm() + + clearCodeToken := fmt.Sprintf("%v-%v-%v-%v-%v-%v", ContentTypeMd5Str, originMd5Str, userAgentMd5Str, numberMd5, userKeyMd5Str, passWordMd5Str) + + fmt.Printf("redisKey---->ContentTypeMd5Str:%v-originMd5Str:%v-userAgentMd5Str:%v-numberMd5:%v-userKeyMd5Str:%v-passwordMd5Str:%v\n", ContentTypeMd5Str, originMd5Str, userAgentMd5Str, numberMd5, userKeyMd5Str, passWordMd5Str) + + //token 加密 + var tokenMd5 publicmethod.Md5Encryption + tokenMd5.Md5EncryptionInit(clearCodeToken) + if empowerUser.VerificationCode != "" { + tokenMd5.AppKey = empowerUser.VerificationCode + } + fmt.Printf("tokenMd5Appk ----->%v\n", tokenMd5) + tokenMd5Str := tokenMd5.Md5EncryptionAlgorithm() + + clearTokenStr := fmt.Sprintf("%v-%v", tokenMd5Str, numberMd5) + var clearTokenMd5 publicmethod.Md5Encryption + clearTokenMd5.Md5EncryptionInit(clearTokenStr) + if empowerUser.VerificationCode != "" { + clearTokenMd5.AppKey = empowerUser.VerificationCode + } + clearTokenMd5Str := clearTokenMd5.Md5EncryptionAlgorithm() + + //提交Token转化 + submitTokenStr := fmt.Sprintf("%v-%v", userToken, randomNumber) + + var submitTokenMd5 publicmethod.Md5Encryption + submitTokenMd5.Md5EncryptionInit(submitTokenStr) + if empowerUser.VerificationCode != "" { + submitTokenMd5.AppKey = empowerUser.VerificationCode + } + submitTokenMd5Str := submitTokenMd5.Md5EncryptionAlgorithm() + + if submitTokenMd5Str != clearTokenMd5Str { + sss := publicmethod.MapOut[string]() + sss["numberMd5"] = numberMd5 + sss["submitTokenMd5Str"] = submitTokenMd5Str + sss["clearTokenMd5Str"] = clearTokenMd5Str + sss["tokenMd5Str"] = tokenMd5Str + sss["clearCodeToken"] = clearCodeToken + sss["submitTokenStr"] = submitTokenStr + sss["clearTokenStr"] = clearTokenStr + sss["userToken"] = userToken + + // tokenMd5Str, numberMd5 + // publicmethod.Result(2004, "对不起!非法令牌!不可访问系统", c) + publicmethod.Result(2004, sss, c, "对不起!非法令牌!不可访问系统") + c.Abort() + return + } + c.Set("token", validator) + c.Next() + } +} diff --git a/identification/interceptor/identity.go b/identification/interceptor/identity.go new file mode 100644 index 0000000..aaf7c9e --- /dev/null +++ b/identification/interceptor/identity.go @@ -0,0 +1,161 @@ +package interceptor + +import ( + "appPlatform/middleware/grocerystore" + "appPlatform/overall" + "appPlatform/overall/publicmethod" + "fmt" + + "github.com/flipped-aurora/gin-vue-admin/server/model/common/response" + "github.com/gin-gonic/gin" +) + +// 验证用户是否登录 +func AuthenticateUser() gin.HandlerFunc { + return func(c *gin.Context) { + userKey := c.Request.Header.Get("user-key") + userToken := c.Request.Header.Get("user-token") + userAgent := c.Request.Header.Get("User-Agent") + userAgent = overall.CONSTANT_CONFIG.Appsetup.AppKey + // fmt.Printf("userKey---------->%v----------userToken---------->%v--------userAgent---------->%v\n", userKey, userToken, userAgent) + if userKey == "" || userToken == "" || userAgent == "" { + response.FailWithDetailed(gin.H{"reload": false, "code": 300}, "未登录或非法访问", c) + c.Abort() + return + } + + redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userKey) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + userRedisToken, isTrue := redisClient.HashGetAll(redisFileKey) + if isTrue == false { + response.FailWithDetailed(gin.H{"reload": false, "code": 301}, redisFileKey, c) + c.Abort() + return + } + if userToken != userRedisToken["usertoken"] { + response.FailWithDetailed(gin.H{"reload": false, "code": 302}, "令牌不正确!非法访问!", c) + c.Abort() + return + } + myCont, myErr := publicmethod.GetUserRedisCont(userRedisToken["usernumber"]) + // var myCont modelshr.ManCont + // myErr := myCont.GetCont(map[string]interface{}{"`number`": userRedisToken["usernumber"]}) + if myErr != nil { + response.FailWithDetailed(gin.H{"reload": false, "code": 303, "data": myErr}, "登录超时!请重新登录", c) + c.Abort() + return + } + + // myContJson, _ := json.Marshal(myCont) + // fmt.Printf("myCont---------------->%v\n", string(myContJson)) + c.Set(overall.MyContJwt, myCont) + writeRedisData := publicmethod.MapOut[string]() + for i, v := range userRedisToken { + writeRedisData[i] = v + } + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, writeRedisData) + myContRedis := publicmethod.MapOut[string]() + myContRedis["id"] = myCont.Id + myContRedis["number"] = myCont.Number //员工工号 + myContRedis["name"] = myCont.Name //姓名 + myContRedis["icon"] = myCont.Icon //头像 + myContRedis["hireclass"] = myCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;) + myContRedis["emptype"] = myCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) + myContRedis["company"] = myCont.Company //入职公司 + myContRedis["maindeparment"] = myCont.MainDeparment //主部门 + myContRedis["sunmaindeparment"] = myCont.SunMainDeparment //二级主部门 + myContRedis["deparment"] = myCont.Deparment //部门 + myContRedis["adminorg"] = myCont.AdminOrg //所属行政组织 + myContRedis["teamid"] = myCont.TeamId //班组 + myContRedis["position"] = myCont.Position //职位 + myContRedis["jobclass"] = myCont.JobClass //职务分类 + myContRedis["jobid"] = myCont.JobId //职务 + myContRedis["jobleve"] = myCont.JobLeve //职务等级 + myContRedis["wechat"] = myCont.Wechat //微信UserId + myContRedis["workwechat"] = myCont.WorkWechat //企业微信UserId + myContRedis["state"] = myCont.State //状态(1:启用;2:禁用;3:删除) + myContRedis["key"] = myCont.Key //key + myContRedis["isadmin"] = myCont.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管 + myContRedis["password"] = myCont.Password //密码 + myContRedis["role"] = myCont.Role //角色 + myContRedis["idcardno"] = myCont.Idcardno //身份证号 + myContRedis["passportno"] = myCont.Passportno //护照号码 + myContRedis["globalroaming"] = myCont.Globalroaming //国际区号 + myContRedis["mobilephone"] = myCont.Mobilephone //手机号码 + myContRedis["email"] = myCont.Email //电子邮件 + myContRedis["gender"] = myCont.Gender //性别(1:男性;2:女性;3:中性) + myContRedis["birthday"] = myCont.Birthday //birthday + myContRedis["myfolk"] = myCont.Myfolk //民族 + myContRedis["nativeplace"] = myCont.Nativeplace //籍贯 + myContRedis["idcardstartdate"] = myCont.Idcardstartdate //身份证有效期开始 + myContRedis["idcardenddate"] = myCont.Idcardenddate //身份证有效期结束 + myContRedis["idcardaddress"] = myCont.Idcardaddress //身份证地址 + myContRedis["idcardIssued"] = myCont.IdcardIssued //身份证签发机关 + myContRedis["health"] = myCont.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废) + myContRedis["maritalstatus"] = myCont.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异) + myContRedis["internaltelephone"] = myCont.Internaltelephone //内线电话 + myContRedis["currentresidence"] = myCont.Currentresidence //现居住地址 + myContRedis["constellationing"] = myCont.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座) + myContRedis["isdoubleworker"] = myCont.Isdoubleworker //是否双职工(1:是;2:否) + myContRedis["isveterans"] = myCont.Isveterans //是否为退役军人(1:是;2:否) + myContRedis["veteransnumber"] = myCont.Veteransnumber //退役证编号 + myContRedis["jobstartdate"] = myCont.Jobstartdate //参加工作日期 + myContRedis["entrydate"] = myCont.Entrydate //入职日期 + myContRedis["probationperiod"] = myCont.Probationperiod //试用期 + myContRedis["planformaldate"] = myCont.Planformaldate //预计转正日期 + myContRedis["political_outlook"] = myCont.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员) + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, myCont.Number) + + // fmt.Printf("redisMyContKey------------>%v\n", redisMyContKey) + // myContRedisJson, _ := json.Marshal(myContRedis) + // fmt.Printf("myContRedisJson------------>%v\n", string(myContRedisJson)) + + redisClient.HashMsetAdd(redisMyContKey, myContRedis) + + //获取授权信息 + // powerCont, powerErr := publicmethod.GetPostOfUsEmpowerCont(myCont.AdminOrg, myCont.Position, "kpi") + // c.Set(overall.MyContJwtPower, powerCont) + // fmt.Printf("redisMyContKey------Login----->%v----->%v\n", powerErr, powerCont) + //获取权限 + var powerCont EmpowerCont + powerCont.RoleName, powerCont.PointId, powerCont.Operation, powerCont.Level = publicmethod.GetNewAccredit("kpi", myCont.Role, myCont.Key, myCont.AdminOrg, myCont.Position) + c.Set(overall.MyContJwtPower, powerCont) + c.Next() + } +} + +// 验证用户是否具备权限 +func VerifyUrl() gin.HandlerFunc { + return func(c *gin.Context) { + systemClass := c.Request.Header.Get("system-class") + context, exi := publicmethod.LoginMyCont(c) + if exi != nil { + response.FailWithDetailed(gin.H{"reload": false, "code": 401}, "对不起!你没有访问此功能的权限!", c) + c.Abort() + return + } + // 获取请求的PATH + obj := c.Request.URL.Path + // 获取请求方法 + act := c.Request.Method + + menuIdAry, menuUrl, err := publicmethod.GetPostPower(context.AdminOrg, context.Position, "kpi") + + //此功能暂时不开启 + // if err != nil || len(menuUrl) < 1 || len(menuIdAry) < 1 { + // response.FailWithDetailed(gin.H{"reload": false, "code": 402}, "对不起!你没有访问此功能的权限!", c) + // c.Abort() + // return + // } + fmt.Printf("obj---url--->%v-----------act------->%v---systemClass------------>%v------------------context-------->%v-------->menuIdAry-------->%v-------->menuUrl-------->%v-------->err-------->%v\n", obj, act, systemClass, context.Role, menuIdAry, menuUrl, err) + //此功能暂时不开启 + // if publicmethod.IsInTrue[string](obj, menuUrl) == false { + // response.FailWithDetailed(gin.H{"reload": false, "code": 403}, "对不起!你没有访问此功能的权限!", c) + // c.Abort() + // return + // } + + c.Next() + } +} diff --git a/identification/interceptor/type.go b/identification/interceptor/type.go new file mode 100644 index 0000000..d2ed4b4 --- /dev/null +++ b/identification/interceptor/type.go @@ -0,0 +1,16 @@ +package interceptor + +//验证器结构Token +type ValidatorToken struct { + Number string `json:"number"` //随机数 + UserKey string `json:"userkey"` //用户名 + PassWord string `json:"password"` //密码 +} + +//权限相关 +type EmpowerCont struct { + RoleName string `json:"roleName"` + PointId string `json:"pointid"` + Operation string `json:"operation"` + Level int `json:"level"` +} diff --git a/initialization/app/initServer.go b/initialization/app/initServer.go new file mode 100644 index 0000000..23b5ecf --- /dev/null +++ b/initialization/app/initServer.go @@ -0,0 +1,19 @@ +package app + +import ( + "net/http" + "time" + + "github.com/gin-gonic/gin" +) + +//设置服务启动 +func InitServer(port string, handler *gin.Engine) server { + return &http.Server{ + Addr: port, //监听的TCP地址,如果为空字符串会使用":http" + Handler: handler, //调用的处理器,如为nil会调用http.DefaultServeMux + ReadTimeout: 3600 * time.Second, //请求的读取操作在超时前的最大持续时间 + WriteTimeout: 3600 * time.Second, //回复的写入操作在超时前的最大持续时间 + MaxHeaderBytes: 1 << 40, //请求的头域最大长度,如为0则用DefaultMaxHeaderBytes + } +} diff --git a/initialization/app/run.go b/initialization/app/run.go new file mode 100644 index 0000000..c7e17d5 --- /dev/null +++ b/initialization/app/run.go @@ -0,0 +1,26 @@ +package app + +import ( + "fmt" + "appPlatform/initialization/initviper" + "appPlatform/initialization/route" + "appPlatform/overall" +) + +type server interface { + ListenAndServe() error +} + +// 启动服务 +func RunItem() { + //加载基础配置 + // var appConfig configApp.Server + initviper.RunViper(&overall.CONSTANT_CONFIG) + // fmt.Printf("CONSTANT_CONFIG----------->%v", overall.CONSTANT_CONFIG) + routers := route.InitialRouter() + portStr := fmt.Sprintf(":%d", overall.CONSTANT_CONFIG.Appsetup.Port) + startUp := InitServer(portStr, routers) + fmt.Printf("\n\n默认API运行地址:http://127.0.0.1%s\n", portStr) + runErr := startUp.ListenAndServe().Error() + panic(fmt.Errorf(runErr)) +} diff --git a/initialization/databaseinit/mysql.go b/initialization/databaseinit/mysql.go new file mode 100644 index 0000000..ddefb58 --- /dev/null +++ b/initialization/databaseinit/mysql.go @@ -0,0 +1,131 @@ +package databaseinit + +import ( + "appPlatform/initialization/initviper" + "appPlatform/overall" + "fmt" +) + +func LoadDatabase() { + sqlConfig := overall.CONSTANT_MYSQL + initviper.RunViper(&sqlConfig, overall.ConfigDatabaseConstant) + //开启主数据库 + overall.CONSTANT_DB_Master = sqlConfig.MasterMysql.OpenSql() + if overall.CONSTANT_DB_Master == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.MasterMysql.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.MasterMysql.Name) + } + //开启主数据库 + overall.CONSTANT_DB_AppPlatform = sqlConfig.AppPlatformDatabase.OpenSql() + if overall.CONSTANT_DB_AppPlatform == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.AppPlatformDatabase.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.AppPlatformDatabase.Name) + } + //开启微信数据库 + overall.CONSTANT_DB_Wechat = sqlConfig.WechatMysql.OpenSql() + if overall.CONSTANT_DB_Master == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.WechatMysql.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.WechatMysql.Name) + } + //开启Hr数据库 + overall.CONSTANT_DB_HR = sqlConfig.HrMysql.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.HrMysql.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.HrMysql.Name) + } + //文档属性数据库 + overall.CONSTANT_DB_FILE_BOOK = sqlConfig.FileBookDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.FileBookDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.FileBookDate.Name) + } + //错题库 + overall.CONSTANT_DB_ERROR_SUBJECT = sqlConfig.ErrorSubjectDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.ErrorSubjectDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.ErrorSubjectDate.Name) + } + //自我测验 + overall.CONSTANT_DB_MY_TEST = sqlConfig.MyTestDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.MyTestDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.MyTestDate.Name) + } + //图文信息数据库 + overall.CONSTANT_DB_IMAGES_TEST = sqlConfig.ImageTextDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.ImageTextDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.ImageTextDate.Name) + } + //计分明细数据库 + overall.CONSTANT_DB_SCORING = sqlConfig.ScoringDetailsDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.ScoringDetailsDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.ScoringDetailsDate.Name) + } + //趣味问答 + overall.CONSTANT_DB_QA = sqlConfig.QuestionsAnswersDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.QuestionsAnswersDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.QuestionsAnswersDate.Name) + } + //风云榜统计数据库 + overall.CONSTANT_DB_BILLBOARD = sqlConfig.BillboardDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.BillboardDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.BillboardDate.Name) + } + //健康上报数据库 + overall.CONSTANT_DB_HEALTH = sqlConfig.HealthReportDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.HealthReportDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.HealthReportDate.Name) + } + //绩效考核数据库 + overall.CONSTANT_DB_KPI = sqlConfig.KpiDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.KpiDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.KpiDate.Name) + } + //企业微信回调记录 + overall.CONSTANT_DB_WECHAT_LOG = sqlConfig.WechatCallBackLogDate.OpenSql() + if overall.CONSTANT_DB_HR == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.WechatCallBackLogDate.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.WechatCallBackLogDate.Name) + } + //管理档案 + overall.CONSTANT_DB_MANAGE_ARCHIVES = sqlConfig.Managearchives.OpenSql() + if overall.CONSTANT_DB_MANAGE_ARCHIVES == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.Managearchives.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.Managearchives.Name) + } + //系统权限配置数据库 + overall.CONSTANT_DB_System_Permission = sqlConfig.SystemPermission.OpenSql() + if overall.CONSTANT_DB_System_Permission == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.SystemPermission.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.SystemPermission.Name) + } + //仓储系统 + overall.CONSTANT_DB_Storage = sqlConfig.Storage.OpenSql() + if overall.CONSTANT_DB_Storage == nil { + fmt.Printf("%v数据库开启失败!\n", sqlConfig.Storage.Name) + } else { + fmt.Printf("%v数据库开启成功!\n", sqlConfig.Storage.Name) + } +} diff --git a/initialization/initviper/init_viper.go b/initialization/initviper/init_viper.go new file mode 100644 index 0000000..9dd6ba0 --- /dev/null +++ b/initialization/initviper/init_viper.go @@ -0,0 +1,55 @@ +package initviper + +import ( + "appPlatform/overall" + "fmt" + + "github.com/fsnotify/fsnotify" + "github.com/spf13/viper" +) + +// 使用viper 处理包解决配置读取问题 +func RunViper(configInfo interface{}, path ...string) *viper.Viper { + var config string + if len(path) == 0 { + config = overall.ConfigFilePathConstant + fmt.Printf("你正在使用系统默认值。配置路径为:%v\n", config) + } else { + config = path[0] + fmt.Printf("你正在使用RunViper传值。配置路径为:%v\n", config) + } + v := viper.New() + // 设置配置文件信息 + v.SetConfigFile(config) + v.SetConfigType("yaml") + //读取配置信息 + err := v.ReadInConfig() + if err != nil { + panic(fmt.Errorf("配置文件读取失败?原因:%s\n", err)) + } + // 监控配置和重新获取配置 + v.WatchConfig() + + v.OnConfigChange(func(e fsnotify.Event) { + fmt.Printf("配置文件已经更改:%v\n", e.Name) + if errSet := v.Unmarshal(&configInfo); errSet != nil { + fmt.Printf("新配置文件解析失败!系统继续使用原配置!失败原因:%s\n", errSet) + } else { + // LoadDatabase() + if e.Name == "config\\configDatabase\\database.yaml" { + LoadDatabase() + } + if e.Name == "config\\configNosql\\redis.yaml" { + LoadRedis() + } + } + }) + //解析配置映射到切片 + if errStruct := v.Unmarshal(&configInfo); errStruct != nil { + fmt.Printf("配置解析失败!原因:%s\n", errStruct) + } + // json.Marshal(configInfo) + // cfi, _ := json.Marshal(configInfo) + // fmt.Printf("============>%v\n", string(cfi)) + return v +} diff --git a/initialization/initviper/initreload.go b/initialization/initviper/initreload.go new file mode 100644 index 0000000..0fb5586 --- /dev/null +++ b/initialization/initviper/initreload.go @@ -0,0 +1,18 @@ +package initviper + +import ( + "appPlatform/overall" +) + +func LoadDatabase() { + sqlConfig := overall.CONSTANT_MYSQL + RunViper(&sqlConfig, overall.ConfigDatabaseConstant) + +} + +// 加载Redis +func LoadRedis() { + //读取Redis配置 + redisConfig := overall.CONSTANT_Redis + RunViper(&redisConfig, overall.ConfigRedisConstant) +} diff --git a/initialization/nosql/redis.go b/initialization/nosql/redis.go new file mode 100644 index 0000000..be52125 --- /dev/null +++ b/initialization/nosql/redis.go @@ -0,0 +1,19 @@ +package nosql + +import ( + "appPlatform/initialization/initviper" + "appPlatform/overall" +) + +// 加载Redis +func LoadRedis() { + //读取Redis配置 + redisConfig := overall.CONSTANT_Redis + initviper.RunViper(&redisConfig, overall.ConfigRedisConstant) + overall.CONSTANT_REDIS0 = redisConfig.MasterRedis.OpenRedis() + overall.CONSTANT_REDIS1 = redisConfig.MasterRedis1.OpenRedis() + overall.CONSTANT_REDIS2 = redisConfig.MasterRedis2.OpenRedis() + overall.CONSTANT_REDIS3 = redisConfig.MasterRedis3.OpenRedis() + overall.CONSTANT_REDIS4 = redisConfig.MasterRedis4.OpenRedis() + overall.CONSTANT_REDIS5 = redisConfig.MasterRedis5.OpenRedis() +} diff --git a/initialization/route/initRoute.go b/initialization/route/initRoute.go new file mode 100644 index 0000000..80d1d1d --- /dev/null +++ b/initialization/route/initRoute.go @@ -0,0 +1,59 @@ +package route + +import ( + "appPlatform/apirouter" + "appPlatform/identification/interceptor" + + "github.com/gin-gonic/gin" +) + +// 初始化主路由 +func InitialRouter() *gin.Engine { + var router = gin.Default() + + //app默认相应 + appLoadRouterGroup := router.Group("") + { + + // 跨域设置 + // router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开 + //app默认相应 + appLoadRouterGroup.GET("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + appLoadRouterGroup.POST("/", func(c *gin.Context) { + c.JSON(0, "通讯成功!") + }) + //实验路由 + + shiyanApi := apirouter.RouterGroupEntry.ShiyanApi + { + shiyanApi.RouterGroup(appLoadRouterGroup) + } + + } + + //验证身份接口 鉴权Url(主要应用端使用) + VerifyIdentity := router.Group("") + VerifyIdentity.Use(interceptor.AuthenticateUser()).Use(interceptor.VerifyUrl()) + { + + //主体内容 + version1HonorsApi := apirouter.RouterGroupEntry.UserRouter + version1HonorsApi.RouterGroupPc(VerifyIdentity) + + } + //验证身份接口 无需鉴权Url(主要web端使用) + VerifyIdentityWeb := router.Group("") + VerifyIdentityWeb.Use(interceptor.AuthenticateUser()) + { + + } + //Token身份验证 + VerifyIdentityToken := router.Group("") + VerifyIdentityToken.Use(interceptor.IdentificationToken()) + { + + } + return router +} diff --git a/main.go b/main.go new file mode 100644 index 0000000..2952362 --- /dev/null +++ b/main.go @@ -0,0 +1,17 @@ +package main + +import ( + "appPlatform/initialization/app" + "appPlatform/initialization/databaseinit" + "appPlatform/initialization/nosql" +) + +func main() { + //加载数据库 + databaseinit.LoadDatabase() + //加载Redis + nosql.LoadRedis() + //启动定时任务 + // scheduledtask.TimeTask() + app.RunItem() +} diff --git a/middleware/cross_domain.go b/middleware/cross_domain.go new file mode 100644 index 0000000..f237298 --- /dev/null +++ b/middleware/cross_domain.go @@ -0,0 +1,26 @@ +package middleware + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +// 处理跨域请求,支持options访问 +func CrossDomainRequest() gin.HandlerFunc { + return func(c *gin.Context) { + method := c.Request.Method + origin := c.Request.Header.Get("Origin") + c.Header("Access-Control-Allow-Origin", origin) + c.Header("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id") + c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS,DELETE,PUT") + c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type") + c.Header("Access-Control-Allow-Credentials", "true") + // 放行所有OPTIONS方法 + if method == "OPTIONS" { + c.AbortWithStatus(http.StatusNoContent) + } + // 处理请求 + c.Next() + } +} diff --git a/middleware/grocerystore/redis.go b/middleware/grocerystore/redis.go new file mode 100644 index 0000000..16c2b35 --- /dev/null +++ b/middleware/grocerystore/redis.go @@ -0,0 +1,415 @@ +package grocerystore + +import ( + "appPlatform/overall" + "context" + "fmt" + "time" + + "github.com/go-redis/redis/v8" +) + +// redis 基础设定 +type RedisStoreType struct { + Expiration time.Duration + PreKey string + Context context.Context + RedisDb *redis.Client +} + +// 启动redis +func RunRedis(redisClient *redis.Client) *RedisStoreType { + var redisStoreType RedisStoreType + redisStoreType.Expiration = time.Second * 300 + redisStoreType.PreKey = fmt.Sprintf("%v:", overall.CONSTANT_CONFIG.RedisPrefixStr.PreFix) + redisStoreType.Context = context.Background() + redisStoreType.RedisDb = redisClient + return &redisStoreType +} + +// 设置键前缀 +func (r *RedisStoreType) SetRedisPrefix(prefix string) { + r.PreKey = prefix +} + +// 设置过期时间 +func (r *RedisStoreType) SetRedisTime(timeDate int64) { + r.Expiration = time.Second * time.Duration(timeDate) +} + +// 设置字符串 +func (r *RedisStoreType) Set(key string, value string) bool { + err := r.RedisDb.Set(r.Context, r.PreKey+key, value, r.Expiration).Err() + if err != nil { + return false + } + return true +} + +// 获取字符串 +func (r *RedisStoreType) Get(key string) (bool, string) { + err := r.RedisDb.Get(r.Context, r.PreKey+key) + if err.Err() != nil { + return false, "" + } + return true, err.Val() +} + +// 删除键 +func (r *RedisStoreType) DelKey(key string) bool { + err := r.RedisDb.Del(r.Context, r.PreKey+key).Err() + if err != nil { + return false + } + return true +} + +//哈希操作 +/* +获取单个哈希键值 +@hashName 集合名称 +@hashKey 哈希键 +callback + errs 状态 + hashVal 获得值 +*/ +func (r *RedisStoreType) HashGet(hashName, hashKey string) (errs bool, hashVal string) { + err := r.RedisDb.HGet(r.Context, r.PreKey+hashName, hashKey) + if err.Err() != nil { + return false, "" + } + return true, err.Val() +} + +/* +为哈希表中的字段赋值 。 单一设置 +@hashName 集合名称 +@hashKey 哈希键 +@hashVal 要添加的值 +*/ +func (r *RedisStoreType) HashSet(hashName, hashKey, hashVal string) bool { + err := r.RedisDb.HSet(r.Context, r.PreKey+hashName, hashKey, hashVal).Err() + if err != nil { + return false + } + if r.Expiration == 0 { + r.RedisDb.Persist(r.Context, r.PreKey+hashName) + } else { + r.RedisDb.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + } + // global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + return true +} + +/* +同时将多个 field-value (字段-值)对设置到哈希表中。 +@hashName 集合名称 +@hashVal 要添加的键与值 +*/ +func (r *RedisStoreType) HashMsetAdd(hashName string, hashVal map[string]interface{}) bool { + // rdb := RedisInit() + err := r.RedisDb.HMSet(r.Context, r.PreKey+hashName, hashVal).Err() + // fmt.Printf("错误sss=========》%v=====2====》%v\n", err, hashVal) + // err := rdb.HMSet(ctx, "userfg", hashVal).Err() + if err != nil { + return false + } + if r.Expiration == 0 { + r.RedisDb.Persist(r.Context, r.PreKey+hashName) + } else { + r.RedisDb.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + } + + return true +} +func (r *RedisStoreType) HashMsetAddinterface(hashName string, hashVal interface{}) bool { + // rdb := RedisInit() + err := r.RedisDb.HMSet(r.Context, r.PreKey+hashName, hashVal).Err() + // fmt.Printf("错误sss=========》%v=====2====》%v\n", err, hashVal) + // err := rdb.HMSet(ctx, "userfg", hashVal).Err() + if err != nil { + return false + } + if r.Expiration == 0 { + r.RedisDb.Persist(r.Context, r.PreKey+hashName) + } else { + r.RedisDb.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + } + + return true +} +func (r *RedisStoreType) HashMsetAddAry(hashName string, hashVal []map[string]interface{}) bool { + // rdb := RedisInit() + err := r.RedisDb.HMSet(r.Context, r.PreKey+hashName, hashVal).Err() + // err := rdb.HMSet(ctx, "userfg", hashVal).Err() + if err != nil { + return false + } + if r.Expiration == 0 { + r.RedisDb.Persist(r.Context, r.PreKey+hashName) + } else { + r.RedisDb.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + } + // global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration) + // fmt.Printf("错误sss=========》%v\n", hashVal) + return true +} + +/* +返回哈希表中,所有的字段和值。 +@hashName 集合名称 +@hashKey 哈希键 +*/ +func (r *RedisStoreType) HashGetAll(hashName string) (map[string]string, bool) { + // rdb := RedisInit() + // fmt.Printf("strKEy:===>%v\n", r.PreKey+hashName) + val, err := r.RedisDb.HGetAll(r.Context, r.PreKey+hashName).Result() + if err != nil { + return val, false + } + if len(val) == 0 { + return val, false + } + return val, true +} + +//Redis 列表(List) + +/* +* +Linsert 命令用于在列表的元素前或者后插入元素。当指定元素不存在于列表中时,不执行任何操作。 +当列表不存在时,被视为空列表,不执行任何操作。 +如果 key 不是列表类型,返回一个错误。 +@key 列表 +@op 插入状态 (1:在pivot之后;2:在pivot之前) +@pivot 定位值 +@value 要插入值 +*/ +func (r *RedisStoreType) Linsert(key string, op int, pivot, value interface{}) (int64, bool) { + BeforeOrAfter := "BEFORE" + if op != 1 { + BeforeOrAfter = "AFTER" + } + linsert, linsertErr := r.RedisDb.LInsert(r.Context, key, BeforeOrAfter, pivot, value).Result() + if linsertErr != nil { + return 0, false + } + return linsert, true +} + +/* +* +Lindex 命令用于通过索引获取列表中的元素。你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 +@key 列表 +@index 索引 +*/ +func (r *RedisStoreType) Lindex(key string, index int64) (val string, err error) { + val, err = r.RedisDb.LIndex(r.Context, key, index).Result() + return +} + +/* +* +Llen 命令用于返回列表的长度。 如果列表 key 不存在,则 key 被解释为一个空列表,返回 0 。 如果 key 不是列表类型,返回一个错误。 +@key 列表 +*/ +func (r *RedisStoreType) Llen(key string) (val int64, err error) { + val, err = r.RedisDb.LLen(r.Context, key).Result() + return +} + +/* +* +Lpop 命令用于移除并返回列表的第一个元素。 +@key 列表 +*/ +func (r *RedisStoreType) Lpop(key string) (val string, err error) { + val, err = r.RedisDb.LPop(r.Context, key).Result() + return +} + +/* +* +Lpush 命令将一个或多个值插入到列表头部。 如果 key 不存在,一个空列表会被创建并执行 LPUSH 操作。 当 key 存在但不是列表类型时,返回一个错误。 +@key 列表 +@value 要插入的字符串 +*/ +func (r *RedisStoreType) Lpush(key string, value ...interface{}) (val int64, err error) { + val, err = r.RedisDb.LPush(r.Context, key, value).Result() + return +} + +/* +* +Lpushx 将一个值插入到已存在的列表头部,列表不存在时操作无效。 +@key 列表 +@value 要插入的字符串 +*/ +func (r *RedisStoreType) Lpushx(key, value string) (val int64, err error) { + val, err = r.RedisDb.LPushX(r.Context, key, value).Result() + return +} + +/* +* +Lrange 返回列表中指定区间内的元素,区间以偏移量 START 和 END 指定。 其中 0 表示列表的第一个元素, 1 表示列表的第二个元素,以此类推。 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 +@key 列表 +@start 起始值 +@stop 结束值 +*/ +func (r *RedisStoreType) Lrange(key string, start, stop int64) (val []string, err error) { + val, err = r.RedisDb.LRange(r.Context, key, start, stop).Result() + return +} + +/* +* +Lrem 根据参数 COUNT 的值,移除列表中与参数 VALUE 相等的元素。 +COUNT 的值可以是以下几种: + + count > 0 : 从表头开始向表尾搜索,移除与 VALUE 相等的元素,数量为 COUNT 。 + count < 0 : 从表尾开始向表头搜索,移除与 VALUE 相等的元素,数量为 COUNT 的绝对值。 + count = 0 : 移除表中所有与 VALUE 相等的值。 + +@start = COUNT +@key 列表 +*/ +func (r *RedisStoreType) Lrem(key string, start int64, value ...interface{}) (val int64, err error) { + val, err = r.RedisDb.LRem(r.Context, key, start, value).Result() + return +} + +/* +* +Redis Lset 通过索引来设置元素的值。 + +当索引参数超出范围,或对一个空列表进行 LSET 时,返回一个错误。 +@key 列表 +@indexes 索引值 +*/ +func (r *RedisStoreType) Lset(key string, indexes int64, value ...interface{}) (val string, err error) { + val, err = r.RedisDb.LSet(r.Context, key, indexes, value).Result() + return +} + +/* +* +Ltrim 对一个列表进行修剪(trim),就是说,让列表只保留指定区间内的元素,不在指定区间之内的元素都将被删除。 + +下标 0 表示列表的第一个元素,以 1 表示列表的第二个元素,以此类推。 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 +@key 列表 +@start 起始值 +@stop 结束值 +*/ +func (r *RedisStoreType) Ltrim(key string, start, stop int64) (val string, err error) { + val, err = r.RedisDb.LTrim(r.Context, key, start, stop).Result() + return +} + +/* +* +Rpop 命令用于移除列表的最后一个元素,返回值为移除的元素。 +@key 列表 +*/ +func (r *RedisStoreType) Rpop(key string) (val string, err error) { + val, err = r.RedisDb.RPop(r.Context, key).Result() + return +} + +/* +* +Rpoplpush 命令用于移除列表的最后一个元素,并将该元素添加到另一个列表并返回。 +@sourceKey 源列表 +@newKey 目标列表 +*/ +func (r *RedisStoreType) Rpoplpush(sourceKey, newKey string) (val string, err error) { + val, err = r.RedisDb.RPopLPush(r.Context, sourceKey, newKey).Result() + return +} + +/* +* +Rpush 命令用于将一个或多个值插入到列表的尾部(最右边)。 +如果列表不存在,一个空列表会被创建并执行 RPUSH 操作。 当列表存在但不是列表类型时,返回一个错误。 +@key 列表 +@value 要插入的字符串 +*/ +func (r *RedisStoreType) Rpush(key string, value ...interface{}) (val int64, err error) { + val, err = r.RedisDb.RPush(r.Context, key, value).Result() + return +} + +/* +* +Rpushx 命令用于将一个值插入到已存在的列表尾部(最右边)。如果列表不存在,操作无效。 +@key 列表 +@value 要插入的字符串 +*/ +func (r *RedisStoreType) Rpushx(key string, value ...interface{}) (val int64, err error) { + val, err = r.RedisDb.RPushX(r.Context, key, value).Result() + return +} + +/* +* +Blpop 命令移出并获取列表的第一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。 +@key 列表 +*/ +func (r *RedisStoreType) Blpop(key string) (val []string, err error) { + val, err = r.RedisDb.BLPop(r.Context, r.Expiration, key).Result() + return +} + +/* +* +Brpop 命令移出并获取列表的最后一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。 +@key 列表 +*/ +func (r *RedisStoreType) Brpop(key string) (val []string, err error) { + val, err = r.RedisDb.BRPop(r.Context, r.Expiration, key).Result() + return +} + +/* +* +Brpoplpush 命令从列表中取出最后一个元素,并插入到另外一个列表的头部; 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。 +@source 源列表 +@destination 目标列表 +*/ +func (r *RedisStoreType) Brpoplpush(source, destination string) (val string, err error) { + val, err = r.RedisDb.BRPopLPush(r.Context, source, destination, r.Expiration).Result() + return +} + +/* +Redis 键(key) +Redis 键命令用于管理 redis 的键。 +*/ + +/* +Redis SCAN 命令 +Redis Scan 命令用于迭代数据库中的数据库键。 + +SCAN 命令是一个基于游标的迭代器,每次被调用之后, 都会向用户返回一个新的游标, 用户在下次迭代时需要使用这个新游标作为 SCAN 命令的游标参数, 以此来延续之前的迭代过程。 + +SCAN 返回一个包含两个元素的数组, 第一个元素是用于进行下一次迭代的新游标, 而第二个元素则是一个数组, 这个数组中包含了所有被迭代的元素。如果新游标返回 0 表示迭代已结束。 + +相关命令: + + SSCAN 命令用于迭代集合键中的元素。 + HSCAN 命令用于迭代哈希键中的键值对。 + ZSCAN 命令用于迭代有序集合中的元素(包括元素成员和元素分值)。 +*/ + +func (r *RedisStoreType) Scan(cursor uint64, match string, count int64) (keys []string, cursores uint64, err error) { + keys, cursores, err = r.RedisDb.Scan(r.Context, cursor, match, count).Result() + return +} + +/* +*Keys 命令用于查找所有符合给定模式 pattern 的 key 。。 + */ +func (r *RedisStoreType) Keys(key string) (val []string, err error) { + val, err = r.RedisDb.Keys(r.Context, key).Result() + return +} diff --git a/middleware/snowflake/snowflake.go b/middleware/snowflake/snowflake.go new file mode 100644 index 0000000..18ac34b --- /dev/null +++ b/middleware/snowflake/snowflake.go @@ -0,0 +1,38 @@ +package snowflake + +import ( + "errors" + "time" +) + +//雪花算法 +func NewWorker(workerId int64) (*Worker, error) { + if workerId < 0 || workerId > workerMax { + return nil, errors.New("工作机器的ID超出范围!") + } + // 生成一个新节点 + return &Worker{ + timestamp: 0, + workerId: workerId, + number: 0, + }, nil +} + +func (w *Worker) GetId() int64 { + w.mu.Lock() + defer w.mu.Unlock() + now := time.Now().UnixNano() / 1e6 + if w.timestamp == now { + w.number++ + if w.number > numberMax { + for now <= w.timestamp { + now = time.Now().UnixNano() / 1e6 + } + } + } else { + w.number = 0 + w.timestamp = now + } + ID := int64((now-startTime)< 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *ArchivesType) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_Master.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelbookimg/bookattribute.go b/models/modelbookimg/bookattribute.go new file mode 100644 index 0000000..41a36b0 --- /dev/null +++ b/models/modelbookimg/bookattribute.go @@ -0,0 +1,46 @@ +package modelbookimg + +import ( + "appPlatform/overall" + "strings" +) + +// 文档属性 +type BookAttribute struct { + Id int64 `json:"id" gorm:"primaryKey;column:b_id;type:bigint unsigned;not null;auto_increment;comment:ID"` + FileId int64 `json:"fileid" gorm:"column:b_file_id;type:bigint unsigned;not null;default:0;comment:文档ID"` + UserId int64 `json:"userid" gorm:"column:b_userid;type:bigint unsigned;not null;default:0;comment:阅读人ID"` + Time int64 `json:"time" gorm:"column:b_time;type:bigint unsigned;not null;default:0;comment:阅读时间"` + Type int `json:"type" gorm:"column:b_type;type:tinyint unsigned;not null;default:1;comment:类型 (1:阅读量;2:收藏数;3:赞;4:踩)"` + Stater int `json:"stater" gorm:"column:b_stater;type:tinyint unsigned;not null;default:1;comment:状态(1:有效;2:无效)"` + EiteTime int64 `json:"eitetime" gorm:"column:b_eite_time;type:bigint unsigned;not null;default:0;comment:编辑时间"` + Source int `json:"source" gorm:"column:b_source;type:tinyint unsigned;not null;default:1;comment:来源(1:文档类;2:文档类评论;3:问题;4:问题答案;5:问题答案评论)"` +} + +func (ba *BookAttribute) TableName() string { + return "bookattribute" +} + +// 编辑文档属性内容 +func (cont *BookAttribute) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取文档属性内容 +func (cont *BookAttribute) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_FILE_BOOK.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *BookAttribute) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelbookimg/discussmsg.go b/models/modelbookimg/discussmsg.go new file mode 100644 index 0000000..a18fa82 --- /dev/null +++ b/models/modelbookimg/discussmsg.go @@ -0,0 +1,48 @@ +package modelbookimg + +import ( + "appPlatform/overall" + "strings" +) + +// 评论列表 +type DiscussMsg struct { + Id int64 `json:"id" gorm:"primaryKey;column:dis_id;type:bigint unsigned;not null;auto_increment;comment:ID"` + FileId int64 `json:"fileid" gorm:"column:dis_file_id;type:bigint unsigned;not null;default:0;comment:文档ID"` + UserId int64 `json:"userid" gorm:"column:dis_user_id;type:bigint unsigned;not null;default:0;comment:评论人ID"` + Prent int64 `json:"prent" gorm:"column:dis_prent;type:bigint unsigned;not null;default:0;comment:归属(0:评论源)"` + Cont string `json:"cont" gorm:"column:dis_cont;type:text;comment:评论内容"` + Time int64 `json:"time" gorm:"column:dis_time;type:bigint unsigned;default:0;comment:评论时间"` + Stater int `json:"stater" gorm:"column:dis_stater;type:tinyint unsigned;not null;default:1;comment:状态(1:审核;2:发布;3:下架;4:删除)"` + Source int `json:"source" gorm:"column:dis_source;type:tinyint unsigned;not null;default:1;comment:来源(1:文档类;2:文档类评论;3:问题;4:问题答案;5:问题答案评论)"` + UserJson string `json:"userjson" gorm:"column:dis_user_json;type:mediumtext;comment:评论人基本信息"` + EiteTime int64 `json:"eitetime" gorm:"column:dis_eite_time;type:bigint unsigned;not null;default:0;comment:修改时间"` +} + +func (dm *DiscussMsg) TableName() string { + return "discussmsg" +} + +// 编辑评论列表内容 +func (cont *DiscussMsg) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取评论列表内容 +func (cont *DiscussMsg) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_FILE_BOOK.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *DiscussMsg) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelbookimg/graphicform.go b/models/modelbookimg/graphicform.go new file mode 100644 index 0000000..f20955a --- /dev/null +++ b/models/modelbookimg/graphicform.go @@ -0,0 +1,72 @@ +package modelbookimg + +import ( + "appPlatform/overall" + "strings" +) + +// 图文信息表 +type GraphicForm struct { + Id int64 `json:"id" gorm:"primaryKey;column:g_id;type:bigint unsigned;not null;comment:ID"` + Title string `json:"title" gorm:"column:g_title;type:varchar(255);comment:标题"` + Key string `json:"key" gorm:"column:g_key;type:varchar(255);comment:关键字"` + Describe string `json:"describe" gorm:"column:g_describe;type:mediumtext;comment:描述"` + Parent int64 `json:"parent" gorm:"column:g_parent;type:bigint unsigned;not null;default:0;comment:父级"` + ParentSun int64 `json:"parentsun" gorm:"column:g_parent_sun;type:bigint unsigned;not null;default:0;comment:父类"` + Source int `json:"source" gorm:"column:g_source;type:tinyint unsigned;default:1;not null;comment:文档来源(1:原创;2:转载)"` + SourceUrl string `json:"sourceurl" gorm:"column:g_source_url;type:varchar(255);comment:转载地址"` + Thumbnail string `json:"thumbnail" gorm:"column:g_thumbnail;type:varchar(255);comment:缩略图"` + Sort int64 `json:"sort" gorm:"column:g_sort;type:bigint unsigned;default:50;not null;comment:排序"` + Comment int `json:"comment" gorm:"column:g_comment;type:tinyint unsigned;default:1;not null;comment:评论设置(1:允许评论;2:禁止评论)"` + VisitStrat int `json:"visitstrat" gorm:"column:g_visit_strat;type:tinyint unsigned;default:1;not null;comment:访问权限(1:公开;2:分厂;3:工段;4:自定义)"` + State int `json:"state" gorm:"column:g_state;type:tinyint unsigned;default:1;not null;comment:状态(1:草稿;2:发表;3:下架;4:删除)"` + AddTime int64 `json:"addtime" gorm:"column:g_add_time;type:bigint unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eite" gorm:"column:g_eite_time;type:bigint;not null;comment:修改时间"` + UserKey int64 `json:"userkey" gorm:"column:g_user_key;type:bigint;comment:编辑人员"` + BfId int64 `json:"bfid" gorm:"column:g_bf_id;type:bigint unsigned;default:0;not null;comment:分厂"` + WsId int64 `json:"wsid" gorm:"column:g_ws_id;type:bigint unsigned;default:0;not null;comment:工段"` + Team int64 `json:"team" gorm:"column:g_team;type:bigint unsigned;default:0;not null;comment:班组"` + DownLoadState int `json:"downloadstate" gorm:"column:g_download_state;type:tinyint unsigned;default:1;not null;comment:是否允许下载(1:允许;2:禁止)"` + Read int `json:"read" gorm:"column:g_read;type:int unsigned;default:0;not null;comment:阅读量"` + ComSum int `json:"comsum" gorm:"column:g_com_sum;type:int unsigned;default:0;not null;comment:评论数"` + CollectionSum int `json:"collectionsum" gorm:"column:g_collection_sum;type:int unsigned;default:0;not null;comment:收藏数"` + Likes int `json:"likes" gorm:"column:g_likes;type:int unsigned;default:0;not null;comment:点赞数"` + Recommend int `json:"recommend" gorm:"column:g_recommend;type:tinyint unsigned;default:2;not null;comment:推荐(1:推荐,2:不推荐)"` + Content string `json:"content" gorm:"column:g_content;type:longtext;comment:图文详情"` + StepOn int `json:"stepon" gorm:"column:g_step_on;type:int unsigned;default:0;not null;comment:踩数量"` + Range string `json:"range" gorm:"column:g_range;type:mediumtext;comment:自定义可见范围"` + WriteBfid string `json:"writebfid" gorm:"column:g_write_bfid;type:bigint unsigned;default:0;not null;comment:写入分厂"` + TextName string `json:"textname" gorm:"column:g_text_name;type:varchar(255);default:'';comment:正文文档名称"` + TestUrl string `json:"testurl" gorm:"column:g_test_url;type:varchar(255);default:'';comment:正文文档URL"` + PhysicsPath string `json:"physicspath" gorm:"column:g_physics_path;type:varchar(255);default:'';comment:物理地址"` + WriteGroup int64 `json:"writegroup" gorm:"column:g_write_group;type:bigint unsigned;default:3;not null;comment:写入人员组织"` + OuterLink string `json:"outerlink" gorm:"column:g_outer_link;type:varchar(255);default:'';comment:外部链接"` +} + +func (gf *GraphicForm) TableName() string { + return "graphicform" +} + +// 编辑图文信息内容 +func (cont *GraphicForm) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_IMAGES_TEST.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取图文信息内容 +func (cont *GraphicForm) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_IMAGES_TEST.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *GraphicForm) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_IMAGES_TEST.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelbookimg/reporting.go b/models/modelbookimg/reporting.go new file mode 100644 index 0000000..e82f3a9 --- /dev/null +++ b/models/modelbookimg/reporting.go @@ -0,0 +1,46 @@ +package modelbookimg + +import ( + "appPlatform/overall" + "strings" +) + +// 举报 +type Reporting struct { + Id int64 `json:"id" gorm:"primaryKey;column:r_id;type:bigint unsigned;not null;auto_increment;comment:ID"` + UserKey int64 `json:"userkey" gorm:"column:r_user_key;type:bigint unsigned;not null;default:0;comment:编辑人员"` + UserJson string `json:"userjson" gorm:"column:r_user_json;type:mediumtext;comment:举报人基本信息"` + Content string `json:"content" gorm:"column:r_content;type:mediumtext;comment:举报内容"` + AnsId int64 `json:"ansid" gorm:"column:r_ans_id;type:bigint unsigned;not null;comment:被举报答案ID"` + AnsCont string `json:"anscont" gorm:"column:r_ans_cont;type:mediumtext;comment:被举报内容"` + Time int64 `json:"time" gorm:"column:r_time;type:bigint unsigned;default:0;not null;comment:举报时间"` + State int `json:"state" gorm:"column:r_state;type:tinyint unsigned;default:1;not null;comment:状态(1:审核,2:有效;3:无效;4:删除)"` +} + +func (r *Reporting) TableName() string { + return "reporting" +} + +// 编辑举报内容 +func (cont *Reporting) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取举报内容 +func (cont *Reporting) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_FILE_BOOK.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *Reporting) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelbookimg/searchlog.go b/models/modelbookimg/searchlog.go new file mode 100644 index 0000000..18a8da7 --- /dev/null +++ b/models/modelbookimg/searchlog.go @@ -0,0 +1,44 @@ +package modelbookimg + +import ( + "appPlatform/overall" + "strings" +) + +// 关键词记录 +type SearchLog struct { + Id int64 `json:"id" gorm:"primaryKey;column:sea_id;type:bigint unsigned;not null;auto_increment;comment:ID"` + Cont string `json:"cont" gorm:"column:sea_cont;type:varchar(255);comment:关键词"` + UserKey int64 `json:"userkey" gorm:"column:sea_user_key;type:bigint unsigned;not null;default:0;comment:搜索人"` + Num int `json:"num" gorm:"column:sea_num;type:int unsigned;not null;default:0;comment:搜索次数"` + Time int64 `json:"time" gorm:"column:sea_time;type:bigint unsigned;not null;default:0;comment:时间"` + State int `json:"state" gorm:"column:sea_state;type:tinyint unsigned;not null;default:1;comment:1:启用,2:删除"` +} + +func (sl *SearchLog) TableName() string { + return "reporting" +} + +// 编辑关键词记录内容 +func (cont *SearchLog) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取关键词记录内容 +func (cont *SearchLog) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_FILE_BOOK.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *SearchLog) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelbookimg/traceing.go b/models/modelbookimg/traceing.go new file mode 100644 index 0000000..79c7524 --- /dev/null +++ b/models/modelbookimg/traceing.go @@ -0,0 +1,49 @@ +package modelbookimg + +import ( + "appPlatform/overall" + "strings" +) + +// 追问 +type Traceing struct { + Id int64 `json:"id" gorm:"primaryKey;column:tr_id;type:bigint unsigned;not null;auto_increment;comment:ID"` + AnsId int64 `json:"ansid" gorm:"column:tr_ans_id;type:bigint unsigned;not null;default:0;comment:答案ID"` + UserKey int64 `json:"userkey" gorm:"column:tr_user_key;type:bigint unsigned;not null;default:0;comment:追问人Key"` + UserJson string `json:"userjson" gorm:"column:tr_user_json;type:mediumtext;comment:追问人基本信息"` + Cont string `json:"cont" gorm:"column:tr_cont;type:mediumtext;comment:内容"` + Type int `json:"type" gorm:"column:tr_type;type:tinyint unsigned;not null;default:1;comment:类型(1:追问;2:追答)"` + State int `json:"state" gorm:"column:tr_state;type:tinyint unsigned;not null;default:1;comment:状态(1:启用;2:禁用)"` + Time int64 `json:"time" gorm:"column:tr_time;type:bigint unsigned;not null;default:0;comment:时间"` + EiteTime int64 `json:"eitetime" gorm:"column:tr_eite_time;type:bigint unsigned;not null;default:0;comment:编辑时间"` + AnsUserKey int64 `json:"ansuserkey" gorm:"column:tr_ans_user_key;type:bigint unsigned;not null;default:0;comment:问题回答人"` + IsRes int `json:"isres" gorm:"column:tr_is_res;type:tinyint unsigned;not null;default:1;comment:是否已经解决(1:未解决;2:已解决)"` +} + +func (ri *Traceing) TableName() string { + return "traceing" +} + +// 编辑追问内容 +func (cont *Traceing) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取追问内容 +func (cont *Traceing) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_FILE_BOOK.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *Traceing) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_FILE_BOOK.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelshonory/carrier_type.go b/models/modelshonory/carrier_type.go new file mode 100644 index 0000000..02139d0 --- /dev/null +++ b/models/modelshonory/carrier_type.go @@ -0,0 +1,42 @@ +package modelshonory + +import ( + "appPlatform/overall" + "strings" +) + +// 载体类型 +type CarrierType struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:荣誉名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (CarrierType *CarrierType) TableName() string { + return "carrier_type" +} + +// 编辑载体类型内容 +func (cont *CarrierType) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取载体类型内容 +func (cont *CarrierType) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *CarrierType) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelshonory/honorary_archives.go b/models/modelshonory/honorary_archives.go new file mode 100644 index 0000000..de6b058 --- /dev/null +++ b/models/modelshonory/honorary_archives.go @@ -0,0 +1,49 @@ +package modelshonory + +import ( + "appPlatform/overall" + "strings" +) + +// 荣誉档案 +type HonoraryArchives struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:荣誉名称"` + IssuingUnit string `json:"issuingunit" gorm:"column:issuing_unit;type:varchar(255) unsigned;default:'';not null;comment:发放单位"` + Carrier int64 `json:"carrier" gorm:"column:carrier;type:bigint(20) unsigned;default:0;not null;comment:载体"` + AwardTime int64 `json:"awardtime" gorm:"column:award_time;type:bigint(20) ;default:0;not null;comment:获奖时间"` + TermOfValidity int64 `json:"termvalidity" gorm:"column:term_of_validity;type:bigint(20) unsigned;default:0;not null;comment:有效期限"` + Contet string `json:"contet" gorm:"column:contet;type:mediumtext unsigned;comment:备注"` + Organization int64 `json:"organization" gorm:"column:organization;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"` + Userid int64 `json:"userid" gorm:"column:userid;type:bigint(20) unsigned;default:0;not null;comment:归属人员"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (HonoraryArchives *HonoraryArchives) TableName() string { + return "honorary_archives" +} + +// 编辑荣誉档案内容 +func (cont *HonoraryArchives) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取荣誉档案内容 +func (cont *HonoraryArchives) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *HonoraryArchives) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelshonory/photos_gallery.go b/models/modelshonory/photos_gallery.go new file mode 100644 index 0000000..6f663d7 --- /dev/null +++ b/models/modelshonory/photos_gallery.go @@ -0,0 +1,47 @@ +package modelshonory + +import ( + "appPlatform/overall" + "strings" +) + +// 图片库 +type PhotosGallery struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Url string `json:"url" gorm:"column:url;type:varchar(255) unsigned;default:'';not null;comment:图片地址"` + ImgPath string `json:"imgpath" gorm:"column:img_path;type:varchar(255) unsigned;default:'';not null;comment:物理地址"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:文档名称"` + FileSize string `json:"filesize" gorm:"column:file_size;type:varchar(255) unsigned;default:'';not null;comment:文档大小"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + AscriptionId int64 `json:"ascriptionid" gorm:"column:ascription_id;type:bigint(20) unsigned;default:0;not null;comment:归属"` + AscriptionDataSheet string `json:"ascriptiondatasheet" gorm:"column:ascription_data_sheet;type:varchar(255) unsigned;default:'';not null;comment:归属拿个数据表"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (PhotosGallery *PhotosGallery) TableName() string { + return "photos_gallery" +} + +// 编辑图片库内容 +func (cont *PhotosGallery) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取图片库内容 +func (cont *PhotosGallery) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_MANAGE_ARCHIVES.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 删除内容 +func (cont *PhotosGallery) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_MANAGE_ARCHIVES.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelshr/administrative_organization.go b/models/modelshr/administrative_organization.go new file mode 100644 index 0000000..6243582 --- /dev/null +++ b/models/modelshr/administrative_organization.go @@ -0,0 +1,63 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 行政组织 +type AdministrativeOrganization struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"` + OrganizationType int64 `json:"organizationtype" gorm:"column:organization_type;type:bigint(20) unsigned;default:0;not null;comment:行政组织类型"` + Abbreviation string `json:"abbreviation" gorm:"column:abbreviation;type:varchar(255) unsigned;default:'';not null;comment:行政组织简称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + WechatOrganizationId int64 `json:"wechatorganizationid" gorm:"column:wechat_organization_id;type:bigint(20) unsigned;default:0;not null;comment:微信组织架构对照码"` + SuperiorSun string `json:"superiorsun" gorm:"column:superior_sun;type:mediumtext;comment:级联ID"` + Schoole int64 `json:"schoole" gorm:"column:schoole;type:bigint(20) unsigned;default:0;not null;comment:原知行学院对照码"` + KingdeeId string `json:"kingdeeid" gorm:"column:kingdeeid;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` + IsPower int `json:"ispower" gorm:"column:ispower;type:int(1) unsigned;default:2;not null;comment:是否为实权部门"` + Sort int `json:"sort" gorm:"column:sort;type:int(6) unsigned;default:100;not null;comment:是否为实权部门"` +} + +func (AdministrativeOrganization *AdministrativeOrganization) TableName() string { + return "administrative_organization" +} + +// 编辑行政组织内容 +func (cont *AdministrativeOrganization) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取行政组织内容 +func (cont *AdministrativeOrganization) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *AdministrativeOrganization) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *AdministrativeOrganization) ContMap(whereMap interface{}, field ...string) (countAry []AdministrativeOrganization) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb.Where(whereMap).Find(&countAry) + return +} diff --git a/models/modelshr/administrative_organization_type.go b/models/modelshr/administrative_organization_type.go new file mode 100644 index 0000000..fc1f8bd --- /dev/null +++ b/models/modelshr/administrative_organization_type.go @@ -0,0 +1,38 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 行政组织类型 +type AdministrativeOrganizationType struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:类型名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Level int64 `json:"level" gorm:"column:level;type:int(5) unsigned;default:1;not null;comment:级别"` + KingdeeId string `json:"kingdeeid" gorm:"column:kingdeeid;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` +} + +func (AdministrativeOrganizationType *AdministrativeOrganizationType) TableName() string { + return "administrative_organization_type" +} + +// 编辑职务分类内容 +func (cont *AdministrativeOrganizationType) EiteCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取详细内容 +func (cont *AdministrativeOrganizationType) GetCont(whereMap map[string]interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/double_worker.go b/models/modelshr/double_worker.go new file mode 100644 index 0000000..694a7c1 --- /dev/null +++ b/models/modelshr/double_worker.go @@ -0,0 +1,42 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 双职工 +type DoubleWorker struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Company string `json:"company" gorm:"column:company;type:varchar(255) unsigned;default:'';not null;comment:所在公司"` + Department string `json:"department" gorm:"column:department;type:varchar(255) unsigned;default:'';not null;comment:所在部门"` + Position string `json:"position" gorm:"column:position;type:varchar(255) unsigned;default:'';not null;comment:所在岗位"` + Tel string `json:"tel" gorm:"column:tel;type:varchar(255) unsigned;default:'';not null;comment:联系方式"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` +} + +func (DoubleWorker *DoubleWorker) TableName() string { + return "double_worker" +} + +// 编辑双职工内容 +func (DoubleWorker *DoubleWorker) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&DoubleWorker).Where(whereMap).Updates(saveData).Error + return +} + +// 获取双职工内容 +func (cont *DoubleWorker) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/duties.go b/models/modelshr/duties.go new file mode 100644 index 0000000..8eb9b4a --- /dev/null +++ b/models/modelshr/duties.go @@ -0,0 +1,41 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 职务 +type Duties struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职务名称"` + JobType int64 `json:"jobtype" gorm:"column:job_type;type:bigint(20) unsigned;default:0;not null;comment:归属职务类型"` + Weight int64 `json:"weight" gorm:"column:weight;type:bigint(20) unsigned;default:1;not null;comment:权重"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:编码"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + KingdeeId string `json:"kingdeeid" gorm:"column:kingdeeid;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` + KingdeeNum string `json:"kingdeenum" gorm:"column:kingdeenum;type:varchar(255) unsigned;default:'';comment:金蝶对照编码"` +} + +func (Duties *Duties) TableName() string { + return "duties" +} + +// 编辑职务分类内容 +func (Duties *Duties) EiteCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&Duties).Where(whereMap).Updates(saveData).Error + return +} + +// 获取详细内容 +func (cont *Duties) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/duties_class_leve.go b/models/modelshr/duties_class_leve.go new file mode 100644 index 0000000..857fd47 --- /dev/null +++ b/models/modelshr/duties_class_leve.go @@ -0,0 +1,37 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 职务信息及类别、等级视图 +type DutiesClassLeve struct { + Id int64 `json:"id" gorm:"primaryKey;column:d_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:d_name;type:varchar(255) unsigned;default:'';not null;comment:职务名称"` + Weight int64 `json:"weight" gorm:"column:d_weight;type:bigint(20) unsigned;default:1;not null;comment:权重"` + Number string `json:"number" gorm:"column:d_num;type:varchar(50) unsigned;default:'';not null;comment:编码"` + State int `json:"state" gorm:"column:d_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + KingdeeId string `json:"kingdeeid" gorm:"column:d_king;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` + ClassId int64 `json:"classid" gorm:"column:c_id;type:bigint(20) unsigned;not null;comment:Id;index"` //职务分类Id + ClassName string `json:"classname" gorm:"column:c_name;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"` + // LeveId int64 `json:"leveid" gorm:"column:l_id;type:bigint(20) unsigned;not null;comment:Id;index"` //职务等级Id + // LeveNumber string `json:"levenumber" gorm:"column:l_num;type:varchar(50) unsigned;default:'';not null;comment:等级编号"` + // LeveName string `json:"levename" gorm:"column:l_name;type:varchar(255) unsigned;default:'';not null;comment:等级名称"` +} + +func (DutiesClassLeve *DutiesClassLeve) TableName() string { + return "duties_class_leve" +} + +// 获取详细内容 +func (cont *DutiesClassLeve) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/emergency_contact.go b/models/modelshr/emergency_contact.go new file mode 100644 index 0000000..8107bef --- /dev/null +++ b/models/modelshr/emergency_contact.go @@ -0,0 +1,46 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 紧急联系人 +type EmergencyContact struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"primaryKey;column:number;type:varchar(30) unsigned;not null;comment:员工工号;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:紧急联系人姓名"` + Relationship string `json:"relationship" gorm:"column:relationship;type:varchar(255) unsigned;default:'';not null;comment:与紧急联系人关系"` + Tel string `json:"tel" gorm:"column:tel;type:varchar(255) unsigned;default:'';not null;comment:紧急联系人电话"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` +} + +func (EmergencyContact *EmergencyContact) TableName() string { + return "emergency_contact" +} + +// 编辑职务分类内容 +func (EmergencyContact *EmergencyContact) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&EmergencyContact).Where(whereMap).Updates(saveData).Error + return +} + +// 获取行政组织内容 +func (cont *EmergencyContact) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *EmergencyContact) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} diff --git a/models/modelshr/empoweruser.go b/models/modelshr/empoweruser.go new file mode 100644 index 0000000..d73071d --- /dev/null +++ b/models/modelshr/empoweruser.go @@ -0,0 +1,46 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 授权账户 +type EmpowerUser struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + UserKey string `json:"userkey" gorm:"column:userkey;type:varchar(255) unsigned;not null;comment:账户"` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:使用人(组织)名称"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Time int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eitetime;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + VerificationCode string `json:"verificationcode" gorm:"column:verification_code;type:mediumtext unsigned;comment:身份识别码"` +} + +func (Position *EmpowerUser) TableName() string { + return "empoweruser" +} + +// 编辑职务分类内容 +func (cont *EmpowerUser) EiteCont(whereMap interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取行政组织内容 +func (cont *EmpowerUser) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *EmpowerUser) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} diff --git a/models/modelshr/family_members.go b/models/modelshr/family_members.go new file mode 100644 index 0000000..5d56ea2 --- /dev/null +++ b/models/modelshr/family_members.go @@ -0,0 +1,46 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 员工家属 +type FamilyMembers struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Relationship string `json:"relationship" gorm:"column:relation;type:varchar(255) unsigned;default:'';not null;comment:亲属关系"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Company string `json:"company" gorm:"column:company;type:varchar(255) unsigned;default:'';not null;comment:所在公司"` + Deparment string `json:"deparment" gorm:"column:deparment;type:varchar(255) unsigned;default:'';not null;comment:所在部门"` + Postnme string `json:"postnme" gorm:"column:postnme;type:varchar(255) unsigned;default:'';not null;comment:所在岗位"` + Tel string `json:"tel" gorm:"column:tel;type:varchar(255) unsigned;default:'';not null;comment:紧急联系人电话"` + PoliticalOutlook int `json:"politicaloutlook" gorm:"column:political_outlook;type:int(3) unsigned;default:1;not null;comment:政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + + PoliticalOutlookCn string `json:"politicaloutlookcn" gorm:"column:political_outlook_cn;type:varchar(30) unsigned;not null;comment:政治面貌汉字说明"` +} + +func (FamilyMembers *FamilyMembers) TableName() string { + return "family_members" +} + +// 编辑员工家属内容 +func (FamilyMembers *FamilyMembers) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&FamilyMembers).Where(whereMap).Updates(saveData).Error + return +} + +// 获取员工家属内容 +func (cont *FamilyMembers) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/inside_work_history.go b/models/modelshr/inside_work_history.go new file mode 100644 index 0000000..194c1ea --- /dev/null +++ b/models/modelshr/inside_work_history.go @@ -0,0 +1,48 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 集团内部工作经历 +type InsideWorkHistory struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Key int64 `json:"key" gorm:"column:key;type:bigint(20) unsigned;default:0;not null;comment:员工识别符"` + Group int64 `json:"group" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:集团"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:公司"` + Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;not null;comment:部室"` + WorkShop int64 `json:"workshop" gorm:"column:workshop;type:bigint(20) unsigned;default:0;not null;comment:二级部门或车间"` + WorkshopSection int64 `json:"workshopsection" gorm:"column:workshop_section;type:bigint(20) unsigned;default:0;not null;comment:工段"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + GradePositions int64 `json:"gradepositions" gorm:"column:grade_positions;type:bigint(20) unsigned;default:0;not null;comment:职等"` + StartTime int64 `json:"starttime" gorm:"column:start_time;type:bigint(20) unsigned;default:0;not null;comment:开始日期"` + EndTime int64 `json:"endtime" gorm:"column:end_time;type:bigint(20) unsigned;default:0;not null;comment:结束日期"` + Team int64 `json:"team" gorm:"column:team;type:int(1) unsigned;default:1;not null;comment:班组(1:长白;2:甲;3:乙;4:丙;5:丁)"` + ChangeType int `json:"changetype" gorm:"column:change_type;type:int(1) unsigned;default:1;not null;comment:变动类型(1:预入职;2:雇佣入职;3:转正;4:晋升;5:降级;6:职等调整;7:调动调入;8:跨公司调动调入;9:借调;10:平调;11:兼职;12:预离职;13:离职;14:退休;15:返聘;16:员工初始化;)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AssignType int `json:"assigntype" gorm:"column:assign_type;type:int(1) unsigned;default:1;not null;comment:1、主职;2:兼职"` +} + +func (InsideWorkHistory *InsideWorkHistory) TableName() string { + return "inside_work_history" +} + +// 编辑集团内部工作经历内容 +func (cont *InsideWorkHistory) EditCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取详细内容 +func (cont *InsideWorkHistory) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/inside_work_view.go b/models/modelshr/inside_work_view.go new file mode 100644 index 0000000..6e9027d --- /dev/null +++ b/models/modelshr/inside_work_view.go @@ -0,0 +1,39 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +type InsideWorkView struct { + InsideWorkHistory + GroupNumber string `json:"groupnumber" gorm:"column:g_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + GroupName string `json:"groupname" gorm:"column:g_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + CompanyNumber string `json:"companynumber" gorm:"column:c_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + CompanyName string `json:"companyname" gorm:"column:c_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + DepartmentNumber string `json:"departmentnumber" gorm:"column:d_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + DepartmentName string `json:"departmentname" gorm:"column:d_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + WorkShopNumber string `json:"workshopnumber" gorm:"column:ws_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + WorkShopName string `json:"workshopname" gorm:"column:ws_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + SectionNumber string `json:"sectionnumber" gorm:"column:w_number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + SectionName string `json:"sectionnasectionme" gorm:"column:w_name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + PostJobNumber string `json:"postjobnumber" gorm:"column:p_number;type:varchar(50) unsigned;default:'';not null;comment:职位编码"` + PostJobName string `json:"postjobname" gorm:"column:p_name;type:varchar(255) unsigned;default:'';not null;comment:职位名称"` + TeamName string `json:"teamname" gorm:"column:r_name;type:varchar(255) unsigned;default:'';not null;comment:班组名称"` +} + +func (InsideWorkView *InsideWorkView) TableName() string { + return "inside_work_view" +} + +// 获取详细内容 +func (cont *InsideWorkView) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/job_class.go b/models/modelshr/job_class.go new file mode 100644 index 0000000..2bf44b6 --- /dev/null +++ b/models/modelshr/job_class.go @@ -0,0 +1,38 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 职务分类 +type JobClass struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + KingdeeId string `json:"kingdeeid" gorm:"column:kingdeeid;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` + KingdeeNum string `json:"kingdeenum" gorm:"column:kingdeenum;type:varchar(255) unsigned;default:'';comment:金蝶对照编码"` +} + +func (JobClass *JobClass) TableName() string { + return "job_class" +} + +// 编辑职务分类内容 +func (JobClass *JobClass) EiteJobClassCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&JobClass).Where(whereMap).Updates(saveData).Error + return +} + +// 获取详细内容 +func (cont *JobClass) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/kingdee_log.go b/models/modelshr/kingdee_log.go new file mode 100644 index 0000000..6d777eb --- /dev/null +++ b/models/modelshr/kingdee_log.go @@ -0,0 +1,36 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 金蝶对照记录 +type KingdeeLog struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(255) unsigned;default:'';not null;comment:工号"` + Cont string `json:"cont" gorm:"column:cont;type:longtext unsigned;default:'';not null;comment:内容"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (KingdeeLog *KingdeeLog) TableName() string { + return "kingdee_log" +} + +// 编辑职务分类内容 +func (KingdeeLog *KingdeeLog) EidtCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&KingdeeLog).Where(whereMap).Updates(saveData).Error + return +} + +// 获取详细内容 +func (cont *KingdeeLog) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/man_cont.go b/models/modelshr/man_cont.go new file mode 100644 index 0000000..649a4d7 --- /dev/null +++ b/models/modelshr/man_cont.go @@ -0,0 +1,76 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +type ManCont struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` + HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` + EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` + MainDeparment int64 `json:"maindeparment" gorm:"column:maindeparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` + SunMainDeparment int64 `json:"sunmaindeparment" gorm:"column:sun_main_department;type:bigint(20) unsigned;default:0;not null;comment:二级主部门"` + Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` + AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` + TeamId int64 `json:"teamid" gorm:"column:teamid;type:bigint(20) unsigned;default:0;not null;comment:班组"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` + JobLeve int64 `json:"jobleve" gorm:"column:job_leve;type:bigint(20) unsigned;default:0;not null;comment:职务等级"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` + WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` + Idcardno string `json:"idcardno" gorm:"column:idcardno;type:varchar(50) unsigned;default:'';not null;comment:身份证号"` + Passportno string `json:"passportno" gorm:"column:passportno;type:varchar(50) unsigned;default:'';not null;comment:护照号码"` + Globalroaming string `json:"globalroaming" gorm:"column:globalroaming;type:varchar(50) unsigned;default:'';not null;comment:国际区号"` + Mobilephone string `json:"mobilephone" gorm:"column:mobilephone;type:varchar(50) unsigned;default:'';not null;comment:手机号码"` + Email string `json:"email" gorm:"column:email;type:varchar(255) unsigned;default:'';not null;comment:电子邮件"` + Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男性;2:女性;3:中性)"` + Birthday int64 `json:"birthday" gorm:"column:birthday;type:bigint(20) unsigned;default:0;not null;comment:birthday"` + Myfolk string `json:"myfolk" gorm:"column:myfolk;type:varchar(50) unsigned;default:'';not null;comment:民族"` + Nativeplace string `json:"nativeplace" gorm:"column:nativeplace;type:varchar(255) unsigned;default:'';not null;comment:籍贯"` + Idcardstartdate int64 `json:"idcardstartdate" gorm:"column:idcardstartdate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期开始"` + Idcardenddate int64 `json:"idcardenddate" gorm:"column:idcardenddate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期结束"` + Idcardaddress string `json:"idcardaddress" gorm:"column:idcardaddress;type:varchar(255) unsigned;default:'';not null;comment:身份证地址"` + IdcardIssued string `json:"idcardIssued" gorm:"column:idcardIssued;type:varchar(255) unsigned;default:'';not null;comment:身份证签发机关"` + Health int `json:"health" gorm:"column:health;type:tinyint(1) unsigned;default:1;not null;comment:健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)"` + Maritalstatus int `json:"maritalstatus" gorm:"column:maritalstatus;type:tinyint(1) unsigned;default:1;not null;comment:婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)"` + Internaltelephone string `json:"internaltelephone" gorm:"column:internaltelephone;type:varchar(255) unsigned;default:'';not null;comment:内线电话"` + Currentresidence string `json:"currentresidence" gorm:"column:currentresidence;type:varchar(255) unsigned;default:'';not null;comment:现居住地址"` + Constellation int `json:"constellationing" gorm:"column:constellationing;type:tinyint(3) unsigned;comment:星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)"` + Isdoubleworker int `json:"isdoubleworker" gorm:"column:isdoubleworker;type:tinyint(1) unsigned;default:1;comment:是否双职工(1:是;2:否)"` + Isveterans int `json:"isveterans" gorm:"column:isveterans;type:tinyint(1) unsigned;default:1;comment:是否为退役军人(1:是;2:否)"` + Veteransnumber string `json:"veteransnumber" gorm:"column:veteransnumber;type:varchar(255) unsigned;default:'';comment:退役证编号"` + Jobstartdate int64 `json:"jobstartdate" gorm:"column:jobstartdate;type:bigint(20) unsigned;default:0;comment:参加工作日期"` + Entrydate int64 `json:"entrydate" gorm:"column:entrydate;type:bigint(20) unsigned;default:0;comment:入职日期"` + Probationperiod int `json:"probationperiod" gorm:"column:probationperiod;type:int(5) unsigned;default:0;comment:试用期"` + Planformaldate int64 `json:"planformaldate" gorm:"column:planformaldate;type:bigint(20) unsigned;default:0;comment:预计转正日期"` + PoliticalOutlook int `json:"politicaloutlook" gorm:"column:political_outlook;type:tinyint(3) unsigned;default:1;comment:政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"` +} + +func (ManCont *ManCont) TableName() string { + return "man_cont" +} + +// 获取职务分类内容 +func (cont *ManCont) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/org_cont_type.go b/models/modelshr/org_cont_type.go new file mode 100644 index 0000000..0bee690 --- /dev/null +++ b/models/modelshr/org_cont_type.go @@ -0,0 +1,34 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 职务信息及类别、等级视图 +type OrgContType struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:行政编码"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"` + Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + TypeName string `json:"typename" gorm:"column:typename;type:varchar(255) unsigned;default:'';not null;comment:类型名称"` + Level int64 `json:"level" gorm:"column:level;type:int(5) unsigned;default:1;not null;comment:级别"` + IsPower int `json:"ispower" gorm:"column:ispower;type:int(1) unsigned;default:2;not null;comment:是否为实权部门"` +} + +func (OrgContType *OrgContType) TableName() string { + return "org_cont_type" +} + +// 获取详细内容 +func (cont *OrgContType) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/personarchives.go b/models/modelshr/personarchives.go new file mode 100644 index 0000000..0e4e994 --- /dev/null +++ b/models/modelshr/personarchives.go @@ -0,0 +1,61 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 员工档案(主) +type PersonArchives struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` + HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` + EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:实习生;2:待分配;3:试用员工;4:正式员工;5:停薪留职;6:退休;7:辞退;8:离职)"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` + MainDeparment int64 `json:"maindeparment" gorm:"column:maindeparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` + Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` + AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` + TeamId int64 `json:"teamid" gorm:"column:teamid;type:bigint(20) unsigned;default:0;not null;comment:班组"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` + JobLeve int64 `json:"jobleve" gorm:"column:job_leve;type:bigint(20) unsigned;default:0;not null;comment:职务等级"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` + WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` + + EmpTypeName string `json:"emptypename" gorm:"column:emp_type_name;type:varchar(255) unsigned;default:'';not null;comment:用工关系中文"` + HireClassName string `json:"hireclassname" gorm:"column:hire_class_name;type:varchar(255) unsigned;default:'';not null;comment:雇佣类型中文"` + IconPhoto string `json:"iconphoto" gorm:"column:icon_photo;type:varchar(255) unsigned;default:'';not null;comment:头像"` + SunMainDeparment int64 `json:"sunmaindeparment" gorm:"column:sun_main_deparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` +} + +func (PersonArchives *PersonArchives) TableName() string { + return "person_archives" +} + +// 编辑员工档案 +func (PersonArchives *PersonArchives) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PersonArchives).Where(whereMap).Updates(saveData).Error + return +} + +// 获取员工档案 +func (cont *PersonArchives) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/personnel.go b/models/modelshr/personnel.go new file mode 100644 index 0000000..f8eee68 --- /dev/null +++ b/models/modelshr/personnel.go @@ -0,0 +1,54 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 员工档案(主) +type Personnel struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + HireClass int `json:"hireclass" gorm:"column:hire_class;type:tinyint(1) unsigned;default:1;not null;comment:雇佣类型(1:雇佣入职;2:再入职;)"` + PositionLevel int64 `json:"positionleveles" gorm:"column:positionleveles;type:bigint(20) unsigned;default:0;not null;comment:职位"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` + EmpType int `json:"emptype" gorm:"column:emp_type;type:tinyint(1) unsigned;default:1;not null;comment:用工关系(1:实习生;2:待分配;3:试用员工;4:正式员工;5:停薪留职;6:退休;7:辞退;8:离职)"` + Deparment string `json:"deparment" gorm:"column:deparment;type:text;comment:部门"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:2;not null;comment:职务分类"` + PositionGrade int64 `json:"positiongrade" gorm:"column:position_grade;type:bigint(20) unsigned;default:0;not null;comment:入职职等"` + Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` + Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` + WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` +} + +func (Personnel *Personnel) TableName() string { + return "personnel" +} + +// 编辑员工档案 +func (Personnel *Personnel) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&Personnel).Where(whereMap).Updates(saveData).Error + return +} + +// 获取员工档案 +func (cont *Personnel) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/personnel_change_record.go b/models/modelshr/personnel_change_record.go new file mode 100644 index 0000000..c10635d --- /dev/null +++ b/models/modelshr/personnel_change_record.go @@ -0,0 +1,58 @@ +package modelshr + +import "appPlatform/overall" + +//人员变动记录 +type PersonnelChangeRecord struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Type int `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:1;comment:变动类型(1:雇佣入职;2:再入职;3:职位分配;4:转正;5:停薪留职;6:退休;7:辞退;8:离职)"` + Reason string `json:"reason" gorm:"column:reason;type:text;comment:变动原因"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;comment:职位"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;comment:职务"` + JobLevel int64 `json:"joblevel" gorm:"column:job_level;type:bigint(20) unsigned;default:'';comment:职务等级"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:0;comment:职务分类"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;comment:入职公司"` + MainDepartment int64 `json:"maindepartment" gorm:"column:main_department;type:bigint(20) unsigned;default:0;comment:主部门"` + Department string `json:"department" gorm:"column:department;type:varchar(255) unsigned;default:0;comment:入职分厂"` + Adminorg int64 `json:"adminorg" gorm:"column:adminorg;type:bigint(20) unsigned;default:0;comment:入职行政组织"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;comment:写入时间"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` +} + +func (PersonnelChangeRecord *PersonnelChangeRecord) TableName() string { + return "personnel_change_record" +} + +//编辑职务分类内容 +func (PersonnelChangeRecord *PersonnelChangeRecord) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PersonnelChangeRecord).Where(whereMap).Updates(saveData).Error + return +} + +type ManTransferLog struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Type int `json:"classtype" gorm:"column:classtype;type:tinyint(1) unsigned;default:1;comment:变动类型(1:雇佣入职;2:再入职;3:职位分配;4:转正;5:停薪留职;6:退休;7:辞退;8:离职)"` + Reason string `json:"reason" gorm:"column:reason;type:text;comment:变动原因"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;comment:职位"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;comment:职务"` + JobLevel int64 `json:"joblevel" gorm:"column:job_level;type:bigint(20) unsigned;default:'';comment:职务等级"` + JobClass int64 `json:"jobclass" gorm:"column:job_class;type:bigint(20) unsigned;default:0;comment:职务分类"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;comment:入职公司"` + MainDepartment int64 `json:"maindepartment" gorm:"column:main_department;type:bigint(20) unsigned;default:0;comment:主部门"` + Department string `json:"department" gorm:"column:department;type:varchar(255) unsigned;default:0;comment:入职分厂"` + Adminorg int64 `json:"adminorg" gorm:"column:adminorg;type:bigint(20) unsigned;default:0;comment:入职行政组织"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;comment:写入时间"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` +} + +func (ManTransferLog *ManTransferLog) TableName() string { + return "man_transfer_log" +} + +//编辑职务分类内容 +func (ManTransferLog *ManTransferLog) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&ManTransferLog).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/modelshr/personnel_content.go b/models/modelshr/personnel_content.go new file mode 100644 index 0000000..d5c0c6d --- /dev/null +++ b/models/modelshr/personnel_content.go @@ -0,0 +1,67 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +//员工附属信息 + +type PersonnelContent struct { + Number string `json:"number" gorm:"primaryKey;column:number;type:varchar(30) unsigned;not null;comment:员工工号;index"` + Idcardno string `json:"idcardno" gorm:"column:idcardno;type:varchar(50) unsigned;default:'';not null;comment:身份证号"` + Passportno string `json:"passportno" gorm:"column:passportno;type:varchar(50) unsigned;default:'';not null;comment:护照号码"` + Globalroaming string `json:"globalroaming" gorm:"column:globalroaming;type:varchar(50) unsigned;default:'';not null;comment:国际区号"` + Mobilephone string `json:"mobilephone" gorm:"column:mobilephone;type:varchar(50) unsigned;default:'';not null;comment:手机号码"` + Email string `json:"email" gorm:"column:email;type:varchar(255) unsigned;default:'';not null;comment:电子邮件"` + Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男性;2:女性;3:中性)"` + Birthday int64 `json:"birthday" gorm:"column:birthday;type:bigint(20) unsigned;default:0;not null;comment:birthday"` + Myfolk string `json:"myfolk" gorm:"column:myfolk;type:varchar(50) unsigned;default:'';not null;comment:民族"` + Nativeplace string `json:"nativeplace" gorm:"column:nativeplace;type:varchar(255) unsigned;default:'';not null;comment:籍贯"` + Idcardstartdate int64 `json:"idcardstartdate" gorm:"column:idcardstartdate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期开始"` + Idcardenddate int64 `json:"idcardenddate" gorm:"column:idcardenddate;type:bigint(20) unsigned;default:0;not null;comment:身份证有效期结束"` + Idcardaddress string `json:"idcardaddress" gorm:"column:idcardaddress;type:varchar(255) unsigned;default:'';not null;comment:身份证地址"` + IdcardIssued string `json:"idcardIssued" gorm:"column:idcardIssued;type:varchar(255) unsigned;default:'';not null;comment:身份证签发机关"` + Health int `json:"health" gorm:"column:health;type:tinyint(1) unsigned;default:1;not null;comment:健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)"` + Maritalstatus int `json:"maritalstatus" gorm:"column:maritalstatus;type:tinyint(1) unsigned;default:1;not null;comment:婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)"` + Internaltelephone string `json:"internaltelephone" gorm:"column:internaltelephone;type:varchar(255) unsigned;default:'';not null;comment:内线电话"` + Currentresidence string `json:"currentresidence" gorm:"column:currentresidence;type:varchar(255) unsigned;default:'';not null;comment:现居住地址"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Constellation int `json:"constellationing" gorm:"column:constellationing;type:tinyint(3) unsigned;comment:星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)"` + Isdoubleworker int `json:"isdoubleworker" gorm:"column:isdoubleworker;type:tinyint(1) unsigned;default:1;comment:是否双职工(1:是;2:否)"` + Isveterans int `json:"isveterans" gorm:"column:isveterans;type:tinyint(1) unsigned;default:1;comment:是否为退役军人(1:是;2:否)"` + Veteransnumber string `json:"veteransnumber" gorm:"column:veteransnumber;type:varchar(255) unsigned;default:'';comment:退役证编号"` + Jobstartdate int64 `json:"jobstartdate" gorm:"column:jobstartdate;type:bigint(20) unsigned;default:0;comment:参加工作日期"` + Entrydate int64 `json:"entrydate" gorm:"column:entrydate;type:bigint(20) unsigned;default:0;comment:入职日期"` + Probationperiod int `json:"probationperiod" gorm:"column:probationperiod;type:int(5) unsigned;default:0;comment:试用期"` + Planformaldate int64 `json:"planformaldate" gorm:"column:planformaldate;type:bigint(20) unsigned;default:0;comment:预计转正日期"` + PoliticalOutlook int `json:"politicaloutlook" gorm:"column:political_outlook;type:tinyint(3) unsigned;default:1;comment:政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + + MaritalstatusCn string `json:"maritalstatuscn" gorm:"column:maritalstatus_cn;type:varchar(50) unsigned;default:'';not null;comment:婚姻状况汉字说明"` + ConstellationingCn string `json:"constellationingcn" gorm:"column:constellationing_cn;type:varchar(50) unsigned;default:'';not null;comment:星座汉字说明"` + PoliticalOutlookCn string `json:"politicaloutlookcn" gorm:"column:political_outlook_cn;type:varchar(50) unsigned;default:'';not null;comment:政治面貌汉字说明"` + HealthCn string `json:"healthcn" gorm:"column:health_cn;type:varchar(50) unsigned;default:'';not null;comment:健康状况中文说明"` +} + +func (PersonnelContent *PersonnelContent) TableName() string { + return "personnel_content" +} + +// 编辑职务分类内容 +func (PersonnelContent *PersonnelContent) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PersonnelContent).Where(whereMap).Updates(saveData).Error + return +} + +// 获取职务分类内容 +func (cont *PersonnelContent) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/personnel_education.go b/models/modelshr/personnel_education.go new file mode 100644 index 0000000..13bc465 --- /dev/null +++ b/models/modelshr/personnel_education.go @@ -0,0 +1,48 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +//教育经历 + +type PersonnelEducation struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;comment:员工工号"` + Education int `json:"education" gorm:"column:education;type:int(5) unsigned;default:1;comment:学历(1:初中及以下;2:中专;3:高中;4:中技;5:高技;6:函数专科;7:大学专科;8:函数本科;9:大学本科;10:硕士研究生;11:博士研究生;12:专家、教授)"` + GraduationSchool string `json:"graduationschool" gorm:"column:graduation_school;type:varchar(255) unsigned;default:'';comment:毕业学校"` + Subject string `json:"subject" gorm:"column:subject;type:varchar(255) unsigned;default:'';comment:专业"` + AdmissionTime int64 `json:"admissiontime" gorm:"column:admission_time;type:bigint(20) unsigned;default:0;comment:入学时间"` + GraduationTime int64 `json:"graduationtime" gorm:"column:graduation_time;type:bigint(20) unsigned;default:0;comment:毕业时间"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;comment:写入时间"` + Level int `json:"level" gorm:"column:level;type:tinyint(1) unsigned;default:1;comment:学历类型(1:普通;2:第一学历;3:最高学历)"` + AcademicDegree int `json:"academicdegree" gorm:"column:academic_degree;type:tinyint(2) unsigned;default:1;comment:学位(1:无;2:学士;3:硕士;4:博士)"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + + AcademicDegreeCn string `json:"academicdegreecn" gorm:"column:academic_degree_cn;type:varchar(30) unsigned;comment:学位中文说明"` + EducationCn string `json:"educationcn" gorm:"column:education_cn;type:varchar(30) unsigned;comment:学历中文说明"` +} + +func (PersonnelEducation *PersonnelEducation) TableName() string { + return "personnel_education" +} + +// 编辑教育经历内容 +func (PersonnelEducation *PersonnelEducation) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PersonnelEducation).Where(whereMap).Updates(saveData).Error + return +} + +// 获取教育经历内容 +func (cont *PersonnelEducation) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/position.go b/models/modelshr/position.go new file mode 100644 index 0000000..7247d8e --- /dev/null +++ b/models/modelshr/position.go @@ -0,0 +1,53 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 职位(岗位) +type Position struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:职位编码"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职位名称"` + Duties int64 `json:"duties" gorm:"column:duties;type:bigint(20) unsigned;default:0;not null;comment:职务"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AdministrativeOrganization int64 `json:"administrativeorganization" gorm:"column:administrative_organization;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"` + Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"` + PersonInCharge int `json:"personincharge" gorm:"column:person_in_charge;type:int(1) unsigned;default:2;not null;comment:是否为本部门负责人(1:是;2:否)"` + Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;not null;comment:部门"` + MenuPermit string `json:"menupermit" gorm:"column:menu_permit;type:longtext;comment:菜单许可证"` + ButtonPermit string `json:"buttonpermit" gorm:"column:button_permit;type:longtext;comment:按钮许可"` + School int64 `json:"school" gorm:"column:school;type:bigint(20) unsigned;default:0;not null;comment:部门"` + KingdeeId string `json:"kingdeeid" gorm:"column:kingdeeid;type:varchar(255) unsigned;default:'';comment:金蝶对照ID"` + UnifyId int64 `json:"unifyid" gorm:"column:unify_id;type:bigint(20) unsigned;default:0;not null;comment:统一名称"` +} + +func (Position *Position) TableName() string { + return "position" +} + +// 编辑职务分类内容 +func (cont *Position) EiteCont(whereMap interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取行政组织内容 +func (cont *Position) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *Position) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} diff --git a/models/modelshr/position_level.go b/models/modelshr/position_level.go new file mode 100644 index 0000000..430e3f8 --- /dev/null +++ b/models/modelshr/position_level.go @@ -0,0 +1,22 @@ +package modelshr + +import "appPlatform/overall" + +//职位等级 +type PositionLevel struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:等级编号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:等级名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + PositionId int64 `json:"positionid" gorm:"column:positionid;type:bigint(20) unsigned;default:0;not null;comment:归属哪个职务"` +} + +func (PositionLevel *PositionLevel) TableName() string { + return "position_level" +} + +//编辑职务分类内容 +func (PositionLevel *PositionLevel) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&PositionLevel).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/modelshr/position_unify.go b/models/modelshr/position_unify.go new file mode 100644 index 0000000..c73cfec --- /dev/null +++ b/models/modelshr/position_unify.go @@ -0,0 +1,43 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 职位(岗位) +type PositionUnify struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(200) unsigned;default:'';not null;comment:职位名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Content string `json:"content" gorm:"column:content;type:longtext;comment:关联具体岗位ID"` +} + +func (PositionUnify *PositionUnify) TableName() string { + return "position_unify" +} + +// 编辑职务分类内容 +func (cont *PositionUnify) EiteCont(whereMap interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取行政组织内容 +func (cont *PositionUnify) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *PositionUnify) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} diff --git a/models/modelshr/post_duties_job.go b/models/modelshr/post_duties_job.go new file mode 100644 index 0000000..dd35c93 --- /dev/null +++ b/models/modelshr/post_duties_job.go @@ -0,0 +1,44 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +//职务与岗位视图 + +type PostDutiesJob struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:职位编码"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职位名称"` + PersonInCharge int `json:"personincharge" gorm:"column:perincha;type:int(1) unsigned;default:2;not null;comment:是否为本部门负责人(1:是;2:否)"` + Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"` + Duties int64 `json:"duties" gorm:"column:duties;type:bigint(20) unsigned;default:0;not null;comment:职务"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AdministrativeOrganization int64 `json:"administrativeorganization" gorm:"column:adm_org;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"` + Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;not null;comment:部门"` + MenuPermit string `json:"menupermit" gorm:"column:menu_permit;type:longtext;comment:菜单许可证"` + ButtonPermit string `json:"buttonpermit" gorm:"column:button_permit;type:longtext;comment:按钮许可"` + School int64 `json:"school" gorm:"column:school;type:bigint(20) unsigned;default:0;not null;comment:部门"` + DutiesName string `json:"dutiesname" gorm:"column:duties_name;type:varchar(255) unsigned;default:'';not null;comment:职务名称"` + DutiesNumber string `json:"dutiesnumber" gorm:"column:duties_number;type:varchar(50) unsigned;default:'';not null;comment:编码"` + Weight int64 `json:"weight" gorm:"column:weight;type:bigint(20) unsigned;default:1;not null;comment:权重"` + JobType int64 `json:"jobtype" gorm:"column:job_type;type:bigint(20) unsigned;default:0;not null;comment:归属职务类型"` + JobName string `json:"jobname" gorm:"column:job_name;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"` +} + +func (PostDutiesJob *PostDutiesJob) TableName() string { + return "post_duties_job" +} + +// 获取详细内容 +func (cont *PostDutiesJob) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/teamgroup.go b/models/modelshr/teamgroup.go new file mode 100644 index 0000000..8a75c73 --- /dev/null +++ b/models/modelshr/teamgroup.go @@ -0,0 +1,36 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 班组 +type TeamGroup struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:班组名称"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (TeamGroup *TeamGroup) TableName() string { + return "teamgroup" +} + +// 编辑班组内容 +func (TeamGroup *TeamGroup) EiteTeamGroupCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&TeamGroup).Where(whereMap).Updates(saveData).Error + return +} + +// 获取详细内容 +func (cont *TeamGroup) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} diff --git a/models/modelshr/user_post_duties.go b/models/modelshr/user_post_duties.go new file mode 100644 index 0000000..ebaf824 --- /dev/null +++ b/models/modelshr/user_post_duties.go @@ -0,0 +1,82 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +type UserPostDuties struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:ID"` + Number string `json:"number" gorm:"column:number;type:varchar(30) unsigned;not null;comment:员工工号"` + Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:姓名"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(255) unsigned;default:'';not null;comment:头像"` + Company int64 `json:"company" gorm:"column:company;type:bigint(20) unsigned;default:0;not null;comment:入职公司"` + MainDeparment int64 `json:"maindeparment" gorm:"column:maindeparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` + AdminOrg int64 `json:"adminorg" gorm:"column:admin_org;type:bigint(20) unsigned;default:0;not null;comment:所属行政组织"` + TeamId int64 `json:"teamid" gorm:"column:teamid;type:bigint(20) unsigned;default:0;not null;comment:班组"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;not null;comment:职位"` + JobId int64 `json:"jobid" gorm:"column:job_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` + JobLeve int64 `json:"jobleve" gorm:"column:job_leve;type:bigint(20) unsigned;default:0;not null;comment:职务等级"` + Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255) unsigned;default:'';not null;comment:微信UserId"` + WorkWechat string `json:"workwechat" gorm:"column:work_wechat;type:varchar(255) unsigned;default:'';not null;comment:企业微信UserId"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:key"` + IsAdmin int `json:"isadmin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` + Password string `json:"password" gorm:"column:password;type:varchar(255) unsigned;default:'';not null;comment:密码"` + Role string `json:"role" gorm:"column:role;type:longtext;comment:角色"` + SunMainDeparment int64 `json:"sunmaindeparment" gorm:"column:sun_main_deparment;type:bigint(20) unsigned;default:0;not null;comment:主部门"` + + Mobilephone string `json:"mobilephone" gorm:"column:mobilephone;type:varchar(50) unsigned;default:'';not null;comment:手机号码"` + Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男性;2:女性;3:中性)"` + + PostName string `json:"postname" gorm:"column:postname;type:varchar(255) unsigned;default:'';not null;comment:职位名称"` + PersonInCharge int `json:"personincharge" gorm:"column:leading_cadre;type:int(1) unsigned;default:2;not null;comment:是否为本部门负责人(1:是;2:否)"` + Superior int64 `json:"superior" gorm:"column:post_superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"` + MenuPermit string `json:"menupermit" gorm:"column:menu_permit;type:longtext;comment:菜单许可证"` + ButtonPermit string `json:"buttonpermit" gorm:"column:button_permit;type:longtext;comment:按钮许可"` + DutiesName string `json:"dutiesname" gorm:"column:duties_name;type:varchar(255) unsigned;default:'';not null;comment:职务名称"` +} + +func (UserPostDuties *UserPostDuties) TableName() string { + return "user_post_duties" +} + +// 编辑内容 +func (cont *UserPostDuties) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *UserPostDuties) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *UserPostDuties) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *UserPostDuties) ContMap(whereMap interface{}, field ...string) (countAry []UserPostDuties, err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *UserPostDuties) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelshr/work_history.go b/models/modelshr/work_history.go new file mode 100644 index 0000000..5494496 --- /dev/null +++ b/models/modelshr/work_history.go @@ -0,0 +1,51 @@ +package modelshr + +import ( + "appPlatform/overall" + "strings" +) + +// 工作履历 +type WorkHistory struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:工号"` + Key int64 `json:"key" gorm:"column:key;type:bigint(50) unsigned;default:0;not null;comment:身份识别"` + Company string `json:"company" gorm:"column:company;type:varchar(255) unsigned;default:'';comment:公司"` + Deparment string `json:"deparment" gorm:"column:deparment;type:varchar(255) unsigned;default:'';comment:部门"` + Job string `json:"job" gorm:"column:job;type:varchar(255) unsigned;default:'';comment:职务"` + EntryTime int64 `json:"entrytime" gorm:"column:entry_time;type:bigint(20) unsigned;default:0;not null;comment:入职时间"` + Leavedate int64 `json:"leavedate" gorm:"column:leavedate;type:bigint(20) unsigned;default:0;not null;comment:离职日期"` + Witness string `json:"witness" gorm:"column:witness;type:varchar(255) unsigned;default:'';comment:证明人"` + WitnessTel string `json:"witnesstel" gorm:"column:witness_tel;type:varchar(255) unsigned;default:'';comment:证明人电话"` + Remarks string `json:"remarks" gorm:"column:remarks;type:text unsigned;default:'';comment:备注"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` +} + +func (WorkHistory *WorkHistory) TableName() string { + return "work_history" +} + +// 编辑职务分类内容 +func (cont *WorkHistory) EiteCont(whereMap interface{}, saveData map[string]interface{}) (err error) { + err = overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取行政组织内容 +func (cont *WorkHistory) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_HR.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *WorkHistory) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_HR.Model(&cont).Where(whereMap).Count(&countId) + return +} diff --git a/models/modelskpi/app_flow_log.go b/models/modelskpi/app_flow_log.go new file mode 100644 index 0000000..d1efc42 --- /dev/null +++ b/models/modelskpi/app_flow_log.go @@ -0,0 +1,119 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 审批记录 视图 +// 岗位审批工作流 +type AppFlowLog struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;autoIncrement;comment:ID"` + OrderId int64 `json:"orderid" gorm:"column:order_id;type:bigint(20) unsigned;default:0;not null;comment:审批单ID"` + Step int `json:"step" gorm:"column:step;type:int(5) unsigned;default:0;not null;comment:当前执行到第几步"` + NextStep int `json:"nextstep" gorm:"column:next_step;type:int(5) unsigned;default:0;not null;comment:下一步执行哪个步骤"` + NextExecutor string `json:"nextexecutor" gorm:"column:next_executor;type:longtext;comment:下一步执行人"` + CountStep int `json:"countstep" gorm:"column:count_step;type:int(5) unsigned;default:0;not null;comment:总共几步"` + WorkFlow string `json:"workflow" gorm:"column:work_flow;type:longtext;comment:工作流(审批json字符串)"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Class int `json:"class" gorm:"column:class;type:tinyint(1) unsigned;default:1;not null;comment:属性1、定性;2、定量"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + SonTarget int64 `json:"sontarget" gorm:"column:son_target;type:bigint(20) unsigned;default:0;not null;comment:指标子栏目"` + Detailed int64 `json:"detailed" gorm:"column:detailed;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Executor int64 `json:"executor" gorm:"column:executor;type:bigint(20) unsigned;default:0;not null;comment:执行人"` + ExecutorDepartment int64 `json:"executordepartment" gorm:"column:executor_department;type:bigint(20) unsigned;default:0;not null;comment:执行人部门"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:流程状态 1:草稿;2:审批中;3:驳回;4:归档;5:废弃;6:删除"` + StartTime int64 `json:"starttime" gorm:"column:start_time;type:bigint(20) unsigned;default:0;not null;comment:流程开始时间"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:时间"` + EnclosureFormat string `json:"enclosureformat" gorm:"column:enclosure_format;type:longtext;comment:附件"` + Participants string `json:"participants" gorm:"column:participants;type:longtext;comment:流程参与人"` + Year int64 `json:"year" gorm:"column:year;type:int(7) unsigned;default:0;not null;comment:年"` + Quarter int64 `json:"quarter" gorm:"column:quarter;type:int(3) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:month;type:int(3) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:week;type:int(3) unsigned;default:0;not null;comment:周"` + PersonLiable int64 `json:"personliable" gorm:"column:person_liable;type:bigint(20) unsigned;default:0;not null;comment:责任人"` + HappenTime int64 `json:"happentime" gorm:"column:happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + //post_target + PtTitle string `json:"pt_title" gorm:"column:pt_title;type:varchar(255) unsigned;default:'';not null;comment:指标标题"` + PtCycle int `json:"pt_cycle" gorm:"column:pt_cycle;type:int(1) unsigned;default:1;not null;comment:指标1:班;2:天;3:周;4:月;5:季度;6:年"` + PtCycleattr int `json:"pt_cycleattr" gorm:"column:pt_cycleattr;type:int(9) unsigned;default:1;not null;comment:指标辅助计数"` + //post_sun_target + PstTitle string `json:"pst_title" gorm:"column:pst_title;type:varchar(255) unsigned;default:'';not null;comment:子栏目标题"` + //post_target_details + PtdTitle string `json:"ptd_title" gorm:"column:ptd_title;type:text;comment:指标细则"` + PtdCycles int `json:"ptd_cycle" gorm:"column:ptd_cycle;type:tinyint(1) unsigned;default:1;not null;comment:指标细则1:班;2:天;3:周;4:月;5:季度;6:年"` + PtdCycleAttres int `json:"ptd_cycleattr" gorm:"column:ptd_cycleattr;type:int(9) unsigned;default:1;not null;comment:指标细则辅助计数"` + //post_metering_flow + PmfId int64 `json:"pmf_id" gorm:"primaryKey;column:pmf_id;type:bigint(20) unsigned;not null;autoIncrement;comment:ID"` + PmfShemeId int64 `json:"pmf_shem_id" gorm:"column:pmf_shem_id;type:bigint(20) unsigned;default:0;not null;comment:方案ID"` + PmfPersonLiable int64 `json:"pmf_person_liable" gorm:"column:pmf_person_liable;type:bigint(20) unsigned;default:0;not null;comment:责任人"` + PmfCompanyId int64 `json:"pmf_company_id" gorm:"column:pmf_company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + PmfDepartmentId int64 `json:"pmf_department_id" gorm:"column:pmf_department_id;type:bigint(20) unsigned;default:0;not null;comment:部门"` + PmfOrgId int64 `json:"pmf_org_id" gorm:"column:pmf_org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PmfPostId int64 `json:"pmf_post_id" gorm:"column:pmf_post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + PmfExecutor int64 `json:"pmf_executor" gorm:"column:pmf_executor;type:bigint(20) unsigned;default:0;not null;comment:执行人"` + PmfExecutorDepartment int64 `json:"pmf_executor_depart" gorm:"column:pmf_executor_depart;type:bigint(20) unsigned;default:0;not null;comment:执行人部门"` + PmfHappenTime int64 `json:"pmf_happen_time" gorm:"column:pmf_happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + PmfTime int64 `json:"pmf_time" gorm:"column:pmf_time;type:bigint(20) unsigned;default:0;not null;comment:时间"` + //post_nature_flow + PnfId int64 `json:"pnf_id" gorm:"primaryKey;column:pnf_id;type:bigint(20) unsigned;not null;autoIncrement;comment:ID"` + PnfShemeId int64 `json:"pnf_sheme_id" gorm:"column:pnf_sheme_id;type:bigint(20) unsigned;default:0;not null;comment:方案ID"` + PnfPersonLiable int64 `json:"pnf_person_liable" gorm:"column:pnf_person_liable;type:bigint(20) unsigned;default:0;not null;comment:责任人"` + PnfCompanyId int64 `json:"pnf_company" gorm:"column:pnf_company;type:bigint(20) unsigned;default:0;not null;comment:公司"` + PnfDepartmentId int64 `json:"pnf_department_id" gorm:"column:pnf_department_id;type:bigint(20) unsigned;default:0;not null;comment:部门"` + PnfOrgId int64 `json:"pnf_org_id" gorm:"column:pnf_org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PnfPostId int64 `json:"pnf_post_id" gorm:"column:pnf_post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + PnfExecutor int64 `json:"pnf_executor" gorm:"column:pnf_executor;type:bigint(20) unsigned;default:0;not null;comment:执行人"` + PnfExecutorDepartment int64 `json:"pnf_executor_depart" gorm:"column:pnf_executor_depart;type:bigint(20) unsigned;default:0;not null;comment:执行人部门"` + PnfHappenTime int64 `json:"pnf_happen_time" gorm:"column:pnf_happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + PnfTime int64 `json:"pnf_time" gorm:"column:pnf_time;type:bigint(20) unsigned;default:0;not null;comment:时间"` +} + +func (AppFlowLog *AppFlowLog) TableName() string { + return "app_flow_log" +} + +// 编辑内容 +func (cont *AppFlowLog) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *AppFlowLog) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *AppFlowLog) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *AppFlowLog) ContMap(whereMap interface{}, field ...string) (countAry []AppFlowLog, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *AppFlowLog) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/app_new_flow_log.go b/models/modelskpi/app_new_flow_log.go new file mode 100644 index 0000000..d7b334d --- /dev/null +++ b/models/modelskpi/app_new_flow_log.go @@ -0,0 +1,95 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 岗位审批工作流查询视图 +type AppNewFlowLog struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;autoIncrement;comment:ID"` + OrderId int64 `json:"orderid" gorm:"column:order_id;type:bigint(20) unsigned;default:0;not null;comment:审批单ID"` + Step int `json:"step" gorm:"column:step;type:int(5) unsigned;default:0;not null;comment:当前执行到第几步"` + NextStep int `json:"nextstep" gorm:"column:next_step;type:int(5) unsigned;default:0;not null;comment:下一步执行哪个步骤"` + NextExecutor string `json:"nextexecutor" gorm:"column:next_executor;type:longtext;comment:下一步执行人"` + CountStep int `json:"countstep" gorm:"column:count_step;type:int(5) unsigned;default:0;not null;comment:总共几步"` + WorkFlow string `json:"workflow" gorm:"column:work_flow;type:longtext;comment:工作流(审批json字符串)"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Class int `json:"class" gorm:"column:class;type:tinyint(1) unsigned;default:1;not null;comment:属性1、定性;2、定量"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + SonTarget int64 `json:"sontarget" gorm:"column:son_target;type:bigint(20) unsigned;default:0;not null;comment:指标子栏目"` + Detailed int64 `json:"detailed" gorm:"column:detailed;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Executor int64 `json:"executor" gorm:"column:executor;type:bigint(20) unsigned;default:0;not null;comment:执行人"` + ExecutorDepartment int64 `json:"executordepartment" gorm:"column:executor_department;type:bigint(20) unsigned;default:0;not null;comment:执行人部门"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:流程状态 流程状态 1:草稿;2:审批中;3:驳回;4:归档;5:废弃;6:删除"` + StartTime int64 `json:"starttime" gorm:"column:start_time;type:bigint(20) unsigned;default:0;not null;comment:流程开始时间"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:时间"` + EnclosureFormat string `json:"enclosureformat" gorm:"column:enclosure_format;type:longtext;comment:附件"` + Participants string `json:"participants" gorm:"column:participants;type:longtext;comment:流程参与人"` + Year int64 `json:"year" gorm:"column:year;type:int(7) unsigned;default:0;not null;comment:年"` + Quarter int64 `json:"quarter" gorm:"column:quarter;type:int(3) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:month;type:int(3) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:week;type:int(3) unsigned;default:0;not null;comment:周"` + PersonLiable int64 `json:"personliable" gorm:"column:person_liable;type:bigint(20) unsigned;default:0;not null;comment:责任人"` + HappenTime int64 `json:"happentime" gorm:"column:happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + + //post_target + PtTitle string `json:"pt_title" gorm:"column:pt_title;type:varchar(255) unsigned;default:'';not null;comment:指标标题"` + PtCycle int `json:"pt_cycle" gorm:"column:pt_cycle;type:int(1) unsigned;default:1;not null;comment:指标1:班;2:天;3:周;4:月;5:季度;6:年"` + PtCycleattr int `json:"pt_cycleattr" gorm:"column:pt_cycleattr;type:int(9) unsigned;default:1;not null;comment:指标辅助计数"` + //post_sun_target + PstTitle string `json:"pst_title" gorm:"column:pst_title;type:varchar(255) unsigned;default:'';not null;comment:子栏目标题"` + //post_target_details + PtdTitle string `json:"ptd_title" gorm:"column:ptd_title;type:text;comment:指标细则"` + PtdCycles int `json:"ptd_cycle" gorm:"column:ptd_cycle;type:tinyint(1) unsigned;default:1;not null;comment:指标细则1:班;2:天;3:周;4:月;5:季度;6:年"` + PtdCycleAttres int `json:"ptd_cycleattr" gorm:"column:ptd_cycleattr;type:int(9) unsigned;default:1;not null;comment:指标细则辅助计数"` +} + +func (AppNewFlowLog *AppNewFlowLog) TableName() string { + return "app_new_flow_log" +} + +// 编辑内容 +func (cont *AppNewFlowLog) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *AppNewFlowLog) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *AppNewFlowLog) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *AppNewFlowLog) ContMap(whereMap interface{}, field ...string) (countAry []AppNewFlowLog, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *AppNewFlowLog) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/approval_record.go b/models/modelskpi/approval_record.go new file mode 100644 index 0000000..3aff2be --- /dev/null +++ b/models/modelskpi/approval_record.go @@ -0,0 +1,97 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +/* +* +@ 作者: 秦东 +@ 时间: 2023-04-08 10:28:42 +@ 功能: 审批记录视图 +@ 参数 + + # + +@ 返回值 + + # + +@ 方法原型 + + # +*/ +type ApprovalRecord struct { + Id int64 `json:"id" gorm:"primaryKey;column:ep_id;type:bigint(20) unsigned;not null"` + OrderKey int64 `json:"orderkey" gorm:"column:ep_order_key;type:bigint(20) unsigned;default:0;not null;comment:发起表单key"` + Step int `json:"step" gorm:"column:ep_step;type:int(7) unsigned;default:1;not null;comment:当前执行到第几部"` + Content string `json:"content" gorm:"column:ep_cont;type:longtext;comment:流程步进值"` + NextContent string `json:"nextcontent" gorm:"column:ep_next_cont;type:mediumtext;comment:下一步内容"` + Time int64 `json:"time" gorm:"column:ep_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:ep_state;type:int(2) unsigned;default:1;not null;comment:1:草稿,2:审批中;3:驳回;4:归档;5:删除"` + RoleGroup int64 `json:"rolegroup" gorm:"column:ep_role_group;type:bigint(20) unsigned;default:0;not null;comment:角色组"` + TypeClass int `json:"type" gorm:"column:ep_type;type:tinyint(1) unsigned;default:1;not null;comment:1、定性;2、定量"` + Participants string `json:"participants" gorm:"column:ep_participants;type:mediumtext;comment:参与人"` + StartTime int64 `json:"starttime" gorm:"column:ep_start_time;type:bigint(20) unsigned;default:0;not null;comment:流程开始时间"` + NextStep int `json:"nextstep" gorm:"column:ep_next_step;type:int(7) unsigned;default:1;not null;comment:下一步"` + NextExecutor string `json:"nextexecutor" gorm:"column:ep_next_executor;type:mediumtext;comment:下一步执行人"` + SetupDepartment int64 `json:"setupdepartment" gorm:"column:ep_setup_department;type:bigint(20) unsigned;default:0;not null;comment:发起部门"` + Dimension string `json:"dimension" gorm:"column:ep_dimension;type:mediumtext;comment:维度"` + Target string `json:"target" gorm:"column:ep_target;type:mediumtext;comment:指标"` + DetailedTarget string `json:"detailedtarget" gorm:"column:ep_detailedtarget;type:mediumtext;comment:指标细则"` + AcceptDepartment int64 `json:"acceptdepartment" gorm:"column:ep_accept_department;type:bigint(20) unsigned;default:0;not null;comment:接受考核部门"` + HappenTime int64 `json:"happentime" gorm:"column:ep_happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + FlowKey int64 `json:"flowkey" gorm:"column:ep_flow_key;type:bigint(20) unsigned;default:0;not null;comment:工作流识别符"` + FlowVid int64 `json:"flowvid" gorm:"column:ep_flow_vid;type:bigint(20) unsigned;default:0;not null;comment:当前工作流版本号"` + EpOld int `json:"epold" gorm:"column:ep_old;type:int(1) unsigned;default:1;not null;comment:1:旧流程;2:新流程"` + Creater int64 `json:"creater" gorm:"column:ep_creater;type:bigint(20) unsigned;default:0;not null;comment:流程创始人"` + TargetTitle string `json:"targettitle" gorm:"column:target_title;type:varchar(255);comment:指标名称"` + BylawsTitle string `json:"bylawstitle" gorm:"column:bylaws_title;type:varchar(255);comment:细则名称"` + Clique int64 `json:"clique" gorm:"column:ep_clique;type:bigint(20) unsigned;default:0;not null;comment:公司"` +} + +func (ApprovalRecord *ApprovalRecord) TableName() string { + return "approval_record" +} + +// 编辑内容 +func (cont *ApprovalRecord) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *ApprovalRecord) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *ApprovalRecord) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *ApprovalRecord) ContMap(whereMap interface{}, field ...string) (countAry []ApprovalRecord, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *ApprovalRecord) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/assesstarget.go b/models/modelskpi/assesstarget.go new file mode 100644 index 0000000..be9705c --- /dev/null +++ b/models/modelskpi/assesstarget.go @@ -0,0 +1,64 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 定性考核指标关系指定 +type Assesstarget struct { + Id int64 `json:"id" gorm:"primaryKey;column:at_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Group int64 `json:"group" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:集团ID"` + Departmentmap string `json:"departmentmap" gorm:"column:departmentmap;type:mediumtext unsigned;default:0;comment:部门ID"` + TargetId int64 `json:"targetid" gorm:"column:targetid;type:bigint(20) unsigned;default:0;not null;comment:指标"` + SunTargetId int64 `json:"suntargetid" gorm:"column:suntargetid;type:bigint(20) unsigned;default:0;not null;comment:子栏目ID"` + Content string `json:"content" gorm:"column:content;type:longtext;comment:描述"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` +} + +func (Assesstarget *Assesstarget) TableName() string { + return "assesstarget" +} + +// 编辑内容 +func (cont *Assesstarget) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *Assesstarget) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *Assesstarget) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *Assesstarget) ContMap(whereMap interface{}, field ...string) (countAry []Assesstarget, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *Assesstarget) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/depart_dime_post_weight.go b/models/modelskpi/depart_dime_post_weight.go new file mode 100644 index 0000000..bf3a928 --- /dev/null +++ b/models/modelskpi/depart_dime_post_weight.go @@ -0,0 +1,123 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" + "time" +) + +// 岗位考核指标权重 +type DepartDimePostWeight struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Type int64 `json:"type" gorm:"column:type;type:bigint(20) unsigned;default:0;not null;comment:1:定性考核;2:定量考核"` + Orgid int64 `json:"orgid" gorm:"column:orgid;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + Postid int64 `json:"postid" gorm:"column:postid;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:考核维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + Weight float64 `json:"weight" gorm:"column:weight;type:int(6) unsigned;default:0;not null;comment:权重"` + Addtime int64 `json:"addtime" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` + Hierarchy int64 `json:"hierarchy" gorm:"column:hierarchy;type:bigint(20) unsigned;default:0;not null;comment:维度;2:指标"` + Quote int64 `json:"quote" gorm:"column:is_quote;type:bigint(20) unsigned;default:0;not null;comment:1:不是引用;2:引用部门"` +} + +func (DepartDimePostWeight *DepartDimePostWeight) TableName() string { + return "depart_dime_post_weight" +} + +// 编辑内容 +func (cont *DepartDimePostWeight) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *DepartDimePostWeight) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *DepartDimePostWeight) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *DepartDimePostWeight) ContMap(whereMap interface{}, field ...string) (countAry []DepartDimePostWeight, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *DepartDimePostWeight) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} + +/** +@ 作者: 秦东 +@ 时间: 2022-10-25 14:47:00 +@ 功能: +@ 参数 + # +@ 返回值 + # +*/ +// 写入岗位考核维度与指标权重 +func (cont *DepartDimePostWeight) WriteTargetWeight() (err error) { + where := make(map[string]interface{}) + // where := publicmethod.MapOut[string]() + where["`orgid`"] = cont.Orgid + where["`postid`"] = cont.Postid + where["`dimension`"] = cont.Dimension + where["`hierarchy`"] = cont.Hierarchy + where["`is_quote`"] = cont.Quote + if cont.Hierarchy == 1 { + var oldCont DepartDimePostWeight + err = oldCont.GetCont(where) + if err != nil { + err = overall.CONSTANT_DB_KPI.Create(&cont).Error + return + } else { + // editWhe := publicmethod.MapOut[string]() + editWhe := make(map[string]interface{}) + editWhe["`id`"] = oldCont.Id + // saveAry := publicmethod.MapOut[string]() + saveAry := make(map[string]interface{}) + saveAry["`weight`"] = cont.Weight + saveAry["`time`"] = time.Now().Unix() + err = oldCont.EiteCont(editWhe, saveAry) + return + } + } else { + where["`target`"] = cont.Target + var oldCont DepartDimePostWeight + err = oldCont.GetCont(where) + if err != nil { + err = overall.CONSTANT_DB_KPI.Create(&cont).Error + return + } else { + // editWhe := publicmethod.MapOut[string]() + editWhe := make(map[string]interface{}) + editWhe["`id`"] = oldCont.Id + // saveAry := publicmethod.MapOut[string]() + saveAry := make(map[string]interface{}) + saveAry["`weight`"] = cont.Weight + saveAry["`time`"] = time.Now().Unix() + err = oldCont.EiteCont(editWhe, saveAry) + return + } + } + return +} diff --git a/models/modelskpi/department_dimension_weight.go b/models/modelskpi/department_dimension_weight.go new file mode 100644 index 0000000..ccd8e50 --- /dev/null +++ b/models/modelskpi/department_dimension_weight.go @@ -0,0 +1,64 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 性质考核方案权重 +type DepartmentDimensionWeight struct { + Id int64 `json:"id" gorm:"primaryKey;column:ddw_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Type int64 `json:"type" gorm:"column:ddw_type;type:bigint(20) unsigned;default:0;not null;comment:1:定性考核;2:定量考核"` + Group int64 `json:"group" gorm:"column:ddw_group;type:bigint(20) unsigned;default:0;not null;comment:归属集团"` + DepartmentId int64 `json:"parentid" gorm:"column:ddw_derpatment;type:bigint(20) unsigned;default:0;not null;comment:部门ID"` + Dimension int64 `json:"dimension" gorm:"column:ddw_dimension;type:bigint(20) unsigned;default:0;not null;comment:考核维度"` + Target int64 `json:"target" gorm:"column:ddw_target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + Weight int64 `json:"weight" gorm:"column:ddw_weight;type:int(6) unsigned;default:0;not null;comment:权重"` + Addtime int64 `json:"addtime" gorm:"column:ddw_time;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` + Hierarchy int64 `json:"hierarchy" gorm:"column:ddw_hierarchy;type:bigint(20) unsigned;default:0;not null;comment:维度;2:指标"` +} + +func (DepartmentDimensionWeight *DepartmentDimensionWeight) TableName() string { + return "department_dimension_weight" +} + +// 编辑内容 +func (cont *DepartmentDimensionWeight) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *DepartmentDimensionWeight) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *DepartmentDimensionWeight) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *DepartmentDimensionWeight) ContMap(whereMap interface{}, field ...string) (countAry []DepartmentDimensionWeight, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *DepartmentDimensionWeight) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/detailed_target.go b/models/modelskpi/detailed_target.go new file mode 100644 index 0000000..64465b7 --- /dev/null +++ b/models/modelskpi/detailed_target.go @@ -0,0 +1,73 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 指标细则 +type DetailedTarget struct { + Id int64 `json:"id" gorm:"primaryKey;column:dt_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:dt_title;type:text;comment:指标细则"` + Content string `json:"content" gorm:"column:dt_content;type:text;comment:指标说明"` + ParentId int64 `json:"parentid" gorm:"column:dt_parentid;type:bigint(20) unsigned;default:0;not null;comment:归属指标栏目"` + ParentIdSun int64 `json:"parentidsun" gorm:"column:dt_parentid_sun;type:bigint(20) unsigned;default:0;not null;comment:归属指标子栏目"` + State int `json:"state" gorm:"column:dt_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AddTime int64 `json:"addtime" gorm:"column:dt_time;type:bigint(20) unsigned;default:0;not null;comment:制定时间"` + MinScore int64 `json:"minscore" gorm:"column:dt_min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` + MaxScore int64 `json:"maxscore" gorm:"column:dt_max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` + Company string `json:"company" gorm:"column:dt_company;type:varchar(20) unsigned;default:0;not null;comment:单位"` + AddReduce int `json:"addreduce" gorm:"column:dt_add_reduce;type:int(1) unsigned;default:1;not null;comment:1:减少;2:增加;3:无属性,现场确认加或减"` + CensorType string `json:"censortype" gorm:"column:dt_censor_type;type:text;comment:检查方式"` + CensorCont string `json:"censorcont" gorm:"column:dt_censor_cont;type:longtext;comment:检查依据"` + CensorRate int `json:"censorrate" gorm:"column:dt_censor_rate;type:int(5) unsigned;default:1;not null;comment:检查频次"` + Cycles int `json:"cycle" gorm:"column:dt_cycle;type:tinyint(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"` + CycleAttres int `json:"cycleattr" gorm:"column:dt_cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` + Paretment string `json:"paretment" gorm:"column:dt_paretment;type:longtext;comment:接受考核的部门"` + Reportary string `json:"reportary" gorm:"column:reportary;type:longtext;comment:提报人"` +} + +func (DetailedTarget *DetailedTarget) TableName() string { + return "detailed_target" +} + +// 编辑内容 +func (cont *DetailedTarget) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(&saveData).Error + return +} + +// 获取内容 +func (cont *DetailedTarget) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *DetailedTarget) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *DetailedTarget) ContMap(whereMap interface{}, field ...string) (countAry []DetailedTarget, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *DetailedTarget) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/division_responsibilities.go b/models/modelskpi/division_responsibilities.go new file mode 100644 index 0000000..7b59473 --- /dev/null +++ b/models/modelskpi/division_responsibilities.go @@ -0,0 +1,77 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 划分责任 division_responsibilities +type DivisionResponsibilities struct { + Id int64 `json:"id" gorm:"primaryKey;column:df_id;type:bigint(20) unsigned;not null"` + ScoreFlow int64 `json:"scoreflow" gorm:"column:df_sf_id;type:bigint(20) unsigned;default:0;not null;comment:归属加减分关联值"` + Type int `json:"type" gorm:"column:df_type;type:tinyint(1) unsigned;default:1;not null;comment:责任类型(1、主要责任人;2、互保责任人;3、责任班组;4、责任班组长;5、主管;6、三大员;7、厂长、主任)"` + UserName string `json:"username" gorm:"column:df_user_name;type:varchar(100);comment:责任人名"` + UserNumber string `json:"usernumber" gorm:"column:df_user_number;type:varchar(100);comment:责任人工号"` + UserKey int64 `json:"userkey" gorm:"column:df_user_key;type:bigint(20) unsigned;default:0;not null;comment:责任人KEY"` + Department int64 `json:"department" gorm:"column:df_department_id;type:bigint(20) unsigned;default:0;not null;comment:责任人部门"` + Group int64 `json:"group" gorm:"column:df_group;type:bigint(20) unsigned;default:0;not null;comment:责任人集团"` + Tema int64 `json:"tema" gorm:"column:df_tema;type:bigint(20) unsigned;default:0;not null;comment:责任人班组"` + Weight int64 `json:"weight" gorm:"column:df_weight;type:int(7) unsigned;default:0;not null;comment:比重"` + Time int64 `json:"time" gorm:"column:df_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eitetime" gorm:"column:df_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` + DistributionUser int64 `json:"distributionuser" gorm:"column:df_distribution_user;type:bigint(20) unsigned;default:0;not null;comment:分配任key"` + EvaluationDepartment int64 `json:"evaluationdepartment" gorm:"column:df_evaluation_department;type:bigint(20) unsigned;default:0;not null;comment:测评部门"` + EvaluationUser int64 `json:"evaluationuser" gorm:"column:df_evaluation_user;type:bigint(20) unsigned;default:0;not null;comment:测评人"` + EvaluationGroup int64 `json:"evaluationgroup" gorm:"column:df_evaluation_group;type:bigint(20) unsigned;default:0;not null;comment:测评集团"` +} + +func (DivisionResponsibilities *DivisionResponsibilities) TableName() string { + return "division_responsibilities" +} + +// 添加 +func (cont *DivisionResponsibilities) AddCont() (err error) { + err = overall.CONSTANT_DB_KPI.Create(&cont).Error + return +} + +// 编辑内容 +func (cont *DivisionResponsibilities) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *DivisionResponsibilities) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *DivisionResponsibilities) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *DivisionResponsibilities) ContMap(whereMap interface{}, field ...string) (countAry []DivisionResponsibilities, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *DivisionResponsibilities) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/duty_flow_data.go b/models/modelskpi/duty_flow_data.go new file mode 100644 index 0000000..ccfc04f --- /dev/null +++ b/models/modelskpi/duty_flow_data.go @@ -0,0 +1,81 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 定量考核数据流 +type DutyFlowData struct { + Id int64 `json:"id" gorm:"primaryKey;column:fld_id;type:bigint(20) unsigned;not null;comment:Id;index"` + EvaluationPlan int64 `json:"evaluationplan" gorm:"column:fld_evaluation_id;type:bigint(20) unsigned;default:0;not null;comment:考核方案项目ID"` + Key int64 `json:"key" gorm:"column:fld_flow_log;type:bigint(20) unsigned;default:0;not null;comment:识别标志"` + Score int64 `json:"score" gorm:"column:fld_score;type:bigint(20) unsigned;default:0;not null;comment:数据"` + Content string `json:"content" gorm:"column:fld_cont;type:mediumtext;comment:描述"` + Enclosure string `json:"enclosure" gorm:"column:fld_enclosure;type:longtext;comment:附件"` + Time int64 `json:"time" gorm:"column:fld_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + ScoringMethod int `json:"scoringmethod" gorm:"column:fld_scoring_method;type:int(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"` + ScoringScore float64 `json:"scoringscore" gorm:"column:fld_scoring_score;type:bigint(20) unsigned;default:0;not null;comment:手动分"` + PlanVersion string `json:"planversion" gorm:"column:fld_planversion;type:varchar(255);comment:版本号"` + Year int64 `json:"year" gorm:"column:fld_year;type:int(7) unsigned;default:0;not null;comment:年分"` + Quarter int64 `json:"quarter" gorm:"column:fld_quarter;type:int(2) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:fld_month;type:int(2) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:fld_week;type:int(5) unsigned;default:0;not null;comment:周"` + ToDay int64 `json:"today" gorm:"column:fld_day;type:int(5) unsigned;default:0;not null;comment:天"` + TargetId int64 `json:"targetid" gorm:"column:fld_target_id;type:bigint(20) unsigned;default:0;not null;comment:指标ID"` + + EvaluationDepartment int64 `json:"evaluationdepartment" gorm:"column:fl_evaluation_department;type:bigint(20) unsigned;default:0;not null;comment:测评部门"` + EvaluationUser int64 `json:"evaluationuser" gorm:"column:fl_evaluation_user;type:bigint(20) unsigned;default:0;not null;comment:测评人"` + EvaluationGroup int64 `json:"evaluationgroup" gorm:"column:fl_evaluation_group;type:bigint(20) unsigned;default:0;not null;comment:测评集团"` + EnclosureFlow string `json:"enclosure" gorm:"column:fl_enclosure;type:longtext;comment:附件"` + DutyGroup int64 `json:"dutygroup" gorm:"column:fl_duty_group;type:bigint(20) unsigned;default:0;not null;comment:职责集团"` + DutyDepartment int64 `json:"dutydepartment" gorm:"column:fl_duty_department;type:bigint(20) unsigned;default:0;not null;comment:职责部门"` + Reply int `json:"reply" gorm:"column:fl_reply;type:int(2) unsigned;default:1;not null;comment:状态(0:删除;1:起草;2:审批;3:通过)"` + ContentFlow string `json:"content" gorm:"column:fl_content;type:mediumtext;comment:描述"` + Baseline string `json:"baseline" gorm:"column:fl_baseline;type:longtext;comment:基准线 "` +} + +func (DutyFlowData *DutyFlowData) TableName() string { + return "duty_flow_data" +} + +// 编辑内容 +func (cont *DutyFlowData) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *DutyFlowData) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *DutyFlowData) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *DutyFlowData) ContMap(whereMap interface{}, field ...string) (countAry []DutyFlowData, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *DutyFlowData) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/dutyclass.go b/models/modelskpi/dutyclass.go new file mode 100644 index 0000000..e3375c1 --- /dev/null +++ b/models/modelskpi/dutyclass.go @@ -0,0 +1,62 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 考核维度 +type DutyClass struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id"` + Title string `json:"title" gorm:"column:title;type:varchar(255);comment:考核维度名称"` + Type int `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:1;not null;comment:类型(1:定性考核;2:定量考核)"` + Weight int `json:"weight" gorm:"column:weight;type:int(3) unsigned;default:0;not null;comment:权重比例"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态"` + Sort int `json:"sort" gorm:"column:sort;type:int(5) unsigned;default:0;not null;comment:排序"` +} + +func (DutyClass *DutyClass) TableName() string { + return "dutyclass" +} + +// 编辑内容 +func (cont *DutyClass) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *DutyClass) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *DutyClass) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *DutyClass) ContMap(whereMap interface{}, field ...string) (countAry []DutyClass, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *DutyClass) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/evaluation_process.go b/models/modelskpi/evaluation_process.go new file mode 100644 index 0000000..98d9b5a --- /dev/null +++ b/models/modelskpi/evaluation_process.go @@ -0,0 +1,79 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 流程步进器 +type EvaluationProcess struct { + Id int64 `json:"id" gorm:"primaryKey;column:ep_id;type:bigint(20) unsigned;not null"` + OrderKey int64 `json:"orderkey" gorm:"column:ep_order_key;type:bigint(20) unsigned;default:0;not null;comment:发起表单key"` + Step int `json:"step" gorm:"column:ep_step;type:int(7) unsigned;default:1;not null;comment:当前执行到第几部"` + Content string `json:"content" gorm:"column:ep_cont;type:longtext;comment:流程步进值"` + NextContent string `json:"nextcontent" gorm:"column:ep_next_cont;type:mediumtext;comment:下一步内容"` + Time int64 `json:"time" gorm:"column:ep_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:ep_state;type:int(2) unsigned;default:1;not null;comment:1:草稿,2:审批中;3:驳回;4:归档;5:删除"` + RoleGroup int64 `json:"rolegroup" gorm:"column:ep_role_group;type:bigint(20) unsigned;default:0;not null;comment:角色组"` + TypeClass int `json:"type" gorm:"column:ep_type;type:tinyint(1) unsigned;default:1;not null;comment:1、定性;2、定量"` + Participants string `json:"participants" gorm:"column:ep_participants;type:mediumtext;comment:参与人"` + StartTime int64 `json:"starttime" gorm:"column:ep_start_time;type:bigint(20) unsigned;default:0;not null;comment:流程开始时间"` + NextStep int `json:"nextstep" gorm:"column:ep_next_step;type:int(7) unsigned;default:1;not null;comment:下一步"` + NextExecutor string `json:"nextexecutor" gorm:"column:ep_next_executor;type:mediumtext;comment:下一步执行人"` + SetupDepartment int64 `json:"setupdepartment" gorm:"column:ep_setup_department;type:bigint(20) unsigned;default:0;not null;comment:发起部门"` + Dimension string `json:"dimension" gorm:"column:ep_dimension;type:mediumtext;comment:维度"` + Target string `json:"target" gorm:"column:ep_target;type:mediumtext;comment:指标"` + DetailedTarget string `json:"detailedtarget" gorm:"column:ep_detailedtarget;type:mediumtext;comment:指标细则"` + AcceptDepartment int64 `json:"acceptdepartment" gorm:"column:ep_accept_department;type:bigint(20) unsigned;default:0;not null;comment:接受考核部门"` + HappenTime int64 `json:"happentime" gorm:"column:ep_happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + FlowKey int64 `json:"flowkey" gorm:"column:ep_flow_key;type:bigint(20) unsigned;default:0;not null;comment:工作流识别符"` + FlowVid int64 `json:"flowvid" gorm:"column:ep_flow_vid;type:bigint(20) unsigned;default:0;not null;comment:当前工作流版本号"` + EpOld int `json:"epold" gorm:"column:ep_old;type:int(7) unsigned;default:1;not null;comment:1:旧流程;2:新流程"` + Creater int64 `json:"creater" gorm:"column:ep_creater;type:bigint(20) unsigned;default:0;not null;comment:流程创始人"` + Clique int64 `json:"clique" gorm:"column:ep_clique;type:bigint(20) unsigned;default:0;not null;comment:公司"` +} + +func (EvaluationProcess *EvaluationProcess) TableName() string { + return "evaluation_process" +} + +// 编辑内容 +func (cont *EvaluationProcess) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *EvaluationProcess) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *EvaluationProcess) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *EvaluationProcess) ContMap(whereMap interface{}, field ...string) (countAry []EvaluationProcess, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *EvaluationProcess) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/evaluationtarget.go b/models/modelskpi/evaluationtarget.go new file mode 100644 index 0000000..3844052 --- /dev/null +++ b/models/modelskpi/evaluationtarget.go @@ -0,0 +1,71 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 测评指标 +type EvaluationTarget struct { + Id int64 `json:"id" gorm:"primaryKey;column:et_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:et_title;type:varchar(255);comment:指标名称"` + Type int `json:"type" gorm:"column:et_type;type:int(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` + State int `json:"state" gorm:"column:et_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AddTime int64 `json:"addTime" gorm:"column:et_time;type:bigint(20) unsigned;default:0;not null;comment:制定时间"` + Share int `json:"share" gorm:"column:et_share;type:int(1) unsigned;default:1;not null;comment:1:共用;2:私用"` + RelevantDepartments string `json:"relevantdepartments" gorm:"column:et_relevant_departments;type:text;comment:相关部门"` + Dimension int64 `json:"dimension" gorm:"column:et_dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Key int64 `json:"key" gorm:"column:et_key;type:bigint(20) unsigned;default:0;not null;comment:UUID"` + Report string `json:"report" gorm:"column:et_report;type:text;comment:上报人"` + Uniteing string `json:"unites" gorm:"column:et_unit;type:varchar(255);comment:计量单位"` + Cycles int `json:"cycle" gorm:"column:et_cycle;type:tinyint(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"` + CycleAttres int `json:"cycleattr" gorm:"column:et_cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` + VisibleRange string `json:"visiblerange" gorm:"column:et_visible_range;type:text;comment:可见范围"` + VisibleRangeGroup string `json:"visiblerangegroup" gorm:"column:et_visible_group;type:text;comment:可见范围(集团)"` + ScoringMethod int `json:"scoringmethod" gorm:"column:et_scoring_method;type:tinyint(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"` +} + +func (EvaluationTarget *EvaluationTarget) TableName() string { + return "evaluationtarget" +} + +// 编辑内容 +func (cont *EvaluationTarget) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *EvaluationTarget) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *EvaluationTarget) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *EvaluationTarget) ContMap(whereMap interface{}, field ...string) (countAry []EvaluationTarget, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *EvaluationTarget) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/flow_data_log.go b/models/modelskpi/flow_data_log.go new file mode 100644 index 0000000..af6dce2 --- /dev/null +++ b/models/modelskpi/flow_data_log.go @@ -0,0 +1,26 @@ +package modelskpi + +// 定量柳树视图 +type FlowDataLogType struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Key int64 `json:"key" gorm:"column:key;type:bigint(20) unsigned;default:0;not null;comment:识别标志"` + Score int64 `json:"score" gorm:"column:score;type:bigint(20) unsigned;default:0;not null;comment:数据"` + ScoringMethod int `json:"scoringmethod" gorm:"column:method;type:int(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"` + ScoringScore float64 `json:"scoringscore" gorm:"column:scoring_score;type:bigint(20) unsigned;default:0;not null;comment:手动分"` + EvaluationDepartment int64 `json:"evaluationdepartment" gorm:"column:eval_department;type:bigint(20) unsigned;default:0;not null;comment:测评部门"` + DutyGroup int64 `json:"dutygroup" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:职责集团"` + DutyDepartment int64 `json:"dutydepartment" gorm:"column:department;type:bigint(20) unsigned;default:0;not null;comment:职责部门"` + Baseline string `json:"baseline" gorm:"column:baseline;type:longtext;comment:基准线 "` + Year int64 `json:"year" gorm:"column:year;type:int(7) unsigned;default:0;not null;comment:年分"` + Quarter int64 `json:"quarter" gorm:"column:quarte;type:int(2) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:month;type:int(2) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:week;type:int(5) unsigned;default:0;not null;comment:周"` + ToDay int64 `json:"today" gorm:"column:today;type:int(5) unsigned;default:0;not null;comment:天"` + TargetId int64 `json:"targetid" gorm:"column:targetid;type:bigint(20) unsigned;default:0;not null;comment:指标ID"` + Edition string `json:"edition" gorm:"column:edition;type:longtext;comment:版本号 "` + Content string `json:"content" gorm:"column:content;type:longtext;comment:评测内容 "` +} + +func (FlowDataLogType *FlowDataLogType) TableName() string { + return "flow_data_log" +} diff --git a/models/modelskpi/flow_log.go b/models/modelskpi/flow_log.go new file mode 100644 index 0000000..f69c927 --- /dev/null +++ b/models/modelskpi/flow_log.go @@ -0,0 +1,76 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 定量考核数据表 +type FlowLog struct { + Id int64 `json:"id" gorm:"primaryKey;column:fl_id;type:bigint(20) unsigned;not null;comment:Id;index"` + EvaluationPlan string `json:"evaluationplan" gorm:"column:fl_evaluation_id;type:mediumtext unsigned;default:0;not null;comment:考核方案项目ID"` + Score int64 `json:"score" gorm:"column:fl_data;type:bigint(20) unsigned;default:0;not null;comment:数据"` + Key int64 `json:"key" gorm:"column:fl_key;type:bigint(20) unsigned;default:0;not null;comment:识别标志"` + Content string `json:"content" gorm:"column:fl_content;type:mediumtext;comment:描述"` + Time int64 `json:"time" gorm:"column:fl_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eitetime" gorm:"column:fl_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` + EvaluationDepartment int64 `json:"evaluationdepartment" gorm:"column:fl_evaluation_department;type:bigint(20) unsigned;default:0;not null;comment:测评部门"` + EvaluationUser int64 `json:"evaluationuser" gorm:"column:fl_evaluation_user;type:bigint(20) unsigned;default:0;not null;comment:测评人"` + EvaluationGroup int64 `json:"evaluationgroup" gorm:"column:fl_evaluation_group;type:bigint(20) unsigned;default:0;not null;comment:测评集团"` + Year int64 `json:"year" gorm:"column:fl_year;type:int(7) unsigned;default:0;not null;comment:年分"` + Quarter int64 `json:"quarter" gorm:"column:fl_quarter;type:int(2) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:fl_month;type:int(2) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:fl_week;type:int(5) unsigned;default:0;not null;comment:周"` + ToDay int64 `json:"today" gorm:"column:fl_day;type:int(5) unsigned;default:0;not null;comment:天"` + Enclosure string `json:"enclosure" gorm:"column:fl_enclosure;type:longtext;comment:附件"` + DutyGroup int64 `json:"dutygroup" gorm:"column:fl_duty_group;type:bigint(20) unsigned;default:0;not null;comment:职责集团"` + DutyDepartment int64 `json:"dutydepartment" gorm:"column:fl_duty_department;type:bigint(20) unsigned;default:0;not null;comment:职责部门"` + Reply int `json:"reply" gorm:"column:fl_reply;type:int(2) unsigned;default:1;not null;comment:状态(0:删除;1:起草;2:审批;3:通过)"` + PlanVersion string `json:"planversion" gorm:"column:fl_planversion;type:varchar(255);comment:版本号"` + Baseline string `json:"baseline" gorm:"column:fl_baseline;type:longtext;comment:基准线 "` +} + +func (FlowLog *FlowLog) TableName() string { + return "flow_log" +} + +// 编辑内容 +func (cont *FlowLog) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *FlowLog) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *FlowLog) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *FlowLog) ContMap(whereMap interface{}, field ...string) (countAry []FlowLog, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *FlowLog) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/flow_log_data.go b/models/modelskpi/flow_log_data.go new file mode 100644 index 0000000..65abf26 --- /dev/null +++ b/models/modelskpi/flow_log_data.go @@ -0,0 +1,71 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 定量考核数据流 +type FlowLogData struct { + Id int64 `json:"id" gorm:"primaryKey;column:fld_id;type:bigint(20) unsigned;not null;comment:Id;index"` + EvaluationPlan int64 `json:"evaluationplan" gorm:"column:fld_evaluation_id;type:bigint(20) unsigned;default:0;not null;comment:考核方案项目ID"` + Key int64 `json:"key" gorm:"column:fld_flow_log;type:bigint(20) unsigned;default:0;not null;comment:识别标志"` + Score int64 `json:"score" gorm:"column:fld_score;type:bigint(20) unsigned;default:0;not null;comment:数据"` + Content string `json:"content" gorm:"column:fld_cont;type:mediumtext;comment:描述"` + Enclosure string `json:"enclosure" gorm:"column:fld_enclosure;type:longtext;comment:附件"` + Time int64 `json:"time" gorm:"column:fld_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + ScoringMethod int `json:"scoringmethod" gorm:"column:fld_scoring_method;type:int(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"` + ScoringScore float64 `json:"scoringscore" gorm:"column:fld_scoring_score;type:bigint(20) unsigned;default:0;not null;comment:手动分"` + PlanVersion string `json:"planversion" gorm:"column:fld_planversion;type:varchar(255);comment:版本号"` + Year int64 `json:"year" gorm:"column:fld_year;type:int(7) unsigned;default:0;not null;comment:年分"` + Quarter int64 `json:"quarter" gorm:"column:fld_quarter;type:int(2) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:fld_month;type:int(2) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:fld_week;type:int(5) unsigned;default:0;not null;comment:周"` + ToDay int64 `json:"today" gorm:"column:fld_day;type:int(5) unsigned;default:0;not null;comment:天"` + TargetId int64 `json:"targetid" gorm:"column:fld_target_id;type:bigint(20) unsigned;default:0;not null;comment:指标ID"` +} + +func (FlowLogData *FlowLogData) TableName() string { + return "flow_log_data" +} + +// 编辑内容 +func (cont *FlowLogData) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *FlowLogData) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *FlowLogData) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *FlowLogData) ContMap(whereMap interface{}, field ...string) (countAry []FlowLogData, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *FlowLogData) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/nature_flow_order.go b/models/modelskpi/nature_flow_order.go new file mode 100644 index 0000000..0604af7 --- /dev/null +++ b/models/modelskpi/nature_flow_order.go @@ -0,0 +1,86 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 定性考核流水 +type NatureFlowOrder struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;autoIncrement;comment:ID"` + OrderId int64 `json:"orderid" gorm:"column:order_id;type:bigint(20) unsigned;default:0;not null;comment:审批单ID"` + AddOrDecrease int `json:"addordecrease" gorm:"column:add_or_decrease;type:tinyint(1) unsigned;default:1;not null;comment:增加或减少(1:增加;2:减少)"` + Score float64 `json:"score" gorm:"column:score;type:bigint(20) unsigned;default:0;not null;comment:分值(*100保存)"` + Money float64 `json:"money" gorm:"column:money;type:bigint(20) unsigned;default:0;not null;comment:钱(扣款或奖励)*100保存"` + Reason string `json:"reason" gorm:"column:reason;type:text;comment:这样操作的原因"` + ShemeId int64 `json:"shemeid" gorm:"column:sheme_id;type:bigint(20) unsigned;default:0;not null;comment:方案ID"` + ShemeVersion string `json:"shemeversion" gorm:"column:sheme_version;type:varchar(255) ;not null;comment:方案版本编号"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + SonTarget int64 `json:"sontarget" gorm:"column:son_target;type:bigint(20) unsigned;default:0;not null;comment:指标子栏目"` + Detailed int64 `json:"detailed" gorm:"column:detailed;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Year int64 `json:"year" gorm:"column:year;type:int(7) unsigned;default:0;not null;comment:年"` + Quarter int64 `json:"quarter" gorm:"column:quarter;type:int(3) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:month;type:int(3) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:week;type:int(3) unsigned;default:0;not null;comment:周"` + PersonLiable int64 `json:"personliable" gorm:"column:person_liable;type:bigint(20) unsigned;default:0;not null;comment:责任人"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Executor int64 `json:"executor" gorm:"column:executor;type:bigint(20) unsigned;default:0;not null;comment:执行人"` + ExecutorDepartment int64 `json:"executordepartment" gorm:"column:executor_department;type:bigint(20) unsigned;default:0;not null;comment:执行人部门"` + Rectification int `json:"rectification" gorm:"column:rectification;type:tinyint(1) unsigned;default:2;not null;comment:是否需要整改 1、需要整改;2:无需整改"` + CorrectionTime int64 `json:"correctiontime" gorm:"column:correction_time;type:bigint(20) unsigned;default:0;not null;comment:整改期限"` + HappenTime int64 `json:"happentime" gorm:"column:happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + HappenCount int `json:"happencount" gorm:"column:happen_count;type:int(7) unsigned;default:0;not null;comment:发生次数"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:时间"` + Class int `json:"class" gorm:"column:class;type:tinyint(1) unsigned;default:1;not null;comment:属性1、定性;2、定量"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:流程状态 1:草稿;2:驳回;3:审批中;4:归档;5:废弃;6:删除"` + Participants string `json:"participants" gorm:"column:participants;type:longtext;comment:流程参与人"` +} + +func (NatureFlowOrder *NatureFlowOrder) TableName() string { + return "nature_flow_order" +} + +// 编辑内容 +func (cont *NatureFlowOrder) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *NatureFlowOrder) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *NatureFlowOrder) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *NatureFlowOrder) ContMap(whereMap interface{}, field ...string) (countAry []NatureFlowOrder, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *NatureFlowOrder) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/open_approval_change_log.go b/models/modelskpi/open_approval_change_log.go new file mode 100644 index 0000000..5739fa0 --- /dev/null +++ b/models/modelskpi/open_approval_change_log.go @@ -0,0 +1,94 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 审批记录 +type OpenApprovalChangeLog struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Type int `json:"type" gorm:"column:type;type:int(1) unsigned;default:1;not null;comment:类型(1:部门;2:岗位)"` + Title string `json:"title" gorm:"column:title;type:varchar(255);comment:节点名称"` + Operator int64 `json:"operator" gorm:"column:operator;type:bigint(20);comment:操作人"` + OrderId int64 `json:"orderid" gorm:"column:orderid;type:bigint(20) unsigned;default:0;not null;comment:订单ID"` + OperatorTime int64 `json:"operatortime" gorm:"column:operatortime;type:bigint(20) unsigned;default:0;not null;comment:操作时间"` + Step int64 `json:"step" gorm:"column:step;type:int(5) unsigned;default:1;not null;comment:操作第几步"` + OperatorType int `json:"operatortype" gorm:"column:operatortype;type:int(1) unsigned;default:1;not null;comment:操作状态(1:位操作;2:已操作)"` + Msgid string `json:"msgid" gorm:"column:msgid;type:varchar(255);comment:消息id,用于撤回应用消息"` + ResponseCode string `json:"responsecode" gorm:"column:response_code;type:varchar(255);comment:仅消息类型为“按钮交互型”,“投票选择型”和“多项选择型”的模板卡片消息返回,应用可使用response_code调用更新模版卡片消息接口,24小时内有效,且只能使用一次"` + Stepper int `json:"stepper" gorm:"column:stepper;type:int(5) unsigned;default:1;not null;comment:步进器"` + ChangeIsTrue int `json:"changeistrue" gorm:"column:change_is_true;type:int(1) unsigned;default:1;not null;comment:是否可变更(1:可变更;2:不可变更)"` + Eiteyime int64 `json:"eiteyime" gorm:"column:eiteyime;type:bigint(20) unsigned;default:0;not null;comment:变动时间"` + YesOrNo int `json:"yesorno" gorm:"column:yesorno;type:int(1) unsigned;default:0;not null;comment:1:草稿,2:审批中;3:驳回;4:归档;5:删除"` + Idea string `json:"idea" gorm:"column:idea;type:longtext;comment:操作意见"` + Annex string `json:"annex" gorm:"column:annex;type:longtext;comment:附件"` +} + +func (OpenApprovalChangeLog *OpenApprovalChangeLog) TableName() string { + return "open_approval_change_log" +} + +// 编辑内容 +func (cont *OpenApprovalChangeLog) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *OpenApprovalChangeLog) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *OpenApprovalChangeLog) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *OpenApprovalChangeLog) ContMap(whereMap interface{}, field ...string) (countAry []OpenApprovalChangeLog, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *OpenApprovalChangeLog) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} + +// 添加记录 +func (cont *OpenApprovalChangeLog) AddCont() (err error) { + err = overall.CONSTANT_DB_KPI.Create(&cont).Error + return +} + +// 获取最大数 +func (cont *OpenApprovalChangeLog) GetMAx(orderId int64, userKey []string) (maxData int, err error) { + if len(userKey) > 0 { + err = overall.CONSTANT_DB_KPI.Model(&OpenApprovalChangeLog{}).Select("`stepper`,`operatortype`,`change_is_true`").Where("`orderid` = ? AND `operator` IN ?", orderId, userKey).First(&cont).Error + if cont.ChangeIsTrue == 1 { + maxData = cont.Stepper + return + } else { + err = overall.CONSTANT_DB_KPI.Model(&OpenApprovalChangeLog{}).Select("MAX(`stepper`) AS maxstep").Where("`orderid` = ?", orderId).First(&maxData).Error + } + } else { + err = overall.CONSTANT_DB_KPI.Model(&OpenApprovalChangeLog{}).Select("MAX(`stepper`) AS maxstep").Where("`orderid` = ?", orderId).First(&maxData).Error + } + + return +} diff --git a/models/modelskpi/operator_is_true.go b/models/modelskpi/operator_is_true.go new file mode 100644 index 0000000..b412e66 --- /dev/null +++ b/models/modelskpi/operator_is_true.go @@ -0,0 +1,69 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 当前节点是否可操作 +type OperatorIsTrue struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + OrderId int64 `json:"orderid" gorm:"column:orderid;type:bigint(20) unsigned;default:0;not null;comment:订单ID"` + Step int `json:"step" gorm:"column:step;type:int(5) unsigned;default:1;not null;comment:审批到第几步"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态:1:可操作;2:不可操作"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:操作时间"` + Msgid string `json:"msgid" gorm:"column:msgid;type:varchar(255);comment:消息id,用于撤回应用消息"` + ResponseCode string `json:"responsecode" gorm:"column:response_code;type:varchar(255);comment:仅消息类型为“按钮交互型”,“投票选择型”和“多项选择型”的模板卡片消息返回,应用可使用response_code调用更新模版卡片消息接口,24小时内有效,且只能使用一次"` + Stepper int `json:"stepper" gorm:"column:stepper;type:int(5) unsigned;default:1;not null;comment:步进器"` +} + +func (OperatorIsTrue *OperatorIsTrue) TableName() string { + return "operator_is_true" +} + +// 编辑内容 +func (cont *OperatorIsTrue) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *OperatorIsTrue) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *OperatorIsTrue) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *OperatorIsTrue) ContMap(whereMap interface{}, field ...string) (countAry []OperatorIsTrue, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *OperatorIsTrue) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} + +// 添加记录 +func (cont *OperatorIsTrue) AddCont() (err error) { + err = overall.CONSTANT_DB_KPI.Create(&cont).Error + return +} diff --git a/models/modelskpi/plan_versio.go b/models/modelskpi/plan_versio.go new file mode 100644 index 0000000..adffa50 --- /dev/null +++ b/models/modelskpi/plan_versio.go @@ -0,0 +1,65 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 考核方案版本管理 +type PlanVersio struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Group int64 `json:"group" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:集团ID"` + Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;comment:部门ID"` + Year int64 `json:"year" gorm:"column:yeares;type:int(5) unsigned;default:0;not null;comment:年度"` + Versio string `json:"versio" gorm:"column:versio;type:varchar(20) unsigned;default:0;not null;comment:版本号"` + Key string `json:"key" gorm:"column:key;type:varchar(200) unsigned;default:0;not null;comment:编码"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AddTime int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eitetime;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` + Content string `json:"content" gorm:"column:content;type:longtext;comment:版本内容"` +} + +func (PlanVersio *PlanVersio) TableName() string { + return "plan_versio" +} + +// 编辑内容 +func (cont *PlanVersio) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *PlanVersio) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *PlanVersio) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *PlanVersio) ContMap(whereMap interface{}, field ...string) (countAry []PlanVersio, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *PlanVersio) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/position_plan_version.go b/models/modelskpi/position_plan_version.go new file mode 100644 index 0000000..7af2d2b --- /dev/null +++ b/models/modelskpi/position_plan_version.go @@ -0,0 +1,67 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 岗位考核方案版本管理 +type PositionPlanVersio struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Group int64 `json:"group" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:归属集团"` + Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;comment:归属部门"` + OrgId int64 `json:"orgid" gorm:"column:orgid;type:bigint(20) unsigned;default:0;comment:行政组织"` + Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;comment:归属岗位"` + Key string `json:"key" gorm:"column:key;type:varchar(200) unsigned;default:0;not null;comment:编码"` + Versio string `json:"versio" gorm:"column:version;type:varchar(20) unsigned;default:0;not null;comment:版本号"` + Year int64 `json:"year" gorm:"column:years;type:int(5) unsigned;default:0;not null;comment:年度"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AddTime int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eitetime" gorm:"column:eitetime;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` + Content string `json:"content" gorm:"column:content;type:longtext;comment:版本内容"` +} + +func (PositionPlanVersio *PositionPlanVersio) TableName() string { + return "position_plan_version" +} + +// 编辑内容 +func (cont *PositionPlanVersio) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *PositionPlanVersio) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *PositionPlanVersio) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *PositionPlanVersio) ContMap(whereMap interface{}, field ...string) (countAry []PositionPlanVersio, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *PositionPlanVersio) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/post_metering_flow.go b/models/modelskpi/post_metering_flow.go new file mode 100644 index 0000000..23f2a8f --- /dev/null +++ b/models/modelskpi/post_metering_flow.go @@ -0,0 +1,79 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 定量考核流水 +type PostMeteringFlow struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;autoIncrement;comment:ID"` + OrderId int64 `json:"orderid" gorm:"column:order_id;type:bigint(20) unsigned;default:0;not null;comment:审批单ID"` + ShemeId int64 `json:"shemeid" gorm:"column:sheme_id;type:bigint(20) unsigned;default:0;not null;comment:方案ID"` + ShemeVersion string `json:"shemeversion" gorm:"column:sheme_version;type:varchar(255) ;not null;comment:方案版本编号"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + Score float64 `json:"score" gorm:"column:score;type:bigint(20) unsigned;default:0;not null;comment:分值(*100保存)"` + Reason string `json:"reason" gorm:"column:reason;type:text;comment:这样操作的原因"` + Year int64 `json:"year" gorm:"column:year;type:int(7) unsigned;default:0;not null;comment:年"` + Quarter int64 `json:"quarter" gorm:"column:quarter;type:int(3) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:month;type:int(3) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:week;type:int(3) unsigned;default:0;not null;comment:周"` + PersonLiable int64 `json:"personliable" gorm:"column:person_liable;type:bigint(20) unsigned;default:0;not null;comment:责任人"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Executor int64 `json:"executor" gorm:"column:executor;type:bigint(20) unsigned;default:0;not null;comment:执行人"` + ExecutorDepartment int64 `json:"executordepartment" gorm:"column:executor_department;type:bigint(20) unsigned;default:0;not null;comment:执行人部门"` + HappenTime int64 `json:"happentime" gorm:"column:happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:时间"` + Baseline string `json:"baseline" gorm:"column:baseline;type:text;comment:基准线"` + ScoringMethod int `json:"scoringmethod" gorm:"column:scoring_method;type:tinyint(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"` + ScoringScore float64 `json:"scoringscore" gorm:"column:scoring_score;type:bigint(20) unsigned;default:0;not null;comment:手动分"` +} + +func (PostMeteringFlow *PostMeteringFlow) TableName() string { + return "post_metering_flow" +} + +// 编辑内容 +func (cont *PostMeteringFlow) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *PostMeteringFlow) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *PostMeteringFlow) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *PostMeteringFlow) ContMap(whereMap interface{}, field ...string) (countAry []PostMeteringFlow, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *PostMeteringFlow) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/post_nature_flow.go b/models/modelskpi/post_nature_flow.go new file mode 100644 index 0000000..5d777a3 --- /dev/null +++ b/models/modelskpi/post_nature_flow.go @@ -0,0 +1,84 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 定性考核流水 +type PostNatureFlow struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;autoIncrement;comment:ID"` + OrderId int64 `json:"orderid" gorm:"column:order_id;type:bigint(20) unsigned;default:0;not null;comment:审批单ID"` + AddOrDecrease int `json:"addordecrease" gorm:"column:add_or_decrease;type:tinyint(1) unsigned;default:1;not null;comment:增加或减少(1:增加;2:减少)"` + Score float64 `json:"score" gorm:"column:score;type:bigint(20) unsigned;default:0;not null;comment:分值(*100保存)"` + Money float64 `json:"money" gorm:"column:money;type:bigint(20) unsigned;default:0;not null;comment:钱(扣款或奖励)*100保存"` + Reason string `json:"reason" gorm:"column:reason;type:text;comment:这样操作的原因"` + ShemeId int64 `json:"shemeid" gorm:"column:sheme_id;type:bigint(20) unsigned;default:0;not null;comment:方案ID"` + ShemeVersion string `json:"shemeversion" gorm:"column:sheme_version;type:varchar(255) ;not null;comment:方案版本编号"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + SonTarget int64 `json:"sontarget" gorm:"column:son_target;type:bigint(20) unsigned;default:0;not null;comment:指标子栏目"` + Detailed int64 `json:"detailed" gorm:"column:detailed;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Year int64 `json:"year" gorm:"column:year;type:int(7) unsigned;default:0;not null;comment:年"` + Quarter int64 `json:"quarter" gorm:"column:quarter;type:int(3) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:month;type:int(3) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:week;type:int(3) unsigned;default:0;not null;comment:周"` + PersonLiable int64 `json:"personliable" gorm:"column:person_liable;type:bigint(20) unsigned;default:0;not null;comment:责任人"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Executor int64 `json:"executor" gorm:"column:executor;type:bigint(20) unsigned;default:0;not null;comment:执行人"` + ExecutorDepartment int64 `json:"executordepartment" gorm:"column:executor_department;type:bigint(20) unsigned;default:0;not null;comment:执行人部门"` + Rectification int `json:"rectification" gorm:"column:rectification;type:tinyint(1) unsigned;default:2;not null;comment:是否需要整改 1、需要整改;2:无需整改"` + CorrectionTime int64 `json:"correctiontime" gorm:"column:correction_time;type:bigint(20) unsigned;default:0;not null;comment:整改期限"` + HappenTime int64 `json:"happentime" gorm:"column:happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + HappenCount int `json:"happencount" gorm:"column:happen_count;type:int(7) unsigned;default:0;not null;comment:发生次数"` + HappenCountMoney int `json:"happencountmoney" gorm:"column:happen_count_money;type:int(7) unsigned;default:0;not null;comment:发生次数(钱)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:时间"` +} + +func (PostNatureFlow *PostNatureFlow) TableName() string { + return "post_nature_flow" +} + +// 编辑内容 +func (cont *PostNatureFlow) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *PostNatureFlow) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *PostNatureFlow) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *PostNatureFlow) ContMap(whereMap interface{}, field ...string) (countAry []PostNatureFlow, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *PostNatureFlow) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/post_sun_target.go b/models/modelskpi/post_sun_target.go new file mode 100644 index 0000000..51b9ccf --- /dev/null +++ b/models/modelskpi/post_sun_target.go @@ -0,0 +1,62 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 岗位定性指标子栏目 +type PostSonTarget struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:title;type:varchar(255) unsigned;default:'';not null;comment:标题"` + ParentId int64 `json:"parentid" gorm:"column:parent_id;type:bigint(20) unsigned;default:0;not null;comment:归属指标"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Depart string `json:"depart" gorm:"column:depart;type:longtext ;default:0;comment:关联部门"` + DepartPost string `json:"departpost" gorm:"column:depart_post;type:longtext ;default:'';comment:关联部门岗位"` +} + +func (PostSonTarget *PostSonTarget) TableName() string { + return "post_sun_target" +} + +// 编辑内容 +func (cont *PostSonTarget) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *PostSonTarget) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *PostSonTarget) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *PostSonTarget) ContMap(whereMap interface{}, field ...string) (countAry []PostSonTarget, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *PostSonTarget) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/post_target.go b/models/modelskpi/post_target.go new file mode 100644 index 0000000..39fbe01 --- /dev/null +++ b/models/modelskpi/post_target.go @@ -0,0 +1,77 @@ +package modelskpi + +import ( + "appPlatform/overall" + "fmt" + "strings" +) + +// 岗位指标 +type PostTarget struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:title;type:varchar(255) unsigned;default:'';not null;comment:标题"` + Type int `json:"type" gorm:"column:type;type:int(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Share int `json:"share" gorm:"column:share;type:int(1) unsigned;default:1;not null;comment:1:共用;2:私用"` + ReleDepart int64 `json:"reledepart" gorm:"column:rele_depart;type:bigint(20) unsigned;default:0;not null;comment:相关部门"` + DepartmentsPost string `json:"departmentspost" gorm:"column:departments_post;type:text ;default:'';comment:相关岗位"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Key int64 `json:"key" gorm:"column:key;type:bigint(20) unsigned;default:0;not null;comment:UUID"` + Report string `json:"report" gorm:"column:report;type:text ;default:'';comment:上报人"` + Unit string `json:"unit" gorm:"column:unit;type:varchar(255) unsigned;default:'';not null;comment:单位"` + Cycle int `json:"cycle" gorm:"column:cycle;type:int(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"` + Cycleattr int `json:"cycleattr" gorm:"column:cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` + ScoringMethod int `json:"scoringmethod" gorm:"column:scoring_method;type:int(1) unsigned;default:0;not null;comment:计分方式(1:自动;2:手动)"` + VisibleRange string `json:"visiblerange" gorm:"column:visible_range;type:text ;default:'';comment:可见范围"` + VisibleGroup string `json:"visiblegroup" gorm:"column:visible_group;type:text ;default:'';comment:可见范围(集团)"` +} + +func (PostTarget *PostTarget) TableName() string { + return "post_target" +} + +// 编辑内容 +func (cont *PostTarget) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *PostTarget) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + // fieldStr := strings.Join(field, ",") + // gormDb = gormDb.Select(fieldStr) + for _, v := range field { + gormDb = gormDb.Select(v) + } + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + fmt.Printf("GetCont---------->%v------->%v\n", err, cont) + return +} + +// 根据条件获取总数 +func (cont *PostTarget) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *PostTarget) ContMap(whereMap interface{}, field ...string) (countAry []PostTarget, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *PostTarget) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/post_target_details.go b/models/modelskpi/post_target_details.go new file mode 100644 index 0000000..3fd26f1 --- /dev/null +++ b/models/modelskpi/post_target_details.go @@ -0,0 +1,77 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 指标细则 +type PostTargetDetails struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:title;type:text;comment:指标细则"` + Content string `json:"content" gorm:"column:content;type:text;comment:指标说明"` + ParentId int64 `json:"parentid" gorm:"column:parentid;type:bigint(20) unsigned;default:0;not null;comment:归属指标栏目"` + ParentIdSun int64 `json:"parentidsun" gorm:"column:parentid_sun;type:bigint(20) unsigned;default:0;not null;comment:归属指标子栏目"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AddTime int64 `json:"addtime" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:制定时间"` + MinScore int64 `json:"minscore" gorm:"column:min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` + MaxScore int64 `json:"maxscore" gorm:"column:max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` + Company string `json:"company" gorm:"column:company;type:varchar(20) unsigned;default:0;not null;comment:单位"` + AddReduce int `json:"addreduce" gorm:"column:add_reduce;type:int(1) unsigned;default:1;not null;comment:1:减少;2:增加;3:无属性,现场确认加或减"` + CensorType string `json:"censortype" gorm:"column:censor_type;type:text;comment:检查方式"` + CensorCont string `json:"censorcont" gorm:"column:censor_cont;type:longtext;comment:检查依据"` + CensorRate int `json:"censorrate" gorm:"column:censor_rate;type:int(5) unsigned;default:1;not null;comment:检查频次"` + Cycles int `json:"cycle" gorm:"column:cycle;type:tinyint(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"` + CycleAttres int `json:"cycleattr" gorm:"column:cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` + Paretment string `json:"paretment" gorm:"column:paretment;type:longtext;comment:接受考核的部门"` + ParetmentPost string `json:"paretmentpost" gorm:"column:paretment_post;type:longtext;comment:接受考核的部门岗位"` + Reportary string `json:"reportary" gorm:"column:reportary;type:longtext;comment:提报人"` + Punishmode int `json:"punishmode" gorm:"column:punishmode;type:tinyint(1) unsigned;default:1;not null;comment:处罚方式 1:扣分;2:现金处罚;3:扣分加现金"` + Maxmoney int64 `json:"maxmoney" gorm:"column:maxmoney;type:bigint(20) unsigned;default:0;not null;comment:最高罚款"` + Minmoney int64 `json:"minmoney" gorm:"column:minmoney;type:bigint(20) unsigned;default:0;not null;comment:最低罚款"` +} + +func (PostTargetDetails *PostTargetDetails) TableName() string { + return "post_target_details" +} + +// 编辑内容 +func (cont *PostTargetDetails) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *PostTargetDetails) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *PostTargetDetails) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *PostTargetDetails) ContMap(whereMap interface{}, field ...string) (countAry []PostTargetDetails, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *PostTargetDetails) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/post_workflow_orders.go b/models/modelskpi/post_workflow_orders.go new file mode 100644 index 0000000..fded902 --- /dev/null +++ b/models/modelskpi/post_workflow_orders.go @@ -0,0 +1,84 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 岗位审批工作流 +type PostWorkflowOrders struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;autoIncrement;comment:ID"` + OrderId int64 `json:"orderid" gorm:"column:order_id;type:bigint(20) unsigned;default:0;not null;comment:审批单ID"` + Step int `json:"step" gorm:"column:step;type:int(5) unsigned;default:0;not null;comment:当前执行到第几步"` + NextStep int `json:"nextstep" gorm:"column:next_step;type:int(5) unsigned;default:0;not null;comment:下一步执行哪个步骤"` + NextExecutor string `json:"nextexecutor" gorm:"column:next_executor;type:longtext;comment:下一步执行人"` + CountStep int `json:"countstep" gorm:"column:count_step;type:int(5) unsigned;default:0;not null;comment:总共几步"` + WorkFlow string `json:"workflow" gorm:"column:work_flow;type:longtext;comment:工作流(审批json字符串)"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Class int `json:"class" gorm:"column:class;type:tinyint(1) unsigned;default:1;not null;comment:属性1、定性;2、定量"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + SonTarget int64 `json:"sontarget" gorm:"column:son_target;type:bigint(20) unsigned;default:0;not null;comment:指标子栏目"` + Detailed int64 `json:"detailed" gorm:"column:detailed;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Executor int64 `json:"executor" gorm:"column:executor;type:bigint(20) unsigned;default:0;not null;comment:执行人"` + ExecutorDepartment int64 `json:"executordepartment" gorm:"column:executor_department;type:bigint(20) unsigned;default:0;not null;comment:执行人部门"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:流程状态 流程状态 1:草稿;2:审批中;3:驳回;4:归档;5:废弃;6:删除"` + StartTime int64 `json:"starttime" gorm:"column:start_time;type:bigint(20) unsigned;default:0;not null;comment:流程开始时间"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:时间"` + EnclosureFormat string `json:"enclosureformat" gorm:"column:enclosure_format;type:longtext;comment:附件"` + Participants string `json:"participants" gorm:"column:participants;type:longtext;comment:流程参与人"` + Year int64 `json:"year" gorm:"column:year;type:int(7) unsigned;default:0;not null;comment:年"` + Quarter int64 `json:"quarter" gorm:"column:quarter;type:int(3) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:month;type:int(3) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:week;type:int(3) unsigned;default:0;not null;comment:周"` + PersonLiable int64 `json:"personliable" gorm:"column:person_liable;type:bigint(20) unsigned;default:0;not null;comment:责任人"` + HappenTime int64 `json:"happentime" gorm:"column:happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` +} + +func (PostWorkflowOrders *PostWorkflowOrders) TableName() string { + return "post_workflow_orders" +} + +// 编辑内容 +func (cont *PostWorkflowOrders) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *PostWorkflowOrders) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *PostWorkflowOrders) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *PostWorkflowOrders) ContMap(whereMap interface{}, field ...string) (countAry []PostWorkflowOrders, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *PostWorkflowOrders) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/qualitative_evaluation.go b/models/modelskpi/qualitative_evaluation.go new file mode 100644 index 0000000..23b9c90 --- /dev/null +++ b/models/modelskpi/qualitative_evaluation.go @@ -0,0 +1,89 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 部门方案 +// 性质考核方案明细 +type QualitativeEvaluation struct { + Id int64 `json:"id" gorm:"primaryKey;column:qe_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:qe_title;type:text;comment:考核名称"` + DepartmentId string `json:"parentid" gorm:"column:qe_department_id;type:text;comment:执行考核部门ID"` + Dimension int64 `json:"dimension" gorm:"column:qe_dimension;type:bigint(20) unsigned;default:0;not null;comment:考核维度"` + Target int64 `json:"target" gorm:"column:qe_target;type:bigint(20) unsigned;default:0;not null;comment:考核指标"` + TargetSun int64 `json:"targetsun" gorm:"column:qe_target_sun;type:bigint(20) unsigned;default:0;not null;comment:考核指标子栏目"` + DetailedTarget int64 `json:"detailedtarget" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"` + Type int `json:"type" gorm:"column:qe_type;type:int(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` + Weight int64 `json:"weight" gorm:"column:qe_weight;type:int(5) unsigned;default:0;not null;comment:权重"` + Unit string `json:"unit" gorm:"column:qe_unit;type:varchar(255);comment:单位"` + ReferenceScore int64 `json:"referencescore" gorm:"column:qe_reference_score;type:int(9) unsigned;default:0;not null;comment:标准分值"` + State int `json:"state" gorm:"column:qe_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Addtime int64 `json:"addtime" gorm:"column:qe_addtime;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` + Eitetime int64 `json:"eitetime" gorm:"column:qe_eitetime;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Group int64 `json:"group" gorm:"column:qe_group;type:bigint(20) unsigned;default:0;not null;comment:归属集团"` + QualEvalId string `json:"qualevalid" gorm:"column:qe_qual_eval_id;type:varchar(200) unsigned;default:0;not null;comment:性质考核方案"` + Cycles int `json:"cycle" gorm:"column:qe_cycle;type:tinyint(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"` + CycleAttres int `json:"cycleattr" gorm:"column:qe_cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` + AcceptEvaluation int64 `json:"acceptevaluation" gorm:"column:qe_accept_evaluation;type:bigint(20) unsigned;default:0;not null;comment:接受考核部门"` + Operator string `json:"operator" gorm:"column:qe_operator;type:text;comment:执行人"` + Content string `json:"content" gorm:"column:qe_content;type:text;comment:补充说明"` + MinScore int64 `json:"minscore" gorm:"column:qe_min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` + MaxScore int64 `json:"maxscore" gorm:"column:qe_max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` + CensorType string `json:"censortype" gorm:"column:qe_censor_type;type:tinyint(1) unsigned;default:1;not null;comment:检查方式"` + CensorCont string `json:"censorcont" gorm:"column:qe_censor_cont;type:longtext;comment:检查依据"` + CensorRate int `json:"censorrate" gorm:"column:qe_censor_rate;type:int(5) unsigned;default:1;not null;comment:检查频次"` + Observer int `json:"observer" gorm:"column:observer;type:tinyint(1) unsigned;default:1;not null;comment:1:启用;2:禁用;3:观察"` +} + +func (QualitativeEvaluation *QualitativeEvaluation) TableName() string { + return "qualitative_evaluation" +} + +// 新增内容 +func (cont *QualitativeEvaluation) AddCont() (err error) { + err = overall.CONSTANT_DB_KPI.Create(&cont).Error + return +} + +// 编辑内容 +func (cont *QualitativeEvaluation) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *QualitativeEvaluation) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *QualitativeEvaluation) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *QualitativeEvaluation) ContMap(whereMap interface{}, field ...string) (countAry []QualitativeEvaluation, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *QualitativeEvaluation) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/qualitative_evaluation_scheme.go b/models/modelskpi/qualitative_evaluation_scheme.go new file mode 100644 index 0000000..7b6a1d7 --- /dev/null +++ b/models/modelskpi/qualitative_evaluation_scheme.go @@ -0,0 +1,81 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 岗位评估方案 +type QualitativeEvaluationScheme struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + VersionNumber string `json:"versionnumber" gorm:"column:version_number;type:varchar(255) unsigned;not null;comment:版本编号"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:归属公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:归属部门"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:归属岗位"` + Title string `json:"title" gorm:"column:title;type:varchar(255) ;default:'';comment:考核项名称"` + Content string `json:"content" gorm:"column:content;type:text ;default:'';comment:考核说明"` + DimensionId int64 `json:"dimensionid" gorm:"column:dimension_id;type:bigint(20) unsigned;default:0;not null;comment:维度"` + TargetId int64 `json:"targetid" gorm:"column:target_id;type:bigint(20) unsigned;default:0;not null;comment:指标"` + SonTargetId int64 `json:"sontargetid" gorm:"column:son_target_id;type:bigint(20) unsigned;default:0;not null;comment:子栏目"` + DetailsId int64 `json:"detailsid" gorm:"column:details_id;type:bigint(20) unsigned;default:0;not null;comment:细则"` + Attribute int `json:"attribute" gorm:"column:attribute;type:tinyint(1) unsigned;default:1;not null;comment:属性 1:定性考核;2:定量考核"` + MinScore int64 `json:"minscore" gorm:"column:min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` + MaxScore int64 `json:"maxscore" gorm:"column:max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` + ScoringMethod int `json:"scoringmethod" gorm:"column:scoring_method;type:tinyint(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Addtime int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` + Eitetime int64 `json:"eitetime" gorm:"column:eitetime;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + CensorType string `json:"censortype" gorm:"column:censor_type;type:tinytext;comment:检查方式(1:现场检查;2:资料检查;3:事件触发)"` + Source int `json:"source" gorm:"column:source;type:tinyint(1) unsigned;default:1;not null;comment:来源(1:岗位;2:部门引用)"` + RunState int `json:"run_state" gorm:"column:run_state;type:tinyint(1) unsigned;default:1;not null;comment:运行状态(1:启用;2:禁用;3:观察)"` + Punishmode int `json:"punishmode" gorm:"column:punishmode;type:tinyint(1) unsigned;default:1;not null;comment:处罚方式 1:扣分;2:现金处罚;3:扣分加现金"` + Maxmoney int64 `json:"maxmoney" gorm:"column:maxmoney;type:bigint(20) unsigned;default:0;not null;comment:最高罚款*100保存"` + Minmoney int64 `json:"minmoney" gorm:"column:minmoney;type:bigint(20) unsigned;default:0;not null;comment:最低罚款*100保存"` + AddReduce int `json:"add_reduce" gorm:"column:add_reduce;type:int(1) unsigned;default:0;not null;comment:1:减少;2:增加;3:无属性,现场确认加或减"` +} + +func (QualitativeEvaluationScheme *QualitativeEvaluationScheme) TableName() string { + return "qualitative_evaluation_scheme" +} + +// 编辑内容 +func (cont *QualitativeEvaluationScheme) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *QualitativeEvaluationScheme) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *QualitativeEvaluationScheme) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *QualitativeEvaluationScheme) ContMap(whereMap interface{}, field ...string) (countAry []QualitativeEvaluationScheme, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *QualitativeEvaluationScheme) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/qualitative_evaluation_view.go b/models/modelskpi/qualitative_evaluation_view.go new file mode 100644 index 0000000..1b2191a --- /dev/null +++ b/models/modelskpi/qualitative_evaluation_view.go @@ -0,0 +1,95 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" + "time" +) + +type QualitativeEvaluationView struct { + Id int64 `json:"id" gorm:"primaryKey;column:qe_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:qe_title;type:text;comment:考核名称"` + DepartmentId string `json:"parentid" gorm:"column:qe_department_id;type:text;comment:执行考核部门ID"` + Dimension int64 `json:"dimension" gorm:"column:qe_dimension;type:bigint(20) unsigned;default:0;not null;comment:考核维度"` + Target int64 `json:"target" gorm:"column:qe_target;type:bigint(20) unsigned;default:0;not null;comment:考核指标"` + TargetSun int64 `json:"targetsun" gorm:"column:qe_target_sun;type:bigint(20) unsigned;default:0;not null;comment:考核指标子栏目"` + DetailedTarget int64 `json:"detailedtarget" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"` + Type int `json:"type" gorm:"column:qe_type;type:int(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` + Weight int64 `json:"weight" gorm:"column:qe_weight;type:int(5) unsigned;default:0;not null;comment:权重"` + Unit string `json:"unit" gorm:"column:qe_unit;type:varchar(255);comment:单位"` + ReferenceScore int64 `json:"referencescore" gorm:"column:qe_reference_score;type:int(9) unsigned;default:0;not null;comment:标准分值"` + State int `json:"state" gorm:"column:qe_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Addtime int64 `json:"addtime" gorm:"column:qe_addtime;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` + Eitetime int64 `json:"eitetime" gorm:"column:qe_eitetime;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Group int64 `json:"group" gorm:"column:qe_group;type:bigint(20) unsigned;default:0;not null;comment:归属集团"` + QualEvalId string `json:"qualevalid" gorm:"column:qe_qual_eval_id;type:varchar(200) unsigned;default:0;not null;comment:性质考核方案"` + Cycles int `json:"cycle" gorm:"column:qe_cycle;type:tinyint(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"` + CycleAttres int `json:"cycleattr" gorm:"column:qe_cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` + AcceptEvaluation int64 `json:"acceptevaluation" gorm:"column:qe_accept_evaluation;type:bigint(20) unsigned;default:0;not null;comment:接受考核部门"` + Operator string `json:"operator" gorm:"column:qe_operator;type:text;comment:执行人"` + Content string `json:"content" gorm:"column:qe_content;type:text;comment:补充说明"` + MinScore int64 `json:"minscore" gorm:"column:qe_min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` + MaxScore int64 `json:"maxscore" gorm:"column:qe_max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` + CensorType string `json:"censortype" gorm:"column:qe_censor_type;type:tinyint(1) unsigned;default:1;not null;comment:检查方式"` + CensorCont string `json:"censorcont" gorm:"column:qe_censor_cont;type:longtext;comment:检查依据"` + CensorRate int `json:"censorrate" gorm:"column:qe_censor_rate;type:int(5) unsigned;default:1;not null;comment:检查频次"` + EtTitle string `json:"ettitle" gorm:"column:et_title;type:varchar(255);comment:指标名称"` +} + +func (QualitativeEvaluationView *QualitativeEvaluationView) TableName() string { + return "qualitative_evaluation_view" +} + +// 编辑内容 +func (cont *QualitativeEvaluationView) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *QualitativeEvaluationView) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *QualitativeEvaluationView) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *QualitativeEvaluationView) ContMap(whereMap interface{}, field ...string) (countAry []QualitativeEvaluationView, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *QualitativeEvaluationView) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} + +// 判断子目标是否存在 +func (cont *QualitativeEvaluationView) JudgeIsTrue(whereMap interface{}, addCont QualitativeEvaluationView) (err error) { + err = cont.GetCont(whereMap) + if err != nil { + err = overall.CONSTANT_DB_KPI.Create(&addCont).Error + } else { + if cont.State != 1 { + err = cont.EiteCont(map[string]interface{}{"`q_id`": cont.Id}, map[string]interface{}{"`q_state`": 1, "`q_time`": time.Now().Unix()}) + } + } + return nil +} diff --git a/models/modelskpi/qualitative_target.go b/models/modelskpi/qualitative_target.go new file mode 100644 index 0000000..132e400 --- /dev/null +++ b/models/modelskpi/qualitative_target.go @@ -0,0 +1,75 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" + "time" +) + +// 定性测评指标子栏目 +type QualitativeTarget struct { + Id int64 `json:"id" gorm:"primary_key;column:q_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:q_title;type:varchar(255);comment:指标子栏目名称"` + ParentId int64 `json:"parentid" gorm:"column:q_parent_id;type:bigint(20) unsigned;default:0;not null;comment:归属指标"` + State int `json:"state" gorm:"column:q_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AddTime int64 `json:"addTime" gorm:"column:q_time;type:bigint(20) unsigned;default:0;not null;comment:制定时间"` + Depart string `json:"depart" gorm:"column:q_depart;type:mediumtext;comment:关联部门"` +} + +func (QualitativeTarget *QualitativeTarget) TableName() string { + return "qualitative_target" +} + +// 编辑内容 +func (cont *QualitativeTarget) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *QualitativeTarget) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *QualitativeTarget) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *QualitativeTarget) ContMap(whereMap interface{}, field ...string) (countAry []QualitativeTarget, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *QualitativeTarget) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} + +// 判断子目标是否存在 +func (cont *QualitativeTarget) JudgeIsTrue(whereMap interface{}, addCont QualitativeTarget) (err error) { + err = cont.GetCont(whereMap) + if err != nil { + err = overall.CONSTANT_DB_KPI.Create(&addCont).Error + } else { + if cont.State != 1 { + err = cont.EiteCont(map[string]interface{}{"`q_id`": cont.Id}, map[string]interface{}{"`q_state`": 1, "`q_time`": time.Now().Unix()}) + } + } + return nil +} diff --git a/models/modelskpi/quan_people_config.go b/models/modelskpi/quan_people_config.go new file mode 100644 index 0000000..b7a2053 --- /dev/null +++ b/models/modelskpi/quan_people_config.go @@ -0,0 +1,73 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 岗位定量考核目标设定 +type QuanPeopleConfig struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + UserKey int64 `json:"userkey" gorm:"column:user_key;type:bigint(20) unsigned;default:0;not null;comment:人员key"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门ID"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + Detailed int64 `json:"detailed" gorm:"column:detailed;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Type int64 `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:0;not null;comment:1、年度;2、季度;3、月度"` + Year int64 `json:"year" gorm:"column:year;type:bigint(20) unsigned;default:0;not null;comment:年度"` + Timecopy int64 `json:"timecopy" gorm:"column:timecopy;type:int(3) unsigned;default:0;not null;comment:季度与月度辅助值"` + Zeroprize float64 `json:"zeroprize" gorm:"column:zeroprize;type:int(7) unsigned;default:0;not null;comment:零奖值"` + Allprize float64 `json:"allprize" gorm:"column:allprize;type:int(7) unsigned;default:0;not null;comment:全奖值"` + Capping int `json:"capping" gorm:"column:capping;type:int(1) unsigned;default:2;not null;comment:是否封顶(1、是;2:否)"` + CappingVal float64 `json:"cappingval" gorm:"column:capping_val;type:bigint(20) unsigned;default:0;not null;comment:封顶值"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (QuanPeopleConfig *QuanPeopleConfig) TableName() string { + return "quan_people_config" +} + +// 编辑内容 +func (cont *QuanPeopleConfig) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *QuanPeopleConfig) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *QuanPeopleConfig) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *QuanPeopleConfig) ContMap(whereMap interface{}, field ...string) (countAry []QuanPeopleConfig, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *QuanPeopleConfig) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/quan_people_config_target.go b/models/modelskpi/quan_people_config_target.go new file mode 100644 index 0000000..2d458dd --- /dev/null +++ b/models/modelskpi/quan_people_config_target.go @@ -0,0 +1,76 @@ +package modelskpi + +// + +import ( + "appPlatform/overall" + "strings" +) + +// 岗位定量考核目标设定 +type QuanPeopleConfigTarget struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:title;type:varchar(255) unsigned;default:'';not null;comment:标题"` + UserKey int64 `json:"userkey" gorm:"column:user_key;type:bigint(20) unsigned;default:0;not null;comment:使用人"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门ID"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + Detailed int64 `json:"detailed" gorm:"column:detailed;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Type int64 `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:0;not null;comment:1、年度;2、季度;3、月度"` + Year int64 `json:"year" gorm:"column:year;type:bigint(20) unsigned;default:0;not null;comment:年度"` + Timecopy int64 `json:"timecopy" gorm:"column:timecopy;type:int(3) unsigned;default:0;not null;comment:季度与月度辅助值"` + Zeroprize float64 `json:"zeroprize" gorm:"column:zeroprize;type:int(7) unsigned;default:0;not null;comment:零奖值"` + Allprize float64 `json:"allprize" gorm:"column:allprize;type:int(7) unsigned;default:0;not null;comment:全奖值"` + Capping int `json:"capping" gorm:"column:capping;type:int(1) unsigned;default:2;not null;comment:是否封顶(1、是;2:否)"` + CappingVal float64 `json:"cappingval" gorm:"column:capping_val;type:bigint(20) unsigned;default:0;not null;comment:封顶值"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (QuanPeopleConfigTarget *QuanPeopleConfigTarget) TableName() string { + return "quan_people_config_target" +} + +// 编辑内容 +func (cont *QuanPeopleConfigTarget) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *QuanPeopleConfigTarget) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *QuanPeopleConfigTarget) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *QuanPeopleConfigTarget) ContMap(whereMap interface{}, field ...string) (countAry []QuanPeopleConfigTarget, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *QuanPeopleConfigTarget) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/quan_post_config.go b/models/modelskpi/quan_post_config.go new file mode 100644 index 0000000..4847637 --- /dev/null +++ b/models/modelskpi/quan_post_config.go @@ -0,0 +1,72 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 岗位定量考核目标设定 +type QuanPostConfig struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门ID"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + Detailed int64 `json:"detailed" gorm:"column:detailed;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Type int64 `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:0;not null;comment:1、年度;2、季度;3、月度"` + Year int64 `json:"year" gorm:"column:year;type:bigint(20) unsigned;default:0;not null;comment:年度"` + Timecopy int64 `json:"timecopy" gorm:"column:timecopy;type:int(3) unsigned;default:0;not null;comment:季度与月度辅助值"` + Zeroprize float64 `json:"zeroprize" gorm:"column:zeroprize;type:int(7) unsigned;default:0;not null;comment:零奖值"` + Allprize float64 `json:"allprize" gorm:"column:allprize;type:int(7) unsigned;default:0;not null;comment:全奖值"` + Capping int `json:"capping" gorm:"column:capping;type:int(1) unsigned;default:2;not null;comment:是否封顶(1、是;2:否)"` + CappingVal float64 `json:"cappingval" gorm:"column:capping_val;type:bigint(20) unsigned;default:0;not null;comment:封顶值"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (QuanPostConfig *QuanPostConfig) TableName() string { + return "quan_post_config" +} + +// 编辑内容 +func (cont *QuanPostConfig) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *QuanPostConfig) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *QuanPostConfig) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *QuanPostConfig) ContMap(whereMap interface{}, field ...string) (countAry []QuanPostConfig, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *QuanPostConfig) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/quan_post_config_target.go b/models/modelskpi/quan_post_config_target.go new file mode 100644 index 0000000..071460d --- /dev/null +++ b/models/modelskpi/quan_post_config_target.go @@ -0,0 +1,75 @@ +package modelskpi + +// + +import ( + "appPlatform/overall" + "strings" +) + +// 岗位定量考核目标设定 +type QuanPostConfigTarget struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:title;type:varchar(255) unsigned;default:'';not null;comment:标题"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门ID"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + Detailed int64 `json:"detailed" gorm:"column:detailed;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Type int64 `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:0;not null;comment:1、年度;2、季度;3、月度"` + Year int64 `json:"year" gorm:"column:year;type:bigint(20) unsigned;default:0;not null;comment:年度"` + Timecopy int64 `json:"timecopy" gorm:"column:timecopy;type:int(3) unsigned;default:0;not null;comment:季度与月度辅助值"` + Zeroprize float64 `json:"zeroprize" gorm:"column:zeroprize;type:int(7) unsigned;default:0;not null;comment:零奖值"` + Allprize float64 `json:"allprize" gorm:"column:allprize;type:int(7) unsigned;default:0;not null;comment:全奖值"` + Capping int `json:"capping" gorm:"column:capping;type:int(1) unsigned;default:2;not null;comment:是否封顶(1、是;2:否)"` + CappingVal float64 `json:"cappingval" gorm:"column:capping_val;type:bigint(20) unsigned;default:0;not null;comment:封顶值"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (QuanPostConfigTarget *QuanPostConfigTarget) TableName() string { + return "quan_post_config_target" +} + +// 编辑内容 +func (cont *QuanPostConfigTarget) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *QuanPostConfigTarget) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *QuanPostConfigTarget) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *QuanPostConfigTarget) ContMap(whereMap interface{}, field ...string) (countAry []QuanPostConfigTarget, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *QuanPostConfigTarget) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/quantitative_config.go b/models/modelskpi/quantitative_config.go new file mode 100644 index 0000000..8ca9ef0 --- /dev/null +++ b/models/modelskpi/quantitative_config.go @@ -0,0 +1,70 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 定量考核目标设定 +type QuantitativeConfig struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + DepartmentId int64 `json:"departmentid" gorm:"column:departmentid;type:bigint(20) unsigned;default:0;not null;comment:部门ID"` + Group int64 `json:"group" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:集团ID"` + Dimension int64 `json:"dimension" gorm:"column:dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Target int64 `json:"target" gorm:"column:target;type:bigint(20) unsigned;default:0;not null;comment:指标"` + TargetConfig int64 `json:"targetconfig" gorm:"column:targetconfig;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Type int64 `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:0;not null;comment:1、年度;2、季度;3、月度"` + Year int64 `json:"year" gorm:"column:year;type:bigint(20) unsigned;default:0;not null;comment:年度"` + Timecopy int64 `json:"timecopy" gorm:"column:timecopy;type:int(3) unsigned;default:0;not null;comment:季度与月度辅助值"` + Zeroprize float64 `json:"zeroprize" gorm:"column:zeroprize;type:int(7) unsigned;default:0;not null;comment:零奖值"` + Allprize float64 `json:"allprize" gorm:"column:allprize;type:int(7) unsigned;default:0;not null;comment:全奖值"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Capping int `json:"capping" gorm:"column:capping;type:int(1) unsigned;default:2;not null;comment:是否封顶(1、是;2:否)"` + CappingVal float64 `json:"cappingval" gorm:"column:capping_val;type:bigint(20) unsigned;default:0;not null;comment:封顶值"` +} + +func (QuantitativeConfig *QuantitativeConfig) TableName() string { + return "quantitative_config" +} + +// 编辑内容 +func (cont *QuantitativeConfig) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *QuantitativeConfig) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *QuantitativeConfig) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *QuantitativeConfig) ContMap(whereMap interface{}, field ...string) (countAry []QuantitativeConfig, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *QuantitativeConfig) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/rectification_measures.go b/models/modelskpi/rectification_measures.go new file mode 100644 index 0000000..811b6ae --- /dev/null +++ b/models/modelskpi/rectification_measures.go @@ -0,0 +1,72 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 整改措施 +type RectificationMeasures struct { + Id int64 `json:"id" gorm:"primaryKey;column:rm_id;type:bigint(20) unsigned;not null"` + UserKey int64 `json:"userkey" gorm:"column:rm_user_key;type:bigint(20) unsigned;default:0;not null;comment:整改人"` + Department int64 `json:"department" gorm:"column:rm_department;type:bigint(20) unsigned;default:0;not null;comment:整改部门"` + Group int64 `json:"group" gorm:"column:rm_group;type:bigint(20) unsigned;default:0;not null;comment:集团"` + OrderKey int64 `json:"order" gorm:"column:rm_order;type:bigint(20) unsigned;default:0;not null;comment:订单ID"` + State int `json:"state" gorm:"column:rm_state;type:int(1) unsigned;default:1;not null;comment:1:草果;2:审批中;3:不合格;4:合格"` + Time int64 `json:"time" gorm:"column:rm_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eitetime" gorm:"column:rm_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` + Content string `json:"content" gorm:"column:rm_content;type:longtext;comment:整改内容"` + Enclosure string `json:"enclosure" gorm:"column:rm_files;type:longtext;comment:附件"` + DepartPost int `json:"departpost" gorm:"column:depart_post;type:int(1) unsigned;default:1;not null;comment:1、部门;2:岗位"` +} + +func (RectificationMeasures *RectificationMeasures) TableName() string { + return "rectification_measures" +} + +// 添加 +func (cont *RectificationMeasures) AddCont() (err error) { + err = overall.CONSTANT_DB_KPI.Create(&cont).Error + return +} + +// 编辑内容 +func (cont *RectificationMeasures) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *RectificationMeasures) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *RectificationMeasures) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *RectificationMeasures) ContMap(whereMap interface{}, field ...string) (countAry []RectificationMeasures, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *RectificationMeasures) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/register.go b/models/modelskpi/register.go new file mode 100644 index 0000000..8fd88cb --- /dev/null +++ b/models/modelskpi/register.go @@ -0,0 +1,65 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 订单挂号 +type Register struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null"` + Number int64 `json:"userkey" gorm:"column:number;type:bigint(20) unsigned;default:0;not null;comment:号码"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:1:正常;2:已经使用"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (Register *Register) TableName() string { + return "register" +} + +// 添加 +func (cont *Register) AddCont() (err error) { + err = overall.CONSTANT_DB_KPI.Create(&cont).Error + return +} + +// 编辑内容 +func (cont *Register) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *Register) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *Register) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *Register) ContMap(whereMap interface{}, field ...string) (countAry []Register, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *Register) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/score_flow.go b/models/modelskpi/score_flow.go new file mode 100644 index 0000000..74b9a8e --- /dev/null +++ b/models/modelskpi/score_flow.go @@ -0,0 +1,82 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 分数流水 +type ScoreFlow struct { + Id int64 `json:"id" gorm:"primaryKey;column:sf_id;type:bigint(20) unsigned;not null;comment:Id"` + EvaluationPlan int64 `json:"evaluationplan" gorm:"column:sf_evaluation_plan;type:bigint(20) unsigned;default:0;not null;comment:考核方案项目ID"` + PlusReduceScore int `json:"plusreducescore" gorm:"column:sf_plus_reduce_score;type:tinyint(1) unsigned;default:1;not null;comment:1:加分;2:减分"` + Score int64 `json:"score" gorm:"column:sf_score;type:bigint(20) unsigned;default:0;not null;comment:分值(乘100录入)"` + Key int64 `json:"key" gorm:"column:sf_key;type:bigint(20) unsigned;default:0;not null;comment:识别标志"` + Reason string `json:"reason" gorm:"column:sf_reason;type:mediumtext;comment:操作原因"` + Content string `json:"content" gorm:"column:sf_content;type:mediumtext;comment:操作结构体"` + Time int64 `json:"time" gorm:"column:sf_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eitetime" gorm:"column:sf_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` + EvaluationDepartment int64 `json:"evaluationdepartment" gorm:"column:sf_evaluation_department;type:bigint(20) unsigned;default:0;not null;comment:测评部门"` + EvaluationUser int64 `json:"evaluationuser" gorm:"column:sf_evaluation_user;type:bigint(20) unsigned;default:0;not null;comment:测评人"` + EvaluationGroup int64 `json:"evaluationgroup" gorm:"column:sf_evaluation_group;type:bigint(20) unsigned;default:0;not null;comment:测评集团"` + Year int64 `json:"year" gorm:"column:sf_year;type:int(7) unsigned;default:0;not null;comment:年分"` + Quarter int64 `json:"quarter" gorm:"column:sf_quarter;type:int(2) unsigned;default:0;not null;comment:季度"` + Month int64 `json:"month" gorm:"column:sf_month;type:int(2) unsigned;default:0;not null;comment:月"` + Week int64 `json:"week" gorm:"column:sf_week;type:int(5) unsigned;default:0;not null;comment:周"` + Enclosure string `json:"enclosure" gorm:"column:sf_enclosure;type:longtext;comment:附件"` + DutyGroup int64 `json:"dutygroup" gorm:"column:sf_duty_group;type:bigint(20) unsigned;default:0;not null;comment:职责集团"` + DutyDepartment int64 `json:"dutydepartment" gorm:"column:sf_duty_department;type:bigint(20) unsigned;default:0;not null;comment:职责部门"` + Reply int `json:"reply" gorm:"column:sf_reply;type:int(2) unsigned;default:1;not null;comment:状态(0:删除;1:起草;2:审批;3:通过)"` + Rectification int `json:"rectification" gorm:"column:sf_rectification;type:tinyint(1) unsigned;default:1;not null;comment:1、需要整改;2:无需整改"` + HappenTime int64 `json:"happentime" gorm:"column:sf_happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` + Count int `json:"count" gorm:"column:sf_count;type:int(5) unsigned;default:1;not null;comment:发生次数"` + CorrectionTime int64 `json:"correctiontime" gorm:"column:sf_correctiontime;type:bigint(20) unsigned;default:0;not null;comment:整改期限"` + PlanVersion string `json:"planversion" gorm:"column:sf_planversion;type:varchar(255);comment:版本号"` + TargetId int64 `json:"targetid" gorm:"column:sf_target_id;type:bigint(20) unsigned;default:0;not null;comment:指标ID"` + DetailedId int64 `json:"detailedid" gorm:"column:sf_detailed_id;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` +} + +func (ScoreFlow *ScoreFlow) TableName() string { + return "score_flow" +} + +// 编辑内容 +func (cont *ScoreFlow) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *ScoreFlow) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *ScoreFlow) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *ScoreFlow) ContMap(whereMap interface{}, field ...string) (countAry []ScoreFlow, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *ScoreFlow) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/sheme_people.go b/models/modelskpi/sheme_people.go new file mode 100644 index 0000000..1f4aa82 --- /dev/null +++ b/models/modelskpi/sheme_people.go @@ -0,0 +1,87 @@ +package modelskpi + +//岗位考核项目与提报人关联视图 +import ( + "appPlatform/overall" + "strings" +) + +// 岗位评估方案 +type ShemePeople struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + VersionNumber string `json:"versionnumber" gorm:"column:version_number;type:varchar(255) unsigned;not null;comment:版本编号"` + CompanyId int64 `json:"companyid" gorm:"column:company_id;type:bigint(20) unsigned;default:0;not null;comment:归属公司"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:归属部门"` + OrgId int64 `json:"orgid" gorm:"column:org_id;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:归属岗位"` + Title string `json:"title" gorm:"column:title;type:varchar(255) ;default:'';comment:考核项名称"` + DimensionId int64 `json:"dimensionid" gorm:"column:dimension_id;type:bigint(20) unsigned;default:0;not null;comment:维度"` + TargetId int64 `json:"targetid" gorm:"column:target_id;type:bigint(20) unsigned;default:0;not null;comment:指标"` + SonTargetId int64 `json:"sontargetid" gorm:"column:son_target_id;type:bigint(20) unsigned;default:0;not null;comment:子栏目"` + DetailsId int64 `json:"detailsid" gorm:"column:details_id;type:bigint(20) unsigned;default:0;not null;comment:细则"` + Attribute int `json:"attribute" gorm:"column:attribute;type:tinyint(1) unsigned;default:1;not null;comment:属性 1:定性考核;2:定量考核"` + MinScore float64 `json:"minscore" gorm:"column:min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` + MaxScore float64 `json:"maxscore" gorm:"column:max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` + ScoringMethod int `json:"scoringmethod" gorm:"column:scoring_method;type:tinyint(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Addtime int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` + Eitetime int64 `json:"eitetime" gorm:"column:eitetime;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + CensorType string `json:"censortype" gorm:"column:censor_type;type:tinytext;comment:检查方式(1:现场检查;2:资料检查;3:事件触发)"` + Source int `json:"source" gorm:"column:source;type:tinyint(1) unsigned;default:1;not null;comment:来源(1:岗位;2:部门引用)"` + RunState int `json:"run_state" gorm:"column:run_state;type:tinyint(1) unsigned;default:1;not null;comment:运行状态(1:启用;2:禁用;3:观察)"` + + Type int `json:"type" gorm:"column:tr_type;type:tinyint(1) unsigned;default:1;not null;comment:类型(1:公司级;2:部门级)"` + ReportPerson int64 `json:"reportperson" gorm:"column:man_key;type:bigint(20) unsigned;default:0;not null;comment:上报人"` + ManDepartment int64 `json:"mandepartment" gorm:"column:man_department;type:bigint(20) unsigned;default:0;not null;comment:提报人所在部门"` + Class int `json:"class" gorm:"column:tr_class;type:tinyint(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` + Level int `json:"level" gorm:"column:tr_level;type:tinyint(1) unsigned;default:1;not null;comment:类型(1:指标;2:子目标;3:细则)"` + + Punishmode int `json:"punishmode" gorm:"column:punishmode;type:tinyint(1) unsigned;default:1;not null;comment:处罚方式 1:扣分;2:现金处罚;3:扣分加现金"` + Maxmoney float64 `json:"maxmoney" gorm:"column:maxmoney;type:bigint(20) unsigned;default:0;not null;comment:最高罚款"` + Minmoney float64 `json:"minmoney" gorm:"column:minmoney;type:bigint(20) unsigned;default:0;not null;comment:最低罚款"` +} + +func (ShemePeople *ShemePeople) TableName() string { + return "sheme_people" +} + +// 编辑内容 +func (cont *ShemePeople) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *ShemePeople) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *ShemePeople) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *ShemePeople) ContMap(whereMap interface{}, field ...string) (countAry []ShemePeople, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *ShemePeople) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/son_target_father.go b/models/modelskpi/son_target_father.go new file mode 100644 index 0000000..3cba84f --- /dev/null +++ b/models/modelskpi/son_target_father.go @@ -0,0 +1,70 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 子栏目关联指标视图 +type SonTargetFather struct { + Id int64 `json:"id" gorm:"primaryKey;column:q_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:q_title;type:varchar(255);comment:指标子栏目名称"` + ParentId int64 `json:"parentid" gorm:"column:q_parent_id;type:bigint(20) unsigned;default:0;not null;comment:归属指标"` + State int `json:"state" gorm:"column:q_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AddTime int64 `json:"addTime" gorm:"column:q_time;type:bigint(20) unsigned;default:0;not null;comment:制定时间"` + Depart string `json:"depart" gorm:"column:q_depart;type:mediumtext;comment:关联部门"` + + EtTitle string `json:"ettitle" gorm:"column:et_title;type:varchar(255);comment:指标名称"` + Type int `json:"type" gorm:"column:et_type;type:int(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` + Dimension int64 `json:"dimension" gorm:"column:et_dimension;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Key int64 `json:"key" gorm:"column:et_key;type:bigint(20) unsigned;default:0;not null;comment:UUID"` + Uniteing string `json:"unites" gorm:"column:et_unit;type:varchar(255);comment:计量单位"` + Cycles int `json:"cycle" gorm:"column:et_cycle;type:tinyint(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"` + CycleAttres int `json:"cycleattr" gorm:"column:et_cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` + ScoringMethod int `json:"scoringmethod" gorm:"column:et_scoring_method;type:tinyint(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"` +} + +func (SonTargetFather *SonTargetFather) TableName() string { + return "son_target_father" +} + +// 编辑内容 +func (cont *SonTargetFather) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *SonTargetFather) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *SonTargetFather) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *SonTargetFather) ContMap(whereMap interface{}, field ...string) (countAry []SonTargetFather, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *SonTargetFather) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/target_department.go b/models/modelskpi/target_department.go new file mode 100644 index 0000000..b9fe17e --- /dev/null +++ b/models/modelskpi/target_department.go @@ -0,0 +1,67 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 指标、栏目、细则关联部门 +type TargetDepartment struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id"` + Dimension int64 `json:"dimension" gorm:"column:dimension_id;type:bigint(20) unsigned;default:0;not null;comment:维度"` + TargetId int64 `json:"targetid" gorm:"column:target_id;type:bigint(20) unsigned;default:0;not null;comment:指标ID"` + TargetSunId int64 `json:"targetsunid" gorm:"column:target_sun_id;type:bigint(20) unsigned;default:0;not null;comment:子目标"` + TargetBylaws int64 `json:"targetbylaws" gorm:"column:target_bylaws;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + Type int `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:1;not null;comment:类型(1:指标;2:子目标;3:细则)"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门ID"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位ID"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + Class int `json:"class" gorm:"column:class;type:tinyint(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` + Level int `json:"level" gorm:"column:level;type:tinyint(1) unsigned;default:1;not null;comment:级别(1:部门级;2:岗位级)"` +} + +func (TargetDepartment *TargetDepartment) TableName() string { + return "target_department" +} + +// 编辑内容 +func (cont *TargetDepartment) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *TargetDepartment) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *TargetDepartment) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *TargetDepartment) ContMap(whereMap interface{}, field ...string) (countAry []TargetDepartment, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *TargetDepartment) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/target_detailed_relation_department.go b/models/modelskpi/target_detailed_relation_department.go new file mode 100644 index 0000000..1371c03 --- /dev/null +++ b/models/modelskpi/target_detailed_relation_department.go @@ -0,0 +1,84 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +//部门考核细则关联部门视图 +//target_detailed_relation_department + +// 指标、栏目、细则关联部门 +type TargetDetailedRelationDepartment struct { + Id int64 `json:"id" gorm:"primaryKey;column:dt_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:dt_title;type:text;comment:指标细则"` + Content string `json:"content" gorm:"column:dt_content;type:text;comment:指标说明"` + ParentId int64 `json:"parentid" gorm:"column:dt_parentid;type:bigint(20) unsigned;default:0;not null;comment:归属指标栏目"` + ParentIdSun int64 `json:"parentidsun" gorm:"column:dt_parentid_sun;type:bigint(20) unsigned;default:0;not null;comment:归属指标子栏目"` + State int `json:"state" gorm:"column:dt_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + AddTime int64 `json:"addtime" gorm:"column:dt_time;type:bigint(20) unsigned;default:0;not null;comment:制定时间"` + MinScore int64 `json:"minscore" gorm:"column:dt_min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` + MaxScore int64 `json:"maxscore" gorm:"column:dt_max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` + Company string `json:"company" gorm:"column:dt_company;type:varchar(20) unsigned;default:0;not null;comment:单位"` + AddReduce int `json:"addreduce" gorm:"column:dt_add_reduce;type:int(1) unsigned;default:1;not null;comment:1:减少;2:增加;3:无属性,现场确认加或减"` + CensorType string `json:"censortype" gorm:"column:dt_censor_type;type:text;comment:检查方式"` + CensorCont string `json:"censorcont" gorm:"column:dt_censor_cont;type:longtext;comment:检查依据"` + CensorRate int `json:"censorrate" gorm:"column:dt_censor_rate;type:int(5) unsigned;default:1;not null;comment:检查频次"` + Cycles int `json:"cycle" gorm:"column:dt_cycle;type:tinyint(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"` + CycleAttres int `json:"cycleattr" gorm:"column:dt_cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` + Paretment string `json:"paretment" gorm:"column:dt_paretment;type:longtext;comment:接受考核的部门"` + Reportary string `json:"reportary" gorm:"column:reportary;type:longtext;comment:提报人"` + //关联表 + Dimension int64 `json:"dimension" gorm:"column:dimensionid;type:bigint(20) unsigned;default:0;not null;comment:维度"` + Type int `json:"type" gorm:"column:type;tdtype:tinyint(1) unsigned;default:1;not null;comment:类型(1:指标;2:子目标;3:细则)"` + DepartmentId int64 `json:"departmentid" gorm:"column:tddepartment;type:bigint(20) unsigned;default:0;not null;comment:部门ID"` + PostId int64 `json:"postid" gorm:"column:postid;type:bigint(20) unsigned;default:0;not null;comment:岗位ID"` + TdState int `json:"tastate" gorm:"column:tastate;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Class int `json:"class" gorm:"column:tdclass;type:tinyint(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` + Level int `json:"level" gorm:"column:level;type:tinyint(1) unsigned;default:1;not null;comment:级别(1:部门级;2:岗位级)"` +} + +func (TargetDetailedRelationDepartment *TargetDetailedRelationDepartment) TableName() string { + return "target_detailed_relation_department" +} + +// 编辑内容 +func (cont *TargetDetailedRelationDepartment) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *TargetDetailedRelationDepartment) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *TargetDetailedRelationDepartment) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *TargetDetailedRelationDepartment) ContMap(whereMap interface{}, field ...string) (countAry []TargetDetailedRelationDepartment, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *TargetDetailedRelationDepartment) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/target_report.go b/models/modelskpi/target_report.go new file mode 100644 index 0000000..28eeab1 --- /dev/null +++ b/models/modelskpi/target_report.go @@ -0,0 +1,69 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 指标部门、岗位上报人对照表 +type TargetReport struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id"` + Dimension int64 `json:"dimension" gorm:"column:dimension_id;type:bigint(20) unsigned;default:0;not null;comment:维度"` + TargetId int64 `json:"targetid" gorm:"column:target_id;type:bigint(20) unsigned;default:0;not null;comment:指标ID"` + TargetSunId int64 `json:"targetsunid" gorm:"column:target_sun_id;type:bigint(20) unsigned;default:0;not null;comment:子目标"` + TargetBylaws int64 `json:"targetbylaws" gorm:"column:target_bylaws;type:bigint(20) unsigned;default:0;not null;comment:指标细则"` + DepartmentId int64 `json:"departmentid" gorm:"column:department_id;type:bigint(20) unsigned;default:0;not null;comment:部门ID"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位ID"` + Type int `json:"type" gorm:"column:type;type:tinyint(1) unsigned;default:1;not null;comment:类型(1:公司级;2:部门级)"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + ReportPerson int64 `json:"reportperson" gorm:"column:man_key;type:bigint(20) unsigned;default:0;not null;comment:上报人"` + ManDepartment int64 `json:"mandepartment" gorm:"column:man_department;type:bigint(20) unsigned;default:0;not null;comment:提报人所在部门"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + Class int `json:"class" gorm:"column:class;type:tinyint(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` + Level int `json:"level" gorm:"column:type_level;type:tinyint(1) unsigned;default:1;not null;comment:类型(1:指标;2:子目标;3:细则)"` +} + +func (TargetReport *TargetReport) TableName() string { + return "target_report" +} + +// 编辑内容 +func (cont *TargetReport) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *TargetReport) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *TargetReport) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *TargetReport) ContMap(whereMap interface{}, field ...string) (countAry []TargetReport, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *TargetReport) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/update_wechat_tempmsg.go b/models/modelskpi/update_wechat_tempmsg.go new file mode 100644 index 0000000..17edb7c --- /dev/null +++ b/models/modelskpi/update_wechat_tempmsg.go @@ -0,0 +1,71 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 企业微信模版信息发送回调 +type UpdateWechatTempmsg struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id"` + Type int `json:"type" gorm:"column:type;type:int(1) ;default:1;comment:类型(1:文本通知型;2:图文展示型;3:按钮交互型;4:投票选择型;5:多项选择型)"` + Sendmsgcont string `json:"sendmsgcont" gorm:"column:sendmsgcont;type:longtext ;comment:发送文件信息"` + Msgid string `json:"msgid" gorm:"column:msgid;type:mediumtext;comment:消息id,用于撤回应用消息"` + ResponseCode string `json:"response_code" gorm:"column:response_code;type:mediumtext ;comment:仅消息类型为“按钮交互型”,“投票选择型”和“多项选择型”的模板卡片消息返回,应用可使用response_code调用更新模版卡片消息接口,72小时内有效,且只能使用一次"` + Orderkey int64 `json:"orderkey" gorm:"column:orderkey;type:bigint(20) unsigned;not null;default:0;comment:流程id"` + Enforcer string `json:"enforcer" gorm:"column:enforcer;type:mediumtext;comment:执行人"` + State int `json:"sate" gorm:"column:sate;type:int(1) unsigned;default:2;not null;comment:状态(1:已执行更新;2:未执行更新)"` + TaskId string `json:"task_id" gorm:"column:task_id;type:mediumtext;comment:任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成,最长128字节,填了action_menu字段的话本字段必填"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` +} + +func (UpdateWechatTempmsg *UpdateWechatTempmsg) TableName() string { + return "update_wechat_tempmsg" +} + +// 添加 +func (cont *UpdateWechatTempmsg) AddCont() (err error) { + err = overall.CONSTANT_DB_KPI.Create(&cont).Error + return +} + +// 编辑内容 +func (cont *UpdateWechatTempmsg) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *UpdateWechatTempmsg) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *UpdateWechatTempmsg) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *UpdateWechatTempmsg) ContMap(whereMap interface{}, field ...string) (countAry []UpdateWechatTempmsg, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *UpdateWechatTempmsg) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/work_flow.go b/models/modelskpi/work_flow.go new file mode 100644 index 0000000..3fbdd1e --- /dev/null +++ b/models/modelskpi/work_flow.go @@ -0,0 +1,61 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 工作流 +type WorkFlow struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id"` + Name string `json:"name" gorm:"column:name;type:varchar(255) ;default:'';comment:维度"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + Describe string `json:"describe" gorm:"column:describe;type:longtext ;comment:描述"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + OpenWechat int `json:"openwechat" gorm:"column:open_wechat;type:int(1) unsigned;default:1;not null;comment:是否开启企业微信通知及审批(1:无;2:开启通知;3:开启审批及通知)"` +} + +func (WorkFlow *WorkFlow) TableName() string { + return "work_flow" +} + +// 编辑内容 +func (cont *WorkFlow) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *WorkFlow) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *WorkFlow) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *WorkFlow) ContMap(whereMap interface{}, field ...string) (countAry []WorkFlow, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *WorkFlow) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/work_flow_cont.go b/models/modelskpi/work_flow_cont.go new file mode 100644 index 0000000..99f3379 --- /dev/null +++ b/models/modelskpi/work_flow_cont.go @@ -0,0 +1,65 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 工作流视图 +type WorkFlowCont struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id"` + Name string `json:"name" gorm:"column:name;type:varchar(255) ;default:'';comment:维度"` + Content string `json:"content" gorm:"column:content;type:longtext ;comment:关联部门"` + Version string `json:"version" gorm:"column:version;type:varchar(255) ;default:'';comment:维度"` + Describe string `json:"describe" gorm:"column:describe;type:longtext ;comment:描述"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + VersionState int `json:"vstate" gorm:"column:vstate;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + VersionId int64 `json:"vid" gorm:"column:vid;type:bigint(20) unsigned;not null;comment:Id"` //附表ID + OpenWechat int `json:"openwechat" gorm:"column:openwechat;type:int(1) unsigned;default:1;not null;comment:是否开启企业微信通知及审批(1:无;2:开启通知;3:开启审批及通知)"` +} + +func (WorkFlowCont *WorkFlowCont) TableName() string { + return "work_flow_cont" +} + +// 编辑内容 +func (cont *WorkFlowCont) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *WorkFlowCont) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *WorkFlowCont) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *WorkFlowCont) ContMap(whereMap interface{}, field ...string) (countAry []WorkFlowCont, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *WorkFlowCont) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelskpi/work_flow_version.go b/models/modelskpi/work_flow_version.go new file mode 100644 index 0000000..d810e3b --- /dev/null +++ b/models/modelskpi/work_flow_version.go @@ -0,0 +1,61 @@ +package modelskpi + +import ( + "appPlatform/overall" + "strings" +) + +// 工作流版本 +type WorkFlowVersion struct { + Id int64 `json:"id" gorm:"column:id;type:bigint(20) unsigned;not null;comment:Id"` + Content string `json:"content" gorm:"column:content;type:longtext ;comment:关联部门"` + Version string `json:"version" gorm:"column:version;type:varchar(255) ;default:'';comment:维度"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Key int64 `json:"key" gorm:"column:key;type:bigint(20) unsigned;default:0;not null;comment:标识符"` +} + +func (WorkFlowVersion *WorkFlowVersion) TableName() string { + return "work_flow_version" +} + +// 编辑内容 +func (cont *WorkFlowVersion) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *WorkFlowVersion) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *WorkFlowVersion) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *WorkFlowVersion) ContMap(whereMap interface{}, field ...string) (countAry []WorkFlowVersion, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Order("sort ASC").Find(&countAry).Error + return +} + +// 删除内容 +func (cont *WorkFlowVersion) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelsschool/menu_operation.go b/models/modelsschool/menu_operation.go new file mode 100644 index 0000000..bc3dcd4 --- /dev/null +++ b/models/modelsschool/menu_operation.go @@ -0,0 +1,12 @@ +package modelsschool + +//菜单功能 +type MenuOperation struct { + OperId int64 `json:"operId" gorm:"primaryKey;column:oper_id;type:bigint(20) unsigned;not null;comment:功能ID"` + MenuId int64 `json:"menuId" gorm:"column:menu_id;type:bigint(20) unsigned;not null;default:0;comment:菜单id"` + OperTitle string `json:"operTitle" gorm:"column:oper_title;type:varchar(255);not null;comment:操作名称"` +} + +func (MenuOperation *MenuOperation) TableName() string { + return "menu_operation" +} diff --git a/models/modelsschool/step_role_group.go b/models/modelsschool/step_role_group.go new file mode 100644 index 0000000..6dbf960 --- /dev/null +++ b/models/modelsschool/step_role_group.go @@ -0,0 +1,48 @@ +package modelsschool + +import ( + "appPlatform/overall" + "strings" +) + +// 角色组(审批流程使用) +type RoleGroup struct { + Id int64 `json:"id" gorm:"primaryKey;column:srg_id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:srg_name;type:text;comment:角色名称"` + Group int64 `json:"group" gorm:"column:srg_group;type:bigint(20) unsigned;default:0;not null;comment:角色归属"` + Addtime int64 `json:"addtime" gorm:"column:srg_time;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` + State int `json:"state" gorm:"column:srg_state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Contentes string `json:"content" gorm:"column:srg_extatry;type:mediumtext;comment:操作组"` + Type int `json:"type" gorm:"column:srg_type;type:int(1) unsigned;default:1;not null;comment:操作类型(1:部门矩阵;2:个人)"` +} + +func (RoleGroup *RoleGroup) TableName() string { + return "step_role_group" +} + +// 获取详情 +func (cont *RoleGroup) GetCont(where interface{}, filed ...string) error { + // gormDb := overall.CONSTANT_DB_Master.Where(where) + // if len(filed) > 0 { + // fieldStr := strings.Join(filed, ",") + // gormDb = gormDb.Select(fieldStr) + // } + // err := gormDb.First(&cont).Error + // return err + // fmt.Println("败笔") + gormDb := overall.CONSTANT_DB_Master.Model(&cont) + if len(filed) > 0 { + fieldStr := strings.Join(filed, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(where) + err := gormDb.First(&cont).Error + // fmt.Println("败笔", cont) + return err +} + +// 编辑内容 +func (cont *RoleGroup) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/modelsschool/system_menu.go b/models/modelsschool/system_menu.go new file mode 100644 index 0000000..9975a5f --- /dev/null +++ b/models/modelsschool/system_menu.go @@ -0,0 +1,70 @@ +package modelsschool + +import ( + "appPlatform/overall" + "strings" +) + +// 菜单 +type SystemMenuSchool struct { + Id int64 `json:"id" gorm:"primaryKey;column:m_id;type:bigint(20) unsigned;not null;comment:ID"` + Title string `json:"title" gorm:"column:m_title;type:varchar(255);not null;comment:菜单名称"` + State int `json:"state" gorm:"column:m_steat;type:tinyint(1) unsigned;default:1;not null;comment:是否启用(1:启用;2:禁用;3:删除)"` + ParentId int64 `json:"parentId" gorm:"column:m_parent;type:bigint(30) unsigned;default:0;not null;comment:'父级(顶级:0)"` + ApiUrl string `json:"apiUrl" gorm:"column:m_url;type:varchar(255);not null;comment:地址"` + Time int64 `json:"time" gorm:"column:m_time;type:bigint(30) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eiteTime" gorm:"column:m_eite_time;type:bigint(30) unsigned;default:0;not null;comment:修改时间"` + UserId int64 `json:"userId" gorm:"column:m_user_id;type:bigint(20) unsigned;not null;default:0;comment:写入人"` + Sort int `json:"sort" gorm:"column:m_sort;type:tinyint(3) unsigned;default:0;not null;comment:排序"` +} + +func (SystemMenu *SystemMenuSchool) TableName() string { + return "system_menu" +} + +// // 菜单管理 +// type SystemMenuOperation struct { +// SystemMenuSchool +// MenuPermit []MenuOperation `json:"menupermit"` +// } + +// 编辑内容 +func (cont *SystemMenuSchool) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *SystemMenuSchool) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *SystemMenuSchool) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_KPI.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *SystemMenuSchool) ContMap(whereMap interface{}, field ...string) (countAry []SystemMenuSchool, err error) { + gormDb := overall.CONSTANT_DB_KPI.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *SystemMenuSchool) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_KPI.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelsschool/system_role.go b/models/modelsschool/system_role.go new file mode 100644 index 0000000..2e1ca88 --- /dev/null +++ b/models/modelsschool/system_role.go @@ -0,0 +1,44 @@ +package modelsschool + +import ( + "appPlatform/overall" + "strings" +) + +type SystemRole struct { + Id int64 `json:"id" gorm:"column:r_id;type:bigint(20) unsigned;not null;comment:Id"` + Title string `json:"title" gorm:"column:r_title;type:varchar(36);not null;comment:角色名称"` + State int `json:"state" gorm:"column:r_set;type:tinyint(1) unsigned;default:1;not null;comment:是否启用(1:启用;2:禁用;3:删除)"` + Attribute int64 `json:"attribute" gorm:"column:r_attribute;type:bigint(20) unsigned;default:0;not null;comment:属性"` + Gode int `json:"gode" gorm:"column:r_gode;type:tinyint(1) unsigned;default:1;not null;comment:继承属性(1:系统管理员;2:分厂管理员)"` + Time int64 `json:"time" gorm:"column:r_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + UserId int64 `json:"userId" gorm:"column:r_user_id;type:bigint(50) unsigned;default:0;not null;comment:写入人"` + Jurisdiction string `json:"jurisdiction" gorm:"column:r_jurisdiction;type:text;not null;comment:权限"` + MenuOper string `json:"menuoper" gorm:"column:r_menu_oper;type:text;not null;comment:权限"` + Wand int `json:"wand" gorm:"column:r_wand;type:tinyint(2) unsigned;default:0;not null;comment:权杖"` + Group int64 `json:"group" gorm:"column:r_group;type:bigint(20) unsigned;not null;default:3;comment:归属集团"` +} + +func (SystemRole *SystemRole) TableName() string { + return "system_role" +} + +// 获取详情 +func (cont *SystemRole) GetCont(where interface{}, filed ...string) error { + gormDb := overall.CONSTANT_DB_Master.Where(where) + if len(filed) > 0 { + // for _, v := range filed { + // gormDb = gormDb.Select(v) + // } + filedStr := strings.Join(filed, ",") + gormDb = gormDb.Select(filedStr) + } + err := gormDb.First(&cont).Error + return err +} + +// 编辑内容 +func (cont *SystemRole) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/modelsschool/system_user.go b/models/modelsschool/system_user.go new file mode 100644 index 0000000..4653743 --- /dev/null +++ b/models/modelsschool/system_user.go @@ -0,0 +1,40 @@ +package modelsschool + +import "appPlatform/overall" + +//系统用户表 +type SystemUser struct { + Id int64 `json:"id" gorm:"column:u_id;type:bigint(20) unsigned;not null;comment:Id"` + Name string `json:"name" gorm:"column:u_name;type:varchar(36);not null;comment:用户名"` + PassWord string `json:"passWord" gorm:"column:u_password;type:varchar(30);not null;comment:密码"` + Role int64 `json:"role" gorm:"column:u_role;type:bigint(20) unsigned;not null;default:1;comment:用户类型"` + State int `json:"state" gorm:"column:u_set;type:tinyint(1) unsigned;default:1;not null;comment:是否启用(1:启用;2:禁用;3:删除)"` + Attribute int64 `json:"attribute" gorm:"column:u_attribute;type:bigint(20) unsigned;not null;default:0;comment:账号属性"` + Time int64 `json:"time" gorm:"column:u_time;type:bigint(30) unsigned;default:0;not null;comment:创建时间"` + EiteTime int64 `json:"eiteTime" gorm:"column:u_eite_time;type:bigint(30) unsigned;default:0;not null;comment:修改时间"` + Key int64 `json:"key" gorm:"column:u_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别码"` + Group int64 `json:"group" gorm:"column:u_group;type:bigint(20) unsigned;not null;default:0;comment:集团公司"` + Wand int `json:"wand" gorm:"column:u_wand;type:tinyint(3) unsigned;default:0;not null;comment:权重"` +} + +func (SystemUser *SystemUser) TableName() string { + return "system_user" +} + +//获取详情 +func (cont *SystemUser) GetCont(where interface{}, filed ...string) error { + gormDb := overall.CONSTANT_DB_Master.Where(where) + if len(filed) > 0 { + for _, v := range filed { + gormDb = gormDb.Select(v) + } + } + err := gormDb.First(&cont).Error + return err +} + +//编辑内容 +func (cont *SystemUser) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/modelsschool/system_user_attribute.go b/models/modelsschool/system_user_attribute.go new file mode 100644 index 0000000..f0fb7c8 --- /dev/null +++ b/models/modelsschool/system_user_attribute.go @@ -0,0 +1,33 @@ +package modelsschool + +import "appPlatform/overall" + +//系统管理员属性资料 +type SystemUserAttribute struct { + IdAttr int64 `json:"id" gorm:"column:ua_id;type:bigint(50) unsigned;not null;comment:Id"` + NameAttr string `json:"name" gorm:"column:ua_name;type:varchar(20);not null;comment:姓名"` + Tel string `json:"tel" gorm:"column:ua_tel;type:varchar(30);not null;default:0;comment:电话"` + TimeAttr int64 `json:"time" gorm:"column:ua_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (SystemUserAttribute *SystemUserAttribute) TableName() string { + return "system_user_attribute" +} + +//获取详情 +func (cont *SystemUserAttribute) GetCont(where interface{}, filed ...string) error { + gormDb := overall.CONSTANT_DB_Master.Where(where) + if len(filed) > 0 { + for _, v := range filed { + gormDb = gormDb.Select(v) + } + } + err := gormDb.First(&cont).Error + return err +} + +//编辑内容 +func (cont *SystemUserAttribute) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Master.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} diff --git a/models/modelsstorage/accesstoaddress.go b/models/modelsstorage/accesstoaddress.go new file mode 100644 index 0000000..29c4bfd --- /dev/null +++ b/models/modelsstorage/accesstoaddress.go @@ -0,0 +1,65 @@ +package modelsstorage + +import ( + "appPlatform/overall" + "strings" +) + +// 仓储系统菜单管理 +type AccesstoAddress struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;index"` + Name string `json:"name" gorm:"column:name;type:varchar(100);comment:名称"` + Url string `json:"url" gorm:"column:url;type:varchar(100);comment:路径"` + Type int `json:"type" gorm:"column:type;type:int(1) unsigned;default:1;not null;comment:访问方式(1get,2post,3delet,4put,5全部)"` + RoleId int `json:"roleid" gorm:"column:role_id;type:int(1) unsigned;default:1;not null;comment:菜单对应的角色"` + Menuparent int `json:"menuparent" gorm:"column:menuparent;type:int(1) unsigned;default:0;not null;comment:父菜单,0代表无父菜单"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Icon string `json:"icon" gorm:"column:icon;type:varchar(100);comment:图标"` + Target string `json:"target" gorm:"column:target;type:varchar(100);comment:目标"` + IsChild int `json:"ischild" gorm:"column:ischild;type:int(1) unsigned;default:1;not null;comment:是否有子菜单\r\n(1有2无)"` +} + +func (AccesstoAddress *AccesstoAddress) TableName() string { + return "accesstoaddress" +} + +// 编辑内容 +func (cont *AccesstoAddress) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Storage.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *AccesstoAddress) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_Storage.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *AccesstoAddress) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_Storage.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *AccesstoAddress) ContMap(whereMap interface{}, field ...string) (countAry []AccesstoAddress, err error) { + gormDb := overall.CONSTANT_DB_Storage.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *AccesstoAddress) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_Storage.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelsstorage/material.go b/models/modelsstorage/material.go new file mode 100644 index 0000000..e30bdf9 --- /dev/null +++ b/models/modelsstorage/material.go @@ -0,0 +1,70 @@ +package modelsstorage + +import ( + "appPlatform/overall" + "strings" +) + +// 仓储系统菜单管理 +type Material struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;index"` + DepositoryId int64 `json:"depositoryid" gorm:"column:depository_id;type:bigint(20) unsigned;default:0;not null;comment:仓库编号"` + Name string `json:"name" gorm:"column:mname;type:varchar(100);comment:材料名称"` + Quantity int `json:"quantity" gorm:"column:type;quantity:int(11) unsigned;default:1;not null;comment:数量"` + Amounts int `json:"amounts" gorm:"column:amounts;type:int(11) unsigned;default:1;not null;comment:总金额"` + TypeId int64 `json:"typeid" gorm:"column:type_id;type:bigint(20) unsigned;default:0;not null;comment:材料种类id"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Code string `json:"code" gorm:"column:code;type:varchar(255);comment:存货编码"` + Version string `json:"version" gorm:"column:version;type:varchar(255);comment:规格型号"` + Price int `json:"price" gorm:"column:price;type:int(11) unsigned;default:1;not null;comment:单价"` + Unit string `json:"unit" gorm:"column:unit;type:varchar(255);comment:计量单位"` + Texture string `json:"texture" gorm:"column:texture;type:varchar(255);comment:材质"` + DepositoryCode string `json:"depositoryCode" gorm:"column:depositoryCode;type:varchar(255);comment:货位码(存放位置)"` + Kingdeecode string `json:"kingdeecode" gorm:"column:kingdeecode;type:varchar(255);comment:计量单位"` + NumberOfTemporary int `json:"numberoftemporary" gorm:"column:number_of_temporary;type:int(11) unsigned;default:1;not null;comment:临时数目(临时出库数目)"` +} + +func (Material *Material) TableName() string { + return "material" +} + +// 编辑内容 +func (cont *Material) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Storage.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *Material) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_Storage.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *Material) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_Storage.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *Material) ContMap(whereMap interface{}, field ...string) (countAry []Material, err error) { + gormDb := overall.CONSTANT_DB_Storage.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *Material) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_Storage.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelsstorage/material_type.go b/models/modelsstorage/material_type.go new file mode 100644 index 0000000..169e4fd --- /dev/null +++ b/models/modelsstorage/material_type.go @@ -0,0 +1,61 @@ +package modelsstorage + +import ( + "appPlatform/overall" + "strings" +) + +// 仓储系统菜单管理 +type MaterialType struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;index"` + Name string `json:"name" gorm:"column:tname;type:varchar(255);comment:类型名称"` + Introduce string `json:"introduce" gorm:"column:introduce;type:varchar(255);comment:类型介绍"` + State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(启用2禁用3删除4不对其做任何操作)"` + ParentId int64 `json:"parentId" gorm:"column:parentId;type:bigint(20) unsigned;default:0;not null;comment:父级"` + OrderId int64 `json:"orderid" gorm:"column:oldId;type:bigint(20) unsigned;default:0;not null;comment:导入时id"` +} + +func (MaterialType *MaterialType) TableName() string { + return "material_type" +} + +// 编辑内容 +func (cont *MaterialType) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_Storage.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *MaterialType) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_Storage.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *MaterialType) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_Storage.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *MaterialType) ContMap(whereMap interface{}, field ...string) (countAry []MaterialType, err error) { + gormDb := overall.CONSTANT_DB_Storage.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *MaterialType) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_Storage.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelssystempermission/Untitled-1.json b/models/modelssystempermission/Untitled-1.json new file mode 100644 index 0000000..58c4a5d --- /dev/null +++ b/models/modelssystempermission/Untitled-1.json @@ -0,0 +1,115 @@ +{ + "code": 0, + "msg": "成功", + "data": { + "key": "f782e7cfdf4732fb296f16359590d6ad", + "token": "90ac4f9925233c10648987a25f2dc58de6c42f8c", + "usercont": { + "adminorg": 272, + "birthday": 882374400, + "company": 309, + "companyname": "山东恒信高科能源有限公司", + "constellationing": 9, + "currentresidence": "山东省宁阳县西关社区", + "deparment": "", + "email": "", + "emptype": 8, + "entrydate": 1637683200, + "gender": 1, + "globalroaming": "", + "health": 1, + "hireclass": 1, + "icon": "https://wework.qpic.cn/wwhead/duc2TvpEgSQgUKEe0Fda8oILw6YibaHehrEgmXCL4mfjzKKe7a2ibk8us04G5EXDPkWnMc67718jY/0", + "id": 80, + "idcardIssued": "", + "idcardaddress": "", + "idcardenddate": 0, + "idcardno": "370921199712182136", + "idcardstartdate": 0, + "internaltelephone": "", + "isadmin": 1, + "isdoubleworker": 1, + "isveterans": 1, + "jobclass": 6, + "jobid": 52, + "jobleve": 0, + "jobstartdate": 1596211200, + "key": 16384038535027389, + "maindeparment": 102, + "maindeparmentname": "企管部", + "maritalstatus": 1, + "mobilephone": "17853319013", + "myfolk": "汉族", + "name": "马飞", + "nativeplace": "山东省宁阳县西关社区", + "number": "301968", + "passportno": "", + "password": "1dc7402ad00756bd47cbb7a6f835c9bf", + "planformaldate": 1637683200, + "political_outlook": 1, + "position": 795, + "positionname": "科员", + "probationperiod": 0, + "role": "1", + "state": 1, + "sunmaindeparment": 272, + "teamid": 0, + "veteransnumber": "", + "wechat": "", + "workwechat": "Fei1893" + }, + "userinfo": { + "id": 80, + "number": "301968", + "name": "马飞", + "icon": "https://wework.qpic.cn/wwhead/duc2TvpEgSQgUKEe0Fda8oILw6YibaHehrEgmXCL4mfjzKKe7a2ibk8us04G5EXDPkWnMc67718jY/0", + "hireclass": 1, + "emptype": 8, + "company": 309, + "maindeparment": 102, + "sunmaindeparment": 272, + "deparment": "", + "adminorg": 272, + "teamid": 0, + "position": 795, + "jobclass": 6, + "jobid": 52, + "jobleve": 0, + "time": 1656984568, + "eitetime": 1656984568, + "wechat": "", + "workwechat": "Fei1893", + "state": 1, + "key": 16384038535027389, + "isadmin": 1, + "password": "1dc7402ad00756bd47cbb7a6f835c9bf", + "role": "1", + "idcardno": "370921199712182136", + "passportno": "", + "globalroaming": "", + "mobilephone": "17853319013", + "email": "", + "gender": 1, + "birthday": 882374400, + "myfolk": "汉族", + "nativeplace": "山东省宁阳县西关社区", + "idcardstartdate": 0, + "idcardenddate": 0, + "idcardaddress": "", + "idcardIssued": "", + "health": 1, + "maritalstatus": 1, + "internaltelephone": "", + "currentresidence": "山东省宁阳县西关社区", + "constellationing": 9, + "isdoubleworker": 1, + "isveterans": 1, + "veteransnumber": "", + "jobstartdate": 1596211200, + "entrydate": 1637683200, + "probationperiod": 0, + "planformaldate": 1637683200, + "politicaloutlook": 1 + } + } +} \ No newline at end of file diff --git a/models/modelssystempermission/appsystem.go b/models/modelssystempermission/appsystem.go new file mode 100644 index 0000000..31eb32d --- /dev/null +++ b/models/modelssystempermission/appsystem.go @@ -0,0 +1,62 @@ +package modelssystempermission + +import ( + "appPlatform/overall" + "strings" +) + +// 应用系统 +type Appsystem struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Title string `json:"title" gorm:"column:title;type:varchar(255) ;comment:系统名称"` + Coder string `json:"coder" gorm:"column:coder;type:varchar(255) ;comment:识别符"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Sort int `json:"sort" gorm:"column:sort;type:int(5) unsigned;default:50;not null;comment:排序"` + ApiUrl string `json:"apiurl" gorm:"column:api_url;type:varchar(255) ;comment:菜单访问权限列表"` +} + +func (Appsystem *Appsystem) TableName() string { + return "appsystem" +} + +// 编辑内容 +func (cont *Appsystem) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *Appsystem) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *Appsystem) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *Appsystem) ContMap(whereMap interface{}, field ...string) (countAry []Appsystem, err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *Appsystem) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelssystempermission/empower.go b/models/modelssystempermission/empower.go new file mode 100644 index 0000000..9f8f4fa --- /dev/null +++ b/models/modelssystempermission/empower.go @@ -0,0 +1,65 @@ +package modelssystempermission + +import ( + "appPlatform/overall" + "strings" +) + +// 权限配置 +type Empower struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + OrdId int64 `json:"ordid" gorm:"column:ordid;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位ID"` + System string `json:"system" gorm:"column:system;type:varchar(255) ;comment:系统"` + PointId string `json:"pointid" gorm:"column:point_id;type:longtext;comment:权限点位"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Level int `json:"level" gorm:"column:level;type:int(1) unsigned;default:1;not null;comment:授权范围等级(1:本部门;2:本分部;3:所有)"` + Organization string `json:"organization" gorm:"column:organization;type:longtext;comment:行政组织"` + Operation string `json:"operation" gorm:"column:operation;type:longtext;comment:操作点位"` +} + +func (Empower *Empower) TableName() string { + return "empower" +} + +// 编辑内容 +func (cont *Empower) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *Empower) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *Empower) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *Empower) ContMap(whereMap interface{}, field ...string) (countAry []Empower, err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *Empower) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelssystempermission/role_empower.go b/models/modelssystempermission/role_empower.go new file mode 100644 index 0000000..c02c38c --- /dev/null +++ b/models/modelssystempermission/role_empower.go @@ -0,0 +1,64 @@ +package modelssystempermission + +import ( + "appPlatform/overall" + "strings" +) + +// 权限配置 +type RoleEmpower struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + RoleId int64 `json:"roleid" gorm:"column:role_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + System string `json:"system" gorm:"column:system;type:varchar(255) ;comment:系统"` + PointId string `json:"pointid" gorm:"column:point_id;type:longtext;comment:权限点位"` + Operation string `json:"operation" gorm:"column:operation;type:longtext;comment:操作点位"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Level int `json:"level" gorm:"column:level;type:int(1) unsigned;default:1;not null;comment:授权范围等级(1:本部门;2:本分部;3:所有)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Organization string `json:"organization" gorm:"column:organization;type:longtext;comment:行政组织列表"` +} + +func (RoleEmpower *RoleEmpower) TableName() string { + return "role_empower" +} + +// 编辑内容 +func (cont *RoleEmpower) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *RoleEmpower) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *RoleEmpower) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *RoleEmpower) ContMap(whereMap interface{}, field ...string) (countAry []RoleEmpower, err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *RoleEmpower) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelssystempermission/system_role.go b/models/modelssystempermission/system_role.go new file mode 100644 index 0000000..46590b1 --- /dev/null +++ b/models/modelssystempermission/system_role.go @@ -0,0 +1,60 @@ +package modelssystempermission + +import ( + "appPlatform/overall" + "strings" +) + +// 系统角色表 +type SystemRole struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + Name string `json:"name" gorm:"column:name;type:varchar(255) ;comment:系统名称"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Sort int `json:"sort" gorm:"column:sort;type:int(5) unsigned;default:50;not null;comment:排序"` +} + +func (SystemRole *SystemRole) TableName() string { + return "system_role" +} + +// 编辑内容 +func (cont *SystemRole) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *SystemRole) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *SystemRole) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *SystemRole) ContMap(whereMap interface{}, field ...string) (countAry []SystemRole, err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *SystemRole) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelssystempermission/systemrole_empower.go b/models/modelssystempermission/systemrole_empower.go new file mode 100644 index 0000000..605cc5f --- /dev/null +++ b/models/modelssystempermission/systemrole_empower.go @@ -0,0 +1,65 @@ +package modelssystempermission + +import ( + "appPlatform/overall" + "strings" +) + +// 角色权限视图 +type SystemroleEmpower struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + RoleId int64 `json:"roleid" gorm:"column:role_id;type:bigint(20) unsigned;default:0;not null;comment:行政组织"` + System string `json:"system" gorm:"column:system;type:varchar(255) ;comment:系统"` + PointId string `json:"pointid" gorm:"column:point_id;type:longtext;comment:权限点位"` + Operation string `json:"operation" gorm:"column:operation;type:longtext;comment:操作点位"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Level int `json:"level" gorm:"column:level;type:int(1) unsigned;default:1;not null;comment:授权范围等级(1:本部门;2:本分部;3:所有)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` + Name string `json:"name" gorm:"column:name;type:varchar(255) ;comment:系统名称"` + Sort int `json:"sort" gorm:"column:sort;type:int(5) unsigned;default:50;not null;comment:排序"` +} + +func (SystemroleEmpower *SystemroleEmpower) TableName() string { + return "systemrole_empower" +} + +// 编辑内容 +func (cont *SystemroleEmpower) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *SystemroleEmpower) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *SystemroleEmpower) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *SystemroleEmpower) ContMap(whereMap interface{}, field ...string) (countAry []SystemroleEmpower, err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *SystemroleEmpower) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/modelswechat/wechatUsers.go b/models/modelswechat/wechatUsers.go new file mode 100644 index 0000000..a1a1058 --- /dev/null +++ b/models/modelswechat/wechatUsers.go @@ -0,0 +1,34 @@ +package modelswechat + +//企业微信人员架构 +type WechatUsers struct { + Uid int64 `json:"uid" gorm:"column:u_id;type:bigint(20) unsigned;default:0;not null;comment:id"` + Userid string `json:"userid" gorm:"column:userid;type:varchar(255);not null;comment:wechat user id企业微信用户ID"` + Name string `json:"name" gorm:"column:name;type:varchar(100);not null;comment:姓名"` + Department string `json:"department" gorm:"column:department;type:text;comment:归属部门json"` + Position string `json:"position" gorm:"column:position;type:varchar(255);not null;comment:企业微信职务"` + Mobile string `json:"mobile" gorm:"column:mobile;type:varchar(100);not null;comment:企业微信电话"` + Gender int `json:"gender" gorm:"column:gender;type:tinyint(1) unsigned;default:1;not null;comment:性别。1表示男性,2表示女性"` + Email string `json:"email" gorm:"column:email;type:varchar(255);not null;comment:邮箱"` + Avatar string `json:"avatar" gorm:"column:avatar;type:varchar(255);not null;comment:员工头像"` + Status int `json:"status" gorm:"column:status;type:tinyint(1) unsigned;default:1;not null;comment:激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业。"` + Extattr string `json:"extattr" gorm:"column:extattr;type:mediumtext;comment:企业微信员工扩展属性"` + MainDepartment int64 `json:"main_department" gorm:"column:main_department;type:int(8) unsigned;default:0;not null;comment:主部门"` + QrCode string `json:"qr_code" gorm:"column:qr_code;type:text;comment:员工个人二维码,扫描可添加为外部联系人(注意返回的是一个url,可在浏览器上打开该url以展示二维码);第三方仅通讯录应用可获取;对于非第三方创建的成员,第三方通讯录应用也不可获取"` + IsLeaderInDept string `json:"is_leader_in_dept" gorm:"column:is_leader_in_dept;type:text;comment:表示在所在的部门内是否为上级。0-否;1-是。是一个列表,数量必须与department一致。第三方仅通讯录应用可获取;对于非第三方创建的成员,第三方通讯录应用也不可获取"` + ThumbAvatar string `json:"thumb_avatar" gorm:"column:thumb_avatar;type:varchar(255);not null;comment:头像缩略图url"` + UserNumber string `json:"user_number" gorm:"column:user_number;type:varchar(8);not null;comment:工号"` + SysBf int64 `json:"sys_bf" gorm:"column:sys_bf;type:int(20) unsigned;default:0;not null;comment:系统分厂"` + SysWs int64 `json:"sys_ws" gorm:"column:sys_ws;type:int(20) unsigned;default:0;not null;comment:系统工段"` + SysPs int64 `json:"sys_ps" gorm:"column:sys_ps;type:int(20) unsigned;default:0;not null;comment:系统职务"` + WmTema int64 `json:"wm_tema" gorm:"column:wm_tema;type:int(20) unsigned;default:0;not null;comment:系统班组"` + IsAdmin int `json:"is_admin" gorm:"column:is_admin;type:tinyint(1) unsigned;default:1;not null;comment:管理员1、否;2:是"` + IsRole int64 `json:"is_role" gorm:"column:is_role;type:int(20) unsigned;default:0;not null;comment:角色"` + Pwd string `json:"pwd" gorm:"column:pwd;type:varchar(255);not null;comment:密码"` + Time int64 `json:"time" gorm:"column:time;type:int(20) unsigned;default:0;not null;comment:写入时间"` +} + +func (WechatUsers *WechatUsers) TableName() string { + // return "wechatusers_es" + return "wechatusers" +} diff --git a/models/myuser.go b/models/myuser.go new file mode 100644 index 0000000..a30a23c --- /dev/null +++ b/models/myuser.go @@ -0,0 +1,90 @@ +package models + +import ( + "appPlatform/overall" + "strings" +) + +//个人信息主表 +type WorkMan struct { + Id int64 `json:"id" gorm:"column:wm_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"` + Number string `json:"number" gorm:"column:wm_number;type:varchar(10);not null;comment:员工编号"` + Password string `json:"pwd" gorm:"column:wm_pwd;type:varchar(50);not null;comment:密码"` + DepartmentId int64 `json:"departmentid" gorm:"column:wm_bf_id;type:bigint(20) unsigned;default:0;not null;comment:分厂"` + WorkshopId int64 `json:"workshopid" gorm:"column:wm_ws_id;type:bigint(20) unsigned;default:0;not null;comment:工段"` + PostId int64 `json:"postid" gorm:"column:wm_pt_id;type:bigint(20) unsigned;default:0;not null;comment:职务"` + Key int64 `json:"key" gorm:"column:wm_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别码"` + State int `json:"state" gorm:"column:wm_set;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + HireSet int `json:"hireset" gorm:"column:wm_hire_set;type:tinyint(1) unsigned;default:1;not null;comment:雇佣状态(1:在职;2:离职)"` + Time int64 `json:"time" gorm:"column:wm_time;type:bigint(20) unsigned;default:0;not null;comment:添加事件"` + EiteTime int64 `json:"eitetime" gorm:"column:wm_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改事件"` + UserId int64 `json:"userid" gorm:"column:wm_user_id;type:bigint(50) unsigned;default:0;not null;comment:录入人"` + QuitTime int64 `json:"quitime" gorm:"column:wm_quit_time;type:bigint(20) unsigned;default:0;not null"` + Group int64 `json:"group" gorm:"column:wm_group;type:bigint(20) unsigned;default:0;not null;comment:集团公司"` + Soptcheck int `json:"soptcheck" gorm:"column:wm_soptcheck;type:tinyint(1) unsigned;default:1;not null"` + Tema int64 `json:"tema" gorm:"column:wm_tema;type:bigint(20) unsigned;default:0;not null;comment:班组"` + IsOne int `json:"isone" gorm:"column:wm_one;type:tinyint(1) unsigned;default:1;not null;comment:第一次登陆"` + WorkWechatId string `json:"workwechatid" gorm:"column:qywx_key;type:varchar(255);not null;comment:企业微信KEY"` + WechatId string `json:"wechatid" gorm:"column:wx_key;type:varchar(255);not null;comment:微信KEY"` +} + +func (WorkMan *WorkMan) TableName() string { + return "worker_man" +} + +//获取职务分类内容 +func (cont *WorkMan) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_Master.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +//个人信息附表 +type WorkManAttribute struct { + KeyAttr int64 `json:"key" gorm:"column:wmd_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别符"` + Name string `json:"name" gorm:"column:wmd_name;type:varchar(50);not null;comment:姓名"` + Gender int `json:"gender" gorm:"column:wmd_gender;type:tinyint(1) unsigned;default:1;not null;comment:性别(1:男;2:女)"` + Age int `json:"age" gorm:"column:wmd_age;type:tinyint(3) unsigned;default:1;not null;comment:年龄"` + Tel string `json:"tel" gorm:"column:wmd_tel;type:varchar(25);not null;comment:联系方式"` + Category int `json:"category" gorm:"column:wmd_category;type:tinyint(1) unsigned;default:1;not null;comment:人员类别(1:正式工;2:合同工;3:实习生)"` + CertificatesType int `json:"certificatesType" gorm:"column:wmd_certificates_type;type:tinyint(1) unsigned;default:1;not null;comment:证件类型(1:身份证;2:驾驶证;3:军人证;4:护照;5:居住证)"` + CertificatesNum string `json:"certificatesNum" gorm:"column:wmd_certificates_number;type:varbinary(50);comment:证件编号"` + Birthday int64 `json:"birthday" gorm:"column:wmd_birthday;type:bigint(20) unsigned;default:0;not null;comment:出生日期"` + EntryTime int64 `json:"entryTime" gorm:"column:wmd_entry_time;type:bigint(20) unsigned;default:0;not null;comment:入职日期"` + QuitTimeAttr int64 `json:"quitTime" gorm:"column:wmd_quit_time;type:bigint(20) unsigned;default:0;not null;comment:离职日期"` + EiteTimeAttr int64 `json:"eiteTime" gorm:"column:wmd_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` + Addrest string `json:"addrest" gorm:"column:wmd_addrest;type:varchar(255);comment:家庭住址"` + Icon string `json:"icon" gorm:"column:wmd_icon;type:varchar(255);comment:照片"` + NickName string `json:"nickName" gorm:"column:wmd_nickname;type:varchar(255);comment:昵称"` +} + +func (WorkManAttribute *WorkManAttribute) TableName() string { + return "worker_man_data" +} + +//个人详细信息 +type PersonalDetails struct { + WorkMan + WorkManAttribute +} + +//Redis身份识别 +type RedisUserInfo struct { + Id string `json:"id"` + Number string `json:"number"` + DepartmentId string `json:"departmentid"` + WorkshopId string `json:"workshopid"` + PostId string `json:"postid"` + Key string `json:"key"` + Group string `json:"group"` + Tema string `json:"tema"` + WorkWechatId string `json:"workwechatid"` + WechatId string `json:"wechatid"` + Name string `json:"name"` + NickName string `json:"nickname"` +} diff --git a/models/systempermission/empower.go b/models/systempermission/empower.go new file mode 100644 index 0000000..511a06f --- /dev/null +++ b/models/systempermission/empower.go @@ -0,0 +1,60 @@ +package systempermission + +import ( + "appPlatform/overall" + "strings" +) + +type Empower struct { + Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` + PostId int64 `json:"postid" gorm:"column:post_id;type:bigint(20) unsigned;default:0;not null;comment:岗位ID"` + System string `json:"system" gorm:"column:system;type:varchar(255) ;comment:系统"` + PointId int64 `json:"pointid" gorm:"column:point_id;type:bigint(20) unsigned;default:0;not null;comment:权限点位"` + State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` + Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` +} + +func (Empower *Empower) TableName() string { + return "Empower" +} + +// 编辑内容 +func (cont *Empower) EiteCont(whereMap interface{}, saveData interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Updates(saveData).Error + return +} + +// 获取内容 +func (cont *Empower) GetCont(whereMap interface{}, field ...string) (err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + gormDb = gormDb.Where(whereMap) + err = gormDb.First(&cont).Error + return +} + +// 根据条件获取总数 +func (cont *Empower) CountCont(whereMap interface{}) (countId int64) { + overall.CONSTANT_DB_System_Permission.Model(&cont).Where(whereMap).Count(&countId) + return +} + +// 读取全部信息 +func (cont *Empower) ContMap(whereMap interface{}, field ...string) (countAry []Empower, err error) { + gormDb := overall.CONSTANT_DB_System_Permission.Model(&cont) + if len(field) > 0 { + fieldStr := strings.Join(field, ",") + gormDb = gormDb.Select(fieldStr) + } + err = gormDb.Where(whereMap).Find(&countAry).Error + return +} + +// 删除内容 +func (cont *Empower) DelCont(whereMap interface{}) (err error) { + err = overall.CONSTANT_DB_System_Permission.Where(whereMap).Delete(&cont).Error + return +} diff --git a/models/wechatcallback/callbacklog.go b/models/wechatcallback/callbacklog.go new file mode 100644 index 0000000..947bcc2 --- /dev/null +++ b/models/wechatcallback/callbacklog.go @@ -0,0 +1,18 @@ +package wechatcallback + +//企业微信回调记录 +type CallbackLog struct { + Id int64 `json:"id" gorm:"column:id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"` + MsgSignature string `json:"msgSignature" gorm:"column:msg_signature;type:varchar(255);not null;comment:组织名称"` + TimeStamp int64 `json:"timestamp" gorm:"column:timestamp;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Nonce string `json:"nonce" gorm:"column:nonce;type:varchar(255);not null;comment:组织名称"` + Echostr string `json:"echostr" gorm:"column:echostr;type:text;not null;comment:组织名称"` + Xmlstr string `json:"xmlstr" gorm:"column:xmlstr;type:text;comment:组织名称"` + Jsonstr string `json:"jsonstr" gorm:"column:jsonstr;type:text;comment:组织名称"` + AddTime int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"` + Reqdata string `json:"reqdata" gorm:"column:reqdata;type:text;comment:组织名称"` +} + +func (CallbackLog *CallbackLog) TableName() string { + return "callback_log" +} diff --git a/overall/appConfig.go b/overall/appConfig.go new file mode 100644 index 0000000..db8378b --- /dev/null +++ b/overall/appConfig.go @@ -0,0 +1,51 @@ +package overall + +import ( + "appPlatform/config/configApp" + + "github.com/go-redis/redis/v8" + "gorm.io/gorm" +) + +// 常量 +var ( + ConfigFilePathConstant = "./config/configApp/appConfig.yaml" //服务基础配置 + ConfigDatabaseConstant = "./config/configDatabase/database.yaml" + ConfigRedisConstant = "./config/configNosql/redis.yaml" + EmployeeStatusIng = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) + EmployeeStatusOld = []int{11, 12, 13, 14} //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) + DockingKingdeeUrl = "http://36.134.44.40:18888" + MyContJwt = "mycontjwt" + MyContJwtPower = "mycontjwtpower" +) + +// 全局配置 +var ( + //服务常量 + CONSTANT_CONFIG configApp.Server + // + CONSTANT_DB_Master *gorm.DB //主数据库 + CONSTANT_DB_AppPlatform *gorm.DB //应用平台据库 + CONSTANT_DB_Wechat *gorm.DB //微信数据库 + CONSTANT_DB_HR *gorm.DB //HR数据库 + CONSTANT_DB_FILE_BOOK *gorm.DB //文档属性数据库 + CONSTANT_DB_ERROR_SUBJECT *gorm.DB //错题库 + CONSTANT_DB_MY_TEST *gorm.DB //自我测验 + CONSTANT_DB_IMAGES_TEST *gorm.DB //图文信息数据库 + CONSTANT_DB_SCORING *gorm.DB //计分明细数据库 + CONSTANT_DB_QA *gorm.DB //趣味问答 + CONSTANT_DB_BILLBOARD *gorm.DB //风云榜统计数据库 + CONSTANT_DB_HEALTH *gorm.DB //健康上报数据库 + CONSTANT_DB_KPI *gorm.DB //绩效考核数据库 + CONSTANT_DB_WECHAT_LOG *gorm.DB //企业微信回调记录 + CONSTANT_DB_MANAGE_ARCHIVES *gorm.DB //管理档案 + CONSTANT_DB_System_Permission *gorm.DB //系统权限配置数据库 + CONSTANT_DB_Storage *gorm.DB //仓储系统数据库 + //Redis + CONSTANT_REDIS0 *redis.Client + CONSTANT_REDIS1 *redis.Client + CONSTANT_REDIS2 *redis.Client + CONSTANT_REDIS3 *redis.Client + CONSTANT_REDIS4 *redis.Client + CONSTANT_REDIS5 *redis.Client +) diff --git a/overall/database.go b/overall/database.go new file mode 100644 index 0000000..d4ef2e3 --- /dev/null +++ b/overall/database.go @@ -0,0 +1,11 @@ +package overall + +import ( + "appPlatform/config/configDatabase" + confignosql "appPlatform/config/configNosql" +) + +var ( + CONSTANT_MYSQL configDatabase.MysqlSetUp + CONSTANT_Redis confignosql.RedisSetUp +) diff --git a/overall/publicmethod/errorCode.go b/overall/publicmethod/errorCode.go new file mode 100644 index 0000000..c5efcf4 --- /dev/null +++ b/overall/publicmethod/errorCode.go @@ -0,0 +1,15 @@ +package publicmethod + +var ErrorCodeMsg = map[int]string{ + 0: "成功", + 1: "", + 100: "提交的数据格式错误!", + 101: "提交的数据不能为空!", + 103: "该数据已经存在!请不要重复添加", + 104: "数据写入失败!", + 105: "数据查询失败!", + 106: "编辑失败!", + 107: "未能查询到数据!", + 108: "删除失败", + 2000: "账户或密码错误!", +} diff --git a/overall/publicmethod/formatOutput.go b/overall/publicmethod/formatOutput.go new file mode 100644 index 0000000..2db4d92 --- /dev/null +++ b/overall/publicmethod/formatOutput.go @@ -0,0 +1,231 @@ +package publicmethod + +import ( + "appPlatform/models/modelshr" + "appPlatform/models/modelssystempermission" + "appPlatform/overall" + "bytes" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "strconv" + "strings" + + "github.com/gin-gonic/gin" +) + +// 格式化输出 +func Result(code int, data interface{}, c *gin.Context, msgAry ...string) { + var msg string + if _, isTrue := ErrorCodeMsg[code]; isTrue { + msg = ErrorCodeMsg[code] + } + if len(msgAry) > 0 { + for _, v := range msgAry { + if msg == "" { + msg = fmt.Sprintf("%v", v) + } else { + msg = fmt.Sprintf("%v。%v", msg, v) + } + + } + } + c.JSON(http.StatusOK, Reply{code, msg, data}) //输出json格式数据 +} + +//列表输出标准格式 +/* +@total 总数 +@count 当前页总数 +@page 页数 +@pageSize 每页显示数量 +@data 返回数据 +*/ +func ResultList(code, page, pageSize int, total, count int64, data interface{}, c *gin.Context) (printMap map[string]interface{}) { + outMap := MapOut[string]() + outMap["count"] = count + outMap["total"] = total + outMap["page"] = page + outMap["pageSize"] = pageSize + outMap["list"] = data + printMap = outMap + Result(code, outMap, c) + return +} + +// 登录信息转换 +func LoginMyCont(c *gin.Context) (myCont AuthenticationPower, err error) { + var myContInfo modelshr.ManCont + context, exi := c.Get(overall.MyContJwt) + contextPower, exiPower := c.Get(overall.MyContJwtPower) + if exi != true { + err = errors.New("对不起!你没有该功能的操作权限!1") + return + } + jsonCont, jsonErr := json.Marshal(context) + // fmt.Printf("LoginMyCont--------->%v--------->%v\n", contextPower, exiPower) + if jsonErr != nil { + err = jsonErr + return + } + jsonUnErr := json.Unmarshal(jsonCont, &myContInfo) + if jsonUnErr != nil { + err = jsonUnErr + return + } + // var powerInfo SystemPowerInfo + var powerInfo EmpowerCont + if exiPower == true { + jsonPowerCont, _ := json.Marshal(contextPower) + json.Unmarshal(jsonPowerCont, &powerInfo) + // fmt.Printf("LoginMyCont--------->%v--------->%v\n", powerInfo, string(jsonPowerCont)) + } + PointIdList := strings.Split(powerInfo.PointId, ",") + OrganizationList := strings.Split(powerInfo.Operation, ",") + myCont.Id = myContInfo.Id + myCont.Number = myContInfo.Number //员工工号"` + myCont.Name = myContInfo.Name //姓名"` + myCont.Icon = myContInfo.Icon //头像"` + myCont.HireClass = myContInfo.HireClass //雇佣类型(1:雇佣入职;2:再入职;)"` + myCont.EmpType = myContInfo.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)"` + myCont.Company = myContInfo.Company //入职公司"` + myCont.MainDeparment = myContInfo.MainDeparment //主部门"` + myCont.SunMainDeparment = myContInfo.SunMainDeparment //二级主部门"` + myCont.Deparment = myContInfo.Deparment //部门 + myCont.AdminOrg = myContInfo.AdminOrg // 所属行政组织"` + myCont.TeamId = myContInfo.TeamId //班组"` + myCont.Position = myContInfo.Position //职位"` + myCont.JobClass = myContInfo.JobClass // 职务分类"` + myCont.JobId = myContInfo.JobId //职务"` + myCont.JobLeve = myContInfo.JobLeve //职务等级"` + myCont.Time = myContInfo.Time //写入时间"` + myCont.EiteTime = myContInfo.EiteTime // 编辑时间"` + myCont.Wechat = myContInfo.Wechat //微信UserId"` + myCont.WorkWechat = myContInfo.WorkWechat //企业微信UserId"` + myCont.State = myContInfo.State //状态(1:启用;2:禁用;3:删除)` + myCont.Key = myContInfo.Key //nkey"` + myCont.IsAdmin = myContInfo.IsAdmin //是否为管理员(1:不是;2:分公司;3:集团管理员;4:超级管` + myCont.Password = myContInfo.Password // 密码"` + myCont.Role = myContInfo.Role // 角色 + myCont.Idcardno = myContInfo.Idcardno //t 身份证号"` + myCont.Passportno = myContInfo.Passportno // 护照号码"` + myCont.Globalroaming = myContInfo.Globalroaming // 国际区号"` + myCont.Mobilephone = myContInfo.Mobilephone //手机号码"` + myCont.Email = myContInfo.Email //电子邮件"` + myCont.Gender = myContInfo.Gender //性别(1:男性;2:女性;3:中性)"` + myCont.Birthday = myContInfo.Birthday //birthday"` + myCont.Myfolk = myContInfo.Myfolk //民族"` + myCont.Nativeplace = myContInfo.Nativeplace //籍贯"` + myCont.Idcardstartdate = myContInfo.Idcardstartdate // 身份证有效期开始"` + myCont.Idcardenddate = myContInfo.Idcardenddate //身份证有效期结束"` + myCont.Idcardaddress = myContInfo.Idcardaddress // 身份证地址"` + myCont.IdcardIssued = myContInfo.IdcardIssued // 身份证签发机关"` + myCont.Health = myContInfo.Health //健康状况(1:良好;2:一般;3:较弱,4:有生理缺陷;5:残废)"` + myCont.Maritalstatus = myContInfo.Maritalstatus //婚姻状况(1:未婚;2:已婚;3:丧偶;4:离异)"` + myCont.Internaltelephone = myContInfo.Internaltelephone //i内线电话"` + myCont.Currentresidence = myContInfo.Currentresidence //现居住地址"` + myCont.Constellation = myContInfo.Constellation //星座(1:白羊座;2:金牛座;3:双子座;4:巨蟹座;5:狮子座;6:处女座;7:天枰座;8:天蝎座;9:射手座;10:摩羯座;11:水瓶座;12:双鱼座)"` + myCont.Isdoubleworker = myContInfo.Isdoubleworker //是否双职工(1:是;2:否)"` + myCont.Isveterans = myContInfo.Isveterans //是否为退役军人(1:是;2:否)"` + myCont.Veteransnumber = myContInfo.Veteransnumber //退役证编号"` + myCont.Jobstartdate = myContInfo.Jobstartdate //参加工作日期"` + myCont.Entrydate = myContInfo.Entrydate //入职日期"` + myCont.Probationperiod = myContInfo.Probationperiod //试用期"` + myCont.Planformaldate = myContInfo.Planformaldate //预计转正日期"` + myCont.PoliticalOutlook = myContInfo.PoliticalOutlook //政治面貌(1:群众;2:无党派;3:台盟会员;4:九三社员;5:致公党员;6:农工党员;7:民进会员;8:民建会员;9:民盟盟员;10:民革会员,11:共青团员;12:预备党员;13:中共党员)"` + myCont.Level = powerInfo.Level + myCont.PointIdList = PointIdList + myCont.OrganizationList = OrganizationList + return +} + +// Get请求 +func CurlGet(getUrl string) []byte { + client := &http.Client{} + reqest, err := http.NewRequest("GET", getUrl, nil) + if err != nil { + panic(err) + } + response, _ := client.Do(reqest) + defer response.Body.Close() + body, err := ioutil.ReadAll(response.Body) + return body +} + +// Post请求 json +func CurlPostJosn(postUrl string, jsonData []byte) []byte { + req, err := http.NewRequest("POST", postUrl, bytes.NewBuffer(jsonData)) + req.Header.Set("Content-Type", "application/json;charset=utf-8") + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + panic(err) + } + defer resp.Body.Close() + body, _ := ioutil.ReadAll(resp.Body) + return body +} + +// 判断用户身份 +func DetermineUserIdentity(userKey int64) (identity outShenFen) { + var userCont modelshr.PersonArchives + err := userCont.GetCont(map[string]interface{}{"`key`": userKey}) + if err != nil { + identity.Level = 1 + return + } + //角色权限范围判定 + roleList := strings.Split(userCont.Role, ",") + var roleVerify modelssystempermission.RoleEmpower + overall.CONSTANT_DB_System_Permission.Where("`state` = 1 AND `system` = ? AND `id` IN ? ", "kpi", roleList).Find(&roleVerify) + //岗位权限范围判定 + var postVerify modelssystempermission.Empower + postVerify.GetCont(map[string]interface{}{"`post_id`": userCont.Position, "`state`": 1, "`system`": "kpi"}) + if roleVerify.Level >= postVerify.Level { + identity.Level = roleVerify.Level + } else { + identity.Level = postVerify.Level + } + + switch identity.Level { + case 2: + identity.Level = 2 + + var sunOrg GetOrgAllParent + sunOrg.GetOrgSonAllId(userCont.MainDeparment) + identity.OrgList = sunOrg.Id + identity.OrgList = append(identity.OrgList, userCont.MainDeparment) + case 3: + identity.Level = 3 + identity.Group = userCont.Company + case 4: + identity.Level = 4 + if roleVerify.Organization != "" { + orgList := strings.Split(roleVerify.Organization, ",") + for _, v := range orgList { + orgIdInt, _ := strconv.ParseInt(v, 10, 64) + if !IsInTrue[int64](orgIdInt, identity.OrgList) { + identity.OrgList = append(identity.OrgList, orgIdInt) + } + } + } + if postVerify.Organization != "" { + orgListPost := strings.Split(postVerify.Organization, ",") + for _, pv := range orgListPost { + orgIdPostInt, _ := strconv.ParseInt(pv, 10, 64) + if !IsInTrue[int64](orgIdPostInt, identity.OrgList) { + identity.OrgList = append(identity.OrgList, orgIdPostInt) + } + } + } + case 5: + identity.Level = 5 + identity.Group = 0 + identity.OrgList = []int64{} + default: + identity.Level = 1 + } + return +} diff --git a/overall/publicmethod/log.go b/overall/publicmethod/log.go new file mode 100644 index 0000000..f8fc1bd --- /dev/null +++ b/overall/publicmethod/log.go @@ -0,0 +1,71 @@ +package publicmethod + +import ( + "fmt" + "appPlatform/overall" + "log" + "os" + "time" +) + +//日志相关操作 +//判断文件夹是否存在,不存在得话就创建 +/* +@path 日志文件夹 +*/ +func PathExists(path string) bool { + _, err := os.Stat(path) + // fmt.Printf("path----->%v\n", err) + if err == nil { + return true + } + if os.IsNotExist(err) { + mkdirErr := os.Mkdir(path, os.ModePerm) + if mkdirErr == nil { + return true + } else { + return false + } + } + return true +} + +//写日志 +func WriteLog(class string, errmsg ...any) { + // var ErrorLog *log.Logger + fileName := fmt.Sprintf("./%v/%v", overall.CONSTANT_CONFIG.Logsetup.Path, UnixTimeToDay(time.Now().Unix(), 21)) + // fmt.Printf("fileName--->%v\n", fileName) + if PathExists(fileName) != true { + return + } + logFilePath := fmt.Sprintf("%v/%v.log", fileName, UnixTimeToDay(time.Now().Unix(), 20)) + file, err := os.OpenFile(logFilePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0766) + if err != nil { + log.Fatalln("Failed to open error log file: ", err) + } + // fmt.Printf("logFilePath--->%v\n", logFilePath) + errLevel := "[Trace] " + switch class { + case "i": + errLevel = "[Info] " + case "w": + errLevel = "[Warning] " + case "e": + errLevel = "[Error] " + case "write": + errLevel = "[Write] " + case "add": + errLevel = "[Add] " + case "edit": + errLevel = "[Edit] " + case "del": + errLevel = "[Delete] " + default: + errLevel = "[Trace] " + } + + loger := log.New(file, errLevel, log.Ldate|log.Ltime) + loger.SetFlags(log.Ldate | log.Ltime) + loger.Println(errmsg) + return +} diff --git a/overall/publicmethod/technique.go b/overall/publicmethod/technique.go new file mode 100644 index 0000000..46977f4 --- /dev/null +++ b/overall/publicmethod/technique.go @@ -0,0 +1,2135 @@ +package publicmethod + +import ( + "appPlatform/middleware/grocerystore" + "appPlatform/middleware/snowflake" + "appPlatform/models/modelshr" + "appPlatform/models/modelsschool" + "appPlatform/models/modelsstorage" + "appPlatform/models/modelssystempermission" + "appPlatform/overall" + "bytes" + "crypto/md5" + "crypto/rand" + "crypto/sha1" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "math" + "math/big" + "reflect" + "sort" + "strconv" + "strings" + "time" + + "github.com/mozillazg/go-pinyin" + "gorm.io/gorm" +) + +// 全局函数处理 +// 时间相关处理类 +var ( + timeLayoutMap = map[string]string{ + "y": "2006", + "m": "2006-01", + "d": "2006-01-02", + "h": "2006-01-02 15", + "i": "2006-01-02 15:04", + "s": "2006-01-02 15:04:05", + } + + weekDay = map[string]int{ + "Monday": 1, + "Tuesday": 2, + "Wednesday": 3, + "Thursday": 4, + "Friday": 5, + "Saturday": 6, + "Sunday": 7, + } +) + +// 编号,纯数字 +func TableNumber(class ...string) (number int64) { + result, _ := rand.Int(rand.Reader, big.NewInt(8999)) + numberTeam := result.Int64() + 1000 + numberStr := fmt.Sprintf("%v%v", time.Now().Unix(), numberTeam) + if len(class) > 0 { + resultLong, _ := rand.Int(rand.Reader, big.NewInt(8999999)) + numberTeamLong := resultLong.Int64() + 1000000 + numberStr = fmt.Sprintf("%v%v", time.Now().Unix(), numberTeamLong) + } + number, _ = strconv.ParseInt(numberStr, 10, 64) + return +} + +// 获取UUID +func GetUUid(workId int64) (uuId int64) { + snowflakeId, snowflakeErr := snowflake.NewWorker(workId) + if snowflakeErr != nil { + uuId = TableNumber() + } else { + uuId = snowflakeId.GetId() + } + return +} + +// 初始化map(泛型) +func MapOut[T GenericityVariable]() (data map[T]interface{}) { + data = make(map[T]interface{}) //必可不少,分配内存 + return data +} + +//时间搓转换成日期 +/* +@timestamp 待转换的时间戳 +@timeType 转换类型 +*/ +func UnixTimeToDay(timeStamp int64, timeType int) (dateStr string) { + timeTemplate := "2006-01-02 15:04:05" //常规类型 + switch timeType { + case 1: + timeTemplate = "2006/01/02 15:04:05" + case 2: + timeTemplate = "2006/01/02 15:04" + case 3: + timeTemplate = "2006/01/02 15" + case 4: + timeTemplate = "2006/01/02" + case 5: + timeTemplate = "15:04:05" + case 6: + timeTemplate = "15:04" + case 7: + timeTemplate = "15" + case 8: + timeTemplate = "04:05" + case 9: + timeTemplate = "04" + case 10: + timeTemplate = "05" + case 11: + timeTemplate = "2006-01-02 15:04:05" + case 12: + timeTemplate = "2006-01-02 15:04" + case 13: + timeTemplate = "2006-01-02 15" + case 14: + timeTemplate = "2006-01-02" + case 15: + timeTemplate = "2006-01" //年月 + case 16: + timeTemplate = "2006" //年 + case 17: + timeTemplate = "01" //月 + case 18: + timeTemplate = "02" //日 + case 19: //季度 + dayMonth := time.Unix(timeStamp, 0).Format("01") + datMonthFloat, datMonthFloatErr := strconv.ParseFloat(dayMonth, 10) + if datMonthFloatErr == nil { + dateStr = strconv.FormatFloat(math.Ceil(datMonthFloat/3), 'f', -1, 64) + } else { + dateStr = "1" + } + dateStr = "1" + // fmt.Printf("获取是电话卡-------------->%v------------>%v------------>%v\n", dateStr, datMonthFloat, datMonthFloatErr) + case 20: + timeTemplate = "20060102" + case 21: + timeTemplate = "200601" + case 22: + timeTemplate = "01-02" + case 23: //当前日期为本月第几周 + monthFirstDayStr := DateToTimeStampOld(UnixTimeToDay(timeStamp, 10) + "-01 00:00:00") //获取指定月第一天时间戳 + dayTime := time.Unix(monthFirstDayStr, 0) + dayOfWeek := int(dayTime.Weekday()) //获取本月第一天是周几 + if dayOfWeek == 0 { + dayOfWeek = 7 + } + + dayNumber, dayNumberErr := strconv.ParseInt(UnixTimeToDay(timeStamp, 9), 10, 64) //获取今天是几号 + if dayNumberErr != nil { + dayNumber = 1 + } + daysAndWeeksDiff := dayNumber - (8 - int64(dayOfWeek)) + if daysAndWeeksDiff <= 0 { + dateStr = "1" + } else { + daysAndWeeksDiffFlot, daysAndWeeksDiffFloatErr := strconv.ParseFloat(strconv.FormatInt(daysAndWeeksDiff, 10), 10) + if daysAndWeeksDiffFloatErr == nil { + daysWeeksDiffVal := math.Ceil(daysAndWeeksDiffFlot/7) + 1 + dateStr = strconv.FormatFloat(daysWeeksDiffVal, 'f', -1, 64) + } else { + dateStr = "1" + } + } + default: + timeTemplate = "2006-01-02 15:04:05" //常规类型 + } + dateStr = time.Unix(timeStamp, 0).Format(timeTemplate) + return +} + +/* +日期转时间戳 +*/ +func DateToTimeStamp(dataStr string) (timeStamp int64, isTrue bool) { + isTrue = false + tmp := "2006-01-02 15:04:05" + res, err := time.ParseInLocation(tmp, dataStr, time.Local) + timeStamp = res.Unix() + if err == nil { + isTrue = true + } + return +} +func DateToTimeStampOld(dataStr string) (timeStamp int64) { + tmp := "2006-01-02 15:04:05" + res, _ := time.ParseInLocation(tmp, dataStr, time.Local) + timeStamp = res.Unix() + return +} + +// 数据库查询翻页 +func LimitPage(page, pageSize int) (offSet int) { + if page < 1 { + page = 1 + } + offSet = pageSize * (page - 1) + if offSet < 0 { + offSet = 0 + } + return +} + +// 数据库查询翻页 +func LimitPage64(page, pageSize int64) (offSet int64) { + if page < 1 { + page = 1 + } + offSet = pageSize * (page - 1) + if offSet < 0 { + offSet = 0 + } + return +} + +// 中文首字母大写 +func ChineseFirstWordCapitalize(wordStr string) (firstWord string) { + pinYinSub := pinyin.NewArgs() + rows := pinyin.Pinyin(wordStr, pinYinSub) + for i := 0; i < len(rows); i++ { + if len(rows[i]) != 0 { + str := rows[i][0] + pi := str[0:1] + firstWord += string(bytes.ToUpper([]byte(pi))) + } + } + return +} + +// ZeroFillByStr +// @Description: 字符串补零 +// @param str :需要操作的字符串 +// @param resultLen 结果字符串的长度 +// @param reverse true 为前置补零,false 为后置补零 +// @return string +func ZeroFillByStr(str string, resultLen int, reverse bool) string { + if len(str) > resultLen || resultLen <= 0 { + return str + } + if reverse { + return fmt.Sprintf("%0*s", resultLen, str) //不足前置补零 + } + result := str + for i := 0; i < resultLen-len(str); i++ { + result += "0" + } + return result +} + +/* +*加密算法 + */ +type Md5Encryption struct { + Code string `json:"code"` + AppKey string `json:"appKey"` +} + +func (m *Md5Encryption) Md5EncryptionAlgorithm() (md5Val string) { + if m.AppKey == "" { + m.Md5EncryptionInit(m.Code) + } + // fmt.Printf("Code ====> %v\n", m.Code) + // fmt.Printf("AppKey ====> %v\n", m.AppKey) + + mdNew := md5.New() + mdNew.Write([]byte(m.AppKey)) + keyMd5 := fmt.Sprintf("%x", mdNew.Sum(nil)) + + // fmt.Printf("Step1:--AppKey-加密->%v\n", keyMd5) + + codeNewMd1 := md5.New() + codeNewMd1.Write([]byte(m.Code)) + codeMd1 := fmt.Sprintf("%x", codeNewMd1.Sum(nil)) + + // fmt.Printf("Step2:--CodeString-加密->%v\n", codeMd1) + + yiCeng := codeMd1 + keyMd5 + + // fmt.Printf("Step3:--CodeString+AppKey-->%v\n", yiCeng) + + yiCengNew := md5.New() + yiCengNew.Write([]byte(yiCeng)) + yiCengMd5 := fmt.Sprintf("%x", yiCengNew.Sum(nil)) + + // fmt.Printf("Step4:--one-加密->%v\n", yiCengMd5) + + erCeng := yiCengMd5 + m.AppKey + + // fmt.Printf("Step5:--one + AppKey->%v\n", erCeng) + + // fmt.Printf("AppKey ===2=> %v\n", m.AppKey) + + erCengNew := md5.New() + erCengNew.Write([]byte(erCeng)) + md5Val = fmt.Sprintf("%x", erCengNew.Sum(nil)) + + // fmt.Printf("Step6:--therr--加密-->%v\n", md5Val) + + // md5Val = codeMd1 + return +} + +func (m *Md5Encryption) Md5EncryptionAlgorithmFj() (md5Val string, outlog []string) { + if m.AppKey == "" { + m.Md5EncryptionInit(m.Code) + } + // fmt.Printf("Code ====> %v\n", m.Code) + // fmt.Printf("AppKey ====> %v\n", m.AppKey) + + outlog = append(outlog, fmt.Sprintf("Code ====> %v", m.Code)) + outlog = append(outlog, fmt.Sprintf("AppKey ====> %v", m.AppKey)) + + mdNew := md5.New() + mdNew.Write([]byte(m.AppKey)) + keyMd5 := fmt.Sprintf("%x", mdNew.Sum(nil)) + + // fmt.Printf("Step1:--AppKey-加密->%v\n", keyMd5) + outlog = append(outlog, fmt.Sprintf("Step1:--AppKey-加密->%v", keyMd5)) + + codeNewMd1 := md5.New() + codeNewMd1.Write([]byte(m.Code)) + codeMd1 := fmt.Sprintf("%x", codeNewMd1.Sum(nil)) + + // fmt.Printf("Step2:--CodeString-加密->%v\n", codeMd1) + outlog = append(outlog, fmt.Sprintf("Step2:--CodeString-加密->%v", codeMd1)) + + yiCeng := codeMd1 + keyMd5 + + // fmt.Printf("Step3:--CodeString+AppKey-->%v\n", yiCeng) + outlog = append(outlog, fmt.Sprintf("Step3:--CodeString+AppKey-->%v", yiCeng)) + + yiCengNew := md5.New() + yiCengNew.Write([]byte(yiCeng)) + yiCengMd5 := fmt.Sprintf("%x", yiCengNew.Sum(nil)) + + // fmt.Printf("Step4:--one-加密->%v\n", yiCengMd5) + outlog = append(outlog, fmt.Sprintf("Step4:--one-加密->%v", yiCengMd5)) + + erCeng := yiCengMd5 + m.AppKey + + // fmt.Printf("Step5:--one + AppKey->%v\n", erCeng) + outlog = append(outlog, fmt.Sprintf("Step5:--one + AppKey->%v", erCeng)) + + // fmt.Printf("AppKey ===2=> %v\n", m.AppKey) + + erCengNew := md5.New() + erCengNew.Write([]byte(erCeng)) + md5Val = fmt.Sprintf("%x", erCengNew.Sum(nil)) + + // fmt.Printf("Step6:--therr--加密-->%v\n", md5Val) + outlog = append(outlog, fmt.Sprintf("Step6:--therr--加密-->%v", md5Val)) + + // md5Val = codeMd1 + return +} + +// 初始化程序 +func (m *Md5Encryption) Md5EncryptionInit(code string) { + m.AppKey = overall.CONSTANT_CONFIG.Appsetup.AppKey + m.Code = code +} + +// sha1算法 +func Sha1Encryption(str string) string { + sha1 := sha1.New() + sha1.Write([]byte(str)) + return hex.EncodeToString(sha1.Sum(nil)) +} + +//计算当前时间N个月后的时间 +/* +@timeStamp 当前时间戳 +@futureTime 正数多少时间后,负数多少时间前 +*/ +func GetFutureMonthTime(timeStamp int64, futureTime, class int) (dateStr int64) { + timeUnix := time.Unix(timeStamp, 0) + addDate := timeUnix.AddDate(0, 0, futureTime) + switch class { + case 2: + addDate = timeUnix.AddDate(0, futureTime, 0) + case 3: + addDate = timeUnix.AddDate(futureTime, 0, 0) + default: + addDate = timeUnix.AddDate(0, 0, futureTime) + } + + dateStr = addDate.Unix() + return +} + +// 判断字符串是否在切片中 泛型 +func IsInTrue[T GenericityVariable](key T, keyAry []T) (isTrue bool) { + isTrue = false + for _, v := range keyAry { + if v == key { + return true + } + } + return +} + +// 获取两个切片得差集 +func DifferenceSet[T GenericityVariable](one, two []T) []T { + var three []T + temp := map[T]struct{}{} + for _, val := range two { + if _, ok := temp[val]; !ok { + temp[val] = struct{}{} + } + } + for _, val := range one { + if _, ok := temp[val]; !ok { + three = append(three, val) + } + } + return three +} + +// 两个切片的交集 +func Intersect[T GenericityVariable](a, b []T) []T { + inter := make([]T, 0) + mp := make(map[T]bool) + + for _, s := range a { + if _, ok := mp[s]; !ok { + mp[s] = true + } + } + for _, s := range b { + if _, ok := mp[s]; ok { + inter = append(inter, s) + } + } + + return inter +} + +//判断类型转换成 +/* +字符转int +*/ +func StringToInt(val interface{}) (int, error) { + switch val.(type) { + case string: + return strconv.Atoi(val.(string)) + case int: + return val.(int), nil + default: + return 0, nil + } + return 0, nil +} + +/* +字符转int64 +*/ +func StringToInt64(val interface{}) (int64, error) { + switch val.(type) { + case string: + return strconv.ParseInt(val.(string), 10, 64) + case int: + return int64(val.(int)), nil + case int64: + return val.(int64), nil + default: + return 0, nil + } + return 0, nil +} + +// 获取人员TokenRedis 信息 +func GetUserRedisToken(number string) (manCont modelshr.ManCont, err error) { + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, number) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + useMap, isTrue := redisClient.HashGetAll(redisMyContKey) + if isTrue == false { + err.Error() + return + } + // fmt.Printf("%v\n", useMap) + err = MapToStruct(useMap, &manCont, "json") + return +} + +// 获取人员Redis信息 +func GetUserRedisCont(number string) (manCont modelshr.ManCont, err error) { + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, number) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + useMap, isTrue := redisClient.HashGetAll(redisMyContKey) + if isTrue == false { + err.Error() + return + } + // fmt.Printf("%v\n", useMap) + // var manInfo models.ManCont + err = MapToStruct(useMap, &manCont, "json") + // manCont = manInfo + return +} + +// 获取人员Redis信息返回指针 +func GetUserRedisContPointer(number string) (manCont modelshr.ManCont, err error) { + redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, number) + // fmt.Printf("redisMyContKey------------>%v\n", redisMyContKey) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + useMap, isTrue := redisClient.HashGetAll(redisMyContKey) + if isTrue == false { + err.Error() + return + } + // fmt.Printf("%v\n", useMap) + // var manInfo models.ManCont + err = MapToStruct(useMap, &manCont, "json") + // manCont = manInfo + return +} + +/* +map[string]string 转 struct +*/ +func MapToStruct(mapString map[string]string, structInterface interface{}, tag string) (err error) { + strType := reflect.TypeOf(structInterface) + strValue := reflect.ValueOf(structInterface) + switch strType.Kind() { + case reflect.Ptr: + if strType.Elem().Kind() != reflect.Struct { + // fmt.Printf("1-->%v\n", strType.Elem().Kind().String()) + return errors.New("需要*struct类型,却传入*" + strType.Elem().Kind().String() + "类型") + } + default: + // fmt.Printf("2-->%v\n", strType.Kind().String()) + return errors.New("需要*struct类型,却传入" + strType.Kind().String() + "类型") + } + // fmt.Printf("strType--->%v---strValue---->%v\n", strType, strValue) + strTypeElem := strType.Elem() + strValueElem := strValue.Elem() + strTypeNum := strTypeElem.NumField() + // fmt.Printf("strTypeElem--->%v---strValueElem---->%v---------strTypeNum--------->%v\n", strTypeElem, strValueElem, strTypeNum) + for i := 0; i < strTypeNum; i++ { + fieldName := strTypeElem.Field(i).Name + if tag != "" { + fieldName = strTypeElem.Field(i).Tag.Get(tag) + } + value, ok := mapString[fieldName] + if !ok { + continue + } + // fmt.Printf("name--->%v---tag---->%v----value---->%v----ok---->%v\n", fieldName, tag, value, ok) + if strValueElem.Field(i).CanSet() { + // fmt.Printf("Type--->%v---value---->%v\n", strValueElem.Field(i).Type(), reflect.TypeOf(value)) + valType := fmt.Sprintf("%v", strValueElem.Field(i).Type()) + switch valType { + case "int": + valueInt, _ := strconv.Atoi(value) + strValueElem.Field(i).Set(reflect.ValueOf(valueInt)) + case "int32": + valueInt32, _ := strconv.ParseInt(value, 10, 32) + strValueElem.Field(i).Set(reflect.ValueOf(int32(valueInt32))) + case "int64": + valueInt64, _ := strconv.ParseInt(value, 10, 64) + strValueElem.Field(i).Set(reflect.ValueOf(valueInt64)) + case "float32": + valuefloat32, _ := strconv.ParseFloat(value, 32) + strValueElem.Field(i).Set(reflect.ValueOf(float32(valuefloat32))) + case "float64": + valuefloat64, _ := strconv.ParseFloat(value, 64) + strValueElem.Field(i).Set(reflect.ValueOf(valuefloat64)) + case "string": + strValueElem.Field(i).Set(reflect.ValueOf(value)) + default: + + } + } else { + continue + } + } + return +} + +// 翻页设置 +func PageTurningSettings(gormDb *gorm.DB, page, pageSize int) *gorm.DB { + if page < 0 { + page = 1 + } + if pageSize < 0 { + pageSize = 10 + } + gormDb = gormDb.Limit(pageSize).Offset(LimitPage(page, pageSize)) + return gormDb +} + +//浮点数保留小数 +/* +@value 浮点数值 +@weishu 要保留的小数位数 +*/ +func DecimalEs(value float64, weishu int) float64 { + switch weishu { + case 3: + value, _ = strconv.ParseFloat(fmt.Sprintf("%.3f", value), 64) + case 4: + value, _ = strconv.ParseFloat(fmt.Sprintf("%.4f", value), 64) + case 5: + value, _ = strconv.ParseFloat(fmt.Sprintf("%.5f", value), 64) + case 6: + value, _ = strconv.ParseFloat(fmt.Sprintf("%.6f", value), 64) + default: + value, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", value), 64) + } + + return value +} + +// 递归查找 +func RecursionOrgLeve(superior int64, leve int64) (groupId int64) { + if leve == 0 { + leve = 1 + } + if superior == 0 { + return + } + var orgMap modelshr.OrgContType + err := orgMap.GetCont(map[string]interface{}{"`id`": superior, "`state`": 1}, "`id`", "`superior`", "`level`") + if err != nil { + return + } + + if orgMap.Level <= leve { + groupId = orgMap.Id + return + } else { + groupId = RecursionOrgLeve(orgMap.Superior, leve) + } + return +} + +// 获取集团、公司、部门、二级部门、工段 +func GetOrgStructurees(orgId int64) (groupId, companyId, departmentId, sunDepartId, workShopId int64) { + if orgId == 0 { + return + } + var orgContTypeInfo modelshr.OrgContType + err := orgContTypeInfo.GetCont(map[string]interface{}{"`id`": orgId}) + if err != nil { + return + } + switch orgContTypeInfo.Level { + case 1: + groupId = orgContTypeInfo.Id + case 2: + groupId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 1) + workShopId = orgContTypeInfo.Id + case 3: + groupId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 2) + companyId = orgContTypeInfo.Id + case 4: + groupId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 2) + companyId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 3) + departmentId = orgContTypeInfo.Id + case 5: + groupId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 2) + companyId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 3) + departmentId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 4) + sunDepartId = orgContTypeInfo.Id + case 6: + groupId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 2) + companyId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 3) + departmentId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 4) + sunDepartId = RecursionOrgLevees(orgId, orgContTypeInfo.Superior, 5) + workShopId = orgContTypeInfo.Id + default: + groupId = orgContTypeInfo.Id + companyId = orgContTypeInfo.Id + workShopId = orgContTypeInfo.Id + } + return +} + +func RecursionOrgLevees(oldId, superior int64, leve int64) (groupId int64) { + if leve == 0 { + leve = 1 + } + if superior == 0 { + return + } + var orgMap modelshr.OrgContType + err := orgMap.GetCont(map[string]interface{}{"`id`": superior, "`state`": 1}, "`id`", "`superior`", "`level`") + if err != nil { + return + } + if orgMap.Level <= leve { + if orgMap.Level == leve { + groupId = oldId + } else { + groupId = orgMap.Id + } + + return + } else { + groupId = RecursionOrgLevees(orgMap.Id, orgMap.Superior, leve) + } + return +} + +// 获取集团、公司、部门、二级部门、工段 +func GetOrgStructure(orgId int64) (groupId, companyId, departmentId, sunDepartId, workShopId int64) { + if orgId == 0 { + return + } + var orgContTypeInfo modelshr.OrgContType + err := orgContTypeInfo.GetCont(map[string]interface{}{"`id`": orgId}) + if err != nil { + return + } + switch orgContTypeInfo.Level { + case 1: + groupId = orgContTypeInfo.Id + case 2: + groupId = RecursionOrgLeve(orgContTypeInfo.Superior, 1) + workShopId = orgContTypeInfo.Id + case 3: + groupId = RecursionOrgLeve(orgContTypeInfo.Superior, 2) + companyId = orgContTypeInfo.Id + case 4: + groupId = RecursionOrgLeve(orgContTypeInfo.Superior, 2) + companyId = RecursionOrgLeve(orgContTypeInfo.Superior, 3) + departmentId = orgContTypeInfo.Id + case 5: + groupId = RecursionOrgLeve(orgContTypeInfo.Superior, 2) + companyId = RecursionOrgLeve(orgContTypeInfo.Superior, 3) + departmentId = RecursionOrgLeve(orgContTypeInfo.Superior, 4) + sunDepartId = orgContTypeInfo.Id + case 6: + groupId = RecursionOrgLeve(orgContTypeInfo.Superior, 2) + companyId = RecursionOrgLeve(orgContTypeInfo.Superior, 3) + departmentId = RecursionOrgLeve(orgContTypeInfo.Superior, 4) + sunDepartId = RecursionOrgLeve(orgContTypeInfo.Superior, 5) + workShopId = orgContTypeInfo.Id + default: + groupId = orgContTypeInfo.Id + companyId = orgContTypeInfo.Id + workShopId = orgContTypeInfo.Id + } + return +} + +// 获取指定行政组织id,所有子类 +func GetDepartmentSun(superior int64, idary []int64) (orgIdAry []int64) { + var orgAry []modelshr.AdministrativeOrganization + err := overall.CONSTANT_DB_HR.Model(&modelshr.AdministrativeOrganization{}).Select("`id`").Where("`state` = 1 AND `superior` = ?", superior).Find(&orgAry).Error + if err != nil { + return + } + for _, v := range orgAry { + if IsInTrue[int64](v.Id, orgIdAry) == false { + orgIdAry = append(orgIdAry, v.Id) + GetDepartmentSun(v.Id, orgIdAry) + } else { + GetDepartmentSun(v.Id, orgIdAry) + } + } + return +} + +// 获取集团或第一实权部门 +func GetGroupOrDepartPower(parentId int64, departId ...int64) int64 { + var orgCont modelshr.AdministrativeOrganization + err := orgCont.GetCont(map[string]interface{}{"id": parentId}, "id", "organization_type", "superior", "ispower") + if err != nil { + return parentId + } + if len(departId) > 0 { + if orgCont.IsPower == 1 { + return orgCont.Id + } + return GetGroupOrDepartPower(orgCont.Superior, 1) + } else { + if orgCont.OrganizationType <= 2 { + return orgCont.Id + } + return GetGroupOrDepartPower(orgCont.Superior) + } + return orgCont.Id +} + +// 时间计算(年、季、月、周、日、时、分、秒) +func ComputingTime(timeStamp int64, timeType int) (timeDataInt int64) { + var timeData string = "1" + switch timeType { + case 1: + timeData = time.Unix(timeStamp, 0).Format("2006") //年 + case 2: + dayMonth := time.Unix(timeStamp, 0).Format("01") //季度 + datMonthFloat, datMonthFloatErr := strconv.ParseFloat(dayMonth, 10) + if datMonthFloatErr == nil { + timeData = strconv.FormatFloat(math.Ceil(datMonthFloat/3), 'f', -1, 64) + } else { + timeData = "1" + } + case 3: + timeData = time.Unix(timeStamp, 0).Format("01") //月份 + case 4: //当前日期为本月第几周 + monthFirstDayStr := DateToTimeStampOld(UnixTimeToDay(timeStamp, 15) + "-01 00:00:00") //获取指定月第一天时间戳 + dayTime := time.Unix(monthFirstDayStr, 0) + dayOfWeek := int(dayTime.Weekday()) //获取本月第一天是周几 + if dayOfWeek == 0 { + dayOfWeek = 7 + } + + dayNumber, dayNumberErr := strconv.ParseInt(UnixTimeToDay(timeStamp, 18), 10, 64) //获取今天是几号 + if dayNumberErr != nil { + dayNumber = 1 + } + daysAndWeeksDiff := dayNumber - (8 - int64(dayOfWeek)) + if daysAndWeeksDiff <= 0 { + timeData = "1" + } else { + daysAndWeeksDiffFlot, daysAndWeeksDiffFloatErr := strconv.ParseFloat(strconv.FormatInt(daysAndWeeksDiff, 10), 10) + if daysAndWeeksDiffFloatErr == nil { + daysWeeksDiffVal := math.Ceil(daysAndWeeksDiffFlot/7) + 1 + timeData = strconv.FormatFloat(daysWeeksDiffVal, 'f', -1, 64) + } else { + timeData = "1" + } + } + case 5: + timeData = time.Unix(timeStamp, 0).Format("02") //天 + case 7: + timeData = time.Unix(timeStamp, 0).Format("15") //时 + case 8: + timeData = time.Unix(timeStamp, 0).Format("04") //分 + case 9: + timeData = time.Unix(timeStamp, 0).Format("05") //秒 + default: + timeData = "0" + } + timeDataInt, timeDataIntErr := strconv.ParseInt(timeData, 10, 64) + if timeDataIntErr != nil { + timeDataInt = 0 + return + } + return +} + +/* +获取岗位权限 +@ordid 行政组织 +@postid 岗位 +@system 系统标识 +*/ +func GetPostPower(ordid, postid int64, system string) (menuIdAry, menuUrl []string, err error) { + redisFileEmpowerKey := fmt.Sprintf("ScanCode:SystemEmpower:Authorize_%v_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, system, postid) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) + empowerRedisToken, isTrue := redisClient.HashGetAll(redisFileEmpowerKey) + // fmt.Printf("empowerRedisToken------------->%v---------->isTrue------------->%v---------->redisFileEmpowerKey------------->%v\n", empowerRedisToken, isTrue, redisFileEmpowerKey) + if isTrue == false { + fmt.Printf("GetPostPower-1-->%v\n", empowerRedisToken["menuid"]) + menuIdAry, menuUrl, err = readMenuList(postid, system) + writeRedisData := MapOut[string]() + writeRedisData["menuid"] = strings.Join(menuIdAry, ",") + writeRedisData["menuurl"] = strings.Join(menuUrl, "|_^_|") + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileEmpowerKey, writeRedisData) + } else { + // fmt.Printf("GetPostPower-2-->%v\n", empowerRedisToken["menuid"]) + menuIdAry = strings.Split(empowerRedisToken["menuid"], ",") + menuUrl = strings.Split(empowerRedisToken["menuurl"], "|_^_|") + // fmt.Printf("GetPostPower-3-->%v-->%v\n", len(menuIdAry), menuIdAry) + if len(menuIdAry) <= 1 { + menuIdAry, menuUrl, err = readMenuList(postid, system) + writeRedisData := MapOut[string]() + writeRedisData["menuid"] = strings.Join(menuIdAry, ",") + writeRedisData["menuurl"] = strings.Join(menuUrl, "|_^_|") + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileEmpowerKey, writeRedisData) + } + } + + return +} + +/* +读取菜单 +*/ +func readMenuList(postid int64, system string) (menuIdAry, menuUrl []string, err error) { + var ponitId string + err = overall.CONSTANT_DB_System_Permission.Model(&modelssystempermission.Empower{}).Select("`point_id`").Where("`state` = 1 AND `post_id` = ? AND `system` = ?", postid, system).Find(&ponitId).Error + if err != nil { + return + } + menuIdAry = strings.Split(ponitId, ",") + if len(menuIdAry) < 1 { + return + } + switch system { + case "cangchu": + menuUrl, err = getStorageSystemEmpower(menuIdAry) + default: + //绩效考核系统 + menuUrl, err = getKpiSystemEmpower(menuIdAry) + } + return +} + +/* +获取绩效考核系统授权菜单 +@menuIdAry 菜单ID +*/ +func getKpiSystemEmpower(menuIdAry []string) (menuUrl []string, err error) { + if len(menuIdAry) < 1 { + return + } + var empowerMenuUrl []string + err = overall.CONSTANT_DB_Master.Model(&modelsschool.SystemMenuSchool{}).Distinct("`m_url`").Where("`m_steat` = 1 AND `m_id` IN ?", menuIdAry).Find(&empowerMenuUrl).Error + if err != nil || len(empowerMenuUrl) < 1 { + return + } + for i := 0; i < len(empowerMenuUrl); i++ { + if empowerMenuUrl[i] != "#" && IsInTrue[string](empowerMenuUrl[i], menuUrl) == false { + menuUrl = append(menuUrl, empowerMenuUrl[i]) + } + } + return +} + +/* +获取仓储考核系统授权菜单 +@menuIdAry 菜单ID +*/ +func getStorageSystemEmpower(menuIdAry []string) (menuUrl []string, err error) { + if len(menuIdAry) < 1 { + return + } + var empowerMenuUrl []string + err = overall.CONSTANT_DB_Storage.Model(&modelsstorage.AccesstoAddress{}).Distinct("`url`").Where("`state` = 1 AND `id` IN ?", menuIdAry).Find(&empowerMenuUrl).Error + if err != nil || len(empowerMenuUrl) < 1 { + return + } + // fmt.Printf("empowerMenuUrl---------->%v\n", empowerMenuUrl) + for i := 0; i < len(empowerMenuUrl); i++ { + if empowerMenuUrl[i] != "#" && empowerMenuUrl[i] != "" && IsInTrue[string](empowerMenuUrl[i], menuUrl) == false { + menuUrl = append(menuUrl, empowerMenuUrl[i]) + } + } + return +} + +// 获取公司最小主责部门 +func GetMinMainDutyDeparment(company string) (organization []modelshr.AdministrativeOrganization) { + var allOrg []modelshr.AdministrativeOrganization + err := overall.CONSTANT_DB_HR.Model(&modelshr.AdministrativeOrganization{}).Where("ispower = 1 AND state = 1 AND organization_type > 2 AND superior = ?", company).Find(&allOrg).Error + if err != nil || len(allOrg) < 1 { + return + } + for _, v := range allOrg { + sunOrgList, orgSunErr := GetSunOrgList(v.Id) + if orgSunErr == nil && len(sunOrgList) > 0 { + for _, sv := range sunOrgList { + organization = append(organization, sv) + } + } else { + organization = append(organization, v) + } + } + return +} + +// 获取下级行政组织是否有主行政部门 +func GetSunOrgList(orgId int64) (orgList []modelshr.AdministrativeOrganization, ovErr error) { + ovErr = overall.CONSTANT_DB_HR.Where("state = 1").Where("ispower = 1 AND superior = ?", orgId).Find(&orgList).Error + return +} + +// 递归无限极菜单树 +func GetMenuThree(jurisd int, parentId string, threeData []MenuContList) []PowerThree { + treeList := []PowerThree{} + for _, v := range threeData { + if v.ParentId == parentId { + child := GetMenuThree(jurisd, v.Id, threeData) + var node PowerThree + node.Id = v.Id + node.Name = v.Name + node.ParentId = v.ParentId + node.IsTrue = v.IsTrue + isTrue, menuOper := MenuOperation(jurisd, v.Id) + if isTrue == true { + node.MenuOperation = menuOper + // fmt.Printf("GetMenuThree-1111--%v--->%v\n", v.Id, menuOper) + } + node.Child = child + treeList = append(treeList, node) + } + } + return treeList +} + +// 获取菜单操作项目 +func MenuOperation(jurisd int, menuId string) (isTrue bool, operation []MenuContList) { + var operList []modelsschool.MenuOperation + isTrue = false + operErr := overall.CONSTANT_DB_Master.Where("`menu_id` = ?", menuId).Order("oper_id desc").Find(&operList).Error + if operErr != nil || len(operList) < 1 { + return + } + + isTrue = true + for i := 0; i < len(operList); i++ { + var menSmaiCont MenuContList + menSmaiCont.Id = strconv.FormatInt(operList[i].OperId, 10) + menSmaiCont.Name = operList[i].OperTitle + menSmaiCont.ParentId = strconv.FormatInt(operList[i].MenuId, 10) + operation = append(operation, menSmaiCont) + } + // fmt.Printf("ApiUrl---%v--->%v--->%v--->%v\n", menuId, isTrue, operErr, operList) + return +} + +/* +递归无限极菜单树 +*/ +func GetMenuThrees(jurisd int, parentId string, threeData []MenuContList) []PowerThree { + treeList := []PowerThree{} + for _, v := range threeData { + if v.ParentId == parentId { + child := GetMenuThrees(jurisd, v.Id, threeData) + var node PowerThree + node.Id = v.Id + node.Name = v.Name + node.ParentId = v.ParentId + node.Child = child + node.IsTrue = v.IsTrue + // fmt.Printf("GetMenuThree-22222--%v--->%v\n", v.Id, node) + treeList = append(treeList, node) + } + } + return treeList +} + +// 获取责任人 +func GetDepartmentLeader(userCont modelshr.PersonArchives) { + var orgContList []DepartmentIsPower + orgContList = GetAllFatherDeparment(userCont.AdminOrg, 1, orgContList) + //根据序号排序 + sort.Slice(orgContList, func(i, j int) bool { + return orgContList[i].Sort < orgContList[j].Sort + }) + jsonStr, _ := json.Marshal(orgContList) + fmt.Printf("orgList---------------->%v\n", string(jsonStr)) +} + +// 获取行政组织的所有上级实权部门 +func GetAllFatherDeparment(orgId int64, sort int, oldCont []DepartmentIsPower) (orgContList []DepartmentIsPower) { + var orgCont modelshr.AdministrativeOrganization + err := orgCont.GetCont(map[string]interface{}{"id": orgId}, "id", "name", "organization_type", "superior", "ispower") + if err != nil { + return + } + if orgCont.OrganizationType <= 2 { + orgContList = oldCont + // jsonStr, _ := json.Marshal(oldCont) + // fmt.Printf("oldCont---------------->%v\n", string(jsonStr)) + return + } else { + // jsonStr, _ := json.Marshal(oldCont) + // fmt.Printf("oldCont---------------->%v\n", string(jsonStr)) + + if orgCont.IsPower == 1 { + var orgListCont DepartmentIsPower + orgListCont.Id = strconv.FormatInt(orgCont.Id, 10) + orgListCont.Name = orgCont.Name + orgListCont.Superior = orgCont.Superior + orgListCont.OrganizationType = orgCont.OrganizationType + orgListCont.IsPower = orgCont.IsPower + orgListCont.Sort = sort + orgListCont.PowerPeople = GetDutyOrgAbourLeader(orgCont.Id) + oldCont = append(oldCont, orgListCont) + orgContList = oldCont + sort = sort + 1 + } + return GetAllFatherDeparment(orgCont.Superior, sort, oldCont) + } + + return orgContList +} + +/* +获取主权行政组织责任岗位及相关人员 +@ordId 行政组织ID +*/ +func GetDutyOrgAbourLeader(ordId int64) (postAboutPeople []DepartSoverePostMan) { + //获取负责人岗位 + var leaderPostList []modelshr.Position + err := overall.CONSTANT_DB_HR.Model(&modelshr.Position{}).Select("`id`,`name`").Where("`state` = 1 AND `person_in_charge` = 1 AND `administrative_organization` = ?", ordId).Find(&leaderPostList).Error + if err != nil || len(leaderPostList) < 1 { + return + } + var isIn []int64 + for _, v := range leaderPostList { + if IsInTrue[int64](v.Id, isIn) == false { //岗位 + var postAboutManCont DepartSoverePostMan + postAboutManCont.Id = strconv.FormatInt(v.Id, 10) + postAboutManCont.Name = v.Name + postAboutManCont.People = GetManInPostList(ordId, v.Id) + postAboutPeople = append(postAboutPeople, postAboutManCont) + } + } + return postAboutPeople +} + +/* +获取岗位中的人及其职务 +@ordId 行政组织ID +@postId 岗位ID +*/ +func GetManInPostList(ordId, postId int64) (peopleList []PeopleSoverePostMan) { + //获取相关行政组织岗位的人员列表 + var usList []modelshr.PersonArchives + err := overall.CONSTANT_DB_HR.Model(&modelshr.PersonArchives{}).Select("`id`,`number`,`name`,`job_id`").Where("`state` = 1 AND `admin_org` = ? AND `position` = ? AND `emp_type` IN ?", ordId, postId, overall.EmployeeStatusIng).Find(&usList).Error + if err != nil || len(usList) < 1 { + return + } + for _, v := range usList { + var peopleCont PeopleSoverePostMan + peopleCont.Id = strconv.FormatInt(v.Id, 10) + peopleCont.Number = v.Number + peopleCont.Name = v.Name + var duitesCont modelshr.Duties + duitesCont.GetCont(map[string]interface{}{"`id`": v.JobId}, "`id`", "`name`") + peopleCont.PostId = strconv.FormatInt(duitesCont.Id, 10) + peopleCont.PostName = duitesCont.Name + peopleList = append(peopleList, peopleCont) + } + return +} + +/* +获取上级审批 +@userKey 用户KEy +@ordId 行政组织ID +@postId 岗位ID +@sort 排序 +@contList 审批人列表 +*/ +func GetPositionList(userKey, ordId, postId int64, sort int, contList []PositionDigui) (listCont []PositionDigui) { + var positionCont modelshr.PostDutiesJob + err := positionCont.GetCont(map[string]interface{}{"`id`": postId}) + if err != nil { + return + } + jsonStr, _ := json.Marshal(positionCont) + fmt.Printf("positionCont---------------->%v\n", string(jsonStr)) + if positionCont.JobType < 2 { + listCont = contList + return + } else { + + if positionCont.PersonInCharge == 1 { + peopelAry := GetPeopleInPostList(userKey, positionCont.AdministrativeOrganization, positionCont.Id) + if len(peopelAry) > 0 { + var cont PositionDigui + cont.Id = strconv.FormatInt(positionCont.Id, 10) + cont.Name = positionCont.Name + cont.OrgId = strconv.FormatInt(positionCont.AdministrativeOrganization, 10) + cont.Superior = strconv.FormatInt(positionCont.Superior, 10) + cont.Sort = sort + cont.People = peopelAry + contList = append(contList, cont) + } + listCont = contList + return GetPositionList(userKey, positionCont.AdministrativeOrganization, positionCont.Superior, sort+1, contList) + } else { + return GetPositionList(userKey, positionCont.AdministrativeOrganization, positionCont.Superior, sort+1, contList) + } + } + + return +} + +/* +获取岗位下人员列表 +@userKey 用户KEy +@ordId 行政组织ID +@postId 岗位ID +*/ +func GetPeopleInPostList(userKey, ordId, postId int64) (peopleList []PostPeople) { + isTrue := false + //获取相关行政组织岗位的人员列表 + var usList []modelshr.PersonArchives + err := overall.CONSTANT_DB_HR.Model(&modelshr.PersonArchives{}).Select("`id`,`key`,`number`,`name`,`job_id`,`wechat`,`work_wechat`,`company`,`maindeparment`,`admin_org`,`job_id`").Where("`state` = 1 AND `admin_org` = ? AND `position` = ? AND `emp_type` IN ?", ordId, postId, overall.EmployeeStatusIng).Find(&usList).Error + if err != nil || len(usList) < 1 { + return + } + for _, v := range usList { + if v.Key == userKey { + isTrue = true + } + wechatStr := v.Wechat + if v.WorkWechat != "" { + wechatStr = v.WorkWechat + } + if wechatStr != "" { + var peopleCont PostPeople + peopleCont.Id = strconv.FormatInt(v.Id, 10) + peopleCont.Number = v.Number + peopleCont.Name = v.Name + + peopleCont.Company = strconv.FormatInt(v.Company, 10) + if v.Company != 0 { + var companyCont modelshr.AdministrativeOrganization + companyCont.GetCont(map[string]interface{}{"`id`": v.Company}, "`name`") + peopleCont.CompanyName = companyCont.Name + } + + if v.MainDeparment != 0 { + departmentId := GetGroupOrDepartPower(v.AdminOrg, 1) + peopleCont.Department = strconv.FormatInt(departmentId, 10) + var departCont modelshr.AdministrativeOrganization + departCont.GetCont(map[string]interface{}{"`id`": departmentId}, "`name`") + peopleCont.DepartmentName = departCont.Name + } + + peopleCont.OrgId = strconv.FormatInt(v.AdminOrg, 10) + if v.AdminOrg != 0 { + var orgCont modelshr.AdministrativeOrganization + orgCont.GetCont(map[string]interface{}{"`id`": v.AdminOrg}, "`name`") + peopleCont.OrgName = orgCont.Name + } + + var duitesCont modelshr.Duties + duitesCont.GetCont(map[string]interface{}{"`id`": v.JobId}, "`id`", "`name`") + peopleCont.DutiesId = strconv.FormatInt(duitesCont.Id, 10) + peopleCont.DutiesName = duitesCont.Name + peopleCont.Wechat = wechatStr + peopleList = append(peopleList, peopleCont) + } + + } + fmt.Printf("%v\n", isTrue) + // if isTrue == true { + // var emptyAry []PostPeople + // peopleList = emptyAry + // } + return +} + +/* +* +@ 作者: 秦东 +@ 时间: 2022-11-19 15:01:33 +@ 功能: 获取岗位权限信息 +@ 参数 + + #orgId 行政组织 + #postId 岗位 + #systemName 系统 + +@ 返回值 + + # + +@ 方法原型 + + # +*/ +func GetPostOfUsEmpowerCont(orgId, postId int64, systemName string) (sysPowerCont SystemPowerInfo, err error) { + + redisFileKey := fmt.Sprintf("Licence:LoginApi_%v_%v_%v", systemName, orgId, postId) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS3) + userRedisToken, isTrue := redisClient.HashGetAll(redisFileKey) + if isTrue == false { + var systemPowerCont modelssystempermission.Empower + err = systemPowerCont.GetCont(map[string]interface{}{"`ordid`": orgId, "`post_id`": postId, "`system`": systemName}) + if err != nil { + return + } + sysPowerCont.Id = systemPowerCont.Id + sysPowerCont.OrdId = systemPowerCont.OrdId //行政组织"` + sysPowerCont.PostId = systemPowerCont.PostId //岗位ID"` + sysPowerCont.System = systemPowerCont.System //系统"` + sysPowerCont.PointId = systemPowerCont.PointId //权限点位"` + sysPowerCont.State = systemPowerCont.State //状态(1:启用;2:禁用;3:删除)"` + sysPowerCont.Time = systemPowerCont.Time //创建时间"` + sysPowerCont.Level = systemPowerCont.Level //授权范围等级(1:本部门;2:本分部;3:所有)"` + sysPowerCont.Organization = systemPowerCont.Organization //行政组织"` + sysPowerCont.PointIdList = strings.Split(systemPowerCont.PointId, ",") + sysPowerCont.OrganizationList = strings.Split(systemPowerCont.Organization, ",") + + myContRedis := MapOut[string]() + myContRedis["id"] = systemPowerCont.Id + myContRedis["ordid"] = systemPowerCont.OrdId + myContRedis["postid"] = systemPowerCont.PostId + myContRedis["system"] = systemPowerCont.System + myContRedis["pointid"] = systemPowerCont.PointId + myContRedis["state"] = systemPowerCont.State + myContRedis["time"] = systemPowerCont.Time + myContRedis["level"] = systemPowerCont.Level + myContRedis["organization"] = systemPowerCont.Organization + + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, myContRedis) + } else { + idInt, _ := strconv.ParseInt(userRedisToken["id"], 10, 64) + sysPowerCont.Id = idInt + orgIdInt, _ := strconv.ParseInt(userRedisToken["ordid"], 10, 64) + sysPowerCont.OrdId = orgIdInt //行政组织"` + postIdInt, _ := strconv.ParseInt(userRedisToken["postid"], 10, 64) + sysPowerCont.PostId = postIdInt //岗位ID"` + sysPowerCont.System = userRedisToken["system"] //系统"` + sysPowerCont.PointId = userRedisToken["pointid"] //权限点位"` + stateInt, _ := strconv.Atoi(userRedisToken["state"]) + sysPowerCont.State = stateInt //状态(1:启用;2:禁用;3:删除)"` + timeInt, _ := strconv.ParseInt(userRedisToken["time"], 10, 64) + sysPowerCont.Time = timeInt //创建时间"` + levelInt, _ := strconv.Atoi(userRedisToken["level"]) + sysPowerCont.Level = levelInt //授权范围等级(1:本部门;2:本分部;3:所有)"` + sysPowerCont.Organization = userRedisToken["organization"] //行政组织"` + sysPowerCont.PointIdList = strings.Split(userRedisToken["pointid"], ",") + sysPowerCont.OrganizationList = strings.Split(userRedisToken["organization"], ",") + writeRedisData := MapOut[string]() + for i, v := range userRedisToken { + writeRedisData[i] = v + } + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, writeRedisData) + } + return +} + +/* +* +@ 作者: 秦东 +@ 时间: 2022-11-19 15:03:42 +@ 功能: 获取系统授权 +@ 参数 + + #roleId 角色ID + #systemName 系统名称 + #userKey 人员识别码 + #orgId 行政组织 + #postId 岗位 + +@ 返回值 + + #roleName 角色名称 + #pointId 菜单权限 + #operation 操作权限 + #level 操作等级 + +@ 方法原型 + + #func GetNewAccredit(systemName, roleId string, userKey, orgId, postId int64) (roleName, pointId, operation string, level int) +*/ +func GetNewAccredit(systemName, roleId string, userKey, orgId, postId int64) (roleName, pointId, operation string, level int) { + fmt.Printf("jsonStr---1--->%v---->%v---->%v---->%v---->%v\n", systemName, roleId, userKey, orgId, postId) + redisFileKey := fmt.Sprintf("Licence:PowerLoginApi_%v_%v_%v_%v", systemName, userKey, orgId, postId) + redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS3) + userRedisToken, isTrue := redisClient.HashGetAll(redisFileKey) + fmt.Printf("jsonStr---2--->%v---->%v---->%v---->%v---->%v---->%v\n", systemName, roleId, userKey, orgId, postId, userRedisToken) + if isTrue == false { + + var pointIdAry []string + var operationAry []string + if roleId != "" { + roleIdAry := strings.Split(roleId, ",") + var roleCont []modelssystempermission.SystemRole + if len(roleIdAry) > 0 { + //获取角色名称 + err := overall.CONSTANT_DB_System_Permission.Model(&modelssystempermission.SystemRole{}).Select("`name`").Where("`id` IN ?", roleIdAry).Find(&roleCont).Error + if err == nil && len(roleCont) > 0 { + var roleNameAry []string + for _, rnv := range roleCont { + if IsInTrue[string](rnv.Name, roleNameAry) == false { + roleNameAry = append(roleNameAry, rnv.Name) + } + } + roleName = strings.Join(roleNameAry, "|") + } + //获取配置的所有角色权限 + var roleEmpowerCont []modelssystempermission.RoleEmpower + err = overall.CONSTANT_DB_System_Permission.Model(&modelssystempermission.RoleEmpower{}).Select("`point_id`,`operation`,`level`").Where("`system` = ? AND `role_id` IN ?", systemName, roleIdAry).Find(&roleEmpowerCont).Error + if err == nil && len(roleEmpowerCont) > 0 { + for _, rev := range roleEmpowerCont { + menuList := strings.Split(rev.PointId, ",") + for _, mv := range menuList { //菜单权限 + if mv != "" && IsInTrue[string](mv, pointIdAry) == false { + pointIdAry = append(pointIdAry, mv) + } + } + operList := strings.Split(rev.Operation, ",") + for _, ov := range operList { //操作权限 + if ov != "" && IsInTrue[string](ov, operationAry) == false { + operationAry = append(operationAry, ov) + } + } + if level < rev.Level { + level = rev.Level //等级 + } + } + } + } + + } + + //获取行政组织授权 + if orgId > 0 && postId > 0 { + var orgEmpowerCont modelssystempermission.Empower + orgEmpowerCont.GetCont(map[string]interface{}{"`ordid`": orgId, "`post_id`": postId, "`system`": systemName}, "`point_id`", "`operation`", "`level`") + if len(pointIdAry) < 1 { //判断是否已经配过权限 + pointIdAry = strings.Split(orgEmpowerCont.PointId, ",") + } else { + guoduPoin := strings.Split(orgEmpowerCont.PointId, ",") + for _, pv := range guoduPoin { //合并权限 + if pv != "" && IsInTrue[string](pv, pointIdAry) == false { + pointIdAry = append(pointIdAry, pv) + } + } + + } + if len(operationAry) < 1 { //判断是否已经配过权限 + operationAry = strings.Split(orgEmpowerCont.Operation, ",") + } else { + guoduOper := strings.Split(orgEmpowerCont.Operation, ",") + for _, gpv := range guoduOper { //合并权限 + if gpv != "" && IsInTrue[string](gpv, operationAry) == false { + operationAry = append(operationAry, gpv) + } + } + + } + if level < orgEmpowerCont.Level { + level = orgEmpowerCont.Level + } + } + pointId = strings.Join(pointIdAry, ",") + operation = strings.Join(operationAry, ",") + + var powerCont EmpowerCont + powerCont.RoleName = roleName + powerCont.PointId = pointId + powerCont.Operation = operation + powerCont.Level = level + //组转写入redis + myContRedis := MapOut[string]() + myContRedis["roleName"] = roleName + myContRedis["pointid"] = pointId + myContRedis["operation"] = operation + myContRedis["level"] = level + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, myContRedis) + + } else { + roleName = userRedisToken["roleName"] + pointId = userRedisToken["pointid"] + operation = userRedisToken["operation"] + level, _ = strconv.Atoi(userRedisToken["level"]) + //组转写入redis + writeRedisData := MapOut[string]() + for i, v := range userRedisToken { + writeRedisData[i] = v + } + redisClient.SetRedisTime(10800) + redisClient.HashMsetAdd(redisFileKey, writeRedisData) + } + return +} + +// 步骤名称 +func GetSetpName(setId int) (setpName string) { + switch setId { + case 1: + setpName = "创建申请" + case 2: + setpName = "审核" + case 3: + setpName = "责任划分" + case 4: + setpName = "整改措施" + case 5: + setpName = "整改验收" + case 6: + setpName = "抄送" + case 7: + // setpName = "部门负责人" + setpName = "审核确认" + default: + setpName = "创建申请" + } + return +} + +// 步骤名称/节点类型 0:发起人;1:审批;2:抄送;3:执行节点;4:路由;5:条件; +func GetSetpNodeName(setId int) (setpName string) { + switch setId { + case 1: + setpName = "审核" + case 2: + setpName = "抄送" + case 3: + setpName = "执行" + case 4: + setpName = "路由" + case 5: + setpName = "条件条件" + default: + setpName = "发起申请" + } + return +} + +/* +* +@ 作者: 秦东 +@ 时间: 2022-10-01 10:44:41 +@ 功能: 获取企业微信审批组相关负责人 +@ 参数 + + #wechatTeamId 审批数据库节点ID + #departmentId 部门ID + +@ 返回值 + + #userStrList 微信Openid + #err cuo +*/ +func GetRefereeTeamWorkWechat(wechatTeamId, departmentId int64) (userStrList []string, err error) { + var orgCont modelshr.AdministrativeOrganization + err = orgCont.GetCont(map[string]interface{}{"`id`": departmentId}, "`wechat_organization_id`") + // fmt.Printf("orgCont------------>%v\n", err) + if err != nil { + return + } + //获取角色组数据 + var roleCont modelsschool.RoleGroup + err = roleCont.GetCont(map[string]interface{}{"`srg_id`": wechatTeamId}, "`srg_extatry`", "`srg_type`") + // fmt.Printf("orgCont:%v------------>roleCont:%v\n", err, roleCont) + if err != nil { + return + } + var roleUser []roleGroupBodyAry + if roleCont.Type == 1 { + //矩阵 + roleList := MapOut[string]() + err = json.Unmarshal([]byte(roleCont.Contentes), &roleList) + + if err != nil { + return + } + departmentIdStr := strconv.FormatInt(orgCont.WechatOrganizationId, 10) + // fmt.Printf("roleList------矩阵------>%v------>%v\n", roleList, departmentIdStr) + for i, v := range roleList { + if i == departmentIdStr { + jsonMAp, _ := json.Marshal(v) + json.Unmarshal(jsonMAp, &roleUser) + } + + } + + } else { + //个人 + err = json.Unmarshal([]byte(roleCont.Contentes), &roleUser) + } + if len(roleUser) < 1 { + err = fmt.Errorf("没有数据!") + } + // fmt.Printf("roleUser------------>%v\n", roleUser) + for _, v := range roleUser { + if IsInTrue[string](v.Id, userStrList) == false { + userStrList = append(userStrList, v.Id) + } + } + return +} + +// 获取指定月的起止时间 +func GetAppointMonthStarAndEndTime(dayTime string) (startTime, endTime int64) { + dataTypeAll := "2006-01-02" + dayTime = fmt.Sprintf("%v-%v", dayTime, "01") + firstToTime := StringToTimeIng("d", dayTime) + startTimeStr := fmt.Sprintf("%v 00:00:00", firstToTime.AddDate(0, 0, 0).Format(dataTypeAll)) + endTimeStr := fmt.Sprintf("%v 23:59:59", firstToTime.AddDate(0, 1, -1).Format(dataTypeAll)) + // startTime = dayTime + startTime = DateToTimeStampOld(startTimeStr) + endTime = DateToTimeStampOld(endTimeStr) + return +} + +// 获取指定月的起止时间副本 +func GetAppointMonthStarAndEndTimeEs(dayTime string) (startTime, endTime int64) { + dataTypeAll := "2006-01-02" + firstToTime := StringToTimeIng("d", dayTime) + startTimeStr := fmt.Sprintf("%v 00:00:00", firstToTime.AddDate(0, 0, 0).Format(dataTypeAll)) + endTimeStr := fmt.Sprintf("%v 23:59:59", firstToTime.AddDate(0, 1, -1).Format(dataTypeAll)) + // startTime = dayTime + startTime, _ = DateToTimeStamp(startTimeStr) + endTime, _ = DateToTimeStamp(endTimeStr) + return +} + +// 日期字符串转换成time格式 +func StringToTimeIng(unit, str string) (res time.Time) { + loc, _ := time.LoadLocation("Local") + // str := t.ToString() + layout, ok := timeLayoutMap[unit] + if !ok { + layout = timeLayoutMap["s"] + } + res, _ = time.ParseInLocation(layout, str, loc) + return +} + +// 递归无限极菜单树 +/* +@jurisd 起始位置 +@parentId 上级ID +@threeData 结果值 +@oper 已付权限 +*/ +func GetMenuThreePeiQuan(jurisd int, parentId string, threeData []MenuContList, oper []string) []PowerThree { + treeList := []PowerThree{} + for _, v := range threeData { + if v.ParentId == parentId { + child := GetMenuThreePeiQuan(jurisd, v.Id, threeData, oper) + var node PowerThree + node.Id = v.Id + node.Name = v.Name + node.ParentId = v.ParentId + node.IsTrue = v.IsTrue + isTrue, menuOper := MenuOperationPeiQuan(jurisd, v.Id, oper) + if isTrue == true { + node.MenuOperation = menuOper + // fmt.Printf("GetMenuThree-1111--%v--->%v\n", v.Id, menuOper) + } + node.Child = child + treeList = append(treeList, node) + } + } + return treeList +} + +// 配权 +// 获取菜单操作项目 +/* +@jurisd 起始位置 +@menuId 菜单ID +@oper 已付权限 +*/ +func MenuOperationPeiQuan(jurisd int, menuId string, oper []string) (isTrue bool, operation []MenuContList) { + var operList []modelsschool.MenuOperation + isTrue = false + operErr := overall.CONSTANT_DB_Master.Where("`menu_id` = ?", menuId).Order("oper_id desc").Find(&operList).Error + if operErr != nil || len(operList) < 1 { + return + } + + isTrue = true + for i := 0; i < len(operList); i++ { + var menSmaiCont MenuContList + idStr := strconv.FormatInt(operList[i].OperId, 10) + menSmaiCont.Id = idStr + menSmaiCont.Name = operList[i].OperTitle + menSmaiCont.ParentId = strconv.FormatInt(operList[i].MenuId, 10) + if IsInTrue[string](idStr, oper) == true { + menSmaiCont.IsTrue = true + } + operation = append(operation, menSmaiCont) + } + // fmt.Printf("ApiUrl---%v--->%v--->%v--->%v\n", menuId, isTrue, operErr, operList) + return +} + +/* +* +@ 作者: 秦东 +@ 时间: 2023-01-03 16:41:19 +@ 功能: 合并数组 +@ 参数 + + # + +@ 返回值 + + # + +@ 方法原型 + + # +*/ +func MergeStruct[T GenericityVariable](aryOen, aryTwo []T) (structAry []T) { + if len(aryOen) >= len(aryTwo) { + structAry = aryOen + for i := 0; i < len(aryTwo); i++ { + if IsInTrue[T](aryTwo[i], structAry) == false { + structAry = append(structAry, aryTwo[i]) + } + } + } else { + structAry = aryTwo + for i := 0; i < len(aryOen); i++ { + if IsInTrue[T](aryOen[i], structAry) == false { + structAry = append(structAry, aryOen[i]) + } + } + } + return +} + +// 根据字符串组合时间 +/* +#dateTime 日期 +*/ +func (d *DateTimeTotimes) BaisStrToTime(dateTime string) { + timeStrAry := strings.Split(dateTime, "-") + switch len(timeStrAry) { + case 1: + dateTime = fmt.Sprintf("%v-01-01 12:00:00", dateTime) + case 2: + if len(timeStrAry[1]) < 2 { + dateTime = fmt.Sprintf("%v-0%v-01 12:00:00", timeStrAry[0], timeStrAry[1]) + } + case 3: + monthStr := timeStrAry[1] + if len(timeStrAry[1]) < 2 { + monthStr = fmt.Sprintf("0%v", timeStrAry[1]) + } + dayAry := strings.Split(timeStrAry[2], " ") + // fmt.Printf("dayAry:%v------>%v\n", dayAry, len(dayAry)) + dayStr := dayAry[0] + if len(dayAry[0]) < 2 { + dayStr = fmt.Sprintf("0%v", dayAry[0]) + } + if len(dayAry) > 1 { + // fmt.Printf("dayAry[1]:%v------>%v\n", dayAry[1], len(dayAry[1])) + if len(dayAry[1]) > 0 { + Hours := "00" + minutes := "00" + seconds := "00" + hisAry := strings.Split(dayAry[1], ":") + switch len(hisAry) { + case 1: + if len(hisAry[0]) < 2 { + Hours = fmt.Sprintf("0%v", hisAry[0]) + } else { + Hours = hisAry[0] + } + case 2: + if len(hisAry[0]) < 2 { + Hours = fmt.Sprintf("0%v", hisAry[0]) + } else { + Hours = hisAry[0] + } + if len(hisAry[1]) < 2 { + minutes = fmt.Sprintf("0%v", hisAry[1]) + } else { + minutes = hisAry[1] + } + case 3: + if len(hisAry[0]) < 2 { + Hours = fmt.Sprintf("0%v", hisAry[0]) + } else { + Hours = hisAry[0] + } + if len(hisAry[1]) < 2 { + minutes = fmt.Sprintf("0%v", hisAry[1]) + } else { + minutes = hisAry[1] + } + if len(hisAry[2]) < 2 { + seconds = fmt.Sprintf("0%v", hisAry[2]) + } else { + seconds = hisAry[2] + } + default: + } + dayStr = fmt.Sprintf("%v %v:%v:%v", dayStr, Hours, minutes, seconds) + } + } + // dayStr := timeStrAry[2] + // if len(timeStrAry[2]) < 2 { + // dayStr = fmt.Sprintf("0%v", timeStrAry[2]) + // } + dateTime = fmt.Sprintf("%v-%v-%v", timeStrAry[0], monthStr, dayStr) + + default: + } + fmt.Printf("dateTime:%v---1--->%v\n", dateTime, len(dateTime)) + orgTime, orgTimeErr := DateToTimeStamp(fmt.Sprintf("%v-01-01 12:00:00", dateTime)) + if orgTimeErr { + d.AllTime = orgTime + d.Years = strconv.FormatInt(ComputingTime(orgTime, 1), 10) + d.Quarter = strconv.FormatInt(ComputingTime(orgTime, 2), 10) + d.Months = strconv.FormatInt(ComputingTime(orgTime, 3), 10) + d.Week = strconv.FormatInt(ComputingTime(orgTime, 4), 10) + d.Days = strconv.FormatInt(ComputingTime(orgTime, 5), 10) + d.Hours = strconv.FormatInt(ComputingTime(orgTime, 7), 10) + d.Minutes = strconv.FormatInt(ComputingTime(orgTime, 8), 10) + d.Second = strconv.FormatInt(ComputingTime(orgTime, 9), 10) + } else { + + orgTime, orgTimeErr = DateToTimeStamp(fmt.Sprintf("%v-01 12:00:00", dateTime)) + if orgTimeErr { + d.AllTime = orgTime + d.Years = strconv.FormatInt(ComputingTime(orgTime, 1), 10) + d.Quarter = strconv.FormatInt(ComputingTime(orgTime, 2), 10) + d.Months = strconv.FormatInt(ComputingTime(orgTime, 3), 10) + d.Week = strconv.FormatInt(ComputingTime(orgTime, 4), 10) + d.Days = strconv.FormatInt(ComputingTime(orgTime, 5), 10) + d.Hours = strconv.FormatInt(ComputingTime(orgTime, 7), 10) + d.Minutes = strconv.FormatInt(ComputingTime(orgTime, 8), 10) + d.Second = strconv.FormatInt(ComputingTime(orgTime, 9), 10) + + fmt.Printf("dateTime:%v---2--->%v--->%v\n", orgTime, d.AllTime, d.Quarter) + } else { + orgTime, orgTimeErr = DateToTimeStamp(fmt.Sprintf("%v 12:00:00", dateTime)) + if orgTimeErr { + d.AllTime = orgTime + d.Years = strconv.FormatInt(ComputingTime(orgTime, 1), 10) + d.Quarter = strconv.FormatInt(ComputingTime(orgTime, 2), 10) + d.Months = strconv.FormatInt(ComputingTime(orgTime, 3), 10) + d.Week = strconv.FormatInt(ComputingTime(orgTime, 4), 10) + d.Days = strconv.FormatInt(ComputingTime(orgTime, 5), 10) + d.Hours = strconv.FormatInt(ComputingTime(orgTime, 7), 10) + d.Minutes = strconv.FormatInt(ComputingTime(orgTime, 8), 10) + d.Second = strconv.FormatInt(ComputingTime(orgTime, 9), 10) + } else { + orgTime, orgTimeErr = DateToTimeStamp(fmt.Sprintf("%v:00:00", dateTime)) + if orgTimeErr { + d.AllTime = orgTime + d.Years = strconv.FormatInt(ComputingTime(orgTime, 1), 10) + d.Quarter = strconv.FormatInt(ComputingTime(orgTime, 2), 10) + d.Months = strconv.FormatInt(ComputingTime(orgTime, 3), 10) + d.Week = strconv.FormatInt(ComputingTime(orgTime, 4), 10) + d.Days = strconv.FormatInt(ComputingTime(orgTime, 5), 10) + d.Hours = strconv.FormatInt(ComputingTime(orgTime, 7), 10) + d.Minutes = strconv.FormatInt(ComputingTime(orgTime, 8), 10) + d.Second = strconv.FormatInt(ComputingTime(orgTime, 9), 10) + } else { + orgTime, orgTimeErr = DateToTimeStamp(fmt.Sprintf("%v:00", dateTime)) + if orgTimeErr { + d.AllTime = orgTime + d.Years = strconv.FormatInt(ComputingTime(orgTime, 1), 10) + d.Quarter = strconv.FormatInt(ComputingTime(orgTime, 2), 10) + d.Months = strconv.FormatInt(ComputingTime(orgTime, 3), 10) + d.Week = strconv.FormatInt(ComputingTime(orgTime, 4), 10) + d.Days = strconv.FormatInt(ComputingTime(orgTime, 5), 10) + d.Hours = strconv.FormatInt(ComputingTime(orgTime, 7), 10) + d.Minutes = strconv.FormatInt(ComputingTime(orgTime, 8), 10) + d.Second = strconv.FormatInt(ComputingTime(orgTime, 9), 10) + } else { + orgTime, orgTimeErr = DateToTimeStamp(dateTime) + if orgTimeErr { + d.AllTime = orgTime + d.Years = strconv.FormatInt(ComputingTime(orgTime, 1), 10) + d.Quarter = strconv.FormatInt(ComputingTime(orgTime, 2), 10) + d.Months = strconv.FormatInt(ComputingTime(orgTime, 3), 10) + d.Week = strconv.FormatInt(ComputingTime(orgTime, 4), 10) + d.Days = strconv.FormatInt(ComputingTime(orgTime, 5), 10) + d.Hours = strconv.FormatInt(ComputingTime(orgTime, 7), 10) + d.Minutes = strconv.FormatInt(ComputingTime(orgTime, 8), 10) + d.Second = strconv.FormatInt(ComputingTime(orgTime, 9), 10) + } + } + } + } + } + } +} + +//统一图标计算最大值最小值方法 +/* +maxVal 最大值 +minVal 最小值 +*/ +func JudjeMaxOfMinVal(maxVal, minVal float64) (maxVals, minVals float64) { + if maxVal > 0 { + if minVal > 0 { + if maxVal < 10 { + if maxVal < 1 { + maxVal = math.Ceil(maxVal) + 0.1 + minVals = math.Ceil(minVal) - 0.1 + } else { + maxVal = math.Ceil(maxVal) + 1 + minVals = math.Ceil(minVal) - 1 + } + } else { + jianGe := math.Ceil((maxVal - minVal) / 5) + if jianGe <= 0 { + jianGe = 1 + } + maxVals = math.Ceil(maxVal) + jianGe + minVals = math.Ceil(minVal) - jianGe + if minVals < 0 { + minVals = 0 + } + } + } else { + jianGe := math.Ceil(maxVal / 5) + maxVals = math.Ceil(maxVal) + jianGe + } + } else { + if minVal > -1 { + minVals = minVal - 0.1 + } else { + maxGuoDu := maxVal * -1 + minGuoDu := minVal * -1 + jianGe := math.Ceil((minGuoDu - maxGuoDu) / 5) + if jianGe > 0 { + minVals = minVal - jianGe + } else { + minVals = minVal - 1 + } + } + + } + // fmt.Printf("ge---1-->%v----->%v\n", maxVals, minVals) + return +} + +// 获取行政组织所有上级 +func (g *GetOrgAllParent) GetOrgParentAllId(orgId int64) { + var orgCont modelshr.AdministrativeOrganization + err := orgCont.GetCont(map[string]interface{}{"`id`": orgId, "`state`": 1}, "`superior`") + if err == nil { + if IsInTrue[int64](orgId, g.Id) == false { + g.Id = append(g.Id, orgId) + } + g.GetOrgParentAllId(orgCont.Superior) + } else { + return + } +} + +// 获取所有下级 +func (g *GetOrgAllParent) GetOrgSonAllId(orgId int64) { + var orgAry []int64 + if orgId != 0 { + err := overall.CONSTANT_DB_HR.Model(&modelshr.AdministrativeOrganization{}).Select("`id`").Where("`state` = 1 AND `superior` = ?", orgId).Find(&orgAry).Error + if err != nil { + return + } + for _, v := range orgAry { + if !IsInTrue[int64](v, g.Id) { + g.Id = append(g.Id, v) + g.GetOrgSonAllId(v) + } else { + g.GetOrgSonAllId(v) + } + } + } + +} + +// 获取行政组织所有上级和下级 +func HaveAllOrgRelation(orgId int64) []int64 { + // departmentId := RecursionOrgLeve(orgId, 4) + // fmt.Printf("获取行政组--->%v--->%v\n", departmentId, orgId) + var getAllOrg GetOrgAllParent + // getAllOrg.GetOrgParentAllId(departmentId) + // getAllOrg.GetOrgSonAllId(departmentId) + getAllOrg.Id = append(getAllOrg.Id, orgId) + getAllOrg.GetOrgParent(orgId, 4) + // fmt.Printf("获取行政组--2222->%v--->%v\n", getAllOrg.Id, orgId) + return getAllOrg.Id +} + +// 获取上下级 +func (g *GetOrgAllParent) GetOrgParent(orgId, level int64) { + if orgId != 0 { + var orgCont modelshr.OrgContType + err := orgCont.GetCont(map[string]interface{}{"`id`": orgId, "`state`": 1}, "`superior`", "level") + if err == nil { + + // fmt.Printf("获取行政组--2222->%v--->%v\n", orgCont.Level, level) + if orgCont.Level >= level { + g.GetOrgSonAllId(orgId) + g.GetOrgParent(orgCont.Superior, level) + } + } + } +} + +//计算得分 +/* +参数 +@targetScore 指标分值 +@resultval 结算值 +@allPrizes 全奖值 +@zeroPrizes 零奖值 +@CappingVals 封顶值 +@typeClass 1:定性;2:定量;3:观察指标 + +返回说明 +@scoreVal 计算得分 +@allPrize 全奖值 +@zeroPrize 零奖值 +@CappingVal 封顶值 +@achievement 达成率 +func CalculateScore(targetScore int64, resultval, allPrizes, zeroPrizes, CappingVals float64, typeClass int) (scoreVal, allPrize, zeroPrize, CappingVal, achievement float64) +*/ +func CalculateScore(targetScore int64, resultval, allPrizes, zeroPrizes, CappingVals float64, typeClass int) (scoreVal, allPrize, zeroPrize, CappingVal, achievement float64) { + allPrize = allPrizes / 100 + zeroPrize = zeroPrizes / 100 + CappingVal = CappingVals / 100 + resultval = resultval / 100 + + //fmt.Printf("达成率--1-->targetScore:%v-->resultval:%v-->allPrize:%v-->zeroPrize:%v-->CappingVal:%v\n", targetScore, resultval, allPrize, zeroPrize, CappingVal) + + //不修正精度的达成率 + var achievementAll float64 = 0 + + if allPrize == 0 && zeroPrize == 0 { //全奖值与零奖值都为0 那么达成率 100 和实际得分是 指标分 + achievement = 100 + scoreVal = float64(targetScore) + if typeClass == 2 { + if resultval <= 0 { + scoreVal = 0 + } + } + achievementAll = 100 + //fmt.Printf("达成率--11-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } else { + if allPrize > zeroPrize { //如果全奖值大于零奖值 执行一下操作 + if resultval <= zeroPrize { //实际结算值小于零奖值 那么达成率和实际得分都是0 + achievement = 0 + scoreVal = 0 + achievementAll = 0 + // } else if resultval > allPrize { //实际结算值大于全奖值 执行一下操作 + //fmt.Printf("达成率--7-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } else { //实际结算值在全奖值 与 零奖值之间 + chuShu := resultval - float64(zeroPrize) + beiChuShu := float64(allPrize) - float64(zeroPrize) + if beiChuShu != 0 { + achievement = DecimalEs(chuShu/beiChuShu, 4) + achievementAll = chuShu / beiChuShu + if achievement <= 0 { + //如果在全奖值大于零件值的情况下出现达成率为0或负数,则达成率和实际得分都是0 + achievement = 0 + scoreVal = 0 + achievementAll = 0 + //fmt.Printf("达成率--8-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } else { + //fmt.Printf("达成率--9-1->targetScore:%v-->resultval:%v-->scoreVal:%v-->allPrize:%v-->zeroPrize:%v-->CappingVal:%v-->achievement:%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + if achievement*100 >= CappingVal { + //如果达成率大于等于封顶值 + if CappingVal > 0 { + scoreVal = (CappingVal / 100) * float64(targetScore) + //fmt.Printf("达成率--9-2->targetScore:%v-->resultval:%v-->scoreVal:%v-->allPrize:%v-->zeroPrize:%v-->CappingVal:%v-->achievement:%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } else { + //fmt.Printf("达成率--9-3->targetScore:%v-->resultval:%v-->scoreVal:%v-->allPrize:%v-->zeroPrize:%v-->CappingVal:%v-->achievement:%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + scoreVal = float64(targetScore) + } + + } else { + // scoreVal = achievement * (float64(targetScore)) + scoreVal = achievementAll * (float64(targetScore)) + //fmt.Printf("达成率--9-4->targetScore:%v-->resultval:%v-->scoreVal:%v-->allPrize:%v-->zeroPrize:%v-->CappingVal:%v-->achievement:%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + + } + //fmt.Printf("达成率--9-->targetScore:%v-->resultval:%v-->scoreVal:%v-->allPrize:%v-->zeroPrize:%v-->CappingVal:%v-->achievement:%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } + achievement = DecimalEs(achievement*100, 4) + } else { + //被除数为0时 那么达成率和实际得分都是0 + achievement = 0 + scoreVal = 0 + achievementAll = 0 + //fmt.Printf("达成率--10-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } + + } + } else { //如果全奖值小于零奖值 执行一下操作 + if resultval >= zeroPrize { //实际结算值大于零奖值 那么达成率和实际得分都是0 + achievement = 0 + scoreVal = 0 + achievementAll = 0 + //fmt.Printf("达成率--1-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } else { + chuShu := resultval - float64(zeroPrize) + beiChuShu := float64(allPrize) - float64(zeroPrize) + if beiChuShu != 0 { + achievement = DecimalEs(chuShu/beiChuShu, 4) + achievementAll = chuShu / beiChuShu + if achievement <= 0 { + //如果在全奖值大于零件值的情况下出现达成率为0或负数,则达成率和实际得分都是0 + achievement = 0 + scoreVal = 0 + achievementAll = 0 + //fmt.Printf("达成率--2-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } else { + if achievement*100 >= CappingVal { + //如果达成率大于等于封顶值 + scoreVal = CappingVal * float64(targetScore) / 100 + //fmt.Printf("达成率--3-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } else { + // scoreVal = achievement * (float64(targetScore)) + scoreVal = achievementAll * (float64(targetScore)) + //fmt.Printf("达成率--4-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } + } + achievement = DecimalEs(achievement*100, 4) + //fmt.Printf("达成率--6-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } else { + //被除数为0时 那么达成率和实际得分都是0 + achievement = 0 + scoreVal = 0 + achievementAll = 0 + //fmt.Printf("达成率--5-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } + } + } + } + if typeClass == 3 { + scoreVal = float64(targetScore) + //fmt.Printf("达成率--11-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + } + scoreVal = DecimalEs(scoreVal, 2) + allPrize = DecimalEs(allPrize, 2) + zeroPrize = DecimalEs(zeroPrize, 2) + CappingVal = DecimalEs(CappingVal, 2) + achievement = DecimalEs(achievement, 4) + //fmt.Printf("达成率--12-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) + return +} + +// 字符串数子转int64 +func StrNumberToInt64(val string, cheng float64) (valInt int64) { + valFloat, _ := strconv.ParseFloat(val, 64) + valFloatGd := DecimalEs(valFloat*cheng, 2) + valStr := strconv.FormatFloat(valFloatGd, 'f', -1, 64) + valInt, _ = strconv.ParseInt(valStr, 10, 64) + return +} diff --git a/overall/publicmethod/type.go b/overall/publicmethod/type.go new file mode 100644 index 0000000..cd61f85 --- /dev/null +++ b/overall/publicmethod/type.go @@ -0,0 +1,293 @@ +package publicmethod + +import ( + "appPlatform/models/modelshr" + "appPlatform/models/modelssystempermission" +) + +// 泛型基础变量类型 +type GenericityVariable interface { + int | int8 | int16 | int32 | int64 | float32 | float64 | string +} + +// 数值泛型基础变量类型 +type GenericityVariableNumber interface { + int | int8 | int16 | int32 | int64 | float32 | float64 +} + +// 格式化输出 +type Reply struct { + Code int `json:"code"` + Msg string `json:"msg"` + Data interface{} `json:"data"` +} + +// 翻页信息 +type PagesTurn struct { + Page int `json:"page"` + PageSize int `json:"pagesize"` +} + +// 通用ID结构体 +type PublicId struct { + Id string `json:"id"` +} + +// 通用name结构体 +type PublicName struct { + Name string `json:"name"` +} + +// 通用排序结构体 +type PublicSort struct { + Sort int `json:"sort"` +} + +// 通用编辑状态结构体 +type PublicState struct { + PublicId + State int `json:"state"` + IsTrue int `json:"istrue"` //1:强制删除;非1:软删除 +} + +// 通用图片结构体列表 +type PubilcImageList struct { + Id string `json:"id"` + Url string `json:"url"` //图片地址 + Name string `json:"name"` //文档名称 + FileSize string `json:"filesize"` //文档大小 +} + +// 通用图片结构体内容 +type PubilcImageCont struct { + PubilcImageList + Imgpath string `json:"imgpath"` //物理地址 + AscriptionId string `json:"ascriptionid"` //归属 +} + +// 附件格式 +type EnclosureFormat struct { + FileName string `json:"filename"` //附件名称 + FilePath string `json:"filepath"` //附件地址 + FileType int `json:"filetype"` //附件类型 1:图片;2:视频;3:表格;4:word;5:pdf;7:其他文件 +} + +// 授权输出 +type empowerOut struct { + MenuIdAry []string `json:"menuid"` + MenuUrl []string `json:"menuurl"` +} + +// 菜单列表 +type MenuContList struct { + PublicId //菜单ID + PublicName //菜单名称 + ParentId string `json:"parentid"` //上级 + PathUrl string `json:"pathurl"` //访问路径 + IsTrue bool `json:"istrue"` //是否已授权 true:授权,false:未授权 +} + +// 权限菜单树 +type PowerThree struct { + MenuContList + Child []PowerThree `json:"child"` //下级菜单 + MenuOperation []MenuContList `json:"menuOperation"` //本级菜单操作 +} + +// 部门判断列表 +type DepartmentIsPower struct { + PublicId + PublicName + Superior int64 `json:"superior"` + OrganizationType int64 `json:"organizationtype"` + IsPower int `json:"ispower"` + Sort int `json:"sort"` + PowerPeople []DepartSoverePostMan `json:"powerpeople"` +} + +// 获取主权部门的负责人 +type DepartSoverePostMan struct { + PublicId + PublicName + People []PeopleSoverePostMan `json:"people"` +} +type PeopleSoverePostMan struct { + PublicId + Number string `json:"number"` + PublicName + PostId string `json:"postid"` + PostName string `json:"postname"` +} + +// 岗位递归 +type PositionDigui struct { + PublicId + PublicName + OrgId string `json:"orgId"` + Superior string `json:"superior"` + Sort int `json:"sort"` + People []PostPeople `json:"people"` +} + +type PostPeople struct { + PublicId + Number string `json:"number"` + PublicName + Company string `json:"company"` + CompanyName string `json:"companyname"` + Department string `json:"department"` + DepartmentName string `json:"departmentname"` + OrgId string `json:"orgId"` + OrgName string `json:"orgname"` + DutiesId string `json:"dutiesid"` + DutiesName string `json:"dutiesname"` + Wechat string `json:"wechat"` +} + +// 权限分配详情分解 +type SystemPowerInfo struct { + modelssystempermission.Empower + PointIdList []string `json:"point_id_list"` + OrganizationList []string `json:"organization"` +} + +// 鉴权个人信息 +type AuthenticationPower struct { + modelshr.ManCont + Level int `json:"level"` + PointIdList []string `json:"point_id_list"` + OrganizationList []string `json:"organization"` +} + +// 流程结构体 +type FlowChartList struct { + Step int `json:"step"` //步伐 + NodeName string `json:"nodename"` //节点名称 + State int `json:"state"` //状态 1、不点亮;2、点亮 + Class int `json:"class"` //节点类型 1、普通节点;2、运行中指定节点;3:抄送节点 + RunType int `json:"runtype"` //运行状态(1:开始;2:操作点;3:结束;4:抄送) + NodeRelationship NodeRelationshipStruct `json:"noderelationship"` //节点关系 + UserList []UserListFlowAll `json:"userlist"` //节点操作人 +} + +// 节点关系 +type NodeRelationshipStruct struct { + FromNode int `json:"fromnode"` // 来源 + ToNode int `json:"tonode"` //去向 + RejectNode int `json:"rejectnode"` //退回 +} + +// 节点操作人 +type UserListFlowAll struct { + Id string `json:"id"` //操作人ID + Name string `json:"name"` //操作人姓名 + Icon string `json:"icon"` //操作人头像 + Wechat string `json:"wechat"` //微信Openid + Company int64 `json:"company"` //公司 + CompanyName string `json:"companyname"` //公司名称 + DepartmentId int64 `json:"departmentid"` //分厂Id + DepartmentName string `json:"departmentname"` //分厂名称 + WorkshopId int64 `json:"workshopid"` //工段Id + WorkshopName string `json:"workshopname"` //工段名称 + PostId int64 `json:"postid"` //职务Id + PostName string `json:"postname"` //职务名称 + Tema int64 `json:"tema"` //班组Id + TemaName string `json:"temaname"` //班组名称 + LogList []LogList `json:"log"` //操作记录 +} + +// 节点操作人操作记录 +type LogList struct { + State int `json:"state"` //状态 1、未操作;2、通过;3、驳回 + TimeVal string `json:"time"` + Content string `json:"content"` //审批意见 + Enclosure []EnclosureFormat `json:"enclosure"` //附件 +} + +// 流程操作节点操作人信息 +type FlowNodePeopleInfo struct { + EvalCont UserListFlowAll `json:"evalcont"` + DutyCont UserListFlowAll `json:"dutycont"` +} + +type roleGroupBodyAry struct { + Id string `json:"open_id"` + WechatName string `json:"wechat_name"` + Prentid string `json:"prentid"` + Bfid string `json:"bf_id"` + Icons string `json:"icons"` +} + +// 改正措施数据提交 +type CorrectiveMeasuresType struct { + OrderId string `json:"orderid"` + Content string `json:"content"` //整改内容 + Register string `json:"register"` //挂号 + // Enclosure []string `json:"enclosure"` //附件 + // Enclosure []EnclosureFormat `json:"enclosure"` //附件 + Enclosure []EnclosureFormat `json:"enclosure"` //附件 +} + +// 权限相关 +type EmpowerCont struct { + RoleName string `json:"roleName"` + PointId string `json:"pointid"` + Operation string `json:"operation"` + Level int `json:"level"` +} + +// 部门方案通用json +type DepartmentProgrammeJson struct { + Id string `json:"id"` //维度ID + Name string `json:"name"` + ZhiFraction int `json:"zhiFraction"` + Child []EvaluPross `json:"child"` //考核细则 +} + +// 指标 +type EvaluPross struct { + Id string `json:"id"` //维度ID + Name string `json:"name"` + Content string `json:"content"` //指标说明 + Unit string `json:"unit"` //单位"` + ReferenceScore int64 `json:"referencescore"` //标准分值"` + Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"` + CycleAttres int `json:"cycleattr"` //辅助计数"` + State int `json:"state"` // + Score int64 `json:"score"` //分数 + QualEvalId string `json:"qeid"` + Status int `json:"status"` //1:使用;2:禁用;3:观察 +} + +// 时间转换 +type DateTimeTotimes struct { + Years string `json:"years"` + Quarter string `json:"quarter"` + Months string `json:"months"` + Week string `json:"week"` + Days string `json:"days"` + Hours string `json:"hours"` + Minutes string `json:"minutes"` + Second string `json:"second"` + AllTime int64 `json:"alltime"` +} + +// 获取行政组织所有上级 +type GetOrgAllParent struct { + Id []int64 `json:"id"` +} + +// 输出判定身份 +type outShenFen struct { + Level int + Group int64 + OrgList []int64 +} + +// 企业微信模版卡片返回值 +type WechatCallBack struct { + Errcode int `json:"errcode"` //返回码 + ErrMsg string `json:"errmsg"` //对返回码的文本描述内容 + MsgId string `json:"msgid"` //消息id,用于撤回应用消息 + ResponseCode string `json:"response_code"` //仅消息类型为“按钮交互型”,“投票选择型”和“多项选择型”的模板卡片消息返回,应用可使用response_code调用更新模版卡片消息接口,72小时内有效,且只能使用一次 +}