This commit is contained in:
parent
69f46d8a1a
commit
7597ea905f
|
|
@ -129,15 +129,20 @@ public class BmTeamServiceImpl implements BmTeamService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getList(BmTeam tbTeam) {
|
public AjaxResult getList(BmTeam tbTeam) {
|
||||||
List<IwsTeamUserVo> iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByIdCard(tbTeam.getIdCard());
|
List<IwsTeamUserVo> iwsTeamUserVos = new ArrayList<>();
|
||||||
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
|
if (StringUtils.isNotBlank(tbTeam.getIdCard())) {
|
||||||
return AjaxResult.success(iwsTeamUserVos);
|
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByIdCard(tbTeam.getIdCard());
|
||||||
|
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
|
||||||
|
return AjaxResult.success(iwsTeamUserVos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 根据i8工程id查询班组信息
|
// 根据i8工程id查询班组信息
|
||||||
List<String> ids = Collections.singletonList(tbTeam.getProjectId());
|
if (StringUtils.isNotBlank(tbTeam.getProjectId())) {
|
||||||
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
|
List<String> ids = Collections.singletonList(tbTeam.getProjectId());
|
||||||
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
|
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
|
||||||
return AjaxResult.success(iwsTeamUserVos);
|
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
|
||||||
|
return AjaxResult.success(iwsTeamUserVos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.success(new ArrayList<>());
|
return AjaxResult.success(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -336,16 +336,15 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
||||||
// 先查第四层类型
|
// 先查第四层类型
|
||||||
List<TypeTreeNode> listL4 = materialBackInfoMapper.getUseTypeTreeL4(backApplyInfo);
|
List<TypeTreeNode> listL4 = materialBackInfoMapper.getUseTypeTreeL4(backApplyInfo);
|
||||||
for (MaterialBackApplyDetails details : backApplyDetailsList) {
|
for (MaterialBackApplyDetails details : backApplyDetailsList) {
|
||||||
|
// 将listL4转换为Map以typeId为键,提高查询效率
|
||||||
|
Map<Long, BigDecimal> typeNumMap = new HashMap<>();
|
||||||
if (CollectionUtils.isNotEmpty(listL4)) {
|
if (CollectionUtils.isNotEmpty(listL4)) {
|
||||||
for (TypeTreeNode node : listL4) {
|
for (TypeTreeNode node : listL4) {
|
||||||
if (node.getTypeId() == details.getTypeId()) {
|
typeNumMap.put(node.getTypeId(), node.getNum());
|
||||||
details.setNum(node.getNum());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
details.setNum(BigDecimal.ZERO);
|
|
||||||
}
|
}
|
||||||
|
// 从Map中获取num,不存在则设为0
|
||||||
|
details.setNum(typeNumMap.getOrDefault(details.getTypeId(), BigDecimal.ZERO));
|
||||||
// 为每个退料详情设置附件信息
|
// 为每个退料详情设置附件信息
|
||||||
setBmFileInfosForDetails(details, bmFileInfos);
|
setBmFileInfosForDetails(details, bmFileInfos);
|
||||||
// 如果是编码设备,查询并设置相关的编码信息和附件
|
// 如果是编码设备,查询并设置相关的编码信息和附件
|
||||||
|
|
@ -462,7 +461,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
||||||
// 保存退料信息到 tm_task 表中
|
// 保存退料信息到 tm_task 表中
|
||||||
result += taskMapper.insertTmTask(tmTask);
|
result += taskMapper.insertTmTask(tmTask);
|
||||||
if (result > 0) {
|
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.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTaskAgreement.setCreateBy(createBy);
|
tmTaskAgreement.setCreateBy(createBy);
|
||||||
// 增加任务和协议关联表数据
|
// 增加任务和协议关联表数据
|
||||||
|
|
|
||||||
|
|
@ -594,9 +594,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM
|
FROM
|
||||||
clz_slt_agreement_info
|
clz_slt_agreement_info
|
||||||
WHERE
|
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 type_id = #{typeId}
|
||||||
AND status = 0
|
|
||||||
<if test="maId != null">
|
<if test="maId != null">
|
||||||
AND ma_id = #{maId}
|
AND ma_id = #{maId}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="getByParentId" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
<select id="getByParentId" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
select
|
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
|
from lease_apply_details
|
||||||
where parent_id = #{parentId}
|
where parent_id = #{parentId}
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue