From 608f444af1889ca2e9ae6c089aeba88d439b46c2 Mon Sep 17 00:00:00 2001 From: zth <1205836521@qq.com> Date: Tue, 25 Jun 2024 14:33:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E6=AE=B5=E5=AF=BC=E5=87=BA=E5=92=8C?= =?UTF-8?q?=E5=86=9C=E6=B0=91=E5=B7=A5=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jwtech/quartz/task/evaluateTask.java | 36 ++++---- .../domain/BsSgcJsjdBuiSectionExcel.java | 4 +- .../BsSgcJsjdBuiNmgStatisticsController.java | 6 ++ .../domain/BsSgcJsjdNmgStatisticVo.java | 3 +- .../BsSgcJsjdBuiNmgStatisticsService.java | 85 +++++++++++++++---- ...sjdBuiRegulatoryInspectionsController.java | 10 ++- 6 files changed, 102 insertions(+), 42 deletions(-) diff --git a/jwtech-quartz/src/main/java/com/jwtech/quartz/task/evaluateTask.java b/jwtech-quartz/src/main/java/com/jwtech/quartz/task/evaluateTask.java index 218cc96c..9cd6481d 100644 --- a/jwtech-quartz/src/main/java/com/jwtech/quartz/task/evaluateTask.java +++ b/jwtech-quartz/src/main/java/com/jwtech/quartz/task/evaluateTask.java @@ -631,24 +631,24 @@ public class evaluateTask { } //大于60天未创建农民工账号 - @Scheduled(cron = "0 1 * * * ?") - public void accountDistributionManagement(){ - List bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.selectList(null); - Date date=new Date(); - bsSgcjsjdBuiProInfos.forEach((BsSgcjsjdBuiProInfo item)->{ - if (ObjectUtil.isNotEmpty(item.getCommencementDate())){ - int day = (int) DateUtil.betweenDay(date, item.getCommencementDate(), true); - if (day>60){ - QueryWrapperqw=new QueryWrapper<>(); - List bsSgcJsjdBuiGzbzjs = bsSgcJsjdBuiGzbzjMapper.selectList(qw.eq("PRO_NO", item.getProNo())); - if (ObjectUtil.isEmpty(bsSgcJsjdBuiGzbzjs)){ - WarnType warnType=WarnType.PEASANT_WAGES_SIXTY_DAYS; - warnOperate.sendWarn(item.getProNo(),item.getProCode(),warnType,warnType.getWarnResult()); - } - } - } - }); - } +// @Scheduled(cron = "0 1 * * * ?") +// public void accountDistributionManagement(){ +// List bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.selectList(null); +// Date date=new Date(); +// bsSgcjsjdBuiProInfos.forEach((BsSgcjsjdBuiProInfo item)->{ +// if (ObjectUtil.isNotEmpty(item.getCommencementDate())){ +// int day = (int) DateUtil.betweenDay(date, item.getCommencementDate(), true); +// if (day>60){ +// QueryWrapperqw=new QueryWrapper<>(); +// List bsSgcJsjdBuiGzbzjs = bsSgcJsjdBuiGzbzjMapper.selectList(qw.eq("PRO_NO", item.getProNo())); +// if (ObjectUtil.isEmpty(bsSgcJsjdBuiGzbzjs)){ +// WarnType warnType=WarnType.PEASANT_WAGES_SIXTY_DAYS; +// warnOperate.sendWarn(item.getProNo(),item.getProCode(),warnType,warnType.getWarnResult()); +// } +// } +// } +// }); +// } // @Scheduled(cron = "0 0/2 * * * ?") // public void stageAcceptanceLag(){ diff --git a/jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiSectionExcel.java b/jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiSectionExcel.java index acbbecb3..baf51dc1 100644 --- a/jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiSectionExcel.java +++ b/jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiSectionExcel.java @@ -19,8 +19,7 @@ public class BsSgcJsjdBuiSectionExcel { @ApiModelProperty("项目名称") private String projectName; - /** 项目法人 */ - @Excel(name = "项目法人") + /** 项目法人 */ @Excel(name = "项目法人") @ApiModelProperty("项目法人") private String projectLegalPerson; @@ -29,6 +28,7 @@ public class BsSgcJsjdBuiSectionExcel { @ApiModelProperty("法定代表人电话") private String projectUnitLegalPhone; + /** 工程等别 */ @Excel(name = "工程等别") @ApiModelProperty("工程等别") diff --git a/jwtech-system/src/main/java/com/kms/statistics/controller/BsSgcJsjdBuiNmgStatisticsController.java b/jwtech-system/src/main/java/com/kms/statistics/controller/BsSgcJsjdBuiNmgStatisticsController.java index 9d319006..15f1e094 100644 --- a/jwtech-system/src/main/java/com/kms/statistics/controller/BsSgcJsjdBuiNmgStatisticsController.java +++ b/jwtech-system/src/main/java/com/kms/statistics/controller/BsSgcJsjdBuiNmgStatisticsController.java @@ -2,6 +2,7 @@ package com.kms.statistics.controller; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.jianwei.common.core.domain.AjaxResult; import com.jianwei.common.core.domain.SearchParam; import com.kms.build.domain.BsSgcJsjdBuiDedicatedAccount; import com.kms.build.domain.BsSgcJsjdBuiRealNamePro; @@ -23,4 +24,9 @@ public class BsSgcJsjdBuiNmgStatisticsController { public IPageselectPage(SearchParamsp){ return bsSgcJsjdBuiNmgStatisticsService.selectPage(sp); } + + @PostMapping("/getTotal") + public AjaxResult getTotal(){ + return null; + } } diff --git a/jwtech-system/src/main/java/com/kms/statistics/domain/BsSgcJsjdNmgStatisticVo.java b/jwtech-system/src/main/java/com/kms/statistics/domain/BsSgcJsjdNmgStatisticVo.java index d86adff9..f4e72dfb 100644 --- a/jwtech-system/src/main/java/com/kms/statistics/domain/BsSgcJsjdNmgStatisticVo.java +++ b/jwtech-system/src/main/java/com/kms/statistics/domain/BsSgcJsjdNmgStatisticVo.java @@ -30,7 +30,6 @@ public class BsSgcJsjdNmgStatisticVo { //总拖欠工资 private String unpaidWagesAmount; - private ListchildrenYear; + private Listchildren; - private ListchildrenMonth; } diff --git a/jwtech-system/src/main/java/com/kms/statistics/service/BsSgcJsjdBuiNmgStatisticsService.java b/jwtech-system/src/main/java/com/kms/statistics/service/BsSgcJsjdBuiNmgStatisticsService.java index 6b3c1b73..858f2c4a 100644 --- a/jwtech-system/src/main/java/com/kms/statistics/service/BsSgcJsjdBuiNmgStatisticsService.java +++ b/jwtech-system/src/main/java/com/kms/statistics/service/BsSgcJsjdBuiNmgStatisticsService.java @@ -1,6 +1,7 @@ package com.kms.statistics.service; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -59,10 +60,9 @@ public class BsSgcJsjdBuiNmgStatisticsService { if (ObjectUtil.isNotEmpty(bsSgcJsjdBuiRealName.getAdmissionTime())){ LocalDate localDate = bsSgcJsjdBuiRealName.getAdmissionTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); String year= String.valueOf(localDate.getYear()); - String yearMonth=localDate.getYear()+"-"+localDate.getMonth(); + String yearMonth=localDate.getYear()+"-"+localDate.getMonthValue(); String month= String.valueOf(localDate.getMonthValue()); BsSgcJsjdNmgStatisticVo bsSgcJsjdNmgStatisticVo1=new BsSgcJsjdNmgStatisticVo(); - BsSgcJsjdNmgStatisticVo bsSgcJsjdNmgStatisticVo2=new BsSgcJsjdNmgStatisticVo(); //年统计 if (map.containsKey(year)){ BsSgcJsjdNmgStatisticVo o = (BsSgcJsjdNmgStatisticVo) map.get(year); @@ -91,7 +91,7 @@ public class BsSgcJsjdBuiNmgStatisticsService { map.put(year,bsSgcJsjdNmgStatisticVo1); //月统计 - if (map.containsKey(yearMonth)){ + if (childrenMap.containsKey(yearMonth)){ BsSgcJsjdNmgStatisticVo o = (BsSgcJsjdNmgStatisticVo) map.get(yearMonth); o.setTotalNum(String.valueOf(Integer.parseInt(o.getTotalNum())+1)); if (ObjectUtil.isNotEmpty(bsSgcJsjdBuiRealName.getExitTime())){ @@ -100,8 +100,9 @@ public class BsSgcJsjdBuiNmgStatisticsService { if (ObjectUtil.isNotEmpty(bsSgcJsjdBuiRealName.getAdmissionTime())){ o.setPresentNum(String.valueOf(Integer.parseInt(o.getPresentNum()+1))); } - map.put(yearMonth,o); + childrenMap.put(yearMonth,o); }else { + BsSgcJsjdNmgStatisticVo bsSgcJsjdNmgStatisticVo2=new BsSgcJsjdNmgStatisticVo(); bsSgcJsjdNmgStatisticVo2.setProjectName(bs.getProjectName()); bsSgcJsjdNmgStatisticVo2.setTotalNum("1"); bsSgcJsjdNmgStatisticVo2.setCurrentTime(yearMonth); @@ -164,10 +165,11 @@ public class BsSgcJsjdBuiNmgStatisticsService { monthValue=monthValue+1; if (monthValue>12){ yearValue=yearValue+1; + monthValue=1; } yearMonth=yearValue+"-"+monthValue; - if (map.containsKey(yearMonth)){ - BsSgcJsjdNmgStatisticVo o = (BsSgcJsjdNmgStatisticVo) map.get(yearMonth); + if (childrenMap.containsKey(yearMonth)){ + BsSgcJsjdNmgStatisticVo o = (BsSgcJsjdNmgStatisticVo) childrenMap.get(yearMonth); o.setTotalNum(String.valueOf(Integer.parseInt(o.getTotalNum())+1)); if (ObjectUtil.isNotEmpty(bsSgcJsjdBuiRealName.getExitTime())){ o.setExitNum(String.valueOf(Integer.parseInt(o.getExitNum())+1)); @@ -177,6 +179,7 @@ public class BsSgcJsjdBuiNmgStatisticsService { } childrenMap.put(yearMonth,o); }else { + BsSgcJsjdNmgStatisticVo bsSgcJsjdNmgStatisticVo2=new BsSgcJsjdNmgStatisticVo(); bsSgcJsjdNmgStatisticVo2.setProjectName(bs.getProjectName()); bsSgcJsjdNmgStatisticVo2.setTotalNum("1"); bsSgcJsjdNmgStatisticVo2.setCurrentTime(yearMonth); @@ -190,7 +193,7 @@ public class BsSgcJsjdBuiNmgStatisticsService { }else { bsSgcJsjdNmgStatisticVo2.setPresentNum("0"); } - childrenMap.put(year,bsSgcJsjdNmgStatisticVo2); + childrenMap.put(yearMonth,bsSgcJsjdNmgStatisticVo2); } } } @@ -203,8 +206,8 @@ public class BsSgcJsjdBuiNmgStatisticsService { String year= String.valueOf(localDate.getYear()); String month = String.valueOf(localDate.getMonthValue()); String yearMonth=year+"-"+month; - if (map.containsKey(yearMonth)){ - BsSgcJsjdNmgStatisticVo o = (BsSgcJsjdNmgStatisticVo) map.get(yearMonth); + if (map.containsKey(year)){ + BsSgcJsjdNmgStatisticVo o = (BsSgcJsjdNmgStatisticVo) map.get(year); if (ObjectUtil.isNotEmpty(o.getTotalSalary())){ o.setTotalSalary(String.valueOf(Integer.parseInt(bsSgcJsjdBuiSalaryPayable.getMonthlySalaryCurrent())+Integer.parseInt(o.getTotalSalary()))); }else { @@ -220,10 +223,11 @@ public class BsSgcJsjdBuiNmgStatisticsService { }else { o.setUnpaidWages("1"); } + map.put(year,o); }else { BsSgcJsjdNmgStatisticVo bsSgcJsjdNmgStatisticVo1=new BsSgcJsjdNmgStatisticVo(); bsSgcJsjdNmgStatisticVo1.setProjectName(bs.getProjectName()); - bsSgcJsjdNmgStatisticVo1.setCurrentTime(yearMonth); + bsSgcJsjdNmgStatisticVo1.setCurrentTime(year); bsSgcJsjdNmgStatisticVo1.setTotalSalary(bsSgcJsjdBuiSalaryPayable.getMonthlySalaryCurrent()); bsSgcJsjdNmgStatisticVo1.setUnpaidWagesAmount(bsSgcJsjdBuiSalaryPayable.getMonthlySalaryDeduct()); if (!bsSgcJsjdNmgStatisticVo1.getUnpaidWagesAmount().equals("0")){ @@ -233,17 +237,62 @@ public class BsSgcJsjdBuiNmgStatisticsService { } map.put(bsSgcJsjdNmgStatisticVo1.getCurrentTime(),bsSgcJsjdNmgStatisticVo1); } + + if (childrenMap.containsKey(yearMonth)){ + BsSgcJsjdNmgStatisticVo o = (BsSgcJsjdNmgStatisticVo) childrenMap.get(yearMonth); + if (ObjectUtil.isNotEmpty(o.getTotalSalary())){ + o.setTotalSalary(String.valueOf(Integer.parseInt(bsSgcJsjdBuiSalaryPayable.getMonthlySalaryCurrent())+Integer.parseInt(o.getTotalSalary()))); + }else { + o.setTotalSalary(bsSgcJsjdBuiSalaryPayable.getMonthlySalaryCurrent()); + } + if (ObjectUtil.isNotEmpty(o.getUnpaidWagesAmount())){ + o.setUnpaidWagesAmount(String.valueOf(Integer.parseInt(bsSgcJsjdBuiSalaryPayable.getMonthlySalaryDeduct())+Integer.parseInt(o.getUnpaidWagesAmount()))); + }else { + o.setUnpaidWagesAmount(bsSgcJsjdBuiSalaryPayable.getMonthlySalaryDeduct()); + } + if (!o.getUnpaidWagesAmount().equals("0")){ + o.setUnpaidWages("0"); + }else { + o.setUnpaidWages("1"); + } + childrenMap.put(yearMonth,o); + }else { + BsSgcJsjdNmgStatisticVo bsSgcJsjdNmgStatisticVo1=new BsSgcJsjdNmgStatisticVo(); + bsSgcJsjdNmgStatisticVo1.setProjectName(bs.getProjectName()); + bsSgcJsjdNmgStatisticVo1.setCurrentTime(yearMonth); + bsSgcJsjdNmgStatisticVo1.setTotalSalary(bsSgcJsjdBuiSalaryPayable.getMonthlySalaryCurrent()); + bsSgcJsjdNmgStatisticVo1.setUnpaidWagesAmount(bsSgcJsjdBuiSalaryPayable.getMonthlySalaryDeduct()); + if (!bsSgcJsjdNmgStatisticVo1.getUnpaidWagesAmount().equals("0")){ + bsSgcJsjdNmgStatisticVo1.setUnpaidWages("0"); + }else { + bsSgcJsjdNmgStatisticVo1.setUnpaidWages("1"); + } + childrenMap.put(bsSgcJsjdNmgStatisticVo1.getCurrentTime(),bsSgcJsjdNmgStatisticVo1); + } } Listlist1=new ArrayList<>(); - Listlist2=new ArrayList<>(); - map.forEach((key,value)->{ - list1.add((BsSgcJsjdNmgStatisticVo) value); + List finalList1 = list1; + map.forEach((key, value)->{ + finalList1.add((BsSgcJsjdNmgStatisticVo) value); }); - childrenMap.forEach((key,value)->{ - list2.add((BsSgcJsjdNmgStatisticVo) value); + ListbsSgcJsjdNmgStatisticVos=new ArrayList<>(); + childrenMap.forEach((key, value)->{ + for (BsSgcJsjdNmgStatisticVo bsSgcJsjdNmgStatisticVo1: finalList1){ + if (bsSgcJsjdNmgStatisticVo1.getCurrentTime().equals(key.split("-")[0])){ + if (CollectionUtil.isEmpty(bsSgcJsjdNmgStatisticVo1.getChildren())){ + Listlist3=new ArrayList<>(); + list3.add((BsSgcJsjdNmgStatisticVo) value); + bsSgcJsjdNmgStatisticVo1.setChildren(list3); + }else { + bsSgcJsjdNmgStatisticVo1.getChildren().add((BsSgcJsjdNmgStatisticVo) value); + } + bsSgcJsjdNmgStatisticVos.add(bsSgcJsjdNmgStatisticVo1); + break; + } + } }); - bsSgcJsjdNmgStatisticVo.setChildrenYear(list1); - bsSgcJsjdNmgStatisticVo.setChildrenMonth(list2); + list1=bsSgcJsjdNmgStatisticVos; + bsSgcJsjdNmgStatisticVo.setChildren(list1); list.add(bsSgcJsjdNmgStatisticVo); } Page page1=new Page<>(); @@ -251,4 +300,6 @@ public class BsSgcJsjdBuiNmgStatisticsService { page1.setTotal(list.size()); return page1; } + + } diff --git a/jwtech-system/src/main/java/com/kms/warn/controller/BsSgcJsjdBuiRegulatoryInspectionsController.java b/jwtech-system/src/main/java/com/kms/warn/controller/BsSgcJsjdBuiRegulatoryInspectionsController.java index 43ad48c0..8653ec3f 100644 --- a/jwtech-system/src/main/java/com/kms/warn/controller/BsSgcJsjdBuiRegulatoryInspectionsController.java +++ b/jwtech-system/src/main/java/com/kms/warn/controller/BsSgcJsjdBuiRegulatoryInspectionsController.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.jianwei.common.core.controller.BaseController; import com.jianwei.common.core.domain.SearchParam; import com.jianwei.common.utils.poi.ExcelUtil; +import com.kms.build.domain.BsSgcjsjdBuiProInfo; +import com.kms.build.service.BsSgcjsjdBuiProInfoService; import com.kms.common.utils.BaseEntityUtils; @@ -57,6 +59,9 @@ public class BsSgcJsjdBuiRegulatoryInspectionsController extends BaseController @Autowired private SpecialProjectProposalService service; + @Autowired + private BsSgcjsjdBuiProInfoService bsSgcjsjdBuiProInfoService; + /** * 查询监管检查列表 */ @@ -96,11 +101,10 @@ public class BsSgcJsjdBuiRegulatoryInspectionsController extends BaseController BsSgcJsjdBuiRegulatoryInspections byId = bsSgcJsjdBuiRegulatoryInspectionsService.getById(id); String proNo = byId.getProNo(); String proCode = byId.getProCode(); - SpecialProjectProposal one = service.getOne(Wrappers.lambdaQuery(SpecialProjectProposal.class) - .eq(SpecialProjectProposal::getProjectCode, proCode).eq(SpecialProjectProposal::getProNo, proNo)); + BsSgcjsjdBuiProInfo one = bsSgcjsjdBuiProInfoService.getOne(Wrappers.lambdaQuery(BsSgcjsjdBuiProInfo.class) + .eq(BsSgcjsjdBuiProInfo::getProCode, proCode).eq(BsSgcjsjdBuiProInfo::getProNo, proNo)); String projectName = one.getProjectName(); byId.setProjectName(projectName); - return AjaxResult.success(byId); }