From 179c4d64313c9b7572778da4aaaf6c6584fe457d Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期二, 20 五月 2025 23:48:08 +0800 Subject: [PATCH] 修改文件上传类型限制 --- springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/StreetBigScreenServiceImpl.java | 97 ++++++++++++++++++++++++++++++++++-------------- 1 files changed, 69 insertions(+), 28 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/StreetBigScreenServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/StreetBigScreenServiceImpl.java index 88ef3f2..03fe86a 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/StreetBigScreenServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/StreetBigScreenServiceImpl.java @@ -79,13 +79,21 @@ else if(StringUtils.equals(type,"2")) { //按月份 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM"); - LocalDate localDate = LocalDate.parse(starTime, formatter2); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date date = null; + try { + date = sdf.parse(starTime+"-01"); + } catch (ParseException e) { + e.printStackTrace(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); + Date lastDay = calendar.getTime(); // 获取当前月份的第一天 - String firstDayOfMonth = localDate.with(TemporalAdjusters.firstDayOfMonth()).format(formatter); - // 获取当前月份的最后一天 - String lastDayOfMonth = localDate.with(TemporalAdjusters.lastDayOfMonth()).format(formatter); + String firstDayOfMonth = starTime+"-01"; +// // 获取当前月份的最后一天 + String lastDayOfMonth = sdf.format(lastDay); //获取小程序用户数量 userNum= baseMapper.getUserNum(streetId,communityId,firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); @@ -181,9 +189,10 @@ } else if(StringUtils.equals(type,"2")) { - //按月份 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + try { + //按月份 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date date = sdf.parse(starTime+"-01"); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); @@ -300,6 +309,8 @@ //报到党员总计数据 Integer MemberNum=0; + Integer fuwuNum=0; + if(StringUtils.equals(type,"1")) { //按年份 @@ -320,17 +331,27 @@ UnitNum=baseMapper.getUnitNum(streetId,communityId,starTime+"-01-01 00:00:00",starTime+"-12-31 23:59:59"); //报到党员总计数据 MemberNum=baseMapper.getMemberNum(streetId,communityId,starTime+"-01-01 00:00:00",starTime+"-12-31 23:59:59"); + + fuwuNum=baseMapper.getRegistNum(streetId,communityId,starTime+"-01-01 00:00:00",starTime+"-12-31 23:59:59"); } else if(StringUtils.equals(type,"2")) { //按月份 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM"); - LocalDate localDate = LocalDate.parse(starTime, formatter2); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date date = null; + try { + date = sdf.parse(starTime+"-01"); + } catch (ParseException e) { + e.printStackTrace(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); + Date lastDay = calendar.getTime(); // 获取当前月份的第一天 - String firstDayOfMonth = localDate.with(TemporalAdjusters.firstDayOfMonth()).format(formatter); - // 获取当前月份的最后一天 - String lastDayOfMonth = localDate.with(TemporalAdjusters.lastDayOfMonth()).format(formatter); + String firstDayOfMonth = starTime+"-01"; +// // 获取当前月份的最后一天 + String lastDayOfMonth = sdf.format(lastDay); //旧的报道需求问题统计数 2.问题清单 3.需求清单 OleProblemNum=baseMapper.getOleNeedProblemNum("2",streetId,communityId,firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); @@ -348,6 +369,7 @@ UnitNum=baseMapper.getUnitNum(streetId,communityId,firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); //报到党员总计数据 MemberNum=baseMapper.getMemberNum(streetId,communityId,firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); + fuwuNum=baseMapper.getRegistNum(streetId,communityId,firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); } else if(StringUtils.equals(type,"3")) { @@ -371,6 +393,7 @@ UnitNum=baseMapper.getUnitNum(streetId,communityId,starTime+" 00:00:00",starTime+" 23:59:59"); //报到党员总计数据 MemberNum=baseMapper.getMemberNum(streetId,communityId,starTime+" 00:00:00",starTime+" 23:59:59"); + fuwuNum=baseMapper.getRegistNum(streetId,communityId,starTime+" 00:00:00",starTime+" 23:59:59"); } else if(StringUtils.equals(type,"4")) { @@ -391,6 +414,7 @@ UnitNum=baseMapper.getUnitNum(streetId,communityId,starTime+" 00:00:00",endTime+" 23:59:59"); //报到党员总计数据 MemberNum=baseMapper.getMemberNum(streetId,communityId,starTime+" 00:00:00",endTime+" 23:59:59"); + fuwuNum=baseMapper.getRegistNum(streetId,communityId,starTime+" 00:00:00",endTime+" 23:59:59"); } else @@ -411,6 +435,7 @@ UnitNum=baseMapper.getUnitNum(streetId,communityId,null,null); //报到党员总计数据 MemberNum=baseMapper.getMemberNum(streetId,communityId,null,null); + fuwuNum=baseMapper.getRegistNum(streetId,communityId,null,null); } @@ -436,8 +461,8 @@ doubleRegistrationData.setUnitNum(UnitNum); //报到党员总计数据 doubleRegistrationData.setMemberNum(MemberNum); - - doubleRegistrationData.setAllNum(NewNeedNum+OleNeedNum+OleProblemNum+NewProblemNum); + //报到服务次数 + doubleRegistrationData.setAllNum(NewNeedNum+OleNeedNum+OleProblemNum+NewProblemNum+fuwuNum); return R.ok(doubleRegistrationData); @@ -484,13 +509,21 @@ else if(StringUtils.equals(type,"2")) { //按月份 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM"); - LocalDate localDate = LocalDate.parse(starTime, formatter2); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date date = null; + try { + date = sdf.parse(starTime+"-01"); + } catch (ParseException e) { + e.printStackTrace(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); + Date lastDay = calendar.getTime(); // 获取当前月份的第一天 - String firstDayOfMonth = localDate.with(TemporalAdjusters.firstDayOfMonth()).format(formatter); - // 获取当前月份的最后一天 - String lastDayOfMonth = localDate.with(TemporalAdjusters.lastDayOfMonth()).format(formatter); + String firstDayOfMonth = starTime+"-01"; +// // 获取当前月份的最后一天 + String lastDayOfMonth = sdf.format(lastDay); photoList=baseMapper.getPhotoMicroWishData("1","%Y-%m",streetId,communityId,firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); microWishList=baseMapper.getPhotoMicroWishData("2","%Y-%m",streetId,communityId,firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); @@ -642,13 +675,21 @@ else if(StringUtils.equals(type,"2")) { //按月份 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM"); - LocalDate localDate = LocalDate.parse(starTime, formatter2); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date date = null; + try { + date = sdf.parse(starTime+"-01"); + } catch (ParseException e) { + e.printStackTrace(); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); + Date lastDay = calendar.getTime(); // 获取当前月份的第一天 - String firstDayOfMonth = localDate.with(TemporalAdjusters.firstDayOfMonth()).format(formatter); - // 获取当前月份的最后一天 - String lastDayOfMonth = localDate.with(TemporalAdjusters.lastDayOfMonth()).format(formatter); + String firstDayOfMonth = starTime+"-01"; +// // 获取当前月份的最后一天 + String lastDayOfMonth = sdf.format(lastDay); //* 社区活动统计 nommunityActNumList=baseMapper.getNommunityActNumList("%Y-%m",streetId,communityId,firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); -- Gitblit v1.7.1