This commit is contained in:
mashuai 2025-05-30 17:14:08 +08:00
parent cc9662b2d9
commit 6f8a6b1b20
2 changed files with 12 additions and 7 deletions

View File

@ -127,12 +127,16 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
}
}
}
if ("0".equals(details.getManageType())) {
List<MaCodeVo> list = backApplyInfoMapper.selectByCode(details.getParentId());
if (CollectionUtils.isNotEmpty(list)) {
// 过滤出list中typeId和details.getTypeId相等的MaCodeVo对象
list = list.stream().filter(type -> type.getTypeId().equals(details.getTypeId().toString())).collect(Collectors.toList());
// 将goodNum和badNum分别相加
details.setGoodNum(list.stream().map(MaCodeVo::getGoodNum).reduce(BigDecimal.ZERO, BigDecimal::add));
details.setBadNum(list.stream().map(MaCodeVo::getBadNum).reduce(BigDecimal.ZERO, BigDecimal::add));
}
}
// 为每个退料详情设置附件信息
setBmFileInfosForDetails(details, bmFileInfos);
// 如果是编码设备查询并设置相关的编码信息和附件

View File

@ -178,7 +178,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ba.remark AS remark,
ba.ap_detection AS apDetection,
ba.bad_num AS badNum,
ba.good_num AS goodNum
ba.good_num AS goodNum,
mt.manage_type AS manageType
FROM
back_apply_details ba
LEFT JOIN ma_type mt ON mt.type_id = ba.type_id and mt.del_flag = 0
@ -209,7 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
back_check_details bcd
left join ma_machine mm on bcd.ma_id = mm.ma_id
left join ma_type mt ON mt.type_id = mm.type_id and mt.del_flag = 0
left join ma_type mt ON mt.type_id = bcd.type_id and mt.del_flag = 0
left join ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = 0
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = 0
where bcd.parent_id = #{id}