...
|
...
|
@@ -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
|
...
|
...
|
@@ -338,8 +340,10 @@ func TemplateList(uid, companyId int64, request *protocol.TemplateListRequest) ( |
|
|
// log.Error(err.Error())
|
|
|
// return
|
|
|
//}
|
|
|
if e := json.Unmarshal([]byte(temp.VisibleObject), &vObj); e != nil {
|
|
|
log.Error("%v %v %v", temp.Id, temp.VisibleObject, e.Error())
|
|
|
if len(temp.VisibleObject) > 0 {
|
|
|
if e := json.Unmarshal([]byte(temp.VisibleObject), &vObj); e != nil {
|
|
|
log.Error("%v %v %v", temp.Id, temp.VisibleObject, e.Error())
|
|
|
}
|
|
|
}
|
|
|
tempItem := &protocol.TemplateItem{
|
|
|
Id: temp.Id,
|
...
|
...
|
|