This commit is contained in:
hongchao 2025-10-14 22:41:50 +08:00
commit 4a3d1617ea
7 changed files with 146 additions and 26 deletions

View File

@ -226,7 +226,7 @@ public class ClzSltAgreementInfoController extends BaseController {
if(materialReturnTime == null){
materialReturnTime = DateTime.now();
}
String teamExitTime = bean.getActualExitTime();
String teamExitTime = date;
if (teamExitTime == null) {
teamExitTime = DateTime.now().toString("yyyy-MM-dd");
}
@ -617,16 +617,16 @@ public class ClzSltAgreementInfoController extends BaseController {
Date teamExitTime = simulateTeamExitTime();
for (MaterialSltAgreementInfo bean : returnedList) {
// 只处理已退还的物资
if (bean.getEndTime() != null) {
long overdueDays = calculateOverdueDays(bean.getEndTime(), teamExitTime);
if (overdueDays >= 16) {
// 超期16天以上计为丢失
overdueList.add(bean);
}
}
}
// for (MaterialSltAgreementInfo bean : returnedList) {
// // 只处理已退还的物资
// if (bean.getEndTime() != null) {
// long overdueDays = calculateOverdueDays(bean.getEndTime(), teamExitTime);
// if (overdueDays >= 16) {
// // 超期16天以上计为丢失
// overdueList.add(bean);
// }
// }
// }
return overdueList;
}

View File

@ -757,16 +757,16 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
Date teamExitTime = simulateTeamExitTime();
for (MaterialSltAgreementInfo bean : returnedList) {
// 只处理已退还的物资
if (bean.getEndTime() != null) {
long overdueDays = calculateOverdueDays(bean.getEndTime(), teamExitTime);
if (overdueDays >= 16) {
// 超期16天以上计为丢失
overdueList.add(bean);
}
}
}
// for (MaterialSltAgreementInfo bean : returnedList) {
// // 只处理已退还的物资
// if (bean.getEndTime() != null) {
// long overdueDays = calculateOverdueDays(bean.getEndTime(), teamExitTime);
// if (overdueDays >= 16) {
// // 超期16天以上计为丢失
// overdueList.add(bean);
// }
// }
// }
return overdueList;
}
@ -813,7 +813,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
if(materialReturnTime == null){
materialReturnTime = DateTime.now();
}
String teamExitTime = bean.getActualExitTime();
String teamExitTime = date;
if (teamExitTime == null) {
teamExitTime = DateTime.now().toString("yyyy-MM-dd");
}
@ -826,7 +826,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
}
// 计算超期天数
long overdueDays = calculateOverdueDays(materialReturnTime, exitTime);
if(overdueDays < 8 ){
if(overdueDays <= 7 ){
bean.setOverDay(0L);
}else{
bean.setOverDay(overdueDays-7);

View File

@ -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

View File

@ -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);
}

View File

@ -203,7 +203,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
left join ma_type mt on sai.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where sai.agreement_id = #{agreementId} and sai.end_time is null and sai.is_slt=1
where sai.agreement_id = #{agreementId} and sai.status =0 and sai.is_slt=1
) res
GROUP BY res.typeId,res.startTime,res.endTime
</select>
@ -407,7 +407,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bm_unit bu on bai.unit_id = bu.unit_id
WHERE
bu.unit_name IS NOT NULL
AND bai.project_id = #{proId}
AND bai.project_id = #{proId} and bu.type_id = 1731
GROUP BY
bu.unit_id
</select>

View File

@ -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

View File

@ -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>