qxp192083 5 rokov pred
rodič
commit
546d574921
69 zmenil súbory, kde vykonal 3616 pridanie a 1173 odobranie
  1. 9 0
      pom.xml
  2. 4 3
      suishenbang-admin/src/main/resources/static/ruoyi/js/ry-ui.js
  3. 7 0
      suishenbang-admin/src/main/resources/templates/system/role/role.html
  4. 1 1
      suishenbang-admin/src/main/resources/templates/system/user/profile/avatar.html
  5. 5 0
      suishenbang-api/pom.xml
  6. 3 0
      suishenbang-api/src/main/java/com/dgtly/ApiApplication.java
  7. 22 3
      suishenbang-api/src/main/java/com/dgtly/api/controller/CommonController.java
  8. 0 37
      suishenbang-api/src/main/java/com/dgtly/api/controller/HellowController.java
  9. 0 129
      suishenbang-api/src/main/java/com/dgtly/api/controller/SysNoticeInterface.java
  10. 101 0
      suishenbang-api/src/main/java/com/dgtly/api/controller/SysUserController.java
  11. 2 2
      suishenbang-api/src/main/resources/application-dev-druid.yml
  12. 29 1
      suishenbang-api/src/main/resources/application-dev.yml
  13. 0 83
      suishenbang-apiframework/src/main/java/com/dgtly/apiframework/config/CaptchaConfig.java
  14. 21 12
      suishenbang-apiframework/src/main/java/com/dgtly/apiframework/interceptor/AuthenticationInterceptor.java
  15. 2 0
      suishenbang-apiframework/src/main/java/com/dgtly/apiframework/interceptor/SwitchEnSqlInterceptor.java
  16. 125 0
      suishenbang-apiframework/src/main/java/com/dgtly/apiframework/util/QyWeixinUtil.java
  17. 10 0
      suishenbang-common/pom.xml
  18. 108 0
      suishenbang-common/src/main/java/com/dgtly/common/config/RedisConfig.java
  19. 4 4
      suishenbang-common/src/main/java/com/dgtly/common/core/domain/AjaxResult.java
  20. 0 8
      suishenbang-common/src/main/java/com/dgtly/common/core/domain/ResultType.java
  21. 22 0
      suishenbang-common/src/main/java/com/dgtly/common/exception/api/QyWeixinException.java
  22. 533 0
      suishenbang-common/src/main/java/com/dgtly/common/utils/RedisUtil.java
  23. 0 198
      suishenbang-common/src/main/java/com/dgtly/common/utils/TranslateUtil.java
  24. 13 7
      suishenbang-common/src/main/java/com/dgtly/common/utils/http/HttpUtils.java
  25. 0 1
      suishenbang-framework/src/main/java/com/dgtly/framework/config/ShiroConfig.java
  26. 0 32
      suishenbang-system/src/main/java/com/dgtly/system/domain/SysNotice.java
  27. 328 0
      suishenbang-system/src/main/java/com/dgtly/system/domain/WxQyUser.java
  28. 0 7
      suishenbang-system/src/main/java/com/dgtly/system/mapper/SysCompanyMapper.java
  29. 1 2
      suishenbang-system/src/main/java/com/dgtly/system/mapper/SysDictDataMapper.java
  30. 3 37
      suishenbang-system/src/main/java/com/dgtly/system/mapper/SysNoticeMapper.java
  31. 68 0
      suishenbang-system/src/main/java/com/dgtly/system/mapper/WxQyUserMapper.java
  32. 68 0
      suishenbang-system/src/main/java/com/dgtly/system/service/IWxQyUserService.java
  33. 0 8
      suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysCompanyServiceImpl.java
  34. 12 13
      suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysDictDataServiceImpl.java
  35. 0 3
      suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysDictTypeServiceImpl.java
  36. 2 30
      suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysNoticeServiceImpl.java
  37. 104 0
      suishenbang-system/src/main/java/com/dgtly/system/service/impl/WxQyUserServiceImpl.java
  38. 1 11
      suishenbang-system/src/main/resources/mapper/system/SysCompanyMapper.xml
  39. 0 3
      suishenbang-system/src/main/resources/mapper/system/SysDictDataMapper.xml
  40. 0 3
      suishenbang-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
  41. 4 16
      suishenbang-system/src/main/resources/mapper/system/SysNoticeMapper.xml
  42. 165 0
      suishenbang-system/src/main/resources/mapper/system/WxQyUserMapper.xml
  43. 14 13
      suishenbang-wxportal/suishenbang-wxportal-api/pom.xml
  44. 102 0
      suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxController.java
  45. 50 0
      suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxPortalController.java
  46. 26 0
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/domain/RoleMagnet.java
  47. 94 0
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/domain/WxBanner.java
  48. 0 10
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/domain/WxMagnet.java
  49. 61 0
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/mapper/WxBannerMapper.java
  50. 29 21
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/mapper/WxMagnetMapper.java
  51. 61 0
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/IWxBannerService.java
  52. 20 10
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/IWxMagnetService.java
  53. 97 0
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/WxBannerServiceImpl.java
  54. 46 37
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/WxMagnetServiceImpl.java
  55. 99 0
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/resources/mapper/wxportal/WxBannerMapper.xml
  56. 55 29
      suishenbang-wxportal/suishenbang-wxportal-common/src/main/resources/mapper/wxportal/WxMagnetMapper.xml
  57. 6 0
      suishenbang-wxportal/suishenbang-wxportal-manager/pom.xml
  58. 136 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/java/com/dgtly/wxportal/controller/WxBannerController.java
  59. 46 48
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/java/com/dgtly/wxportal/controller/WxMagnetController.java
  60. 0 192
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/add.html
  61. 99 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/add.html
  62. 117 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/banner.html
  63. 102 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/edit.html
  64. 79 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/uploadImg.html
  65. 0 133
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/edit.html
  66. 190 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/add.html
  67. 194 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/edit.html
  68. 59 0
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/roletree.html
  69. 57 26
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/wxMagnet.html

+ 9 - 0
pom.xml

@@ -31,6 +31,7 @@
 		<commons.fileupload.version>1.3.3</commons.fileupload.version>
 		<poi.version>3.17</poi.version>
 		<velocity.version>1.7</velocity.version>
+        <lombok.version>1.16.10</lombok.version>
 	</properties>
 	
     <!-- 依赖声明 -->
@@ -167,6 +168,14 @@
 				<artifactId>fastjson</artifactId>
 				<version>${fastjson.version}</version>
 			</dependency>
+
+
+            <!--lombok 注解-->
+            <dependency>
+                <groupId>org.projectlombok</groupId>
+                <artifactId>lombok</artifactId>
+                <version>${lombok.version}</version>
+            </dependency>
             
             <!-- 定时任务-->
 			<dependency>

+ 4 - 3
suishenbang-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -159,7 +159,7 @@
             		$('#' + $.table._option.toolbar + ' .single').toggleClass('disabled', rows.length!=1);
             	});
             	// 图片预览事件
-            	$.btTable.on('click', '.img-circle', function() {
+            	$.btTable.on('click', '.img-view', function() {
     			    var src = $(this).attr('src');
     			    var target = $(this).data('target');
     			    var height = $(this).data('height');
@@ -234,7 +234,7 @@
 				return actions.join('');
 			},
 			// 图片预览
-			imageView: function (value, height, width, target) {
+			imageView: function (value, height, width,imgClass, target) {
 				if ($.common.isEmpty(width)) {
                 	width = 'auto';
                 }
@@ -243,8 +243,9 @@
                 }
 				// blank or self
 				var _target = $.common.isEmpty(target) ? 'self' : target;
+                var _imgClass = $.common.isEmpty(imgClass) ? 'img-view img-circle img-xs' : imgClass;
 				if ($.common.isNotEmpty(value)) {
-					return $.common.sprintf("<img class='img-circle img-xs' data-height='%s' data-width='%s' data-target='%s' src='%s'/>", height, width, _target, value);
+					return $.common.sprintf("<img class='%s' data-height='%s' data-width='%s' data-target='%s' src='%s'/>",_imgClass, height, width, _target, value);
 				} else {
 					return $.common.nullToStr(value);
 				}

+ 7 - 0
suishenbang-admin/src/main/resources/templates/system/role/role.html

@@ -115,6 +115,7 @@
 		                var actions = [];
 		                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.roleId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
 		                actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="authDataScope(\'' + row.roleId + '\')"><i class="fa fa-check-square-o"></i>数据权限</a> ');
+                        actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="wxMagnet(\'' + row.roleId + '\')"><i class="fa fa-user"></i>企业微信磁贴</a> ');
 		                actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="authUser(\'' + row.roleId + '\')"><i class="fa fa-user"></i>分配用户</a> ');
 		                actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.roleId + '\')"><i class="fa fa-remove"></i>删除</a> ');
 		                return actions.join('');
@@ -135,6 +136,12 @@
 		    var url = prefix + '/authUser/' + roleId;
 		    $.modal.openTab("分配用户", url);
 		}
+
+        /* 角色管理-分配企业微信磁贴权限 */
+        function wxMagnet(roleId) {
+            var url = ctx + 'wxportal/magnet/selectMagnetTree/' + roleId;
+            $.modal.open("分配磁贴", url,400,600);
+        }
 		
 		/* 角色状态显示 */
 		function statusTools(row) {

+ 1 - 1
suishenbang-admin/src/main/resources/templates/system/user/profile/avatar.html

@@ -7,7 +7,7 @@
 <body class="white-bg">
     <div class="container"> 
         <div class="imageBox"> 
-	        <div class="thumbBox"></div> 
+	        <div class="thumbBox" style="width:200px;height:200px;"></div>
 	        <div class="spinner" style="display: none">Loading...</div> 
 	   </div> 
 	   <div class="action"> 

+ 5 - 0
suishenbang-api/pom.xml

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

+ 3 - 0
suishenbang-api/src/main/java/com/dgtly/ApiApplication.java

@@ -9,6 +9,9 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
 @EnableSwagger2
 public class ApiApplication {
 
+
+
+
     public static void main(String[] args)
     {
         SpringApplication.run(ApiApplication.class, args);

+ 22 - 3
suishenbang-api/src/main/java/com/dgtly/api/controller/CommonController.java

@@ -7,8 +7,10 @@ import com.dgtly.common.config.ServerConfig;
 import com.dgtly.common.core.controller.ApiBaseController;
 import com.dgtly.common.core.domain.AjaxResult;
 import com.dgtly.common.core.domain.ParameterObject;
+import com.dgtly.common.core.domain.ResultType;
 import com.dgtly.common.utils.file.FileUploadUtils;
 import com.dgtly.system.service.ISysDictDataService;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -18,12 +20,16 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.util.ArrayList;
+import java.util.List;
+
 
 /**
  * 通用请求处理
  * 
  * @author dgtly
  */
+@Api(tags = "常用API")
 @ApiNoCheckSign
 @ApiPassToken
 @RestController()
@@ -36,20 +42,19 @@ public class CommonController extends ApiBaseController
     private ServerConfig serverConfig;
 
     @Autowired
-    private ISysDictDataService dictDataService;
+    private ISysDictDataService sysDictDataService;
 
 
     @ApiOperation(value = "获取字典")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "params" , paramType = "body"),
-            @ApiImplicitParam(name = "language" , paramType = "header")
     })
     @PostMapping("/dict")
     public Object getDict(){
         ParameterObject obj = getParameterObject();
         obj.checkParameterNotNull("dictType");
         String dictType = obj.getString("dictType");
-        return AjaxResult.success().putKV("list", dictDataService.selectSimpleDictDataByType(dictType));
+        return AjaxResult.success().putKV("list", sysDictDataService.selectSimpleDictDataByType(dictType));
     }
 
 
@@ -76,6 +81,20 @@ public class CommonController extends ApiBaseController
         }
     }
 
+    @ApiOperation(value = "获取全局异常")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+    })
+    @PostMapping("/globalException")
+    public Object globalException(){
+        List<String> res = new ArrayList<>();
+        for(ResultType r :ResultType.values()){
+            String s = "错误代码:"+r.value()+"---错误信息:"+r.msg();
+            res.add(s);
+        }
+        return AjaxResult.success().putKV("list", res);
+    }
+
 
 
 }

+ 0 - 37
suishenbang-api/src/main/java/com/dgtly/api/controller/HellowController.java

@@ -1,37 +0,0 @@
-package com.dgtly.api.controller;
-
-
-import com.dgtly.common.annotation.ApiNoCheckSign;
-import com.dgtly.common.annotation.ApiPassToken;
-import com.dgtly.common.core.controller.ApiBaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.domain.ParameterObject;
-import com.dgtly.system.domain.SysUser;
-import org.springframework.web.bind.annotation.*;
-
-@RestController
-@ApiPassToken
-@ApiNoCheckSign
-public class HellowController extends ApiBaseController {
-
-
-    @GetMapping("getTest")
-    public Object getTest(String param){
-        return AjaxResult.success().putKV("param",param);
-    }
-
-
-    @PostMapping("/post/json")
-    public Object j(){
-        ParameterObject obj = getParameterObject();obj.checkParameterNotNull("id,aa");
-        SysUser su = obj.parseBean(SysUser.class);
-        return AjaxResult.success();
-    }
-
-    @PostMapping("/post/form")
-    public Object f(String param ){
-        return AjaxResult.success().putKV("param",param);
-    }
-
-
-}

+ 0 - 129
suishenbang-api/src/main/java/com/dgtly/api/controller/SysNoticeInterface.java

@@ -1,129 +0,0 @@
-package com.dgtly.api.controller;
-
-import com.dgtly.common.annotation.ApiNoCheckSign;
-import com.dgtly.common.annotation.ApiPassToken;
-import com.dgtly.common.core.controller.ApiBaseController;
-import com.dgtly.common.core.controller.BaseController;
-import com.dgtly.common.core.domain.AjaxResult;
-import com.dgtly.common.core.domain.ParameterObject;
-import com.dgtly.common.utils.StringUtils;
-import com.dgtly.system.domain.SysNotice;
-import com.dgtly.system.service.ISysNoticeService;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
-  * @descption: 内容管理相关接口
-  * @author LiuLingChao
-  * @version 1.0
-  * @company 神州数码通用软件(洛阳)有限公司
-  * @copyright (c) 2019 LuoYang DGT Co'Ltd Inc. All rights reserved.
-  * @date 2019-11-04 11:08
-  * @since JDK1.8
-  */
-@RestController
-@RequestMapping("/interface/notice")
-@ApiPassToken
-@ApiNoCheckSign
-public class SysNoticeInterface extends ApiBaseController {
-
-    @Autowired
-    private ISysNoticeService sysNoticeService;
-
-    /**
-     * @descption: 根据类型查询内容列表前五个
-     * @param:类型
-     * @return: 内容列表五个
-     * @auther: LiuLingChao
-     * @date: 2019-11-04 11:46
-     */
-    @ApiOperation(value = "根据类型查询内容列表前五个")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "params" , paramType = "body"),
-            @ApiImplicitParam(name = "language" , paramType = "header")
-    })
-    @PostMapping("getNoticeListTop5")
-    public AjaxResult getNoticeList(){
-
-        ParameterObject obj =  getParameterObject();
-        SysNotice sysNotice = obj.parseBean(SysNotice.class);
-        String noticeType = sysNotice.getNoticeType();
-        if(StringUtils.isNotEmpty(noticeType)){
-            sysNotice.setLimitFlag("true");
-            List<SysNotice> sysNoticeList = sysNoticeService.selectNoticeTop3ByRole(sysNotice);
-            List<String> banner = new ArrayList<String>();
-            for(SysNotice n:sysNoticeList){
-                banner.add(n.getFmzFileUrl());
-            }
-            AjaxResult result = AjaxResult.success("查询成功").putKV("list",sysNoticeList);
-            result.putKV("banner",banner);
-            return result;
-        }else{
-            return AjaxResult.error("参数为空");
-        }
-
-
-    }
-
-    /**
-     * @descption: 根据类型查询全部内容列表
-     * @param:类型
-     * @return: 内容列表
-     * @auther: LiuLingChao
-     * @date: 2019-11-04 15:01
-     */
-    @ApiOperation(value = "根据类型查询全部内容列表")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "params" , paramType = "body"),
-            @ApiImplicitParam(name = "language" , paramType = "header")
-    })
-    @PostMapping("getNoticeListAll")
-    public AjaxResult getNoticeListAll(){
-        ParameterObject obj =  getParameterObject();
-        SysNotice sysNotice = obj.parseBean(SysNotice.class);
-        String noticeType = sysNotice.getNoticeType();
-        if(StringUtils.isNotEmpty(noticeType)){
-            startPage(obj);/*向分页传递 分页参数*/
-            List<SysNotice> sysNoticeList = sysNoticeService.selectNoticeList(sysNotice);
-            return AjaxResult.success(getDataTable(sysNoticeList));
-        }else{
-            return AjaxResult.error("参数为空");
-        }
-
-
-    }
-
-    /**
-     * @descption: 根据id查询详情
-     * @param:
-     * @return:
-     * @auther: LiuLingChao
-     * @date: 2020-2-27 10:31
-     */
-    @ApiOperation(value = "根据id查询详情")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "params" , paramType = "body"),
-            @ApiImplicitParam(name = "language" , paramType = "header")
-    })
-    @RequestMapping("getNoticeListById")
-    public AjaxResult getNoticeListById(){
-        ParameterObject obj =  getParameterObject();
-        SysNotice sysNotice = obj.parseBean(SysNotice.class);
-        Long noticeId = sysNotice.getNoticeId();
-        if(null != noticeId){
-            SysNotice sysNotice1 = sysNoticeService.selectNoticeById(noticeId);
-            return AjaxResult.success().putKV("sysNotice",sysNotice1);
-        }else{
-            return AjaxResult.error("参数为空");
-        }
-
-
-    }
-}

+ 101 - 0
suishenbang-api/src/main/java/com/dgtly/api/controller/SysUserController.java

@@ -0,0 +1,101 @@
+package com.dgtly.api.controller;
+
+import com.dgtly.common.annotation.ApiPassToken;
+import com.dgtly.common.core.controller.ApiBaseController;
+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.system.service.ISysUserService;
+import com.dgtly.system.service.IWxQyUserService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Api(tags = "系统用户相关API")
+@RestController
+@RequestMapping("sysuser")
+public class SysUserController extends ApiBaseController {
+
+    @Autowired
+    private IWxQyUserService wxQyUserService;
+    @Autowired
+    private ISysUserService sysUserService;
+
+
+    @ApiOperation(value = "绑定微信用户和系统用户",
+            notes = "参数:{wxUserId:'xxxxxxxxxxxxxxxxxxxx'," +
+            "username:'admin',password:'admin123'}" +
+            "错误:" +
+            "301  用户不存在或密码错误")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @ApiPassToken
+    @PostMapping("bindingUser")
+    public Object bindingUser(){
+        ParameterObject obj =  getParameterObject();
+        obj.checkParameterNotNull("wxUserId,username,password");
+        SysUser sysUser = sysUserService.selectUserByLoginName(obj.getString("username"));
+        if(sysUser==null){
+            return AjaxResult.error(301,"用户不存在或密码错误");
+        }
+        String p =EncryptPassWordClass.encryptPassword(sysUser.getLoginName(), obj.getString("password"), sysUser.getSalt());
+        if(!sysUser.getPassword().equals(p)){
+            return AjaxResult.error(301,"用户不存在或密码错误");
+        }
+        WxQyUser wxQyUser  = new WxQyUser();
+        wxQyUser.setUserid(obj.getString("wxUserId"));
+        wxQyUser.setSysUserId(sysUser.getUserId());
+        int i  =wxQyUserService.updateWxQyUser(wxQyUser);
+
+        if (i > 0) {
+            return AjaxResult.success().putKV("user",sysUser);
+        }else{
+            return AjaxResult.error();
+        }
+    }
+
+    @ApiOperation(value = "接触绑定",
+            notes = "参数:{" +
+                    "userId:xxxxxx}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @PostMapping("bonded")
+    public Object bonded(){
+        ParameterObject obj =  getParameterObject();
+        obj.checkParameterNotNull("userId");
+        Long userId =obj.getLong("userId");
+        int i = wxQyUserService.bondedSysUserBySysUserId(userId);
+        return toAjax(i);
+    }
+
+    @ApiOperation(value = "获取用户信息",
+            notes = "参数:{" +
+                    "userId:xxxxxx}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @PostMapping("getUserInfo")
+    public Object getUserInfo(){
+        ParameterObject obj =  getParameterObject();
+        obj.checkParameterNotNull("userId");
+        Long userId =obj.getLong("userId");
+        SysUser user = sysUserService.selectUserById(userId);
+        WxQyUser wxQyUser = new WxQyUser();
+        wxQyUser.setSysUserId(userId);
+        List<WxQyUser> wxQyUsers = wxQyUserService.selectWxQyUserList(wxQyUser);
+        wxQyUser = wxQyUsers.size()>0?wxQyUsers.get(0):null;
+        return AjaxResult.success().putKV("wxUser",wxQyUser).putKV("sysUser",user);
+    }
+
+}

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

@@ -6,9 +6,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://192.168.100.254: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:
                 # 从数据源开关/默认关闭

+ 29 - 1
suishenbang-api/src/main/resources/application-dev.yml

@@ -7,7 +7,7 @@ ruoyi:
   # 版权年份
   copyrightYear: 2019
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-  profile: D:/dgtly/uploadPath
+  profile: D:/home
   # 获取ip地址开关
   addressEnabled: true
   #是否开启swagger
@@ -63,6 +63,29 @@ spring:
     restart:
       # 热部署开关
       enabled: true
+  # redis配置
+  redis:
+      # Redis数据库索引(默认为0)
+      database: 0
+      # Redis服务器地址
+      host: 192.168.100.254
+      # 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

+ 0 - 83
suishenbang-apiframework/src/main/java/com/dgtly/apiframework/config/CaptchaConfig.java

@@ -1,83 +0,0 @@
-package com.dgtly.apiframework.config;
-
-import java.util.Properties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import com.google.code.kaptcha.impl.DefaultKaptcha;
-import com.google.code.kaptcha.util.Config;
-import static com.google.code.kaptcha.Constants.*;
-
-/**
- * 验证码配置
- *
- * @author ruoyi
- */
-@Configuration
-public class CaptchaConfig
-{
-    @Bean(name = "captchaProducer")
-    public DefaultKaptcha getKaptchaBean()
-    {
-        DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
-        Properties properties = new Properties();
-        // 是否有边框 默认为true 我们可以自己设置yes,no
-        properties.setProperty(KAPTCHA_BORDER, "yes");
-        // 验证码文本字符颜色 默认为Color.BLACK
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "black");
-        // 验证码图片宽度 默认为200
-        properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160");
-        // 验证码图片高度 默认为50
-        properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "60");
-        // 验证码文本字符大小 默认为40
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_SIZE, "38");
-        // KAPTCHA_SESSION_KEY
-        properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCode");
-        // 验证码文本字符长度 默认为5
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "4");
-        // 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier");
-        // 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
-        properties.setProperty(KAPTCHA_OBSCURIFICATOR_IMPL, "com.google.code.kaptcha.impl.ShadowGimpy");
-        Config config = new Config(properties);
-        defaultKaptcha.setConfig(config);
-        return defaultKaptcha;
-    }
-
-    @Bean(name = "captchaProducerMath")
-    public DefaultKaptcha getKaptchaBeanMath()
-    {
-        DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
-        Properties properties = new Properties();
-        // 是否有边框 默认为true 我们可以自己设置yes,no
-        properties.setProperty(KAPTCHA_BORDER, "yes");
-        // 边框颜色 默认为Color.BLACK
-        properties.setProperty(KAPTCHA_BORDER_COLOR, "105,179,90");
-        // 验证码文本字符颜色 默认为Color.BLACK
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "blue");
-        // 验证码图片宽度 默认为200
-        properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160");
-        // 验证码图片高度 默认为50
-        properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "60");
-        // 验证码文本字符大小 默认为40
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_SIZE, "35");
-        // KAPTCHA_SESSION_KEY
-        properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCodeMath");
-        // 验证码文本生成器
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.dgtly.framework.config.KaptchaTextCreator");
-        // 验证码文本字符间距 默认为2
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3");
-        // 验证码文本字符长度 默认为5
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "6");
-        // 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier");
-        // 验证码噪点颜色 默认为Color.BLACK
-        properties.setProperty(KAPTCHA_NOISE_COLOR, "white");
-        // 干扰实现类
-        properties.setProperty(KAPTCHA_NOISE_IMPL, "com.google.code.kaptcha.impl.NoNoise");
-        // 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
-        properties.setProperty(KAPTCHA_OBSCURIFICATOR_IMPL, "com.google.code.kaptcha.impl.ShadowGimpy");
-        Config config = new Config(properties);
-        defaultKaptcha.setConfig(config);
-        return defaultKaptcha;
-    }
-}

+ 21 - 12
suishenbang-apiframework/src/main/java/com/dgtly/apiframework/interceptor/AuthenticationInterceptor.java

@@ -19,12 +19,21 @@ import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
+/*企业微信应用  放过token校验*/
 @Component
 public class AuthenticationInterceptor implements HandlerInterceptor {
 
+    @Autowired
+    private ISysUserService sysUserService;
+
     @Override
     public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) throws Exception {
+        //因为必须在企业微信中才能那个登录  所以放开登录token验证
+        if(1==1){
+            return true;
+        }
+
+
         String token = httpServletRequest.getHeader("token");// 从 http 请求头中取出 token
         // 如果不是映射到方法直接通过
         if(!(object instanceof HandlerMethod)){
@@ -58,17 +67,17 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
             /*密码错误*/
             throw new NoLoginException();
         }
-//        MemberInfo user = memberInfoService.selectMemberInfoById(userId);
-//        if (user == null) {
-//            throw new NoLoginException();
-//        }
-//        // 验证 token
-//        JWTVerifier jwtVerifier = JWT.require(Algorithm.HMAC256(user.getLoginPassword())).build();
-//        try {
-//            jwtVerifier.verify(token);
-//        } catch (JWTVerificationException e) {
-//            throw new ApiTokenTimeoutException();
-//        }
+        SysUser user = sysUserService.selectUserById(userId);
+        if (user == null) {
+            throw new NoLoginException();
+        }
+        // 验证 token
+        JWTVerifier jwtVerifier = JWT.require(Algorithm.HMAC256(user.getPassword())).build();
+        try {
+            jwtVerifier.verify(token);
+        } catch (JWTVerificationException e) {
+            throw new ApiTokenTimeoutException();
+        }
         return true;
     }
 

+ 2 - 0
suishenbang-apiframework/src/main/java/com/dgtly/apiframework/interceptor/SwitchEnSqlInterceptor.java

@@ -1,5 +1,6 @@
 package com.dgtly.apiframework.interceptor;
 
+
 import com.dgtly.common.annotation.SwitchEn;
 import com.dgtly.common.utils.ServletUtils;
 import com.dgtly.common.utils.StringUtils;
@@ -18,6 +19,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.lang.reflect.Method;
 import java.util.Properties;
 
+/*放过中英文切换*/
 @Component
 @Intercepts({@Signature(
         type = Executor.class,

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

@@ -0,0 +1,125 @@
+package com.dgtly.apiframework.util;
+
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * 企业微信工具类
+ */
+@Component
+public class QyWeixinUtil {
+
+    @Autowired
+    private RedisUtil redisUtil;
+
+    @Autowired
+    private IWxQyUserService wxQyUserService;
+
+    private String redis_qywxtoken_key="QYWX_ACCESS_TOKEN";
+
+    //获取access_token的接口地址(GET) 限200(次/天)
+    private String access_token_url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s";
+
+    //获取用户信息url
+    private String getuserinfo_url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=%s&code=%s";
+
+    //网页授权链接
+    private String oauth2_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect";
+
+
+    //获取用户详细信息
+    private String getUser_url = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=%s&userid=%s";
+
+
+    @Value(value = "${qiyeweixin.corpid}")
+    private String corpid;
+
+
+
+    @Value(value = "${qiyeweixin.corpsecret}")
+    private String corpsecret;
+
+    /**
+     * 获取access_token
+     * @return
+     */
+    public String getAccessToken() {
+        if(redisUtil.hasKey(redis_qywxtoken_key)){
+            return redisUtil.get(redis_qywxtoken_key).toString();
+        }
+        String url = String.format(access_token_url,corpid,corpsecret );
+        JSONObject json = JSONObject.parseObject(HttpUtils.sendGet(url));
+        Integer errcode = json.getInteger("errcode");
+        if(errcode!=0){
+            throw new QyWeixinException(errcode,json.getString("errmsg"),url);
+        }
+        String token = json.getString("access_token");
+        redisUtil.set(redis_qywxtoken_key,token,json.getLong("expires_in"));
+
+        return token;
+    }
+
+    /**
+     * 获取企业微信用户的userId
+     * @return
+     */
+    public JSONObject getUserId(String code) {
+        String url = String.format(getuserinfo_url,getAccessToken(),code );
+
+        JSONObject json  = JSONObject.parseObject(HttpUtils.sendGet(url));
+        Integer errcode = json.getInteger("errcode");
+        if(errcode!=0){
+            throw new QyWeixinException(errcode,json.getString("errmsg"),url);
+        }
+        /*
+        * 当用户为企业成员时返回示例如下:
+        * {
+        *   "errcode": 0,
+        *   "errmsg": "ok",
+        *   "UserId":"USERID",
+        *   "DeviceId":"DEVICEID"
+        *   }
+        *
+        * 非企业成员授权时返回示例如下:
+        * {
+        *   "errcode": 0,
+        *   "errmsg": "ok",
+        *   "OpenId":"OPENID",
+        *   "DeviceId":"DEVICEID"
+        *   }
+        *
+        * */
+
+        return json;
+    }
+
+    public String getOauth2Url(String redirect,String state){
+        return String.format(oauth2_url,corpid,redirect,state);
+    }
+
+    public WxQyUser gerUserDetail(String userId){
+        String url =  String.format(getUser_url,getAccessToken(),userId);
+
+        String result = HttpUtils.sendGet(url);
+
+        JSONObject json = JSONObject.parseObject(result);
+
+        Integer errcode = json.getInteger("errcode");
+        if(errcode!=0){
+            throw new QyWeixinException(errcode,json.getString("errmsg"),url);
+        }
+        WxQyUser wxQyUser = JSONObject.parseObject(result,WxQyUser.class);
+        wxQyUser.setJson(result);
+        return wxQyUser;
+
+    }
+
+}

+ 10 - 0
suishenbang-common/pom.xml

@@ -102,6 +102,16 @@
 			<version>2.3</version>
 			<classifier>jdk15</classifier>
 		</dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
     </dependencies>
   
 </project>

+ 108 - 0
suishenbang-common/src/main/java/com/dgtly/common/config/RedisConfig.java

@@ -0,0 +1,108 @@
+package com.dgtly.common.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.cache.annotation.CachingConfigurerSupport;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.*;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+@Configuration
+@EnableCaching
+public class RedisConfig extends CachingConfigurerSupport {
+
+    /**
+     * retemplate相关配置
+     * @param factory
+     * @return
+     */
+    @Bean
+    public RedisTemplate<String,Object> redisTemplate(RedisConnectionFactory factory){
+        RedisTemplate<String,Object> template = new RedisTemplate<>();
+        //配置连接工厂
+        template.setConnectionFactory(factory);
+
+        //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
+        Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class);
+
+        ObjectMapper om = new ObjectMapper();
+        // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
+        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
+        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        jacksonSeial.setObjectMapper(om);
+
+        // 值采用json序列化
+        template.setValueSerializer(jacksonSeial);
+        //使用StringRedisSerializer来序列化和反序列化redis的key值
+        template.setKeySerializer(new StringRedisSerializer());
+
+        // 设置hash key 和value序列化模式
+        template.setHashKeySerializer(new StringRedisSerializer());
+        template.setHashValueSerializer(jacksonSeial);
+        template.afterPropertiesSet();
+
+        return template;
+    }
+
+    /**
+     * 对hash类型的数据操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForHash();
+    }
+
+    /**
+     * 对redis字符串类型数据操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForValue();
+    }
+
+    /**
+     * 对链表类型的数据操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForList();
+    }
+
+    /**
+     * 对无序集合类型的数据操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForSet();
+    }
+
+    /**
+     * 对有序集合类型的数据操作
+     *
+     * @param redisTemplate
+     * @return
+     */
+    @Bean
+    public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
+        return redisTemplate.opsForZSet();
+    }
+
+}

+ 4 - 4
suishenbang-common/src/main/java/com/dgtly/common/core/domain/AjaxResult.java

@@ -204,19 +204,19 @@ public class AjaxResult
      *
      * @return
      */
-   /* public static AjaxResult error(int code,String msg)
+    public static AjaxResult error(int code,String msg)
     {
         return new AjaxResult(code,msg);
-    }*/
+    }
 
     /**
      * 返回错误消息
      *
      * @return
      */
-    /*public static AjaxResult error(int code,String msg,Object data){
+    public static AjaxResult error(int code,String msg,Object data){
         return new AjaxResult(code,msg).parseBean(data);
-    }*/
+    }
 
 
 

+ 0 - 8
suishenbang-common/src/main/java/com/dgtly/common/core/domain/ResultType.java

@@ -6,14 +6,6 @@ public enum ResultType {
     /** 成功 */
     SUCCESS(0,"成功")
 
-    ,LOGINNAMEREPEAT(301,"登录名重复")
-    ,PHONEREPEAT(302,"电话号码重复")
-    ,PASSWORDERROR(303,"账号或密码错误")
-    ,VERIFICATIONERROR(304,"验证码错误")
-    ,PASSWORD_LENGTH_ERROR(305,"密码长度为6~19位")
-    ,ACCOUNT_PHONE_ERROR(306,"未找到相应账户(手机号或账号错误)")
-
-
 
 
 

+ 22 - 0
suishenbang-common/src/main/java/com/dgtly/common/exception/api/QyWeixinException.java

@@ -0,0 +1,22 @@
+package com.dgtly.common.exception.api;
+
+import com.dgtly.common.exception.BusinessException;
+
+public class QyWeixinException extends RuntimeException {
+
+    private Integer errcode;
+
+    private String errmsg;
+
+    private String message;
+
+    public QyWeixinException(Integer errcode,String errmsg,String url) {
+
+        super("企业微信API访问返回异常,请求地址为:"+url+"异常代码errcode:"+errcode+"---errmsg:"+errmsg,new Throwable());
+
+        this.errcode = errcode;
+        this.errmsg =errmsg;
+    }
+
+
+}

+ 533 - 0
suishenbang-common/src/main/java/com/dgtly/common/utils/RedisUtil.java

@@ -0,0 +1,533 @@
+package com.dgtly.common.utils;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+@Component
+public class RedisUtil {
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    public RedisUtil(RedisTemplate<String, Object> redisTemplate) {
+        this.redisTemplate = redisTemplate;
+    }
+
+    /**
+     * 指定缓存失效时间
+     * @param key 键
+     * @param time 时间(秒)
+     * @return
+     */
+    public boolean expire(String key,long time){
+        try {
+            if(time>0){
+                redisTemplate.expire(key, time, TimeUnit.SECONDS);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 根据key 获取过期时间
+     * @param key 键 不能为null
+     * @return 时间(秒) 返回0代表为永久有效
+     */
+    public long getExpire(String key){
+        return redisTemplate.getExpire(key,TimeUnit.SECONDS);
+    }
+
+    /**
+     * 判断key是否存在
+     * @param key 键
+     * @return true 存在 false不存在
+     */
+    public boolean hasKey(String key){
+        try {
+            return redisTemplate.hasKey(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 删除缓存
+     * @param key 可以传一个值 或多个
+     */
+    @SuppressWarnings("unchecked")
+    public void del(String ... key){
+        if(key!=null&&key.length>0){
+            if(key.length==1){
+                redisTemplate.delete(key[0]);
+            }else{
+                redisTemplate.delete(CollectionUtils.arrayToList(key));
+            }
+        }
+    }
+
+    //============================String=============================
+    /**
+     * 普通缓存获取
+     * @param key 键
+     * @return 值
+     */
+    public Object get(String key){
+        return key==null?null:redisTemplate.opsForValue().get(key);
+    }
+
+    /**
+     * 普通缓存放入
+     * @param key 键
+     * @param value 值
+     * @return true成功 false失败
+     */
+    public boolean set(String key,Object value) {
+        try {
+            redisTemplate.opsForValue().set(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 普通缓存放入并设置时间
+     * @param key 键
+     * @param value 值
+     * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
+     * @return true成功 false 失败
+     */
+    public boolean set(String key,Object value,long time){
+        try {
+            if(time>0){
+                redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
+            }else{
+                set(key, value);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 递增
+     * @param key 键
+     * @param delta 要增加几(大于0)
+     * @return
+     */
+    public long incr(String key, long delta){
+        if(delta<0){
+            throw new RuntimeException("递增因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, delta);
+    }
+
+    /**
+     * 递减
+     * @param key 键
+     * @param delta 要减少几(小于0)
+     * @return
+     */
+    public long decr(String key, long delta){
+        if(delta<0){
+            throw new RuntimeException("递减因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, -delta);
+    }
+
+    //================================Map=================================
+    /**
+     * HashGet
+     * @param key 键 不能为null
+     * @param item 项 不能为null
+     * @return 值
+     */
+    public Object hget(String key,String item){
+        return redisTemplate.opsForHash().get(key, item);
+    }
+
+    /**
+     * 获取hashKey对应的所有键值
+     * @param key 键
+     * @return 对应的多个键值
+     */
+    public Map<Object,Object> hmget(String key){
+        return redisTemplate.opsForHash().entries(key);
+    }
+
+    /**
+     * HashSet
+     * @param key 键
+     * @param map 对应多个键值
+     * @return true 成功 false 失败
+     */
+    public boolean hmset(String key, Map<String,Object> map){
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * HashSet 并设置时间
+     * @param key 键
+     * @param map 对应多个键值
+     * @param time 时间(秒)
+     * @return true成功 false失败
+     */
+    public boolean hmset(String key, Map<String,Object> map, long time){
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            if(time>0){
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     * @param key 键
+     * @param item 项
+     * @param value 值
+     * @return true 成功 false失败
+     */
+    public boolean hset(String key,String item,Object value) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     * @param key 键
+     * @param item 项
+     * @param value 值
+     * @param time 时间(秒)  注意:如果已存在的hash表有时间,这里将会替换原有的时间
+     * @return true 成功 false失败
+     */
+    public boolean hset(String key,String item,Object value,long time) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            if(time>0){
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 删除hash表中的值
+     * @param key 键 不能为null
+     * @param item 项 可以使多个 不能为null
+     */
+    public void hdel(String key, Object... item){
+        redisTemplate.opsForHash().delete(key,item);
+    }
+
+    /**
+     * 判断hash表中是否有该项的值
+     * @param key 键 不能为null
+     * @param item 项 不能为null
+     * @return true 存在 false不存在
+     */
+    public boolean hHasKey(String key, String item){
+        return redisTemplate.opsForHash().hasKey(key, item);
+    }
+
+    /**
+     * hash递增 如果不存在,就会创建一个 并把新增后的值返回
+     * @param key 键
+     * @param item 项
+     * @param by 要增加几(大于0)
+     * @return
+     */
+    public double hincr(String key, String item,double by){
+        return redisTemplate.opsForHash().increment(key, item, by);
+    }
+
+    /**
+     * hash递减
+     * @param key 键
+     * @param item 项
+     * @param by 要减少记(小于0)
+     * @return
+     */
+    public double hdecr(String key, String item,double by){
+        return redisTemplate.opsForHash().increment(key, item,-by);
+    }
+
+    //============================set=============================
+    /**
+     * 根据key获取Set中的所有值
+     * @param key 键
+     * @return
+     */
+    public Set<Object> sGet(String key){
+        try {
+            return redisTemplate.opsForSet().members(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 根据value从一个set中查询,是否存在
+     * @param key 键
+     * @param value 值
+     * @return true 存在 false不存在
+     */
+    public boolean sHasKey(String key,Object value){
+        try {
+            return redisTemplate.opsForSet().isMember(key, value);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将数据放入set缓存
+     * @param key 键
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    public long sSet(String key, Object...values) {
+        try {
+            return redisTemplate.opsForSet().add(key, values);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 将set数据放入缓存
+     * @param key 键
+     * @param time 时间(秒)
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    public long sSetAndTime(String key,long time,Object...values) {
+        try {
+            Long count = redisTemplate.opsForSet().add(key, values);
+            if(time>0) {
+                expire(key, time);
+            }
+            return count;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 获取set缓存的长度
+     * @param key 键
+     * @return
+     */
+    public long sGetSetSize(String key){
+        try {
+            return redisTemplate.opsForSet().size(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 移除值为value的
+     * @param key 键
+     * @param values 值 可以是多个
+     * @return 移除的个数
+     */
+    public long setRemove(String key, Object ...values) {
+        try {
+            Long count = redisTemplate.opsForSet().remove(key, values);
+            return count;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+    //===============================list=================================
+
+    /**
+     * 获取list缓存的内容
+     * @param key 键
+     * @param start 开始
+     * @param end 结束  0 到 -1代表所有值
+     * @return
+     */
+    public List<Object> lGet(String key, long start, long end){
+        try {
+            return redisTemplate.opsForList().range(key, start, end);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 获取list缓存的长度
+     * @param key 键
+     * @return
+     */
+    public long lGetListSize(String key){
+        try {
+            return redisTemplate.opsForList().size(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 通过索引 获取list中的值
+     * @param key 键
+     * @param index 索引  index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
+     * @return
+     */
+    public Object lGetIndex(String key,long index){
+        try {
+            return redisTemplate.opsForList().index(key, index);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     * @param key 键
+     * @param value 值
+     * @return
+     */
+    public boolean lSet(String key, Object value) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     * @param key 键
+     * @param value 值
+     * @param time 时间(秒)
+     * @return
+     */
+    public boolean lSet(String key, Object value, long time) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     * @param key 键
+     * @param value 值
+     * @return
+     */
+    public boolean lSet(String key, List<Object> value) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     * @param key 键
+     * @param value 值
+     * @param time 时间(秒)
+     * @return
+     */
+    public boolean lSet(String key, List<Object> value, long time) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 根据索引修改list中的某条数据
+     * @param key 键
+     * @param index 索引
+     * @param value 值
+     * @return
+     */
+    public boolean lUpdateIndex(String key, long index,Object value) {
+        try {
+            redisTemplate.opsForList().set(key, index, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 移除N个值为value
+     * @param key 键
+     * @param count 移除多少个
+     * @param value 值
+     * @return 移除的个数
+     */
+    public long lRemove(String key,long count,Object value) {
+        try {
+            Long remove = redisTemplate.opsForList().remove(key, count, value);
+            return remove;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 198
suishenbang-common/src/main/java/com/dgtly/common/utils/TranslateUtil.java


+ 13 - 7
suishenbang-common/src/main/java/com/dgtly/common/utils/http/HttpUtils.java

@@ -36,12 +36,18 @@ public class HttpUtils
      * @return 所代表远程资源的响应结果
      */
     public static String sendGet(String url, String param)
+    {
+        url = url+"?"+param;
+        return sendGet(url);
+    }
+
+    public static String sendGet(String url)
     {
         StringBuilder result = new StringBuilder();
         BufferedReader in = null;
         try
         {
-            String urlNameString = url + "?" + param;
+            String urlNameString = url;
             log.info("sendGet - {}", urlNameString);
             URL realUrl = new URL(urlNameString);
             URLConnection connection = realUrl.openConnection();
@@ -57,21 +63,21 @@ public class HttpUtils
             }
             log.info("recv - {}", result);
         }
-        catch (ConnectException e)
+        catch(ConnectException e)
         {
-            log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
+            log.error("调用HttpUtils.sendGet ConnectException, url=" + url , e);
         }
         catch (SocketTimeoutException e)
         {
-            log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e);
+            log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url , e);
         }
         catch (IOException e)
         {
-            log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e);
+            log.error("调用HttpUtils.sendGet IOException, url=" + url, e);
         }
         catch (Exception e)
         {
-            log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e);
+            log.error("调用HttpsUtil.sendGet Exception, url=" + url , e);
         }
         finally
         {
@@ -84,7 +90,7 @@ public class HttpUtils
             }
             catch (Exception ex)
             {
-                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
+                log.error("调用in.close Exception, url=" + url , ex);
             }
         }
         return result.toString();

+ 0 - 1
suishenbang-framework/src/main/java/com/dgtly/framework/config/ShiroConfig.java

@@ -257,7 +257,6 @@ public class ShiroConfig
         // 不需要拦截的访问
         filterChainDefinitionMap.put("/login", "anon,captchaValidate");
         filterChainDefinitionMap.put("/interface/**", "anon,captchaValidate");
-        filterChainDefinitionMap.put("/**/**.if", "anon,captchaValidate");
 
         // 系统权限列表
         // filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());

+ 0 - 32
suishenbang-system/src/main/java/com/dgtly/system/domain/SysNotice.java

@@ -27,11 +27,6 @@ public class SysNotice extends BaseEntity
     /** 公告概要 */
     private String noticeOutline;
 
-    /** 公告标题英文字段 */
-    private String noticeTitleEn;
-
-    /** 公告概要英文字段 */
-    private String noticeOutlineEn;
 
     /** 公告类型(1通知 2公告) */
     private String noticeType;
@@ -39,9 +34,6 @@ public class SysNotice extends BaseEntity
     /** 公告内容 */
     private String noticeContent;
 
-    /** 公告内容 */
-    private String noticeContentEn;
-
     private String fmzFile;
 
     private String fmzFileUrl;
@@ -145,30 +137,6 @@ public class SysNotice extends BaseEntity
         this.limitFlag = limitFlag;
     }
 
-    public String getNoticeTitleEn() {
-        return noticeTitleEn;
-    }
-
-    public void setNoticeTitleEn(String noticeTitleEn) {
-        this.noticeTitleEn = noticeTitleEn;
-    }
-
-    public String getNoticeOutlineEn() {
-        return noticeOutlineEn;
-    }
-
-    public void setNoticeOutlineEn(String noticeOutlineEn) {
-        this.noticeOutlineEn = noticeOutlineEn;
-    }
-
-    public String getNoticeContentEn() {
-        return noticeContentEn;
-    }
-
-    public void setNoticeContentEn(String noticeContentEn) {
-        this.noticeContentEn = noticeContentEn;
-    }
-
 
     @Override
     public String toString() {

+ 328 - 0
suishenbang-system/src/main/java/com/dgtly/system/domain/WxQyUser.java

@@ -0,0 +1,328 @@
+package com.dgtly.system.domain;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.dgtly.common.annotation.Excel;
+import com.dgtly.common.core.domain.BaseEntity;
+
+import java.util.List;
+
+/**
+ * 企业微信用户信息对象 wx_qy_user
+ * 
+ * @author dgtly
+ * @date 2020-06-29
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class WxQyUser extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 企业微信用户id */
+    private String userid;
+
+    /** 企业微信用户姓名 */
+    @Excel(name = "企业微信用户姓名")
+    private String name;
+
+    /** 企业微信用户手机号 */
+    @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表示女性")
+    private String gender;
+
+    /** 邮箱,第三方仅通讯录应用可获取 */
+    @Excel(name = "邮箱,第三方仅通讯录应用可获取")
+    private String email;
+
+    /** 表示在所在的部门内是否为上级。;第三方仅通讯录应用可获取 */
+    //private List<String> isLeaderInDept;
+
+    /** 头像url。 第三方仅通讯录应用可获取 */
+    @Excel(name = "头像url。 第三方仅通讯录应用可获取")
+    private String avatar;
+
+    /** 头像缩略图url。第三方仅通讯录应用可获取 */
+    @Excel(name = "头像缩略图url。第三方仅通讯录应用可获取")
+    private String thumbAvatar;
+
+    /** 座机。第三方仅通讯录应用可获取 */
+    @Excel(name = "座机。第三方仅通讯录应用可获取")
+    private String telephone;
+
+    /** 别名;第三方仅通讯录应用可获取 */
+    @Excel(name = "别名;第三方仅通讯录应用可获取")
+    private String alias;
+
+    /** 扩展属性,第三方仅通讯录应用可获取 */
+    //private Object extattr;
+
+    /** 激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业。
+已激活代表已激活企业微信或已关注微工作台(原企业号)。未激活代表既未激活企业微信又未关注微工作台(原企业号)。 */
+    @Excel(name = "激活状态: 1=已激活,2=已禁用,4=未激活,5=退出企业。已激活代表已激活企业微信或已关注微工作台", readConverterExp = "原=企业号")
+    private String status;
+
+    /** 员工个人二维码,扫描可添加为外部联系人(注意返回的是一个url,可在浏览器上打开该url以展示二维码);第三方仅通讯录应用可获取 */
+    @Excel(name = "员工个人二维码,扫描可添加为外部联系人(注意返回的是一个url,可在浏览器上打开该url以展示二维码);第三方仅通讯录应用可获取")
+    private String qrCode;
+
+    /** 成员对外属性,字段详情见对外属性;第三方仅通讯录应用可获取 */
+    @Excel(name = "成员对外属性,字段详情见对外属性;第三方仅通讯录应用可获取")
+    private String externalProfile;
+
+    /** 地址。第三方仅通讯录应用可获取 */
+    @Excel(name = "地址。第三方仅通讯录应用可获取")
+    private String address;
+
+    /** 全局唯一。对于同一个服务商,不同应用获取到企业内同一个成员的open_userid是相同的,最多64个字节。仅第三方应用可获取 */
+    @Excel(name = "全局唯一。对于同一个服务商,不同应用获取到企业内同一个成员的open_userid是相同的,最多64个字节。仅第三方应用可获取")
+    private String openUserid;
+
+    /** 主部门 */
+    @Excel(name = "主部门")
+    private String mainDepartment;
+
+    /** 用户关联的系统用户id */
+    @Excel(name = "用户关联的系统用户id")
+    private Long sysUserId;
+    /** 微信传回的用户信息json */
+    private String json;
+
+    public void setUserid(String userid)
+    {
+        this.userid = userid;
+    }
+
+    public String getUserid() 
+    {
+        return userid;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setMobile(String mobile) 
+    {
+        this.mobile = mobile;
+    }
+
+    public String getMobile() 
+    {
+        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;
+    }
+
+    public String getGender() 
+    {
+        return gender;
+    }
+    public void setEmail(String email) 
+    {
+        this.email = email;
+    }
+
+    public String getEmail() 
+    {
+        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;
+    }
+
+    public String getAvatar() 
+    {
+        return avatar;
+    }
+    public void setThumbAvatar(String thumbAvatar) 
+    {
+        this.thumbAvatar = thumbAvatar;
+    }
+
+    public String getThumbAvatar() 
+    {
+        return thumbAvatar;
+    }
+    public void setTelephone(String telephone) 
+    {
+        this.telephone = telephone;
+    }
+
+    public String getTelephone() 
+    {
+        return telephone;
+    }
+    public void setAlias(String alias) 
+    {
+        this.alias = alias;
+    }
+
+    public String getAlias() 
+    {
+        return alias;
+    }
+//    public void setExtattr(String extattr)
+//    {
+//        this.extattr = extattr;
+//    }
+//
+//    public String getExtattr()
+//    {
+//        return extattr;
+//    }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+    public void setQrCode(String qrCode) 
+    {
+        this.qrCode = qrCode;
+    }
+
+    public String getQrCode() 
+    {
+        return qrCode;
+    }
+    public void setExternalProfile(String externalProfile) 
+    {
+        this.externalProfile = externalProfile;
+    }
+
+    public String getExternalProfile() 
+    {
+        return externalProfile;
+    }
+    public void setAddress(String address) 
+    {
+        this.address = address;
+    }
+
+    public String getAddress() 
+    {
+        return address;
+    }
+    public void setOpenUserid(String openUserid) 
+    {
+        this.openUserid = openUserid;
+    }
+
+    public String getOpenUserid() 
+    {
+        return openUserid;
+    }
+    public void setMainDepartment(String mainDepartment) 
+    {
+        this.mainDepartment = mainDepartment;
+    }
+
+    public String getMainDepartment() 
+    {
+        return mainDepartment;
+    }
+    public void setSysUserId(Long sysUserId) 
+    {
+        this.sysUserId = sysUserId;
+    }
+
+    public Long getSysUserId() 
+    {
+        return sysUserId;
+    }
+
+    public String getJson() {
+        return json;
+    }
+
+    public void setJson(String json) {
+        this.json = json;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .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();
+    }
+}

+ 0 - 7
suishenbang-system/src/main/java/com/dgtly/system/mapper/SysCompanyMapper.java

@@ -1,6 +1,5 @@
 package com.dgtly.system.mapper;
 
-import com.dgtly.common.annotation.SwitchEn;
 import com.dgtly.system.domain.SysCompany;
 import java.util.List;
 
@@ -18,8 +17,6 @@ public interface SysCompanyMapper
      * @param id 公司表ID
      * @return 公司表
      */
-    @SwitchEn(oldfiles = {"sc.company_name","sc.legal_person","sc.company_introduce","sc.primary_business","sc.detail_address"},
-            newfiles = {"sc.company_name_en company_name","sc.legal_person_en legal_person","sc.company_introduce_en company_introduce","sc.primary_business_en primary_business","sc.detail_address_en detail_address"})
     public SysCompany selectSysCompanyById(Long id);
 
     /**
@@ -66,8 +63,6 @@ public interface SysCompanyMapper
      * @param
      * @return
      */
-    @SwitchEn(oldfiles = {"sc.company_name","sc.primary_business"},
-            newfiles = {"sc.company_name_en company_name","sc.primary_business_en primary_business"})
     public List<SysCompany> selectCompanyHotList();
 
     /**
@@ -77,8 +72,6 @@ public interface SysCompanyMapper
      * @auther: qxp
      * @date: 2020-2-25
      */
-    @SwitchEn(oldfiles = {"sc.company_name","sc.legal_person","sc.company_introduce","sc.primary_business","sc.detail_address"},
-            newfiles = {"sc.company_name_en company_name","sc.legal_person_en legal_person","sc.company_introduce_en company_introduce","sc.primary_business_en primary_business","sc.detail_address_en detail_address"})
     List<SysCompany> selectSysCompanyListExRoot(SysCompany sysCompany);
 
 

+ 1 - 2
suishenbang-system/src/main/java/com/dgtly/system/mapper/SysDictDataMapper.java

@@ -2,7 +2,6 @@ package com.dgtly.system.mapper;
 
 import java.util.List;
 
-import com.dgtly.common.annotation.SwitchEn;
 import org.apache.ibatis.annotations.Param;
 import com.dgtly.system.domain.SysDictData;
 
@@ -102,6 +101,6 @@ public interface SysDictDataMapper
      * @auther: qxp
      * @date: 2020-2-25
      */
-    @SwitchEn(oldfiles = {"dict_label"},newfiles = {"dict_label_en dict_label"})
+
     public List<SysDictData> selectSimpleDictDataByType(String dictType);
 }

+ 3 - 37
suishenbang-system/src/main/java/com/dgtly/system/mapper/SysNoticeMapper.java

@@ -2,7 +2,6 @@ package com.dgtly.system.mapper;
 
 import java.util.List;
 
-import com.dgtly.common.annotation.SwitchEn;
 import com.dgtly.system.domain.SysNotice;
 
 /**
@@ -18,15 +17,7 @@ public interface SysNoticeMapper
      * @param noticeId 公告ID
      * @return 公告信息
      */
-    @SwitchEn(oldfiles = {
-            "notice_title",
-            "notice_outline",
-            "notice_content"
-    },newfiles = {
-            "notice_title_en notice_title",
-            "notice_outline_en notice_outline",
-            "notice_content_en notice_content"
-    })
+
     public SysNotice selectNoticeById(Long noticeId);
 
     /**
@@ -35,15 +26,6 @@ public interface SysNoticeMapper
      * @param notice 公告信息
      * @return 公告集合
      */
-    @SwitchEn(oldfiles = {
-            "notice_title",
-            "notice_outline",
-            "notice_content"
-    },newfiles = {
-            "notice_title_en notice_title",
-            "notice_outline_en notice_outline",
-            "notice_content_en notice_content"
-    })
     public List<SysNotice> selectNoticeList(SysNotice notice);
 
     /**
@@ -52,15 +34,7 @@ public interface SysNoticeMapper
      * @param notice 公告信息
      * @return 公告集合
      */
-    @SwitchEn(oldfiles = {
-            "sn.notice_title",
-            "sn.notice_outline",
-            "sn.notice_content"
-    },newfiles = {
-            "sn.notice_title_en notice_title",
-            "sn.notice_outline_en notice_outline",
-            "sn.notice_content_en notice_content"
-    })
+
     public List<SysNotice> selectNoticeListByRole(SysNotice notice);
 
 
@@ -72,15 +46,7 @@ public interface SysNoticeMapper
      * @auther: LiuLingChao
      * @date: 2019-11-04 11:36
      */
-    @SwitchEn(oldfiles = {
-            "notice_title",
-            "notice_outline",
-            "notice_content"
-    },newfiles = {
-            "notice_title_en notice_title",
-            "notice_outline_en notice_outline",
-            "notice_content_en notice_content"
-    })
+
     public List<SysNotice> selectNoticeTop3ByRole(SysNotice notice);
 
     /**

+ 68 - 0
suishenbang-system/src/main/java/com/dgtly/system/mapper/WxQyUserMapper.java

@@ -0,0 +1,68 @@
+package com.dgtly.system.mapper;
+
+import com.dgtly.system.domain.WxQyUser;
+import java.util.List;
+
+/**
+ * 企业微信用户信息Mapper接口
+ * 
+ * @author dgtly
+ * @date 2020-06-29
+ */
+public interface WxQyUserMapper 
+{
+    /**
+     *
+     * @param sysUserId
+     * @return
+     */
+    int bondedSysUserBySysUserId(Long sysUserId);
+
+    /**
+     * 查询企业微信用户信息
+     * 
+     * @param userid 企业微信用户信息ID
+     * @return 企业微信用户信息
+     */
+    public WxQyUser selectWxQyUserById(String userid);
+
+    /**
+     * 查询企业微信用户信息列表
+     * 
+     * @param wxQyUser 企业微信用户信息
+     * @return 企业微信用户信息集合
+     */
+    public List<WxQyUser> selectWxQyUserList(WxQyUser wxQyUser);
+
+    /**
+     * 新增企业微信用户信息
+     * 
+     * @param wxQyUser 企业微信用户信息
+     * @return 结果
+     */
+    public int insertWxQyUser(WxQyUser wxQyUser);
+
+    /**
+     * 修改企业微信用户信息
+     * 
+     * @param wxQyUser 企业微信用户信息
+     * @return 结果
+     */
+    public int updateWxQyUser(WxQyUser wxQyUser);
+
+    /**
+     * 删除企业微信用户信息
+     * 
+     * @param userid 企业微信用户信息ID
+     * @return 结果
+     */
+    public int deleteWxQyUserById(String userid);
+
+    /**
+     * 批量删除企业微信用户信息
+     * 
+     * @param userids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteWxQyUserByIds(String[] userids);
+}

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

@@ -0,0 +1,68 @@
+package com.dgtly.system.service;
+
+import com.dgtly.system.domain.WxQyUser;
+import java.util.List;
+
+/**
+ * 企业微信用户信息Service接口
+ * 
+ * @author dgtly
+ * @date 2020-06-29
+ */
+public interface IWxQyUserService 
+{
+    /**
+     * 根据系统用户id解除微信绑定
+     * @param userId
+     * @return
+     */
+    int bondedSysUserBySysUserId(Long userId);
+
+    /**
+     * 查询企业微信用户信息
+     * 
+     * @param userid 企业微信用户信息ID
+     * @return 企业微信用户信息
+     */
+    public WxQyUser selectWxQyUserById(String userid);
+
+    /**
+     * 查询企业微信用户信息列表
+     * 
+     * @param wxQyUser 企业微信用户信息
+     * @return 企业微信用户信息集合
+     */
+    public List<WxQyUser> selectWxQyUserList(WxQyUser wxQyUser);
+
+    /**
+     * 新增企业微信用户信息
+     * 
+     * @param wxQyUser 企业微信用户信息
+     * @return 结果
+     */
+    public int insertWxQyUser(WxQyUser wxQyUser);
+
+    /**
+     * 修改企业微信用户信息
+     * 
+     * @param wxQyUser 企业微信用户信息
+     * @return 结果
+     */
+    public int updateWxQyUser(WxQyUser wxQyUser);
+
+    /**
+     * 批量删除企业微信用户信息
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteWxQyUserByIds(String ids);
+
+    /**
+     * 删除企业微信用户信息信息
+     * 
+     * @param userid 企业微信用户信息ID
+     * @return 结果
+     */
+    public int deleteWxQyUserById(String userid);
+}

+ 0 - 8
suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysCompanyServiceImpl.java

@@ -1,18 +1,11 @@
 package com.dgtly.system.service.impl;
 
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 
 import com.dgtly.common.constant.UserConstants;
 import com.dgtly.common.core.domain.Ztree;
-import com.dgtly.common.exception.BusinessException;
 import com.dgtly.common.utils.DateUtils;
-import com.dgtly.common.utils.ShiroSaltUtil;
-import com.dgtly.common.utils.TranslateUtil;
-import com.dgtly.common.utils.security.EncryptPassWordClass;
-import com.dgtly.system.domain.SysDept;
-import com.dgtly.system.domain.SysUser;
 import com.dgtly.system.service.ISysConfigService;
 import com.dgtly.system.service.ISysDeptService;
 import com.dgtly.system.service.ISysUserService;
@@ -22,7 +15,6 @@ import com.dgtly.system.mapper.SysCompanyMapper;
 import com.dgtly.system.domain.SysCompany;
 import com.dgtly.system.service.ISysCompanyService;
 import com.dgtly.common.core.text.Convert;
-import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 公司表Service业务层处理

+ 12 - 13
suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysDictDataServiceImpl.java

@@ -2,7 +2,6 @@ package com.dgtly.system.service.impl;
 
 import java.util.List;
 
-import com.dgtly.common.utils.TranslateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.dgtly.common.core.text.Convert;
@@ -19,7 +18,7 @@ import com.dgtly.system.service.ISysDictDataService;
 public class SysDictDataServiceImpl implements ISysDictDataService
 {
     @Autowired
-    private SysDictDataMapper dictDataMapper;
+    private SysDictDataMapper sysDictDataMapper;
 
     /**
      * 根据条件分页查询字典数据
@@ -30,7 +29,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
     @Override
     public List<SysDictData> selectDictDataList(SysDictData dictData)
     {
-        return dictDataMapper.selectDictDataList(dictData);
+        return sysDictDataMapper.selectDictDataList(dictData);
     }
 
     /**
@@ -42,7 +41,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
     @Override
     public List<SysDictData> selectDictDataByType(String dictType)
     {
-        return dictDataMapper.selectDictDataByType(dictType);
+        return sysDictDataMapper.selectDictDataByType(dictType);
     }
 
     /**
@@ -55,7 +54,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
     @Override
     public String selectDictLabel(String dictType, String dictValue)
     {
-        return dictDataMapper.selectDictLabel(dictType, dictValue);
+        return sysDictDataMapper.selectDictLabel(dictType, dictValue);
     }
 
     /**
@@ -67,7 +66,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
     @Override
     public SysDictData selectDictDataById(Long dictCode)
     {
-        return dictDataMapper.selectDictDataById(dictCode);
+        return sysDictDataMapper.selectDictDataById(dictCode);
     }
 
     /**
@@ -79,7 +78,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
     @Override
     public int deleteDictDataById(Long dictCode)
     {
-        return dictDataMapper.deleteDictDataById(dictCode);
+        return sysDictDataMapper.deleteDictDataById(dictCode);
     }
 
     /**
@@ -91,7 +90,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
     @Override
     public int deleteDictDataByIds(String ids)
     {
-        return dictDataMapper.deleteDictDataByIds(Convert.toStrArray(ids));
+        return sysDictDataMapper.deleteDictDataByIds(Convert.toStrArray(ids));
     }
 
     /**
@@ -103,8 +102,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService
     @Override
     public int insertDictData(SysDictData dictData)
     {
-        dictData.setDictLabelEn(TranslateUtil.getEnTranslateInfo(dictData.getDictLabel()));
-        return dictDataMapper.insertDictData(dictData);
+
+        return sysDictDataMapper.insertDictData(dictData);
     }
 
     /**
@@ -116,8 +115,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService
     @Override
     public int updateDictData(SysDictData dictData)
     {
-        dictData.setDictLabelEn(TranslateUtil.getEnTranslateInfo(dictData.getDictLabel()));
-        return dictDataMapper.updateDictData(dictData);
+
+        return sysDictDataMapper.updateDictData(dictData);
     }
 
     /**
@@ -129,6 +128,6 @@ public class SysDictDataServiceImpl implements ISysDictDataService
      */
     @Override
     public List<SysDictData> selectSimpleDictDataByType(String dictType) {
-        return dictDataMapper.selectSimpleDictDataByType(dictType);
+        return sysDictDataMapper.selectSimpleDictDataByType(dictType);
     }
 }

+ 0 - 3
suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysDictTypeServiceImpl.java

@@ -3,7 +3,6 @@ package com.dgtly.system.service.impl;
 import java.util.ArrayList;
 import java.util.List;
 
-import com.dgtly.common.utils.TranslateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -120,7 +119,6 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
     @Override
     public int insertDictType(SysDictType dictType)
     {
-        dictType.setDictNameEn(TranslateUtil.getEnTranslateInfo(dictType.getDictName()));
         return dictTypeMapper.insertDictType(dictType);
     }
 
@@ -135,7 +133,6 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
     public int updateDictType(SysDictType dictType)
     {
         SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId());
-        dictType.setDictNameEn(TranslateUtil.getEnTranslateInfo(dictType.getDictName()));
         dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType());
         return dictTypeMapper.updateDictType(dictType);
     }

+ 2 - 30
suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysNoticeServiceImpl.java

@@ -3,8 +3,6 @@ package com.dgtly.system.service.impl;
 import java.util.List;
 
 import com.dgtly.common.annotation.DataScope;
-import com.dgtly.common.utils.StringUtils;
-import com.dgtly.common.utils.TranslateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.dgtly.common.core.text.Convert;
@@ -59,19 +57,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
     {
         //公告标题
         String noticeTitle = notice.getNoticeTitle();
-        if(StringUtils.isNotEmpty(noticeTitle)) {
-            notice.setNoticeTitleEn(TranslateUtil.getEnTranslateInfo(noticeTitle));
-        }
-        //公告概要
-        String noticeOutline = notice.getNoticeOutline();
-        if (StringUtils.isNotEmpty(noticeOutline)){
-            notice.setNoticeOutlineEn(TranslateUtil.getEnTranslateInfo(noticeOutline));
-        }
-        //公告内容
-        String noticeContent = notice.getNoticeContent();
-        if (StringUtils.isNotEmpty(noticeContent)){
-            notice.setNoticeContentEn(TranslateUtil.getDesEnTranslateInfo(noticeContent));
-        }
+
 
         return noticeMapper.insertNotice(notice);
     }
@@ -85,21 +71,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
     @Override
     public int updateNotice(SysNotice notice)
     {
-        //公告标题
-        String noticeTitle = notice.getNoticeTitle();
-        if(StringUtils.isNotEmpty(noticeTitle)) {
-            notice.setNoticeTitleEn(TranslateUtil.getEnTranslateInfo(noticeTitle));
-        }
-        //公告概要
-        String noticeOutline = notice.getNoticeOutline();
-        if (StringUtils.isNotEmpty(noticeOutline)){
-            notice.setNoticeOutlineEn(TranslateUtil.getEnTranslateInfo(noticeOutline));
-        }
-        //公告内容
-        String noticeContent = notice.getNoticeContent();
-        if (StringUtils.isNotEmpty(noticeContent)){
-            notice.setNoticeContentEn(TranslateUtil.getDesEnTranslateInfo(noticeContent));
-        }
+
 
         return noticeMapper.updateNotice(notice);
     }

+ 104 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/impl/WxQyUserServiceImpl.java

@@ -0,0 +1,104 @@
+package com.dgtly.system.service.impl;
+
+import java.util.List;
+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.common.core.text.Convert;
+
+/**
+ * 企业微信用户信息Service业务层处理
+ * 
+ * @author dgtly
+ * @date 2020-06-29
+ */
+@Service
+public class WxQyUserServiceImpl implements IWxQyUserService 
+{
+    @Autowired
+    private WxQyUserMapper wxQyUserMapper;
+
+    /**
+     * 根据系统用户Id解除微信绑定
+     * @param userId
+     * @return
+     */
+    @Override
+    public int bondedSysUserBySysUserId(Long userId) {
+        return wxQyUserMapper.bondedSysUserBySysUserId(userId);
+    }
+
+    /**
+     * 查询企业微信用户信息
+     * 
+     * @param userid 企业微信用户信息ID
+     * @return 企业微信用户信息
+     */
+    @Override
+    public WxQyUser selectWxQyUserById(String userid)
+    {
+        return wxQyUserMapper.selectWxQyUserById(userid);
+    }
+
+    /**
+     * 查询企业微信用户信息列表
+     * 
+     * @param wxQyUser 企业微信用户信息
+     * @return 企业微信用户信息
+     */
+    @Override
+    public List<WxQyUser> selectWxQyUserList(WxQyUser wxQyUser)
+    {
+        return wxQyUserMapper.selectWxQyUserList(wxQyUser);
+    }
+
+    /**
+     * 新增企业微信用户信息
+     * 
+     * @param wxQyUser 企业微信用户信息
+     * @return 结果
+     */
+    @Override
+    public int insertWxQyUser(WxQyUser wxQyUser)
+    {
+        return wxQyUserMapper.insertWxQyUser(wxQyUser);
+    }
+
+    /**
+     * 修改企业微信用户信息
+     * 
+     * @param wxQyUser 企业微信用户信息
+     * @return 结果
+     */
+    @Override
+    public int updateWxQyUser(WxQyUser wxQyUser)
+    {
+        return wxQyUserMapper.updateWxQyUser(wxQyUser);
+    }
+
+    /**
+     * 删除企业微信用户信息对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteWxQyUserByIds(String ids)
+    {
+        return wxQyUserMapper.deleteWxQyUserByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除企业微信用户信息信息
+     * 
+     * @param userid 企业微信用户信息ID
+     * @return 结果
+     */
+    @Override
+    public int deleteWxQyUserById(String userid)
+    {
+        return wxQyUserMapper.deleteWxQyUserById(userid);
+    }
+}

+ 1 - 11
suishenbang-system/src/main/resources/mapper/system/SysCompanyMapper.xml

@@ -59,14 +59,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             create_time,
             <if test="status != null  and status != ''">status,</if>
             <if test="companyName != null  and companyName != ''">company_name,</if>
-            <if test="companyNameEn != null  and companyNameEn != ''">company_name_en,</if>
             <if test="companyType != null  and companyType != ''">company_type,</if>
             <if test="detailAddress != null  and detailAddress != ''">detail_address,</if>
-            <if test="detailAddressEn != null  and detailAddressEn != ''">detail_address_en,</if>
             <if test="longitude != null  and longitude != ''">longitude,</if>
             <if test="latitude != null  and latitude != ''">latitude,</if>
             <if test="legalPerson != null  and legalPerson != ''">legal_person,</if>
-            <if test="legalPersonEn != null  and legalPersonEn != ''">legal_person_en,</if>
             <if test="contactNumber != null  and contactNumber != ''">contact_number,</if>
             <if test="establishDate != null ">establish_date,</if>
             <if test="unifiedSocialCreditCode != null  and unifiedSocialCreditCode != ''">unified_social_credit_code,</if>
@@ -74,13 +71,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="defaultImgUrl != null  and defaultImgUrl != ''">default_img_url,</if>
             <if test="propagandaImgUrl != null  and propagandaImgUrl != ''">propaganda_img_url,</if>
             <if test="companyIntroduce != null  and companyIntroduce != ''">company_introduce,</if>
-            <if test="companyIntroduceEn != null  and companyIntroduceEn != ''">company_introduce_en,</if>
             <if test="versionNum != null  and versionNum != ''">version_num,</if>
             <if test="createBy != null  and createBy != ''">create_by,</if>
             <if test="updateBy != null  and updateBy != ''">update_by,</if>
             <if test="remark != null  and remark != ''">remark,</if>
             <if test="primaryBusiness != null  and primaryBusiness != ''">primary_business,</if>
-            <if test="primaryBusinessEn != null  and primaryBusinessEn != ''">primary_business_en,</if>
             <if test="sort != null  and sort != ''">sort,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -120,14 +115,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             version_num=version_num+1,
             <if test="status != null">status = #{status},</if>
             <if test="companyName != null  and companyName != ''">company_name= #{companyName},</if>
-            <if test="companyNameEn != null  and companyNameEn != ''">company_name_en = #{companyNameEn},</if>
             <if test="companyType != null  and companyType != ''">company_type= #{companyType},</if>
             <if test="detailAddress != null  and detailAddress != ''">detail_address= #{detailAddress},</if>
-            <if test="detailAddressEn != null  and detailAddressEn != ''">detail_address_en= #{detailAddressEn},</if>
             <if test="longitude != null  and longitude != ''">longitude= #{longitude},</if>
             <if test="latitude != null  and latitude != ''">latitude= #{latitude},</if>
             <if test="legalPerson != null  and legalPerson != ''">legal_person= #{legalPerson},</if>
-            <if test="legalPersonEn != null  and legalPersonEn != ''">legal_person_en = #{legalPersonEn},</if>
             <if test="contactNumber != null  and contactNumber != ''">contact_number= #{contactNumber},</if>
             <if test="establishDate != null ">establish_date= #{establishDate},</if>
             <if test="unifiedSocialCreditCode != null  and unifiedSocialCreditCode != ''">unified_social_credit_code= #{unifiedSocialCreditCode},</if>
@@ -135,12 +127,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="defaultImgUrl != null  and defaultImgUrl != ''">default_img_url= #{defaultImgUrl},</if>
             <if test="propagandaImgUrl != null  and propagandaImgUrl != ''">propaganda_img_url= #{propagandaImgUrl},</if>
             <if test="companyIntroduce != null  and companyIntroduce != ''">company_introduce= #{companyIntroduce},</if>
-            <if test="companyIntroduceEn != null  and companyIntroduceEn != ''">company_introduce_en = #{companyIntroduceEn},</if>
             <if test="createBy != null  and createBy != ''">create_by= #{createBy},</if>
             <if test="updateBy != null  and updateBy != ''">update_by= #{updateBy},</if>
             <if test="remark != null  and remark != ''">remark= #{remark},</if>
             <if test="primaryBusiness != null  and primaryBusiness != ''">primary_business=#{primaryBusiness},</if>
-            <if test="primaryBusinessEn != null  and primaryBusinessEn != ''">primary_business_en=#{primaryBusinessEn},</if>
             <if test="sort != null  and sort != ''">sort=#{sort},</if>
         </trim>
         where id = #{id}
@@ -169,7 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectSysCompanyVo"/>
         <where>
             sc.id !=1
-            <if test="companyName != null  and companyName != ''"> and (sc.company_name like concat('%',#{companyName},'%') or sc.company_name_en like concat('%',#{companyName},'%')) </if>
+            <if test="companyName != null  and companyName != ''"> and (sc.company_name like concat('%',#{companyName},'%') </if>
         </where>
         order by sc.sort desc
     </select>

+ 0 - 3
suishenbang-system/src/main/resources/mapper/system/SysDictDataMapper.xml

@@ -75,7 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		<set>
  			<if test="dictSort != null and dictSort != ''">dict_sort = #{dictSort},</if>
  			<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
- 			<if test="dictLabelEn != null and dictLabelEn != ''">dict_label_en = #{dictLabelEn},</if>
  			<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
  			<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
  			<if test="cssClass != null">css_class = #{cssClass},</if>
@@ -97,7 +96,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		insert into sys_dict_data(
  			<if test="dictSort != null and dictSort != ''">dict_sort,</if>
  			<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
- 			<if test="dictLabelEn != null and dictLabelEn != ''">dict_label_en,</if>
  			<if test="dictValue != null and dictValue != ''">dict_value,</if>
  			<if test="dictType != null and dictType != ''">dict_type,</if>
  			<if test="cssClass != null and cssClass != ''">css_class,</if>
@@ -110,7 +108,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		)values(
  		    <if test="dictSort != null and dictSort != ''">#{dictSort},</if>
  		    <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
- 		    <if test="dictLabelEn != null and dictLabelEn != ''">#{dictLabelEn},</if>
  			<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
  			<if test="dictType != null and dictType != ''">#{dictType},</if>
  			<if test="cssClass != null and cssClass != ''">#{cssClass},</if>

+ 0 - 3
suishenbang-system/src/main/resources/mapper/system/SysDictTypeMapper.xml

@@ -75,7 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		update sys_dict_type
  		<set>
  			<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
- 			<if test="dictNameEn != null and dictNameEn != ''">dict_name_en = #{dictNameEn},</if>
  			<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
  			<if test="status != null">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
@@ -88,7 +87,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  	<insert id="insertDictType" parameterType="SysDictType">
  		insert into sys_dict_type(
  			<if test="dictName != null and dictName != ''">dict_name,</if>
- 			<if test="dictNameEn != null and dictNameEn != ''">dict_name_en,</if>
  			<if test="dictType != null and dictType != ''">dict_type,</if>
  			<if test="status != null">status,</if>
  			<if test="remark != null and remark != ''">remark,</if>
@@ -96,7 +94,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			create_time
  		)values(
  			<if test="dictName != null and dictName != ''">#{dictName},</if>
- 			<if test="dictNameEn != null and dictNameEn != ''">#{dictNameEn},</if>
  			<if test="dictType != null and dictType != ''">#{dictType},</if>
  			<if test="status != null">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>

+ 4 - 16
suishenbang-system/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     
     <sql id="selectNoticeVo">
-        select notice_id,company_id,notice_title,notice_title_en,notice_outline,notice_outline_en, notice_type, notice_content,notice_content_en, status, create_by, fmz_file_url, create_time, update_by, update_time, remark
+        select notice_id,company_id,notice_title,notice_outline, notice_type, notice_content, status, create_by, fmz_file_url, create_time, update_by, update_time, remark
 		from sys_notice
     </sql>
 
@@ -29,12 +29,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select sn.notice_id,
         su.company_id,
         sn.notice_title,
-        sn.notice_title_en,
         sn.notice_outline,
-        sn.notice_outline_en,
         sn.notice_type,
         sn.notice_content,
-        sn.notice_content_en,
         sn.status,
         su.user_name create_by,
         sn.create_time,
@@ -57,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectNoticeVo"/>
         <where>
 			<if test="noticeTitle != null and noticeTitle != ''">
-				AND notice_title like concat('%', #{noticeTitle}, '%') or notice_title_en like concat('%', #{noticeTitle}, '%')
+				AND notice_title like concat('%', #{noticeTitle}, '%')
 			</if>
             <if test="companyId != null and companyId != 0">
                 AND company_id = #{companyId}
@@ -76,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectNotice"/>
         <where>
             <if test="noticeTitle != null and noticeTitle != ''">
-                AND sn.notice_title like concat('%', #{noticeTitle}, '%') or sn.notice_title_en like concat('%', #{noticeTitle}, '%')
+                AND sn.notice_title like concat('%', #{noticeTitle}, '%')
             </if>
             <if test="companyId != null and companyId != 0">
                 AND sn.company_id = #{companyId}
@@ -97,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectNoticeVo"/>
         <where>
             <if test="noticeTitle != null and noticeTitle != ''">
-                AND notice_title like concat('%', #{noticeTitle}, '%') or notice_title_en like concat('%', #{noticeTitle}, '%')
+                AND notice_title like concat('%', #{noticeTitle}, '%')
             </if>
             <if test="companyId != null and companyId != 0">
                 AND company_id = #{companyId}
@@ -121,12 +118,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into sys_notice (
             <if test="companyId != null and companyId != 0">company_id,</if>
 			<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
-			<if test="noticeTitleEn != null and noticeTitleEn != '' ">notice_title_en, </if>
 			<if test="noticeOutline != null and noticeOutline != '' ">notice_outline, </if>
-			<if test="noticeOutlineEn != null and noticeOutlineEn != '' ">notice_outline_en, </if>
 			<if test="noticeType != null and noticeType != '' ">notice_type, </if>
 			<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
-			<if test="noticeContentEn != null and noticeContentEn != '' ">notice_content_en, </if>
 			<if test="status != null and status != '' ">status, </if>
 			<if test="remark != null and remark != ''">remark,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
@@ -135,12 +129,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		)values(
             <if test="companyId != null and companyId != 0">#{companyId},</if>
 			<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
-			<if test="noticeTitleEn != null and noticeTitleEn != ''">#{noticeTitleEn}, </if>
 			<if test="noticeOutline != null and noticeOutline != ''">#{noticeOutline}, </if>
-			<if test="noticeOutlineEn != null and noticeOutlineEn != ''">#{noticeOutlineEn}, </if>
 			<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
 			<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
-			<if test="noticeContentEn != null and noticeContentEn != ''">#{noticeContentEn}, </if>
 			<if test="status != null and status != ''">#{status}, </if>
 			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
@@ -153,12 +144,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update sys_notice 
         <set>
             <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
-            <if test="noticeTitleEn != null and noticeTitleEn != ''">notice_title_en = #{noticeTitleEn}, </if>
             <if test="noticeOutline != null and noticeOutline != ''">notice_outline = #{noticeOutline}, </if>
-            <if test="noticeOutlineEn != null and noticeOutlineEn != ''">notice_outline_en = #{noticeOutlineEn}, </if>
             <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
             <if test="noticeContent != null">notice_content = #{noticeContent}, </if>
-            <if test="noticeContentEn != null">notice_content_en = #{noticeContentEn}, </if>
             <if test="status != null and status != ''">status = #{status}, </if>
             <if test="fmzFileUrl != null and fmzFileUrl != ''">fmz_file_url = #{fmzFileUrl}, </if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>

+ 165 - 0
suishenbang-system/src/main/resources/mapper/system/WxQyUserMapper.xml

@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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">
+    
+    <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
+    </sql>
+
+    <select id="selectWxQyUserList" parameterType="WxQyUser" resultMap="WxQyUserResult">
+        <include refid="selectWxQyUserVo"/>
+        <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="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="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="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>
+    </select>
+    
+    <select id="selectWxQyUserById" parameterType="String" resultMap="WxQyUserResult">
+        <include refid="selectWxQyUserVo"/>
+        where userid = #{userid}
+    </select>
+        
+    <insert id="insertWxQyUser" parameterType="WxQyUser">
+        insert into wx_qy_user
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <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>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <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>
+    </insert>
+
+    <update id="updateWxQyUser" parameterType="WxQyUser">
+        update wx_qy_user
+        <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>
+        where userid = #{userid}
+    </update>
+
+    <delete id="deleteWxQyUserById" parameterType="String">
+        delete from wx_qy_user where userid = #{userid}
+    </delete>
+
+    <delete id="deleteWxQyUserByIds" parameterType="String">
+        delete from wx_qy_user where userid in 
+        <foreach item="userid" collection="array" open="(" separator="," close=")">
+            #{userid}
+        </foreach>
+    </delete>
+
+    <update id="bondedSysUserBySysUserId" parameterType="Long">
+        update wx_qy_user
+        set sys_user_id = null
+        where sys_user_id = #{sysUserId}
+    </update>
+    
+</mapper>

+ 14 - 13
suishenbang-wxportal/suishenbang-wxportal-api/pom.xml

@@ -12,18 +12,19 @@
     <artifactId>suishenbang-wxportal-api</artifactId>
 
     <dependencies>
-        <!--<dependency>-->
-            <!--<groupId>com.dgtly</groupId>-->
-            <!--<artifactId>suishenbang-apiframework</artifactId>-->
-        <!--</dependency>-->
-        <!--&lt;!&ndash;常用公共类&ndash;&gt;-->
-        <!--<dependency>-->
-            <!--<groupId>com.dgtly</groupId>-->
-            <!--<artifactId>suishenbang-common</artifactId>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>com.dgtly</groupId>-->
-            <!--<artifactId>suishenbang-wxportal-common</artifactId>-->
-        <!--</dependency>-->
+        <dependency>
+            <groupId>com.dgtly</groupId>
+            <artifactId>suishenbang-apiframework</artifactId>
+        </dependency>
+        <!--常用公共类-->
+        <dependency>
+            <groupId>com.dgtly</groupId>
+            <artifactId>suishenbang-common</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.dgtly</groupId>
+            <artifactId>suishenbang-wxportal-common</artifactId>
+            <version>4.0.0</version>
+        </dependency>
     </dependencies>
 </project>

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

@@ -0,0 +1,102 @@
+package com.dgtly.wxportal.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.dgtly.common.annotation.ApiPassToken;
+import com.dgtly.common.core.controller.ApiBaseController;
+import com.dgtly.common.core.domain.AjaxResult;
+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.system.service.ISysUserService;
+import com.dgtly.system.service.IWxQyUserService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@Api(tags = "企业微信相关API", description = "提供企业微信相关的AP")
+@RequestMapping("wx")
+@RestController
+@ApiPassToken
+public class WxController extends ApiBaseController {
+
+
+    @Autowired
+    private RedisUtil redisUtil;
+
+    @Autowired
+    private QyWeixinUtil qyWeixinUtil;
+
+    @Autowired
+    private IWxQyUserService wxQyUserService;
+    @Autowired
+    private ISysUserService sysUserService;
+
+
+    @ApiOperation(value = "获取微信授权跳转url",notes = "参数:{url:www.baidu.com}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @PostMapping("getOauthUrl")
+    public Object getOauthUrl(){
+        ParameterObject obj =  getParameterObject();
+        obj.checkParameterNotNull("url");
+        String oauth2Url =  qyWeixinUtil.getOauth2Url(obj.getString("url"),null);
+        return AjaxResult.success().putKV("oauth2Url",oauth2Url);
+    }
+
+    @ApiOperation(value = "根据微信coed获取用户信息",
+            notes = "参数:{code:123} code微信跳转回来的携带的用户code" +
+                    "错误:301 当前用户不是当前企业用户成员" +
+                    "错误:302 当前用户没有绑定")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @PostMapping("getWxUserInfo")
+    public Object getWxUserInfo(){
+        ParameterObject obj =  getParameterObject();
+        obj.checkParameterNotNull("code");
+        String code = obj.getString("code");
+        JSONObject json =  qyWeixinUtil.getUserId(code);
+        String userId ="";
+        if(!json.containsKey("UserId")){
+            return AjaxResult.error(301,"当前用户不是企业成员");
+        }
+        userId = json.getString("UserId");
+        WxQyUser wxQyUser = qyWeixinUtil.gerUserDetail(userId);
+        WxQyUser resWxQyUser = wxQyUserService.selectWxQyUserById(wxQyUser.getUserid());
+        if(resWxQyUser==null){
+            int i = wxQyUserService.insertWxQyUser(wxQyUser);
+            if(i>0){
+                return AjaxResult.error(302,"当前用户没有绑定").putKV("wxUserInfo",wxQyUser);
+            }else{
+                return AjaxResult.error();
+            }
+        }
+
+        if(resWxQyUser.getSysUserId()==null){
+            return AjaxResult.error(302,"当前用户没有绑定").putKV("wxUserInfo",wxQyUser);
+        }
+        try{
+            wxQyUser.setSysUserId(resWxQyUser.getSysUserId());
+
+            wxQyUserService.updateWxQyUser(wxQyUser);
+        }catch(Exception e){
+            logger.error("更新微信用户信息时出错",e);
+            e.printStackTrace();
+        }
+        SysUser user=sysUserService.selectUserById(resWxQyUser.getSysUserId());
+        return AjaxResult.success().putKV("wxUser",resWxQyUser).putKV("sysUser",user);
+    }
+
+
+
+
+}

+ 50 - 0
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxPortalController.java

@@ -0,0 +1,50 @@
+package com.dgtly.wxportal.controller;
+
+
+import com.dgtly.common.annotation.ApiNoCheckSign;
+import com.dgtly.common.annotation.ApiPassToken;
+import com.dgtly.common.core.controller.ApiBaseController;
+import com.dgtly.common.core.domain.AjaxResult;
+import com.dgtly.common.core.domain.ParameterObject;
+import com.dgtly.wxportal.domain.WxBanner;
+import com.dgtly.wxportal.domain.WxMagnet;
+import com.dgtly.wxportal.service.IWxBannerService;
+import com.dgtly.wxportal.service.IWxMagnetService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Api(tags = "微信门户相关接口")
+@RestController
+@RequestMapping("/wxportal")
+@ApiPassToken
+public class WxPortalController extends ApiBaseController {
+
+    @Autowired
+    private IWxMagnetService wxMagnetService;
+
+    @Autowired
+    private IWxBannerService wxBannerService;
+
+    @ApiOperation(value = "微信门户首页",notes = "参数:{userId:1}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @PostMapping("/portalData")
+    public Object getMagent(){
+        ParameterObject obj =  getParameterObject();
+        obj.checkParameterNotNull("userId");
+        WxBanner wxBanner = new WxBanner();
+        List<WxMagnet> wxMagnetList =  wxMagnetService.selectMagnetByUserId(obj.getString("userId"));
+        List<WxBanner> wxBannerList = wxBannerService.selectWxBannerList(wxBanner);
+        return AjaxResult.success().putKV("magnets",wxMagnetList).putKV("banners",wxBannerList);
+    }
+
+}

+ 26 - 0
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/domain/RoleMagnet.java

@@ -0,0 +1,26 @@
+package com.dgtly.wxportal.domain;
+
+public class RoleMagnet {
+
+    /** 角色ID */
+    private Long roleId;
+
+    /** 磁贴ID */
+    private Long magnetId;
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
+    public Long getMagnetId() {
+        return magnetId;
+    }
+
+    public void setMagnetId(Long magnetId) {
+        this.magnetId = magnetId;
+    }
+}

+ 94 - 0
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/domain/WxBanner.java

@@ -0,0 +1,94 @@
+package com.dgtly.wxportal.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.dgtly.common.annotation.Excel;
+import com.dgtly.common.core.domain.BaseEntity;
+
+/**
+ * 企业微信门户首页banner图对象 wx_banner
+ * 
+ * @author qxp
+ * @date 2020-06-23
+ */
+public class WxBanner extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long bannerId;
+
+    /** banner图地址 */
+    private String imgUrl;
+
+    /** 标题 */
+    private String title;
+
+    /** 内容地址 */
+    private String contextUrl;
+
+    /** 内容摘要 */
+    private String des;
+
+    public void setBannerId(Long bannerId) 
+    {
+        this.bannerId = bannerId;
+    }
+
+    public Long getBannerId() 
+    {
+        return bannerId;
+    }
+    public void setImgUrl(String imgUrl) 
+    {
+        this.imgUrl = imgUrl;
+    }
+
+    public String getImgUrl() 
+    {
+        return imgUrl;
+    }
+    public void setTitle(String title) 
+    {
+        this.title = title;
+    }
+
+    public String getTitle() 
+    {
+        return title;
+    }
+    public void setContextUrl(String contextUrl) 
+    {
+        this.contextUrl = contextUrl;
+    }
+
+    public String getContextUrl() 
+    {
+        return contextUrl;
+    }
+    public void setDes(String des) 
+    {
+        this.des = des;
+    }
+
+    public String getDes() 
+    {
+        return des;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("bannerId", getBannerId())
+            .append("imgUrl", getImgUrl())
+            .append("title", getTitle())
+            .append("contextUrl", getContextUrl())
+            .append("des", getDes())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 0 - 10
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/domain/WxMagnet.java

@@ -42,8 +42,6 @@ public class WxMagnet extends BaseEntity
     /** 背景图片 */
     private String bgUrl;
 
-    /** 子菜单 */
-    private List<WxMagnet> children = new ArrayList<WxMagnet>();
 
     public Long getMagnetId()
     {
@@ -121,15 +119,7 @@ public class WxMagnet extends BaseEntity
         this.bgUrl = bgUrl;
     }
 
-    public List<WxMagnet> getChildren()
-    {
-        return children;
-    }
 
-    public void setChildren(List<WxMagnet> children)
-    {
-        this.children = children;
-    }
 
     @Override
     public String toString() {

+ 61 - 0
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/mapper/WxBannerMapper.java

@@ -0,0 +1,61 @@
+package com.dgtly.wxportal.mapper;
+
+import com.dgtly.wxportal.domain.WxBanner;
+import java.util.List;
+
+/**
+ * 企业微信门户首页banner图Mapper接口
+ * 
+ * @author qxp
+ * @date 2020-06-23
+ */
+public interface WxBannerMapper 
+{
+    /**
+     * 查询企业微信门户首页banner图
+     * 
+     * @param bannerId 企业微信门户首页banner图ID
+     * @return 企业微信门户首页banner图
+     */
+    public WxBanner selectWxBannerById(Long bannerId);
+
+    /**
+     * 查询企业微信门户首页banner图列表
+     * 
+     * @param wxBanner 企业微信门户首页banner图
+     * @return 企业微信门户首页banner图集合
+     */
+    public List<WxBanner> selectWxBannerList(WxBanner wxBanner);
+
+    /**
+     * 新增企业微信门户首页banner图
+     * 
+     * @param wxBanner 企业微信门户首页banner图
+     * @return 结果
+     */
+    public int insertWxBanner(WxBanner wxBanner);
+
+    /**
+     * 修改企业微信门户首页banner图
+     * 
+     * @param wxBanner 企业微信门户首页banner图
+     * @return 结果
+     */
+    public int updateWxBanner(WxBanner wxBanner);
+
+    /**
+     * 删除企业微信门户首页banner图
+     * 
+     * @param bannerId 企业微信门户首页banner图ID
+     * @return 结果
+     */
+    public int deleteWxBannerById(Long bannerId);
+
+    /**
+     * 批量删除企业微信门户首页banner图
+     * 
+     * @param bannerIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteWxBannerByIds(String[] bannerIds);
+}

+ 29 - 21
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/mapper/WxMagnetMapper.java

@@ -1,6 +1,7 @@
 package com.dgtly.wxportal.mapper;
 
 import com.dgtly.system.domain.SysMenu;
+import com.dgtly.wxportal.domain.RoleMagnet;
 import com.dgtly.wxportal.domain.WxMagnet;
 import org.apache.ibatis.annotations.Param;
 
@@ -23,15 +24,6 @@ public interface WxMagnetMapper
      */
     List<WxMagnet> selectMagnetList(WxMagnet wxMagnet);
 
-    /**
-     * 查询磁贴列表
-     *
-     * @param wxMagnet 菜单信息
-     * @return 菜单列表
-     */
-    List<WxMagnet> selectMagnetListByUserId(WxMagnet wxMagnet);
-
-
 
     /**
      * 查询磁贴使用数量
@@ -82,12 +74,7 @@ public interface WxMagnetMapper
      */
     int updateMagnet(WxMagnet wxMagnet);
 
-    /**
-     * 查询所有磁贴信息
-     *
-     * @return 结果
-     */
-    List<WxMagnet> selectMagnetAll();
+
 
     /**
      * 根据用户ID查询磁贴
@@ -95,13 +82,34 @@ public interface WxMagnetMapper
      * @param userId 用户ID
      * @return 磁贴列表
      */
-    List<WxMagnet> selectMagnetAllByUserId(Long userId);
+    List<WxMagnet> selectMagnetAllByUserId(@Param("wxMagnet")WxMagnet wxMagnet,@Param("userId")Long userId);
+
+
+    /**
+     * 根据角色id查询拥有的磁贴id列表
+     * @param roleId
+     * @return
+     */
+    List<String> selectMagnetIdByRoleId(Long roleId);
 
     /**
-     * 根据角色ID查询磁贴
-     *
-     * @param roleId 角色ID
-     * @return 磁贴列表
+     * 根据角色id删除所有RoleMagnet
+     * @param roleId
+     * @return
+     */
+    int deleteRoleMagnetByRoleId(String roleId);
+
+    /**
+     * 批量添加roleMagnet
+     * @param roleMagnetList
+     * @return
+     */
+    int batchRoleMagnet(List<RoleMagnet> roleMagnetList);
+
+    /**
+     * 根据用户id查询所拥有的的磁贴
+     * @param userId
+     * @return
      */
-    List<String> selectMagnetTree(Long roleId);
+    List<WxMagnet> selectMagnetByUserId(String userId);
 }

+ 61 - 0
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/IWxBannerService.java

@@ -0,0 +1,61 @@
+package com.dgtly.wxportal.service;
+
+import com.dgtly.wxportal.domain.WxBanner;
+import java.util.List;
+
+/**
+ * 企业微信门户首页banner图Service接口
+ * 
+ * @author qxp
+ * @date 2020-06-23
+ */
+public interface IWxBannerService 
+{
+    /**
+     * 查询企业微信门户首页banner图
+     * 
+     * @param bannerId 企业微信门户首页banner图ID
+     * @return 企业微信门户首页banner图
+     */
+    public WxBanner selectWxBannerById(Long bannerId);
+
+    /**
+     * 查询企业微信门户首页banner图列表
+     * 
+     * @param wxBanner 企业微信门户首页banner图
+     * @return 企业微信门户首页banner图集合
+     */
+    public List<WxBanner> selectWxBannerList(WxBanner wxBanner);
+
+    /**
+     * 新增企业微信门户首页banner图
+     * 
+     * @param wxBanner 企业微信门户首页banner图
+     * @return 结果
+     */
+    public int insertWxBanner(WxBanner wxBanner);
+
+    /**
+     * 修改企业微信门户首页banner图
+     * 
+     * @param wxBanner 企业微信门户首页banner图
+     * @return 结果
+     */
+    public int updateWxBanner(WxBanner wxBanner);
+
+    /**
+     * 批量删除企业微信门户首页banner图
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteWxBannerByIds(String ids);
+
+    /**
+     * 删除企业微信门户首页banner图信息
+     * 
+     * @param bannerId 企业微信门户首页banner图ID
+     * @return 结果
+     */
+    public int deleteWxBannerById(Long bannerId);
+}

+ 20 - 10
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/IWxMagnetService.java

@@ -26,7 +26,7 @@ public interface IWxMagnetService
      * @param userId 用户ID
      * @return 磁贴列表
      */
-    List<WxMagnet> selectMagnetList(WxMagnet wxMagnet, Long userId);
+    List<WxMagnet> selectMagnetList(WxMagnet wxMagnet);
 
 
 
@@ -84,19 +84,29 @@ public interface IWxMagnetService
      * @param role 角色对象
      * @return 磁贴列表
      */
-    List<Ztree> roleMagnetTreeData(SysRole role, Long userId);
+    List<Ztree> roleMagnetTreeData(SysRole role, SysUser user);
+
 
     /**
-     * 查询磁贴集合
-     *
-     * @return 所有磁贴信息
+     * 根据角色权限查询磁贴列表
+     * @param wxMagnet
+     * @param user
+     * @return
      */
-    List<WxMagnet> selectMagnetAll(Long userId);
+    List<WxMagnet> selectMagnetListByRole(WxMagnet wxMagnet, SysUser user);
 
     /**
-     * 查询所有磁贴
-     *
-     * @return 磁贴列表
+     * 根据角色id更新磁贴权限表
+     * @param roleId
+     * @param magnetIds
+     * @return
+     */
+    int upDateRoleMagnet(String roleId, String magnetIds);
+
+    /**
+     * 根据用户id查询所拥有的的磁贴
+     * @param userId
+     * @return
      */
-    List<Ztree> magnetTreeData(Long userId);
+    List<WxMagnet> selectMagnetByUserId(String userId);
 }

+ 97 - 0
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/WxBannerServiceImpl.java

@@ -0,0 +1,97 @@
+package com.dgtly.wxportal.service.impl;
+
+import java.util.List;
+import com.dgtly.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.dgtly.wxportal.mapper.WxBannerMapper;
+import com.dgtly.wxportal.domain.WxBanner;
+import com.dgtly.wxportal.service.IWxBannerService;
+import com.dgtly.common.core.text.Convert;
+
+/**
+ * 企业微信门户首页banner图Service业务层处理
+ * 
+ * @author qxp
+ * @date 2020-06-23
+ */
+@Service
+public class WxBannerServiceImpl implements IWxBannerService 
+{
+    @Autowired
+    private WxBannerMapper wxBannerMapper;
+
+    /**
+     * 查询企业微信门户首页banner图
+     * 
+     * @param bannerId 企业微信门户首页banner图ID
+     * @return 企业微信门户首页banner图
+     */
+    @Override
+    public WxBanner selectWxBannerById(Long bannerId)
+    {
+        return wxBannerMapper.selectWxBannerById(bannerId);
+    }
+
+    /**
+     * 查询企业微信门户首页banner图列表
+     * 
+     * @param wxBanner 企业微信门户首页banner图
+     * @return 企业微信门户首页banner图
+     */
+    @Override
+    public List<WxBanner> selectWxBannerList(WxBanner wxBanner)
+    {
+        return wxBannerMapper.selectWxBannerList(wxBanner);
+    }
+
+    /**
+     * 新增企业微信门户首页banner图
+     * 
+     * @param wxBanner 企业微信门户首页banner图
+     * @return 结果
+     */
+    @Override
+    public int insertWxBanner(WxBanner wxBanner)
+    {
+        wxBanner.setCreateTime(DateUtils.getNowDate());
+        return wxBannerMapper.insertWxBanner(wxBanner);
+    }
+
+    /**
+     * 修改企业微信门户首页banner图
+     * 
+     * @param wxBanner 企业微信门户首页banner图
+     * @return 结果
+     */
+    @Override
+    public int updateWxBanner(WxBanner wxBanner)
+    {
+        wxBanner.setUpdateTime(DateUtils.getNowDate());
+        return wxBannerMapper.updateWxBanner(wxBanner);
+    }
+
+    /**
+     * 删除企业微信门户首页banner图对象
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteWxBannerByIds(String ids)
+    {
+        return wxBannerMapper.deleteWxBannerByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除企业微信门户首页banner图信息
+     * 
+     * @param bannerId 企业微信门户首页banner图ID
+     * @return 结果
+     */
+    @Override
+    public int deleteWxBannerById(Long bannerId)
+    {
+        return wxBannerMapper.deleteWxBannerById(bannerId);
+    }
+}

+ 46 - 37
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/WxMagnetServiceImpl.java

@@ -3,19 +3,16 @@ package com.dgtly.wxportal.service.impl;
 import com.dgtly.common.constant.UserConstants;
 import com.dgtly.common.core.domain.Ztree;
 import com.dgtly.common.utils.StringUtils;
-import com.dgtly.system.domain.SysMenu;
 import com.dgtly.system.domain.SysRole;
 import com.dgtly.system.domain.SysUser;
-import com.dgtly.system.mapper.SysMenuMapper;
 import com.dgtly.system.mapper.SysRoleMenuMapper;
-import com.dgtly.system.service.ISysMenuService;
+import com.dgtly.wxportal.domain.RoleMagnet;
 import com.dgtly.wxportal.domain.WxMagnet;
 import com.dgtly.wxportal.mapper.WxMagnetMapper;
 import com.dgtly.wxportal.service.IWxMagnetService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.text.MessageFormat;
 import java.util.*;
 
 /**
@@ -39,22 +36,13 @@ public class WxMagnetServiceImpl implements IWxMagnetService
      * 查询H5磁贴列表
      *
      * @param wxMagnet 菜单信息
-     * @param userId 用户ID
      * @return 磁贴列表
      */
     @Override
-    public List<WxMagnet> selectMagnetList(WxMagnet wxMagnet, Long userId)
+    public List<WxMagnet> selectMagnetList(WxMagnet wxMagnet)
     {
-        List<WxMagnet> menuList = null;
-        if (SysUser.isAdmin(userId))
-        {
-            menuList = wxMagnetMapper.selectMagnetList(wxMagnet);
-        }
-        else
-        {
-            wxMagnet.getParams().put("userId", userId);
-            menuList = wxMagnetMapper.selectMagnetListByUserId(wxMagnet);
-        }
+
+        List<WxMagnet> menuList = wxMagnetMapper.selectMagnetList(wxMagnet);
         return menuList;
     }
 
@@ -139,13 +127,23 @@ public class WxMagnetServiceImpl implements IWxMagnetService
      * @return 磁贴列表
      */
     @Override
-    public List<Ztree> roleMagnetTreeData(SysRole role, Long userId) {
+    public List<Ztree> roleMagnetTreeData(SysRole role, SysUser user) {
         Long roleId = role.getRoleId();
         List<Ztree> ztrees = new ArrayList<Ztree>();
-        List<WxMagnet> wxMagnetList = selectMagnetAll(userId);
+        WxMagnet wxMagnet = new WxMagnet();
+        wxMagnet.setVisible("0");
+        List<WxMagnet> wxMagnetList;
+        if (user.isAdmin())
+        {
+            wxMagnetList = wxMagnetMapper.selectMagnetList(wxMagnet);
+        }
+        else
+        {
+            wxMagnetList = wxMagnetMapper.selectMagnetAllByUserId(wxMagnet,user.getUserId());
+        }
         if (StringUtils.isNotNull(roleId))
         {
-            List<String> roleMagnetList = wxMagnetMapper.selectMagnetTree(roleId);
+            List<String> roleMagnetList = wxMagnetMapper.selectMagnetIdByRoleId(roleId);
             ztrees = initZtree(wxMagnetList, roleMagnetList);
         }
         else
@@ -155,38 +153,49 @@ public class WxMagnetServiceImpl implements IWxMagnetService
         return ztrees;
     }
 
-    /**
-     * 查询菜单集合
-     *
-     * @return 所有菜单信息
-     */
+
+
     @Override
-    public List<WxMagnet> selectMagnetAll(Long userId)
-    {
+    public List<WxMagnet> selectMagnetListByRole(WxMagnet wxMagnet, SysUser user) {
         List<WxMagnet> wxMagnetList = null;
-        if (SysUser.isAdmin(userId))
+        if (user.isAdmin())
         {
-            wxMagnetList = wxMagnetMapper.selectMagnetAll();
+            wxMagnetList = wxMagnetMapper.selectMagnetList(wxMagnet);
         }
         else
         {
-            wxMagnetList = wxMagnetMapper.selectMagnetAllByUserId(userId);
+            wxMagnetList = wxMagnetMapper.selectMagnetAllByUserId(wxMagnet,user.getUserId());
         }
         return wxMagnetList;
     }
 
+    @Override
+    public int upDateRoleMagnet(String roleId, String magnetIds) {
+        //
+        wxMagnetMapper.deleteRoleMagnetByRoleId(roleId);
+        List<RoleMagnet> roleMagnetList = new ArrayList<>();
+        String s[] = magnetIds.split(",");
+        for(String str:s){
+            RoleMagnet roleMagnet = new RoleMagnet();
+            roleMagnet.setMagnetId(Long.parseLong(str));
+            roleMagnet.setRoleId(Long.parseLong(roleId));
+            roleMagnetList.add(roleMagnet);
+        }
+
+        return wxMagnetMapper.batchRoleMagnet(roleMagnetList);
+    }
+
     /**
-     * 查询所有磁贴
-     *
-     * @return 磁贴列表
+     * 根据用户id查询所的的磁贴
+     * @param userId
+     * @return
      */
     @Override
-    public List<Ztree> magnetTreeData(Long userId) {
-        List<WxMagnet> magnetList = selectMagnetAll(userId);
-        List<Ztree> ztrees = initZtree(magnetList,null);
-        return ztrees;
+    public List<WxMagnet> selectMagnetByUserId(String userId) {
+        return wxMagnetMapper.selectMagnetByUserId(userId);
     }
 
+
     /**
      * 对象转磁贴树
      *
@@ -207,7 +216,7 @@ public class WxMagnetServiceImpl implements IWxMagnetService
             ztree.setTitle(wxMagnet.getMagnetName());
             if (isCheck)
             {
-                ztree.setChecked(roleMagnetList.contains(wxMagnet.getMagnetId()));
+                ztree.setChecked(roleMagnetList.contains(wxMagnet.getMagnetId().toString()));
             }
             ztrees.add(ztree);
         }

+ 99 - 0
suishenbang-wxportal/suishenbang-wxportal-common/src/main/resources/mapper/wxportal/WxBannerMapper.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dgtly.wxportal.mapper.WxBannerMapper">
+    
+    <resultMap type="WxBanner" id="WxBannerResult">
+        <result property="bannerId"    column="banner_id"    />
+        <result property="imgUrl"    column="img_url"    />
+        <result property="title"    column="title"    />
+        <result property="contextUrl"    column="context_url"    />
+        <result property="des"    column="des"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectWxBannerVo">
+        select banner_id, img_url, title, context_url, des, create_by, create_time, update_by, update_time, remark from wx_banner
+    </sql>
+
+    <select id="selectWxBannerList" parameterType="WxBanner" resultMap="WxBannerResult">
+        <include refid="selectWxBannerVo"/>
+        <where>  
+            <if test="title != null  and title != ''">
+                and title like concat('%', #{title}, '%')
+            </if>
+            <if test="params.beginCreateTime != null and params.beginCreateTime != ''"><!-- 开始时间检索 -->
+                AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginCreateTime},'%y%m%d')
+            </if>
+            <if test="params.endCreateTime != null and params.endCreateTime != ''"><!-- 结束时间检索 -->
+                AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endCreateTime},'%y%m%d')
+            </if>
+        </where>
+    </select>
+    
+    <select id="selectWxBannerById" parameterType="Long" resultMap="WxBannerResult">
+        <include refid="selectWxBannerVo"/>
+        where banner_id = #{bannerId}
+    </select>
+        
+    <insert id="insertWxBanner" parameterType="WxBanner">
+        insert into wx_banner
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="bannerId != null ">banner_id,</if>
+            <if test="imgUrl != null  and imgUrl != ''">img_url,</if>
+            <if test="title != null  and title != ''">title,</if>
+            <if test="contextUrl != null  and contextUrl != ''">context_url,</if>
+            <if test="des != null  and des != ''">des,</if>
+            <if test="createBy != null  and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null  and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
+            <if test="remark != null  and remark != ''">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="bannerId != null ">#{bannerId},</if>
+            <if test="imgUrl != null  and imgUrl != ''">#{imgUrl},</if>
+            <if test="title != null  and title != ''">#{title},</if>
+            <if test="contextUrl != null  and contextUrl != ''">#{contextUrl},</if>
+            <if test="des != null  and des != ''">#{des},</if>
+            <if test="createBy != null  and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null  and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
+            <if test="remark != null  and remark != ''">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateWxBanner" parameterType="WxBanner">
+        update wx_banner
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="imgUrl != null  and imgUrl != ''">img_url = #{imgUrl},</if>
+            <if test="title != null  and title != ''">title = #{title},</if>
+            <if test="contextUrl != null  and contextUrl != ''">context_url = #{contextUrl},</if>
+            <if test="des != null  and des != ''">des = #{des},</if>
+            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
+            <if test="remark != null  and remark != ''">remark = #{remark},</if>
+        </trim>
+        where banner_id = #{bannerId}
+    </update>
+
+    <delete id="deleteWxBannerById" parameterType="Long">
+        delete from wx_banner where banner_id = #{bannerId}
+    </delete>
+
+    <delete id="deleteWxBannerByIds" parameterType="String">
+        delete from wx_banner where banner_id in 
+        <foreach item="bannerId" collection="array" open="(" separator="," close=")">
+            #{bannerId}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 55 - 29
suishenbang-wxportal/suishenbang-wxportal-common/src/main/resources/mapper/wxportal/WxMagnetMapper.xml

@@ -26,38 +26,26 @@
 
 
     <select id="selectMagnetList" parameterType="WxMagnet" resultMap="WxMagnetResult">
-        <include refid="selectMagnetVo"/>
+        select distinct m.magnet_id,  m.magnet_name, m.url, m.visible, m.magnet_size
+        , m.bg_url, m.order_num, m.create_time
+        from wx_magnet m
         <where>
             <if test="magnetName != null and magnetName != ''">
-                AND magnet_name like concat('%', #{magnetName}, '%')
+                AND m.magnet_name like concat('%', #{magnetName}, '%')
             </if>
             <if test="visible != null and visible != ''">
-                AND visible = #{visible}
+                AND m.visible = #{visible}
+            </if>
+            <if test="magnetSize != null and magnetSize != ''">
+                AND m.magnetSize = #{magnet_size}
             </if>
+            ${params.dataScope}
         </where>
         order by  order_num
     </select>
 
-    <select id="selectMagnetListByUserId" parameterType="WxMagnet" resultMap="WxMagnetResult">
-        select distinct m.magnet_id,  m.magnet_name, m.url, m.visible, m.magnet_size
-        , m.bg_url, m.order_num, m.create_time
-        from wx_magnet m
-        left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
-        left join sys_user_role ur on rm.role_id = ur.role_id
-        LEFT JOIN sys_role ro on ur.role_id = ro.role_id
-        where ur.user_id = #{params.userId}
-        <if test="magnetName != null and magnetName != ''">
-            AND m.magnet_name like concat('%', #{magnetName}, '%')
-        </if>
-        <if test="visible != null and visible != ''">
-            AND m.visible = #{visible}
-        </if>
-        order by  m.order_num
-    </select>
-
-
 
-    <select id="selectCountRoleMenuByMenuId" resultType="Integer">
+    <select id="selectCountRoleMagnetByMagnetId" resultType="Integer">
 	    select count(1) from wx_role_magnet where magnet_id=#{magnetId}
 	</select>
 
@@ -122,24 +110,62 @@
         order by order_num
     </select>
 
-    <select id="selectMagnetAllByUserId" parameterType="Long" resultMap="WxMagnetResult">
+    <select id="selectMagnetAllByUserId"  resultMap="WxMagnetResult">
       select distinct m.magnet_id,  m.magnet_name, m.url, m.visible, m.magnet_size
             , m.bg_url, m.order_num, m.create_time
 		from wx_magnet m
-			 left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
-			 left join sys_user_role ur on rm.role_id = ur.role_id
-			 LEFT JOIN sys_role ro on ur.role_id = ro.role_id
-		where ur.user_id = #{userId}
+         left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
+         left join sys_user_role ur on rm.role_id = ur.role_id
+         LEFT JOIN sys_role ro on ur.role_id = ro.role_id
+        <where>
+            ur.user_id = #{userId}
+            <if test="magnetName != null and magnetName != ''">
+                AND m.magnet_name like concat('%', #{magnetName}, '%')
+            </if>
+            <if test="visible != null and visible != ''">
+                AND m.visible = #{visible}
+            </if>
+            <if test="magnetSize != null and magnetSize != ''">
+                AND m.magnetSize = #{magnet_size}
+            </if>
+            ${params.dataScope}
+        </where>
 		order by  m.order_num
 	</select>
 
-    <select id="selectMagnetTree" parameterType="Long" resultType="String">
+    <select id="selectMagnetIdByRoleId" parameterType="Long" resultType="String">
 		select m.magnet_id
 		from wx_magnet m
-			left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
+		left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
 		where rm.role_id = #{roleId}
+		and m.visible = 0
 		order by  m.order_num
 	</select>
 
+    <delete id="deleteRoleMagnetByRoleId" parameterType="String">
+
+        delete from wx_role_magnet where role_id = #{roleId}
+    </delete>
+
+    <insert id="batchRoleMagnet">
+        insert into wx_role_magnet(role_id, magnet_id) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.roleId},#{item.magnetId})
+        </foreach>
+    </insert>
+
+    <select id="selectMagnetByUserId" parameterType="String" resultMap="WxMagnetResult">
+        select distinct m.magnet_id,  m.magnet_name, m.url, m.visible, m.magnet_size
+        , m.bg_url, m.order_num, m.create_time
+        from wx_magnet m
+        left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
+        left join sys_user_role ur on rm.role_id = ur.role_id
+        LEFT JOIN sys_role ro on ur.role_id = ro.role_id
+        <where>
+            ur.user_id = #{userId}
+        </where>
+        order by  m.order_num
+	</select>
+
 
 </mapper> 

+ 6 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/pom.xml

@@ -43,6 +43,12 @@
             <groupId>com.dgtly</groupId>
             <artifactId>suishenbang-system</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>com.dgtly</groupId>
+            <artifactId>suishenbang-framework</artifactId>
+            <version>4.0.0</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 136 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/java/com/dgtly/wxportal/controller/WxBannerController.java

@@ -0,0 +1,136 @@
+package com.dgtly.wxportal.controller;
+
+import java.util.List;
+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.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import com.dgtly.common.annotation.Log;
+import com.dgtly.common.enums.BusinessType;
+import com.dgtly.wxportal.domain.WxBanner;
+import com.dgtly.wxportal.service.IWxBannerService;
+import com.dgtly.common.core.controller.BaseController;
+import com.dgtly.common.core.domain.AjaxResult;
+import com.dgtly.common.utils.poi.ExcelUtil;
+import com.dgtly.common.core.page.TableDataInfo;
+
+/**
+ * 企业微信门户首页banner图Controller
+ * 
+ * @author qxp
+ * @date 2020-06-23
+ */
+@Controller
+@RequestMapping("/wxportal/banner")
+public class WxBannerController extends BaseController
+{
+    private String prefix = "wxportal/banner";
+
+    @Autowired
+    private IWxBannerService wxBannerService;
+
+    @RequiresPermissions("wxportal:banner:view")
+    @GetMapping()
+    public String banner()
+    {
+        return prefix + "/banner";
+    }
+
+    /**
+     * 查询企业微信门户首页banner图列表
+     */
+    @RequiresPermissions("wxportal:banner:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(WxBanner wxBanner)
+    {
+        startPage();
+        List<WxBanner> list = wxBannerService.selectWxBannerList(wxBanner);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出企业微信门户首页banner图列表
+     */
+    @RequiresPermissions("wxportal:banner:export")
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(WxBanner wxBanner)
+    {
+        List<WxBanner> list = wxBannerService.selectWxBannerList(wxBanner);
+        ExcelUtil<WxBanner> util = new ExcelUtil<WxBanner>(WxBanner.class);
+        return util.exportExcel(list, "banner");
+    }
+
+    /**
+     * 新增企业微信门户首页banner图
+     */
+    @GetMapping("/add")
+    public String add()
+    {
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存企业微信门户首页banner图
+     */
+    @RequiresPermissions("wxportal:banner:add")
+    @Log(title = "企业微信门户首页banner图", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(WxBanner wxBanner)
+    {
+        return toAjax(wxBannerService.insertWxBanner(wxBanner));
+    }
+
+    /**
+     * 修改企业微信门户首页banner图
+     */
+    @GetMapping("/edit/{bannerId}")
+    public String edit(@PathVariable("bannerId") Long bannerId, ModelMap mmap)
+    {
+        WxBanner wxBanner = wxBannerService.selectWxBannerById(bannerId);
+        mmap.put("wxBanner", wxBanner);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存企业微信门户首页banner图
+     */
+    @RequiresPermissions("wxportal:banner:edit")
+    @Log(title = "企业微信门户首页banner图", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(WxBanner wxBanner)
+    {
+        return toAjax(wxBannerService.updateWxBanner(wxBanner));
+    }
+
+    /**
+     * 删除企业微信门户首页banner图
+     */
+    @RequiresPermissions("wxportal:banner:remove")
+    @Log(title = "企业微信门户首页banner图", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(wxBannerService.deleteWxBannerByIds(ids));
+    }
+
+
+    /**
+     * 上传图片
+     */
+    @GetMapping("/imgUpload")
+    public String imgUpload(String imgUrl,ModelMap mmap)
+    {
+        mmap.addAttribute("imgUrl",imgUrl);
+        return prefix + "/uploadImg";
+    }
+}

+ 46 - 48
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/java/com/dgtly/wxportal/controller/WxMagnetController.java

@@ -5,10 +5,12 @@ import com.dgtly.common.constant.UserConstants;
 import com.dgtly.common.core.controller.BaseController;
 import com.dgtly.common.core.domain.AjaxResult;
 import com.dgtly.common.core.domain.Ztree;
+import com.dgtly.common.core.page.TableDataInfo;
 import com.dgtly.common.enums.BusinessType;
 import com.dgtly.common.exception.BusinessException;
 import com.dgtly.framework.util.ShiroUtils;
 import com.dgtly.system.domain.SysRole;
+import com.dgtly.system.domain.SysUser;
 import com.dgtly.wxportal.domain.WxMagnet;
 import com.dgtly.wxportal.service.IWxMagnetService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -30,7 +32,7 @@ import java.util.List;
 @RequestMapping("/wxportal/magnet")
 public class WxMagnetController extends BaseController
 {
-    private String prefix = "wxportal";
+    private String prefix = "wxportal/magnet";
 
     @Autowired
     private IWxMagnetService wxMagnetService;
@@ -42,22 +44,14 @@ public class WxMagnetController extends BaseController
         return prefix + "/wxMagnet";
     }
 
-    @RequiresPermissions("wxportal:magnet:list")
-    @PostMapping("/list")
-    @ResponseBody
-    public List<WxMagnet> list(WxMagnet wxMagnet)
-    {
-        Long userId = ShiroUtils.getUserId();
-        List<WxMagnet> magnetList = wxMagnetService.selectMagnetList(wxMagnet, userId);
-        return magnetList;
-    }
+
 
     /**
      * 删除磁贴
      */
     @Log(title = "磁贴管理", businessType = BusinessType.DELETE)
     @RequiresPermissions("wxportal:magnet:remove")
-    @GetMapping("/remove/{magnetId}")
+    @PostMapping("/remove/{magnetId}")
     @ResponseBody
     public AjaxResult remove(@PathVariable("magnetId") Long magnetId)
     {
@@ -73,21 +67,10 @@ public class WxMagnetController extends BaseController
     /**
      * 新增
      */
-    @GetMapping("/add/{parentId}")
-    public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
+    @GetMapping("/add")
+    public String add()
     {
-        WxMagnet wxMagnet = null;
-        if (0L != parentId)
-        {
-            wxMagnet = wxMagnetService.selectMagnetById(parentId);
-        }
-        else
-        {
-            wxMagnet = new WxMagnet();
-            wxMagnet.setMagnetId(0L);
-            wxMagnet.setMagnetName("主目录");
-        }
-        mmap.put("wxMagnet", wxMagnet);
+
         return prefix + "/add";
     }
 
@@ -149,48 +132,63 @@ public class WxMagnetController extends BaseController
         return wxMagnetService.checkMagnetNameUnique(wxMagnet);
     }
 
+
+
     /**
-     * 加载角色磁贴列表树
+     * 选择磁贴页面
      */
-    @GetMapping("/roleMagnetTreeData")
-    @ResponseBody
-    public List<Ztree> roleMagnetTreeData(SysRole role)
+    @GetMapping("/selectMagnetTree/{roleId}")
+    public String selectMagnetTree(@PathVariable("roleId") Long roleId, ModelMap mmap)
     {
-        Long userId = ShiroUtils.getUserId();
-        List<Ztree> ztrees = wxMagnetService.roleMagnetTreeData(role, userId);
-        return ztrees;
+        mmap.put("roleId",roleId);
+        return prefix + "/roletree";
     }
 
     /**
-     * 加载所有磁贴列表树
+     * 上传图片
      */
-    @GetMapping("/magnetTreeData")
+    @GetMapping("/bgUpload")
+    public String bgUpload(String bgUrl,String size,ModelMap mmap)
+    {
+        mmap.addAttribute("bgUrl",bgUrl);
+        mmap.addAttribute("size",size);
+        return prefix + "/bgUpload";
+    }
+
+    @RequiresPermissions("wxportal:magnet:list")
+    @PostMapping("/list")
     @ResponseBody
-    public List<Ztree> magnetTreeData()
+    public TableDataInfo list(WxMagnet wxMagnet)
     {
-        Long userId = ShiroUtils.getUserId();
-        List<Ztree> ztrees = wxMagnetService.magnetTreeData(userId);
-        return ztrees;
+        startPage();
+        SysUser user = ShiroUtils.getSysUser();
+        List<WxMagnet> magnetList = wxMagnetService.selectMagnetListByRole(wxMagnet,user);
+        return getDataTable(magnetList);
     }
 
+
     /**
-     * 选择菜单
+     * 加载角色磁贴列表
      */
-    @GetMapping("/selectMagnetTree/{magnetId}")
-    public String selectMagnetTree(@PathVariable("magnetId") Long magnetId, ModelMap mmap)
+    @RequestMapping("/roleMagnetTreeData")
+    @ResponseBody
+    public List<Ztree> roleMagnetTreeData(SysRole role)
     {
-        mmap.put("magnet", wxMagnetService.selectMagnetById(magnetId));
-        return prefix + "/tree";
+        SysUser user = ShiroUtils.getSysUser();
+        List<Ztree> ztrees = wxMagnetService.roleMagnetTreeData(role, user);
+        return ztrees;
     }
 
     /**
-     * 修改菜单
+     * 更新角色H5磁贴
      */
-    @GetMapping("/bgUpload")
-    public String bgUpload( ModelMap mmap)
+    @RequestMapping("/upRoleMagnet")
+    @Log(title = "角色管理更新H5磁贴", businessType = BusinessType.UPDATE)
+    @ResponseBody
+    public AjaxResult upRoleMagnet(String roleId,String magnetIds)
     {
-        mmap.addAttribute("bgUrl","");
-        return prefix + "/bgUpload";
+
+        return toAjax(wxMagnetService.upDateRoleMagnet(roleId, magnetIds));
     }
 
 }

+ 0 - 192
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/add.html

@@ -1,192 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
-<head>
-	<th:block th:include="include :: header('新增磁贴')" />
-    <style>
-        .bg-sm{
-            width:70px;
-            height: 70px;
-            font-size: 40px;
-            color: black;
-            text-align: center
-        }
-        .bg-md{
-             width:140px;
-             height: 70px;
-             font-size: 40px;
-             color: black;
-             text-align: center
-         }
-        .bg-lg{
-            width:210px;
-            height: 70px;
-            font-size: 40px;
-            color: black;
-            text-align: center
-        }
-    </style>
-</head>
-<body class="white-bg">
-	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
-		<form class="form-horizontal m" id="form-magnet-add">
-			<input id="treeId" name="parentId" type="hidden" th:value="${wxMagnet.magnetId}" />
-
-			<div class="form-group">
-				<label class="col-sm-3 control-label">磁贴名称:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="magnetName" id="magnetName" required>
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">请求地址:</label>
-				<div class="col-sm-8">
-					<input id="url" name="url" class="form-control" type="text">
-				</div>
-			</div>
-
-			<div class="form-group">
-				<label class="col-sm-3 control-label">磁贴尺寸:</label>
-				<div class="col-sm-8">
-                   <select name="magnetSize" id="sel_magnetSize" class="form-control m-b" th:with="type=${@dict.getType('wx_magnet_size')}" onchange="sizeChange()">
-                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                </select>
-                </div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">显示排序:</label>
-				<div class="col-sm-8" >
-					<input class="form-control" type="text" name="orderNum" required>
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">背景图片:</label>
-				<div class="col-sm-8">
-                    <input id="input_bgUrl" name="bgUrl" type="hidden"/>
-                    <input type="file" id="input-slideshow-add" style="display: none;" onclick="bgUpload()"/>
-                    <div class="thumbnail slideshow_span" id="btn-bgUrl-add" onclick="bgUpload()">
-                        <i class="fa fa-plus"></i>
-                    </div>
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">菜单状态:</label>
-				<div class="col-sm-8">
-				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_show_hide')}">
-						<input type="radio" th:id="${dict.dictCode}" name="visible" th:value="${dict.dictValue}" th:checked="${dict.default}">
-						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
-					</div>
-				</div>
-			</div>
-
-			<div class="form-group">
-				<label class="col-sm-3 control-label">备注:</label>
-				<div class="col-sm-8">
-					<textarea id="remark" name="remark" class="form-control" type="text"></textarea>
-				</div>
-			</div>
-		</form>
-	</div>
-	<th:block th:include="include :: footer" />
-	 <script>
-        var prefix = ctx + "wxportal/magnet";
-        var sizeList = [[${@dict.getType('swx_magnet_size')}]];
-        $("#form-magnet-add").validate({
-        	onkeyup: false,
-        	rules:{
-        		magnetName:{
-        			remote: {
-                        url: prefix + "/checkMagnetNameUnique",
-                        type: "post",
-                        dataType: "json",
-                        data: {
-                        	"parentId": function() {
-		                		return $("input[name='parentId']").val();
-		                    },
-                        	"magnetName" : function() {
-                                return $.common.trim($("#magnetName").val());
-                            }
-                        },
-                        dataFilter: function(data, type) {
-                        	return $.validate.unique(data);
-                        }
-                    }
-        		},
-        		orderNum:{
-        			digits:true
-        		},
-        	},
-        	messages: {
-                "magnetName": {
-                    remote: "菜单已经存在"
-                }
-            },
-            focusCleanup: true
-        });
-        
-        function submitHandler() {
-	        if ($.validate.form()) {
-	            $.operate.save(prefix + "/add", $('#form-magnet-add').serialize());
-	        }
-	    }
-
-        $(function() {
-
-        	$("input[name='bgUrl']").focus(function() {
-                $(".icon-drop").show();
-            });
-        	$("#form-magnet-add").click(function(event) {
-        	    var obj = event.srcElement || event.target;
-        	    if (!$(obj).is("input[name='bgUrl']")) {
-        	    	$(".icon-drop").hide();
-        	    }
-        	});
-        	$(".icon-drop").find(".ico-list i").on("click", function() {
-        		$('#bgUrl').val($(this).attr('class'));
-            });
-
-        });
-
-        /*用户管理-头像*/
-        function bgUpload() {
-            var options = {
-                title: "上传背景图像",
-                // width: 500,
-                // height: 500,
-                url:  ctx + 'wxportal/magnet/bgUpload',
-                btn:["上传","取消"],
-                callBack :upBg
-            };
-            $.modal.openOptions(options);
-        }
-
-        function upBg(index, layero) {
-            var img = window.frames[0].cropper.getBlob();
-            var formdata = new FormData();
-            formdata.append("file", img);
-            $.ajax({
-                url: ctx + "common/upload",
-                data: formdata,
-                type: "post",
-                processData: false,
-                contentType: false,
-                success: function(result) {
-                    $.operate.saveSuccess(result);
-                    alert(result.data.url);
-                }
-            })
-        }
-        function sizeChange(){
-            var size = $("#sel_magnetSize").val();
-            if(size=="l"||size=="L"){
-
-            }else if(size=="m"||size=="M"){
-
-            }else if(size=="s"||size=="S"){
-
-            }
-        }
-
-
-    </script>
-</body>
-</html>

+ 99 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/add.html

@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增企业微信门户首页banner图')" />
+    <style>
+
+        .bannerImg{
+            width: 360px;
+            height: 200px;
+            font-size: 130px;
+            color: black;
+            text-align: center
+        }
+    </style>
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-banner-add">
+
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">标题:</label>
+                <div class="col-sm-8">
+                    <input name="title" class="form-control" type="text">
+                </div>
+            </div>
+
+            <div class="form-group">
+                <label class="col-sm-3 control-label">banner图:</label>
+                <div class="col-sm-8">
+                    <input id="input_imgUrl" name="imgUrl" type="hidden"/>
+                    <div class="thumbnail slideshow_span bannerImg" id="div-imgUrl" onclick="javascript:imgUpload()">
+                        <i class="fa fa-plus"></i>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">内容地址:</label>
+                <div class="col-sm-8">
+                    <input name="contextUrl" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">内容摘要:</label>
+                <div class="col-sm-8">
+                    <textarea name="des" class="form-control"></textarea>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script type="text/javascript">
+        var prefix = ctx + "wxportal/banner"
+        $("#form-banner-add").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/add", $('#form-banner-add').serialize());
+            }
+        }
+        /*上传背景图片*/
+        function imgUpload() {
+            var imgUrl = $("#input_imgUrl").val();
+            var options = {
+                title: "上传Banner图像",
+                width: 500,
+                height: 600,
+                url:  prefix + '/imgUpload?&bgUrl='+imgUrl,
+                btn:["上传","取消"],
+                callBack :upImg
+            };
+            $.modal.openOptions(options);
+        }
+        function upImg(index, layero) {
+            var img = window.frames[0].cropper.getBlob();
+            var formdata = new FormData();
+            formdata.append("file", img);
+            $.ajax({
+                url: ctx + "common/upload",
+                data: formdata,
+                type: "post",
+                processData: false,
+                contentType: false,
+                success: function(result) {
+                    if(result.code==0){
+                        $("#input_imgUrl").val(result.data.fileName);
+                        $("#div-imgUrl").html("<img src='"+result.data.url+"' style='width;100%;height:100%;'>");
+                        layer.close(index);
+                    }else{
+                        $.modal.alertWarning(result.msg);
+                    }
+
+                }
+            })
+        }
+    </script>
+</body>
+</html>

+ 117 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/banner.html

@@ -0,0 +1,117 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('企业微信门户首页banner图列表')" />
+    <style>
+
+        .tableImage_l{
+            border-radius:2px;
+            width:57px;
+            height: 32px;
+        }
+    </style>
+</head>
+<body class="gray-bg">
+     <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="formId">
+                    <div class="select-list">
+                        <ul>
+                            <li>
+                                <p>标题:</p>
+                                <input type="text" name="title"/>
+                            </li>
+                            <li class="select-time">
+                                <p>创建时间:</p>
+                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
+                                <span>-</span>
+                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
+                            </li>
+                            <li>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                            </li>
+                        </ul>
+                    </div>
+                </form>
+            </div>
+
+            <div class="btn-group-sm" id="toolbar" role="group">
+                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="wxportal:banner:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="wxportal:banner:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="wxportal:banner:remove">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+            </div>
+            <div class="col-sm-12 select-table table-striped">
+                <table id="bootstrap-table"></table>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('wxportal:banner:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('wxportal:banner:remove')}]];
+        var prefix = ctx + "wxportal/banner";
+
+        $(function() {
+            var options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                modalName: "企业微信门户首页banner图",
+                columns: [{
+                    checkbox: true
+                },
+                {
+                    field : 'bannerId',
+                    title : 'id',
+                    visible: false
+                },
+
+                {
+                    field : 'title', 
+                    title : '标题'
+                },
+                {
+                    field : 'imgUrl',
+                    title : 'banner图    ',
+                    formatter: function(value, row, index) {
+                        return $.table.imageView(value,200,600,"tableImage_l img-view");
+
+                    }
+                },
+                {
+                    field : 'contextUrl', 
+                    title : '内容地址'
+                },
+                {
+                    field : 'des', 
+                    title : '内容摘要'
+                },
+                {
+                    field : 'remark', 
+                    title : '备注'
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        var actions = [];
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.bannerId + '\')"><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.bannerId + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        return actions.join('');
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+    </script>
+</body>
+</html>

+ 102 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/edit.html

@@ -0,0 +1,102 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改企业微信门户首页banner图')" />
+    <style>
+        .bg-lg{
+            width: 360px;
+            height: 200px;
+            font-size: 130px;
+            color: black;
+            text-align: center
+        }
+    </style>
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-banner-edit" th:object="${wxBanner}">
+            <input name="bannerId" th:field="*{bannerId}" type="hidden">
+
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">标题:</label>
+                <div class="col-sm-8">
+                    <input name="title" th:field="*{title}" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">    
+                <label class="col-sm-3 control-label">内容地址:</label>
+                <div class="col-sm-8">
+                    <input name="contextUrl" th:field="*{contextUrl}" class="form-control" type="text">
+                </div>
+            </div>
+
+            <div class="form-group">
+                <label class="col-sm-3 control-label">背景图片:</label>
+                <div class="col-sm-8">
+                    <input id="input_imgUrl" name="imgUrl" th:field="*{imgUrl}" type="hidden"/>
+                    <div class="thumbnail slideshow_span bg-lg" id="div-bgUrl" onclick="javascript:imgUpload()">
+                        <img th:src="*{imgUrl}" style="width:100%;height:100%;">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">内容摘要:</label>
+                <div class="col-sm-8">
+                    <textarea name="des" class="form-control">[[*{des}]]</textarea>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script type="text/javascript">
+        var prefix = ctx + "wxportal/banner";
+        $("#form-banner-edit").validate({
+            focusCleanup: true
+        });
+
+
+
+        /*上传背景图片*/
+        function imgUpload() {
+            var imgUrl = $("#input_imgUrl").val();
+            var options = {
+                title: "上传背景图像",
+                width: 500,
+                height: 600,
+                url:  prefix + '/imgUpload?imgUrl='+imgUrl,
+                btn:["上传","取消"],
+                callBack :upImg
+            };
+            $.modal.openOptions(options);
+        }
+
+        function upImg(index, layero) {
+            var img = window.frames[0].cropper.getBlob();
+            var formdata = new FormData();
+            formdata.append("file", img);
+            $.ajax({
+                url: ctx + "common/upload",
+                data: formdata,
+                type: "post",
+                processData: false,
+                contentType: false,
+                success: function(result) {
+                    if(result.code==0){
+                        $("#input_imgUrl").val(result.data.fileName);
+                        $("#div-imgUrl").html("<img src='"+result.data.url+"' style='width;100%;height:100%;'>");
+                        layer.close(index);
+                    }else{
+                        $.modal.alertWarning(result.msg);
+                    }
+
+                }
+            })
+        }
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-banner-edit').serialize());
+            }
+        }
+    </script>
+</body>
+</html>

+ 79 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/uploadImg.html

@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+	<th:block th:include="include :: header('上传Banner图片')" />
+	<th:block th:include="include :: cropbox-css" />
+    <style>
+
+        .thumbBox_L{
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 360px;
+            height: 200px;
+            margin-top: -100px;
+            margin-left: -180px;
+            box-sizing: border-box;
+            border: 1px solid rgb(102, 102, 102);
+            box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
+            background: none repeat scroll 0% 0% transparent;
+        }
+    </style>
+</head>
+<body class="white-bg">
+    <div class="container"> 
+        <div class="imageBox" style="margin: 0 auto;">
+	        <div class="thumbBox_L" ></div>
+	        <div class="spinner" style="display: none">Loading...</div> 
+	   </div> 
+	   <div class="action" style="margin: 10px auto;">
+	       <div class="new-contentarea tc">
+	           <a href="javascript:void(0)" class="upload-img"> <label for="avatar">上传图像</label> </a> 
+	           <input type="file" class="" name="avatar" id="avatar" accept="image/*"/>
+	       </div>
+           <input type="button" id="btnZoomIn" class="Btnsty_peyton" value="+" />
+           <input type="button" id="btnZoomOut" class="Btnsty_peyton"  value="-" />
+	   </div> 
+
+    </div>
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: cropbox-js" />
+<script type="text/javascript">
+var cropper;
+$(window).load(function() {
+	var imgUrl = '[[${imgUrl}]]';
+    var options = {
+        thumbBox: '.thumbBox_L',
+        spinner: '.spinner',
+        imgSrc: $.common.isEmpty(imgUrl) ? ctx + 'img/profile.jpg' : imgUrl
+    }
+    cropper = $('.imageBox').cropbox(options);
+    $('#avatar').on('change', function() {
+        var reader = new FileReader();
+        reader.onload = function(e) {
+            options.imgSrc = e.target.result;
+            //根据MIME判断上传的文件是不是图片类型
+            if((options.imgSrc).indexOf("image/")==-1){
+                $.modal.alertWarning("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
+            } else {
+                cropper = $('.imageBox').cropbox(options);
+            }
+        }
+        reader.readAsDataURL(this.files[0]);
+    })
+    
+
+	$('#btnZoomIn').on('click', function(){
+		cropper.zoomIn();
+	})
+	
+	$('#btnZoomOut').on('click', function(){
+		cropper.zoomOut();
+	})
+});
+
+
+
+</script>
+</body>
+</html>

+ 0 - 133
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/edit.html

@@ -1,133 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
-<head>
-	<th:block th:include="include :: header('修改磁贴')" />
-</head>
-<body class="white-bg">
-	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
-		<form class="form-horizontal m" id="form-magnet-edit" th:object="${wxMagnet}">
-			<input name="magnetId"   type="hidden" th:field="*{magnetId}"   />
-
-			<div class="form-group">
-				<label class="col-sm-3 control-label">磁贴名称:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="magnetName" id="magnetName" th:field="*{magnetName}" required>
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">请求地址:</label>
-				<div class="col-sm-8">
-					<input id="url" name="url" class="form-control" type="text" th:field="*{url}">
-				</div>
-			</div>
-
-            <div class="form-group">
-                <label class="col-sm-3 control-label">磁贴尺寸:</label>
-                <div class="col-sm-8">
-                    <select name="magnetSize"  class="form-control m-b" th:with="type=${@dict.getType('wx_magnet_size')}">
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                    </select>
-                </div>
-            </div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">显示排序:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="orderNum" th:field="*{orderNum}" required>
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">背景图片:</label>
-				<div class="col-sm-8">
-
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">菜单状态:</label>
-				<div class="col-sm-8">
-					<div class="radio-box" th:each="dict : ${@dict.getType('sys_show_hide')}">
-						<input type="radio" th:id="${dict.dictCode}" name="visible" th:value="${dict.dictValue}" th:field="*{visible}">
-						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
-					</div>
-				</div>
-			</div>
-
-			<div class="form-group">
-				<label class="col-sm-3 control-label">备注:</label>
-				<div class="col-sm-8">
-					<textarea id="remark" name="remark" class="form-control" type="text">[[*{remark}]]</textarea>
-				</div>
-			</div>
-		</form>
-	</div>
-	<th:block th:include="include :: footer" />
-	 <script>
-        var prefix = ctx + "wxportal/magnet";
-
-
-        $("#form-magnet-edit").validate({
-        	onkeyup: false,
-        	rules:{
-        		magnetType:{
-        			required:true,
-        		},
-        		magnetName:{
-        			remote: {
-                        url: prefix + "/checkMagnetNameUnique",
-                        type: "post",
-                        dataType: "json",
-                        data: {
-                        	"magnetId": function() {
-                                return $("#magnetId").val();
-                            },
-                            "parentId": function() {
-		                		return $("input[name='parentId']").val();
-		                    },
-                			"magnetName": function() {
-                                return $.common.trim($("#magnetName").val());
-                            }
-                        },
-                        dataFilter: function(data, type) {
-                        	return $.validate.unique(data);
-                        }
-                    }
-        		},
-        		orderNum:{
-        			digits:true
-        		},
-        	},
-        	messages: {
-                "magnetName": {
-                    remote: "菜单已经存在"
-                }
-            },
-            focusCleanup: true
-        });
-        
-        function submitHandler() {
-	        if ($.validate.form()) {
-	            $.operate.save(prefix + "/edit", $('#form-magnet-edit').serialize());
-	        }
-	    }
-
-        $(function() {
-            $("input[name='bgUrl']").focus(function() {
-                $(".icon-drop").show();
-            });
-            $("#form-magnet-edit").click(function(event) {
-                var obj = event.srcElement || event.target;
-                if (!$(obj).is("input[name='bgUrl']")) {
-                    $(".icon-drop").hide();
-                }
-            });
-            $(".icon-drop").find(".ico-list i").on("click",
-            function() {
-                $('#bgUrl').val($(this).attr('class'));
-            });
-
-        });
-
-
-
-    </script>
-</body>
-</html>

+ 190 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/add.html

@@ -0,0 +1,190 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+	<th:block th:include="include :: header('新增磁贴')" />
+    <style>
+        .bg-sm{
+            width: 120px;
+            height: 110px;
+            font-size: 90px;
+            color: black;
+            text-align: center
+        }
+        .bg-md{
+            width: 180px;
+            height: 150px;
+            font-size: 90px;
+            color: black;
+            text-align: center
+         }
+        .bg-lg{
+            width: 360px;
+            height: 200px;
+            font-size: 90px;
+            color: black;
+            text-align: center
+        }
+    </style>
+</head>
+<body class="white-bg">
+	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+		<form class="form-horizontal m" id="form-magnet-add">
+
+			<div class="form-group">
+				<label class="col-sm-3 control-label"><span style="color: red; ">*</span>磁贴名称:</label>
+				<div class="col-sm-8">
+					<input class="form-control" type="text" name="magnetName" id="magnetName" required>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-3 control-label"><span style="color: red; ">*</span>请求地址:</label>
+				<div class="col-sm-8">
+					<input id="url" name="url" class="form-control" type="text" required>
+				</div>
+			</div>
+
+			<div class="form-group">
+				<label class="col-sm-3 control-label">磁贴尺寸:</label>
+				<div class="col-sm-8">
+                   <select name="magnetSize" id="sel_magnetSize" class="form-control m-b" th:with="type=${@dict.getType('wx_magnet_size')}" onchange="javascript:sizeChange()">
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                </select>
+                </div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-3 control-label"><span style="color: red; ">*</span>显示排序:</label>
+				<div class="col-sm-8" >
+					<input class="form-control" type="text" name="orderNum" required>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-3 control-label">背景图片:</label>
+				<div class="col-sm-8">
+                    <input id="input_bgUrl" name="bgUrl" type="hidden"/>
+                    <div class="thumbnail slideshow_span" id="div-bgUrl" onclick="javascript:bgUpload()">
+                        <i class="fa fa-plus"></i>
+                    </div>
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-3 control-label">菜单状态:</label>
+				<div class="col-sm-8">
+				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_show_hide')}">
+						<input type="radio" th:id="${dict.dictCode}" name="visible" th:value="${dict.dictValue}" th:checked="${dict.default}">
+						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
+					</div>
+				</div>
+			</div>
+
+			<div class="form-group">
+				<label class="col-sm-3 control-label">备注:</label>
+				<div class="col-sm-8">
+					<textarea id="remark" name="remark" class="form-control" type="text"></textarea>
+				</div>
+			</div>
+		</form>
+	</div>
+	<th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+    var prefix = ctx + "wxportal/magnet";
+
+    $(function(){
+        //form校验
+        $("#form-magnet-add").validate({
+            onkeyup: false,
+            rules:{
+                magnetName:{
+                    remote: {
+                        url: prefix + "/checkMagnetNameUnique",
+                        type: "post",
+                        dataType: "json",
+                        data: {
+                            "magnetName" : function() {
+                                return $.common.trim($("#magnetName").val());
+                            }
+                        },
+                        dataFilter: function(data, type) {
+                            return $.validate.unique(data);
+                        }
+                    }
+                },
+                orderNum:{
+                    digits:true
+                },
+                url:{
+                    required:true
+                },
+            },
+            messages: {
+                "magnetName": {
+                    remote: "菜单已经存在"
+                }
+            },
+            focusCleanup: true
+        });
+        sizeChange();
+    })
+
+    //表单提交
+    function submitHandler() {
+        if ($.validate.form()) {
+            $.operate.save(prefix + "/add", $('#form-magnet-add').serialize());
+        }
+    }
+
+
+    /*上传背景图片*/
+    function bgUpload() {
+        var size = $("#sel_magnetSize").val();
+        var bgUrl = $("#input_bgUrl").val();
+        var options = {
+            title: "上传背景图像",
+            width: 500,
+            height: 600,
+            url:  ctx + 'wxportal/magnet/bgUpload?size='+size+"&bgUrl="+bgUrl,
+            btn:["上传","取消"],
+            callBack :upBg
+        };
+        $.modal.openOptions(options);
+    }
+
+    function upBg(index, layero) {
+        var img = window.frames[0].cropper.getBlob();
+        var formdata = new FormData();
+        formdata.append("file", img);
+        $.ajax({
+            url: ctx + "common/upload",
+            data: formdata,
+            type: "post",
+            processData: false,
+            contentType: false,
+            success: function(result) {
+                if(result.code==0){
+                    $("#input_bgUrl").val(result.data.fileName);
+                    $("#div-bgUrl").html("<img src='"+result.data.url+"' style='width;100%;height:100%;'>");
+                    layer.close(index);
+                }else{
+                    $.modal.alertWarning(result.msg);
+                }
+
+            }
+        })
+    }
+    function sizeChange(){
+        var size = $("#sel_magnetSize").val();
+        $("#div-bgUrl").removeClass("bg-sm");
+        $("#div-bgUrl").removeClass("bg-md");
+        $("#div-bgUrl").removeClass("bg-lg");
+        if(size=="l"||size=="L"){
+            $("#div-bgUrl").addClass("bg-lg");
+        }else if(size=="m"||size=="M"){
+            $("#div-bgUrl").addClass("bg-md");
+        }else if(size=="s"||size=="S"){
+            $("#div-bgUrl").addClass("bg-sm");
+        }
+    }
+
+
+    </script>
+</body>
+</html>

+ 194 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/edit.html

@@ -0,0 +1,194 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+	<th:block th:include="include :: header('修改磁贴')" />
+    <style>
+        .bg-sm{
+            width: 120px;
+            height: 110px;
+            font-size: 90px;
+            color: black;
+            text-align: center
+        }
+        .bg-md{
+            width: 180px;
+            height: 150px;
+            font-size: 90px;
+            color: black;
+            text-align: center
+        }
+        .bg-lg{
+            width: 360px;
+            height: 200px;
+            font-size: 90px;
+            color: black;
+            text-align: center
+        }
+    </style>
+</head>
+<body class="white-bg">
+	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-magnet-edit"  th:object="${wxMagnet}">
+            <input type="hidden" name="magnetId" th:field="*{magnetId}">
+            <div class="form-group">
+                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>磁贴名称:</label>
+                <div class="col-sm-8">
+                    <input class="form-control" type="text" name="magnetName" id="magnetName" th:field="*{magnetName}" required>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>请求地址:</label>
+                <div class="col-sm-8">
+                    <input id="url" name="url" class="form-control" type="text" th:field="*{url}"  required>
+                </div>
+            </div>
+
+            <div class="form-group">
+                <label class="col-sm-3 control-label">磁贴尺寸:</label>
+                <div class="col-sm-8">
+                    <select name="magnetSize" id="sel_magnetSize" class="form-control m-b"
+                            th:with="type=${@dict.getType('wx_magnet_size')}" onchange="javascript:sizeChange()">
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{magnetSize}"></option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>显示排序:</label>
+                <div class="col-sm-8" >
+                    <input class="form-control" type="text" name="orderNum" th:field="*{orderNum}" required>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">背景图片:</label>
+                <div class="col-sm-8">
+                    <input id="input_bgUrl" name="bgUrl" th:field="*{bgUrl}" type="hidden"/>
+                    <div class="thumbnail slideshow_span" id="div-bgUrl" onclick="javascript:bgUpload()">
+                        <img th:src="*{bgUrl}" style="width;100%;height:100%;">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">菜单状态:</label>
+                <div class="col-sm-8">
+                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_show_hide')}">
+                        <input type="radio" th:id="${dict.dictCode}" name="visible" th:value="${dict.dictValue}"
+                              th:field="*{visible}" >
+                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
+                    </div>
+                </div>
+            </div>
+
+            <div class="form-group">
+                <label class="col-sm-3 control-label">备注:</label>
+                <div class="col-sm-8">
+                    <textarea id="remark" name="remark" class="form-control" type="text" th:field="*{remark}"></textarea>
+                </div>
+            </div>
+        </form>
+    </div>
+	<th:block th:include="include :: footer" />
+	 <script th:inline="javascript">
+        var prefix = ctx + "wxportal/magnet";
+        $(function() {
+            $("#form-magnet-edit").validate({
+                onkeyup: false,
+                rules: {
+                    url: {
+                        required: true,
+                    },
+                    magnetName: {
+                        remote: {
+                            url: prefix + "/checkMagnetNameUnique",
+                            type: "post",
+                            dataType: "json",
+                            data: {
+                                "magnetId": function () {
+                                    return $("#magnetId").val();
+                                },
+                                "magnetName": function () {
+                                    return $.common.trim($("#magnetName").val());
+                                }
+                            },
+                            dataFilter: function (data, type) {
+                                return $.validate.unique(data);
+                            }
+                        }
+                    },
+                    orderNum: {
+                        digits: true
+                    },
+
+                },
+                messages: {
+                    "magnetName": {
+                        remote: "菜单已经存在"
+                    }
+                },
+                focusCleanup: true
+            });
+
+            sizeChange();
+        });
+        
+        function submitHandler() {
+	        if ($.validate.form()) {
+	            $.operate.save(prefix + "/edit", $('#form-magnet-edit').serialize());
+	        }
+	    }
+
+        /*上传背景图片*/
+        function bgUpload() {
+            var size = $("#sel_magnetSize").val();
+            var bgUrl = $("#input_bgUrl").val();
+            var options = {
+                title: "上传背景图像",
+                width: 500,
+                height: 600,
+                url:  ctx + 'wxportal/magnet/bgUpload?size='+size+"&bgUrl="+bgUrl,
+                btn:["上传","取消"],
+                callBack :upBg
+            };
+            $.modal.openOptions(options);
+        }
+
+        function upBg(index, layero) {
+            var img = window.frames[0].cropper.getBlob();
+            var formdata = new FormData();
+            formdata.append("file", img);
+            $.ajax({
+                url: ctx + "common/upload",
+                data: formdata,
+                type: "post",
+                processData: false,
+                contentType: false,
+                success: function(result) {
+                    if(result.code==0){
+                        $("#input_bgUrl").val(result.data.fileName);
+                        $("#div-bgUrl").html("<img src='"+result.data.url+"' style='width;100%;height:100%;'>");
+                        layer.close(index);
+                    }else{
+                        $.modal.alertWarning(result.msg);
+                    }
+
+                }
+            })
+        }
+        function sizeChange(){
+            var size = $("#sel_magnetSize").val();
+            $("#div-bgUrl").removeClass("bg-sm");
+            $("#div-bgUrl").removeClass("bg-md");
+            $("#div-bgUrl").removeClass("bg-lg");
+            if(size=="l"||size=="L"){
+                $("#div-bgUrl").addClass("bg-lg");
+            }else if(size=="m"||size=="M"){
+                $("#div-bgUrl").addClass("bg-md");
+            }else if(size=="s"||size=="S"){
+                $("#div-bgUrl").addClass("bg-sm");
+            }
+        }
+
+
+
+    </script>
+</body>
+</html>

+ 59 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/roletree.html

@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('磁贴列表')" />
+    <th:block th:include="include :: ztree-css" />
+
+</head>
+<body class="gray-bg">
+<div class="container-div">
+    <div class="row">
+
+        <div class="form-group">
+            <label class="col-sm-3 control-label">磁贴权限</label>
+            <div class="col-sm-8">
+                <div id="menuTrees" class="ztree"></div>
+            </div>
+        </div>
+    </div>
+</div>
+
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: ztree-js" />
+<script th:inline="javascript">
+    var roleId = [[${roleId}]]
+    var prefix = ctx + "wxportal/magnet";
+
+    $(function() {
+        var url = prefix + "/roleMagnetTreeData?roleId=" + roleId;
+        var options = {
+            id: "menuTrees",
+            url: url,
+            check: { enable: true },
+            expandLevel: 0
+        };
+        $.tree.init(options);
+    });
+
+    function submitHandler() {
+        var magnetIds = $.tree.getCheckedNodes();
+        $.ajax({
+            cache : true,
+            type : "POST",
+            url : prefix + "/upRoleMagnet",
+            data : {
+                "roleId":roleId,
+                "magnetIds": magnetIds
+            },
+            async : false,
+            error : function(request) {
+                $.modal.alertError("系统错误");
+            },
+            success : function(data) {
+                $.operate.successCallback(data);
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 57 - 26
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/wxMagnet.html

@@ -2,6 +2,23 @@
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
 	<th:block th:include="include :: header('磁贴列表')" />
+    <style>
+        .tableImage_s{
+            border-radius:2px;
+            width:35px;
+            height: 32px;
+        }
+        .tableImage_m{
+            border-radius:2px;
+            width:38px;
+            height: 32px;
+        }
+        .tableImage_l{
+            border-radius:2px;
+            width:57px;
+            height: 32px;
+        }
+    </style>
 </head>
 <body class="gray-bg">
     <div class="container-div">
@@ -20,7 +37,7 @@
 								</select>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
 								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
 							</li>
 						</ul>
@@ -29,22 +46,21 @@
 			</div>
                 
             <div class="btn-group-sm" id="toolbar" role="group">
-		        <a class="btn btn-success" onclick="$.operate.addFull(0)" shiro:hasPermission="wxportal:magnet:add">
+		        <a class="btn btn-success" onclick="$.operate.add(0)" shiro:hasPermission="wxportal:magnet:add">
                     <i class="fa fa-plus"></i> 新增
                 </a>
-                <a class="btn btn-primary" onclick="$.operate.editFull()" shiro:hasPermission="wxportal:magnet:edit">
-		            <i class="fa fa-edit"></i> 修改
-		        </a>
+                <!--<a class="btn btn-primary" onclick="$.operate.editFull()" shiro:hasPermission="wxportal:magnet:edit">-->
+		            <!--<i class="fa fa-edit"></i> 修改-->
+		        <!--</a>-->
 	        </div>
        		 <div class="col-sm-12 select-table table-striped">
-	            <table id="bootstrap-tree-table"></table>
+	            <table id="bootstrap-table"></table>
 	        </div>
 	    </div>
 	</div>
 	
 	<th:block th:include="include :: footer" />
 	<script th:inline="javascript">
-		var addFlag = [[${@permission.hasPermi('wxportal:magnet:add')}]];
 		var editFlag = [[${@permission.hasPermi('wxportal:magnet:edit')}]];
 		var removeFlag = [[${@permission.hasPermi('wxportal:magnet:remove')}]];
 		var datas = [[${@dict.getType('sys_show_hide')}]];
@@ -53,30 +69,39 @@
 
 		$(function() {
 		    var options = {
-		        code: "magnetId",
-		        parentCode: "parentId",
-		        uniqueId: "magnetId",
-		        expandAll: false,
-		        expandFirst: false,
 		        url: prefix + "/list",
-		        createUrl: prefix + "/add/{id}",
+		        createUrl: prefix + "/add",
 		        updateUrl: prefix + "/edit/{id}",
 		        removeUrl: prefix + "/remove/{id}",
-		        modalName: "磁贴",
+                showColumns: false,
+                showToggle: false,
+		        modalName: "磁贴管理",
 		        columns: [{
-                    field: 'selectItem', 
-                    radio: true
-                 },
-                 {
-		            title: '磁贴名称',
-		            field: 'magnetName',
-		            width: '20%'
-		        },
+                    checkbox: true
+                },
+                {
+                    field : 'id',
+                    title : 'id',
+                    visible: false
+                },
+                {
+                    field: 'magnetName',
+                    title: '磁贴名称',
+                    width: '20%'
+                },
 		        {
-		            field: 'orderNum',
-		            title: '排序',
+		            field: 'bgUrl',
+		            title: '背景图片',
 		            width: '10%',
-		            align: "left"
+                    formatter: function(value, row, index) {
+                        if(row.magnetSize=="S"){
+                            return $.table.imageView(value,200,200,"tableImage_s img-view");
+                        }else if(row.magnetSize=="M"){
+                            return $.table.imageView(value,200,300,"tableImage_m img-view");
+                        }else if(row.magnetSize=="L"){
+                            return $.table.imageView(value,200,600,"tableImage_l img-view");
+                        }
+                    }
 		        },
 		        {
 		            field: 'url',
@@ -105,6 +130,12 @@
 		            	return $.table.selectDictLabel(datas, row.visible);
 		            }
 		        },
+                {
+                    field: 'orderNum',
+                    title: '排序',
+                    width: '10%',
+                    align: "left"
+                },
 		        {
 		            title: '操作',
 		            width: '20%',
@@ -117,7 +148,7 @@
 		            }
 		        }]
 		    };
-		    $.treeTable.init(options);
+		    $.table.init(options);
 		});
 	</script>
 </body>