glj-代码提交
This commit is contained in:
parent
157b411106
commit
2a56224d94
|
@ -29,4 +29,10 @@ public class DataUpload extends EntityData{
|
|||
private String geometry;
|
||||
|
||||
private String uploaderEmail;
|
||||
|
||||
private Integer isDownload;
|
||||
|
||||
private String account;
|
||||
|
||||
private String password;
|
||||
}
|
||||
|
|
|
@ -112,6 +112,17 @@ public class EntityData implements Serializable {
|
|||
*/
|
||||
private Integer isPublish;
|
||||
|
||||
/**
|
||||
* 是否下载(0 未下载/1已下载)
|
||||
*/
|
||||
private Integer isDownload;
|
||||
|
||||
|
||||
private String account;
|
||||
|
||||
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 上传人姓名
|
||||
*/
|
||||
|
|
|
@ -9,6 +9,12 @@ import java.util.List;
|
|||
@Data
|
||||
public class EntityDataUserVo {
|
||||
|
||||
|
||||
/**
|
||||
* 数据产品的大小(byte)
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数据名称
|
||||
*/
|
||||
|
@ -17,7 +23,7 @@ public class EntityDataUserVo {
|
|||
/**
|
||||
* 数据产品的大小(byte)
|
||||
*/
|
||||
private Long size;
|
||||
private Integer size;
|
||||
|
||||
/**
|
||||
* 数据类型(0-基础数据,1-减灾产品,2-制图产品)
|
||||
|
|
|
@ -45,6 +45,12 @@ public class DataUploadController {
|
|||
*/
|
||||
@GetMapping("/pages")
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,13 @@ public class EntityDataController {
|
|||
return R.data(entityDataService.saveEntityData(entityDataUserVo));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/updateEntityDataAdmin")
|
||||
public R updateEntityDataAdmin(EntityDataUserVo entityDataUserVo) {
|
||||
return R.data(entityDataService.updateEntityDataAdmin(entityDataUserVo));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/updateByIdEntityDataStatus")
|
||||
public R updateByIdEntityDataStatus(Long id,Integer status,Long managerId) {
|
||||
EntityData entityData = new EntityData();
|
||||
|
|
|
@ -42,12 +42,17 @@
|
|||
ed.status,ed.uploader_id,ed.manager_id,
|
||||
ed.review_time, ed.source_organization,
|
||||
ed.upload_type,
|
||||
ed.is_download,
|
||||
ed.account,
|
||||
ed.password,
|
||||
bu.name as uploaderName,
|
||||
bu.email as uploaderEmail
|
||||
from entity_data ed
|
||||
left join blade_user bu on bu.id = ed.uploader_id
|
||||
<where>
|
||||
and ed.status = 0
|
||||
<if test="params.status!=null and params.status!=''">
|
||||
ed.status = #{params.status}
|
||||
</if>
|
||||
<if test="params.disasterId!=null">
|
||||
and ed.disaster_id = #{params.disasterId}
|
||||
</if>
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
<result property="uploadType" column="upload_type" jdbcType="INTEGER"/>
|
||||
<result property="isDeleted" column="is_deleted" 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>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
|
@ -36,7 +39,8 @@
|
|||
ed.visual_lon,ed.visual_lat,
|
||||
ed.status,ed.uploader_id,ed.manager_id,
|
||||
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>
|
||||
|
||||
<select id="getEntityDataList" resultType="com.kening.vordm.entity.EntityData">
|
||||
|
|
|
@ -40,4 +40,7 @@ public interface EntityDataService extends IService<EntityData> {
|
|||
List<Map<String, Long>> getStatisticsByUserId(Long id, String year);
|
||||
|
||||
Map<String, Object> getStatisticsByUserIdPancake(Long id);
|
||||
|
||||
R updateEntityDataAdmin(EntityDataUserVo entityDataUserVo);
|
||||
|
||||
}
|
||||
|
|
|
@ -147,7 +147,6 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
|
|||
entityData.setRemark(entityDataUserVo.getRemark());
|
||||
entityData.setSourceOrganization(entityDataUserVo.getOrganization());
|
||||
entityData.setType(entityDataUserVo.getType());
|
||||
entityData.setTitle(entityDataUserVo.getTitle());
|
||||
return R.status(this.baseMapper.insert(entityData) > 0);
|
||||
}
|
||||
}
|
||||
|
@ -200,4 +199,39 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue