南网结算审核功能新增

This commit is contained in:
liang.chao 2024-08-23 11:20:57 +08:00
parent 0dfd32755a
commit 693d3f2907
2 changed files with 13 additions and 37 deletions

View File

@ -136,30 +136,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
@Override @Override
@Transactional @Transactional
public int settlementReview(SltAgreementApply apply) { public int settlementReview(SltAgreementApply apply) {
Long userid = SecurityUtils.getLoginUser().getUserid();
apply.setAuditor(String.valueOf(userid));
int i = sltAgreementInfoMapper.updateRelation(apply); int i = sltAgreementInfoMapper.updateRelation(apply);
int j = 0; return i;
if (i > 0) {
List<SltAgreementRelation> relations = sltAgreementInfoMapper.getRelations(apply);
List<AgreementInfo> infos = new ArrayList<>();
for (SltAgreementRelation bean : relations) {
AgreementInfo info = new AgreementInfo();
info.setAgreementId(Long.valueOf(bean.getAgreementId()));
infos.add(info);
}
List<SltAgreementInfo> loseList = getLoseList(infos);
for (SltAgreementInfo agreementInfo : loseList) {
if (agreementInfo.getMaId() != null && agreementInfo.getMaId().isEmpty()) {
sltAgreementInfoMapper.updateMaStatus(agreementInfo);
}
}
j = sltAgreementInfoMapper.updateApply(apply);
} else {
throw new ServiceException("结算审核失败");
//throw new ServiceException(ExceptionDict.SETTLEMENT_REVIEW_ERROR_MSG,ExceptionDict.SETTLEMENT_REVIEW_ERROR);
}
return j;
} }
@Override @Override

View File

@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateRelation"> <update id="updateRelation">
update slt_agreement_relation update slt_agreement_relation
set status = #{status} set status = #{status}
where apply_id = #{id} where agreement_id = #{agreementId}
</update> </update>
<update id="updateApply"> <update id="updateApply">
update slt_agreement_apply update slt_agreement_apply
@ -265,16 +265,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(*) from slt_agreement_apply where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') select count(*) from slt_agreement_apply where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m')
</select> </select>
<select id="getSltExam" resultType="com.bonus.sgzb.base.api.domain.SltAgreementApply"> <select id="getSltExam" resultType="com.bonus.sgzb.base.api.domain.SltAgreementApply">
select saa.id, SELECT
saa.code, sar.agreement_id AS agreementId,
GROUP_CONCAT(DISTINCT sar.agreement_id) as agreementId, bui.unit_name AS unitName,
GROUP_CONCAT(DISTINCT bui.unit_name) as unitName, bp.lot_name AS projectName,
GROUP_CONCAT(DISTINCT bp.lot_name) as projectName, sar.cost,
saa.cost, sar.STATUS
saa.status FROM
from slt_agreement_apply saa slt_agreement_relation sar
left join slt_agreement_relation sar on saa.id = sar.apply_id LEFT JOIN bm_agreement_info bai ON sar.agreement_id = bai.agreement_id
LEFT JOIN bm_agreement_info bai on sar.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_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 bm_unit_info bui ON bui.unit_id = bai.unit_id
where 1=1 where 1=1
@ -284,10 +283,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId != null and projectId != ''"> <if test="projectId != null and projectId != ''">
and bp.lot_id = #{projectId} and bp.lot_id = #{projectId}
</if> </if>
<if test="sltStatus != null and sltStatus != ''"> <if test="sltStatus != null">
and saa.status = #{sltStatus} and sar.status = #{sltStatus}
</if> </if>
GROUP BY saa.id
</select> </select>
<select id="getRelations" resultType="com.bonus.sgzb.base.api.domain.SltAgreementRelation"> <select id="getRelations" resultType="com.bonus.sgzb.base.api.domain.SltAgreementRelation">
select sar.id, select sar.id,