过滤已结算的工程
This commit is contained in:
parent
2204220937
commit
a89936cb70
|
|
@ -118,4 +118,7 @@ public class LeaseTotalInfo {
|
|||
@ApiModelProperty(value = "分包单位")
|
||||
@Excel(name = "分包单位")
|
||||
private String subUnitName;
|
||||
|
||||
@ApiModelProperty(value = "工程id")
|
||||
private String proId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import com.bonus.material.back.domain.vo.MaCodeVo;
|
|||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.clz.domain.BmTeam;
|
||||
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
import com.bonus.material.clz.mapper.IwsTeamUserMapper;
|
||||
import com.bonus.material.clz.mapper.MaterialMachineMapper;
|
||||
import com.bonus.material.common.mapper.SelectMapper;
|
||||
|
|
@ -148,6 +149,23 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
item.getTypeName().contains(backApplyInfo.getTypeName()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<MaterialBackApplyInfo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialBackApplyInfo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
// 如果需要导出
|
||||
if (backApplyInfo.getIsExport()) {
|
||||
for (MaterialBackApplyInfo applyInfo : list) {
|
||||
|
|
@ -261,6 +279,22 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
.filter(item -> containsTotalKeyword(item, backApplyInfo.getKeyWord()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的设备
|
||||
Iterator<MaterialBackApplyInfo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialBackApplyInfo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
@ -641,6 +675,22 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
.filter(item -> com.alibaba.nacos.common.utils.StringUtils.equals(item.getSubUnitName(), info.getSubUnitName()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<MaterialBackApplyTotalInfo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialBackApplyTotalInfo infos = iterator.next();
|
||||
String proId = infos.getProId() != null ?
|
||||
infos.getProId().toString() : null;
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (MaterialBackApplyTotalInfo backApplyTotalInfo : list) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.bonus.material.clz.domain.back.MaterialBackApplyDetails;
|
|||
import com.bonus.material.clz.domain.back.MaterialBackApplyTotalInfo;
|
||||
import com.bonus.material.clz.domain.back.MaterialBackPreApply;
|
||||
import com.bonus.material.clz.domain.back.MaterialBackPreDetails;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
import com.bonus.material.clz.mapper.MaterialBackAppointmentMapper;
|
||||
import com.bonus.material.clz.mapper.MaterialMachineMapper;
|
||||
import com.bonus.material.clz.service.MaterialBackAppointmentService;
|
||||
|
|
@ -151,6 +152,23 @@ public class MaterialBackAppointmentServiceImpl implements MaterialBackAppointme
|
|||
.filter(item -> bean.getTypeName().contains(item.getTypeName()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
if (list.size()>0){
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = selectMapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<MaterialBackPreApply> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialBackPreApply info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error("查询退料预约列表:{}", e);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.bonus.material.basic.mapper.BmAgreementInfoMapper;
|
|||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.clz.domain.BmTeam;
|
||||
import com.bonus.material.clz.domain.vo.MaterialMaCodeVo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedTeamTotalVo;
|
||||
import com.bonus.material.clz.mapper.BmTeamMapper;
|
||||
import com.bonus.material.clz.mapper.IwsTeamUserMapper;
|
||||
|
|
@ -172,6 +173,22 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
.filter(item -> leaseApplyInfo.getStatusList().contains(item.getTaskStatus()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<MaterialLeaseApplyInfo> iterator = sortedList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialLeaseApplyInfo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sortedList;
|
||||
}
|
||||
|
|
@ -311,6 +328,22 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
.filter(item -> containsTotalKeyword(item, leaseApplyInfo.getKeyWord()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的设备
|
||||
Iterator<MaterialLeaseApplyInfo> iterator = sortedList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialLeaseApplyInfo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sortedList;
|
||||
}
|
||||
|
|
@ -1379,6 +1412,21 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
}
|
||||
// 处理数据并计算总和
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<LeaseTotalInfo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
LeaseTotalInfo infos = iterator.next();
|
||||
String proId = infos.getProId() != null ?
|
||||
infos.getProId().toString() : null;
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
for (LeaseTotalInfo leaseTotalInfo : list) {
|
||||
// 根据typeId和parentId查询领料数量
|
||||
LeaseTotalInfo totalInfo = materialLeaseInfoMapper.getTotalInfo(leaseTotalInfo);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.clz.service.impl;
|
|||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.BmProject;
|
||||
|
|
@ -168,25 +169,47 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
extractedDept(bean);
|
||||
}
|
||||
}
|
||||
|
||||
// 查询目前在用的设备信息
|
||||
List<MaterialRetainedEquipmentInfo> usList = materialMachineMapper.getUsInfoList(bean);
|
||||
//查询目前还有库存的设备
|
||||
// 查询目前还有库存的设备
|
||||
List<MaterialRetainedEquipmentInfo> recordList = materialMachineMapper.getRetainInfoList(bean);
|
||||
|
||||
// 数据合并
|
||||
if (!CollectionUtils.isEmpty(recordList)) {
|
||||
usList.addAll(recordList);
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(usList)){
|
||||
if (teamData != null){
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
|
||||
if (!CollectionUtils.isEmpty(usList)) {
|
||||
if (teamData != null) {
|
||||
// 将 usList 中班组身份证号与 username 相同的元素过滤处理
|
||||
usList = usList.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的设备
|
||||
Iterator<MaterialRetainedEquipmentInfo> iterator = usList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialRetainedEquipmentInfo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return usList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保有设备总量查询材料员权限
|
||||
* @param list
|
||||
|
|
@ -301,6 +324,23 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
}*/
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<MaterialRetainedEquipmentInfo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialRetainedEquipmentInfo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
for (MaterialRetainedEquipmentInfo retainedEquipmentInfo : list) {
|
||||
MaterialRetainedEquipmentInfo info = new MaterialRetainedEquipmentInfo();
|
||||
info.setTypeId(retainedEquipmentInfo.getTypeId());
|
||||
|
|
@ -572,11 +612,27 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
String subUnitName = iwsTeamUserMapper.getTeamName(materialRetainedEquipmentInfo.getTeamName());
|
||||
materialRetainedEquipmentInfo.setSubUnitName(subUnitName);
|
||||
}
|
||||
if(bean.getSubUnitName()!=null && !bean.getSubUnitName().equals("") && !usList.isEmpty()){
|
||||
if(bean.getSubUnitName()!=null && !"".equals(bean.getSubUnitName()) && !usList.isEmpty()){
|
||||
// 根据传入的SubUnitName过滤列表
|
||||
usList = usList.stream()
|
||||
.filter(item -> StringUtils.equals(item.getSubUnitName(), bean.getSubUnitName()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<MaterialRetainedEquipmentInfo> iterator = usList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialRetainedEquipmentInfo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return usList;
|
||||
}
|
||||
|
|
@ -637,6 +693,23 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
if (teamNumList.size()>0){
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<MaterialRetainedTeamTotalVo> iterator = teamNumList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialRetainedTeamTotalVo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return teamNumList;
|
||||
}
|
||||
|
||||
|
|
@ -740,6 +813,11 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
*/
|
||||
@Override
|
||||
public MaterialTotalMentInfo getTotalList(MaterialRetainedEquipmentInfo bean) {
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdLists = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdLists);
|
||||
|
||||
MaterialTotalMentInfo info = new MaterialTotalMentInfo();
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
BmTeam teamData = null;
|
||||
|
|
@ -776,6 +854,16 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
List<MaterialRetainedEquipmentInfo> useInfoList = materialMachineMapper.getRetainTotalInfo(bean);
|
||||
// 分别获取useInfoList中以unitValue分组的usNum数量,展示出来
|
||||
if (!CollectionUtils.isEmpty(useInfoList)) {
|
||||
// 过滤掉不在未结算工程集合内的设备
|
||||
Iterator<MaterialRetainedEquipmentInfo> iterator = useInfoList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialRetainedEquipmentInfo infos = iterator.next();
|
||||
if (infos.getProId() == null || !unsettledProjectIds.contains(infos.getProId())) {
|
||||
// 如果 proId 不在未结算集合中,则移除
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
useCountNum = useInfoList.stream()
|
||||
.filter(item -> "0".equals(item.getUnitValue()))
|
||||
.map(MaterialRetainedEquipmentInfo::getUsNum)
|
||||
|
|
@ -791,6 +879,16 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
//查询目前还有库存的设备
|
||||
List<MaterialRetainedEquipmentInfo> recordList = materialMachineMapper.getRetainInfoList(bean);
|
||||
if (CollectionUtils.isNotEmpty(recordList)) {
|
||||
// 过滤掉不在未结算工程集合内的设备
|
||||
Iterator<MaterialRetainedEquipmentInfo> iterator = recordList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialRetainedEquipmentInfo infos = iterator.next();
|
||||
if (infos.getProId() == null || !unsettledProjectIds.contains(infos.getProId())) {
|
||||
// 如果 proId 不在未结算集合中,则移除
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
inCountNum = recordList.stream()
|
||||
.filter(item -> "0".equals(item.getUnitValue()) && !"32".equals(item.getUnitType()))
|
||||
.map(MaterialRetainedEquipmentInfo::getAllNum)
|
||||
|
|
@ -828,6 +926,16 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
// 查询目前在用的设备信息
|
||||
List<MaterialRetainedEquipmentInfo> usList = materialMachineMapper.getUsInfoList(bean);
|
||||
if (CollectionUtils.isNotEmpty(usList)) {
|
||||
// 过滤掉不在未结算工程集合内的设备
|
||||
Iterator<MaterialRetainedEquipmentInfo> iterator = usList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialRetainedEquipmentInfo infos = iterator.next();
|
||||
if (infos.getProId() == null || !unsettledProjectIds.contains(infos.getProId())) {
|
||||
// 如果 proId 不在未结算集合中,则移除
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
// 获取usList中的班组id,且去重的数量
|
||||
info.setTeamNum((int) usList.stream()
|
||||
.map(MaterialRetainedEquipmentInfo::getTeamId)
|
||||
|
|
@ -891,7 +999,25 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
*/
|
||||
@Override
|
||||
public List<TeamVo> getTeamInOrOutInfo(TeamVo bean) {
|
||||
return materialMachineMapper.getTeamInOrOutInfo(bean);
|
||||
List<TeamVo> list = materialMachineMapper.getTeamInOrOutInfo(bean);
|
||||
if (list.size()>0){
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<TeamVo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TeamVo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -972,7 +1098,25 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
// 部门查询赋值
|
||||
extractedDept(bean);
|
||||
}
|
||||
return materialMachineMapper.getProjectList(bean);
|
||||
List<MaterialRetainedEquipmentInfo> list = materialMachineMapper.getProjectList(bean);
|
||||
if (list.size()>0){
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<MaterialRetainedEquipmentInfo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialRetainedEquipmentInfo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1104,6 +1248,23 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
//查询目前还有库存的设备
|
||||
List<MaterialStorageAndUseNumInfo> recordList = materialMachineMapper.getStoreNumAndUseList(bean);
|
||||
if (!CollectionUtils.isEmpty(recordList)){
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = mapper.getUnsettledProId();
|
||||
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
|
||||
// 过滤掉不在未结算工程集合内的设备
|
||||
Iterator<MaterialStorageAndUseNumInfo> iterator = recordList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MaterialStorageAndUseNumInfo info = iterator.next();
|
||||
if (info.getProId() == null || !unsettledProjectIds.contains(info.getProId())) {
|
||||
// 如果 proId 不在未结算集合中,则移除
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (teamData != null){
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
recordList = recordList.stream()
|
||||
|
|
|
|||
|
|
@ -373,4 +373,11 @@ public interface SelectMapper {
|
|||
* @return
|
||||
*/
|
||||
List<ProjectTreeNode> getTeamNewList(ProAuthorizeInfo bean);
|
||||
|
||||
/**
|
||||
* 获取未结算工程
|
||||
* @return
|
||||
*/
|
||||
List<String> getUnsettledProId();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import java.util.stream.Collectors;
|
|||
|
||||
import com.bonus.common.biz.constant.GlobalConstants;
|
||||
import com.bonus.common.biz.enums.*;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
import com.bonus.material.common.mapper.SelectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
|
|
@ -86,6 +88,9 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
@Resource
|
||||
private LeaseTaskMapper mapper;
|
||||
|
||||
@Resource
|
||||
private SelectMapper selectMapper;
|
||||
|
||||
/**
|
||||
* 查询领料任务
|
||||
*
|
||||
|
|
@ -916,6 +921,22 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
.filter(item -> containsKeyword(item, keyWord))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = selectMapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<LeaseApplyInfo> iterator = sortedList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
LeaseApplyInfo info = iterator.next();
|
||||
String proId = info.getProjectId() != null ?
|
||||
info.getProjectId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sortedList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,4 +100,9 @@ public class ProAuthorizeInfo {
|
|||
* 项目部名称
|
||||
*/
|
||||
private String projectDept;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private String proId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.bonus.common.core.domain.R;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
import com.bonus.material.common.mapper.SelectMapper;
|
||||
import com.bonus.material.materialStation.domain.ProAuthorizeDetails;
|
||||
import com.bonus.material.materialStation.domain.ProAuthorizeInfo;
|
||||
|
|
@ -30,10 +31,7 @@ import java.net.URI;
|
|||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -85,6 +83,22 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
|||
.filter(item -> containsKeyWord(item, keyWord))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = selectMapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<LeasePublishInfo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
LeasePublishInfo info = iterator.next();
|
||||
String proId = info.getLeaseProjectId() != null ?
|
||||
info.getLeaseProjectId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e){
|
||||
|
|
@ -275,6 +289,23 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
|||
public List<ProAuthorizeInfo> getAuthorList(ProAuthorizeInfo bean) {
|
||||
try {
|
||||
List<ProAuthorizeInfo> list = mapper.getAuthorList(bean);
|
||||
if (list.size()>0){
|
||||
// 查询所有未结算的工程
|
||||
List<String> projectIdList = selectMapper.getUnsettledProId();
|
||||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<ProAuthorizeInfo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ProAuthorizeInfo info = iterator.next();
|
||||
String proId = info.getProId() != null ?
|
||||
info.getProId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e){
|
||||
log.error("项目部授权列表查询", e.getMessage());
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
cbpa.id,
|
||||
bu.unit_name as unitName,
|
||||
bp.pro_id as proId,
|
||||
bp.pro_name as proName,
|
||||
cbpa.back_person as backPerson,
|
||||
cbpa.back_time as backTime,
|
||||
|
|
|
|||
|
|
@ -627,6 +627,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SUM( bcd.back_num ) AS backNum,
|
||||
bcd.create_time AS backTime,
|
||||
bt.unit_name AS teamName,
|
||||
bp.pro_id AS proId,
|
||||
bp.pro_name AS proName,
|
||||
bai.back_person AS backPerson,
|
||||
bai.create_by AS createBy,
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lai.create_by, lai.create_time as leaseTime, lai.update_by, lai.update_time, lai.remark, lai.company_id,
|
||||
lai.lease_sign_url as leaseSignUrl, lai.lease_sign_type as leaseSignType,
|
||||
lai.material_man, lai.confirm_time, lai.is_confirm, lai.confirm_remark,
|
||||
bu.unit_name as leaseUnit, bp.pro_name as leaseProject, tt.task_status as taskStatus,
|
||||
bu.unit_name as leaseUnit, bp.pro_name as leaseProject,bp.pro_id as proId, tt.task_status as taskStatus,
|
||||
sda.dict_label as taskStatusName,
|
||||
IFNULL(sum(lad.pre_num),0) as preCountNum,
|
||||
IFNULL(sum(lad.al_num),0) as alNum,
|
||||
|
|
@ -931,6 +931,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lod.create_time as outDate,
|
||||
bt.unit_name as teamName,
|
||||
bp.external_id as externalId,
|
||||
bp.pro_id as proId,
|
||||
bp.pro_name as projectName,
|
||||
lai.lease_person as leasePerson,
|
||||
su.nick_name as outPerson,
|
||||
|
|
@ -1179,6 +1180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lpd.phone AS phone,
|
||||
lpd.unit_id AS leaseUnitId,
|
||||
lpd.project_id AS leaseProjectId,
|
||||
lpd.project_id as proId,
|
||||
bu.unit_name AS leaseUnit,
|
||||
bp.pro_name AS leaseProject,
|
||||
bai.agreement_code AS agreementCode,
|
||||
|
|
|
|||
|
|
@ -755,6 +755,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHEN DATEDIFF(mm.next_check_time, CURDATE()) <= 90 THEN 1 -- 相差不足3个月
|
||||
ELSE 0 -- 相差3个月以上
|
||||
END AS status,
|
||||
bp.pro_id AS proId,
|
||||
bp.pro_name AS proName,
|
||||
bu.unit_name AS teamName
|
||||
FROM
|
||||
|
|
@ -1042,6 +1043,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHEN '3' THEN '进场'
|
||||
ELSE '未知'
|
||||
END AS teamStatusName,
|
||||
bp.pro_id AS proId,
|
||||
bzgl_bz.project_name AS projectName,
|
||||
org_user.mobile AS teamLeaderPhone,
|
||||
bzgl_bz.sfjs AS isDismiss,
|
||||
|
|
@ -1661,7 +1663,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="getProjectList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT
|
||||
DISTINCT bp.pro_name AS proName
|
||||
DISTINCT bp.pro_name AS proName,bp.pro_id AS proId
|
||||
FROM
|
||||
bm_project bp
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
|
||||
|
|
@ -1687,6 +1689,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="impUnit != null and impUnit != ''">
|
||||
AND bp.imp_unit = #{impUnit}
|
||||
</if>
|
||||
and bp.del_flag='0'
|
||||
GROUP BY bp.pro_name
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -1152,4 +1152,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND bzgl_bz.project_id = #{externalId}
|
||||
GROUP BY bzgl_bz.bzmc
|
||||
</select>
|
||||
<select id="getUnsettledProId" resultType="java.lang.String">
|
||||
SELECT DISTINCT bp.pro_id as proId
|
||||
FROM bm_project bp
|
||||
WHERE EXISTS(
|
||||
SELECT 1
|
||||
FROM bm_agreement_info bai
|
||||
INNER JOIN slt_agreement_info sai ON bai.agreement_id = sai.agreement_id
|
||||
WHERE bai.project_id = bp.pro_id
|
||||
AND sai.is_slt = 0
|
||||
)
|
||||
AND bp.pro_id IS NOT NULL
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lai.create_by, lai.create_time as createTime, lai.update_by, lai.update_time, lai.remark, lai.company_id,
|
||||
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.lease_sign_type,
|
||||
lai.material_man, lai.confirm_time, lai.is_confirm, lai.confirm_remark,
|
||||
bai.unit_id,bai.project_id,bu.unit_name as unitName, bp.pro_name as projectName,bp.external_id as externalId, bai.agreement_code as agreementCode, tt.task_status as taskStatus,
|
||||
bai.unit_id,bai.project_id,bai.project_id as projectId,bu.unit_name as unitName, bp.pro_name as projectName,bp.external_id as externalId, bai.agreement_code as agreementCode, tt.task_status as taskStatus,
|
||||
sda.dict_label as taskStatusName,
|
||||
IFNULL(sum(lad.pre_num),0) as preCountNum,
|
||||
IFNULL(lod.num,0) as alNum,
|
||||
|
|
@ -731,6 +731,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lpd.phone AS phone,
|
||||
lpd.unit_id AS leaseUnitId,
|
||||
lpd.project_id AS leaseProjectId,
|
||||
lpd.project_id AS projectId,
|
||||
bu.unit_name AS unitName,
|
||||
bp.pro_name AS projectName,
|
||||
bai.agreement_code AS agreementCode,
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pai.team_id as teamId,
|
||||
pai.team_name as teamName,
|
||||
bu.unit_name as leaseUnit,
|
||||
bp.pro_id as proId,
|
||||
bp.pro_name as leaseProject,
|
||||
su.nick_name as userName,
|
||||
lai.code as code,
|
||||
|
|
|
|||
Loading…
Reference in New Issue