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

日常管理-警情填报

parent 2625be26
package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -10,11 +9,10 @@ import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlarmStatisticsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
......@@ -24,7 +22,7 @@ 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.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlarmStatisticsDto;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
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;
......@@ -35,14 +33,12 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.opc.internal.FileHelper;
import org.springframework.beans.factory.annotation.Autowired;
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.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -124,7 +120,7 @@ public class AlertCalledController extends BaseController {
Page<ESAlertCalledDto> esAlertCalledDtoPage = eSAlertCalledService.queryByKeys(alertCalledVo, current, size);
esAlertCalledDtoPage.getRecords().stream().forEach(e->{
getResponseLevel(alertCalledVo.getSequenceNbr(),null,e);
getResponseLevel(e.getSequenceNbr(),null,e);
});
return ResponseHelper.buildResponse(esAlertCalledDtoPage);
}
......@@ -268,7 +264,7 @@ public class AlertCalledController extends BaseController {
IPage<AlertCalledDto> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageDto(page);
calledVoIPage.getRecords().stream().forEach(e->e.setAlertAddress(e.getCity()+e.getDistrict()));
calledVoIPage.getRecords().stream().forEach(e->{
getResponseLevel(alertCalled.getSequenceNbr(), e,null);
getResponseLevel(e.getSequenceNbr(), e,null);
});
return ResponseHelper.buildResponse(calledVoIPage);
}
......@@ -334,13 +330,13 @@ public class AlertCalledController extends BaseController {
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());
queryWrapper.eq("alert_called_id", dispatchPaper.getSequenceNbr()).eq("alert_type_code", DispatchPaperEnums.getEnumById(dispatchPaper.getAlertCode()).getDynamicCode());
// 派遣单动态表单数据
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");
dynamicParms.put(paperFormValue.getFieldCode(),paperFormValue.getFieldValue());
});
String responseLevel = dynamicParms.get("response_level");
if(null != alertCalledDto) {
......@@ -369,7 +365,7 @@ public class AlertCalledController extends BaseController {
@PostMapping("/exportSelectRecord")
public void exportAlertCalled(@RequestBody AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
List<AlertCalledQueryDto> list = iAlertCalledService.queryAlertListByQueryDto(alertCalledQueryDto);
String fileName = "警情事件记录" + new Date().getTime();
String fileName = "警情事件记录" + System.currentTimeMillis();
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list,
AlertCalledQueryDto.class, null, false);
}
......
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