作者 yangfu

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

@@ -80,6 +80,7 @@ var errmessge ErrorMap = map[string]string{ @@ -80,6 +80,7 @@ var errmessge ErrorMap = map[string]string{
80 "10276": "最多选择1个角色", 80 "10276": "最多选择1个角色",
81 "10277": "最多一个小数", 81 "10277": "最多一个小数",
82 "10278": "公告标题大于30个字符", 82 "10278": "公告标题大于30个字符",
  83 + "10279": "该子分类名称已存在",
83 84
84 "10170": "请选择指定成员", 85 "10170": "请选择指定成员",
85 "10171": "请选择审批人类别", 86 "10171": "请选择审批人类别",
@@ -35,7 +35,7 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs @@ -35,7 +35,7 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs
35 return 35 return
36 } 36 }
37 if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name); err == nil { 37 if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name); err == nil {
38 - err = protocol.NewErrWithMessage("10271") 38 + err = protocol.NewErrWithMessage("10279")
39 return 39 return
40 } 40 }
41 orm := orm2.NewOrm() 41 orm := orm2.NewOrm()
@@ -111,6 +111,8 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs @@ -111,6 +111,8 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs
111 flowConfig.ToRole = jsonAssertMarsh(getIdsFrom(config.ToRole)) 111 flowConfig.ToRole = jsonAssertMarsh(getIdsFrom(config.ToRole))
112 flowConfig.ToUser = jsonAssertMarsh(getIdsFrom(config.ToUser)) 112 flowConfig.ToUser = jsonAssertMarsh(getIdsFrom(config.ToUser))
113 flowConfig.ActionType = config.AcitonType 113 flowConfig.ActionType = config.AcitonType
  114 + //flowConfig.FlowType = config.ProcessType
  115 + //flowConfig.AuditFlowType = config.ApproveType
114 flowConfig.CreateAt = time.Now() 116 flowConfig.CreateAt = time.Now()
115 flowConfig.AuditGroupId = int64(config.GroupId) 117 flowConfig.AuditGroupId = int64(config.GroupId)
116 flowConfig.ConfigData = jsonAssertMarsh(config) 118 flowConfig.ConfigData = jsonAssertMarsh(config)
@@ -162,7 +164,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques @@ -162,7 +164,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques
162 } 164 }
163 if template.Name != request.Template.Name { 165 if template.Name != request.Template.Name {
164 if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name); err == nil { 166 if _, err = models.GetAuditTemplateByName(companyId, request.Template.Name); err == nil {
165 - err = protocol.NewErrWithMessage("10271") 167 + err = protocol.NewErrWithMessage("10279")
166 return 168 return
167 } 169 }
168 } 170 }
@@ -220,7 +222,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques @@ -220,7 +222,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques
220 for i := range request.AuditFlowConfig.ProcessConfig { 222 for i := range request.AuditFlowConfig.ProcessConfig {
221 config := request.AuditFlowConfig.ProcessConfig[i] 223 config := request.AuditFlowConfig.ProcessConfig[i]
222 flowConfig := &models.AuditFlowConfig{ 224 flowConfig := &models.AuditFlowConfig{
223 - AuditFlowType: config.ProcessType, 225 + //AuditFlowType: config.ApproveType,
224 } 226 }
225 if config.ProcessType == models.FlowTypeNormal { 227 if config.ProcessType == models.FlowTypeNormal {
226 flowConfig.Level = normalLevel 228 flowConfig.Level = normalLevel
@@ -233,6 +235,8 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques @@ -233,6 +235,8 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques
233 flowConfig.ToRole = jsonAssertMarsh(getIdsFrom(config.ToRole)) 235 flowConfig.ToRole = jsonAssertMarsh(getIdsFrom(config.ToRole))
234 flowConfig.ToUser = jsonAssertMarsh(getIdsFrom(config.ToUser)) 236 flowConfig.ToUser = jsonAssertMarsh(getIdsFrom(config.ToUser))
235 flowConfig.ActionType = config.AcitonType 237 flowConfig.ActionType = config.AcitonType
  238 + flowConfig.FlowType = config.ProcessType
  239 + flowConfig.AuditFlowType = config.ApproveType
236 flowConfig.CreateAt = time.Now() 240 flowConfig.CreateAt = time.Now()
237 flowConfig.AuditGroupId = int64(config.GroupId) 241 flowConfig.AuditGroupId = int64(config.GroupId)
238 flowConfig.ConfigData = jsonAssertMarsh(config) 242 flowConfig.ConfigData = jsonAssertMarsh(config)
@@ -338,7 +338,11 @@ func UpdateBulletin(companyId int64, request *protocol.UpdateBulletinRequest) (r @@ -338,7 +338,11 @@ func UpdateBulletin(companyId int64, request *protocol.UpdateBulletinRequest) (r
338 bulletin.QuestionSwitch = int8(request.QuestionSwitch) 338 bulletin.QuestionSwitch = int8(request.QuestionSwitch)
339 //bulletin.AllowCondition = int8(request.AllowCondition) 339 //bulletin.AllowCondition = int8(request.AllowCondition)
340 bulletin.AllowClose = int8(request.AllowClose) 340 bulletin.AllowClose = int8(request.AllowClose)
  341 + bulletin.AllPeople = request.AllPeo
341 bulletin.UpdateAt = time.Now() 342 bulletin.UpdateAt = time.Now()
  343 + if request.IsPublish == 1 && bulletin.Status == protocol.BulletinUnRelease {
  344 + bulletin.Status = protocol.BulletinRelease
  345 + }
342 if err = models.UpdateBulletinById(bulletin); err != nil { 346 if err = models.UpdateBulletinById(bulletin); err != nil {
343 log.Error(err.Error()) 347 log.Error(err.Error())
344 return 348 return