From 2367ea384683d0755a34f8deea16a3a61862a739 Mon Sep 17 00:00:00 2001 From: water_xu Date: Thu, 9 May 2024 16:40:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86=E9=87=8D=E7=82=B9?= =?UTF-8?q?=E5=B7=A5=E7=A8=8BAI=E6=8A=A5=E8=AD=A6=E7=9A=84=E5=90=8E?= =?UTF-8?q?=E7=BB=AD=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../keyProjects/app/AppKeyprojectPunishController.java | 7 ++++++- .../mybatis/dsno2/keyProjects/OutSourcedMapper.xml | 9 +++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectPunishController.java b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectPunishController.java index 6d51e5c2..6569ed6c 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectPunishController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectPunishController.java @@ -78,7 +78,12 @@ public class AppKeyprojectPunishController extends BaseController { keyprote.put("KEYPROJECTCHECK_ID",pd.getString("KEYPROJECTCHECK_ID")); keyprote = keyprojectcheckService.findById(keyprote); PageData outSource = new PageData(); - outSource.put("OUTSOURCED_ID",keyprote.getString("OUTSOURCED_ID")); + // 如果是AI报警生成的隐患,不走安全环保检查主表,直接使用FOREIGN_ID + if ("1".equals(hidden.getString("SOURCE"))){ + outSource.put("OUTSOURCED_ID",hidden.getString("FOREIGN_ID")); + }else{ + outSource.put("OUTSOURCED_ID",keyprote.getString("OUTSOURCED_ID")); + } outSource = outsourcedService.findById(outSource); if(StringUtils.isNotBlank(outSource.getString("IS_SMS"))&&StringUtils.equals("0",outSource.getString("IS_SMS"))){ //发送短信 pd中 PERSONNELMANAGEMENT_ID 对应 `qa-gwj-regulatory`.`BUS_PERSONNELMANAGEMENT` 表中 PERSONNELMANAGEMENT_ID 获取到 PHONENUM 手机号字段 发送短信 diff --git a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml index 557ab56c..18f4e3fe 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml @@ -314,7 +314,7 @@ LEFT JOIN `qa-gwj-regulatory`.vi_all_corp vac on vua.CORPINFO_ID = vac.CORPINFO_ID left join `qa-gwj-regulatory`.bus_personnelmanagement p on p.PERSONNELMANAGEMENT_ID = f.UNITS_PIC LEFT JOIN ( select count(c.KEYPROJECTCHECK_ID) co, c.OUTSOURCED_ID from `qa-gwj-prevention`.BUS_KEYPROJECTCHECK c where c.ISDELETE = '0' group by c.OUTSOURCED_ID ) cc on cc.OUTSOURCED_ID = f.OUTSOURCED_ID - left join ( SELECT t.OUTSOURCED_ID, COUNT( t.HIDDEN_ID ) HIDDEN_COUNT + left join ( SELECT t.OUTSOURCED_ID, COUNT( t.HIDDEN_ID ) HIDDEN_COUNT, t.SOURCE SOURCE, t.CREATOR CREATOR FROM ( SELECT IFNULL( k.OUTSOURCED_ID, h.FOREIGN_ID ) OUTSOURCED_ID, h.* FROM `qa-gwj-prevention`.bus_keyproject_hidden h LEFT JOIN `qa-gwj-prevention`.bus_keyprojectcheck k ON h.FOREIGN_ID = k.KEYPROJECTCHECK_ID and h.ISDELETE = '0') t GROUP BY t.OUTSOURCED_ID ) h on h.OUTSOURCED_ID = f.OUTSOURCED_ID where f.ISDELETE = '0' @@ -376,6 +376,7 @@ or f.JURISDICTION_UNIT LIKE CONCAT(CONCAT('%', #{pd.DeptId}),'%') or f.PUNISH_THE_PERSON LIKE CONCAT(CONCAT('%', #{pd.UserId}),'%') or f.CREATOR = #{pd.UserId} + or (h.CREATOR = #{pd.UserId} and h.SOURCE = '1') ) ORDER BY @@ -500,9 +501,9 @@ LEFT JOIN `qa-gwj-prevention`.vi_user_all vua on f.CREATOR = vua.USER_ID LEFT JOIN `qa-gwj-regulatory`.vi_all_corp vac on vua.CORPINFO_ID = vac.CORPINFO_ID left join `qa-gwj-regulatory`.bus_personnelmanagement p on p.PERSONNELMANAGEMENT_ID = f.UNITS_PIC - left join (SELECT PUN.OUTSOURCED_ID,COUNT( distinct PUN.HIDDEN_ID) co FROM ( + left join (SELECT PUN.OUTSOURCED_ID,COUNT( distinct PUN.HIDDEN_ID) co,PUN.SOURCE SOURCE,PUN.CREATOR CREATOR FROM ( SELECT - f.HIDDEN_ID,ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) OUTSOURCED_ID + f.HIDDEN_ID,ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) OUTSOURCED_ID,f.SOURCE,f.CREATOR FROM `qa-gwj-prevention`.BUS_KEYPROJECT_HIDDEN f LEFT JOIN `qa-gwj-prevention`.bus_keyprojectcheck keycheck ON keycheck.KEYPROJECTCHECK_ID = f.FOREIGN_ID @@ -528,7 +529,7 @@ pcij.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%') ) - and f.PUNISH_THE_PERSON LIKE CONCAT( CONCAT( '%', #{pd.PUNISHUser} ), '%' ) + and (f.PUNISH_THE_PERSON LIKE CONCAT( CONCAT( '%', #{pd.PUNISHUser} ), '%' ) or (cfsl.SOURCE='1' and cfsl.CREATOR = #{pd.PUNISHUser})) AND f.STATE = '1' ORDER BY cfsl.co DESC,