冲突解决
This commit is contained in:
commit
6d33feb5d4
|
@ -1,8 +1,10 @@
|
|||
package com.kening.vordm.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EntityDataUserVo {
|
||||
|
@ -131,4 +133,14 @@ public class EntityDataUserVo {
|
|||
* 职称
|
||||
*/
|
||||
private String professionalTitle;
|
||||
|
||||
/**
|
||||
* 职称
|
||||
*/
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 文件信息
|
||||
*/
|
||||
private List<MultipartFile> filesArray;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.kening.vordm.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FileVo {
|
||||
|
||||
//文件大小
|
||||
private Long fileSize;
|
||||
|
||||
//获取文件类型
|
||||
private String fileType;
|
||||
|
||||
//文件后缀
|
||||
private String fileSuffix;
|
||||
|
||||
//文件存储路径
|
||||
private String link;
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.kening.vordm.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springblade.common.cache.CacheNames;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.redis.cache.BladeRedis;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author wanghongqing
|
||||
* @date 2023/3/31 11:10
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/captcha")
|
||||
@RequiredArgsConstructor
|
||||
@Api(value = "验证码校验接口", tags = "验证码校验")
|
||||
public class CaptchaController extends BladeController {
|
||||
|
||||
private final BladeRedis bladeRedis;
|
||||
|
||||
|
||||
@PostMapping("/validate")
|
||||
@ApiOperation(value = "验证码校验", notes = "传入需要校验的验证码以及缓存Key")
|
||||
public R<String> validDefaultTime(@RequestParam String code, @RequestParam String key) {
|
||||
// 获取验证码
|
||||
String redisCode = bladeRedis.get(CacheNames.CAPTCHA_KEY + key);
|
||||
// 判断验证码
|
||||
if (code == null || !StringUtil.equalsIgnoreCase(redisCode, code)) {
|
||||
return R.fail(1404, "Verification code error");
|
||||
}
|
||||
return R.success("OK");
|
||||
}
|
||||
|
||||
}
|
|
@ -47,7 +47,7 @@ public class EntityDataController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("/saveEntityData")
|
||||
public R saveEntityData(@RequestBody EntityDataUserVo entityDataUserVo) {
|
||||
public R saveEntityData(EntityDataUserVo entityDataUserVo) {
|
||||
return R.data(entityDataService.saveEntityData(entityDataUserVo));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package com.kening.vordm.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.kening.vordm.vo.FileVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.core.oss.MinioTemplate;
|
||||
import org.springblade.core.oss.model.BladeFile;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@RequestMapping("/ui/upload")
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class FileController {
|
||||
|
||||
|
||||
/**
|
||||
* 对象存储模块
|
||||
*/
|
||||
@Autowired
|
||||
private MinioTemplate minioTemplate;
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/uploadFile")
|
||||
public R upload(MultipartFile file){
|
||||
BladeFile bladeFile = minioTemplate.putFile(file);
|
||||
//获取文件大小
|
||||
Long fileSize = file.getSize();
|
||||
//获取文件类型
|
||||
String fileType = file.getContentType();
|
||||
//文件后缀
|
||||
String fileSuffix = file.getOriginalFilename();
|
||||
//文件存储路径
|
||||
String link = bladeFile.getLink();
|
||||
FileVo fileVo = new FileVo();
|
||||
fileVo.setFileSize(fileSize);
|
||||
fileVo.setFileType(fileType);
|
||||
fileVo.setFileSuffix(fileSuffix);
|
||||
fileVo.setLink(link);
|
||||
return R.data(bladeFile);
|
||||
}
|
||||
}
|
|
@ -36,7 +36,10 @@ public class RemoteSensingSourceDataController {
|
|||
*/
|
||||
@GetMapping("/SourceData")
|
||||
public R<IPage<RemoteSensingSourceData>> getRemoteSensingSourceData(DisasterInfo disasterInfo, Query query){
|
||||
List<Long> disasterIds=disasterInfoService.getDisasterId(disasterInfo);
|
||||
List<Long> disasterIds = disasterInfoService.getDisasterId(disasterInfo);
|
||||
if (disasterIds.isEmpty()){
|
||||
return R.data(null);
|
||||
}
|
||||
return R.data(remoteSensingSourceDataService.page(Condition.getPage(query),new QueryWrapper<RemoteSensingSourceData>().in("disaster_id",disasterIds)));
|
||||
}
|
||||
|
||||
|
|
|
@ -55,15 +55,14 @@ implements DisasterInfoService {
|
|||
qw.eq("disaster_time",disasterInfo.getDisasterTime());
|
||||
}
|
||||
List<DisasterInfo> disasterInfos = this.baseMapper.selectList(qw);
|
||||
if (!disasterInfos.isEmpty()){
|
||||
List<Long> ids = new ArrayList<>();
|
||||
if (!disasterInfos.isEmpty()){
|
||||
disasterInfos.stream().forEach(disasterInfo1 -> {
|
||||
ids.add(disasterInfo1.getId());
|
||||
ids .add(disasterInfo1.getId());
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
return null;
|
||||
// return new ArrayList<>();
|
||||
return ids;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,12 +9,21 @@ import com.kening.vordm.mapper.EntityDataMapper;
|
|||
import com.kening.vordm.mapper.GuestInfoMapper;
|
||||
import com.kening.vordm.service.EntityDataService;
|
||||
import com.kening.vordm.vo.EntityDataUserVo;
|
||||
import com.kening.vordm.vo.FileVo;
|
||||
import com.kening.vordm.vo.UserTenantVo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.core.oss.MinioTemplate;
|
||||
import org.springblade.core.oss.model.BladeFile;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -31,6 +40,11 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
|
|||
|
||||
private GuestInfoMapper guestInfoMapper;
|
||||
|
||||
/**
|
||||
* 对象存储模块
|
||||
*/
|
||||
private MinioTemplate minioTemplate;
|
||||
|
||||
@Override
|
||||
public IPage<EntityData> getEntityDataList(IPage<Object> page, EntityData entityData) {
|
||||
return this.baseMapper.getEntityDataList(entityData, page);
|
||||
|
@ -83,5 +97,16 @@ public class EntityDataServiceImpl extends ServiceImpl<EntityDataMapper, EntityD
|
|||
return this.baseMapper.insert(entityData)>1;
|
||||
}
|
||||
|
||||
public static MultipartFile fileToMultipartFile(File file) {
|
||||
MultipartFile result = null;
|
||||
if (null != file) {
|
||||
try (FileInputStream input = new FileInputStream(file)) {
|
||||
result = new MockMultipartFile(file.getName().concat("temp"), file.getName(), "text/plain", input);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.kening.vordm.mapper.ContactMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.kening.vordm.entity.Contact">
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="email" column="email" jdbcType="VARCHAR"/>
|
||||
<result property="organization" column="organization" jdbcType="VARCHAR"/>
|
||||
<result property="message" column="message" jdbcType="VARCHAR"/>
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
user_name,email,organization,
|
||||
message,id
|
||||
</sql>
|
||||
</mapper>
|
|
@ -65,6 +65,25 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springblade</groupId>
|
||||
<artifactId>blade-starter-oss</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>esdk-obs-java</artifactId>
|
||||
<groupId>com.huaweicloud</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-mock</artifactId>
|
||||
<version>2.0.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
|
|
Loading…
Reference in New Issue