Compare commits

...

7 Commits

Author SHA1 Message Date
wangliwen 1c9a83fcd2 Merge branch 'master' of http://221.0.232.152:9393/ability-center/share-platform 2022-06-22 09:12:02 +08:00
wangliwen 6a07620ba3 配置统计时,资源是否归属上级 2022-06-22 09:11:39 +08:00
huangweixiong 5b2f0bef95 Merge branch 'master' of http://221.0.232.152:9393/ability-center/share-platform
* 'master' of http://221.0.232.152:9393/ability-center/share-platform:
  总应用数目
  知识库 文件类型导入问题
2022-06-21 21:31:42 +08:00
huangweixiong b531192f91 市局数据资源实现 2022-06-21 21:31:23 +08:00
huangweixiong 8e87eb848f Merge branch 'master' of http://221.0.232.152:9393/ability-center/share-platform
* 'master' of http://221.0.232.152:9393/ability-center/share-platform:
  修改数据资源对接方式
2022-06-21 20:54:04 +08:00
huangweixiong b1e489bc27 Merge branch 'master' of http://221.0.232.152:9393/ability-center/share-platform
* 'master' of http://221.0.232.152:9393/ability-center/share-platform: (49 commits)
  标识所有未读资源为已读
  排查加日志
  屮
  。。。
  通知的历史数据 来源处理
  通知来源类型
  基础设施
  用户表加字段
  云图数据资源总况
  1、修改获取金宏数据库中用户名和地区信息,将 JhUserTask和JhDeptTask删除,改为在SysUserController中分别通过/getDeptInfoFromJH和/getUserInfoFromJH手动调用。
  。。。
  1、将金宏数据库中用户和地区信息整合进来,并做成任务调度 JhUserTask和JhDeptTask,需要通过前端配置一下才能启动。
  基础设施统计接口
  。。。
  ...
  获取预览地址接口
  视频预览 工厂模式下各区域的实现
  ....
  ...
  现有区域配置文件 加入
  ...

# Conflicts:
#	renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java
2022-06-21 20:53:46 +08:00
huangweixiong 2a5334dc81 资源目录分页,排序,模糊查询 2022-06-21 20:47:14 +08:00
6 changed files with 107 additions and 15 deletions

View File

@ -42,6 +42,8 @@ import java.util.stream.Collectors;
public class CensusControllerV2 {
@Value("${project.place}")
private Integer projectPlace;
@Value("${project.higher}")
private Boolean higher;
private static final Logger logger = LoggerFactory.getLogger(CensusControllerV2.class);
@Autowired
@ -175,7 +177,7 @@ public class CensusControllerV2 {
String sql = String.format("SELECT COUNT(id) FROM tb_data_resource WHERE dept_id = %s AND type = '应用资源' AND del_flag = 0;", index.get("id").toString());
logger.info(sql);
Long count = jdbcTemplate.queryForObject(sql, Long.class);
if (!"0".equals(index.get("pid").toString())) { // 有上级部门
if (!"0".equals(index.get("pid").toString()) && higher) { // 有上级部门 配置资源归属上级
Optional<SysDeptDTO> sysDeptDTO =
Optional.ofNullable(sysDeptService.get(Long.valueOf(index.get("pid").toString())));
if (sysDeptDTO.isPresent() && sysDeptDTO.get().getType() != null && sysDeptDTO.get().getType() >= 2) {

View File

@ -16,12 +16,9 @@ import io.renren.modules.resource.dto.GetDataResourceListDto;
import io.renren.modules.resource.dto.ResourceDTO;
import io.renren.modules.resource.excel.ResourceExcelImportListener;
import io.renren.modules.resource.service.ResourceService;
import io.swagger.annotations.*;
import io.renren.modules.resource.videoPreview.AbstractVideoPreviewService;
import io.renren.modules.resource.videoPreview.VideoPreviewFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -41,6 +38,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
@ -304,19 +302,34 @@ public class ResourceController {
@GetMapping("ZywMessage/list")
@ApiOperation("资源列表转发")
public Result ZywMessageList(Integer page, Integer size) {
public Result ZywMessageList(@ApiParam("页数") Integer page,
@ApiParam("页大小") Integer size,
@ApiParam("排序字段fbrq发布日期syqk申请数量") String pxcol,
@ApiParam("排序方式取值asc/desc") String order,
@ApiParam("部门") String bmname,
@ApiParam("资源模糊搜索") String zyname) {
if (page == null) page = 1;
if (size == null) size = 10;
if (pxcol == null) pxcol = "fbrq";
if (order == null) order = "desc";
String url = "http://15.72.158.81/zyjk/ZywMessage.asmx";
String parame = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
" <soap:Body>\n" +
" <ZWCJ_mainPort xmlns=\"http://tempuri.org/\">\n" +
String.format("<pagenum>%d</pagenum>\n <pagesize>%d</pagesize>\n", page, size) +
" </ZWCJ_mainPort>\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
" <soap:Body><ZWCJ_mainPort xmlns=\"http://tempuri.org/\">\n" +
String.format("<pagenum>%d</pagenum>\n <pagesize>%d</pagesize>\n",page, size) +
String.format("<pxcol>%s</pxcol>\n <order>%s</order>\n",pxcol, order);
if (bmname != null){
parame = parame + String.format("<bmname>%s</bmname>",bmname);
}
if (zyname != null) {
parame = parame + String.format("<zyname>%s</zyname>",zyname);
}
parame = parame + "</ZWCJ_mainPort></soap:Body></soap:Envelope>";
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.set("SOAPAction", "http://tempuri.org/ZWCJ_mainPort");
requestHeaders.setContentType(MediaType.TEXT_XML);
requestHeaders.setContentType(new MediaType("text","xml", Charset.forName("utf-8")));
HttpEntity<String> requestEntity = new HttpEntity(parame, requestHeaders);
try {
String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody();

View File

@ -5,6 +5,7 @@ import io.renren.common.domain.BaoTouProperties;
import io.renren.common.domain.TsingtaoProperties;
import io.renren.common.domain.Tsingtao_xhaProperties;
import io.renren.common.utils.SpringContextUtils;
import io.renren.modules.resource.dataResource.domain.TsingtaoDataResourceService;
import io.renren.modules.resource.dataResource.domain.TsingtaoXHADataResourceService;
import io.renren.modules.resource.service.ResourceService;
import org.slf4j.Logger;
@ -43,6 +44,7 @@ public final class DataResourceFactory {
AbstractDataResourceService abstractDataResourceService = null;
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: { // 青岛市局
abstractDataResourceService = new TsingtaoDataResourceService();
}
break;
case TSINGTAO_XHA: { // 青岛西海岸

View File

@ -1,9 +1,24 @@
package io.renren.modules.resource.dataResource.domain;
import com.alibaba.fastjson.JSONObject;
import io.renren.common.utils.Result;
import io.renren.common.utils.SpringContextUtils;
import io.renren.modules.resource.dataResource.AbstractDataResourceService;
import io.renren.modules.resource.dto.GetDataResourceListDto;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 青岛市局数据资源
@ -11,8 +26,64 @@ import org.slf4j.LoggerFactory;
public class TsingtaoDataResourceService extends AbstractDataResourceService {
private static final Logger logger = LoggerFactory.getLogger(TsingtaoDataResourceService.class);
private static RestTemplate restTemplate;
{
TsingtaoDataResourceService.restTemplate = SpringContextUtils.getBean(RestTemplate.class);
}
@Override
public Object getDataResource(GetDataResourceListDto dto) {
return null;
Integer page = dto.getPageNum();
Integer size = dto.getPageSize();
String pxcol = dto.getOrderField();
String order = dto.getOrderType();
String bmname = dto.getServiceName();
String zyname = dto.getServiceName();
if (page == null) page = 1;
if (size == null) size = 10;
if (pxcol == null) pxcol = "fbrq";
if (order == null) order = "desc";
String url = "http://15.72.158.81/zyjk/ZywMessage.asmx";
String parame = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
" <soap:Body><ZWCJ_mainPort xmlns=\"http://tempuri.org/\">\n" +
String.format("<pagenum>%d</pagenum>\n <pagesize>%d</pagesize>\n",page, size) +
String.format("<pxcol>%s</pxcol>\n <order>%s</order>\n",pxcol, order);
if (bmname != null){
parame = parame + String.format("<bmname>%s</bmname>",bmname);
}
if (zyname != null) {
parame = parame + String.format("<zyname>%s</zyname>",zyname);
}
parame = parame + "</ZWCJ_mainPort></soap:Body></soap:Envelope>";
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.set("SOAPAction", "http://tempuri.org/ZWCJ_mainPort");
requestHeaders.setContentType(new MediaType("text","xml", Charset.forName("utf-8")));
HttpEntity<String> requestEntity = new HttpEntity(parame, requestHeaders);
try {
String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody();
String startTag = "<ZWCJ_mainPortResult>";
String endTag = "</ZWCJ_mainPortResult>";
String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag));
HashMap result = JSONObject.parseObject(json, HashMap.class);
List<Map> rows = (List<Map>) result.get("data");
List<Object> objects = rows.stream()
.filter(item -> item.get("main") != null)
.map(item -> item.get("main"))
.collect(Collectors.toList());
result.put("data", objects);
return result;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}

View File

@ -34,6 +34,8 @@ spring:
wall:
config:
multi-statement-allow: true
flyway:
enabled: false
#上传的静态资源配置
resource:
root_url: 15.2.21.238

View File

@ -1,6 +1,8 @@
project:
# 平台部署位置 0青岛市区 1青岛西海岸 2包头
# 平台部署位置 0青岛市区 1青岛西海岸 2包头
place: 0
# 是否将资源归为上级
higher: false
# 大数据部门相关配置
big_date:
name: 青岛市大数据发展管理局