@@ -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, | |||
@@ -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 公排管理 | |||
@@ -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 { | |||
@@ -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"` // 邀请码 | |||
} | |||
@@ -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"` // 会员手机号 | |||
@@ -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") | |||
{ | |||
@@ -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 | |||
@@ -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-------------------------------") | |||
@@ -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() { | |||
@@ -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": { | |||
@@ -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: | |||
@@ -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 | |||
) | |||