2021-07-13 10:18:08 +08:00
|
|
|
|
package com.xkrs.controller;
|
|
|
|
|
|
|
|
|
|
import com.xkrs.common.encapsulation.PromptMessageEnum;
|
2021-07-14 16:06:34 +08:00
|
|
|
|
import com.xkrs.common.tool.TokenUtil;
|
2021-07-30 08:29:00 +08:00
|
|
|
|
import com.xkrs.dao.FirePointDao;
|
2021-07-14 16:06:34 +08:00
|
|
|
|
import com.xkrs.dao.SysUserDao;
|
2021-09-23 16:36:08 +08:00
|
|
|
|
import com.xkrs.model.entity.FirePoint;
|
2021-07-13 10:18:08 +08:00
|
|
|
|
import com.xkrs.model.entity.FirePointEntity;
|
2021-07-14 16:06:34 +08:00
|
|
|
|
import com.xkrs.model.entity.SysUserEntity;
|
2021-07-13 10:18:08 +08:00
|
|
|
|
import com.xkrs.model.qo.FirePointQo;
|
2021-07-16 10:47:24 +08:00
|
|
|
|
import com.xkrs.model.vo.AppTaskBodyVo;
|
2021-07-13 10:18:08 +08:00
|
|
|
|
import com.xkrs.service.FirePointService;
|
2021-07-20 16:38:14 +08:00
|
|
|
|
import com.xkrs.websocket.service.WebSocketServer;
|
2021-07-13 10:18:08 +08:00
|
|
|
|
import org.springframework.context.i18n.LocaleContextHolder;
|
2021-07-14 16:06:34 +08:00
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
2021-07-16 10:47:24 +08:00
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
2021-07-13 10:18:08 +08:00
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
2021-10-11 16:28:03 +08:00
|
|
|
|
import javax.transaction.Transactional;
|
2021-07-16 10:47:24 +08:00
|
|
|
|
import java.io.IOException;
|
2021-07-15 15:22:23 +08:00
|
|
|
|
import java.util.List;
|
2021-07-13 10:18:08 +08:00
|
|
|
|
import java.util.Locale;
|
2021-07-16 09:22:48 +08:00
|
|
|
|
import java.util.Map;
|
2021-07-13 10:18:08 +08:00
|
|
|
|
|
|
|
|
|
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author XinYi Song
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
2021-07-14 16:06:34 +08:00
|
|
|
|
public class FirePointController {
|
2021-07-13 10:18:08 +08:00
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private FirePointService firePointService;
|
|
|
|
|
|
2021-07-14 16:06:34 +08:00
|
|
|
|
@Resource
|
|
|
|
|
private SysUserDao sysUserDao;
|
|
|
|
|
|
2021-07-30 08:29:00 +08:00
|
|
|
|
@Resource
|
|
|
|
|
private FirePointDao firePointDao;
|
|
|
|
|
|
2021-08-02 14:22:45 +08:00
|
|
|
|
|
2021-07-13 10:18:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 添加火点数据
|
|
|
|
|
* @param firePointQo
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/insertFirePoint")
|
|
|
|
|
public String insertFirePoint(@RequestBody FirePointQo firePointQo){
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
FirePointEntity firePointEntity = firePointService.insertFirePoint(firePointQo);
|
|
|
|
|
if(firePointEntity == null){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"添加数据失败",locale);
|
|
|
|
|
}else {
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"添加成功",locale);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-14 16:06:34 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 测试
|
|
|
|
|
* @param token
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/selectUserName")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('auth_general_user')")
|
|
|
|
|
public String selectUserName(@RequestHeader(value="Authorization") String token){
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
// 验证token
|
|
|
|
|
String tokenUserName = TokenUtil.getTokenUserName(token);
|
|
|
|
|
SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName);
|
|
|
|
|
if(sysUserEntity == null){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale);
|
|
|
|
|
}
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,sysUserEntity.getUserName(),locale);
|
|
|
|
|
}
|
2021-07-15 15:22:23 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2021-08-02 14:22:45 +08:00
|
|
|
|
* 查询今天的火点信息
|
2021-07-15 15:22:23 +08:00
|
|
|
|
* @param token
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/selectTodayFirePoint")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('auth_general_user')")
|
2021-08-02 14:56:25 +08:00
|
|
|
|
public String selectTodayFirePoint(@RequestParam("countyCode") String countyCode,@RequestHeader(value="Authorization") String token){
|
2021-07-15 15:22:23 +08:00
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
2021-08-02 14:56:25 +08:00
|
|
|
|
List<FirePointEntity> firePointEntities = firePointService.selectTodayFirePoint(countyCode);
|
2021-07-15 15:22:23 +08:00
|
|
|
|
if(firePointEntities == null || firePointEntities.size() == 0){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有火点数据",locale);
|
|
|
|
|
}
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
|
|
|
|
|
}
|
2021-07-16 09:22:48 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 动态多条件查询火点信息
|
|
|
|
|
* @param map
|
|
|
|
|
* @param token
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/selectFirePoint")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('auth_general_user')")
|
|
|
|
|
public String selectFirePoint(@RequestBody Map map,@RequestHeader(value="Authorization") String token){
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
// 区县编码
|
|
|
|
|
String cityCode = (String) map.get("cityCode");
|
|
|
|
|
// 卫星类型
|
|
|
|
|
String satelliteType = (String) map.get("satelliteType");
|
|
|
|
|
// 植被类型
|
|
|
|
|
String landType = (String) map.get("landType");
|
|
|
|
|
// 开始时间
|
|
|
|
|
String startTime = (String) map.get("startTime");
|
|
|
|
|
// 结束时间
|
|
|
|
|
String endTime = (String) map.get("endTime");
|
2021-08-02 14:22:45 +08:00
|
|
|
|
// 验证token
|
|
|
|
|
String tokenUserName = TokenUtil.getTokenUserName(token);
|
|
|
|
|
SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName);
|
|
|
|
|
// 查询省
|
|
|
|
|
if(sysUserEntity.getCountyCode().substring(2).equals("0000")){
|
|
|
|
|
List<FirePointEntity> firePointEntities = firePointService.selectFirePoint(sysUserEntity.getCountyCode(),cityCode, satelliteType, landType, startTime, endTime);
|
|
|
|
|
if(firePointEntities == null || firePointEntities.size() == 0){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有火点数据",locale);
|
|
|
|
|
}
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
|
|
|
|
|
// 查询市
|
|
|
|
|
}else if(sysUserEntity.getCountyCode().substring(4).equals("00") && !sysUserEntity.getCountyCode().substring(2).equals("0000")){
|
|
|
|
|
List<FirePointEntity> firePointEntities = firePointService.selectFirePointByCity(sysUserEntity.getCountyCode(), cityCode, satelliteType, landType, startTime, endTime);
|
|
|
|
|
if(firePointEntities == null || firePointEntities.size() == 0){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有火点数据",locale);
|
|
|
|
|
}
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
|
|
|
|
|
// 查询县
|
|
|
|
|
}else {
|
2021-08-10 08:41:17 +08:00
|
|
|
|
List<FirePointEntity> firePointEntities = firePointService.selectFirePointByCounty(sysUserEntity.getCountyCode(), satelliteType, landType, startTime, endTime);
|
2021-08-02 14:22:45 +08:00
|
|
|
|
if(firePointEntities == null || firePointEntities.size() == 0){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有火点数据",locale);
|
|
|
|
|
}
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
|
2021-07-16 09:22:48 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-16 09:52:25 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据火点编码修改火点状态
|
|
|
|
|
* @param map
|
|
|
|
|
* @param token
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/updateTypeByFireCode")
|
|
|
|
|
public String updateTypeByFireCode(@RequestBody Map map, @RequestHeader(value="Authorization") String token){
|
|
|
|
|
String fireCode = (String) map.get("fireCode");
|
|
|
|
|
String fireType = (String) map.get("fireType");
|
|
|
|
|
return firePointService.updateTypeByFireCode(fireCode,fireType,token);
|
|
|
|
|
}
|
2021-07-16 10:47:24 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 提交核查任务
|
|
|
|
|
* @param files
|
|
|
|
|
* @param appTaskBodyVo
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/insertAppTask")
|
|
|
|
|
public String insertAppTask(@RequestParam("files") MultipartFile[] files, AppTaskBodyVo appTaskBodyVo) throws IOException {
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
if("".equals(appTaskBodyVo.getFireCode()) || appTaskBodyVo.getFireCode() == null){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"火点编码不能为空",locale);
|
|
|
|
|
}
|
|
|
|
|
if("".equals(appTaskBodyVo.getTaskInformation()) || appTaskBodyVo.getTaskInformation() == null){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"任务描述不能为空",locale);
|
|
|
|
|
}
|
|
|
|
|
if(files == null || files.length == 0 ){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"图片不能为空",locale);
|
|
|
|
|
}
|
|
|
|
|
return firePointService.insertAppTask(files,appTaskBodyVo);
|
|
|
|
|
}
|
2021-07-16 11:12:37 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询核查的任务信息
|
|
|
|
|
* @param fireCode
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/selectAppTask")
|
|
|
|
|
public String selectAppTask(@RequestParam("fireCode") String fireCode) throws Exception {
|
|
|
|
|
return firePointService.selectAppTask(fireCode);
|
|
|
|
|
}
|
2021-07-16 17:21:31 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询近一周的火点信息
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/selectFirePointBetweenSeven")
|
|
|
|
|
public String selectFirePointBetweenSeven(){
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
List<FirePointEntity> firePointEntities = firePointService.selectFirePointBetweenSeven();
|
|
|
|
|
if(firePointEntities == null || firePointEntities.size() == 0){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时没有火点数据",locale);
|
|
|
|
|
}
|
2021-07-19 10:51:05 +08:00
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询近一个月的火点信息
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/selectFirePointByMonth")
|
2021-08-05 15:53:42 +08:00
|
|
|
|
@PreAuthorize("hasAnyAuthority('auth_general_user')")
|
|
|
|
|
public String selectFirePointByMonth(@RequestHeader(value="Authorization") String token) {
|
2021-07-19 10:51:05 +08:00
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
2021-08-05 15:53:42 +08:00
|
|
|
|
// 验证token
|
|
|
|
|
String tokenUserName = TokenUtil.getTokenUserName(token);
|
|
|
|
|
SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName);
|
|
|
|
|
List<FirePointEntity> firePointEntities = firePointService.selectFirePointByMonth(sysUserEntity.getCountyCode());
|
2021-07-19 10:51:05 +08:00
|
|
|
|
if(firePointEntities == null || firePointEntities.size() == 0){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时没有火点数据",locale);
|
|
|
|
|
}
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
|
2021-07-16 17:21:31 +08:00
|
|
|
|
}
|
2021-07-20 15:07:37 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询火点数量
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/selectFirePointNum")
|
|
|
|
|
public String selectFirePointNum(@RequestParam("keepType") String keepType){
|
|
|
|
|
// keepType为1时,查询近一天的火点数量
|
|
|
|
|
if("1".equals(keepType)){
|
|
|
|
|
return firePointService.selectFirePointNumDay();
|
|
|
|
|
// keepType为2时,查询近一周的火点数量
|
|
|
|
|
}else if("2".equals(keepType)){
|
|
|
|
|
return firePointService.selectFirePointNumWeek();
|
|
|
|
|
}else {
|
|
|
|
|
return firePointService.selectFirePointNumMonth();
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-20 17:26:17 +08:00
|
|
|
|
|
|
|
|
|
@GetMapping("/websocketTest")
|
|
|
|
|
public void websocketTest(@RequestParam("message") String message){
|
|
|
|
|
|
|
|
|
|
WebSocketServer.broadInfo(message);
|
|
|
|
|
}
|
2021-07-22 11:54:01 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询该省所有的市
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/selectCityName")
|
2021-08-02 17:05:11 +08:00
|
|
|
|
public String selectCityName(@RequestParam("code") String code){
|
2021-07-22 11:54:01 +08:00
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
2021-08-02 17:05:11 +08:00
|
|
|
|
if(code.substring(2).equals("0000")){
|
|
|
|
|
List<Map<String, Object>> maps = firePointService.selectCityName(code);
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,maps,locale);
|
|
|
|
|
}else {
|
|
|
|
|
List<Map<String, Object>> maps = firePointService.selectCountyName(code);
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,maps,locale);
|
|
|
|
|
}
|
2021-07-22 11:54:01 +08:00
|
|
|
|
}
|
2021-07-30 08:29:00 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据火点编码查询火点信息
|
|
|
|
|
* @param fireCode
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2021-12-06 09:03:07 +08:00
|
|
|
|
@GetMapping("/selectFirePointByCode")
|
2021-07-30 08:29:00 +08:00
|
|
|
|
public String selectFirePoint(@RequestParam("fireCode") String fireCode){
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
FirePointEntity byFireCode = firePointDao.findByFireCode(fireCode);
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,byFireCode,locale);
|
|
|
|
|
}
|
2021-09-23 16:36:08 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 测试添加火点信息
|
|
|
|
|
* @param firePointQo
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/insertFireTest")
|
|
|
|
|
public String insertFireTest(@RequestBody FirePointQo firePointQo){
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
FirePoint firePoint = firePointService.insertFireTest(firePointQo);
|
|
|
|
|
if(firePoint == null){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"添加数据失败",locale);
|
|
|
|
|
}else {
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"添加成功",locale);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-09-24 15:19:36 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导入全国省市区
|
|
|
|
|
* @param file
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/importCityExcel")
|
|
|
|
|
public String importCityExcel(MultipartFile file) throws Exception {
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
firePointService.importCityExcel(file);
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"导入成功",locale);
|
|
|
|
|
}
|
2021-09-29 08:32:23 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询今天的火点信息(测试)
|
|
|
|
|
* @param token
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/selectTodayFire")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('auth_general_user')")
|
|
|
|
|
public String selectTodayFire(@RequestParam("countyCode") String countyCode,@RequestHeader(value="Authorization") String token){
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
List<FirePoint> firePointEntities = firePointService.selectTodayFire(countyCode);
|
|
|
|
|
if(firePointEntities == null || firePointEntities.size() == 0){
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有火点数据",locale);
|
|
|
|
|
}
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
|
|
|
|
|
}
|
2021-10-11 16:28:03 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除水体类型的火点信息
|
|
|
|
|
* @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);
|
|
|
|
|
}
|
2021-12-01 14:13:05 +08:00
|
|
|
|
|
|
|
|
|
@GetMapping("/selectBeijing")
|
|
|
|
|
public String selectBeijing(){
|
|
|
|
|
// 获取区域信息
|
|
|
|
|
Locale locale = LocaleContextHolder.getLocale();
|
|
|
|
|
List<FirePointEntity> firePointEntities = firePointDao.selectBeijing();
|
|
|
|
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,firePointEntities,locale);
|
|
|
|
|
}
|
2022-01-10 11:15:34 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据火点编码添加火点前后的图片
|
|
|
|
|
* @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);
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-13 10:18:08 +08:00
|
|
|
|
}
|