工程结算

This commit is contained in:
sxu 2024-12-06 10:29:49 +08:00
parent 4770eb0f6f
commit 70af70a8e8
5 changed files with 119 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.settlement.domain.SltAgreementApply;
import com.bonus.material.settlement.domain.vo.SltInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -68,6 +69,27 @@ public class SltAgreementInfoController extends BaseController {
return AjaxResult.success(bean);
}
/**
* 获取结算审核列表
*/
@ApiOperation(value = "获取结算审核列表")
@GetMapping("/getSltExam")
public TableDataInfo getSltExam(SltAgreementInfo bean) {
startPage();
List<SltAgreementApply> list = sltAgreementInfoService.getSltExam(bean);
return getDataTable(list);
}
/**
* 获取结算审核清单
*/
@ApiOperation(value = "获取结算审核清单")
@GetMapping("/getSltExamInfo")
public AjaxResult getSltExamInfo(SltAgreementApply apply) {
SltInfoVo bean = sltAgreementInfoService.getSltExamInfo(apply);
return AjaxResult.success(bean);
}
/**
* 导出结算信息列表
*/

View File

@ -4,7 +4,9 @@ import java.util.List;
import com.bonus.material.lease.domain.LeaseOutDetails;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.settlement.domain.SltAgreementApply;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.domain.SltAgreementRelation;
import com.bonus.material.task.domain.TmTask;
import org.apache.ibatis.annotations.Param;
@ -67,6 +69,12 @@ public interface SltAgreementInfoMapper {
List<SltAgreementInfo> getSltAgreementInfo4Project(SltAgreementInfo record);
List<SltAgreementApply> getSltExam(SltAgreementInfo bean);
String getCost(SltAgreementApply apply);
List<SltAgreementRelation> getRelations(SltAgreementApply apply);
int updSltInfo(SltAgreementInfo sltAgreementInfo);
int insSltInfo(@Param("record") LeaseOutDetails record, @Param("agreementId")String agreementId, @Param("ma") Type ma);

View File

@ -1,6 +1,8 @@
package com.bonus.material.settlement.service;
import java.util.List;
import com.bonus.material.settlement.domain.SltAgreementApply;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.domain.vo.SltInfoVo;
@ -31,6 +33,10 @@ public interface ISltAgreementInfoService {
public SltInfoVo getSltInfo(List<SltAgreementInfo> list);
List<SltAgreementApply> getSltExam(SltAgreementInfo bean);
SltInfoVo getSltExamInfo(SltAgreementApply apply);
/**
* 新增结算信息
*

View File

@ -7,6 +7,7 @@ import java.util.List;
import com.bonus.common.biz.enums.TmTaskTypeEnum;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.material.settlement.domain.SltAgreementApply;
import com.bonus.material.settlement.domain.SltAgreementRelation;
import com.bonus.material.settlement.domain.vo.SltInfoVo;
import com.bonus.material.task.domain.TmTask;
@ -80,6 +81,35 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
return sltInfoVo;
}
@Override
public List<SltAgreementApply> getSltExam(SltAgreementInfo bean) {
return sltAgreementInfoMapper.getSltExam(bean);
}
@Override
public SltInfoVo getSltExamInfo(SltAgreementApply apply) {
SltInfoVo sltInfoVo = new SltInfoVo();
List<SltAgreementInfo> list = new ArrayList<>();
String cost = sltAgreementInfoMapper.getCost(apply);
List<SltAgreementRelation> relations = sltAgreementInfoMapper.getRelations(apply);
sltInfoVo.setRelations(relations);
for (SltAgreementRelation relation : relations) {
SltAgreementInfo info = new SltAgreementInfo();
info.setAgreementId(Long.valueOf(relation.getAgreementId()));
list.add(info);
}
List<SltAgreementInfo> leaseList = getLeaseList(list);
List<SltAgreementInfo> repairList = getRepairList(list);
List<SltAgreementInfo> scrapList = getScrapList(list);
List<SltAgreementInfo> loseList = getLoseList(list);
sltInfoVo.setLeaseList(leaseList);
sltInfoVo.setRepairList(repairList);
sltInfoVo.setScrapList(scrapList);
sltInfoVo.setLoseList(loseList);
sltInfoVo.setCost(cost);
return sltInfoVo;
}
/**
* 新增结算信息
*

View File

@ -199,6 +199,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY sltStatus,bai.agreement_id desc
</select>
<select id="getSltExam" resultType="com.bonus.material.settlement.domain.SltAgreementApply">
select saa.id,
saa.code,
GROUP_CONCAT(DISTINCT sar.agreement_id) as agreementId,
GROUP_CONCAT(DISTINCT bui.unit_name) as unitName,
GROUP_CONCAT(DISTINCT bp.pro_name) as projectName,
saa.cost,
saa.status
from slt_agreement_apply saa
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_project bp ON bp.pro_id = bai.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
where 1=1
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}
</if>
<if test="projectId != null and projectId != ''">
and bp.pro_id = #{projectId}
</if>
<if test="sltStatus != null and sltStatus != ''">
and saa.status = #{sltStatus}
</if>
GROUP BY saa.id
</select>
<update id="updSltInfo">
update slt_agreement_info
set num = #{num},
@ -320,4 +346,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt1 on mt.parent_id = mt1.type_id
where sai.agreement_id = #{agreementId} and sai.end_time is null
</select>
<select id="getCost" resultType="java.lang.String">
select cost
from slt_agreement_apply
where id = #{id}
</select>
<select id="getRelations" resultType="com.bonus.material.settlement.domain.SltAgreementRelation">
select sar.id,
bui.unit_name as unitName,
bp.lot_name as projectName,
sar.apply_id as applyId,
sar.agreement_id as agreementId,
sar.add_cost as addCost,
sar.sub_cost as subCost,
sar.remark as remark,
sar.cost as cost,
sar.lease_cost as leaseCost,
sar.repair_cost as repairCost,
sar.scrap_cost as scrapCost,
sar.lose_cost as loseCost
from slt_agreement_relation sar
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_unit_info bui ON bui.unit_id = bai.unit_id
where sar.apply_id = #{id}
</select>
</mapper>