Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 173227f9
由
LN
编写于
2022-05-10 16:54:11 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
元器件导入导出标题改为英文
1 个父辈
f1bbd461
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
30 行增加
和
16 行删除
src/main/java/com/neotel/smfcore/core/barcode/rest/ComponentController.java
src/main/java/com/neotel/smfcore/core/barcode/rest/ComponentController.java
查看文件 @
173227f
...
@@ -219,8 +219,10 @@ public class ComponentController {
...
@@ -219,8 +219,10 @@ public class ComponentController {
try
{
try
{
List
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
List
<
String
>
titles
=
new
ArrayList
<>();
List
<
String
>
titles
=
new
ArrayList
<>();
String
[]
titleArray
=
new
String
[]{
"料件编号"
,
"数量"
,
"尺寸"
,
"高度"
,
"最大库存"
,
"最小库存"
,
"安全库存"
// String[] titleArray = new String[]{"料件编号" , "数量", "尺寸", "高度", "最大库存", "最小库存", "安全库存"
,
"呆滞天数"
,
"整盘比"
,
"散盘比"
,
"描述"
};
// , "呆滞天数", "整盘比", "散盘比", "描述"};
String
[]
titleArray
=
new
String
[]{
"materialNo"
,
"amount"
,
"plateSize"
,
"height"
,
"maxStoreNum"
,
"minStoreNum"
,
"safetyStoreNum"
,
"sluggishDay"
,
"wholeReel"
,
"halfReel"
,
"description"
};
for
(
String
title
:
for
(
String
title
:
titleArray
)
{
titleArray
)
{
...
@@ -230,19 +232,30 @@ public class ComponentController {
...
@@ -230,19 +232,30 @@ public class ComponentController {
for
(
int
i
=
1
;
i
<=
5
;
i
++)
{
for
(
int
i
=
1
;
i
<=
5
;
i
++)
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"materialNo"
,
"MATERIALNO-"
+
i
);
map
.
put
(
"料件编号"
,
"MATERIALNO-"
+
i
);
map
.
put
(
"amount"
,
1000
);
map
.
put
(
"数量"
,
1000
);
map
.
put
(
"plateSize"
,
7
);
map
.
put
(
"尺寸"
,
7
);
map
.
put
(
"height"
,
8
);
map
.
put
(
"高度"
,
8
);
map
.
put
(
"maxStoreNum"
,
""
);
map
.
put
(
"最大库存"
,
""
);
map
.
put
(
"minStoreNum"
,
""
);
map
.
put
(
"最小库存"
,
""
);
map
.
put
(
"safetyStoreNum"
,
""
);
map
.
put
(
"安全库存"
,
""
);
map
.
put
(
"sluggishDay"
,
""
);
map
.
put
(
"呆滞天数"
,
""
);
map
.
put
(
"wholeReel"
,
""
);
map
.
put
(
"整盘比"
,
""
);
map
.
put
(
"halfReel"
,
""
);
map
.
put
(
"散盘比"
,
""
);
map
.
put
(
"description"
,
""
);
map
.
put
(
"描述"
,
""
);
// map.put("料件编号", "MATERIALNO-"+i);
// map.put("数量", 1000);
// map.put("尺寸", 7);
// map.put("高度", 8);
// map.put("最大库存", "");
// map.put("最小库存", "");
//
// map.put("安全库存", "");
// map.put("呆滞天数", "");
// map.put("整盘比", "");
// map.put("散盘比", "");
// map.put("描述", "");
maps
.
add
(
map
);
maps
.
add
(
map
);
}
}
FileUtil
.
downloadCSV
(
maps
,
titles
,
response
);
FileUtil
.
downloadCSV
(
maps
,
titles
,
response
);
...
@@ -271,7 +284,8 @@ public class ComponentController {
...
@@ -271,7 +284,8 @@ public class ComponentController {
int
descriptionIndex
=
csvRead
.
getIndex
(
"描述"
,
"description"
);
int
descriptionIndex
=
csvRead
.
getIndex
(
"描述"
,
"description"
);
if
(
amountIndex
==-
1
||
plateSizeIndex
==-
1
||
heightIndex
==-
1
){
if
(
amountIndex
==-
1
||
plateSizeIndex
==-
1
||
heightIndex
==-
1
){
throw
new
ValidateException
(
"smfcore.componetn.csverror"
,
"文件格式错误,必须包含列:料件编号,数量,尺寸,高度"
);
// throw new ValidateException("smfcore.componetn.csverror", "文件格式错误,必须包含列:料件编号,数量,尺寸,高度" );
throw
new
ValidateException
(
"smfcore.componetn.csverror"
,
"文件格式错误,必须包含列:materialNo,amount,plateSize,height"
);
}
}
int
row
=
1
;
int
row
=
1
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论