添加了删除水体类型火点信息的接口
This commit is contained in:
parent
7a88b4f8df
commit
c6adc85b61
@ -59,6 +59,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.antMatchers(HttpMethod.POST,"/uploadFile").permitAll()
|
||||
.antMatchers(HttpMethod.POST,"/insertFireTest").permitAll()
|
||||
.antMatchers(HttpMethod.POST,"/importCityExcel").permitAll()
|
||||
.antMatchers(HttpMethod.POST,"/deleteShuiTi").permitAll()
|
||||
// 所有其它请求需要身份认证
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
|
@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.transaction.Transactional;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@ -324,4 +325,18 @@ public class FirePointController {
|
||||
}
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除水体类型的火点信息
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackOn = Exception.class)
|
||||
@PostMapping("/deleteShuiTi")
|
||||
public String deleteShuiTi(){
|
||||
// 获取区域信息
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
List<Integer> integers = firePointDao.selectId();
|
||||
firePointDao.deleteByIdIn(integers);
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"删除成功",locale);
|
||||
}
|
||||
}
|
||||
|
@ -71,4 +71,18 @@ public interface FirePointDao extends JpaRepository<FirePointEntity,Long>, JpaSp
|
||||
"on fp.county_code like concat('%',ci.city_code,'%') AND fp.add_time BETWEEN ?1 AND ?2 " +
|
||||
"group by ci.city_name",nativeQuery = true)
|
||||
List<Map<String,Object>> selectNumByArea(String startTime,String endTime);
|
||||
|
||||
/**
|
||||
* 查询水体类型的id
|
||||
* @return
|
||||
*/
|
||||
@Query(value = "select id from fire_point where land_type = '水体'",nativeQuery = true)
|
||||
List<Integer> selectId();
|
||||
|
||||
/**
|
||||
* 批量删除水体
|
||||
* @param id
|
||||
*/
|
||||
@Modifying(clearAutomatically=true)
|
||||
void deleteByIdIn(List<Integer> id);
|
||||
}
|
||||
|
@ -78,6 +78,9 @@ public class FirePointServiceImpl implements FirePointService {
|
||||
@Override
|
||||
public FirePointEntity insertFirePoint(FirePointQo firePointQo) {
|
||||
FirePointEntity firePointEntity = new FirePointEntity();
|
||||
if(firePointQo.getLandtype().equals("水体")){
|
||||
return null;
|
||||
}else {
|
||||
firePointEntity.setFireCode(firePointQo.getFireCode());
|
||||
firePointEntity.setCountyCode(firePointQo.getCountyCode().toString());
|
||||
firePointEntity.setCountyName(firePointQo.getCountyName());
|
||||
@ -110,7 +113,7 @@ public class FirePointServiceImpl implements FirePointService {
|
||||
// 将监测到的火点信息返给前端
|
||||
WebSocketServer.broadInfo(websocket);*/
|
||||
return firePointDao.save(firePointEntity);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user