|
@@ -25,7 +25,7 @@ func HandleYongyiIndex(req *models.HandleYongyiExcelDataReq) (err error) {
|
|
|
errMsgList = append(errMsgList, fmt.Sprintf("新增指标异常,指标编码%s或者指标ID%s为空:", v.IndexCode, v.IndexName))
|
|
|
continue
|
|
|
}
|
|
|
- err = handleYongyiIndex(v)
|
|
|
+ err = handleYongyiIndex(v, req.TerminalCode)
|
|
|
if err != nil {
|
|
|
errMsgList = append(errMsgList, fmt.Sprintf("新增指标异常,指标编码:%s, Err: %s", v.IndexCode, err))
|
|
|
return
|
|
@@ -34,8 +34,7 @@ func HandleYongyiIndex(req *models.HandleYongyiExcelDataReq) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func handleYongyiIndex(req *models.HandleYongyiExcelData) (err error) {
|
|
|
- terminalCode := req.TerminalCode
|
|
|
+func handleYongyiIndex(req *models.HandleYongyiExcelData, terminalCode string) (err error) {
|
|
|
indexName := req.IndexName
|
|
|
indexCode := req.IndexCode
|
|
|
excelDataMap := req.ExcelDataMap
|
|
@@ -76,7 +75,7 @@ func handleYongyiIndex(req *models.HandleYongyiExcelData) (err error) {
|
|
|
SysUserId: 0,
|
|
|
SysUserRealName: "",
|
|
|
Level: 1,
|
|
|
- Sort: 0,
|
|
|
+ Sort: req.ClassifySort,
|
|
|
ModifyTime: now,
|
|
|
CreateTime: now,
|
|
|
}
|
|
@@ -87,13 +86,6 @@ func handleYongyiIndex(req *models.HandleYongyiExcelData) (err error) {
|
|
|
return
|
|
|
}
|
|
|
classifyObj.ClassifyId = classifyId
|
|
|
- //修改排序
|
|
|
- classifyObj.Sort = int(classifyId)
|
|
|
- err = classifyObj.Update([]string{"Sort"})
|
|
|
- if err != nil {
|
|
|
- err = fmt.Errorf("修改分类排序失败 Err:%s", err)
|
|
|
- return
|
|
|
- }
|
|
|
} else {
|
|
|
return
|
|
|
}
|