From 029399c877b1723537b0096d661c3c0d98a47baf Mon Sep 17 00:00:00 2001 From: shanao Date: Mon, 30 Sep 2024 15:33:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=9A=90=E6=82=A3?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=AD=89=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StatisticsDataController.java | 273 ++++++++++++++++++ 1 file changed, 273 insertions(+) diff --git a/src/main/java/com/zcloud/controller/statisticsdata/StatisticsDataController.java b/src/main/java/com/zcloud/controller/statisticsdata/StatisticsDataController.java index 5d046d49..416b2918 100644 --- a/src/main/java/com/zcloud/controller/statisticsdata/StatisticsDataController.java +++ b/src/main/java/com/zcloud/controller/statisticsdata/StatisticsDataController.java @@ -951,5 +951,278 @@ public class StatisticsDataController extends BaseController { return map; } + /** + *

隐患处理

+ * + *

+ * 数据可视化/任务处理情况/隐患处理 + *

+ * + * @Data 2024年9月30日 + */ + @RequestMapping(value = "/getBICount") + @ResponseBody + public Object getBICount() throws Exception { + Map map = new HashMap<>(); + String errInfo = "success"; + PageData pd = this.getPageData(); + pd.put("CORPINFO_ID", CORPINFO_ID); + // 旬 + if (pd.get("IS_XUN") != null && Tools.notEmpty(pd.get("IS_XUN").toString())) { + // 1-10 + if (DateUtil.timeCalendar(new Date(), + DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01 00:00:00"), + DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10 23:59:59"))) { + pd.put("STARTTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01 00:00:00"); + pd.put("ENDTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10 23:59:59"); + } + // 10-20 + if (DateUtil.timeCalendar(new Date(), + DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11 00:00:00"), + DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20 23:59:59"))) { + pd.put("STARTTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11 00:00:00"); + pd.put("ENDTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20 23:59:59"); + } + // 20-月底 + if (DateUtil.timeCalendar(new Date(), + DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21 00:00:00"), + DateUtil.fomatDateTime(DateUtil.getMonthEndDay() + " 23:59:59"))) { + pd.put("STARTTIME", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21 00:00:00"); + pd.put("ENDTIME", DateUtil.getMonthEndDay() + " 23:59:59"); + } + } + // 季度 + if (pd.get("IS_QUARTER") != null && Tools.notEmpty(pd.get("IS_QUARTER").toString())) { + pd.put("STARTTIME", DateUtil.quarterStart() + " 00:00:00"); + pd.put("ENDTIME", DateUtil.quarterEnd() + " 23:59:59"); + } + List varList = hiddenService.getBICount(pd); + if (varList != null && !varList.isEmpty()) { + map.put("total", varList.size()); + int checked = 0; + int uncheck = 0; + for (PageData hidden : varList) { + if (hidden.get("STATE").toString().equals("4") || hidden.get("STATE").toString().equals("15") || hidden.get("STATE").toString().equals("5") || hidden.get("STATE").toString().equals("6")) { + checked++; + } else { + uncheck++; + } + + } + map.put("checked", checked); + map.put("uncheck", uncheck); + } else { + map.put("total", 0); + map.put("checked", 0); + map.put("uncheck", 0); + } + + map.put("result", errInfo); + return map; + } + + /** + *

日常检查

+ * + *

数据可视化/任务处理情况/日常检查

+ */ + @RequestMapping(value = "/goBiListCount") + @ResponseBody + public Object goBiListCount() throws Exception { + Map map = new HashMap<>(); + String errInfo = "success"; + PageData pd = this.getPageData(); + pd.put("CORPINFO_ID", CORPINFO_ID); // 企业 + + switch (pd.get("COUNTTYPE").toString()) { + case "day":// 每日 + pd.put("STARTTIME", DateUtil.getDay() + " 00:00:00"); + pd.put("ENDTIME", DateUtil.getDay() + " 23:59:59"); + break; + + case "week":// 每周 + pd.put("STARTTIME", DateUtil.getWeekStart()); + pd.put("ENDTIME", DateUtil.getWeekEnd()); + break; + + case "xun":// 每旬 + String year = DateUtil.getYear(); + String month = DateUtil.getMonth(); + Integer day = Integer.parseInt(DateUtil.getOnlyDay()); + String startTime = year + "-" + month + "-"; + String endTime = year + "-" + month + "-"; + if (day <= 10) { + startTime = startTime + "01 00:00:00"; + endTime = endTime + "10 23:59:59"; + } else if (day > 10 && day <= 20) { + startTime = startTime + "11 00:00:00"; + endTime = endTime + "20 23:59:59"; + } else { + startTime = startTime + "21 00:00:00"; + endTime = DateUtil.getMonthEndDay() + " 23:59:59"; + } + pd.put("STARTTIME", startTime); + pd.put("ENDTIME", endTime); + break; + + case "month":// 每月 + pd.put("STARTTIME", DateUtil.getMonthFirstDay() + " 00:00:00"); + pd.put("ENDTIME", DateUtil.getMonthEndDay() + " 23:59:59"); + break; + + case "quarter":// 每季 + pd.put("STARTTIME", DateUtil.quarterStart() + " 00:00:00"); + pd.put("ENDTIME", DateUtil.quarterEnd() + " 23:59:59"); + break; + + case "year":// 每年 + pd.put("STARTTIME", DateUtil.getCurrYearFirst() + " 00:00:00"); + pd.put("ENDTIME", DateUtil.getCurrYearLast() + " 23:59:59"); + break; + + case "halfyear":// 半年 + String byear = DateUtil.getYear(); + Integer bmonth = Integer.parseInt(DateUtil.getMonth()); + if (bmonth <= 6) { + pd.put("STARTTIME", byear + "-01-01 00:00:00"); + pd.put("ENDTIME", byear + "-06-30 23:59:59"); + } else if (bmonth > 6) { + pd.put("STARTTIME", byear + "-07-01 00:00:00"); + pd.put("ENDTIME", byear + "-12-31 23:59:59"); + } + break; + + default: + break; + } + + String STARTTIME = pd.getString("STARTTIME"); + String ENDTIME = pd.getString("ENDTIME"); + + PageData all = new PageData(); + all.put("type", "all"); + all.put("name", "合计"); + all.put("molecule", 0); + all.put("denominator", 0); + all.put("percentage", 0d); + + List countList = listStatisticsService.getCountList(pd);// 统计分母 + + if (countList != null && !countList.isEmpty()) { + int sum = 0; + List dayList = checkrecordService.listCountDay(pd); // 统计--日 + if (dayList != null && !dayList.isEmpty()) { + for (PageData count : dayList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List weekList = checkrecordService.listCountWeek(pd); // 统计--周 + if (weekList != null && !weekList.isEmpty()) { + for (PageData count : weekList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List monthList = checkrecordService.listCountMonth(pd); // 统计--月 + + if (monthList != null && !monthList.isEmpty()) { + for (PageData count : monthList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List quarterList = checkrecordService.listCountQuarter(pd); // 统计--季 + + if (quarterList != null && !quarterList.isEmpty()) { + for (PageData count : quarterList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List halfYearList = checkrecordService.listCountHalfYear(pd); // 统计--半年 + + if (halfYearList != null && !halfYearList.isEmpty()) { + for (PageData count : halfYearList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + List yearList = checkrecordService.listCountYear(pd); // 统计--年 + if (yearList != null && !yearList.isEmpty()) { + for (PageData count : yearList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + // 处理旬时间 + StringBuilder stt = new StringBuilder(); + stt.append(pd.getString("STARTTIME")); + stt.setCharAt(9, '1'); + pd.put("STARTTIME", stt.toString()); + + String endDay = ENDTIME.substring(8, 10); + Integer endTime = Integer.parseInt(endDay); + StringBuffer et = new StringBuffer(); + et.append(pd.getString("ENDTIME")); + + if (endTime <= 10) { + stt.setCharAt(8, '1'); + stt.setCharAt(9, '0'); + pd.put("ENDTIME", et.toString()); + } else if (endTime <= 20) { + stt.setCharAt(8, '2'); + stt.setCharAt(9, '0'); + pd.put("ENDTIME", et.toString()); + } else { + Integer endMonth = Integer.parseInt(ENDTIME.substring(5, 7)); + Integer endYear = Integer.parseInt(ENDTIME.substring(0, 4)); + pd.put("ENDTIME", getLastDayOfMonth(endYear, endMonth) + " 23:59:59"); + } + List tenDaysList = checkrecordService.listCountTenDays(pd); // 统计--旬 + if (tenDaysList != null && !tenDaysList.isEmpty()) { + for (PageData count : tenDaysList) { + sum += Integer.parseInt(count.get("NUM").toString()); + } + } + // 分母 + for (PageData count : countList) { + + Integer allDenominator = Integer.parseInt(count.get("NOTEXAMINEDNUM").toString()) + + Integer.parseInt(all.get("denominator").toString()); + all.put("denominator", allDenominator); + } + + Integer jjr = checkrecordService.listCountJjr(pd) == null ? 0 : checkrecordService.listCountJjr(pd); + all.put("molecule", sum + jjr); + } + + if (!all.get("denominator").toString().equals("0")) { + if (all.get("molecule").toString().equals("0")) { + all.put("percentage", 0d); + } else { + Double denominator = Double.parseDouble(all.get("denominator").toString()); + Double molecule = Double.parseDouble(all.get("molecule").toString()); + Double percentage = molecule / denominator * 100; + DecimalFormat df = new DecimalFormat("#.00"); + all.put("percentage", df.format(percentage)); + } + } + + map.put("all", all); + map.put("result", errInfo); + return map; + } + + /** + *

排查信息

+ *

辨识部位检查记录(排查信息)

+ */ + @RequestMapping(value = "/listLogByIde") + @ResponseBody + public Object listLogByIde() throws Exception { + Map map = new HashMap<>(); + String errInfo = "success"; + PageData pd = this.getPageData(); + pd.put("CORPINFO_ID", CORPINFO_ID); // 企业 + List varList = checkrecordService.listLogByIde(pd); + map.put("varList", varList); + map.put("result", errInfo); + return map; + } } From f74153542014ce72b0a1d83baf14276dc86be933 Mon Sep 17 00:00:00 2001 From: huangyuxuan Date: Sat, 12 Oct 2024 08:56:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD](hyx?= =?UTF-8?q?=5F2024-9-27=5Ftongbu)=20=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/UsersController.java | 29 +++++++++++++------ .../zcloud/syncData/SyncDataAdviceAspect.java | 4 +-- .../syncData/listener/SyncDataListener.java | 10 ++++--- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/zcloud/controller/system/UsersController.java b/src/main/java/com/zcloud/controller/system/UsersController.java index 4c0ee501..225e4088 100644 --- a/src/main/java/com/zcloud/controller/system/UsersController.java +++ b/src/main/java/com/zcloud/controller/system/UsersController.java @@ -778,7 +778,7 @@ public class UsersController extends BaseController { } map.put("result", errInfo); map.put("code","0"); -// map.put("syncInfo", JSONUtil.toJsonStr(usersService.findById(pd))); + map.put("syncInfo", JSONUtil.toJsonStr(usersService.findById(pd))); return map; } @@ -1032,7 +1032,7 @@ public class UsersController extends BaseController { map.put("USER_ID",ID); map.put("result", errInfo); //返回结果 map.put("code", "0"); -// map.put("syncInfo", JSONUtil.toJsonStr(userinfo)); + map.put("syncInfo", JSONUtil.toJsonStr(userinfo)); } else { map.put("result", "您输入的身份证号和用户名二次校验失败,请确认后重新申请"); //返回结果 } @@ -1066,9 +1066,9 @@ public class UsersController extends BaseController { for (Object key : set) { param.put(key.toString(),pd.getString(key.toString())); } -// String UserDto = JSON.toJSONString(param); -// String result = HttpClientUtilDoGet.sendHttpPost(tongBuUrl + "/docking/core/user/addOrUpdate", UserDto,param); -// returnMap = (Map) JSON.parse(result); + String UserDto = JSON.toJSONString(param); + String result = HttpClientUtilDoGet.sendHttpPost(tongBuUrl + "/docking/core/user/addOrUpdate", UserDto,param); + returnMap = (Map) JSON.parse(result); // TODO com.alibaba.fastjson.JSONException: syntax error, pos 1 暂时不用人员中台 returnMap.put("result", "success"); } @@ -2503,12 +2503,23 @@ public class UsersController extends BaseController { return doCheck(param.get("USERNAME"),param.get("CARD_NO"),param.get("USER_ID")); } + /** + * 检查人员中台用户是否存在 + * + * @param USERNAME 用户名 + * @param CARD_NO 身份证号 + * @param USER_ID 用户id + * @return map + * @throws Exception + * @author water_xu + * @date 2024-9-29 + */ public Map doCheck(String USERNAME, String CARD_NO, String USER_ID) throws Exception { -// String result = HttpClientUtilDoGet.sendHttpGet(tongBuUrl + "/docking/core/user/getCheck"+"?USERNAME="+USERNAME+"&CARD_NO="+CARD_NO+"&USER_ID="+USER_ID); -// Map returnMap = (Map) JSON.parse(result); + String result = HttpClientUtilDoGet.sendHttpGet(tongBuUrl + "/docking/core/user/getCheck"+"?USERNAME="+USERNAME+"&CARD_NO="+CARD_NO+"&USER_ID="+USER_ID); + Map returnMap = (Map) JSON.parse(result); // 人员中台暂时不用 - Map returnMap = new HashMap<>(); - returnMap.put("result", "success"); +// Map returnMap = new HashMap<>(); +// returnMap.put("result", "success"); return returnMap; } diff --git a/src/main/java/com/zcloud/syncData/SyncDataAdviceAspect.java b/src/main/java/com/zcloud/syncData/SyncDataAdviceAspect.java index dabed28d..d50553f2 100644 --- a/src/main/java/com/zcloud/syncData/SyncDataAdviceAspect.java +++ b/src/main/java/com/zcloud/syncData/SyncDataAdviceAspect.java @@ -25,8 +25,8 @@ import java.util.Map; * 作者:water_xu * 官网:www.zcloudchina.com */ -//@Aspect -//@Component +@Aspect +@Component @SuppressWarnings("all") public class SyncDataAdviceAspect { diff --git a/src/main/java/com/zcloud/syncData/listener/SyncDataListener.java b/src/main/java/com/zcloud/syncData/listener/SyncDataListener.java index a313f873..0eebb398 100644 --- a/src/main/java/com/zcloud/syncData/listener/SyncDataListener.java +++ b/src/main/java/com/zcloud/syncData/listener/SyncDataListener.java @@ -85,10 +85,12 @@ public class SyncDataListener implements RocketMQListener { pd.putAll(tenCorpDto.getPd()); pd.put("CONSUMPTION_TIME", DateUtil.date2Str(new Date())); pd.put("CONSUMPTION_TYPE","MqQyDataListener"); - if ("qy".equals(tenCorpDto.getMessage())){ - // 在本端发的同步消息,不需要再次同步该数据 - return; - } + //2024-10-08 黄宇轩修改, + // 三端新增用户后,人员中台将用户信息同步到core_sync_user表 +// if ("qy".equals(tenCorpDto.getMessage())){ +// // 在本端发的同步消息,不需要再次同步该数据 +// return; +// } try { //拿到原路径 String url = pd.getString("url"); From 059e316156da1a9a89d8000fa99281d5c4556cd7 Mon Sep 17 00:00:00 2001 From: huangyuxuan Date: Mon, 21 Oct 2024 08:48:15 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD](hyx?= =?UTF-8?q?=5F2024-9-27=5Ftongbu)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zcloud/controller/system/UsersController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zcloud/controller/system/UsersController.java b/src/main/java/com/zcloud/controller/system/UsersController.java index 225e4088..d3b50f18 100644 --- a/src/main/java/com/zcloud/controller/system/UsersController.java +++ b/src/main/java/com/zcloud/controller/system/UsersController.java @@ -798,7 +798,7 @@ public class UsersController extends BaseController { usersService.editUserFuns(pd); //执行修改 map.put("result", errInfo); map.put("code", "0"); -// map.put("syncInfo", JSONUtil.toJsonStr(usersService.findById(pd))); + map.put("syncInfo", JSONUtil.toJsonStr(usersService.findById(pd))); return map; } @@ -830,7 +830,7 @@ public class UsersController extends BaseController { FHLOG.save(Jurisdiction.getUsername(), "从个人资料中修改" + pd.getString("USERNAME") + "的资料"); //记录日志 map.put("result", errInfo); map.put("code", "0"); -// map.put("syncInfo", JSONUtil.toJsonStr(usersService.findById(pd))); + map.put("syncInfo", JSONUtil.toJsonStr(usersService.findById(pd))); return map; }