|
@@ -212,25 +212,25 @@ public class OwnCompanyManageController extends BaseController
|
|
|
throw new Exception("统一信用代码格式错误");
|
|
|
}
|
|
|
//联系人
|
|
|
- String scyLegal = CommonUtil.objToString(map.get("scyLegal"));
|
|
|
- if(CommonUtil.isEmpty(scyLegal)){
|
|
|
+ String nickName = CommonUtil.objToString(map.get("nickName"));
|
|
|
+ if(CommonUtil.isEmpty(nickName)){
|
|
|
throw new Exception("联系人不能为空");
|
|
|
}
|
|
|
- if(scyLegal.length() > 30){
|
|
|
+ if(nickName.length() > 30){
|
|
|
throw new Exception("联系人长度不能超过30字;请检查是否正确");
|
|
|
}
|
|
|
//联系电话
|
|
|
- String scyPhone = CommonUtil.objToString(map.get("scyPhone"));
|
|
|
- if(CommonUtil.isEmpty(scyPhone)){
|
|
|
+ String userName = CommonUtil.objToString(map.get("userName"));
|
|
|
+ if(CommonUtil.isEmpty(userName)){
|
|
|
throw new Exception("联系电话不能为空");
|
|
|
}
|
|
|
- if(CommonUtil.isNotEmpty(scyPhone)) {
|
|
|
- if(scyPhone.length() > 11){
|
|
|
+ if(CommonUtil.isNotEmpty(userName)) {
|
|
|
+ if(userName.length() > 11){
|
|
|
throw new Exception("手机号不能超过11位");
|
|
|
}
|
|
|
String checkPhone = "^1[3|4|5|6|7|8|9][0-9]\\d{8}$";
|
|
|
Pattern regePhone = Pattern.compile(checkPhone);
|
|
|
- Matcher matcherPhone = regePhone.matcher(scyPhone);
|
|
|
+ Matcher matcherPhone = regePhone.matcher(userName);
|
|
|
boolean isMatPhone = matcherPhone.matches();
|
|
|
if (!isMatPhone) {
|
|
|
throw new Exception("手机格式不正确");
|
|
@@ -274,15 +274,15 @@ public class OwnCompanyManageController extends BaseController
|
|
|
iSysCompanyService.createSysCompany(sysCompany);
|
|
|
|
|
|
LambdaQueryWrapper<SysUser> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper.eq(SysUser::getUserName, scyPhone);
|
|
|
+ lambdaQueryWrapper.eq(SysUser::getUserName, userName);
|
|
|
List<SysUser> users = iSysUserService.findSysUsers(lambdaQueryWrapper);
|
|
|
SysUser createUser = null;
|
|
|
// 用户没有注册
|
|
|
if (users.size() == 0) {
|
|
|
String password = configService.selectConfigByKey("sys.user.initPassword");
|
|
|
SysUser sysUser = new SysUser();
|
|
|
- sysUser.setNickName(scyLegal);
|
|
|
- sysUser.setUserName(scyPhone);
|
|
|
+ sysUser.setNickName(nickName);
|
|
|
+ sysUser.setUserName(userName);
|
|
|
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
|
|
iSysUserService.createSysUser(sysUser);
|
|
|
createUser = iSysUserService.findSysUsers(lambdaQueryWrapper).get(0);
|
|
@@ -344,22 +344,22 @@ public class OwnCompanyManageController extends BaseController
|
|
|
|
|
|
|
|
|
// flowable数据
|
|
|
-// Map<String, Object> flowableRes = flowableService.addFlowableGroup(scyId, sysCompany.getScyName());
|
|
|
-// if (!"200".equals(flowableRes.get("code"))) {
|
|
|
-// throw new Exception("审批数据新增失败!");
|
|
|
-// }
|
|
|
-// flowableRes = flowableService.addFlowableGroup(alternateNumber, dept.getDeptName());
|
|
|
-// if (!"200".equals(flowableRes.get("code"))) {
|
|
|
-// throw new Exception("审批数据新增失败!");
|
|
|
-// }
|
|
|
-// flowableRes = flowableService.addFlowableUser(String.valueOf(createUser.getUserId()), createUser.getNickName(), scyId);
|
|
|
-// if (!"200".equals(flowableRes.get("code"))) {
|
|
|
-// throw new Exception("审批数据新增失败!");
|
|
|
-// }
|
|
|
-// flowableRes = flowableService.addFlowableUser(String.valueOf(createUser.getUserId()), createUser.getNickName(), alternateNumber);
|
|
|
-// if (!"200".equals(flowableRes.get("code"))) {
|
|
|
-// throw new Exception("审批数据新增失败!");
|
|
|
-// }
|
|
|
+ Map<String, Object> flowableRes = flowableService.addFlowableGroup(scyId, sysCompany.getScyName());
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
+ flowableRes = flowableService.addFlowableGroup(alternateNumber, dept.getDeptName());
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
+ flowableRes = flowableService.addFlowableUser(String.valueOf(createUser.getUserId()), createUser.getNickName(), scyId);
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
+ flowableRes = flowableService.addFlowableUser(String.valueOf(createUser.getUserId()), createUser.getNickName(), alternateNumber);
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
|
|
|
return R.ok();
|
|
|
}
|