...
|
...
|
@@ -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)
|
...
|
...
|
|