dev-chenjiajian #1

Merged
ChenJiaJian merged 8 commits from dev-chenjiajian into master 2026-01-17 16:31:39 +08:00
4 changed files with 13 additions and 16 deletions
Showing only changes of commit 2b4e18b49c - Show all commits

View File

@ -63,7 +63,8 @@ public class AdminAgentEmployeeRelationController {
@Operation(summary = "根据代理商ID获取员工列表")
@GetMapping("/by-agent/{agentId}")
@SaCheckPermission("mp:admin:agent:employee:by-agent")
public ResultBean<java.util.List<AgentEmployeeRelationResp>> getByAgent(@PathVariable Integer agentId) {
return ResultBean.success(agentEmployeeRelationService.getEmployeeRelationsByAgentId(agentId));
public ResultBean<PageListBean<AgentEmployeeRelationResp>> getByAgent(@PathVariable Integer agentId,
@RequestBody @Validated AgentEmployeeRelationQueryReq query) {
return ResultBean.success(agentEmployeeRelationService.getEmployeeRelationsByAgentId(agentId, query));
}
}

View File

@ -8,9 +8,6 @@ import lombok.Data;
@Data
public class AgentEmployeeRelationQueryReq extends PageRequest {
@Schema(description = "代理商名称")
private String agentName;
@Schema(description = "员工名称")
private String employeeName;

View File

@ -1,12 +1,10 @@
package com.seer.teach.mp.admin.service;
import com.seer.teach.common.PageListBean;
import com.seer.teach.mp.admin.controller.req.AgentEmployeeRelationQueryReq;
import com.seer.teach.mp.admin.controller.req.AgentEmployeeSaveReq;
import com.seer.teach.mp.admin.controller.req.AgentEmployeeUpdateReq;
import com.seer.teach.mp.admin.controller.resp.AgentEmployeeRelationResp;
import com.seer.teach.mp.admin.controller.req.AgentEmployeeRelationQueryReq;
import java.util.List;
/**
* <p>
@ -56,7 +54,7 @@ public interface IAdminAgentEmployeeRelationService {
* @param agentId 代理商ID
* @return 员工关联列表
*/
List<AgentEmployeeRelationResp> getEmployeeRelationsByAgentId(Integer agentId);
PageListBean<AgentEmployeeRelationResp> getEmployeeRelationsByAgentId(Integer agentId,AgentEmployeeRelationQueryReq query);
/**
* 新增代理商员工关联管理端

View File

@ -22,7 +22,6 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
@ -48,7 +47,6 @@ public class AdminAgentEmployeeRelationServiceImpl implements IAdminAgentEmploye
public PageListBean<AgentEmployeeRelationResp> pageList(AgentEmployeeRelationQueryReq query) {
Page<MpAgentEmployeeRelationEntity> pageParm = new Page<>(query.getPageNo(), query.getPageSize());
var pageResult = agentEmployeeRelationService.page(pageParm, new LambdaQueryWrapper<>(MpAgentEmployeeRelationEntity.class)
.like(Objects.nonNull(query.getAgentName()), MpAgentEmployeeRelationEntity::getAgentName, query.getAgentName())
.like(Objects.nonNull(query.getEmployeeName()), MpAgentEmployeeRelationEntity::getEmployeeName, query.getEmployeeName())
.eq(Objects.nonNull(query.getStatus()), MpAgentEmployeeRelationEntity::getStatus, query.getStatus()));
@ -97,11 +95,14 @@ public class AdminAgentEmployeeRelationServiceImpl implements IAdminAgentEmploye
}
@Override
public List<AgentEmployeeRelationResp> getEmployeeRelationsByAgentId(Integer agentId) {
var relations = agentEmployeeRelationService.getEmployeeRelationsByAgentId(agentId);
return relations.stream()
.map(AdminAgentEmployeeRelationConvert.INSTANCE::convertToResp)
.toList();
public PageListBean<AgentEmployeeRelationResp> getEmployeeRelationsByAgentId(Integer agentId,AgentEmployeeRelationQueryReq query) {
Page<MpAgentEmployeeRelationEntity> page = new Page<>(query.getPageNo(), query.getPageSize());
LambdaQueryWrapper<MpAgentEmployeeRelationEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MpAgentEmployeeRelationEntity::getAgentId, agentId)
.like(Objects.nonNull(query.getEmployeeName()), MpAgentEmployeeRelationEntity::getEmployeeName, query.getEmployeeName())
.eq(Objects.nonNull(query.getStatus()), MpAgentEmployeeRelationEntity::getStatus, query.getStatus());
Page<MpAgentEmployeeRelationEntity> pageParm = agentEmployeeRelationService.page(page, wrapper);
return PageConverterUtils.convertPageListBean(pageParm, AdminAgentEmployeeRelationConvert.INSTANCE::convertToRespList);
}
@Override