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