Commit 8e8b2fa2 authored by 李秀明's avatar 李秀明

fix(patrol) 巡检接口bug处理

parent ea000999
......@@ -24,8 +24,8 @@ public class FaultCaseServiceImpl extends ServiceImpl<FaultCaseMapper, FaultCase
@Override
public Page<FaultCase> listPage(Page page, FaultCase faultCase) {
Page<FaultCase> pages = this.baseMapper.listPage(page, faultCase);
if (0 < pages.getRecords().size()) {
pages.getRecords().stream().map(x -> x.setFaultLevel(EmergencyLevelEum.getNameByCode(x.getFaultLevel()))).collect(Collectors.toList());
if (!pages.getRecords().isEmpty()) {
pages.getRecords().forEach(x -> x.setFaultLevel(EmergencyLevelEum.getNameByCode(x.getFaultLevel())));
}
return pages;
}
......
......@@ -1102,8 +1102,8 @@ public class PlanTaskController extends AbstractBaseController {
@ApiParam(value = "开始日期") @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
@ApiParam(value = "结束日期") @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate) {
try {
Map<String, Object> map = planTaskService.queryPatrolInfo(bizOrgCode, startDate, endDate);
return CommonPatrolResponseUtil.success(map);
List<Map<String, Object>> result = planTaskService.queryPatrolInfo(bizOrgCode, startDate, endDate);
return CommonPatrolResponseUtil.success(result);
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonPatrolResponseUtil.failure("远程查询巡检信息失败!");
......
......@@ -2101,12 +2101,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
@Override
public Map<String, Object> queryPatrolInfo(String bizOrgCode, Date startDate, Date endDate) {
public List<Map<String, Object>> queryPatrolInfo(String bizOrgCode, Date startDate, Date endDate) {
List<Map<String, Object>> list = new ArrayList<>();
list = planTaskMapper.queryPatrolInfo(bizOrgCode, startDate, endDate);
Map<String, Object> map = new HashMap<>();
map.put("patrol", list);
return map;
return planTaskMapper.queryPatrolInfo(bizOrgCode, startDate, endDate);
}
public static byte[] file2byte(File file) {
......
......@@ -201,6 +201,6 @@ public interface IPlanTaskService {
Map<String,Object> queryPatrolInfoList(String bizOrgCode, Date startDate, Date endDate);
Map<String,Object> queryPatrolInfo(String bizOrgCode, Date startDate, Date endDate);
List<Map<String, Object>> queryPatrolInfo(String bizOrgCode, Date startDate, Date endDate);
}
......@@ -1630,8 +1630,6 @@
AND p.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY
LEFT (pt.check_date, 10)
ORDER BY
pt.check_date
) s
......
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