作者 陈志颖

合并分支 'dev' 到 'test'

fix:修复导入销售日期错误提示



查看合并请求 !32
@@ -1146,12 +1146,14 @@ func (c *OrderInfoController) ImportOrderFromExcel() { @@ -1146,12 +1146,14 @@ func (c *OrderInfoController) ImportOrderFromExcel() {
1146 // 销售日期时间格式转换 1146 // 销售日期时间格式转换
1147 timeValue, err := time.ParseInLocation("2006/01/02", row[4], time.Local) 1147 timeValue, err := time.ParseInLocation("2006/01/02", row[4], time.Local)
1148 if err != nil { 1148 if err != nil {
1149 - e := lib.ThrowError(lib.ARG_ERROR, err.Error())  
1150 - c.ResponseError(e)  
1151 - return 1149 + var tmpRow []string
  1150 + tmpRow = append(tmpRow, "无效的销售日期") // 错误信息
  1151 + s := strconv.Itoa(i + 1)
  1152 + tmpRow = append(tmpRow, s) // 行号
  1153 + tmpRow = append(tmpRow, row...) // 错误行数据
  1154 + partnerDataList = append(partnerDataList, tmpRow)
1152 } 1155 }
1153 1156
1154 - //saleDate, err := time.ParseInLocation("2006-01-02 15:04:05", param.SaleDate, time.Local)  
1155 saleDateWithTz := time.Date(timeValue.Year(), timeValue.Month(), timeValue.Day(), time.Now().Hour(), time.Now().Minute(), time.Now().Second(), time.Now().Nanosecond(), time.Local) 1157 saleDateWithTz := time.Date(timeValue.Year(), timeValue.Month(), timeValue.Day(), time.Now().Hour(), time.Now().Minute(), time.Now().Second(), time.Now().Nanosecond(), time.Local)
1156 1158
1157 fmt.Print("销售日期:", saleDateWithTz, "\n") 1159 fmt.Print("销售日期:", saleDateWithTz, "\n")