ソースを参照

fix:钢联指标新增返回供应商停用字段

Roc 6 ヶ月 前
コミット
4f1c0ca5ac

+ 5 - 0
controllers/data_manage/edb_info.go

@@ -2138,6 +2138,8 @@ func (this *EdbInfoController) EdbInfoList() {
 
 	//获取英文频度
 	edbInfoItem.FrequencyEn = data.GetFrequencyEn(edbInfoItem.Frequency)
+	// 获取是否供应商停更
+	edbInfoItem.IsSupplierStop = data.GetIsSupplierStop(edbInfoItem.Source, edbInfoItem.EdbCode)
 
 	//查询目录
 	classifyList, err, errMsg := data.GetFullClassifyByClassifyId(edbInfoItem.ClassifyId)
@@ -3737,6 +3739,9 @@ func (this *ChartInfoController) EdbInfoData() {
 		return
 	}
 	fullEdb.EdbInfo = edbInfo
+	// 是否供应商停更
+	fullEdb.IsSupplierStop = data.GetIsSupplierStop(edbInfo.Source, edbInfo.EdbCode)
+
 	fullEdb.ClassifyList = classifyList
 
 	var currClassifyItem *data_manage.EdbClassifyIdItems

+ 2 - 0
models/data_manage/edb_info.go

@@ -71,6 +71,7 @@ type EdbInfoFullClassify struct {
 	CorrelationStr string `description:"相关性系数字符串"`
 	ClassifyList   []*EdbClassifyIdItems
 	HaveOperaAuth  bool `description:"是否有数据权限,默认:false"`
+	IsSupplierStop int  `description:"是否供应商停更:1:停更,0:未停更"`
 }
 
 func AddEdbInfo(item *EdbInfo) (lastId int64, err error) {
@@ -436,6 +437,7 @@ type EdbInfoList struct {
 	NoUpdate         int8                    `description:"是否停止更新,0:继续更新;1:停止更新"`
 	IsJoinPermission int                     `description:"是否加入权限管控,0:不加入;1:加入;默认:0"`
 	HaveOperaAuth    bool                    `description:"是否有数据权限,默认:false"`
+	IsSupplierStop   int                     `description:"是否供应商停更:1:停更,0:未停更"`
 }
 
 type EdbDataInsertConfigItem struct {

+ 2 - 0
models/data_manage/mysteel_chemical_index.go

@@ -34,6 +34,7 @@ type BaseFromMysteelChemicalIndex struct {
 	TerminalCode                      string    `description:"终端编码"`
 	IsStop                            int       `description:"是否停更:1:停更,0:未停更"`
 	EndValue                          float64   `description:"指标的最新值"`
+	IsSupplierStop                    int       `description:"是否供应商停更:1:停更,0:未停更"`
 }
 
 type BaseFromMysteelChemicalIndexItem struct {
@@ -190,6 +191,7 @@ type MysteelChemicalList struct {
 	EdbInfoId                         int                `description:"指标库的id"`
 	UpdateTime                        string             `orm:"column(modify_time)"`
 	IsStop                            int                `description:"是否停更:1:停更,0:未停更"`
+	IsSupplierStop                    int                `description:"是否供应商停更:1:停更,0:未停更"`
 	Paging                            *paging.PagingItem `description:"分页数据"`
 	DataList                          []*MysteelChemicalData
 }

+ 22 - 0
services/data/edb_info.go

@@ -2965,3 +2965,25 @@ func handleByDelEdbInfo(edbInfo *data_manage.EdbInfo) {
 		_ = models.UpdateManualIsJoinEdbStatus(edbInfo.EdbCode, 0)
 	}
 }
+
+// GetIsSupplierStop
+// @Description: 获取是否供应商停更
+// @author: Roc
+// @datetime 2024-08-27 10:28:19
+// @param source int
+// @param edbCode string
+// @return isSupplierStop int
+func GetIsSupplierStop(source int, edbCode string) (isSupplierStop int) {
+	switch source {
+	case utils.DATA_SOURCE_MYSTEEL_CHEMICAL:
+		item, err := data_manage.GetBaseFromMysteelChemicalIndexByCode(edbCode)
+		if err != nil {
+			return
+		}
+		isSupplierStop = item.IsSupplierStop
+	}
+
+	return
+}
+
+//IsSupplierStop  int    `description:"是否供应商停更:1:停更,0:未停更"`