作者 yangfu

Merge remote-tracking branch 'origin/test' into dev

... ... @@ -80,6 +80,7 @@ var errmessge ErrorMap = map[string]string{
"10276": "最多选择1个角色",
"10277": "最多一个小数",
"10278": "公告标题大于30个字符",
"10279": "该子分类名称已存在",
"10170": "请选择指定成员",
"10171": "请选择审批人类别",
... ...
... ... @@ -35,7 +35,7 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs
return
}
if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name); err == nil {
err = protocol.NewErrWithMessage("10271")
err = protocol.NewErrWithMessage("10279")
return
}
orm := orm2.NewOrm()
... ... @@ -111,6 +111,8 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs
flowConfig.ToRole = jsonAssertMarsh(getIdsFrom(config.ToRole))
flowConfig.ToUser = jsonAssertMarsh(getIdsFrom(config.ToUser))
flowConfig.ActionType = config.AcitonType
//flowConfig.FlowType = config.ProcessType
//flowConfig.AuditFlowType = config.ApproveType
flowConfig.CreateAt = time.Now()
flowConfig.AuditGroupId = int64(config.GroupId)
flowConfig.ConfigData = jsonAssertMarsh(config)
... ... @@ -162,7 +164,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques
}
if template.Name != request.Template.Name {
if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name); err == nil {
err = protocol.NewErrWithMessage("10271")
err = protocol.NewErrWithMessage("10279")
return
}
}
... ... @@ -220,7 +222,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques
for i := range request.AuditFlowConfig.ProcessConfig {
config := request.AuditFlowConfig.ProcessConfig[i]
flowConfig := &models.AuditFlowConfig{
AuditFlowType: config.ProcessType,
//AuditFlowType: config.ApproveType,
}
if config.ProcessType == models.FlowTypeNormal {
flowConfig.Level = normalLevel
... ... @@ -233,6 +235,8 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques
flowConfig.ToRole = jsonAssertMarsh(getIdsFrom(config.ToRole))
flowConfig.ToUser = jsonAssertMarsh(getIdsFrom(config.ToUser))
flowConfig.ActionType = config.AcitonType
flowConfig.FlowType = config.ProcessType
flowConfig.AuditFlowType = config.ApproveType
flowConfig.CreateAt = time.Now()
flowConfig.AuditGroupId = int64(config.GroupId)
flowConfig.ConfigData = jsonAssertMarsh(config)
... ...
... ... @@ -338,7 +338,11 @@ func UpdateBulletin(companyId int64, request *protocol.UpdateBulletinRequest) (r
bulletin.QuestionSwitch = int8(request.QuestionSwitch)
//bulletin.AllowCondition = int8(request.AllowCondition)
bulletin.AllowClose = int8(request.AllowClose)
bulletin.AllPeople = request.AllPeo
bulletin.UpdateAt = time.Now()
if request.IsPublish == 1 && bulletin.Status == protocol.BulletinUnRelease {
bulletin.Status = protocol.BulletinRelease
}
if err = models.UpdateBulletinById(bulletin); err != nil {
log.Error(err.Error())
return
... ...