添加了对接遥感算法进行火点图片添加的功能模块

This commit is contained in:
XinYi Song 2022-01-10 11:15:34 +08:00
parent 39267f9e86
commit 5a7ada09c3
5 changed files with 99 additions and 3 deletions

View File

@ -64,6 +64,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers(HttpMethod.GET,"/api/user/verificationCodeUpdate").permitAll()
.antMatchers(HttpMethod.GET,"/api/user/getVerificationCode").permitAll()
.antMatchers(HttpMethod.POST,"/api/user/userUnRememberPassword").permitAll()
.antMatchers(HttpMethod.POST,"/updateBeforeFireAndAfterFireImage").permitAll()
// 所有其它请求需要身份认证
.anyRequest().authenticated()
.and()

View File

@ -347,4 +347,29 @@ public class FirePointController {
List<FirePointEntity> firePointEntities = firePointDao.selectBeijing();
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
}
/**
* 根据火点编码添加火点前后的图片
* @param map
* @return
*/
@Transactional(rollbackOn = Exception.class)
@PostMapping("/updateBeforeFireAndAfterFireImage")
public String updateBeforeFireAndAfterFireImage(@RequestBody Map map){
// 获取区域信息
Locale locale = LocaleContextHolder.getLocale();
String fireCode = (String) map.get("fireCode");
String beforeFireImage = (String) map.get("beforeFireImage");
String afterFireImage = (String) map.get("afterFireImage");
if(fireCode == null || "".equals(fireCode)){
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"火点编码不能为空!",locale);
}
FirePointEntity byFireCode = firePointDao.findByFireCode(fireCode);
if(byFireCode == null){
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"火点编码错误!",locale);
}
firePointDao.updateBeforeFireAndAfterFireImage(fireCode,beforeFireImage,afterFireImage);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"添加图片成功!",locale);
}
}

View File

@ -110,4 +110,14 @@ public interface FirePointDao extends JpaRepository<FirePointEntity,Long>, JpaSp
*/
@Query(value = "select * from fire_point fp where fp.fire_point_address like concat('%','北京市','%') and fp.add_time BETWEEN '2021-10-19' AND '2021-11-20'",nativeQuery = true)
List<FirePointEntity> selectBeijing();
/**
* 根据火点编码修改火点前后图片路径
* @param fireCode
* @param beforeFireImage
* @param afterFireImage
*/
@Modifying(clearAutomatically=true)
@Query(value = "update fire_point set before_fire_image = ?2,after_fire_image = ?3 where fire_code = ?1",nativeQuery = true)
void updateBeforeFireAndAfterFireImage(String fireCode, String beforeFireImage, String afterFireImage);
}

View File

@ -93,11 +93,21 @@ public class FirePoint {
*/
private String satelliteImage;
/**
* 火点前的图片
*/
private String beforeFireImage;
/**
* 火点后的图片
*/
private String afterFireImage;
public FirePoint() {
}
public FirePoint(Integer id, String fireCode, double longitude, double latitude, String countyCode, String countyName, String satelliteTime, String satelliteType, String landType, String addTime, String confidence, String firePointAddress, String fireType, String fireImage, String satelliteImage) {
public FirePoint(Integer id, String fireCode, double longitude, double latitude, String countyCode, String countyName, String satelliteTime, String satelliteType, String landType, String addTime, String confidence, String firePointAddress, String fireType, String fireImage, String satelliteImage, String beforeFireImage, String afterFireImage) {
this.id = id;
this.fireCode = fireCode;
this.longitude = longitude;
@ -113,6 +123,8 @@ public class FirePoint {
this.fireType = fireType;
this.fireImage = fireImage;
this.satelliteImage = satelliteImage;
this.beforeFireImage = beforeFireImage;
this.afterFireImage = afterFireImage;
}
public Integer getId() {
@ -235,9 +247,25 @@ public class FirePoint {
this.satelliteImage = satelliteImage;
}
public String getBeforeFireImage() {
return beforeFireImage;
}
public void setBeforeFireImage(String beforeFireImage) {
this.beforeFireImage = beforeFireImage;
}
public String getAfterFireImage() {
return afterFireImage;
}
public void setAfterFireImage(String afterFireImage) {
this.afterFireImage = afterFireImage;
}
@Override
public String toString() {
return "FirePointEntity{" +
return "FirePoint{" +
"id=" + id +
", fireCode='" + fireCode + '\'' +
", longitude=" + longitude +
@ -253,6 +281,8 @@ public class FirePoint {
", fireType='" + fireType + '\'' +
", fireImage='" + fireImage + '\'' +
", satelliteImage='" + satelliteImage + '\'' +
", beforeFireImage='" + beforeFireImage + '\'' +
", afterFireImage='" + afterFireImage + '\'' +
'}';
}
}

View File

@ -95,12 +95,22 @@ public class FirePointEntity implements Serializable {
*/
private String satelliteImage;
/**
* 火点前的图片
*/
private String beforeFireImage;
/**
* 火点后的图片
*/
private String afterFireImage;
public FirePointEntity() {
}
public FirePointEntity(Integer id, String fireCode, double longitude, double latitude, String countyCode, String countyName, String satelliteTime, String satelliteType, String landType, String addTime, String confidence, String firePointAddress, String fireType, String fireImage, String satelliteImage) {
public FirePointEntity(Integer id, String fireCode, double longitude, double latitude, String countyCode, String countyName, String satelliteTime, String satelliteType, String landType, String addTime, String confidence, String firePointAddress, String fireType, String fireImage, String satelliteImage, String beforeFireImage, String afterFireImage) {
this.id = id;
this.fireCode = fireCode;
this.longitude = longitude;
@ -116,6 +126,8 @@ public class FirePointEntity implements Serializable {
this.fireType = fireType;
this.fireImage = fireImage;
this.satelliteImage = satelliteImage;
this.beforeFireImage = beforeFireImage;
this.afterFireImage = afterFireImage;
}
public Integer getId() {
@ -238,6 +250,22 @@ public class FirePointEntity implements Serializable {
this.satelliteImage = satelliteImage;
}
public String getBeforeFireImage() {
return beforeFireImage;
}
public void setBeforeFireImage(String beforeFireImage) {
this.beforeFireImage = beforeFireImage;
}
public String getAfterFireImage() {
return afterFireImage;
}
public void setAfterFireImage(String afterFireImage) {
this.afterFireImage = afterFireImage;
}
@Override
public String toString() {
return "FirePointEntity{" +
@ -256,6 +284,8 @@ public class FirePointEntity implements Serializable {
", fireType='" + fireType + '\'' +
", fireImage='" + fireImage + '\'' +
", satelliteImage='" + satelliteImage + '\'' +
", beforeFireImage='" + beforeFireImage + '\'' +
", afterFireImage='" + afterFireImage + '\'' +
'}';
}
}