|
@@ -681,31 +681,31 @@ func ExcelRuleFormat(req *request.ExcelRuleMappingReq, lang string) (res *excel.
|
|
|
switch req.LeftValue {
|
|
|
// 今天
|
|
|
case "today":
|
|
|
- res.LeftValueShow = "今天"
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
// 明天
|
|
|
case "tomorrow":
|
|
|
- res.LeftValueShow = "明天"
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
// 最近7天
|
|
|
case "last7days":
|
|
|
- res.LeftValueShow = "最近7天"
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
// 上周
|
|
|
case "lastweek":
|
|
|
- res.LeftValueShow = "上周"
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
// 本周
|
|
|
case "thisweek":
|
|
|
- res.LeftValueShow = "本周"
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
// 下周
|
|
|
case "nextweek":
|
|
|
- res.LeftValueShow = "下周"
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
// 上月
|
|
|
case "lastmonth":
|
|
|
- res.LeftValueShow = "上月"
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
// 本月
|
|
|
case "thismonth":
|
|
|
- res.LeftValueShow = "本月"
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
// 下月
|
|
|
case "nextmonth":
|
|
|
- res.LeftValueShow = "下月"
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
default:
|
|
|
err = errors.New("发生日期规则错误")
|
|
|
return
|
|
@@ -719,9 +719,9 @@ func ExcelRuleFormat(req *request.ExcelRuleMappingReq, lang string) (res *excel.
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
- res.LeftValue = fmt.Sprintf("%d,%d", x, y)
|
|
|
+ res.LeftValueBack = fmt.Sprintf("%d,%d", x, y)
|
|
|
default:
|
|
|
- res.LeftValue = req.LeftValue
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
}
|
|
|
switch req.RightValueType {
|
|
|
// 坐标
|
|
@@ -730,17 +730,17 @@ func ExcelRuleFormat(req *request.ExcelRuleMappingReq, lang string) (res *excel.
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
- res.RightValue = fmt.Sprintf("%d,%d", x, y)
|
|
|
- res.RightValueShow = req.RightValue
|
|
|
+ res.RightValue = req.RightValue
|
|
|
+ res.RightValueBack = fmt.Sprintf("%d,%d", x, y)
|
|
|
default:
|
|
|
res.RightValue = req.RightValue
|
|
|
- res.RightValueShow = req.RightValue
|
|
|
+ res.RightValueBack = req.RightValue
|
|
|
}
|
|
|
- if res.LeftValueShow == "" {
|
|
|
- res.LeftValueShow = req.LeftValue
|
|
|
+ if res.LeftValueBack == "" {
|
|
|
+ res.LeftValueBack = req.LeftValue
|
|
|
}
|
|
|
- if res.RightValueShow == "" {
|
|
|
- res.RightValueShow = req.RightValue
|
|
|
+ if res.RightValueBack == "" {
|
|
|
+ res.RightValueBack = req.RightValue
|
|
|
}
|
|
|
res.RuleType = req.RuleType
|
|
|
res.ExcelInfoId = req.ExcelInfoId
|
|
@@ -782,14 +782,14 @@ func ModifyExcelRule(req *request.ExcelRuleMappingReq, lang string) (err error)
|
|
|
var updateCols []string
|
|
|
if excelInfo.LeftValue != editExcelInfo.LeftValue {
|
|
|
updateCols = append(updateCols, "LeftValue")
|
|
|
- updateCols = append(updateCols, "LeftValueShow")
|
|
|
+ updateCols = append(updateCols, "LeftValueBack")
|
|
|
}
|
|
|
if excelInfo.LeftValueType != editExcelInfo.LeftValueType {
|
|
|
updateCols = append(updateCols, "LeftValueType")
|
|
|
}
|
|
|
if excelInfo.RightValue != editExcelInfo.RightValue {
|
|
|
updateCols = append(updateCols, "RightValue")
|
|
|
- updateCols = append(updateCols, "RightValueShow")
|
|
|
+ updateCols = append(updateCols, "RightValueBack")
|
|
|
}
|
|
|
if excelInfo.RightValueType != editExcelInfo.RightValueType {
|
|
|
updateCols = append(updateCols, "RightValueType")
|
|
@@ -824,23 +824,6 @@ func GetExcelRuleList(excelInfoId int) (resp *response.ExcelRuleListResp, err er
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- for _, v := range excelInfoList {
|
|
|
- switch v.RuleType {
|
|
|
- // 大于
|
|
|
- case 1:
|
|
|
- v.LeftValueShow = "大于" + v.LeftValueShow
|
|
|
- // 小于
|
|
|
- case 2:
|
|
|
- v.LeftValueShow = "小于" + v.LeftValueShow
|
|
|
- // 介于
|
|
|
- case 3:
|
|
|
- v.LeftValueShow = "介于" + v.LeftValueShow + "到" + v.RightValueShow
|
|
|
- // 等于
|
|
|
- case 4:
|
|
|
- v.LeftValueShow = "等于" + v.LeftValueShow
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
resp.List = excelInfoList
|
|
|
return
|
|
|
}
|