Selaa lähdekoodia

资方新增用户相关

sqg 3 vuotta sitten
vanhempi
commit
0d16d0c013

+ 26 - 1
tianhu-system/src/main/java/com/tianhu/system/controller/OwnManagementInfController.java

@@ -16,8 +16,10 @@ import com.tianhu.system.api.domain.*;
 import com.tianhu.system.api.model.LoginUser;
 import com.tianhu.system.common.IMessageUtilsService;
 import com.tianhu.system.domain.*;
+import com.tianhu.system.mapper.SysDeptMapper;
 import com.tianhu.system.mapper.SysProductMenuMapper;
 import com.tianhu.system.service.*;
+import com.tianhu.system.utils.FlowableService;
 import com.tianhu.system.utils.RegularUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -63,10 +65,14 @@ public class OwnManagementInfController extends BaseController
     @Autowired
     private RemoteFileService remoteFileService;
     @Autowired
+    private FlowableService flowableService;
+    @Autowired
     private ISysCompanyProductService sysCompanyProductService;
     @Autowired
     private IMessageUtilsService messageUtilsService;
     @Autowired
+    private SysDeptMapper deptMapper;
+    @Autowired
     private RemoteSystemService remoteSystemService;
     @Autowired
     private IOwnNoticeService ownNoticeService;
@@ -269,7 +275,7 @@ public class OwnManagementInfController extends BaseController
         }
         LoginUser userInfo = tokenService.getLoginUser();
         String  scyId  =  IdUtils.fastSimpleUUID();
-        //创建用户
+        //创建企业
         company.setScyId(scyId);
         company.setScyName(scyName);
         company.setScyStatus(staust_00);
@@ -289,6 +295,7 @@ public class OwnManagementInfController extends BaseController
         dept.setParentId(defaultId);
         dept.setAncestors(defaultAn);
         dept.setOrderNum(defaultOrder);
+        dept.setAlternateNumber(IdUtils.fastSimpleUUID());
         dept.setCreateBy(use.getUserId()+"");
         deptService.insertDept(dept);
         List<SysDept> deptList= deptService.selectDeptList(dept);
@@ -398,6 +405,24 @@ public class OwnManagementInfController extends BaseController
                 "医疗招商、医疗集采、供应链金融等企业级服务,如果您再平台使用中遇到任何问题," +
                 "请再首页查看并拨打平台客服专线电话,我们将竭尽所能为您提供免费的咨询服务";
         ownNoticeService.sendNotice(scyId,scyId,tittle,"01","00",null,"0",String.valueOf(listUserTwo.getUserId()),null,null,null);
+        //审批表增加数据
+        Map<String, Object> flowableRes = flowableService.addFlowableGroup(scyId, company.getScyName());
+        if (!"200".equals(flowableRes.get("code"))) {
+            throw new Exception("审批数据新增失败!");
+        }
+        flowableRes = flowableService.addFlowableGroup(deptList.get(0).getAlternateNumber(), dept.getDeptName());
+        if (!"200".equals(flowableRes.get("code"))) {
+            throw new Exception("审批数据新增失败!");
+        }
+        flowableRes = flowableService.addFlowableUser(String.valueOf(listUserTwo.getUserId()), sysUser.getNickName(), scyId);
+        if (!"200".equals(flowableRes.get("code"))) {
+            throw new Exception("审批数据新增失败!");
+        }
+        SysDept depts = deptMapper.selectDeptById(deptId);
+        flowableRes = flowableService.addFlowableUser(String.valueOf(listUserTwo.getUserId()), sysUser.getNickName(), depts.getAlternateNumber());
+        if (!"200".equals(flowableRes.get("code"))) {
+            throw new Exception("审批数据新增失败!");
+        }
         return R.ok();
     }
 

+ 2 - 2
tianhu-system/src/main/java/com/tianhu/system/controller/SysUserController.java

@@ -640,7 +640,7 @@ public class SysUserController extends BaseController
             }
         } else{
             user.setStatus("0");
-            user.setPassword(password);
+            user.setPassword(SecurityUtils.encryptPassword(password));
             user.setCreateBy(SecurityUtils.getUsername());
             userMapper.insertUser(user);
         }
@@ -692,7 +692,7 @@ public class SysUserController extends BaseController
 //        remoteSystemService.sendNotice(use.getCompanyId(),use.getCompanyId(),tittle,"01","00",null,"0",String.valueOf(queryUser.getUserId()),null);
         if (listNormalUser.size() < 0) {
             Map passwordMap =new HashMap();
-            passwordMap.put("password",password);
+            passwordMap.put("password",SecurityUtils.encryptPassword(password));
             messageUtilsService.sendMessageCode(user.getPhonenumber(),zhucechenggong,passwordMap,null);
         }
         return toAjax(1);