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

日常管理-警情统计优化

parent 610dcaa1
package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -20,9 +19,6 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
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.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.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;
......@@ -32,7 +28,6 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -54,7 +49,6 @@ import java.lang.reflect.Field;
import java.text.ParseException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -264,7 +258,7 @@ public class AlertCalledController extends BaseController {
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
IPage<AlertCalledDto> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageDto(page);
calledVoIPage.getRecords().stream().forEach(e->{
getResponseLevel(e.getSequenceNbr(), e,null);
e.setAlertAddress(e.getAddress());
});
return ResponseHelper.buildResponse(calledVoIPage);
}
......@@ -324,28 +318,7 @@ public class AlertCalledController extends BaseController {
return queryWrapper;
}
void getResponseLevel(Long alertId, AlertCalledDto alertCalledDto, ESAlertCalledDto esAlertCalledDto) {
LambdaQueryWrapper<DispatchPaper> dispatchPaperQueryWrapper = new LambdaQueryWrapper<>();
dispatchPaperQueryWrapper.eq(DispatchPaper::getAlertId,alertId);
DispatchPaper dispatchPaper = dispatchPaperServiceImpl.getOne(dispatchPaperQueryWrapper);
if(null != dispatchPaper) {
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, dispatchPaper.getSequenceNbr()).eq(AlertFormValue::getAlertTypeCode, 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(paperFormValue.getFieldCode(),paperFormValue.getFieldValue());
});
String responseLevel = dynamicParms.get("response_level");
if(null != alertCalledDto) {
alertCalledDto.setResponseLevel(responseLevel);
} else {
esAlertCalledDto.setResponseLevel(responseLevel);
}
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
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