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

fix(patrol) 巡检接口bug处理

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