Commit 3530008e authored by 李松's avatar 李松

修改bug

parent e415011c
......@@ -846,8 +846,8 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/callRecords/{id}")
@ApiOperation(httpMethod = "GET", value = "根据id获取通话记录信息", notes = "根据id获取通话记录信息")
public ResponseModel<Object> getCallRecords(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.getCallRecords(id));
public ResponseModel<Object> getCallRecords(@PathVariable Long id, @RequestParam int number, @RequestParam int size) {
return ResponseHelper.buildResponse(iAlertCalledService.getCallRecords(id, number, size));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -981,7 +981,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return alertCalledMapper.getCountNum(userName, startTime, endTime, groupCode);
}
public Object getCallRecords(Long id) {
public Object getCallRecords(Long id, int number, int size) {
Page<VoiceRecordFileDto> voiceRecordFileDtoPage = new Page<>();
HashMap<String, Object> map = new HashMap<>();
LambdaQueryWrapper<VoiceRecordFile> queryWrapper = new LambdaQueryWrapper<VoiceRecordFile>();
queryWrapper.eq(VoiceRecordFile::getAlertId, id).orderByDesc(VoiceRecordFile::getRecDate);
......@@ -994,8 +995,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
BeanUtils.copyProperties(voiceRecord, target);
dtoList.add(target);
});
map.put("dataList", dtoList);
return map;
// map.put("dataList", dtoList);
List<VoiceRecordFileDto> collect = dtoList.stream()
.skip((long) (number - 1) * size)
.limit(size)
.collect(Collectors.toList());
voiceRecordFileDtoPage.setRecords(collect);
voiceRecordFileDtoPage.setCurrent(number);
voiceRecordFileDtoPage.setSize(size);
return voiceRecordFileDtoPage;
}
private static Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
......@@ -1026,15 +1034,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
first.put("columns", columns);
first.put("displayName", "一级调派");
List<Map<String, Object>> list = elevatorServiceImpl.selectMtByAlertId(String.valueOf(map.get("sequenceNbr")));
// if (!ObjectUtils.isEmpty(list)) {
// firstData.put("companyName", ObjectUtils.isEmpty(list.get(0).get("unitName")) ? null : String.valueOf(list.get(0).get("unitName")));
// firstData.put("companyCode", ObjectUtils.isEmpty(list.get(0).get("useCode")) ? null : String.valueOf(list.get(0).get("useCode")));
// firstData.put("companyType", "维保单位");
// firstData.put("responseStatus", "已派遣");
// }
firstDatas.add(firstData);
first.put("datas", list);
first.put("dataList", list);
first.put("rowKey", "sequenceNbr");
// 二级调派
String secondJson;
try {
......@@ -1049,14 +1051,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
String latitude = String.valueOf(map2.get("latitude"));
// 根据经纬度和距离返回救援机构信息
HashMap<String, Object> second = new HashMap<>();
ArrayList<Map> secondDatas = new ArrayList<>();
second.put("key", "secondLevelDispatch");
second.put("renderType", "table");
second.put("columns", secondColumns);
second.put("displayName", "二级调派");
List<RescueStationDto> listByLatLonDistance = iRescueStationService.getListByLatLonDistance(latitude, longitude, 1000);
second.put("datas", listByLatLonDistance);
second.put("dataList", listByLatLonDistance);
second.put("rowKey", "sequenceNbr");
// 力量调派
String powerJson;
try {
......@@ -1069,7 +1070,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
queryWrapper.eq(DispatchTask::getAlertId, id);
HashMap<String, Object> power = new HashMap<>();
ArrayList<Map> powerDatas = new ArrayList<>();
power.put("key", "firstLevelDispatch");
power.put("key", "powerLevelDispatch");
power.put("renderType", "table");
power.put("columns", powerColumns);
power.put("displayName", "使用单位");
......@@ -1086,7 +1087,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
powerDatas.add(objectMap);
});
}
power.put("datas", powerDatas);
power.put("dataList", powerDatas);
power.put("rowKey", "sequenceNbr");
group.add(power);
group.add(first);
group.add(second);
......
[
{
"dataIndex": "unitName",
"width": 150,
"width": "33%",
"align": "left",
"title": "维保单位",
"key": "AA6DE857-C788-494F-8F16-2ECFC7E34528"
},
{
"dataIndex": "address",
"width": 160,
"width": "33%",
"align": "left",
"title": "地址",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA"
},
{
"dataIndex": "userName1",
"width": 160,
"width": "15%",
"align": "left",
"title": "主要负责人",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA2"
},
{
"dataIndex": "phone1",
"width": 160,
"width": "15%",
"align": "left",
"title": "主要负责人电话",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA3"
......
[
{
"dataIndex": "orgType",
"width": 150,
"width": "15%",
"align": "left",
"title": "响应级别",
"key": "AA6DE857-C788-494F-8F16-2ECFC7E34528"
},
{
"dataIndex": "responseOrgName",
"width": 150,
"width": "26%",
"align": "left",
"title": "单位名称",
"key": "D1CB84A4-E037-446A-9469-65B76E381585"
},
{
"dataIndex": "responseUserName",
"width": 160,
"width": "10%",
"align": "left",
"title": "联系人",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA"
},
{
"dataIndex": "responseUserTel",
"width": 160,
"width": "15%",
"align": "left",
"title": "联系电话",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA1"
},
{
"dataIndex": "dispatchTime",
"width": 160,
"width": "15%",
"align": "left",
"title": "派遣时间",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA2"
},
{
"dataIndex": "arriveTime",
"width": 160,
"width": "15%",
"align": "left",
"title": "到达时间",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA3"
......
[
{
"dataIndex": "name",
"width": 150,
"width": "23%",
"align": "left",
"title": "名称",
"key": "AA6DE857-C788-494F-8F16-2ECFC7E34528"
},
{
"dataIndex": "address",
"width": 150,
"width": "33%",
"align": "left",
"title": "地址",
"key": "D1CB84A4-E037-446A-9469-65B76E381585"
},
{
"dataIndex": "distance",
"width": 160,
"width": "20%",
"align": "left",
"title": "距离",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA"
},
{
"dataIndex": "rescueLeader",
"width": 160,
"width": "10%",
"align": "left",
"title": "救援负责人",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA1"
},
{
"dataIndex": "rescueLeaderPhone",
"width": 160,
"width": "10%",
"align": "left",
"title": "电话",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA2"
......
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