From 12921287b624b97c134bc400876f26b281e49cac Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Tue, 6 Aug 2024 15:58:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E7=AE=A1=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/mapper/CalMonthlyMapper.java | 5 ++-- .../service/SltAgreementInfoService.java | 3 ++- .../impl/SltAgreementInfoServiceImpl.java | 18 ++++++------- .../mapper/material/CalMonthlyMapper.xml | 25 ++++++++++--------- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/CalMonthlyMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/CalMonthlyMapper.java index bf86eb29..ffdc51f4 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/CalMonthlyMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/CalMonthlyMapper.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.material.mapper; +import com.bonus.sgzb.base.api.domain.SltAgreementInfo; import com.bonus.sgzb.material.domain.AgreementInfo; import com.bonus.sgzb.material.domain.CalMonthlyBean; import com.bonus.sgzb.material.domain.ProjectMonthCosts; @@ -35,7 +36,7 @@ public interface CalMonthlyMapper { int updateProMonCosts(ProjectMonthCosts pmcId); - List getMonthCosts(AgreementInfo agreementInfo); + List getMonthCosts(AgreementInfo agreementInfo); - List getMonthDetails(ProjectMonthCosts monthCost); + List getMonthDetails(SltAgreementInfo monthCost); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java index 25b6998c..95c5750a 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java @@ -5,6 +5,7 @@ import com.bonus.sgzb.base.api.domain.SltAgreementInfo; import com.bonus.sgzb.base.api.domain.SltInfoVo; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.material.domain.AgreementInfo; +import org.apache.poi.ss.formula.functions.T; import org.springframework.stereotype.Service; import java.util.List; @@ -39,7 +40,7 @@ public interface SltAgreementInfoService { int updateTrimDay(List sltAgreementInfo); - List getSltInfoMonth(List list); + List getSltInfoMonth(List list); int updateOutSourceCosts(SltAgreementInfo sltAgreementInfo); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java index 775cb131..f1df1ef8 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java @@ -20,6 +20,7 @@ import com.bonus.sgzb.material.mapper.SltAgreementInfoMapper; import com.bonus.sgzb.material.service.SltAgreementInfoService; import com.bonus.sgzb.material.vo.GlobalContants; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.formula.functions.T; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -406,7 +407,6 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { @Override public List getSltInfoMonth(List list) { List leaseListMonth = new ArrayList<>(); - List monthCostsList = new ArrayList<>(); Integer num = 0; //租赁费用列表 for (AgreementInfo agreementInfo : list) { @@ -414,21 +414,19 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { if (agreementInfo.getStartTime() == null || DateTimeHelper.getNowMonth().equals(DateTimeHelper.getNowMonth(DateTimeHelper.parse(agreementInfo.getEndTime(), "yyyy-MM")))) { List listMonth = getLeaseListMonth(agreementInfo, num); leaseListMonth.addAll(listMonth); - return leaseListMonth; } else { // 查定时任务记录的数据 - List listMonth = getLeaseJobListMonth(agreementInfo); - monthCostsList.addAll(listMonth); - return monthCostsList; + List listMonth = getLeaseJobListMonth(agreementInfo); + leaseListMonth.addAll(listMonth); } } - return new ArrayList<>(); + return leaseListMonth; } - private List getLeaseJobListMonth(AgreementInfo agreementInfo) { - List monthCosts = calMonthlyMapper.getMonthCosts(agreementInfo); - for (ProjectMonthCosts monthCost : monthCosts) { - List monthDetails = calMonthlyMapper.getMonthDetails(monthCost); + private List getLeaseJobListMonth(AgreementInfo agreementInfo) { + List monthCosts = calMonthlyMapper.getMonthCosts(agreementInfo); + for (SltAgreementInfo monthCost : monthCosts) { + List monthDetails = calMonthlyMapper.getMonthDetails(monthCost); monthCost.setNode(monthDetails); } return monthCosts; diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/CalMonthlyMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/CalMonthlyMapper.xml index 62ec96da..b7c145b9 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/CalMonthlyMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/CalMonthlyMapper.xml @@ -25,7 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id,month from calc_project_month where month = #{month} - SELECT pmc.id as id, bui.unit_name AS unitName, @@ -35,14 +36,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" pmc.costs as costs FROM project_month_costs pmc - LEFT JOIN slt_project_month spm ON pmc.slt_month_id = spm.id - LEFT JOIN bm_agreement_info bai ON pmc.agreement_id = bai.agreement_id - LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id - LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id + LEFT JOIN slt_project_month spm ON pmc.slt_month_id = spm.id + LEFT JOIN bm_agreement_info bai ON pmc.agreement_id = bai.agreement_id + LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id + LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id WHERE spm.month = DATE_FORMAT(#{endTime}, '%Y-%m') - SELECT mt1.type_name AS typeName, mt.type_name AS modelName, @@ -60,12 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" pmd.month_temporarily_costs as realCosts FROM project_month_detail pmd - LEFT JOIN project_month_costs pmc ON pmd.pro_month_cost_id = pmc.id - LEFT JOIN bm_unit_info bui ON bui.unit_id = pmc.unit_id - LEFT JOIN bm_project_lot bp ON bp.lot_id = pmc.project_id - LEFT JOIN ma_type mt ON pmd.type_id = mt.type_id - LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id - LEFT JOIN ma_machine mm ON mm.ma_id = pmd.ma_id + LEFT JOIN project_month_costs pmc ON pmd.pro_month_cost_id = pmc.id + LEFT JOIN bm_unit_info bui ON bui.unit_id = pmc.unit_id + LEFT JOIN bm_project_lot bp ON bp.lot_id = pmc.project_id + LEFT JOIN ma_type mt ON pmd.type_id = mt.type_id + LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id + LEFT JOIN ma_machine mm ON mm.ma_id = pmd.ma_id WHERE pmc.id = #{id}