Commit a5d9669e authored by zhangyingbin's avatar zhangyingbin

修改 项目质量监检信息列表接口 添加约束

parent 84fab15e
...@@ -2,14 +2,15 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper; ...@@ -2,14 +2,15 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto; import com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.QualityInfo; import com.yeejoin.amos.boot.module.ugp.api.entity.QualityInfo;
import java.util.Set;
import java.util.List; import java.util.List;
public interface IInstallationQualityMapper extends BaseMapper<QualityInfo> { public interface IInstallationQualityMapper extends BaseMapper<QualityInfo> {
List<QualityInfo> findss(PercentOfPassDto dto); Page<QualityInfo> findss(Page<QualityInfo> page,PercentOfPassDto dto,Set<String> projectId);
......
...@@ -8,7 +8,7 @@ import java.util.List; ...@@ -8,7 +8,7 @@ import java.util.List;
public interface IInstallationQualityService { public interface IInstallationQualityService {
Page<PercentOfPassDto> find(Page<PercentOfPassDto> page,PercentOfPassDto percentOfPassDto); Page<PercentOfPassDto> find(int current,int size,PercentOfPassDto pd);
} }
...@@ -54,6 +54,12 @@ ...@@ -54,6 +54,12 @@
and and
pt.name like concat( '%',#{name},'%') pt.name like concat( '%',#{name},'%')
</if> </if>
<if test="projectIds != null and projectIds.size > 0">
and qy.project_id in
<foreach collection="projectIds" separator="," item="item" close=")" open="(" index="index">
#{item}
</foreach>
</if>
order by rec_date desc order by rec_date desc
......
...@@ -46,10 +46,7 @@ private WeldServiceImpl weld; ...@@ -46,10 +46,7 @@ private WeldServiceImpl weld;
@ApiOperation(httpMethod = "GET", value = "质量问题闭环管理-安装质量监检信息-质量监检信息", notes = "质量问题闭环管理-安装质量监检信息-质量监检信息") @ApiOperation(httpMethod = "GET", value = "质量问题闭环管理-安装质量监检信息-质量监检信息", notes = "质量问题闭环管理-安装质量监检信息-质量监检信息")
public ResponseModel<Page<PercentOfPassDto>> find(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<PercentOfPassDto>> find(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, PercentOfPassDto percentOfPassDto) { (value = "size") int size, PercentOfPassDto percentOfPassDto) {
Page<PercentOfPassDto> page = new Page<>(); return ResponseHelper.buildResponse(services.find(current,size,percentOfPassDto));
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(services.find(page,percentOfPassDto));
} }
......
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
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.dto.PercentOfPassDto; import com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto; import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto;
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;
...@@ -13,14 +14,18 @@ import com.yeejoin.amos.boot.module.ugp.api.service.IInstallationQualityService; ...@@ -13,14 +14,18 @@ import com.yeejoin.amos.boot.module.ugp.api.service.IInstallationQualityService;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -40,13 +45,25 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali ...@@ -40,13 +45,25 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
@Resource @Resource
private OrgUsrServiceImpl orgUsrService; private OrgUsrServiceImpl orgUsrService;
@Autowired
ProjectResourceServiceImpl projectResourceService;
//分页查询项目质量监检信息 //分页查询项目质量监检信息
@Override @Override
public Page<PercentOfPassDto> find(Page<PercentOfPassDto> page,PercentOfPassDto pd) { public Page<PercentOfPassDto> find(int current,int size,PercentOfPassDto pd) {
Page page = new Page<>();
List<QualityInfo> qfList = mapper.findss ( pd); page.setCurrent(current);
page.setSize(size);
Set<String> projectIds = new HashSet<>();
for(Project project:projectResourceService.getProjectList()){
projectIds.add(String.valueOf(project.getSequenceNbr()));
}
if(ValidationUtil.isEmpty(projectIds)){
return page;
}
page = mapper.findss(page,pd,projectIds);
List<QualityInfo> qfList = page.getRecords();
List<PercentOfPassDto> list = new ArrayList<> ( ); List<PercentOfPassDto> list = new ArrayList<> ( );
for (QualityInfo qualityInfo : qfList) { for (QualityInfo qualityInfo : qfList) {
......
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