...
|
...
|
@@ -75,7 +75,7 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs |
|
|
CompanyId: int(companyId),
|
|
|
AuditTemplateId: int(templateId),
|
|
|
Section: input.SectionType,
|
|
|
SortNum: input.Sort,
|
|
|
SortNum: i,
|
|
|
Label: input.Label,
|
|
|
InputType: input.InputType,
|
|
|
Required: int8(input.Required),
|
...
|
...
|
@@ -207,6 +207,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques |
|
|
}
|
|
|
for i := range request.Template.InputList {
|
|
|
input := request.Template.InputList[i]
|
|
|
input.Sort = i
|
|
|
if err = insertOrUpdateInput(orm, companyId, int(template.Id), input); err != nil {
|
|
|
log.Error(err.Error())
|
|
|
orm.Rollback()
|
...
|
...
|
@@ -291,6 +292,7 @@ func insertOrUpdateInput(orm orm2.Ormer, companyId int64, templateId int, input |
|
|
"Label": input.Label,
|
|
|
"InputType": input.InputType,
|
|
|
"Required": int8(input.Required),
|
|
|
"SortNum": input.Sort,
|
|
|
}
|
|
|
if err = utils.UpdateTableByMapWithOrmer(orm, auditForm, updateMap); err != nil {
|
|
|
return
|
...
|
...
|
|