| | |
| | | var fileUrl string |
| | | if operation.BaseOperationType == constvar.BaseOperationTypeIncoming { |
| | | if conf.WebConf.CompanyName == "jialian" { |
| | | fileUrl, err = JialianInputOperation(operation) |
| | | fileUrl, err = JialianOperation(constvar.FileTemplateCategory_JialianInput, operation) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | } else { |
| | | } else if conf.WebConf.CompanyName == "geruimi" { |
| | | fileUrl, err = ExportInputSelfmade(constvar.FileTemplateCategory_Selfmade, operation) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | |
| | | } |
| | | } |
| | | } else if operation.BaseOperationType == constvar.BaseOperationTypeOutgoing { |
| | | fileUrl, err = ExportOutputOperation(constvar.FileTemplateCategory_Output, operation) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | if conf.WebConf.CompanyName == "jialian" { |
| | | fileUrl, err = JialianOperation(constvar.FileTemplateCategory_JialianOutput, operation) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | } else if conf.WebConf.CompanyName == "geruimi" { |
| | | fileUrl, err = ExportInputSelfmade(constvar.FileTemplateCategory_Selfmade, operation) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | } |
| | | } else { |
| | | util.ResponseFormat(c, code.RequestParamError, "该记录不支持打印") |
| | |
| | | util.ResponseFormat(c, code.Success, fileUrl) |
| | | } |
| | | |
| | | func JialianInputOperation(operation *models.Operation) (string, error) { |
| | | template, err := models.NewFileTemplateAttachmentSearch().SetCategory(14).First() |
| | | func JialianOperation(category constvar.FileTemplateCategory, operation *models.Operation) (string, error) { |
| | | template, err := models.NewFileTemplateAttachmentSearch().SetCategory(category).First() |
| | | if err != nil { |
| | | return "", errors.New("获取模版记录失败:" + err.Error()) |
| | | } |