Commit 683e9ced authored by 郭武斌's avatar 郭武斌

*)修改相似警情api

parent f4278632
......@@ -206,10 +206,10 @@ public class AlertCalledController extends BaseController {
@ApiOperation(value = "相似警情分页查询")
@RequestMapping(value = "/page/similar", method = RequestMethod.POST)
public ResponseModel<Page<ESAlertCalledDto>> pageBySimilar(
@RequestBody ESAlertCalledDto alertCalled,
@RequestBody AlertCalledVo alertCalledVo,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) throws Exception {
return ResponseHelper.buildResponse(eSAlertCalledService.queryByKeys(alertCalled, current, size));
return ResponseHelper.buildResponse(eSAlertCalledService.queryByKeys(alertCalledVo, current, size));
}
/**
......
......@@ -25,6 +25,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.ESAlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository;
/**
......@@ -100,8 +101,15 @@ public class ESAlertCalledService {
* @return
*/
@SuppressWarnings({ "rawtypes" })
public Page<ESAlertCalledDto> queryByKeys(ESAlertCalledDto alertCalled, int current, int size)
public Page<ESAlertCalledDto> queryByKeys(AlertCalledVo alertCalledVo, int current, int size)
{
Page<ESAlertCalledDto> result = new Page<ESAlertCalledDto>(current, size);
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
if (ValidationUtil.isEmpty(alertCalled))
{
return result;
}
/**
* 通用匹配规则,条件构建
*/
......@@ -144,7 +152,6 @@ public class ESAlertCalledService {
// 对高亮词条进行操作
SearchHits<ESAlertCalled> searchHits =elasticsearchTemplate.search(queryBuilder.build(), ESAlertCalled.class);
Page<ESAlertCalledDto> result = new Page<ESAlertCalledDto>(current, size);
List<ESAlertCalledDto> list = new LinkedList<>();
for (SearchHit searchHit : searchHits.getSearchHits())
{
......@@ -215,7 +222,7 @@ public class ESAlertCalledService {
{
ESAlertCalled esAlertCalled = new ESAlertCalled();
esAlertCalled.setSequenceNbr(alertCalled.getSequenceNbr());
esAlertCalled.setAlertType(alertCalled.getAlarmType());
esAlertCalled.setAlertType(alertCalled.getAlertType());
esAlertCalled.setCallTime(alertCalled.getCallTime());
esAlertCalled.setCallTimeLong(alertCalled.getCallTime().getTime());
esAlertCalled.setContactUser(alertCalled.getContactUser());
......
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