glj-代码提交

This commit is contained in:
glj 2024-01-30 18:09:26 +08:00
parent 157b411106
commit 2a56224d94
9 changed files with 86 additions and 4 deletions

View File

@ -29,4 +29,10 @@ public class DataUpload extends EntityData{
private String geometry; private String geometry;
private String uploaderEmail; private String uploaderEmail;
private Integer isDownload;
private String account;
private String password;
} }

View File

@ -112,6 +112,17 @@ public class EntityData implements Serializable {
*/ */
private Integer isPublish; private Integer isPublish;
/**
* 是否下载0 未下载/1已下载
*/
private Integer isDownload;
private String account;
private String password;
/** /**
* 上传人姓名 * 上传人姓名
*/ */

View File

@ -9,6 +9,12 @@ import java.util.List;
@Data @Data
public class EntityDataUserVo { public class EntityDataUserVo {
/**
* 数据产品的大小byte
*/
private Long id;
/** /**
* 数据名称 * 数据名称
*/ */
@ -17,7 +23,7 @@ public class EntityDataUserVo {
/** /**
* 数据产品的大小byte * 数据产品的大小byte
*/ */
private Long size; private Integer size;
/** /**
* 数据类型0-基础数据1-减灾产品2-制图产品 * 数据类型0-基础数据1-减灾产品2-制图产品

View File

@ -45,6 +45,12 @@ public class DataUploadController {
*/ */
@GetMapping("/pages") @GetMapping("/pages")
public R<IPage<DataUpload>> pages(Query query, @RequestParam Map<String,Object> params){ public R<IPage<DataUpload>> pages(Query query, @RequestParam Map<String,Object> params){
params.put("status",0);
return R.data(service.queryPage(Condition.getPage(query),params));
}
@GetMapping("/pagesAdmin")
public R<IPage<DataUpload>> pagesAdmin(Query query, @RequestParam Map<String,Object> params){
return R.data(service.queryPage(Condition.getPage(query),params)); return R.data(service.queryPage(Condition.getPage(query),params));
} }

View File

@ -52,6 +52,13 @@ public class EntityDataController {
return R.data(entityDataService.saveEntityData(entityDataUserVo)); return R.data(entityDataService.saveEntityData(entityDataUserVo));
} }
@PostMapping("/updateEntityDataAdmin")
public R updateEntityDataAdmin(EntityDataUserVo entityDataUserVo) {
return R.data(entityDataService.updateEntityDataAdmin(entityDataUserVo));
}
@GetMapping("/updateByIdEntityDataStatus") @GetMapping("/updateByIdEntityDataStatus")
public R updateByIdEntityDataStatus(Long id,Integer status,Long managerId) { public R updateByIdEntityDataStatus(Long id,Integer status,Long managerId) {
EntityData entityData = new EntityData(); EntityData entityData = new EntityData();

View File

@ -42,12 +42,17 @@
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,
ed.upload_type, ed.upload_type,
ed.is_download,
ed.account,
ed.password,
bu.name as uploaderName, bu.name as uploaderName,
bu.email as uploaderEmail bu.email as uploaderEmail
from entity_data ed from entity_data ed
left join blade_user bu on bu.id = ed.uploader_id left join blade_user bu on bu.id = ed.uploader_id
<where> <where>
and ed.status = 0 <if test="params.status!=null and params.status!=''">
ed.status = #{params.status}
</if>
<if test="params.disasterId!=null"> <if test="params.disasterId!=null">
and ed.disaster_id = #{params.disasterId} and ed.disaster_id = #{params.disasterId}
</if> </if>

View File

@ -24,6 +24,9 @@
<result property="uploadType" column="upload_type" jdbcType="INTEGER"/> <result property="uploadType" column="upload_type" jdbcType="INTEGER"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/> <result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
<result property="isPublish" column="is_publish" jdbcType="INTEGER"/> <result property="isPublish" column="is_publish" jdbcType="INTEGER"/>
<result property="isDownload" column="is_download" jdbcType="INTEGER"/>
<result property="account" column="account" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@ -36,7 +39,8 @@
ed.visual_lon,ed.visual_lat, 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,
ed.upload_type, ed.is_deleted, ed.is_publish ed.upload_type, ed.is_deleted, ed.is_publish,
ed.is_download, ed.account, ed.password
</sql> </sql>
<select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityData"> <select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityData">

View File

@ -40,4 +40,7 @@ public interface EntityDataService extends IService<EntityData> {
List<Map<String, Long>> getStatisticsByUserId(Long id, String year); List<Map<String, Long>> getStatisticsByUserId(Long id, String year);
Map<String, Object> getStatisticsByUserIdPancake(Long id); Map<String, Object> getStatisticsByUserIdPancake(Long id);
R updateEntityDataAdmin(EntityDataUserVo entityDataUserVo);
} }

View File

@ -147,7 +147,6 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
entityData.setRemark(entityDataUserVo.getRemark()); entityData.setRemark(entityDataUserVo.getRemark());
entityData.setSourceOrganization(entityDataUserVo.getOrganization()); entityData.setSourceOrganization(entityDataUserVo.getOrganization());
entityData.setType(entityDataUserVo.getType()); entityData.setType(entityDataUserVo.getType());
entityData.setTitle(entityDataUserVo.getTitle());
return R.status(this.baseMapper.insert(entityData) > 0); return R.status(this.baseMapper.insert(entityData) > 0);
} }
} }
@ -200,4 +199,39 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
return map3; return map3;
} }
@Override
public R updateEntityDataAdmin(EntityDataUserVo entityDataUserVo) {
EntityData entityData = new EntityData();
entityData.setId(entityDataUserVo.getId());
//文件数据
List<MultipartFile> filesArray = entityDataUserVo.getFilesArray();
if (filesArray!=null && !filesArray.isEmpty()){
//路径拼接
List<String> link = new ArrayList<>();
//文件大小
List<Long> size = new ArrayList<>();
filesArray.stream().forEach(files -> {
BladeFile bladeFile = minioTemplate.putFile(files);
bladeFile = format(bladeFile, imageUrl);
//获取文件大小
Long fileSize = files.getSize();
link.add(bladeFile.getLink());
size.add(fileSize);
});
Long sum = size.stream().reduce(Long::sum).orElse(0L);
entityData.setSize(sum);
entityData.setLink(StringUtils.join(link, ","));
}
entityData.setTitle(entityDataUserVo.getTitle());
entityData.setDisasterId(entityDataUserVo.getDisasterId());
entityData.setRemark(entityDataUserVo.getRemark());
entityData.setType(entityDataUserVo.getType());
return R.status(this.baseMapper.updateById(entityData) > 0);
}
} }