Skip to content

Commit 951c24b

Browse files
committed
修改元数据excel导入
1 parent 2fdb615 commit 951c24b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

MT Maven Webapp/src/main/java/com/x8/mt/controller/MetadataManagementController.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.io.ByteArrayOutputStream;
77
import java.io.IOException;
88
import java.io.InputStream;
9+
import java.net.URLDecoder;
910
import java.util.ArrayList;
1011
import java.util.HashMap;
1112
import java.util.Iterator;
@@ -220,11 +221,9 @@ public JSONObject exportProtocolMetadataToJSONFile(HttpServletRequest request, H
220221
GlobalMethodAndParams.setHttpServletResponse(request, response);
221222

222223
String protocolId = request.getParameter("protocolId");
223-
protocolId = new String(protocolId.getBytes("iso8859-1"),"utf-8");
224224

225225
String filename =request.getParameter("filename");
226-
filename = new String(filename.getBytes("iso8859-1"),"utf-8");
227-
226+
228227
JSONObject protocolMetadata = externalInterfaceService.getProtocolMetadataByprotocolId(protocolId);
229228

230229
if(protocolMetadata==null){

MT Maven Webapp/src/main/java/com/x8/mt/service/MetadataManagementService.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -873,11 +873,13 @@ private List<Map<String, Object>> TraverseBoolean(List<Map<String, Object>> list
873873
@Transactional
874874
public void importExcelFileProtocolMetadata(XSSFSheet sheet,String protocolId) throws Exception {
875875
int rowNum = 1;
876-
while((sheet.getRow(rowNum).getCell(0)!=null)
876+
877+
while((sheet.getRow(rowNum)!=null)
878+
&&(sheet.getRow(rowNum).getCell(0)!=null)
877879
&&(rowNum<=sheet.getLastRowNum())
878880
&&(sheet.getRow(rowNum).getCell(GlobalMethodAndParams.excel_TypeTag_CellNum).toString().equals(GlobalMethodAndParams.excel_TypeTag_Array)
879881
||sheet.getRow(rowNum).getCell(GlobalMethodAndParams.excel_TypeTag_CellNum).toString().equals(GlobalMethodAndParams.excel_TypeTag_Param))){
880-
882+
//System.out.println(rowNum);
881883
Row row=sheet.getRow(rowNum);
882884
if(row.getCell(GlobalMethodAndParams.excel_TypeTag_CellNum).toString().equals(GlobalMethodAndParams.excel_TypeTag_Array)){//参数组
883885
int paramArrayMetadataId = addExcelParamArrayMetadata(row,protocolId);

0 commit comments

Comments
 (0)