Commit 9b9bf6c4 authored by 赵啸非's avatar 赵啸非

添加产品资源枚举类

parent 9c0dcc6b
...@@ -108,6 +108,32 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se ...@@ -108,6 +108,32 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
} }
/**
* 批量部署
*/
@ApiOperation(value = "批量项目部署", notes = "部署")
@PostMapping(value = "batchDistribute")
public Rest<Void> batchDistribute(@RequestBody SetupProjectEntity setupProjectEntity) {
String busiDesc = this.getModuleDesc() + "设备模块部署";
Rest<Void> rest = Rest.ok(busiDesc + " 【成功】");
try {
if (!ObjectUtils.isEmpty(setupProjectEntity.getIdList())) {
SetupProjectQuery setupProjectQuery = new SetupProjectQuery();
setupProjectQuery.setIdList(setupProjectEntity.getIdList());
List<SetupProjectEntity> setupProjectEntities = this.service.find(setupProjectQuery, getContext());
for (SetupProjectEntity projectEntity : setupProjectEntities) {
this.service.distribute(projectEntity, getContext());
}
}
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error("批量项目部署", e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/** /**
* 部署 * 部署
*/ */
...@@ -225,7 +251,7 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se ...@@ -225,7 +251,7 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
if (YesNoEnum.YES.getValue() == rest.getCode()) { if (YesNoEnum.YES.getValue() == rest.getCode()) {
ret.put(KEY_RESULT_MSG, "更新事项命令下发成功!"); ret.put(KEY_RESULT_MSG, "更新事项命令下发成功!");
this.service.update(setupProject); this.service.update(setupProject);
}else{ } else {
ret.put(KEY_RESULT_MSG, "更新事项命令下发失败"); ret.put(KEY_RESULT_MSG, "更新事项命令下发失败");
} }
...@@ -486,7 +512,7 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se ...@@ -486,7 +512,7 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
SetupProjectQuery setupProjectQuery = new SetupProjectQuery(); SetupProjectQuery setupProjectQuery = new SetupProjectQuery();
setupProjectQuery.setProjectCode(基础服务后端.getValue()); setupProjectQuery.setProjectCode(基础服务后端.getValue());
SetupProjectEntity setupProjectEntity = this.service.selectOne(setupProjectQuery); SetupProjectEntity setupProjectEntity = this.service.selectOne(setupProjectQuery);
if (ObjectUtils.isEmpty(setupProjectEntity)){ if (ObjectUtils.isEmpty(setupProjectEntity)) {
throw new AppException("基础服务不存在"); throw new AppException("基础服务不存在");
} }
//判断资源文件是否已经上传 //判断资源文件是否已经上传
......
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