结算月结明细编组功能

This commit is contained in:
liang.chao 2024-08-26 10:44:59 +08:00
parent ab5b90b85d
commit d1aa5f26e6
2 changed files with 10 additions and 7 deletions

View File

@ -28,10 +28,8 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author c liu
@ -437,8 +435,12 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
List<SltAgreementInfo> monthCosts = calMonthlyMapper.getMonthCosts(agreementInfo);
int num = 0;
for (SltAgreementInfo monthCost : monthCosts) {
List<SltAgreementInfo> monthDetails = new ArrayList<>();
monthCost.setCodeNum(num++);
List<SltAgreementInfo> monthDetails = calMonthlyMapper.getMonthDetails(monthCost);
for (String id : monthCost.getIds().split(",")) {
monthCost.setId(Long.parseLong(id));
monthDetails.addAll(calMonthlyMapper.getMonthDetails(monthCost));
}
monthCost.setNode(monthDetails);
}
return monthCosts;

View File

@ -28,13 +28,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMonthCosts" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
SELECT
pmc.id as id,
GROUP_CONCAT(pmc.id) as ids,
bui.unit_name AS unitName,
bp.lot_name AS projectName,
spm.month as month,
pmc.agreement_id as agreementId,
pmc.cost_bearing_party as costBearingParty,
pmc.costs as costs
SUM(pmc.costs) as costs
FROM
project_month_costs pmc
LEFT JOIN slt_project_month spm ON pmc.task_id = spm.id
@ -49,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="costBearingParty != null and costBearingParty != ''">
and pmc.cost_bearing_party = #{costBearingParty}
</if>
GROUP BY spm.month,pmc.cost_bearing_party
</select>
<select id="getMonthDetails" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
SELECT