This commit is contained in:
mashuai 2025-09-22 20:52:01 +08:00
parent 69f46d8a1a
commit 7597ea905f
4 changed files with 26 additions and 17 deletions

View File

@ -129,16 +129,21 @@ public class BmTeamServiceImpl implements BmTeamService {
@Override
public AjaxResult getList(BmTeam tbTeam) {
List<IwsTeamUserVo> iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByIdCard(tbTeam.getIdCard());
List<IwsTeamUserVo> iwsTeamUserVos = new ArrayList<>();
if (StringUtils.isNotBlank(tbTeam.getIdCard())) {
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByIdCard(tbTeam.getIdCard());
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
return AjaxResult.success(iwsTeamUserVos);
}
}
// 根据i8工程id查询班组信息
if (StringUtils.isNotBlank(tbTeam.getProjectId())) {
List<String> ids = Collections.singletonList(tbTeam.getProjectId());
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
return AjaxResult.success(iwsTeamUserVos);
}
}
return AjaxResult.success(new ArrayList<>());
}

View File

@ -336,16 +336,15 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
// 先查第四层类型
List<TypeTreeNode> listL4 = materialBackInfoMapper.getUseTypeTreeL4(backApplyInfo);
for (MaterialBackApplyDetails details : backApplyDetailsList) {
// 将listL4转换为Map以typeId为键提高查询效率
Map<Long, BigDecimal> typeNumMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(listL4)) {
for (TypeTreeNode node : listL4) {
if (node.getTypeId() == details.getTypeId()) {
details.setNum(node.getNum());
break;
typeNumMap.put(node.getTypeId(), node.getNum());
}
}
} else {
details.setNum(BigDecimal.ZERO);
}
// 从Map中获取num不存在则设为0
details.setNum(typeNumMap.getOrDefault(details.getTypeId(), BigDecimal.ZERO));
// 为每个退料详情设置附件信息
setBmFileInfosForDetails(details, bmFileInfos);
// 如果是编码设备查询并设置相关的编码信息和附件
@ -462,7 +461,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
// 保存退料信息到 tm_task 表中
result += taskMapper.insertTmTask(tmTask);
if (result > 0) {
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), dto.getBackApplyInfo().getAgreementId());
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), Long.valueOf(dto.getBackApplyInfo().getAgreementIds().get(0)));
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
tmTaskAgreement.setCreateBy(createBy);
// 增加任务和协议关联表数据

View File

@ -594,9 +594,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
clz_slt_agreement_info
WHERE
agreement_id = #{agreementId}
status = 0
<if test="agreementIds != null">
AND agreement_id in
<foreach item="item" index="index" collection="agreementIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND type_id = #{typeId}
AND status = 0
<if test="maId != null">
AND ma_id = #{maId}
</if>

View File

@ -233,7 +233,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getByParentId" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
<!--@mbg.generated-->
select
id, parent_id as parentId, type_id as typeId, pre_num as preNum, al_num as alNum, `status`
id, parent_id as parentId, type_id as typeId, IFNULL(pre_num, 0) as preNum, IFNULL(al_num, 0) as alNum, `status`
from lease_apply_details
where parent_id = #{parentId}
</select>