Commit 0a860fb3 authored by wanglong's avatar wanglong

当为监检机构登录时 获取所有项目的质量监检信息

parent c219a9ba
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
</association> </association>
</resultMap> </resultMap>
...@@ -50,13 +50,16 @@ ...@@ -50,13 +50,16 @@
qy.is_delete =0 qy.is_delete =0
and and
pt.is_delete=0 pt.is_delete=0
<if test="name !='' and name != null"> <if test="dto !=null">
and <if test="dto.name !='' and dto.name != null">
pt.name like concat( '%',#{name},'%') and
</if> pt.name like concat( '%',#{dto.name},'%')
<if test="projectIds != null and projectIds.size > 0"> </if>
and qy.project_id in </if>
<foreach collection="projectIds" separator="," item="item" close=")" open="(" index="index">
<if test="projectId != null and projectId.size > 0">
and qy.project_id in
<foreach collection="projectId" item ="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto; import com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto;
...@@ -11,7 +12,9 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Project; ...@@ -11,7 +12,9 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.entity.QualityInfo; import com.yeejoin.amos.boot.module.ugp.api.entity.QualityInfo;
import com.yeejoin.amos.boot.module.ugp.api.entity.Weld; import com.yeejoin.amos.boot.module.ugp.api.entity.Weld;
import com.yeejoin.amos.boot.module.ugp.api.mapper.IInstallationQualityMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.IInstallationQualityMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallationQualityService; import com.yeejoin.amos.boot.module.ugp.api.service.IInstallationQualityService;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import jdk.nashorn.internal.runtime.logging.Logger; import jdk.nashorn.internal.runtime.logging.Logger;
import lombok.extern.log4j.Log4j; import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -27,6 +30,7 @@ import java.util.ArrayList; ...@@ -27,6 +30,7 @@ import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -42,29 +46,47 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali ...@@ -42,29 +46,47 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
@Resource @Resource
private IInstallationQualityMapper mapper; private IInstallationQualityMapper mapper;
@Autowired
private ProjectMapper projectMapper;
@Resource @Resource
private WeldServiceImpl weldService; private WeldServiceImpl weldService;
@Resource @Resource
private OrgUsrServiceImpl orgUsrService; private OrgUsrServiceImpl orgUsrService;
@Autowired
OrgServiceImpl orgService;
@Autowired @Autowired
ProjectResourceServiceImpl projectResourceService; ProjectResourceServiceImpl projectResourceService;
static final String 监检="WzNVBO";
//分页查询项目质量监检信息 //分页查询项目质量监检信息
@Override @Override
@BusinessIdentify
public Page<PercentOfPassDto> find(int current,int size,PercentOfPassDto pd) { public Page<PercentOfPassDto> find(int current,int size,PercentOfPassDto pd) {
Page page = new Page<>(); Page page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
Set<String> projectIds = new HashSet<>(); Set<String> projectIds = new HashSet<>();
for(Project project:projectResourceService.getProjectList()){ Long companySequenceNbr = orgService.getReginParams().getBusinessInfo().getCompanySequenceNbr();
projectIds.add(String.valueOf(project.getSequenceNbr())); OrgUsr orgUsrById = orgService.getOrgUsrById(String.valueOf(companySequenceNbr));
} if (Pattern.matches(orgUsrById.getBizOrgCode(),监检)){
if(ValidationUtil.isEmpty(projectIds)){ List<Project> projects = projectMapper.selectList(null);
return page; for (Project i:projects){
projectIds.add(String.valueOf(i.getSequenceNbr()));
}
page = mapper.findss(page,pd,projectIds);
}else {
for (Project project : projectResourceService.getProjectList()) {
projectIds.add(String.valueOf(project.getSequenceNbr()));
}
if (ValidationUtil.isEmpty(projectIds)) {
return page;
}
page = mapper.findss(page, pd, projectIds);
} }
page = mapper.findss(page,pd,projectIds);
List<QualityInfo> qfList = page.getRecords(); List<QualityInfo> qfList = page.getRecords();
List<PercentOfPassDto> list = new ArrayList<> ( ); List<PercentOfPassDto> list = new ArrayList<> ( );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment