From 8e5325bd17f4fd5d62aaac90ed86370d0c14765d Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Thu, 16 Nov 2023 17:20:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=84=E7=BD=9A=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E6=8E=A5=E5=8F=A3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/AppKeyprojectCheckController.java | 29 ++++++++++++++++++- .../keyProjects/KeyprojectHiddenMapper.java | 9 ++++++ .../keyProjects/KeyprojectHiddenService.java | 9 ++++++ .../impl/KeyprojectHiddenServiceImpl.java | 10 +++++++ .../keyProjects/KeyprojectHiddenMapper.xml | 17 +++++++++++ 5 files changed, 73 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectCheckController.java b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectCheckController.java index 5457c3b9..9b5ce3a1 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectCheckController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectCheckController.java @@ -85,8 +85,9 @@ public class AppKeyprojectCheckController extends BaseController { time = DateUtil.calculateDateSecond(time, 1); } } - + Boolean boo = false; // 增加开关控制 if (Tools.notEmpty(pd.getString("HIDDENJSON"))) { + boo = true; List hiddenList = new ArrayList(); List list = (List) JSON.parse(pd.getString("HIDDENJSON")); String time = currentTime; @@ -142,6 +143,32 @@ public class AppKeyprojectCheckController extends BaseController { records = SendSmsUtil.getRecords(person.getString("PHONENUM"),tpContent); jsonArray.add(records); SendSmsUtil.sendSms("121451",jsonArray,null); + //发送罚款待处理 上文开关控制这里发送不 + if(boo){ + List jsonList = (List) JSON.parse(pd.getString("HIDDENJSON")); + String PUNISHTHEPERSON = keyprojectHiddenService.getPUNISHTHEPERSON(pd); + if (!Tools.isEmpty(PUNISHTHEPERSON)) { + PageData selectPageData = new PageData(); + String[] split = PUNISHTHEPERSON.split(","); + selectPageData.put("ids", split); + List list = keyprojectHiddenService.getPhone(selectPageData); + for (JSONObject json : jsonList) { + for(String phone:list) { + JSONArray jsonBrray = new JSONArray(); + //接受返回结果 + JSONObject recordsB = new JSONObject(); + //定义替换参数 + JSONObject tpContentB = new JSONObject(); + tpContentB.put("HIDDENDESCR",json.getString("HIDDENDESCR")); //隐患描述 + if(StringUtils.isNotBlank(phone)){ + recordsB = SendSmsUtil.getRecords(phone,tpContentB); + jsonBrray.add(recordsB); + SendSmsUtil.sendSms("121487",jsonBrray,null); + } + } + } + } + } } }catch (Exception e){ e.printStackTrace(); diff --git a/src/main/java/com/zcloud/mapper/datasource/keyProjects/KeyprojectHiddenMapper.java b/src/main/java/com/zcloud/mapper/datasource/keyProjects/KeyprojectHiddenMapper.java index 9fa7b3bd..0fbcecc3 100644 --- a/src/main/java/com/zcloud/mapper/datasource/keyProjects/KeyprojectHiddenMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/keyProjects/KeyprojectHiddenMapper.java @@ -158,5 +158,14 @@ public interface KeyprojectHiddenMapper { */ List getpunishlistPage(Page page); + /** + * 获取当前隐患的处罚人 + * @param pd + * @return + */ + String getPUNISHTHEPERSON(PageData pd); + + + List getPhone(PageData pd); } diff --git a/src/main/java/com/zcloud/service/keyProjects/KeyprojectHiddenService.java b/src/main/java/com/zcloud/service/keyProjects/KeyprojectHiddenService.java index 954c4e8f..16db8958 100644 --- a/src/main/java/com/zcloud/service/keyProjects/KeyprojectHiddenService.java +++ b/src/main/java/com/zcloud/service/keyProjects/KeyprojectHiddenService.java @@ -180,5 +180,14 @@ public interface KeyprojectHiddenService { public PageData keyprojectcount(PageData pd)throws Exception; List getpunishlist(Page page); + + /** + * 获取当前隐患的处罚人 + * @param pd + * @return + */ + String getPUNISHTHEPERSON(PageData pd); + + List getPhone(PageData 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 9a47f11f..99fc74dc 100644 --- a/src/main/java/com/zcloud/service/keyProjects/impl/KeyprojectHiddenServiceImpl.java +++ b/src/main/java/com/zcloud/service/keyProjects/impl/KeyprojectHiddenServiceImpl.java @@ -253,5 +253,15 @@ public class KeyprojectHiddenServiceImpl implements KeyprojectHiddenService { public List getpunishlist(Page page) { return hiddenMapper.getpunishlistPage(page); } + + @Override + public String getPUNISHTHEPERSON(PageData pd) { + return hiddenMapper.getPUNISHTHEPERSON(pd); + } + + @Override + public List getPhone(PageData pd) { + return hiddenMapper.getPhone(pd); + } } diff --git a/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml b/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml index 2a55495a..5030e522 100644 --- a/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml +++ b/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml @@ -1606,4 +1606,21 @@ h.ISPUNISH ASC, p.HANDLED DESC + + + +