Merge remote-tracking branch 'origin/master'

This commit is contained in:
hongchao 2025-10-10 17:33:54 +08:00
commit ffeea860d9
4 changed files with 18 additions and 10 deletions

View File

@ -99,7 +99,6 @@ public class ClzSltAgreementInfoController extends BaseController {
}
}
/**
* 提交结算清单
*/

View File

@ -14,7 +14,7 @@ import java.util.List;
@Data
public class ClzSltApplyDTO extends BaseVO {
@ApiModelProperty("申请结算单位")
@ApiModelProperty("申请结算单位,数组形式")
private List<Integer> unitIds;
@ApiModelProperty("申请结算工程")

View File

@ -51,7 +51,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
/**
* 进行结算审批
*
* @param sltAgreementApply
* @param sltAgreementApply 结算提交信息
*/
@Override
@Transactional(rollbackFor = Exception.class)
@ -265,24 +265,24 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
});
}
// 返回之前对集合做去重处理根据外层的单位名称去重,保留每个单位名称的第一个
Set<String> seen = new HashSet<>();
List<MaterialSltInfoVo> dedup = new ArrayList<>(resultVoList.size());
for (MaterialSltInfoVo it : resultVoList) {
if (it == null) continue;
String key = normalize(it.getUnitName());
// 若不希望把 null 当作一个有效键可加if (key == null) continue;
if (key == null) continue;
if (seen.add(key)) {
dedup.add(it); // 第一次见到该单位名 -> 保留
}
}
return dedup;
}
/**
* 去除空行
*/
private static String normalize(String s) {
if (s == null) return null; // 若希望丢弃 null可直接返回 null 不参与去重键
return s.trim(); // 需要忽略大小写可用s.trim().toLowerCase(Locale.ROOT)
@ -307,9 +307,18 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
sltInfoVo.setProjectName(sltInfoVo.getScrapList().get(0).getProjectName());
sltInfoVo.setUnitName(sltInfoVo.getScrapList().get(0).getUnitName());
}
// 合计一下总费用
sltInfoVo.setTotalCostAll(Optional.ofNullable(sltInfoVo.getLeaseCost()).orElse(BigDecimal.ZERO)
.add(Optional.ofNullable(sltInfoVo.getRepairCost()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(sltInfoVo.getScrapCost()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(sltInfoVo.getLoseCost()).orElse(BigDecimal.ZERO))
);
resultVoList.add(sltInfoVo);
}
/**
* 根据单位及工程查询待结算费用明细
* @param requestApplyDto 工程班组
@ -339,8 +348,8 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
// 调用单个结算信息查询方法
MaterialSltInfoVo sltInfo = getSltInfo(sltAgreementInfo);
// 给外层的单位名称/工程名称赋值
if (sltInfo != null) {
// 给外层的单位名称/工程名称赋值
extractInnerNameToOuter(voList, sltInfo);
}
}

View File

@ -280,8 +280,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
saa.id as id, bai.agreement_id as agreementId, bai.agreement_code as agreementCode, saa.`code` as sltApplyCode,
bui.unit_id as unitId, bui.unit_name as unitName, bp.pro_id as projectId, bp.pro_name as projectName,
saa.remark, sad.money as costs, saa.audit_time as auditTime,
saa.`status` as sltStatus, sad.slt_type as sltType,
saa.remark, sad.money as costs, saa.audit_time as auditTime, sad.start_time as startTime, sad.end_time as endTime,
saa.`status` as sltStatus, sad.slt_type as sltType, sad.num, sad.price as leasePrice,
mt1.type_name as typeName, mt.type_name as modelName, mt.unit_name as mtUnitName
FROM
clz_slt_agreement_apply saa