Commit e2a5e401 authored by zhangyingbin's avatar zhangyingbin

提交资料 获取管材列表(建设单位) 分页查询接口

parent 7384c6c0
......@@ -142,6 +142,23 @@ public class MaterialController extends BaseController {
}
/**
* 提交资料 获取管材列表(建设单位) 分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping( value = "/pageList")
@ApiOperation(httpMethod = "GET",value = "材料信息表分页查询", notes = "材料信息表分页查询")
public ResponseModel<IPage<Material>> queryPage( int current, int size, Material material) {
IPage<Material> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(materialServiceImpl.queryMaterialPage(page,material));
}
/**
* 列表全部数据查询
*
* @return
......
......@@ -54,6 +54,9 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
@Autowired
CompanyServiceImpl companyService;
@Autowired
ProjectServiceImpl projectService;
/**
* 分页查询
*/
......@@ -71,6 +74,62 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
return this.page(page,wrapper);
}
/**
* 提交资料 获取管材列表(建设单位) 分页查询
*/
@BusinessIdentify
public IPage<Material> queryMaterialPage(IPage<Material> page, Material material) {
LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
getWrapper(wrapper,material);
wrapper.in(Material::getCompanyId,getCompanyIds());
return this.page(page,wrapper);
}
public void getWrapper(LambdaQueryWrapper<Material> wrapper,Material material){
if(!ValidationUtil.isEmpty(material.getName())){
wrapper.like(Material::getName,material.getName());
}
if(!ValidationUtil.isEmpty(material.getCode())){
wrapper.like(Material::getCode,material.getCode());
}
if(!ValidationUtil.isEmpty(material.getType())){
wrapper.like(Material::getType,material.getType());
}
if(!ValidationUtil.isEmpty(material.getMaterial())){
wrapper.like(Material::getMaterial,material.getMaterial());
}
if(!ValidationUtil.isEmpty(material.getManufactureDate())){
wrapper.like(Material::getManufactureDate,material.getManufactureDate());
}
if(!ValidationUtil.isEmpty(material.getSpec())){
wrapper.like(Material::getSpec,material.getSpec());
}
if(!ValidationUtil.isEmpty(material.getBatchNum())){
wrapper.like(Material::getBatchNum,material.getBatchNum());
}
if(!ValidationUtil.isEmpty(material.getApproved())){
wrapper.like(Material::getApproved,material.getApproved());
}
if(!ValidationUtil.isEmpty(material.getCompanyId())){
wrapper.like(Material::getCompanyId,material.getCompanyId());
}
if(!ValidationUtil.isEmpty(material.getDiameter())){
wrapper.like(Material::getDiameter,material.getDiameter());
}
if(!ValidationUtil.isEmpty(material.getLength())){
wrapper.like(Material::getLength,material.getLength());
}
if(!ValidationUtil.isEmpty(material.getManufactureAddr())){
wrapper.like(Material::getManufactureAddr,material.getManufactureAddr());
}
if(!ValidationUtil.isEmpty(material.getOrgCode())){
wrapper.like(Material::getOrgCode,material.getOrgCode());
}
if(!ValidationUtil.isEmpty(material.getWallThickness())){
wrapper.like(Material::getWallThickness,material.getWallThickness());
}
}
@BusinessIdentify
public Set<Long> getCompanyIds(){
List<String> regionCodeList = 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