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
{
if(files == null || files.size() < 2)
if(files == null )
return false;
File file = new File(files.get(0));
if(!file.exists())

View File

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