切换导航条
此项目
正在载入...
登录
allied-creation
/
allied-creation-cooperation
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
陈志颖
3 years ago
提交
1f61c16564f4b6469455fdce9dea9c510327bb1e
1 个父辈
57f23d1b
fix:导入订单、退货单错误信息被覆盖问题
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
21 行增加
和
19 行删除
pkg/application/dividendsOrder/service/dividends_order.go
pkg/application/dividendsReturnedOrder/service/dividends_returned_order.go
pkg/application/dividendsOrder/service/dividends_order.go
查看文件 @
1f61c16
...
...
@@ -439,10 +439,11 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD
/***************************************************** 3.单元格类型校验 *********************************************/
typeError
:=
make
([]
*
domain
.
FailInfo
,
0
)
for
_
,
dividendsOrder
:=
range
importDividendsOrderCommand
.
DividendsOrderData
{
// 行
var
myRow
[]
*
domain
.
FailInfo
for
j
,
dividendsOrder
:=
range
importDividendsOrderCommand
.
DividendsOrderData
{
// 行
t
:=
reflect
.
TypeOf
(
dividendsOrder
)
v
:=
reflect
.
ValueOf
(
dividendsOrder
)
var
myRow
[]
*
domain
.
FailInfo
for
k
:=
0
;
k
<
t
.
NumField
();
k
++
{
// 列
//r := strconv.Itoa(i + 1)
switch
k
{
...
...
@@ -454,7 +455,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD
tmpRow
:=
&
domain
.
FailInfo
{
FailReason
:
"订单日期格式错误,请输入正确的订单日期"
,
}
tmpRow
.
ImportDividendsOrderData
=
&
dividendsOrder
tmpRow
.
ImportDividendsOrderData
=
&
importDividendsOrderCommand
.
DividendsOrderData
[
j
]
myRow
=
append
(
myRow
,
tmpRow
)
continue
}
...
...
@@ -467,7 +468,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD
tmpRow
:=
&
domain
.
FailInfo
{
FailReason
:
"行产品数量格式错误,产品数量必须整数"
,
}
tmpRow
.
ImportDividendsOrderData
=
&
dividendsOrder
tmpRow
.
ImportDividendsOrderData
=
&
importDividendsOrderCommand
.
DividendsOrderData
[
j
]
myRow
=
append
(
myRow
,
tmpRow
)
continue
}
...
...
@@ -476,7 +477,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD
tmpRow
:=
&
domain
.
FailInfo
{
FailReason
:
"产品数量必须大于0,请重新填写"
,
}
tmpRow
.
ImportDividendsOrderData
=
&
dividendsOrder
tmpRow
.
ImportDividendsOrderData
=
&
importDividendsOrderCommand
.
DividendsOrderData
[
j
]
myRow
=
append
(
myRow
,
tmpRow
)
continue
}
...
...
@@ -489,7 +490,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD
tmpRow
:=
&
domain
.
FailInfo
{
FailReason
:
"产品价格格式错误,产品价格必须为数字类型"
,
}
tmpRow
.
ImportDividendsOrderData
=
&
dividendsOrder
tmpRow
.
ImportDividendsOrderData
=
&
importDividendsOrderCommand
.
DividendsOrderData
[
j
]
myRow
=
append
(
myRow
,
tmpRow
)
continue
}
...
...
@@ -499,7 +500,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD
tmpRow
:=
&
domain
.
FailInfo
{
FailReason
:
"产品价格超过最大限制,产品价格小数点前面不能超过十六位数字,并保留两位小数"
,
}
tmpRow
.
ImportDividendsOrderData
=
&
dividendsOrder
tmpRow
.
ImportDividendsOrderData
=
&
importDividendsOrderCommand
.
DividendsOrderData
[
j
]
myRow
=
append
(
myRow
,
tmpRow
)
continue
}
...
...
@@ -508,7 +509,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD
tmpRow
:=
&
domain
.
FailInfo
{
FailReason
:
"产品价格必须大于0,请重新填写"
,
}
tmpRow
.
ImportDividendsOrderData
=
&
dividendsOrder
tmpRow
.
ImportDividendsOrderData
=
&
importDividendsOrderCommand
.
DividendsOrderData
[
j
]
myRow
=
append
(
myRow
,
tmpRow
)
continue
}
...
...
@@ -522,7 +523,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD
tmpRow
:=
&
domain
.
FailInfo
{
FailReason
:
"费用格式错误,费用必须为数字类型"
,
}
tmpRow
.
ImportDividendsOrderData
=
&
dividendsOrder
tmpRow
.
ImportDividendsOrderData
=
&
importDividendsOrderCommand
.
DividendsOrderData
[
j
]
myRow
=
append
(
myRow
,
tmpRow
)
log
.
Logger
.
Info
(
"费用类型错误"
,
map
[
string
]
interface
{}{
"tmpRow"
:
tmpRow
,
...
...
@@ -534,7 +535,7 @@ func (dividendsOrderService *DividendsOrderService) ImportDividendsOrder(importD
tmpRow
:=
&
domain
.
FailInfo
{
FailReason
:
"费用超过最大限制,费用小数点前面不能超过十六位数字,并保留两位小数"
,
}
tmpRow
.
ImportDividendsOrderData
=
&
dividendsOrder
tmpRow
.
ImportDividendsOrderData
=
&
importDividendsOrderCommand
.
DividendsOrderData
[
j
]
myRow
=
append
(
myRow
,
tmpRow
)
continue
}
...
...
pkg/application/dividendsReturnedOrder/service/dividends_returned_order.go
查看文件 @
1f61c16
...
...
@@ -478,10 +478,11 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide
/***************************************************** 3.单元格类型校验 *********************************************/
typeError
:=
make
([]
*
domain
.
FailReturnedInfo
,
0
)
for
_
,
dividendsReturnedOrder
:=
range
importDividendsReturnedOrderCommand
.
DividendsReturnedOrderData
{
// 行
var
myRow
[]
*
domain
.
FailReturnedInfo
for
j
,
dividendsReturnedOrder
:=
range
importDividendsReturnedOrderCommand
.
DividendsReturnedOrderData
{
// 行
t
:=
reflect
.
TypeOf
(
dividendsReturnedOrder
)
v
:=
reflect
.
ValueOf
(
dividendsReturnedOrder
)
var
myRow
[]
*
domain
.
FailReturnedInfo
for
k
:=
0
;
k
<
t
.
NumField
();
k
++
{
// 列
switch
k
{
case
3
:
// 退货日期校验
...
...
@@ -491,7 +492,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide
if
!
ok
{
tmpRow
:=
&
domain
.
FailReturnedInfo
{
FailReason
:
"退货日期格式错误,请输入正确的退货日期"
,
ImportDividendsReturnedOrderData
:
&
dividendsReturnedOrder
,
ImportDividendsReturnedOrderData
:
&
importDividendsReturnedOrderCommand
.
DividendsReturnedOrderData
[
j
]
,
}
myRow
=
append
(
myRow
,
tmpRow
)
continue
...
...
@@ -504,7 +505,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide
if
!
ok
{
tmpRow
:=
&
domain
.
FailReturnedInfo
{
FailReason
:
"订单日期格式错误,请输入正确的订单日期"
,
ImportDividendsReturnedOrderData
:
&
dividendsReturnedOrder
,
ImportDividendsReturnedOrderData
:
&
importDividendsReturnedOrderCommand
.
DividendsReturnedOrderData
[
j
]
,
}
myRow
=
append
(
myRow
,
tmpRow
)
continue
...
...
@@ -517,7 +518,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide
if
err
!=
nil
{
tmpRow
:=
&
domain
.
FailReturnedInfo
{
FailReason
:
"退货数量格式错误,退货数量必须整数"
,
ImportDividendsReturnedOrderData
:
&
dividendsReturnedOrder
,
ImportDividendsReturnedOrderData
:
&
importDividendsReturnedOrderCommand
.
DividendsReturnedOrderData
[
j
]
,
}
myRow
=
append
(
myRow
,
tmpRow
)
continue
...
...
@@ -526,7 +527,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide
if
orderGoodQuantity
<
0
{
tmpRow
:=
&
domain
.
FailReturnedInfo
{
FailReason
:
"退货数量必须大于0,请重新填写"
,
ImportDividendsReturnedOrderData
:
&
dividendsReturnedOrder
,
ImportDividendsReturnedOrderData
:
&
importDividendsReturnedOrderCommand
.
DividendsReturnedOrderData
[
j
]
,
}
myRow
=
append
(
myRow
,
tmpRow
)
continue
...
...
@@ -539,7 +540,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide
if
typeErr
!=
nil
{
tmpRow
:=
&
domain
.
FailReturnedInfo
{
FailReason
:
"退货价格格式错误,退货价格必须为数字类型"
,
ImportDividendsReturnedOrderData
:
&
dividendsReturnedOrder
,
ImportDividendsReturnedOrderData
:
&
importDividendsReturnedOrderCommand
.
DividendsReturnedOrderData
[
j
]
,
}
myRow
=
append
(
myRow
,
tmpRow
)
continue
...
...
@@ -549,7 +550,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide
if
univalent
>=
1e16
{
tmpRow
:=
&
domain
.
FailReturnedInfo
{
FailReason
:
"退货价格超过最大限制,退货价格小数点前面不能超过十六位数字,并保留两位小数"
,
ImportDividendsReturnedOrderData
:
&
dividendsReturnedOrder
,
ImportDividendsReturnedOrderData
:
&
importDividendsReturnedOrderCommand
.
DividendsReturnedOrderData
[
j
]
,
}
myRow
=
append
(
myRow
,
tmpRow
)
continue
...
...
@@ -559,7 +560,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) ImportDivide
if
univalent
<
0
{
tmpRow
:=
&
domain
.
FailReturnedInfo
{
FailReason
:
"退货价格必须大于0,请重新填写"
,
ImportDividendsReturnedOrderData
:
&
dividendsReturnedOrder
,
ImportDividendsReturnedOrderData
:
&
importDividendsReturnedOrderCommand
.
DividendsReturnedOrderData
[
j
]
,
}
myRow
=
append
(
myRow
,
tmpRow
)
continue
...
...
请
注册
或
登录
后发表评论