月度统计出入库按类型汇总报表定时任务和手动跑任务接口
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/doWarehouseMonthStats": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "手动跑月度统计库存报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.DoWarehouseMonthStats" |
| | | } |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.MonthStats" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/downloadHistory": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | "报表" |
| | | ], |
| | | "summary": "月度统计库存报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetMonthStats" |
| | | } |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.MonthStats" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/warehouseMonthStats": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "仓库月度统计库存报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Operation" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "type": "string", |
| | | "description": "仓库id", |
| | | "name": "warehouseId", |
| | | "name": "warehouseIds", |
| | | "in": "query" |
| | | } |
| | | ], |
| | |
| | | "BaseOperationTypeAdjust" |
| | | ] |
| | | }, |
| | | "constvar.BoolType": { |
| | | "type": "integer", |
| | | "enum": [ |
| | | 1, |
| | | 2 |
| | | ], |
| | | "x-enum-comments": { |
| | | "BoolTypeFalse": "false", |
| | | "BoolTypeTrue": "true" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "BoolTypeTrue", |
| | | "BoolTypeFalse" |
| | | ] |
| | | }, |
| | | "constvar.CostingMethod": { |
| | | "type": "integer", |
| | | "enum": [ |
| | |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3 |
| | | 3, |
| | | 4 |
| | | ], |
| | | "x-enum-comments": { |
| | | "StockoutType": "出库类型", |
| | | "StorageType": "入库类型", |
| | | "TakeStock": "盘点类型", |
| | | "TransferType": "调拨类型" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "TransferType", |
| | | "StorageType", |
| | | "StockoutType" |
| | | "StockoutType", |
| | | "TransferType", |
| | | "TakeStock" |
| | | ] |
| | | }, |
| | | "constvar.OperationSource": { |
| | |
| | | "updateTime": { |
| | | "type": "string" |
| | | }, |
| | | "warehouse": { |
| | | "$ref": "#/definitions/models.Warehouse" |
| | | }, |
| | | "warehouseId": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "type": "number" |
| | | }, |
| | | "createTime": { |
| | | "type": "string" |
| | | }, |
| | | "dealerType": { |
| | | "description": "出入库类型", |
| | | "type": "string" |
| | | }, |
| | | "fromLocation": { |
| | |
| | | "description": "仓库名称", |
| | | "type": "string" |
| | | }, |
| | | "openMonthStats": { |
| | | "description": "是否开启月度统计", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.BoolType" |
| | | } |
| | | ] |
| | | }, |
| | | "outboundTransportation": { |
| | | "description": "出库运输", |
| | | "type": "integer" |
| | |
| | | } |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "inventoryDealerType": { |
| | | "type": "integer" |
| | | }, |
| | | "locationId": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.DoWarehouseMonthStats": { |
| | | "type": "object", |
| | | "properties": { |
| | | "token": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.EditMiniDict": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | }, |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "preload": { |
| | | "type": "boolean" |
| | | }, |
| | | "warehouseID": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "inventoryDealerType": { |
| | | "type": "integer" |
| | | }, |
| | | "locationId": { |
| | | "description": "源位置id", |
| | | "type": "integer" |
| | |
| | | "description": "目标位置id", |
| | | "type": "integer" |
| | | }, |
| | | "warehouseId": { |
| | | "description": "仓库id", |
| | | "type": "integer" |
| | | }, |
| | | "waybillNumber": { |
| | | "description": "运单号", |
| | | "type": "string" |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/doWarehouseMonthStats": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "手动跑月度统计库存报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.DoWarehouseMonthStats" |
| | | } |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.MonthStats" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/downloadHistory": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | "报表" |
| | | ], |
| | | "summary": "月度统计库存报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetMonthStats" |
| | | } |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.MonthStats" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-wms/v1/forms/warehouseMonthStats": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "报表" |
| | | ], |
| | | "summary": "仓库月度统计库存报表", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Operation" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "type": "string", |
| | | "description": "仓库id", |
| | | "name": "warehouseId", |
| | | "name": "warehouseIds", |
| | | "in": "query" |
| | | } |
| | | ], |
| | |
| | | "BaseOperationTypeAdjust" |
| | | ] |
| | | }, |
| | | "constvar.BoolType": { |
| | | "type": "integer", |
| | | "enum": [ |
| | | 1, |
| | | 2 |
| | | ], |
| | | "x-enum-comments": { |
| | | "BoolTypeFalse": "false", |
| | | "BoolTypeTrue": "true" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "BoolTypeTrue", |
| | | "BoolTypeFalse" |
| | | ] |
| | | }, |
| | | "constvar.CostingMethod": { |
| | | "type": "integer", |
| | | "enum": [ |
| | |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3 |
| | | 3, |
| | | 4 |
| | | ], |
| | | "x-enum-comments": { |
| | | "StockoutType": "出库类型", |
| | | "StorageType": "入库类型", |
| | | "TakeStock": "盘点类型", |
| | | "TransferType": "调拨类型" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "TransferType", |
| | | "StorageType", |
| | | "StockoutType" |
| | | "StockoutType", |
| | | "TransferType", |
| | | "TakeStock" |
| | | ] |
| | | }, |
| | | "constvar.OperationSource": { |
| | |
| | | "updateTime": { |
| | | "type": "string" |
| | | }, |
| | | "warehouse": { |
| | | "$ref": "#/definitions/models.Warehouse" |
| | | }, |
| | | "warehouseId": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "type": "number" |
| | | }, |
| | | "createTime": { |
| | | "type": "string" |
| | | }, |
| | | "dealerType": { |
| | | "description": "出入库类型", |
| | | "type": "string" |
| | | }, |
| | | "fromLocation": { |
| | |
| | | "description": "仓库名称", |
| | | "type": "string" |
| | | }, |
| | | "openMonthStats": { |
| | | "description": "是否开启月度统计", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.BoolType" |
| | | } |
| | | ] |
| | | }, |
| | | "outboundTransportation": { |
| | | "description": "出库运输", |
| | | "type": "integer" |
| | |
| | | } |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "inventoryDealerType": { |
| | | "type": "integer" |
| | | }, |
| | | "locationId": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.DoWarehouseMonthStats": { |
| | | "type": "object", |
| | | "properties": { |
| | | "token": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.EditMiniDict": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | }, |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | }, |
| | | "preload": { |
| | | "type": "boolean" |
| | | }, |
| | | "warehouseID": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "inventoryDealerType": { |
| | | "type": "integer" |
| | | }, |
| | | "locationId": { |
| | | "description": "源位置id", |
| | | "type": "integer" |
| | |
| | | "description": "目标位置id", |
| | | "type": "integer" |
| | | }, |
| | | "warehouseId": { |
| | | "description": "仓库id", |
| | | "type": "integer" |
| | | }, |
| | | "waybillNumber": { |
| | | "description": "运单号", |
| | | "type": "string" |
| | |
| | | - BaseOperationTypeInternal |
| | | - BaseOperationTypeDisuse |
| | | - BaseOperationTypeAdjust |
| | | constvar.BoolType: |
| | | enum: |
| | | - 1 |
| | | - 2 |
| | | type: integer |
| | | x-enum-comments: |
| | | BoolTypeFalse: "false" |
| | | BoolTypeTrue: "true" |
| | | x-enum-varnames: |
| | | - BoolTypeTrue |
| | | - BoolTypeFalse |
| | | constvar.CostingMethod: |
| | | enum: |
| | | - 1 |
| | |
| | | - 1 |
| | | - 2 |
| | | - 3 |
| | | - 4 |
| | | type: integer |
| | | x-enum-comments: |
| | | StockoutType: 出库类型 |
| | | StorageType: 入库类型 |
| | | TakeStock: 盘点类型 |
| | | TransferType: 调拨类型 |
| | | x-enum-varnames: |
| | | - TransferType |
| | | - StorageType |
| | | - StockoutType |
| | | - TransferType |
| | | - TakeStock |
| | | constvar.OperationSource: |
| | | enum: |
| | | - 1 |
| | |
| | | type: integer |
| | | updateTime: |
| | | type: string |
| | | warehouse: |
| | | $ref: '#/definitions/models.Warehouse' |
| | | warehouseId: |
| | | type: integer |
| | | waybillNumber: |
| | |
| | | description: 成本单价 |
| | | type: number |
| | | createTime: |
| | | type: string |
| | | dealerType: |
| | | description: 出入库类型 |
| | | type: string |
| | | fromLocation: |
| | | allOf: |
| | |
| | | name: |
| | | description: 仓库名称 |
| | | type: string |
| | | openMonthStats: |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.BoolType' |
| | | description: 是否开启月度统计 |
| | | outboundTransportation: |
| | | description: 出库运输 |
| | | type: integer |
| | |
| | | $ref: '#/definitions/request.OperationDetails' |
| | | type: array |
| | | id: |
| | | type: integer |
| | | inventoryDealerType: |
| | | type: integer |
| | | locationId: |
| | | description: 源位置id |
| | |
| | | token: |
| | | type: string |
| | | type: object |
| | | request.DoWarehouseMonthStats: |
| | | properties: |
| | | token: |
| | | type: string |
| | | type: object |
| | | request.EditMiniDict: |
| | | properties: |
| | | id: |
| | |
| | | type: integer |
| | | pageSize: |
| | | description: 每页大小 |
| | | type: integer |
| | | preload: |
| | | type: boolean |
| | | warehouseID: |
| | | type: integer |
| | | type: object |
| | | request.GetProductList: |
| | |
| | | type: array |
| | | id: |
| | | type: integer |
| | | inventoryDealerType: |
| | | type: integer |
| | | locationId: |
| | | description: 源位置id |
| | | type: integer |
| | |
| | | description: 状态 |
| | | toLocationId: |
| | | description: 目标位置id |
| | | type: integer |
| | | warehouseId: |
| | | description: 仓库id |
| | | type: integer |
| | | waybillNumber: |
| | | description: 运单号 |
| | |
| | | summary: 手动跑月度统计库存报表 |
| | | tags: |
| | | - 报表 |
| | | /api-wms/v1/forms/doWarehouseMonthStats: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.DoWarehouseMonthStats' |
| | | - description: token |
| | | in: header |
| | | name: Authorization |
| | | required: true |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.ResponseList' |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/models.MonthStats' |
| | | type: array |
| | | type: object |
| | | summary: 手动跑月度统计库存报表 |
| | | tags: |
| | | - 报表 |
| | | /api-wms/v1/forms/downloadHistory: |
| | | post: |
| | | parameters: |
| | |
| | | type: array |
| | | type: object |
| | | summary: 月度统计库存报表 |
| | | tags: |
| | | - 报表 |
| | | /api-wms/v1/forms/warehouseMonthStats: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.GetMonthStats' |
| | | - description: token |
| | | in: header |
| | | name: Authorization |
| | | required: true |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.ResponseList' |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/models.MonthStats' |
| | | type: array |
| | | type: object |
| | | summary: 仓库月度统计库存报表 |
| | | tags: |
| | | - 报表 |
| | | /api-wms/v1/location/addLocation: |
| | |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.Response' |
| | | allOf: |
| | | - $ref: '#/definitions/util.ResponseList' |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/models.Operation' |
| | | type: array |
| | | type: object |
| | | summary: 入库/出库列表 |
| | | tags: |
| | | - 入库/出库 |
| | |
| | | type: integer |
| | | - description: 仓库id |
| | | in: query |
| | | name: warehouseId |
| | | type: integer |
| | | name: warehouseIds |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
New file |
| | |
| | | package task |
| | | |
| | | import ( |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | "time" |
| | | "wms/constvar" |
| | | "wms/models" |
| | | "wms/pkg/logx" |
| | | "wms/service" |
| | | ) |
| | | |
| | | func WarehouseMonthStats() (err error) { |
| | | //加锁,只需要一个进程运行此任务 |
| | | var ( |
| | | lockName = "WarehouseMonthStats" |
| | | serviceID = "wms" |
| | | ) |
| | | err = models.NewLockSearch().AcquireLock(lockName, serviceID) |
| | | if err != nil { |
| | | logx.Errorf("WarehouseMonthStats AcquireLock err:%v", err) |
| | | return |
| | | } |
| | | defer func() { |
| | | if err != nil { |
| | | service.SendAlarm("月度统计执行失败", "报错: "+err.Error()) |
| | | } |
| | | err = models.NewLockSearch().ReleaseLock(lockName, serviceID) |
| | | if err != nil { |
| | | logx.Errorf("WarehouseMonthStats ReleaseLock err:%v", err) |
| | | service.SendAlarm("月度统计执行成功解锁失败", err.Error()) |
| | | } |
| | | }() |
| | | |
| | | date := time.Now().Format("2006-01") |
| | | lastDate := time.Now().AddDate(0, -1, 0).Format("2006-01") |
| | | |
| | | warehouses, err := models.NewWarehouseSearch().SetOpenMonthStats(constvar.BoolTypeTrue).FindNotTotal() |
| | | if len(warehouses) == 0 { |
| | | return |
| | | } |
| | | |
| | | for _, warehouse := range warehouses { |
| | | warehouseId := warehouse.Id |
| | | oldRecords, err := models.NewWarehouseMonthStatsSearch(). |
| | | SetDate(lastDate).SetWarehouseId(warehouseId).SetFields("id, product_id").FindNotTotal() |
| | | if err != nil { |
| | | logx.Errorf("WarehouseMonthStats get last date record err:%v", err) |
| | | continue |
| | | } |
| | | oldRecordsMap := models.WarehouseMonthStatsMap(oldRecords) |
| | | |
| | | //本月期初数量/上月结余数量 |
| | | statsRecords, err := service.GetCurrentWarehouseStats(date, warehouseId, nil) |
| | | if err != nil { |
| | | continue |
| | | } |
| | | |
| | | err = models.NewWarehouseMonthStatsSearch().SetDate(date).Delete() |
| | | if err != nil { |
| | | continue |
| | | } |
| | | |
| | | for _, record := range statsRecords { |
| | | record.BeginAmount = record.EndAmount |
| | | err = models.WithTransaction(func(db *gorm.DB) error { |
| | | err = models.NewWarehouseMonthStatsSearch().SetOrm(db).Create(record) |
| | | if err != nil { |
| | | logx.Errorf("NewWarehouseMonthStatsSearch Create err:%v, record: %+v", err, record) |
| | | service.SendAlarm("按仓库月度统计创建本月失败", fmt.Sprintf("NewWarehouseMonthStatsSearch Create err:%v, record: %+v", err, record)) |
| | | } |
| | | |
| | | if oldRecordsMap[record.ProductId] != nil && oldRecordsMap[record.ProductId].Id != 0 { |
| | | oldRecordsMap[record.ProductId].EndAmount = record.EndAmount |
| | | if !record.InputAmount.IsZero() || !record.InputAmount.IsZero() { |
| | | oldRecordsMap[record.ProductId].InputAmount = record.InputAmount |
| | | oldRecordsMap[record.ProductId].InputItems = record.InputItems |
| | | oldRecordsMap[record.ProductId].OutputAmount = record.OutputAmount |
| | | oldRecordsMap[record.ProductId].OutputItems = record.OutputItems |
| | | } |
| | | err = models.NewWarehouseMonthStatsSearch().SetOrm(db).SetID(oldRecordsMap[record.ProductId].Id).Save(record) |
| | | if err != nil { |
| | | logx.Errorf("NewWarehouseMonthStatsSearch Save err:%v, record:%v", err, oldRecordsMap[record.ProductId]) |
| | | service.SendAlarm("月度统计更改上月失败", fmt.Sprintf("NewWarehouseMonthStatsSearch Create err:%v, record: %+v", err, record)) |
| | | } |
| | | } |
| | | return nil |
| | | }) |
| | | } |
| | | } |
| | | if err == nil { |
| | | service.SendAlarm("按仓库月度统计执行成功", "") |
| | | } |
| | | |
| | | return |
| | | } |