Compare commits
No commits in common. "461705254bbf89752fd50fb6f0225202fd948cc0" and "8f812a710931b510973be5a6736f4cda1a15f7b9" have entirely different histories.
461705254b
...
8f812a7109
|
@ -85,20 +85,6 @@ public class CeesUserController extends JeecgController<CeesUser, ICeesUserServi
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成规则相关api
|
||||
* @return
|
||||
*/
|
||||
|
||||
@GetMapping("/getGenerativeRules")
|
||||
public Result<?> getGenerativeRules() {
|
||||
return ceesUserService.getGenerativeRules();
|
||||
}
|
||||
@GetMapping("/updateGenerateRule")
|
||||
public Result<?> updateGenerateRule(@RequestParam(name = "id") Long id,@RequestParam(name = "groupType") Integer groupType,@RequestParam(name = "majorId") Integer majorId){
|
||||
return ceesUserService.updateGenerateRule(id, groupType, majorId);
|
||||
// return null;
|
||||
}
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
|
|
|
@ -22,10 +22,5 @@ public interface ICeesUserService extends IService<CeesUser> {
|
|||
|
||||
Result<?> getGroupName(String groupId);
|
||||
|
||||
// void createAccount(CreateAccountDto createAccountDto);
|
||||
|
||||
Result<?> getGenerativeRules();
|
||||
|
||||
Result<?> updateGenerateRule(Long id, Integer groupType, Integer majorId);
|
||||
Result<?> createAccount(CreateAccountDto createAccountDto);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.jeecg.modules.service.impl;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
@ -297,11 +296,11 @@ public class CeesUserServiceImpl extends ServiceImpl<CeesUserMapper, CeesUser> i
|
|||
throw new IllegalArgumentException("参数无效");
|
||||
}
|
||||
|
||||
// 获取生成规则
|
||||
CeesGenerativeRules rules = GetGenerativeRules();
|
||||
if (rules == null) {
|
||||
throw new IllegalArgumentException("找不到对应的账号生成规则");
|
||||
}
|
||||
// 获取生成规则
|
||||
CeesGenerativeRules rules = getGenerativeRules();
|
||||
if (rules == null) {
|
||||
throw new IllegalArgumentException("找不到对应的账号生成规则");
|
||||
}
|
||||
|
||||
// 存储已存在的用户ID
|
||||
Set<String> set = new HashSet<>();
|
||||
|
@ -348,33 +347,8 @@ public class CeesUserServiceImpl extends ServiceImpl<CeesUserMapper, CeesUser> i
|
|||
}
|
||||
}
|
||||
|
||||
// 获取生成规则---用户前端获取rule
|
||||
public Result<?> getGenerativeRules() {
|
||||
LambdaQueryWrapper<CeesGenerativeRules> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CeesGenerativeRules::getIs_default, "1");
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("GenerativeRules",ceesGenerativeRulesMapper.selectOne(queryWrapper));
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> updateGenerateRule(Long id, Integer groupType, Integer majorId) {
|
||||
LambdaUpdateWrapper<CeesGenerativeRules> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(CeesGenerativeRules::getId, id)
|
||||
.set(CeesGenerativeRules::getGroupType, groupType)
|
||||
.set(CeesGenerativeRules::getMajorId, majorId);
|
||||
// 使用 update 方法进行更新
|
||||
int result = ceesGenerativeRulesMapper.update(null, updateWrapper);
|
||||
|
||||
if (result > 0) {
|
||||
return Result.ok("更新成功");
|
||||
} else {
|
||||
return Result.error("更新失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 获取生成规则
|
||||
private CeesGenerativeRules GetGenerativeRules() {
|
||||
private CeesGenerativeRules getGenerativeRules() {
|
||||
LambdaQueryWrapper<CeesGenerativeRules> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CeesGenerativeRules::getIs_default, "1");
|
||||
return ceesGenerativeRulesMapper.selectOne(queryWrapper);
|
||||
|
|
Loading…
Reference in New Issue