controllers/location_product_amount.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
controllers/operation.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
models/location_product_amount.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
models/operation.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
models/operation_details.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
request/operation.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
controllers/location_product_amount.go
@@ -207,6 +207,7 @@ // @Tags 库存盘点 // @Summary 添加库存盘点信息 // @Produce application/json // @Param Authorization header string true "token" // @Param object body request.UpdateLocationProductAmount true "入库/出库信息" // @Success 200 {object} util.Response "成功" // @Router /api-wms/v1/locationProductAmount/add [post] @@ -332,6 +333,7 @@ // @Tags 库存盘点 // @Summary 修改库存盘点信息 // @Produce application/json // @Param Authorization header string true "token" // @Param object body request.UpdateLocationProductAmount true "入库/出库信息" // @Success 200 {object} util.Response "成功" // @Router /api-wms/v1/locationProductAmount/update [post] @@ -370,12 +372,13 @@ // Finish // // @Tags 库存盘点 // @Tags 库存盘点 // @Summary 应用、验证 // @Produce application/json // @Param object body request.FinishLocationProductAmount true "入参" // @Param Authorization header string true "token" // @Param object body request.FinishLocationProductAmount true "入参" // @Success 200 {object} util.Response "成功" // @Router /api-wms/v1/locationProductAmount/finish [post] // @Router /api-wms/v1/locationProductAmount/finish [post] func (slf LocationProductAmountController) Finish(c *gin.Context) { var reqParams request.FinishLocationProductAmount if err := c.BindJSON(&reqParams); err != nil { controllers/operation.go
@@ -41,6 +41,7 @@ // @Tags 入库/出库 // @Summary 添加入库/出库 // @Produce application/json // @Param Authorization header string true "token" // @Param object body request.AddOperation true "入库/出库信息" // @Success 200 {object} util.Response "成功" // @Router /api-wms/v1/operation/operation [post] @@ -146,6 +147,7 @@ util.ResponseFormat(c, code.Success, "添加成功") } // CheckInventoryDealerType 检查基础类型,防止类型为空添加其它类型 func CheckInventoryDealerType(params *models.Operation) { var dictType constvar.MiniDictType dictName := "其他" @@ -331,6 +333,7 @@ // @Tags 入库/出库 // @Summary 入库/出库列表 // @Produce application/json // @Param Authorization header string true "token" // @Param object body request.OperationList true "查询参数" // @Success 200 {object} util.ResponseList{data=[]models.Operation} "成功" // @Router /api-wms/v1/operation/list [post] @@ -485,6 +488,7 @@ // @Tags 入库/出库 // @Summary 删除入库/出库信息 // @Produce application/json // @Param Authorization header string true "token" // @Param id path int true "id" // @Success 200 {object} util.Response "成功" // @Router /api-wms/v1/operation/operation/{id} [delete] @@ -532,9 +536,10 @@ // @Tags 入库/出库 // @Summary 更改记录状态 // @Produce application/json // @Param id path int true "id" // @Param Authorization header string true "token" // @Param id path int true "id" // @Success 200 {object} util.Response "成功" // @Router /api-wms/v1/operation/finish/{id} [put] // @Router /api-wms/v1/operation/finish/{id} [put] func (slf OperationController) Finish(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { @@ -585,25 +590,26 @@ return err } if operation.BaseOperationType == constvar.BaseOperationTypeIncoming { if operation.BaseOperationType == constvar.BaseOperationTypeIncoming { // 入库 if err := service.FinishOperationInput(c, tx, operation, listDetails, mapLocAmount); err != nil { return err } } if operation.BaseOperationType == constvar.BaseOperationTypeOutgoing || operation.BaseOperationType == constvar.BaseOperationTypeDisuse { if operation.BaseOperationType == constvar.BaseOperationTypeOutgoing || // 出库 operation.BaseOperationType == constvar.BaseOperationTypeDisuse { // 报废 if err := service.FinishOperationOutput(tx, listDetails, mapLocAmount, operation); err != nil { return err } } if operation.BaseOperationType == constvar.BaseOperationTypeInternal { if operation.BaseOperationType == constvar.BaseOperationTypeInternal { // 内部调拨 if err := service.FinishOperationInternal(tx, listDetails, operation); err != nil { return err } } if operation.BaseOperationType == constvar.BaseOperationTypeAdjust { if operation.BaseOperationType == constvar.BaseOperationTypeAdjust { // 库存盘点 if err := service.FinishOperationAdjust(tx, listDetails, mapLocAmount, operation); err != nil { return err } @@ -626,7 +632,6 @@ go UpdateOutStatus(operation.Source, operation.SourceNumber, 4) } } util.ResponseFormat(c, code.Success, "操作成功") } models/location_product_amount.go
@@ -9,11 +9,12 @@ ) type ( // LocationProductAmount 库存产品数量 LocationProductAmount struct { WmsModel Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` LocationId int `json:"locationId" gorm:"type:int;not null;comment:位置id"` //位置id WarehouseId int `json:"warehouseId" gorm:"type:int;not null;default:0;comment:仓库id"` LocationId int `json:"locationId" gorm:"type:int;not null;comment:位置id"` //位置id WarehouseId int `json:"warehouseId" gorm:"type:int;not null;default:0;comment:仓库id"` // 仓库id Location Location `json:"location" gorm:"foreignKey:LocationId;references:id"` ProductCategoryID int `json:"productCategoryId" gorm:"type:int;not null;comment:产品种类id"` //产品种类id ProductCategory ProductCategory `json:"productCategory" gorm:"foreignKey:ProductCategoryID;references:Id"` @@ -48,14 +49,14 @@ ProductName string `json:"productName" gorm:"column:product_name"` Amount decimal.Decimal `json:"amount" gorm:"column:amount"` AmountMoreUnits []UnitItems `json:"amountMoreUnits" gorm:"-"` //在库数量多单位 Unit string `json:"unit" gorm:"column:unit"` CreateDate string `json:"createDate" gorm:"column:create_date"` Unit string `json:"unit" gorm:"column:unit;size:50;comment:物品单位"` CreateDate string `json:"createDate" gorm:"column:create_date;size:50;comment:创建时间"` AdjustAmount decimal.Decimal `json:"adjustAmount" gorm:"column:adjust_amount"` //差值 DifferenceAmount decimal.Decimal `json:"differenceAmount" gorm:"-"` //计数数量 OperationId int `json:"operationId" gorm:"column:operation_id"` Status constvar.OperationStatus `json:"status" gorm:"status"` BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"base_operation_type"` Weight decimal.Decimal `gorm:"type:decimal(20,3);comment:重量" json:"weight"` //重量 OperationId int `json:"operationId" gorm:"column:operation_id;comment:库存操作记录"` Status constvar.OperationStatus `json:"status" gorm:";comment:操作状态(3就绪、4完成、5取消)"` // 操作状态 BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"base_operation_type;comment:基础作业类型"` // 基础作业类型 Weight decimal.Decimal `gorm:"type:decimal(20,3);comment:重量" json:"weight"` //重量 } ) models/operation.go
@@ -10,57 +10,60 @@ ) type ( // Operation 操作表 // Operation 库存操作表 Operation struct { WmsModel Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` Number string `json:"number" gorm:"type:varchar(255)"` //单号 SourceNumber string `json:"sourceNumber" gorm:"index;type:varchar(255)"` //源单号 OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"` //作业类型id OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);comment:作业类型名称"` //作业类型名称 Status constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:状态"` //状态 OperationDate string `json:"operationDate" gorm:"type:varchar(31);comment:安排日期"` ContacterID int `json:"contacterID" gorm:"type:int;comment:联系人ID"` ContacterName string `json:"contacterName" gorm:"type:varchar(63);comment:联系人姓名"` CompanyID string `json:"companyID" gorm:"type:varchar(255);comment:公司ID-客户"` CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:公司名称-客户"` Comment string `json:"comment" gorm:"type:text;comment:备注"` LogisticCompanyId string `json:"logisticCompanyId" gorm:"type:varchar(191);comment:物流公司id"` LogisticCompany LogisticCompany `json:"logisticCompany" gorm:"foreignKey:LogisticCompanyId"` WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:运单号"` //运单号 Weight decimal.Decimal `gorm:"type:decimal(20,2);comment:重量" json:"weight"` //重量 LogisticWeight decimal.Decimal `gorm:"type:decimal(20,2);comment:物流重量" json:"logisticWeight"` //物流重量 Source string `json:"source" gorm:"type:varchar(255);comment:来源系统,用于返回修改状态"` Number string `json:"number" gorm:"type:varchar(255);comment:单号"` //单号 SourceNumber string `json:"sourceNumber" gorm:"index;type:varchar(255);comment:源单号"` //源单号 OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"` //作业类型id OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);comment:作业类型名称"` //作业类型名称 Status constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:状态"` //状态 OperationDate string `json:"operationDate" gorm:"type:varchar(31);comment:安排日期"` // 安排日期 ContacterID int `json:"contacterID" gorm:"type:int;comment:联系人ID"` // 联系人ID ContacterName string `json:"contacterName" gorm:"type:varchar(63);comment:联系人姓名"` // 联系人姓名 CompanyID string `json:"companyID" gorm:"type:varchar(255);comment:公司ID-客户"` // 公司ID-客户 CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:公司名称-客户"` // 公司名称-客户 Comment string `json:"comment" gorm:"type:text;comment:备注"` // 备注 LogisticCompanyId string `json:"logisticCompanyId" gorm:"type:varchar(191);comment:物流公司id"` // 物流公司id LogisticCompany LogisticCompany `json:"logisticCompany" gorm:"foreignKey:LogisticCompanyId"` // 物流公司信息 WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:运单号"` //运单号 Weight decimal.Decimal `json:"weight" gorm:"type:decimal(20,2);comment:重量" ` //重量 LogisticWeight decimal.Decimal `json:"logisticWeight" gorm:"type:decimal(20,2);comment:物流重量" ` //物流重量 Source string `json:"source" gorm:"type:varchar(255);comment:来源系统,用于返回修改状态"` // 来源系统 OperationSource constvar.OperationSource `json:"operationSource" gorm:"type:tinyint(3);not null;default:0;comment:操作来源"` //操作来源 Details []*OperationDetails `json:"details" gorm:"foreignKey:OperationID;references:Id"` Details []*OperationDetails `json:"details" gorm:"foreignKey:OperationID;references:Id"` // 操作明细 BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:基础作业类型"` //基础作业类型 AuditDate string `json:"auditDate" gorm:"type:varchar(31);comment:审批时间"` ReceiverName string `json:"receiverName" gorm:"type:varchar(31);comment:收货人姓名"` ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:联系电话"` ReceiverAddr string `json:"receiverAddr" gorm:"type:varchar(255);comment:收货地址"` AuditDate string `json:"auditDate" gorm:"type:varchar(31);comment:审批时间"` // 审批时间 ReceiverName string `json:"receiverName" gorm:"type:varchar(31);comment:收货人姓名"` // 收货人姓名 ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:联系电话"` // 联系电话 ReceiverAddr string `json:"receiverAddr" gorm:"type:varchar(255);comment:收货地址"` // 收货地址 LocationID int `json:"locationID" gorm:"type:int;not null;comment:源位置id"` //源位置id Location Location `json:"location" gorm:"foreignkey:LocationID;references:Id"` //源位置 ToLocationID int `json:"toLocationId" gorm:"type:int;not null;comment:仓库位置id"` //目标位置id ToLocation Location `json:"toLocation" gorm:"foreignKey:ToLocationID;references:Id"` //目标位置 SalesDetailsNumber string `gorm:"type:varchar(191);comment:销售明细编码" json:"salesDetailsNumber"` LocationID int `json:"locationID" gorm:"type:int;not null;comment:源位置id"` //源位置id Location Location `json:"location" gorm:"foreignkey:LocationID;references:Id"` //源位置 ToLocationID int `json:"toLocationId" gorm:"type:int;not null;comment:仓库位置id"` //目标位置id ToLocation Location `json:"toLocation" gorm:"foreignKey:ToLocationID;references:Id"` //目标位置 SalesDetailsNumber string `json:"salesDetailsNumber" gorm:"type:varchar(191);comment:销售明细编码"` // 销售明细编码 ManagerId string `json:"managerId" gorm:"type:varchar(255);comment:主管id"` Manager string `json:"manager" gorm:"type:varchar(255);comment:主管名称"` AccountantId string `json:"accountantId" gorm:"type:varchar(255);comment:会计id"` Accountant string `json:"accountant" gorm:"type:varchar(255);comment:会计名称"` CustodianId string `json:"custodianId" gorm:"type:varchar(255);comment:保管员id"` Custodian string `json:"custodian" gorm:"type:varchar(255);comment:保管员名称"` CreatedBy string `json:"createBy" gorm:"type:varchar(255);comment:创建者UserId"` CheckedBy string `json:"checkedBy" gorm:"type:varchar(255);comment:验证者UserId"` Remark string `json:"remark"` ManagerId string `json:"managerId" gorm:"type:varchar(255);comment:主管id"` // 主管id Manager string `json:"manager" gorm:"type:varchar(255);comment:主管名称"` // 主管名称 AccountantId string `json:"accountantId" gorm:"type:varchar(255);comment:会计id"` // 会计id Accountant string `json:"accountant" gorm:"type:varchar(255);comment:会计名称"` // 会计名称 CustodianId string `json:"custodianId" gorm:"type:varchar(255);comment:保管员id"` // 保管员id Custodian string `json:"custodian" gorm:"type:varchar(255);comment:保管员名称"` // 保管员名称 CreatedBy string `json:"createBy" gorm:"type:varchar(255);comment:创建者UserId"` // 创建者UserId CheckedBy string `json:"checkedBy" gorm:"type:varchar(255);comment:验证者UserId"` // 验证者UserId Remark string `json:"remark"` // 备注 WarehouseId int `json:"warehouseId" gorm:"type:int;not null;default:0;comment:仓库id"` Warehouse Warehouse `json:"warehouse" gorm:"foreignKey:WarehouseId"` IsInternalOutput bool `json:"isInternalOutput"` //是否调拨产生的出库 DealerType string `json:"dealerType" gorm:"type:varchar(255);comment:调拨出入库类型"` WarehouseId int `json:"warehouseId" gorm:"type:int;not null;default:0;comment:仓库id"` // 仓库id Warehouse Warehouse `json:"warehouse" gorm:"foreignKey:WarehouseId"` // 仓库信息 IsInternalOutput bool `json:"isInternalOutput" gorm:"type:tinyint(1);comment:是否调拨产生的出库"` //是否调拨产生的出库 DealerType string `json:"dealerType" gorm:"type:varchar(255);comment:调拨出入库类型"` // 调拨出入库类型 // 嘉联仓储添加 SilkMarket SilkMarket string `json:"silkMarket" gorm:"type:varchar(255);comment:庄口"` // 庄口 } OperationSearch struct { models/operation_details.go
@@ -9,33 +9,36 @@ ) type ( // OperationDetails 操作明细表 // OperationDetails 库存操作明细表 OperationDetails struct { WmsModel Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` OperationID int `json:"operationId" gorm:"index;type:int;not null;comment:操作记录id"` //操作id OperationID int `json:"operationId" gorm:"index;type:int;not null;comment:操作记录id"` //操作记录id BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:基础作业类型"` //基础作业类型 ProductId string `json:"productId" gorm:"type:varchar(191);not null;comment:产品id"` //产品id //ProductName string `json:"productName" gorm:"type:varchar(255);not null;comment:产品名称"` //产品名称 Amount decimal.Decimal `json:"amount" gorm:"type:decimal(30,10);not null;comment:数量"` //数量 StockAmount decimal.Decimal `json:"stockAmount" gorm:"type:decimal(30,10);"` //库存数量,盘点时用 StockAmount decimal.Decimal `json:"stockAmount" gorm:"type:decimal(30,10);comment:库存数量"` //库存数量,盘点时用 //Unit string `json:"unit" gorm:"type:varchar(31);comment:单位"` //单位 Product Material `json:"product" gorm:"foreignKey:ProductId;references:ID"` Product Material `json:"product" gorm:"foreignKey:ProductId;references:ID"` // 物料信息 FromLocationID int `json:"fromLocationId" gorm:"type:int;not null;comment:源位置id"` //源位置id FromLocation Location `json:"fromLocation" gorm:"foreignKey:FromLocationID;references:Id"` //源位置 ToLocationID int `json:"toLocationId" gorm:"type:int;not null;comment:目标位置id"` //目标位置id ToLocation Location `json:"toLocation" gorm:"foreignKey:ToLocationID;references:Id"` //目标位置 TotalGrossWeight decimal.Decimal `json:"totalGrossWeight" gorm:"type:decimal(20,3);comment:总毛重"` TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:总净重"` AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:辅助数量"` AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:辅助单位"` Remark string `gorm:"type:varchar(1024);comment:备注" json:"remark"` IsInternalOutput bool `json:"isInternalOutput"` //是否调拨产生的出库 DealerType string `json:"dealerType"` //出入库类型 TotalGrossWeight decimal.Decimal `json:"totalGrossWeight" gorm:"type:decimal(20,3);comment:总毛重"` // 总毛重 TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:总净重"` // 总净重 AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:辅助数量"` // 辅助数量 AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:辅助单位"` // 辅助单位 Remark string `json:"remark" gorm:"type:varchar(1024);comment:备注"` // 备注 IsInternalOutput bool `json:"isInternalOutput" gorm:"type:tinyint(1);comment:是否调拨产生的出库"` //是否调拨产生的出库 DealerType string `json:"dealerType" gorm:"type:varchar(255);comment:出入库类型"` //出入库类型 Cost decimal.Decimal `json:"cost" ` //成本单价 SalePrice decimal.Decimal `json:"salePrice" ` //销售单价 Cost decimal.Decimal `json:"cost" gorm:"type:decimal(20,4);comment:成本单价"` //成本单价 SalePrice decimal.Decimal `json:"salePrice" gorm:"type:decimal(20,4);comment:销售单价"` //销售单价 // 嘉联仓储添加 SilkMarket、SilkMarketClose SilkMarket string `json:"silkMarket" gorm:"type:varchar(255);comment:庄口"` // 庄口 SilkMarketClose string `json:"silkMarketClose" gorm:"type:varchar(10);comment:庄口关闭"` // 庄口关闭 } OperationDetailsSearch struct { request/operation.go
@@ -6,114 +6,118 @@ ) type AddOperation struct { ID int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` Number string `json:"number" gorm:"column:number;type:varchar(255)"` //单号 SourceNumber string `json:"sourceNumber" gorm:"type:varchar(255)"` //源单号 OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"` //作业类型id OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);comment:作业类型名称"` //作业类型名称 Status constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:状态"` //状态 //FromLocationId int `json:"fromLocationId" gorm:"type:int;not null;comment:源位置id"` //源位置id //ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:目标位置id"` //目标位置id OperationDate string `json:"operationDate" gorm:"type:varchar(31);comment:安排日期"` //安排日期 Details []*OperationDetails `json:"details"` ContacterID int `json:"contacterID" gorm:"type:int;comment:联系人ID"` //联系人ID-非必填 ContacterName string `json:"contacterName" gorm:"type:varchar(63);comment:联系人姓名"` //联系人姓名-非必填 CompanyID string `json:"companyID"` //公司ID-客户 CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:公司名称"` //公司名称-客户名称 Comment string `json:"comment" gorm:"type:text;comment:备注"` //备注 LogisticCompanyId string `json:"logisticCompanyId" gorm:"type:varchar(191);comment:物流公司id"` WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:运单号"` //运单号 Weight decimal.Decimal `gorm:"type:decimal(20,2);comment:重量" json:"weight"` //重量 LogisticWeight decimal.Decimal `gorm:"type:decimal(20,2);comment:物流重量" json:"logisticWeight"` //物流重量 ReceiverName string `json:"receiverName" gorm:"type:varchar(31);comment:收货人姓名"` ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:联系电话"` ReceiverAddr string `json:"receiverAddr" gorm:"type:varchar(255);comment:收货地址"` LocationId int `json:"locationId" gorm:"type:int;not null;comment:源位置id"` //源位置id ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:仓库位置id"` //目标位置id ManagerId string `json:"managerId" gorm:"type:varchar(255);comment:主管id"` Manager string `json:"manager" gorm:"type:varchar(255);comment:主管名称"` AccountantId string `json:"accountantId" gorm:"type:varchar(255);comment:会计id"` Accountant string `json:"accountant" gorm:"type:varchar(255);comment:会计名称"` CustodianId string `json:"custodianId" gorm:"type:varchar(255);comment:保管员id"` Custodian string `json:"custodian" gorm:"type:varchar(255);comment:保管员名称"` BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:基础作业类型"` //基础作业类型 5库存盘点 WarehouseId int `json:"warehouseId" gorm:"type:int;not null;comment:仓库id"` //仓库id DealerType string `json:"dealerType" gorm:"type:varchar(255);comment:调拨出入库类型"` ID int `json:"id" ` Number string `json:"number" ` //单号 SourceNumber string `json:"sourceNumber" ` //源单号 OperationTypeId int `json:"operationTypeId" ` //作业类型id OperationTypeName string `json:"operationTypeName" ` //作业类型名称 Status constvar.OperationStatus `json:"status" ` //状态 //FromLocationId int `json:"fromLocationId" ` //源位置id //ToLocationId int `json:"toLocationId" ` //目标位置id OperationDate string `json:"operationDate" ` //安排日期 Details []*OperationDetails `json:"details"` // 详情 ContacterID int `json:"contacterID" ` //联系人ID-非必填 ContacterName string `json:"contacterName" ` //联系人姓名-非必填 CompanyID string `json:"companyID"` //公司ID-客户 CompanyName string `json:"companyName" ` //公司名称-客户名称 Comment string `json:"comment" ` //备注 LogisticCompanyId string `json:"logisticCompanyId" ` // 物流公司id WaybillNumber string `json:"waybillNumber" ` //运单号 Weight decimal.Decimal `json:"weight"` //重量 LogisticWeight decimal.Decimal `json:"logisticWeight"` //物流重量 ReceiverName string `json:"receiverName" ` // 收货人姓名 ReceiverPhone string `json:"receiverPhone" ` // 联系电话 ReceiverAddr string `json:"receiverAddr" ` // 收货地址 LocationId int `json:"locationId" ` //源位置id ToLocationId int `json:"toLocationId" ` //目标位置id ManagerId string `json:"managerId" ` // 主管id Manager string `json:"manager" ` // 主管名称 AccountantId string `json:"accountantId" ` // 会计id Accountant string `json:"accountant" ` // 会计名称 CustodianId string `json:"custodianId" ` // 保管员id Custodian string `json:"custodian" ` // 保管员名称 BaseOperationType constvar.BaseOperationType `json:"baseOperationType" ` //基础作业类型 1 入库 2 出库 3 内部调拨 4 报废 5 库存盘点 WarehouseId int `json:"warehouseId" ` //仓库id DealerType string `json:"dealerType" ` // 调拨出入库类型 SilkMarket string `json:"silkMarket"` // 庄口 } type OperationDetails struct { OperationId int `json:"OperationId" gorm:"type:int;not null;comment:操作记录id"` //操作id ProductId string `json:"productId" gorm:"type:varchar(191);not null;comment:产品id"` //产品id //ProductName string `json:"productName" gorm:"type:varchar(255);not null;comment:产品名称"` //产品名称 Amount decimal.Decimal `json:"amount" gorm:"type:decimal(20,2);not null;comment:数量"` //数量 StockAmount decimal.Decimal `json:"stockAmount" gorm:"type:decimal(30,10);"` //库存数量,盘点时用 //Unit string `json:"unit" gorm:"type:varchar(31);comment:单位"` //单位 //Product models.Material `json:"product" gorm:"foreignKey:ProductId;references:ID"` FromLocationId int `json:"fromLocationId" gorm:"type:int;not null;comment:源位置id"` //源位置id ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:目标位置id"` //目标位置id TotalGrossWeight decimal.Decimal `json:"totalGrossWeight" gorm:"type:decimal(20,3);comment:总毛重"` //总毛重 TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:总净重"` //总净重 AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:辅助数量"` //辅助数量 AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:辅助单位"` //辅助单位 Remark string `gorm:"type:varchar(1024);comment:备注" json:"remark"` OperationId int `json:"OperationId" ` //操作id ProductId string `json:"productId" ` //产品id //ProductName string `json:"productName" ` //产品名称 Amount decimal.Decimal `json:"amount" ` //数量 StockAmount decimal.Decimal `json:"stockAmount"` //库存数量,盘点时用 //Unit string `json:"unit"` //单位 //Product models.Material `json:"product" ` // 产品 FromLocationId int `json:"fromLocationId"` //源位置id ToLocationId int `json:"toLocationId"` //目标位置id TotalGrossWeight decimal.Decimal `json:"totalGrossWeight"` //总毛重 TotalNetWeight decimal.Decimal `json:"totalNetWeight"` //总净重 AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount"` //辅助数量 AuxiliaryUnit string `json:"auxiliaryUnit"` //辅助单位 Remark string `json:"remark"` // 备注 Cost decimal.Decimal `json:"cost"` //成本单价 SalePrice decimal.Decimal `json:"salePrice"` //销售单价 Cost decimal.Decimal `json:"cost"` //成本单价 SalePrice decimal.Decimal `json:"salePrice"` //销售单价 SilkMarket string `json:"silkMarket"` // 庄口 SilkMarketClose string `json:"silkMarketClose"` // 庄口关闭 } type OperationList struct { PageInfo OperationTypeId int `json:"operationTypeId" form:"operationTypeId"` BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` // 1 入库 2 出库 3 内部调拨 4 报废 5 库存盘点 Number string `json:"number"` Status constvar.OperationStatus `json:"status"` OperationTypeId int `json:"operationTypeId" form:"operationTypeId"` // 作业类型id BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` //基础作业类型 1 入库 2 出库 3 内部调拨 4 报废 5 库存盘点 Number string `json:"number"` // 单号 Status constvar.OperationStatus `json:"status"` // 状态 } type UpdateOperation struct { ID int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` Number string `json:"number" gorm:"column:number;type:varchar(255)"` //单号 SourceNumber string `json:"sourceNumber" gorm:"type:varchar(255)"` //源单号 OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"` //作业类型id OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);comment:作业类型名称"` //作业类型名称 Status constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:状态"` //状态 //FromLocationId int `json:"fromLocationId" gorm:"type:int;not null;comment:源位置id"` //源位置id //ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:目标位置id"` //目标位置id OperationDate string `json:"operationDate" gorm:"type:varchar(31);comment:安排日期"` //安排日期 Details []*OperationDetails `json:"details"` ContacterID int `json:"contacterID" gorm:"type:int;comment:联系人ID"` //联系人ID-非必填 ContacterName string `json:"contacterName" gorm:"type:varchar(63);comment:联系人姓名"` //联系人姓名-非必填 CompanyID string `json:"companyID"` //公司ID-客户 CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:公司名称"` //公司名称-客户名称 Comment string `json:"comment" gorm:"type:text;comment:备注"` //备注 BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` //基础作业类型 LogisticCompanyId string `json:"logisticCompanyId" gorm:"type:varchar(191);comment:物流公司id"` WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:运单号"` //运单号 Weight decimal.Decimal `gorm:"type:decimal(20,2);comment:重量" json:"weight"` //重量 LogisticWeight decimal.Decimal `gorm:"type:decimal(20,2);comment:物流重量" json:"logisticWeight"` //物流重量 ReceiverName string `json:"receiverName" gorm:"type:varchar(31);comment:收货人姓名"` ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:联系电话"` ReceiverAddr string `json:"receiverAddr" gorm:"type:varchar(255);comment:收货地址"` LocationId int `json:"locationId" gorm:"type:int;not null;comment:源位置id"` //源位置id ToLocationId int `json:"toLocationId" gorm:"type:int;not null;comment:仓库位置id"` //目标位置id ManagerId string `json:"managerId" gorm:"type:varchar(255);comment:主管id"` Manager string `json:"manager" gorm:"type:varchar(255);comment:主管名称"` AccountantId string `json:"accountantId" gorm:"type:varchar(255);comment:会计id"` Accountant string `json:"accountant" gorm:"type:varchar(255);comment:会计名称"` CustodianId string `json:"custodianId" gorm:"type:varchar(255);comment:保管员id"` Custodian string `json:"custodian" gorm:"type:varchar(255);comment:保管员名称"` WarehouseId int `json:"warehouseId" gorm:"type:int;not null;comment:仓库id"` //仓库id InventoryDealerType int `json:"inventoryDealerType" gorm:"type:varchar(255);comment:调拨出入库分类(对应dict字典表的ID)"` ID int `json:"id"` Number string `json:"number" ` //单号 SourceNumber string `json:"sourceNumber" ` //源单号 OperationTypeId int `json:"operationTypeId" ` //作业类型id OperationTypeName string `json:"operationTypeName" ` //作业类型名称 Status constvar.OperationStatus `json:"status" ` //状态 //FromLocationId int `json:"fromLocationId" ` //源位置id //ToLocationId int `json:"toLocationId" ` //目标位置id OperationDate string `json:"operationDate" ` //安排日期 Details []*OperationDetails `json:"details"` // 详情 ContacterID int `json:"contacterID" ` //联系人ID-非必填 ContacterName string `json:"contacterName"` //联系人姓名-非必填 CompanyID string `json:"companyID"` //公司ID-客户 CompanyName string `json:"companyName" ` //公司名称-客户名称 Comment string `json:"comment"` //备注 BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` //基础作业类型 LogisticCompanyId string `json:"logisticCompanyId" ` WaybillNumber string `json:"waybillNumber" ` //运单号 Weight decimal.Decimal `json:"weight"` //重量 LogisticWeight decimal.Decimal `json:"logisticWeight"` //物流重量 ReceiverName string `json:"receiverName" ` // 收货人姓名 ReceiverPhone string `json:"receiverPhone" ` // 联系电话 ReceiverAddr string `json:"receiverAddr" ` // 收货地址 LocationId int `json:"locationId" ` //源位置id ToLocationId int `json:"toLocationId" ` //目标位置id ManagerId string `json:"managerId" ` // 主管id Manager string `json:"manager" ` // 主管名称 AccountantId string `json:"accountantId" ` // 会计id Accountant string `json:"accountant" ` // 会计名称 CustodianId string `json:"custodianId" ` // 保管员id Custodian string `json:"custodian" ` // 保管员名称 WarehouseId int `json:"warehouseId" ` //仓库id InventoryDealerType int `json:"inventoryDealerType" ` // 调拨出入库分类(对应dict字典表的ID) SilkMarket string `json:"silkMarket"` // 庄口 } type OperationAllList struct { PageInfo Number string `json:"number"` SourceNumber string `json:"sourceNumber"` Number string `json:"number"` // 单号 SourceNumber string `json:"sourceNumber"` // 源单号 } type OperationCondition struct { PageInfo Condition string `json:"condition"` Condition string `json:"condition"` // 模糊查询条件 Keyword string `json:"keyword" form:"keyword"` //关键字搜索 WarehouseId int `json:"warehouseId" form:"warehouseId"` //仓库ID LocationId int `json:"locationId" form:"locationId"` //位置ID