Commit 197cc39f authored by wanglong's avatar wanglong

添加模糊筛选

parent 8ef35e0e
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
...@@ -24,68 +25,68 @@ public class Company extends BaseEntity { ...@@ -24,68 +25,68 @@ public class Company extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "企业名称") @TableField("name")
private String name; private String name;
@ApiModelProperty(value = "企业类型") @TableField("type")
private String type; private String type;
@ApiModelProperty(value = "统一信用代码") @TableField("credit_code")
private String creditCode; private String creditCode;
@ApiModelProperty(value = "许可证号") @TableField("license_number")
private String licenseNumber; private String licenseNumber;
@ApiModelProperty(value = "有效期至") @TableField("expiration_date")
private Date expirationDate; private Date expirationDate;
@ApiModelProperty(value = "企业地址") @TableField("address")
private String address; private String address;
@ApiModelProperty(value = "联系方式") @TableField("contact_phone")
private String contactPhone; private String contactPhone;
@ApiModelProperty(value = "联系人") @TableField("contact")
private String contact; private String contact;
@TableField("remark")
private String remark; private String remark;
@ApiModelProperty(value = "统一信用代码证书附件") @TableField("credit_attch")
private String creditAttch; private String creditAttch;
@ApiModelProperty(value = "许可证附件") @TableField("license_attch")
private String licenseAttch; private String licenseAttch;
@ApiModelProperty(value = "是否已审核(1已审核,0未审核)") @TableField("approved")
private String approved; private String approved;
@ApiModelProperty(value = "单位机构代码") @TableField("org_code")
private String orgCode; private String orgCode;
@ApiModelProperty(value = "企业管理员") @TableField("admin_name")
private String adminName; private String adminName;
@ApiModelProperty(value = "企业管理员电话") @TableField("admin_tel")
private String adminTel; private String adminTel;
@ApiModelProperty(value = "法人") @TableField("legal_person")
private String legalPerson; private String legalPerson;
@ApiModelProperty(value = "法人电话") @TableField("legal_person_tel")
private String legalPersonTel; private String legalPersonTel;
@ApiModelProperty(value = "单位电话") @TableField("unit_tel")
private String unitTel; private String unitTel;
@ApiModelProperty(value = "成立日期") @TableField("create_time")
private Date createTime; private Date createTime;
@ApiModelProperty(value = "管理员身份证附件") @TableField("admin_lincense_pic")
private String adminLincensePic; private String adminLincensePic;
@ApiModelProperty(value = "用户名") @TableField("admin_login_name")
private String adminLoginName; private String adminLoginName;
@ApiModelProperty(value = "用户密码") @TableField("admin_login_pwd")
private String adminLoginPwd; private String adminLoginPwd;
} }
package com.yeejoin.amos.boot.module.ugp.api.mapper; 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.CompanyDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company; import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 企业信息表 Mapper 接口 * 企业信息表 Mapper 接口
...@@ -9,5 +15,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Company; ...@@ -9,5 +15,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
* @author system_generator * @author system_generator
* @date 2022-09-22 * @date 2022-09-22
*/ */
@Mapper
public interface CompanyMapper extends BaseMapper<Company> { public interface CompanyMapper extends BaseMapper<Company> {
List<CompanyDto> queryCompanyPage(Company companyParam);
} }
package com.yeejoin.amos.boot.module.ugp.api.mapper; package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.yeejoin.amos.boot.module.ugp.api.dto.SmartListDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Verify; import com.yeejoin.amos.boot.module.ugp.api.entity.Verify;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -21,6 +22,6 @@ public interface VerifyMapper extends BaseMapper<Verify> { ...@@ -21,6 +22,6 @@ public interface VerifyMapper extends BaseMapper<Verify> {
* @return * @return
*/ */
List<Verify> commonality(String stage); List<Verify> commonality(String stage,SmartListDto smartListDto);
} }
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ugp.api.service; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company; import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
/** /**
...@@ -12,6 +14,8 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Company; ...@@ -12,6 +14,8 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
*/ */
public interface ICompanyService { public interface ICompanyService {
Page<CompanyDto> queryCompanyPage(int current, int size,Company company);
} }
...@@ -10,6 +10,6 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.SmartListDto; ...@@ -10,6 +10,6 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.SmartListDto;
* @date 2022-09-22 * @date 2022-09-22
*/ */
public interface IVerifyService { public interface IVerifyService {
Page<SmartListDto> commonality(String stage, Page<SmartListDto> page); Page<SmartListDto> commonality(String stage, Page<SmartListDto> page,SmartListDto smartListDto);
} }
...@@ -2,4 +2,17 @@ ...@@ -2,4 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper">
<select id="queryCompanyPage" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Company">
select * from tz_ugp_company
<where>
<if test="name != '' and name != null">
and `name` like concat('%',#{name},'%')
</if>
<if test="type != '' and type != null">
and `type` like concat('%',#{type},'%')
</if>
</where>
</select>
</mapper> </mapper>
...@@ -52,6 +52,16 @@ ...@@ -52,6 +52,16 @@
and and
vf.stage =#{stage} vf.stage =#{stage}
</if> </if>
<if test="smartListDto.name !='' and smartListDto.name != null">
and
pt.name like '%${smartListDto.name}%'
</if>
<if test="smartListDto.projectCode !='' and smartListDto.projectCode != null">
and
pt.code like '%${smartListDto.projectCode}%'
</if>
</select> </select>
</mapper> </mapper>
...@@ -130,9 +130,9 @@ public class CompanyController extends BaseController { ...@@ -130,9 +130,9 @@ public class CompanyController extends BaseController {
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "企业信息表分页查询", notes = "企业信息表分页查询") @ApiOperation(httpMethod = "GET",value = "企业信息表分页查询", notes = "企业信息表分页查询")
public ResponseModel<Page<CompanyDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<CompanyDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size,CompanyDto companyDto) { (value = "size") int size,Company company) {
return ResponseHelper.buildResponse(companyServiceImpl.queryCompanyPage(current,size,companyDto)); return ResponseHelper.buildResponse(companyServiceImpl.queryCompanyPage(current,size,company));
} }
/** /**
......
...@@ -139,11 +139,11 @@ public class VerifyController extends BaseController { ...@@ -139,11 +139,11 @@ public class VerifyController extends BaseController {
@GetMapping(value = "/selectTubular") @GetMapping(value = "/selectTubular")
@ApiOperation(httpMethod = "GET", value = "焊接管材检验信息列表", notes = "焊接管材检验信息列表") @ApiOperation(httpMethod = "GET", value = "焊接管材检验信息列表", notes = "焊接管材检验信息列表")
public ResponseModel<Page<SmartListDto>> selectTubular(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<SmartListDto>> selectTubular(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) { (value = "size") int size,SmartListDto smartListDto) {
Page<SmartListDto> page = new Page<>(); Page<SmartListDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(service.commonality(StageEnum.焊前管材质量.getStage(),page)); return ResponseHelper.buildResponse(service.commonality(StageEnum.焊前管材质量.getStage(),page,smartListDto));
} }
/** cpp /** cpp
* *
...@@ -158,11 +158,11 @@ public class VerifyController extends BaseController { ...@@ -158,11 +158,11 @@ public class VerifyController extends BaseController {
@GetMapping(value = "/selectWorker") @GetMapping(value = "/selectWorker")
@ApiOperation(httpMethod = "GET", value = "查询焊接人员检验信息列表", notes = "查询焊接人员检验信息列表") @ApiOperation(httpMethod = "GET", value = "查询焊接人员检验信息列表", notes = "查询焊接人员检验信息列表")
public ResponseModel<Page<SmartListDto>> selectWorker(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<SmartListDto>> selectWorker(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) { (value = "size") int size,SmartListDto smartListDto) {
Page<SmartListDto> page = new Page<>(); Page<SmartListDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(service.commonality(StageEnum.焊前人员.getStage(),page)); return ResponseHelper.buildResponse(service.commonality(StageEnum.焊前人员.getStage(),page,smartListDto));
} }
/** cpp /** cpp
...@@ -177,11 +177,11 @@ public class VerifyController extends BaseController { ...@@ -177,11 +177,11 @@ public class VerifyController extends BaseController {
@GetMapping(value = "/selectFacility") @GetMapping(value = "/selectFacility")
@ApiOperation(httpMethod = "GET", value = "查询焊接设备检验信息列表", notes = "查询焊接设备检验信息列表") @ApiOperation(httpMethod = "GET", value = "查询焊接设备检验信息列表", notes = "查询焊接设备检验信息列表")
public ResponseModel<Page<SmartListDto>> selectFacility(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<SmartListDto>> selectFacility(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) { (value = "size") int size,SmartListDto smartListDto) {
Page<SmartListDto> page = new Page<>(); Page<SmartListDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(service.commonality(StageEnum.焊前设备.getStage(),page)); return ResponseHelper.buildResponse(service.commonality(StageEnum.焊前设备.getStage(),page,smartListDto));
} }
/** cpp /** cpp
* *
...@@ -195,11 +195,11 @@ public class VerifyController extends BaseController { ...@@ -195,11 +195,11 @@ public class VerifyController extends BaseController {
@GetMapping(value = "/selectCraft") @GetMapping(value = "/selectCraft")
@ApiOperation(httpMethod = "GET", value = "查询焊接工艺检验信息列表", notes = "查询焊接工艺检验信息列表") @ApiOperation(httpMethod = "GET", value = "查询焊接工艺检验信息列表", notes = "查询焊接工艺检验信息列表")
public ResponseModel<Page<SmartListDto>> selectCraft(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<SmartListDto>> selectCraft(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) { (value = "size") int size,SmartListDto smartListDto) {
Page<SmartListDto> page = new Page<>(); Page<SmartListDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(service.commonality(StageEnum.焊接工艺.getStage(),page)); return ResponseHelper.buildResponse(service.commonality(StageEnum.焊接工艺.getStage(),page,smartListDto));
} }
/** cpp /** cpp
* *
...@@ -213,11 +213,11 @@ public class VerifyController extends BaseController { ...@@ -213,11 +213,11 @@ public class VerifyController extends BaseController {
@GetMapping(value = "/selectVoltage") @GetMapping(value = "/selectVoltage")
@ApiOperation(httpMethod = "GET", value = "查询管道耐压检验信息列表", notes = "查询管道耐压检验信息列表") @ApiOperation(httpMethod = "GET", value = "查询管道耐压检验信息列表", notes = "查询管道耐压检验信息列表")
public ResponseModel<Page<SmartListDto>> selectVoltage(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<SmartListDto>> selectVoltage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) { (value = "size") int size,SmartListDto smartListDto) {
Page<SmartListDto> page = new Page<>(); Page<SmartListDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(service.commonality(StageEnum.管道耐压.getStage(),page)); return ResponseHelper.buildResponse(service.commonality(StageEnum.管道耐压.getStage(),page,smartListDto));
} }
/** cpp /** cpp
...@@ -232,11 +232,11 @@ public class VerifyController extends BaseController { ...@@ -232,11 +232,11 @@ public class VerifyController extends BaseController {
@GetMapping(value = "/selectLocation") @GetMapping(value = "/selectLocation")
@ApiOperation(httpMethod = "GET", value = "敷设位置标定检验列表", notes = "敷设位置标定检验列表") @ApiOperation(httpMethod = "GET", value = "敷设位置标定检验列表", notes = "敷设位置标定检验列表")
public ResponseModel<Page<SmartListDto>> selectLocation(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<SmartListDto>> selectLocation(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) { (value = "size") int size,SmartListDto smartListDto) {
Page<SmartListDto> page = new Page<>(); Page<SmartListDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(service.commonality(StageEnum.定位.getStage(),page)); return ResponseHelper.buildResponse(service.commonality(StageEnum.定位.getStage(),page, smartListDto));
} }
/** /**
......
...@@ -15,6 +15,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -15,6 +15,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil; import com.yeejoin.amos.feign.privilege.util.DesUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -61,18 +62,24 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company ...@@ -61,18 +62,24 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
/** /**
* 分页查询+筛选 * 分页查询+筛选
*/ */
public Page<CompanyDto> queryCompanyPage(int current, int size, CompanyDto companyDto) { public Page<CompanyDto> queryCompanyPage(int current, int size, Company company) {
Page<CompanyDto> page = new Page<>(); Page<CompanyDto> page = new Page<>();
page.setSize(size); page.setSize(size);
page.setCurrent(current); page.setCurrent(current);
Page<CompanyDto> page1 = queryForPage(page, null, false);
if (companyDto.getName() != null) { this.list();
List<CompanyDto> collect = page1.getRecords().stream().filter(a -> a.getName().equals(companyDto.getName())).collect(Collectors.toList()); List<CompanyDto> companies = companyMapper.queryCompanyPage(company);
page1.setRecords(collect); // List<CompanyDto> companyDtos = new ArrayList<>();
} // BeanUtils.copyProperties(companies,companyDtos);
page.setRecords(companies);
// if (companyDto.getName() != null) {
// List<CompanyDto> collect = page1.getRecords().stream().filter(a -> a.getName().equals(companyDto.getName())).collect(Collectors.toList());
// page1.setRecords(collect);
// }
return page1; return page;
} }
/** /**
......
...@@ -73,8 +73,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -73,8 +73,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
* stage 阶段 * stage 阶段
* page 分页 * page 分页
*/ */
public Page<SmartListDto> commonality(String stage,Page<SmartListDto> page){ public Page<SmartListDto> commonality(String stage,Page<SmartListDto> page,SmartListDto smartListDto){
List<Verify> verifyList = verifyMapper.commonality(stage); List<Verify> verifyList = verifyMapper.commonality(stage,smartListDto);
List<SmartListDto> dtoList =new ArrayList<>(); List<SmartListDto> dtoList =new ArrayList<>();
//进入焊前 //进入焊前
if (verifyList !=null && verifyList.size() !=0){ if (verifyList !=null && verifyList.size() !=0){
......
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