From f17036abebe54258905e03dcc818c2d77eaf030f Mon Sep 17 00:00:00 2001 From: songwenxuan <1924103812@qq.com> Date: Thu, 6 Jun 2024 17:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B9=E7=85=A4=E7=82=AD=20=E6=B6=88?= =?UTF-8?q?=E9=98=B2=E7=82=B9=E4=BD=8D=E6=89=AB=E7=A0=81=E5=90=8E=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=B7=B3=E8=BD=AC=E8=87=B3=E9=9A=90=E6=82=A3=E6=8E=92?= =?UTF-8?q?=E6=9F=A5=E9=A1=B9=E8=BF=9B=E8=A1=8C=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/AppFireRecordController.java | 44 +++++++++++++---- .../firemanager/FireCheckListMapper.java | 2 + .../firemanager/FireCheckListService.java | 1 + .../impl/FireCheckListServiceImpl.java | 49 +++++++++++++++++++ .../firemanager/FireCheckListMapper.xml | 46 +++++++++++++++++ .../firemanager/FireRecordMapper.xml | 3 ++ 6 files changed, 136 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/zcloud/controller/firemanager/app/AppFireRecordController.java b/src/main/java/com/zcloud/controller/firemanager/app/AppFireRecordController.java index 475b59f6..913e2ca5 100644 --- a/src/main/java/com/zcloud/controller/firemanager/app/AppFireRecordController.java +++ b/src/main/java/com/zcloud/controller/firemanager/app/AppFireRecordController.java @@ -518,18 +518,44 @@ public class AppFireRecordController extends BaseController { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); - if (pd.getString("FIRE_CHECK_ID").equals("undefined") || pd.getString("FIRE_RECORD_ID").equals("undefined") ) { - pd.put("pointId",pd.getString("FIRE_POINT_ID")); - Page page = new Page(); - page.setPd(pd); - List dataList = fireCheckListService.getFireCheckListByAppV2(page); + List varList = new ArrayList<>(); + if (pd.getString("CORPINFO_ID").equals("6aa255d41602497fa0f934a822820df4") && pd.getString("ISSCAN").equals("1")) { + List dataList = fireCheckListService.getFireCheckListByPointId(pd); + System.out.println(dataList); if (dataList.size()>0) { - PageData pageData = dataList.get(0); - pd.put("FIRE_CHECK_ID",pageData.getString("FIRE_CHECK_ID")); - pd.put("FIRE_RECORD_ID",pageData.getString("FIRE_RECORD_ID")); + for (PageData pageData : dataList) { + PageData checkData = new PageData(); + checkData.put("FIRE_RECORD_ID",pageData.getString("FIRE_RECORD_ID")); + checkData.put("PHONE_REPEAT",pageData.getString("PHONE_REPEAT")); + checkData.put("FIRE_CHECK_TYPE",pageData.getString("FIRE_CHECK_TYPE")); + checkData.put("FIRE_CHECK_ID",pageData.getString("FIRE_CHECK_ID")); + checkData.put("FIRE_PREPARED_ID",pageData.getString("FIRE_PREPARED_ID")); + checkData.put("CORPINFO_ID",pd.getString("CORPINFO_ID")); + checkData.put("USER_ID",pd.getString("USER_ID")); + checkData.put("FIRE_POINT_ID",pd.getString("FIRE_POINT_ID")); + if (checkData.getString("PHONE_REPEAT").equals("2")) { + // 完全没检查过的清单,初始化一下检查记录 + PageData fireRecordData = new PageData(); + initPageDataUtil.initSaveApp(fireRecordData, pageData.getString("USER_ID")); + fireRecordData.putAll(pageData); + fireRecordData.put("PHONE_REPEAT", "1"); + pageData.put("PHONE_REPEAT", "1"); + fireRecordService.saveInfoByPoint(fireRecordData); + } + List checkStandardList = fireCheckStandardService.getAppRiskByPoint(checkData); + if (checkStandardList.size()>0) { + PageData checkStandData = checkStandardList.get(0); + if (checkStandData.getString("ISCHECKED").equals("1")){ + varList = fireCheckStandardService.getAppRiskByDevice(checkStandData); + map.put("EQUIPMENT_POINT_ID",checkStandData.getString("EQUIPMENT_POINT_ID")); + break; + } + } + } } + } else { + varList = fireCheckStandardService.getAppRiskByDevice(pd); } - List varList = fireCheckStandardService.getAppRiskByDevice(pd); map.put("result", errInfo); map.put("varData", varList); return map; diff --git a/src/main/java/com/zcloud/mapper/datasource/firemanager/FireCheckListMapper.java b/src/main/java/com/zcloud/mapper/datasource/firemanager/FireCheckListMapper.java index 7f1f7d5c..e7733922 100644 --- a/src/main/java/com/zcloud/mapper/datasource/firemanager/FireCheckListMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/firemanager/FireCheckListMapper.java @@ -129,6 +129,8 @@ public interface FireCheckListMapper { * @Return: java.util.List */ List getFireCheckListByApplistPageV2(Page pageData); + + List getFireCheckListByPointId(PageData pd); /** * @Description: 完成记录 * @Author: dearLin diff --git a/src/main/java/com/zcloud/service/firemanager/FireCheckListService.java b/src/main/java/com/zcloud/service/firemanager/FireCheckListService.java index 7976aafd..aa0bda33 100644 --- a/src/main/java/com/zcloud/service/firemanager/FireCheckListService.java +++ b/src/main/java/com/zcloud/service/firemanager/FireCheckListService.java @@ -112,6 +112,7 @@ public interface FireCheckListService { List getFireCheckListCountByApp(PageData pageData); List getFireCheckListByAppV2(Page page); + List getFireCheckListByPointId(PageData pd); List getFireCheckListCountByAppV2(PageData pageData); diff --git a/src/main/java/com/zcloud/service/firemanager/impl/FireCheckListServiceImpl.java b/src/main/java/com/zcloud/service/firemanager/impl/FireCheckListServiceImpl.java index 62151777..e1912c01 100644 --- a/src/main/java/com/zcloud/service/firemanager/impl/FireCheckListServiceImpl.java +++ b/src/main/java/com/zcloud/service/firemanager/impl/FireCheckListServiceImpl.java @@ -421,6 +421,55 @@ public class FireCheckListServiceImpl implements FireCheckListService { return pageDataLinkedList; } + @Override + public List getFireCheckListByPointId(PageData pageData) { + pageData.put("CYCLETIME", DateUtil.date2Str(new Date())); + PageData sysdate = new PageData(); + sysdate.put("DATE", DateUtil.date2Str(new Date())); + try { + sysdate = sysDateService.findByDate(sysdate); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 根据检查周期生成时间 + // 首先检查所有该人的清单 + // todo bug 12427 + // 现在发现这个人实际有3条待办 但是分页只有十条,查不到其余2条。 + // 下拉分页后能成功显示点检表 + // 调大分页数据(或者这个页面不分页=>但是怕数据太多选择调大分页数据) + List data = fireCheckListMapper.getFireCheckListByPointId(pageData); + LinkedList pageDataLinkedList = new LinkedList<>(); + + PageData finalSysdate = sysdate; + data.forEach(item -> { + // 检查今天有没有排查过数据 + pageData.put("FIRE_CHECK_ID", item.get("FIRE_CHECK_ID")); + pageData.put("PHONE_REPEAT", 0); + PageData today = fireCheckListMapper.getFinshedLog(pageData); + if (today == null) { + // 今天还没创建过清单 或者填了一半 + pageData.put("PHONE_REPEAT", 1); + PageData todayCreat = fireCheckListMapper.getFinshedLog(pageData); + String uuid = UuidUtil.get32UUID(); + if (todayCreat != null) { + // 今天填了一半 + uuid = todayCreat.getString("FIRE_RECORD_ID"); + item.put("PHONE_REPEAT", 1); + } else { + // 今天完全没填过,点击清单检查了就新建数据 + item.put("PHONE_REPEAT", 2); + } + String[] periodDate = PeriodDateUtil.getPeriodDate(finalSysdate, (String) item.get("FIRE_CHECK_TYPE")); + item.put("FIRE_RECORD_ID", uuid); + // 状态已完成 1 填了一半, 2没填过 + item.put("PERIODSTART", periodDate[0]); + item.put("PERIODEND", periodDate[1]); + pageDataLinkedList.add(item); + } + }); + return pageDataLinkedList; + } + @Override public List getFireCheckListCountByAppV2(PageData pageData) { pageData.put("CYCLETIME", DateUtil.date2Str(new Date())); diff --git a/src/main/resources/mybatis/datasource/firemanager/FireCheckListMapper.xml b/src/main/resources/mybatis/datasource/firemanager/FireCheckListMapper.xml index ea67ee21..5eee0367 100644 --- a/src/main/resources/mybatis/datasource/firemanager/FireCheckListMapper.xml +++ b/src/main/resources/mybatis/datasource/firemanager/FireCheckListMapper.xml @@ -379,6 +379,52 @@ GROUP BY fpc.FIRE_CHECK_ID order by cl.CREATTIME desc + + +