Merge remote-tracking branch 'origin/master'
This commit is contained in:
		
						commit
						91515b24e8
					
				| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
package com.bonus.common.biz.utils;
 | 
			
		||||
 | 
			
		||||
import com.alibaba.fastjson.JSON;
 | 
			
		||||
import com.alibaba.fastjson.JSONObject;
 | 
			
		||||
 | 
			
		||||
import com.alibaba.fastjson2.JSONObject;
 | 
			
		||||
import com.bonus.common.security.utils.SecurityUtils;
 | 
			
		||||
import org.apache.http.HttpEntity;
 | 
			
		||||
import org.apache.http.client.methods.CloseableHttpResponse;
 | 
			
		||||
| 
						 | 
				
			
			@ -245,4 +245,4 @@ public class HttpHelper {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -118,4 +118,7 @@ public class LeaseTotalInfo {
 | 
			
		|||
    @ApiModelProperty(value = "分包单位")
 | 
			
		||||
    @Excel(name = "分包单位")
 | 
			
		||||
    private String subUnitName;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "工程id")
 | 
			
		||||
    private String proId;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1045,7 +1045,7 @@ public class ClzDirectServiceImpl implements ClzDirectService {
 | 
			
		|||
     */
 | 
			
		||||
    private void createWorkOrderAndPeopleDirect(SysUser sysUser, String backProName, int taskId, String taskCode, int newId,int nodeId,List<WorkPeopleInfo> userList) {
 | 
			
		||||
        String id = UUID.randomUUID().toString().replace("-", "");
 | 
			
		||||
        String webUrlBase = "/mea-h5/#/pages/businessAudit/directAudit/details";
 | 
			
		||||
        String webUrlBase = "/mea-h5/#/pages/businessAudit/siteDirectAudit/details";
 | 
			
		||||
        String queryParams = UriComponentsBuilder.newInstance()
 | 
			
		||||
                .queryParam("appId", "9fa73f046ef520b09e94bbffc3b07702")
 | 
			
		||||
                .queryParam("taskId", taskId)
 | 
			
		||||
| 
						 | 
				
			
			@ -1247,7 +1247,7 @@ public class ClzDirectServiceImpl implements ClzDirectService {
 | 
			
		|||
    private void createWorkOrderAndPeople(SysUser sysUser, WorkflowEvent event, Long taskId, int newId, int nodeId, List<WorkPeopleInfo> userList) {
 | 
			
		||||
        String projectName = event.getProjectName();
 | 
			
		||||
        String id = UUID.randomUUID().toString().replace("-", "");
 | 
			
		||||
        String webUrlBase = "/mea-h5/#/pages/businessAudit/directAudit/details";
 | 
			
		||||
        String webUrlBase = "/mea-h5/#/pages/businessAudit/siteDirectAudit/details";
 | 
			
		||||
        String queryParams = UriComponentsBuilder.newInstance()
 | 
			
		||||
                .queryParam("appId", "9fa73f046ef520b09e94bbffc3b07702")
 | 
			
		||||
                .queryParam("taskId", taskId)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -1371,6 +1404,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());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -98,6 +98,22 @@ public class PushProDataUseInfoController extends BaseController {
 | 
			
		|||
            throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询重要机具详情
 | 
			
		||||
     *
 | 
			
		||||
     * @param bean
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping(value = "getDeviceNumByType")
 | 
			
		||||
    public AjaxResult getDeviceNumByType(ProIdsBean bean) {
 | 
			
		||||
        try {
 | 
			
		||||
            List<TotalNumsBean> results = service.getDeviceNumByType(bean);
 | 
			
		||||
            return AjaxResult.success(results);
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            logger.error(e.toString(), e);
 | 
			
		||||
            throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保有量、在用量、再修量、库存量 装备详情
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,6 +13,7 @@ import java.util.List;
 | 
			
		|||
@Data
 | 
			
		||||
public class ProIdsBean {
 | 
			
		||||
    private List<String> proIds;
 | 
			
		||||
    private List<String> projectIds;
 | 
			
		||||
    private Integer proId;
 | 
			
		||||
    private String proName;
 | 
			
		||||
    private Integer typeId;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,4 +34,9 @@ public class StaticsNumsBean {
 | 
			
		|||
     * 单位名称
 | 
			
		||||
     */
 | 
			
		||||
    private String unitName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 单位名称
 | 
			
		||||
     */
 | 
			
		||||
    private String deviceName;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,7 @@ package com.bonus.material.push.domain;
 | 
			
		|||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class TotalNumsBean {
 | 
			
		||||
| 
						 | 
				
			
			@ -17,6 +18,13 @@ public class TotalNumsBean {
 | 
			
		|||
    private BigDecimal num;
 | 
			
		||||
    private BigDecimal ApproachingNum;
 | 
			
		||||
    private BigDecimal TimeoutNum;
 | 
			
		||||
    private BigDecimal stNum;
 | 
			
		||||
    private BigDecimal leaseNum;
 | 
			
		||||
 | 
			
		||||
    private String deviceName;
 | 
			
		||||
 | 
			
		||||
    private List<String> projectIds;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // 可以根据需要添加分类名称getter方法
 | 
			
		||||
    public String getCategoryName() {
 | 
			
		||||
| 
						 | 
				
			
			@ -34,4 +42,4 @@ public class TotalNumsBean {
 | 
			
		|||
            default: return "未知分类";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,4 +57,6 @@ public interface ProDataUseInfoMapper {
 | 
			
		|||
    List<MachineInfoBean> getCompletionNotRefundedSub(ProIdsBean bean);
 | 
			
		||||
 | 
			
		||||
    List<MachineInfoBean> getCompletionNotRefundedDetailsSub(ProIdsBean bean);
 | 
			
		||||
 | 
			
		||||
    List<TotalNumsBean> getDeviceNumByType(ProIdsBean bean);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,4 +48,6 @@ public interface ProDataUseInfoService {
 | 
			
		|||
    List<MachineInfoBean> getCompletionNotRefundedSub(ProIdsBean bean);
 | 
			
		||||
 | 
			
		||||
    List<MachineInfoBean> getCompletionNotRefundedDetailsSub(ProIdsBean bean);
 | 
			
		||||
 | 
			
		||||
    List<TotalNumsBean> getDeviceNumByType(ProIdsBean bean);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -218,4 +218,9 @@ public class ProDataUseInfoImpl implements ProDataUseInfoService {
 | 
			
		|||
    public List<MachineInfoBean> getCompletionNotRefundedDetailsSub(ProIdsBean bean) {
 | 
			
		||||
        return proDataUseInfoMapper.getCompletionNotRefundedDetailsSub(bean);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<TotalNumsBean> getDeviceNumByType(ProIdsBean bean) {
 | 
			
		||||
        return proDataUseInfoMapper.getDeviceNumByType(bean);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -737,4 +737,542 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		|||
        </if>
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
    <select id="getDeviceNumByType" resultType="com.bonus.material.push.domain.TotalNumsBean">
 | 
			
		||||
        SELECT
 | 
			
		||||
            res.typeName as deviceName,
 | 
			
		||||
            SUM( res.storeNum ) + SUM( dsNum )+ SUM( repairNum )+ SUM( repairAuditNum )+ SUM( repairInputNum )+ SUM( inputNum ) AS stNum,
 | 
			
		||||
            SUM( res.usNum ) AS leaseNum
 | 
			
		||||
        FROM
 | 
			
		||||
            (
 | 
			
		||||
                SELECT
 | 
			
		||||
                    mt.type_id AS typeId,
 | 
			
		||||
                    mt4.type_name AS constructionType,
 | 
			
		||||
                    mt4.type_id AS firstTypeId,
 | 
			
		||||
                    mt3.type_name AS materialType,
 | 
			
		||||
                    mt3.type_id AS secondTypeId,
 | 
			
		||||
                    mt2.type_name AS typeName,
 | 
			
		||||
                    mt2.type_id AS thirdTypeId,
 | 
			
		||||
                    mt.type_name AS typeModelName,
 | 
			
		||||
                    mt.unit_name AS unit,
 | 
			
		||||
                    IFNULL( mt.buy_price, 0 ) AS buyPrice,
 | 
			
		||||
                    CASE
 | 
			
		||||
                        mt.manage_type
 | 
			
		||||
                        WHEN 0 THEN
 | 
			
		||||
                            IFNULL( subquery0.num, 0 ) ELSE IFNULL( mt.storage_num, 0 )
 | 
			
		||||
                        END AS storeNum,
 | 
			
		||||
                    IFNULL( subquery1.usNum, 0 ) AS usNum,
 | 
			
		||||
                    IFNULL( subquery2.dsNum, 0 ) AS dsNum,
 | 
			
		||||
                    IFNULL( subquery2.repairNum, 0 ) AS repairNum,
 | 
			
		||||
                    IFNULL( subquery12.repairAuditNum, 0 ) AS repairAuditNum,
 | 
			
		||||
                    IFNULL( subquery3.repairInputNum, 0 ) AS repairInputNum,
 | 
			
		||||
                    IFNULL( subquery4.inputNum, 0 ) AS inputNum,
 | 
			
		||||
                    CASE
 | 
			
		||||
                        mt.manage_type
 | 
			
		||||
                        WHEN 0 THEN
 | 
			
		||||
                                IFNULL( subquery0.num, 0 )+ IFNULL( subquery1.usNum, 0 ) + IFNULL( subquery2.dsNum, 0 ) + IFNULL( subquery2.repairNum, 0 ) + IFNULL( subquery3.repairInputNum, 0 ) + IFNULL( subquery12.repairAuditNum, 0 ) + IFNULL( subquery4.inputNum, 0 ) ELSE IFNULL( mt.storage_num, 0 )+ IFNULL( subquery1.usNum, 0 ) + IFNULL( subquery2.dsNum, 0 ) + IFNULL( subquery2.repairNum, 0 ) + IFNULL( subquery3.repairInputNum, 0 ) + IFNULL( subquery12.repairAuditNum, 0 ) + IFNULL( subquery4.inputNum, 0 )
 | 
			
		||||
                        END AS allNum,
 | 
			
		||||
                    CASE
 | 
			
		||||
                        mt.manage_type
 | 
			
		||||
                        WHEN 0 THEN
 | 
			
		||||
                            '编码' ELSE '数量'
 | 
			
		||||
                        END manageType
 | 
			
		||||
 | 
			
		||||
                FROM
 | 
			
		||||
                    ma_type mt
 | 
			
		||||
                        LEFT JOIN (
 | 
			
		||||
                        SELECT
 | 
			
		||||
                            mt.type_id,
 | 
			
		||||
                            mt4.type_name AS constructionType,
 | 
			
		||||
                            mt4.type_id AS firstTypeId,
 | 
			
		||||
                            mt3.type_name AS materialType,
 | 
			
		||||
                            mt3.type_id AS secondTypeId,
 | 
			
		||||
                            mt2.type_name AS typeName,
 | 
			
		||||
                            mt2.type_id AS thirdTypeId,
 | 
			
		||||
                            mt.type_name AS typeModelName,
 | 
			
		||||
                            count( mm.ma_id ) AS num
 | 
			
		||||
                        FROM
 | 
			
		||||
                            ma_machine mm
 | 
			
		||||
                                LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
 | 
			
		||||
                                LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
 | 
			
		||||
                        WHERE
 | 
			
		||||
                            mm.ma_code IS NOT NULL
 | 
			
		||||
                          AND mm.ma_status IN ( 1 )
 | 
			
		||||
                        GROUP BY
 | 
			
		||||
                            mt.type_id
 | 
			
		||||
                    ) AS subquery0 ON subquery0.type_id = mt.type_id
 | 
			
		||||
                        LEFT JOIN (
 | 
			
		||||
                        SELECT
 | 
			
		||||
                            mt.type_id,
 | 
			
		||||
                            mt4.type_name AS constructionType,
 | 
			
		||||
                            mt4.type_id AS firstTypeId,
 | 
			
		||||
                            mt3.type_name AS materialType,
 | 
			
		||||
                            mt3.type_id AS secondTypeId,
 | 
			
		||||
                            mt2.type_name AS typeName,
 | 
			
		||||
                            mt2.type_id AS thirdTypeId,
 | 
			
		||||
                            mt.type_name AS typeModelName,
 | 
			
		||||
                            SUM(
 | 
			
		||||
                                    IFNULL( sai.num, 0 )) AS usNum
 | 
			
		||||
                        FROM
 | 
			
		||||
                            slt_agreement_info sai
 | 
			
		||||
                                LEFT JOIN bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
 | 
			
		||||
                                LEFT JOIN bm_project_info bp ON bp.project_id = bai.project_id
 | 
			
		||||
                                LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
 | 
			
		||||
                                LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
 | 
			
		||||
                        WHERE
 | 
			
		||||
                            sai.`status` = '0'
 | 
			
		||||
                          AND sai.`is_slt` = '0'
 | 
			
		||||
                          AND ( sai.source = 1 OR sai.source IS NULL )
 | 
			
		||||
                          AND sai.end_time IS NULL
 | 
			
		||||
                          AND sai.back_id IS NULL
 | 
			
		||||
                          AND mt.type_id IN (
 | 
			
		||||
                                             2598,
 | 
			
		||||
                                             2599,
 | 
			
		||||
                                             2600,
 | 
			
		||||
                                             2601,
 | 
			
		||||
                                             2602,
 | 
			
		||||
                                             2603,
 | 
			
		||||
                                             2604,
 | 
			
		||||
                                             2605,
 | 
			
		||||
                                             2606,
 | 
			
		||||
                                             2608,
 | 
			
		||||
                                             2609,
 | 
			
		||||
                                             2610,
 | 
			
		||||
                                             2611,
 | 
			
		||||
                                             2612,
 | 
			
		||||
                                             2613,
 | 
			
		||||
                                             2614,
 | 
			
		||||
                                             2615,
 | 
			
		||||
                                             2616,
 | 
			
		||||
                                             2617,
 | 
			
		||||
                                             2618,
 | 
			
		||||
                                             2619,
 | 
			
		||||
                                             2620,
 | 
			
		||||
                                             2621,
 | 
			
		||||
                                             4341,
 | 
			
		||||
                                             4374,
 | 
			
		||||
                                             4678,
 | 
			
		||||
                                             2624,
 | 
			
		||||
                                             2625,
 | 
			
		||||
                                             2626,
 | 
			
		||||
                                             2627,
 | 
			
		||||
                                             2628,
 | 
			
		||||
                                             2629,
 | 
			
		||||
                                             2630,
 | 
			
		||||
                                             2631,
 | 
			
		||||
                                             2632,
 | 
			
		||||
                                             2633,
 | 
			
		||||
                                             2634,
 | 
			
		||||
                                             2635,
 | 
			
		||||
                                             2636,
 | 
			
		||||
                                             2637,
 | 
			
		||||
                                             2638,
 | 
			
		||||
                                             2639,
 | 
			
		||||
                                             2640,
 | 
			
		||||
                                             2641,
 | 
			
		||||
                                             2623,
 | 
			
		||||
                                             2164,
 | 
			
		||||
                                             2165,
 | 
			
		||||
                                             2166,
 | 
			
		||||
                                             4359,
 | 
			
		||||
                                             4360,
 | 
			
		||||
                                             4519,
 | 
			
		||||
                                             2411,
 | 
			
		||||
                                             4353,
 | 
			
		||||
                                             2404,
 | 
			
		||||
                                             2405,
 | 
			
		||||
                                             2406,
 | 
			
		||||
                                             2407,
 | 
			
		||||
                                             2408,
 | 
			
		||||
                                             2409,
 | 
			
		||||
                                             2410,
 | 
			
		||||
                                             2525,
 | 
			
		||||
                                             3281
 | 
			
		||||
                            )
 | 
			
		||||
 | 
			
		||||
        <if test="projectIds != null and projectIds.size() > 0">
 | 
			
		||||
            AND bp.external_id in
 | 
			
		||||
            <foreach item="item" index="index" collection="projectIds" open="(" separator="," close=")">
 | 
			
		||||
                #{item}
 | 
			
		||||
            </foreach>
 | 
			
		||||
        </if>
 | 
			
		||||
 | 
			
		||||
                        GROUP BY
 | 
			
		||||
                            mt.type_id
 | 
			
		||||
                    ) AS subquery1 ON mt.type_id = subquery1.type_id
 | 
			
		||||
                        LEFT JOIN (
 | 
			
		||||
                        SELECT
 | 
			
		||||
                            mt.type_id,
 | 
			
		||||
                            mt4.type_name AS constructionType,
 | 
			
		||||
                            mt4.type_id AS firstTypeId,
 | 
			
		||||
                            mt3.type_name AS materialType,
 | 
			
		||||
                            mt3.type_id AS secondTypeId,
 | 
			
		||||
                            mt2.type_name AS typeName,
 | 
			
		||||
                            mt2.type_id AS thirdTypeId,
 | 
			
		||||
                            mt.type_name AS typeModelName,
 | 
			
		||||
                            SUM( CASE WHEN tt.task_status = 0 AND rad.is_ds = 1 THEN IFNULL( rad.repair_num, 0 ) ELSE 0 END ) AS dsNum,
 | 
			
		||||
                            SUM(
 | 
			
		||||
                                    CASE
 | 
			
		||||
 | 
			
		||||
                                        WHEN tt.task_status = 4
 | 
			
		||||
                                            AND rad.is_ds = 0 THEN
 | 
			
		||||
                                            (
 | 
			
		||||
                                                    IFNULL( rad.repair_num, 0 ) - IFNULL( rad.repaired_num, 0 ) - IFNULL( rad.scrap_num, 0 )) ELSE 0
 | 
			
		||||
                                        END
 | 
			
		||||
                                ) AS repairNum
 | 
			
		||||
                        FROM
 | 
			
		||||
                            repair_apply_details rad
 | 
			
		||||
                                LEFT JOIN ma_type mt ON mt.type_id = rad.type_id
 | 
			
		||||
                                LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
 | 
			
		||||
                                INNER JOIN tm_task tt ON rad.task_id = tt.task_id
 | 
			
		||||
                        WHERE
 | 
			
		||||
                            tt.task_status IN ( 0, 4 )
 | 
			
		||||
                          AND tt.CODE IS NOT NULL
 | 
			
		||||
                          AND mt.type_id IN (
 | 
			
		||||
                                             2598,
 | 
			
		||||
                                             2599,
 | 
			
		||||
                                             2600,
 | 
			
		||||
                                             2601,
 | 
			
		||||
                                             2602,
 | 
			
		||||
                                             2603,
 | 
			
		||||
                                             2604,
 | 
			
		||||
                                             2605,
 | 
			
		||||
                                             2606,
 | 
			
		||||
                                             2608,
 | 
			
		||||
                                             2609,
 | 
			
		||||
                                             2610,
 | 
			
		||||
                                             2611,
 | 
			
		||||
                                             2612,
 | 
			
		||||
                                             2613,
 | 
			
		||||
                                             2614,
 | 
			
		||||
                                             2615,
 | 
			
		||||
                                             2616,
 | 
			
		||||
                                             2617,
 | 
			
		||||
                                             2618,
 | 
			
		||||
                                             2619,
 | 
			
		||||
                                             2620,
 | 
			
		||||
                                             2621,
 | 
			
		||||
                                             4341,
 | 
			
		||||
                                             4374,
 | 
			
		||||
                                             4678,
 | 
			
		||||
                                             2624,
 | 
			
		||||
                                             2625,
 | 
			
		||||
                                             2626,
 | 
			
		||||
                                             2627,
 | 
			
		||||
                                             2628,
 | 
			
		||||
                                             2629,
 | 
			
		||||
                                             2630,
 | 
			
		||||
                                             2631,
 | 
			
		||||
                                             2632,
 | 
			
		||||
                                             2633,
 | 
			
		||||
                                             2634,
 | 
			
		||||
                                             2635,
 | 
			
		||||
                                             2636,
 | 
			
		||||
                                             2637,
 | 
			
		||||
                                             2638,
 | 
			
		||||
                                             2639,
 | 
			
		||||
                                             2640,
 | 
			
		||||
                                             2641,
 | 
			
		||||
                                             2623,
 | 
			
		||||
                                             2164,
 | 
			
		||||
                                             2165,
 | 
			
		||||
                                             2166,
 | 
			
		||||
                                             4359,
 | 
			
		||||
                                             4360,
 | 
			
		||||
                                             4519,
 | 
			
		||||
                                             2411,
 | 
			
		||||
                                             4353,
 | 
			
		||||
                                             2404,
 | 
			
		||||
                                             2405,
 | 
			
		||||
                                             2406,
 | 
			
		||||
                                             2407,
 | 
			
		||||
                                             2408,
 | 
			
		||||
                                             2409,
 | 
			
		||||
                                             2410,
 | 
			
		||||
                                             2525,
 | 
			
		||||
                                             3281
 | 
			
		||||
                            )
 | 
			
		||||
                        GROUP BY
 | 
			
		||||
                            mt.type_id
 | 
			
		||||
                    ) AS subquery2 ON subquery2.type_id = mt.type_id
 | 
			
		||||
                        LEFT JOIN (
 | 
			
		||||
                        SELECT
 | 
			
		||||
                            mt.type_id,
 | 
			
		||||
                            mt4.type_name AS constructionType,
 | 
			
		||||
                            mt4.type_id AS firstTypeId,
 | 
			
		||||
                            mt3.type_name AS materialType,
 | 
			
		||||
                            mt3.type_id AS secondTypeId,
 | 
			
		||||
                            mt2.type_name AS typeName,
 | 
			
		||||
                            mt2.type_id AS thirdTypeId,
 | 
			
		||||
                            mt.type_name AS typeModelName,
 | 
			
		||||
                            SUM( IFNULL( rad.repair_num, 0 ) ) AS repairAuditNum
 | 
			
		||||
                        FROM
 | 
			
		||||
                            repair_audit_details rad
 | 
			
		||||
                                LEFT JOIN ma_type mt ON mt.type_id = rad.type_id
 | 
			
		||||
                                LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
 | 
			
		||||
                                LEFT JOIN tm_task tt ON rad.task_id = tt.task_id
 | 
			
		||||
                        WHERE
 | 
			
		||||
                            tt.CODE IS NOT NULL
 | 
			
		||||
                          AND rad.`status` = '0'
 | 
			
		||||
                        GROUP BY
 | 
			
		||||
                            mt.type_id
 | 
			
		||||
                    ) AS subquery12 ON subquery12.type_id = mt.type_id
 | 
			
		||||
                        LEFT JOIN (
 | 
			
		||||
                        SELECT
 | 
			
		||||
                            mt.type_id,
 | 
			
		||||
                            mt4.type_name AS constructionType,
 | 
			
		||||
                            mt4.type_id AS firstTypeId,
 | 
			
		||||
                            mt3.type_name AS materialType,
 | 
			
		||||
                            mt3.type_id AS secondTypeId,
 | 
			
		||||
                            mt2.type_name AS typeName,
 | 
			
		||||
                            mt2.type_id AS thirdTypeId,
 | 
			
		||||
                            mt.type_name AS typeModelName,
 | 
			
		||||
                            SUM(
 | 
			
		||||
                                        IFNULL( rid.repair_num, 0 ) - IFNULL( rid.input_num, 0 ) - IFNULL( rid.reject_num, 0 )) AS repairInputNum
 | 
			
		||||
                        FROM
 | 
			
		||||
                            repair_input_details rid
 | 
			
		||||
                                LEFT JOIN ma_type mt ON mt.type_id = rid.type_id
 | 
			
		||||
                                LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
 | 
			
		||||
                                LEFT JOIN tm_task tt ON rid.task_id = tt.task_id
 | 
			
		||||
                        WHERE
 | 
			
		||||
                                    IFNULL( rid.repair_num, 0 ) - IFNULL( rid.input_num, 0 ) - IFNULL( rid.reject_num, 0 ) > 0
 | 
			
		||||
                          AND tt.task_status = 0
 | 
			
		||||
                          AND mt.type_id IN (
 | 
			
		||||
                                             2598,
 | 
			
		||||
                                             2599,
 | 
			
		||||
                                             2600,
 | 
			
		||||
                                             2601,
 | 
			
		||||
                                             2602,
 | 
			
		||||
                                             2603,
 | 
			
		||||
                                             2604,
 | 
			
		||||
                                             2605,
 | 
			
		||||
                                             2606,
 | 
			
		||||
                                             2608,
 | 
			
		||||
                                             2609,
 | 
			
		||||
                                             2610,
 | 
			
		||||
                                             2611,
 | 
			
		||||
                                             2612,
 | 
			
		||||
                                             2613,
 | 
			
		||||
                                             2614,
 | 
			
		||||
                                             2615,
 | 
			
		||||
                                             2616,
 | 
			
		||||
                                             2617,
 | 
			
		||||
                                             2618,
 | 
			
		||||
                                             2619,
 | 
			
		||||
                                             2620,
 | 
			
		||||
                                             2621,
 | 
			
		||||
                                             4341,
 | 
			
		||||
                                             4374,
 | 
			
		||||
                                             4678,
 | 
			
		||||
                                             2624,
 | 
			
		||||
                                             2625,
 | 
			
		||||
                                             2626,
 | 
			
		||||
                                             2627,
 | 
			
		||||
                                             2628,
 | 
			
		||||
                                             2629,
 | 
			
		||||
                                             2630,
 | 
			
		||||
                                             2631,
 | 
			
		||||
                                             2632,
 | 
			
		||||
                                             2633,
 | 
			
		||||
                                             2634,
 | 
			
		||||
                                             2635,
 | 
			
		||||
                                             2636,
 | 
			
		||||
                                             2637,
 | 
			
		||||
                                             2638,
 | 
			
		||||
                                             2639,
 | 
			
		||||
                                             2640,
 | 
			
		||||
                                             2641,
 | 
			
		||||
                                             2623,
 | 
			
		||||
                                             2164,
 | 
			
		||||
                                             2165,
 | 
			
		||||
                                             2166,
 | 
			
		||||
                                             4359,
 | 
			
		||||
                                             4360,
 | 
			
		||||
                                             4519,
 | 
			
		||||
                                             2411,
 | 
			
		||||
                                             4353,
 | 
			
		||||
                                             2404,
 | 
			
		||||
                                             2405,
 | 
			
		||||
                                             2406,
 | 
			
		||||
                                             2407,
 | 
			
		||||
                                             2408,
 | 
			
		||||
                                             2409,
 | 
			
		||||
                                             2410,
 | 
			
		||||
                                             2525,
 | 
			
		||||
                                             3281
 | 
			
		||||
                            )
 | 
			
		||||
                        GROUP BY
 | 
			
		||||
                            mt.type_id
 | 
			
		||||
                    ) AS subquery3 ON subquery3.type_id = mt.type_id
 | 
			
		||||
                        LEFT JOIN (
 | 
			
		||||
                        SELECT
 | 
			
		||||
                            mt.type_id,
 | 
			
		||||
                            mt4.type_name AS constructionType,
 | 
			
		||||
                            mt4.type_id AS firstTypeId,
 | 
			
		||||
                            mt3.type_name AS materialType,
 | 
			
		||||
                            mt3.type_id AS secondTypeId,
 | 
			
		||||
                            mt2.type_name AS typeName,
 | 
			
		||||
                            mt2.type_id AS thirdTypeId,
 | 
			
		||||
                            mt.type_name AS typeModelName,
 | 
			
		||||
                            SUM(
 | 
			
		||||
                                    IFNULL( pcd.check_num, 0 ) - IFNULL( pcd.input_num, 0 )) AS inputNum
 | 
			
		||||
                        FROM
 | 
			
		||||
                            purchase_check_details pcd
 | 
			
		||||
                                LEFT JOIN ma_type mt ON mt.type_id = pcd.type_id
 | 
			
		||||
                                LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
 | 
			
		||||
                                LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
 | 
			
		||||
                        WHERE
 | 
			
		||||
                            IFNULL( pcd.check_num, 0 ) - IFNULL( pcd.input_num, 0 ) > 0
 | 
			
		||||
                          AND pcd.STATUS IN ( 3, 4, 13, 14 )
 | 
			
		||||
                          AND mt.type_id IN (
 | 
			
		||||
                                             2598,
 | 
			
		||||
                                             2599,
 | 
			
		||||
                                             2600,
 | 
			
		||||
                                             2601,
 | 
			
		||||
                                             2602,
 | 
			
		||||
                                             2603,
 | 
			
		||||
                                             2604,
 | 
			
		||||
                                             2605,
 | 
			
		||||
                                             2606,
 | 
			
		||||
                                             2608,
 | 
			
		||||
                                             2609,
 | 
			
		||||
                                             2610,
 | 
			
		||||
                                             2611,
 | 
			
		||||
                                             2612,
 | 
			
		||||
                                             2613,
 | 
			
		||||
                                             2614,
 | 
			
		||||
                                             2615,
 | 
			
		||||
                                             2616,
 | 
			
		||||
                                             2617,
 | 
			
		||||
                                             2618,
 | 
			
		||||
                                             2619,
 | 
			
		||||
                                             2620,
 | 
			
		||||
                                             2621,
 | 
			
		||||
                                             4341,
 | 
			
		||||
                                             4374,
 | 
			
		||||
                                             4678,
 | 
			
		||||
                                             2624,
 | 
			
		||||
                                             2625,
 | 
			
		||||
                                             2626,
 | 
			
		||||
                                             2627,
 | 
			
		||||
                                             2628,
 | 
			
		||||
                                             2629,
 | 
			
		||||
                                             2630,
 | 
			
		||||
                                             2631,
 | 
			
		||||
                                             2632,
 | 
			
		||||
                                             2633,
 | 
			
		||||
                                             2634,
 | 
			
		||||
                                             2635,
 | 
			
		||||
                                             2636,
 | 
			
		||||
                                             2637,
 | 
			
		||||
                                             2638,
 | 
			
		||||
                                             2639,
 | 
			
		||||
                                             2640,
 | 
			
		||||
                                             2641,
 | 
			
		||||
                                             2623,
 | 
			
		||||
                                             2164,
 | 
			
		||||
                                             2165,
 | 
			
		||||
                                             2166,
 | 
			
		||||
                                             4359,
 | 
			
		||||
                                             4360,
 | 
			
		||||
                                             4519,
 | 
			
		||||
                                             2411,
 | 
			
		||||
                                             4353,
 | 
			
		||||
                                             2404,
 | 
			
		||||
                                             2405,
 | 
			
		||||
                                             2406,
 | 
			
		||||
                                             2407,
 | 
			
		||||
                                             2408,
 | 
			
		||||
                                             2409,
 | 
			
		||||
                                             2410,
 | 
			
		||||
                                             2525,
 | 
			
		||||
                                             3281
 | 
			
		||||
                            )
 | 
			
		||||
                        GROUP BY
 | 
			
		||||
                            mt.type_id
 | 
			
		||||
                    ) AS subquery4 ON subquery4.type_id = mt.type_id
 | 
			
		||||
 | 
			
		||||
                        LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
 | 
			
		||||
                        LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
 | 
			
		||||
                        LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
 | 
			
		||||
                WHERE
 | 
			
		||||
                    mt.del_flag = '0'
 | 
			
		||||
                  AND mt.type_id IN (
 | 
			
		||||
                                     2598,
 | 
			
		||||
                                     2599,
 | 
			
		||||
                                     2600,
 | 
			
		||||
                                     2601,
 | 
			
		||||
                                     2602,
 | 
			
		||||
                                     2603,
 | 
			
		||||
                                     2604,
 | 
			
		||||
                                     2605,
 | 
			
		||||
                                     2606,
 | 
			
		||||
                                     2608,
 | 
			
		||||
                                     2609,
 | 
			
		||||
                                     2610,
 | 
			
		||||
                                     2611,
 | 
			
		||||
                                     2612,
 | 
			
		||||
                                     2613,
 | 
			
		||||
                                     2614,
 | 
			
		||||
                                     2615,
 | 
			
		||||
                                     2616,
 | 
			
		||||
                                     2617,
 | 
			
		||||
                                     2618,
 | 
			
		||||
                                     2619,
 | 
			
		||||
                                     2620,
 | 
			
		||||
                                     2621,
 | 
			
		||||
                                     4341,
 | 
			
		||||
                                     4374,
 | 
			
		||||
                                     4678,
 | 
			
		||||
                                     2624,
 | 
			
		||||
                                     2625,
 | 
			
		||||
                                     2626,
 | 
			
		||||
                                     2627,
 | 
			
		||||
                                     2628,
 | 
			
		||||
                                     2629,
 | 
			
		||||
                                     2630,
 | 
			
		||||
                                     2631,
 | 
			
		||||
                                     2632,
 | 
			
		||||
                                     2633,
 | 
			
		||||
                                     2634,
 | 
			
		||||
                                     2635,
 | 
			
		||||
                                     2636,
 | 
			
		||||
                                     2637,
 | 
			
		||||
                                     2638,
 | 
			
		||||
                                     2639,
 | 
			
		||||
                                     2640,
 | 
			
		||||
                                     2641,
 | 
			
		||||
                                     2623,
 | 
			
		||||
                                     2164,
 | 
			
		||||
                                     2165,
 | 
			
		||||
                                     2166,
 | 
			
		||||
                                     4359,
 | 
			
		||||
                                     4360,
 | 
			
		||||
                                     4519,
 | 
			
		||||
                                     2411,
 | 
			
		||||
                                     4353,
 | 
			
		||||
                                     2404,
 | 
			
		||||
                                     2405,
 | 
			
		||||
                                     2406,
 | 
			
		||||
                                     2407,
 | 
			
		||||
                                     2408,
 | 
			
		||||
                                     2409,
 | 
			
		||||
                                     2410,
 | 
			
		||||
                                     2525,
 | 
			
		||||
                                     3281
 | 
			
		||||
                    )
 | 
			
		||||
            ) res
 | 
			
		||||
        GROUP BY
 | 
			
		||||
            res.typeName
 | 
			
		||||
    </select>
 | 
			
		||||
</mapper>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue