diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/CIMController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/CIMController.java index 7dcd2eac..86c03215 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/CIMController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/CIMController.java @@ -48,17 +48,17 @@ public class CIMController { } @GetMapping("/cimImgResources") - @ApiOperation("根据应用领域查询图层服务") - public Result cimImgResources(@RequestParam String type){ - List imgServices = cimService.getImgServices(type); - return new Result().ok(imgServices); + @ApiOperation("CIM平台根据应用领域查询图层服务") + @LogOperation(value = "CIM平台根据应用领域查询图层服务") + public Result> cimImgResources(@RequestParam String type){ + return new Result>().ok(cimService.getImgServices(type)); } @GetMapping("/cimAssemblyResources") - @ApiOperation("查询智能算法组件") - public Result cimAssemblyResources(){ - List maps = cimService.cimAssemblyResources(); - return new Result().ok(maps); + @ApiOperation("CIM平台查询智能算法组件") + @LogOperation(value = "CIM平台查询智能算法组件") + public Result> cimAssemblyResources(){ + return new Result>().ok(cimService.cimAssemblyResources()); } } diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index 480de728..8295ddcc 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -182,7 +182,7 @@ public interface ResourceDao extends BaseDao { List getCIMApplyApplicationList(@Param("deptId") Long deptId); - List getImgServices(@Param("type") String type); + List getImgServices(@Param("deptid") Long deptid,@Param("type") String type); - List cimAssemblyResources(); + List cimAssemblyResources(@Param("deptid") Long deptid); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/CIMServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/CIMServiceImpl.java index 32a29f9b..059637ff 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/CIMServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/CIMServiceImpl.java @@ -72,16 +72,24 @@ public class CIMServiceImpl implements CIMService { @Override public List getImgServices(String type) { + SysDeptEntity sysDeptEntity = sysDeptDao.getByName(zjjName); + if (ObjectUtil.isEmpty(sysDeptEntity)) { + return new ArrayList<>(); + } List imgServices = new ArrayList<>(); - imgServices = resourceDao.getImgServices(type); + imgServices = resourceDao.getImgServices(sysDeptEntity.getId(),type); return imgServices; } @Override public List cimAssemblyResources() { + SysDeptEntity sysDeptEntity = sysDeptDao.getByName(zjjName); + if (ObjectUtil.isEmpty(sysDeptEntity)) { + return new ArrayList<>(); + } List result = new ArrayList<>(); - result = resourceDao.cimAssemblyResources(); + result = resourceDao.cimAssemblyResources(sysDeptEntity.getId()); return result; } diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index acc7c070..2ce4d1e0 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1630,27 +1630,30 @@ tdr.create_date - with A as ( SELECT m.* FROM ( SELECT a.name,a.id,a.info_list FROM tb_data_resource a INNER JOIN tb_data_attr b ON a.id = b.data_resource_id - WHERE a.dept_id = 1555080592128163841 AND a.del_flag = 0 and a.type = '组件服务' + WHERE a.dept_id = #{deptid} AND a.del_flag = 0 and a.type = '组件服务' AND (b.attr_type = '组件类型' AND b.attr_value = '图层服务' ) AND b.del_flag = 0 - ) m - INNER JOIN tb_data_attr b ON m.id = b.data_resource_id AND b.attr_type = '应用领域' AND LOCATE(#{type},b.attr_value) AND b.del_flag = 0 ) SELECT A.*,c.attr_value as link FROM A INNER JOIN tb_data_attr c ON A.id = c.data_resource_id - AND c.attr_type = '图层缩略图' AND c.del_flag = 0 + AND c.attr_type = '图层缩略图' AND c.del_flag = 0 \ No newline at end of file