|
楼主 |
发表于 2020-3-13 14:38:12
|
显示全部楼层
public static void workOrderProcessAfterImportExcelBeforeAction() {
System.out.println("导入前");
Workbook workBook = (Workbook)ModelUtils.getRequestContext().getActionContext().getParameter("excel");
Sheet sheet=workBook.getSheetAt(0); //获得sheet1表
List<String> list=new ArrayList<String>();//存放excel鉴别列的数据
for(int i=0;i<=sheet.getLastRowNum();i++){
Row row=sheet.getRow(i);
Cell cell=row.getCell(1);//根据excel表中第一列数据进行校验
cell.setCellType(Cell.CELL_TYPE_STRING);
if(cell.getRowIndex()==0){
row.removeCell(cell);//如果list存在和鉴别列相同的数据就删除
}else{
list.add(cell.getStringCellValue());//如果不存在就添加到list
}
}
}
导入excel提示如下错误
导入前
2020-03-13 14:37:05 excute stream action, params:{"accept":"application/json","action":"importExcel","actionFlag":"__action_0__","activity":"newActivity","contentType":"json","executeContext":"","executor":"","parameters":{"config":{"@type":"xml","xml":"<config use-default=\"false\" to=\"UI\" excel-file=\"E:\\BeX5_V3.8\\apache-tomcat\\temp\\072c1df2-cde3-462b-9f24-80d5fb76c327.excel.tmp\" mapping-file=\"E:\\BeX5_V3.8\\apache-tomcat\\temp\\a866f371-7778-4104-aadf-c8d302541a82.excel.tmp\"><sheet all=\"true\" start=\"1\" end=\"1\"/><row all=\"true\" start=\"1\" end=\"1\"/><data><concept name=\"NP_workOrderD\"><relation name=\"NP_workOrderD\" type=\"String\"/><relation name=\"fBrandModel\" type=\"String\"/><relation name=\"fConstructionUnit\" type=\"String\"/><relation name=\"fDailyOverhaul\" type=\"String\"/><relation name=\"fDefetClass\" type=\"String\"/><relation name=\"fEngQuantities\" type=\"String\"/><relation name=\"fMasterID\" type=\"String\"/><relation name=\"fNumber\" type=\"Decimal\"/><relation name=\"fOrderContent\" type=\"String\"/><relation name=\"fOrderFinishDate\" type=\"Date\"/><relation name=\"fOrderID\" type=\"Decimal\"/><relation name=\"fOrderPerson\" type=\"String\"/><relation name=\"fOrderReDate\" type=\"Date\"/><relation name=\"fOrderStartDate\" type=\"Date\"/><relation name=\"fOwerPerson\" type=\"String\"/><relation name=\"fPlantCode\" type=\"String\"/><relation name=\"fPosition\" type=\"String\"/><relation name=\"fRemarks\" type=\"String\"/><relation name=\"fTeamNum\" type=\"String\"/><relation name=\"fUseMaterial\" type=\"String\"/><relation name=\"fUseTools\" type=\"String\"/><relation name=\"fWork\" type=\"String\"/><relation name=\"fWorkHour\" type=\"String\"/><relation name=\"sCreateTime\" type=\"DateTime\"/><relation name=\"version\" type=\"Integer\"/></concept></data></config>"},"createActionParam":{"action":"createNP_workOrderDAction","activity":"newActivity","parameters":{"defaultValues":{"fMasterID":"'34AE2D1493A4471D9533F5491D4485A1'"},"table":{"@type":"table","rows":[],"userdata":{"idColumnDefine":"NP_workOrderD","idColumnName":"NP_workOrderD","idColumnType":"String","model":"/NPOMIS/engMgt/data","relationAlias":"fBrandModel,fConstructionUnit,fDailyOverhaul,fDefetClass,fEngQuantities,fMasterID,fNumber,fOrderContent,fOrderFinishDate,fOrderID,fOrderPerson,fOrderReDate,fOrderStartDate,fOwerPerson,fPlantCode,fPosition,fRemarks,fTeamNum,fUseMaterial,fUseTools,fWork,fWorkHour,sCreateTime,version","relationTypes":"String,String,String,String,String,String,Decimal,String,Date,Decimal,String,Date,Date,String,String,String,String,String,String,String,String,String,DateTime,Integer","relations":"NP_workOrderD.fBrandModel,NP_workOrderD.fConstructionUnit,NP_workOrderD.fDailyOverhaul,NP_workOrderD.fDefetClass,NP_workOrderD.fEngQuantities,NP_workOrderD.fMasterID,NP_workOrderD.fNumber,NP_workOrderD.fOrderContent,NP_workOrderD.fOrderFinishDate,NP_workOrderD.fOrderID,NP_workOrderD.fOrderPerson,NP_workOrderD.fOrderReDate,NP_workOrderD.fOrderStartDate,NP_workOrderD.fOwerPerson,NP_workOrderD.fPlantCode,NP_workOrderD.fPosition,NP_workOrderD.fRemarks,NP_workOrderD.fTeamNum,NP_workOrderD.fUseMaterial,NP_workOrderD.fUseTools,NP_workOrderD.fWork,NP_workOrderD.fWorkHour,NP_workOrderD.sCreateTime,NP_workOrderD.version","updateMode":"whereVersion"}}},"process":"/NPOMIS/engMgt/process/workOrder/workOrderProcess"}},"process":"/NPOMIS/engMgt/process/workOrder/workOrderProcess"}
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor262.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.justep.system.action.Engine.invokeActions(Native Method)
at com.justep.system.action.Engine.invokeActions(Unknown Source)
at com.justep.business.server.BusinessServer.doAction(Unknown Source)
at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
at com.justep.business.server.BusinessServer.excute(Unknown Source)
at com.justep.business.server.BusinessServer.excute(Unknown Source)
at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.justep.micro.service.MicroServiceFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.justep.excel.ExcelException: 编码: JUSTEP170010; 提示:
at com.justep.excel.ExcelException.create(ExcelException.java:32)
at com.justep.excel.ImportGenerator.getValue(ImportGenerator.java:315)
at com.justep.excel.ImportGenerator.setCellsValue(ImportGenerator.java:238)
at com.justep.excel.ImportGenerator.generateRecord(ImportGenerator.java:203)
at com.justep.excel.ImportGenerator.generateSheet(ImportGenerator.java:198)
at com.justep.excel.ImportGenerator.generate(ImportGenerator.java:131)
at Excel.importExcel(Excel.java:91)
... 29 more
Caused by: java.lang.NumberFormatException
at java.math.BigDecimal.<init>(BigDecimal.java:494)
at java.math.BigDecimal.<init>(BigDecimal.java:383)
at java.math.BigDecimal.<init>(BigDecimal.java:806)
at com.justep.system.transform.SimpleTransform.a(Unknown Source)
at com.justep.system.transform.SimpleTransform.transToObj(Unknown Source)
at com.justep.excel.ImportGenerator.getValue(ImportGenerator.java:313)
... 34 more
|
|