From f53539025c21069912fa76bffbb5e7b1ef9412da Mon Sep 17 00:00:00 2001 From: limingyu Date: Thu, 14 Dec 2023 18:40:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=B6=E6=97=B6=E7=9B=91=E7=81=AB=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=A4=9A=E4=BA=BA=E5=90=8C=E6=97=B6=E7=9B=91=E7=81=AB?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E5=90=8C=E4=B8=80=E4=B8=AA=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E4=B8=AD=E9=83=BD=E5=8F=AF=E4=BB=A5=E6=9F=A5=E7=9C=8B=E5=92=8C?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E7=9B=91=E7=81=AB=E4=BF=A1=E6=81=AF2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/highriskwork/AppHomeController.java | 48 ++++----- .../AppHotWorkApplicationController.java | 98 ++++++++++--------- 2 files changed, 77 insertions(+), 69 deletions(-) diff --git a/src/main/java/com/zcloud/controller/app/highriskwork/AppHomeController.java b/src/main/java/com/zcloud/controller/app/highriskwork/AppHomeController.java index 28342ca4..b5484661 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppHomeController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppHomeController.java @@ -88,22 +88,24 @@ public class AppHomeController extends BaseController { if(!Tools.isEmpty(pd.get("USER_ID"))){ varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID")); PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID")); - if (varList.size() > 0) { - boolean isDelayedExist = false; - for (PageData data : varList) { - if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true; - } - if (isDelayedExist) { - for (PageData pageData : varList){ - if (StringUtils.equals(pageData.getString("STATE"),"10")) { - pageData.put("count",delayedCount.getString("count")); + if (Integer.parseInt(delayedCount.getString("count")) != 0) { + if (varList.size() > 0) { + boolean isDelayedExist = false; + for (PageData data : varList) { + if (StringUtils.equals(data.getString("STATE"), "10")) isDelayedExist = true; + } + if (isDelayedExist) { + for (PageData pageData : varList) { + if (StringUtils.equals(pageData.getString("STATE"), "10")) { + pageData.put("count", delayedCount.getString("count")); + } } + } else { + varList.add(delayedCount); } } else { varList.add(delayedCount); } - } else { - varList.add(delayedCount); } myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID")); } @@ -146,22 +148,24 @@ public class AppHomeController extends BaseController { if(!Tools.isEmpty(pd.get("USER_ID"))){ varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID")); PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID")); - if (varList.size() > 0) { - boolean isDelayedExist = false; - for (PageData data : varList) { - if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true; - } - if (isDelayedExist) { - for (PageData pageData : varList){ - if (StringUtils.equals(pageData.getString("STATE"),"10")) { - pageData.put("count",delayedCount.getString("count")); + if (Integer.parseInt(delayedCount.getString("count")) != 0) { + if (varList.size() > 0) { + boolean isDelayedExist = false; + for (PageData data : varList) { + if (StringUtils.equals(data.getString("STATE"), "10")) isDelayedExist = true; + } + if (isDelayedExist) { + for (PageData pageData : varList) { + if (StringUtils.equals(pageData.getString("STATE"), "10")) { + pageData.put("count", delayedCount.getString("count")); + } } + } else { + varList.add(delayedCount); } } else { varList.add(delayedCount); } - } else { - varList.add(delayedCount); } myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID")); } diff --git a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotWorkApplicationController.java b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotWorkApplicationController.java index ced46e97..275ae9bd 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotWorkApplicationController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotWorkApplicationController.java @@ -746,42 +746,44 @@ public class AppHotWorkApplicationController extends BaseController { } } PageData hotUser = new PageData(); - hotUser.put("hotIds", hotIds); - List hotUserAllList = hotWorkApplicationUserService.listAll(hotUser); - for (PageData userPageData : hotUserAllList){ - String hotAndType = userPageData.getString("FOREIGN_KEY"); - if(hotIdKeyMap.containsKey(hotAndType)){ - PageData hot = varList.get(hotIdKeyMap.get(hotAndType)); - String type = userPageData.get("STATE").toString(); - if("0".equals(type)){ // 申请办理人 - hot.put("APPLY_DEPARTMENT_NAME",userPageData.getString("deptName")); - hot.put("APPLY_USER_NAME",userPageData.getString("userName")); - hot.put("APPLY_USER_ID",userPageData.getString("USER_ID")); - }else if("1".equals(type)){ //动火单位负责人 - hot.put("HOT_WORK_UNIT_LEADER_NAME",userPageData.getString("userName")); - hot.put("HOT_WORK_UNIT_LEADER_ID",userPageData.getString("USER_ID")); - }else if("2".equals(type)){ // 项目发包单位负责人 - hot.put("PROJECT_UNIT_LEADER_NAME",userPageData.getString("userName")); - hot.put("PROJECT_UNIT_LEADER_ID",userPageData.getString("USER_ID")); - }else if("3".equals(type)){ // 现场管辖单位负责人 - hot.put("UNIT_LEADER_NAME",userPageData.getString("userName")); - hot.put("UNIT_LEADER_ID",userPageData.getString("USER_ID")); - }else if("5".equals(type)){ // 动火前 负责人 - hot.put("HOT_WORK_BEFORE_UNIT_LEADER",userPageData.getString("userName")); - }else if("6".equals(type)){ // 现场负责人 - hot.put("SITE_LEADER_NAME",userPageData.getString("userName")); - hot.put("SITE_LEADER_PHONE",userPageData.getString("userPhone")); - }else if("7".equals(type)){ // 动火后 负责人 - hot.put("HOT_WORK_AFTER_UNIT_LEADER",userPageData.getString("userName")); - } else if("11".equals(type)){ // 特级动火 申请人 - hot.put("DEPARTMENT_PERSONNEL_NAME",userPageData.getString("userName")); - hot.put("DEPARTMENT_PERSONNEL_ID",userPageData.getString("USER_ID")); - }else if("20".equals(type)){ // 特级动火 申请人 - hot.put("SUPERVISOR_OF_HOT_WORK_UNIT",userPageData.getString("USER_ID")); - }else if("21".equals(type)){ // 动火后 负责人 - String userName = userPageData.getString("userName2") +","; - String oldName = Tools.isEmpty(pd.get("HOT_WORK_OPERATOR_NAME"))?"":pd.get("HOT_WORK_OPERATOR_NAME").toString(); - hot.put("HOT_WORK_OPERATOR_NAME",oldName + userName); + if (hotIds.size() > 0) { + hotUser.put("hotIds", hotIds); + List hotUserAllList = hotWorkApplicationUserService.listAll(hotUser); + for (PageData userPageData : hotUserAllList){ + String hotAndType = userPageData.getString("FOREIGN_KEY"); + if(hotIdKeyMap.containsKey(hotAndType)){ + PageData hot = varList.get(hotIdKeyMap.get(hotAndType)); + String type = userPageData.get("STATE").toString(); + if("0".equals(type)){ // 申请办理人 + hot.put("APPLY_DEPARTMENT_NAME",userPageData.getString("deptName")); + hot.put("APPLY_USER_NAME",userPageData.getString("userName")); + hot.put("APPLY_USER_ID",userPageData.getString("USER_ID")); + }else if("1".equals(type)){ //动火单位负责人 + hot.put("HOT_WORK_UNIT_LEADER_NAME",userPageData.getString("userName")); + hot.put("HOT_WORK_UNIT_LEADER_ID",userPageData.getString("USER_ID")); + }else if("2".equals(type)){ // 项目发包单位负责人 + hot.put("PROJECT_UNIT_LEADER_NAME",userPageData.getString("userName")); + hot.put("PROJECT_UNIT_LEADER_ID",userPageData.getString("USER_ID")); + }else if("3".equals(type)){ // 现场管辖单位负责人 + hot.put("UNIT_LEADER_NAME",userPageData.getString("userName")); + hot.put("UNIT_LEADER_ID",userPageData.getString("USER_ID")); + }else if("5".equals(type)){ // 动火前 负责人 + hot.put("HOT_WORK_BEFORE_UNIT_LEADER",userPageData.getString("userName")); + }else if("6".equals(type)){ // 现场负责人 + hot.put("SITE_LEADER_NAME",userPageData.getString("userName")); + hot.put("SITE_LEADER_PHONE",userPageData.getString("userPhone")); + }else if("7".equals(type)){ // 动火后 负责人 + hot.put("HOT_WORK_AFTER_UNIT_LEADER",userPageData.getString("userName")); + } else if("11".equals(type)){ // 特级动火 申请人 + hot.put("DEPARTMENT_PERSONNEL_NAME",userPageData.getString("userName")); + hot.put("DEPARTMENT_PERSONNEL_ID",userPageData.getString("USER_ID")); + }else if("20".equals(type)){ // 特级动火 申请人 + hot.put("SUPERVISOR_OF_HOT_WORK_UNIT",userPageData.getString("USER_ID")); + }else if("21".equals(type)){ // 动火后 负责人 + String userName = userPageData.getString("userName2") +","; + String oldName = Tools.isEmpty(pd.get("HOT_WORK_OPERATOR_NAME"))?"":pd.get("HOT_WORK_OPERATOR_NAME").toString(); + hot.put("HOT_WORK_OPERATOR_NAME",oldName + userName); + } } } } @@ -1361,22 +1363,24 @@ public class AppHotWorkApplicationController extends BaseController { if(!Tools.isEmpty(pd.get("USER_ID"))){ varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID")); PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID")); - if (varList.size() > 0) { - boolean isDelayedExist = false; - for (PageData data : varList) { - if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true; - } - if (isDelayedExist) { - for (PageData pageData : varList){ - if (StringUtils.equals(pageData.getString("STATE"),"10")) { - pageData.put("count",delayedCount.getString("count")); + if (Integer.parseInt(delayedCount.getString("count")) != 0) { + if (varList.size() > 0) { + boolean isDelayedExist = false; + for (PageData data : varList) { + if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true; + } + if (isDelayedExist) { + for (PageData pageData : varList){ + if (StringUtils.equals(pageData.getString("STATE"),"10")) { + pageData.put("count",delayedCount.getString("count")); + } } + } else { + varList.add(delayedCount); } } else { varList.add(delayedCount); } - } else { - varList.add(delayedCount); } myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID")); }