| | |
| | | import com.panzhihua.service_dangjian.service.StreetBigScreenService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.TemporalAdjusters; |
| | |
| | | else if(StringUtils.equals(type,"2")) |
| | | { |
| | | //按月份 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDate localDate = LocalDate.parse(starTime); |
| | | 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"); |
| | |
| | | } |
| | | else if(StringUtils.equals(type,"2")) |
| | | { |
| | | //按月份 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDate localDate = LocalDate.parse(starTime); |
| | | // 获取当前月份的第一天 |
| | | String firstDayOfMonth = localDate.with(TemporalAdjusters.firstDayOfMonth()).format(formatter); |
| | | // 获取当前月份的最后一天 |
| | | String lastDayOfMonth = localDate.with(TemporalAdjusters.lastDayOfMonth()).format(formatter); |
| | | |
| | | partyAffairsNum=baseMapper.getThreeNum(streetId,communityId,"党务公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | serviceNum=baseMapper.getThreeNum(streetId,communityId,"服务公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | financeNum=baseMapper.getThreeNum(streetId,communityId,"财务公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | fundNum=baseMapper.getThreeNum(streetId,communityId,"资金公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | propertyNum=baseMapper.getThreeNum(streetId,communityId,"资产公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | naturalResourcesNum=baseMapper.getThreeNum(streetId,communityId,"资源公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | villageEconomyNum=baseMapper.getThreeNum(streetId,communityId,"村集体经济组织项目",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | try { |
| | | //按月份 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date date = sdf.parse(starTime+"-01"); |
| | | 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 = starTime+"-01"; |
| | | // // 获取当前月份的最后一天 |
| | | String lastDayOfMonth = sdf.format(lastDay); |
| | | |
| | | partyAffairsNum=baseMapper.getThreeNum(streetId,communityId,"党务公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | serviceNum=baseMapper.getThreeNum(streetId,communityId,"服务公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | financeNum=baseMapper.getThreeNum(streetId,communityId,"财务公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | fundNum=baseMapper.getThreeNum(streetId,communityId,"资金公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | propertyNum=baseMapper.getThreeNum(streetId,communityId,"资产公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | naturalResourcesNum=baseMapper.getThreeNum(streetId,communityId,"资源公开",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | villageEconomyNum=baseMapper.getThreeNum(streetId,communityId,"村集体经济组织项目",firstDayOfMonth+" 00:00:00",lastDayOfMonth+" 23:59:59"); |
| | | |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // 获取并打印第一天的日期 |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else if(StringUtils.equals(type,"3")) |
| | | { |
| | |
| | | //报到党员总计数据 |
| | | Integer MemberNum=0; |
| | | |
| | | Integer fuwuNum=0; |
| | | |
| | | if(StringUtils.equals(type,"1")) |
| | | { |
| | | //按年份 |
| | |
| | | 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"); |
| | | LocalDate localDate = LocalDate.parse(starTime); |
| | | 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"); |
| | |
| | | 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")) |
| | | { |
| | |
| | | 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")) |
| | | { |
| | |
| | | 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 |
| | |
| | | UnitNum=baseMapper.getUnitNum(streetId,communityId,null,null); |
| | | //报到党员总计数据 |
| | | MemberNum=baseMapper.getMemberNum(streetId,communityId,null,null); |
| | | fuwuNum=baseMapper.getRegistNum(streetId,communityId,null,null); |
| | | } |
| | | |
| | | |
| | |
| | | doubleRegistrationData.setUnitNum(UnitNum); |
| | | //报到党员总计数据 |
| | | doubleRegistrationData.setMemberNum(MemberNum); |
| | | |
| | | doubleRegistrationData.setAllNum(NewNeedNum+OleNeedNum+OleProblemNum+NewProblemNum); |
| | | //报到服务次数 |
| | | doubleRegistrationData.setAllNum(NewNeedNum+OleNeedNum+OleProblemNum+NewProblemNum+fuwuNum); |
| | | |
| | | |
| | | return R.ok(doubleRegistrationData); |
| | |
| | | else if(StringUtils.equals(type,"2")) |
| | | { |
| | | //按月份 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDate localDate = LocalDate.parse(starTime); |
| | | 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"); |
| | |
| | | else if(StringUtils.equals(type,"2")) |
| | | { |
| | | //按月份 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDate localDate = LocalDate.parse(starTime); |
| | | 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"); |