添加字段,库存报表统计返回结果添加productType(产品类别)、productSpecs(产品规格),产品类别由原来的productType改为productCategory
| | |
| | | ReadTimeout: 5 * time.Second, |
| | | WriteTimeout: 5 * time.Second, |
| | | } |
| | | logx.Infof("server start success! \n\n\t- Local: \thttp://localhost:%v/\n\t- Network: \thttp://%v:%v/\n", |
| | | conf.WebConf.Port, conf.WebConf.Host, conf.WebConf.Port) |
| | | go shutdown(server) |
| | | //启动grpc客户端 |
| | | //go controllers.InitInventoryOrderServiceConn() |
| | |
| | | Unit string `json:"unit"` //单位 |
| | | KeyWord string `json:"keyWord"` //搜索条件 |
| | | BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` //基础作业类型 |
| | | WarehouseId string `json:"warehouseId"` // 仓库ID |
| | | WarehouseCode string `json:"warehouseCode"` |
| | | } |
| | | |
| | |
| | | ProduceId string `json:"produceId"` //产品id |
| | | ProductName string `json:"productName"` //产品名称 |
| | | ProductType string `json:"productType"` //产品类型 |
| | | ProductCategory string `json:"productCategory"` //产品类别 |
| | | ProductSpecs string `json:"productSpecs"` //产品规格 |
| | | Cost decimal.Decimal `json:"cost"` //成本 |
| | | Value decimal.Decimal `json:"value"` //总价值 |
| | | Amount decimal.Decimal `json:"amount"` //在库数量 |
| | |
| | | data.Cost = material.Cost |
| | | data.Unit = material.Unit |
| | | data.Value = material.Amount.Mul(material.Cost) |
| | | data.ProductType = material.CategoryName |
| | | data.ProductCategory = material.CategoryName |
| | | data.ProductType = material.Type |
| | | data.ProductSpecs = material.Specs |
| | | for _, amount := range productAmounts { |
| | | if material.ID == amount.ProductId { |
| | | data.Amount = data.Amount.Add(amount.Amount) |