作者 tangxvhui

bug 修复

@@ -516,6 +516,10 @@ func (c RankController) RankRangeMove() { @@ -516,6 +516,10 @@ func (c RankController) RankRangeMove() {
516 return 516 return
517 } 517 }
518 companyid := c.GetCompanyId() 518 companyid := c.GetCompanyId()
  519 + if len(param.RelationId) == 0 {
  520 + msg = protocol.BadRequestParam("10126")
  521 + return
  522 + }
519 err := serverank.RankRangeMove(param.FromId, param.ToId, param.RelationId, companyid) 523 err := serverank.RankRangeMove(param.FromId, param.ToId, param.RelationId, companyid)
520 msg = protocol.NewReturnResponse(nil, err) 524 msg = protocol.NewReturnResponse(nil, err)
521 return 525 return
@@ -123,6 +123,7 @@ var errmessge ErrorMap = map[string]string{ @@ -123,6 +123,7 @@ var errmessge ErrorMap = map[string]string{
123 "10123": "排行榜评比项最多4项", 123 "10123": "排行榜评比项最多4项",
124 "10124": "公司未启用该模块", 124 "10124": "公司未启用该模块",
125 "10125": "参与范围名称不能重复", 125 "10125": "参与范围名称不能重复",
  126 + "10126": "被转移人员不能为空",
126 } 127 }
127 128
128 //错误码转换 ,兼容需要 129 //错误码转换 ,兼容需要
@@ -56,12 +56,12 @@ type ModuleEmployee struct { @@ -56,12 +56,12 @@ type ModuleEmployee struct {
56 } 56 }
57 57
58 type DeleteUserData struct { 58 type DeleteUserData struct {
59 - CompanyId int64 `json:"company_id"` 59 + CompanyId int64 `json:"companyId"`
60 Ids []int64 `json:"ids"` 60 Ids []int64 `json:"ids"`
61 } 61 }
62 62
63 type ForbidAllowUserData struct { 63 type ForbidAllowUserData struct {
64 - CompanyId int64 `json:"company_id"` 64 + CompanyId int64 `json:"companyId"`
65 Ids []int64 `json:"ids"` 65 Ids []int64 `json:"ids"`
66 Status int8 `json:"status"` 66 Status int8 `json:"status"`
67 } 67 }
@@ -435,7 +435,9 @@ func editUserDepart(usercompanyid int64, companyid int64, userDepart []UserDepar @@ -435,7 +435,9 @@ func editUserDepart(usercompanyid int64, companyid int64, userDepart []UserDepar
435 } 435 }
436 if len(delDepartIds) > 0 { 436 if len(delDepartIds) > 0 {
437 _, err = o.QueryTable(&models.UserDepartment{}). 437 _, err = o.QueryTable(&models.UserDepartment{}).
438 - Filter("id__in", delDepartIds). 438 + Filter("department_id__in", delDepartIds).
  439 + Filter("user_company_id", usercompanyid).
  440 + Filter("enable_status", 1).
439 Update(orm.Params{ 441 Update(orm.Params{
440 "enable_status": models.USER_DEPARTMENT_ENABLE_NO, 442 "enable_status": models.USER_DEPARTMENT_ENABLE_NO,
441 }) 443 })
@@ -488,7 +490,9 @@ func editUserPosition(usercompanyid int64, companyid int64, userPosition []UserP @@ -488,7 +490,9 @@ func editUserPosition(usercompanyid int64, companyid int64, userPosition []UserP
488 } 490 }
489 if len(delPositionIds) > 0 { 491 if len(delPositionIds) > 0 {
490 _, err = o.QueryTable(&models.UserPosition{}). 492 _, err = o.QueryTable(&models.UserPosition{}).
491 - Filter("id__in", delPositionIds). 493 + Filter("position_id__in", delPositionIds).
  494 + Filter("user_company_id", usercompanyid).
  495 + Filter("enable_status", 1).
492 Update(orm.Params{ 496 Update(orm.Params{
493 "enable_status": models.USER_POSITION_ENABLE_NO, 497 "enable_status": models.USER_POSITION_ENABLE_NO,
494 }) 498 })