代理商在增加员工时,同步增加员工的角色

This commit is contained in:
Wang 2026-01-09 09:31:13 +08:00
parent 543f972c5c
commit dbe8e28237
6 changed files with 11 additions and 24 deletions

View File

@ -14,5 +14,8 @@ public class MpGenerateQrCodeReq {
private String appId; private String appId;
@Schema(description = "二维码类型 1-临时 2-永久") @Schema(description = "二维码类型 1-临时 2-永久")
private Integer type; private Integer type = 2;
@Schema(description = "二维码有效期")
private Integer expireSeconds;
} }

View File

@ -42,7 +42,7 @@ public class AppAgentActivityParentInfoServiceImpl implements IAppAgentActivityP
if (Objects.isNull(userAgentId)) { if (Objects.isNull(userAgentId)) {
return List.of(); return List.of();
} }
log.info("userAgentId:{}", userAgentId); log.info("getParentsByActivityAndAgent userAgentId:{}", userAgentId);
if(userAgentId.intValue() != agentId){ if(userAgentId.intValue() != agentId){
throw new CommonException(ResultCodeEnum.RELATION_NOT_FOUND); throw new CommonException(ResultCodeEnum.RELATION_NOT_FOUND);
} }

View File

@ -10,6 +10,8 @@ import lombok.RequiredArgsConstructor;
import com.seer.teach.mp.app.convert.AppAgentConvert; import com.seer.teach.mp.app.convert.AppAgentConvert;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Objects;
/** /**
* App端代理商服务实现类 * App端代理商服务实现类
*/ */
@ -27,11 +29,12 @@ public class AppAgentServiceImpl implements IAppAgentService {
return null; return null;
} }
MpAgentEntity agentEntity = mpAgentService.getAgentById(mpAgentEmployeeRelationEntity.getAgentId()); MpAgentEntity agentEntity = mpAgentService.getAgentById(mpAgentEmployeeRelationEntity.getAgentId());
if (agentEntity == null) { if (Objects.isNull(agentEntity)) {
return null; return null;
} }
AppMpAgentResp appMpAgentResp = AppAgentConvert.INSTANCE.entityToResp(agentEntity); AppMpAgentResp appMpAgentResp = AppAgentConvert.INSTANCE.entityToResp(agentEntity);
appMpAgentResp.setIsContactPerson(agentEntity.getContactUserId().equals(userId)); Boolean isContactPerson = Objects.nonNull(agentEntity.getContactUserId()) && agentEntity.getContactUserId().equals(userId);
appMpAgentResp.setIsContactPerson(isContactPerson);
return appMpAgentResp; return appMpAgentResp;
} }

View File

@ -47,12 +47,6 @@ public interface GradeServiceApi {
@PostMapping("/addGrade") @PostMapping("/addGrade")
ResultBean addGrade(@RequestParam("status") Integer status, @RequestParam("grade") String grade); ResultBean addGrade(@RequestParam("status") Integer status, @RequestParam("grade") String grade);
/**
* 删除年级
* @param ids
*/
@DeleteMapping("/delete")
void deleteGrade(@RequestBody List<Integer> ids);
/** /**
* 修改年级状态 * 修改年级状态

View File

@ -140,7 +140,7 @@ public interface UserInfoServiceApi {
* @param userInfoDTO 用户信息 * @param userInfoDTO 用户信息
* @return 用户ID * @return 用户ID
*/ */
@PostMapping("/update-user-assign-role") @PostMapping("/add-user-assign-role")
Integer addUserInfoAndAssignRole(@RequestBody UserInfoDTO userInfoDTO); Integer addUserInfoAndAssignRole(@RequestBody UserInfoDTO userInfoDTO);
/** /**

View File

@ -95,19 +95,6 @@ public class GradeServiceApiImpl implements GradeServiceApi {
} }
} }
/**
* 删除年级
* @param ids
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteGrade(List<Integer> ids) {
AssertUtils.notEmpty(ids, ResultCodeEnum.PLEASE_SELECT_THE_GRADE_TO_DELETED);
List<Integer> distinctIds = ids.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
gradeService.removeByIds(distinctIds);
log.info("删除年级成功ids={}", distinctIds);
}
@Override @Override
public ResultBean updateGradeStatus(GradeUpdateDTO params) { public ResultBean updateGradeStatus(GradeUpdateDTO params) {
GradeEntity grade = gradeService.getById(params.getId()); GradeEntity grade = gradeService.getById(params.getId());