print("批量导入组织");var File=Java.type("java.io.File");var Config={interfaceUrl:"http://ahpp.zoneland.net:20030/x_program_center/jaxrs/invoke/unitAsync/execute",localPath:File.separator+"data"+File.separator+"ImportUnitFromExcel"+File.separator,recordLocalPath:File.separator+"data"+File.separator+"ImportUnitFromExcelRecord"+File.separator};var Utils={parseResp:function(e){if(!e||e===null){return{type:"error",message:"服务响应是null,需要管理员查看后台日志"}}else{var a=JSON.parse(e.toString());return a}},getFailText:function(e){var a;if(e.message){a=e.message+(e.prompt?"("+e.prompt+")":"")}else if(e.prompt){a=e.prompt}else{a="未知异常"}print(a);return a}};function getFileList(){var e=Config.localPath;var a=new File(e);var r=Java.type("java.util.ArrayList");var t=new r;if(a.exists()){var i=a.listFiles();for(var s=0;s1){for(var v=1;v0){importRow(u,f)}}}else{r="EXCEL没有数据,请确定。"}}if(r.length()>0){print("错误消息:"+r)}else{print(e.getName()+"导入成功!")}}catch(e){e.printStackTrace()}}var Cell=Java.type("org.apache.poi.ss.usermodel.Cell");function importRow(e,a){var r={action:"add",attributeList:[]};for(var t=0;t