xiziwen 5 dagar sedan
förälder
incheckning
702542ebde

+ 2 - 3
controllers/data_manage/clarksons_data.go

@@ -169,7 +169,7 @@ func (this *ClarksonsDataController) EditClassify() {
 		br.ErrMsg = "参数解析失败,Err:" + err.Error()
 		return
 	}
-	if req.BaseFromClassifyId <= 0 {
+	if req.BaseFromClassifyId < 0 {
 		br.Msg = "参数错误"
 		return
 	}
@@ -1518,7 +1518,6 @@ func (this *ClarksonsDataController) ClarksonsData() {
 		pars = append(pars, "%"+keyword+"%")
 	}
 
-
 	sci99List, err := data_manage.GetClarksonsIndex(condition, pars)
 	if err != nil {
 		br.Msg = "获取数据失败"
@@ -1648,4 +1647,4 @@ func (this *ClarksonsDataController) IndexPageList() {
 	br.Success = true
 	br.Msg = "获取成功"
 	br.Data = resp
-}
+}

+ 45 - 0
models/data_manage/excel/referenced_excel_config.go

@@ -0,0 +1,45 @@
+package excel
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"time"
+)
+
+type ReferencedExcelConfig struct {
+	ReferencedExcelConfigId int       `orm:"column(referenced_excel_config_id);pk;auto" ` // excel表格配置id
+	UniqueCode              string    // 表格唯一编码
+	ReferencedID            int       // 被引用的id,报告就是报告id,pptId
+	FromScene               int       // 引用类型 1智能研报 2研报列表 3英文研报 4PPT
+	Uuid                    string    // 引用唯一标识
+	WidthList               string    // 宽度数组
+	HeightList              string    // 高度数组
+	OpUserID                int       // 当前编辑操作的用户id
+	OpUserName              string    // 当前编辑的用户名称(冗余字段,避免查表)
+	CreateTime              time.Time // 创建时间
+	Content                 string    // 内容
+	ModifyTime              time.Time // 修改时间
+}
+
+type ExcelReferencesReq struct {
+	UniqueCode   string `description:"表格唯一编码"`
+	ReferencedId int    `description:"被引用的ID"`
+	FromScene    int    `description:"引用类型 1智能研报 2研报列表 3英文研报 4PPT 5英文PPT"`
+	Uuid         string `description:"引用唯一标识"`
+	WidthList    string `description:"宽度数组"`
+	HeightList   string `description:"高度数组"`
+}
+
+// add
+func AddReferencedExcelConfig(items []*ReferencedExcelConfig) (err error) {
+	o := orm.NewOrmUsingDB("data")
+	_, err = o.InsertMulti(len(items), items)
+	return
+}
+
+// getByCode
+func GetReferencedExcelConfigByUniqueCode(uniqueCode string) (item ReferencedExcelConfig, err error) {
+	o := orm.NewOrmUsingDB("data")
+	sql := ` SELECT * FROM referenced_excel_config WHERE referenced_excel_unique_code = ? `
+	err = o.Raw(sql, uniqueCode).QueryRow(&item)
+	return
+}

+ 2 - 1
static/ErrMsgConfig.json

@@ -59,5 +59,6 @@
   "指标已删除,请刷新页面": "Metric deleted, please refresh the page.",
   "删除失败": "Deletion failed.",
   "指标数据异常,请检查": "The metric data is abnormal, please check.",
-  "原指标与替换指标存在引用关系,不允许替换": "Original indicators and replacement indicators have a referencing relationship, which is not allowed to be replaced."
+  "原指标与替换指标存在引用关系,不允许替换": "Original indicators and replacement indicators have a referencing relationship, which is not allowed to be replaced.",
+  "请选择分类": "Please Select a Category"
 }