Commit dc31daa8 authored by 赵啸非's avatar 赵啸非

添加产品资源枚举类

parent 6a961e79
...@@ -152,11 +152,8 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec ...@@ -152,11 +152,8 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
destDir.mkdirs(); destDir.mkdirs();
ua.setDestDirectory(destDir); ua.setDestDirectory(destDir);
ua.extract(); ua.extract();
} else if (uiZipFile.exists()) { } else if (uiZipFile.exists()) {
ZipUtil.unzip(uiZipFile, destDir); ZipUtil.unzip(uiZipFile, destDir);
} else { } else {
throw new AppException("请上传项目工程资源文件!"); throw new AppException("请上传项目工程资源文件!");
} }
...@@ -168,8 +165,8 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec ...@@ -168,8 +165,8 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
//TODO: 资源逻辑 //TODO: 资源逻辑
} else if (ProjectTypeEnum.PHP后端.getValue() == setupProjectEntity.getProjectType()) { } else if (ProjectTypeEnum.PHP后端.getValue() == setupProjectEntity.getProjectType()) {
//TODO: 解压php逻辑 //TODO: 解压php逻辑
String sourceDirPath = this.publishPath + "/temp/project/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getDesc() + "/";
String sourcePath = this.publishPath + "/temp/project/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getDesc() + "/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue() + ".zip"; String sourcePath = sourceDirPath+ ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue() + ".zip";
File file = new File(sourcePath); File file = new File(sourcePath);
log.info("文件路径:{},存在:{}", sourcePath, file.exists()); log.info("文件路径:{},存在:{}", sourcePath, file.exists());
...@@ -178,7 +175,6 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec ...@@ -178,7 +175,6 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
boolean mkdirs = destDir.mkdirs(); boolean mkdirs = destDir.mkdirs();
log.info("创建目录:{},{}", destDir.getPath(), mkdirs); log.info("创建目录:{},{}", destDir.getPath(), mkdirs);
} }
if (!file.exists()) { if (!file.exists()) {
throw new AppException("请上传项目工程文件!"); throw new AppException("请上传项目工程文件!");
} }
...@@ -223,12 +219,11 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec ...@@ -223,12 +219,11 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
} catch (IOException e) { } catch (IOException e) {
log.error(e.getMessage()); log.error(e.getMessage());
} }
callScript("project_deploy.sh", "4", publicPath); callScript("project_deploy.sh", "4", sourcePath);
} else if (SystemUtil.getOsInfo().isWindows()) { } else if (SystemUtil.getOsInfo().isWindows()) {
//todo //todo
} }
} }
return Rest.ok(); return Rest.ok();
......
...@@ -76,7 +76,7 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se ...@@ -76,7 +76,7 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
@Override @Override
protected void doListBefore(SetupProjectEntity query, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(SetupProjectEntity query, Map<String, Object> model, Context context) throws AppException {
query.setSize(50); query.setSize(50);
query.setOrderColList(Arrays.asList(new OrderCol("orderNum"))); query.setOrderColList(Arrays.asList(new OrderCol("projectCode"),new OrderCol("orderNum")));
super.doListBefore(query, model, context); super.doListBefore(query, model, context);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment