结算管理功能开发

This commit is contained in:
liang.chao 2024-08-06 15:58:03 +08:00
parent 23e4885815
commit 12921287b6
4 changed files with 26 additions and 25 deletions

View File

@ -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<ProjectMonthCosts> getMonthCosts(AgreementInfo agreementInfo);
List<SltAgreementInfo> getMonthCosts(AgreementInfo agreementInfo);
List<ProjectMonthDetail> getMonthDetails(ProjectMonthCosts monthCost);
List<SltAgreementInfo> getMonthDetails(SltAgreementInfo monthCost);
}

View File

@ -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> sltAgreementInfo);
List<SltAgreementInfo> getSltInfoMonth(List<AgreementInfo> list);
List getSltInfoMonth(List<AgreementInfo> list);
int updateOutSourceCosts(SltAgreementInfo sltAgreementInfo);
}

View File

@ -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<AgreementInfo> list) {
List<SltAgreementInfo> leaseListMonth = new ArrayList<>();
List<ProjectMonthCosts> 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<SltAgreementInfo> listMonth = getLeaseListMonth(agreementInfo, num);
leaseListMonth.addAll(listMonth);
return leaseListMonth;
} else {
// 查定时任务记录的数据
List<ProjectMonthCosts> listMonth = getLeaseJobListMonth(agreementInfo);
monthCostsList.addAll(listMonth);
return monthCostsList;
List<SltAgreementInfo> listMonth = getLeaseJobListMonth(agreementInfo);
leaseListMonth.addAll(listMonth);
}
}
return new ArrayList<>();
return leaseListMonth;
}
private List<ProjectMonthCosts> getLeaseJobListMonth(AgreementInfo agreementInfo) {
List<ProjectMonthCosts> monthCosts = calMonthlyMapper.getMonthCosts(agreementInfo);
for (ProjectMonthCosts monthCost : monthCosts) {
List<ProjectMonthDetail> monthDetails = calMonthlyMapper.getMonthDetails(monthCost);
private List<SltAgreementInfo> getLeaseJobListMonth(AgreementInfo agreementInfo) {
List<SltAgreementInfo> monthCosts = calMonthlyMapper.getMonthCosts(agreementInfo);
for (SltAgreementInfo monthCost : monthCosts) {
List<SltAgreementInfo> monthDetails = calMonthlyMapper.getMonthDetails(monthCost);
monthCost.setNode(monthDetails);
}
return monthCosts;

View File

@ -25,7 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id,month from calc_project_month
where month = #{month}
</select>
<select id="getMonthCosts" resultType="com.bonus.sgzb.material.domain.ProjectMonthCosts">
<select id="getMonthCosts" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
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>
<select id="getMonthDetails" resultType="com.bonus.sgzb.material.domain.ProjectMonthDetail">
<select id="getMonthDetails" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
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}
</select>