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);
......
......@@ -8,6 +8,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.jcs.api.entity.VoiceFusionLog;
import com.yeejoin.amos.boot.module.jcs.api.mapper.VoiceFusionLogMapper;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -102,6 +104,9 @@ public class AlertCalledController extends BaseController {
private static String ALETR_TYPE_AID = "1214";
private static String ALETR_TYPE_AID_STATUS = "patientStatus";
private static String FireAlarmNum = "FireAlarmNum";
private static String FaultAlarmNum = "FaultAlarmNum";
private static String MonitorEventNum = "monitorEventNum";
@Autowired
......@@ -129,7 +134,7 @@ public class AlertCalledController extends BaseController {
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("新增失敗");
throw new BadRequest("新增失敗");
}
return ResponseHelper.buildResponse("新增成功!");
};
......@@ -148,8 +153,7 @@ public class AlertCalledController extends BaseController {
@Transactional
public ResponseModel<AlertCalled> saveAlertCalled(@RequestBody AlertCalledObjsDto alertCalledObjsDto) throws Exception {
if (ValidationUtil.isEmpty(alertCalledObjsDto)
|| ValidationUtil.isEmpty(alertCalledObjsDto.getAlertCalled()))
if (ValidationUtil.isEmpty(alertCalledObjsDto) || ValidationUtil.isEmpty(alertCalledObjsDto.getAlertCalled()))
throw new BadRequest("参数校验失败.");
ReginParams reginParams = getSelectedOrgInfo();
//获取当前登录人公司
......@@ -159,22 +163,20 @@ public class AlertCalledController extends BaseController {
if (alertCalled.getAlertTypeCode().equals(ALETR_TYPE_AID)) {
List<AlertFormValue> alertFormValue = alertCalledObjsDto.getAlertFormValue();
alertFormValue.forEach(e -> {
if (e.getFieldCode().equals(ALETR_TYPE_AID_STATUS)) {
if (e.getFieldValue() != null) {
if (e.getFieldCode().equals(ALETR_TYPE_AID_STATUS) && e.getFieldValue() != null ){
if (e.getFieldValue().contains(",")) {
String[] split = e.getFieldValue().split(",");
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < split.length; i++) {
DataDictionary hzxz = dataDictionaryService.getByCode(split[i], "HZXZ");
Arrays.stream(split).forEach(a->{
DataDictionary hzxz = dataDictionaryService.getByCode(a, "HZXZ");
stringBuilder.append(hzxz.getName() + " ");
e.setFieldValue(stringBuilder.toString());
}
});
} else {
DataDictionary hzxz = dataDictionaryService.getByCode(e.getFieldValue(), "HZXZ");
e.setFieldValue(hzxz.getName());
}
}
}
});
alertCalledObjsDto.setAlertFormValue(alertFormValue);
}
......@@ -251,12 +253,6 @@ public class AlertCalledController extends BaseController {
String callTimeStart,
String systemSourceCode,
@RequestParam(value ="isFatherAlert",required = false) String isFatherAlert) {
/* Page<AlertCalled> pageBean;
IPage<AlertCalled> page;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
return ResponseHelper.buildResponse(page);
setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort); */
/*分页存在问题 修改分页参数 陈召 2021-09-22 开始*/
Page<AlertCalled> page = new Page<>();
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
......@@ -312,10 +308,10 @@ public class AlertCalledController extends BaseController {
Page<ESAlertCalledDto> esAlertCalledDtoPage = eSAlertCalledService.queryByKeys(alertCalledVo, current, size);
List<ESAlertCalledDto> records = esAlertCalledDtoPage.getRecords();
for (ESAlertCalledDto record : records) {
if (record.getResponseLevelCode() != null) {
DataDictionary byCode = dataDictionaryService.getByCode(record.getResponseLevelCode(), "XYJBR");
record.setResponseLevel(byCode.getName());
for (ESAlertCalledDto data : records) {
if (data.getResponseLevelCode() != null) {
DataDictionary byCode = dataDictionaryService.getByCode(data.getResponseLevelCode(), "XYJBR");
data.setResponseLevel(byCode.getName());
}
}
/*bug 3090 警情填报,相似警情中响应级别错误显示为code 2021-10-13 chenzhao */
......@@ -334,10 +330,10 @@ public class AlertCalledController extends BaseController {
Page<ESAlertCalledDto> esAlertCalledDtoPage = eSAlertCalledService.queryByKeys(alertCalledVo, current, size,"120");
List<ESAlertCalledDto> records = esAlertCalledDtoPage.getRecords();
for (ESAlertCalledDto record : records) {
if (record.getResponseLevelCode() != null) {
DataDictionary byCode = dataDictionaryService.getByCode(record.getResponseLevelCode(), "XYJBR");
record.setResponseLevel(byCode.getName());
for (ESAlertCalledDto data : records) {
if (data.getResponseLevelCode() != null) {
DataDictionary byCode = dataDictionaryService.getByCode(data.getResponseLevelCode(), "XYJBR");
data.setResponseLevel(byCode.getName());
}
}
/*bug 3090 警情填报,相似警情中响应级别错误显示为code 2021-10-13 chenzhao */
......@@ -380,18 +376,12 @@ public class AlertCalledController extends BaseController {
private QueryWrapper<AlertCalled> setQueryWrapper(QueryWrapper<AlertCalled> queryWrapper, AlertCalled alertCalled, String sort) {
Class<? extends AlertCalled> aClass = alertCalled.getClass();
queryWrapper.eq("is_delete", 0);
if (sort != null) {
if (sort != null ) {
String[] date = sort.split(",");
if (date[1].equals("ascend")) {
queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
} else {
queryWrapper.orderByDesc(RedisKey.humpToLine(date[0]));
}
} else {
queryWrapper.orderBy(true, date[1].equals("ascend"),RedisKey.humpToLine(date[0]));
}else {
queryWrapper.orderByDesc("call_time");
}
if (alertCalled.getCallTimeStart() != null && alertCalled.getCallTimeEnd() != null) {
queryWrapper.between("call_time", alertCalled.getCallTimeStart(), alertCalled.getCallTimeEnd());
}
......@@ -409,7 +399,7 @@ public class AlertCalledController extends BaseController {
});
fieldStream.forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(alertCalled);
if (o != null && !"serialVersionUID".equals(field.getName())) {
Class<?> type = field.getType();
......@@ -430,7 +420,7 @@ public class AlertCalledController extends BaseController {
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常");
throw new BadRequest("系统异常");
}
});
......@@ -510,12 +500,7 @@ public class AlertCalledController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询")
public ResponseModel<Object> getContact() {
// if (redisUtils.hasKey(RedisKey.CONTACT_USER)) {
// Object obj = redisUtils.get(RedisKey.CONTACT_USER);
// return ResponseHelper.buildResponse(obj);
// } else {
List<Map<String, String>> contactName = iAlertCalledService.getContactName();
// redisUtils.set(RedisKey.CONTACT_USER, contactName, time);
return ResponseHelper.buildResponse(contactName);
}
......@@ -555,20 +540,20 @@ public class AlertCalledController extends BaseController {
ResponseModel<Map<String, Object>> fireAlarm = equipFeignClient.getFireAlarm();
Map<String, Object> map = fireAlarm.getResult();
int fireAlarmNum = !ValidationUtil.isEmpty(map.get("FireAlarmNum")) ? Integer.valueOf(map.get("FireAlarmNum").toString()) : 0;
int fireAlarmNum = !ValidationUtil.isEmpty(map.get(FireAlarmNum)) ? Integer.valueOf(map.get(FireAlarmNum).toString()) : 0;
ResponseModel<Map<String, Object>> faultAlarm = equipFeignClient.getFaultAlarm();
map = faultAlarm.getResult();
int faultAlarmNum = !ValidationUtil.isEmpty(map.get("FaultAlarmNum")) ? Integer.valueOf(map.get("FaultAlarmNum").toString()) : 0;
int faultAlarmNum = !ValidationUtil.isEmpty(map.get(FaultAlarmNum)) ? Integer.valueOf(map.get(FaultAlarmNum).toString()) : 0;
ResponseModel<Map<String, Object>> monitorEvent = equipFeignClient.getMonitorEvent();
map = monitorEvent.getResult();
int monitorEventNum = !ValidationUtil.isEmpty(map.get("monitorEventNum")) ? Integer.valueOf(map.get("monitorEventNum").toString()) : 0;
int monitorEventNum = !ValidationUtil.isEmpty(map.get(MonitorEventNum)) ? Integer.valueOf(map.get(MonitorEventNum).toString()) : 0;
dto.setIotDetection(fireAlarmNum + faultAlarmNum + monitorEventNum);
ResponseModel<Object> currentHiddenDanger = latentDangerFeignClient.currentLandgerCount();
Integer currentHiddenDangerNum = JSONObject.parseObject(JSONObject.toJSONString(currentHiddenDanger.getResult())).getInteger("count") ;
Integer currentHiddenDangerNum = JSON.parseObject(JSON.toJSONString(currentHiddenDanger.getResult())).getInteger("count") ;
dto.setCurrentHiddenDanger(currentHiddenDangerNum);
dto.setAllNum(dto.getAlarmNum() + dto.getIotDetection() + currentHiddenDangerNum);
......@@ -591,15 +576,15 @@ public class AlertCalledController extends BaseController {
ResponseModel<Map<String, Object>> fireAlarm = equipFeignClient.getFireAlarm();
Map<String, Object> map = fireAlarm.getResult();
int fireAlarmNum = !ValidationUtil.isEmpty(map.get("FireAlarmNum")) ? Integer.valueOf(map.get("FireAlarmNum").toString()) : 0;
int fireAlarmNum = !ValidationUtil.isEmpty(map.get(FireAlarmNum)) ? Integer.valueOf(map.get(FireAlarmNum).toString()) : 0;
ResponseModel<Map<String, Object>> faultAlarm = equipFeignClient.getFaultAlarm();
map = faultAlarm.getResult();
int faultAlarmNum = !ValidationUtil.isEmpty(map.get("FaultAlarmNum")) ? Integer.valueOf(map.get("FaultAlarmNum").toString()) : 0;
int faultAlarmNum = !ValidationUtil.isEmpty(map.get(FaultAlarmNum)) ? Integer.valueOf(map.get(FaultAlarmNum).toString()) : 0;
ResponseModel<Map<String, Object>> monitorEvent = equipFeignClient.getMonitorEvent();
map = monitorEvent.getResult();
int monitorEventNum = !ValidationUtil.isEmpty(map.get("monitorEventNum")) ? Integer.valueOf(map.get("monitorEventNum").toString()) : 0;
int monitorEventNum = !ValidationUtil.isEmpty(map.get(MonitorEventNum)) ? Integer.valueOf(map.get(MonitorEventNum).toString()) : 0;
dto.setFireNum(fireAlarmNum);
dto.setFaultAlarmNum(faultAlarmNum);
......@@ -658,12 +643,6 @@ public class AlertCalledController extends BaseController {
String callTimeStart,
String systemSourceCode,
@RequestParam(value ="isFatherAlert",required = false) String isFatherAlert) {
/* Page<AlertCalled> pageBean;
IPage<AlertCalled> page;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
return ResponseHelper.buildResponse(page);
setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort); */
/*分页存在问题 修改分页参数 陈召 2021-09-22 开始*/
Page<AlertCalled> page = new Page<>();
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
......
......@@ -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;
......@@ -59,7 +61,8 @@ 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,7 +90,7 @@ 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());
}
}
......@@ -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;
......
//package com.yeejoin.amos.boot.module.jcs.biz.controller;
//
//import java.io.IOException;
//import java.lang.reflect.Field;
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.Iterator;
//import java.util.List;
//import java.util.Map;
//
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.core.io.ByteArrayResource;
//import org.springframework.http.HttpEntity;
//import org.springframework.http.HttpHeaders;
//import org.springframework.http.HttpMethod;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.MediaType;
//import org.springframework.http.ResponseEntity;
//import org.springframework.util.LinkedMultiValueMap;
//import org.springframework.util.MultiValueMap;
//import org.springframework.util.ObjectUtils;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.client.RestTemplate;
//import org.springframework.web.multipart.MultipartFile;
//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.utils.ResponseHelper;
//import org.typroject.tyboot.core.restful.utils.ResponseModel;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.google.common.collect.Maps;
//import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
//import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
//import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
//import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
//import com.yeejoin.amos.boot.biz.common.controller.BaseController;
//import com.yeejoin.amos.boot.module.jcs.biz.service.impl.RemoteSecurityService;
//import com.yeejoin.amos.component.feign.model.FeignClientResult;
//import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
//import com.yeejoin.amos.feign.privilege.model.CompanyModel;
//import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
//import com.yeejoin.amos.feign.privilege.model.RoleModel;
//import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//
///**
// * 获取用户信息
// *
// * @author gaodongdong
// */
//@RestController
//@RequestMapping(value = "/user")
//@Api(tags = "用户信息api")
//public class UserController extends BaseController {
//
// private final Logger logger = LoggerFactory.getLogger(UserController.class);
//
// @Autowired
// private RemoteSecurityService remoteSecurityService;
// @Autowired
// private RestTemplate restTemplate;
//
// @Value("${security.systemctl.name}")
// private String systemctl;
// private static final String appType = "APP";
//
// /**
// * 获取公司选择信息
// */
// @ApiOperation(value = "获取公司选择信息", notes = "获取公司选择信息")
// @GetMapping(value = "/selectInfo")
// @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
// public JSONObject selectInfo() {
// try {
// JSONObject result = new JSONObject();
// AgencyUserModel user = getUserInfo();
// if (user != null) {
// List<CompanyModel> list = user.getCompanys();
// Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments();
// Map<String, List<Map<String, Object>>> mapdate = new HashMap<String, List<Map<String, Object>>>();
// List<Map> listCompanyModel = new ArrayList();
// if (list != null && list.size() > 0) {
// for (CompanyModel article : list) {
// Map<String, Object> map = objectToMap(article);
// map.put("companySeq", map.get("sequenceNbr") + "");
// map.put("parentId", map.get("parentId") + "");
// listCompanyModel.add(map);
// long key = Long.valueOf(map.get("sequenceNbr").toString());
// List<DepartmentModel> listdep = mapDepartments.get(key);
// List<Map<String, Object>> dep = new ArrayList();
// for (DepartmentModel departmentModel : listdep) {
// if (departmentModel != null) {
// Map<String, Object> mapo = objectToMap(departmentModel);
// mapo.put("sequenceNbr", mapo.get("sequenceNbr").toString());
// dep.add(mapo);
// }
// }
// mapdate.put(map.get("sequenceNbr").toString(), dep);
// }
// }
// Map<String, Object> mapRoles = objectToMap(user.getOrgRoles());
//
// result.put("companys", listCompanyModel);
// result.put("orgRoles", user.getOrgRoles());
// result.put("companyDepartments", mapdate);
// return result;
// } else {
// throw new RuntimeException("请重新登录");
// }
// } catch (Exception e) {
// e.printStackTrace();
// logger.error("获取公司选择信息异常", e);
// throw new RuntimeException(e.getMessage());
// }
// }
//
//
// // 对象转map
//
// public static Map<String, Object> objectToMap(Object obj) throws IllegalAccessException {
// Map<String, Object> map = new HashMap<String, Object>();
// if (obj != null) {
// Class<?> clazz = obj.getClass();
// for (Field field : clazz.getDeclaredFields()) {
// field.setAccessible(true);
// String fieldName = field.getName();
// Object value = nvl(field.get(obj));
//
// if (fieldName.equals("sequenceNbr")) {
// map.put(fieldName, value + "");
// } else if (fieldName.equals("companySeq")) {
// map.put(fieldName, value + "");
// } else if (fieldName.equals("children")) {
// map.put(fieldName, value);
// } else {
// map.put(fieldName, value);
// }
//
// }
// return map;
// }
// return map;
// }
//
// public static Object nvl(Object param) {
// return param != null ? param : "";
// }
//
// /**
// * 保存登陆用户选择公司信息
// */
// @ApiOperation(value = "保存登陆用户选择公司信息", notes = "保存登陆用户选择公司信息")
// @PostMapping(value = "/save/curCompany")
// @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
// public JSONObject saveCurCompany(
// @ApiParam(value = "当前登陆用户所选单位机构编号", required = true) @RequestBody ReginParams selectUserInfo) {
// try {
// AgencyUserModel user = getUserInfo();
// CompanyBo company = new CompanyBo();
// DepartmentBo department = new DepartmentBo();
// RoleBo role = new RoleBo();
// if(ObjectUtils.isEmpty(selectUserInfo.getCompany())){
// CompanyModel companyM = user.getCompanys().get(0);
// Bean.copyExistPropertis(companyM,company);
//
// Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments();
// DepartmentModel departmentM = mapDepartments.get(companyM.getSequenceNbr()).get(0);
// Bean.copyExistPropertis(departmentM,department);
// Map<Long, List<RoleModel>> roles = user.getOrgRoles();
// RoleModel roleM = roles.get(departmentM.getSequenceNbr()).get(0);
//
// Bean.copyExistPropertis(roleM,role);
// selectUserInfo.setCompany(company);
// selectUserInfo.setDepartment(department);
// selectUserInfo.setRole(role);
// }else{
// company = selectUserInfo.getCompany();
// role = selectUserInfo.getRole();
// department = selectUserInfo.getDepartment();
// }
// ReginParams reginParams = new ReginParams();
// reginParams.setCompany(company);
// reginParams.setRole(role);
// reginParams.setDepartment(department);
// saveSelectedOrgInfo(reginParams);
// //保存用户信息
// saveUser(user);
//
// return buildCurCompany(selectUserInfo, user);
// } catch (Exception e) {
// e.printStackTrace();
// logger.error("保存登陆用户选择公司信息异常", e);
// throw new RuntimeException("系统繁忙,请稍后再试");
// }
// }
// private JSONObject buildCurCompany(ReginParams selectUserInfo, AgencyUserModel user) {
// JSONObject result = new JSONObject();
// result.put("userId", user.getUserId());
// result.put("realName", user.getRealName());
// result.put("userMobile", user.getMobile());
// result.put("userName", user.getUserName());
// result.put("email", user.getEmail());
//
// ResponseModel secResponse = remoteSecurityService
// .searchPermissionTree(selectUserInfo.getRole().getSequenceNbr(), appType);
// List<JSONObject> listp = new ArrayList<>();
// if (secResponse.getStatus()==HttpStatus.OK.value() && secResponse.getResult() != null) {
// JSONArray arr = JSON.parseArray(JSONArray.toJSONString(secResponse.getResult()));
// Map<String, JSONObject> map = Maps.newHashMap();
//
// if (arr != null && arr.size() > 0) {
// JSONObject obj = arr.getJSONObject(0);
// if (obj != null) {
// JSONArray childrens = obj.getJSONArray("children");
// if (childrens != null && childrens.size() > 0) {
// for (int i = 0; i < childrens.size(); i++) {
// JSONObject child = childrens.getJSONObject(i);
// // map.put(child.getString("path"), child);
// listp.add(child);
// }
// }
// }
//
// // result.put("userPower", map.get("app"));
// }
// }
// result.put("userPower", JSON.toJSON(listp));
// result.put("companyModel", selectUserInfo.getCompany());
// result.put("departmentModel", selectUserInfo.getDepartment());
// result.put("roleModel", selectUserInfo.getRole());
// return result;
// }
//
//
//
// /**
// *
// * 获取字典
// *
// */
//
// @ApiOperation(value = "查询指定的字典信息", notes = "查询指定的字典信息")
// @GetMapping(value = "listDictionaryByDictCode/{dictCode}")
// @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
// public List<DictionarieValueModel> listDictionaryByDictCode(@PathVariable String dictCode) {
// try {
// List<DictionarieValueModel> list = remoteSecurityService.listDictionaryByDictCode(dictCode);
//
// return list;
// } catch (Exception e) {
//
// throw new RuntimeException();
// }
// }
//
// /**
// *
// *
// * 上传图片到平台
// *
// **/
// @ApiOperation(httpMethod = "POST", value = "文件上传(<font color='blue'>release</font>)", notes = "文件上传")
// @RequestMapping(value = "/upload-file", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
// @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
// public ResponseModel uploadFile(@RequestParam("file") MultipartFile file) {
//
// FeignClientResult<Map<String, String>> date = remoteSecurityService.fileImage(file);
// Map<String, String> map1 = new HashMap<>();
// if (date != null) {
// Map<String, String> map = date.getResult();
// Iterator<String> it = map.keySet().iterator();
//
// while (it.hasNext()) {
// map1.put("url", it.next());
// }
//
// }
// return ResponseHelper.buildResponse(map1);
// }
//
// @ApiOperation(httpMethod = "POST", value = "文件上传(<font color='blue'>release</font>)", notes = "文件上传")
// @RequestMapping(value = "/upload-files", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
// @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
// public ResponseModel uploadFile(@RequestParam("files") MultipartFile[] files) throws IOException {
//
// // 设置请求头
// HttpHeaders headers = new HttpHeaders();
// MediaType type = MediaType.parseMediaType("multipart/form-data");
// headers.setContentType(type);
// headers.set("product", getProduct());
// headers.set("token", getToken());
// headers.set("appKey", getAppKey());
// // 设置请求体,注意是LinkedMultiValueMap
// MultiValueMap<String, Object> form = new LinkedMultiValueMap<>();
// List<Object> fileList = new ArrayList<>();
// for (MultipartFile file : files) {
// ByteArrayResource byteArrayResource = new ByteArrayResource(file.getBytes()) {
// @Override
// public String getFilename() throws IllegalStateException {
// return file.getOriginalFilename();
// }
// };
// fileList.add(byteArrayResource);
// }
//
// form.put("files", fileList);
//
// // 用HttpEntity封装整个请求报文
// HttpEntity<MultiValueMap<String, Object>> files1 = new HttpEntity<>(form, headers);
//
// ResponseEntity<String> responseEntity = restTemplate.exchange(
// "http://" + systemctl + "/systemctl/v1/filestorage/image", HttpMethod.POST, files1, String.class);
//
// JSONObject jsonObject = JSON.parseObject(responseEntity.getBody());
//
// Map<String, String> map1 = new HashMap<>();
// if (jsonObject != null) {
// Map<String, String> map = JSON.parseObject(jsonObject.get("result").toString(), Map.class);
// Iterator<String> it = map.keySet().iterator();
// String url = "";
// while (it.hasNext()) {
// url = url + it.next() + ",";
// }
// map1.put("url", url);
// }
// return ResponseHelper.buildResponse(map1);
// }
//
//}
\ No newline at end of file
......@@ -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