fix:修改管理端代理商员工列表添加员工名称和状态查询条件
This commit is contained in:
parent
baccd3a433
commit
2b4e18b49c
@ -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));
|
||||
}
|
||||
}
|
||||
@ -8,9 +8,6 @@ import lombok.Data;
|
||||
@Data
|
||||
public class AgentEmployeeRelationQueryReq extends PageRequest {
|
||||
|
||||
@Schema(description = "代理商名称")
|
||||
private String agentName;
|
||||
|
||||
@Schema(description = "员工名称")
|
||||
private String employeeName;
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
/**
|
||||
* 新增代理商员工关联(管理端)
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user