feat:管理端活动信息收集管理和家长参与代理商活动管理
This commit is contained in:
parent
7792e17438
commit
54728dec3e
@ -336,6 +336,7 @@ public enum ResultCodeEnum {
|
|||||||
PARTICIPATION_FAILED(13010, "参与活动失败"),
|
PARTICIPATION_FAILED(13010, "参与活动失败"),
|
||||||
PARENT_NOT_FOUND(13011, "家长不存在"),
|
PARENT_NOT_FOUND(13011, "家长不存在"),
|
||||||
INVALID_ACTIVITY_STATUS(13012, "无效的活动状态"),
|
INVALID_ACTIVITY_STATUS(13012, "无效的活动状态"),
|
||||||
|
AGENT_NOT_FOUND(13013, "代理商不存在"),
|
||||||
PARENT_ALREADY_SIGN_UP(130121, "已经报名参加该活动");
|
PARENT_ALREADY_SIGN_UP(130121, "已经报名参加该活动");
|
||||||
|
|
||||||
private int code;
|
private int code;
|
||||||
|
|||||||
@ -3,8 +3,6 @@ package com.seer.teach.mp.admin.controller.req;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Schema(name = "AgentEmployeeRelationReq", description = "代理商员工关联请求参数")
|
@Schema(name = "AgentEmployeeRelationReq", description = "代理商员工关联请求参数")
|
||||||
@Data
|
@Data
|
||||||
public class AgentEmployeeRelationReq {
|
public class AgentEmployeeRelationReq {
|
||||||
@ -12,11 +10,9 @@ public class AgentEmployeeRelationReq {
|
|||||||
@Schema(description = "关联ID")
|
@Schema(description = "关联ID")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@NotNull(message = "代理商ID不能为空")
|
|
||||||
@Schema(description = "代理商ID")
|
@Schema(description = "代理商ID")
|
||||||
private Integer agentId;
|
private Integer agentId;
|
||||||
|
|
||||||
@NotNull(message = "员工用户ID不能为空")
|
|
||||||
@Schema(description = "员工用户ID")
|
@Schema(description = "员工用户ID")
|
||||||
private Integer employeeUserId;
|
private Integer employeeUserId;
|
||||||
|
|
||||||
|
|||||||
@ -17,10 +17,6 @@ public class AgentEmployeeSaveReq {
|
|||||||
@NotNull(message = "员工名称不能为空")
|
@NotNull(message = "员工名称不能为空")
|
||||||
private String employeeName;
|
private String employeeName;
|
||||||
|
|
||||||
@Schema(description = "员工密码")
|
|
||||||
@NotNull(message = "员工密码不能为空")
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
@Schema(description = "员工职位")
|
@Schema(description = "员工职位")
|
||||||
private String position;
|
private String position;
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public interface IAdminAgentEmployeeRelationService {
|
|||||||
PageListBean<AgentEmployeeRelationResp> pageList(AgentEmployeeRelationQueryReq query);
|
PageListBean<AgentEmployeeRelationResp> pageList(AgentEmployeeRelationQueryReq query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建或更新代理商员工关联(管理端)
|
* 更新代理商员工关联(管理端)
|
||||||
*
|
*
|
||||||
* @param request 关联请求对象
|
* @param request 关联请求对象
|
||||||
* @return 操作是否成功
|
* @return 操作是否成功
|
||||||
|
|||||||
@ -17,7 +17,6 @@ import com.seer.teach.mp.entity.MpAgentEntity;
|
|||||||
import com.seer.teach.mp.service.IMpAgentEmployeeRelationService;
|
import com.seer.teach.mp.service.IMpAgentEmployeeRelationService;
|
||||||
import com.seer.teach.mp.service.IMpAgentService;
|
import com.seer.teach.mp.service.IMpAgentService;
|
||||||
import com.seer.teach.user.api.UserInfoServiceApi;
|
import com.seer.teach.user.api.UserInfoServiceApi;
|
||||||
import com.seer.teach.user.api.dto.UserInfoDTO;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -83,15 +82,11 @@ public class AdminAgentEmployeeRelationServiceImpl implements IAdminAgentEmploye
|
|||||||
MpAgentEmployeeRelationEntity one = agentEmployeeRelationService.lambdaQuery()
|
MpAgentEmployeeRelationEntity one = agentEmployeeRelationService.lambdaQuery()
|
||||||
.eq(MpAgentEmployeeRelationEntity::getEmployeeName, request.getEmployeeName()).one();
|
.eq(MpAgentEmployeeRelationEntity::getEmployeeName, request.getEmployeeName()).one();
|
||||||
AssertUtils.isNull(one, ResultCodeEnum.AGENT_EMPLOYEE_ALREADY_EXISTS);
|
AssertUtils.isNull(one, ResultCodeEnum.AGENT_EMPLOYEE_ALREADY_EXISTS);
|
||||||
UserInfoDTO userInfoDTO = new UserInfoDTO();
|
|
||||||
userInfoDTO.setUserName(request.getEmployeeName());
|
|
||||||
userInfoDTO.setPassword(request.getPassword());
|
|
||||||
userInfoServiceApi.saveAgentInfo(userInfoDTO);
|
|
||||||
Integer employeeUserId = userInfoServiceApi.getUserIdByUserName(request.getEmployeeName());
|
|
||||||
Integer agentId = mpAgentService.lambdaQuery().eq(MpAgentEntity::getAgentName, request.getAgentName()).one().getId();
|
Integer agentId = mpAgentService.lambdaQuery().eq(MpAgentEntity::getAgentName, request.getAgentName()).one().getId();
|
||||||
|
Integer employeeId = userInfoServiceApi.getUserIdByUserName(request.getEmployeeName());
|
||||||
MpAgentEmployeeRelationEntity entity = new MpAgentEmployeeRelationEntity();
|
MpAgentEmployeeRelationEntity entity = new MpAgentEmployeeRelationEntity();
|
||||||
entity.setAgentId(agentId);
|
entity.setAgentId(agentId);
|
||||||
entity.setEmployeeUserId(employeeUserId);
|
entity.setEmployeeUserId(employeeId);
|
||||||
entity.setEmployeeName(request.getEmployeeName());
|
entity.setEmployeeName(request.getEmployeeName());
|
||||||
entity.setAgentName(request.getAgentName());
|
entity.setAgentName(request.getAgentName());
|
||||||
entity.setPosition(request.getPosition());
|
entity.setPosition(request.getPosition());
|
||||||
|
|||||||
@ -284,10 +284,8 @@ public class UserInfoServiceApiImpl implements UserInfoServiceApi {
|
|||||||
public Integer getUserIdByUserName(String userName) {
|
public Integer getUserIdByUserName(String userName) {
|
||||||
UserEntity userEntity = userService.getOne(new LambdaQueryWrapper<UserEntity>()
|
UserEntity userEntity = userService.getOne(new LambdaQueryWrapper<UserEntity>()
|
||||||
.eq(UserEntity::getUserName, userName));
|
.eq(UserEntity::getUserName, userName));
|
||||||
if (Objects.nonNull(userEntity)) {
|
AssertUtils.notNull(userEntity, ResultCodeEnum.USER_NOT_FOUND);
|
||||||
return userEntity.getId();
|
return userEntity.getId();
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user