Merge branch 'test' of http://gitlab.fjmaimaimai.com/mmm-go/oppmg into test
正在显示
1 个修改的文件
包含
5 行增加
和
1 行删除
| @@ -75,7 +75,7 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs | @@ -75,7 +75,7 @@ func TemplateAdd(uid, companyId int64, request *protocol.TemplateAddRequest) (rs | ||
| 75 | CompanyId: int(companyId), | 75 | CompanyId: int(companyId), |
| 76 | AuditTemplateId: int(templateId), | 76 | AuditTemplateId: int(templateId), |
| 77 | Section: input.SectionType, | 77 | Section: input.SectionType, |
| 78 | - SortNum: input.Sort, | 78 | + SortNum: i, |
| 79 | Label: input.Label, | 79 | Label: input.Label, |
| 80 | InputType: input.InputType, | 80 | InputType: input.InputType, |
| 81 | Required: int8(input.Required), | 81 | Required: int8(input.Required), |
| @@ -207,6 +207,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques | @@ -207,6 +207,7 @@ func TemplateUpdate(uid, companyId int64, request *protocol.TemplateUpdateReques | ||
| 207 | } | 207 | } |
| 208 | for i := range request.Template.InputList { | 208 | for i := range request.Template.InputList { |
| 209 | input := request.Template.InputList[i] | 209 | input := request.Template.InputList[i] |
| 210 | + input.Sort = i | ||
| 210 | if err = insertOrUpdateInput(orm, companyId, int(template.Id), input); err != nil { | 211 | if err = insertOrUpdateInput(orm, companyId, int(template.Id), input); err != nil { |
| 211 | log.Error(err.Error()) | 212 | log.Error(err.Error()) |
| 212 | orm.Rollback() | 213 | orm.Rollback() |
| @@ -291,6 +292,7 @@ func insertOrUpdateInput(orm orm2.Ormer, companyId int64, templateId int, input | @@ -291,6 +292,7 @@ func insertOrUpdateInput(orm orm2.Ormer, companyId int64, templateId int, input | ||
| 291 | "Label": input.Label, | 292 | "Label": input.Label, |
| 292 | "InputType": input.InputType, | 293 | "InputType": input.InputType, |
| 293 | "Required": int8(input.Required), | 294 | "Required": int8(input.Required), |
| 295 | + "SortNum": input.Sort, | ||
| 294 | } | 296 | } |
| 295 | if err = utils.UpdateTableByMapWithOrmer(orm, auditForm, updateMap); err != nil { | 297 | if err = utils.UpdateTableByMapWithOrmer(orm, auditForm, updateMap); err != nil { |
| 296 | return | 298 | return |
| @@ -338,9 +340,11 @@ func TemplateList(uid, companyId int64, request *protocol.TemplateListRequest) ( | @@ -338,9 +340,11 @@ func TemplateList(uid, companyId int64, request *protocol.TemplateListRequest) ( | ||
| 338 | // log.Error(err.Error()) | 340 | // log.Error(err.Error()) |
| 339 | // return | 341 | // return |
| 340 | //} | 342 | //} |
| 343 | + if len(temp.VisibleObject) > 0 { | ||
| 341 | if e := json.Unmarshal([]byte(temp.VisibleObject), &vObj); e != nil { | 344 | if e := json.Unmarshal([]byte(temp.VisibleObject), &vObj); e != nil { |
| 342 | log.Error("%v %v %v", temp.Id, temp.VisibleObject, e.Error()) | 345 | log.Error("%v %v %v", temp.Id, temp.VisibleObject, e.Error()) |
| 343 | } | 346 | } |
| 347 | + } | ||
| 344 | tempItem := &protocol.TemplateItem{ | 348 | tempItem := &protocol.TemplateItem{ |
| 345 | Id: temp.Id, | 349 | Id: temp.Id, |
| 346 | Name: temp.Name, | 350 | Name: temp.Name, |
-
请 注册 或 登录 后发表评论