Commit eab6b464 authored by 李腾威's avatar 李腾威

日常管理-警情列表增加响应级别及警情地址

parent 5413509f
...@@ -90,4 +90,10 @@ public class ESAlertCalledDto extends BaseDto { ...@@ -90,4 +90,10 @@ public class ESAlertCalledDto extends BaseDto {
@ApiModelProperty(value = "求援人电话") @ApiModelProperty(value = "求援人电话")
private String emergencyCall; private String emergencyCall;
/**
* 响应级别
*/
@ApiModelProperty(value = "响应级别")
private String responseLevel;
} }
...@@ -201,4 +201,7 @@ public class AlertCalledVo extends BaseEntity { ...@@ -201,4 +201,7 @@ public class AlertCalledVo extends BaseEntity {
@ApiModelProperty(value = "警情地址") @ApiModelProperty(value = "警情地址")
private String alertAddress; private String alertAddress;
@ApiModelProperty(value = "响应级别")
private String responseLevel;
} }
...@@ -13,8 +13,12 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto; ...@@ -13,8 +13,12 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.vo.AlertCalledVo; import com.yeejoin.amos.boot.module.tzs.api.vo.AlertCalledVo;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESAlertCalledService; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
...@@ -38,6 +42,9 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -38,6 +42,9 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream; import java.util.stream.Stream;
/** /**
...@@ -57,7 +64,10 @@ public class AlertCalledController extends BaseController { ...@@ -57,7 +64,10 @@ public class AlertCalledController extends BaseController {
AlertCalledServiceImpl iAlertCalledService; AlertCalledServiceImpl iAlertCalledService;
@Autowired @Autowired
private ESAlertCalledService eSAlertCalledService; private ESAlertCalledService eSAlertCalledService;
@Autowired
DispatchPaperServiceImpl dispatchPaperServiceImpl;
@Autowired
AlertFormValueServiceImpl iAlertFormValueService;
/** /**
* 新增警情接警填报记录 * 新增警情接警填报记录
* *
...@@ -103,7 +113,12 @@ public class AlertCalledController extends BaseController { ...@@ -103,7 +113,12 @@ public class AlertCalledController extends BaseController {
@RequestBody ESAlertCalledRequestDto alertCalledVo, @RequestBody ESAlertCalledRequestDto alertCalledVo,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) throws Exception { @RequestParam(value = "size") int size) throws Exception {
return ResponseHelper.buildResponse(eSAlertCalledService.queryByKeys(alertCalledVo, current, size));
Page<ESAlertCalledDto> esAlertCalledDtoPage = eSAlertCalledService.queryByKeys(alertCalledVo, current, size);
esAlertCalledDtoPage.getRecords().stream().forEach(e->{
getResponseLevel(alertCalledVo.getSequenceNbr(),null,e);
});
return ResponseHelper.buildResponse(esAlertCalledDtoPage);
} }
...@@ -146,6 +161,9 @@ public class AlertCalledController extends BaseController { ...@@ -146,6 +161,9 @@ public class AlertCalledController extends BaseController {
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper); page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
IPage<AlertCalledVo> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageVo(page); IPage<AlertCalledVo> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageVo(page);
calledVoIPage.getRecords().stream().forEach(e->e.setAlertAddress(e.getCity()+e.getDistrict())); calledVoIPage.getRecords().stream().forEach(e->e.setAlertAddress(e.getCity()+e.getDistrict()));
calledVoIPage.getRecords().stream().forEach(e->{
getResponseLevel(alertCalled.getSequenceNbr(),e,null);
});
return ResponseHelper.buildResponse(calledVoIPage); return ResponseHelper.buildResponse(calledVoIPage);
} }
...@@ -203,4 +221,27 @@ public class AlertCalledController extends BaseController { ...@@ -203,4 +221,27 @@ public class AlertCalledController extends BaseController {
}); });
return queryWrapper; return queryWrapper;
} }
void getResponseLevel(Long alertId,AlertCalledVo alertCalledVo,ESAlertCalledDto esAlertCalledDto) {
QueryWrapper<DispatchPaper> dispatchPaperQueryWrapper = new QueryWrapper<>();
dispatchPaperQueryWrapper.eq("alert_id",alertId);
DispatchPaper dispatchPaper = dispatchPaperServiceImpl.getOne(dispatchPaperQueryWrapper);
if(null != dispatchPaper) {
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", dispatchPaper.getSendUserId()).eq("alert_type_code",dispatchPaper.getAlertType());
// 派遣单动态表单数据
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
// map 存取数据
Map<String,String> dynamicParms = new HashMap<String,String>();
list.stream().forEach(paperFormValue -> {
dynamicParms.put("field_code","field_value");
});
String responseLevel = dynamicParms.get("response_level");
if(null != alertCalledVo) {
alertCalledVo.setResponseLevel(responseLevel);
} else {
esAlertCalledDto.setResponseLevel(responseLevel);
}
}
}
} }
...@@ -6,9 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,9 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService; import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator; import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit; import com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit;
import com.yeejoin.amos.boot.module.tzs.api.service.EquipFeignService;
import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService; import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService;
import com.yeejoin.amos.boot.module.tzs.api.vo.UseUnitVo; import com.yeejoin.amos.boot.module.tzs.api.vo.UseUnitVo;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
...@@ -46,7 +46,7 @@ public class UseUnitController extends BaseController { ...@@ -46,7 +46,7 @@ public class UseUnitController extends BaseController {
IUseUnitService iUseUnitService; IUseUnitService iUseUnitService;
@Autowired @Autowired
EquipFeignService equipFeignService; EquipFeignClient equipFeignClient;
@Autowired @Autowired
AmosFeignService amosFeignService; AmosFeignService amosFeignService;
...@@ -105,7 +105,7 @@ public class UseUnitController extends BaseController { ...@@ -105,7 +105,7 @@ public class UseUnitController extends BaseController {
@RequestMapping(value = "/buildingTree", method = RequestMethod.GET) @RequestMapping(value = "/buildingTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取消防建筑树", notes = "获取消防建筑树") @ApiOperation(httpMethod = "GET", value = "获取消防建筑树", notes = "获取消防建筑树")
public ResponseModel<Object> getBuildingTreeAndEquip() { public ResponseModel<Object> getBuildingTreeAndEquip() {
return equipFeignService.getBuildingTreeAndEquip(); return equipFeignClient.getBuildingTreeAndEquip();
} }
/** /**
......
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