中介 代码重写
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
"Bash(powershell:*)",
|
||||
"Skill(document-skills:mcp-builder)",
|
||||
"Bash(ping:*)",
|
||||
"Bash(git commit:*)"
|
||||
"Bash(git commit:*)",
|
||||
"Bash(taskkill:*)"
|
||||
]
|
||||
},
|
||||
"enabledMcpjsonServers": [
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- 在进行需求分析类型的任务时,自动开启深度思考模式,输入 “think more”、“think a lot”、“think harder” 或 “think longer” 触发更深层的思考
|
||||
- 在进行需求分析与分解任务时,按照不同的模块分为不同的文件,创建模块名的文件夹并将对应文件保存在文件夹中,然后对模块的功能文件进行继续分解
|
||||
- 在使用/openspec:proposal时,自动开启深度思考模式,输入 “think more”、“think a lot”、“think harder” 或 “think longer” 触发更深层的思考
|
||||
- 在完成/openspec:apply后,使用code-simplifier 进行代码精简
|
||||
- 在执行/openspec:apply后,使用code-simplifier 进行代码精简
|
||||
|
||||
## Communication
|
||||
- 永远使用简体中文进行思考和对话
|
||||
@@ -29,15 +29,18 @@
|
||||
- 需要单独的VO类,不可以与entity混用
|
||||
- 审计字段通过添加注释的方式实现自动插入
|
||||
- 简单的crud操作通过mybatis plus的方法实现,复杂的操作通过xml中写sql和mapper映射实现
|
||||
- 控制层所有接口需要正确的添加注释,确保在swagger-ui中正确展示。控制层中任何接口发生变动,及时同步到doc中的接口文档中
|
||||
- 控制层分页接口使用mybatis plus page,不要使用若依框架的分页
|
||||
|
||||
|
||||
### 前端代码
|
||||
- 在添加页面和组件后,注意与数据库中菜单表进行联动修改
|
||||
|
||||
|
||||
## 运行过程中
|
||||
## 运行
|
||||
- 使用根目录中的ry.bat控制后端的启动,不要自行在命令行中启动后端
|
||||
- 测试方式为生成可执行的测试脚本
|
||||
- 在测试中启动的进程,在测试完成后立刻结束
|
||||
- 测试脚本在运行完成后需要保存所有接口输出并生成测试用例报告
|
||||
- /login/test接口可以传入username和password获取token,用于测试验证接口的功能。
|
||||
用于测试的账号:username: admin password admin123
|
||||
- swagger-ui的地址为/swagger-ui/index.html
|
||||
|
||||
@@ -85,9 +85,9 @@ springdoc:
|
||||
tags-sorter: alpha
|
||||
group-configs:
|
||||
- group: 'default'
|
||||
display-name: '测试模块'
|
||||
display-name: '纪检模块'
|
||||
paths-to-match: '/**'
|
||||
packages-to-scan: com.ruoyi.web.controller.tool
|
||||
packages-to-scan: com.ruoyi.dpc.controller
|
||||
|
||||
# 防盗链配置
|
||||
referer:
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
package com.ruoyi.common.core.controller;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.InitBinder;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
@@ -20,6 +13,14 @@ import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.sql.SqlUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.InitBinder;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web层通用数据处理
|
||||
@@ -90,6 +91,19 @@ public class BaseController
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应请求分页数据(手动指定总数)
|
||||
*/
|
||||
protected TableDataInfo getDataTable(List<?> list, long total)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(total);
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
*/
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-doc -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证中介数据
|
||||
*/
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.dpc.mapper.DpcIntermediaryBlacklistMapper">
|
||||
|
||||
<resultMap type="DpcIntermediaryBlacklist" id="DpcIntermediaryBlacklistResult">
|
||||
<id property="intermediaryId" column="intermediary_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="certificateNo" column="certificate_no"/>
|
||||
<result property="intermediaryType" column="intermediary_type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIntermediaryVo">
|
||||
select intermediary_id, name, certificate_no, intermediary_type, status, remark,
|
||||
create_by, create_time, update_by, update_time
|
||||
from dpc_intermediary_blacklist
|
||||
</sql>
|
||||
|
||||
<select id="selectIntermediaryList" parameterType="DpcIntermediaryBlacklistQueryDTO"
|
||||
resultMap="DpcIntermediaryBlacklistResult">
|
||||
<include refid="selectIntermediaryVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''">
|
||||
AND name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="certificateNo != null and certificateNo != ''">
|
||||
AND certificate_no = #{certificateNo}
|
||||
</if>
|
||||
<if test="intermediaryType != null and intermediaryType != ''">
|
||||
AND intermediary_type = #{intermediaryType}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectIntermediaryById" parameterType="Long" resultMap="DpcIntermediaryBlacklistResult">
|
||||
<include refid="selectIntermediaryVo"/>
|
||||
where intermediary_id = #{intermediaryId}
|
||||
</select>
|
||||
|
||||
<insert id="insertIntermediary" parameterType="DpcIntermediaryBlacklist" useGeneratedKeys="true"
|
||||
keyProperty="intermediaryId">
|
||||
insert into dpc_intermediary_blacklist
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="certificateNo != null and certificateNo != ''">certificate_no,</if>
|
||||
<if test="intermediaryType != null and intermediaryType != ''">intermediary_type,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="certificateNo != null and certificateNo != ''">#{certificateNo},</if>
|
||||
<if test="intermediaryType != null and intermediaryType != ''">#{intermediaryType},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateIntermediary" parameterType="DpcIntermediaryBlacklist">
|
||||
update dpc_intermediary_blacklist
|
||||
<set>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="certificateNo != null">certificate_no = #{certificateNo},</if>
|
||||
<if test="intermediaryType != null and intermediaryType != ''">intermediary_type = #{intermediaryType},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where intermediary_id = #{intermediaryId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteIntermediaryById" parameterType="Long">
|
||||
delete from dpc_intermediary_blacklist where intermediary_id = #{intermediaryId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteIntermediaryByIds" parameterType="Long">
|
||||
delete from dpc_intermediary_blacklist where intermediary_id in
|
||||
<foreach collection="array" item="intermediaryId" open="(" separator="," close=")">
|
||||
#{intermediaryId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user