This commit is contained in:
daiqy88
2025-10-31 17:02:38 +08:00
parent e9647554cb
commit 5e8e822632
2 changed files with 7 additions and 7 deletions

View File

@@ -342,7 +342,7 @@ public class OfficeProxy{
{ {
try try
{ {
if(files == null || files.size() < 2) if(files == null )
return false; return false;
File file = new File(files.get(0)); File file = new File(files.get(0));
if(!file.exists()) if(!file.exists())

View File

@@ -514,23 +514,23 @@ public class ProjectServiceImpl implements ProjectService {
} }
List<String> result = new ArrayList<>(); List<String> result = new ArrayList<>();
String[] cmdParams = commands.split(" "); String[] cmdParams = commands.split(" ");
if(cmdParams.length != 4) if(cmdParams.length != 5)
{ {
return SdmResponse.failed("param size error"); return SdmResponse.failed("param size error");
} }
OfficeProxy officeProxy = new OfficeProxy(); OfficeProxy officeProxy = new OfficeProxy();
if(commands.contains("excelToJson.py")) //excel转为json库 if(commands.contains("excelToJson.py")) //excel转为json库
{ {
String excelPath = cmdParams[1]; String excelPath = cmdParams[2];
String dictPath = cmdParams[3]; String dictPath = cmdParams[4];
String jsonContents = officeProxy.excelToJson(excelPath,dictPath); String jsonContents = officeProxy.excelToJson(excelPath,dictPath);
result.add(jsonContents); result.add(jsonContents);
} }
else if(commands.contains("jsonToExcel.py"))//json库导出excel else if(commands.contains("jsonToExcel.py"))//json库导出excel
{ {
String jsonPath = cmdParams[1]; String jsonPath = cmdParams[2];
int type = Integer.parseInt(cmdParams[2]); int type = Integer.parseInt(cmdParams[3]);
String dictPath = cmdParams[3]; String dictPath = cmdParams[4];
int index = dictPath.lastIndexOf(File.separator); int index = dictPath.lastIndexOf(File.separator);
if(index > 0) { if(index > 0) {
String savePath = dictPath.substring(0, index); String savePath = dictPath.substring(0, index);