From ca4f798de976f8975d9a07c0ac4f8316bae6438c Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 7 Apr 2025 07:46:19 +0000 Subject: [PATCH 01/27] =?UTF-8?q?HC=20=E5=B0=8F=E5=8C=BA=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F1.8=E7=89=88=E6=9C=AC=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- springboot/src/main/resources/application.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springboot/src/main/resources/application.yml b/springboot/src/main/resources/application.yml index bfa50977b3..caf4dfcd64 100644 --- a/springboot/src/main/resources/application.yml +++ b/springboot/src/main/resources/application.yml @@ -1,3 +1,3 @@ spring: profiles: - active: debug \ No newline at end of file + active: dev \ No newline at end of file -- Gitee From ce0071a111644b878d75f34fe189d14260f5c6c0 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Fri, 11 Apr 2025 00:46:24 +0000 Subject: [PATCH 02/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=8A=A5=E4=BF=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../com/java110/community/cmd/repair/SaveRepairSettingCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-community/src/main/java/com/java110/community/cmd/repair/SaveRepairSettingCmd.java b/service-community/src/main/java/com/java110/community/cmd/repair/SaveRepairSettingCmd.java index f9ce60aa0a..01b218ff9b 100644 --- a/service-community/src/main/java/com/java110/community/cmd/repair/SaveRepairSettingCmd.java +++ b/service-community/src/main/java/com/java110/community/cmd/repair/SaveRepairSettingCmd.java @@ -61,7 +61,7 @@ public class SaveRepairSettingCmd extends Cmd { Assert.hasKeyAndValue(reqJson, "payFeeFlag", "请求报文中未包含收费情况"); Assert.hasKeyAndValue(reqJson, "returnVisitFlag", "请求报文中未包含回访设置"); Assert.hasKeyAndValue(reqJson, "doTime", "请求报文中未包含办理时长"); - Assert.hasKeyAndValue(reqJson, "warning", "请求报文中未包含超时预警"); + Assert.hasKeyAndValue(reqJson, "warningTime", "请求报文中未包含超时预警"); } -- Gitee From ae166fb4fc9cdb44d839e5507f8ef5065d387179 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Thu, 17 Apr 2025 04:21:41 +0000 Subject: [PATCH 03/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=E5=BB=BA=E8=B4=A6=E6=97=B6=E9=97=B4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../job/importData/adapt/ImportRoomFeeQueueDataAdapt.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomFeeQueueDataAdapt.java b/service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomFeeQueueDataAdapt.java index b7c035831a..a36f85e3f4 100644 --- a/service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomFeeQueueDataAdapt.java +++ b/service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomFeeQueueDataAdapt.java @@ -213,7 +213,7 @@ public class ImportRoomFeeQueueDataAdapt extends DefaultImportData implements II payFeePo.setAmount(importRoomFee.getAmount()); payFeePo.setBatchId(batchId); payFeePo.setEndTime(importRoomFee.getStartTime()); - payFeePo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); + payFeePo.setStartTime(importRoomFee.getStartTime()); payFeePos.add(payFeePo); -- Gitee From c855d7b064849e4af8bb90cb719eabc4ea0de31e Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Fri, 18 Apr 2025 04:05:34 +0000 Subject: [PATCH 04/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E8=B0=83=E7=94=A8=E8=BD=A6=E4=BD=8D=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../cmd/parkingSpaceApply/ListParkingSpaceApplyCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/ListParkingSpaceApplyCmd.java b/service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/ListParkingSpaceApplyCmd.java index 327ae36b8b..031d9b7367 100644 --- a/service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/ListParkingSpaceApplyCmd.java +++ b/service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/ListParkingSpaceApplyCmd.java @@ -54,7 +54,7 @@ public class ListParkingSpaceApplyCmd extends Cmd { @Override public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { super.validatePageInfo(reqJson); - super.validateProperty(cmdDataFlowContext); + //super.validateProperty(cmdDataFlowContext); } @Override -- Gitee From 03b73e9126cfb1bdabec5581546683b471604d8f Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sat, 19 Apr 2025 03:18:02 +0000 Subject: [PATCH 05/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E4=B8=BAspring=20Cloud=20=E6=89=A7=E8=A1=8C=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=91=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- service-api/pom-boot.xml | 1 - service-api/pom-cloud.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/service-api/pom-boot.xml b/service-api/pom-boot.xml index 933ec5d5ba..98be7aff20 100644 --- a/service-api/pom-boot.xml +++ b/service-api/pom-boot.xml @@ -12,7 +12,6 @@ service-api service-api - http://www.example.com diff --git a/service-api/pom-cloud.xml b/service-api/pom-cloud.xml index 4f2e7b36b9..35143de9fd 100644 --- a/service-api/pom-cloud.xml +++ b/service-api/pom-cloud.xml @@ -12,7 +12,6 @@ service-api service-api - http://www.example.com -- Gitee From a33e205da90458facd2e2ab3b1fa0d5017871df4 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Mon, 21 Apr 2025 18:14:21 +0800 Subject: [PATCH 06/27] =?UTF-8?q?=E4=BC=98=E5=8C=96sql=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/db/TT.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/db/TT.sql b/docs/db/TT.sql index 0d683b6146..7808e812a8 100644 --- a/docs/db/TT.sql +++ b/docs/db/TT.sql @@ -34013,6 +34013,7 @@ CREATE TABLE `u_org` ( -- Records of u_org -- ---------------------------- INSERT INTO `u_org` VALUES ('842025040735010044', null, '102025040775320034', 'HC演示物业', '1', '-1', null, '2025-04-07 12:51:17', '0', '9999', 'F'); +INSERT INTO `u_org` VALUES ('842024122616450000', NULL, '400000000000000001', 'HC小区运营团队', '1', '-1', NULL, '2024-12-26 23:46:21', '0', '9999', 'F'); -- ---------------------------- -- Table structure for u_org_community -- Gitee From d146f4be33eef0af267aee54fb2703354125c39b Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sat, 26 Apr 2025 07:02:29 +0000 Subject: [PATCH 07/27] =?UTF-8?q?=E7=BB=99=E5=91=98=E5=B7=A5=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=B6=88=E6=81=AF=20=E5=B7=A1=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../java110/job/task/noticeStaff/NoticeStaffTaskTemplate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-job/src/main/java/com/java110/job/task/noticeStaff/NoticeStaffTaskTemplate.java b/service-job/src/main/java/com/java110/job/task/noticeStaff/NoticeStaffTaskTemplate.java index b5c4d7b881..735d6fa205 100644 --- a/service-job/src/main/java/com/java110/job/task/noticeStaff/NoticeStaffTaskTemplate.java +++ b/service-job/src/main/java/com/java110/job/task/noticeStaff/NoticeStaffTaskTemplate.java @@ -224,7 +224,7 @@ public class NoticeStaffTaskTemplate extends TaskSystemQuartz { InspectionTaskDetailDto inspectionTaskDetailDto = new InspectionTaskDetailDto(); inspectionTaskDetailDto.setCommunityId(communityDto.getCommunityId()); inspectionTaskDetailDto.setState(InspectionTaskDto.STATE_NO_START); - inspectionTaskDetailDto.setQrCodeTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B)); + inspectionTaskDetailDto.setQrCodeTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); inspectionTaskDetailDto.setSendFlag(InspectionTaskDetailDto.SEND_FLAG_N); List inspectionTaskDetailDtos = inspectionTaskDetailInnerServiceSMOImpl.queryInspectionTaskDetails(inspectionTaskDetailDto); for (InspectionTaskDetailDto tInspectionTaskDetailDto : inspectionTaskDetailDtos) { -- Gitee From 591c46465e50d47611346e418a0336823440a4c5 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 28 Apr 2025 03:29:45 +0000 Subject: [PATCH 08/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E6=AC=A0=E8=B4=B9=E6=98=8E=E7=BB=86=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../export/adapt/ReportOweFeeDetailAdapt.java | 115 ++++++++++ .../export/adapt/ReportRepairDetailAdapt.java | 213 ++++++++++++++++++ 2 files changed, 328 insertions(+) create mode 100644 service-job/src/main/java/com/java110/job/export/adapt/ReportOweFeeDetailAdapt.java create mode 100644 service-job/src/main/java/com/java110/job/export/adapt/ReportRepairDetailAdapt.java diff --git a/service-job/src/main/java/com/java110/job/export/adapt/ReportOweFeeDetailAdapt.java b/service-job/src/main/java/com/java110/job/export/adapt/ReportOweFeeDetailAdapt.java new file mode 100644 index 0000000000..3aeaf0f4dd --- /dev/null +++ b/service-job/src/main/java/com/java110/job/export/adapt/ReportOweFeeDetailAdapt.java @@ -0,0 +1,115 @@ +package com.java110.job.export.adapt; + +import com.alibaba.fastjson.JSONObject; +import com.java110.dto.data.ExportDataDto; +import com.java110.dto.reportFee.ReportFeeMonthStatisticsDto; +import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO; +import com.java110.job.export.IExportDataAdapt; +import com.java110.utils.util.BeanConvertUtil; +import com.java110.utils.util.DateUtil; +import com.java110.utils.util.ListUtil; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; + +@Component("reportOweFeeDetail") +public class ReportOweFeeDetailAdapt implements IExportDataAdapt { + + @Autowired + private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl; + + @Override + public SXSSFWorkbook exportData(ExportDataDto exportDataDto) throws ParseException { + + JSONObject paramIn = exportDataDto.getReqJson(); + SXSSFWorkbook workbook = null; //工作簿 + //工作表 + workbook = new SXSSFWorkbook(); + workbook.setCompressTempFiles(false); + Sheet sheet = workbook.createSheet("欠费明细表"); + Row row = sheet.createRow(0); + row.createCell(0).setCellValue("费用编号"); + row.createCell(1).setCellValue("房号"); + row.createCell(2).setCellValue("业主"); + row.createCell(3).setCellValue("业主电话"); + row.createCell(4).setCellValue("面积"); + row.createCell(5).setCellValue("费用项"); + row.createCell(6).setCellValue("开始时间"); + row.createCell(7).setCellValue("结束时间"); + row.createCell(8).setCellValue("欠费时长(天)"); + row.createCell(9).setCellValue("欠费时长(月)"); + row.createCell(10).setCellValue("欠费金额"); + + List rooms = this.getReportOweFeeDetail(paramIn); + if (ListUtil.isNull(rooms)) { + return workbook; + } + ReportFeeMonthStatisticsDto dataObj = null; + BigDecimal monthDec = null; + for (int roomIndex = 0; roomIndex < rooms.size(); roomIndex++) { + row = sheet.createRow(roomIndex + 1); + dataObj = rooms.get(roomIndex); + row.createCell(0).setCellValue(roomIndex + 1); + row.createCell(1).setCellValue(dataObj.getObjName()); + row.createCell(2).setCellValue(dataObj.getOwnerName()); + row.createCell(3).setCellValue(dataObj.getOwnerTel()); + row.createCell(4).setCellValue(dataObj.getBuiltUpArea()); + row.createCell(5).setCellValue(dataObj.getFeeName()); + row.createCell(6).setCellValue(dataObj.getStartTime()); + row.createCell(7).setCellValue(dataObj.getEndTime()); + row.createCell(8).setCellValue(dataObj.getOweDay()); + monthDec = new BigDecimal(dataObj.getOweDay()); + monthDec = monthDec.divide(new BigDecimal("30"), 2, BigDecimal.ROUND_HALF_UP); + row.createCell(9).setCellValue(monthDec.doubleValue()); + row.createCell(10).setCellValue(dataObj.getOweAmount()); + } + return workbook; + } + + private List getReportOweFeeDetail(JSONObject paramIn) { + + ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = BeanConvertUtil.covertBean(paramIn, ReportFeeMonthStatisticsDto.class); + reportFeeMonthStatisticsDto.setPage(1); + reportFeeMonthStatisticsDto.setRow(10000); + int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryOweFeeDetailCount(reportFeeMonthStatisticsDto); + List reportFeeMonthStatisticsDtos = null; + if (count > 0) { + reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryOweFeeDetail(reportFeeMonthStatisticsDto); + ReportFeeMonthStatisticsDto tmpReportFeeMonthStatisticsDto = reportFeeMonthStatisticsInnerServiceSMOImpl.queryOweFeeDetailMajor(reportFeeMonthStatisticsDto); + if (!ListUtil.isNull(reportFeeMonthStatisticsDtos)) { + for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto1 : reportFeeMonthStatisticsDtos) { +// reportFeeMonthStatisticsDto1.setAllReceivableAmount(tmpReportFeeMonthStatisticsDto.getAllReceivableAmount()); +// reportFeeMonthStatisticsDto1.setAllReceivedAmount(tmpReportFeeMonthStatisticsDto.getAllReceivedAmount()); + reportFeeMonthStatisticsDto1.setAllOweAmount(tmpReportFeeMonthStatisticsDto.getOweAmount()); + } + } + freshReportOweDay(reportFeeMonthStatisticsDtos); + } else { + reportFeeMonthStatisticsDtos = new ArrayList<>(); + } + + return reportFeeMonthStatisticsDtos; + + + } + + private void freshReportOweDay(List reportFeeMonthStatisticsDtos) { + int day = 0; + for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto : reportFeeMonthStatisticsDtos) { + try { + day = DateUtil.daysBetween(DateUtil.getDateFromStringB(reportFeeMonthStatisticsDto.getEndTime()), + DateUtil.getDateFromStringB(reportFeeMonthStatisticsDto.getStartTime())); + reportFeeMonthStatisticsDto.setOweDay(day); + } catch (Exception e) { + e.printStackTrace(); + } + } + } +} diff --git a/service-job/src/main/java/com/java110/job/export/adapt/ReportRepairDetailAdapt.java b/service-job/src/main/java/com/java110/job/export/adapt/ReportRepairDetailAdapt.java new file mode 100644 index 0000000000..030d75ea2f --- /dev/null +++ b/service-job/src/main/java/com/java110/job/export/adapt/ReportRepairDetailAdapt.java @@ -0,0 +1,213 @@ +package com.java110.job.export.adapt; + +import com.alibaba.fastjson.JSONObject; +import com.java110.dto.data.ExportDataDto; +import com.java110.dto.repair.RepairUserDto; +import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO; +import com.java110.job.export.IExportDataAdapt; +import com.java110.utils.util.BeanConvertUtil; +import com.java110.utils.util.ListUtil; +import com.java110.utils.util.StringUtil; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; + +@Component("reportRepairDetail") +public class ReportRepairDetailAdapt implements IExportDataAdapt { + + @Autowired + private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl; + + @Override + public SXSSFWorkbook exportData(ExportDataDto exportDataDto) throws ParseException { + JSONObject paramIn = exportDataDto.getReqJson(); + SXSSFWorkbook workbook = null; //工作簿 + //工作表 + workbook = new SXSSFWorkbook(); + workbook.setCompressTempFiles(false); + Sheet sheet = workbook.createSheet("报修汇总表"); + Row row = sheet.createRow(0); + row.createCell(0).setCellValue("员工ID"); + row.createCell(1).setCellValue("员工姓名"); + row.createCell(2).setCellValue("处理中条数"); + row.createCell(3).setCellValue("派单条数"); + row.createCell(4).setCellValue("转单条数"); + row.createCell(5).setCellValue("退单条数"); + row.createCell(6).setCellValue("已回访条数"); + row.createCell(7).setCellValue("已完结条数"); + row.createCell(8).setCellValue("员工评分"); + RepairUserDto repairUserDto = BeanConvertUtil.covertBean(paramIn,RepairUserDto.class); + if (!StringUtil.isEmpty(repairUserDto.getBeginStartTime())) { + repairUserDto.setBeginStartTime(repairUserDto.getBeginStartTime() + " 00:00:00"); + } + if (!StringUtil.isEmpty(repairUserDto.getBeginEndTime())) { + repairUserDto.setBeginEndTime(repairUserDto.getBeginEndTime() + " 23:59:59"); + } + if (!StringUtil.isEmpty(repairUserDto.getFinishStartTime())) { + repairUserDto.setFinishStartTime(repairUserDto.getFinishStartTime() + " 00:00:00"); + } + if (!StringUtil.isEmpty(repairUserDto.getFinishEndTime())) { + repairUserDto.setFinishEndTime(repairUserDto.getFinishEndTime() + " 23:59:59"); + } + List repairs = this.queryRepair(repairUserDto); + if (ListUtil.isNull(repairs)) { + return workbook; + } + RepairUserDto dataObj = null; + for (int roomIndex = 0; roomIndex < repairs.size(); roomIndex++) { + row = sheet.createRow(roomIndex + 1); + dataObj = repairs.get(roomIndex); + row.createCell(0).setCellValue(dataObj.getStaffId()); + row.createCell(1).setCellValue(dataObj.getStaffName()); + row.createCell(2).setCellValue(dataObj.getDealAmount()); + row.createCell(3).setCellValue(dataObj.getDispatchAmount()); + row.createCell(4).setCellValue(dataObj.getTransferOrderAmount()); + row.createCell(5).setCellValue(dataObj.getChargebackAmount()); + row.createCell(6).setCellValue(dataObj.getReturnAmount()); + row.createCell(7).setCellValue(dataObj.getStatementAmount()); + row.createCell(8).setCellValue(dataObj.getScore()); + } + return workbook; + } + + public List queryRepair(RepairUserDto repairUserDto) { + //查询员工报修表员工信息 + List repairUsers = reportFeeMonthStatisticsInnerServiceSMOImpl.queryRepairForStaff(repairUserDto); + int count = repairUsers.size(); + //获取员工id和姓名集合 + List staffs; + if (StringUtil.isEmpty(repairUserDto.getStaffId())) { + repairUserDto.setPage(-1); + staffs = reportFeeMonthStatisticsInnerServiceSMOImpl.queryRepairForStaff(repairUserDto); + } else { + repairUserDto.setPage(-1); + repairUserDto.setStaffId(null); + staffs = reportFeeMonthStatisticsInnerServiceSMOImpl.queryRepairForStaff(repairUserDto); + } + List repairUserList = new ArrayList<>(); + //处理中总数量 + int dealNumber = 0; + //结单总数量 + int statementNumber = 0; + //退单总数量 + int chargebackNumber = 0; + //转单总数量 + int transferOrderNumber = 0; + //派单总数量 + int dispatchNumber = 0; + //已回访总数量 + int returnNumber = 0; + if (count > 0) { + for (RepairUserDto repairUser : repairUsers) { + RepairUserDto repairUserInfo = new RepairUserDto(); + //员工id + repairUserDto.setStaffId(repairUser.getStaffId()); + List repairUserDtoList = reportFeeMonthStatisticsInnerServiceSMOImpl.queryRepairWithOutPage(repairUserDto); + if (ListUtil.isNull(repairUserDtoList)) { + continue; + } + //处理中数量 + int dealAmount = 0; + //结单数量 + int statementAmount = 0; + //退单数量 + int chargebackAmount = 0; + //转单数量 + int transferOrderAmount = 0; + //派单数量 + int dispatchAmount = 0; + //回访数量 + int returnAmount = 0; + //评分 + String score = ""; + for (RepairUserDto repair : repairUserDtoList) { + //处理中状态 + if (repair.getState().equals("10001")) { + //获取数量 + int amount = Integer.parseInt(repair.getAmount()); + dealAmount = dealAmount + amount; + } else if (repair.getState().equals("10002")) { //结单状态 + //获取数量 + int amount = Integer.parseInt(repair.getAmount()); + statementAmount = statementAmount + amount; + } else if (repair.getState().equals("10003")) { //退单状态 + //获取数量 + int amount = Integer.parseInt(repair.getAmount()); + chargebackAmount = chargebackAmount + amount; + } else if (repair.getState().equals("10004")) { //转单状态 + //获取数量 + int amount = Integer.parseInt(repair.getAmount()); + transferOrderAmount = transferOrderAmount + amount; + } else if (repair.getState().equals("10006")) { //派单状态 + int amount = Integer.parseInt(repair.getAmount()); + dispatchAmount = dispatchAmount + amount; + } else if (repair.getState().equals("10008")) { //已回访状态 + int amount = Integer.parseInt(repair.getAmount()); + returnAmount = returnAmount + amount; + } + if (!StringUtil.isEmpty(repair.getScore())) { + score = repair.getScore(); + } + } + //员工id + repairUserInfo.setStaffId(repairUser.getStaffId()); + //员工姓名 + repairUserInfo.setStaffName(repairUser.getStaffName()); + //处理中报修数量 + repairUserInfo.setDealAmount(Integer.toString(dealAmount)); + //处理中报修总数量 + repairUserInfo.setDealNumber(Integer.toString(dealNumber)); + //结单报修数量 + repairUserInfo.setStatementAmount(Integer.toString(statementAmount)); + //结单报修总数量 + repairUserInfo.setStatementNumber(Integer.toString(statementNumber)); + //退单报修数量 + repairUserInfo.setChargebackAmount(Integer.toString(chargebackAmount)); + //退单报修总数量 + repairUserInfo.setChargebackNumber(Integer.toString(chargebackNumber)); + //转单报修数量 + repairUserInfo.setTransferOrderAmount(Integer.toString(transferOrderAmount)); + //转单报修总数量 + repairUserInfo.setTransferOrderNumber(Integer.toString(transferOrderNumber)); + //派单报修数量 + repairUserInfo.setDispatchAmount(Integer.toString(dispatchAmount)); + //派单报修总数量 + repairUserInfo.setDispatchNumber(Integer.toString(dispatchNumber)); + //回访数量 + repairUserInfo.setReturnAmount(Integer.toString(returnAmount)); + //回访总数量 + repairUserInfo.setReturnNumber(Integer.toString(returnNumber)); + //员工id和姓名信息集合 + repairUserInfo.setRepairList(staffs); + //员工评分 + repairUserInfo.setScore(score); + repairUserList.add(repairUserInfo); + + dealNumber = Integer.parseInt(repairUserInfo.getDealAmount()) + dealNumber; + statementNumber = Integer.parseInt(repairUserInfo.getStatementAmount()) + statementNumber; + chargebackNumber = Integer.parseInt(repairUserInfo.getChargebackAmount()) + chargebackNumber; + transferOrderNumber = Integer.parseInt(repairUserInfo.getTransferOrderAmount()) + transferOrderNumber; + dispatchNumber = Integer.parseInt(repairUserInfo.getDispatchAmount()) + dispatchNumber; + returnNumber = Integer.parseInt(repairUserInfo.getReturnAmount()) + returnNumber; + } + } else { + repairUserList = new ArrayList<>(); + } + + RepairUserDto repairUser = new RepairUserDto(); + repairUser.setDealNumber(Integer.toString(dealNumber)); + repairUser.setStatementNumber(Integer.toString(statementNumber)); + repairUser.setChargebackNumber(Integer.toString(chargebackNumber)); + repairUser.setTransferOrderNumber(Integer.toString(transferOrderNumber)); + repairUser.setDispatchNumber(Integer.toString(dispatchNumber)); + repairUser.setReturnNumber(Integer.toString(returnNumber)); + + return repairUserList; + } +} -- Gitee From b742d73dea4a36b8ba6b8ea3d4db0d4f99201df9 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Tue, 29 Apr 2025 02:34:33 +0000 Subject: [PATCH 09/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=97=B4=E6=8E=A5?= =?UTF-8?q?=E6=80=A7=E8=B4=B9=E7=94=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java index c72f574e6f..48010d1d16 100644 --- a/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java +++ b/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java @@ -707,17 +707,17 @@ public class PayFeeCmd extends Cmd { return; } // todo 自己是间接性费用 - if (FeeDto.FEE_FLAG_CYCLE_ONCE.equals(feeConfigDto.getFeeFlag())) { + if (FeeDto.FEE_FLAG_CYCLE.equals(feeConfigDto.getFeeFlag())) { return; } FeeConfigDto tmpFeeConfigDto = new FeeConfigDto(); tmpFeeConfigDto.setFeeNameEq(feeConfigDto.getFeeName() + "欠费"); - tmpFeeConfigDto.setFeeFlag(FeeDto.FEE_FLAG_CYCLE_ONCE); + tmpFeeConfigDto.setFeeFlag(FeeDto.FEE_FLAG_CYCLE); tmpFeeConfigDto.setComputingFormula(feeConfigDto.getComputingFormula()); List feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(tmpFeeConfigDto); - Assert.listOnlyOne(feeConfigDtos, "按自定义时间段缴费时,费用必须为间接性费用,或者存在名称为 " + feeConfigDto.getFeeName() + "欠费 的间接性费用,它的公式计算必须要和" + feeConfigDto.getFeeName() + "一致"); + Assert.listOnlyOne(feeConfigDtos, "按自定义时间段缴费时,费用必须为周期性,或者存在名称为 " + feeConfigDto.getFeeName() + "欠费 的周期性费用,它的公式计算必须要和" + feeConfigDto.getFeeName() + "一致"); } -- Gitee From 0ec558f44ffb7ac36f11b83c035f15b9d70f7b7e Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Tue, 29 Apr 2025 02:42:31 +0000 Subject: [PATCH 10/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java index 48010d1d16..56859f2bbe 100644 --- a/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java +++ b/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java @@ -841,14 +841,14 @@ public class PayFeeCmd extends Cmd { feeConfigDto.setCommunityId(feeInfo.getCommunityId()); List feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); Assert.listOnlyOne(feeConfigDtos, "费用项不存在"); - if (FeeDto.FEE_FLAG_CYCLE_ONCE.equals(feeConfigDtos.get(0).getFeeFlag())) { + if (FeeDto.FEE_FLAG_CYCLE.equals(feeConfigDtos.get(0).getFeeFlag())) { return; } FeeConfigDto tmpFeeConfigDto = new FeeConfigDto(); tmpFeeConfigDto.setFeeNameEq(feeConfigDtos.get(0).getFeeName() + "欠费"); - tmpFeeConfigDto.setFeeFlag(FeeDto.FEE_FLAG_CYCLE_ONCE); + tmpFeeConfigDto.setFeeFlag(FeeDto.FEE_FLAG_CYCLE); tmpFeeConfigDto.setComputingFormula(feeConfigDto.getComputingFormula()); //todo 校验的时候校验过了 所以这里不可能为空 feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(tmpFeeConfigDto); -- Gitee From e9201bb8705655602971022d0ff0cb45979a9f0b Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 7 May 2025 07:16:18 +0000 Subject: [PATCH 11/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../export/adapt/ReportListOweFeeAdapt.java | 356 ++++++++++++++++++ 1 file changed, 356 insertions(+) create mode 100644 service-job/src/main/java/com/java110/job/export/adapt/ReportListOweFeeAdapt.java diff --git a/service-job/src/main/java/com/java110/job/export/adapt/ReportListOweFeeAdapt.java b/service-job/src/main/java/com/java110/job/export/adapt/ReportListOweFeeAdapt.java new file mode 100644 index 0000000000..5338084346 --- /dev/null +++ b/service-job/src/main/java/com/java110/job/export/adapt/ReportListOweFeeAdapt.java @@ -0,0 +1,356 @@ +package com.java110.job.export.adapt; + +import com.alibaba.fastjson.JSONObject; +import com.java110.dto.data.ExportDataDto; +import com.java110.dto.fee.FeeConfigDto; +import com.java110.dto.reportFee.ReportOweFeeDto; +import com.java110.dto.reportFee.ReportOweFeeItemDto; +import com.java110.intf.fee.IPayFeeConfigV1InnerServiceSMO; +import com.java110.intf.report.IReportOweFeeInnerServiceSMO; +import com.java110.job.export.IExportDataAdapt; +import com.java110.utils.util.DateUtil; +import com.java110.utils.util.ListUtil; +import com.java110.utils.util.StringUtil; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service("reportListOweFee") +public class ReportListOweFeeAdapt implements IExportDataAdapt { + + @Autowired + private IReportOweFeeInnerServiceSMO reportOweFeeInnerServiceSMOImpl; + + @Autowired + private IPayFeeConfigV1InnerServiceSMO payFeeConfigV1InnerServiceSMOImpl; + + + @Override + public SXSSFWorkbook exportData(ExportDataDto exportDataDto) throws ParseException { + SXSSFWorkbook workbook = null; //工作簿 + String userId = ""; + //工作表 + workbook = new SXSSFWorkbook(); + workbook.setCompressTempFiles(false); + + JSONObject reqJson = exportDataDto.getReqJson(); + String configIds = reqJson.getString("configIds"); + //查询楼栋信息 + List oweFees = this.getReportListOweFees(reqJson); + if (ListUtil.isNull(oweFees)) { + return workbook; + } + //获取费用项 + List feeConfigDtos = getFeeConfigs(oweFees); + Sheet sheet = workbook.createSheet("欠费清单"); + Row row = sheet.createRow(0); + row.createCell(0).setCellValue("收费对象"); + row.createCell(1).setCellValue("业主名称"); + row.createCell(2).setCellValue("手机号"); + row.createCell(3).setCellValue("开始时间"); + row.createCell(4).setCellValue("结束时间"); + if (!StringUtil.isEmpty(configIds)) { + for (int feeConfigIndex = 0; feeConfigIndex < feeConfigDtos.size(); feeConfigIndex++) { + row.createCell(5 + feeConfigIndex).setCellValue(feeConfigDtos.get(feeConfigIndex).getFeeName()); + } + row.createCell(5 + feeConfigDtos.size()).setCellValue("合计"); + } else { + row.createCell(5).setCellValue("合计"); + } + + + ReportOweFeeDto reportOweFeeDto = null; + for (int roomIndex = 0; roomIndex < oweFees.size(); roomIndex++) { + row = sheet.createRow(roomIndex + 1); + reportOweFeeDto = oweFees.get(roomIndex); + row.createCell(0).setCellValue(reportOweFeeDto.getPayerObjName()); + row.createCell(1).setCellValue(reportOweFeeDto.getOwnerName()); + row.createCell(2).setCellValue(reportOweFeeDto.getOwnerTel()); + row.createCell(3).setCellValue(reportOweFeeDto.getEndTime()); + row.createCell(4).setCellValue(reportOweFeeDto.getDeadlineTime()); + if (!StringUtil.isEmpty(configIds)) { + for (int feeConfigIndex = 0; feeConfigIndex < feeConfigDtos.size(); feeConfigIndex++) { + row.createCell(5 + feeConfigIndex).setCellValue(getFeeConfigAmount(feeConfigDtos.get(feeConfigIndex), reportOweFeeDto)); + } + row.createCell(5 + feeConfigDtos.size()).setCellValue(getAllFeeOweAmount(feeConfigDtos, reportOweFeeDto)); + } else { + row.createCell(5).setCellValue(getAllFeeOweAmount(feeConfigDtos, reportOweFeeDto)); + } + + } + return workbook; + } + + private List getReportListOweFees(JSONObject reqJson) { + + ReportOweFeeDto reportOweFeeDto = new ReportOweFeeDto(); + reportOweFeeDto.setPage(1); + reportOweFeeDto.setRow(10000); + reportOweFeeDto.setHasOweFee("Y"); + + List allReportOweFeeDtos = reportOweFeeInnerServiceSMOImpl.queryReportAllOweFees(reportOweFeeDto); + if (ListUtil.isNull(allReportOweFeeDtos)) { + return allReportOweFeeDtos; + } + + //get old report owe fee + List oldReportOweFeeDtos = new ArrayList<>(); + ReportOweFeeDto oldReportOweFeeDto = null; + for (ReportOweFeeDto tmpReportOweFeeDto : allReportOweFeeDtos) { + if (existsOweFee(oldReportOweFeeDtos, tmpReportOweFeeDto.getPayerObjId())) { + continue; + } + oldReportOweFeeDto = new ReportOweFeeDto(); + oldReportOweFeeDto.setPayerObjId(tmpReportOweFeeDto.getPayerObjId()); + + oldReportOweFeeDtos.add(oldReportOweFeeDto); + } + + for (ReportOweFeeDto tmpReportOweFeeDto : oldReportOweFeeDtos) { + dealItem(tmpReportOweFeeDto, allReportOweFeeDtos); + } + + if (reportOweFeeDto.getConfigIds() == null || reportOweFeeDto.getConfigIds().length < 1) { + return oldReportOweFeeDtos; + } + + //如果费用对象上没有这个费用项时默认写零 + FeeConfigDto feeConfigDto = null; + feeConfigDto = new FeeConfigDto(); + feeConfigDto.setConfigIds(reportOweFeeDto.getConfigIds()); + List feeConfigDtos = payFeeConfigV1InnerServiceSMOImpl.queryPayFeeConfigs(feeConfigDto); + for (ReportOweFeeDto tmpReportOweFeeDto : oldReportOweFeeDtos) { + for (String configId : reportOweFeeDto.getConfigIds()) { + if (hasItem(tmpReportOweFeeDto.getItems(), configId) != null) { + continue; + } + ReportOweFeeItemDto reportOweFeeItemDto = new ReportOweFeeItemDto(); + reportOweFeeItemDto.setConfigId(configId); + reportOweFeeItemDto.setConfigName(getFeeConfigName(feeConfigDtos, configId)); + reportOweFeeItemDto.setAmountOwed("0"); + reportOweFeeItemDto.setPayerObjId(""); + reportOweFeeItemDto.setPayerObjName(""); + tmpReportOweFeeDto.getItems().add(reportOweFeeItemDto); + } + } + return oldReportOweFeeDtos; + } + + private ReportOweFeeItemDto hasItem(List reportOweFeeItemDtos, String configId) { + if (ListUtil.isNull(reportOweFeeItemDtos)) { + return null; + } + for (ReportOweFeeItemDto reportOweFeeItemDto : reportOweFeeItemDtos) { + if (reportOweFeeItemDto.getConfigId().equals(configId)) { + return reportOweFeeItemDto; + } + } + + return null; + } + + private void dealItem(ReportOweFeeDto oldReportOweFeeDto, List allReportOweFeeDtos) { + List items = new ArrayList<>(); + if (ListUtil.isNull(allReportOweFeeDtos)) { + return; + } + + ReportOweFeeItemDto reportOweFeeItemDto = null; + for (ReportOweFeeDto reportOweFeeDto : allReportOweFeeDtos) { + if (!oldReportOweFeeDto.getPayerObjId().equals(reportOweFeeDto.getPayerObjId())) { + continue; + } + reportOweFeeItemDto = hasItem(items, reportOweFeeDto.getConfigId()); + if (reportOweFeeItemDto == null) { + reportOweFeeItemDto = new ReportOweFeeItemDto(); + reportOweFeeItemDto.setConfigId(reportOweFeeDto.getConfigId()); + reportOweFeeItemDto.setFeeName(reportOweFeeDto.getFeeName()); + reportOweFeeItemDto.setAmountOwed(reportOweFeeDto.getAmountOwed()); + reportOweFeeItemDto.setPayerObjId(reportOweFeeDto.getPayerObjId()); + reportOweFeeItemDto.setPayerObjName(reportOweFeeDto.getPayerObjName()); + reportOweFeeItemDto.setConfigName(reportOweFeeDto.getConfigName()); + try { + reportOweFeeItemDto.setStartTime(DateUtil.getDateFromString(reportOweFeeDto.getEndTime(), DateUtil.DATE_FORMATE_STRING_A)); + reportOweFeeItemDto.setEndTime(DateUtil.getDateFromString(reportOweFeeDto.getDeadlineTime(), DateUtil.DATE_FORMATE_STRING_A)); + } catch (ParseException e) { + e.printStackTrace(); + } + items.add(reportOweFeeItemDto); + } else { + BigDecimal oldAmount = new BigDecimal(Double.parseDouble(reportOweFeeItemDto.getAmountOwed())); + oldAmount = oldAmount.add(new BigDecimal(Double.parseDouble(reportOweFeeDto.getAmountOwed()))).setScale(2, BigDecimal.ROUND_HALF_EVEN); + reportOweFeeItemDto.setAmountOwed(oldAmount.doubleValue() + ""); + } + if (!StringUtil.isEmpty(reportOweFeeDto.getOwnerName()) && StringUtil.isEmpty(oldReportOweFeeDto.getOwnerName())) { + oldReportOweFeeDto.setOwnerName(reportOweFeeDto.getOwnerName()); + } + if (!StringUtil.isEmpty(reportOweFeeDto.getOwnerTel()) && StringUtil.isEmpty(oldReportOweFeeDto.getOwnerTel())) { + oldReportOweFeeDto.setOwnerTel(reportOweFeeDto.getOwnerTel()); + } + oldReportOweFeeDto.setUpdateTime(reportOweFeeDto.getUpdateTime()); + oldReportOweFeeDto.setConfigName(reportOweFeeDto.getConfigName()); + } + + //计算总金额 + BigDecimal totalAmount = new BigDecimal(0); + Date startTime = null; + Date endTime = null; + for (ReportOweFeeItemDto tempReportOweFeeItemDto : items) { + if (startTime == null) { + startTime = tempReportOweFeeItemDto.getStartTime(); + } + if (startTime.getTime() > tempReportOweFeeItemDto.getStartTime().getTime()) { + startTime = tempReportOweFeeItemDto.getStartTime(); + } + if (endTime == null) { + endTime = tempReportOweFeeItemDto.getEndTime(); + } + if (endTime.getTime() < tempReportOweFeeItemDto.getEndTime().getTime()) { + endTime = tempReportOweFeeItemDto.getEndTime(); + } + totalAmount = totalAmount.add(new BigDecimal(Double.parseDouble(tempReportOweFeeItemDto.getAmountOwed()))).setScale(2, BigDecimal.ROUND_HALF_EVEN); + } + oldReportOweFeeDto.setEndTime(DateUtil.getFormatTimeString(startTime, DateUtil.DATE_FORMATE_STRING_A)); + oldReportOweFeeDto.setDeadlineTime(DateUtil.getFormatTimeString(endTime, DateUtil.DATE_FORMATE_STRING_A)); + oldReportOweFeeDto.setItems(items); + oldReportOweFeeDto.setPayerObjName(items.get(0).getPayerObjName()); + oldReportOweFeeDto.setAmountOwed(totalAmount.doubleValue() + ""); + + } + + private String getFeeConfigName(List feeConfigDtos, String configId) { + + if (ListUtil.isNull(feeConfigDtos)) { + return "无"; + } + + for (FeeConfigDto feeConfigDto : feeConfigDtos) { + if (feeConfigDto.getConfigId().equals(configId)) { + return feeConfigDto.getFeeName(); + } + } + + return "无"; + } + + /** + * exists owe fee in oldReportOweFeeDtos + * true is exists false is not + * + * @param oldReportOweFeeDtos + * @param payerObjId + * @return + */ + private boolean existsOweFee(List oldReportOweFeeDtos, String payerObjId) { + for (ReportOweFeeDto tmpReportOweFeeDto : oldReportOweFeeDtos) { + // if equal return true + if (tmpReportOweFeeDto.getPayerObjId().equals(payerObjId)) { + return true; + } + + } + //default return false + return false; + } + + private List getFeeConfigs(List oweFees) { + List feeConfigDtos = new ArrayList<>(); + FeeConfigDto feeConfigDto = null; + for (int oweFeeIndex = 0; oweFeeIndex < oweFees.size(); oweFeeIndex++) { + List items = oweFees.get(oweFeeIndex).getItems(); + for (int itemIndex = 0; itemIndex < items.size(); itemIndex++) { + if (existsFeeConfig(feeConfigDtos, items.get(itemIndex))) { + continue; + } + feeConfigDto = new FeeConfigDto(); + feeConfigDto.setConfigId(items.get(itemIndex).getConfigId()); + feeConfigDto.setFeeName(items.get(itemIndex).getConfigName()); + feeConfigDtos.add(feeConfigDto); + } + } + + return feeConfigDtos; + } + + private boolean existsFeeConfig(List feeConfigDtos, ReportOweFeeItemDto reportOweFeeItemDto) { + if (ListUtil.isNull(feeConfigDtos)) { + return false; + } + for (FeeConfigDto feeConfigDto : feeConfigDtos) { + if (feeConfigDto.getConfigId().equals(reportOweFeeItemDto.getConfigId())) { + return true; + } + } + + return false; + } + + /** + * _getAllFeeOweAmount: function (_fee) { + * let _feeConfigNames = $that.listOweFeeInfo.feeConfigNames; + * if (_feeConfigNames.length < 1) { + * return _fee.amountOwed; + * } + *

+ * let _amountOwed = 0.0; + * let _items = _fee.items; + * _feeConfigNames.forEach(_feeItem =>{ + * _items.forEach(_item=>{ + * if(_feeItem.configId == _item.configId){ + * _amountOwed += parseFloat(_item.amountOwed); + * } + * }) + * }) + * return _amountOwed; + * } + * + * @param reportOweFeeDto + * @return + */ + private double getAllFeeOweAmount(List feeConfigDtos, ReportOweFeeDto reportOweFeeDto) { + if (ListUtil.isNull(feeConfigDtos)) { + return Double.parseDouble(reportOweFeeDto.getAmountOwed()); + } + List items = reportOweFeeDto.getItems(); + if (ListUtil.isNull(items)) { + return Double.parseDouble(reportOweFeeDto.getAmountOwed()); + } + + BigDecimal oweAmount = new BigDecimal(0); + for (FeeConfigDto feeConfigDto : feeConfigDtos) { + for (int itemIndex = 0; itemIndex < items.size(); itemIndex++) { + if (feeConfigDto.getConfigId().equals(items.get(itemIndex).getConfigId())) { + oweAmount = oweAmount.add(new BigDecimal(items.get(itemIndex).getAmountOwed())); + } + } + } + + return oweAmount.doubleValue(); + } + + private double getFeeConfigAmount(FeeConfigDto feeConfigDto, ReportOweFeeDto reportOweFeeDto) { + List items = reportOweFeeDto.getItems(); + double oweAmount = 0; + + if (ListUtil.isNull(items)) { + return oweAmount; + } + + for (int itemIndex = 0; itemIndex < items.size(); itemIndex++) { + if (feeConfigDto.getConfigId().equals(items.get(itemIndex).getConfigId())) { + oweAmount = Double.parseDouble(items.get(itemIndex).getAmountOwed()); + break; + } + } + return oweAmount; + } + +} -- Gitee From c2d4a451c5dac3447ff276d22e153c2fb95ba547 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 7 May 2025 09:52:55 +0000 Subject: [PATCH 12/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java index 56859f2bbe..8bc4187022 100644 --- a/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java +++ b/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java @@ -819,7 +819,7 @@ public class PayFeeCmd extends Cmd { tmpFeeAttrPo = new FeeAttrPo(); tmpFeeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId, true)); tmpFeeAttrPo.setFeeId(tmpPayFeePo.getFeeId()); - tmpFeeAttrPo.setCommunityId(tmpFeeAttrPo.getCommunityId()); + tmpFeeAttrPo.setCommunityId(tmpPayFeePo.getCommunityId()); tmpFeeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME); tmpFeeAttrPo.setValue(reqJson.getString("customStartTime")); tmpFeeAttrPos.add(tmpFeeAttrPo); -- Gitee From f81ebc5cb805d1352e8bf01fce4b1048b568d003 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 14 May 2025 07:13:16 +0000 Subject: [PATCH 13/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=BC=E9=87=91?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../adapt/ReportPayFeeDepositAdapt.java | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 service-job/src/main/java/com/java110/job/export/adapt/ReportPayFeeDepositAdapt.java diff --git a/service-job/src/main/java/com/java110/job/export/adapt/ReportPayFeeDepositAdapt.java b/service-job/src/main/java/com/java110/job/export/adapt/ReportPayFeeDepositAdapt.java new file mode 100644 index 0000000000..aef6184aa5 --- /dev/null +++ b/service-job/src/main/java/com/java110/job/export/adapt/ReportPayFeeDepositAdapt.java @@ -0,0 +1,114 @@ +package com.java110.job.export.adapt; + +import com.alibaba.fastjson.JSONObject; +import com.java110.dto.data.ExportDataDto; +import com.java110.dto.fee.FeeConfigDto; +import com.java110.dto.fee.FeeDto; +import com.java110.dto.report.ReportDeposit; +import com.java110.intf.fee.IFeeConfigInnerServiceSMO; +import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO; +import com.java110.job.export.IExportDataAdapt; +import com.java110.utils.util.BeanConvertUtil; +import com.java110.utils.util.ListUtil; +import com.java110.utils.util.StringUtil; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.ParseException; +import java.util.List; + +@Service("reportPayFeeDeposit") +public class ReportPayFeeDepositAdapt implements IExportDataAdapt { + + @Autowired + private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl; + + @Autowired + private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl; + @Override + public SXSSFWorkbook exportData(ExportDataDto exportDataDto) throws ParseException { + + JSONObject reqJson = exportDataDto.getReqJson(); + SXSSFWorkbook workbook = null; //工作簿 + //工作表 + workbook = new SXSSFWorkbook(); + workbook.setCompressTempFiles(false); + Sheet sheet = workbook.createSheet("押金报表"); + Row row = sheet.createRow(0); + row.createCell(0).setCellValue("费用ID"); + row.createCell(1).setCellValue("房号"); + row.createCell(2).setCellValue("业主"); + row.createCell(3).setCellValue("费用类型"); + row.createCell(4).setCellValue("费用项"); + row.createCell(5).setCellValue("费用开始时间"); + row.createCell(6).setCellValue("费用结束时间"); + row.createCell(7).setCellValue("创建时间"); + row.createCell(8).setCellValue("付费对象类型"); + row.createCell(9).setCellValue("付款方ID"); + row.createCell(10).setCellValue("应收金额"); + row.createCell(11).setCellValue("状态"); + row.createCell(12).setCellValue("退费状态"); + + List reportPayFeeDeposits = this.getReportPayFeeDeposit(reqJson); + if (ListUtil.isNull(reportPayFeeDeposits)) { + return workbook; + } + ReportDeposit dataObj = null; + for (int roomIndex = 0; roomIndex < reportPayFeeDeposits.size(); roomIndex++) { + row = sheet.createRow(roomIndex + 1); + dataObj = reportPayFeeDeposits.get(roomIndex); + row.createCell(0).setCellValue(dataObj.getFeeId()); + if (!StringUtil.isEmpty(dataObj.getPayerObjType()) && dataObj.getPayerObjType().equals("3333")) { //房屋 + row.createCell(1).setCellValue(dataObj.getFloorNum() + "-" + dataObj.getUnitNum() + "-" + dataObj.getRoomNum()); + } else { + row.createCell(1).setCellValue(dataObj.getObjName()); + } + row.createCell(2).setCellValue(dataObj.getOwnerName()); + row.createCell(3).setCellValue(dataObj.getFeeTypeCdName()); + row.createCell(4).setCellValue(dataObj.getFeeName()); + row.createCell(5).setCellValue(dataObj.getStartTime()); + row.createCell(6).setCellValue(dataObj.getDeadlineTime()); + row.createCell(7).setCellValue(dataObj.getCreateTime()); + row.createCell(8).setCellValue(dataObj.getPayerObjTypeName()); + row.createCell(9).setCellValue(dataObj.getPayerObjId()); + row.createCell(10).setCellValue(dataObj.getAdditionalAmount()); + row.createCell(11).setCellValue(dataObj.getStateName()); + if (dataObj.getState().equals("2009001")) { + row.createCell(12).setCellValue(dataObj.getDetailStateName()); + } else { + row.createCell(12).setCellValue("未缴费"); + } + } + return workbook; + } + + private List getReportPayFeeDeposit(JSONObject reqJson) { + + ReportDeposit reportDeposit = BeanConvertUtil.covertBean(reqJson,ReportDeposit.class); + reportDeposit.setPage(1); + reportDeposit.setRow(10000); + List reportDeposits = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPayFeeDeposit(reportDeposit); + //查询押金费用项 + FeeConfigDto feeConfigDto = new FeeConfigDto(); + feeConfigDto.setCommunityId(reportDeposit.getCommunityId()); + feeConfigDto.setFeeTypeCd("888800010006"); + List feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); + + + for (ReportDeposit deposit : reportDeposits) { + deposit.setFeeConfigDtos(feeConfigDtos); + if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(deposit.getPayerObjType())) { + deposit.setObjName(deposit.getFloorNum() + + "栋" + deposit.getUnitNum() + + "单元" + deposit.getRoomNum() + "室"); + } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(deposit.getPayerObjType())) { + deposit.setObjName(deposit.getCarNum()); + } + } + + return reportDeposits; + } +} -- Gitee From 82800e4b73fa668498599c6191b16432f602ced0 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 14 May 2025 07:39:38 +0000 Subject: [PATCH 14/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../ReportQuestionAnswerDetailAdapt.java | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 service-job/src/main/java/com/java110/job/export/adapt/ReportQuestionAnswerDetailAdapt.java diff --git a/service-job/src/main/java/com/java110/job/export/adapt/ReportQuestionAnswerDetailAdapt.java b/service-job/src/main/java/com/java110/job/export/adapt/ReportQuestionAnswerDetailAdapt.java new file mode 100644 index 0000000000..4f23c6b8df --- /dev/null +++ b/service-job/src/main/java/com/java110/job/export/adapt/ReportQuestionAnswerDetailAdapt.java @@ -0,0 +1,94 @@ +package com.java110.job.export.adapt; + +import com.alibaba.fastjson.JSONObject; +import com.java110.dto.data.ExportDataDto; +import com.java110.dto.user.UserQuestionAnswerValueDto; +import com.java110.intf.report.IReportUserQuestionAnswerValueInnerServiceSMO; +import com.java110.job.export.IExportDataAdapt; +import com.java110.utils.util.BeanConvertUtil; +import com.java110.utils.util.ListUtil; +import com.java110.utils.util.StringUtil; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; + +@Service("reportQuestionAnswerDetail") +public class ReportQuestionAnswerDetailAdapt implements IExportDataAdapt { + + @Autowired + private IReportUserQuestionAnswerValueInnerServiceSMO reportUserQuestionAnswerValueInnerServiceSMOImpl; + + + @Override + public SXSSFWorkbook exportData(ExportDataDto exportDataDto) throws ParseException { + JSONObject reqJson = exportDataDto.getReqJson(); + SXSSFWorkbook workbook = null; //工作簿 + //工作表 + workbook = new SXSSFWorkbook(); + workbook.setCompressTempFiles(false); + Sheet sheet = workbook.createSheet("问卷明细表"); + Row row = sheet.createRow(0); + row.createCell(0).setCellValue("问卷人"); + row.createCell(1).setCellValue("问卷类型"); + row.createCell(2).setCellValue("问卷名称"); + row.createCell(3).setCellValue("问卷题目"); + row.createCell(4).setCellValue("答案"); + row.createCell(5).setCellValue("时间"); + + List questionAnswers = this.getReportQuestionAnswerDetail(reqJson); + if (ListUtil.isNull(questionAnswers)) { + return workbook; + } + UserQuestionAnswerValueDto dataObj = null; + for (int roomIndex = 0; roomIndex < questionAnswers.size(); roomIndex++) { + row = sheet.createRow(roomIndex + 1); + dataObj = questionAnswers.get(roomIndex); + row.createCell(0).setCellValue(dataObj.getUserName()); + row.createCell(1).setCellValue(dataObj.getQaTypeName()); + row.createCell(2).setCellValue(dataObj.getQaName()); + row.createCell(3).setCellValue(dataObj.getQaTitle()); + row.createCell(4).setCellValue(dataObj.getQaValue()); + row.createCell(5).setCellValue(dataObj.getCreateTime()); + } + return workbook; + } + + private List getReportQuestionAnswerDetail(JSONObject reqJson) { + + UserQuestionAnswerValueDto userQuestionAnswerValueDto = BeanConvertUtil.covertBean(reqJson, UserQuestionAnswerValueDto.class); + userQuestionAnswerValueDto.setPage(1); + userQuestionAnswerValueDto.setRow(10000); + + int count = reportUserQuestionAnswerValueInnerServiceSMOImpl.queryUserQuestionAnswerValuesCount(userQuestionAnswerValueDto); + + List userQuestionAnswerValueDtos = null; + if (count > 0) { + userQuestionAnswerValueDtos = reportUserQuestionAnswerValueInnerServiceSMOImpl.queryUserQuestionAnswerValues(userQuestionAnswerValueDto); + + refreshQuestionAnswerValue(userQuestionAnswerValueDtos); + } else { + userQuestionAnswerValueDtos = new ArrayList<>(); + } + + return userQuestionAnswerValueDtos; + } + + private void refreshQuestionAnswerValue(List userQuestionAnswerValueDtos) { + + if (userQuestionAnswerValueDtos == null || userQuestionAnswerValueDtos.size() < 1) { + return; + } + + for (UserQuestionAnswerValueDto userQuestionAnswerValueDto : userQuestionAnswerValueDtos) { + if (StringUtil.isEmpty(userQuestionAnswerValueDto.getValueContent())) { + userQuestionAnswerValueDto.setValueContent(userQuestionAnswerValueDto.getValueContent()); + } + } + } +} -- Gitee From b5730dd5b3ad64ad0f87949dad33f6cd69462f17 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 14 May 2025 07:54:16 +0000 Subject: [PATCH 15/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../ReportUserQuestionAnswerValueServiceDaoImplMapper.xml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportUserQuestionAnswerValueServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportUserQuestionAnswerValueServiceDaoImplMapper.xml index a79f715dfe..eef72088fd 100644 --- a/java110-db/src/main/resources/mapper/report/ReportUserQuestionAnswerValueServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportUserQuestionAnswerValueServiceDaoImplMapper.xml @@ -42,9 +42,6 @@ and t.value_content= #{valueContent} - - and t.person_id= #{personId} - and t.status_cd= #{statusCd} @@ -111,9 +108,7 @@ and t.value_content= #{valueContent} - - and t.person_id= #{personId} - + and t.status_cd= #{statusCd} -- Gitee From 584f6ed0ddd5440db1132a0e1e247a56e919fb98 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 14 May 2025 08:02:16 +0000 Subject: [PATCH 16/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../ReportUserQuestionAnswerValueServiceDaoImplMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java110-db/src/main/resources/mapper/report/ReportUserQuestionAnswerValueServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/report/ReportUserQuestionAnswerValueServiceDaoImplMapper.xml index eef72088fd..924bf7d2b7 100644 --- a/java110-db/src/main/resources/mapper/report/ReportUserQuestionAnswerValueServiceDaoImplMapper.xml +++ b/java110-db/src/main/resources/mapper/report/ReportUserQuestionAnswerValueServiceDaoImplMapper.xml @@ -11,7 +11,7 @@ from user_question_answer_value t left join question_answer_title uat on t.title_id = uat.title_id and uat.status_cd = '0' left join question_answer qa on uat.qa_id = qa.qa_id and qa.status_cd = '0' - left join u_user uu on t.person_id = uu.user_id and uu.status_cd = '0' + left join u_user uu on t.user_qa_id = uu.user_id and uu.status_cd = '0' left join question_answer_title_value qatv on t.value_id = qatv.value_id and qatv.status_cd = '0' left join t_dict td on qa.qa_type = td.status_cd and td.table_name = 'question_answer' and td.table_columns = 'qa_type' where 1=1 @@ -77,7 +77,7 @@ from user_question_answer_value t left join question_answer_title uat on t.title_id = uat.title_id and uat.status_cd = '0' left join question_answer qa on uat.qa_id = qa.qa_id and qa.status_cd = '0' - left join u_user uu on t.person_id = uu.user_id and uu.status_cd = '0' + left join u_user uu on t.user_qa_id = uu.user_id and uu.status_cd = '0' left join question_answer_title_value qatv on t.value_id = qatv.value_id and qatv.status_cd = '0' left join t_dict td on qa.qa_type = td.status_cd and td.table_name = 'question_answer' and td.table_columns = 'qa_type' where 1=1 -- Gitee From 46675f1b0e738d6feac132606612e16056c9aee6 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 14 May 2025 17:02:52 +0000 Subject: [PATCH 17/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E4=BA=A7=E7=94=9F=E6=95=B0=E6=8D=AE=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=B0=86=E8=87=AA=E7=84=B6=E6=9C=88=E5=92=8C=E9=9D=9E?= =?UTF-8?q?=E8=87=AA=E7=84=B6=E6=9C=88=E5=8D=B4=E5=88=AB=E5=AF=B9=E5=BE=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../fee/feeMonth/IPayFeeMonthHelp.java | 2 +- .../java110/fee/feeMonth/PayFeeMonthHelp.java | 117 +++++++++++++++--- .../java110/fee/feeMonth/PayFeeMonthImpl.java | 6 +- 3 files changed, 102 insertions(+), 23 deletions(-) diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/IPayFeeMonthHelp.java b/service-fee/src/main/java/com/java110/fee/feeMonth/IPayFeeMonthHelp.java index 52abb02b83..68d3501758 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/IPayFeeMonthHelp.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/IPayFeeMonthHelp.java @@ -30,5 +30,5 @@ public interface IPayFeeMonthHelp { * @param feePrice * @param deadlineTime */ - void waitDispersedOweFee(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice, Date deadlineTime); + void waitDispersedOweFee(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice, Date deadlineTime,double owePrice); } diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java index 6fe0331103..c441b20ea3 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java @@ -159,7 +159,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { * @param deadlineTime */ @Override - public void waitDispersedOweFee(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice, Date deadlineTime) { + public void waitDispersedOweFee(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice, Date deadlineTime, double owePrice) { // todo 清理 detailId 为-1 的数据 @@ -174,6 +174,31 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { return; } + // 自然月周期性费用计算 + waitDispersedOweFeeCycleNormalMonth(feeDto,payFeeMonthOwnerDto,feePrice,deadlineTime); + + // 一次性或者非自然月处理 + waitDispersedOweFeeOnceUnNormalMonth(feeDto,payFeeMonthOwnerDto,deadlineTime,owePrice); + + } + + /** + * 自然月周期性费用计算 + * + * @param feeDto + * @param payFeeMonthOwnerDto + * @param feePrice + * @param deadlineTime + */ + private void waitDispersedOweFeeCycleNormalMonth(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice, Date deadlineTime) { + // 一次性费用直接返回 + if (FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { + return; + } + // 不是自然月 费用直接返回 + if(DateUtil.getMonthDay(feeDto.getStartTime()) !=1){ + return; + } List payFeeDetailMonthPos = new ArrayList<>(); // todo 处理 开始时间和结束时间 Date startTime = DateUtil.timeToDate(feeDto.getEndTime()); @@ -183,15 +208,6 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { BigDecimal dayReceivableAmount = null; - //todo 一次性费用 日应收计算 - if (FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { - int day = DateUtil.daysBetween(endTime, startTime); - if (day < 1) { - day = 1; - } - dayReceivableAmount = receivableAmount.divide(new BigDecimal(day), 8, BigDecimal.ROUND_HALF_UP);// 日 应收 - } - // todo 寻找第一个自然月 一日 Calendar firstMonthDayCal = Calendar.getInstance(); firstMonthDayCal.setTime(startTime); @@ -212,11 +228,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { calendar.setTime(startMonthDayTime); curMonthMaxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - - //todo 周期性费用 日应收重新算 - if (!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { - dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - } + dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 // todo 计算 应收 curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); @@ -240,21 +252,86 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { Calendar calendar = Calendar.getInstance(); calendar.setTime(startMonthDayTime); curMonthMaxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - // todo 如果不是整月,则转换为按天计算 -// if (curDay != curMonthMaxDay) { //todo 周期性费用 日应收重新算 if (!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 } // todo 计算 应收 curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); -// } else { // todo 如果是整月 那就按月计算,以免 转换成天再 乘以天数后的误差 -// curMonthReceivableAmount = receivableAmount; -// } + // todo 保存数据到pay_fee_detail_month toSavePayFeeDetailMonth(curMonthReceivableAmount.doubleValue(), 0, null, feeDto, payFeeMonthOwnerDto, payFeeDetailMonthPos, startMonthDayTime, deadlineTime); payFeeDetailMonthInnerServiceSMOImpl.savePayFeeDetailMonths(payFeeDetailMonthPos); + } + + + /** + * 一次性或者非自然月处理 + * @param feeDto + * @param payFeeMonthOwnerDto + * @param deadlineTime + * @param oweMonth + */ + private void waitDispersedOweFeeOnceUnNormalMonth(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Date deadlineTime, double oweMonth) { + + // 不是一次性费用 并且是 自然月就返回 + if(!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) && DateUtil.getMonthDay(feeDto.getStartTime()) == 1){ + return; + } + List payFeeDetailMonthPos = new ArrayList<>(); + // todo 处理 开始时间和结束时间 + Date startTime = DateUtil.timeToDate(feeDto.getEndTime()); + Date endTime = DateUtil.deadTimeToDate(deadlineTime); + + BigDecimal receivableAmount = new BigDecimal(oweMonth); + + BigDecimal dayReceivableAmount = null; + + int day = DateUtil.daysBetween(endTime, startTime); + if (day < 1) { + day = 1; + } + dayReceivableAmount = receivableAmount.divide(new BigDecimal(day), 8, BigDecimal.ROUND_HALF_UP);// 日 应收 + + // todo 寻找第一个自然月 一日 + Calendar firstMonthDayCal = Calendar.getInstance(); + firstMonthDayCal.setTime(startTime); + firstMonthDayCal.add(Calendar.MONTH, 1); + firstMonthDayCal.set(Calendar.DAY_OF_MONTH, 1); + Date firstMonthDayTime = firstMonthDayCal.getTime(); + + Date startMonthDayTime = startTime; + // todo 循环,只到 firstMonthDayTime 大于 endTime + int curDay = 0; + int curMonthMaxDay = 30; + BigDecimal curMonthReceivableAmount = null; + + while (firstMonthDayTime.getTime() < endTime.getTime()) { + curDay = DateUtil.daysBetween(firstMonthDayTime, startMonthDayTime); + // todo 计算 应收 + curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); + + // todo 保存数据到pay_fee_detail_month + toSavePayFeeDetailMonth(curMonthReceivableAmount.doubleValue(), 0, null, feeDto, payFeeMonthOwnerDto, payFeeDetailMonthPos, startMonthDayTime, deadlineTime); + + // todo 将startTime 修改为 下月1日时间 + startMonthDayTime = firstMonthDayTime; + firstMonthDayCal.add(Calendar.MONTH, 1); + firstMonthDayTime = firstMonthDayCal.getTime(); + } + + //todo 最后处理 最后 startMonthDayTime 到endTime 的 + if (startMonthDayTime.getTime() >= endTime.getTime()) { + payFeeDetailMonthInnerServiceSMOImpl.savePayFeeDetailMonths(payFeeDetailMonthPos); + return; + } + curDay = DateUtil.daysBetween(endTime, startMonthDayTime); + // todo 计算 应收 + curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); + // todo 保存数据到pay_fee_detail_month + toSavePayFeeDetailMonth(curMonthReceivableAmount.doubleValue(), 0, null, feeDto, payFeeMonthOwnerDto, payFeeDetailMonthPos, startMonthDayTime, deadlineTime); + payFeeDetailMonthInnerServiceSMOImpl.savePayFeeDetailMonths(payFeeDetailMonthPos); } private void doDispersedFeeDetail(FeeDetailDto feeDetailDto, FeeDto feeDto, PayFeeMonthOwnerDto diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java index ce9890d028..6232ee5f17 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java @@ -230,8 +230,10 @@ public class PayFeeMonthImpl implements IPayFeeMonth { //todo 处理 endTime 到 deadlineTime 的费用 - Date deadlineTime = computeFeeSMOImpl.getDeadlineTime(feeDto); - payFeeMonthHelp.waitDispersedOweFee(feeDto, payFeeMonthOwnerDto, feePrice, deadlineTime); + Map info = computeFeeSMOImpl.getTargetEndDateAndOweMonth(feeDto); + Date deadlineTime = (Date) info.get("targetEndDate"); + double oweMonth = (double)info.get("targetEndDate"); + payFeeMonthHelp.waitDispersedOweFee(feeDto, payFeeMonthOwnerDto, feePrice, deadlineTime,oweMonth); } -- Gitee From 0e20010f0e435352d840f8c985ad09c7c745a7f4 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 14 May 2025 17:09:22 +0000 Subject: [PATCH 18/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java index 6232ee5f17..43808f85fe 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java @@ -232,7 +232,7 @@ public class PayFeeMonthImpl implements IPayFeeMonth { //todo 处理 endTime 到 deadlineTime 的费用 Map info = computeFeeSMOImpl.getTargetEndDateAndOweMonth(feeDto); Date deadlineTime = (Date) info.get("targetEndDate"); - double oweMonth = (double)info.get("targetEndDate"); + double oweMonth = (double)info.get("oweMonth"); payFeeMonthHelp.waitDispersedOweFee(feeDto, payFeeMonthOwnerDto, feePrice, deadlineTime,oweMonth); } -- Gitee From 7115e74a69021c84c93a3fc9e65b75cea5da575e Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 14 May 2025 17:29:41 +0000 Subject: [PATCH 19/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../fee/feeMonth/IPayFeeMonthHelp.java | 2 +- .../java110/fee/feeMonth/PayFeeMonthHelp.java | 21 ++++++------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/IPayFeeMonthHelp.java b/service-fee/src/main/java/com/java110/fee/feeMonth/IPayFeeMonthHelp.java index 68d3501758..15f13d9f63 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/IPayFeeMonthHelp.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/IPayFeeMonthHelp.java @@ -30,5 +30,5 @@ public interface IPayFeeMonthHelp { * @param feePrice * @param deadlineTime */ - void waitDispersedOweFee(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice, Date deadlineTime,double owePrice); + void waitDispersedOweFee(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice, Date deadlineTime,double oweMonth); } diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java index c441b20ea3..ba40790119 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java @@ -97,17 +97,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); Double feePrice = Double.parseDouble(feePriceAll.get("feePrice").toString()); - //todo 如果是一次性费用 除以 -// if (!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getPayerObjType())) { -// return feePrice; -// } -// double maxMonth = Math.ceil(computeFeeSMOImpl.dayCompare(feeDto.getStartTime(), feeDto.getEndTime())); -// if (maxMonth <= 0) { -// return feePrice; -// -// } -// BigDecimal feePriceDec = new BigDecimal(feePrice).divide(new BigDecimal(maxMonth), 2, BigDecimal.ROUND_HALF_UP); -// feePrice = feePriceDec.doubleValue(); + return feePrice; } @@ -159,7 +149,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { * @param deadlineTime */ @Override - public void waitDispersedOweFee(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice, Date deadlineTime, double owePrice) { + public void waitDispersedOweFee(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice, Date deadlineTime, double oweMonth) { // todo 清理 detailId 为-1 的数据 @@ -178,7 +168,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { waitDispersedOweFeeCycleNormalMonth(feeDto,payFeeMonthOwnerDto,feePrice,deadlineTime); // 一次性或者非自然月处理 - waitDispersedOweFeeOnceUnNormalMonth(feeDto,payFeeMonthOwnerDto,deadlineTime,owePrice); + waitDispersedOweFeeOnceUnNormalMonth(feeDto,payFeeMonthOwnerDto,feePrice,deadlineTime,oweMonth); } @@ -272,7 +262,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { * @param deadlineTime * @param oweMonth */ - private void waitDispersedOweFeeOnceUnNormalMonth(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Date deadlineTime, double oweMonth) { + private void waitDispersedOweFeeOnceUnNormalMonth(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto,double feePrice, Date deadlineTime, double oweMonth) { // 不是一次性费用 并且是 自然月就返回 if(!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) && DateUtil.getMonthDay(feeDto.getStartTime()) == 1){ @@ -283,7 +273,8 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { Date startTime = DateUtil.timeToDate(feeDto.getEndTime()); Date endTime = DateUtil.deadTimeToDate(deadlineTime); - BigDecimal receivableAmount = new BigDecimal(oweMonth); + + BigDecimal receivableAmount = new BigDecimal(feePrice).multiply(new BigDecimal(oweMonth)).setScale(8,BigDecimal.ROUND_HALF_UP); BigDecimal dayReceivableAmount = null; -- Gitee From 6eff7f8d095d24cd30c35e7a686f0f16b7bfd6ed Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 14 May 2025 17:53:24 +0000 Subject: [PATCH 20/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=AE=97=E8=B4=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../src/main/java/com/java110/utils/util/DateUtil.java | 6 ++++++ .../main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/java110-utils/src/main/java/com/java110/utils/util/DateUtil.java b/java110-utils/src/main/java/com/java110/utils/util/DateUtil.java index 8ac38bf009..d44d00b51f 100755 --- a/java110-utils/src/main/java/com/java110/utils/util/DateUtil.java +++ b/java110-utils/src/main/java/com/java110/utils/util/DateUtil.java @@ -619,6 +619,12 @@ public class DateUtil { return calendar.get(Calendar.MONTH) + 1; } + public static int getDay(Date date) { + Calendar a = Calendar.getInstance(); + a.setTime(date); + return a.get(Calendar.DAY_OF_MONTH); + } + /** * 判断时间是否在时间段内 * diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java index ba40790119..de254d2d75 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java @@ -186,7 +186,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { return; } // 不是自然月 费用直接返回 - if(DateUtil.getMonthDay(feeDto.getStartTime()) !=1){ + if(DateUtil.getDay(feeDto.getStartTime()) !=1){ return; } List payFeeDetailMonthPos = new ArrayList<>(); @@ -265,7 +265,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { private void waitDispersedOweFeeOnceUnNormalMonth(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto,double feePrice, Date deadlineTime, double oweMonth) { // 不是一次性费用 并且是 自然月就返回 - if(!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) && DateUtil.getMonthDay(feeDto.getStartTime()) == 1){ + if(!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) && DateUtil.getDay(feeDto.getStartTime()) == 1){ return; } List payFeeDetailMonthPos = new ArrayList<>(); -- Gitee From e4b421a2a680a9e7cb5f7a9c0cab93eb43802d93 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Thu, 15 May 2025 14:38:27 +0000 Subject: [PATCH 21/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B0=B4=E7=94=B5?= =?UTF-8?q?=E8=B4=B9=E7=94=9F=E6=88=90=E6=8A=A5=E8=A1=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E5=87=86=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java index de254d2d75..290de26e5c 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java @@ -447,6 +447,9 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { getDiscountAmount(Double.parseDouble(tmpPayFeeDetailMonthPo.getReceivableAmount()), Double.parseDouble(tmpPayFeeDetailMonthPo.getReceivedAmount()), calendar.getTime(), feeDto) + ""); + if (feeDetailDto == null) { + tmpPayFeeDetailMonthPo.setDiscountAmount("0"); + } tmpPayFeeDetailMonthPo.setMonthId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_monthId, true)); tmpPayFeeDetailMonthPo.setRemark("程序计算生成"); tmpPayFeeDetailMonthPo.setObjName(payFeeMonthOwnerDto.getObjName()); -- Gitee From 3425f13eb7d49e41e8b76da8909490130c802edb Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Thu, 15 May 2025 14:51:21 +0000 Subject: [PATCH 22/27] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B0=B4=E7=94=B5?= =?UTF-8?q?=E6=8A=84=E8=A1=A8=20=E6=8A=A5=E8=A1=A8=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=B8=9A=E4=B8=BB=E4=BF=A1=E6=81=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../fee/cmd/meterWater/SaveMeterWaterCmd.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/service-fee/src/main/java/com/java110/fee/cmd/meterWater/SaveMeterWaterCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/meterWater/SaveMeterWaterCmd.java index 95cde64878..4c79dc393b 100644 --- a/service-fee/src/main/java/com/java110/fee/cmd/meterWater/SaveMeterWaterCmd.java +++ b/service-fee/src/main/java/com/java110/fee/cmd/meterWater/SaveMeterWaterCmd.java @@ -193,17 +193,14 @@ public class SaveMeterWaterCmd extends Cmd { reqJson.put("feeId", payFeePo.getFeeId()); addMeterWater(reqJson, roomList.get(0)); - int flag = payFeeV1InnerServiceSMOImpl.savePayFee(payFeePo); - if (flag < 1) { - throw new CmdException("保存数据失败"); - } + FeeAttrPo feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(reqJson.getString("communityId")); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME); feeAttrPo.setValue(reqJson.getString("curReadingTime")); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); - flag = feeAttrInnerServiceSMOImpl.saveFeeAttr(feeAttrPo); + int flag = feeAttrInnerServiceSMOImpl.saveFeeAttr(feeAttrPo); if (flag < 1) { throw new CmdException("保存数据失败"); } @@ -215,7 +212,7 @@ public class SaveMeterWaterCmd extends Cmd { feeAttrPo.setValue(roomList.get(0).getFloorNum() + "-" + roomList.get(0).getUnitNum() + "-" + roomList.get(0).getRoomNum()); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); - flag = feeAttrInnerServiceSMOImpl.saveFeeAttr(feeAttrPo); + flag = feeAttrInnerServiceSMOImpl.saveFeeAttr(feeAttrPo); if (flag < 1) { throw new CmdException("保存数据失败"); } @@ -225,7 +222,7 @@ public class SaveMeterWaterCmd extends Cmd { ownerDto.setRoomId(reqJson.getString("objId")); List ownerDtos = ownerInnerServiceSMOImpl.queryOwnersByRoom(ownerDto); - if (ownerDtos != null && ownerDtos.size() > 0) { + if (!ListUtil.isNull(ownerDtos)) { feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(reqJson.getString("communityId")); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_OWNER_ID); @@ -259,7 +256,10 @@ public class SaveMeterWaterCmd extends Cmd { throw new CmdException("保存数据失败"); } } - + flag = payFeeV1InnerServiceSMOImpl.savePayFee(payFeePo); + if (flag < 1) { + throw new CmdException("保存数据失败"); + } } cmdDataFlowContext.setResponseEntity(ResultVo.success()); } -- Gitee From 20258410be0cef929131ec45b9b1c8661f1ff234 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Thu, 15 May 2025 15:40:17 +0000 Subject: [PATCH 23/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9D=9E=E8=87=AA?= =?UTF-8?q?=E7=84=B6=E6=9C=88=E5=AE=9E=E6=94=B6=E6=8C=89=E5=A4=A9=E8=AE=A1?= =?UTF-8?q?=E7=AE=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../java110/fee/feeMonth/PayFeeMonthHelp.java | 144 +++++++++++++++--- 1 file changed, 124 insertions(+), 20 deletions(-) diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java index 290de26e5c..e5b7e90c1d 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java @@ -135,7 +135,15 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { for (FeeDetailDto feeDetailDto : feeDetailDtos) { // todo 逐条去离散 - doDispersedFeeDetail(feeDetailDto, feeDto, payFeeMonthOwnerDto, feePrice); + try { + // 自然月实收处理 + doDispersedFeeDetailNormalMonth(feeDetailDto, feeDto, payFeeMonthOwnerDto, feePrice); + + //非自然月或者一次性费用处理已经交过费的 + doDispersedFeeDetailUnNormalMonth(feeDetailDto, feeDto, payFeeMonthOwnerDto, feePrice); + }catch (Exception e){ + e.printStackTrace(); + } } } @@ -165,10 +173,10 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { } // 自然月周期性费用计算 - waitDispersedOweFeeCycleNormalMonth(feeDto,payFeeMonthOwnerDto,feePrice,deadlineTime); + waitDispersedOweFeeCycleNormalMonth(feeDto, payFeeMonthOwnerDto, feePrice, deadlineTime); // 一次性或者非自然月处理 - waitDispersedOweFeeOnceUnNormalMonth(feeDto,payFeeMonthOwnerDto,feePrice,deadlineTime,oweMonth); + waitDispersedOweFeeOnceUnNormalMonth(feeDto, payFeeMonthOwnerDto, feePrice, deadlineTime, oweMonth); } @@ -186,7 +194,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { return; } // 不是自然月 费用直接返回 - if(DateUtil.getDay(feeDto.getStartTime()) !=1){ + if (DateUtil.getDay(feeDto.getStartTime()) != 1) { return; } List payFeeDetailMonthPos = new ArrayList<>(); @@ -257,15 +265,16 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { /** * 一次性或者非自然月处理 + * * @param feeDto * @param payFeeMonthOwnerDto * @param deadlineTime * @param oweMonth */ - private void waitDispersedOweFeeOnceUnNormalMonth(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto,double feePrice, Date deadlineTime, double oweMonth) { + private void waitDispersedOweFeeOnceUnNormalMonth(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, double feePrice, Date deadlineTime, double oweMonth) { // 不是一次性费用 并且是 自然月就返回 - if(!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) && DateUtil.getDay(feeDto.getStartTime()) == 1){ + if (!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) && DateUtil.getDay(feeDto.getStartTime()) == 1) { return; } List payFeeDetailMonthPos = new ArrayList<>(); @@ -274,7 +283,7 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { Date endTime = DateUtil.deadTimeToDate(deadlineTime); - BigDecimal receivableAmount = new BigDecimal(feePrice).multiply(new BigDecimal(oweMonth)).setScale(8,BigDecimal.ROUND_HALF_UP); + BigDecimal receivableAmount = new BigDecimal(feePrice).multiply(new BigDecimal(oweMonth)).setScale(8, BigDecimal.ROUND_HALF_UP); BigDecimal dayReceivableAmount = null; @@ -325,8 +334,27 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { payFeeDetailMonthInnerServiceSMOImpl.savePayFeeDetailMonths(payFeeDetailMonthPos); } - private void doDispersedFeeDetail(FeeDetailDto feeDetailDto, FeeDto feeDto, PayFeeMonthOwnerDto + + + + /** + * 自然月处理已经交过费的 + * + * @param feeDetailDto + * @param feeDto + * @param payFeeMonthOwnerDto + * @param feePrice + */ + private void doDispersedFeeDetailNormalMonth(FeeDetailDto feeDetailDto, FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice) { + // 一次性费用直接返回 + if (FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { + return; + } + // 不是自然月 费用直接返回 + if (DateUtil.getDay(feeDto.getStartTime()) != 1) { + return; + } List payFeeDetailMonthPos = new ArrayList<>(); // todo 去除 开始时间和 结束时间的 小时 分钟 秒 @@ -344,8 +372,8 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { BigDecimal receivableAmount = new BigDecimal(feePrice + ""); BigDecimal receivedAmount = new BigDecimal(Double.parseDouble(feeDetailDto.getReceivedAmount())); - BigDecimal dayReceivableAmount = receivableAmount.divide(new BigDecimal(day), 8, BigDecimal.ROUND_HALF_UP);// 日 应收 - BigDecimal dayReceivedAmount = receivedAmount.divide(new BigDecimal(day), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + BigDecimal dayReceivableAmount = null; + BigDecimal dayReceivedAmount = null; // todo 寻找第一个自然月 一日 Calendar firstMonthDayCal = Calendar.getInstance(); @@ -366,11 +394,9 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { Calendar calendar = Calendar.getInstance(); calendar.setTime(startMonthDayTime); curMonthMaxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - if (!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { - dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - dayReceivedAmount = receivedAmount.divide(new BigDecimal(month + ""), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - dayReceivedAmount = dayReceivedAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - } + dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + dayReceivedAmount = receivedAmount.divide(new BigDecimal(month + ""), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + dayReceivedAmount = dayReceivedAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 // todo 计算 应收 curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); // todo 计算 实收 @@ -395,11 +421,90 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { Calendar calendar = Calendar.getInstance(); calendar.setTime(startMonthDayTime); curMonthMaxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - if (!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { - dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - dayReceivedAmount = receivedAmount.divide(new BigDecimal(month + ""), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - dayReceivedAmount = dayReceivedAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + dayReceivedAmount = receivedAmount.divide(new BigDecimal(month + ""), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + dayReceivedAmount = dayReceivedAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + + // todo 计算 应收 + curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); + // todo 计算 实收 + curMonthReceivedAmount = new BigDecimal(curDay).multiply(dayReceivedAmount).setScale(4, BigDecimal.ROUND_HALF_UP); + + // todo 保存数据到pay_fee_detail_month + toSavePayFeeDetailMonth(curMonthReceivableAmount.doubleValue(), curMonthReceivedAmount.doubleValue(), feeDetailDto, feeDto, payFeeMonthOwnerDto, payFeeDetailMonthPos, startMonthDayTime, endTime); + payFeeDetailMonthInnerServiceSMOImpl.savePayFeeDetailMonths(payFeeDetailMonthPos); + } + + + /** + * 非自然月或者一次性费用处理已经交过费的 + * + * @param feeDetailDto + * @param feeDto + * @param payFeeMonthOwnerDto + * @param feePrice + */ + private void doDispersedFeeDetailUnNormalMonth(FeeDetailDto feeDetailDto, FeeDto feeDto, PayFeeMonthOwnerDto + payFeeMonthOwnerDto, Double feePrice) { + // 不是一次性费用 并且是 自然月就返回 + if (!FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) && DateUtil.getDay(feeDto.getStartTime()) == 1) { + return; + } + + List payFeeDetailMonthPos = new ArrayList<>(); + + // todo 去除 开始时间和 结束时间的 小时 分钟 秒 + Date startTime = DateUtil.timeToDate(feeDetailDto.getStartTime()); + Date endTime = feeDetailDto.getEndTime(); + endTime = DateUtil.getNextSecDateTime(endTime); + endTime = DateUtil.timeToDate(endTime); + + int day = DateUtil.daysBetween(endTime, startTime); + if (day < 1) { + day = 1; } + + BigDecimal receivableAmount = new BigDecimal(feeDetailDto.getReceivableAmount()); + BigDecimal receivedAmount = new BigDecimal(feeDetailDto.getReceivedAmount()); + + BigDecimal dayReceivableAmount = receivableAmount.divide(new BigDecimal(day), 8, BigDecimal.ROUND_HALF_UP);// 日 应收 + BigDecimal dayReceivedAmount = receivedAmount.divide(new BigDecimal(day), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + + // todo 寻找第一个自然月 一日 + Calendar firstMonthDayCal = Calendar.getInstance(); + firstMonthDayCal.setTime(startTime); + firstMonthDayCal.add(Calendar.MONTH, 1); + firstMonthDayCal.set(Calendar.DAY_OF_MONTH, 1); + Date firstMonthDayTime = firstMonthDayCal.getTime(); + + Date startMonthDayTime = startTime; + // todo 循环,只到 firstMonthDayTime 大于 endTime + int curDay = 0; + BigDecimal curMonthReceivableAmount = null; + BigDecimal curMonthReceivedAmount = null; + int curMonthMaxDay = 30; + while (firstMonthDayTime.getTime() < endTime.getTime()) { + curDay = DateUtil.daysBetween(firstMonthDayTime, startMonthDayTime); + // todo 计算 应收 + curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); + // todo 计算 实收 + curMonthReceivedAmount = new BigDecimal(curDay).multiply(dayReceivedAmount).setScale(4, BigDecimal.ROUND_HALF_UP); + // todo 保存数据到pay_fee_detail_month + toSavePayFeeDetailMonth(curMonthReceivableAmount.doubleValue(), curMonthReceivedAmount.doubleValue(), feeDetailDto, feeDto, payFeeMonthOwnerDto, payFeeDetailMonthPos, startMonthDayTime, endTime); + + // todo 将startTime 修改为 下月1日时间 + startMonthDayTime = firstMonthDayTime; + firstMonthDayCal.add(Calendar.MONTH, 1); + firstMonthDayTime = firstMonthDayCal.getTime(); + } + + //todo 最后处理 最后 startMonthDayTime 到endTime 的 + if (startMonthDayTime.getTime() >= endTime.getTime()) { + payFeeDetailMonthInnerServiceSMOImpl.savePayFeeDetailMonths(payFeeDetailMonthPos); + return; + } + + curDay = DateUtil.daysBetween(endTime, startMonthDayTime); // todo 计算 应收 curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); // todo 计算 实收 @@ -410,7 +515,6 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { payFeeDetailMonthInnerServiceSMOImpl.savePayFeeDetailMonths(payFeeDetailMonthPos); } - /** * 保存数据 * -- Gitee From 086e1d0e91d7d64d0e7667cbabbed3fc45b338c9 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Thu, 15 May 2025 16:32:58 +0000 Subject: [PATCH 24/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=9E=E7=BC=B4?= =?UTF-8?q?=E5=BD=B1=E5=93=8D=E8=87=AA=E7=84=B6=E6=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../java110/fee/feeMonth/PayFeeMonthHelp.java | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java index e5b7e90c1d..7244c9dce7 100644 --- a/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java +++ b/service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java @@ -369,8 +369,10 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { } double month = DateUtil.dayCompare(feeDetailDto.getStartTime(), feeDetailDto.getEndTime(), true); - BigDecimal receivableAmount = new BigDecimal(feePrice + ""); - BigDecimal receivedAmount = new BigDecimal(Double.parseDouble(feeDetailDto.getReceivedAmount())); + BigDecimal receivableAmount = new BigDecimal(feeDetailDto.getReceivableAmount()); + BigDecimal receivedAmount = new BigDecimal(feeDetailDto.getReceivedAmount()); + BigDecimal monthReceivableAmount = receivableAmount.divide(new BigDecimal(month + ""), 8, BigDecimal.ROUND_HALF_UP); + BigDecimal monthReceivedAmount = receivedAmount.divide(new BigDecimal(month + ""), 8, BigDecimal.ROUND_HALF_UP); BigDecimal dayReceivableAmount = null; BigDecimal dayReceivedAmount = null; @@ -394,13 +396,18 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { Calendar calendar = Calendar.getInstance(); calendar.setTime(startMonthDayTime); curMonthMaxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - dayReceivedAmount = receivedAmount.divide(new BigDecimal(month + ""), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - dayReceivedAmount = dayReceivedAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + dayReceivableAmount = monthReceivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + dayReceivedAmount = monthReceivedAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 // todo 计算 应收 curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); // todo 计算 实收 curMonthReceivedAmount = new BigDecimal(curDay).multiply(dayReceivedAmount).setScale(4, BigDecimal.ROUND_HALF_UP); + if(curMonthReceivableAmount.doubleValue() > receivableAmount.doubleValue()){ + curMonthReceivableAmount = receivableAmount; + } + if(curMonthReceivedAmount.doubleValue() > receivedAmount.doubleValue()){ + curMonthReceivedAmount = receivedAmount; + } // todo 保存数据到pay_fee_detail_month toSavePayFeeDetailMonth(curMonthReceivableAmount.doubleValue(), curMonthReceivedAmount.doubleValue(), feeDetailDto, feeDto, payFeeMonthOwnerDto, payFeeDetailMonthPos, startMonthDayTime, endTime); @@ -408,6 +415,9 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { startMonthDayTime = firstMonthDayTime; firstMonthDayCal.add(Calendar.MONTH, 1); firstMonthDayTime = firstMonthDayCal.getTime(); + + receivableAmount = receivableAmount.subtract(curMonthReceivableAmount); + receivedAmount = receivedAmount.subtract(curMonthReceivedAmount); } //todo 最后处理 最后 startMonthDayTime 到endTime 的 @@ -421,15 +431,21 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp { Calendar calendar = Calendar.getInstance(); calendar.setTime(startMonthDayTime); curMonthMaxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - dayReceivableAmount = receivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - dayReceivedAmount = receivedAmount.divide(new BigDecimal(month + ""), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 - dayReceivedAmount = dayReceivedAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + dayReceivableAmount = monthReceivableAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 + dayReceivedAmount = monthReceivedAmount.divide(new BigDecimal(curMonthMaxDay), 8, BigDecimal.ROUND_HALF_UP);// 日 实收 // todo 计算 应收 curMonthReceivableAmount = new BigDecimal(curDay).multiply(dayReceivableAmount).setScale(4, BigDecimal.ROUND_HALF_UP); // todo 计算 实收 curMonthReceivedAmount = new BigDecimal(curDay).multiply(dayReceivedAmount).setScale(4, BigDecimal.ROUND_HALF_UP); + if(curMonthReceivableAmount.doubleValue() > receivableAmount.doubleValue()){ + curMonthReceivableAmount = receivableAmount; + } + if(curMonthReceivedAmount.doubleValue() > receivedAmount.doubleValue()){ + curMonthReceivedAmount = receivedAmount; + } + // todo 保存数据到pay_fee_detail_month toSavePayFeeDetailMonth(curMonthReceivableAmount.doubleValue(), curMonthReceivedAmount.doubleValue(), feeDetailDto, feeDto, payFeeMonthOwnerDto, payFeeDetailMonthPos, startMonthDayTime, endTime); payFeeDetailMonthInnerServiceSMOImpl.savePayFeeDetailMonths(payFeeDetailMonthPos); -- Gitee From 64e4b5bb1474f28d7d5513e6f7cb89deab7eb140 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Tue, 27 May 2025 09:31:35 +0000 Subject: [PATCH 25/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E9=80=80=E5=8D=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../java110/community/cmd/ownerRepair/RepairDispatchCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairDispatchCmd.java b/service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairDispatchCmd.java index 7c4ef5d692..229d0b6cfc 100644 --- a/service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairDispatchCmd.java +++ b/service-community/src/main/java/com/java110/community/cmd/ownerRepair/RepairDispatchCmd.java @@ -168,7 +168,7 @@ public class RepairDispatchCmd extends Cmd { repairUserDto.setStates(new String[]{RepairUserDto.STATE_DOING,RepairUserDto.STATE_EVALUATE}); repairUserDto.setStaffId(reqJson.getString("userId")); List repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); - if (!ListUtil.isNull(repairUserDtos)) { + if (ListUtil.isNull(repairUserDtos)) { ResponseEntity responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "当前用户没有需要处理订单!"); context.setResponseEntity(responseEntity); return; -- Gitee From 45102fc13900aad6d117b00a4feeeafe9c3f5fee Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Tue, 27 May 2025 13:04:09 +0000 Subject: [PATCH 26/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=B8=9A=E4=B8=BB=E6=88=90=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: java110 <928255095@qq.com> --- .../java110/user/cmd/owner/QueryAppOwnerMembersCmd.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/service-user/src/main/java/com/java110/user/cmd/owner/QueryAppOwnerMembersCmd.java b/service-user/src/main/java/com/java110/user/cmd/owner/QueryAppOwnerMembersCmd.java index a4eeb6b027..2684cfa804 100644 --- a/service-user/src/main/java/com/java110/user/cmd/owner/QueryAppOwnerMembersCmd.java +++ b/service-user/src/main/java/com/java110/user/cmd/owner/QueryAppOwnerMembersCmd.java @@ -21,6 +21,7 @@ import com.java110.utils.util.Assert; import com.java110.utils.util.BeanConvertUtil; import com.java110.utils.util.ListUtil; import com.java110.utils.util.StringUtil; +import com.java110.vo.ResultVo; import com.java110.vo.api.ApiOwnerDataVo; import com.java110.vo.api.ApiOwnerVo; import org.springframework.beans.factory.annotation.Autowired; @@ -112,13 +113,7 @@ public class QueryAppOwnerMembersCmd extends Cmd { ownerDtoList = new ArrayList<>(); } - - ApiOwnerVo apiOwnerVo = new ApiOwnerVo(); - apiOwnerVo.setOwners(BeanConvertUtil.covertBeanList(ownerDtoList, ApiOwnerDataVo.class)); - apiOwnerVo.setTotal(total); - apiOwnerVo.setRecords((int) Math.ceil((double) total / (double) row)); - - ResponseEntity responseEntity = new ResponseEntity(JSONObject.toJSONString(apiOwnerVo), HttpStatus.OK); + ResponseEntity responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) total / (double) row), total, ownerDtoList); context.setResponseEntity(responseEntity); } } -- Gitee From f346b7321249c76cb01e4562634b72458e6a8391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=94=E7=BA=B2?= Date: Fri, 6 Jun 2025 17:19:56 +0800 Subject: [PATCH 27/27] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=A4=9A?= =?UTF-8?q?=E5=A4=84=E5=8F=AF=E8=83=BD=E5=AF=BC=E8=87=B4=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E7=9A=84=E4=B8=8D=E5=AE=89=E5=85=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/java110/core/client/FtpUploadTemplate.java | 6 ++++-- .../com/java110/core/client/OutRestTemplate.java | 13 ++----------- .../java110/core/event/app/AppEventPublishing.java | 2 +- .../com/java110/core/factory/DataFlowFactory.java | 6 +++++- .../com/java110/core/factory/PaymentFactory.java | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/java110-core/src/main/java/com/java110/core/client/FtpUploadTemplate.java b/java110-core/src/main/java/com/java110/core/client/FtpUploadTemplate.java index 8e8cd60310..0d5d2777da 100755 --- a/java110-core/src/main/java/com/java110/core/client/FtpUploadTemplate.java +++ b/java110-core/src/main/java/com/java110/core/client/FtpUploadTemplate.java @@ -155,7 +155,8 @@ public class FtpUploadTemplate { throw new IllegalArgumentException("上传文件失败"); } finally { try { - ftpClient.disconnect(); + // 先判空再调用 + if (ftpClient != null) ftpClient.disconnect(); } catch (IOException e) { e.printStackTrace(); } @@ -210,7 +211,8 @@ public class FtpUploadTemplate { throw new IllegalArgumentException("上传文件失败"); } finally { try { - ftpClient.disconnect(); + // 先判空再调用 + if (ftpClient != null) ftpClient.disconnect(); } catch (IOException e) { e.printStackTrace(); } diff --git a/java110-core/src/main/java/com/java110/core/client/OutRestTemplate.java b/java110-core/src/main/java/com/java110/core/client/OutRestTemplate.java index b3e959f76e..4fafad5697 100644 --- a/java110-core/src/main/java/com/java110/core/client/OutRestTemplate.java +++ b/java110-core/src/main/java/com/java110/core/client/OutRestTemplate.java @@ -1,18 +1,9 @@ package com.java110.core.client; -import com.java110.core.factory.GenerateCodeFactory; import com.java110.core.factory.LogFactory; import com.java110.core.log.LoggerFactory; -import com.java110.dto.log.TransactionOutLogDto; -import com.java110.intf.common.ITransactionOutLogV1ServiceSMO; -import com.java110.po.log.TransactionOutLogPo; -import com.java110.utils.cache.MappingCache; -import com.java110.utils.constant.MappingConstant; -import com.java110.utils.constant.ServiceConstant; -import com.java110.utils.factory.ApplicationContextFactory; import com.java110.utils.util.DateUtil; import com.java110.utils.util.ExceptionUtil; -import com.java110.utils.util.StringUtil; import org.slf4j.Logger; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; @@ -22,7 +13,6 @@ import org.springframework.lang.Nullable; import org.springframework.web.client.HttpStatusCodeException; import org.springframework.web.client.RestClientException; -import java.net.URI; import java.util.Date; /** @@ -107,7 +97,8 @@ public class OutRestTemplate extends RestTemplate { } // saveLog(url, "POST", null, tmpResponseEntity, DateUtil.getCurrentDate().getTime() - startTime.getTime()); - LogFactory.saveOutLog(url, "POST", DateUtil.getCurrentDate().getTime() - startTime.getTime(), null, request.toString(), tmpResponseEntity); + LogFactory.saveOutLog(url, "POST", DateUtil.getCurrentDate().getTime() - startTime.getTime(), + null, request != null ? request.toString() : "" , tmpResponseEntity); } return responseEntity; } diff --git a/java110-core/src/main/java/com/java110/core/event/app/AppEventPublishing.java b/java110-core/src/main/java/com/java110/core/event/app/AppEventPublishing.java index d0a6949b54..525ce7a991 100755 --- a/java110-core/src/main/java/com/java110/core/event/app/AppEventPublishing.java +++ b/java110-core/src/main/java/com/java110/core/event/app/AppEventPublishing.java @@ -71,7 +71,7 @@ public class AppEventPublishing extends LoggerEngine{ */ public static List> getListeners(String interfaceClassName){ - Assert.isNull(interfaceClassName,"获取需要发布的事件处理侦听时,传递事件为空,请检查"); + Assert.notNull(interfaceClassName, "获取需要发布的事件处理侦听时,传递事件为空,请检查"); //先从缓存中获取,为了提升效率 if(cacheListenersMap.containsKey(interfaceClassName)){ diff --git a/java110-core/src/main/java/com/java110/core/factory/DataFlowFactory.java b/java110-core/src/main/java/com/java110/core/factory/DataFlowFactory.java index cc2c0d09ef..2807c05b4c 100755 --- a/java110-core/src/main/java/com/java110/core/factory/DataFlowFactory.java +++ b/java110-core/src/main/java/com/java110/core/factory/DataFlowFactory.java @@ -287,7 +287,11 @@ public class DataFlowFactory { business.setbId(GenerateCodeFactory.getBId()); busiMap = new HashMap(); busiMap.put("oId",dataFlow.getoId()); - busiMap.put("businessTypeCd",getService(dataFlow,business.getServiceCode()).getBusinessTypeCd()); + AppService service = getService(dataFlow, business.getServiceCode()); + if (service == null) { + throw new NullPointerException("getService() returned null, unable to getBusinessTypeCd"); + } + busiMap.put("businessTypeCd", service.getBusinessTypeCd()); busiMap.put("remark",business.getRemark()); busiMap.put("statusCd",StatusConstant.STATUS_CD_SAVE); busiMap.put("bId",business.getbId()); diff --git a/java110-core/src/main/java/com/java110/core/factory/PaymentFactory.java b/java110-core/src/main/java/com/java110/core/factory/PaymentFactory.java index be09103a4b..18893456a4 100755 --- a/java110-core/src/main/java/com/java110/core/factory/PaymentFactory.java +++ b/java110-core/src/main/java/com/java110/core/factory/PaymentFactory.java @@ -49,7 +49,7 @@ public class PaymentFactory { InetAddress ia = null; String localip = null; try { - ia = ia.getLocalHost(); + ia = InetAddress.getLocalHost(); localip = ia.getHostAddress(); } catch (Exception e) { e.printStackTrace(); -- Gitee