| | |
| | | "CostingMethodAverageCost" |
| | | ] |
| | | }, |
| | | "constvar.FileType": { |
| | | "type": "string", |
| | | "enum": [ |
| | | "file", |
| | | "picture", |
| | | "thumbnail" |
| | | ], |
| | | "x-enum-comments": { |
| | | "FileType_File": "文件", |
| | | "FileType_Picture": "图片", |
| | | "FileType_Thumbnail": "缩略图" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "FileType_File", |
| | | "FileType_Picture", |
| | | "FileType_Thumbnail" |
| | | ] |
| | | }, |
| | | "constvar.ForceRemovalStrategy": { |
| | | "type": "integer", |
| | | "enum": [ |
| | |
| | | "ReservationNever" |
| | | ] |
| | | }, |
| | | "models.Attachment": { |
| | | "type": "object", |
| | | "properties": { |
| | | "FileUrl": { |
| | | "type": "string" |
| | | }, |
| | | "ext": { |
| | | "type": "string" |
| | | }, |
| | | "fileName": { |
| | | "type": "string" |
| | | }, |
| | | "fileType": { |
| | | "$ref": "#/definitions/constvar.FileType" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "models.Company": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "attachmentIDs": { |
| | | "type": "array", |
| | | "items": { |
| | | "type": "integer" |
| | | } |
| | | }, |
| | | "attachmentList": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Attachment" |
| | | } |
| | | }, |
| | | "barcode": { |
| | | "description": "条码", |
| | | "type": "string" |
| | |
| | | "CostingMethodAverageCost" |
| | | ] |
| | | }, |
| | | "constvar.FileType": { |
| | | "type": "string", |
| | | "enum": [ |
| | | "file", |
| | | "picture", |
| | | "thumbnail" |
| | | ], |
| | | "x-enum-comments": { |
| | | "FileType_File": "文件", |
| | | "FileType_Picture": "图片", |
| | | "FileType_Thumbnail": "缩略图" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "FileType_File", |
| | | "FileType_Picture", |
| | | "FileType_Thumbnail" |
| | | ] |
| | | }, |
| | | "constvar.ForceRemovalStrategy": { |
| | | "type": "integer", |
| | | "enum": [ |
| | |
| | | "ReservationNever" |
| | | ] |
| | | }, |
| | | "models.Attachment": { |
| | | "type": "object", |
| | | "properties": { |
| | | "FileUrl": { |
| | | "type": "string" |
| | | }, |
| | | "ext": { |
| | | "type": "string" |
| | | }, |
| | | "fileName": { |
| | | "type": "string" |
| | | }, |
| | | "fileType": { |
| | | "$ref": "#/definitions/constvar.FileType" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "models.Company": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "description": "数量", |
| | | "type": "number" |
| | | }, |
| | | "attachmentIDs": { |
| | | "type": "array", |
| | | "items": { |
| | | "type": "integer" |
| | | } |
| | | }, |
| | | "attachmentList": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Attachment" |
| | | } |
| | | }, |
| | | "barcode": { |
| | | "description": "条码", |
| | | "type": "string" |
| | |
| | | - CostingMethodStandardPrice |
| | | - CostingMethodFIFO |
| | | - CostingMethodAverageCost |
| | | constvar.FileType: |
| | | enum: |
| | | - file |
| | | - picture |
| | | - thumbnail |
| | | type: string |
| | | x-enum-comments: |
| | | FileType_File: 文件 |
| | | FileType_Picture: 图片 |
| | | FileType_Thumbnail: 缩略图 |
| | | x-enum-varnames: |
| | | - FileType_File |
| | | - FileType_Picture |
| | | - FileType_Thumbnail |
| | | constvar.ForceRemovalStrategy: |
| | | enum: |
| | | - 1 |
| | |
| | | - WhetherTypeAsk |
| | | - WhetherTypeAlways |
| | | - ReservationNever |
| | | models.Attachment: |
| | | properties: |
| | | FileUrl: |
| | | type: string |
| | | ext: |
| | | type: string |
| | | fileName: |
| | | type: string |
| | | fileType: |
| | | $ref: '#/definitions/constvar.FileType' |
| | | id: |
| | | type: integer |
| | | type: object |
| | | models.Company: |
| | | properties: |
| | | createTime: |
| | |
| | | amount: |
| | | description: 数量 |
| | | type: number |
| | | attachmentIDs: |
| | | items: |
| | | type: integer |
| | | type: array |
| | | attachmentList: |
| | | items: |
| | | $ref: '#/definitions/models.Attachment' |
| | | type: array |
| | | barcode: |
| | | description: 条码 |
| | | type: string |
| | |
| | | db = slf.build() |
| | | ) |
| | | |
| | | if err := db.Count(&total).Error; err != nil { |
| | | if err := db.Model(&Material{}).Count(&total).Error; err != nil { |
| | | return records, total, fmt.Errorf("find count err: %v", err) |
| | | } |
| | | if slf.PageNum*slf.PageSize > 0 { |
| | |
| | | b = sz.Y |
| | | } |
| | | |
| | | thumbnailImg = canvas.(*image.YCbCr).SubImage(image.Rect(l, t, r, b)).(*image.YCbCr) |
| | | if ycbcr, ok := canvas.(*image.YCbCr); ok { |
| | | thumbnailImg = ycbcr.SubImage(image.Rect(l, t, r, b)).(*image.YCbCr) |
| | | } else if rgba, ok := canvas.(*image.RGBA); ok { |
| | | thumbnailImg = rgba.SubImage(image.Rect(l, t, r, b)).(*image.RGBA) |
| | | } else { |
| | | return nil, errors.New("未识别的图片色彩类型") |
| | | } |
| | | } else { |
| | | w := width |
| | | h := height |