Merge remote-tracking branch 'origin/main'
# Conflicts: # kn-service/biz-vordm/src/main/java/com/kening/vordm/mapper/NewsMapper.java # kn-service/biz-vordm/src/main/java/com/kening/vordm/mapper/NewsMapper.xml # kn-service/biz-vordm/src/main/java/com/kening/vordm/service/NewsService.java # kn-service/biz-vordm/src/main/java/com/kening/vordm/service/impl/NewsServiceImpl.java
This commit is contained in:
commit
d634e1037c
|
@ -21,9 +21,9 @@ public class DownloadRecord implements Serializable {
|
|||
private Integer id;
|
||||
|
||||
/**
|
||||
* 灾害id
|
||||
* 灾害id,审批通过后生成
|
||||
*/
|
||||
private Integer diasterId;
|
||||
private String vordmId;
|
||||
|
||||
/**
|
||||
* 大的数据源:1为新闻资讯,2为社交媒体,3实体数据
|
||||
|
|
|
@ -54,9 +54,9 @@ public class EntityData implements Serializable {
|
|||
private Date uploadTime;
|
||||
|
||||
/**
|
||||
* 灾害id
|
||||
* vordm-id
|
||||
*/
|
||||
private Integer disasterId;
|
||||
private String vordmId;
|
||||
|
||||
/**
|
||||
* 可视化可视化标志0-不可可视化;1-表示可以可视化
|
||||
|
|
|
@ -37,9 +37,9 @@ public class Hotspot implements Serializable {
|
|||
private Integer frequency;
|
||||
|
||||
/**
|
||||
* 灾害id
|
||||
* 灾害id,审批通过后生成
|
||||
*/
|
||||
private Integer disasterId;
|
||||
private String vordmId;
|
||||
|
||||
/**
|
||||
* 数据条目创建时间
|
||||
|
|
|
@ -26,9 +26,9 @@ public class MapServer implements Serializable {
|
|||
private String name;
|
||||
|
||||
/**
|
||||
* 灾害id
|
||||
* 灾害id,审批通过后生成
|
||||
*/
|
||||
private Integer disasterId;
|
||||
private String vordmId;
|
||||
|
||||
/**
|
||||
* 缩放纬度
|
||||
|
|
|
@ -37,9 +37,9 @@ public class PictureInfo implements Serializable {
|
|||
private String type;
|
||||
|
||||
/**
|
||||
* 灾害id
|
||||
* 灾害id,审批通过后生成
|
||||
*/
|
||||
private Integer disasterId;
|
||||
private String vordmId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
|
|
@ -36,9 +36,9 @@ public class ResponseInfo implements Serializable {
|
|||
private Integer managerId;
|
||||
|
||||
/**
|
||||
* 灾害id
|
||||
* 灾害id,审批通过后生成
|
||||
*/
|
||||
private Integer disasterId;
|
||||
private String vordmId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -38,9 +38,9 @@ public class Websites implements Serializable {
|
|||
private String provider;
|
||||
|
||||
/**
|
||||
* 灾害id
|
||||
* 灾害id,审批通过后生成
|
||||
*/
|
||||
private Integer disasterId;
|
||||
private String vordmId;
|
||||
|
||||
/**
|
||||
* 数据条目创建时间
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package com.kening.vordm.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wanghongqing
|
||||
* @date 2023/3/31 09:46
|
||||
**/
|
||||
@Data
|
||||
public class DisasterInfo {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String content;
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.kening.vordm.vo;
|
||||
|
||||
import com.kening.vordm.entity.DisasterInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author wanghongqing
|
||||
* @date 2023/3/31 09:46
|
||||
**/
|
||||
@Getter
|
||||
@Setter
|
||||
public class DisasterInfoVo extends DisasterInfo {
|
||||
|
||||
private String geo;
|
||||
}
|
|
@ -41,8 +41,9 @@ public class NewsController {
|
|||
public R<List<News>> getNews(String content) {
|
||||
// LambdaQueryWrapper<News> qr = new LambdaQueryWrapper<>();
|
||||
// qr.like(News::getContent, content);
|
||||
List<News> list = newsService.list(Wrappers.<News>lambdaQuery().like(News::getContent, content));
|
||||
return R.data(list);
|
||||
//List<News> list = newsService.list(Wrappers.<News>lambdaQuery().like(News::getContent, content));
|
||||
|
||||
return R.data(newsService.getNewsInfo());
|
||||
}
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation(value = "列表", notes = "传入news")
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package com.kening.vordm.controller;
|
||||
|
||||
import com.kening.vordm.entity.DisasterInfo;
|
||||
import com.kening.vordm.entity.SocialMedia;
|
||||
import com.kening.vordm.service.DisasterInfoService;
|
||||
import com.kening.vordm.vo.DisasterInfoVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class SocialMediaController {
|
||||
private final DisasterInfoService disasterInfoService;
|
||||
|
||||
@GetMapping("/social-media")
|
||||
public R<List<DisasterInfoVo>> getSocialMediaDataByCountry(DisasterInfo disasterInfo){
|
||||
return R.data(disasterInfoService.getAllDataByCountry(disasterInfo.getDisasterCountry()));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.kening.vordm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.kening.vordm.entity.News;
|
||||
import com.kening.vordm.service.NewsService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
@RequiredArgsConstructor
|
||||
public class TestController {
|
||||
private final NewsService newsService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping
|
||||
public R<List<News>> getA(Long id) {
|
||||
|
||||
LambdaQueryWrapper<News> qrq = new LambdaQueryWrapper<>();
|
||||
qrq.eq(News::getId, id);
|
||||
|
||||
List<News> list = newsService.list(qrq);
|
||||
return R.data(list);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R<String> getB() {
|
||||
return R.data("seccess");
|
||||
}
|
||||
}
|
|
@ -14,9 +14,11 @@
|
|||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,username,
|
||||
email,organization,research_field,
|
||||
create_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -3,6 +3,10 @@ package com.kening.vordm.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.kening.vordm.entity.DisasterInfo;
|
||||
import com.kening.vordm.vo.DisasterInfoVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G1393
|
||||
|
@ -11,6 +15,5 @@ import com.kening.vordm.entity.DisasterInfo;
|
|||
* @Entity new.domain.DisasterInfo
|
||||
*/
|
||||
public interface DisasterInfoMapper extends BaseMapper<DisasterInfo> {
|
||||
|
||||
|
||||
List<DisasterInfoVo> socialMediaData(@Param("country") String country);
|
||||
}
|
||||
|
|
|
@ -19,10 +19,37 @@
|
|||
<result property="respondTime" column="respond_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="BaseResultMap2" type="com.kening.vordm.vo.DisasterInfoVo">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="disasterType" column="disaster_type" jdbcType="VARCHAR"/>
|
||||
<result property="disasterKeyword" column="disaster_keyword" jdbcType="VARCHAR"/>
|
||||
<result property="disasterTime" column="disaster_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="geometry" column="geometry" jdbcType="VARCHAR"/>
|
||||
<result property="disasterLevel" column="disaster_level" jdbcType="VARCHAR"/>
|
||||
<result property="disasterCountry" column="disaster_country" jdbcType="VARCHAR"/>
|
||||
<result property="respondStatus" column="respond_status" jdbcType="SMALLINT"/>
|
||||
<result property="visitCount" column="visit_count" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="vordmId" column="vordm_id" jdbcType="VARCHAR"/>
|
||||
<result property="respondTime" column="respond_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="geo" column="geo" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,disaster_type,disaster_keyword,
|
||||
disaster_time,geometry,disaster_level,
|
||||
disaster_country,respond_status,visit_count,
|
||||
create_time,vordm_id,respond_time
|
||||
</sql>
|
||||
<sql id="Base_Column_List2">
|
||||
id,disaster_type,disaster_keyword,
|
||||
disaster_time
|
||||
</sql>
|
||||
<select id="socialMediaData" resultMap="BaseResultMap2">
|
||||
SELECT d.*, m.geo
|
||||
FROM disaster_info d
|
||||
INNER JOIN social_media m
|
||||
ON d.vordm_id = m.vordm_id
|
||||
WHERE d.disaster_country = #{country}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<resultMap id="BaseResultMap" type="com.kening.vordm.entity.DownloadRecord">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="diasterId" column="diaster_id" jdbcType="INTEGER"/>
|
||||
<result property="vordmId" column="vordmId" jdbcType="INTEGER"/>
|
||||
<result property="bigType" column="big_type" jdbcType="INTEGER"/>
|
||||
<result property="smallType" column="small_type" jdbcType="VARCHAR"/>
|
||||
<result property="count" column="count" jdbcType="INTEGER"/>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<result property="link" column="link" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="uploadTime" column="upload_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="disasterId" column="disaster_id" jdbcType="INTEGER"/>
|
||||
<result property="vordmId" column="disaster_id" jdbcType="INTEGER"/>
|
||||
<result property="visualFlag" column="visual_flag" jdbcType="INTEGER"/>
|
||||
<result property="visualLon" column="visual_lon" jdbcType="DOUBLE"/>
|
||||
<result property="visualLat" column="visual_lat" jdbcType="DOUBLE"/>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<result property="areaCn" column="area_cn" jdbcType="VARCHAR"/>
|
||||
<result property="areaEn" column="area_en" jdbcType="VARCHAR"/>
|
||||
<result property="frequency" column="frequency" jdbcType="INTEGER"/>
|
||||
<result property="disasterId" column="disaster_id" jdbcType="INTEGER"/>
|
||||
<result property="vordmId" column="vordmId" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="status" column="status" jdbcType="SMALLINT"/>
|
||||
<result property="managerId" column="manager_id" jdbcType="INTEGER"/>
|
||||
|
|
|
@ -4,6 +4,8 @@ package com.kening.vordm.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.kening.vordm.entity.MapServer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G1393
|
||||
* @description 针对表【map_server(上传基础地理数据,并发布到geoserver上,记录geoserver的存储信息)】的数据库操作Mapper
|
||||
|
@ -13,4 +15,6 @@ import com.kening.vordm.entity.MapServer;
|
|||
public interface MapServerMapper extends BaseMapper<MapServer> {
|
||||
|
||||
|
||||
List<MapServer> getMapService(Long id);
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<resultMap id="BaseResultMap" type="com.kening.vordm.entity.MapServer">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="disasterId" column="disaster_id" jdbcType="INTEGER"/>
|
||||
<result property="vordmId" column="vordmId" jdbcType="INTEGER"/>
|
||||
<result property="lat" column="lat" jdbcType="DOUBLE"/>
|
||||
<result property="lon" column="lon" jdbcType="DOUBLE"/>
|
||||
</resultMap>
|
||||
|
@ -16,4 +16,7 @@
|
|||
id,name,disaster_id,
|
||||
lat,lon
|
||||
</sql>
|
||||
<select id="getMapService" resultType="com.kening.vordm.entity.MapServer">
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -2,11 +2,7 @@ package com.kening.vordm.mapper;
|
|||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.kening.vordm.entity.News;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G1393
|
||||
|
@ -16,5 +12,5 @@ import java.util.List;
|
|||
*/
|
||||
public interface NewsMapper extends BaseMapper<News> {
|
||||
|
||||
List<News> selectNewsPage(IPage<News> page, @Param("title") String title);
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,4 @@
|
|||
create_time,status,manager_id,
|
||||
review_time
|
||||
</sql>
|
||||
<select id="selectNewsPage" resultMap="BaseResultMap">
|
||||
select * from news where title like CONCAT(CONCAT('%', #{title}), '%')
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<result property="link" column="link" jdbcType="VARCHAR"/>
|
||||
<result property="size" column="size" jdbcType="INTEGER"/>
|
||||
<result property="type" column="type" jdbcType="VARCHAR"/>
|
||||
<result property="disasterId" column="disaster_id" jdbcType="INTEGER"/>
|
||||
<result property="vordmId" column="vordmId" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isMain" column="is_main" jdbcType="SMALLINT"/>
|
||||
<result property="uploader" column="uploader" jdbcType="INTEGER"/>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<result property="promoteId" column="promote_id" jdbcType="INTEGER"/>
|
||||
<result property="uploaderId" column="uploader_id" jdbcType="INTEGER"/>
|
||||
<result property="managerId" column="manager_id" jdbcType="INTEGER"/>
|
||||
<result property="disasterId" column="disaster_id" jdbcType="INTEGER"/>
|
||||
<result property="vordmId" column="vordmId" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<result property="reviewTime" column="review_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,link,time,
|
||||
content,user_id,favorite_count,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="link" column="link" jdbcType="VARCHAR"/>
|
||||
<result property="provider" column="provider" jdbcType="VARCHAR"/>
|
||||
<result property="disasterId" column="disaster_id" jdbcType="INTEGER"/>
|
||||
<result property="vordmId" column="vordmId" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="websiteId" column="website_id" jdbcType="VARCHAR"/>
|
||||
<result property="uploader" column="uploader" jdbcType="INTEGER"/>
|
||||
|
|
|
@ -2,6 +2,9 @@ package com.kening.vordm.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.kening.vordm.entity.DisasterInfo;
|
||||
import com.kening.vordm.vo.DisasterInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G1393
|
||||
|
@ -9,5 +12,5 @@ import com.kening.vordm.entity.DisasterInfo;
|
|||
* @createDate 2023-03-30 17:40:27
|
||||
*/
|
||||
public interface DisasterInfoService extends IService<DisasterInfo> {
|
||||
|
||||
List<DisasterInfoVo> getAllDataByCountry(String country);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package com.kening.vordm.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.kening.vordm.entity.News;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G1393
|
||||
* @description 针对表【news(新闻咨询数据表)】的数据库操作Service
|
||||
|
@ -13,5 +10,4 @@ import java.util.List;
|
|||
*/
|
||||
public interface NewsService extends IService<News> {
|
||||
|
||||
IPage<News> selectNewsPage(IPage<News> page, String title);
|
||||
}
|
||||
|
|
|
@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.kening.vordm.entity.DisasterInfo;
|
||||
import com.kening.vordm.mapper.DisasterInfoMapper;
|
||||
import com.kening.vordm.service.DisasterInfoService;
|
||||
import com.kening.vordm.vo.DisasterInfoVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G1393
|
||||
* @description 针对表【disaster_info(灾害信息表,存储灾害信息)】的数据库操作Service实现
|
||||
|
@ -15,4 +18,8 @@ import org.springframework.stereotype.Service;
|
|||
public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, DisasterInfo>
|
||||
implements DisasterInfoService {
|
||||
|
||||
@Override
|
||||
public List<DisasterInfoVo> getAllDataByCountry(String country) {
|
||||
return this.baseMapper.socialMediaData(country);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
package com.kening.vordm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.kening.vordm.entity.News;
|
||||
import com.kening.vordm.mapper.NewsMapper;
|
||||
import com.kening.vordm.service.NewsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author G1393
|
||||
* @description 针对表【news(新闻咨询数据表)】的数据库操作Service实现
|
||||
|
@ -18,9 +15,4 @@ import java.util.List;
|
|||
public class NewsServiceImpl extends ServiceImpl<NewsMapper, News>
|
||||
implements NewsService {
|
||||
|
||||
@Override
|
||||
public IPage<News> selectNewsPage(IPage<News> page, String title) {
|
||||
List<News> news = this.baseMapper.selectNewsPage(page, title);
|
||||
return page.setRecords(news);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue