作者 tangxvhui

赛季设置调整

@@ -105,6 +105,7 @@ func (c RankController) RankSeasonAdd() { @@ -105,6 +105,7 @@ func (c RankController) RankSeasonAdd() {
105 c.ResposeJson(msg) 105 c.ResposeJson(msg)
106 }() 106 }()
107 type Parameter struct { 107 type Parameter struct {
  108 + RankTypeId int64 `json:"rank_type_id"`
108 Name string `json:"name"` 109 Name string `json:"name"`
109 BeginTime string `json:"begin_time"` 110 BeginTime string `json:"begin_time"`
110 EndTime string `json:"end_time"` 111 EndTime string `json:"end_time"`
@@ -120,7 +121,7 @@ func (c RankController) RankSeasonAdd() { @@ -120,7 +121,7 @@ func (c RankController) RankSeasonAdd() {
120 endTime int64 121 endTime int64
121 ) 122 )
122 companyid := c.GetCompanyId() 123 companyid := c.GetCompanyId()
123 - err := serverank.AddRankSeason(beginTime, endTime, param.Name, companyid) 124 + err := serverank.AddRankSeason(param.RankTypeId, beginTime, endTime, param.Name, companyid)
124 msg = protocol.NewReturnResponse(nil, err) 125 msg = protocol.NewReturnResponse(nil, err)
125 return 126 return
126 } 127 }
@@ -176,6 +177,7 @@ func (c RankController) RankRangeAdd() { @@ -176,6 +177,7 @@ func (c RankController) RankRangeAdd() {
176 c.ResposeJson(msg) 177 c.ResposeJson(msg)
177 }() 178 }()
178 type Parameter struct { 179 type Parameter struct {
  180 + RankTypeId int64 `json:"rank_type_id"`
179 Name string `json:"name"` 181 Name string `json:"name"`
180 RangeType int8 `json:"range_type"` 182 RangeType int8 `json:"range_type"`
181 RelationId []int64 `json:"relation_id"` 183 RelationId []int64 `json:"relation_id"`
@@ -207,7 +209,7 @@ func (c RankController) RankRangeAdd() { @@ -207,7 +209,7 @@ func (c RankController) RankRangeAdd() {
207 return 209 return
208 } 210 }
209 companyid := c.GetCompanyId() 211 companyid := c.GetCompanyId()
210 - err := serverank.AddRankRange(param.Name, param.RangeType, param.RelationId, companyid) 212 + err := serverank.AddRankRange(param.RankTypeId, param.Name, param.RangeType, param.RelationId, companyid)
211 msg = protocol.NewReturnResponse(nil, err) 213 msg = protocol.NewReturnResponse(nil, err)
212 return 214 return
213 } 215 }
@@ -11,6 +11,7 @@ type RankPeriod struct { @@ -11,6 +11,7 @@ type RankPeriod struct {
11 Id int64 `orm:"column(id);auto" description:"主键"` 11 Id int64 `orm:"column(id);auto" description:"主键"`
12 CompanyId int64 `orm:"column(company_id);null" description:"公司编号 表company.id"` 12 CompanyId int64 `orm:"column(company_id);null" description:"公司编号 表company.id"`
13 SeasonName string `orm:"column(season_name);size(50);null" description:"赛季名称"` 13 SeasonName string `orm:"column(season_name);size(50);null" description:"赛季名称"`
  14 + RankTypeId int64 `orm:"column(rank_type_id);size(50);null" description:"赛季类型id"`
14 BeginTime time.Time `orm:"column(begin_time);type(timestamp);null" description:"开始时间"` 15 BeginTime time.Time `orm:"column(begin_time);type(timestamp);null" description:"开始时间"`
15 EndTime time.Time `orm:"column(end_time);type(timestamp);null" description:"结束时间"` 16 EndTime time.Time `orm:"column(end_time);type(timestamp);null" description:"结束时间"`
16 CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间"` 17 CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间"`
@@ -12,6 +12,7 @@ type RankRange struct { @@ -12,6 +12,7 @@ type RankRange struct {
12 Id int64 `orm:"column(id);auto"` 12 Id int64 `orm:"column(id);auto"`
13 Name string `orm:"column(name);size(50);null" description:"名称"` 13 Name string `orm:"column(name);size(50);null" description:"名称"`
14 CompanyId int64 `orm:"column(company_id);null" description:"公司编号 表company.id"` 14 CompanyId int64 `orm:"column(company_id);null" description:"公司编号 表company.id"`
  15 + RankTypeId int64 `orm:"column(rank_type_id);null" description:""`
15 Type int8 `orm:"column(type);null" description:"1:所有员工 2:指定员工 3:所有部门 4:指定部门"` 16 Type int8 `orm:"column(type);null" description:"1:所有员工 2:指定员工 3:所有部门 4:指定部门"`
16 Data string `orm:"column(data);size(1000);null" description:"人员范围数据(type:2,4 有值 对于人员数据/部门数据)"` 17 Data string `orm:"column(data);size(1000);null" description:"人员范围数据(type:2,4 有值 对于人员数据/部门数据)"`
17 CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间"` 18 CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间"`
@@ -176,13 +176,14 @@ func RankSeasonList(pageindex int, pagesize int, companyid int64) (protocol.Resp @@ -176,13 +176,14 @@ func RankSeasonList(pageindex int, pagesize int, companyid int64) (protocol.Resp
176 return rspData, err 176 return rspData, err
177 } 177 }
178 178
179 -func AddRankSeason(beginTime int64, endTime int64, name string, companyid int64) error { 179 +func AddRankPeriod(rankTypeId int64, beginTime int64, endTime int64, name string, companyid int64) error {
180 var ( 180 var (
181 err error 181 err error
182 ) 182 )
183 m := &models.RankPeriod{ 183 m := &models.RankPeriod{
184 CompanyId: companyid, 184 CompanyId: companyid,
185 SeasonName: name, 185 SeasonName: name,
  186 + RankTypeId: rankTypeId,
186 BeginTime: time.Unix(beginTime, 0), 187 BeginTime: time.Unix(beginTime, 0),
187 EndTime: time.Unix(endTime, 0), 188 EndTime: time.Unix(endTime, 0),
188 Status: 0, 189 Status: 0,
@@ -232,7 +233,7 @@ func GetRankRangeList(companyid int64) []protocol.RankRangeItem { @@ -232,7 +233,7 @@ func GetRankRangeList(companyid int64) []protocol.RankRangeItem {
232 return rspData 233 return rspData
233 } 234 }
234 235
235 -func AddRankRange(name string, rangetype int8, relationId []int64, companyid int64) error { 236 +func AddRankRange(rankTypeId int64, name string, rangetype int8, relationId []int64, companyid int64) error {
236 var ( 237 var (
237 rankRangeDatas []models.RankRangeData 238 rankRangeDatas []models.RankRangeData
238 rankRange *models.RankRange 239 rankRange *models.RankRange
@@ -241,6 +242,7 @@ func AddRankRange(name string, rangetype int8, relationId []int64, companyid int @@ -241,6 +242,7 @@ func AddRankRange(name string, rangetype int8, relationId []int64, companyid int
241 rankRange = &models.RankRange{ 242 rankRange = &models.RankRange{
242 Name: name, 243 Name: name,
243 CompanyId: companyid, 244 CompanyId: companyid,
  245 + RankTypeId: rankTypeId,
244 Type: rangetype, 246 Type: rangetype,
245 } 247 }
246 o := orm.NewOrm() 248 o := orm.NewOrm()