From c90f5b8e48bd4ed873a2ff9a274e9f74aa7d3e15 Mon Sep 17 00:00:00 2001 From: water_xu Date: Thu, 23 May 2024 11:27:52 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=EF=BC=9A=E5=AD=97=E6=AE=B5=E2=80=9CISDELETE=E2=80=9D=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mybatis/datasource/system/UsersMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mybatis/datasource/system/UsersMapper.xml b/src/main/resources/mybatis/datasource/system/UsersMapper.xml index 575474ae..2e79d2a6 100644 --- a/src/main/resources/mybatis/datasource/system/UsersMapper.xml +++ b/src/main/resources/mybatis/datasource/system/UsersMapper.xml @@ -257,9 +257,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" f LEFT JOIN OA_DEPARTMENT dept on f.DEPARTMENT_ID = dept.DEPARTMENT_ID where - USERNAME = #{USERNAME} and ISDELETE='0' + f.USERNAME = #{USERNAME} and f.ISDELETE='0' - and USER_ID != #{VERIFYUSER_ID} + and f.USER_ID != #{VERIFYUSER_ID} + + + diff --git a/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml index d02004c1..eec18ac6 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml @@ -312,4 +312,25 @@ ) + + + From dd534649e57dc09635c09a2e112fffd33b4425d0 Mon Sep 17 00:00:00 2001 From: water_xu Date: Wed, 29 May 2024 16:20:33 +0800 Subject: [PATCH 5/7] =?UTF-8?q?AI=E6=8A=A5=E8=AD=A6-=E6=8B=86=E5=88=86HIDD?= =?UTF-8?q?EN=5FIDS=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/AppAIWarningController.java | 24 +++++++- .../keyProjects/AIWarningHiddensMapper.java | 51 ++++++++++++++++ .../keyProjects/AIWarningHiddensService.java | 48 +++++++++++++++ .../impl/AIWarningHiddensServiceImpl.java | 59 ++++++++++++++++++ .../impl/KeyprojectHiddenServiceImpl.java | 8 +++ .../keyProjects/KeyprojectHiddenMapper.xml | 14 +++-- .../keyProjects/AIWarningHiddensMapper.xml | 61 +++++++++++++++++++ .../dsno2/keyProjects/AIWarningMapper.xml | 4 -- 8 files changed, 256 insertions(+), 13 deletions(-) create mode 100644 src/main/java/com/zcloud/mapper/dsno2/keyProjects/AIWarningHiddensMapper.java create mode 100644 src/main/java/com/zcloud/service/keyProjects/AIWarningHiddensService.java create mode 100644 src/main/java/com/zcloud/service/keyProjects/impl/AIWarningHiddensServiceImpl.java create mode 100644 src/main/resources/mybatis/dsno2/keyProjects/AIWarningHiddensMapper.xml diff --git a/src/main/java/com/zcloud/controller/keyProjects/app/AppAIWarningController.java b/src/main/java/com/zcloud/controller/keyProjects/app/AppAIWarningController.java index d17877f0..7b8c6db9 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/app/AppAIWarningController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/app/AppAIWarningController.java @@ -1,11 +1,14 @@ package com.zcloud.controller.keyProjects.app; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.Assert; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.service.bus.ImgFilesService; +import com.zcloud.service.keyProjects.AIWarningHiddensService; import com.zcloud.service.keyProjects.AIWarningService; import com.zcloud.service.keyProjects.KeyprojectHiddenService; import com.zcloud.util.*; @@ -20,6 +23,7 @@ import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.*; +import java.util.stream.Collectors; /** * 说明:AI报警 @@ -37,6 +41,8 @@ public class AppAIWarningController extends BaseController { private KeyprojectHiddenService keyprojectHiddenService; @Autowired private ImgFilesService imgFilesService; + @Autowired + private AIWarningHiddensService aiwarningHiddensService; /**新增 * @param * @throws Exception @@ -171,7 +177,17 @@ public class AppAIWarningController extends BaseController { } } if (!hiddenIdList.isEmpty()) { - pd.put("HIDDEN_IDS", hiddenIdList.toString().replace("[","").replace("]","").replace(" ","")); + PageData finalPd = pd; + hiddenIdList.forEach(e -> { + PageData pageData = new PageData(); + pageData.put("AIWARNING_HIDDEN_ID", this.get32UUID()); + + pageData.put("AIWARNING_ID", finalPd.getString("AIWARNING_ID")); + pageData.put("HIDDEN_ID", e); + + aiwarningHiddensService.save(pageData); + }); + } aiwarningService.edit(pd); map.put("result", errInfo); @@ -216,10 +232,12 @@ public class AppAIWarningController extends BaseController { pd.put("NAME",user.getString("name")); } pd.put("FOREIGN_ID", pd.getString("OUTSOURCED_ID")); - if (Tools.notEmpty(pd.getString("HIDDEN_IDS"))){ + List hiddens = aiwarningHiddensService.findByAiId(pd); + if (CollUtil.isNotEmpty(hiddens)){ PageData pageData = new PageData(); pageData.put("AI_WARNING","Y"); - pageData.put("array",pd.getString("HIDDEN_IDS").split(",")); + pageData.put("AIWARNING_ID", Assert.notBlank(pd.getString("AIWARNING_ID"))); + pageData.put("array",hiddens.stream().map(e -> e.getString("HIDDEN_ID")).collect(Collectors.toList())); pd.put("hiddenList", keyprojectHiddenService.listAllInspection(pageData)); } map.put("pd", pd); diff --git a/src/main/java/com/zcloud/mapper/dsno2/keyProjects/AIWarningHiddensMapper.java b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/AIWarningHiddensMapper.java new file mode 100644 index 00000000..f7ed726c --- /dev/null +++ b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/AIWarningHiddensMapper.java @@ -0,0 +1,51 @@ +package com.zcloud.mapper.dsno2.keyProjects; + + + +import com.zcloud.entity.PageData; + +import java.util.List; + + +/** + * 说明:AI报警表的Hidden_ids中间表 + * 官网:www.zcloudchina.com + * @Autor:water_xu + * @Date:2024-05-29 + */ +public interface AIWarningHiddensMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + + /**通过AiId获取数据 + * @param pd + * @throws Exception + */ + List findByAiId(PageData pd); + + /**通过HiddenId获取数据 + * @param pd + * @throws Exception + */ + PageData findByHiddenId(PageData pd); + + +} + diff --git a/src/main/java/com/zcloud/service/keyProjects/AIWarningHiddensService.java b/src/main/java/com/zcloud/service/keyProjects/AIWarningHiddensService.java new file mode 100644 index 00000000..7e1b5482 --- /dev/null +++ b/src/main/java/com/zcloud/service/keyProjects/AIWarningHiddensService.java @@ -0,0 +1,48 @@ +package com.zcloud.service.keyProjects; + +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:AI报警表的Hidden_ids中间表 + * 官网:www.zcloudchina.com + * @Autor water_xu + * @Date 2024.05.29 + */ +public interface AIWarningHiddensService { + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd); + + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + public List findByAiId(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findByHiddenId(PageData pd); + +} + diff --git a/src/main/java/com/zcloud/service/keyProjects/impl/AIWarningHiddensServiceImpl.java b/src/main/java/com/zcloud/service/keyProjects/impl/AIWarningHiddensServiceImpl.java new file mode 100644 index 00000000..a2b12cc8 --- /dev/null +++ b/src/main/java/com/zcloud/service/keyProjects/impl/AIWarningHiddensServiceImpl.java @@ -0,0 +1,59 @@ + +package com.zcloud.service.keyProjects.impl; + +import com.zcloud.entity.PageData; +import com.zcloud.mapper.dsno2.keyProjects.AIWarningHiddensMapper; +import com.zcloud.service.keyProjects.AIWarningHiddensService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 说明:AI报警表的Hidden_ids中间表 + * 官网:www.zcloudchina.com + * @Autor water_xu + * @Date 2024.05.29 + */ +@Service +public class AIWarningHiddensServiceImpl implements AIWarningHiddensService { + + @Autowired + private AIWarningHiddensMapper aiWarningHiddensMapper; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd){ + aiWarningHiddensMapper.save(pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd){ + aiWarningHiddensMapper.edit(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd){ + return aiWarningHiddensMapper.findById(pd); + } + + @Override + public List findByAiId(PageData pd){ + return aiWarningHiddensMapper.findByAiId(pd); + } + + @Override + public PageData findByHiddenId(PageData pd){ + return aiWarningHiddensMapper.findByHiddenId(pd); + } + +} + diff --git a/src/main/java/com/zcloud/service/keyProjects/impl/KeyprojectHiddenServiceImpl.java b/src/main/java/com/zcloud/service/keyProjects/impl/KeyprojectHiddenServiceImpl.java index beb7b93e..17af2bfe 100644 --- a/src/main/java/com/zcloud/service/keyProjects/impl/KeyprojectHiddenServiceImpl.java +++ b/src/main/java/com/zcloud/service/keyProjects/impl/KeyprojectHiddenServiceImpl.java @@ -184,6 +184,14 @@ public class KeyprojectHiddenServiceImpl implements KeyprojectHiddenService { @Override public List listAllInspection(PageData pd) throws Exception { List hiddenList = hiddenMapper.listAllInspection(pd); + /** + * 这里如果不传对应的参数会出现全表查询的现象,为了避免这种情况,默认如果记录数超过100条,抛出异常 + * @Autor water_xu + * @Date 2024/05/29 + */ + if (hiddenList.size() >= 100){ + throw new RuntimeException("参数异常-listAllInspection查询结果记录数为:" + hiddenList.size()); + } for (PageData hd : hiddenList) { PageData pd2 = new PageData(); pd2.put("FOREIGN_KEY",hd.getString("HIDDEN_ID")); diff --git a/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml b/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml index d94d66e8..83793a1d 100644 --- a/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml +++ b/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml @@ -1136,6 +1136,10 @@ from f left join `qa-gwj-prevention`.bus_hiddenregion hr on hr.HIDDENREGION_ID = f.HIDDENPART + + left join `qa-gwj-regulatory`.bus_aiwarning_hiddens aih on aih.HIDDEN_ID = f.HIDDEN_ID + left join `qa-gwj-regulatory`.bus_aiwarning ai on ai.AIWARNING_ID = aih.AIWARNING_ID + left join lv on f.HIDDENLEVEL = lv.BIANMA left join ht on f.HIDDENTYPE = ht.BIANMA left join ht2 on f.HIDDENTYPE2 = ht2.BIANMA and ht2.PARENT_ID = '18c0a9aea6e54feab9f4ab3f46e0bc86' @@ -1148,13 +1152,11 @@ and f.FOREIGN_ID = #{FOREIGN_ID} - - - and f.HIDDEN_ID in - - #{item} - + + + and ai.AIWARNING_ID = #{AIWARNING_ID} + and ( diff --git a/src/main/resources/mybatis/dsno2/keyProjects/AIWarningHiddensMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/AIWarningHiddensMapper.xml new file mode 100644 index 00000000..3805e40f --- /dev/null +++ b/src/main/resources/mybatis/dsno2/keyProjects/AIWarningHiddensMapper.xml @@ -0,0 +1,61 @@ + + + + + + + BUS_AIWARNING_HIDDENS + + + + + insert into + + ( + AIWARNING_HIDDEN_ID,AIWARNING_ID,HIDDEN_ID + ) values ( + #{AIWARNING_HIDDEN_ID},#{AIWARNING_ID},#{HIDDEN_ID} + ) + + + + + + update + + set + AIWARNING_ID = #{AIWARNING_ID},HIDDEN_ID = #{HIDDEN_ID} + where + AIWARNING_HIDDEN_ID = #{AIWARNING_HIDDEN_ID} + + + + + + + + + + + diff --git a/src/main/resources/mybatis/dsno2/keyProjects/AIWarningMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/AIWarningMapper.xml index b34f1a62..a6d4266c 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/AIWarningMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/AIWarningMapper.xml @@ -28,7 +28,6 @@ f.ISTRUE, f.HASHIDDEN, f.AIWARNING_ID, - f.HIDDEN_IDS, f.REMARKS @@ -126,9 +125,6 @@ ,OPERATTIME = #{OPERATTIME} - - ,HIDDEN_IDS = #{HIDDEN_IDS} - where AIWARNING_ID = #{AIWARNING_ID} From 7f97d2b82e375671040b4f3445c30267904f79fe Mon Sep 17 00:00:00 2001 From: water_xu Date: Fri, 31 May 2024 17:01:50 +0800 Subject: [PATCH 6/7] =?UTF-8?q?bug-15746=20=E4=BF=AE=E5=A4=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=B6=88=E9=98=B2=E7=82=B9=E4=BD=8D=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../firemanager/FireRecordMapper.java | 2 +- .../firemanager/FireRecordService.java | 2 +- .../impl/FireCheckListServiceImpl.java | 99 ++++++++++--------- .../impl/FireRecordServiceImpl.java | 3 +- 4 files changed, 54 insertions(+), 52 deletions(-) diff --git a/src/main/java/com/zcloud/mapper/datasource/firemanager/FireRecordMapper.java b/src/main/java/com/zcloud/mapper/datasource/firemanager/FireRecordMapper.java index 5d224cf1..cfe481a5 100644 --- a/src/main/java/com/zcloud/mapper/datasource/firemanager/FireRecordMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/firemanager/FireRecordMapper.java @@ -91,7 +91,7 @@ public interface FireRecordMapper { List datalistPage(Page page); - PageData getCheckingByCid(String fireCheckId); + List getCheckingByCid(String fireCheckId); PageData getCheckingNoFinByCid(String fireCheckId); void removeRecordPointByCidRidPids(PageData pd); diff --git a/src/main/java/com/zcloud/service/firemanager/FireRecordService.java b/src/main/java/com/zcloud/service/firemanager/FireRecordService.java index f7da6d39..982a1b70 100644 --- a/src/main/java/com/zcloud/service/firemanager/FireRecordService.java +++ b/src/main/java/com/zcloud/service/firemanager/FireRecordService.java @@ -89,7 +89,7 @@ public interface FireRecordService { * @Param: [java.lang.String] [fireCheckId] * @Return: com.zcloud.entity.PageData */ - PageData getCheckingByCid(String fireCheckId); + List getCheckingByCid(String fireCheckId); /** * @Description: 根据checkid,pointid,recordid 删除点位 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 583f8ceb..68acf3a8 100644 --- a/src/main/java/com/zcloud/service/firemanager/impl/FireCheckListServiceImpl.java +++ b/src/main/java/com/zcloud/service/firemanager/impl/FireCheckListServiceImpl.java @@ -1,5 +1,6 @@ package com.zcloud.service.firemanager.impl; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -574,58 +575,60 @@ public class FireCheckListServiceImpl implements FireCheckListService { * 2. 点位下删除了器材,把检查的器材删除 * 3. * */ - PageData checkingData = fireRecordService.getCheckingByCid(FIRE_CHECK_ID); + List checkingByCid = fireRecordService.getCheckingByCid(FIRE_CHECK_ID); // 无检查记录 什么也不干 - if (checkingData != null) { - String FIRE_RECORD_ID = checkingData.getString("FIRE_RECORD_ID"); + if (CollUtil.isNotEmpty(checkingByCid)) { + checkingByCid.stream().forEach(checkingData -> { + String FIRE_RECORD_ID = checkingData.getString("FIRE_RECORD_ID"); - // 有删除的点位那么 删除记录中的点位 - if (deletedPoints.size() > 0) { - PageData delRecordData = new PageData(); - initPageDataUtil.initEdit(delRecordData); - delRecordData.put("FIRE_CHECK_ID", FIRE_CHECK_ID); - delRecordData.put("FIRE_RECORD_ID", FIRE_RECORD_ID); - delRecordData.put("list", deletedPoints); - fireRecordService.removeRecordPointByCidRidPids(delRecordData); - } - // 有新增的点位 把点位初始化 - if (addPoints.size() > 0) { - for (PageData addedRecordPointData : addPoints) { - initPageDataUtil.initSave(addedRecordPointData, "EQUIPMENT_POINT_ID"); - addedRecordPointData.put("FIRE_CHECK_ID", FIRE_CHECK_ID); - addedRecordPointData.put("FIRE_RECORD_ID", FIRE_RECORD_ID); - addedRecordPointData.put("CORPINFO_ID", CORPINFO_ID); - addedRecordPointData.put("P_ISCHECKED", 1); + // 有删除的点位那么 删除记录中的点位 + if (deletedPoints.size() > 0) { + PageData delRecordData = new PageData(); + initPageDataUtil.initEdit(delRecordData); + delRecordData.put("FIRE_CHECK_ID", FIRE_CHECK_ID); + delRecordData.put("FIRE_RECORD_ID", FIRE_RECORD_ID); + delRecordData.put("list", deletedPoints); + fireRecordService.removeRecordPointByCidRidPids(delRecordData); } - fireRecordService.addedRecordPoint(addPoints); - } - // 有删除的器材那么 删除记录中的器材 - if (deviceIds.length > 0) { - PageData removeRecordDevice = new PageData(); - initPageDataUtil.initSave(removeRecordDevice); - removeRecordDevice.put("FIRE_CHECK_ID", FIRE_CHECK_ID); - removeRecordDevice.put("FIRE_RECORD_ID", FIRE_RECORD_ID); - removeRecordDevice.put("list", deviceIds); - fireRecordService.removeDeviceByCIdRid(removeRecordDevice); - } - // 有新增的器材那么 新增记录中的器材, 点位信息变更为也未检查完的状态。 - if (DEVICE_PREPARED_DATA.size() > 0) { - // 准备变更状态的 点位id - HashSet preChangesPid = new HashSet<>(); - for (PageData device_prepared_info : DEVICE_PREPARED_DATA) { - initPageDataUtil.initSave(device_prepared_info, "EQUIPMENT_RECORD_ID"); - device_prepared_info.put("ISCHECKED", 0); - device_prepared_info.put("FIRE_RECORD_ID", FIRE_RECORD_ID); - device_prepared_info.put("ISNORMAL", 2); - preChangesPid.add(device_prepared_info.getString("FIRE_POINT_ID")); + // 有新增的点位 把点位初始化 + if (addPoints.size() > 0) { + for (PageData addedRecordPointData : addPoints) { + initPageDataUtil.initSave(addedRecordPointData, "EQUIPMENT_POINT_ID"); + addedRecordPointData.put("FIRE_CHECK_ID", FIRE_CHECK_ID); + addedRecordPointData.put("FIRE_RECORD_ID", FIRE_RECORD_ID); + addedRecordPointData.put("CORPINFO_ID", CORPINFO_ID); + addedRecordPointData.put("P_ISCHECKED", 1); + } + fireRecordService.addedRecordPoint(addPoints); } - fireRecordService.addedRecordDeviceList(DEVICE_PREPARED_DATA); - PageData checkedPageData = new PageData(); - initPageDataUtil.initEdit(checkedPageData); - checkedPageData.put("FIRE_RECORD_ID",FIRE_RECORD_ID); - checkedPageData.put("list",preChangesPid); - fireRecordService.updCheckedByRidPid(checkedPageData); - } + // 有删除的器材那么 删除记录中的器材 + if (deviceIds.length > 0) { + PageData removeRecordDevice = new PageData(); + initPageDataUtil.initSave(removeRecordDevice); + removeRecordDevice.put("FIRE_CHECK_ID", FIRE_CHECK_ID); + removeRecordDevice.put("FIRE_RECORD_ID", FIRE_RECORD_ID); + removeRecordDevice.put("list", deviceIds); + fireRecordService.removeDeviceByCIdRid(removeRecordDevice); + } + // 有新增的器材那么 新增记录中的器材, 点位信息变更为也未检查完的状态。 + if (DEVICE_PREPARED_DATA.size() > 0) { + // 准备变更状态的 点位id + HashSet preChangesPid = new HashSet<>(); + for (PageData device_prepared_info : DEVICE_PREPARED_DATA) { + initPageDataUtil.initSave(device_prepared_info, "EQUIPMENT_RECORD_ID"); + device_prepared_info.put("ISCHECKED", 0); + device_prepared_info.put("FIRE_RECORD_ID", FIRE_RECORD_ID); + device_prepared_info.put("ISNORMAL", 2); + preChangesPid.add(device_prepared_info.getString("FIRE_POINT_ID")); + } + fireRecordService.addedRecordDeviceList(DEVICE_PREPARED_DATA); + PageData checkedPageData = new PageData(); + initPageDataUtil.initEdit(checkedPageData); + checkedPageData.put("FIRE_RECORD_ID",FIRE_RECORD_ID); + checkedPageData.put("list",preChangesPid); + fireRecordService.updCheckedByRidPid(checkedPageData); + } + }); } } diff --git a/src/main/java/com/zcloud/service/firemanager/impl/FireRecordServiceImpl.java b/src/main/java/com/zcloud/service/firemanager/impl/FireRecordServiceImpl.java index e45b77da..771b1771 100644 --- a/src/main/java/com/zcloud/service/firemanager/impl/FireRecordServiceImpl.java +++ b/src/main/java/com/zcloud/service/firemanager/impl/FireRecordServiceImpl.java @@ -1,7 +1,6 @@ package com.zcloud.service.firemanager.impl; import java.util.*; -import java.util.stream.Collectors; import javax.annotation.Resource; @@ -730,7 +729,7 @@ public class FireRecordServiceImpl implements FireRecordService { } @Override - public PageData getCheckingByCid(String fireCheckId) { + public List getCheckingByCid(String fireCheckId) { return fireRecordMapper.getCheckingByCid(fireCheckId); } From a6f36e8b439e200d46c0f8fd8b8f8784a41d41ed Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 11 Jun 2024 14:21:48 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=96=B9=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=AE=A1=E6=89=B9=E5=8F=AF=E6=8C=87=E5=AE=9A=E6=89=93?= =?UTF-8?q?=E5=9B=9E=E8=87=B3=E7=89=B9=E6=AE=8A=E8=8A=82=E7=82=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcloud/flow/xgf/GuFen/GuFenCharge.java | 2 +- .../zcloud/flow/xgf/GuFen/GuFenSupervise.java | 2 +- .../flow/xgf/GuFen/GuFenWeiTuoCharge.java | 2 +- .../flow/xgf/GuFen/GuFenWeiTuoSupervise.java | 2 +- .../zcloud/flow/xgf/JiTuan/JiTuanCharge.java | 2 +- .../flow/xgf/JiTuan/JiTuanSupervise.java | 2 +- .../flow/xgf/JiTuan/JiTuanWeiTuoCharge.java | 2 +- .../xgf/JiTuan/JiTuanWeiTuoSupervise.java | 2 +- .../zcloud/flow/xgf/YiBan/YiBanCharge.java | 2 +- .../zcloud/flow/xgf/YiBan/YiBanSupervise.java | 2 +- .../com/zcloud/flow/xgf/util/XgfFlowDto.java | 3 ++ .../zcloud/service/xgf/XgfUserService.java | 2 +- .../service/xgf/impl/XgfUserServiceImpl.java | 49 ++++++++++++------- 13 files changed, 45 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java index 08145546..8c529cba 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenCharge.java @@ -84,7 +84,7 @@ public class GuFenCharge extends NodeSwitchComponent { flows.put("OPINION", info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows, info); return ""; } else { xgfFlowsMapper.edit(flows); diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java index 59247bf3..43ed5672 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenSupervise.java @@ -70,7 +70,7 @@ public class GuFenSupervise extends NodeComponent { flows.put("OPINION",info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows,info); // 保存操作记录 xgfUserService.saveLog(info, info.getSTATUS(), "0"); diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java index a9770a6f..28a0fd93 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoCharge.java @@ -93,7 +93,7 @@ public class GuFenWeiTuoCharge extends NodeComponent { if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows,info); } else { xgfFlowsMapper.edit(flows); condition.clear(); diff --git a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java index 61d80296..4c399549 100644 --- a/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/GuFen/GuFenWeiTuoSupervise.java @@ -73,7 +73,7 @@ public class GuFenWeiTuoSupervise extends NodeComponent { flows.put("OPINION", info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows,info); // 保存操作记录 xgfUserService.saveLog(info, info.getSTATUS(), "0"); } else { diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java index f869f160..70c82eb1 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanCharge.java @@ -84,7 +84,7 @@ public class JiTuanCharge extends NodeSwitchComponent { flows.put("OPINION",info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows,info); return ""; } else { xgfFlowsMapper.edit(flows); diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java index 18678083..03d76e6d 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanSupervise.java @@ -70,7 +70,7 @@ public class JiTuanSupervise extends NodeComponent { flows.put("OPINION", info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows,info); // 保存操作记录 xgfUserService.saveLog(info, info.getSTATUS(), "0"); diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java index 166febba..7adb8cc1 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoCharge.java @@ -75,7 +75,7 @@ public class JiTuanWeiTuoCharge extends NodeComponent { if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows,info); } else { xgfFlowsMapper.edit(flows); condition.clear(); diff --git a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java index d925024b..783cf372 100644 --- a/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/JiTuan/JiTuanWeiTuoSupervise.java @@ -72,7 +72,7 @@ public class JiTuanWeiTuoSupervise extends NodeComponent { flows.put("OPINION", info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows,info); // 保存操作记录 xgfUserService.saveLog(info, info.getSTATUS(), "0"); } else { diff --git a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java index 51f2e8d6..2d9bfabb 100644 --- a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java +++ b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanCharge.java @@ -71,7 +71,7 @@ public class YiBanCharge extends NodeComponent { flows.put("OPINION",info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows,info); } else { xgfFlowsMapper.edit(flows); condition.clear(); diff --git a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java index 63c4e0b9..3f02448a 100644 --- a/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java +++ b/src/main/java/com/zcloud/flow/xgf/YiBan/YiBanSupervise.java @@ -105,7 +105,7 @@ public class YiBanSupervise extends NodeComponent { flows.put("OPINION",info.getOPINION()); if ("0".equals(info.getSTATUS())) { // 打回至相关方端 - xgfUserService.repulse(flows); + xgfUserService.repulse(flows,info); // 保存操作记录 xgfUserService.saveLog(info, info.getSTATUS(), "0"); } else { diff --git a/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java b/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java index a7ce4975..f27de069 100644 --- a/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java +++ b/src/main/java/com/zcloud/flow/xgf/util/XgfFlowDto.java @@ -46,4 +46,7 @@ public class XgfFlowDto { // 获取节点需要填写的信息 private Map map; + + // 打回节点游标 + private String BACK_STEP; } diff --git a/src/main/java/com/zcloud/service/xgf/XgfUserService.java b/src/main/java/com/zcloud/service/xgf/XgfUserService.java index 0509d206..56c2a876 100644 --- a/src/main/java/com/zcloud/service/xgf/XgfUserService.java +++ b/src/main/java/com/zcloud/service/xgf/XgfUserService.java @@ -39,7 +39,7 @@ public interface XgfUserService { void saveLog(PageData info, String status, String endFlag) throws Exception; void saveLog(XgfFlowDto info, String status, String endFlag) throws Exception; - void repulse(PageData flows) throws Exception; + void repulse(PageData flows, XgfFlowDto info) throws Exception; void approveMax(PageData request, MultipartFile[] chengNuoShu) throws Exception; diff --git a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java index 99260734..4fd0fa17 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -991,25 +991,38 @@ public class XgfUserServiceImpl implements XgfUserService { } @Override - public void repulse(PageData flows) throws Exception { - PageData condition = new PageData(); - condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); - PageData entity = xgfUserMapper.findById(condition); - entity.put("STATUS", "0"); - entity.put("VALID_FLAG", "0"); - entity.put("CHECK_STATUS", "-2"); - PageData key = new PageData(); - key.putAll(entity); - key.put("USER_ID", condition.get("XGF_USER_ID")); - key.put("STATUS", "1"); - key.put("OPINION", flows.get("OPINION")); - Map result = HttpClientService.doPost(prevention_xgf_url + "openApi/user/approve", key); - if (result == null || !"succeed".equals(result.get("result"))) { - throw new RuntimeException("请求失败"); + public void repulse(PageData flows, XgfFlowDto info) throws Exception { + // add by liu jun 相关方可指定打回至指定节点 -1 为默认打回至相关方端 + if ("-1".equals(info.getBACK_STEP())){ + PageData condition = new PageData(); + condition.put("XGF_USER_ID", flows.getString("FLOWS_ID")); + PageData entity = xgfUserMapper.findById(condition); + entity.put("STATUS", "0"); + entity.put("VALID_FLAG", "0"); + entity.put("CHECK_STATUS", "-2"); + PageData key = new PageData(); + key.putAll(entity); + key.put("USER_ID", condition.get("XGF_USER_ID")); + key.put("STATUS", "1"); + key.put("OPINION", flows.get("OPINION")); + Map result = HttpClientService.doPost(prevention_xgf_url + "openApi/user/approve", key); + if (result == null || !"succeed".equals(result.get("result"))) { + throw new RuntimeException("请求失败"); + } + xgfUserMapper.edit(entity); + this.clearInfo(flows); + xgfFlowsMapper.edit(flows); + } else { + // 1、判断不能自己打回到自己 + PageData condition = new PageData(); + condition.put("FLOWS_ID",flows.getString("FLOWS_ID")); + PageData flowEntity = xgfFlowsMapper.findById(condition); + if (flowEntity != null && flowEntity.size() > 0 && flowEntity.getString("FLOWS_STEP").equals(info.getBACK_STEP())){ + throw new RuntimeException("不能自己打回到自己"); + } + flowEntity.put("FLOWS_STEP", info.getBACK_STEP()); + xgfFlowsMapper.edit(flowEntity); } - xgfUserMapper.edit(entity); - this.clearInfo(flows); - xgfFlowsMapper.edit(flows); } @Override