Merge branch 'master' of http://192.168.30.2:3000/bonus/Bonus-Cloud-Material
This commit is contained in:
commit
4a3d1617ea
|
|
@ -226,7 +226,7 @@ public class ClzSltAgreementInfoController extends BaseController {
|
||||||
if(materialReturnTime == null){
|
if(materialReturnTime == null){
|
||||||
materialReturnTime = DateTime.now();
|
materialReturnTime = DateTime.now();
|
||||||
}
|
}
|
||||||
String teamExitTime = bean.getActualExitTime();
|
String teamExitTime = date;
|
||||||
if (teamExitTime == null) {
|
if (teamExitTime == null) {
|
||||||
teamExitTime = DateTime.now().toString("yyyy-MM-dd");
|
teamExitTime = DateTime.now().toString("yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
|
|
@ -617,16 +617,16 @@ public class ClzSltAgreementInfoController extends BaseController {
|
||||||
|
|
||||||
Date teamExitTime = simulateTeamExitTime();
|
Date teamExitTime = simulateTeamExitTime();
|
||||||
|
|
||||||
for (MaterialSltAgreementInfo bean : returnedList) {
|
// for (MaterialSltAgreementInfo bean : returnedList) {
|
||||||
// 只处理已退还的物资
|
// // 只处理已退还的物资
|
||||||
if (bean.getEndTime() != null) {
|
// if (bean.getEndTime() != null) {
|
||||||
long overdueDays = calculateOverdueDays(bean.getEndTime(), teamExitTime);
|
// long overdueDays = calculateOverdueDays(bean.getEndTime(), teamExitTime);
|
||||||
if (overdueDays >= 16) {
|
// if (overdueDays >= 16) {
|
||||||
// 超期16天以上计为丢失
|
// // 超期16天以上计为丢失
|
||||||
overdueList.add(bean);
|
// overdueList.add(bean);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return overdueList;
|
return overdueList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -757,16 +757,16 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
|
|
||||||
Date teamExitTime = simulateTeamExitTime();
|
Date teamExitTime = simulateTeamExitTime();
|
||||||
|
|
||||||
for (MaterialSltAgreementInfo bean : returnedList) {
|
// for (MaterialSltAgreementInfo bean : returnedList) {
|
||||||
// 只处理已退还的物资
|
// // 只处理已退还的物资
|
||||||
if (bean.getEndTime() != null) {
|
// if (bean.getEndTime() != null) {
|
||||||
long overdueDays = calculateOverdueDays(bean.getEndTime(), teamExitTime);
|
// long overdueDays = calculateOverdueDays(bean.getEndTime(), teamExitTime);
|
||||||
if (overdueDays >= 16) {
|
// if (overdueDays >= 16) {
|
||||||
// 超期16天以上计为丢失
|
// // 超期16天以上计为丢失
|
||||||
overdueList.add(bean);
|
// overdueList.add(bean);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
return overdueList;
|
return overdueList;
|
||||||
}
|
}
|
||||||
|
|
@ -813,7 +813,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
if(materialReturnTime == null){
|
if(materialReturnTime == null){
|
||||||
materialReturnTime = DateTime.now();
|
materialReturnTime = DateTime.now();
|
||||||
}
|
}
|
||||||
String teamExitTime = bean.getActualExitTime();
|
String teamExitTime = date;
|
||||||
if (teamExitTime == null) {
|
if (teamExitTime == null) {
|
||||||
teamExitTime = DateTime.now().toString("yyyy-MM-dd");
|
teamExitTime = DateTime.now().toString("yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
|
|
@ -826,7 +826,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic
|
||||||
}
|
}
|
||||||
// 计算超期天数
|
// 计算超期天数
|
||||||
long overdueDays = calculateOverdueDays(materialReturnTime, exitTime);
|
long overdueDays = calculateOverdueDays(materialReturnTime, exitTime);
|
||||||
if(overdueDays < 8 ){
|
if(overdueDays <= 7 ){
|
||||||
bean.setOverDay(0L);
|
bean.setOverDay(0L);
|
||||||
}else{
|
}else{
|
||||||
bean.setOverDay(overdueDays-7);
|
bean.setOverDay(overdueDays-7);
|
||||||
|
|
|
||||||
|
|
@ -1184,6 +1184,15 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
|
|
||||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||||
iterator.remove();
|
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 materialRetainedEquipmentInfo = new MaterialRetainedEquipmentInfo();
|
||||||
materialRetainedEquipmentInfo.setTeamName("站内库存");
|
materialRetainedEquipmentInfo.setTeamName("站内库存");
|
||||||
List<MaterialRetainedEquipmentInfo> teamList = materialMachineMapper.getTeamList(bean);
|
List<MaterialRetainedEquipmentInfo> teamList = materialMachineMapper.getTeamList(bean);
|
||||||
|
if (CollectionUtils.isNotEmpty(teamList)) {
|
||||||
|
// 使用Stream过滤并收集符合条件的元素
|
||||||
|
teamList = teamList.stream()
|
||||||
|
.filter(this::hasRelatedAgreements)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
teamList.add(0, materialRetainedEquipmentInfo);
|
teamList.add(0, materialRetainedEquipmentInfo);
|
||||||
return teamList;
|
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
|
* @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.ClzDirectApplyDetails;
|
||||||
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
|
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
|
||||||
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
|
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.dto.SelectDto;
|
||||||
import com.bonus.material.common.domain.vo.AgreementVo;
|
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||||
import com.bonus.material.common.domain.vo.SelectVo;
|
import com.bonus.material.common.domain.vo.SelectVo;
|
||||||
|
|
@ -384,4 +385,32 @@ public interface SelectMapper {
|
||||||
BackApplyInfo selectCheckPerson(BackApplyDetails details);
|
BackApplyInfo selectCheckPerson(BackApplyDetails details);
|
||||||
|
|
||||||
BackApplyDetails selectSignUrlByUserId(int userId);
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 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 mt on sai.type_id = mt.type_id
|
||||||
left join ma_type mt1 on mt.parent_id = mt1.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
|
) res
|
||||||
GROUP BY res.typeId,res.startTime,res.endTime
|
GROUP BY res.typeId,res.startTime,res.endTime
|
||||||
</select>
|
</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
|
left join bm_unit bu on bai.unit_id = bu.unit_id
|
||||||
WHERE
|
WHERE
|
||||||
bu.unit_name IS NOT NULL
|
bu.unit_name IS NOT NULL
|
||||||
AND bai.project_id = #{proId}
|
AND bai.project_id = #{proId} and bu.type_id = 1731
|
||||||
GROUP BY
|
GROUP BY
|
||||||
bu.unit_id
|
bu.unit_id
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -1694,7 +1694,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="getTeamList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
<select id="getTeamList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
bz.bzmc AS teamName,
|
bz.bzmc AS teamName,
|
||||||
bz.project_name AS proName
|
bz.project_name AS proName,
|
||||||
|
bp.external_id AS externalId
|
||||||
FROM
|
FROM
|
||||||
`micro-tool`.bzgl_bz bz
|
`micro-tool`.bzgl_bz bz
|
||||||
LEFT JOIN bm_project bp ON bz.project_id = bp.external_id
|
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
|
WHERE
|
||||||
user_id=#{userId}
|
user_id=#{userId}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue