|
|
|
|
@ -28,10 +28,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import java.util.Calendar;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 注册验证
|
|
|
|
|
@ -71,7 +68,7 @@ public class SysRegisterController extends BaseController {
|
|
|
|
|
*/
|
|
|
|
|
@SaIgnore
|
|
|
|
|
@PostMapping("/registerGs")
|
|
|
|
|
public R<SysRole> register1(@Validated(AddGroup.class) @RequestBody PayTenantBo bo) {
|
|
|
|
|
public R<Map<String, Object>> register1(@Validated(AddGroup.class) @RequestBody PayTenantBo bo) {
|
|
|
|
|
//添加验证 手机号相同或者公司名相同不允许注册
|
|
|
|
|
PayTenantBo queryBo = new PayTenantBo();
|
|
|
|
|
queryBo.setPhone(bo.getPhone());
|
|
|
|
|
@ -88,6 +85,7 @@ public class SysRegisterController extends BaseController {
|
|
|
|
|
if(iPayTenantService.insertByBo(bo)){
|
|
|
|
|
//公司注册成功后自动添加角色:管理员 todo
|
|
|
|
|
Long[] adids={1L, 1921833283434213378L, 1921827581902888962L, 1921827581902888963L, 1921827581902888964L, 1921827581902888965L, 1921827581902888966L, 1921827581902888967L, 1921833488053334018L, 1921827579365335041L, 1921827579365335042L, 1921827579365335043L, 1921827579365335044L, 1921827579365335045L, 1921827579365335046L, 1921827582745944066L, 1921827582745944067L, 1921827582745944068L, 1921827582745944069L, 1921827582745944070L, 1921827582745944071L, 1921827581055639553L, 1921827581055639554L, 1921827581055639555L, 1921827581055639556L, 1921827581055639557L, 1921827581055639558L, 1921827581252771841L, 1921827581252771842L, 1921827581252771843L, 1921827581252771844L, 1921827581252771845L, 1921827581252771846L, 1921834138757656577L, 1921827582162935809L, 1921827582162935810L, 1921827582162935811L, 1921827582162935812L, 1921827582162935813L, 1921827582162935814L, 1921827582490091522L, 1921827582490091523L, 1921827582490091524L, 1921827582490091525L, 1921827582490091526L, 1921827582490091527L, 1921827583140208641L, 1921827583140208642L, 1921827583140208643L, 1921827583140208644L, 1921827583140208645L, 1921827583140208646L, 1921827581449904130L, 1921827581449904131L, 1921827581449904132L, 1921827581449904133L, 1921827581449904134L, 1921827581449904135L, 1921827583601582082L, 1921827583601582083L, 1921827583601582084L, 1921827583601582085L, 1921827583601582086L, 1921827583601582087L, 1921835117498494977L, 1921827582880161794L, 1921827582880161795L, 1921827582880161796L, 1921827582880161797L, 1921827582880161798L, 1921827582880161799L, 100L, 1001L, 1002L, 1003L, 1004L, 1005L, 1006L, 1007L, 101L, 1010L, 1011L, 1012L, 1013L, 1014L};
|
|
|
|
|
Long[] ygids={1921835117498494977L, 1921827582880161794L, 1921827582880161795L};
|
|
|
|
|
SysRole role1 = new SysRole();
|
|
|
|
|
role1.setRoleKey("companyAdmin");
|
|
|
|
|
role1.setRoleName("公司管理员");
|
|
|
|
|
@ -99,14 +97,27 @@ public class SysRegisterController extends BaseController {
|
|
|
|
|
role1.setFlag(false);
|
|
|
|
|
role1.setMenuIds(adids);
|
|
|
|
|
|
|
|
|
|
SysRole role2 = new SysRole();
|
|
|
|
|
role2.setRoleKey("yg");
|
|
|
|
|
role2.setRoleName("普通员工");
|
|
|
|
|
role2.setTenantId(bo.getId());
|
|
|
|
|
role2.setStatus("0");
|
|
|
|
|
role2.setRoleSort(0);
|
|
|
|
|
role2.setMenuCheckStrictly(false);
|
|
|
|
|
role2.setDeptCheckStrictly(true);
|
|
|
|
|
role2.setFlag(false);
|
|
|
|
|
role2.setMenuIds(ygids);
|
|
|
|
|
|
|
|
|
|
roleService.insertRole(role1);
|
|
|
|
|
/*Map<String ,Object> data = new HashMap<>();
|
|
|
|
|
roleService.insertRole(role2);
|
|
|
|
|
|
|
|
|
|
Map<String ,Object> data = new HashMap<>();
|
|
|
|
|
List<SysRole> roles = new ArrayList<>();
|
|
|
|
|
roles.add(role1);
|
|
|
|
|
// data.put("id",bo.getId());
|
|
|
|
|
data.put("roles",roles);*/
|
|
|
|
|
return new R().ok(role1);
|
|
|
|
|
roles.add(role2);
|
|
|
|
|
data.put("id",bo.getId());
|
|
|
|
|
data.put("roles",roles);
|
|
|
|
|
return new R().ok(data);
|
|
|
|
|
}else{
|
|
|
|
|
return new R().fail("注册失败,请重试");
|
|
|
|
|
}
|
|
|
|
|
|