This commit is contained in:
parent
c1306c49e3
commit
e1c5771475
|
|
@ -1184,6 +1184,15 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
// 根据工程去机具协议表查询关联协议数据
|
||||
List<MaterialRetainedEquipmentInfo> agreementIdList = mapper.getAgreementId(info.getProId());
|
||||
// 根据工程去材料站协议表查询关联协议数据
|
||||
List<MaterialRetainedEquipmentInfo> storageAgreementIdList = mapper.getStorageAgreementId(info.getProId());
|
||||
// 如果获取的协议数据为空,则移除该行数据
|
||||
if (CollectionUtils.isEmpty(agreementIdList) && CollectionUtils.isEmpty(storageAgreementIdList)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1217,10 +1226,33 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
MaterialRetainedEquipmentInfo materialRetainedEquipmentInfo = new MaterialRetainedEquipmentInfo();
|
||||
materialRetainedEquipmentInfo.setTeamName("站内库存");
|
||||
List<MaterialRetainedEquipmentInfo> teamList = materialMachineMapper.getTeamList(bean);
|
||||
if (CollectionUtils.isNotEmpty(teamList)) {
|
||||
// 使用Stream过滤并收集符合条件的元素
|
||||
teamList = teamList.stream()
|
||||
.filter(this::hasRelatedAgreements)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
teamList.add(0, materialRetainedEquipmentInfo);
|
||||
return teamList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前信息是否关联了协议
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
private boolean hasRelatedAgreements(MaterialRetainedEquipmentInfo info) {
|
||||
// 查询机具协议表关联数据
|
||||
List<MaterialRetainedEquipmentInfo> agreementIdList = mapper.getJiJuBzAgreementId(info);
|
||||
if (CollectionUtils.isNotEmpty(agreementIdList)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 查询材料站协议表关联数据
|
||||
List<MaterialRetainedEquipmentInfo> storageAgreementIdList = mapper.getClzAgreementId(info);
|
||||
return CollectionUtils.isNotEmpty(storageAgreementIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分包单位下拉选
|
||||
* @param bean
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.bonus.material.clz.domain.BmTeam;
|
|||
import com.bonus.material.clz.domain.direct.ClzDirectApplyDetails;
|
||||
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
|
||||
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
import com.bonus.material.common.domain.dto.SelectDto;
|
||||
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||
import com.bonus.material.common.domain.vo.SelectVo;
|
||||
|
|
@ -384,4 +385,32 @@ public interface SelectMapper {
|
|||
BackApplyInfo selectCheckPerson(BackApplyDetails details);
|
||||
|
||||
BackApplyDetails selectSignUrlByUserId(int userId);
|
||||
|
||||
/**
|
||||
* 获取机具协议id
|
||||
* @param proId
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getAgreementId(String proId);
|
||||
|
||||
/**
|
||||
* 根据工程去材料站协议表查询关联协议数据
|
||||
* @param proId
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getStorageAgreementId(String proId);
|
||||
|
||||
/**
|
||||
* 根据班组去机具协议表查询关联协议数据
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getJiJuBzAgreementId(MaterialRetainedEquipmentInfo info);
|
||||
|
||||
/**
|
||||
* 根据班组去材料站协议表查询关联协议数据
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getClzAgreementId(MaterialRetainedEquipmentInfo info);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1694,7 +1694,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getTeamList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT DISTINCT
|
||||
bz.bzmc AS teamName,
|
||||
bz.project_name AS proName
|
||||
bz.project_name AS proName,
|
||||
bp.external_id AS externalId
|
||||
FROM
|
||||
`micro-tool`.bzgl_bz bz
|
||||
LEFT JOIN bm_project bp ON bz.project_id = bp.external_id
|
||||
|
|
|
|||
|
|
@ -1217,4 +1217,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
user_id=#{userId}
|
||||
</select>
|
||||
|
||||
<select id="getAgreementId" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT
|
||||
sai.agreement_id as agreementId,
|
||||
sai.type_id as typeId
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
WHERE
|
||||
sai.is_slt = '0'
|
||||
AND sai.`status` = '0'
|
||||
AND bai.project_id = #{proId}
|
||||
</select>
|
||||
|
||||
<select id="getStorageAgreementId" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT
|
||||
sai.agreement_id as agreementId,
|
||||
sai.type_id as typeId
|
||||
FROM
|
||||
clz_slt_agreement_info sai
|
||||
LEFT JOIN clz_bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
WHERE
|
||||
sai.is_slt = '0'
|
||||
AND bai.project_id = #{proId}
|
||||
</select>
|
||||
|
||||
<select id="getJiJuBzAgreementId" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT
|
||||
sai.agreement_id,
|
||||
sai.type_id
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id
|
||||
WHERE
|
||||
sai.is_slt = '0'
|
||||
AND sai.`status` = '0'
|
||||
AND bu.unit_name = #{teamName}
|
||||
<if test="externalId != null and externalId != ''">
|
||||
AND bu.project_id = #{externalId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getClzAgreementId" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT
|
||||
sai.agreement_id,
|
||||
sai.type_id
|
||||
FROM
|
||||
clz_slt_agreement_info sai
|
||||
LEFT JOIN clz_bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id
|
||||
WHERE
|
||||
sai.is_slt = '0'
|
||||
AND bu.unit_name = #{teamName}
|
||||
<if test="externalId != null and externalId != ''">
|
||||
AND bu.project_id = #{externalId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue