Просмотр исходного кода

同一账号 登陆多家机构

shaohao521 1 год назад
Родитель
Сommit
5400931af0
17 измененных файлов с 355 добавлено и 115 удалено
  1. 1 1
      fangchan_manager/src/main/java/com/mw/platform/controller/BaOrgController.java
  2. 11 6
      fangchan_manager/src/main/java/com/mw/platform/controller/OrganizationController.java
  3. 74 1
      fangchan_manager/src/main/java/com/mw/platform/controller/TokenLoginController.java
  4. 10 10
      fangchan_manager/src/main/resources/templates/business/baOrg/baOrgApply.html
  5. 7 3
      fangchan_manager/src/main/resources/templates/business/organization/branch_add.html
  6. 90 88
      fangchan_manager/src/main/resources/templates/business/organization/detail.html
  7. 7 1
      fangchan_manager/src/main/resources/templates/business/organization/jjjg_edit.html
  8. 99 0
      fangchan_manager/src/main/resources/templates/checkOrg.html
  9. 5 0
      fangchan_mybatis/src/main/java/com/mw/platform/business/mysql/entity/Organization.java
  10. 1 1
      fangchan_mybatis/src/main/java/com/mw/platform/business/mysql/service/IOrganizationService.java
  11. 9 3
      fangchan_mybatis/src/main/java/com/mw/platform/business/mysql/service/impl/OrganizationServiceImpl.java
  12. 1 0
      system_core/src/main/java/com/mw/platform/core/ShiroConfig.java
  13. 2 0
      system_mybatis/src/main/java/com/mw/platform/system/mysql/dao/ISysUserDao.java
  14. 17 1
      system_mybatis/src/main/java/com/mw/platform/system/mysql/entity/SysUserInfo.java
  15. 2 0
      system_mybatis/src/main/java/com/mw/platform/system/mysql/service/ISysUserService.java
  16. 5 0
      system_mybatis/src/main/java/com/mw/platform/system/mysql/service/impl/SysUserServiceImpl.java
  17. 14 0
      system_mybatis/src/main/resources/mapper/system/transfer/SysUserMapper.xml

+ 1 - 1
fangchan_manager/src/main/java/com/mw/platform/controller/BaOrgController.java

@@ -117,7 +117,7 @@ public class BaOrgController extends BaseController {
         Personnel personnel = new Personnel();
         personnel.setZsxm(zsxm);
         personnel.setOrgId(user.getGroupId());
-        personnel.setJjrzslx(-1); //此标识为查询有证书类型的经纪人
+//        personnel.setJjrzslx(-1); //此标识为查询有证书类型的经纪人
 
         Example<Personnel> example = new Example<>();
         example.setRecord(personnel);

+ 11 - 6
fangchan_manager/src/main/java/com/mw/platform/controller/OrganizationController.java

@@ -101,6 +101,9 @@ public class OrganizationController extends BaseController {
     public ModelAndView toAdd() {
         ModelAndView view = new ModelAndView(getPagePath() + "/branch_add");
 
+        List<Dictionary> jglxDict = dictCache.findByCodes("job_jglx");
+        view.addObject("jglxDict", jglxDict);
+
         SysUserInfo user = getSysUserInfo();
         Organization organization = organizationService.selectByPrimaryKey(user.getGroupId());
         view.addObject("org", organization);
@@ -157,19 +160,19 @@ public class OrganizationController extends BaseController {
         if (org.getShtyxydm() == null || org.getShtyxydm().equals("")){ //没有填信用代码
             //父机构
             Organization fuOrg = organizationService.selectByPrimaryKey(getSysUserInfo().getGroupId());
-            for (int i=1;i<=10;i++){
+            for (int i=1;i<=50;i++){
                 if (organizationService.selectByShtyxydm(fuOrg.getShtyxydm()+"-"+i) == null){
                     org.setShtyxydm(fuOrg.getShtyxydm()+"-"+i);
                     break;
                 }
             }
-            return organizationService.saveBranchOrg(org);
+            return organizationService.saveBranchOrg(org,getSysUserInfo());
         }else { //填了信用代码
             if (organizationService.selectByShtyxydm(org.getShtyxydm()) != null){ //信用代码重复
-                result.setErrorMsg("统一社会信用代码已注册");
+                result.setErrorMsg("统一社会信用代码重复");
                 return result.getContext();
             }else { //信用代码正常
-                return organizationService.saveBranchOrg(org);
+                return organizationService.saveBranchOrg(org,getSysUserInfo());
             }
         }
     }
@@ -334,6 +337,8 @@ public class OrganizationController extends BaseController {
         //机构信用
         Score score = scoreMapper.selectByOrgId(id);
         modelAndView.addObject("score",score);
+        List<Dictionary> jglxDict = dictCache.findByCodes("job_jglx");
+        modelAndView.addObject("jglxDict", jglxDict);
         return modelAndView;
     }
 
@@ -838,13 +843,13 @@ public class OrganizationController extends BaseController {
     @GetMapping("/jjjgEdit")
     public ModelAndView jjjgEdit(){
         ModelAndView view = new ModelAndView(getPagePath() + "/jjjg_edit");
-
         SysUserInfo user = getSysUserInfo();
         Organization organization = organizationService.selectByPrimaryKey(user.getGroupId());
         view.addObject("organization", organization);
         List<Dictionary> dict = dictCache.findByCodes("jg_ssqy");
         view.addObject("ssqyDict", dict);
-
+        List<Dictionary> jglxDict = dictCache.findByCodes("job_jglx");
+        view.addObject("jglxDict", jglxDict);
         return view;
     }
 

+ 74 - 1
fangchan_manager/src/main/java/com/mw/platform/controller/TokenLoginController.java

@@ -3,6 +3,7 @@ package com.mw.platform.controller;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.mw.platform.aspect.Log;
+import com.mw.platform.business.mysql.entity.Organization;
 import com.mw.platform.business.mysql.service.IOrganizationService;
 import com.mw.platform.common.TyrzptConstants;
 import com.mw.platform.core.BaseController;
@@ -26,6 +27,8 @@ import org.springframework.web.servlet.ModelAndView;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 @Controller
@@ -42,12 +45,13 @@ public class TokenLoginController extends BaseController {
 	/**
 	 * 采用token令牌登录
 	 * @param token
+	 * @param u userId
 	 * @return
 	 * @throws Exception
 	 */
 	@Log(operationType = OperationType.TOKEN_LOGIN , title = "统一用户登陆")
 	@RequestMapping(value = "/tokenLogin", method = RequestMethod.GET)
-	public ModelAndView tokenLog(String token, String wl,HttpServletResponse response) throws Exception{
+	public ModelAndView tokenLog(String token, String wl, String u,HttpServletResponse response) throws Exception{
 		System.out.println("> 企业信用Token登录: token=" + token + ", wl=" + wl);
 
 		ModelAndView view = new ModelAndView();
@@ -84,6 +88,47 @@ public class TokenLoginController extends BaseController {
 					userInfo = organizationService.addOrgBaseInfo(loginUser);
 				}
 
+				if (u != null){
+					userInfo = service.getSysUserById(u);
+				}else {
+					if (userInfo.getPid() == null){
+						List<SysUserInfo> sonList = service.checkByPid(userInfo.getId());
+						if (sonList != null && sonList.size() > 0){
+							List<Organization> orgList = new ArrayList<>();
+							Organization fljg = organizationService.selectByPrimaryKey(userInfo.getGroupId());
+							fljg.setU(userInfo.getId());
+							orgList.add(fljg);
+							for (SysUserInfo sonUser : sonList) {
+								Organization sonOrg = organizationService.selectByPrimaryKey(userInfo.getGroupId());
+								sonOrg.setU(sonUser.getId());
+								orgList.add(sonOrg);
+							}
+							view.addObject("orgList",orgList);
+							view.addObject("token",token);
+							view.addObject("wl",wl);
+							view.setViewName("checkOrg");
+							return view;
+						}
+
+
+//						//如果同一账号绑定多个机构 跳转选择机构页面
+//						if (userInfo.getOrgids() != null && userInfo.getOrgids().split(",").length>1){
+//							String[] strings = userInfo.getOrgids().split(",");
+//							Integer[] idsArr = new Integer[strings.length];
+//							for (int i=0;i<strings.length;i++){
+//								idsArr[i] = Integer.valueOf(strings[i]);
+//							}
+//							List<Organization> orgList = organizationService.selectByIds(idsArr);
+//							view.addObject("orgList",orgList);
+//							view.addObject("tyyhid",loginUser.getTyyhId());
+//							view.addObject("token",token);
+//							view.addObject("wl",wl);
+//							view.setViewName("checkOrg");
+//							return view;
+//						}
+					}
+				}
+
 				//shiro
 				Subject subject = SecurityUtils.getSubject();
 				UsernamePasswordToken t = new UsernamePasswordToken(userInfo.getAccount(), userInfo.getPassword());
@@ -107,6 +152,34 @@ public class TokenLoginController extends BaseController {
 		}
 	}
 
+	/**
+	 * checkOrg
+	 * @param tyyhid
+	 * @return
+	 * @throws Exception
+	 */
+	@Log(operationType = OperationType.TOKEN_LOGIN , title = "选择登陆机构")
+	@RequestMapping(value = "/checkOrg", method = RequestMethod.GET)
+	public ModelAndView checkOrg(String tyyhid,Integer orgid) {
+		SysUserInfo userInfo = service.checkByTyyhId(tyyhid);
+		userInfo.setGroupId(orgid);
+		//shiro
+		Subject subject = SecurityUtils.getSubject();
+		UsernamePasswordToken t = new UsernamePasswordToken(userInfo.getAccount(), userInfo.getPassword());
+		subject.login(t);
+		// 生成session
+		setSysUserInfo(userInfo);
+		ModelAndView view = new ModelAndView();
+		view.addObject("title", title);
+		view.addObject("copyright", copyright);
+		view.setViewName("main");
+		return view;
+//		BaseParameter result = new BaseParameter();
+//		result.commit();
+//		return result.toString();
+	}
+
+
 	/**
 	 * 调用用户认证平台接口,获取用户信息
 	 * @param token

+ 10 - 10
fangchan_manager/src/main/resources/templates/business/baOrg/baOrgApply.html

@@ -141,9 +141,9 @@
                             <div class="upload-area">
                                 <a id="cnsUpload" class="btn btn-default" style="overflow: hidden;">上传</a>
                             </div>
-<#--                            <div class="hint">-->
-<#--                                请点击<a id="download" style="color: #0064c8;"> [下载]</a>《房地产经纪机构备案承诺书》模板,由法定代表人签字确认并加盖单位公章后将扫描件上传。-->
-<#--                            </div>-->
+                            <div class="hint">
+                                请点击<a id="download" style="color: #0064c8;"> [下载]</a>《房地产经纪机构备案承诺书》模板,由法定代表人签字确认并加盖单位公章后将扫描件上传。
+                            </div>
                             <div class="layui-upload-list" id="cnsUpload_view"></div>
                             <input type="hidden" name="cnsFj" lay-verify="cnsFj">
                         </div>
@@ -189,9 +189,9 @@
 
         $('#download').on('click', function() {
             var a = document.createElement('a');
-            a.href = '${request.contextPath }/img/file/房地产经纪机构备案承诺书.doc';
+            a.href = '${request.contextPath }/img/file/寿光市房地产经纪机构备案承诺书.doc';
             document.body.appendChild(a);
-            a.download = "房地产经纪机构备案承诺书";
+            a.download = "寿光市房地产经纪机构备案承诺书";
             a.click();
             document.body.removeChild(a);
         });
@@ -352,11 +352,11 @@
                     return "请上传人员身份证反面照片";
                 }
             },
-            grqydFj: function (value, item) {
-                if (value.length == 0) {
-                    return "请上传人员个人权益单照片";
-                }
-            },
+            // grqydFj: function (value, item) {
+            //     if (value.length == 0) {
+            //         return "请上传人员个人权益单照片";
+            //     }
+            // },
             cnsFj: function (value, item) {
                 if (value.length == 0) {
                     return "请上传备案承诺书扫描件";

+ 7 - 3
fangchan_manager/src/main/resources/templates/business/organization/branch_add.html

@@ -67,9 +67,13 @@
 						<div class="layui-inline">
 							<label class="layui-form-label"><span class="cb-red">*</span>机构类型:</label>
 							<div class="layui-input-inline">
-								<select id="jglx" disabled>
-									<option value="1" <#if (org.jglx)?? && (org.jglx) == 1>selected</#if>>房地产经纪机构</option>
-									<option value="2" <#if (org.jglx)?? && (org.jglx) == 2>selected</#if>>房地产评估机构</option>
+								<select id="jglx" lay-verify="required">
+									<option value=""></option>
+									<#if jglxDict??>
+										<#list jglxDict as item>
+											<option value="${(item.dictKey)!}">${(item.dictValue)}</option>
+										</#list>
+									</#if>
 								</select>
 							</div>
 						</div>

+ 90 - 88
fangchan_manager/src/main/resources/templates/business/organization/detail.html

@@ -170,9 +170,11 @@
 								<label class="layui-form-label"><span class="cb-red">*</span>机构类型:</label>
 								<div class="layui-input-block">
 									<span class="cb-span">
-										<#if (organization.jglx)?? && (organization.jglx) == 1>房地产经纪机构</#if>
-										<#if (organization.jglx)?? && (organization.jglx) == 2>房地产评估机构</#if>
-										<#if (organization.jglx)?? && (organization.jglx) == 3>房地产开发企业</#if>
+										<#if jglxDict??>
+											<#list jglxDict as item>
+												<#if organization.jglx?? && organization.jglx?number = item.dictKey?number>${(item.dictValue)}</#if>
+											</#list>
+										</#if>
 									</span>
 								</div>
 							</div>
@@ -357,91 +359,91 @@
 				</blockquote>
 			</fieldset>
 
-			<#if user?? && user == 2>
-				<fieldset class="layui-elem-field">
-					<legend>机构 - 人员信息</legend>
-					<blockquote class="layui-elem-quote">
-						<table class="layui-table" id="lay_table_main"
-							   lay-data="{id: 'mainTable'}" lay-filter="lay_table_main"></table>
-					</blockquote>
-				</fieldset>
-
-				<#if organization.jglx == 1 || organization.jglx == 2>
-					<fieldset class="layui-elem-field">
-						<legend>机构 - 信用信息</legend>
-						<blockquote class="layui-elem-quote">
-							<div class="layui-field-box">
-								<div class="layui-form-item">
-									<div class="layui-inline">
-										<label class="layui-form-label" style="width: 150px">诚信分数:</label>
-										<div class="layui-input-block" style="width: 200px">
-											<span class="cb-span">${score.fz!}分</span>
-										</div>
-									</div>
-									<div class="layui-inline">
-										<label class="layui-form-label" style="width: 150px">诚信等级:</label>
-										<div class="layui-input-block" style="width: 200px">
-											<span class="cb-span">${score.xydj!}</span>
-										</div>
-									</div>
-								</div>
-								<div class="layui-form-item">
-									<div class="layui-inline">
-										<label class="layui-form-label" style="width: 150px">优良信息数:</label>
-										<div class="layui-input-block" style="width: 200px">
-											<span class="cb-span">${score.ylxxs!}</span>
-										</div>
-									</div>
-									<div class="layui-inline">
-										<label class="layui-form-label" style="width: 150px">优良信息分值:</label>
-										<div class="layui-input-block" style="width: 110px">
-											<span class="cb-span">${score.ylxxfz!}分</span>
-										</div>
-									</div>
-									<#if score.ylxxs?? && (score.ylxxs>0) >
-										<button type="button" class="anniu" onclick="ylxq()">详情</button>
-									</#if>
-								</div>
-								<div class="layui-form-item">
-									<div class="layui-inline">
-										<label class="layui-form-label" style="width: 150px">不良信息数:</label>
-										<div class="layui-input-block" style="width: 200px">
-											<span class="cb-span">${score.blxxs!}</span>
-										</div>
-									</div>
-									<div class="layui-inline">
-										<label class="layui-form-label" style="width: 150px">不良信息分值:</label>
-										<div class="layui-input-block" style="width: 110px">
-											<span class="cb-span">${score.blxxfz!}分</span>
-										</div>
-									</div>
-									<#if score.blxxs?? && (score.blxxs>0) >
-										<button type="button" class="anniu" onclick="blxq()">详情</button>
-									</#if>
-								</div>
-								<div class="layui-form-item">
-									<div class="layui-inline">
-										<label class="layui-form-label" style="width: 150px">黑名单记录:</label>
-										<div class="layui-input-block" style="width: 110px">
-									<span class="cb-span">
-										<#if score.hmdbs?? && score.hmdbs == 0>
-											无
-										<#else>
-											有
-										</#if>
-									</span>
-										</div>
-									</div>
-									<#if score.hmdbs?? && score.hmdbs == 1 >
-										<button type="button" class="anniu" onclick="hemdxq()">详情</button>
-									</#if>
-								</div>
-							</div>
-						</blockquote>
-					</fieldset>
-				</#if>
-
-			</#if>
+<#--			<#if user?? && user == 2>-->
+<#--				<fieldset class="layui-elem-field">-->
+<#--					<legend>机构 - 人员信息</legend>-->
+<#--					<blockquote class="layui-elem-quote">-->
+<#--						<table class="layui-table" id="lay_table_main"-->
+<#--							   lay-data="{id: 'mainTable'}" lay-filter="lay_table_main"></table>-->
+<#--					</blockquote>-->
+<#--				</fieldset>-->
+
+<#--				<#if organization.jglx == 1 || organization.jglx == 2>-->
+<#--					<fieldset class="layui-elem-field">-->
+<#--						<legend>机构 - 信用信息</legend>-->
+<#--						<blockquote class="layui-elem-quote">-->
+<#--							<div class="layui-field-box">-->
+<#--								<div class="layui-form-item">-->
+<#--									<div class="layui-inline">-->
+<#--										<label class="layui-form-label" style="width: 150px">诚信分数:</label>-->
+<#--										<div class="layui-input-block" style="width: 200px">-->
+<#--											<span class="cb-span">${score.fz!}分</span>-->
+<#--										</div>-->
+<#--									</div>-->
+<#--									<div class="layui-inline">-->
+<#--										<label class="layui-form-label" style="width: 150px">诚信等级:</label>-->
+<#--										<div class="layui-input-block" style="width: 200px">-->
+<#--											<span class="cb-span">${score.xydj!}</span>-->
+<#--										</div>-->
+<#--									</div>-->
+<#--								</div>-->
+<#--								<div class="layui-form-item">-->
+<#--									<div class="layui-inline">-->
+<#--										<label class="layui-form-label" style="width: 150px">优良信息数:</label>-->
+<#--										<div class="layui-input-block" style="width: 200px">-->
+<#--											<span class="cb-span">${score.ylxxs!}</span>-->
+<#--										</div>-->
+<#--									</div>-->
+<#--									<div class="layui-inline">-->
+<#--										<label class="layui-form-label" style="width: 150px">优良信息分值:</label>-->
+<#--										<div class="layui-input-block" style="width: 110px">-->
+<#--											<span class="cb-span">${score.ylxxfz!}分</span>-->
+<#--										</div>-->
+<#--									</div>-->
+<#--									<#if score.ylxxs?? && (score.ylxxs>0) >-->
+<#--										<button type="button" class="anniu" onclick="ylxq()">详情</button>-->
+<#--									</#if>-->
+<#--								</div>-->
+<#--								<div class="layui-form-item">-->
+<#--									<div class="layui-inline">-->
+<#--										<label class="layui-form-label" style="width: 150px">不良信息数:</label>-->
+<#--										<div class="layui-input-block" style="width: 200px">-->
+<#--											<span class="cb-span">${score.blxxs!}</span>-->
+<#--										</div>-->
+<#--									</div>-->
+<#--									<div class="layui-inline">-->
+<#--										<label class="layui-form-label" style="width: 150px">不良信息分值:</label>-->
+<#--										<div class="layui-input-block" style="width: 110px">-->
+<#--											<span class="cb-span">${score.blxxfz!}分</span>-->
+<#--										</div>-->
+<#--									</div>-->
+<#--									<#if score.blxxs?? && (score.blxxs>0) >-->
+<#--										<button type="button" class="anniu" onclick="blxq()">详情</button>-->
+<#--									</#if>-->
+<#--								</div>-->
+<#--								<div class="layui-form-item">-->
+<#--									<div class="layui-inline">-->
+<#--										<label class="layui-form-label" style="width: 150px">黑名单记录:</label>-->
+<#--										<div class="layui-input-block" style="width: 110px">-->
+<#--									<span class="cb-span">-->
+<#--										<#if score.hmdbs?? && score.hmdbs == 0>-->
+<#---->
+<#--										<#else>-->
+<#---->
+<#--										</#if>-->
+<#--									</span>-->
+<#--										</div>-->
+<#--									</div>-->
+<#--									<#if score.hmdbs?? && score.hmdbs == 1 >-->
+<#--										<button type="button" class="anniu" onclick="hemdxq()">详情</button>-->
+<#--									</#if>-->
+<#--								</div>-->
+<#--							</div>-->
+<#--						</blockquote>-->
+<#--					</fieldset>-->
+<#--				</#if>-->
+
+<#--			</#if>-->
 
 			<div style="height: 100px;text-align: center;">
 				<#if user?? && user == 1>

+ 7 - 1
fangchan_manager/src/main/resources/templates/business/organization/jjjg_edit.html

@@ -81,7 +81,13 @@
 						<div class="layui-inline">
 							<label class="layui-form-label"><span class="cb-red">*</span>机构类型:</label>
 							<div class="layui-input-inline">
-								<input type="text" class="layui-input layui-disabled" value="房地产经纪机构">
+								<#if jglxDict??>
+									<#list jglxDict as item>
+										<#if organization.jglx?? && organization.jglx?number = item.dictKey?number>
+											<input type="text" class="layui-input layui-disabled" value="${(item.dictValue)}">
+										</#if>
+									</#list>
+								</#if>
 							</div>
 						</div>
 						<div class="layui-inline">

+ 99 - 0
fangchan_manager/src/main/resources/templates/checkOrg.html

@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>选择登陆机构</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width, initial-scale=1, maximum-scale=1">
+</head>
+<style>
+    .org-box{
+        border: 1px solid #d3d3d3;
+        margin: 25px 32%;
+        /*padding: 15px;*/
+        border-radius: 11px;
+        font-size: 18px;
+    }
+    .org-box:hover{
+        box-shadow: 0 0 10px #c8c8c8;
+        cursor:pointer;
+    }
+    .title{
+        font-size: 25px;
+        font-weight: 600;
+        padding: 30px 0;
+        text-align: center;
+    }
+    .xydm{
+        padding-top: 15px;
+        font-size: 15px;
+        color: #727272;
+        display: inline-flex;
+        width: 97%;
+        margin: 3px 10px 14px 17px;
+    }
+</style>
+<body>
+<div>
+    <div class="title">请选择登陆机构</div>
+    <#list orgList as org>
+        <div class="org-box">
+            <div style="margin: 20px 10px 2px 15px">${(org.jgmc)!} (法定代表人:${(org.jgfr)!})</div>
+            <div class="xydm" onclick="check('${(org.u)!}')">
+                <div style="width: 94%">
+                    ${(org.shtyxydm)!}
+                </div>
+                <div>
+                    <svg t="1688610458345" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3088" width="20" height="20"><path d="M44.42112 578.12992l685.25568 0-259.18464 248.69376 183.22432 0 324.00896-310.79424-324.00896-310.8352L470.49728 205.19424l259.18464 248.66304L44.42112 453.85728 44.42112 578.12992z" fill="#D65454" p-id="3089"></path></svg>
+                </div>
+            </div>
+        </div>
+    </#list>
+</div>
+<script src="${request.contextPath }/layui.js" charset="utf-8"></script>
+<script>
+    layui.use(['jquery','layer'], function() {
+        var $ = layui.jquery;
+        var layer = layui.layer;
+
+        window.check = function (u){
+            var url = "tokenLogin?token=${token!}&wl=${wl!}&u="+u;
+            location.href = url;
+            // var loadding = layer.msg('玩命加载中,请稍候...', {icon: 16, time: false, shade: 0.1});
+            // $.ajax({
+            //     url: 'checkOrg',
+            //     type: 'get',
+            //     data: {
+            //         orgid:orgid,
+            //         tyyhid:tyyhid
+            //     },
+            //     dataType: 'json'
+            //     // ,
+            //     // success: function (data) {
+            //     //     console.log(data)
+            //     //     console.log(data.code)
+            //     //     if (data.code) {
+            //     //         location.href = 'sys/main';
+            //     //     } else {
+            //     //         layer.alert(data.errorMsg, {
+            //     //             icon: 2
+            //     //         });
+            //     //     }
+            //     //     layer.close(loadding);
+            //     // },
+            //     // error: function (data, status, e) {
+            //     //     layer.alert(data.errorMsg, {
+            //     //         icon: 2
+            //     //     });
+            //     //     layer.close(loadding);
+            //     // }
+            // });
+            return false;
+        }
+
+    })
+</script>
+</body>
+</html>

+ 5 - 0
fangchan_mybatis/src/main/java/com/mw/platform/business/mysql/entity/Organization.java

@@ -337,4 +337,9 @@ public class Organization implements Serializable {
      */
     private Integer notXxba;
 
+    /**
+     * 用户id
+     */
+    private String u;
+
 }

+ 1 - 1
fangchan_mybatis/src/main/java/com/mw/platform/business/mysql/service/IOrganizationService.java

@@ -92,7 +92,7 @@ public interface IOrganizationService extends IService<Organization> {
      * @param org
      * @return
      */
-    String saveBranchOrg(Organization org);
+    String saveBranchOrg(Organization org,SysUserInfo userInfo);
 
     /**
      * 新增人员信息

+ 9 - 3
fangchan_mybatis/src/main/java/com/mw/platform/business/mysql/service/impl/OrganizationServiceImpl.java

@@ -127,7 +127,6 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
     @Override
     @Transactional
     public Boolean updateState(Integer id, Integer xxbazt, Integer fljg, String xxbabz) {
-
         // 审核成功,修改权限
         if (xxbazt == 1 && fljg == 0 ) {
             userInfoMapper.updateRoleId(4, id, AccountEnum.ORG.getType());
@@ -212,21 +211,28 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
 
     @Override
     @Transactional
-    public String saveBranchOrg(Organization org) {
+    public String saveBranchOrg(Organization org,SysUserInfo currUser) {
         BaseParameter result = new BaseParameter();
         int m = getBaseMapper().insertSelective(org);//插入信息到机构表
 
+//        //用户orgids字段更新
+//        SysUserInfo user = new SysUserInfo();
+//        user.setId(currUser.getId());
+//        user.setOrgids(currUser.getOrgids()+","+org.getId());
+//        userInfoMapper.update(user);
+
         //插入到用户表
         SysUserInfo user = new SysUserInfo();
         user.setGroupId(org.getId());
         user.setId(UUIDUtils.getEncryUUID());
         user.setAccount(org.getShtyxydm());
         user.setPassword(MD5Util.MD5Encode("123456", "UTF-8"));
-        user.setRoleId(5);
+        user.setRoleId(3);
         user.setSysType("059358cc4487e7773a878cda0193de67");
         user.setStatus(1);
         user.setCreateTime(new Date());
         user.setFranId(2);
+        user.setPid(currUser.getId());
         userInfoMapper.insert(user);
 
         result.setMessage("操作成功!");

+ 1 - 0
system_core/src/main/java/com/mw/platform/core/ShiroConfig.java

@@ -79,6 +79,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/js/**", "anon");
         filterChainDefinitionMap.put("/login", "anon");
         filterChainDefinitionMap.put("/tokenLogin", "anon");
+        filterChainDefinitionMap.put("/checkOrg", "anon");
         filterChainDefinitionMap.put("/zc", "anon");
 		filterChainDefinitionMap.put("/register/**", "anon");
         filterChainDefinitionMap.put("/sys/main/", "anon");

+ 2 - 0
system_mybatis/src/main/java/com/mw/platform/system/mysql/dao/ISysUserDao.java

@@ -50,4 +50,6 @@ public interface ISysUserDao extends IBaseDao<SysUserInfo> {
 	SysUserInfo selectByTyyhId(String tyyhId);
 
     List<LoginUser> selectZgbmUser();
+
+    List<SysUserInfo> selectByPid(String pid);
 }

+ 17 - 1
system_mybatis/src/main/java/com/mw/platform/system/mysql/entity/SysUserInfo.java

@@ -188,13 +188,18 @@ public class SysUserInfo implements Serializable {
      */
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 父机构用户id
+     */
+    private String pid;
+
     /**
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table t_sys_user_info
      *
      * @mbggenerated
      */
-    public SysUserInfo(String id, String account, String nice, String face, Integer sex, Integer age, Date birthday, String phone, String password, String address, String constellation, String email, Integer type, Integer status, String token, Integer groupId, Integer roleId, String sysType, Integer franId, String tyyhId, Date createTime, Date lastUpdateTime) {
+    public SysUserInfo(String id, String account, String nice, String face, Integer sex, Integer age, Date birthday, String phone, String password, String address, String constellation, String email, Integer type, Integer status, String token, Integer groupId, Integer roleId, String sysType, Integer franId, String tyyhId, Date createTime, Date lastUpdateTime,String pid) {
         this.id = id;
         this.account = account;
         this.nice = nice;
@@ -217,6 +222,7 @@ public class SysUserInfo implements Serializable {
         this.tyyhId = tyyhId;
         this.createTime = createTime;
         this.lastUpdateTime = lastUpdateTime;
+        this.pid = pid;
     }
 
     /**
@@ -709,6 +715,14 @@ public class SysUserInfo implements Serializable {
         this.tyyhId = tyyhId;
     }
 
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
     /**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column t_sys_user_info.create_time
@@ -795,6 +809,7 @@ public class SysUserInfo implements Serializable {
             && (this.getSysType() == null ? other.getSysType() == null : this.getSysType().equals(other.getSysType()))
             && (this.getFranId() == null ? other.getFranId() == null : this.getFranId().equals(other.getFranId()))
             && (this.gettyyhId() == null ? other.gettyyhId() == null : this.gettyyhId().equals(other.gettyyhId()))
+            && (this.getPid() == null ? other.getPid() == null : this.getPid().equals(other.getPid()))
             && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
             && (this.getLastUpdateTime() == null ? other.getLastUpdateTime() == null : this.getLastUpdateTime().equals(other.getLastUpdateTime()));
     }
@@ -829,6 +844,7 @@ public class SysUserInfo implements Serializable {
         result = prime * result + ((getSysType() == null) ? 0 : getSysType().hashCode());
         result = prime * result + ((getFranId() == null) ? 0 : getFranId().hashCode());
         result = prime * result + ((gettyyhId() == null) ? 0 : gettyyhId().hashCode());
+        result = prime * result + ((getPid() == null) ? 0 : getPid().hashCode());
         result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
         result = prime * result + ((getLastUpdateTime() == null) ? 0 : getLastUpdateTime().hashCode());
         return result;

+ 2 - 0
system_mybatis/src/main/java/com/mw/platform/system/mysql/service/ISysUserService.java

@@ -39,4 +39,6 @@ public interface ISysUserService {
 	boolean queryByAccount(String account);
 
     List<LoginUser> selectZgbmUser();
+
+    List<SysUserInfo> checkByPid(String pid);
 }

+ 5 - 0
system_mybatis/src/main/java/com/mw/platform/system/mysql/service/impl/SysUserServiceImpl.java

@@ -99,4 +99,9 @@ public class SysUserServiceImpl implements ISysUserService {
 		return userDao.selectZgbmUser();
     }
 
+	@Override
+	public List<SysUserInfo> checkByPid(String pid) {
+		return userDao.selectByPid(pid);
+	}
+
 }

+ 14 - 0
system_mybatis/src/main/resources/mapper/system/transfer/SysUserMapper.xml

@@ -26,6 +26,7 @@
 	      <arg column="tyyh_id" jdbcType="VARCHAR" javaType="java.lang.String" />
 	      <arg column="create_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
 	      <arg column="last_update_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
+	      <arg column="pid" jdbcType="VARCHAR" javaType="java.lang.String" />
 		</constructor>
 	</resultMap>
 
@@ -158,6 +159,9 @@
       <if test="tyyhId != null" >
         tyyh_id,
       </if>
+      <if test="pid != null and pid != ''" >
+          pid,
+      </if>
       <if test="status != null" >
         status,
       </if>
@@ -205,6 +209,9 @@
       <if test="tyyhId != null" >
         #{tyyhId},
       </if>
+      <if test="pid != null and pid != ''" >
+          #{pid},
+      </if>
       <if test="status != null" >
         #{status},
       </if>
@@ -350,6 +357,9 @@
       <if test="tyyhId != null" >
         tyyh_id = #{tyyhId},
       </if>
+      <if test="pid != null and pid != ''" >
+          pid = #{pid},
+      </if>
       <if test="face != null" >
         face = #{face},
       </if>
@@ -427,4 +437,8 @@
     <select id="selectZgbmUser" resultType="com.mw.platform.system.mysql.entity.LoginUser">
         select id as userId, dlzh as account, xm as userName from zhfg.p_user where state = 1
     </select>
+
+    <select id="selectByPid" resultMap="BaseResultMap">
+        select * from t_sys_user_info where pid = #{pid}
+    </select>
 </mapper>