qxp192083 преди 4 години
родител
ревизия
9907508013
променени са 21 файла, в които са добавени 254 реда и са изтрити 203 реда
  1. 1 1
      bin/start_dgtly-admin.sh
  2. 1 1
      bin/start_dgtly-api.sh
  3. 3 3
      suishenbang-admin/src/main/resources/application-test-druid.yml
  4. 1 1
      suishenbang-admin/src/main/resources/application-test.yml
  5. 25 0
      suishenbang-admin/src/main/resources/templates/system/user/user.html
  6. 10 3
      suishenbang-api/src/main/java/com/dgtly/api/controller/SysUserController.java
  7. 2 2
      suishenbang-api/src/main/resources/application-test-druid.yml
  8. 28 0
      suishenbang-api/src/main/resources/application-test.yml
  9. 5 0
      suishenbang-apiframework/pom.xml
  10. 2 2
      suishenbang-apiframework/src/main/java/com/dgtly/apiframework/util/QyWeixinUtil.java
  11. 11 0
      suishenbang-system/src/main/java/com/dgtly/system/domain/SysUser.java
  12. 6 1
      suishenbang-system/src/main/resources/mapper/system/SysUserMapper.xml
  13. 2 2
      suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxController.java
  14. 3 89
      suishenbang-system/src/main/java/com/dgtly/system/domain/WxQyUser.java
  15. 3 2
      suishenbang-system/src/main/java/com/dgtly/system/mapper/WxQyUserMapper.java
  16. 2 2
      suishenbang-system/src/main/java/com/dgtly/system/service/IWxQyUserService.java
  17. 6 5
      suishenbang-system/src/main/java/com/dgtly/system/service/impl/WxQyUserServiceImpl.java
  18. 6 40
      suishenbang-system/src/main/resources/mapper/system/WxQyUserMapper.xml
  19. 57 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/java/com/dgtly/wxportal/controller/WxQyUserController.java
  20. 0 49
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/tree.html
  21. 80 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/wxdetail.html

+ 1 - 1
bin/start_dgtly-admin.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-AppName=dgtly-admin.jar
+AppName=suihenbang-admin.jar
 
 #JVM参数
 JVM_OPTS="-Dname=$AppName  -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps  -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"

+ 1 - 1
bin/start_dgtly-api.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-AppName=dgtly-api.jar
+AppName=suishengbang-api.jar
 
 #JVM参数
 JVM_OPTS="-Dname=$AppName  -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps  -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"

+ 3 - 3
suishenbang-admin/src/main/resources/application-test-druid.yml

@@ -6,9 +6,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://localhost:3306/Steelfurniture?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: root
-                password: 123456
+                  url: jdbc:mysql://10.32.2.212:3306/suishenbang-oneportal?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                  username: root
+                  password: libang
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 1 - 1
suishenbang-admin/src/main/resources/application-test.yml

@@ -9,7 +9,7 @@ ruoyi:
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-  profile: /home/project/steelfurniture/file
+  profile: /home/suishenbang/file
   # 获取ip地址开关
   addressEnabled: true
 

+ 25 - 0
suishenbang-admin/src/main/resources/templates/system/user/user.html

@@ -94,6 +94,7 @@
 		var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
 		var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
 		var resetPwdFlag = [[${@permission.hasPermi('system:user:resetPwd')}]];
+        var bondedFlag = [[${@permission.hasPermi('system:user:bonded')}]];//接触绑定
 		var prefix = ctx + "system/user";
 
 		$(function() {
@@ -168,6 +169,11 @@
 		                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
 		                actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a> ');
 		                actions.push('<a class="btn btn-info btn-xs ' + resetPwdFlag + '" href="javascript:void(0)" onclick="resetPwd(\'' + row.userId + '\')"><i class="fa fa-key"></i>重置</a>');
+		                if(row.isBindingWx>0){
+                            actions.push('<a class="btn btn-warning btn-xs " href="javascript:void(0)" onclick="wxDetail(\'' + row.userId + '\')"><i class="fa fa-search"></i>查看微信</a> ');
+                            actions.push('<a class="btn btn-warning btn-xs ' + bondedFlag + '" href="javascript:void(0)" onclick="bonded(\'' + row.userId + '\')"><i class="fa fa-chain-broken"></i>解绑</a>');
+                        }
+
 		                return actions.join('');
 		            }
 		        }]
@@ -242,6 +248,25 @@
 				$.operate.post(prefix + "/changeStatus", { "userId": userId, "status": 0 });
 		    })
 		}
+        /* 查看微信信息 */
+        function wxDetail(userId) {
+            var options = {
+                title: "用户微信详情",
+                url:  ctx + "wxqyuser/wxdetail/"+userId,
+                btn: ['关闭'],
+                yes: function (index, layero) {
+                    layer.close(index);
+                }
+            };
+            $.modal.openOptions(options);
+        }
+        /* 用户管理启用 */
+        function bonded(userId) {
+            $.modal.confirm("确认要解绑用户微信吗?", function() {
+                $.operate.post(ctx + "wxqyuser/bonded/"+userId);
+                $.table.refresh();
+            })
+        }
 	</script>
 </body>
 <!-- 导入区域 -->

+ 10 - 3
suishenbang-api/src/main/java/com/dgtly/api/controller/SysUserController.java

@@ -6,9 +6,9 @@ import com.dgtly.common.core.domain.AjaxResult;
 import com.dgtly.common.core.domain.ParameterObject;
 import com.dgtly.common.utils.security.EncryptPassWordClass;
 import com.dgtly.system.domain.SysUser;
-import com.dgtly.system.domain.WxQyUser;
+import com.dgtly.wxportal.domain.WxQyUser;
 import com.dgtly.system.service.ISysUserService;
-import com.dgtly.system.service.IWxQyUserService;
+import com.dgtly.wxportal.service.IWxQyUserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -52,8 +52,15 @@ public class SysUserController extends ApiBaseController {
         if(!sysUser.getPassword().equals(p)){
             return AjaxResult.error(301,"用户不存在或密码错误");
         }
+
+        String wxUserId = obj.getString("wxUserId");
+        WxQyUser wxQyUserIntable = wxQyUserService.selectWxQyUserById(wxUserId);
+        if(wxQyUserIntable.getSysUserId()!=null){
+            return AjaxResult.error(302,"此用户已绑定现相关系统用户");
+        }
+
         WxQyUser wxQyUser  = new WxQyUser();
-        wxQyUser.setUserid(obj.getString("wxUserId"));
+        wxQyUser.setUserid(wxUserId);
         wxQyUser.setSysUserId(sysUser.getUserId());
         int i  =wxQyUserService.updateWxQyUser(wxQyUser);
 

+ 2 - 2
suishenbang-api/src/main/resources/application-test-druid.yml

@@ -6,9 +6,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://localhost:3306/Steelfurniture?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://10.32.2.212:3306/suishenbang-oneportal?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: 123456
+                password: libang
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 28 - 0
suishenbang-api/src/main/resources/application-test.yml

@@ -63,6 +63,29 @@ spring:
     restart:
       # 热部署开关
       enabled: true
+  # redis配置
+  redis:
+      # Redis数据库索引(默认为0)
+      database: 0
+      # Redis服务器地址
+      host: 127.0.0.1
+      # Redis服务器连接端口
+      port: 6379
+      # Redis服务器连接密码(默认为空)
+      password:
+      # 连接超时时间(毫秒)
+      timeout: 500ms
+      pool:
+        jedis:
+         # 连接池最大连接数(使用负值表示没有限制)
+          max-active: 8
+          # 连接池最大阻塞等待时间(使用负值表示没有限制)
+          max-wait: -1
+          # 连接池中的最大空闲连接
+          max-idle: 8
+          # 连接池中的最小空闲连接
+          min-idle: 0
+
 # MyBatis
 mybatis:
     # 搜索指定包别名
@@ -71,3 +94,8 @@ mybatis:
     mapperLocations: classpath*:mapper/**/*Mapper.xml
     # 加载全局的配置文件
     configLocation: classpath:mybatis/mybatis-config.xml
+qiyeweixin:
+  #企业微信id
+  corpid: wx5fd543ad17678381
+  #企业应用的凭证密钥
+  corpsecret: Cs9omiMVyz3cLm2D5T51i4bCDarHhIdl5uTaj__E-38

+ 5 - 0
suishenbang-apiframework/pom.xml

@@ -103,6 +103,11 @@
             <groupId>com.dgtly</groupId>
             <artifactId>suishenbang-system</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.dgtly</groupId>
+            <artifactId>suishenbang-wxportal-common</artifactId>
+            <version>4.0.0</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 2 - 2
suishenbang-apiframework/src/main/java/com/dgtly/apiframework/util/QyWeixinUtil.java

@@ -4,8 +4,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.dgtly.common.exception.api.QyWeixinException;
 import com.dgtly.common.utils.RedisUtil;
 import com.dgtly.common.utils.http.HttpUtils;
-import com.dgtly.system.domain.WxQyUser;
-import com.dgtly.system.service.IWxQyUserService;
+import com.dgtly.wxportal.domain.WxQyUser;
+import com.dgtly.wxportal.service.IWxQyUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;

+ 11 - 0
suishenbang-system/src/main/java/com/dgtly/system/domain/SysUser.java

@@ -99,6 +99,9 @@ public class SysUser extends BaseEntity
     /** 岗位组 */
     private Long[] postIds;
 
+    /** 是否绑定企业微信信息 */
+    private String isBindingWx;
+
     public SysUser()
     {
 
@@ -385,6 +388,14 @@ public class SysUser extends BaseEntity
         this.schedulDetail = schedulDetail;
     }
 
+    public String getIsBindingWx() {
+        return isBindingWx;
+    }
+
+    public void setIsBindingWx(String isBindingWx) {
+        this.isBindingWx = isBindingWx;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 6 - 1
suishenbang-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="updateBy"     column="update_by"    />
 		<result property="updateTime"   column="update_time"  />
 		<result property="remark"       column="remark"       />
+        <result property="isBindingWx"       column="isBindingWx"       />
 		<association property="dept"    column="dept_id" javaType="SysDept" resultMap="deptResult" />
 		<association property="company"    column="company_id" javaType="SysCompany" resultMap="companyResult" />
 		<collection  property="roles"   javaType="java.util.List"        resultMap="RoleResult" />
@@ -67,10 +68,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 	
 	<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader
+		select u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name, u.email, u.avatar,
+          u.phonenumber, u.password, u.sex, u.salt, u.status, u.del_flag,
+          u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
+          d.dept_name, d.leader,wqu.count1 isBindingWx
 		from sys_user u
 		left join sys_dept d on u.dept_id = d.dept_id
 		left join sys_company c on u.company_id = c.id
+        left join (select sys_user_id, count(userId) as count1 from wx_qy_user group by sys_user_id) wqu on wqu.sys_user_id = u.user_id
 		where u.del_flag = '0'
 		<if test="loginName != null and loginName != ''">
 			AND u.login_name like concat('%', #{loginName}, '%')

+ 2 - 2
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxController.java

@@ -8,9 +8,9 @@ import com.dgtly.common.core.domain.ParameterObject;
 import com.dgtly.apiframework.util.QyWeixinUtil;
 import com.dgtly.common.utils.RedisUtil;
 import com.dgtly.system.domain.SysUser;
-import com.dgtly.system.domain.WxQyUser;
+import com.dgtly.wxportal.domain.WxQyUser;
 import com.dgtly.system.service.ISysUserService;
-import com.dgtly.system.service.IWxQyUserService;
+import com.dgtly.wxportal.service.IWxQyUserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;

+ 3 - 89
suishenbang-system/src/main/java/com/dgtly/system/domain/WxQyUser.java

@@ -1,4 +1,4 @@
-package com.dgtly.system.domain;
+package com.dgtly.wxportal.domain;
 
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -30,15 +30,6 @@ public class WxQyUser extends BaseEntity
     @Excel(name = "企业微信用户手机号")
     private String mobile;
 
-    /** 企业微信用户所属部门id列表 */
-    //private List<String> department;
-
-    /** 部门内的排序值默认为0。数量必须和department一致,数值越大排序越前面。值范围是[0, 2^32) */
-    //private List<String> order;
-
-    /** 职务信息;第三方仅通讯录应用可获取 */
-    @Excel(name = "职务信息;第三方仅通讯录应用可获取")
-    private String position;
 
     /** 性别。0表示未定义,1表示男性,2表示女性 */
     @Excel(name = "性别。0表示未定义,1表示男性,2表示女性")
@@ -48,9 +39,6 @@ public class WxQyUser extends BaseEntity
     @Excel(name = "邮箱,第三方仅通讯录应用可获取")
     private String email;
 
-    /** 表示在所在的部门内是否为上级。;第三方仅通讯录应用可获取 */
-    //private List<String> isLeaderInDept;
-
     /** 头像url。 第三方仅通讯录应用可获取 */
     @Excel(name = "头像url。 第三方仅通讯录应用可获取")
     private String avatar;
@@ -67,9 +55,6 @@ public class WxQyUser extends BaseEntity
     @Excel(name = "别名;第三方仅通讯录应用可获取")
     private String alias;
 
-    /** 扩展属性,第三方仅通讯录应用可获取 */
-    //private Object extattr;
-
     /** 激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业。
 已激活代表已激活企业微信或已关注微工作台(原企业号)。未激活代表既未激活企业微信又未关注微工作台(原企业号)。 */
     @Excel(name = "激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业。已激活代表已激活企业微信或已关注微工作台", readConverterExp = "原=企业号")
@@ -79,9 +64,6 @@ public class WxQyUser extends BaseEntity
     @Excel(name = "员工个人二维码,扫描可添加为外部联系人(注意返回的是一个url,可在浏览器上打开该url以展示二维码);第三方仅通讯录应用可获取")
     private String qrCode;
 
-    /** 成员对外属性,字段详情见对外属性;第三方仅通讯录应用可获取 */
-    @Excel(name = "成员对外属性,字段详情见对外属性;第三方仅通讯录应用可获取")
-    private String externalProfile;
 
     /** 地址。第三方仅通讯录应用可获取 */
     @Excel(name = "地址。第三方仅通讯录应用可获取")
@@ -91,9 +73,6 @@ public class WxQyUser extends BaseEntity
     @Excel(name = "全局唯一。对于同一个服务商,不同应用获取到企业内同一个成员的open_userid是相同的,最多64个字节。仅第三方应用可获取")
     private String openUserid;
 
-    /** 主部门 */
-    @Excel(name = "主部门")
-    private String mainDepartment;
 
     /** 用户关联的系统用户id */
     @Excel(name = "用户关联的系统用户id")
@@ -128,33 +107,7 @@ public class WxQyUser extends BaseEntity
     {
         return mobile;
     }
-//    public void setDepartment(List<String> department)
-//    {
-//        this.department = department;
-//    }
-//
-//    public List<String> getDepartment()
-//    {
-//        return department;
-//    }
-//    public void setOrder(List<String> order)
-//    {
-//        this.order = order;
-//    }
-//
-//    public List<String> getOrder()
-//    {
-//        return order;
-//    }
-    public void setPosition(String position) 
-    {
-        this.position = position;
-    }
 
-    public String getPosition() 
-    {
-        return position;
-    }
     public void setGender(String gender) 
     {
         this.gender = gender;
@@ -173,15 +126,7 @@ public class WxQyUser extends BaseEntity
     {
         return email;
     }
-//    public void setIsLeaderInDept(List<String> isLeaderInDept)
-//    {
-//        this.isLeaderInDept = isLeaderInDept;
-//    }
-//
-//    public List<String> getIsLeaderInDept()
-//    {
-//        return isLeaderInDept;
-//    }
+
     public void setAvatar(String avatar)
     {
         this.avatar = avatar;
@@ -218,15 +163,7 @@ public class WxQyUser extends BaseEntity
     {
         return alias;
     }
-//    public void setExtattr(String extattr)
-//    {
-//        this.extattr = extattr;
-//    }
-//
-//    public String getExtattr()
-//    {
-//        return extattr;
-//    }
+
     public void setStatus(String status) 
     {
         this.status = status;
@@ -245,15 +182,7 @@ public class WxQyUser extends BaseEntity
     {
         return qrCode;
     }
-    public void setExternalProfile(String externalProfile) 
-    {
-        this.externalProfile = externalProfile;
-    }
 
-    public String getExternalProfile() 
-    {
-        return externalProfile;
-    }
     public void setAddress(String address) 
     {
         this.address = address;
@@ -272,15 +201,7 @@ public class WxQyUser extends BaseEntity
     {
         return openUserid;
     }
-    public void setMainDepartment(String mainDepartment) 
-    {
-        this.mainDepartment = mainDepartment;
-    }
 
-    public String getMainDepartment() 
-    {
-        return mainDepartment;
-    }
     public void setSysUserId(Long sysUserId) 
     {
         this.sysUserId = sysUserId;
@@ -305,23 +226,16 @@ public class WxQyUser extends BaseEntity
             .append("userid", getUserid())
             .append("name", getName())
             .append("mobile", getMobile())
-//            .append("department", getDepartment())
-//            .append("order", getOrder())
-            .append("position", getPosition())
             .append("gender", getGender())
             .append("email", getEmail())
-//            .append("isLeaderInDept", getIsLeaderInDept())
             .append("avatar", getAvatar())
             .append("thumbAvatar", getThumbAvatar())
             .append("telephone", getTelephone())
             .append("alias", getAlias())
-            //.append("extattr", getExtattr())
             .append("status", getStatus())
             .append("qrCode", getQrCode())
-            .append("externalProfile", getExternalProfile())
             .append("address", getAddress())
             .append("openUserid", getOpenUserid())
-            .append("mainDepartment", getMainDepartment())
             .append("sysUserId", getSysUserId())
             .toString();
     }

+ 3 - 2
suishenbang-system/src/main/java/com/dgtly/system/mapper/WxQyUserMapper.java

@@ -1,6 +1,7 @@
-package com.dgtly.system.mapper;
+package com.dgtly.wxportal.mapper;
+
+import com.dgtly.wxportal.domain.WxQyUser;
 
-import com.dgtly.system.domain.WxQyUser;
 import java.util.List;
 
 /**

+ 2 - 2
suishenbang-system/src/main/java/com/dgtly/system/service/IWxQyUserService.java

@@ -1,6 +1,6 @@
-package com.dgtly.system.service;
+package com.dgtly.wxportal.service;
 
-import com.dgtly.system.domain.WxQyUser;
+import com.dgtly.wxportal.domain.WxQyUser;
 import java.util.List;
 
 /**

+ 6 - 5
suishenbang-system/src/main/java/com/dgtly/system/service/impl/WxQyUserServiceImpl.java

@@ -1,11 +1,12 @@
-package com.dgtly.system.service.impl;
+package com.dgtly.wxportal.service.impl;
 
 import java.util.List;
+
+import com.dgtly.wxportal.service.IWxQyUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.dgtly.system.mapper.WxQyUserMapper;
-import com.dgtly.system.domain.WxQyUser;
-import com.dgtly.system.service.IWxQyUserService;
+import com.dgtly.wxportal.mapper.WxQyUserMapper;
+import com.dgtly.wxportal.domain.WxQyUser;
 import com.dgtly.common.core.text.Convert;
 
 /**
@@ -15,7 +16,7 @@ import com.dgtly.common.core.text.Convert;
  * @date 2020-06-29
  */
 @Service
-public class WxQyUserServiceImpl implements IWxQyUserService 
+public class WxQyUserServiceImpl implements IWxQyUserService
 {
     @Autowired
     private WxQyUserMapper wxQyUserMapper;

+ 6 - 40
suishenbang-system/src/main/resources/mapper/system/WxQyUserMapper.xml

@@ -2,35 +2,29 @@
 <!DOCTYPE mapper
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.dgtly.system.mapper.WxQyUserMapper">
+<mapper namespace="com.dgtly.wxportal.mapper.WxQyUserMapper">
     
     <resultMap type="WxQyUser" id="WxQyUserResult">
         <result property="userid"    column="userid"    />
         <result property="name"    column="name"    />
         <result property="mobile"    column="mobile"    />
-        <!--<result property="department"    column="department"    />-->
-        <!--<result property="order"    column="order"    />-->
-        <result property="position"    column="position"    />
         <result property="gender"    column="gender"    />
         <result property="email"    column="email"    />
-        <!--<result property="isLeaderInDept"    column="is_leader_in_dept"    />-->
         <result property="avatar"    column="avatar"    />
         <result property="thumbAvatar"    column="thumb_avatar"    />
         <result property="telephone"    column="telephone"    />
         <result property="alias"    column="alias"    />
-        <!--<result property="extattr"    column="extattr"    />-->
         <result property="status"    column="status"    />
         <result property="qrCode"    column="qr_code"    />
-        <result property="externalProfile"    column="external_profile"    />
         <result property="address"    column="address"    />
         <result property="openUserid"    column="open_userid"    />
-        <result property="mainDepartment"    column="main_department"    />
         <result property="sysUserId"    column="sys_user_id"    />
         <result property="json"    column="json"    />
     </resultMap>
 
     <sql id="selectWxQyUserVo">
-        select userid, name, mobile,  position, gender, email, avatar, thumb_avatar, telephone, alias, status, qr_code, external_profile, address, open_userid, main_department, sys_user_id,json from wx_qy_user
+        select userid, name, mobile, gender, email, avatar, thumb_avatar, telephone, alias, status, qr_code,
+         address, open_userid,  sys_user_id,json from wx_qy_user
     </sql>
 
     <select id="selectWxQyUserList" parameterType="WxQyUser" resultMap="WxQyUserResult">
@@ -38,23 +32,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>  
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
             <if test="mobile != null  and mobile != ''"> and mobile = #{mobile}</if>
-            <!--<if test="department != null  and department != ''"> and department = #{department}</if>-->
-            <!--<if test="order != null  and order != ''"> and order = #{order}</if>-->
-            <if test="position != null  and position != ''"> and position = #{position}</if>
-            <if test="gender != null  and gender != ''"> and gender = #{gender}</if>
+           <if test="gender != null  and gender != ''"> and gender = #{gender}</if>
             <if test="email != null  and email != ''"> and email = #{email}</if>
-            <!--<if test="isLeaderInDept != null  and isLeaderInDept != ''"> and is_leader_in_dept = #{isLeaderInDept}</if>-->
-            <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
+           <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
             <if test="thumbAvatar != null  and thumbAvatar != ''"> and thumb_avatar = #{thumbAvatar}</if>
             <if test="telephone != null  and telephone != ''"> and telephone = #{telephone}</if>
             <if test="alias != null  and alias != ''"> and alias = #{alias}</if>
-            <!--<if test="extattr != null  and extattr != ''"> and extattr = #{extattr}</if>-->
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+           <if test="status != null  and status != ''"> and status = #{status}</if>
             <if test="qrCode != null  and qrCode != ''"> and qr_code = #{qrCode}</if>
-            <if test="externalProfile != null  and externalProfile != ''"> and external_profile = #{externalProfile}</if>
             <if test="address != null  and address != ''"> and address = #{address}</if>
             <if test="openUserid != null  and openUserid != ''"> and open_userid = #{openUserid}</if>
-            <if test="mainDepartment != null  and mainDepartment != ''"> and main_department = #{mainDepartment}</if>
             <if test="sysUserId != null "> and sys_user_id = #{sysUserId}</if>
 
         </where>
@@ -71,23 +58,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userid != null  and userid != ''">userid,</if>
             <if test="name != null  and name != ''">name,</if>
             <if test="mobile != null  and mobile != ''">mobile,</if>
-            <!--<if test="department != null  and department != ''">department,</if>-->
-            <!--<if test="order != null  and order != ''">order,</if>-->
-            <if test="position != null  and position != ''">position,</if>
             <if test="gender != null  and gender != ''">gender,</if>
             <if test="email != null  and email != ''">email,</if>
-            <!--<if test="isLeaderInDept != null  and isLeaderInDept != ''">is_leader_in_dept,</if>-->
             <if test="avatar != null  and avatar != ''">avatar,</if>
             <if test="thumbAvatar != null  and thumbAvatar != ''">thumb_avatar,</if>
             <if test="telephone != null  and telephone != ''">telephone,</if>
             <if test="alias != null  and alias != ''">alias,</if>
-            <!--<if test="extattr != null  and extattr != ''">extattr,</if>-->
             <if test="status != null  and status != ''">status,</if>
             <if test="qrCode != null  and qrCode != ''">qr_code,</if>
-            <if test="externalProfile != null  and externalProfile != ''">external_profile,</if>
             <if test="address != null  and address != ''">address,</if>
             <if test="openUserid != null  and openUserid != ''">open_userid,</if>
-            <if test="mainDepartment != null  and mainDepartment != ''">main_department,</if>
             <if test="sysUserId != null ">sys_user_id,</if>
             <if test="json != null ">json,</if>
          </trim>
@@ -95,23 +75,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userid != null  and userid != ''">#{userid},</if>
             <if test="name != null  and name != ''">#{name},</if>
             <if test="mobile != null  and mobile != ''">#{mobile},</if>
-            <!--<if test="department != null  and department != ''">#{department},</if>-->
-            <!--<if test="order != null  and order != ''">#{order},</if>-->
-            <if test="position != null  and position != ''">#{position},</if>
             <if test="gender != null  and gender != ''">#{gender},</if>
             <if test="email != null  and email != ''">#{email},</if>
-            <!--<if test="isLeaderInDept != null  and isLeaderInDept != ''">#{isLeaderInDept},</if>-->
             <if test="avatar != null  and avatar != ''">#{avatar},</if>
             <if test="thumbAvatar != null  and thumbAvatar != ''">#{thumbAvatar},</if>
             <if test="telephone != null  and telephone != ''">#{telephone},</if>
             <if test="alias != null  and alias != ''">#{alias},</if>
-            <!--<if test="extattr != null  and extattr != ''">#{extattr},</if>-->
             <if test="status != null  and status != ''">#{status},</if>
             <if test="qrCode != null  and qrCode != ''">#{qrCode},</if>
-            <if test="externalProfile != null  and externalProfile != ''">#{externalProfile},</if>
             <if test="address != null  and address != ''">#{address},</if>
             <if test="openUserid != null  and openUserid != ''">#{openUserid},</if>
-            <if test="mainDepartment != null  and mainDepartment != ''">#{mainDepartment},</if>
             <if test="sysUserId != null ">#{sysUserId},</if>
             <if test="json != null ">#{json},</if>
          </trim>
@@ -122,23 +95,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="name != null  and name != ''">name = #{name},</if>
             <if test="mobile != null  and mobile != ''">mobile = #{mobile},</if>
-            <!--<if test="department != null  and department != ''">department = #{department},</if>-->
-            <!--<if test="order != null  and order != ''">order = #{order},</if>-->
-            <if test="position != null  and position != ''">position = #{position},</if>
             <if test="gender != null  and gender != ''">gender = #{gender},</if>
             <if test="email != null  and email != ''">email = #{email},</if>
-            <!--<if test="isLeaderInDept != null  and isLeaderInDept != ''">is_leader_in_dept = #{isLeaderInDept},</if>-->
             <if test="avatar != null  and avatar != ''">avatar = #{avatar},</if>
             <if test="thumbAvatar != null  and thumbAvatar != ''">thumb_avatar = #{thumbAvatar},</if>
             <if test="telephone != null  and telephone != ''">telephone = #{telephone},</if>
             <if test="alias != null  and alias != ''">alias = #{alias},</if>
-            <!--<if test="extattr != null  and extattr != ''">extattr = #{extattr},</if>-->
             <if test="status != null  and status != ''">status = #{status},</if>
             <if test="qrCode != null  and qrCode != ''">qr_code = #{qrCode},</if>
-            <if test="externalProfile != null  and externalProfile != ''">external_profile = #{externalProfile},</if>
             <if test="address != null  and address != ''">address = #{address},</if>
             <if test="openUserid != null  and openUserid != ''">open_userid = #{openUserid},</if>
-            <if test="mainDepartment != null  and mainDepartment != ''">main_department = #{mainDepartment},</if>
             <if test="sysUserId != null ">sys_user_id = #{sysUserId},</if>
             <if test="json != null "> json = #{json},</if>
         </trim>

+ 57 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/java/com/dgtly/wxportal/controller/WxQyUserController.java

@@ -0,0 +1,57 @@
+package com.dgtly.wxportal.controller;
+
+
+
+import com.dgtly.common.annotation.Log;
+import com.dgtly.common.core.controller.BaseController;
+import com.dgtly.common.core.domain.AjaxResult;
+import com.dgtly.common.enums.BusinessType;
+import com.dgtly.wxportal.domain.WxQyUser;
+import com.dgtly.wxportal.service.IWxQyUserService;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+@Controller
+@RequestMapping("/wxqyuser")
+public class WxQyUserController extends BaseController {
+
+    private String prefix = "wxportal";
+
+    @Autowired
+    private IWxQyUserService wxQyUserService;
+
+    /**
+     * 解除微信绑定
+     */
+    @Log(title = "解除微信绑定", businessType = BusinessType.DELETE)
+    @RequiresPermissions("system:user:bonded")
+    @PostMapping("/bonded/{sysUserId}")
+    @ResponseBody
+    public AjaxResult bonded(@PathVariable("sysUserId") Long sysUserId)
+    {
+        return toAjax(wxQyUserService.bondedSysUserBySysUserId(sysUserId));
+    }
+
+    /**
+     * 查看用户微信信息
+     */
+    @GetMapping("/wxdetail/{sysUserId}")
+    public String wxdetail(@PathVariable("sysUserId") Long sysUserId, ModelMap mmap)
+    {
+        WxQyUser wxQyUser = new WxQyUser();
+        wxQyUser.setSysUserId(sysUserId);
+        List<WxQyUser> wxQyUsers = wxQyUserService.selectWxQyUserList(wxQyUser);
+        if(wxQyUsers.size()>0){
+            mmap.put("wxQyUser",wxQyUsers.get(0));
+        }else{
+            mmap.put("wxQyUser", null);
+        }
+        return prefix + "/wxdetail";
+    }
+}

+ 0 - 49
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/tree.html

@@ -1,49 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
-<head>
-	<th:block th:include="include :: header('菜单树选择')" />
-	<th:block th:include="include :: ztree-css" />
-</head>
-<style>
-	body{height:auto;font-family: "Microsoft YaHei";}
-	button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
-</style>
-<body class="hold-transition box box-main">
-	<input id="treeId"   name="treeId"    type="hidden" th:value="${magnet.magnetId}"/>
-	<input id="treeName" name="treeName"  type="hidden" th:value="${magnet.magnetName}"/>
-	<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
-		<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
-		<label id="btnHide" title="隐藏搜索">︽</label>
-	</div>
-	<div class="treeSearchInput" id="search">
-		<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
-		<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
-	</div>
-	<div class="treeExpandCollapse">
-		<a href="#" onclick="$.tree.expand()">展开</a> /
-		<a href="#" onclick="$.tree.collapse()">折叠</a>
-	</div>
-	<div id="tree" class="ztree treeselect"></div>
-	</div>
-	<th:block th:include="include :: footer" />
-	<th:block th:include="include :: ztree-js" />
-	<script th:inline="javascript">
-		$(function() {
-			var url = ctx + "wxportal/magnet/magnetTreeData";
-			var options = {
-		        url: url,
-		        expandLevel: 1,
-		        onClick : zOnClick
-		    };
-			$.tree.init(options);
-		});
-		
-		function zOnClick(event, treeId, treeNode) {
-		    var treeId = treeNode.id;
-		    var treeName = treeNode.name;
-		    $("#treeId").val(treeId);
-		    $("#treeName").val(treeName);
-		}
-	</script>
-</body>
-</html>

+ 80 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/wxdetail.html

@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改企业微信用户信息')" />
+</head>
+<body class="white-bg">
+    <div th:if="${wxQyUser}!=null" class="wrapper wrapper-content animated fadeInRight ibox-content"  >
+
+        <form class="form-horizontal m" id="form-user-edit" th:object="${wxQyUser}" >
+            <input name="userid" th:field="*{userid}" type="hidden">
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">企业微信用户姓名:</label>
+                <div class="col-sm-8">
+                    <input name="name" th:field="*{name}" class="form-control" type="text" disabled>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">企业微信用户手机号:</label>
+                <div class="col-sm-8">
+                    <input name="mobile" th:field="*{mobile}" class="form-control" type="text" disabled>
+                </div>
+            </div>
+
+
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">性别:</label>
+                <div class="col-sm-8" th:switch="*{gender}">
+                    <input th:case="'0'" name="gender" value="不明" class="form-control" type="text" disabled>
+                    <input th:case="'1'" name="gender" value="男" class="form-control" type="text" disabled>
+                    <input th:case="'2'" name="gender" value="女" class="form-control" type="text" disabled>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">邮箱:</label>
+                <div class="col-sm-8">
+                    <input name="email" th:field="*{email}" class="form-control" type="text" disabled>
+                </div>
+            </div>
+
+            <div class="form-group">
+                <label class="col-sm-3 control-label">头像:</label>
+                <div class="col-sm-8">
+                    <img style="width: 50px;height: 50px; border-radius: 5px" th:src="*{thumbAvatar}">
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">座机:</label>
+                <div class="col-sm-8">
+                    <input name="telephone" th:field="*{telephone}" class="form-control" type="text" disabled>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">别名:</label>
+                <div class="col-sm-8">
+                    <input name="alias" th:field="*{alias}" class="form-control" type="text" disabled>
+                </div>
+            </div>
+
+            <div class="form-group">
+                <label class="col-sm-3 control-label">员工个人二维码:</label>
+                <div class="col-sm-8">
+                    <img style="width: 100px;height: 100px; border-radius: 5px" th:src="*{qrCode}">
+                </div>
+            </div>
+
+            <div class="form-group">
+                <label class="col-sm-3 control-label">地址:</label>
+                <div class="col-sm-8">
+                    <textarea name="address" class="form-control" disabled>[[*{address}]]</textarea>
+                </div>
+            </div>
+
+        </form>
+    </div>
+    <div th:if="${wxQyUser}==null" class="wrapper wrapper-content animated fadeInRight ibox-content"  >
+        未关联相应微信用户
+    </div>
+    <th:block th:include="include :: footer" />
+</body>
+</html>