@@ -12,7 +12,9 @@ import ( | |||||
rule "code.fnuoos.com/EggPlanet/egg_system_rules.git" | rule "code.fnuoos.com/EggPlanet/egg_system_rules.git" | ||||
ruleSvc "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy" | ruleSvc "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy" | ||||
"errors" | "errors" | ||||
"fmt" | |||||
"github.com/gin-gonic/gin" | "github.com/gin-gonic/gin" | ||||
"math" | |||||
"time" | "time" | ||||
) | ) | ||||
@@ -434,6 +436,57 @@ func ExchangeUserPosition(c *gin.Context) { | |||||
e.OutSuc(c, nil, nil) | 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 | // GetFreePublishUser | ||||
// @Summary 制度中心-公排管理-免罚用户(查询) | // @Summary 制度中心-公排管理-免罚用户(查询) | ||||
// @Tags 公排管理 | // @Tags 公排管理 | ||||
@@ -53,6 +53,16 @@ type ExchangeUserPositionReq struct { | |||||
Position2 int64 `json:"position_2,required"` //位置2,具体值取返回数据中的 system_id | 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 { | type SelectMemberReq struct { | ||||
Uid int64 `json:"uid"` // 会员 ID | Uid int64 `json:"uid"` // 会员 ID | ||||
Phone string `json:"phone"` // 会员手机号 | Phone string `json:"phone"` // 会员手机号 | ||||
@@ -225,6 +225,7 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理 | |||||
rPublicPlatoon.GET("/findUserRelationshipMap", public_platoon.FindUserRelationshipMap) | rPublicPlatoon.GET("/findUserRelationshipMap", public_platoon.FindUserRelationshipMap) | ||||
rPublicPlatoon.GET("/findSubUserRelationshipMap", public_platoon.FindSubUserRelationshipMap) | rPublicPlatoon.GET("/findSubUserRelationshipMap", public_platoon.FindSubUserRelationshipMap) | ||||
rPublicPlatoon.POST("/exchangeUserPosition", public_platoon.ExchangeUserPosition) | rPublicPlatoon.POST("/exchangeUserPosition", public_platoon.ExchangeUserPosition) | ||||
rPublicPlatoon.GET("/nineDimensionalSpace", public_platoon.NineDimensionalSpace) | |||||
rPublicPlatoon.POST("/selectMember", public_platoon.SelectMember) | rPublicPlatoon.POST("/selectMember", public_platoon.SelectMember) | ||||
rPublicPlatoonUserFreePunish := rPublicPlatoon.Group("/publicPlatoonUserFreePunish") | rPublicPlatoonUserFreePunish := rPublicPlatoon.Group("/publicPlatoonUserFreePunish") | ||||
{ | { | ||||
@@ -1,5 +1,4 @@ | |||||
// Code generated by swaggo/swag. DO NOT EDIT. | |||||
// Package docs Code generated by swaggo/swag. DO NOT EDIT | |||||
package docs | package docs | ||||
import "github.com/swaggo/swag" | import "github.com/swaggo/swag" | ||||
@@ -1656,9 +1655,7 @@ const docTemplate = `{ | |||||
"name": "req", | "name": "req", | ||||
"in": "body", | "in": "body", | ||||
"required": true, | "required": true, | ||||
"schema": { | |||||
"type": "object" | |||||
} | |||||
"schema": {} | |||||
} | } | ||||
], | ], | ||||
"responses": { | "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": { | "/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/delete": { | ||||
"delete": { | "delete": { | ||||
"description": "免罚用户(删除)", | "description": "免罚用户(删除)", | ||||
@@ -9514,6 +9555,10 @@ const docTemplate = `{ | |||||
} | } | ||||
] | ] | ||||
}, | }, | ||||
"initial_price": { | |||||
"description": "初始价格", | |||||
"type": "string" | |||||
}, | |||||
"is_open": { | "is_open": { | ||||
"description": "是否开启(1:开启 0:关闭)", | "description": "是否开启(1:开启 0:关闭)", | ||||
"type": "integer" | "type": "integer" | ||||
@@ -14932,6 +14977,9 @@ const docTemplate = `{ | |||||
"md.StatisticsEggPointReq": { | "md.StatisticsEggPointReq": { | ||||
"type": "object", | "type": "object", | ||||
"properties": { | "properties": { | ||||
"kind": { | |||||
"type": "string" | |||||
}, | |||||
"week": { | "week": { | ||||
"type": "string", | "type": "string", | ||||
"example": "周份" | "example": "周份" | ||||
@@ -17026,7 +17074,6 @@ const docTemplate = `{ | |||||
"type": "object", | "type": "object", | ||||
"required": [ | "required": [ | ||||
"audit_state", | "audit_state", | ||||
"reason", | |||||
"withdraw_apply_id" | "withdraw_apply_id" | ||||
], | ], | ||||
"properties": { | "properties": { | ||||
@@ -17272,6 +17319,8 @@ var SwaggerInfo = &swag.Spec{ | |||||
Description: "管理后台接口文档", | Description: "管理后台接口文档", | ||||
InfoInstanceName: "swagger", | InfoInstanceName: "swagger", | ||||
SwaggerTemplate: docTemplate, | SwaggerTemplate: docTemplate, | ||||
LeftDelim: "{{", | |||||
RightDelim: "}}", | |||||
} | } | ||||
func init() { | func init() { | ||||
@@ -1648,9 +1648,7 @@ | |||||
"name": "req", | "name": "req", | ||||
"in": "body", | "in": "body", | ||||
"required": true, | "required": true, | ||||
"schema": { | |||||
"type": "object" | |||||
} | |||||
"schema": {} | |||||
} | } | ||||
], | ], | ||||
"responses": { | "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": { | "/api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/delete": { | ||||
"delete": { | "delete": { | ||||
"description": "免罚用户(删除)", | "description": "免罚用户(删除)", | ||||
@@ -9506,6 +9548,10 @@ | |||||
} | } | ||||
] | ] | ||||
}, | }, | ||||
"initial_price": { | |||||
"description": "初始价格", | |||||
"type": "string" | |||||
}, | |||||
"is_open": { | "is_open": { | ||||
"description": "是否开启(1:开启 0:关闭)", | "description": "是否开启(1:开启 0:关闭)", | ||||
"type": "integer" | "type": "integer" | ||||
@@ -14924,6 +14970,9 @@ | |||||
"md.StatisticsEggPointReq": { | "md.StatisticsEggPointReq": { | ||||
"type": "object", | "type": "object", | ||||
"properties": { | "properties": { | ||||
"kind": { | |||||
"type": "string" | |||||
}, | |||||
"week": { | "week": { | ||||
"type": "string", | "type": "string", | ||||
"example": "周份" | "example": "周份" | ||||
@@ -17018,7 +17067,6 @@ | |||||
"type": "object", | "type": "object", | ||||
"required": [ | "required": [ | ||||
"audit_state", | "audit_state", | ||||
"reason", | |||||
"withdraw_apply_id" | "withdraw_apply_id" | ||||
], | ], | ||||
"properties": { | "properties": { | ||||
@@ -90,6 +90,9 @@ definitions: | |||||
allOf: | allOf: | ||||
- $ref: '#/definitions/md.DirectPushRewardSettingStruct' | - $ref: '#/definitions/md.DirectPushRewardSettingStruct' | ||||
description: 直推奖励 | description: 直推奖励 | ||||
initial_price: | |||||
description: 初始价格 | |||||
type: string | |||||
is_open: | is_open: | ||||
description: 是否开启(1:开启 0:关闭) | description: 是否开启(1:开启 0:关闭) | ||||
type: integer | type: integer | ||||
@@ -3858,6 +3861,8 @@ definitions: | |||||
type: object | type: object | ||||
md.StatisticsEggPointReq: | md.StatisticsEggPointReq: | ||||
properties: | properties: | ||||
kind: | |||||
type: string | |||||
week: | week: | ||||
example: 周份 | example: 周份 | ||||
type: string | type: string | ||||
@@ -5317,7 +5322,6 @@ definitions: | |||||
type: integer | type: integer | ||||
required: | required: | ||||
- audit_state | - audit_state | ||||
- reason | |||||
- withdraw_apply_id | - withdraw_apply_id | ||||
type: object | type: object | ||||
md.WithdrawFeeSetStruct: | md.WithdrawFeeSetStruct: | ||||
@@ -6545,8 +6549,7 @@ paths: | |||||
in: body | in: body | ||||
name: req | name: req | ||||
required: true | required: true | ||||
schema: | |||||
type: object | |||||
schema: {} | |||||
produces: | produces: | ||||
- application/json | - application/json | ||||
responses: | responses: | ||||
@@ -9044,6 +9047,35 @@ paths: | |||||
summary: 制度中心-公排管理-公排基础设置(获取) | summary: 制度中心-公排管理-公排基础设置(获取) | ||||
tags: | 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: | /api/institutionalManagement/publicPlatoon/publicPlatoonUserFreePunish/delete: | ||||
delete: | delete: | ||||
consumes: | consumes: | ||||