Commit 173227f9 LN

元器件导入导出标题改为英文

1 个父辈 f1bbd461
...@@ -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!