作者 唐旭辉

提交

package controllers
import "oppmg/protocol"
type AuditController struct {
BaseController
}
//AuditList 机会管理列表
//@router /v1/audit/list [post]
func (this *AuditController) AuditList() {
var msg *protocol.ResponseMessage
defer func() {
this.ResposeJson(msg)
}()
// var request *protocol.ConfigScoreRequest
// if err := json.Unmarshal(this.Ctx.Input.RequestBody, &request); err != nil {
// log.Error("json 解析失败", err)
// msg = protocol.BadRequestParam("1")
// return
// }
// uid := this.GetUserId()
// companyId := this.GetCompanyId()
msg = protocol.NewReturnResponse(nil, nil)
return
}
... ...
... ... @@ -225,3 +225,21 @@ type CategoryEditSortRequest struct {
}
type CategoryEditSortResponse struct {
}
//RequestAuditList 机会管理-获取机会列表
type RequestAuditList struct {
RequestPageInfo
}
type ResponseAuditList struct {
Id int64 `json:"id"` //机会的id
ChanceType1 string `json:"chance_type_1"` //一级分类
ChanceType2 string `json:"chance_type_2"` //二级分类
UserName string `json:"user_name"` // 提交人
Department string `json:"department"` //提交部门
CreateTime int64 `json:"create_time"` //提交时间
PublishStatus int `json:"publish_status"` //公开状态
PublishStatusName string `json:"publish_status_name"` //
ReviewStatus int `json:"review_status"` //审批状态
ReviewStatusName string `json:"review_status_name"`
}
... ...
... ... @@ -20,7 +20,7 @@ var errmessge ErrorMap = map[string]string{
//职位相关
"10011": "该职位已被使用无法删除",
"10012": "超过10级的职位限制,请重新选择",
"10013": "职位已存在",
"10013": "同一级职位名称不允许重复",
"10014": "职位名称最多10个字符",
//安全认证相关
"10020": "验证码过期",
... ... @@ -46,6 +46,7 @@ var errmessge ErrorMap = map[string]string{
"10039": "用户已存在",
"10071": "不能删除主管理员",
"10072": "不能禁用主管理员",
"10073": "角色组已存在",
//部门相关
"10041": "无效的主管设置",
"10042": "上级部门不能选择当前部门及其子部门",
... ...
... ... @@ -98,6 +98,9 @@ func init() {
beego.NSRouter("/score", &controllers.ConfigController{}, "post:ConfigScore"),
beego.NSRouter("/score/get", &controllers.ConfigController{}, "post:GetConfigScore"),
),
beego.NSNamespace("/audit",
beego.NSRouter("/list", &controllers.AuditController{}, "post:AuditList"),
),
)
nsAuth := beego.NewNamespace("/auth",
... ...
package audit
func GetAuditList() error {
/*
SELECT user_id,department_id,audit_template_id,chance_type_id,publish_status,create_at
,review_status,enable_status,discovery_score,comment_total
FROM chance
*/
return nil
}
... ...
... ... @@ -141,6 +141,10 @@ func PositionEdit(param protocol.RequestPositionEdit) (*protocol.ResponsePositio
}
//更新部门关系数据
if positionUpdate.ParentId != param.ParentID {
ok := models.ExistPositiontName(param.CompanyID, param.ParentID, param.Name)
if ok {
return nil, protocol.NewErrWithMessage("10013")
}
err = positionRelationUpdate(positionUpdate, parentPosition)
if err != nil {
e := fmt.Errorf("positionRelationUpdate err:%s", err)
... ...
... ... @@ -181,8 +181,19 @@ func RoleGroupEdit(companyid int64, id int64, name string) (*protocol.ResponseRo
log.Error("不是角色组")
return nil, protocol.NewErrWithMessage("1")
}
if roleinfo.Name != name {
ok := models.ExistRoleName(companyid, name, models.ROLETYPES_GROUP)
if ok {
return nil, protocol.NewErrWithMessage("10073")
}
roleinfo.Name = name
}
roleinfo.Name = name
models.UpdateRoleById(roleinfo, []string{"Name"})
err = models.UpdateRoleById(roleinfo, []string{"Name"})
if err != nil {
log.Error("更新角色数据失败:%s", err)
return nil, protocol.NewErrWithMessage("1")
}
r := &protocol.ResponseRoleInfo{
ID: roleinfo.Id,
Name: roleinfo.Name,
... ...