中介 代码重写
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package com.ruoyi.dpc.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.dpc.domain.DpcEmployee;
|
||||
@@ -12,6 +15,8 @@ import com.ruoyi.dpc.domain.dto.DpcEmployeeEditDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeQueryDTO;
|
||||
import com.ruoyi.dpc.domain.vo.DpcEmployeeVO;
|
||||
import com.ruoyi.dpc.service.IDpcEmployeeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -27,6 +32,7 @@ import java.util.List;
|
||||
* @author ruoyi
|
||||
* @date 2026-01-28
|
||||
*/
|
||||
@Tag(name = "员工信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/dpc/employee")
|
||||
public class DpcEmployeeController extends BaseController {
|
||||
@@ -37,17 +43,21 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 查询员工列表
|
||||
*/
|
||||
@Operation(summary = "查询员工列表")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DpcEmployeeQueryDTO queryDTO) {
|
||||
startPage();
|
||||
List<DpcEmployeeVO> list = employeeService.selectEmployeeList(queryDTO);
|
||||
return getDataTable(list);
|
||||
// 使用MyBatis Plus分页
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Page<DpcEmployee> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
|
||||
Page<DpcEmployeeVO> result = employeeService.selectEmployeePage(page, queryDTO);
|
||||
return getDataTable(result.getRecords(), result.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出员工列表
|
||||
*/
|
||||
@Operation(summary = "导出员工列表")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:export')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@@ -60,6 +70,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 获取员工详细信息
|
||||
*/
|
||||
@Operation(summary = "获取员工详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:query')")
|
||||
@GetMapping(value = "/{employeeId}")
|
||||
public AjaxResult getInfo(@PathVariable Long employeeId) {
|
||||
@@ -69,6 +80,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 新增员工
|
||||
*/
|
||||
@Operation(summary = "新增员工")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:add')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@@ -79,6 +91,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 修改员工
|
||||
*/
|
||||
@Operation(summary = "修改员工")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:edit')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@@ -89,6 +102,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 删除员工
|
||||
*/
|
||||
@Operation(summary = "删除员工")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:remove')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{employeeIds}")
|
||||
@@ -99,6 +113,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 下载导入模板
|
||||
*/
|
||||
@Operation(summary = "下载导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<DpcEmployee> util = new ExcelUtil<>(DpcEmployee.class);
|
||||
@@ -108,6 +123,7 @@ public class DpcEmployeeController extends BaseController {
|
||||
/**
|
||||
* 导入员工信息
|
||||
*/
|
||||
@Operation(summary = "导入员工信息")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:employee:import')")
|
||||
@Log(title = "员工信息", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ruoyi.dpc.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.dpc.domain.DpcIntermediaryBlacklist;
|
||||
@@ -12,6 +15,8 @@ import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistEditDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistQueryDTO;
|
||||
import com.ruoyi.dpc.domain.vo.DpcIntermediaryBlacklistVO;
|
||||
import com.ruoyi.dpc.service.IDpcIntermediaryBlacklistService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -27,6 +32,7 @@ import java.util.List;
|
||||
* @author ruoyi
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
@Tag(name = "中介黑名单管理")
|
||||
@RestController
|
||||
@RequestMapping("/dpc/intermediary")
|
||||
public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
@@ -37,17 +43,21 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
/**
|
||||
* 查询中介黑名单列表
|
||||
*/
|
||||
@Operation(summary = "查询中介黑名单列表")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:intermediary:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DpcIntermediaryBlacklistQueryDTO queryDTO) {
|
||||
startPage();
|
||||
List<DpcIntermediaryBlacklistVO> list = intermediaryService.selectIntermediaryList(queryDTO);
|
||||
return getDataTable(list);
|
||||
// 使用MyBatis Plus分页
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Page<DpcIntermediaryBlacklist> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
|
||||
Page<DpcIntermediaryBlacklistVO> result = intermediaryService.selectIntermediaryPage(page, queryDTO);
|
||||
return getDataTable(result.getRecords(), result.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出中介黑名单列表
|
||||
*/
|
||||
@Operation(summary = "导出中介黑名单列表")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:intermediary:export')")
|
||||
@Log(title = "中介黑名单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@@ -60,6 +70,7 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
/**
|
||||
* 获取中介黑名单详细信息
|
||||
*/
|
||||
@Operation(summary = "获取中介黑名单详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:intermediary:query')")
|
||||
@GetMapping(value = "/{intermediaryId}")
|
||||
public AjaxResult getInfo(@PathVariable Long intermediaryId) {
|
||||
@@ -69,6 +80,7 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
/**
|
||||
* 新增中介黑名单
|
||||
*/
|
||||
@Operation(summary = "新增中介黑名单")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:intermediary:add')")
|
||||
@Log(title = "中介黑名单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@@ -79,6 +91,7 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
/**
|
||||
* 修改中介黑名单
|
||||
*/
|
||||
@Operation(summary = "修改中介黑名单")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:intermediary:edit')")
|
||||
@Log(title = "中介黑名单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@@ -89,6 +102,7 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
/**
|
||||
* 删除中介黑名单
|
||||
*/
|
||||
@Operation(summary = "删除中介黑名单")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:intermediary:remove')")
|
||||
@Log(title = "中介黑名单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{intermediaryIds}")
|
||||
@@ -99,6 +113,7 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
/**
|
||||
* 下载导入模板
|
||||
*/
|
||||
@Operation(summary = "下载导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<DpcIntermediaryBlacklist> util = new ExcelUtil<>(DpcIntermediaryBlacklist.class);
|
||||
@@ -108,6 +123,7 @@ public class DpcIntermediaryBlacklistController extends BaseController {
|
||||
/**
|
||||
* 导入中介黑名单
|
||||
*/
|
||||
@Operation(summary = "导入中介黑名单")
|
||||
@PreAuthorize("@ss.hasPermi('dpc:intermediary:import')")
|
||||
@Log(title = "中介黑名单", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.ruoyi.dpc.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -12,12 +17,14 @@ import java.util.Date;
|
||||
* @author ruoyi
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
@Data
|
||||
public class DpcIntermediaryBlacklist implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 中介ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long intermediaryId;
|
||||
|
||||
/** 姓名/机构名称 */
|
||||
@@ -41,94 +48,18 @@ public class DpcIntermediaryBlacklist implements Serializable {
|
||||
private String remark;
|
||||
|
||||
/** 创建者 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
public Long getIntermediaryId() {
|
||||
return intermediaryId;
|
||||
}
|
||||
|
||||
public void setIntermediaryId(Long intermediaryId) {
|
||||
this.intermediaryId = intermediaryId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCertificateNo() {
|
||||
return certificateNo;
|
||||
}
|
||||
|
||||
public void setCertificateNo(String certificateNo) {
|
||||
this.certificateNo = certificateNo;
|
||||
}
|
||||
|
||||
public String getIntermediaryType() {
|
||||
return intermediaryType;
|
||||
}
|
||||
|
||||
public void setIntermediaryType(String intermediaryType) {
|
||||
this.intermediaryType = intermediaryType;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.ruoyi.dpc.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.dpc.domain.DpcIntermediaryBlacklist;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistQueryDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 中介人员黑名单 数据层
|
||||
@@ -11,53 +9,5 @@ import java.util.List;
|
||||
* @author ruoyi
|
||||
* @date 2026-01-27
|
||||
*/
|
||||
public interface DpcIntermediaryBlacklistMapper {
|
||||
|
||||
/**
|
||||
* 查询中介黑名单列表
|
||||
*
|
||||
* @param queryDTO 查询条件
|
||||
* @return 中介黑名单集合
|
||||
*/
|
||||
List<DpcIntermediaryBlacklist> selectIntermediaryList(DpcIntermediaryBlacklistQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询中介黑名单详细
|
||||
*
|
||||
* @param intermediaryId 中介ID
|
||||
* @return 中介黑名单对象
|
||||
*/
|
||||
DpcIntermediaryBlacklist selectIntermediaryById(Long intermediaryId);
|
||||
|
||||
/**
|
||||
* 新增中介黑名单
|
||||
*
|
||||
* @param intermediary 中介黑名单
|
||||
* @return 结果
|
||||
*/
|
||||
int insertIntermediary(DpcIntermediaryBlacklist intermediary);
|
||||
|
||||
/**
|
||||
* 修改中介黑名单
|
||||
*
|
||||
* @param intermediary 中介黑名单
|
||||
* @return 结果
|
||||
*/
|
||||
int updateIntermediary(DpcIntermediaryBlacklist intermediary);
|
||||
|
||||
/**
|
||||
* 删除中介黑名单
|
||||
*
|
||||
* @param intermediaryId 中介ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteIntermediaryById(Long intermediaryId);
|
||||
|
||||
/**
|
||||
* 批量删除中介黑名单
|
||||
*
|
||||
* @param intermediaryIds 需要删除的中介ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteIntermediaryByIds(Long[] intermediaryIds);
|
||||
public interface DpcIntermediaryBlacklistMapper extends BaseMapper<DpcIntermediaryBlacklist> {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.dpc.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.dpc.domain.DpcEmployee;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeAddDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcEmployeeEditDTO;
|
||||
@@ -24,6 +25,15 @@ public interface IDpcEmployeeService {
|
||||
*/
|
||||
List<DpcEmployeeVO> selectEmployeeList(DpcEmployeeQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 分页查询员工列表
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param queryDTO 查询条件
|
||||
* @return 员工VO分页结果
|
||||
*/
|
||||
Page<DpcEmployeeVO> selectEmployeePage(Page<DpcEmployee> page, DpcEmployeeQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询员工列表(用于导出)
|
||||
*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.dpc.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.dpc.domain.DpcIntermediaryBlacklist;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistAddDTO;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistEditDTO;
|
||||
@@ -24,6 +25,15 @@ public interface IDpcIntermediaryBlacklistService {
|
||||
*/
|
||||
List<DpcIntermediaryBlacklistVO> selectIntermediaryList(DpcIntermediaryBlacklistQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 分页查询中介黑名单列表
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param queryDTO 查询条件
|
||||
* @return 中介黑名单VO分页结果
|
||||
*/
|
||||
Page<DpcIntermediaryBlacklistVO> selectIntermediaryPage(Page<DpcIntermediaryBlacklist> page, DpcIntermediaryBlacklistQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 查询中介黑名单列表(用于导出)
|
||||
*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.dpc.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.dpc.domain.DpcEmployee;
|
||||
import com.ruoyi.dpc.domain.DpcEmployeeRelative;
|
||||
@@ -19,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 员工信息 服务层处理
|
||||
@@ -52,6 +54,29 @@ public class DpcEmployeeServiceImpl implements IDpcEmployeeService {
|
||||
return voList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询员工列表
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param queryDTO 查询条件
|
||||
* @return 员工VO分页结果
|
||||
*/
|
||||
@Override
|
||||
public Page<DpcEmployeeVO> selectEmployeePage(Page<DpcEmployee> page, DpcEmployeeQueryDTO queryDTO) {
|
||||
LambdaQueryWrapper<DpcEmployee> wrapper = buildQueryWrapper(queryDTO);
|
||||
Page<DpcEmployee> resultPage = employeeMapper.selectPage(page, wrapper);
|
||||
|
||||
// 直接复用resultPage,只转换records
|
||||
Page<DpcEmployeeVO> voPage = new Page<>(resultPage.getCurrent(), resultPage.getSize(), resultPage.getTotal());
|
||||
voPage.setRecords(resultPage.getRecords().stream()
|
||||
.map(this::convertToVO)
|
||||
.collect(Collectors.toList()));
|
||||
// 复制其他分页信息
|
||||
voPage.setPages(resultPage.getPages());
|
||||
|
||||
return voPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询员工列表(用于导出)
|
||||
*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.dpc.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.dpc.domain.DpcIntermediaryBlacklist;
|
||||
import com.ruoyi.dpc.domain.dto.DpcIntermediaryBlacklistAddDTO;
|
||||
@@ -13,8 +14,8 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 中介人员黑名单 服务层处理
|
||||
@@ -36,12 +37,29 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
*/
|
||||
@Override
|
||||
public List<DpcIntermediaryBlacklistVO> selectIntermediaryList(DpcIntermediaryBlacklistQueryDTO queryDTO) {
|
||||
List<DpcIntermediaryBlacklist> list = intermediaryMapper.selectIntermediaryList(queryDTO);
|
||||
List<DpcIntermediaryBlacklistVO> voList = new ArrayList<>();
|
||||
for (DpcIntermediaryBlacklist intermediary : list) {
|
||||
voList.add(convertToVO(intermediary));
|
||||
}
|
||||
return voList;
|
||||
LambdaQueryWrapper<DpcIntermediaryBlacklist> wrapper = buildQueryWrapper(queryDTO);
|
||||
List<DpcIntermediaryBlacklist> list = intermediaryMapper.selectList(wrapper);
|
||||
return list.stream().map(this::convertToVO).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询中介黑名单列表
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param queryDTO 查询条件
|
||||
* @return 中介黑名单VO分页结果
|
||||
*/
|
||||
@Override
|
||||
public Page<DpcIntermediaryBlacklistVO> selectIntermediaryPage(Page<DpcIntermediaryBlacklist> page, DpcIntermediaryBlacklistQueryDTO queryDTO) {
|
||||
LambdaQueryWrapper<DpcIntermediaryBlacklist> wrapper = buildQueryWrapper(queryDTO);
|
||||
Page<DpcIntermediaryBlacklist> resultPage = intermediaryMapper.selectPage(page, wrapper);
|
||||
|
||||
// 转换为VO
|
||||
Page<DpcIntermediaryBlacklistVO> voPage = new Page<>(resultPage.getCurrent(), resultPage.getSize(), resultPage.getTotal());
|
||||
voPage.setRecords(resultPage.getRecords().stream().map(this::convertToVO).collect(Collectors.toList()));
|
||||
voPage.setPages(resultPage.getPages());
|
||||
|
||||
return voPage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +70,8 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
*/
|
||||
@Override
|
||||
public List<DpcIntermediaryBlacklist> selectIntermediaryListForExport(DpcIntermediaryBlacklistQueryDTO queryDTO) {
|
||||
return intermediaryMapper.selectIntermediaryList(queryDTO);
|
||||
LambdaQueryWrapper<DpcIntermediaryBlacklist> wrapper = buildQueryWrapper(queryDTO);
|
||||
return intermediaryMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,7 +82,7 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
*/
|
||||
@Override
|
||||
public DpcIntermediaryBlacklistVO selectIntermediaryById(Long intermediaryId) {
|
||||
DpcIntermediaryBlacklist intermediary = intermediaryMapper.selectIntermediaryById(intermediaryId);
|
||||
DpcIntermediaryBlacklist intermediary = intermediaryMapper.selectById(intermediaryId);
|
||||
return convertToVO(intermediary);
|
||||
}
|
||||
|
||||
@@ -77,8 +96,7 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
public int insertIntermediary(DpcIntermediaryBlacklistAddDTO addDTO) {
|
||||
DpcIntermediaryBlacklist intermediary = new DpcIntermediaryBlacklist();
|
||||
BeanUtils.copyProperties(addDTO, intermediary);
|
||||
intermediary.setCreateBy(SecurityUtils.getUsername());
|
||||
return intermediaryMapper.insertIntermediary(intermediary);
|
||||
return intermediaryMapper.insert(intermediary);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,8 +109,7 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
public int updateIntermediary(DpcIntermediaryBlacklistEditDTO editDTO) {
|
||||
DpcIntermediaryBlacklist intermediary = new DpcIntermediaryBlacklist();
|
||||
BeanUtils.copyProperties(editDTO, intermediary);
|
||||
intermediary.setUpdateBy(SecurityUtils.getUsername());
|
||||
return intermediaryMapper.updateIntermediary(intermediary);
|
||||
return intermediaryMapper.updateById(intermediary);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,19 +120,19 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
*/
|
||||
@Override
|
||||
public int deleteIntermediaryByIds(Long[] intermediaryIds) {
|
||||
return intermediaryMapper.deleteIntermediaryByIds(intermediaryIds);
|
||||
return intermediaryMapper.deleteBatchIds(List.of(intermediaryIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入中介黑名单数据
|
||||
*
|
||||
* @param addDTOList 新增DTO列表
|
||||
* @param addDTOList 新增DTO列表
|
||||
* @param isUpdateSupport 是否更新支持
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String importIntermediary(List<DpcIntermediaryBlacklistAddDTO> addDTOList, Boolean isUpdateSupport) {
|
||||
if (StringUtils.isNull(addDTOList) || addDTOList.isEmpty()) {
|
||||
if (addDTOList == null || addDTOList.isEmpty()) {
|
||||
return "至少需要一条数据";
|
||||
}
|
||||
|
||||
@@ -131,9 +148,8 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
|
||||
DpcIntermediaryBlacklist intermediary = new DpcIntermediaryBlacklist();
|
||||
BeanUtils.copyProperties(addDTO, intermediary);
|
||||
intermediary.setCreateBy(SecurityUtils.getUsername());
|
||||
|
||||
intermediaryMapper.insertIntermediary(intermediary);
|
||||
intermediaryMapper.insert(intermediary);
|
||||
successNum++;
|
||||
successMsg.append("<br/>").append(successNum).append("、").append(addDTO.getName()).append(" 导入成功");
|
||||
} catch (Exception e) {
|
||||
@@ -152,6 +168,19 @@ public class DpcIntermediaryBlacklistServiceImpl implements IDpcIntermediaryBlac
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建查询条件
|
||||
*/
|
||||
private LambdaQueryWrapper<DpcIntermediaryBlacklist> buildQueryWrapper(DpcIntermediaryBlacklistQueryDTO queryDTO) {
|
||||
LambdaQueryWrapper<DpcIntermediaryBlacklist> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(StringUtils.isNotEmpty(queryDTO.getName()), DpcIntermediaryBlacklist::getName, queryDTO.getName())
|
||||
.like(StringUtils.isNotEmpty(queryDTO.getCertificateNo()), DpcIntermediaryBlacklist::getCertificateNo, queryDTO.getCertificateNo())
|
||||
.eq(StringUtils.isNotEmpty(queryDTO.getIntermediaryType()), DpcIntermediaryBlacklist::getIntermediaryType, queryDTO.getIntermediaryType())
|
||||
.eq(StringUtils.isNotEmpty(queryDTO.getStatus()), DpcIntermediaryBlacklist::getStatus, queryDTO.getStatus())
|
||||
.orderByDesc(DpcIntermediaryBlacklist::getCreateTime);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证中介数据
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user