Compare commits

..

No commits in common. "de75da4b68278b675a77fb79c34cd9339e4da68c" and "a8e4c6871a659670c2f4a8ad3916dfa94eb915e8" have entirely different histories.

35 changed files with 130 additions and 600 deletions

View File

@ -1 +0,0 @@
baotou.hlsurl=http://10.110.205.1:18088/server/device/hisdeviceapplylist/url/%s

View File

@ -1,7 +0,0 @@
tsingtao-xha.cloudhls=http://10.10.30.9:8001/hx-weatherwarning/camera/getCameraLiveStreamByCode?cameraCode=%s&protocol=hls
tsingtao-xha.localhls=http://10.134.135.9:8001/hx-weatherwarning/camera/getCameraLiveStreamByCode?cameraCode=%s&protocol=hls
tsingtao-xha.cloudcam=http://10.10.30.9:8001/hx-weather-warning/camera/getCameraListByName?name=%s&pageNo=%d&pageSize=%d
tsingtao-xha.localcam=http://10.134.135.9:8001/hx-weather-warning/camera/getCameraListByName?name=%s&pageNo=%d&pageSize=%d
tsingtao-xha.resourcecount=http://10.16.3.224:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=&type=&orderField=requestNum&orderType=desc&pageNum=1&pageSize=10&serviceType=data&rq=1655106309671.43
tsingtao-xha.resourceapplyinfo=http://10.134.135.24:30058/shareportal/platform/index/abilityMarket/count
tsingtao-xha.sjzy=http://10.16.3.224:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=%s&type=&orderField=%s&orderType=%s&pageNum=%s&pageSize=%s&serviceType=data&rq=1655106309671.43

View File

@ -304,8 +304,7 @@
<!-- 排除生产环境配置 -->
<exclude>application-prod.yml</exclude>
<!-- 排除flyway管理的sql -->
<exclude>db/*.sql</exclude>
<exclude>domain/**</exclude>
<!-- <exclude>db/*.sql</exclude>-->
</excludes>
</resource>
<resource>

View File

@ -172,7 +172,6 @@ public class ActivitiNoticeAspect {
dto.setSenderDate(new Date());
dto.setCreator(sysUserService.getByUsername("admin").getId());
dto.setCreateDate(new Date());
dto.setFrom("通知");
sysNoticeService.save(dto);
}).thenRunAsync(() -> {
// 防止重放
@ -320,7 +319,6 @@ public class ActivitiNoticeAspect {
String finalCreator = creator;
CompletableFuture.runAsync(() -> { // 发起人
SysUserDTO assignee = sysUserService.get(Long.valueOf(delegateTask.getAssignee()));
logger.error("审核人:" + assignee.getId());
String content = "【通知】您发起的流程 " + activitiNoticeOperation.process() + " 当前审核节点为:" + activitiNoticeOperation.value() + ";当前审核人为:\"" + assignee.getDeptName() + "\"审核负责人\"" + assignee.getRealName() + "\"";
SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(2);

View File

@ -10,8 +10,6 @@ import io.renren.common.constant.Constant;
import io.renren.common.domain.Tsingtao_xhaProperties;
import io.renren.common.utils.Result;
import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.resource.dataResource.domain.TsingtaoDataResourceService;
import io.renren.modules.resource.dto.GetDataResourceListDto;
import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.resourceBrowse.service.ResourceBrowseService;
import io.renren.modules.sys.dto.SysDeptDTO;
@ -22,7 +20,6 @@ import io.swagger.annotations.ApiOperation;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,8 +42,6 @@ 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
@ -121,7 +116,7 @@ public class CensusControllerV2 {
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
CompletableFuture<Void> allApplicationAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总应用数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='应用资源' AND del_flag = 0;", Long.class);
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='应用资源';", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
@ -180,7 +175,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()) && higher) { // 有上级部门 配置资源归属上级
if (!"0".equals(index.get("pid").toString())) { // 有上级部门
Optional<SysDeptDTO> sysDeptDTO =
Optional.ofNullable(sysDeptService.get(Long.valueOf(index.get("pid").toString())));
if (sysDeptDTO.isPresent() && sysDeptDTO.get().getType() != null && sysDeptDTO.get().getType() >= 2) {
@ -200,7 +195,7 @@ public class CensusControllerV2 {
re.put("deptName", sysDeptService.get(Long.valueOf(index)).getName());
re.put("count", i.get(index).stream().mapToLong(index_ -> index_.values().stream().mapToLong(count_ -> count_).sum()).sum());
return re;
}).filter(index -> ObjectUtils.allNotNull(index)).collect(Collectors.toList());
}).collect(Collectors.toList());
result.sort(Comparator.comparing(x -> {
ObjectMapper mapper = new ObjectMapper();
try {
@ -319,7 +314,6 @@ public class CensusControllerV2 {
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
CompletableFuture<Void> allAmount = null;
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: // 青岛市局
case BAOTOU: { // 包头
allAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总基础设施数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type = '基础设施' AND del_flag = 0", Long.class);
@ -333,15 +327,26 @@ public class CensusControllerV2 {
});
}
break;
case TSINGTAO: { // 青岛大数据局
allAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总基础设施数目
return jdbcTemplate.queryForObject("SELECT COUNT(*) FROM t_camera;", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "视频资源数量");
}
});
});
}
break;
case TSINGTAO_XHA: { // 青岛西海岸
allAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总基础设施数目
List<Long> result_ = new CopyOnWriteArrayList<>();
CompletableFuture cloud =
CompletableFuture.runAsync(() -> { // 云脑专网
OkHttpClient client = new OkHttpClient();
String url = String.format(tsingtao_xhaProperties.getCloudcam(), "", 1, 10);
logger.info(url);
Request request = new Request.Builder().url(url).build();
Request request = new Request.Builder().url(tsingtao_xhaProperties.getCloudcam()).build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
JSONObject jsonObject = JSON.parseObject(response.body().string());
@ -349,18 +354,16 @@ public class CensusControllerV2 {
result_.add(jsonObject.getJSONObject("data").getLongValue("total"));
}
} else {
logger.error("青岛西海岸获取失败");
logger.error("包头获取失败");
}
} catch (Exception exception) {
logger.error("青岛西海岸失败", exception);
logger.error("包头失败", exception);
}
});
CompletableFuture local =
CompletableFuture.runAsync(() -> { // 金宏网
OkHttpClient client = new OkHttpClient();
String url = String.format(tsingtao_xhaProperties.getLocalcam(), "", 1, 10);
logger.info(url);
Request request = new Request.Builder().url(url).build();
Request request = new Request.Builder().url(tsingtao_xhaProperties.getLocalcam()).build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
JSONObject jsonObject = JSON.parseObject(response.body().string());
@ -368,10 +371,10 @@ public class CensusControllerV2 {
result_.add(jsonObject.getJSONObject("data").getLongValue("total"));
}
} else {
logger.error("青岛西海岸获取失败");
logger.error("包头获取失败");
}
} catch (Exception exception) {
logger.error("青岛西海岸失败", exception);
logger.error("包头失败", exception);
}
});
CompletableFuture.allOf(cloud, local);
@ -428,21 +431,15 @@ public class CensusControllerV2 {
}
break;
case TSINGTAO: { // TODO 青岛大数据局
TsingtaoDataResourceService tsingtaoDataResourceService = new TsingtaoDataResourceService();
GetDataResourceListDto getDataResourceListDto = new GetDataResourceListDto();
getDataResourceListDto.setPageNum(1);
getDataResourceListDto.setPageSize(5);
JSONObject dataResource = (JSONObject) tsingtaoDataResourceService.getDataResource(getDataResourceListDto);
JSONObject data = dataResource.getJSONObject("data");
result.add(new HashMap<String, Object>() {
{
put("amount", data.get("rows"));
put("amount", 0L);
put("type", "总数据量");
}
});
result.add(new HashMap<String, Object>() {
{
put("amount", 0L);
put("amount", 0l);
put("type", "总申请次数");
}
});
@ -454,7 +451,7 @@ public class CensusControllerV2 {
});
result.add(new HashMap<String, Object>() {
{
put("resourceTop5", data.get("data"));
put("resourceTop5", new ArrayList<>());
}
});
}
@ -471,10 +468,10 @@ public class CensusControllerV2 {
total = jsonObject.getJSONObject("data").getLongValue("total");
}
} else {
logger.error("青岛西海岸获取失败");
logger.error("包头获取失败");
}
} catch (Exception exception) {
logger.error("青岛西海岸失败", exception);
logger.error("包头失败", exception);
}
return total;
}).thenAccept(sum -> {
@ -518,10 +515,10 @@ public class CensusControllerV2 {
}
} else {
logger.error("青岛西海岸获取失败");
logger.error("包头获取失败");
}
} catch (Exception exception) {
logger.error("青岛西海岸失败", exception);
logger.error("包头失败", exception);
}
});
}

View File

@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
*/
@Data
@Component
@PropertySource("file:config/domain/baotou.properties")
@PropertySource("classpath:/domain/baotou.properties")
@ConfigurationProperties(prefix = "baotou")
public class BaoTouProperties {
private String hlsurl;

View File

@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
*/
@Data
@Component
@PropertySource("file:config/domain/tsingtao.properties")
@PropertySource("classpath:/domain/tsingtao.properties")
@ConfigurationProperties(prefix = "tsingtao")
public class TsingtaoProperties {

View File

@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
*/
@Data
@Component
@PropertySource("file:config/domain/tsingtao-xha.properties")
@PropertySource("classpath:/domain/tsingtao-xha.properties")
@ConfigurationProperties(prefix = "tsingtao-xha")
public class Tsingtao_xhaProperties {
private String cloudhls;
@ -20,5 +20,4 @@ public class Tsingtao_xhaProperties {
private String localcam;
private String resourcecount;
private String resourceapplyinfo;
private String sjzy;
}

View File

@ -91,7 +91,6 @@ public class TDemandCommentServiceImpl extends CrudServiceImpl<TDemandCommentDao
dto.setSenderDate(new Date());
dto.setCreator(sysUserService.getByUsername("admin").getId());
dto.setCreateDate(new Date());
dto.setFrom("评论");
sysNoticeService.save(dto);
});
}

View File

@ -17,15 +17,10 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Arrays;
import java.util.Map;
@ -38,13 +33,10 @@ import java.util.Map;
@RequestMapping("sys/notice")
@Api(tags = "通知管理")
public class SysNoticeController {
private static Logger logger = LoggerFactory.getLogger(SysNoticeController.class);
@Autowired
private SysNoticeService sysNoticeService;
@Autowired
private SysNoticeUserService sysNoticeUserService;
@Autowired
private JdbcTemplate jdbcTemplate;
@GetMapping("page")
@ApiOperation("分页")
@ -83,8 +75,7 @@ public class SysNoticeController {
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "readStatus", value = "阅读状态 0未读 1已读", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "from", value = "通知来源 (通知、评论、其他)", paramType = "query", dataType = "String")
@ApiImplicitParam(name = "readStatus", value = "阅读状态 0未读 1已读", paramType = "query", dataType = "Integer")
})
public Result<PageData<SysNoticeDTO>> myNoticePage(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<SysNoticeDTO> page = sysNoticeService.getMyNoticePage(params);
@ -94,26 +85,9 @@ public class SysNoticeController {
@PutMapping("mynotice/read/{noticeId}")
@ApiOperation("标记我的通知为已读")
public Result read(@PathVariable("noticeId") String noticeId) {
if (StringUtils.isNotEmpty(noticeId) && noticeId.contains(";")) {
String[] noticeIds = noticeId.split(";");
Arrays.asList(noticeIds).stream().distinct().forEach(index -> {
try {
sysNoticeUserService.updateReadStatus(SecurityUser.getUserId(), Long.valueOf(index));
} catch (Exception exception) {
logger.error("标识已读失败", exception);
}
});
} else {
sysNoticeUserService.updateReadStatus(SecurityUser.getUserId(), Long.valueOf(noticeId));
}
return new Result();
}
public Result read(@PathVariable("noticeId") Long noticeId) {
sysNoticeUserService.updateReadStatus(SecurityUser.getUserId(), noticeId);
@PutMapping("mynotice/readall")
@ApiOperation("标记我的所有未读通知为已读")
public Result readAll() {
jdbcTemplate.update(String.format("UPDATE sys_notice_user SET read_status = 1,read_date =NOW() WHERE receiver_id = %s AND read_status = 0;"), SecurityUser.getUserId().toString());
return new Result();
}

View File

@ -48,6 +48,4 @@ public class SysNoticeDTO implements Serializable {
private Date readDate;
@ApiModelProperty(value = "阅读状态 0未读 1已读")
private Integer readStatus;
@ApiModelProperty(value = "通知来源 (通知、评论、其他)")
private String from;
}

View File

@ -10,63 +10,59 @@ import java.util.Date;
/**
* 通知管理
*
*/
@Data
@EqualsAndHashCode(callSuper = false)
@EqualsAndHashCode(callSuper=false)
@TableName("sys_notice")
public class SysNoticeEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* 通知类型
*/
private Integer type;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 接收者 0全部 1部门
*/
private Integer receiverType;
/**
* 接收者ID用逗号分开
*/
private String receiverTypeIds;
/**
* 发送状态 0草稿 1已发布
*/
private Integer status;
/**
* 发送者
*/
private String senderName;
/**
* 发送时间
*/
private Date senderDate;
/**
* 接收者
*/
@TableField(exist = false)
private String receiverName;
/**
* 阅读状态 0未读 1已读
*/
@TableField(exist = false)
private Integer readStatus;
/**
* 阅读时间
*/
@TableField(exist = false)
private Date readDate;
/**
* 通知来源 (通知评论其他)
*/
private String from;
/**
* 通知类型
*/
private Integer type;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 接收者 0全部 1部门
*/
private Integer receiverType;
/**
* 接收者ID用逗号分开
*/
private String receiverTypeIds;
/**
* 发送状态 0草稿 1已发布
*/
private Integer status;
/**
* 发送者
*/
private String senderName;
/**
* 发送时间
*/
private Date senderDate;
/**
* 接收者
*/
@TableField(exist = false)
private String receiverName;
/**
* 阅读状态 0未读 1已读
*/
@TableField(exist = false)
private Integer readStatus;
/**
* 阅读时间
*/
@TableField(exist = false)
private Date readDate;
}

View File

@ -44,17 +44,10 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
@Override
public QueryWrapper<SysNoticeEntity> getWrapper(Map<String, Object> params) {
String type = (String) params.get("type");
QueryWrapper<SysNoticeEntity> wrapper = new QueryWrapper<>();
params.keySet().stream().filter(index -> null != params.get(index)).forEach(index -> {
switch (index) {
case "type":
wrapper.eq(StringUtils.isNotBlank((String) params.get("type")), "type", (String) params.get("type"));
break;
case "from":
wrapper.eq(StringUtils.isNotBlank((String) params.get("from")), "`from`", (String) params.get("from"));
break;
}
});
wrapper.eq(StringUtils.isNotBlank(type), "type", type);
wrapper.orderByDesc(Constant.CREATE_DATE);
return wrapper;
}
@ -86,7 +79,6 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
@Transactional(rollbackFor = Exception.class)
public void save(SysNoticeDTO dto) {
SysNoticeEntity entity = ConvertUtils.sourceToTarget(dto, SysNoticeEntity.class);
entity.setFrom("其它"); // 站内信通知来源 (通知评论其它)
//更新发送者信息
if (dto.getStatus() == NoticeStatusEnum.SEND.value() && StringUtils.isEmpty(dto.getSenderName())) {

View File

@ -10,15 +10,15 @@ import io.renren.common.utils.Result;
import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.modules.resource.dataResource.AbstractDataResourceService;
import io.renren.modules.resource.dataResource.DataResourceFactory;
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;
@ -38,7 +38,6 @@ 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.*;
@ -302,34 +301,19 @@ public class ResourceController {
@GetMapping("ZywMessage/list")
@ApiOperation("资源列表转发")
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";
public Result ZywMessageList(Integer page, Integer size) {
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" +
" <soap:Body>\n" +
" <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>";
" </ZWCJ_mainPort>\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.set("SOAPAction", "http://tempuri.org/ZWCJ_mainPort");
requestHeaders.setContentType(new MediaType("text", "xml", Charset.forName("utf-8")));
requestHeaders.setContentType(MediaType.TEXT_XML);
HttpEntity<String> requestEntity = new HttpEntity(parame, requestHeaders);
try {
String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody();
@ -339,6 +323,8 @@ public class ResourceController {
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"))
@ -415,25 +401,15 @@ public class ResourceController {
}
*/
@GetMapping("/hls/getHls")
@GetMapping("getHls")
@ApiOperation("对接知识库数据")
public Result<String> getHls(String key) {
Optional<AbstractVideoPreviewService> factory = VideoPreviewFactory.build();
if (factory.isPresent()) {
String hls = factory.get().getHls(key);
return new Result<String>().ok(hls);
}
return new Result<String>().ok(null);
}
@PostMapping("/getDataResource")
@ApiOperation("获取数据资源")
public Result<Object> getDataResource(@RequestBody GetDataResourceListDto dto) {
Optional<AbstractDataResourceService> factory = DataResourceFactory.build();
if (factory.isPresent()) {
Object dataResource = factory.get().getDataResource(dto);
return new Result<Object>().ok(dataResource);
}
return null;
}
}

View File

@ -1,20 +0,0 @@
package io.renren.modules.resource.dataResource;
import io.renren.modules.resource.dto.GetDataResourceListDto;
import java.util.Map;
/**
* 视频预览抽象类
*/
public abstract class AbstractDataResourceService {
/**
* 获取数据资源列表
*
* @param Map 查询参数集合
* @return
*/
public abstract Object getDataResource(GetDataResourceListDto dto);
}

View File

@ -1,61 +0,0 @@
package io.renren.modules.resource.dataResource;
import io.renren.common.constant.Constant;
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;
import org.slf4j.LoggerFactory;
import java.util.Optional;
/**
* 数据资源工厂类
*/
public final class DataResourceFactory {
private static final Logger logger = LoggerFactory.getLogger(DataResourceFactory.class);
private static ResourceService resourceService;
private static int projectPlace;
private static TsingtaoProperties tsingtaoProperties; // 青岛市区配置
private static Tsingtao_xhaProperties tsingtao_xhaProperties; // 青岛西海岸配置
static {
DataResourceFactory.resourceService = SpringContextUtils.getBean(ResourceService.class);
DataResourceFactory.projectPlace = resourceService.getProjectPlace();
DataResourceFactory.tsingtaoProperties = SpringContextUtils.getBean(TsingtaoProperties.class);
DataResourceFactory.tsingtao_xhaProperties = SpringContextUtils.getBean(Tsingtao_xhaProperties.class);
}
/**
* 获取数据资源服务实现
*
* @return
*/
public static Optional<AbstractDataResourceService> build() {
AbstractDataResourceService abstractDataResourceService = null;
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: { // 青岛市局
abstractDataResourceService = new TsingtaoDataResourceService();
}
break;
case TSINGTAO_XHA: { // 青岛西海岸
abstractDataResourceService = new TsingtaoXHADataResourceService(tsingtao_xhaProperties);
}
break;
case UNKNOWN: { // 未知区域
logger.error("区域未知");
}
break;
}
return Optional.ofNullable(abstractDataResourceService);
}
}

View File

@ -1,85 +0,0 @@
package io.renren.modules.resource.dataResource.domain;
import com.alibaba.fastjson.JSONObject;
import io.renren.common.utils.SpringContextUtils;
import io.renren.modules.resource.dataResource.AbstractDataResourceService;
import io.renren.modules.resource.dto.GetDataResourceListDto;
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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 青岛市局数据资源
*/
public class TsingtaoDataResourceService extends AbstractDataResourceService {
private static final Logger logger = LoggerFactory.getLogger(TsingtaoDataResourceService.class);
private static RestTemplate restTemplate;
static {
TsingtaoDataResourceService.restTemplate = SpringContextUtils.getBean(RestTemplate.class);
}
@Override
public Object getDataResource(GetDataResourceListDto dto) {
Integer page = dto.getPageNum();
Integer size = dto.getPageSize();
String pxcol = dto.getOrderField();
String order = dto.getOrderType();
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

@ -1,46 +0,0 @@
package io.renren.modules.resource.dataResource.domain;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.renren.common.domain.Tsingtao_xhaProperties;
import io.renren.modules.resource.dataResource.AbstractDataResourceService;
import io.renren.modules.resource.dto.GetDataResourceListDto;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 青岛西海岸数据资源
*/
public class TsingtaoXHADataResourceService extends AbstractDataResourceService {
private static final Logger logger = LoggerFactory.getLogger(TsingtaoXHADataResourceService.class);
Tsingtao_xhaProperties tsingtao_xhaProperties;
public TsingtaoXHADataResourceService(Tsingtao_xhaProperties tsingtao_xhaProperties) {
this.tsingtao_xhaProperties = tsingtao_xhaProperties;
}
@Override
public Object getDataResource(GetDataResourceListDto dto){
JSONObject result = null;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url(String.format(tsingtao_xhaProperties.getSjzy(),
dto.getServiceName(), dto.getOrderField(), dto.getOrderType(), dto.getPageNum(), dto.getPageSize())).build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
JSONObject jsonObject = JSON.parseObject(response.body().string());
if (jsonObject.containsKey("data")) {
result = jsonObject.getJSONObject("data");
}
} else {
logger.error("西海岸数据资源列表获取失败");
}
} catch (Exception exception) {
logger.error("西海岸数据资源列表获取失败", exception);
}
return result;
}
}

View File

@ -1,21 +0,0 @@
package io.renren.modules.resource.dto;
import lombok.Data;
/**
* 数据资源查询参数对象
*/
@Data
public class GetDataResourceListDto {
//名称模糊查询
private String serviceName;
//排序字段
private String orderField;
//排序方式descasc
private String orderType;
//分页页数
private Integer pageNum;
//分页大小
private Integer pageSize;
}

View File

@ -338,7 +338,7 @@ public class ResourceExcelImportListener extends AnalysisEventListener<Map<Integ
AttrEntity attrEntity = new AttrEntity();
attrEntity.setAttrType("文件类型");
attrEntity.setAttrValue(date.get(5));
attrEntity.setAttrValue(date.get(6));
infoList.add(attrEntity);

View File

@ -9,8 +9,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.renren.common.constant.Constant;
import io.renren.common.domain.Tsingtao_xhaProperties;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.resource.dao.AttrDao;
import io.renren.modules.resource.dao.ResourceDao;
@ -40,8 +38,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.*;
@ -117,9 +113,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
private Tsingtao_xhaProperties tsingtao_xhaProperties;
@Override
public QueryWrapper<ResourceEntity> getWrapper(Map<String, Object> params) {
QueryWrapper<ResourceEntity> wrapper = new QueryWrapper<>();
@ -228,142 +221,24 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
String orderField = StringUtils.isBlank(jsonObject.getString("orderField")) ? "total" : jsonObject.getString("orderField");
String orderType = StringUtils.isBlank(jsonObject.getString("orderType")) ? "DESC" : jsonObject.getString("orderType");
Page<ResourceDTO> resultPage = new Page<>(pageNum, pageSize);
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO:
case BAOTOU: { // 包头青岛
logger.info("包头、青岛");
if (resourceDTO.getInfoList().isEmpty()) {
List<ResourceDTO> resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType);
resultPage.setRecords(resourceDTOS);
resultPage.setTotal(resourceDao.selectDTOPage(resourceDTO, 0, 100000, orderField, orderType).size());
} else {
List<ResourceDTO> resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType);
int j = Math.min(pageNum * pageSize, resourceDTOS.size());
if (resourceDTOS.isEmpty()) {
resultPage.setRecords(null);
resultPage.setTotal(0);
} else {
ArrayList<ResourceDTO> recordLists = new ArrayList<>();
for (int i = (pageNum - 1) * pageSize; i < j; i++) {
recordLists.add(resourceDTOS.get(i));
}
resultPage.setRecords(recordLists);
resultPage.setTotal(resourceDTOS.size());
}
if (resourceDTO.getInfoList().isEmpty()) {
List<ResourceDTO> resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType);
resultPage.setRecords(resourceDTOS);
resultPage.setTotal(resourceDao.selectDTOPage(resourceDTO, 0, 100000, orderField, orderType).size());
} else {
List<ResourceDTO> resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType);
int j = Math.min(pageNum * pageSize, resourceDTOS.size());
if (resourceDTOS.isEmpty()) {
resultPage.setRecords(null);
resultPage.setTotal(0);
} else {
ArrayList<ResourceDTO> recordLists = new ArrayList<>();
for (int i = (pageNum - 1) * pageSize; i < j; i++) {
recordLists.add(resourceDTOS.get(i));
}
resultPage.setRecords(recordLists);
resultPage.setTotal(resourceDTOS.size());
}
break;
case TSINGTAO_XHA: {
if ("基础设施".equals(resourceDTO.getType())) { // 基础设施
logger.info("西海岸基础设施");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
CompletableFuture cloud =
CompletableFuture.runAsync(() -> { // 云脑专网
OkHttpClient client = new OkHttpClient();
String url = String.format(tsingtao_xhaProperties.getCloudcam(), resourceDTO.getName(), pageNum, pageSize);
logger.info(url);
Request request = new Request.Builder().url(url).build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
JSONObject jsonObject_ = JSON.parseObject(response.body().string());
if (jsonObject_.containsKey("data")) {
if (jsonObject_.getJSONObject("data").containsKey("list")) {
resultPage.setTotal(jsonObject_.getJSONObject("data").getLongValue("total"));
resultPage.setRecords(jsonObject_.getJSONObject("data").getJSONArray("list").stream().map(index -> (JSONObject) JSON.toJSON(index))
.map(index -> {
ResourceDTO resourceDTO1 = new ResourceDTO();
resourceDTO1.setId(Long.valueOf(index.getString("id")));
resourceDTO1.setDelFlag(index.getIntValue("delFlag"));
resourceDTO1.setLink(index.getString("cameraIndexCode"));
resourceDTO1.setName(index.getString("name"));
resourceDTO1.setType("基础设施");
try {
resourceDTO1.setCreateDate(sdf.parse(index.getString("createdTime")));
} catch (ParseException e) {
logger.error("时间异常");
resourceDTO1.setCreateDate(new Date());
}
return resourceDTO1;
}).collect(Collectors.toList()));
} else {
resultPage.setRecords(null);
resultPage.setTotal(0);
}
}
} else {
logger.error("获取失败");
}
} catch (Exception exception) {
logger.error("失败", exception);
}
});
CompletableFuture local =
CompletableFuture.runAsync(() -> { // 金宏网
OkHttpClient client = new OkHttpClient();
String url = String.format(tsingtao_xhaProperties.getLocalcam(), resourceDTO.getName(), pageNum, pageSize);
logger.info(url);
Request request = new Request.Builder().url(url).build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
JSONObject jsonObject_ = JSON.parseObject(response.body().string());
if (jsonObject_.containsKey("data")) {
if (jsonObject_.getJSONObject("data").containsKey("list")) {
resultPage.setTotal(jsonObject_.getJSONObject("data").getLongValue("total"));
resultPage.setRecords(jsonObject_.getJSONObject("data").getJSONArray("list").stream().map(index -> (JSONObject) JSON.toJSON(index))
.map(index -> {
ResourceDTO resourceDTO1 = new ResourceDTO();
resourceDTO1.setId(Long.valueOf(index.getString("id")));
resourceDTO1.setDelFlag(index.getIntValue("delFlag"));
resourceDTO1.setLink(index.getString("cameraIndexCode"));
resourceDTO1.setName(index.getString("name"));
resourceDTO1.setType("基础设施");
try {
resourceDTO1.setCreateDate(sdf.parse(index.getString("createdTime")));
} catch (ParseException e) {
logger.error("时间异常");
resourceDTO1.setCreateDate(new Date());
}
return resourceDTO1;
}).collect(Collectors.toList()));
} else {
resultPage.setRecords(null);
resultPage.setTotal(0);
}
}
} else {
logger.error("获取失败");
}
} catch (Exception exception) {
logger.error("失败", exception);
}
});
CompletableFuture.allOf(cloud, local);
} else {
logger.info("西海岸基普通");
if (resourceDTO.getInfoList().isEmpty()) {
List<ResourceDTO> resourceDTOS = resourceDao.selectDTOPage(resourceDTO, (pageNum - 1) * pageSize, pageSize, orderField, orderType);
resultPage.setRecords(resourceDTOS);
resultPage.setTotal(resourceDao.selectDTOPage(resourceDTO, 0, 100000, orderField, orderType).size());
} else {
List<ResourceDTO> resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType);
int j = Math.min(pageNum * pageSize, resourceDTOS.size());
if (resourceDTOS.isEmpty()) {
resultPage.setRecords(null);
resultPage.setTotal(0);
} else {
ArrayList<ResourceDTO> recordLists = new ArrayList<>();
for (int i = (pageNum - 1) * pageSize; i < j; i++) {
recordLists.add(resourceDTOS.get(i));
}
resultPage.setRecords(recordLists);
resultPage.setTotal(resourceDTOS.size());
}
}
}
}
break;
}
return resultPage;
}
@ -515,9 +390,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
HashMap<Object, Object> areaMap = new HashMap<>();
areaMap.put("type", "区级");
Integer integer = resourceDao.selectTypeCountByDept("区级", jsonObject.getString("type"));
if (null == integer) {
integer = 0;
}
areaMap.put("total", integer);
ArrayList<Map> areaListTemp = new ArrayList<>();
areaTypeList.orElse(new HashMap<>()).forEach((key, value) -> {

View File

@ -1,5 +1,6 @@
package io.renren.modules.resource.videoPreview;
import io.renren.common.constant.Constant;
import io.renren.common.domain.BaoTouProperties;
import io.renren.common.domain.TsingtaoProperties;

View File

@ -10,7 +10,6 @@ import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.resourceBrowse.dto.ResourceBrowseDTO;
import io.renren.modules.resourceBrowse.excel.ResourceBrowseExcel;
import io.renren.modules.resourceBrowse.service.ResourceBrowseService;
@ -39,8 +38,6 @@ import java.util.Map;
public class ResourceBrowseController {
@Autowired
private ResourceBrowseService resourceBrowseService;
@Autowired
private ResourceService resourceService;
@GetMapping("/page")
@ApiOperation("分页")
@ -48,12 +45,12 @@ public class ResourceBrowseController {
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String"),
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
//@RequiresPermissions("resourceBrowse:resourcebrowse:page")
public Result<PageData<ResourceBrowseDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<ResourceBrowseDTO> page = resourceBrowseService.page(params);
page.getList().forEach(item -> item.setResourceDTO(resourceService.get(item.getResourceId())));
return new Result<PageData<ResourceBrowseDTO>>().ok(page);
}

View File

@ -1,6 +1,5 @@
package io.renren.modules.resourceBrowse.dto;
import io.renren.modules.resource.dto.ResourceDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -42,9 +41,4 @@ public class ResourceBrowseDTO implements Serializable {
@ApiModelProperty(value = "备用字段3")
private String note3;
@ApiModelProperty(value = "能力信息")
private ResourceDTO resourceDTO;
}

View File

@ -25,7 +25,6 @@ public class ResourceBrowseServiceImpl extends CrudServiceImpl<ResourceBrowseDao
@Autowired
private ResourceBrowseDao resourceBrowseDao;
@Value("${system.startDay}")
private String systemDay;

View File

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

View File

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

View File

@ -51,7 +51,6 @@
<include>*.properties</include>
<include>*.json</include>
<include>db/*.sql</include>
<include>domain/**</include>
</includes>
<excludes>
<exclude>application-prod.yml</exclude>

View File

@ -1,3 +0,0 @@
UPDATE sys_notice SET `from` = '评论' WHERE title LIKE '需求%';
UPDATE sys_notice SET `from` = '通知' WHERE title LIKE '流程%';
UPDATE sys_notice SET `from` = '其他' WHERE title IS NULL;

View File

@ -1 +0,0 @@
ALTER TABLE `sys_user` ADD COLUMN `guid` varchar(100) NULL;

View File

@ -1 +0,0 @@
ALTER TABLE `sys_notice` ADD COLUMN `from` varchar(255) NULL COMMENT '通知来源';

View File

@ -1,7 +1,6 @@
tsingtao-xha.cloudhls=http://10.10.30.9:8001/hx-weatherwarning/camera/getCameraLiveStreamByCode?cameraCode=%s&protocol=hls
tsingtao-xha.localhls=http://10.134.135.9:8001/hx-weatherwarning/camera/getCameraLiveStreamByCode?cameraCode=%s&protocol=hls
tsingtao-xha.cloudcam=http://10.10.30.9:8001/hx-weather-warning/camera/getCameraListByName?name=%s&pageNo=%d&pageSize=%d
tsingtao-xha.localcam=http://10.134.135.9:8001/hx-weather-warning/camera/getCameraListByName?name=%s&pageNo=%d&pageSize=%d
tsingtao-xha.cloudcam=http://10.10.30.9:8001/hx-weather-warning/camera/getCameraListByName?name=&pageNo=1&pageSize=10
tsingtao-xha.localcam=http://10.134.135.9:8001/hx-weather-warning/camera/getCameraListByName?name=&pageNo=1&pageSize=10
tsingtao-xha.resourcecount=http://10.16.3.224:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=&type=&orderField=requestNum&orderType=desc&pageNum=1&pageSize=10&serviceType=data&rq=1655106309671.43
tsingtao-xha.resourceapplyinfo=http://10.134.135.24:30058/shareportal/platform/index/abilityMarket/count
tsingtao-xha.sjzy=http://10.16.3.224:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=%s&type=&orderField=%s&orderType=%s&pageNum=%s&pageSize=%s&serviceType=data&rq=1655106309671.43
tsingtao-xha.resourceapplyinfo=http://10.134.135.24:30058/shareportal/platform/index/abilityMarket/count

View File

@ -11,15 +11,11 @@
<!-- 获取我的通知列表 -->
<select id="getMyNoticeList" resultType="io.renren.modules.notice.entity.SysNoticeEntity">
select t2.id, t2.title, t2.type, t2.sender_name, t2.sender_date, t1.read_status, t2.content ,t2.`from` from
sys_notice_user t1, sys_notice t2
select t2.id, t2.title, t2.type, t2.sender_name, t2.sender_date, t1.read_status, t2.content from sys_notice_user t1, sys_notice t2
where t1.notice_id = t2.id and t1.receiver_id = #{receiverId}
<if test="readStatus != null">
AND read_status = #{readStatus}
</if>
<if test="from != null">
AND `from` = #{from}
</if>
order by t2.create_date desc
</select>
</mapper>

View File

@ -215,11 +215,6 @@ public interface Constant {
}
}
/**
* 项目部署地点
*/
String PROJECT_PLACE = "PROJECT_PLACE";
/**
* 项目运行地点
*/