glj-代码提交

This commit is contained in:
glj 2023-04-19 18:35:02 +08:00
parent c342307ac1
commit 4c3c54e585
13 changed files with 231 additions and 101 deletions

View File

@ -146,6 +146,12 @@ public class DisasterInfo implements Serializable {
private List<Websites> websitesList; private List<Websites> websitesList;
/**
* 审核状态 0未审核 1审核通过 2审核不通过 3未认领
*/
@TableField(exist = false)
private String guestManageDisasterRefStatus;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -71,10 +71,6 @@ public class EntityData implements Serializable {
*/ */
private Double visualLat; private Double visualLat;
/**
* 审核时间
*/
private Date examTime;
/** /**
* 0 未审核1-审核已通过2-审核未通过 * 0 未审核1-审核已通过2-审核未通过
@ -111,6 +107,13 @@ public class EntityData implements Serializable {
*/ */
private Integer isDeleted; private Integer isDeleted;
/**
* 上传人姓名
*/
@TableField(exist = false)
private String uploaderName;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* 灾害响应表每一个灾害可能有多个用户响应 * 灾害响应表每一个灾害可能有多个用户响应
@ -40,6 +41,16 @@ public class GuestManageDisasterRef implements Serializable {
*/ */
private Integer status; private Integer status;
/**
* 申请时间
*/
private Date applyTime;
/**
* 通过时间
*/
private Date reviewTime;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -160,6 +160,10 @@ public class RemoteSensingSourceData implements Serializable {
* 来源机构 * 来源机构
*/ */
private String sourceOrganization; private String sourceOrganization;
/**
* 0-爬虫获取1-未审核2-已审核上传源数据未补充下载 链接3-已审核上传源数据已补充下载链接
*/
private Integer status;
/** /**
* 分辨率集合最大值 * 分辨率集合最大值

View File

@ -144,6 +144,32 @@ public class EntityDataUserVo {
*/ */
private String code; private String code;
/**
* 产品波段树
*/
private String productBandsNum;
/**
* 卫星代号
*/
private String satelliteCode;
/**
* 产品分辨率
*/
private Double productResolution;
/**
* 云层覆盖量
*/
private Integer cloudCover;
/**
* 生产时间
*/
private Date productTime;
/** /**
* 文件信息 * 文件信息
*/ */

View File

@ -51,6 +51,19 @@ public class DisasterInfoController {
private final DisasterInfoVoService disasterInfoVoService; 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) @ApiOperationSupport(order = 1)
@ApiOperation(value = "分页", notes = "传入Tool") @ApiOperation(value = "分页", notes = "传入Tool")
@ApiImplicitParams({ @ApiImplicitParams({
@ -361,4 +374,15 @@ public class DisasterInfoController {
public R removeManage(@RequestBody List<DisasterInfo> disasterInfoList){ public R removeManage(@RequestBody List<DisasterInfo> disasterInfoList){
return R.status(disasterInfoService.removeManage(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));
}
} }

View File

@ -66,4 +66,6 @@ public interface DisasterInfoMapper extends BaseMapper<DisasterInfo> {
* @return * @return
*/ */
List<Map<String, Object>> getDisasterInfoByMouth(@Param("start") String start,@Param("end") String end,@Param("type") Integer type,@Param("chiefId") Long chiefId); 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);
} }

View File

@ -26,7 +26,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <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_time,di.upload_time,di.geometry,
di.disaster_level,di.disaster_country,di.respond_status, di.disaster_level,di.disaster_country,di.respond_status,
di.visit_count,di.spider_type,di.tempend_time, di.visit_count,di.spider_type,di.tempend_time,
@ -34,14 +34,24 @@
di.respond_time,di.download_count,di.sponsor_organization di.respond_time,di.download_count,di.sponsor_organization
</sql> </sql>
<sql id="Home_Disaster_Info"> <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 m.organization
</sql> </sql>
<insert id="saveUserData"> <insert id="saveUserData">
insert into blade_user (tenant_id,password,email,status,is_deleted) insert into blade_user (tenant_id, password, email, status, is_deleted)
values (#{userVo.tenantId},#{userVo.password},#{userVo.email},1,0); values (#{userVo.tenantId}, #{userVo.password}, #{userVo.email}, 1, 0);
</insert> </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 id="getDisasterInfoDetail" resultType="com.kening.vordm.entity.DisasterInfo">
select select
<include refid="Base_Column_List"/>, <include refid="Base_Column_List"/>,
@ -49,7 +59,8 @@
gi.organization AS sponsorOrganization, gi.organization AS sponsorOrganization,
bu.name AS managerName, bu.name AS managerName,
bu.organization AS managerOrganization, bu.organization AS managerOrganization,
bdb.dict_value AS dictValue bdb.dict_value AS dictValue,
gmdr.status AS guestManageDisasterRefStatus
from disaster_info di from disaster_info di
left join guest_manage_disaster_ref gmdr on gmdr.disaster_id = di.id 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 left join blade_dict_biz bdb on bdb.dict_key = di.disaster_type
@ -67,15 +78,15 @@
from disaster_info from disaster_info
left join blade_dict_biz bdb on bdb.dict_key = disaster_info.disaster_type left join blade_dict_biz bdb on bdb.dict_key = disaster_info.disaster_type
<where> <where>
<if test="disaster_type !=null and disaster_type!=''"> <if test="disaster_type !=null and disaster_type!=''">
disaster_type = #{disaster_type} disaster_type = #{disaster_type}
</if> </if>
<if test="disaster_country !=null and disaster_country!=''"> <if test="disaster_country !=null and disaster_country!=''">
and disaster_country like concat('%',#{disaster_country},'%') and disaster_country like concat('%',#{disaster_country},'%')
</if> </if>
<if test="disaster_time!=null and disaster_time!=''"> <if test="disaster_time!=null and disaster_time!=''">
and disaster_time like concat('%',#{disaster_time},'%') and disaster_time like concat('%',#{disaster_time},'%')
</if> </if>
</where> </where>
</select> </select>
@ -104,23 +115,33 @@
<select id="getLeft3Data" resultType="com.kening.vordm.vo.GroupByUse"> <select id="getLeft3Data" resultType="com.kening.vordm.vo.GroupByUse">
select t.sponsor_organization as `name`, count(*) as cnt, 'sponsorOrganization' as `type` 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 GROUP BY t.sponsor_organization
ORDER BY cnt desc LIMIT 5 ORDER BY cnt desc LIMIT 5
</select> </select>
<select id="getLeft4Data" resultType="com.kening.vordm.vo.GroupByUse"> <select id="getLeft4Data" resultType="com.kening.vordm.vo.GroupByUse">
select gi.organization as `name`, count(*) as cnt, 'responseOrganization' as `type` 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>
<select id="getLeft1Data" resultType="com.kening.vordm.vo.GroupByUse"> <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`, select b.dict_key,
CONCAT('/icon_disastertype/icon-',b.dict_key,'.png') as icon b.dict_value as name,
from blade_dict_biz b left join disaster_info t on b.dict_key = t.disaster_type count(t.disaster_type) as cnt,
where b.`code` = 'disaster' and b.parent_id != 0 'type' as `type`,
group by b.dict_key, b.dict_value CONCAT('/icon_disastertype/icon-', b.dict_key, '.png') as icon
order by cnt desc 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 limit 7
</select> </select>
@ -130,63 +151,63 @@
INNER JOIN INNER JOIN
(select t.disaster_country as name, count(*) as cnt, 'country' as `type` (select t.disaster_country as name, count(*) as cnt, 'country' as `type`
from disaster_info t from disaster_info t
group by t.disaster_country group by t.disaster_country limit 5) b on c.flagname = b.`name`
limit 5) b on c.flagname = b.`name` order by b.cnt desc order by b.cnt desc
</select> </select>
<select id="page" parameterType="com.kening.vordm.vo.CallForHelpVo" resultType="com.kening.vordm.vo.CallForHelpVo"> <select id="page" parameterType="com.kening.vordm.vo.CallForHelpVo" resultType="com.kening.vordm.vo.CallForHelpVo">
SELECT SELECT
u.username , u.username ,
u.last_name AS lastName, u.last_name AS lastName,
u.first_name AS firstName, u.first_name AS firstName,
u.id as uid , u.id as uid ,
u.email, u.email,
u.research_field, u.research_field,
u.organization, u.organization,
d.id, d.id,
d.disaster_type, d.disaster_type,
d.disaster_time, d.disaster_time,
d.disaster_keyword, d.disaster_keyword,
d.disaster_country, d.disaster_country,
d.disaster_level, d.disaster_level,
d.upload_time, d.upload_time,
d.geometry, d.geometry,
d.respond_status, d.respond_status,
bdb.dict_value as dictValue bdb.dict_value as dictValue
From From
guest_manage_disaster_ref ud join guest_manage_disaster_ref ud join
guest_info u on u.id = ud.sponsor_id JOIN guest_info u on u.id = ud.sponsor_id JOIN
disaster_info d on d.id = ud.disaster_id disaster_info d on d.id = ud.disaster_id
left join blade_dict_biz bdb on d.disaster_type = bdb.dict_key left join blade_dict_biz bdb on d.disaster_type = bdb.dict_key
<where> <where>
<if test="callForHelpVo.respondStatus!=null"> <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 d.respond_status = 1 or d.respond_status = 0
</if> </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 d.respond_status = 2
</if> </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 d.respond_status = 2 or d.respond_status = 3
</if> </if>
</if> </if>
<if test="callForHelpVo.chiefId != null" > <if test="callForHelpVo.chiefId != null">
and d.chief_id is null and d.chief_id is null
</if> </if>
<if test="callForHelpVo.chiefIdEquals != null" > <if test="callForHelpVo.chiefIdEquals != null">
and d.chief_id = #{callForHelpVo.chiefIdEquals} and d.chief_id = #{callForHelpVo.chiefIdEquals}
</if> </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},'%') and bdb.dict_value like concat('%', #{callForHelpVo.disasterType},'%')
</if> </if>
</where> </where>
order by d.upload_time desc order by d.upload_time desc
</select> </select>
<select id="getUserEmail" resultType="java.lang.Integer"> <select id="getUserEmail" resultType="java.lang.Integer">
select count(id) from blade_user select count(id) from blade_user
<where> <where>
<if test="email != null and email != ''" > <if test="email != null and email != ''">
email = #{email} email = #{email}
</if> </if>
</where> </where>
@ -195,7 +216,7 @@
<select id="getUserByEmail" resultType="com.kening.vordm.vo.UserVo"> <select id="getUserByEmail" resultType="com.kening.vordm.vo.UserVo">
select password from blade_user select password from blade_user
<where> <where>
<if test="email != null and email != ''" > <if test="email != null and email != ''">
email = #{email} email = #{email}
</if> </if>
</where> </where>
@ -208,7 +229,7 @@
from disaster_info di from disaster_info di
left join blade_dict_biz bdb on bdb.dict_key = di.disaster_type left join blade_dict_biz bdb on bdb.dict_key = di.disaster_type
<where> <where>
<if test="chiefId != null" > <if test="chiefId != null">
di.chief_id = #{chiefId} di.chief_id = #{chiefId}
</if> </if>
</where> </where>
@ -216,23 +237,23 @@
<select id="getDisasterInfoByMouth" resultType="java.util.Map"> <select id="getDisasterInfoByMouth" resultType="java.util.Map">
SELECT SELECT
<if test="type == 1"> <if test="type == 1">
date_format(di.disaster_time,'%m') AS date, date_format(di.disaster_time,'%m') AS date,
</if> </if>
<if test="type == 2"> <if test="type == 2">
date_format(di.respond_time,'%m') AS date, date_format(di.respond_time,'%m') AS date,
</if> </if>
COUNT(1) AS value COUNT(1) AS value
FROM FROM
disaster_info di disaster_info di
WHERE WHERE
di.respond_time BETWEEN #{start} AND #{end} di.respond_time BETWEEN #{start} AND #{end}
<if test="type == 2"> <if test="type == 2">
AND di.respond_status > 1 AND di.respond_status > 1
</if> </if>
<if test="chiefId != null" > <if test="chiefId != null">
and di.chief_id = #{chiefId} and di.chief_id = #{chiefId}
</if> </if>
GROUP BY date GROUP BY date
</select> </select>

View File

@ -16,7 +16,6 @@
<result property="visualFlag" column="visual_flag" jdbcType="INTEGER"/> <result property="visualFlag" column="visual_flag" jdbcType="INTEGER"/>
<result property="visualLon" column="visual_lon" jdbcType="DOUBLE"/> <result property="visualLon" column="visual_lon" jdbcType="DOUBLE"/>
<result property="visualLat" column="visual_lat" 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="status" column="status" jdbcType="INTEGER"/>
<result property="uploaderId" column="uploader_id" jdbcType="BIGINT"/> <result property="uploaderId" column="uploader_id" jdbcType="BIGINT"/>
<result property="managerId" column="manager_id" jdbcType="BIGINT"/> <result property="managerId" column="manager_id" jdbcType="BIGINT"/>
@ -28,15 +27,17 @@
ed.id,ed.title,ed.size, ed.id,ed.title,ed.size,
ed.type,ed.link,ed.remark, ed.type,ed.link,ed.remark,
ed.upload_time,ed.disaster_id,ed.visual_flag, 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.status,ed.uploader_id,ed.manager_id,
ed.review_time, ed.source_organization ed.review_time, ed.source_organization
</sql> </sql>
<select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityData"> <select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityData">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>,
gi.username AS uploaderName
from entity_data ed from entity_data ed
left join guest_info gi on gi.id = ed.uploader_id
<where> <where>
<if test="entityData.disasterId != null and entityData.disasterId != ''"> <if test="entityData.disasterId != null and entityData.disasterId != ''">
ed.disaster_id = #{entityData.disasterId} ed.disaster_id = #{entityData.disasterId}

View File

@ -68,4 +68,6 @@ public interface DisasterInfoService extends IService<DisasterInfo> {
GuestInfo getUserByEmail(String email); GuestInfo getUserByEmail(String email);
UserVo getBladeUserByEmail(String email); UserVo getBladeUserByEmail(String email);
Integer getByUserDisasterInfo(Long userId, Long disasterId);
} }

View File

@ -9,6 +9,7 @@ import com.google.common.collect.Maps;
import com.kening.vordm.entity.DisasterData; import com.kening.vordm.entity.DisasterData;
import com.kening.vordm.entity.DisasterInfo; import com.kening.vordm.entity.DisasterInfo;
import com.kening.vordm.entity.GuestInfo; import com.kening.vordm.entity.GuestInfo;
import com.kening.vordm.entity.GuestManageDisasterRef;
import com.kening.vordm.mapper.DisasterInfoMapper; import com.kening.vordm.mapper.DisasterInfoMapper;
import com.kening.vordm.mapper.GuestInfoMapper; import com.kening.vordm.mapper.GuestInfoMapper;
import com.kening.vordm.service.DisasterInfoService; import com.kening.vordm.service.DisasterInfoService;
@ -203,6 +204,15 @@ public class DisasterInfoServiceImpl extends ServiceImpl<DisasterInfoMapper, Dis
return guestInfoMapper.getBladeUserByEmail(email); 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 暂时没有条件查询 所有统计都暂时写在一个查询里面 * @description 暂时没有条件查询 所有统计都暂时写在一个查询里面

View File

@ -59,10 +59,11 @@ public class EmailServiceImpl implements EmailService {
if (bladeUser == null || bladeUser.getPassword()==null){ if (bladeUser == null || bladeUser.getPassword()==null){
return R.data(1405, "There are currently no bound users for this email"); return R.data(1405, "There are currently no bound users for this email");
} }
disasterInfoMapper.updataUserByEmail(userVo.getEmail(),"1790ae2beb8e6c6a4c6744667e11c4ba26abeb09");
Email email = new Email(); Email email = new Email();
email.setSubject("您的登录密码"); email.setSubject("您的登录密码");
String encrypt = DigestUtil.encrypt(bladeUser.getPassword()); 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.setHtmlText(false);
email.setTos(userVo.getEmail().split(",")); email.setTos(userVo.getEmail().split(","));
javaMailSender.send(buildMimeMessage(email)); javaMailSender.send(buildMimeMessage(email));

View File

@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kening.vordm.entity.EntityData; import com.kening.vordm.entity.EntityData;
import com.kening.vordm.entity.GuestInfo; import com.kening.vordm.entity.GuestInfo;
import com.kening.vordm.entity.RemoteSensingSourceData;
import com.kening.vordm.mapper.EntityDataMapper; import com.kening.vordm.mapper.EntityDataMapper;
import com.kening.vordm.mapper.GuestInfoMapper; import com.kening.vordm.mapper.GuestInfoMapper;
import com.kening.vordm.mapper.RemoteSensingSourceDataMapper;
import com.kening.vordm.service.EntityDataService; import com.kening.vordm.service.EntityDataService;
import com.kening.vordm.vo.EntityDataUserVo; import com.kening.vordm.vo.EntityDataUserVo;
import com.kening.vordm.vo.UserTenantVo; import com.kening.vordm.vo.UserTenantVo;
@ -40,6 +42,7 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
private GuestInfoMapper guestInfoMapper; private GuestInfoMapper guestInfoMapper;
private RemoteSensingSourceDataMapper remoteSensingSourceDataMapper;
/** /**
* 验证码 * 验证码
*/ */
@ -71,19 +74,7 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
public R saveEntityData(EntityDataUserVo entityDataUserVo) { public R saveEntityData(EntityDataUserVo entityDataUserVo) {
//创建实体数据 //创建实体数据
EntityData entityData = new EntityData(); 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<>(); LambdaQueryWrapper<GuestInfo> qw = new LambdaQueryWrapper<>();
@ -105,16 +96,44 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
entityData.setUploaderId(guestInfo1.getId()); entityData.setUploaderId(guestInfo1.getId());
} }
Long sum = size.stream().reduce(Long::sum).orElse(0L); if (entityDataUserVo.getType().equals("4")) {
//实体数据 RemoteSensingSourceData remoteSensingSourceData = new RemoteSensingSourceData();
entityData.setTitle(entityDataUserVo.getTitle()); remoteSensingSourceData.setDisasterId(entityDataUserVo.getDisasterId());
entityData.setSize(sum); remoteSensingSourceData.setSourceOrganization(entityDataUserVo.getOrganization());
entityData.setLink(StringUtils.join(link,",")); remoteSensingSourceData.setSatelliteCode(entityDataUserVo.getSatelliteCode());
entityData.setDisasterId(entityDataUserVo.getDisasterId()); remoteSensingSourceData.setProductResolution(entityDataUserVo.getProductResolution());
entityData.setUploadTime(new Date()); remoteSensingSourceData.setCloudCover(entityDataUserVo.getCloudCover());
entityData.setRemark(entityDataUserVo.getRemark()); remoteSensingSourceData.setProductTime(entityDataUserVo.getProductTime());
entityData.setSourceOrganization(entityDataUserVo.getOrganization()); remoteSensingSourceData.setProductBandsNum(entityDataUserVo.getProductBandsNum());
return R.status(this.baseMapper.insert(entityData)>0); 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);
}
} }