infish2018 1 неделя назад
Родитель
Сommit
d8acc3cf23
2 измененных файлов с 30 добавлено и 21 удалено
  1. 7 0
      sku3d/sku3d/api/a-service-img.go
  2. 23 21
      sku3d/sku3d/db/model/a-matimage.go

+ 7 - 0
sku3d/sku3d/api/a-service-img.go

@@ -40,12 +40,19 @@ func getSerialNum(img *model.MatImage, ctx *repo.RepoSession) (string, error) {
 	for _, s := range cat.Children {
 		for _, s1 := range s.Children {
 			setMap[s1.IdStr] = s1
+			for _, c := range s1.Children {
+				setMap[c.IdStr] = c
+			}
 		}
 	}
+
 	setParentMap := make(map[string]*model.Category, len(cat.Children)*20)
 	for _, s := range cat.Children {
 		for _, s1 := range s.Children {
 			setParentMap[s1.IdStr] = s
+			for _, c := range s1.Children {
+				setParentMap[c.IdStr] = s1
+			}
 		}
 	}
 

+ 23 - 21
sku3d/sku3d/db/model/a-matimage.go

@@ -42,24 +42,24 @@ type MatImage struct {
 	ProductImage *OssType           `bson:"productImage,omitempty" json:"productImage"`       // 商品图片
 	CreateTime   time.Time          `bson:"createTime,omitempty" json:"createTime,omitempty"` // 创建日期
 	// 商品信息
-	CusNum         string    `bson:"cusNum,omitempty" json:"cusNum,omitempty"`                 // 公司商品编号(格式:分类编号+产品系列+3位流水号+产品用途)
-	From           string    `bson:"from,omitempty" json:"from,omitempty"`                     // 来源(样品收集人)
-	TypeCategory   string    `bson:"typeCategory,omitempty" json:"typeCategory,omitempty"`     // 种类分类
-	TaxNameCN      string    `bson:"taxNameCn,omitempty" json:"taxNameCn,omitempty"`           // 报关商品中文名(必填)
-	DevTime        time.Time `bson:"devTime,omitempty" json:"devTime,omitempty"`               // 开发日期
-	Categories     []string  `bson:"categories,omitempty" json:"categories,omitempty"`         // 商品分类(如:革PVC、布坯类等)
-	BaseCloth      string    `bson:"baseCloth,omitempty" json:"baseCloth,omitempty"`           // 基布
-	SampleNumber   string    `bson:"sampleNumber,omitempty" json:"sampleNumber,omitempty"`     // 样品编号
-	NameCN         string    `bson:"nameCn,omitempty" json:"nameCn,omitempty"`                 // 商品中文名
-	ProductSeries  string    `bson:"productSeries,omitempty" json:"productSeries,omitempty"`   // 产品系列
-	SurfaceProcess string    `bson:"surfaceProcess,omitempty" json:"surfaceProcess,omitempty"` // 表面工艺
-	CatalogNumber  string    `bson:"catalogNumber,omitempty" json:"catalogNumber,omitempty"`   // 留样册号
-	NameEN         string    `bson:"nameEn,omitempty" json:"nameEn,omitempty"`                 // 商品英文名
-	ProductUsage   string    `bson:"productUsage,omitempty" json:"productUsage,omitempty"`     // 产品用途
-	MnemonicSign   string    `bson:"mnemonicSign,omitempty" json:"mnemonicSign,omitempty"`     // 报关助记符
-	UnitGroup      string    `bson:"unitGroup,omitempty" json:"unitGroup,omitempty"`           // 计量单位组
-	OriginalNumber string    `bson:"originalNumber,omitempty" json:"originalNumber,omitempty"` // 原命名编号
-	TaxGoodsNumber string    `bson:"taxGoodsNumber,omitempty" json:"taxGoodsNumber,omitempty"` // 报关商品编号
+	CusNum         string     `bson:"cusNum,omitempty" json:"cusNum,omitempty"`                 // 公司商品编号(格式:分类编号+产品系列+3位流水号+产品用途)
+	From           string     `bson:"from,omitempty" json:"from,omitempty"`                     // 来源(样品收集人)
+	TypeCategory   string     `bson:"typeCategory,omitempty" json:"typeCategory,omitempty"`     // 种类分类
+	TaxNameCN      string     `bson:"taxNameCn,omitempty" json:"taxNameCn,omitempty"`           // 报关商品中文名(必填)
+	DevTime        *time.Time `bson:"devTime,omitempty" json:"devTime,omitempty"`               // 开发日期
+	Categories     []string   `bson:"categories,omitempty" json:"categories,omitempty"`         // 商品分类(如:革PVC、布坯类等)
+	BaseCloth      string     `bson:"baseCloth,omitempty" json:"baseCloth,omitempty"`           // 基布
+	SampleNumber   string     `bson:"sampleNumber,omitempty" json:"sampleNumber,omitempty"`     // 样品编号
+	NameCN         string     `bson:"nameCn,omitempty" json:"nameCn,omitempty"`                 // 商品中文名
+	ProductSeries  string     `bson:"productSeries,omitempty" json:"productSeries,omitempty"`   // 产品系列
+	SurfaceProcess string     `bson:"surfaceProcess,omitempty" json:"surfaceProcess,omitempty"` // 表面工艺
+	CatalogNumber  string     `bson:"catalogNumber,omitempty" json:"catalogNumber,omitempty"`   // 留样册号
+	NameEN         string     `bson:"nameEn,omitempty" json:"nameEn,omitempty"`                 // 商品英文名
+	ProductUsage   string     `bson:"productUsage,omitempty" json:"productUsage,omitempty"`     // 产品用途
+	MnemonicSign   string     `bson:"mnemonicSign,omitempty" json:"mnemonicSign,omitempty"`     // 报关助记符
+	UnitGroup      string     `bson:"unitGroup,omitempty" json:"unitGroup,omitempty"`           // 计量单位组
+	OriginalNumber string     `bson:"originalNumber,omitempty" json:"originalNumber,omitempty"` // 原命名编号
+	TaxGoodsNumber string     `bson:"taxGoodsNumber,omitempty" json:"taxGoodsNumber,omitempty"` // 报关商品编号
 
 	// 商品厂家信息
 	SupplierID     string `bson:"supplierId,omitempty" json:"supplierId,omitempty"`         // 供应商编号
@@ -75,11 +75,13 @@ type MatImage struct {
 	OutsourcedProperty *bool `bson:"outsourcedProperty,omitempty" json:"outsourcedProperty,omitempty"` // 委外属性
 
 	// 体积重量
-	Thickness          *int     `bson:"thickness,omitempty" json:"thickness,omitempty"`                   // 厚度/高(单位:MM)
+	Thickness          *float64 `bson:"thickness,omitempty" json:"thickness,omitempty"`                   // 厚度/高(单位:MM)
 	PackageGrossWeight *float64 `bson:"packageGrossWeight,omitempty" json:"packageGrossWeight,omitempty"` // 单位包材毛重(单位:KG)
-	PhyWidth           *int     `bson:"phyWidth,omitempty" json:"phyWidth,omitempty"`                     // 物理尺寸宽度(门幅/宽,单位:MM)
+	PhyWidth           *float64 `bson:"phyWidth,omitempty" json:"phyWidth,omitempty"`                     // 物理尺寸宽度(门幅/宽,单位:MM)
 	ProductVolume      *float64 `bson:"productVolume,omitempty" json:"productVolume,omitempty"`           // 商品单位体积
-	PhyHeight          *int     `bson:"phyHeight,omitempty" json:"phyHeight,omitempty"`                   // 物理尺寸高度(长度,单位:MM)
+	PhyHeight          *float64 `bson:"phyHeight,omitempty" json:"phyHeight,omitempty"`                   // 物理尺寸高度(长度,单位:MM)
+	OriginWidth        *float64 `bson:"originWidth,omitempty" json:"originWidth,omitempty"`               // 门幅/宽(长度,单位:MM)
+	OriginHeight       *float64 `bson:"originHeight,omitempty" json:"originHeight,omitempty"`             // 门幅/长(长度,单位:MM)
 	SurfaceWeight      *float64 `bson:"surfaceWeight,omitempty" json:"surfaceWeight,omitempty"`           // 面布克重
 	ProductWeight      *float64 `bson:"productWeight,omitempty" json:"productWeight,omitempty"`           // 产品克重(单位:KG)
 	BackingWeight      *float64 `bson:"backingWeight,omitempty" json:"backingWeight,omitempty"`           // 底布克重(单位:KG)