Explorar o código

医生模块多账户

liangpeile hai 1 ano
pai
achega
0fd4e6060f

+ 6 - 14
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/service/impl/AdminUserServiceImpl.java

@@ -207,7 +207,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
 
         AdminCompSelect adminCompSelect = adminCompSelectService.getById(id);
         String yzh = adminCompSelect.getYzh();
-        if ("0".equals(yzh)){
+        if ("0".equals(yzh)) {
             return Result.error("请确认云账户权限是否开启");
         }
 
@@ -398,10 +398,10 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
                 return Result.error("token校验该用户不存在");
             }
             QueryWrapper<AdminCompSelect> adminCompSelectQueryWrapper = new QueryWrapper<>();
-            adminCompSelectQueryWrapper.eq("phone",userPhone);
-            adminCompSelectQueryWrapper.eq("sys_org_code",storeMember1.getSysOrgCode());
+            adminCompSelectQueryWrapper.eq("phone", userPhone);
+            adminCompSelectQueryWrapper.eq("sys_org_code", storeMember1.getSysOrgCode());
             AdminCompSelect one = adminCompSelectService.getOne(adminCompSelectQueryWrapper);
-            if (null!=one){
+            if (null != one) {
                 storeMember1.setYzh(one.getYzh());
 
             }
@@ -637,15 +637,9 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
 
         AdminUser one = adminUserService.getOne(adminUserQueryWrapper);
         if (null != one) {
-//            one.setCard(adminUserVO.getCard());
-//            one.setCardholderName(adminUserVO.getName());
-//            one.setBackCard(adminUserVO.getBackCard());
-//            one.setCardholderPhone(adminUserVO.getCardholderPhone());
-//            one.setDwname(adminUserVO.getDwname());
-//            one.setKsname(adminUserVO.getKsname());
-//            one.setCompleteInformation(2);
+
             one.setDoctorAndSpecialist(adminUserVO.getDoctorAndSpecialist());
-//            one.setCardPic(adminUserVO.getCardPic());
+
             this.updateById(one);
         }
         QueryWrapper<AdminCompSelect> adminCompSelectQueryWrapper = new QueryWrapper<>();
@@ -681,8 +675,6 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
         adminCompSelectService.updateById(adminCompSelect);
 
 
-
-
     }
 
 

+ 2 - 1
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/APIController.java

@@ -364,9 +364,9 @@ public class APIController {
         //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
         QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("phone", UserDTO.getPhone());
-        queryWrapper.eq("doctor_and_specialist", UserDTO.getSf());
         AdminUser storeMember = adminUserService.getOne(queryWrapper);
 
+
         if (storeMember == null) {
             result.setMessage("该用户不存在");
             baseCommonService.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
@@ -507,6 +507,7 @@ public class APIController {
                 storeMember1.setKsname(one.getKsName());
                 storeMember1.setDwname(one.getDwName());
                 storeMember1.setCard(one.getCard());
+                storeMember1.setDoctorAndSpecialist(one.getDoctorAndSpecialist());
             }
 
             if (storeMember1 == null) {

+ 7 - 6
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sysusercompany/controller/SysUserCompanyController.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.sysusercompany.controller;
 
+import java.net.SocketTimeoutException;
 import java.util.Arrays;
 import java.util.List;
 import javax.servlet.http.HttpServletRequest;
@@ -43,7 +44,7 @@ public class SysUserCompanyController extends JeecgController<SysUserCompany, IS
 	private ISysUserCompanyService sysUserCompanyService;
 	@Autowired
 	private ISysUserService sysUserService;
-	
+
 	/**
 	 * 分页列表查询
 	 *
@@ -71,7 +72,7 @@ public class SysUserCompanyController extends JeecgController<SysUserCompany, IS
 		IPage<SysUserCompany> pageList = sysUserCompanyService.page(page, queryWrapper);
 		return Result.OK(pageList);
 	}
-	
+
 	/**
 	 *   添加
 	 *
@@ -85,7 +86,7 @@ public class SysUserCompanyController extends JeecgController<SysUserCompany, IS
 
 		return sysUserCompanyService.saveMain(sysUserCompany) ;
 	}
-	
+
 	/**
 	 *  编辑
 	 *
@@ -99,7 +100,7 @@ public class SysUserCompanyController extends JeecgController<SysUserCompany, IS
 		sysUserCompanyService.updateMain(sysUserCompany);
 		return Result.OK("编辑成功!");
 	}
-	
+
 	/**
 	 *   通过id删除
 	 *
@@ -117,7 +118,7 @@ public class SysUserCompanyController extends JeecgController<SysUserCompany, IS
 		sysUserCompanyService.removeById(id);
 		return Result.OK("删除成功!");
 	}
-	
+
 	/**
 	 *  批量删除
 	 *
@@ -138,7 +139,7 @@ public class SysUserCompanyController extends JeecgController<SysUserCompany, IS
 		this.sysUserCompanyService.removeByIds(Arrays.asList(ids.split(",")));
 		return Result.OK("批量删除成功!");
 	}
-	
+
 	/**
 	 * 通过id查询
 	 *

+ 15 - 11
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sysusercompany/service/impl/SysUserCompanyServiceImpl.java

@@ -64,7 +64,7 @@ public class SysUserCompanyServiceImpl extends ServiceImpl<SysUserCompanyMapper,
         sysUserCompany.setCompanyName(companyName);
 
 
-        SysUserCompany userCompany = sysUserCompanyMapper.getCompany(sysUserCompany.getCompanyName(),sysUserCompany.getCompanyCode());
+        SysUserCompany userCompany = sysUserCompanyMapper.getCompany(sysUserCompany.getCompanyName(), sysUserCompany.getCompanyCode());
         if (null != userCompany) {
             return Result.error("公司已经存在,请勿重复添加");
         }
@@ -87,22 +87,26 @@ public class SysUserCompanyServiceImpl extends ServiceImpl<SysUserCompanyMapper,
         String id = sysUserCompany.getId();
         SysUserCompany byId = this.getById(id);
         String companyCode1 = byId.getCompanyCode();
-        SysUser user = sysUserService.getUserbyUsername(companyCode1);
 
-        String salt = oConvertUtils.randomGen(8);
-        user.setSalt(salt);
-        String passwordEncode = PasswordUtil.encrypt(companyCode, password, salt);
+        if (!password.equals(byId.getPassword())) {
+            SysUser user = sysUserService.getUserbyUsername(companyCode1);
+            String salt = oConvertUtils.randomGen(8);
+            user.setSalt(salt);
+            String passwordEncode = PasswordUtil.encrypt(companyCode, password, salt);
+            sysUserCompany.setPassword(passwordEncode);
+            user.setYzh(yzh);
+            user.setRealname(companyName);
+            user.setUsername(companyCode);
+            user.setPassword(passwordEncode);
+            sysUserService.editUser(user, "1671322266401476610", null);
+
+        }
 
-        sysUserCompany.setPassword(passwordEncode);
         sysUserCompany.setCompanyName(companyName);
         sysUserCompany.setCompanyCode(companyCode);
 
-        user.setYzh(yzh);
-        user.setRealname(companyName);
-        user.setUsername(companyCode);
-        user.setPassword(passwordEncode);
+
         sysUserCompanyMapper.updateById(sysUserCompany);
-        sysUserService.editUser(user, "1671322266401476610", null);
 
 
         return Result.ok("操作成功");