| | |
| | | } |
| | | |
| | | var fileUrl string |
| | | companyName := conf.WebConf.CompanyName |
| | | if companyName == "" { |
| | | util.ResponseFormat(c, code.RequestParamError, "缺少工厂名称配置") |
| | | return |
| | | } |
| | | if operation.BaseOperationType == constvar.BaseOperationTypeIncoming { |
| | | if conf.WebConf.CompanyName == "jialian" { |
| | | if companyName == "jialian" { |
| | | fileUrl, err = JialianOperation(constvar.FileTemplateCategory_JialianInput, operation) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | } else if conf.WebConf.CompanyName == "geruimi" { |
| | | } else if 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 { |
| | | if conf.WebConf.CompanyName == "jialian" { |
| | | if 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" { |
| | | } else if companyName == "geruimi" { |
| | | fileUrl, err = ExportInputSelfmade(constvar.FileTemplateCategory_Selfmade, operation) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | |
| | | return |
| | | } |
| | | |
| | | util.ResponseFormat(c, code.Success, fileUrl) |
| | | m := make(map[string]string) |
| | | m["url"] = fileUrl |
| | | m["name"] = companyName |
| | | util.ResponseFormat(c, code.Success, m) |
| | | } |
| | | |
| | | func JialianOperation(category constvar.FileTemplateCategory, operation *models.Operation) (string, error) { |