From 3b654d0b303a76ae900252d26df01ff528c2f9ee Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 17 Dec 2024 13:55:25 +0800 Subject: [PATCH 1/6] update rule version --- go.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 7ca7e65..b429e86 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( require ( code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241216144119-b08da56ec5ec - code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241216085945-78fe55637e4b + code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241217040418-3640cd7169f0 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 github.com/360EntSecGroup-Skylar/excelize v1.4.1 @@ -50,7 +50,7 @@ require ( github.com/gocolly/colly v1.2.0 github.com/olivere/elastic/v7 v7.0.32 github.com/shopspring/decimal v1.3.1 - github.com/tidwall/gjson v1.14.1 + github.com/tidwall/gjson v1.18.0 google.golang.org/grpc v1.32.0 google.golang.org/protobuf v1.34.0 ) From 0b22b30b63ffaa9493da5aff399daf619fd35a08 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 17 Dec 2024 15:46:24 +0800 Subject: [PATCH 2/6] update --- app/hdl/financial_center/hdl_withdraw.go | 2 +- app/md/financial_center/md_withdraw.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/hdl/financial_center/hdl_withdraw.go b/app/hdl/financial_center/hdl_withdraw.go index 365bf5b..aa3ecd1 100644 --- a/app/hdl/financial_center/hdl_withdraw.go +++ b/app/hdl/financial_center/hdl_withdraw.go @@ -334,7 +334,7 @@ func GetWithdrawApplyList(c *gin.Context) { WechatPayName: apply.WxPayName, AliPayAccount: apply.AliPayAccount, WechatPayAccount: apply.WxPayAccount, - WithdrawType: apply.WithdrawType, + WithdrawType: apply.WithdrawKind, InviteCode: apply.InviteCode, Amount: apply.Amount, ActualReceipt: apply.RealAmount, diff --git a/app/md/financial_center/md_withdraw.go b/app/md/financial_center/md_withdraw.go index 20fb2ca..667cd97 100644 --- a/app/md/financial_center/md_withdraw.go +++ b/app/md/financial_center/md_withdraw.go @@ -86,7 +86,6 @@ type WithdrawApplyInfo struct { AliPayAccount string `xorm:"user_id"` // 支付宝账号 WxPayName string `xorm:"user_name"` // 微信昵称 WxPayAccount string `xorm:"user_id"` // 微信账号 - WithdrawType int `xorm:"withdraw_kind"` // 提现方式(1:支付宝 2:微信) InviteCode string `xorm:"system_invite_code"` // 邀请码 } From 167fdbfd686ecf73e04537b85097f0593d80902e Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 17 Dec 2024 16:03:29 +0800 Subject: [PATCH 3/6] update --- app/md/financial_center/md_withdraw.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/md/financial_center/md_withdraw.go b/app/md/financial_center/md_withdraw.go index 667cd97..96d2d02 100644 --- a/app/md/financial_center/md_withdraw.go +++ b/app/md/financial_center/md_withdraw.go @@ -75,7 +75,7 @@ type GetWithdrawApplyListReq struct { type WithdrawApplyAuditReq struct { WithdrawApplyId int64 `json:"withdraw_apply_id" binding:"required"` // 提现申请id AuditState int `json:"audit_state" binding:"required"` // 审核状态(1:同意 2:拒绝) - Reason int `json:"reason" binding:"required"` // 审核失败(驳回理由) + Reason int `json:"reason"` // 审核失败(驳回理由) } type WithdrawApplyInfo struct { From 14ec5753a05fe0da2f3043a23e00b055739dcc42 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 17 Dec 2024 16:09:34 +0800 Subject: [PATCH 4/6] add NineDimensionalSpace --- .../public_platoon/hdl_basic.go | 53 ++++++++++++++++ .../public_platoon/md_public_platoon.go | 10 +++ app/router/router.go | 1 + docs/docs.go | 61 +++++++++++++++++-- docs/swagger.json | 56 +++++++++++++++-- docs/swagger.yaml | 38 +++++++++++- 6 files changed, 206 insertions(+), 13 deletions(-) diff --git a/app/hdl/institutional_management/public_platoon/hdl_basic.go b/app/hdl/institutional_management/public_platoon/hdl_basic.go index b72a16c..d859725 100644 --- a/app/hdl/institutional_management/public_platoon/hdl_basic.go +++ b/app/hdl/institutional_management/public_platoon/hdl_basic.go @@ -12,7 +12,9 @@ import ( rule "code.fnuoos.com/EggPlanet/egg_system_rules.git" ruleSvc "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy" "errors" + "fmt" "github.com/gin-gonic/gin" + "math" "time" ) @@ -434,6 +436,57 @@ func ExchangeUserPosition(c *gin.Context) { e.OutSuc(c, nil, nil) } +// NineDimensionalSpace +// @Summary 制度中心-公排管理-关系分布图(公排详情) +// @Tags 公排管理 +// @Description 关系分布图(公排详情) +// @Accept json +// @Produce json +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Param uid query string false "用户id" +// @Success 200 {} "成功返回" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/institutionalManagement/publicPlatoon/nineDimensionalSpace [GET] +func NineDimensionalSpace(c *gin.Context) { + uid := c.Query("uid") + // 1. 查询公排基础设置 + settingDb := implement.NewPublicPlatoonBasicSettingDb(db.Db) + setting, err := settingDb.PublicPlatoonBasicSettingGetOneByParams(map[string]interface{}{ + "key": "is_open", + "value": 1, + }) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + if setting == nil { + e.OutErr(c, e.ERR_NO_DATA, nil) + return + } + + var spaceTotalNums float64 + var list []md.SpaceListNode + for i := 1; i <= setting.SeveralRows; i++ { + var tmpSql = fmt.Sprintf("SELECT COUNT(*)AS total FROM `public_platoon_user_relation` WHERE father_uid%d = %s", i, uid) + tmpNativeString, _ := db.QueryNativeString(db.Db, tmpSql) + nowUserCount := utils.StrToInt64(tmpNativeString[0]["total"]) + maxCount := math.Pow(float64(setting.SeveralTimes), float64(i)) + if nowUserCount > int64(maxCount) { + nowUserCount = int64(maxCount) + } + + list = append(list, md.SpaceListNode{ + Name: utils.IntToStr(i) + "维", + MaxCount: int(maxCount), + NowCount: int(nowUserCount), + }) + spaceTotalNums += maxCount + } + + resp := md.NineDimensionalSpaceResp{SpaceList: list} + e.OutSuc(c, resp, nil) +} + // GetFreePublishUser // @Summary 制度中心-公排管理-免罚用户(查询) // @Tags 公排管理 diff --git a/app/md/institutional_management/public_platoon/md_public_platoon.go b/app/md/institutional_management/public_platoon/md_public_platoon.go index d17d531..741ff18 100644 --- a/app/md/institutional_management/public_platoon/md_public_platoon.go +++ b/app/md/institutional_management/public_platoon/md_public_platoon.go @@ -53,6 +53,16 @@ type ExchangeUserPositionReq struct { Position2 int64 `json:"position_2,required"` //位置2,具体值取返回数据中的 system_id } +type SpaceListNode struct { + Name string `json:"name"` // 维度 + MaxCount int `json:"max_count"` // 最大容纳人数 + NowCount int `json:"now_count"` // 当前人数 +} + +type NineDimensionalSpaceResp struct { + SpaceList []SpaceListNode `json:"space_list"` // 数据列表 +} + type SelectMemberReq struct { Uid int64 `json:"uid"` // 会员 ID Phone string `json:"phone"` // 会员手机号 diff --git a/app/router/router.go b/app/router/router.go index 6b04103..f77c634 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -225,6 +225,7 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理 rPublicPlatoon.GET("/findUserRelationshipMap", public_platoon.FindUserRelationshipMap) rPublicPlatoon.GET("/findSubUserRelationshipMap", public_platoon.FindSubUserRelationshipMap) rPublicPlatoon.POST("/exchangeUserPosition", public_platoon.ExchangeUserPosition) + rPublicPlatoon.GET("/nineDimensionalSpace", public_platoon.NineDimensionalSpace) rPublicPlatoon.POST("/selectMember", public_platoon.SelectMember) rPublicPlatoonUserFreePunish := rPublicPlatoon.Group("/publicPlatoonUserFreePunish") { diff --git a/docs/docs.go b/docs/docs.go index 42e4cee..5fa4cfc 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,5 +1,4 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - +// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" @@ -1656,9 +1655,7 @@ const docTemplate = `{ "name": "req", "in": "body", "required": true, - "schema": { - "type": "object" - } + "schema": {} } ], "responses": { @@ -5439,6 +5436,50 @@ const docTemplate = `{ } } }, + "/api/institutionalManagement/publicPlatoon/nineDimensionalSpace": { + "get": { + "description": "关系分布图(公排详情)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "公排管理" + ], + "summary": "制度中心-公排管理-关系分布图(公排详情)", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "用户id", + "name": "uid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "成功返回", + "schema": { + "type": "" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/delete": { "delete": { "description": "免罚用户(删除)", @@ -9514,6 +9555,10 @@ const docTemplate = `{ } ] }, + "initial_price": { + "description": "初始价格", + "type": "string" + }, "is_open": { "description": "是否开启(1:开启 0:关闭)", "type": "integer" @@ -14932,6 +14977,9 @@ const docTemplate = `{ "md.StatisticsEggPointReq": { "type": "object", "properties": { + "kind": { + "type": "string" + }, "week": { "type": "string", "example": "周份" @@ -17026,7 +17074,6 @@ const docTemplate = `{ "type": "object", "required": [ "audit_state", - "reason", "withdraw_apply_id" ], "properties": { @@ -17272,6 +17319,8 @@ var SwaggerInfo = &swag.Spec{ Description: "管理后台接口文档", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", } func init() { diff --git a/docs/swagger.json b/docs/swagger.json index e433d20..7a429ae 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1648,9 +1648,7 @@ "name": "req", "in": "body", "required": true, - "schema": { - "type": "object" - } + "schema": {} } ], "responses": { @@ -5431,6 +5429,50 @@ } } }, + "/api/institutionalManagement/publicPlatoon/nineDimensionalSpace": { + "get": { + "description": "关系分布图(公排详情)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "公排管理" + ], + "summary": "制度中心-公排管理-关系分布图(公排详情)", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "type": "string", + "description": "用户id", + "name": "uid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "成功返回", + "schema": { + "type": "" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/delete": { "delete": { "description": "免罚用户(删除)", @@ -9506,6 +9548,10 @@ } ] }, + "initial_price": { + "description": "初始价格", + "type": "string" + }, "is_open": { "description": "是否开启(1:开启 0:关闭)", "type": "integer" @@ -14924,6 +14970,9 @@ "md.StatisticsEggPointReq": { "type": "object", "properties": { + "kind": { + "type": "string" + }, "week": { "type": "string", "example": "周份" @@ -17018,7 +17067,6 @@ "type": "object", "required": [ "audit_state", - "reason", "withdraw_apply_id" ], "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f19796c..ad84fc6 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -90,6 +90,9 @@ definitions: allOf: - $ref: '#/definitions/md.DirectPushRewardSettingStruct' description: 直推奖励 + initial_price: + description: 初始价格 + type: string is_open: description: 是否开启(1:开启 0:关闭) type: integer @@ -3858,6 +3861,8 @@ definitions: type: object md.StatisticsEggPointReq: properties: + kind: + type: string week: example: 周份 type: string @@ -5317,7 +5322,6 @@ definitions: type: integer required: - audit_state - - reason - withdraw_apply_id type: object md.WithdrawFeeSetStruct: @@ -6545,8 +6549,7 @@ paths: in: body name: req required: true - schema: - type: object + schema: {} produces: - application/json responses: @@ -9044,6 +9047,35 @@ paths: summary: 制度中心-公排管理-公排基础设置(获取) tags: - 公排管理 + /api/institutionalManagement/publicPlatoon/nineDimensionalSpace: + get: + consumes: + - application/json + description: 关系分布图(公排详情) + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + - description: 用户id + in: query + name: uid + type: string + produces: + - application/json + responses: + "200": + description: 成功返回 + schema: + type: "" + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 制度中心-公排管理-关系分布图(公排详情) + tags: + - 公排管理 /api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/delete: delete: consumes: From 4b11451d2f63ff82ac6f29227a343826525954a4 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 17 Dec 2024 18:33:44 +0800 Subject: [PATCH 5/6] update --- app/task/svc/svc_auto_caching_egg_point_statistics.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/task/svc/svc_auto_caching_egg_point_statistics.go b/app/task/svc/svc_auto_caching_egg_point_statistics.go index a451301..14e3df2 100644 --- a/app/task/svc/svc_auto_caching_egg_point_statistics.go +++ b/app/task/svc/svc_auto_caching_egg_point_statistics.go @@ -127,6 +127,8 @@ func AutoCachingEggPointStatistics(engine *xorm.Engine) { parts := strings.Split(esIndexName, "_") yearAndWeekStr := parts[len(parts)-1] redisKey := fmt.Sprintf(md2.AutoCachingEggPointRedisKey, yearAndWeekStr) + // 更新缓存 + cache.Del(redisKey) cache.SetJson(redisKey, tempWeek, -1) } fmt.Println("----------------------------AutoCachingEggPointStatistics_end-------------------------------") From 485a02ea936fb0b1c209ec1d7f2a3a9c701adbb4 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 17 Dec 2024 18:42:27 +0800 Subject: [PATCH 6/6] update --- app/task/svc/svc_auto_caching_egg_point_statistics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/task/svc/svc_auto_caching_egg_point_statistics.go b/app/task/svc/svc_auto_caching_egg_point_statistics.go index 14e3df2..050a23e 100644 --- a/app/task/svc/svc_auto_caching_egg_point_statistics.go +++ b/app/task/svc/svc_auto_caching_egg_point_statistics.go @@ -31,7 +31,7 @@ func AutoCachingEggPointStatistics(engine *xorm.Engine) { return } cache.SetEx(AutoCachingEggPointStatisticsLockKey, "running", 10*60) // 10 min - cache.Del(AutoCachingEggPointStatisticsLockKey) + defer cache.Del(AutoCachingEggPointStatisticsLockKey) // 1. 查询所有蛋蛋分索引 aliasName := md.EggEnergyUserEggScoreEsAlias