Merge branch 'master' of http://47.92.168.204:3000/VoRDM/vordm-backend into why
This commit is contained in:
commit
fc6e0ba6b1
|
@ -146,6 +146,12 @@ public class DisasterInfo implements Serializable {
|
|||
private List<Websites> websitesList;
|
||||
|
||||
|
||||
/**
|
||||
* 审核状态 0未审核 1审核通过 2审核不通过 3未认领
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String guestManageDisasterRefStatus;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
|
@ -71,10 +71,6 @@ public class EntityData implements Serializable {
|
|||
*/
|
||||
private Double visualLat;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date examTime;
|
||||
|
||||
/**
|
||||
* 0 未审核,1-审核已通过,2-审核未通过
|
||||
|
@ -111,6 +107,13 @@ public class EntityData implements Serializable {
|
|||
*/
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
/**
|
||||
* 上传人姓名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String uploaderName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 灾害响应表,每一个灾害可能有多个用户响应
|
||||
|
@ -40,6 +41,16 @@ public class GuestManageDisasterRef implements Serializable {
|
|||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
private Date applyTime;
|
||||
|
||||
/**
|
||||
* 通过时间
|
||||
*/
|
||||
private Date reviewTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
|
@ -160,6 +160,10 @@ public class RemoteSensingSourceData implements Serializable {
|
|||
* 来源机构
|
||||
*/
|
||||
private String sourceOrganization;
|
||||
/**
|
||||
* 0-爬虫获取,1-未审核,2-,已审核,上传源数据未补充下载 链接,3-已审核上传源数据已补充下载链接
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 分辨率集合最大值
|
||||
|
|
|
@ -144,6 +144,32 @@ public class EntityDataUserVo {
|
|||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 产品波段树
|
||||
*/
|
||||
private String productBandsNum;
|
||||
|
||||
/**
|
||||
* 卫星代号
|
||||
*/
|
||||
private String satelliteCode;
|
||||
|
||||
/**
|
||||
* 产品分辨率
|
||||
*/
|
||||
private Double productResolution;
|
||||
|
||||
/**
|
||||
* 云层覆盖量
|
||||
*/
|
||||
private Integer cloudCover;
|
||||
|
||||
/**
|
||||
* 生产时间
|
||||
*/
|
||||
private Date productTime;
|
||||
|
||||
|
||||
/**
|
||||
* 文件信息
|
||||
*/
|
||||
|
|
|
@ -51,6 +51,19 @@ public class DisasterInfoController {
|
|||
|
||||
private final DisasterInfoVoService disasterInfoVoService;
|
||||
|
||||
|
||||
@GetMapping("/saveGuestManageDisasterRef")
|
||||
public R saveGuestManageDisasterRef(Long disasterId, Long managerId) {
|
||||
LambdaQueryWrapper<GuestManageDisasterRef> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(GuestManageDisasterRef::getDisasterId,disasterId);
|
||||
GuestManageDisasterRef one = guestManageDisasterRefService.getOne(queryWrapper);
|
||||
one.setManagerId(managerId);
|
||||
one.setApplyTime(new Date());
|
||||
one.setStatus(0);
|
||||
return R.status(guestManageDisasterRefService.updateById(one));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ApiOperation(value = "分页", notes = "传入Tool")
|
||||
@ApiImplicitParams({
|
||||
|
@ -361,4 +374,15 @@ public class DisasterInfoController {
|
|||
public R removeManage(@RequestBody List<DisasterInfo> disasterInfoList){
|
||||
return R.status(disasterInfoService.removeManage(disasterInfoList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断用户是否管理当前灾害
|
||||
* @param userId 用户Id
|
||||
* @param disasterId 灾害Id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getByUserDisasterInfo")
|
||||
public R getByUserDisasterInfo(Long userId,Long disasterId){
|
||||
return R.data(disasterInfoService.getByUserDisasterInfo(userId,disasterId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,4 +66,6 @@ public interface DisasterInfoMapper extends BaseMapper<DisasterInfo> {
|
|||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getDisasterInfoByMouth(@Param("start") String start,@Param("end") String end,@Param("type") Integer type,@Param("chiefId") Long chiefId);
|
||||
|
||||
void updataUserByEmail(@Param("email") String email,@Param("password") String password);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
di.id,di.disaster_type,di.disaster_keyword,
|
||||
di.id ,di.disaster_type,di.disaster_keyword,
|
||||
di.disaster_time,di.upload_time,di.geometry,
|
||||
di.disaster_level,di.disaster_country,di.respond_status,
|
||||
di.visit_count,di.spider_type,di.tempend_time,
|
||||
|
@ -34,14 +34,24 @@
|
|||
di.respond_time,di.download_count,di.sponsor_organization
|
||||
</sql>
|
||||
<sql id="Home_Disaster_Info">
|
||||
d.disaster_type,d.disaster_time,d.disaster_country,
|
||||
d.disaster_type ,d.disaster_time,d.disaster_country,
|
||||
m.organization
|
||||
</sql>
|
||||
|
||||
<insert id="saveUserData">
|
||||
insert into blade_user (tenant_id,password,email,status,is_deleted)
|
||||
values (#{userVo.tenantId},#{userVo.password},#{userVo.email},1,0);
|
||||
insert into blade_user (tenant_id, password, email, status, is_deleted)
|
||||
values (#{userVo.tenantId}, #{userVo.password}, #{userVo.email}, 1, 0);
|
||||
</insert>
|
||||
|
||||
<update id="updataUserByEmail">
|
||||
UPDATE blade_user SET password = #{password}
|
||||
<where>
|
||||
<if test="email !=null and email != ''">
|
||||
email = #{email}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<select id="getDisasterInfoDetail" resultType="com.kening.vordm.entity.DisasterInfo">
|
||||
select
|
||||
<include refid="Base_Column_List"/>,
|
||||
|
@ -49,7 +59,8 @@
|
|||
gi.organization AS sponsorOrganization,
|
||||
bu.name AS managerName,
|
||||
bu.organization AS managerOrganization,
|
||||
bdb.dict_value AS dictValue
|
||||
bdb.dict_value AS dictValue,
|
||||
gmdr.status AS guestManageDisasterRefStatus
|
||||
from disaster_info di
|
||||
left join guest_manage_disaster_ref gmdr on gmdr.disaster_id = di.id
|
||||
left join blade_dict_biz bdb on bdb.dict_key = di.disaster_type
|
||||
|
@ -67,15 +78,15 @@
|
|||
from disaster_info
|
||||
left join blade_dict_biz bdb on bdb.dict_key = disaster_info.disaster_type
|
||||
<where>
|
||||
<if test="disaster_type !=null and disaster_type!=''">
|
||||
disaster_type = #{disaster_type}
|
||||
</if>
|
||||
<if test="disaster_country !=null and disaster_country!=''">
|
||||
and disaster_country like concat('%',#{disaster_country},'%')
|
||||
</if>
|
||||
<if test="disaster_time!=null and disaster_time!=''">
|
||||
and disaster_time like concat('%',#{disaster_time},'%')
|
||||
</if>
|
||||
<if test="disaster_type !=null and disaster_type!=''">
|
||||
disaster_type = #{disaster_type}
|
||||
</if>
|
||||
<if test="disaster_country !=null and disaster_country!=''">
|
||||
and disaster_country like concat('%',#{disaster_country},'%')
|
||||
</if>
|
||||
<if test="disaster_time!=null and disaster_time!=''">
|
||||
and disaster_time like concat('%',#{disaster_time},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -104,23 +115,33 @@
|
|||
|
||||
<select id="getLeft3Data" resultType="com.kening.vordm.vo.GroupByUse">
|
||||
select t.sponsor_organization as `name`, count(*) as cnt, 'sponsorOrganization' as `type`
|
||||
from disaster_info t where t.sponsor_organization != ''
|
||||
from disaster_info t
|
||||
where t.sponsor_organization != ''
|
||||
GROUP BY t.sponsor_organization
|
||||
ORDER BY cnt desc LIMIT 5
|
||||
</select>
|
||||
|
||||
<select id="getLeft4Data" resultType="com.kening.vordm.vo.GroupByUse">
|
||||
select gi.organization as `name`, count(*) as cnt, 'responseOrganization' as `type`
|
||||
from guest_manage_disaster_ref t INNER JOIN guest_info gi on gi.id = t.manager_id where gi.organization != '' and t.`status` = '1' GROUP BY gi.organization ORDER BY cnt desc LIMIT 5
|
||||
from guest_manage_disaster_ref t
|
||||
INNER JOIN guest_info gi on gi.id = t.manager_id
|
||||
where gi.organization != '' and t.`status` = '1'
|
||||
GROUP BY gi.organization
|
||||
ORDER BY cnt desc LIMIT 5
|
||||
</select>
|
||||
|
||||
<select id="getLeft1Data" resultType="com.kening.vordm.vo.GroupByUse">
|
||||
select b.dict_key, b.dict_value as name, count(t.disaster_type) as cnt, 'type' as `type`,
|
||||
CONCAT('/icon_disastertype/icon-',b.dict_key,'.png') as icon
|
||||
from blade_dict_biz b left join disaster_info t on b.dict_key = t.disaster_type
|
||||
where b.`code` = 'disaster' and b.parent_id != 0
|
||||
group by b.dict_key, b.dict_value
|
||||
order by cnt desc
|
||||
select b.dict_key,
|
||||
b.dict_value as name,
|
||||
count(t.disaster_type) as cnt,
|
||||
'type' as `type`,
|
||||
CONCAT('/icon_disastertype/icon-', b.dict_key, '.png') as icon
|
||||
from blade_dict_biz b
|
||||
left join disaster_info t on b.dict_key = t.disaster_type
|
||||
where b.`code` = 'disaster'
|
||||
and b.parent_id != 0
|
||||
group by b.dict_key, b.dict_value
|
||||
order by cnt desc
|
||||
limit 7
|
||||
</select>
|
||||
|
||||
|
@ -130,63 +151,63 @@
|
|||
INNER JOIN
|
||||
(select t.disaster_country as name, count(*) as cnt, 'country' as `type`
|
||||
from disaster_info t
|
||||
group by t.disaster_country
|
||||
limit 5) b on c.flagname = b.`name` order by b.cnt desc
|
||||
group by t.disaster_country limit 5) b on c.flagname = b.`name`
|
||||
order by b.cnt desc
|
||||
</select>
|
||||
|
||||
<select id="page" parameterType="com.kening.vordm.vo.CallForHelpVo" resultType="com.kening.vordm.vo.CallForHelpVo">
|
||||
SELECT
|
||||
u.username ,
|
||||
u.last_name AS lastName,
|
||||
u.first_name AS firstName,
|
||||
u.id as uid ,
|
||||
u.email,
|
||||
u.research_field,
|
||||
u.organization,
|
||||
d.id,
|
||||
d.disaster_type,
|
||||
d.disaster_time,
|
||||
d.disaster_keyword,
|
||||
d.disaster_country,
|
||||
d.disaster_level,
|
||||
d.upload_time,
|
||||
d.geometry,
|
||||
d.respond_status,
|
||||
bdb.dict_value as dictValue
|
||||
u.username ,
|
||||
u.last_name AS lastName,
|
||||
u.first_name AS firstName,
|
||||
u.id as uid ,
|
||||
u.email,
|
||||
u.research_field,
|
||||
u.organization,
|
||||
d.id,
|
||||
d.disaster_type,
|
||||
d.disaster_time,
|
||||
d.disaster_keyword,
|
||||
d.disaster_country,
|
||||
d.disaster_level,
|
||||
d.upload_time,
|
||||
d.geometry,
|
||||
d.respond_status,
|
||||
bdb.dict_value as dictValue
|
||||
From
|
||||
guest_manage_disaster_ref ud join
|
||||
guest_info u on u.id = ud.sponsor_id JOIN
|
||||
disaster_info d on d.id = ud.disaster_id
|
||||
left join blade_dict_biz bdb on d.disaster_type = bdb.dict_key
|
||||
guest_manage_disaster_ref ud join
|
||||
guest_info u on u.id = ud.sponsor_id JOIN
|
||||
disaster_info d on d.id = ud.disaster_id
|
||||
left join blade_dict_biz bdb on d.disaster_type = bdb.dict_key
|
||||
<where>
|
||||
<if test="callForHelpVo.respondStatus!=null">
|
||||
<if test="callForHelpVo.respondStatus == 0 or callForHelpVo.respondStatus == '0'" >
|
||||
<if test="callForHelpVo.respondStatus == 0 or callForHelpVo.respondStatus == '0'">
|
||||
d.respond_status = 1 or d.respond_status = 0
|
||||
</if>
|
||||
<if test="callForHelpVo.respondStatus != 0 and callForHelpVo.respondStatus != '0' and callForHelpVo.respondStatus != 3 and callForHelpVo.respondStatus != '3'" >
|
||||
<if test="callForHelpVo.respondStatus != 0 and callForHelpVo.respondStatus != '0' and callForHelpVo.respondStatus != 3 and callForHelpVo.respondStatus != '3'">
|
||||
d.respond_status = 2
|
||||
</if>
|
||||
<if test="callForHelpVo.respondStatus == 3 or callForHelpVo.respondStatus == '3'" >
|
||||
<if test="callForHelpVo.respondStatus == 3 or callForHelpVo.respondStatus == '3'">
|
||||
d.respond_status = 2 or d.respond_status = 3
|
||||
</if>
|
||||
</if>
|
||||
<if test="callForHelpVo.chiefId != null" >
|
||||
<if test="callForHelpVo.chiefId != null">
|
||||
and d.chief_id is null
|
||||
</if>
|
||||
<if test="callForHelpVo.chiefIdEquals != null" >
|
||||
<if test="callForHelpVo.chiefIdEquals != null">
|
||||
and d.chief_id = #{callForHelpVo.chiefIdEquals}
|
||||
</if>
|
||||
<if test="callForHelpVo.disasterType != null and callForHelpVo.disasterType != ''" >
|
||||
<if test="callForHelpVo.disasterType != null and callForHelpVo.disasterType != ''">
|
||||
and bdb.dict_value like concat('%', #{callForHelpVo.disasterType},'%')
|
||||
</if>
|
||||
</where>
|
||||
order by d.upload_time desc
|
||||
order by d.upload_time desc
|
||||
</select>
|
||||
|
||||
<select id="getUserEmail" resultType="java.lang.Integer">
|
||||
select count(id) from blade_user
|
||||
<where>
|
||||
<if test="email != null and email != ''" >
|
||||
<if test="email != null and email != ''">
|
||||
email = #{email}
|
||||
</if>
|
||||
</where>
|
||||
|
@ -195,7 +216,7 @@
|
|||
<select id="getUserByEmail" resultType="com.kening.vordm.vo.UserVo">
|
||||
select password from blade_user
|
||||
<where>
|
||||
<if test="email != null and email != ''" >
|
||||
<if test="email != null and email != ''">
|
||||
email = #{email}
|
||||
</if>
|
||||
</where>
|
||||
|
@ -208,7 +229,7 @@
|
|||
from disaster_info di
|
||||
left join blade_dict_biz bdb on bdb.dict_key = di.disaster_type
|
||||
<where>
|
||||
<if test="chiefId != null" >
|
||||
<if test="chiefId != null">
|
||||
di.chief_id = #{chiefId}
|
||||
</if>
|
||||
</where>
|
||||
|
@ -216,23 +237,23 @@
|
|||
|
||||
<select id="getDisasterInfoByMouth" resultType="java.util.Map">
|
||||
SELECT
|
||||
<if test="type == 1">
|
||||
date_format(di.disaster_time,'%m') AS date,
|
||||
</if>
|
||||
<if test="type == 2">
|
||||
date_format(di.respond_time,'%m') AS date,
|
||||
</if>
|
||||
COUNT(1) AS value
|
||||
<if test="type == 1">
|
||||
date_format(di.disaster_time,'%m') AS date,
|
||||
</if>
|
||||
<if test="type == 2">
|
||||
date_format(di.respond_time,'%m') AS date,
|
||||
</if>
|
||||
COUNT(1) AS value
|
||||
FROM
|
||||
disaster_info di
|
||||
disaster_info di
|
||||
WHERE
|
||||
di.respond_time BETWEEN #{start} AND #{end}
|
||||
<if test="type == 2">
|
||||
AND di.respond_status > 1
|
||||
</if>
|
||||
<if test="chiefId != null" >
|
||||
and di.chief_id = #{chiefId}
|
||||
</if>
|
||||
di.respond_time BETWEEN #{start} AND #{end}
|
||||
<if test="type == 2">
|
||||
AND di.respond_status > 1
|
||||
</if>
|
||||
<if test="chiefId != null">
|
||||
and di.chief_id = #{chiefId}
|
||||
</if>
|
||||
GROUP BY date
|
||||
</select>
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
<result property="visualFlag" column="visual_flag" jdbcType="INTEGER"/>
|
||||
<result property="visualLon" column="visual_lon" jdbcType="DOUBLE"/>
|
||||
<result property="visualLat" column="visual_lat" jdbcType="DOUBLE"/>
|
||||
<result property="examTime" column="exam_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="uploaderId" column="uploader_id" jdbcType="BIGINT"/>
|
||||
<result property="managerId" column="manager_id" jdbcType="BIGINT"/>
|
||||
|
@ -28,15 +27,17 @@
|
|||
ed.id,ed.title,ed.size,
|
||||
ed.type,ed.link,ed.remark,
|
||||
ed.upload_time,ed.disaster_id,ed.visual_flag,
|
||||
ed.visual_lon,ed.visual_lat,ed.exam_time,
|
||||
ed.visual_lon,ed.visual_lat,
|
||||
ed.status,ed.uploader_id,ed.manager_id,
|
||||
ed.review_time, ed.source_organization
|
||||
</sql>
|
||||
|
||||
<select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityData">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
<include refid="Base_Column_List"/>,
|
||||
gi.username AS uploaderName
|
||||
from entity_data ed
|
||||
left join guest_info gi on gi.id = ed.uploader_id
|
||||
<where>
|
||||
<if test="entityData.disasterId != null and entityData.disasterId != ''">
|
||||
ed.disaster_id = #{entityData.disasterId}
|
||||
|
|
|
@ -68,4 +68,6 @@ public interface DisasterInfoService extends IService<DisasterInfo> {
|
|||
GuestInfo getUserByEmail(String email);
|
||||
|
||||
UserVo getBladeUserByEmail(String email);
|
||||
|
||||
Integer getByUserDisasterInfo(Long userId, Long disasterId);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.google.common.collect.Maps;
|
|||
import com.kening.vordm.entity.DisasterData;
|
||||
import com.kening.vordm.entity.DisasterInfo;
|
||||
import com.kening.vordm.entity.GuestInfo;
|
||||
import com.kening.vordm.entity.GuestManageDisasterRef;
|
||||
import com.kening.vordm.mapper.DisasterInfoMapper;
|
||||
import com.kening.vordm.mapper.GuestInfoMapper;
|
||||
import com.kening.vordm.service.DisasterInfoService;
|
||||
|
@ -203,6 +204,15 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
|
|||
return guestInfoMapper.getBladeUserByEmail(email);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getByUserDisasterInfo(Long userId, Long disasterId) {
|
||||
LambdaQueryWrapper<GuestManageDisasterRef> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(GuestManageDisasterRef::getDisasterId,disasterId);
|
||||
queryWrapper.eq(GuestManageDisasterRef::getStatus,1);
|
||||
queryWrapper.eq(GuestManageDisasterRef::getManagerId,userId);
|
||||
return guestManageDisasterRefService.count(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台管理系统-控制台灾害各项统计
|
||||
* @description 暂时没有条件查询 所有统计都暂时写在一个查询里面
|
||||
|
|
|
@ -59,10 +59,11 @@ public class EmailServiceImpl implements EmailService {
|
|||
if (bladeUser == null || bladeUser.getPassword()==null){
|
||||
return R.data(1405, "There are currently no bound users for this email");
|
||||
}
|
||||
disasterInfoMapper.updataUserByEmail(userVo.getEmail(),"1790ae2beb8e6c6a4c6744667e11c4ba26abeb09");
|
||||
Email email = new Email();
|
||||
email.setSubject("您的登录密码");
|
||||
String encrypt = DigestUtil.encrypt(bladeUser.getPassword());
|
||||
email.setText("邮箱为"+ userVo.getEmail()+ "的用户登录密码为:"+encrypt);
|
||||
email.setText("Your login password has been updated to:“admin@#”");
|
||||
email.setHtmlText(false);
|
||||
email.setTos(userVo.getEmail().split(","));
|
||||
javaMailSender.send(buildMimeMessage(email));
|
||||
|
|
|
@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.kening.vordm.entity.EntityData;
|
||||
import com.kening.vordm.entity.GuestInfo;
|
||||
import com.kening.vordm.entity.RemoteSensingSourceData;
|
||||
import com.kening.vordm.mapper.EntityDataMapper;
|
||||
import com.kening.vordm.mapper.GuestInfoMapper;
|
||||
import com.kening.vordm.mapper.RemoteSensingSourceDataMapper;
|
||||
import com.kening.vordm.service.EntityDataService;
|
||||
import com.kening.vordm.vo.EntityDataUserVo;
|
||||
import com.kening.vordm.vo.UserTenantVo;
|
||||
|
@ -40,6 +42,7 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
|
|||
|
||||
private GuestInfoMapper guestInfoMapper;
|
||||
|
||||
private RemoteSensingSourceDataMapper remoteSensingSourceDataMapper;
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
|
@ -71,19 +74,7 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
|
|||
public R saveEntityData(EntityDataUserVo entityDataUserVo) {
|
||||
//创建实体数据
|
||||
EntityData entityData = new EntityData();
|
||||
//路径拼接
|
||||
List<String> link = new ArrayList<>();
|
||||
//文件大小
|
||||
List<Long> size = new ArrayList<>();
|
||||
//文件数据
|
||||
List<MultipartFile> filesArray = entityDataUserVo.getFilesArray();
|
||||
filesArray.stream().forEach(files->{
|
||||
BladeFile bladeFile = minioTemplate.putFile(files);
|
||||
//获取文件大小
|
||||
Long fileSize = files.getSize();
|
||||
link.add(bladeFile.getLink());
|
||||
size.add(fileSize);
|
||||
});
|
||||
|
||||
|
||||
//判断上传用户是否存在
|
||||
LambdaQueryWrapper<GuestInfo> qw = new LambdaQueryWrapper<>();
|
||||
|
@ -105,16 +96,44 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
|
|||
entityData.setUploaderId(guestInfo1.getId());
|
||||
}
|
||||
|
||||
Long sum = size.stream().reduce(Long::sum).orElse(0L);
|
||||
//实体数据
|
||||
entityData.setTitle(entityDataUserVo.getTitle());
|
||||
entityData.setSize(sum);
|
||||
entityData.setLink(StringUtils.join(link,","));
|
||||
entityData.setDisasterId(entityDataUserVo.getDisasterId());
|
||||
entityData.setUploadTime(new Date());
|
||||
entityData.setRemark(entityDataUserVo.getRemark());
|
||||
entityData.setSourceOrganization(entityDataUserVo.getOrganization());
|
||||
return R.status(this.baseMapper.insert(entityData)>0);
|
||||
if (entityDataUserVo.getType().equals("4")) {
|
||||
RemoteSensingSourceData remoteSensingSourceData = new RemoteSensingSourceData();
|
||||
remoteSensingSourceData.setDisasterId(entityDataUserVo.getDisasterId());
|
||||
remoteSensingSourceData.setSourceOrganization(entityDataUserVo.getOrganization());
|
||||
remoteSensingSourceData.setSatelliteCode(entityDataUserVo.getSatelliteCode());
|
||||
remoteSensingSourceData.setProductResolution(entityDataUserVo.getProductResolution());
|
||||
remoteSensingSourceData.setCloudCover(entityDataUserVo.getCloudCover());
|
||||
remoteSensingSourceData.setProductTime(entityDataUserVo.getProductTime());
|
||||
remoteSensingSourceData.setProductBandsNum(entityDataUserVo.getProductBandsNum());
|
||||
remoteSensingSourceData.setStatus(1);
|
||||
return R.status(remoteSensingSourceDataMapper.insert(remoteSensingSourceData) > 0);
|
||||
} else {
|
||||
|
||||
//路径拼接
|
||||
List<String> link = new ArrayList<>();
|
||||
//文件大小
|
||||
List<Long> size = new ArrayList<>();
|
||||
//文件数据
|
||||
List<MultipartFile> filesArray = entityDataUserVo.getFilesArray();
|
||||
filesArray.stream().forEach(files -> {
|
||||
BladeFile bladeFile = minioTemplate.putFile(files);
|
||||
//获取文件大小
|
||||
Long fileSize = files.getSize();
|
||||
link.add(bladeFile.getLink());
|
||||
size.add(fileSize);
|
||||
});
|
||||
|
||||
Long sum = size.stream().reduce(Long::sum).orElse(0L);
|
||||
//实体数据
|
||||
entityData.setTitle(entityDataUserVo.getTitle());
|
||||
entityData.setSize(sum);
|
||||
entityData.setLink(StringUtils.join(link, ","));
|
||||
entityData.setDisasterId(entityDataUserVo.getDisasterId());
|
||||
entityData.setUploadTime(new Date());
|
||||
entityData.setRemark(entityDataUserVo.getRemark());
|
||||
entityData.setSourceOrganization(entityDataUserVo.getOrganization());
|
||||
return R.status(this.baseMapper.insert(entityData) > 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue