Commit 23a7b027 authored by chenzhao's avatar chenzhao

修改检索出来异常代码

parent bc61b69b
......@@ -2,7 +2,8 @@ package com.yeejoin.amos.boot.module.common.api.enums;
public enum ExceptionEnum {
PARAMETER_TYPE_ERROR ("0001","传入參數异常");
PARAMETER_TYPE_ERROR ("0001","传入參數异常"),
PARAMETER_TYPE_ERR ("400","系统异常!");
private String eCode;
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -15,6 +16,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceIm
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -50,6 +52,7 @@ import java.util.Map;
* @date 2021-06-29
*/
@RestController
@Slf4j
@Api(tags = "航空器信息Api")
@RequestMapping(value = "/aircraft")
public class AircraftController extends BaseController {
......@@ -64,6 +67,7 @@ public class AircraftController extends BaseController {
@Autowired
private AlertFormValueServiceImpl iAlertFormValueService;
/**
* 新增航空器信息
*
......@@ -244,19 +248,22 @@ public class AircraftController extends BaseController {
ResponseModel<Map<String, Object>> dataModel = iotFeignClient.getDynamicFlightInfo(num);
if (dataModel != null) {
Map<String, Object> map = dataModel.getResult()!=null? dataModel.getResult():null;
if (map != null) {
if (dataModel != null && dataModel.getResult()!=null) {
Map<String, Object> map = dataModel.getResult();
//sonarLint 报错 需要将多次引用的抽成常量
String dynamicFlightId = "dynamicFlightId";
String runway = "runway";
String stand = "stand";
String passengerCapacity = "passengerCapacity";
map1.put("aircraftModel", map.containsKey("aircraftType")?map.get("aircraftType"):null);
map1.put("dynamicFlightId", map.containsKey("dynamicFlightId")?map.get("dynamicFlightId"):null);
map1.put(dynamicFlightId, map.containsKey(dynamicFlightId)?map.get(dynamicFlightId):null);
map1.put("landingTime", map.containsKey("sta")?map.get("sta"):null);
/* 任务 3488 根据航班号查询航班信息回填 增加跑道,机位字段 start*/
map1.put("runway", map.containsKey("runway")?map.get("runway"):null);
map1.put("stand", map.containsKey("stand")?map.get("stand"):null);
map1.put(runway, map.containsKey(runway)?map.get(runway):null);
map1.put(stand, map.containsKey(stand)?map.get(stand):null);
/* 任务 3488 根据航班号查询航班信息回填 end*/
// map1.put("fuelQuantity", map.get(""));
map1.put("passengerCapacity", map.containsKey("passengerCapacity")?map.get("passengerCapacity"):null );
}
map1.put(passengerCapacity, map.containsKey(passengerCapacity)?map.get(passengerCapacity):null );
}
return ResponseHelper.buildResponse(map1);
}
......@@ -273,28 +280,6 @@ public class AircraftController extends BaseController {
/**
*
* 导出航空器信息
* 已废弃
* **/
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @GetMapping(value = "/exportData")
// @ApiOperation(httpMethod = "GET", value = "导出航空器信息", notes = "导出航空器信息")
// public void exportData ( HttpServletResponse response)throws IOException {
// String fileName = "Aircraft";
// response.setContentType("multipart/form-data");
// response.setCharacterEncoding("utf-8");
// response.addHeader("Content-Disposition", "attachment;filename=" + fileName+ ".xlsx");
// String sheetName = "航空器信息";
// ExcelWriter writer = new ExcelWriter(response.getOutputStream(), ExcelTypeEnum.XLSX);
// Sheet sheet = new Sheet(1, 0,AircraftDtos.class);
// List<AircraftDto> list = aircraftServiceImpl.queryAircraftDtoForList(false);
// sheet.setSheetName(sheetName);
// writer.write(list, sheet);
// writer.finish();
// }
/**
*
* 导入航空器信息
*
* **/
......@@ -304,8 +289,7 @@ public class AircraftController extends BaseController {
public Boolean ImportData (@RequestPart MultipartFile multipartFile) {
List<Aircraft> aircraftList = new ArrayList<>();
try {
// list = ExcelUtil.readFirstSheetExcel(multipartFile, AircraftDto.class, 0);
EasyExcel.read(multipartFile.getInputStream(), AircraftDto.class, new AnalysisEventListener<AircraftDto>() {
EasyExcelFactory.read(multipartFile.getInputStream(), AircraftDto.class, new AnalysisEventListener<AircraftDto>() {
// 每读取一行就调用该方法
@Override
public void invoke(AircraftDto data, AnalysisContext context) {
......@@ -317,7 +301,7 @@ public class AircraftController extends BaseController {
// 全部读取完成就调用该方法
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
System.out.println("读取完成");
log.warn("读取完成");
}
}).sheet().doRead();
aircraftServiceImpl.saveBatch(aircraftList);
......
......@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -121,7 +122,7 @@ public class AlertFormController extends BaseController {
@RequestMapping(value = "/form/{code}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据表态类型code查询表单数据项", notes = "根据表态类型code查询表单数据项")
public ResponseModel<Object> selectFormdItem(HttpServletRequest request, @PathVariable String code){
List<AlertFormInitDto> list=new ArrayList<AlertFormInitDto>();
List<AlertFormInitDto> list;
if(redisUtils.hasKey(RedisKey.FORM_CODE+code)){
Object obj= redisUtils.get(RedisKey.FORM_CODE+code);
JSONArray arr = (JSONArray) obj;
......@@ -163,7 +164,7 @@ public class AlertFormController extends BaseController {
Class<? extends AlertForm> aClass = alertForm.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(alertForm);
if (o != null) {
Class<?> type = field.getType();
......@@ -174,9 +175,6 @@ public class AlertFormController extends BaseController {
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(alertForm);
alertFormQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(alertForm);
alertFormQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(alertForm);
alertFormQueryWrapper.eq(name, fileValue);
......
......@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -24,6 +25,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormTypeServiceImp
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
/**
......@@ -107,7 +109,7 @@ public class AlertFormTypeController extends BaseController {
Class<? extends AlertFormType> aClass = alertFormType.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(alertFormType);
if (o != null) {
Class<?> type = field.getType();
......@@ -126,11 +128,10 @@ public class AlertFormTypeController extends BaseController {
String fileValue = (String) field.get(alertFormType);
alertFormTypeQueryWrapper.eq(name, fileValue);
}
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
IPage<AlertFormType> page;
......
......@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -24,6 +25,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceIm
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
/**
......@@ -107,7 +109,7 @@ public class AlertFormValueController extends BaseController {
Class<? extends AlertFormValue> aClass = alertFormValue.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(alertFormValue);
if (o != null) {
Class<?> type = field.getType();
......@@ -118,16 +120,13 @@ public class AlertFormValueController extends BaseController {
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(alertFormValue);
alertFormValueQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(alertFormValue);
alertFormValueQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(alertFormValue);
alertFormValueQueryWrapper.eq(name, fileValue);
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
IPage<AlertFormValue> page;
......
......@@ -34,6 +34,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -42,6 +43,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -171,7 +173,7 @@ public class AlertSubmittedController extends BaseController {
return;
}
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(alertSubmitted);
if (o != null) {
Class<?> type = field.getType();
......@@ -182,16 +184,13 @@ public class AlertSubmittedController extends BaseController {
} else if (type.equals(Long.class) || "long".equals(type.toString())) {
Long fileValue = (Long) field.get(alertSubmitted);
alertSubmittedQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(alertSubmitted);
alertSubmittedQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(alertSubmitted);
alertSubmittedQueryWrapper.eq(name, fileValue);
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
IPage<AlertSubmitted> page;
......@@ -220,7 +219,7 @@ public class AlertSubmittedController extends BaseController {
String companyName = getSelectedOrgInfo().getCompany().getCompanyName();
alertSubmittedService.getAlertSubmittedContent(alertCalledId, templateVos, companyName);
} catch (IllegalAccessException e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
} catch (ParseException e) {
e.printStackTrace();
}
......@@ -248,10 +247,9 @@ public class AlertSubmittedController extends BaseController {
TemplateExtendDto template = null;
Template templateN = null;
if(schedulingContent.getType().equals(AlertBusinessTypeEnum.警情结案.getName()) ||
schedulingContent.getType().equals(AlertBusinessTypeEnum.警情续报.getName()) ||
schedulingContent.getType().equals(AlertBusinessTypeEnum.非警情确认.getName())) {
} else {
if(!schedulingContent.getType().equals(AlertBusinessTypeEnum.警情结案.getName()) &&
!schedulingContent.getType().equals(AlertBusinessTypeEnum.警情续报.getName()) &&
!schedulingContent.getType().equals(AlertBusinessTypeEnum.非警情确认.getName())) {
// 获取模板
templateN = templateService
.getOne(new QueryWrapper<Template>().eq("type_code", "JQCB").eq("format", false));
......@@ -271,18 +269,17 @@ public class AlertSubmittedController extends BaseController {
definitions.put("$callTime", DateUtils.convertDateToString(alertCalled.getCallTime(),DateUtils.DATE_TIME_PATTERN));
definitions.put("$replaceContent",replaceContent);
definitions.put("$address",ValidationUtil.isEmpty(alertCalled.getAddress()) ? "" : alertCalled.getAddress());
// definitions.put("$recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN));
definitions.put("$contactUser",ValidationUtil.isEmpty(alertCalled.getContactUser()) ? "" : alertCalled.getContactUser());
definitions.put("$trappedNum",ValidationUtil.isEmpty(alertCalledRo.getTrappedNum()) ? "" : String.valueOf(alertCalled.getTrappedNum()));
definitions.put("$casualtiesNum",ValidationUtil.isEmpty(alertCalled.getCasualtiesNum()) ? "" : String.valueOf(alertCalled.getCasualtiesNum()));
definitions.put("$contactPhone",ValidationUtil.isEmpty(alertCalled.getContactPhone()) ? "" : alertCalled.getContactPhone());
String companyName = JSONObject.parseObject(schedulingContent.getSubmissionContent()).getString("companyName") ;
String companyName = JSON.parseObject(schedulingContent.getSubmissionContent()).getString("companyName") ;
JSONObject jsonObject = null;
if(!ValidationUtil.isEmpty(alertCalled.getUpdateTime())) {
jsonObject = JSONObject.parseObject(schedulingContent.getSubmissionContent());
jsonObject = JSON.parseObject(schedulingContent.getSubmissionContent());
jsonObject.put("recDate",DateUtils.convertDateToString(alertCalled.getUpdateTime(), DateUtils.DATE_TIME_PATTERN));
}
......
......@@ -11,9 +11,11 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
......@@ -93,7 +95,7 @@ public class AlertSubmittedObjectController extends BaseController {
Class<? extends AlertSubmittedObject> aClass = alertSubmittedObject.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(alertSubmittedObject);
if (o != null) {
Class<?> type = field.getType();
......@@ -104,16 +106,13 @@ public class AlertSubmittedObjectController extends BaseController {
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(alertSubmittedObject);
alertSubmittedObjectQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(alertSubmittedObject);
alertSubmittedObjectQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(alertSubmittedObject);
alertSubmittedObjectQueryWrapper.eq(name, fileValue);
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
IPage<AlertSubmittedObject> page;
......
......@@ -42,13 +42,6 @@ public class Audio2TextController {
@ApiOperation(httpMethod = "GET", value = "测试语音转文字融合接口", notes = "测试语音转文字融合接口")
public HashMap<String, Object> startConvertAndSendAudio(@RequestParam String cid, @RequestParam String myNumber, @RequestParam String callerNumber) {
HashMap<String, Object> convert = audio2Text.doTranslate(cid, myNumber, callerNumber);
/* try {
TimeUnit.SECONDS.sleep(1);
socketClient.process((Integer) convert.get(myNumber), 2);
socketClient.process((Integer) convert.get(callerNumber), 3);
} catch (InterruptedException e) {
e.printStackTrace();
}*/
return convert;
}
......
......@@ -4,6 +4,8 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.module.common.api.enums.ExceptionEnum;
import org.apache.commons.jexl2.UnifiedJEXL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -58,8 +60,9 @@ public class ExcelController extends BaseController {
@Value("${logic}")
Boolean logic ;
private static final String NOT_DUTY = "休班";
private static String JCDWRY = "JCDWRY";
private static String DLDWRY = "DLDWRY";
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取上传excle文件是否成功")
......@@ -78,8 +81,8 @@ public class ExcelController extends BaseController {
@GetMapping("/download/template/{type}")
public void downloadTemplate(HttpServletResponse response, @PathVariable(value = "type") String type) {
try {
if(type.equals("JCDWRY") && !logic){
type = "DLDWRY";
if(type.equals(JCDWRY) && logic != null&& !logic){
type = DLDWRY;
}
ExcelEnums excelEnums = ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(),
......@@ -87,15 +90,15 @@ public class ExcelController extends BaseController {
excelService.templateExport(response, excelDto);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
/**
* * @param Map par 可以传递过滤条件,传入具体实现类中
*
*
* @return
*
*
* <PRE>
* author tw
* date 2021/9/13
......@@ -107,8 +110,8 @@ public class ExcelController extends BaseController {
public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type,
@RequestParam Map par) {
try {
if(type.equals("JCDWRY") && !logic){
type = "DLDWRY";
if(type.equals(JCDWRY) && logic != null &&!logic){
type = DLDWRY;
}
ExcelEnums excelEnums = ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(),
......@@ -116,7 +119,7 @@ public class ExcelController extends BaseController {
excelService.commonExport(response, excelDto, par);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
......@@ -129,8 +132,8 @@ public class ExcelController extends BaseController {
long uuid = sequence.nextId();
String uuidString = Long.toString(uuid);
redisUtils.set(uuidString, 0);
if(type.equals("JCDWRY") && !logic){
type = "DLDWRY";
if(type.equals(JCDWRY) && logic !=null && !logic){
type = DLDWRY;
}
ExcelEnums excelEnums = ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(),
......@@ -146,32 +149,6 @@ public class ExcelController extends BaseController {
}
// @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "上传文件数据-2")
// @PostMapping("/upload2")
// public void upload2(@RequestPart("file") MultipartFile multipartFile,
// @RequestParam(required = false) String fileName,
// @RequestParam(required = false) String sheetName,
// @RequestParam String type) {
// try {
// excelService.commonUpload(multipartFile, new ExcelDto(fileName, sheetName, type));
// } catch (Exception e) {
// e.printStackTrace();
// throw new RuntimeException("系统异常!");
// }
// }
// @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "导出公用类2")
// @GetMapping("/export/list")
// public void exportByType(HttpServletResponse response, @RequestParam(required = false) String fileName,
// @RequestParam(required = false) String sheetName, @RequestParam String type) {
// try {
// excelService.commonExport(response, new ExcelDto(fileName, sheetName, type));
// } catch (Exception e) {
// e.printStackTrace();
// throw new RuntimeException("系统异常!");
// }
// }
/**
* 导出值班模板
*
......@@ -193,7 +170,7 @@ public class ExcelController extends BaseController {
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
......@@ -206,7 +183,7 @@ public class ExcelController extends BaseController {
excelService.dutyInfoExport(response, beginDate, endDate, excelDto);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
......@@ -222,7 +199,7 @@ public class ExcelController extends BaseController {
excelService.exportByParams(response, excelDto, params);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
......@@ -234,7 +211,7 @@ public class ExcelController extends BaseController {
return ResponseHelper.buildResponse(dataSources.selectList(type, method));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
}
......@@ -5,12 +5,14 @@ import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.enums.ExceptionEnum;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -22,6 +24,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -138,7 +141,7 @@ public class FirefightersController extends BaseController {
iFirefightersService.saveFirefighters(firefighters);
return ResponseHelper.buildResponse(firefighters);
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
......@@ -155,7 +158,7 @@ public class FirefightersController extends BaseController {
@Transactional
public ResponseModel<Object> deleteById(HttpServletRequest request, @PathVariable Long id) {
//BUG 2761 判断人员删除时的逻辑 如果被选为队伍联系人则无法被删除 bykongfm
List fireTeam = iFireTeamService.list(new LambdaQueryWrapper<FireTeam>().eq(FireTeam::getIsDelete, false).eq(FireTeam::getContactUserId, id));
List<FireTeam> fireTeam = iFireTeamService.list(new LambdaQueryWrapper<FireTeam>().eq(FireTeam::getIsDelete, false).eq(FireTeam::getContactUserId, id));
if (fireTeam.size() > 0) {
return ResponseHelper.buildResponse("-1");
}
......@@ -186,7 +189,7 @@ public class FirefightersController extends BaseController {
return ResponseHelper.buildResponse("0");
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("删除失败!");
throw new BadRequest("删除失败!");
}
}
......@@ -219,7 +222,7 @@ public class FirefightersController extends BaseController {
userCarService.delete(userCar);
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
......@@ -270,7 +273,7 @@ public class FirefightersController extends BaseController {
return ResponseHelper.buildResponse(null);
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
......@@ -343,7 +346,7 @@ public class FirefightersController extends BaseController {
Class<? extends Firefighters> aClass = firefighters.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(firefighters);
if (o != null) {
Class<?> type = field.getType();
......@@ -365,7 +368,7 @@ public class FirefightersController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
});
IPage<Firefighters> page;
......@@ -500,7 +503,7 @@ public class FirefightersController extends BaseController {
}
return ResponseHelper.buildResponse(iFirefightersService.updatePeopleById(firefighters, id));
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest(ExceptionEnum.PARAMETER_TYPE_ERR.getEmsg());
}
}
......@@ -519,10 +522,6 @@ public class FirefightersController extends BaseController {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if(null != reginParam) {
String bizOrgCode = reginParam.getPersonIdentity().getBizOrgCode();
// String bizOrgName = reginParam.getPersonIdentity().getCompanyName();
// QueryWrapper<Firefighters> firefightersQueryWrapper2 = new QueryWrapper<>();
// firefightersQueryWrapper2.eq("amos_user_id",reginParam.getUserModel().getUserId());
// Firefighters one = iFirefightersService.getOne(firefightersQueryWrapper2);
List<Map<String,Object>> list = new ArrayList<>();
Map<String,Object> bizOrgCodeAndBizOrgName = iFirefightersService.getCompanyName(bizOrgCode);
......
......@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -128,7 +129,7 @@ public class FirefightersJacketController extends BaseController {
Class<? extends FirefightersJacket> aClass = firefightersJacket.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(firefightersJacket);
if (o != null) {
Class<?> type = field.getType();
......@@ -158,7 +159,7 @@ public class FirefightersJacketController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
IPage<FirefightersJacket> page;
......
......@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -147,7 +148,7 @@ public class FirestationJacketController extends BaseController {
Class<? extends FirestationJacket> aClass = firestationJacket.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(firestationJacket);
if (o != null) {
Class<?> type = field.getType();
......@@ -177,7 +178,7 @@ public class FirestationJacketController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
IPage<FirestationJacket> page;
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.read.builder.ExcelReaderSheetBuilder;
......@@ -30,6 +31,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -52,6 +54,10 @@ public class OrganizationController extends BaseController {
@Autowired
private OrganizationService organizationService;
@Autowired
private static String UTF8 = "UTF-8";
private static String CONTENTDISPOSITION = "Content-Disposition";
@PersonIdentify
@GetMapping(value = "/getOrganizationInfo")
......@@ -100,21 +106,21 @@ public class OrganizationController extends BaseController {
public void export(HttpServletResponse response) {
String file_name = null;
try {
response.setCharacterEncoding("UTF-8");
response.setCharacterEncoding(UTF8);
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("组织机构信息.xlsx", "UTF-8") );
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader(CONTENTDISPOSITION, "attachment;filename=" + URLEncoder.encode("组织机构信息.xlsx", UTF8) );
response.setHeader("Access-Control-Expose-Headers", CONTENTDISPOSITION);
List<OrganizationExportDto> firstSheetVOS = new ArrayList<>();
List<OrganizationUserExportDto> secondSheetVOS = new ArrayList<>();
// 应急救援小组写入
ExcelWriter writer = EasyExcel.write(response.getOutputStream(), OrganizationExportDto.class).build();
WriteSheet sheet = EasyExcel.writerSheet(0, "应急救援小组").build();
ExcelWriter writer = EasyExcelFactory.write(response.getOutputStream(), OrganizationExportDto.class).build();
WriteSheet sheet = EasyExcelFactory.writerSheet(0, "应急救援小组").build();
writer.write(firstSheetVOS, sheet);
// 组员写入
WriteSheet sheet2 = EasyExcel.writerSheet(1, "组员").head(OrganizationUserExportDto.class).build();
WriteSheet sheet2 = EasyExcelFactory.writerSheet(1, "组员").head(OrganizationUserExportDto.class).build();
writer.write(secondSheetVOS, sheet2);
// 关闭流
......@@ -140,21 +146,21 @@ public class OrganizationController extends BaseController {
}
}
try {
response.setCharacterEncoding("UTF-8");
response.setCharacterEncoding(UTF8);
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("组织机构信息.xlsx", "UTF-8") );
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader(CONTENTDISPOSITION, "attachment;filename=" + URLEncoder.encode("组织机构信息.xlsx", UTF8) );
response.setHeader("Access-Control-Expose-Headers", CONTENTDISPOSITION);
// 应急小组信息
List<OrganizationExportDto> organizationList = organizationService.selectOrganization(bizOrgCode);
// 应急小组人员信息
List<OrganizationUserExportDto> organizationUserList = organizationService.selectOrganizationUserList(bizOrgCode);
// 应急小组写入
ExcelWriter writer = EasyExcel.write(response.getOutputStream(), OrganizationExportDto.class).build();
WriteSheet sheet = EasyExcel.writerSheet(0, "应急救援小组").build();
ExcelWriter writer = EasyExcelFactory.write(response.getOutputStream(), OrganizationExportDto.class).build();
WriteSheet sheet = EasyExcelFactory.writerSheet(0, "应急救援小组").build();
writer.write(organizationList, sheet);
// 组员写入
WriteSheet sheet2 = EasyExcel.writerSheet(1, "组员").head(OrganizationUserExportDto.class).build();
WriteSheet sheet2 = EasyExcelFactory.writerSheet(1, "组员").head(OrganizationUserExportDto.class).build();
writer.write(organizationUserList, sheet2);
// 关闭流
......@@ -179,14 +185,14 @@ public class OrganizationController extends BaseController {
}
}
try {
ExcelReader reader = EasyExcel.read(file.getInputStream()).build();
ExcelReader reader = EasyExcelFactory.read(file.getInputStream()).build();
List<OrganizationExportDto> organizationList = ExcelUtil.readExcel(reader, OrganizationExportDto.class, 0);
List<OrganizationUserExportDto> organizationUserList = ExcelUtil.readExcel(reader, OrganizationUserExportDto.class, 1);
organizationService.saveOrganization(organizationList, organizationUserList, bizOrgCode);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e.getMessage());
throw new BadRequest(e.getMessage());
}
return CommonResponseUtil.success();
......
......@@ -11,6 +11,7 @@ import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -130,7 +131,7 @@ public class PowerTransferCompanyController extends BaseController {
Class<? extends PowerTransferCompany> aClass = powerTransferCompany.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(powerTransferCompany);
if (o != null) {
Class<?> type = field.getType();
......@@ -141,16 +142,13 @@ public class PowerTransferCompanyController extends BaseController {
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(powerTransferCompany);
powerTransferCompanyQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(powerTransferCompany);
powerTransferCompanyQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(powerTransferCompany);
powerTransferCompanyQueryWrapper.eq(name, fileValue);
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
IPage<PowerTransferCompany> page;
......@@ -176,10 +174,6 @@ public class PowerTransferCompanyController extends BaseController {
throw new BadRequest("警情ID不能为空");
}
jcSituationDetailMapper.insert(jcSituationDetail);
// if (ObjectUtils.isNotEmpty(jcSituationDetail.getAttachments())) {
// sourceFileService.saveAttachments(jcSituationDetail.getSequenceNbr(), jcSituationDetail.getAttachments());
// }
// 自定义指令信息消息推送
// 定义指令信息消息推送 页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, false);
......
......@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IUserCarService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -27,6 +28,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferCompanyRes
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
/**
......@@ -95,7 +97,6 @@ public class PowerTransferCompanyResourcesController extends BaseController {
//获取用户已绑定车辆id、
UserCar userCar=userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
id =userCar!=null?userCar.getCarId():null;
UpdateWrapper<PowerTransferCompanyResources> up=new UpdateWrapper<>();
return powerTransferCompanyResourcesService.update(new UpdateWrapper<PowerTransferCompanyResources>().eq("resources_id", id).set("status", code));
}
......@@ -138,7 +139,7 @@ public class PowerTransferCompanyResourcesController extends BaseController {
Class<? extends PowerTransferCompanyResources> aClass = powerTransferCompanyResources.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(powerTransferCompanyResources);
if (o != null) {
Class<?> type = field.getType();
......@@ -149,16 +150,13 @@ public class PowerTransferCompanyResourcesController extends BaseController {
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(powerTransferCompanyResources);
powerTransferCompanyResourcesQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(powerTransferCompanyResources);
powerTransferCompanyResourcesQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(powerTransferCompanyResources);
powerTransferCompanyResourcesQueryWrapper.eq(name, fileValue);
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
IPage<PowerTransferCompanyResources> page;
......
......@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -128,7 +129,7 @@ public class PowerTransferController extends BaseController {
Class<? extends PowerTransfer> aClass = powerTransfer.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(powerTransfer);
if (o != null) {
Class<?> type = field.getType();
......@@ -139,9 +140,6 @@ public class PowerTransferController extends BaseController {
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(powerTransfer);
powerTransferQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(powerTransfer);
powerTransferQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(powerTransfer);
powerTransferQueryWrapper.eq(name, fileValue);
......
......@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -128,7 +129,7 @@ public class ShiftChangeController extends BaseController {
iShiftChangeService.exportPdfById(response, shiftChangeId);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
throw new BadRequest("系统异常!");
}
}
......
......@@ -179,14 +179,6 @@ public class SignController extends BaseController {
@ApiOperation(httpMethod = "POST",value = "保存打卡记录", notes = "保存打卡记录")
@PostMapping(value = "/saveSign")
public ResponseModel<Boolean> hasSign(@RequestBody SignDto dto) {
// QueryWrapper<Sign> signQueryWrapper = new QueryWrapper<>();
// signQueryWrapper.eq("user_id",dto.getSignUserId());
// signQueryWrapper.eq("date",dto.getDate());
// signQueryWrapper.eq("type",dto.getType());
// Sign one = signServiceImpl.getOne(signQueryWrapper);
// if(null != one) {
// return ResponseHelper.buildResponse(true);
// }
return ResponseHelper.buildResponse(signServiceImpl.saveSign(dto));
}
}
......@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -115,7 +117,7 @@ public class TemplateController extends BaseController {
Class<? extends Template> aClass = template.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(template);
if (o != null) {
Class<?> type = field.getType();
......@@ -126,16 +128,13 @@ public class TemplateController extends BaseController {
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(template);
templateQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(template);
templateQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(template);
templateQueryWrapper.eq(name, fileValue);
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
IPage<Template> page;
......
......@@ -58,8 +58,8 @@ public class VoiceRecordFileController extends BaseController {
@GetMapping(value = "/{sequenceNbr}")
public ResponseModel<VoiceRecordFileDto> getRecordById(@PathVariable Long sequenceNbr) {
VoiceRecordFileDto record = voiceRecordFileService.getRecordById(sequenceNbr);
return ResponseHelper.buildResponse(record);
VoiceRecordFileDto data = voiceRecordFileService.getRecordById(sequenceNbr);
return ResponseHelper.buildResponse(data);
}
/**
......
......@@ -35,31 +35,6 @@ public class AlertCalledAction {
@Autowired
private AlertSubmittedServiceImpl alertSubmittedService;
public void sendSysMessage(String msgType, AlertCalledRo contingency) {
// ContingencyRo ro = (ContingencyRo)contingency;
// ro.setTelemetryMap(null);
// ro.setTelesignallingMap(null);
// Constructor<?> constructor;
// try {
// constructor = Class.forName(
// PACKAGEURL + result.getClass().getSimpleName() + "Message")
// .getConstructor(ActionResult.class);
// AbstractActionResultMessage<?> action = (AbstractActionResultMessage<?>) constructor.newInstance(result);
// ToipResponse toipResponse = action.buildResponse(msgType, contingency, result.toJson());
// String topic = String.format("/%s/%s/%s", serviceName, stationName,"numberPlan");
// log.info(String.format("mqtt[%s]:【 %s 】", topic, toipResponse.toJsonStr()));
// webMqttComponent.publish(topic, toipResponse.toJsonStr());
// ContingencyEvent event = new ContingencyEvent(this);
// event.setMsgBody(toipResponse.toJsonStr());
// event.setTopic(topic);
// event.setMsgType(msgType);
// event.setContingency(contingency);
// contingencyLogPublisher.publish(event);
//
// } catch (Exception e) {
// e.printStackTrace();
// }
}
/**
* 短信报送
......@@ -71,8 +46,7 @@ public class AlertCalledAction {
*/
@RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则")
public void sendcmd(String smsCode, String sendType, List<Map<String,Object>> submittedList, Object object) throws Exception {
System.out.println("接收到规则调用--------------西咸机场119接处警规则/alertCalledRule");
log.warn("接收到规则调用--------------西咸机场119接处警规则/alertCalledRule");
alertSubmittedService.ruleCallbackAction(smsCode, submittedList, object);
}
......
......@@ -58,7 +58,7 @@ public class PowerTransferAction {
AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object;
// 获取力量调派发送人员
List<String> persons = new ArrayList<>();
List<String> persons = null;
List<Map<String, Object>> personslist = new ArrayList<Map<String, Object>>();
if (FireBrigadeTypeEnum.专职消防队.getKey().equals(calledRo.getPowerTransType())) {
alertSubmittedService.ruleCallbackActionForPowerTransferForCar(smsCode, sendIds, object,personslist);//消防车辆
......
......@@ -64,6 +64,8 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
@Autowired
private AlertFormValueServiceImpl iAlertFormValueService;
private static String aircraftModel="aircraftModel";
/**
* <pre>
* 保存
......@@ -121,7 +123,7 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
AlertCalledObjsDto dto = (AlertCalledObjsDto)iAlertCalledService.selectAlertCalledByIdNoRedisNew(seq);
List<AlertFormValue> list = dto.getAlertFormValue();
String aircraft = "";
List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals("aircraftModel")).collect(Collectors.toList());
List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals(aircraftModel)).collect(Collectors.toList());
if(list1.size() > 0) {
if(!ValidationUtil.isEmpty(list1.get(0).getFieldValue())) {
aircraft = list1.get(0).getFieldValue();
......@@ -158,7 +160,7 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
AlertCalledObjsDto dto = (AlertCalledObjsDto)iAlertCalledService.selectAlertCalledByIdNoRedisNew(seq);
List<AlertFormValue> list = dto.getAlertFormValue();
String aircraft = "";
List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals("aircraftModel")).collect(Collectors.toList());
List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals(aircraftModel)).collect(Collectors.toList());
if(list1.size() > 0) {
if(!ValidationUtil.isEmpty(list1.get(0).getFieldValue())) {
aircraft = list1.get(0).getFieldValue();
......@@ -260,11 +262,6 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
AircraftDto aircraftDto = this.queryBySeq(id);
aircraftDto.setIsDelete(true);
this.updateWithModel(aircraftDto);
// //删除附件信息
// Systemctl.fileInfoClient.deleteByAlias(agencyCode, Aircraft.class.getSimpleName(),
// String.valueOf(id), null);
// //删除航空器信息
// this.deleteBySeq(id);
}
return seqs;
}
......@@ -395,7 +392,7 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
@Override
public Aircraft queryByaircraftModel(String seq) {
QueryWrapper<Aircraft> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("aircraftModel", seq);
queryWrapper.eq(aircraftModel, seq);
// 警情动态表单数据
Aircraft aircraft = this.getOne(queryWrapper);
return aircraft;
......@@ -412,7 +409,6 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", alertId);
// 警情动态表单数据
List<KeyValueLabel> listdate = new ArrayList<>();
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
String num = null;
......
......@@ -46,7 +46,6 @@ public class AlertCalledFeedbackServiceImpl extends BaseService<AlertCalledFeedb
public boolean handleFeedback(AlertCalledFeedbackDto model) {
Long alertCalledId = model.getAlertCalledId();
// 更新警情调派任务状态
List<String> carIdList = powerTransferMapper.queryTransferCarIdsByAlertCalledId(alertCalledId);
// 保存警情反馈
model = createWithModel(model);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment