houyaf преди 3 години
родител
ревизия
aa3acd529a

+ 1 - 2
datamodels/biz_object_attr.go

@@ -8,14 +8,13 @@ type BizObjectAttr struct {
     AttrId          int64     `json:"attrId"          xorm:"'attr_id'           bigint      pk comment('Attr ID')        "`
     AttrTitle       string    `json:"attrTitle"       xorm:"'attr_title'        varchar(127)   comment('AttrTitle')      "`
     AttrCode        string    `json:"attrCode"        xorm:"'attr_code'         varchar(127)   comment('AttrCode')       "`
+    MappingCode     string    `json:"mappingCode"     xorm:"'mapping_code'      varchar(127)   comment('AttrCode')       "`
     AttrType        int64     `json:"attrType"        xorm:"'attr_type'         bigint         comment('Type')           "`
     AttrLength      int64     `json:"attrLength"      xorm:"'attr_length'       bigint         comment('attrLength')     "`
     AttrDecimals    int64     `json:"attrDecimals"    xorm:"'attr_decimals'     bigint         comment('attrDecimals')   "`
     Comment         string    `json:"comment"         xorm:"'comment'           varchar(255)   comment('描述')           "`
-    AttrMappingCode string    `json:"attrMappingCode" xorm:"'attr_mapping_code' varchar(127)   comment('AttrMappingCode')"`
     IsNotNull       int64     `json:"isNotNull"       xorm:"'is_not_null'       int            comment('是否可修改')      "`
     SortNo          int64     `json:"sortNo"          xorm:"'sort_no'           int            comment('是否可修改')      "`
-    RuleId          int64     `json:"ruleId"          xorm:"'rule_id'           int            comment('Rule ID')        "`
     CreatedBy       int64     `json:"createdBy"       xorm:"'created_by'"`
     CreatedAt       time.Time `json:"createdAt"       xorm:"'created_at'"`
     UpdatedBy       int64     `json:"updatedBy"       xorm:"'updated_by'"`

+ 4 - 4
datamodels/biz_object_rule.go

@@ -1,10 +1,10 @@
 package datamodels
 
 type BizObjectRule struct {
-    BizId       int64     `json:"bizId"           xorm:"'biz_id'          bigint      pk comment('主键ID')      "`
-    ObjectId    int64     `json:"objectId"        xorm:"'object_id'       bigint      pk comment('主键ID')      "`
-    RuleId      int64     `json:"ruleId"          xorm:"'rule_id'         int            comment('Rule ID')    "`
-    SortNo      int64     `json:"sortNo"          xorm:"'sort_no'         int            comment('Sort No')    "`
+    BizId        int64     `json:"bizId"           xorm:"'biz_id'          bigint      pk comment('主键ID')        "`
+    ObjectId     int64     `json:"objectId"        xorm:"'object_id'       bigint      pk comment('主键ID')        "`
+    RuleId       int64     `json:"ruleId"          xorm:"'rule_id'         bigint         comment('Rule ID')      "`
+    TargetAttrId int64     `json:"targetAttrId"    xorm:"'target_attr_id'  bigint         comment('Target AttrId')"`
 }
 
 func (t *BizObjectRule) TableName() string {

+ 11 - 10
datamodels/model_object_attr.go

@@ -6,16 +6,17 @@ type ModelObjectAttr struct {
 	ModelId      int64     `json:"modelId"         xorm:"'model_id'         bigint      pk comment('主键ID')         "`
 	ObjectId     int64     `json:"objectId"        xorm:"'object_id'        bigint      pk comment('主键ID')         "`
 	AttrId       int64     `json:"attrId"          xorm:"'attr_id'          bigint      pk comment('主键ID')         "`
-	AttrTitle    string    `json:"attrTitle"       xorm:"'attr_title'      varchar(127)   comment('AttrTitle')       "`
-	AttrCode     string    `json:"attrCode"        xorm:"'attr_code'       varchar(127)   comment('AttrCode')        "`
-	AttrType     int64     `json:"attrType"        xorm:"'attr_type'       bigint         comment('Type')            "`
-	AttrLength   int64     `json:"attrLength"      xorm:"'attr_length'      bigint        comment('attrLength')      "`
-	AttrDecimals int64     `json:"attrDecimals"    xorm:"'attr_decimals'    bigint        comment('attrDecimals')    "`
-	Comment      string    `json:"comment"         xorm:"'comment'         varchar(255)   comment('描述')            "`
-	IsFixed      int64     `json:"isFixed"         xorm:"'is_fixed'        int            comment('是否可修改')       "`
-	IsNotNull    int64     `json:"isNotNull"       xorm:"'is_not_null'     int            comment('是否可修改')       "`
-	IsPKey       int64     `json:"isPKey"          xorm:"'is_pkey'         int            comment('是否可修改')       "`
-	SortNo       int64     `json:"sortNo"          xorm:"'sort_no'         int            comment('是否可修改')       "`
+	AttrTitle    string    `json:"attrTitle"       xorm:"'attr_title'       varchar(127)   comment('AttrTitle')      "`
+	AttrCode     string    `json:"attrCode"        xorm:"'attr_code'        varchar(127)   comment('AttrCode')       "`
+	MappingCode  string    `json:"mappingCode"     xorm:"'mapping_code'     varchar(127)   comment('AttrCode')       "`
+	AttrType     int64     `json:"attrType"        xorm:"'attr_type'        bigint         comment('Type')           "`
+	AttrLength   int64     `json:"attrLength"      xorm:"'attr_length'      bigint         comment('attrLength')     "`
+	AttrDecimals int64     `json:"attrDecimals"    xorm:"'attr_decimals'    bigint         comment('attrDecimals')   "`
+	Comment      string    `json:"comment"         xorm:"'comment'          varchar(255)   comment('描述')            "`
+	IsFixed      int64     `json:"isFixed"         xorm:"'is_fixed'         int            comment('是否可修改')       "`
+	IsNotNull    int64     `json:"isNotNull"       xorm:"'is_not_null'      int            comment('是否可修改')       "`
+	IsPKey       int64     `json:"isPKey"          xorm:"'is_pkey'          int            comment('是否可修改')       "`
+	SortNo       int64     `json:"sortNo"          xorm:"'sort_no'          int            comment('是否可修改')       "`
 	CreatedBy    int64     `json:"createdBy"       xorm:"'created_by'"`
 	CreatedAt    time.Time `json:"createdAt"       xorm:"'created_at'"`
 	UpdatedBy    int64     `json:"updatedBy"       xorm:"'updated_by'"`

+ 12 - 0
datamodels/model_object_rule.go

@@ -0,0 +1,12 @@
+package datamodels
+
+type ModelObjectRule struct {
+    ModelId       int64     `json:"modelId"         xorm:"'model_id'        bigint      pk comment('Model ID')      "`
+    ObjectId      int64     `json:"objectId"        xorm:"'object_id'       bigint      pk comment('主键ID')         "`
+    RuleId        int64     `json:"ruleId"          xorm:"'rule_id'         bigint         comment('Rule ID')       "`
+    TargetAttrId  int64     `json:"targetAttrId"    xorm:"'target_attr_id'  bigint         comment('Target Attr ID')"`
+}
+
+func (t *ModelObjectRule) TableName() string {
+    return "model_object_rule"
+}

+ 1 - 0
viewmodels/biz_object_attr_info.go

@@ -7,6 +7,7 @@ type BizObjectAttrInfo struct {
     AttrId          int64     `json:"attrId"          xorm:"'attr_id'           bigint      pk comment('Attr ID')        "`
     AttrTitle       string    `json:"attrTitle"       xorm:"'attr_title'        varchar(127)   comment('AttrTitle')      "`
     AttrCode        string    `json:"attrCode"        xorm:"'attr_code'         varchar(127)   comment('AttrCode')       "`
+    MappingCode     string    `json:"mappingCode"     xorm:"'mapping_code'      varchar(127)   comment('AttrCode')       "`
     AttrType        int64     `json:"attrType"        xorm:"'attr_type'         bigint         comment('Type')           "`
     AttrLength      int64     `json:"attrLength"      xorm:"'attr_length'       bigint         comment('attrLength')     "`
     AttrDecimals    int64     `json:"attrDecimals"    xorm:"'attr_decimals'     bigint         comment('attrDecimals')   "`

+ 14 - 13
viewmodels/model_object_attr_info.go

@@ -1,19 +1,20 @@
 package viewmodels
 
 type ModelObjectAttrInfo struct {
-	ModelId      int64  `json:"modelId"         xorm:"'model_id'         bigint      pk comment('主键ID')         "`
-	ObjectId     int64  `json:"objectId"        xorm:"'object_id'        bigint      pk comment('主键ID')         "`
-	AttrId       int64  `json:"attrId"          xorm:"'attr_id'          bigint      pk comment('主键ID')         "`
-	AttrTitle    string `json:"attrTitle"       xorm:"'attr_title'      varchar(127)   comment('AttrTitle')       "`
-	AttrCode     string `json:"attrCode"        xorm:"'attr_code'       varchar(127)   comment('AttrCode')        "`
-	AttrType     int64  `json:"attrType"        xorm:"'attr_type'       bigint         comment('Type')            "`
-	AttrLength   int64  `json:"attrLength"      xorm:"'attr_length'      bigint        comment('attrLength')      "`
-	AttrDecimals int64  `json:"attrDecimals"    xorm:"'attr_decimals'    bigint        comment('attrDecimals')    "`
-	Comment      string `json:"comment"         xorm:"'comment'         varchar(255)   comment('描述')            "`
-	IsFixed      int64  `json:"isFixed"         xorm:"'is_fixed'        int            comment('是否可修改')       "`
-	IsNotNull    int64  `json:"isNotNull"       xorm:"'is_not_null'     int            comment('是否可修改')       "`
-	IsPKey       int64  `json:"isPKey"          xorm:"'is_pkey'         int            comment('是否可修改')       "`
-	SortNo       int64  `json:"sortNo"          xorm:"'sort_no'         int            comment('是否可修改')       "`
+	ModelId      int64  `json:"modelId"         xorm:"'model_id'        bigint      pk comment('主键ID')        "`
+	ObjectId     int64  `json:"objectId"        xorm:"'object_id'       bigint      pk comment('主键ID')        "`
+	AttrId       int64  `json:"attrId"          xorm:"'attr_id'         bigint      pk comment('主键ID')        "`
+	AttrTitle    string `json:"attrTitle"       xorm:"'attr_title'      varchar(127)   comment('AttrTitle')    "`
+	AttrCode     string `json:"attrCode"        xorm:"'attr_code'       varchar(127)   comment('AttrCode')     "`
+	MappingCode  string `json:"mappingCode"     xorm:"'mapping_code'    varchar(127)   comment('AttrCode')     "`
+	AttrType     int64  `json:"attrType"        xorm:"'attr_type'       bigint         comment('Type')         "`
+	AttrLength   int64  `json:"attrLength"      xorm:"'attr_length'     bigint         comment('attrLength')   "`
+	AttrDecimals int64  `json:"attrDecimals"    xorm:"'attr_decimals'   bigint         comment('attrDecimals') "`
+	Comment      string `json:"comment"         xorm:"'comment'         varchar(255)   comment('描述')          "`
+	IsFixed      int64  `json:"isFixed"         xorm:"'is_fixed'        int            comment('是否可修改')     "`
+	IsNotNull    int64  `json:"isNotNull"       xorm:"'is_not_null'     int            comment('是否可修改')     "`
+	IsPKey       int64  `json:"isPKey"          xorm:"'is_pkey'         int            comment('是否可修改')     "`
+	SortNo       int64  `json:"sortNo"          xorm:"'sort_no'         int            comment('是否可修改')     "`
 }
 
 func (t *ModelObjectAttrInfo) TableName() string {