diff --git a/meta/me/ProductFamily.meta.go b/meta/me/ProductFamily.meta.go index a155e06..65a1846 100644 --- a/meta/me/ProductFamily.meta.go +++ b/meta/me/ProductFamily.meta.go @@ -18,6 +18,7 @@ import ( ******************************************************************************/ var ProductFamily_PlantNr = grmi.NewField("PlantNr", "[ME_ProductFamily].PlantNr", "plantnr", grmi.TypeInt) var ProductFamily_ProductFamilyId = grmi.NewField("ProductFamilyId", "[ME_ProductFamily].ProductFamilyId", "productfamilyid", grmi.TypeString) +var ProductFamily_SerialOrderSnr = grmi.NewField("SerialOrderSnr", "[ME_ProductFamily].SerialOrderSnr", "serialordersnr", grmi.TypeString) var ProductFamily_Descr = grmi.NewField("Descr", "[ME_ProductFamily].Descr", "descr", grmi.TypeString) var ProductFamily_ProjectId = grmi.NewField("ProjectId", "[ME_ProductFamily].ProjectId", "projectid", grmi.TypeString) var ProductFamily_ConfigValue = grmi.NewField("ConfigValue", "[ME_ProductFamily].ConfigValue", "configvalue", grmi.TypeString) @@ -56,6 +57,7 @@ var ProductFamily = grmi.NewEntity( map[string]grmi.Field{ ProductFamily_PlantNr.Name: ProductFamily_PlantNr, ProductFamily_ProductFamilyId.Name: ProductFamily_ProductFamilyId, + ProductFamily_SerialOrderSnr.Name: ProductFamily_SerialOrderSnr, ProductFamily_Descr.Name: ProductFamily_Descr, ProductFamily_ProjectId.Name: ProductFamily_ProjectId, ProductFamily_ConfigValue.Name: ProductFamily_ConfigValue, @@ -80,4 +82,4 @@ var ProductFamily = grmi.NewEntity( ProductFamily_CreateTime.Name: ProductFamily_CreateTime, }, []string{"PlantNr"}, - []string{"Descr", "ProjectId", "ConfigValue", "ModelValue", "ColorValue", "BroadcastPoint", "AutoGenPackToggle", "MultiWorkLineToggle", "Jph", "WorkLineId", "PackTypeId", "CheckSyncKey", "Enable", "CtrlPara1", "CtrlPara2", "CtrlStr1", "CtrlStr2", "CtrlTime1", "CtrlTime2", "LastUser"}) + []string{"Descr", "ProjectId", "SerialOrderSnr", "ConfigValue", "ModelValue", "ColorValue", "BroadcastPoint", "AutoGenPackToggle", "MultiWorkLineToggle", "Jph", "WorkLineId", "PackTypeId", "CheckSyncKey", "Enable", "CtrlPara1", "CtrlPara2", "CtrlStr1", "CtrlStr2", "CtrlTime1", "CtrlTime2", "LastUser"}) diff --git a/models/me/ProductFamily.model.go b/models/me/ProductFamily.model.go index 550e0aa..aad1e17 100644 --- a/models/me/ProductFamily.model.go +++ b/models/me/ProductFamily.model.go @@ -20,35 +20,36 @@ import ( * ******************************************************************************/ type ProductFamily struct { - PlantNr int `xorm:"pk int 'PlantNr'" json:"ME_ProductFamily-PlantNr"` - ProductFamilyId string `xorm:"pk nvarchar(40) 'ProductFamilyId'" json:"ME_ProductFamily-ProductFamilyId"` - Descr string `xorm:"nvarchar(40) 'Descr' not null" json:"ME_ProductFamily-Descr"` - ProjectId string `xorm:"nvarchar(40) 'ProjectId' not null" json:"ME_ProductFamily-ProjectId"` - ConfigValue string `xorm:"nvarchar(40) 'ConfigValue' not null" json:"ME_ProductFamily-ConfigValue"` - ModelValue string `xorm:"nvarchar(40) 'ModelValue' not null" json:"ME_ProductFamily-ModelValue"` - ColorValue string `xorm:"nvarchar(40) 'ColorValue' not null" json:"ME_ProductFamily-ColorValue"` - BroadcastPoint string `xorm:"nvarchar(40) 'BroadcastPoint' not null" json:"ME_ProductFamily-BroadcastPoint"` - AutoGenPackToggle bool `xorm:"bit 'AutoGenPackToggle' not null" json:"ME_ProductFamily-AutoGenPackToggle"` - MultiWorkLineToggle bool `xorm:"bit 'MultiWorkLineToggle' not null" json:"ME_ProductFamily-MultiWorkLineToggle"` - Jph float64 `xorm:"float 'Jph' not null" json:"ME_ProductFamily-Jph"` - WorkLineId string `xorm:"nvarchar(40) 'WorkLineId' not null" json:"ME_ProductFamily-WorkLineId"` - PackTypeId string `xorm:"nvarchar(40) 'PackTypeId' not null" json:"ME_ProductFamily-PackTypeId"` - CheckSyncKey bool `xorm:"bit 'CheckSyncKey' not null" json:"ME_ProductFamily-CheckSyncKey"` - Enable bool `xorm:"bit 'Enable' not null" json:"ME_ProductFamily-Enable"` + PlantNr int `xorm:"pk int 'PlantNr'" json:"ME_ProductFamily-PlantNr"` + ProductFamilyId string `xorm:"pk nvarchar(40) 'ProductFamilyId'" json:"ME_ProductFamily-ProductFamilyId"` + SerialOrderSnr string `xorm:"nvarchar(40) 'SerialOrderSnr' not null" json:"ME_ProductFamily-SerialOrderSnr"` + Descr string `xorm:"nvarchar(40) 'Descr' not null" json:"ME_ProductFamily-Descr"` + ProjectId string `xorm:"nvarchar(40) 'ProjectId' not null" json:"ME_ProductFamily-ProjectId"` + ConfigValue string `xorm:"nvarchar(40) 'ConfigValue' not null" json:"ME_ProductFamily-ConfigValue"` + ModelValue string `xorm:"nvarchar(40) 'ModelValue' not null" json:"ME_ProductFamily-ModelValue"` + ColorValue string `xorm:"nvarchar(40) 'ColorValue' not null" json:"ME_ProductFamily-ColorValue"` + BroadcastPoint string `xorm:"nvarchar(40) 'BroadcastPoint' not null" json:"ME_ProductFamily-BroadcastPoint"` + AutoGenPackToggle bool `xorm:"bit 'AutoGenPackToggle' not null" json:"ME_ProductFamily-AutoGenPackToggle"` + MultiWorkLineToggle bool `xorm:"bit 'MultiWorkLineToggle' not null" json:"ME_ProductFamily-MultiWorkLineToggle"` + Jph float64 `xorm:"float 'Jph' not null" json:"ME_ProductFamily-Jph"` + WorkLineId string `xorm:"nvarchar(40) 'WorkLineId' not null" json:"ME_ProductFamily-WorkLineId"` + PackTypeId string `xorm:"nvarchar(40) 'PackTypeId' not null" json:"ME_ProductFamily-PackTypeId"` + CheckSyncKey bool `xorm:"bit 'CheckSyncKey' not null" json:"ME_ProductFamily-CheckSyncKey"` + Enable bool `xorm:"bit 'Enable' not null" json:"ME_ProductFamily-Enable"` // 代表派生是樱泰的还是安道拓的 - CtrlPara1 int `xorm:"int 'CtrlPara1' not null" json:"ME_ProductFamily-CtrlPara1"` - CtrlPara2 int `xorm:"int 'CtrlPara2' not null" json:"ME_ProductFamily-CtrlPara2"` - CtrlStr1 string `xorm:"nvarchar(255) 'CtrlStr1' not null" json:"ME_ProductFamily-CtrlStr1"` - CtrlStr2 string `xorm:"nvarchar(255) 'CtrlStr2' not null" json:"ME_ProductFamily-CtrlStr2"` - CtrlTime1 grmi.DateTime `xorm:"datetime 'CtrlTime1' not null" json:"ME_ProductFamily-CtrlTime1"` - CtrlTime2 grmi.DateTime `xorm:"datetime 'CtrlTime2' not null" json:"ME_ProductFamily-CtrlTime2"` - LastModify grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"ME_ProductFamily-LastModify"` - LastUser string `xorm:"nvarchar(20) 'LastUser' not null" json:"ME_ProductFamily-LastUser"` - CreateTime grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"ME_ProductFamily-CreateTime"` - Product []Product `xorm:"-" json:"ME_ProductFamily-Product"` - Relate []ProductFamilyRelate `xorm:"-" json:"-"` - Project Project `xorm:"-" json:"-"` - Count int `xorm:"-" json:"ME_ProductFamily-Count"` + CtrlPara1 int `xorm:"int 'CtrlPara1' not null" json:"ME_ProductFamily-CtrlPara1"` + CtrlPara2 int `xorm:"int 'CtrlPara2' not null" json:"ME_ProductFamily-CtrlPara2"` + CtrlStr1 string `xorm:"nvarchar(255) 'CtrlStr1' not null" json:"ME_ProductFamily-CtrlStr1"` + CtrlStr2 string `xorm:"nvarchar(255) 'CtrlStr2' not null" json:"ME_ProductFamily-CtrlStr2"` + CtrlTime1 grmi.DateTime `xorm:"datetime 'CtrlTime1' not null" json:"ME_ProductFamily-CtrlTime1"` + CtrlTime2 grmi.DateTime `xorm:"datetime 'CtrlTime2' not null" json:"ME_ProductFamily-CtrlTime2"` + LastModify grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"ME_ProductFamily-LastModify"` + LastUser string `xorm:"nvarchar(20) 'LastUser' not null" json:"ME_ProductFamily-LastUser"` + CreateTime grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"ME_ProductFamily-CreateTime"` + Product []Product `xorm:"-" json:"ME_ProductFamily-Product"` + Relate []ProductFamilyRelate `xorm:"-" json:"-"` + Project Project `xorm:"-" json:"-"` + Count int `xorm:"-" json:"ME_ProductFamily-Count"` } /****************************************************************************** diff --git a/services/pln/implments/CustOrderLogic.service.impl.go b/services/pln/implments/CustOrderLogic.service.impl.go index 4b2f41b..f0cd486 100644 --- a/services/pln/implments/CustOrderLogic.service.impl.go +++ b/services/pln/implments/CustOrderLogic.service.impl.go @@ -339,6 +339,7 @@ func (impl *CustOrderServiceImplement) ReleaseCustOrder(user *global.User, custO custOrderStatusRecDao := dal.NewCustOrderStatusHistoryDAO(session, user.PlantNr, user.UserId) snrDao := baseDal.NewSnrDAO(session, user.PlantNr, user.UserId) workLineDao := baseDal.NewWorkLineDAO(session, user.PlantNr, user.UserId) + productFamilyDao := meDal.NewProductFamilyDAO(session, user.PlantNr, user.UserId) productFamilyRelateDao := meDal.NewProductFamilyRelateDAO(session, user.PlantNr, user.UserId) productWorkLineDao := meDal.NewProductWorkLineLstDAO(session, user.PlantNr, user.UserId) labelHeadDao := baseDal.NewLabelHeadDAO(session, user.PlantNr, user.UserId) @@ -369,6 +370,13 @@ func (impl *CustOrderServiceImplement) ReleaseCustOrder(user *global.User, custO if project == nil { return grmi.NewBusinessError("车型项目不存在, 车型项目ID:" + custOrderData.ProjectId) } + productFamily, err := productFamilyDao.SelectOne(custOrderData.ProductFamilyId) + if err != nil { + return grmi.NewBusinessError("查询派生数据失败, 错误:" + err.Error()) + } + if productFamily == nil { + return grmi.NewBusinessError("派生不存在") + } // 每个总成生产的时间 duration := custOrderData.PlanEndTime.Restore().Sub(custOrderData.PlanStartTime.Restore()) totalQty := custOrderData.PlanQty * len(productLi) @@ -727,7 +735,7 @@ func (impl *CustOrderServiceImplement) ReleaseCustOrder(user *global.User, custO if err = session.Begin(); err != nil { return grmi.NewBusinessError("开启事务失败, 错误:" + err.Error()) } - serialNumber, err := snrDao.GetNextSnrWithTime(project.SerialOrderSnr, waitReleaseSerialOrderLi[0].PlanStartTime.Restore()) + serialNumber, err := snrDao.GetNextSnrWithTime(productFamily.SerialOrderSnr, waitReleaseSerialOrderLi[0].PlanStartTime.Restore()) if err != nil { _ = session.Rollback() return grmi.NewBusinessError("生成工单流水号失败, error:" + err.Error())