正在显示
7 个修改的文件
包含
77 行增加
和
2 行删除
controllers/audit.go
0 → 100644
| 1 | +package controllers | ||
| 2 | + | ||
| 3 | +import "oppmg/protocol" | ||
| 4 | + | ||
| 5 | +type AuditController struct { | ||
| 6 | + BaseController | ||
| 7 | +} | ||
| 8 | + | ||
| 9 | +//AuditList 机会管理列表 | ||
| 10 | +//@router /v1/audit/list [post] | ||
| 11 | +func (this *AuditController) AuditList() { | ||
| 12 | + var msg *protocol.ResponseMessage | ||
| 13 | + defer func() { | ||
| 14 | + this.ResposeJson(msg) | ||
| 15 | + }() | ||
| 16 | + // var request *protocol.ConfigScoreRequest | ||
| 17 | + // if err := json.Unmarshal(this.Ctx.Input.RequestBody, &request); err != nil { | ||
| 18 | + // log.Error("json 解析失败", err) | ||
| 19 | + // msg = protocol.BadRequestParam("1") | ||
| 20 | + // return | ||
| 21 | + // } | ||
| 22 | + // uid := this.GetUserId() | ||
| 23 | + // companyId := this.GetCompanyId() | ||
| 24 | + | ||
| 25 | + msg = protocol.NewReturnResponse(nil, nil) | ||
| 26 | + return | ||
| 27 | +} |
| @@ -225,3 +225,21 @@ type CategoryEditSortRequest struct { | @@ -225,3 +225,21 @@ type CategoryEditSortRequest struct { | ||
| 225 | } | 225 | } |
| 226 | type CategoryEditSortResponse struct { | 226 | type CategoryEditSortResponse struct { |
| 227 | } | 227 | } |
| 228 | + | ||
| 229 | +//RequestAuditList 机会管理-获取机会列表 | ||
| 230 | +type RequestAuditList struct { | ||
| 231 | + RequestPageInfo | ||
| 232 | +} | ||
| 233 | + | ||
| 234 | +type ResponseAuditList struct { | ||
| 235 | + Id int64 `json:"id"` //机会的id | ||
| 236 | + ChanceType1 string `json:"chance_type_1"` //一级分类 | ||
| 237 | + ChanceType2 string `json:"chance_type_2"` //二级分类 | ||
| 238 | + UserName string `json:"user_name"` // 提交人 | ||
| 239 | + Department string `json:"department"` //提交部门 | ||
| 240 | + CreateTime int64 `json:"create_time"` //提交时间 | ||
| 241 | + PublishStatus int `json:"publish_status"` //公开状态 | ||
| 242 | + PublishStatusName string `json:"publish_status_name"` // | ||
| 243 | + ReviewStatus int `json:"review_status"` //审批状态 | ||
| 244 | + ReviewStatusName string `json:"review_status_name"` | ||
| 245 | +} |
| @@ -20,7 +20,7 @@ var errmessge ErrorMap = map[string]string{ | @@ -20,7 +20,7 @@ var errmessge ErrorMap = map[string]string{ | ||
| 20 | //职位相关 | 20 | //职位相关 |
| 21 | "10011": "该职位已被使用无法删除", | 21 | "10011": "该职位已被使用无法删除", |
| 22 | "10012": "超过10级的职位限制,请重新选择", | 22 | "10012": "超过10级的职位限制,请重新选择", |
| 23 | - "10013": "职位已存在", | 23 | + "10013": "同一级职位名称不允许重复", |
| 24 | "10014": "职位名称最多10个字符", | 24 | "10014": "职位名称最多10个字符", |
| 25 | //安全认证相关 | 25 | //安全认证相关 |
| 26 | "10020": "验证码过期", | 26 | "10020": "验证码过期", |
| @@ -46,6 +46,7 @@ var errmessge ErrorMap = map[string]string{ | @@ -46,6 +46,7 @@ var errmessge ErrorMap = map[string]string{ | ||
| 46 | "10039": "用户已存在", | 46 | "10039": "用户已存在", |
| 47 | "10071": "不能删除主管理员", | 47 | "10071": "不能删除主管理员", |
| 48 | "10072": "不能禁用主管理员", | 48 | "10072": "不能禁用主管理员", |
| 49 | + "10073": "角色组已存在", | ||
| 49 | //部门相关 | 50 | //部门相关 |
| 50 | "10041": "无效的主管设置", | 51 | "10041": "无效的主管设置", |
| 51 | "10042": "上级部门不能选择当前部门及其子部门", | 52 | "10042": "上级部门不能选择当前部门及其子部门", |
| @@ -98,6 +98,9 @@ func init() { | @@ -98,6 +98,9 @@ func init() { | ||
| 98 | beego.NSRouter("/score", &controllers.ConfigController{}, "post:ConfigScore"), | 98 | beego.NSRouter("/score", &controllers.ConfigController{}, "post:ConfigScore"), |
| 99 | beego.NSRouter("/score/get", &controllers.ConfigController{}, "post:GetConfigScore"), | 99 | beego.NSRouter("/score/get", &controllers.ConfigController{}, "post:GetConfigScore"), |
| 100 | ), | 100 | ), |
| 101 | + beego.NSNamespace("/audit", | ||
| 102 | + beego.NSRouter("/list", &controllers.AuditController{}, "post:AuditList"), | ||
| 103 | + ), | ||
| 101 | ) | 104 | ) |
| 102 | 105 | ||
| 103 | nsAuth := beego.NewNamespace("/auth", | 106 | nsAuth := beego.NewNamespace("/auth", |
services/audit/audit.go
0 → 100644
| @@ -141,6 +141,10 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio | @@ -141,6 +141,10 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio | ||
| 141 | } | 141 | } |
| 142 | //更新部门关系数据 | 142 | //更新部门关系数据 |
| 143 | if positionUpdate.ParentId != param.ParentID { | 143 | if positionUpdate.ParentId != param.ParentID { |
| 144 | + ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name) | ||
| 145 | + if ok { | ||
| 146 | + return nil, protocol.NewErrWithMessage("10013") | ||
| 147 | + } | ||
| 144 | err = positionRelationUpdate(positionUpdate, parentPosition) | 148 | err = positionRelationUpdate(positionUpdate, parentPosition) |
| 145 | if err != nil { | 149 | if err != nil { |
| 146 | e := fmt.Errorf("positionRelationUpdate err:%s", err) | 150 | e := fmt.Errorf("positionRelationUpdate err:%s", err) |
| @@ -181,8 +181,19 @@ func RoleGroupEdit(companyid int64, id int64, name string) (*protocol.ResponseRo | @@ -181,8 +181,19 @@ func RoleGroupEdit(companyid int64, id int64, name string) (*protocol.ResponseRo | ||
| 181 | log.Error("不是角色组") | 181 | log.Error("不是角色组") |
| 182 | return nil, protocol.NewErrWithMessage("1") | 182 | return nil, protocol.NewErrWithMessage("1") |
| 183 | } | 183 | } |
| 184 | + if roleinfo.Name != name { | ||
| 185 | + ok := models.ExistRoleName(companyid, name, models.ROLETYPES_GROUP) | ||
| 186 | + if ok { | ||
| 187 | + return nil, protocol.NewErrWithMessage("10073") | ||
| 188 | + } | ||
| 189 | + roleinfo.Name = name | ||
| 190 | + } | ||
| 184 | roleinfo.Name = name | 191 | roleinfo.Name = name |
| 185 | - models.UpdateRoleById(roleinfo, []string{"Name"}) | 192 | + err = models.UpdateRoleById(roleinfo, []string{"Name"}) |
| 193 | + if err != nil { | ||
| 194 | + log.Error("更新角色数据失败:%s", err) | ||
| 195 | + return nil, protocol.NewErrWithMessage("1") | ||
| 196 | + } | ||
| 186 | r := &protocol.ResponseRoleInfo{ | 197 | r := &protocol.ResponseRoleInfo{ |
| 187 | ID: roleinfo.Id, | 198 | ID: roleinfo.Id, |
| 188 | Name: roleinfo.Name, | 199 | Name: roleinfo.Name, |
-
请 注册 或 登录 后发表评论