|
@ -1,4 +1,4 @@
|
|
|
package com.yihu.hos.resource.service.impl;
|
|
|
package com.yihu.hos.resource.service;
|
|
|
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
@ -8,12 +8,10 @@ import com.yihu.hos.core.http.HttpClientKit;
|
|
|
import com.yihu.hos.crawler.service.EsbHttp;
|
|
|
import com.yihu.hos.resource.dao.*;
|
|
|
import com.yihu.hos.resource.model.*;
|
|
|
import com.yihu.hos.resource.service.IRsResourceService;
|
|
|
import com.yihu.hos.resource.service.IStdService;
|
|
|
import com.yihu.hos.resource.viewresult.ResourceAuthorizeDGModel;
|
|
|
import com.yihu.hos.resource.viewresult.RsResourceDeatilModel;
|
|
|
import com.yihu.hos.resource.viewresult.RsResourceDimensionModel;
|
|
|
import com.yihu.hos.system.dao.intf.IAppDao;
|
|
|
import com.yihu.hos.system.dao.AppDao;
|
|
|
import com.yihu.hos.system.model.SystemApp;
|
|
|
import com.yihu.hos.web.framework.model.ActionResult;
|
|
|
import com.yihu.hos.web.framework.model.DataGridResult;
|
|
@ -33,30 +31,33 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Service("resourceService")
|
|
|
public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
@Resource(name = "rsResourceCategoryDao")
|
|
|
private IRsResourceCategoryDao rsResourceCategoryDao;
|
|
|
@Resource(name = "rsResourceDao")
|
|
|
private IRsResourceDao rsResourceDao;
|
|
|
@Resource(name = "resourceDatasetDao")
|
|
|
private IRsResourceDatasetDao resourceDatasetDao;
|
|
|
@Resource(name = "resourceMetadataDao")
|
|
|
private IRsResourceMetadataDao resourceMetadataDao;
|
|
|
@Resource(name = "appDao")
|
|
|
private IAppDao appDao;
|
|
|
@Resource(name = "rsAppResourceDao")
|
|
|
private IRsAppResourceDao appResourceDao;
|
|
|
@Resource(name = "rsAppResourceDetailDao")
|
|
|
private IRsAppResourceDetailDao rsAppResourceDetailDao;
|
|
|
@Resource(name = "resourceDimensionDao")
|
|
|
private IRsResourceDimensionDao resourceDimensionDao;
|
|
|
|
|
|
@Autowired
|
|
|
private IStdService stdService;
|
|
|
public class RsResourceServiceImpl {
|
|
|
|
|
|
public static final String BEAN_ID = "resourceService";
|
|
|
|
|
|
@Resource(name = RsResourceCategoryDaoImpl.BEAN_ID)
|
|
|
private RsResourceCategoryDaoImpl rsResourceCategoryDao;
|
|
|
@Resource(name = RsResourceDaoImpl.BEAN_ID)
|
|
|
private RsResourceDaoImpl rsResourceDao;
|
|
|
@Resource(name = RsResourceDatasetDaoImpl.BEAN_ID)
|
|
|
private RsResourceDatasetDaoImpl resourceDatasetDao;
|
|
|
@Resource(name = RsResourceMetadataDaoImpl.BEAN_ID)
|
|
|
private RsResourceMetadataDaoImpl resourceMetadataDao;
|
|
|
@Resource(name = AppDao.BEAN_ID)
|
|
|
private AppDao appDao;
|
|
|
@Resource(name = RsAppResourceDaoImpl.BEAN_ID)
|
|
|
private RsAppResourceDaoImpl appResourceDao;
|
|
|
@Resource(name = RsAppResourceDetailDaoImpl.BEAN_ID)
|
|
|
private RsAppResourceDetailDaoImpl rsAppResourceDetailDao;
|
|
|
@Resource(name = RsResourceDimensionDaoImpl.BEAN_ID)
|
|
|
private RsResourceDimensionDaoImpl resourceDimensionDao;
|
|
|
|
|
|
@Resource(name = StdService.BEAN_ID)
|
|
|
private StdService stdService;
|
|
|
@Autowired
|
|
|
private ObjectMapper objectMapper;
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public List<TreeResult> getResourceTreeList(String name) throws Exception {
|
|
|
List<TreeResult> treeVOs = new ArrayList<TreeResult>();
|
|
|
List<String> pidList = new ArrayList<>();
|
|
@ -129,7 +130,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return treeVOs;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public List<TreeResult> resourceCategoryTreeList(String name) throws Exception {
|
|
|
List<TreeResult> treeVOs = new ArrayList<TreeResult>();
|
|
|
List<RsResourceCategory> rsCategorya = rsResourceCategoryDao.getAllRsResourceCategory();
|
|
@ -268,18 +269,18 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return treeVOs;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public DataGridResult getResourceList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
|
|
|
|
|
|
return rsResourceDao.getResourceList(conditionMap, page, rows);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public int getResourceListCount(Map<String, Object> conditionMap) throws Exception {
|
|
|
return rsResourceDao.getResourceListCount(conditionMap);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public RsResourceDeatilModel getRsResourceDeatilModel(String id) throws Exception {
|
|
|
RsResourceDeatilModel rsResourceDeatilModel = new RsResourceDeatilModel();
|
|
|
RsResource rsResource = rsResourceDao.getResourceById(id);
|
|
@ -317,7 +318,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public DataGridResult getResourceFiled(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
|
|
|
RsResource rs = rsResourceDao.getEntity(RsResource.class, (String) conditionMap.get("resourceId"));
|
|
|
conditionMap.put("datasetId", rs.getDatasetCode());
|
|
@ -328,7 +329,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
/**
|
|
|
* 通过网关获取资源数据
|
|
|
*/
|
|
|
@Override
|
|
|
|
|
|
public String searchRomoteResourceList(String code, Map<String, String> params) throws Exception {
|
|
|
params.put("code", code);
|
|
|
String result = HttpClientKit.get(EsbHttp.defaultHttpUrl, params).getBody();
|
|
@ -340,7 +341,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return (String) response_params;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Result getDataSet(Map<String, Object> params) throws Exception {
|
|
|
DataGridResult re = new DataGridResult();
|
|
|
if (StringUtils.isEmpty(params.get("datasetId"))) {
|
|
@ -426,7 +427,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return Result.success("删除成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public RsResourceMetadata getRsResourceMetadata(String id) throws Exception {
|
|
|
return resourceMetadataDao.getEntity(RsResourceMetadata.class, id);
|
|
|
}
|
|
@ -461,7 +462,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return Result.success("更新成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Result getMetaDataByDatasetId(String code, String datasetId) throws Exception {
|
|
|
if (StringUtils.isEmpty(code)) {
|
|
|
return new DataGridResult();
|
|
@ -531,19 +532,19 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return Result.success("导入成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public RsResourceDataset getLocalDataSetById(String datasetId) throws Exception {
|
|
|
return resourceDatasetDao.getEntity(RsResourceDataset.class, datasetId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Result getMetadataByLocalDatssetId(String datasetId) throws Exception {
|
|
|
ActionResult ar = new ActionResult();
|
|
|
ar.setData(resourceMetadataDao.getMetadataByLocalDatssetId(datasetId));
|
|
|
return ar;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Result getResourceAuthorize(String resourceId, String appId) throws Exception {
|
|
|
DataGridResult dr = new DataGridResult();
|
|
|
//查找该资源所对应的数据元
|
|
@ -592,7 +593,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return dr;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Result getMetaData(Map<String, Object> params) throws Exception {
|
|
|
DataGridResult re = new DataGridResult();
|
|
|
RsResourceMetadata rd = resourceMetadataDao.getEntity(RsResourceMetadata.class, (String) params.get("id"));
|
|
@ -602,7 +603,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Result getResourceApp(String resourceid) throws Exception {
|
|
|
ActionResult returnData = new ActionResult();
|
|
|
Map<String, Object> rsMap = new HashMap<String, Object>();
|
|
@ -682,7 +683,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return Result.success("更新成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Result getResourceAppList(String resourceId) throws Exception {
|
|
|
DataGridResult dgr = new DataGridResult();
|
|
|
List<RsAppResource> rars = appResourceDao.getAppResourceByResourceId(resourceId);
|
|
@ -740,12 +741,12 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return Result.success("修改成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public List<RsResourceDimensionModel> getDimensionByResourceId(String resourceId) throws Exception {
|
|
|
return resourceDimensionDao.getDimensionByResourceId(resourceId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public RsAppResourceDetail getAppResourceDetailId(String id) throws Exception {
|
|
|
return rsAppResourceDetailDao.getEntity(RsAppResourceDetail.class, id);
|
|
|
}
|
|
@ -758,7 +759,7 @@ public class RsResourceServiceImpl implements IRsResourceService {
|
|
|
return Result.success("保存成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public List<RsResourceMetadata> getResourceMetadataListColumn(String code) throws Exception {
|
|
|
return resourceMetadataDao.getMetadataByResourceId(code);
|
|
|
}
|