Browse Source

修改提交

chenweida 7 years ago
parent
commit
b79fdca9e7
100 changed files with 22713 additions and 0 deletions
  1. 154 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/version/MBaseServerUrlVersion.java
  2. 27 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/doctorManage/DoctorContants.java
  3. 134 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/wx/WechatContants.java
  4. 3 0
      svr-discovery/src/main/java/META-INF/MANIFEST.MF
  5. 38 0
      svr/svr-base/src/main/java/com/yihu/jw/base/controller/base/ModuleFunController.java
  6. 79 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/base/ModuleFunService.java
  7. 11 0
      svr/svr-base/src/main/java/com/yihu/jw/login/dao/BaseLoginAccountDao.java
  8. 11 0
      svr/svr-base/src/main/java/com/yihu/jw/login/dao/BaseLoginLogDao.java
  9. 99 0
      svr/svr-base/src/main/java/com/yihu/jw/login/model/BaseLoginAccount.java
  10. 134 0
      svr/svr-base/src/main/java/com/yihu/jw/login/model/BaseLoginLog.java
  11. 142 0
      svr/svr-base/src/main/java/com/yihu/jw/version/controller/ServerUrlVersionController.java
  12. 66 0
      svr/svr-base/src/main/java/com/yihu/jw/version/controller/UserUrlVersionController.java
  13. 32 0
      svr/svr-base/src/main/java/com/yihu/jw/version/dao/ServerUrlVersionDao.java
  14. 24 0
      svr/svr-base/src/main/java/com/yihu/jw/version/dao/UserUrlVersionDao.java
  15. 148 0
      svr/svr-base/src/main/java/com/yihu/jw/version/model/BaseServerUrlVersion.java
  16. 65 0
      svr/svr-base/src/main/java/com/yihu/jw/version/model/BaseUserUrlVersion.java
  17. 108 0
      svr/svr-base/src/main/java/com/yihu/jw/version/service/ServerUrlVersionService.java
  18. 164 0
      svr/svr-base/src/main/java/com/yihu/jw/version/service/UserUrlVersionService.java
  19. 129 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/CacheAdapter.java
  20. 16 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/Cache.java
  21. 75 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/MapCache.java
  22. 67 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/RedisCache.java
  23. 25 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/model/LoginCacheModel.java
  24. 25 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/model/RoleCacheModel.java
  25. 41 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/aop/LogAspect.java
  26. 13 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/aop/annotation/ManageLog.java
  27. 113 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/base/FunctionController.java
  28. 125 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/base/ModuleController.java
  29. 61 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/doctorManage/DoctorController.java
  30. 51 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/system/MenuRoleController.java
  31. 1 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/system/UserRoleController.java
  32. 95 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/version/ServerUrlVersionController.java
  33. 99 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/version/ServerVersionController.java
  34. 56 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/version/UserUrlVersionController.java
  35. 78 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/version/WlyyVersionController.java
  36. 93 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/wechat/TemplateController.java
  37. 116 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/wechat/WechatMenuController.java
  38. 26 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/dao/system/MenuUrlDao.java
  39. 119 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/model/base/Function.java
  40. 65 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/model/system/ManageMenuUrl.java
  41. 127 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/BaseServerUrlVersion.java
  42. 202 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/BaseServerVersion.java
  43. 166 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/BaseServerVersionLog.java
  44. 141 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/BaseUserUrlVersion.java
  45. 125 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/WlyyVersion.java
  46. 146 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/base/FunctionService.java
  47. 146 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/base/ModuleService.java
  48. 98 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/doctorManage/DoctorService.java
  49. 57 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/system/ManageMenuUrlService.java
  50. 94 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/system/MenuRoleService.java
  51. 121 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/system/UserRoleService.java
  52. 127 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/version/ServerUrlVersionService.java
  53. 119 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/version/ServerVersionService.java
  54. 64 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/version/UserUrlVersionService.java
  55. 108 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/version/WlyyVersionService.java
  56. 125 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/wechat/TemplateService.java
  57. 116 0
      svr/svr-manage/src/main/java/com/yihu/jw/manage/service/wechat/WechatMenuService.java
  58. 12 0
      svr/svr-manage/src/main/resources/webapp/common/css/jw.css
  59. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/a1.jpg
  60. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/a2.jpg
  61. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/a3.jpg
  62. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/a4.jpg
  63. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/a5.jpg
  64. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/a6.jpg
  65. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/a7.jpg
  66. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/a8.jpg
  67. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/a9.jpg
  68. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/iconfont-logo.png
  69. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/index.jpg
  70. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/index_4.jpg
  71. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/locked.png
  72. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/login-background.jpg
  73. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/p1.jpg
  74. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/p2.jpg
  75. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/p3.jpg
  76. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/p_big1.jpg
  77. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/p_big2.jpg
  78. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/p_big3.jpg
  79. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/profile.jpg
  80. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/profile_big.jpg
  81. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/profile_small.jpg
  82. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/qr_code.png
  83. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/user.png
  84. BIN
      svr/svr-manage/src/main/resources/webapp/common/img/wenku_logo.png
  85. 339 0
      svr/svr-manage/src/main/resources/webapp/common/js/bootstrap/modal.js
  86. 569 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/changelog.txt
  87. 190 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/easyloader.js
  88. 16078 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/jquery.easyui.min.js
  89. 141 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/jquery.easyui.mobile.js
  90. 5 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/jquery.min.js
  91. 14 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/license_freeware.txt
  92. 44 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-af.js
  93. 46 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-am.js
  94. 45 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-ar.js
  95. 44 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-bg.js
  96. 44 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-ca.js
  97. 44 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-cs.js
  98. 44 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-cz.js
  99. 44 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-da.js
  100. 0 0
      svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-de.js

+ 154 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/version/MBaseServerUrlVersion.java

@ -0,0 +1,154 @@
package com.yihu.jw.restmodel.base.version;
import java.util.Date;
/**
 * Created by chenweida on 2017/6/16.
 */
public class MBaseServerUrlVersion {
    private String code;
    private String saasId;
    private String functionCode;//关联功能表 base_function code
    private String functionName;//功能名字
    private String serverCode;//关联 base_server_version code
    private String serverName;//base_server_version name
    private String name;//版本名称
    private Integer versionInt;//数字版本号
    private Date createTime;
    private String createUser;
    private String createUserName;
    private Date updateTime;
    private String updateUser;
    private String updateUserName;
    private Integer status;//1: 正常 0:不可用  -1删除
    private String remark;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getVersionInt() {
        return versionInt;
    }
    public void setVersionInt(Integer versionInt) {
        this.versionInt = versionInt;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    public String getUpdateUserName() {
        return updateUserName;
    }
    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getFunctionCode() {
        return functionCode;
    }
    public void setFunctionCode(String functionCode) {
        this.functionCode = functionCode;
    }
    public String getFunctionName() {
        return functionName;
    }
    public void setFunctionName(String functionName) {
        this.functionName = functionName;
    }
    public String getServerCode() {
        return serverCode;
    }
    public void setServerCode(String serverCode) {
        this.serverCode = serverCode;
    }
    public String getServerName() {
        return serverName;
    }
    public void setServerName(String serverName) {
        this.serverName = serverName;
    }
}

+ 27 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/doctorManage/DoctorContants.java

@ -0,0 +1,27 @@
package com.yihu.jw.restmodel.doctorManage;
/**
 * Created by Administrator on 2017/7/19 0019.
 */
public class DoctorContants {
    public static final String api_common="/doctorManage";
    public static class Doctor{
        public static final String api_create="/doctor";
        public static final String api_update="/doctor";
        public static final String api_delete="/doctor/{codes}";
        public static final String api_getListNoPage="/doctor/listNoPage";
        public static final String api_getList="/doctor/list";
        public static final String api_getByCode="/doctor/{code}";
        public static final String message_success_create="doctor create success";
        public static final String message_success_update="doctor update success";
        public static final String message_success_find="doctor find success";
        public static final String message_success_find_functions="doctor find success";
        public static final String message_success_delete="doctor delete success";
        public static final String message_fail_code_is_null="code is null";
        public static final String message_fail_code_no_exist="code not exist";
        public static final String message_fail_status_is_null="status is null";
    }
}

+ 134 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/wx/WechatContants.java

@ -0,0 +1,134 @@
package com.yihu.jw.restmodel.wx;
/**
 * Created by Administrator on 2017/5/20 0020.
 */
public class WechatContants {
    public static final String api_common="/wechat";
    //微信token模块常量
    public static class WxAccessToken{
        public static final String message_success_get="wxAccessToken get success";
        public static final String api_common="wxAccessToken";
        public static final String api_create="create";
        public static final String api_get="get";
    }
    //微信按钮模块常量
    public static class WxMenu{
        public static final String api_create="/menu";
        public static final String api_update="/menu";
        public static final String api_delete="/menu/{codes}/{userCode}";
        public static final String api_getWxMenuNoPage="/menu/listNoPage";
        public static final String api_getWxMenus="/menu/list";
        public static final String api_getByCode="/menu/{code}";
        public static final String api_getParentMenu="/parentMenu/{wechatCode}";
        public static final String api_createMenu="/createMenu";
        public static final String api_getChildMenus="/childMenu/list/{parentCode}";
        public static final String message_fail_code_is_null="code is null";
        public static final String message_fail_name_is_null="name is null";
        public static final String message_fail_type_is_null="type is null";
        public static final String message_fail_key_is_null="key is null";
        public static final String message_fail_key_is_toLong="key is to long";
        public static final String message_fail_url_is_null="url is null";
        public static final String message_fail_appid_is_null="appid is null";
        public static final String message_fail_pagepath_is_null="pagepath is null";
        public static final String message_fail_url_is_toLong="url is to long";
        public static final String message_fail_sort_is_null="sort is null";
        public static final String message_fail_sort_is_repeat="sort is repeat";
        public static final String message_fail_code_no_exist="code no exist";
        public static final String message_fail_supMenuCode_is_no_exist="supMenuCode is no exist";
        public static final String message_fail_mediaId_is_null="mediaId is null";
        public static final String message_fail_childMenu_is_to_much="childMenu is to much";//子菜单数目过多
        public static final String message_fail_parentMenu_is_to_much="parentMenu is to much";//子菜单数目过多
        public static final String message_fail_name_is_to_long="name is to long";
        public static final String message_fail_status_is_null="status is null";
        public static final String message_fail_WxMenu_is_no_exist="menu is no exist";//微信菜单未配置
        public static final String message_success_update="wxMenu update success";
        public static final String message_success_delete="wxMenu delete success";
        public static final String message_success_find="wxMenu find success";
        public static final String message_success_create="wxMenu create success";
        public static final String message_success_find_functions="wxMenu find success";
    }
    //微信模板消息
    public static class WxTemplate {
        public static final String api_create="/template";
        public static final String api_update="/template";
        public static final String api_delete="/template/{codes}";
        public static final String api_getWxTemplatesNoPage="/template/listNoPage";
        public static final String api_getWxTemplates="/template/list";
        public static final String api_getByCode="/template/{code}";
        public static final String api_sendTemplateMessage="/sendTemplateMessage";
        public static final String message_success_create="wxTemplate create success";
        public static final String message_success_update="wxTemplate update success";
        public static final String message_success_find="wxTemplate find success";
        public static final String message_success_find_functions="wxTemplate find success";
        public static final String message_success_delete="wxTemplate delete success";
        public static final String message_fail_code_is_null="code is null";
        public static final String message_fail_code_no_exist="code no exist";
        public static final String message_fail_wechatCode_is_null="wechatCode is null";
        public static final String message_fail_templateid_is_null="templateid is null";
        public static final String message_fail_content_is_null="content is null";
        public static final String message_fail_content_format_is_not_right="content format is not right";
        public static final String message_fail_template_is_no_exist="template is no exist";
    }
    //微信配置表
    public static class WxConfig {
        public static final String api_create="/wechatConfig";
        public static final String api_update="/wechatConfig";
        public static final String api_delete="/wechatConfig/{codes}";
        public static final String api_getWechatNoPage="/wechatConfig/listNoPage";
        public static final String api_getWechats="/wechatConfig/list";
        public static final String api_getByCode="/wechatConfig/{code}";
        public static final String message_success_create="wechat create success";
        public static final String message_success_update="wechat update success";
        public static final String message_success_find="wechat find success";
        public static final String message_success_find_functions="wechat find success";
        public static final String message_success_delete="wechat delete success";
        public static final String message_fail_code_is_null="code is null";
        public static final String message_fail_code_no_exist="code not exist";
        public static final String message_fail_appSecret_is_null="appSecret is null";
        public static final String message_fail_appId_exist="wechat appId exist";
        public static final String message_fail_status_is_null="status is null";
        public static final String message_fail_type_is_null="type is null";
        public static final String message_fail_appId_is_null="appId is null";
        public static final String message_fail_name_is_null="name is null";
        public static final String message_fail_wxWechat_is_no_exist="wxWechat is not exist";//微信配置不存在
        public static final String message_fail_id_is_null="id is null";
        public static final String message_fail_saasId_is_null="saasId is null";
    }
    //微信图文消息
    public static class WxGraphicMessage {
        public static final String api_create="/graphicMessage";
        public static final String api_update="/graphicMessage";
        public static final String api_delete="/graphicMessage/{codes}";
        public static final String api_getWxGraphicMessageNoPage="/graphicMessage/listNoPage";
        public static final String api_getWxGraphicMessages="/graphicMessage/list";
        public static final String api_getByCode="/graphicMessage/{code}";
        public static final String api_sendGraphicMessages="/sendGraphicMessages";
        public static final String message_success_create="wxGraphicMessage create success";
        public static final String message_success_update="wxGraphicMessage update success";
        public static final String message_success_find="wxGraphicMessage find success";
        public static final String message_success_find_functions="wxGraphicMessage find success";
        public static final String message_success_delete="wxGraphicMessage delete success";
        public static final String message_fail_code_is_null="code is null";
        public static final String message_fail_code_no_exist="code not exist";
        public static final String message_fail_code_exist="code exist";
        public static final String message_fail_status_is_null="status is null";
        public static final String message_fail_title_is_null="title is null";
        public static final String message_fail_wxGraphicMessage_is_no_exist="wxGraphicMessage is not exist";
    }
}

+ 3 - 0
svr-discovery/src/main/java/META-INF/MANIFEST.MF

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.yihu.jw.SvrDiscovery

+ 38 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/controller/base/ModuleFunController.java

@ -0,0 +1,38 @@
package com.yihu.jw.base.controller.base;
import com.yihu.jw.base.service.base.ModuleFunService;
import com.yihu.jw.restmodel.base.base.BaseContants;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created by chenweida on 2017/5/19.
 */
@RestController
@RequestMapping(BaseContants.api_common)
@Api(value = "模块功能模块", description = "模块功能模块")
public class ModuleFunController extends EnvelopRestController {
    @Autowired
    private ModuleFunService moduleFunService;
    @GetMapping(value = BaseContants.ModuleFun.api_getExistFun)
    @ApiOperation(value="查找已存在的功能")
    public Envelop getExistFunc(@PathVariable String code){
        List<String> funcs = moduleFunService.getExistFun(code);
        return Envelop.getSuccess("查询成功",funcs);
    }
    @PutMapping(value =  BaseContants.ModuleFun.api_changeFun,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "模块更新功能")
    public Envelop changeFun (@RequestBody String jsonData) {
        moduleFunService.changeFun(jsonData);
        return Envelop.getSuccess("更新成功",null);
    }
}

+ 79 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/base/ModuleFunService.java

@ -0,0 +1,79 @@
package com.yihu.jw.base.service.base;
import com.yihu.jw.base.dao.base.ModuleFunctionDao;
import com.yihu.jw.base.model.base.ModuleFunction;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.base.base.BaseContants;
import com.yihu.jw.restmodel.common.CommonContants;
import com.yihu.jw.restmodel.exception.ApiException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
 * Created by chenweida on 2017/5/19.
 */
@Service
public class ModuleFunService extends BaseJpaService<ModuleFunction, ModuleFunctionDao> {
    @Autowired
    private ModuleFunctionDao moduleFunctionDao;
    /**
     * 根据模块code,获取已存在的功能code
     * @param code
     * @return
     */
    public List<String> getExistFun(String code) {
        List<ModuleFunction> moduleFuns = moduleFunctionDao.findByModuleCode(code);
        List<String> list = new ArrayList<>();
        for(ModuleFunction moduleFun:moduleFuns){
            list.add(moduleFun.getFunctionId());
        }
        return list;
    }
    /**
     * 更改模块关联的功能
     * @param jsonData
     */
    public void changeFun(String jsonData) {
        JSONObject jsonObject =  new JSONObject(jsonData);
        if(!jsonObject.has("moduleCode")){
            throw new ApiException(BaseContants.ModuleFun.moduleCode_is_null, CommonContants.common_error_params_code);
            //filterStr+="saasId="+jsonObject.get("saasId")+";";
        }
        if(!jsonObject.has("funCodes")){
            throw new ApiException(BaseContants.ModuleFun.funCodes_is_null, CommonContants.common_error_params_code);
        }
        String moduleCode = jsonObject.get("moduleCode").toString();//模块code
        String funCodes = jsonObject.get("funCodes").toString();//功能code,多个code  ","  分隔
        List<String> existFun = getExistFun(moduleCode);
        List<String> newFunCodes = new ArrayList<String>(Arrays.asList(funCodes.split(",")));//目前的功能code
        List<String> oldFunCodes = new ArrayList<String>(existFun);//构建existFun的副本
        oldFunCodes.removeAll(newFunCodes);// 去除相同元素--->>需要删除的功能code
        newFunCodes.removeAll(existFun);// 去除相同元素---->>需要添加的功能code
        //先删除权限在添加...
        for(String delCode: oldFunCodes){
            moduleFunctionDao.delete(delCode, moduleCode);
        }
        for(String addCode:newFunCodes){
            ModuleFunction moduleFunction = new ModuleFunction();
            moduleFunction.setFunctionId(addCode);
            moduleFunction.setModuleId(moduleCode);
            moduleFunctionDao.save(moduleFunction);
        }
    }
}

+ 11 - 0
svr/svr-base/src/main/java/com/yihu/jw/login/dao/BaseLoginAccountDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.login.dao;
import com.yihu.jw.login.model.BaseLoginAccount;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by chenweida on 2017/6/20.
 */
public interface BaseLoginAccountDao extends PagingAndSortingRepository<BaseLoginAccount, Long>, JpaSpecificationExecutor<BaseLoginAccount> {
}

+ 11 - 0
svr/svr-base/src/main/java/com/yihu/jw/login/dao/BaseLoginLogDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.login.dao;
import com.yihu.jw.login.model.BaseLoginLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by chenweida on 2017/6/20.
 */
public interface BaseLoginLogDao extends PagingAndSortingRepository<BaseLoginLog, Long>, JpaSpecificationExecutor<BaseLoginLog> {
}

+ 99 - 0
svr/svr-base/src/main/java/com/yihu/jw/login/model/BaseLoginAccount.java

@ -0,0 +1,99 @@
package com.yihu.jw.login.model;// default package
import com.yihu.jw.base.model.IdEntity;
import javax.persistence.*;
import java.util.Date;
/**
 * 账号实体 包含医生 患者的账号
 */
@Entity
@Table(name = "base_login_account")
public class BaseLoginAccount extends IdEntity implements java.io.Serializable {
	private String userType;//'用户类型 1居民 2医生 或者行政管理员'
	private String password;//'密码'
	private String salt;//'盐值'
	private String accountStatus;//'状态 ( -2  锁定 -1 删除,0可用 )'
	private String saasId;//'saas配置id'
	private String email;//'邮箱'
	// Constructors
	/** default constructor */
	public BaseLoginAccount() {
	}
	/** full constructor */
	public BaseLoginAccount(Integer id, String code, String userType,
							String password, String salt, String accountStatus, Date createTime,
							Date updateTime, String saasId, String email) {
		this.code = code;
		this.userType = userType;
		this.password = password;
		this.salt = salt;
		this.accountStatus = accountStatus;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.saasId = saasId;
		this.email = email;
	}
	@Column(name = "user_type", precision = 2, scale = 0)
	public String getUserType() {
		return this.userType;
	}
	public void setUserType(String userType) {
		this.userType = userType;
	}
	@Column(name = "password", length = 100)
	public String getPassword() {
		return this.password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@Column(name = "salt", length = 100)
	public String getSalt() {
		return this.salt;
	}
	public void setSalt(String salt) {
		this.salt = salt;
	}
	@Column(name = "account_status", precision = 2, scale = 0)
	public String getAccountStatus() {
		return this.accountStatus;
	}
	public void setAccountStatus(String accountStatus) {
		this.accountStatus = accountStatus;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "email", length = 100)
	public String getEmail() {
		return this.email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
}

+ 134 - 0
svr/svr-base/src/main/java/com/yihu/jw/login/model/BaseLoginLog.java

@ -0,0 +1,134 @@
package com.yihu.jw.login.model;// default package
import com.yihu.jw.base.model.IdEntity;
import javax.persistence.*;
import java.util.Date;
/**
 * 登陆日志
 */
@Entity
@Table(name = "base_login_log")
public class BaseLoginLog extends IdEntity implements java.io.Serializable {
	private String loginType;//'1 短信登录  2 密码登录'
	private String userCode;//'登录用户主键 患者code或者医生code'
	private String saasId;//'saas配置id'
	private String userType;//'1 患者 2医生 '
	private Date createTime;
	private Integer tokenId;//'tokenid'
	private String type;//'1 成功 2失败'
	private String errorMessage;//'错误信息'
	private String phone;//'电话号码'
	// Constructors
	/** default constructor */
	public BaseLoginLog() {
	}
	/** minimal constructor */
	public BaseLoginLog(Integer id, Date createTime) {
		this.createTime = createTime;
	}
	/** full constructor */
	public BaseLoginLog(Integer id, String loginType, String userCode,
						String saasId, String userType, Date createTime, Integer tokenId,
						String type, String errorMessage, String phone) {
		this.loginType = loginType;
		this.userCode = userCode;
		this.saasId = saasId;
		this.userType = userType;
		this.createTime = createTime;
		this.tokenId = tokenId;
		this.type = type;
		this.errorMessage = errorMessage;
		this.phone = phone;
	}
	@Column(name = "login_type", length = 2)
	public String getLoginType() {
		return this.loginType;
	}
	public void setLoginType(String loginType) {
		this.loginType = loginType;
	}
	@Column(name = "user_code", length = 100)
	public String getUserCode() {
		return this.userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "user_type", length = 2)
	public String getUserType() {
		return this.userType;
	}
	public void setUserType(String userType) {
		this.userType = userType;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", nullable = false, length = 0)
	public Date getCreateTime() {
		return this.createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name = "token_id")
	public Integer getTokenId() {
		return this.tokenId;
	}
	public void setTokenId(Integer tokenId) {
		this.tokenId = tokenId;
	}
	@Column(name = "type", length = 1)
	public String getType() {
		return this.type;
	}
	public void setType(String type) {
		this.type = type;
	}
	@Column(name = "error_message", length = 1000)
	public String getErrorMessage() {
		return this.errorMessage;
	}
	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}
	@Column(name = "phone", length = 20)
	public String getPhone() {
		return this.phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
}

+ 142 - 0
svr/svr-base/src/main/java/com/yihu/jw/version/controller/ServerUrlVersionController.java

@ -0,0 +1,142 @@
package com.yihu.jw.version.controller;
import com.yihu.jw.base.service.base.FunctionService;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.base.version.MBaseServerUrlVersion;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.exception.ApiException;
import com.yihu.jw.version.model.BaseServerUrlVersion;
import com.yihu.jw.version.service.ServerUrlVersionService;
import com.yihu.jw.version.service.ServerVersionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/6/20.
 */
@RestController
@RequestMapping(BaseVersionContants.api_common)
@Api(value = "后台URL模块", description = "后台URL模块接口管理")
public class ServerUrlVersionController extends EnvelopRestController {
    @Autowired
    private ServerUrlVersionService serverUrlVersionService;
    @Autowired
    private FunctionService functionService;
    @Autowired
    private ServerVersionService serverVersionService;
    @PostMapping(value = BaseVersionContants.BaseServerUrlVersion.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建后台URL版本", notes = "创建单个后台URL版本")
    public Envelop createBaseServerUrlVersion(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        try {
            BaseServerUrlVersion BaseServerUrlVersion = toEntity(jsonData, BaseServerUrlVersion.class);
            return Envelop.getSuccess(BaseVersionContants.BaseServerUrlVersion.message_success_create, serverUrlVersionService.createBaseServerUrlVersion(BaseServerUrlVersion));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @PutMapping(value = BaseVersionContants.BaseServerUrlVersion.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改后台URL版本", notes = "修改后台URL版本")
    public Envelop updateBaseServerUrlVersion(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        try {
            BaseServerUrlVersion BaseServerUrlVersion = toEntity(jsonData, BaseServerUrlVersion.class);
            return Envelop.getSuccess(BaseVersionContants.BaseServerUrlVersion.message_success_update, serverUrlVersionService.updateBaseServerUrlVersion(BaseServerUrlVersion));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @DeleteMapping(value = BaseVersionContants.BaseServerUrlVersion.api_delete)
    @ApiOperation(value = "删除后台URL版本", notes = "删除后台URL版本")
    public Envelop deleteBaseServerUrlVersion(
            @ApiParam(name = "codes", value = "codes")
            @PathVariable(value = "codes", required = true) String codes) {
        try {
            serverUrlVersionService.deleteBaseServerUrlVersion(codes);
            return Envelop.getSuccess(BaseVersionContants.BaseServerUrlVersion.message_success_delete );
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = BaseVersionContants.BaseServerUrlVersion.api_getByCode)
    @ApiOperation(value = "根据code查找后台URL版本", notes = "根据code查找后台URL版本")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @PathVariable(value = "code", required = true) String code
    ) {
        try {
            return Envelop.getSuccess(BaseVersionContants.BaseServerUrlVersion.message_success_find, serverUrlVersionService.findByCode(code));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = BaseVersionContants.BaseServerUrlVersion.api_getList, method = RequestMethod.GET)
    @ApiOperation(value = "获取后台URL版本列表(分页)")
    public Envelop getBaseServerUrlVersions(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "code,name,saasId,parentCode,remark")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            //code like 1,name大于aa ,code 等于1 , defaultValue = "code?1;name>aa;code=1"
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) int size,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) int page,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        //得到list数据
        List<BaseServerUrlVersion> list = serverUrlVersionService.search(fields, filters, sorts, page, size);
        Map<String, String> serverVersions = serverVersionService.getName();
        Map<String, String> functions= functionService.getName();
        for(BaseServerUrlVersion version:list){
            String serverName = serverVersions.get(version.getServerCode());
            String functionName = functions.get(version.getFunctionCode());
            version.setServerName(serverName);
            version.setFunctionName(functionName);
        }
        //获取总数
        long count=serverUrlVersionService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<MBaseServerUrlVersion> mBaseServerUrlVersions = convertToModels(list, new ArrayList<>(list.size()), MBaseServerUrlVersion.class, fields);
        return Envelop.getSuccessListWithPage(BaseVersionContants.BaseServerUrlVersion.message_success_find_BaseServerUrlVersions,mBaseServerUrlVersions, page, size,count);
    }
    @GetMapping(value = BaseVersionContants.BaseServerUrlVersion.api_getListNoPage)
    @ApiOperation(value = "获取后台URL版本列表,不分页")
    public Envelop getAppsNoPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "code,name,saasId,parentCode,remark")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<BaseServerUrlVersion> list = serverUrlVersionService.search(fields,filters,sorts);
        //封装返回格式
        List<MBaseServerUrlVersion> mBaseServerUrlVersions = convertToModels(list, new ArrayList<>(list.size()), MBaseServerUrlVersion.class, fields);
        return Envelop.getSuccessList(BaseVersionContants.BaseServerUrlVersion.message_success_find_BaseServerUrlVersions,mBaseServerUrlVersions);
    }
}

+ 66 - 0
svr/svr-base/src/main/java/com/yihu/jw/version/controller/UserUrlVersionController.java

@ -0,0 +1,66 @@
package com.yihu.jw.version.controller;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.version.model.BaseUserUrlVersion;
import com.yihu.jw.version.service.UserUrlVersionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by Administrator on 2017/7/17 0017.
 */
@RestController
@RequestMapping(BaseVersionContants.api_common)
@Api(value = "后台用户版本模块", description = "后台用户版本管理模块")
public class UserUrlVersionController extends EnvelopRestController {
    @Autowired
    private UserUrlVersionService userUrlVersionService;
    @GetMapping(value = BaseVersionContants.UserUrlVersion.api_getListNoPage)
    @ApiOperation(value = "获取后台用户版本列表,不分页")
    public Envelop getListNoPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "code,name,saasId,parentCode,remark")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<BaseUserUrlVersion> list = userUrlVersionService.search(fields,filters,sorts);
        //封装返回格式
        List<BaseUserUrlVersion> versionList = convertToModels(list, new ArrayList<>(list.size()), BaseUserUrlVersion.class, fields);
        return Envelop.getSuccessList(BaseVersionContants.BaseServerVersion.message_success_find_BaseServerVersions,versionList);
    }
    @GetMapping(value = BaseVersionContants.UserUrlVersion.api_changeUserVersion)
    @ApiOperation(value = "更改后台用户版本")
    public Envelop changeUserVersion(
            @ApiParam(name = "serverCode",value="后台版本code")
            @RequestParam(value = "serverCode") String serverCode,
            @ApiParam(name = "userCodes", value = "更改的用户codes")
            @RequestParam(value = "userCodes") String userCodes,
            @ApiParam(name = "userCode", value = "修改人code")
            @RequestParam(value = "userCode") String userCode,
            @ApiParam(name = "userName", value = "修改人")
            @RequestParam(value = "userName") String userName,
            @ApiParam(name = "saasId")
            @RequestParam(value = "saasId") String saasId
    ) {
        userUrlVersionService.changeUserVersion(serverCode, userCodes, userCode,userName,saasId);
        return Envelop.getSuccess(BaseVersionContants.UserUrlVersion.message_success_update,null);
    }
}

+ 32 - 0
svr/svr-base/src/main/java/com/yihu/jw/version/dao/ServerUrlVersionDao.java

@ -0,0 +1,32 @@
package com.yihu.jw.version.dao;
import com.yihu.jw.version.model.BaseServerUrlVersion;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * Created by chenweida on 2017/5/19.
 */
public interface ServerUrlVersionDao extends PagingAndSortingRepository<BaseServerUrlVersion, Long>, JpaSpecificationExecutor<BaseServerUrlVersion> {
    @Query("from BaseServerUrlVersion f where f.name=?1 and f.status=1")
    BaseServerUrlVersion findByName(String name);
    @Query("from BaseServerUrlVersion f where f.name=?1 and f.status=1 and f.code != ?2")
    BaseServerUrlVersion findByNameExcludeCode(String name, String code);
    @Query("from BaseServerUrlVersion f where f.code=?1 and f.status=1")
    BaseServerUrlVersion findByCode(String code);
    @Query("from BaseServerUrlVersion f where f.serverCode=?1 and f.status=1")
    List<BaseServerUrlVersion> findByServer(String serverCode);
    @Transactional
    @Modifying
    @Query("update BaseServerUrlVersion b set b.status=-1 , b.updateUserName=?2 , b.updateUser =?3 where b.serverCode = ?1")
    void deleteByServer(String serverCode, String userName, String userCode);
}

+ 24 - 0
svr/svr-base/src/main/java/com/yihu/jw/version/dao/UserUrlVersionDao.java

@ -0,0 +1,24 @@
package com.yihu.jw.version.dao;
import com.yihu.jw.version.model.BaseUserUrlVersion;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import javax.transaction.Transactional;
import java.util.List;
/**
 * Created by chenweida on 2017/5/19.
 */
public interface UserUrlVersionDao extends PagingAndSortingRepository<BaseUserUrlVersion, Long>, JpaSpecificationExecutor<BaseUserUrlVersion> {
    @Query("from BaseUserUrlVersion f where f.code=?1 and f.status=1")
    BaseUserUrlVersion findByCode(String code);
    @Query("from BaseUserUrlVersion f where f.userCode=?1 and f.saasId=?2 and f.status=1")
    BaseUserUrlVersion findByBsvCodeAndSaasId(String userCode, String saasId);
}

+ 148 - 0
svr/svr-base/src/main/java/com/yihu/jw/version/model/BaseServerUrlVersion.java

@ -0,0 +1,148 @@
package com.yihu.jw.version.model;// default package
import com.yihu.jw.base.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
/**
 * BaseServerUrlVersion entity. @author MyEclipse Persistence Tools
 * 功能版本
 */
@Entity
@Table(name = "base_server_url_version")
public class BaseServerUrlVersion extends IdEntity implements java.io.Serializable {
	// Fields
	private String saasId;
	private String functionCode;//关联功能表 base_function code
	@Transient
	private String functionName;//功能名字
	private String serverCode;//关联 base_server_version code
	@Transient
	private String serverName;//base_server_version name
	private String name;//版本名称
	private Integer versionInt;//数字版本号
	private Integer status;//1: 正常 0:不可用  -1删除
	private String remark;
	// Constructors
	/** default constructor */
	public BaseServerUrlVersion() {
	}
	/** minimal constructor */
	public BaseServerUrlVersion(String code, String name, Date createTime,
			Date updateTime) {
		this.code = code;
		this.name = name;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}
	/** full constructor */
	public BaseServerUrlVersion(String code, String saasId,
			String functionCode, String serverCode, String name,
			Integer versionInt, Date createTime, String createUser,
			String createUserName, Date updateTime, String updateUser,
			String updateUserName, Integer status, String remark) {
		this.code = code;
		this.saasId = saasId;
		this.functionCode = functionCode;
		this.serverCode = serverCode;
		this.name = name;
		this.versionInt = versionInt;
		this.createTime = createTime;
		this.createUser = createUser;
		this.createUserName = createUserName;
		this.updateTime = updateTime;
		this.updateUser = updateUser;
		this.updateUserName = updateUserName;
		this.status = status;
		this.remark = remark;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "function_code", length = 100)
	public String getFunctionCode() {
		return this.functionCode;
	}
	public void setFunctionCode(String functionCode) {
		this.functionCode = functionCode;
	}
	@Column(name = "server_code", length = 100)
	public String getServerCode() {
		return this.serverCode;
	}
	public void setServerCode(String serverCode) {
		this.serverCode = serverCode;
	}
	@Column(name = "name",  length = 100)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "version_int")
	public Integer getVersionInt() {
		return this.versionInt;
	}
	public void setVersionInt(Integer versionInt) {
		this.versionInt = versionInt;
	}
	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Column(name = "remark", length = 1500)
	public String getRemark() {
		return this.remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getFunctionName() {
		return functionName;
	}
	public void setFunctionName(String functionName) {
		this.functionName = functionName;
	}
	public String getServerName() {
		return serverName;
	}
	public void setServerName(String serverName) {
		this.serverName = serverName;
	}
}

+ 65 - 0
svr/svr-base/src/main/java/com/yihu/jw/version/model/BaseUserUrlVersion.java

@ -0,0 +1,65 @@
package com.yihu.jw.version.model;// default package
import com.yihu.jw.base.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * BaseUserUrlVersion entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "base_user_url_version")
public class BaseUserUrlVersion extends IdEntity implements java.io.Serializable {
	// Fields
	private String saasId;//saasid 关联 base_saas
	private String userCode;//关联用户
	private String bsvCode;//关联base_url_server_version code
	private Integer status;//1: 正常 0:不可用  -1删除
	// Constructors
	/** default constructor */
	public BaseUserUrlVersion() {
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "user_code", length = 100)
	public String getUserCode() {
		return this.userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	@Column(name = "bsv_code", length = 100)
	public String getBsvCode() {
		return this.bsvCode;
	}
	public void setBsvCode(String bsvCode) {
		this.bsvCode = bsvCode;
	}
	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
}

+ 108 - 0
svr/svr-base/src/main/java/com/yihu/jw/version/service/ServerUrlVersionService.java

@ -0,0 +1,108 @@
package com.yihu.jw.version.service;
import com.yihu.jw.base.model.base.Function;
import com.yihu.jw.base.service.base.FunctionService;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.CommonContants;
import com.yihu.jw.restmodel.exception.ApiException;
import com.yihu.jw.version.dao.ServerUrlVersionDao;
import com.yihu.jw.version.model.BaseServerUrlVersion;
import com.yihu.jw.version.model.BaseServerVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.List;
/**
 * Created by chenweida on 2017/6/20.
 */
@Service
public class ServerUrlVersionService extends BaseJpaService<BaseServerUrlVersion, ServerUrlVersionDao> {
     @Autowired
    private ServerUrlVersionDao serverUrlVersionDao;
    @Autowired
    private ServerVersionService serverVersionService;
    @Autowired
    private FunctionService functionService;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Transactional
    public BaseServerUrlVersion createBaseServerUrlVersion(BaseServerUrlVersion baseServerVersion) throws ApiException {
        if (StringUtils.isEmpty(baseServerVersion.getCode())) {
            throw new ApiException(BaseVersionContants.BaseServerUrlVersion.message_fail_code_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(baseServerVersion.getName())) {
            throw new ApiException(BaseVersionContants.BaseServerUrlVersion.message_fail_name_is_null, CommonContants.common_error_params_code);
        }
        BaseServerUrlVersion baseServerVersionTmp = serverUrlVersionDao.findByName(baseServerVersion.getName());
        if (baseServerVersionTmp != null) {
            throw new ApiException(BaseVersionContants.BaseServerUrlVersion.message_fail_name_exist, CommonContants.common_error_params_code);
        }
        return serverUrlVersionDao.save(baseServerVersion);
    }
    @Transactional
    public BaseServerUrlVersion updateBaseServerUrlVersion(BaseServerUrlVersion baseServerVersion) {
        if (StringUtils.isEmpty(baseServerVersion.getCode())) {
            throw new ApiException(BaseVersionContants.BaseServerUrlVersion.message_fail_code_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(baseServerVersion.getName())) {
            throw new ApiException(BaseVersionContants.BaseServerUrlVersion.message_fail_name_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(baseServerVersion.getId())) {
            throw new ApiException(BaseVersionContants.BaseServerUrlVersion.message_fail_id_is_null, CommonContants.common_error_params_code);
        }
        BaseServerUrlVersion baseServerVersionTmp = serverUrlVersionDao.findByNameExcludeCode(baseServerVersion.getName(), baseServerVersion.getCode());
        if (baseServerVersionTmp != null) {
            throw new ApiException(BaseVersionContants.BaseServerUrlVersion.message_fail_name_exist, CommonContants.common_error_params_code);
        }
        return serverUrlVersionDao.save(baseServerVersion);
    }
    public BaseServerUrlVersion findByCode(String code) {
        BaseServerUrlVersion baseServerVersion = serverUrlVersionDao.findByCode(code);
        if (baseServerVersion == null) {
            throw new ApiException(BaseVersionContants.BaseServerUrlVersion.message_fail_code_no_exist, CommonContants.common_error_params_code);
        }
        String serverCode = baseServerVersion.getServerCode();
        BaseServerVersion serverVersion = serverVersionService.findByCode(serverCode);
        String functionCode = baseServerVersion.getFunctionCode();
        Function function = functionService.findByCode(functionCode);
        baseServerVersion.setFunctionName(function.getName());
        baseServerVersion.setServerName(serverVersion.getName());
        return baseServerVersion;
    }
    @Transactional
    public void deleteBaseServerUrlVersion(String codes) {
        if(!StringUtils.isEmpty(codes)){
            for(String code:codes.split(",")){
                BaseServerUrlVersion baseServerVersion = serverUrlVersionDao.findByCode(code);
                if (baseServerVersion == null) {
                    continue;
                }
                baseServerVersion.setStatus(-1);
                serverUrlVersionDao.save(baseServerVersion);
            }
        }
    }
    /**
     * 通过serverCode查找
     * @param serverCode
     * @return
     */
    public List<BaseServerUrlVersion> findByServer(String serverCode){
        return serverUrlVersionDao.findByServer(serverCode);
    }
    @Transactional
    public void deleteByServer(String serverCode, String userName, String userCode) {
        serverUrlVersionDao.deleteByServer(serverCode,userName,userCode);
    }
}

+ 164 - 0
svr/svr-base/src/main/java/com/yihu/jw/version/service/UserUrlVersionService.java

@ -0,0 +1,164 @@
package com.yihu.jw.version.service;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.version.dao.ServerVersionLogDao;
import com.yihu.jw.version.dao.UserUrlVersionDao;
import com.yihu.jw.version.model.BaseServerVersion;
import com.yihu.jw.version.model.BaseServerVersionLog;
import com.yihu.jw.version.model.BaseUserUrlVersion;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
/**
 * Created by chenweida on 2017/6/20.
 */
@Service
public class UserUrlVersionService extends BaseJpaService<BaseUserUrlVersion, UserUrlVersionDao> {
    @Autowired
    private UserUrlVersionDao userUrlVersionDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private ServerVersionLogDao serverVersionLogDao;
    @Autowired
    private ServerVersionService serverVersionService;
    /**
     * 更改后台用户版本
     * @param serverCode (bsvCode)
     * @param userCodes (通过,分隔的userCode)
     * @param userCode //创建/修改人
     * @param userName//创建/修改人
     * @param saasId
     * @return
     */
    @Transactional
    public void changeUserVersion(String serverCode, String userCodes, String userCode, String userName, String saasId) {
        //通过serverCode,查找该版本信息
        BaseServerVersion baseServerVersionbyCode = serverVersionService.findByCode(serverCode);
        String[] user_codes = userCodes.split(",");
        List<String> userList = new ArrayList<String>();//现有版本的用户
        Collections.addAll(userList, user_codes);
        List<String> oldUserCodes = findByBsvCode(serverCode, saasId);//原有版本的用户
        List<String> _oldUserCodes = new ArrayList<String>(oldUserCodes);//构建该版本原有的用户  oldUserCodes
        _oldUserCodes.removeAll(userList);// 去除相同元素--->>需要删除的用户
        List<String> _newUserCodes = new ArrayList<String>(userList);//构建userList的副本
        _newUserCodes.removeAll(oldUserCodes);// 去除相同元素---->>需要添加 的权限
        //先删除 在添加...
        for(String delCode:_oldUserCodes){
            BaseUserUrlVersion userUrlVersion = findByUserCodeAndSaasId(delCode, saasId);
            userUrlVersion.setUpdateUser(userCode);
            userUrlVersion.setUpdateUserName(userName);
            userUrlVersion.setStatus(-1);
            userUrlVersionDao.save(userUrlVersion);
        }
        String deleteUserCodes = StringUtils.join(_oldUserCodes.toArray(), ",");
        //不为空,记录日志
        if(StringUtils.isNotBlank(deleteUserCodes)){
            BaseServerVersionLog serverVersionLog = new BaseServerVersionLog();
            serverVersionLog.setSaasId(saasId);
            serverVersionLog.setUserCodes(deleteUserCodes);
            serverVersionLog.setBsvCode(serverCode);
            serverVersionLog.setName(baseServerVersionbyCode.getName());
            serverVersionLog.setVersionInt(baseServerVersionbyCode.getVersionInt());
            serverVersionLog.setType(2);
            serverVersionLog.setStatus(1);
            serverVersionLog.setCreateUser(userCode);
            serverVersionLog.setCreateUserName(userName);
            serverVersionLog.setUpdateUser(userCode);
            serverVersionLog.setUpdateUserName(userName);
            serverVersionLog.setCode(UUID.randomUUID().toString().replaceAll("-",""));
            serverVersionLogDao.save(serverVersionLog);
        }
        for(String usercode:_newUserCodes){
            //同一个saasId下,usercode只能关联一个bsvCode(serverCode)
            BaseUserUrlVersion baseUserUrlVersion = findByUserCodeAndSaasId(usercode, saasId);
            if(baseUserUrlVersion!=null){
                //存在
                if(baseUserUrlVersion.getBsvCode().equals(serverCode)){
                    continue;
                }
                baseUserUrlVersion.setStatus(-1);
                baseUserUrlVersion.setUpdateUser(userCode);
                baseUserUrlVersion.setUpdateUserName(userName);
                userUrlVersionDao.save(baseUserUrlVersion);
            }
            BaseUserUrlVersion userUrlVersion = new BaseUserUrlVersion();
            userUrlVersion.setCode(UUID.randomUUID().toString().replaceAll("-",""));
            userUrlVersion.setSaasId(saasId);
            userUrlVersion.setBsvCode(serverCode);
            userUrlVersion.setUserCode(usercode);
            userUrlVersion.setStatus(1);
            userUrlVersion.setCreateUser(userCode);
            userUrlVersion.setCreateUserName(userName);
            userUrlVersion.setUpdateUser(userCode);
            userUrlVersion.setUpdateUserName(userName);
            userUrlVersionDao.save(userUrlVersion);
        }
        String updateUserCodes = StringUtils.join(_newUserCodes.toArray(), ",");
        //不为空,记录日志
        if(StringUtils.isNotBlank(updateUserCodes)){
            BaseServerVersionLog serverVersionLog = new BaseServerVersionLog();
            serverVersionLog.setSaasId(saasId);
            serverVersionLog.setUserCodes(updateUserCodes);
            serverVersionLog.setBsvCode(serverCode);
            serverVersionLog.setName(baseServerVersionbyCode.getName());
            serverVersionLog.setVersionInt(baseServerVersionbyCode.getVersionInt());
            serverVersionLog.setType(1);
            serverVersionLog.setStatus(1);
            serverVersionLog.setCreateUser(userCode);
            serverVersionLog.setCreateUserName(userName);
            serverVersionLog.setUpdateUser(userCode);
            serverVersionLog.setUpdateUserName(userName);
            serverVersionLog.setCode(UUID.randomUUID().toString().replaceAll("-",""));
            serverVersionLogDao.save(serverVersionLog);
        }
    }
    /**
     * 通过bsvCode,saasId查找已存在的userCode
     * @param bsvCode
     * @param saasId
     * @return
     */
    public  List<String> findByBsvCode(String bsvCode,String saasId){
        String sql = "select v.user_code from base_user_url_version v where v.status=1 and v.bsv_code=? and v.saas_id = ?";
        Object[] objs = new Object[2];
        objs[0] = bsvCode;
        objs[1] = saasId;
        List<String> userCodes = jdbcTemplate.queryForList(sql,objs,String.class);
        return userCodes;
    }
    /**
     * 通过两个参数,判断是否存在BaseUserUrlVersion,存在返回 BaseUserUrlVersion对象
     * 不存在,返回null
     * @param userCode
     * @param saasId
     * @return
     */
    public  BaseUserUrlVersion findByUserCodeAndSaasId(String userCode,String saasId){
        return userUrlVersionDao.findByBsvCodeAndSaasId(userCode, saasId);
    }
}

+ 129 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/CacheAdapter.java

@ -0,0 +1,129 @@
package com.yihu.jw.manage.adapter;
import com.yihu.jw.manage.adapter.cache.Cache;
import com.yihu.jw.manage.adapter.cache.MapCache;
import com.yihu.jw.manage.adapter.cache.RedisCache;
import com.yihu.jw.manage.adapter.cache.model.LoginCacheModel;
import com.yihu.jw.manage.adapter.cache.model.RoleCacheModel;
import com.yihu.jw.util.spring.SpringContext;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
 * Created by Administrator on 2017/7/3 0003.
 */
@Component
@Scope("singleton")
public class CacheAdapter{
    public final static String LOGIN = "login";//登陆模块的缓存是用户对象的LoginCacheModel字符串
    public final static String ROLE = "role";//url 缓存的是RoleCacheModel list的字符串
    /**
     * 1 内存 2 redis
     */
    @Value("${cache}")
    private String cacheKey;
    public String getCacheKey() {
        return cacheKey;
    }
    /**
     * 自动适配添加缓存
     *
     * @param module
     * @param key
     * @param value
     */
    public void setData(String module, String key, Object value) {
        String valStr = null;
        //对象转json字符串
        if(value instanceof List){
            valStr = JSONArray.fromObject(value).toString();
        }else{
            valStr =  JSONObject.fromObject(value).toString();
        }
        Cache cache = getCache();
        cache.setData(module, key, valStr);
    }
    /**
     * 根据模块,key值移除缓存
     * @param module
     * @param key
     * @throws Exception
     */
    public void removeData(String module,String key) throws Exception {
        Cache cache = getCache();
        cache.removeData(module, key);
    }
    /**
     * 自动适配获取缓存
     *
     * @param module
     * @param key
     * @return
     */
    public Object getData(String module, String key) {
        Cache cache = getCache();
        String joData = cache.getData(module, key);
        return getObject(module, joData);
    }
    /**
     *
     * @param module
     * @param pattern
     * @return
     */
    public Set<String> keys(String module,String pattern){
        Cache cache = getCache();
        return cache.keys(module,pattern);
    }
    /**
     * 获取缓存工具
     *
     * @return
     */
    private Cache getCache() {
        switch (cacheKey) {
            case "1": {
                return SpringContext.getService(MapCache.class);
            }
            case "2": {
                return SpringContext.getService(RedisCache.class);
            }
            default: {
                return SpringContext.getService(MapCache.class);
            }
        }
    }
    private Object getObject(String module, String joData) {
        switch (module) {
            case LOGIN: {
                return JSONObject.toBean(JSONObject.fromObject(joData), LoginCacheModel.class);
            }
            case ROLE: {
                List<RoleCacheModel> rcm=new ArrayList<>();
                JSONArray ja=JSONArray.fromObject(joData);
                ja.stream().forEach(one->{
                    rcm.add((RoleCacheModel) JSONObject.toBean(JSONObject.fromObject(one),RoleCacheModel.class));
                });
                return rcm;
            }
        }
        return null;
    }
}

+ 16 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/Cache.java

@ -0,0 +1,16 @@
package com.yihu.jw.manage.adapter.cache;
import java.util.Set;
/**
 * Created by Administrator on 2017/7/4 0004.
 */
public interface Cache {
    void setData(String module, String key, String value);
    String getData(String module, String key);
    Set<String> keys(String module,String pattern);
    void removeData(String module, String key) throws Exception;
}

+ 75 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/MapCache.java

@ -0,0 +1,75 @@
package com.yihu.jw.manage.adapter.cache;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
/**
 * Created by Administrator on 2017/7/3 0003.
 */
@Component
@Scope("singleton")
public class MapCache implements Cache {
    /**
     * 缓存的map,key是module value是对应model的缓存
     */
    private static Map<String, Map<String, String>> cacha = new HashMap<>();
    @Override
    public void setData(String module, String key, String value) {
        //获取map
        Map<String, String> map=cacha.get(module);
        if(map==null){
            map=new HashMap<>();
            cacha.put(module,map);
        }
        //放入缓存
        map.put(key,value);
    }
    @Override
    public String getData(String module, String key) {
        Map<String, String> map=cacha.get(module);
        if(map==null){
            return null;
        }
        return map.get(key);
    }
    /**
     * 通过正则,获取key值
     * @param module
     * @param pattern
     * @return
     */
    @Override
    public Set<String> keys(String module,String pattern) {
        Map<String, String> map=cacha.get(module);
        if(map==null){
            return null;
        }
        Set<String> keys = map.keySet();
        Set<String> newKeys = new HashSet<String>();
        for(String key:keys){
            if(Pattern.matches(pattern, key)){
                newKeys.add(key);
            }
        }
        return newKeys;
    }
    @Override
    public void removeData(String module, String key) throws Exception {
        Map<String, String> map=cacha.get(module);
        if(map==null){
            throw new Exception("this "+module+" does not exist cache");
        }
        map.remove(key);
    }
}

+ 67 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/RedisCache.java

@ -0,0 +1,67 @@
package com.yihu.jw.manage.adapter.cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.util.HashSet;
import java.util.Set;
/**
 * Created by Administrator on 2017/7/3 0003.
 */
@Component
@Scope("singleton")
public class RedisCache implements Cache {
    private static String redis_pre = "manage";
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Override
    public void setData(String module, String key, String value) {
        //获取key
        String redisKey=getKey(module,key);
        //把数据放入redis中
        redisTemplate.opsForValue().set(redisKey,value);
    }
    @Override
    public String getData(String module, String key) {
        //获取key
        String redisKey=getKey(module,key);
        //从redis中获取数据
        return redisTemplate.opsForValue().get(redisKey);
    }
    @Override
    public Set<String> keys(String module,String pattern) {
        pattern = pattern.replaceAll("\\.", "");
        String redisKey = getKey(module,pattern);
        Set<String> redisKeys = redisTemplate.keys(redisKey);
        Set<String> keys = new HashSet<>();
        for(String key:redisKeys){
            key = key.substring(8+module.length());
            keys.add(key);
        }
        return keys;
    }
    @Override
    public void removeData(String module, String key) throws Exception {
        String redisKey = getKey(module, key);
        redisTemplate.delete(redisKey);//根据key删除缓存
    }
    /**
     * 获取redis中的key
     * @param module
     * @param key
     * @return
     */
    private String getKey(String module, String key) {
        return new StringBuffer(redis_pre+":"+module+":"+key).toString();
    }
}

+ 25 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/model/LoginCacheModel.java

@ -0,0 +1,25 @@
package com.yihu.jw.manage.adapter.cache.model;
/**
 * Created by Administrator on 2017/7/4 0004.
 */
public class LoginCacheModel {
    private String code;//用户code
    private String saasId;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
}

+ 25 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/adapter/cache/model/RoleCacheModel.java

@ -0,0 +1,25 @@
package com.yihu.jw.manage.adapter.cache.model;
/**
 * Created by Administrator on 2017/7/4 0004.
 */
public class RoleCacheModel {
    private String url;
    private String method;
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getMethod() {
        return method;
    }
    public void setMethod(String method) {
        this.method = method;
    }
}

+ 41 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/aop/LogAspect.java

@ -0,0 +1,41 @@
package com.yihu.jw.manage.aop;
import com.yihu.jw.restmodel.gateway.GatewayContanrts;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
 * Created by chenweida on 2017/6/19.
 */
@Aspect
@Component
public class LogAspect {
    //Controller层切点
    @Pointcut("execution(* com.yihu.jw.manage..*.*(..))")
    public void controllerAspect() {
    }
    @Around("controllerAspect() && @annotation(com.yihu.jw.manage.aop.annotation.ManageLog)")
    public Object checkToken(ProceedingJoinPoint point) throws Throwable {
        ;
        Object o = null;
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        try {
             o = point.proceed();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return o;
    }
}

+ 13 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/aop/annotation/ManageLog.java

@ -0,0 +1,13 @@
package com.yihu.jw.manage.aop.annotation;
import java.lang.annotation.*;
/**
 * Created by chenweida on 2017/6/24.
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface ManageLog {
}

+ 113 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/base/FunctionController.java

@ -0,0 +1,113 @@
package com.yihu.jw.manage.controller.base;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.manage.service.base.FunctionService;
import com.yihu.jw.restmodel.base.base.BaseContants;
import com.yihu.jw.restmodel.base.base.MFunction;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/6/20.
 */
@RestController
@RequestMapping(BaseContants.api_common)
@Api(description = "功能管理")
public class FunctionController {
    @Autowired
    private FunctionService functionService;
    @GetMapping(BaseContants.Function.api_getList)
    @ApiOperation(value = "分页获取功能列表")
    public Map list(
            @ApiParam(name = "name", value = "功能名称", required = false) @RequestParam(required = false, name = "name") String name,
            @ApiParam(name = "saasId", value = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
            @ApiParam(name = "sorts", value = "排序", required = false) @RequestParam(required = false, name = "sorts") String sorts,
            @ApiParam(name = "start", value = "当前页", required = false) @RequestParam(required = false, name = "start", defaultValue = "1") Integer start,
            @ApiParam(name = "length", value = "每页显示条数", required = false) @RequestParam(required = false, name = "length", defaultValue = "10") Integer length
    ) {
        Map<String, Object> req = new HashMap<String, Object>();
        try {
            Map<String, String> map = new HashMap<>();
            map.put("name",name);
            map.put("saasId",saasId);
            map.put("sorts",sorts);
            Envelop envelop = functionService.list(length, start,map);
            List<Map<String,Object>> list = envelop.getDetailModelList();
            //数据返回
            req.put("rows", list);
            req.put("total",envelop.getTotalCount());
            return req;
        } catch (Exception e) {
            req.put("-1","获取信息失败"+e.getMessage());
            return req;
        }
    }
    @DeleteMapping(value = BaseContants.Function.api_delete)
    @ApiOperation(value = "通过codes删除,多个code用,分割", notes = "通过codes删除")
    public Envelop deleteByCodes(
            @ApiParam(name = "codes", value = "codes")
            @PathVariable String codes,
            @ApiParam(name = "userCode", value = "userCode")
            @RequestParam String userCode
    ) {
        Envelop envelop = functionService.deleteByCode(codes,userCode);
        return envelop;
    }
    @GetMapping(value = BaseContants.Function.api_getByCode)
    @ApiOperation(value = "根据code查找", notes = "根据code查找")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @PathVariable String code
    ) {
        Envelop envelop = functionService.findByCode(code);
        return envelop;
    }
    @GetMapping(value = BaseContants.Function.api_getChildren)
    @ApiOperation(value = "查找子节点", notes = "查找子节点")
    public List<Map<String,Object>> getChildren(@PathVariable String code){
        Envelop envelop = functionService.getChildren(code);
        if(envelop.getObj()==null){
            return new ArrayList<>();
        }
        return (List)envelop.getObj();
    }
    @PostMapping(BaseContants.Function.api_create)
    @ApiOperation(value = "保存/更新", notes = "保存/更新")
    public Envelop saveOrUpdate(@ModelAttribute @Valid MFunction func,String userCode) throws JsonProcessingException {
        return functionService.saveOrUpdate(func,userCode);
    }
    @GetMapping(BaseContants.Function.api_getListNoPage)
    @ApiOperation(value = "获取功能列表")
    public List getListNoPage(@ApiParam(name = "saasId", value = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
                              @ApiParam(name = "parentCode", value = "parentCode", required = false) @RequestParam(required = false, name = "parentCode") String parentCode
    ) {
        Map<String, Object> req = new HashMap<String, Object>();
        Map<String, String> map = new HashMap<>();
        map.put("saasId",saasId);
        map.put("parentCode",parentCode);
        Envelop envelop = functionService.getListNoPage(map);
        List<Map<String,Object>> list = envelop.getDetailModelList();
        return list;
    }
}

+ 125 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/base/ModuleController.java

@ -0,0 +1,125 @@
package com.yihu.jw.manage.controller.base;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.manage.service.base.ModuleService;
import com.yihu.jw.restmodel.base.base.BaseContants;
import com.yihu.jw.restmodel.base.base.MModule;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/6/20.
 */
@RestController
@RequestMapping(BaseContants.api_common)
@Api(description = "模块管理")
public class ModuleController {
    @Autowired
    private ModuleService moduleService;
    @GetMapping(BaseContants.Module.api_getList)
    @ApiOperation(value = "分页获取模块列表")
    public Map list(
            @ApiParam(name = "name", value = "模块名称", required = false) @RequestParam(required = false, name = "name") String name,
            @ApiParam(name = "saasId", value = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
            @ApiParam(name = "sorts", value = "排序", required = false) @RequestParam(required = false, name = "sorts") String sorts,
            @ApiParam(name = "start", value = "当前页", required = false) @RequestParam(required = false, name = "start", defaultValue = "1") Integer start,
            @ApiParam(name = "length", value = "每页显示条数", required = false) @RequestParam(required = false, name = "length", defaultValue = "10") Integer length
    ) {
        Map<String, Object> req = new HashMap<String, Object>();
        try {
            Map<String, String> map = new HashMap<>();
            map.put("name",name);
            map.put("saasId",saasId);
            map.put("sorts",sorts);
            Envelop envelop = moduleService.list(length, start,map);
            List<Map<String,Object>> list = envelop.getDetailModelList();
            //数据返回
            req.put("rows", list);
            req.put("total",envelop.getTotalCount());
            return req;
        } catch (Exception e) {
            req.put("-1","获取信息失败"+e.getMessage());
            return req;
        }
    }
    @DeleteMapping(value = BaseContants.Module.api_delete)
    @ApiOperation(value = "通过codes删除,多个code用,分割", notes = "通过codes删除")
    public Envelop deleteByCodes(
            @ApiParam(name = "codes", value = "codes")
            @PathVariable String codes,
            @ApiParam(name = "userCode", value = "userCode")
            @RequestParam String userCode
    ) {
        Envelop envelop = moduleService.deleteByCode(codes,userCode);
        return envelop;
    }
    @GetMapping(value = BaseContants.Module.api_getByCode)
    @ApiOperation(value = "根据code查找", notes = "根据code查找")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @PathVariable String code
    ) {
        Envelop envelop = moduleService.findByCode(code);
        return envelop;
    }
    @GetMapping(value = BaseContants.Module.api_getChildren)
    @ApiOperation(value = "查找子节点", notes = "查找子节点")
    public List<Map<String,Object>> getChildren(@PathVariable String code){
        Envelop envelop = moduleService.getChildren(code);
        if(envelop.getObj()==null){
            return new ArrayList<>();
        }
        return (List)envelop.getObj();
    }
    @PostMapping(BaseContants.Module.api_create)
    @ApiOperation(value = "保存/更新", notes = "保存/更新")
    public Envelop saveOrUpdate(@ModelAttribute @Valid MModule module,String userCode) throws JsonProcessingException {
        return moduleService.saveOrUpdate(module,userCode);
    }
    @GetMapping(BaseContants.Module.api_getListNoPage)
    @ApiOperation(value = "获取模块列表")
    public List getListNoPage(@ApiParam(name = "saasId", value = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId) {
        Map<String, Object> req = new HashMap<String, Object>();
        Map<String, String> map = new HashMap<>();
        map.put("saasId",saasId);
        Envelop envelop = moduleService.getListNoPage(map);
        List<Map<String,Object>> list = envelop.getDetailModelList();
        return list;
    }
    @GetMapping(BaseContants.ModuleFun.api_getExistFun)
    @ApiOperation(value = "获取已经存在功能")
    public List<String> getExistFun(@ApiParam(name = "code", value = "模块code", required = true) @PathVariable(required = true, name = "code") String code){
        List<String> funcs = moduleService.getExistFun(code);
        return funcs;
    }
    @PutMapping(value = BaseContants.ModuleFun.api_changeFun)
    @ApiOperation(value = "模块更新功能")
    public Envelop changeFun (@RequestParam String funCodes,
                              @RequestParam String moduleCode) {
        moduleService.changeFun(moduleCode, funCodes);
        return Envelop.getSuccess("更新成功", null);
    }
}

+ 61 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/doctorManage/DoctorController.java

@ -0,0 +1,61 @@
package com.yihu.jw.manage.controller.doctorManage;
import com.yihu.jw.restmodel.doctorManage.DoctorContants;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Administrator on 2017/6/13 0013.
 */
@RestController
@RequestMapping(DoctorContants.api_common)
@Api(description = "医生管理")
public class DoctorController {
/*    @Autowired
    private DoctorService doctorService;*/
   /* @GetMapping(DoctorContants.Doctor.api_getList)
    @ApiOperation(value = "分页获取医生列表")
    public Envelop list(
            @ApiParam(name = "name", value = "医生姓名", required = false) @RequestParam(required = false, name = "name") String name,
            @ApiParam(name = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
            @ApiParam(name = "sorts", value = "排序", required = false) @RequestParam(required = false, name = "sorts") String sorts,
            @ApiParam(name = "start", value = "当前页", required = false) @RequestParam(required = false, name = "start", defaultValue = "1") Integer start,
            @ApiParam(name = "length", value = "每页显示条数", required = false) @RequestParam(required = false, name = "length", defaultValue = "10") Integer length
    ) {
        try {
            start=start/length+1;
            Map<String,String> map = new HashMap<String,String>();
            map.put("saasId",saasId);
            map.put("sorts",sorts);
            Envelop envelop = doctorService.list(length, start,map);
            return envelop;
        } catch (Exception e) {
            return Envelop.getError("获取信息失败:" + e.getMessage(), -1);
        }
    }*/
   /* @GetMapping(value = "/wechatConfig/{code}")
    @ApiOperation(value = "根据code查找微信配置", notes = "根据code查找微信配置")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
           @PathVariable String code
    ) {
        Envelop envelop = doctorService.findByCode(code);
        return envelop;
    }
    @GetMapping("wechatConfig/listNoPage")
    @ApiOperation(value = "获取微信配置列表")
    public Envelop listNoPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,name,saasId,appId,appSecret,baseUrl,remark")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts){
        return doctorService.getListNoPage(fields,null,sorts);
    }*/
}

+ 51 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/system/MenuRoleController.java

@ -0,0 +1,51 @@
package com.yihu.jw.manage.controller.system;
import com.yihu.jw.manage.service.system.MenuRoleService;
import com.yihu.jw.manage.service.system.MenuService;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("manage")
@Api(description = "管理系统角色-权限关系")
public class MenuRoleController {
    @Autowired
    private MenuRoleService menuRoleService;
    @Autowired
    private MenuService menuService;
    @GetMapping("menuRole/change")
    @ApiOperation(value = "更新权限")
    public Envelop changeMenuRole(
            @ApiParam(name = "roleCode", value = "roleCode", required = true) @RequestParam(required = true, name = "roleCode") String roleCode,
            @ApiParam(name = "menuCodes", value = "menuCodes", required = true) @RequestParam(required = true, name = "menuCodes") String menuCodes){
        menuRoleService.changeMenuRole(roleCode, menuCodes);
        return Envelop.getSuccess("更新成功",null);
    }
    @GetMapping("menuRole/getMenuRoles")
    @ApiOperation(value = "获取已经存在的权限")
    public List<String> getMenuRoles(@ApiParam(name = "roleCode", value = "roleCode", required = true) @RequestParam(required = true, name = "roleCode") String roleCode){
        List<String> roles = menuRoleService.getMenuRoles(roleCode);
        return roles;
    }
    @GetMapping("menuRole/reloadPrivilege")
    @ApiOperation(value = "更新缓存中的权限")
    public void reloadPrivilege(){
        menuRoleService.reloadPrivilege();
    }
}

File diff suppressed because it is too large
+ 1 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/system/UserRoleController.java


+ 95 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/version/ServerUrlVersionController.java

@ -0,0 +1,95 @@
package com.yihu.jw.manage.controller.version;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.manage.model.version.BaseServerUrlVersion;
import com.yihu.jw.manage.service.version.ServerUrlVersionService;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/6/20.
 */
@RestController
@RequestMapping(BaseVersionContants.api_common)
@Api(description = "服务端版本管理")
public class ServerUrlVersionController {
    @Autowired
    private ServerUrlVersionService serverUrlVersionService;
    @GetMapping(BaseVersionContants.BaseServerUrlVersion.api_getList)
    @ApiOperation(value = "分页获取服务端版本列表")
    public Envelop list(
            @ApiParam(name = "name", value = "版本名称", required = false) @RequestParam(required = false, name = "name") String name,
            @ApiParam(name = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
            @ApiParam(name = "sorts", value = "排序", required = false) @RequestParam(required = false, name = "sorts") String sorts,
            @ApiParam(name = "start", value = "当前页", required = false) @RequestParam(required = false, name = "start", defaultValue = "1") Integer start,
            @ApiParam(name = "length", value = "每页显示条数", required = false) @RequestParam(required = false, name = "length", defaultValue = "10") Integer length
    ) {
        try {
            Map<String, String> map = new HashMap<>();
            map.put("name",name);
            map.put("sorts",sorts);
            map.put("saasId",saasId);
            Envelop envelop = serverUrlVersionService.list(length, start,map);
            return envelop;
        } catch (Exception e) {
            return Envelop.getError("获取信息失败:" + e.getMessage(), -1);
        }
    }
    @GetMapping(BaseVersionContants.BaseServerUrlVersion.api_getListNoPage)
    @ApiOperation(value = "获取服务端版本列表(不分页)")
    public List<Map<String,Object>> getListNoPage(
            @ApiParam(name = "serverCode", value = "后台版本code", required = false) @RequestParam(required = false, name = "serverCode") String serverCode,
            @ApiParam(name = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
            @ApiParam(name = "sorts", value = "排序", required = false) @RequestParam(required = false, name = "sorts") String sorts
    ) {
        Map<String, String> map = new HashMap<>();
        map.put("serverCode",serverCode);
        map.put("sorts",sorts);
        map.put("saasId",saasId);
        Envelop envelop = serverUrlVersionService.getListNoPage(map);
        List list = envelop.getDetailModelList();
        return list;
    }
    @DeleteMapping(value = "/serverUrl/{codes}")
    @ApiOperation(value = "通过codes删除,多个code用,分割", notes = "通过codes删除")
    public Envelop deleteByCodes(
            @ApiParam(name = "codes", value = "codes")
            @PathVariable String codes,
            @ApiParam(name = "userCode", value = "userCode")
            @RequestParam String userCode
    ) {
        Envelop envelop = serverUrlVersionService.deleteByCode(codes,userCode);
        return envelop;
    }
    @GetMapping(value = "/serverUrl/{code}")
    @ApiOperation(value = "根据code查找服务端版本", notes = "根据code查找服务端版本")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @PathVariable String code
    ) {
        Envelop envelop = serverUrlVersionService.findByCode(code);
        return envelop;
    }
    @PostMapping(BaseVersionContants.BaseServerUrlVersion.api_create)
    @ApiOperation(value = "保存/更新服务端版本", notes = "保存/更新服务端版本")
    public Envelop saveOrUpdate(@ModelAttribute @Valid BaseServerUrlVersion version,String userCode) throws JsonProcessingException {
        return serverUrlVersionService.saveOrUpdate(version,userCode);
    }
}

+ 99 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/version/ServerVersionController.java

@ -0,0 +1,99 @@
package com.yihu.jw.manage.controller.version;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.manage.model.version.BaseServerVersion;
import com.yihu.jw.manage.service.version.ServerVersionService;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/6/20.
 */
@RestController
@RequestMapping(BaseVersionContants.api_common)
@Api(description = "服务端版本管理")
public class ServerVersionController {
    @Autowired
    private ServerVersionService serverVersionService;
    @GetMapping(BaseVersionContants.BaseServerVersion.api_getList)
    @ApiOperation(value = "分页获取服务端版本列表")
    public Map<String,Object> list(
            @ApiParam(name = "name", value = "版本名称", required = false) @RequestParam(required = false, name = "name") String name,
            @ApiParam(name = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
            @ApiParam(name = "sorts", value = "排序", required = false) @RequestParam(required = false, name = "sorts") String sorts,
            @ApiParam(name = "start", value = "当前页", required = false) @RequestParam(required = false, name = "start", defaultValue = "1") Integer start,
            @ApiParam(name = "length", value = "每页显示条数", required = false) @RequestParam(required = false, name = "length", defaultValue = "10") Integer length
    ) {
        Map<String, Object> req = new HashMap<String, Object>();
        try {
            Map<String, String> map = new HashMap<>();
            map.put("name",name);
            map.put("sorts",sorts);
            map.put("saasId",saasId);
            Envelop envelop = serverVersionService.list(length, start,map);
            List list = envelop.getDetailModelList();
            //数据返回
            req.put("rows",list);
            req.put("total",envelop.getTotalCount());
            return req;
        } catch (Exception e) {
            req.put("获取信息失败:" + e.getMessage(), -1);
            return req;
        }
    }
    @DeleteMapping(value = "/serverVersion/{codes}")
    @ApiOperation(value = "通过codes删除,多个code用,分割", notes = "通过codes删除")
    public Envelop deleteByCodes(
            @ApiParam(name = "codes", value = "codes")
            @PathVariable String codes,
            @ApiParam(name = "userCode", value = "userCode")
            @RequestParam String userCode
    ) {
        Envelop envelop = serverVersionService.deleteByCode(codes,userCode);
        return envelop;
    }
    @GetMapping(value = "/serverVersion/{code}")
    @ApiOperation(value = "根据code查找服务端版本", notes = "根据code查找服务端版本")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @PathVariable String code
    ) {
        Envelop envelop = serverVersionService.findByCode(code);
        return envelop;
    }
    @PostMapping(BaseVersionContants.BaseServerVersion.api_create)
    @ApiOperation(value = "保存/更新服务端版本", notes = "保存/更新服务端版本")
    public Envelop saveOrUpdate(@ModelAttribute @Valid BaseServerVersion baseServerVersion,String userCode) throws JsonProcessingException {
        return serverVersionService.saveOrUpdate(baseServerVersion,userCode);
    }
    @GetMapping(BaseVersionContants.BaseServerVersion.api_getListNoPage)
    @ApiOperation(value = "获取服务端版本列表")
    public List getListNoPage(@ApiParam(name = "saasId", value = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId) {
        Map<String, Object> req = new HashMap<String, Object>();
        Map<String, String> map = new HashMap<>();
        map.put("saasId",saasId);
        Envelop envelop = serverVersionService.getListNoPage(map);
        List<Map<String,Object>> list = envelop.getDetailModelList();
        return list;
    }
}

+ 56 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/version/UserUrlVersionController.java

@ -0,0 +1,56 @@
package com.yihu.jw.manage.controller.version;
import com.yihu.jw.manage.service.version.UserUrlVersionService;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/6/20.
 */
@RestController
@RequestMapping(BaseVersionContants.api_common)
@Api(description = "app版本管理")
public class UserUrlVersionController {
    @Autowired
    private UserUrlVersionService userUrlVersionService;
    @GetMapping(BaseVersionContants.UserUrlVersion.api_getListNoPage)
    @ApiOperation(value = "获取后台用户版本列表")
    public List getListNoPage(@ApiParam(name = "saasId", value = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
                              @ApiParam(name = "bsvCode", value = "bsvCode", required = false) @RequestParam(required = false, name = "bsvCode") String bsvCode) {
        Map<String, Object> req = new HashMap<String, Object>();
        Map<String, String> map = new HashMap<>();
        map.put("saasId",saasId);
        map.put("bsvCode",bsvCode);
        Envelop envelop = userUrlVersionService.getListNoPage(map);
        List<Map<String,Object>> list = envelop.getDetailModelList();
        if(list==null){
            return  new ArrayList<>();
        }
        return list;
    }
    @GetMapping(BaseVersionContants.UserUrlVersion.api_changeUserVersion)
    @ApiOperation(value = "更改后台用户版本")
    public Envelop changeUserVersion(@RequestParam(value="serverCode") String serverCode,@RequestParam(value="userCodes")String userCodes,@RequestParam(value="userCode")String userCode,@RequestParam(value="saasId")String saasId){
        Envelop envelop = userUrlVersionService.changeUserVersion(serverCode,userCodes,userCode,saasId);
        return envelop;
    }
}

+ 78 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/version/WlyyVersionController.java

@ -0,0 +1,78 @@
package com.yihu.jw.manage.controller.version;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.manage.model.version.WlyyVersion;
import com.yihu.jw.manage.service.version.WlyyVersionService;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by chenweida on 2017/6/20.
 */
@RestController
@RequestMapping(BaseVersionContants.api_common)
@Api(description = "app版本管理")
public class WlyyVersionController {
    @Autowired
    private WlyyVersionService wlyyVersionService;
    @GetMapping(BaseVersionContants.WlyyVersion.api_getList)
    @ApiOperation(value = "分页获取app版本列表")
    public Envelop list(
            @ApiParam(name = "name", value = "版本名称", required = false) @RequestParam(required = false, name = "name") String name,
            @ApiParam(name = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
            @ApiParam(name = "sorts", value = "排序", required = false) @RequestParam(required = false, name = "sorts") String sorts,
            @ApiParam(name = "start", value = "当前页", required = false) @RequestParam(required = false, name = "start", defaultValue = "1") Integer start,
            @ApiParam(name = "length", value = "每页显示条数", required = false) @RequestParam(required = false, name = "length", defaultValue = "10") Integer length
    ) {
        try {
            Map<String, String> map = new HashMap<>();
            map.put("name",name);
            map.put("sorts",sorts);
            map.put("saasId",saasId);
            Envelop envelop = wlyyVersionService.list(length, start,map);
            return envelop;
        } catch (Exception e) {
            return Envelop.getError("获取信息失败:" + e.getMessage(), -1);
        }
    }
    @DeleteMapping(value = "/wlyyVersion/{codes}")
    @ApiOperation(value = "通过codes删除,多个code用,分割", notes = "通过codes删除")
    public Envelop deleteByCodes(
            @ApiParam(name = "codes", value = "codes")
            @PathVariable String codes,
            @ApiParam(name = "userCode", value = "userCode")
            @RequestParam String userCode
    ) {
        Envelop envelop = wlyyVersionService.deleteByCode(codes,userCode);
        return envelop;
    }
    @GetMapping(value = "/wlyyVersion/{code}")
    @ApiOperation(value = "根据code查找app版本", notes = "根据code查找app版本")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @PathVariable String code
    ) {
        Envelop envelop = wlyyVersionService.findByCode(code);
        return envelop;
    }
    @PostMapping(BaseVersionContants.WlyyVersion.api_create)
    @ApiOperation(value = "保存/更新服务端版本", notes = "保存/更新服务端版本")
    public Envelop saveOrUpdate(@ModelAttribute @Valid WlyyVersion version,String userCode) throws JsonProcessingException {
        return wlyyVersionService.saveOrUpdate(version,userCode);
    }
}

+ 93 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/wechat/TemplateController.java

@ -0,0 +1,93 @@
package com.yihu.jw.manage.controller.wechat;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.manage.service.wechat.TemplateService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.wx.MWxTemplate;
import com.yihu.jw.restmodel.wx.WechatContants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
@RestController
@RequestMapping(WechatContants.api_common)
@Api(description = "微信模板消息管理")
public class TemplateController {
    @Autowired
    private TemplateService templateService;
    @GetMapping(WechatContants.WxTemplate.api_getWxTemplates)
    @ApiOperation(value = "分页获取微信模板消息列表")
    public Map<String,Object> list(
            @ApiParam(name = "name", value = "微信名", required = false) @RequestParam(required = false, name = "name") String name,
            @ApiParam(name = "saasId",  required = false) @RequestParam(required = false, name = "saasId") String saasId,
            @ApiParam(name = "sorts", value = "排序", required = false) @RequestParam(required = false, name = "sorts") String sorts,
            @ApiParam(name = "start", value = "当前页", required = false) @RequestParam(required = false, name = "start", defaultValue = "1") Integer start,
            @ApiParam(name = "length", value = "每页显示条数", required = false) @RequestParam(required = false, name = "length", defaultValue = "10") Integer length
    ) {
        start=start/length+1;
        Map<String, String> map = new HashMap<>();
        map.put("sorts",sorts);
        map.put("name",name);
        map.put("saasId",saasId);
        Envelop envelop = templateService.list(length, start,map);
        List list = envelop.getDetailModelList();
        //数据返回
        Map<String, Object> req = new HashMap<String, Object>();
        req.put("rows",list);
        req.put("total",envelop.getTotalCount());
        return req;
    }
    @DeleteMapping(value = WechatContants.WxTemplate.api_delete)
    @ApiOperation(value = "通过codes删除,多个code用,分割", notes = "通过codes删除")
    public Envelop deleteByCodes(
            @ApiParam(name = "codes", value = "codes")
            @PathVariable String codes,
            @ApiParam(name = "userCode", value = "userCode")
            @RequestParam String userCode
    ) {
        Envelop envelop = templateService.deleteByCode(codes,userCode);
        return envelop;
    }
    @GetMapping(value = WechatContants.WxTemplate.api_getByCode)
    @ApiOperation(value = "根据code查找模板消息", notes = "根据code查找模板消息")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @PathVariable String code
    ) {
        Envelop envelop = templateService.findByCode(code);
        return envelop;
    }
    @PostMapping(value = WechatContants.WxTemplate.api_create)
    @ApiOperation(value = "保存或者修改微信模板消息", notes = "保存或者修改微信模板消息")
    public Envelop saveOrUpdate(@ModelAttribute @Valid MWxTemplate template,@RequestParam String userCode) throws JsonProcessingException {
        Envelop envelop = templateService.saveOrUpdate(template,userCode);
        return envelop;
    }
    @GetMapping(value = WechatContants.WxTemplate.api_getWxTemplatesNoPage)
    @ApiOperation(value = "获取列表(不分页)", notes = "获取列表(不分页)")
    public List getListNoPage(
            @ApiParam(name = "wechatCode", value = "wechatCode")
            @RequestParam String wechatCode
    ){
        Map<String, String> filter = new HashMap<>();
        filter.put("wechatCode",wechatCode);
        Envelop envelop = templateService.getListNoPage(filter);
        List list = envelop.getDetailModelList();
        return list;
    }
}

+ 116 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/controller/wechat/WechatMenuController.java

@ -0,0 +1,116 @@
package com.yihu.jw.manage.controller.wechat;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.manage.service.wechat.WechatMenuService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.wx.MWxMenu;
import com.yihu.jw.restmodel.wx.WechatContants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(WechatContants.api_common)
@Api(description = "微信菜单管理")
public class WechatMenuController {
    @Autowired
    private WechatMenuService menuService;
    @GetMapping(value=WechatContants.WxMenu.api_getWxMenus)
    @ApiOperation(value = "分页获取微信菜单列表")
    public Map<String,Object> list(
            @ApiParam(name = "name", value = "菜单名", required = false) @RequestParam(required = false, name = "name") String name,
            @ApiParam(name = "saasId", required = false) @RequestParam(required = false, name = "saasId") String saasId,
            @ApiParam(name = "page", value = "当前页", required = false) @RequestParam(required = false, name = "page", defaultValue = "1") Integer page,
            @ApiParam(name = "rows", value = "每页显示条数", required = false) @RequestParam(required = false, name = "rows", defaultValue = "10") Integer rows
    ) {
        Map<String, String> map = new HashMap<>();
        map.put("name",name);
        map.put("saasId",saasId);
        Envelop envelop = menuService.list(rows, page,map);
        List list = envelop.getDetailModelList();
        //数据返回
        Map<String, Object> req = new HashMap<String, Object>();
        req.put("rows",list);
        req.put("total",envelop.getTotalCount());
        return req;
    }
    @DeleteMapping(value = "/menu/{codes}")
    @ApiOperation(value = "通过codes删除,多个code用,分割", notes = "通过codes删除")
    public Envelop deleteByCodes(
            @ApiParam(name = "codes", value = "codes")
            @PathVariable String codes,
            @ApiParam(name = "userCode", value = "userCode")
            @RequestParam String userCode
    ) {
        Envelop envelop = menuService.deleteByCode(codes,userCode);
        return envelop;
    }
    @GetMapping(value = WechatContants.WxMenu.api_getByCode)
    @ApiOperation(value = "根据code查找菜单", notes = "根据code查找菜单")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @PathVariable String code
    ) {
        Envelop envelop = menuService.findByCode(code);
        Map map = (Map) envelop.getObj();
        String supMenucode = map.get("supMenucode")+"";
        if(supMenucode.equals("null")||supMenucode.equals("")){//说明是父菜单,查询是否有子菜单
            Envelop envelop1 = menuService.getChildMenus(map.get("code").toString());
            List list = (List)envelop1.getObj();
            if(list!=null&&list.size()>0){
                map.put("haveChildMenus",true);
                return envelop;
            }
        }
        map.put("haveChildMenus",false);
        return envelop;
    }
    @PostMapping(value = WechatContants.WxMenu.api_create)
    @ApiOperation(value = "保存或者修改微信菜单", notes = "保存或者修改微信菜单")
    public Envelop saveOrUpdate(@ModelAttribute @Valid MWxMenu menu,@RequestParam String userCode) throws JsonProcessingException {
        Envelop envelop = menuService.saveOrUpdate(menu,userCode);
        return envelop;
    }
    @GetMapping(value = WechatContants.WxMenu.api_getParentMenu)
    @ApiOperation(value = "根据微信code查找父菜单", notes = "根据微信code查找父菜单")
    public List getParentMenu(
            @ApiParam(name = "wechatCode", value = "wechatCode")
            @PathVariable String wechatCode
    ){
        Envelop envelop = menuService.getParentMenu(wechatCode);
        Object obj = envelop.getObj();
        if(obj==null){
            return new ArrayList<>();
        }
        return (List)obj;
    }
    @GetMapping(WechatContants.WxMenu.api_getChildMenus)
    @ApiOperation(value = "根据父菜单code获取子菜单")
    public List getChildMenus(
            @ApiParam(name = "parentCode", value = "parentCode")
            @PathVariable String parentCode){
        Envelop childMenus = menuService.getChildMenus(parentCode);
        Object obj = childMenus.getObj();
        if(obj==null){
            return new ArrayList<>();
        }
        return (List)obj;
    }
}

+ 26 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/dao/system/MenuUrlDao.java

@ -0,0 +1,26 @@
package com.yihu.jw.manage.dao.system;
import com.yihu.jw.manage.model.system.ManageMenu;
import com.yihu.jw.manage.model.system.ManageMenuUrl;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * Created by Administrator on 2017/7/3 0003.
 */
public interface MenuUrlDao extends PagingAndSortingRepository<ManageMenuUrl, Long>, JpaSpecificationExecutor<ManageMenu> {
    @Query("from  ManageMenuUrl m where m.menuCode = ?1")
    List<ManageMenuUrl> getListByMenuCode(String menuCode);
    @Transactional
    @Modifying
    @Query("delete ManageMenuUrl m where m.menuCode = ?1")
    void delete(String menuCode);
}

+ 119 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/model/base/Function.java

@ -0,0 +1,119 @@
package com.yihu.jw.manage.model.base;// default package
import com.yihu.jw.manage.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;
/**
 * WlyyFunction entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "base_function")
public class Function extends IdEntity implements java.io.Serializable {
	// Fields
	private String name; //功能名称
	private String saasId; // saasid
	private String parentCode; //父功能code
	private Integer status; //状态 -1 删除 0 禁用 可用
	private String url;//功能对应的后台url路径
	private String remark; //备注
	@Transient
	private String state ;   //closed:表示有子节点   open:表示没有子节点
	@Transient
	private List<Function> children = new ArrayList<>();
	// Constructors
	/** default constructor */
	public Function() {
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name = "code", length = 100)
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	@Column(name = "name", length = 200)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "parent_code", length = 100)
	public String getParentCode() {
		return this.parentCode;
	}
	public void setParentCode(String parentCode) {
		this.parentCode = parentCode;
	}
	@Column(name = "status", precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Column(name = "remark", length = 1000)
	public String getRemark() {
		return this.remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public List<Function> getChildren() {
		return children;
	}
	public void setChildren(List<Function> children) {
		this.children = children;
	}
}

+ 65 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/model/system/ManageMenuUrl.java

@ -0,0 +1,65 @@
package com.yihu.jw.manage.model.system;
import javax.persistence.*;
/**
 * Created by Administrator on 2017/7/3 0003.
 */
@Entity
@Table(name = "manage_menu_url")
public class ManageMenuUrl {
    private Long id;
    private String code;
    private String menuCode;
    private String url;
    private String method;
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Id
    @Column(name = "id")
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "menu_code")
    public String getMenuCode() {
        return menuCode;
    }
    public void setMenuCode(String menuCode) {
        this.menuCode = menuCode;
    }
    
    @Column(name = "url")
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    
    @Column(name = "method")
    public String getMethod() {
        return method;
    }
    public void setMethod(String method) {
        this.method = method;
    }
}

+ 127 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/BaseServerUrlVersion.java

@ -0,0 +1,127 @@
package com.yihu.jw.manage.model.version;// default package
import com.yihu.jw.manage.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * BaseServerUrlVersion entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "base_server_url_version")
public class BaseServerUrlVersion extends IdEntity implements java.io.Serializable {
	// Fields
	private String saasId;
	private String functionCode;//关联功能表 base_function code
	private String serverCode;//关联 base_server_version code
	private String name;//版本名称
	private Integer versionInt;//数字版本号
	private Integer status;//1: 正常 0:不可用  -1删除
	private String remark;
	// Constructors
	/** default constructor */
	public BaseServerUrlVersion() {
	}
	/** minimal constructor */
	public BaseServerUrlVersion(String code, String name, Date createTime,
			Date updateTime) {
		this.code = code;
		this.name = name;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}
	/** full constructor */
	public BaseServerUrlVersion(String code, String saasId,
			String functionCode, String serverCode, String name,
			Integer versionInt, Date createTime, String createUser,
			String createUserName, Date updateTime, String updateUser,
			String updateUserName, Integer status, String remark) {
		this.code = code;
		this.saasId = saasId;
		this.functionCode = functionCode;
		this.serverCode = serverCode;
		this.name = name;
		this.versionInt = versionInt;
		this.createTime = createTime;
		this.createUser = createUser;
		this.createUserName = createUserName;
		this.updateTime = updateTime;
		this.updateUser = updateUser;
		this.updateUserName = updateUserName;
		this.status = status;
		this.remark = remark;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "function_code", length = 100)
	public String getFunctionCode() {
		return this.functionCode;
	}
	public void setFunctionCode(String functionCode) {
		this.functionCode = functionCode;
	}
	@Column(name = "server_code", length = 100)
	public String getServerCode() {
		return this.serverCode;
	}
	public void setServerCode(String serverCode) {
		this.serverCode = serverCode;
	}
	@Column(name = "name", nullable = false, length = 10)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "version_int")
	public Integer getVersionInt() {
		return this.versionInt;
	}
	public void setVersionInt(Integer versionInt) {
		this.versionInt = versionInt;
	}
	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Column(name = "remark", length = 1500)
	public String getRemark() {
		return this.remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
}

+ 202 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/BaseServerVersion.java

@ -0,0 +1,202 @@
package com.yihu.jw.manage.model.version;// default package
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import javax.persistence.*;
import java.util.Date;
/**
 * BaseServerVersion entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "base_server_version")
public class BaseServerVersion  {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	protected Long id;  // 非业务主键
	@Column(name="code")
	protected String code;
	@CreatedDate
	@Column(name = "create_time", nullable = false, length = 0,updatable = false)
	protected Date createTime;
	@CreatedBy
	@Column(name = "create_user",updatable = false)
	protected String createUser;
	@CreatedBy
	@Column(name = "create_user_name",updatable = false)
	protected String createUserName;
	@LastModifiedDate
	@Column(name = "update_time", nullable = false, length = 0)
	protected Date updateTime;
	@LastModifiedBy
	@Column(name = "update_user", length = 100)
	protected String updateUser;
	@LastModifiedBy
	@Column(name = "update_user_name", length = 50)
	protected String updateUserName;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public String getCreateUserName() {
		return createUserName;
	}
	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	public String getUpdateUser() {
		return updateUser;
	}
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
	public String getUpdateUserName() {
		return updateUserName;
	}
	public void setUpdateUserName(String updateUserName) {
		this.updateUserName = updateUserName;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
 
	private String saasId;//关联base_saas code
	private String name; //版本名称
	private Integer versionInt;//版本号
	private Integer status;////-1 删除 0 禁用 可用
	private String remark;
	// Constructors
	/** default constructor */
	public BaseServerVersion() {
	}
	/** minimal constructor */
	public BaseServerVersion(String code, String name, Date createTime,
			Date updateTime) {
		this.code = code;
		this.name = name;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}
	/** full constructor */
	public BaseServerVersion(String code, String saasId, String userCode,
			String name, Integer versionInt, Date createTime,
			String createUser, String createUserName, Date updateTime,
			String updateUser, String updateUserName, Integer status,
			String remark) {
		this.code = code;
		this.saasId = saasId;
		this.name = name;
		this.versionInt = versionInt;
		this.createTime = createTime;
		this.createUser = createUser;
		this.createUserName = createUserName;
		this.updateTime = updateTime;
		this.updateUser = updateUser;
		this.updateUserName = updateUserName;
		this.status = status;
		this.remark = remark;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "name", nullable = false, length = 10)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "version_int")
	public Integer getVersionInt() {
		return this.versionInt;
	}
	public void setVersionInt(Integer versionInt) {
		this.versionInt = versionInt;
	}
	@Column(name = "status", length = 1)
	public Integer getStatus() {
		return this.status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Column(name = "remark", length = 1500)
	public String getRemark() {
		return this.remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
}

+ 166 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/BaseServerVersionLog.java

@ -0,0 +1,166 @@
package com.yihu.jw.manage.model.version;// default package
import javax.persistence.*;
import java.util.Date;
/**
 * BaseServerVersionLog entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "base_server_version_log")
public class BaseServerVersionLog  implements java.io.Serializable {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	private String saasId; //关联saas code
	private String userCodes;//此次更新的用户 多个逗号分割
	private String name;//此次更新的版本名称
	private Integer versionInt;//版本号
	private Integer type;//1更新 2回滚
	private Date createTime;
	private String createUser;
	private String createUserName;
	private Date updateTime;
	private String updateUser;
	private String updateUserName;
	private Integer status;////-1 删除 0 禁用 可用
	// Constructors
	/** default constructor */
	public BaseServerVersionLog() {
	}
	/** minimal constructor */
	public BaseServerVersionLog(String name, Date createTime) {
		this.name = name;
		this.createTime = createTime;
	}
	/** full constructor */
	public BaseServerVersionLog(String saasId, String userCodes, String name,
			Integer versionInt, Date createTime, String createUser,
			String createUserName) {
		this.saasId = saasId;
		this.userCodes = userCodes;
		this.name = name;
		this.versionInt = versionInt;
		this.createTime = createTime;
		this.createUser = createUser;
		this.createUserName = createUserName;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "user_codes")
	public String getUserCodes() {
		return this.userCodes;
	}
	public void setUserCodes(String userCodes) {
		this.userCodes = userCodes;
	}
	@Column(name = "name", nullable = false, length = 10)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "version_int")
	public Integer getVersionInt() {
		return this.versionInt;
	}
	public void setVersionInt(Integer versionInt) {
		this.versionInt = versionInt;
	}
	@Column(name = "create_time", nullable = false, length = 0)
	public Date getCreateTime() {
		return this.createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name = "create_user", length = 100)
	public String getCreateUser() {
		return this.createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	@Column(name = "create_user_name", length = 50)
	public String getCreateUserName() {
		return this.createUserName;
	}
	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	public String getUpdateUser() {
		return updateUser;
	}
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
	public String getUpdateUserName() {
		return updateUserName;
	}
	public void setUpdateUserName(String updateUserName) {
		this.updateUserName = updateUserName;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
}

+ 141 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/BaseUserUrlVersion.java

@ -0,0 +1,141 @@
package com.yihu.jw.manage.model.version;// default package
import javax.persistence.*;
/**
 * BaseUserUrlVersion entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "base_user_url_version")
public class BaseUserUrlVersion  implements java.io.Serializable {
	// Fields
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	private String code;
	private String saasId;//saasid 关联 base_saas
	private String userCode;//关联用户
	private String usvCode;//关联base_url_server_version code
	private String moduleCode;//关联模块表 base_modile code
	private String functionCode;//关联功能表 base_function code
	private String url;//后台url
	private Integer versionInt;//接口的版本
	private Integer status;//1: 正常 0:不可用  -1删除
	// Constructors
	/** default constructor */
	public BaseUserUrlVersion() {
	}
	/** minimal constructor */
	public BaseUserUrlVersion(Integer id, String code) {
		this.code = code;
	}
	/** full constructor */
	public BaseUserUrlVersion(Integer id, String code, String saasId,
			String userCode, String usvCode, String moduleCode,
			String functionCode, String url, Integer versionInt, Integer status) {
		this.code = code;
		this.saasId = saasId;
		this.userCode = userCode;
		this.usvCode = usvCode;
		this.moduleCode = moduleCode;
		this.functionCode = functionCode;
		this.url = url;
		this.versionInt = versionInt;
		this.status = status;
	}
	@Column(name = "code", nullable = false, length = 10)
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "user_code", length = 100)
	public String getUserCode() {
		return this.userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	@Column(name = "usv_code", length = 100)
	public String getUsvCode() {
		return this.usvCode;
	}
	public void setUsvCode(String usvCode) {
		this.usvCode = usvCode;
	}
	@Column(name = "module_code", length = 100)
	public String getModuleCode() {
		return this.moduleCode;
	}
	public void setModuleCode(String moduleCode) {
		this.moduleCode = moduleCode;
	}
	@Column(name = "function_code", length = 100)
	public String getFunctionCode() {
		return this.functionCode;
	}
	public void setFunctionCode(String functionCode) {
		this.functionCode = functionCode;
	}
	@Column(name = "url", length = 100)
	public String getUrl() {
		return this.url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	@Column(name = "version_int")
	public Integer getVersionInt() {
		return this.versionInt;
	}
	public void setVersionInt(Integer versionInt) {
		this.versionInt = versionInt;
	}
	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
}

+ 125 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/model/version/WlyyVersion.java

@ -0,0 +1,125 @@
package com.yihu.jw.manage.model.version;// default package
import com.yihu.jw.manage.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * WlyyVersion entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "wlyy_version")
public class WlyyVersion extends IdEntity implements java.io.Serializable {
	// Fields
	private String saasId; //saas code
	private String name;
	private Double versionInt;
	private String versionStr;
	private String url;//app下载的路径
	private String info;//app更新的信息
	private Double size;//大小 MB
	private Integer status;////-1 删除 0 禁用 可用
	// Constructors
	/** default constructor */
	public WlyyVersion() {
	}
	/** minimal constructor */
	public WlyyVersion(String code, String name) {
		this.code = code;
		this.name = name;
	}
	/** full constructor */
	public WlyyVersion(String saasId, String code, String name,
					   Double versionInt, String versionStr, String url, String info,
					   Double size) {
		this.saasId = saasId;
		this.code = code;
		this.name = name;
		this.versionInt = versionInt;
		this.versionStr = versionStr;
		this.url = url;
		this.info = info;
		this.size = size;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "name", nullable = false, length = 10)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "version_int", precision = 22, scale = 0)
	public Double getVersionInt() {
		return this.versionInt;
	}
	public void setVersionInt(Double versionInt) {
		this.versionInt = versionInt;
	}
	@Column(name = "version_str", length = 10)
	public String getVersionStr() {
		return this.versionStr;
	}
	public void setVersionStr(String versionStr) {
		this.versionStr = versionStr;
	}
	@Column(name = "url", length = 300)
	public String getUrl() {
		return this.url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	@Column(name = "info", length = 1000)
	public String getInfo() {
		return this.info;
	}
	public void setInfo(String info) {
		this.info = info;
	}
	@Column(name = "size", precision = 22, scale = 0)
	public Double getSize() {
		return this.size;
	}
	public void setSize(Double size) {
		this.size = size;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
}

+ 146 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/base/FunctionService.java

@ -0,0 +1,146 @@
package com.yihu.jw.manage.service.base;
import com.yihu.jw.manage.model.system.ManageUser;
import com.yihu.jw.manage.service.system.UserService;
import com.yihu.jw.manage.util.RestTemplateUtil;
import com.yihu.jw.restmodel.base.base.BaseContants;
import com.yihu.jw.restmodel.base.base.MFunction;
import com.yihu.jw.restmodel.common.Envelop;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
 * Created by chenweida on 2017/6/20.
 */
@Service
public class FunctionService {
    @Value("${spring.gateway}"+ BaseContants.api_common)
    private String url;
    @Autowired
    private RestTemplate template;
    @Autowired
    private UserService userService;
    public Envelop list(Integer size, Integer page,Map<String,String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        req.put("size", size);
        req.put("page", page);
        req.put("sorts", map.get("sorts"));
        String name = map.get("name");
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(name)) {
            filters.put("name", name);
        }
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        String filterStr = JSONObject.fromObject(filters).toString();
        req.put("filters", filterStr);
        Envelop forObject = template.getForObject(url + BaseContants.Function.api_getList+"?size={size}&page={page}&sorts={sorts}&filters={filters}",
                Envelop.class, req);
        return forObject;
    }
    public Envelop getListNoPage(Map<String,String> map){
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        String parentCode = map.get("parentCode");
        if (StringUtils.isNotBlank(parentCode)) {
            filters.put("parentCode", parentCode);
        }
        req.put("filters", JSONObject.fromObject(filters).toString());
        return template.getForObject(url+BaseContants.Function.api_getListNoPage+"?filters={filters}",Envelop.class,req);
    }
    /**
     * 获取所有的顶级(parentCode=0)功能列表
     * @param map
     * @return
     */
    public Envelop getListParentNoPage(Map<String,String> map){
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        req.put("filters", filters);
        return template.getForObject(url+BaseContants.Function.api_getListNoPage+"?filters={filters}",Envelop.class,req);
    }
    public Envelop deleteByCode(String codes,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        Map<String, String> map = new HashMap<>();
        map.put("userCode", userCode);
        map.put("userName", userName);
        String urlRequest = url +"/function/"+codes+"?userCode={userCode}&userName={userName}";
        MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
        RestTemplateUtil restTemplateUtil = new RestTemplateUtil(urlRequest,multiValueMap);
        Envelop envelop = restTemplateUtil.exchange(urlRequest, HttpMethod.DELETE, Envelop.class,map);
        return envelop;
    }
    public Envelop findByCode(String code) {
        Envelop envelop = template.getForObject(url +"/function/"+code, Envelop.class);
        return envelop;
    }
    public Envelop getChildren(String code) {
        return template.getForObject(url +"/function/children/"+code, Envelop.class);
    }
    public Envelop saveOrUpdate(MFunction func,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        //设置值
        if(func.getId()==null){
            func.setCreateUser(userCode);
            func.setStatus(1);
            func.setCreateUserName(userName);
            func.setCode(UUID.randomUUID().toString().replaceAll("-",""));
        }
        func.setUpdateUserName(userName);
        func.setUpdateUser(userCode);
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        JSONObject jsonObj = JSONObject.fromObject(func);
        HttpEntity<String> formEntity = new HttpEntity<String>(jsonObj.toString(), headers);
        Envelop envelop =null;
        if(func.getId()==null){//说明是保存
            ResponseEntity<Envelop> responseEntity = template.postForEntity(url + BaseContants.Function.api_create, formEntity, Envelop.class);
            envelop = responseEntity.getBody();
            return envelop;
        }
        ResponseEntity<Envelop> resp = template.exchange(url + BaseContants.Function.api_update, HttpMethod.PUT,formEntity,Envelop.class);
        envelop = resp.getBody();
        return envelop;
    }
}

+ 146 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/base/ModuleService.java

@ -0,0 +1,146 @@
package com.yihu.jw.manage.service.base;
import com.yihu.jw.manage.model.system.ManageUser;
import com.yihu.jw.manage.service.system.UserService;
import com.yihu.jw.manage.util.RestTemplateUtil;
import com.yihu.jw.restmodel.base.base.BaseContants;
import com.yihu.jw.restmodel.base.base.MModule;
import com.yihu.jw.restmodel.common.Envelop;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.*;
/**
 * Created by chenweida on 2017/6/20.
 */
@Service
public class ModuleService {
    @Value("${spring.gateway}"+ BaseContants.api_common)
    private String url;
    @Autowired
    private RestTemplate template;
    @Autowired
    private UserService userService;
    public Envelop list(Integer size, Integer page,Map<String,String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        req.put("size", size);
        req.put("page", page);
        req.put("sorts", map.get("sorts"));
        String name = map.get("name");
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(name)) {
            filters.put("name", name);
        }
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        String filterStr = JSONObject.fromObject(filters).toString();
        req.put("filters", filterStr);
        Envelop forObject = template.getForObject(url + BaseContants.Module.api_getList+"?size={size}&page={page}&sorts={sorts}&filters={filters}",
                Envelop.class, req);
        return forObject;
    }
    public Envelop getListNoPage(Map<String,String> map){
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        String filterStr = JSONObject.fromObject(filters).toString();
        req.put("filters", filterStr);
        return template.getForObject(url+BaseContants.Module.api_getListNoPage+"?filters={filters}",Envelop.class,req);
    }
    public Envelop deleteByCode(String codes,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        Map<String, String> map = new HashMap<>();
        map.put("userCode", userCode);
        map.put("userName", userName);
        String urlRequest = url +"/module/"+codes+"?userCode={userCode}&userName={userName}";
        MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
        RestTemplateUtil restTemplateUtil = new RestTemplateUtil(urlRequest,multiValueMap);
        Envelop envelop = restTemplateUtil.exchange(urlRequest, HttpMethod.DELETE, Envelop.class,map);
        return envelop;
    }
    public Envelop findByCode(String code) {
        Envelop envelop = template.getForObject(url +"/module/"+code, Envelop.class);
        return envelop;
    }
    public Envelop getChildren(String code) {
        return template.getForObject(url +"/module/children/"+code, Envelop.class);
    }
    public Envelop saveOrUpdate(MModule module,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        //设置值
        if(module.getId()==null){
            module.setCreateUser(userCode);
            module.setStatus(1);
            module.setCreateUserName(userName);
            module.setCode(UUID.randomUUID().toString().replaceAll("-",""));
        }
        module.setUpdateUserName(userName);
        module.setUpdateUser(userCode);
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        JSONObject jsonObj = JSONObject.fromObject(module);
        HttpEntity<String> formEntity = new HttpEntity<String>(jsonObj.toString(), headers);
        Envelop envelop =null;
        if(module.getId()==null){//说明是保存
            ResponseEntity<Envelop> responseEntity = template.postForEntity(url + BaseContants.Module.api_create, formEntity, Envelop.class);
            envelop = responseEntity.getBody();
            return envelop;
        }
        ResponseEntity<Envelop> resp = template.exchange(url + BaseContants.Module.api_update, HttpMethod.PUT,formEntity,Envelop.class);
        envelop = resp.getBody();
        return envelop;
    }
    public List<String> getExistFun(String code) {
        Envelop envelop = template.getForObject(url + "/moduleFun/existFunc/" + code, Envelop.class);
        Object obj = envelop.getObj();
        if(obj==null){
            return new ArrayList<>();
        }
        return (List)obj;
    }
    public Envelop changeFun(String moduleCode, String funCodes) {
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        String json = "{\"moduleCode\" :\""+moduleCode+"\",\"funCodes\":\""+funCodes+"\"}";
        HttpEntity<String> formEntity = new HttpEntity<String>(json, headers);
        ResponseEntity<Envelop> resp = template.exchange(url + BaseContants.ModuleFun.api_changeFun, HttpMethod.PUT,formEntity,Envelop.class);
        return resp.getBody();
    }
}

+ 98 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/doctorManage/DoctorService.java

@ -0,0 +1,98 @@
package com.yihu.jw.manage.service.doctorManage;
/**
 * Created by Administrator on 2017/6/13 0013.
 */
/*
@Service
public class DoctorService {
    @Value("${spring.gateway}"+ DoctorContants.api_common)
    private String url;
    @Autowired
    private RestTemplate template;
    @Autowired
    private UserService userService;
   public Envelop list(Integer size, Integer page,Map<String,String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        req.put("size", size);
        req.put("page", page);
        req.put("sorts", map.get("sorts"));
        String name = map.get("name");
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(name)) {
            filters.put("name", name);
        }
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        req.put("filters",filters);
        return template.getForObject(url + DoctorContants.Doctor.api_getList+"?size={size}&page={page}&sorts={sorts}&filters={filters}", Envelop.class,req);
    }
    public Envelop deleteByCode(String codes,String userCode) {
        //delete 没有返回值....
        //template.delete(url + "/wechatConfig/delete?codes={codes}", codes);
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        Map<String, String> map = new HashMap<>();
        map.put("userCode", userCode);
        map.put("userName", userName);
        String urlRequest = url +"wechatConfig/"+codes+"?userCode={userCode}&userName={userName}";
        MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
        RestTemplateUtil restTemplateUtil = new RestTemplateUtil(urlRequest,multiValueMap);
        Envelop envelop = restTemplateUtil.exchange(urlRequest, HttpMethod.DELETE, Envelop.class,map);
        return envelop;
    }
    public Envelop findByCode(String code) {
        Envelop envelop = template.getForObject(url +"wechatConfig/"+code, Envelop.class);
        return envelop;
    }
    public Envelop saveOrUpdate(WechatConfig wechatConfig,String userCode) throws JsonProcessingException {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        //设置值
        if(wechatConfig.getId()==null){
            wechatConfig.setCreateUser(userCode);
            wechatConfig.setCreateUserName(userName);
        }
        wechatConfig.setUpdateUserName(userName);
        wechatConfig.setUpdateUser(userCode);
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        JSONObject jsonObj = JSONObject.fromObject(wechatConfig);
        HttpEntity<String> formEntity = new HttpEntity<String>(jsonObj.toString(), headers);
        Envelop envelop =null;
        if(wechatConfig.getId()==null){//说明是保存
            ResponseEntity<Envelop> responseEntity = template.postForEntity(url + WechatContants.WxConfig.api_create, formEntity, Envelop.class);
            envelop = responseEntity.getBody();
            return envelop;
        }
        ResponseEntity<Envelop> resp = template.exchange(url + WechatContants.WxConfig.api_update,HttpMethod.PUT,formEntity,Envelop.class);
        envelop = resp.getBody();
        return envelop;
    }
    public Envelop getListNoPage(String fields, Map<String, Object> filter, String sorts) {
        Map<String, Object> map = new HashMap<>();
        map.put("fields",fields);
        map.put("sorts",sorts);
        map.put("filter",filter);
        Envelop forObject = template.getForObject(url + WechatContants.WxConfig.api_getWechatNoPage+"?fields={fields}&filter={filter}&sorts={sorts}", Envelop.class,map);
        return forObject;
    }
}
*/

+ 57 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/system/ManageMenuUrlService.java

@ -0,0 +1,57 @@
package com.yihu.jw.manage.service.system;
import com.yihu.jw.manage.dao.system.MenuUrlDao;
import com.yihu.jw.manage.model.system.ManageMenuUrl;
import com.yihu.jw.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
 * Created by Administrator on 2017/7/3 0003.
 */
@Service
public class ManageMenuUrlService extends BaseJpaService<ManageMenuUrl,MenuUrlDao> {
    @Autowired
    private MenuUrlDao menuUrlDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public List<ManageMenuUrl> getListByMenuCode(String menuCode){
        return menuUrlDao.getListByMenuCode(menuCode);
    }
    public List<Map<String, Object>> getUrlByMenuCode(String menuCode){
        String sql = "select mmu.url,mmu.method from manage_menu_url mmu where mmu.menu_code = ?";
        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql, menuCode);
        return maps;
    }
    @Transactional
    public void saveOrUpdate(String menuCode,List<String> urls,List<String> methods){
        menuUrlDao.delete(menuCode);
        List<ManageMenuUrl> manageMenuUrls = new ArrayList<>();
        int i =0;
        if(urls!=null){
            for(String url:urls){
                ManageMenuUrl manageMenuUrl = new ManageMenuUrl();
                manageMenuUrl.setUrl(url);
                manageMenuUrl.setCode(UUID.randomUUID().toString().replaceAll("-",""));
                manageMenuUrl.setMenuCode(menuCode);
                if(methods!=null){ //methods要么为空,要么与urls成对出现
                    manageMenuUrl.setMethod(methods.get(i));
                    i++;
                }
                manageMenuUrls.add(manageMenuUrl);
            }
        }
        menuUrlDao.save(manageMenuUrls);
    }
}

+ 94 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/system/MenuRoleService.java

@ -0,0 +1,94 @@
package com.yihu.jw.manage.service.system;
import com.yihu.jw.manage.adapter.CacheAdapter;
import com.yihu.jw.manage.adapter.cache.MapCache;
import com.yihu.jw.manage.dao.system.RoleMenuDao;
import com.yihu.jw.manage.model.system.ManageRoleMenu;
import com.yihu.jw.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
 * Created by Administrator on 2017/6/27 0027.
 */
@Service
public class MenuRoleService extends BaseJpaService<ManageRoleMenu,RoleMenuDao> {
    @Autowired
    private RoleMenuDao roleMenuDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private StringRedisTemplate stringRedisTemplate;
    @Autowired
    private CacheAdapter cacheAdapter;
    @Autowired
    private MapCache mapCache;
    @Transactional
    public void changeMenuRole(String roleCode, String menuCodes) {
        //查找目前有的权限
        List<String> oldMenuCodes = getMenuRoles(roleCode);
        //新权限构建成list
        List<String> newMenuCodes = new ArrayList<>();
        for(String menuCode:menuCodes.split(",")){
            newMenuCodes.add(menuCode);
        }
        List<String> _oldMenuCodes = new ArrayList<String>(oldMenuCodes);//构建oldMenuCodes的副本
        _oldMenuCodes.removeAll(newMenuCodes);// 去除相同元素--->>需要删除的权限
        List<String> _newMenuCodes = new ArrayList<String>(newMenuCodes);//构建newMenuCodes的副本
        _newMenuCodes.removeAll(oldMenuCodes);// 去除相同元素---->>需要添加 的权限
        //先删除权限在添加...
        for(String delMenuCode:_oldMenuCodes){
            roleMenuDao.delete(delMenuCode, roleCode);
        }
        for(String addMenuCode:_newMenuCodes){
            ManageRoleMenu menuRole = new ManageRoleMenu();
            menuRole.setRoleCode(roleCode);
            menuRole.setMenuCode(addMenuCode);
            roleMenuDao.save(menuRole);
        }
    }
    public List<String> getMenuRoles(String roleCode){
        List<ManageRoleMenu> menuRoles = roleMenuDao.findByRoleCode(roleCode);
        List<String> list = new ArrayList<>();
        for(ManageRoleMenu menuRole:menuRoles){
            list.add(menuRole.getMenuCode());
        }
        return list;
    }
    /**
     * 通过userCode查找功能权限
     * @param userCode
     * @return
     */
    public  List<Map<String, Object>> findByUserCode(String userCode) {
        //只对功能权限进行查询
        String sql = "select DISTINCT mmu.url,mmu.method from manage_menu mm LEFT JOIN manage_role_menu mrm on mrm.menu_code = mm.code LEFT JOIN manage_user_role mur on mur.role_code = mrm.role_code LEFT JOIN manage_menu_url mmu on mmu.menu_code = mm.code where mur.user_code=? and mmu.url is not null";
        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql, userCode);
        return maps;
    }
    public void reloadPrivilege(){
        Set<String> keys = cacheAdapter.keys(CacheAdapter.ROLE, ".*");//keys即为code的
        for (String key:keys){
            List<Map<String, Object>> maps = findByUserCode(key);
            cacheAdapter.setData(CacheAdapter.ROLE,key,maps);
        }
    }
}

+ 121 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/system/UserRoleService.java

@ -0,0 +1,121 @@
package com.yihu.jw.manage.service.system;
import com.yihu.jw.manage.dao.system.UserRoleDao;
import com.yihu.jw.manage.model.system.ManageUser;
import com.yihu.jw.manage.model.system.ManageUserRole;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.mysql.query.URLQueryParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.persistence.criteria.CriteriaQuery;
import javax.transaction.Transactional;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by Administrator on 2017/6/26 0026.
 */
@Service
public class UserRoleService extends BaseJpaService<ManageUserRole, UserRoleDao> {
    @Autowired
    private UserRoleDao userRoleDao;
    @Autowired
    private UserService userService;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public Page<ManageUserRole> list(String roleCode, Integer page, Integer pageSize) throws ParseException {
        String filters = "roleCode=" + roleCode + ";";
        if (page <= 0) {
            page = 1;
        }
        if (pageSize <= 0) {
            pageSize = 15;
        }
        PageRequest pageRequest = new PageRequest(page - 1, pageSize);
        URLQueryParser queryParser = createQueryParser("", filters, "");
        CriteriaQuery query = queryParser.makeCriteriaQuery();
        List<ManageUserRole> list = entityManager
                .createQuery(query)
                .setFirstResult((page - 1) * pageSize)
                .setMaxResults(pageSize)
                .getResultList();
        long total = 0;
        if (list.size() > 0) {
            queryParser = createQueryParser(filters);
             query = queryParser.makeCriteriaCountQuery();
            total = (long) entityManager.createQuery(query).getSingleResult();
            for (ManageUserRole roleUser : list) {
                ManageUser user = userService.findByCode(roleUser.getUserCode());
                roleUser.setUserName(user == null ? "" : user.getName());
            }
        }
        return new PageImpl<ManageUserRole>(list, pageRequest, total);
    }
    /**
     * 根据roleCode获取userCode的
     * @param roleCode
     * @return
     */
    public  List<String> getUserCodes(String roleCode) {
        List<ManageUserRole> userRoles = userRoleDao.findByRoleCode(roleCode);
        List<String> userCodes = new ArrayList<>();
        for (ManageUserRole userRole:userRoles){
            userCodes.add(userRole.getUserCode());
        }
        return userCodes;
    }
    /**
     * 更改角色权限
     * @param roleCode
     * @param userCode
     */
    @Transactional
    public void changeUserRole(String roleCode ,String userCode) {
        ManageUserRole userRole = userRoleDao.findByRoleAndUserCode(roleCode, userCode);
        if(userRole!=null){
            userRoleDao.deleteUserRole(roleCode,userCode);
            return;
        }
        userRole = new ManageUserRole();
        userRole.setRoleCode(roleCode);
        userRole.setUserCode(userCode);
        userRoleDao.save(userRole);
    }
    /**
     * 获取角色名称
     * @param manageUsers
     * @return
     */
    public List<ManageUser> findByManageUser(List<ManageUser> manageUsers) {
        if(manageUsers==null)
            return null;
        for (ManageUser manageUser:manageUsers){
            String sql = "select group_concat(mr.name) as name from manage_role mr where mr.code in (select role_code from manage_user_role mur where mur.user_code =?)";
            String name = jdbcTemplate.queryForObject(sql, String.class, manageUser.getCode());
            manageUser.setRoleName(name);
        }
        return manageUsers;
    }
    /**
     * 根据userCode获取saasid
     */
    public List<String> getSaasIdByUserCode(String userCode){
        String sql = "select distinct mr.saas_id from manage_user_role mur left join manage_role mr on mr.code = mur.role_code where mur.user_code=? ";
       return jdbcTemplate.queryForList(sql,String.class,userCode);
    }
}

+ 127 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/version/ServerUrlVersionService.java

@ -0,0 +1,127 @@
package com.yihu.jw.manage.service.version;
import com.yihu.jw.manage.model.system.ManageUser;
import com.yihu.jw.manage.model.version.BaseServerUrlVersion;
import com.yihu.jw.manage.service.system.UserService;
import com.yihu.jw.manage.util.RestTemplateUtil;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.Envelop;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
 * Created by chenweida on 2017/6/20.
 */
@Service
public class ServerUrlVersionService {
    @Value("${spring.gateway}"+ BaseVersionContants.api_common)
    private String url;
    @Autowired
    private RestTemplate template;
    @Autowired
    private UserService userService;
    public Envelop list(Integer size, Integer page,Map<String,String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        req.put("size", size);
        req.put("page", page);
        req.put("sorts", map.get("sorts"));
        String name = map.get("name");
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(name)) {
            filters.put("name", name);
        }
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        req.put("filters", filters);
        Envelop forObject = template.getForObject(url + BaseVersionContants.BaseServerUrlVersion.api_getList+"?size={size}&page={page}&sorts={sorts}&filters={filters}",
                Envelop.class, req);
        return forObject;
    }
    public Envelop getListNoPage(Map<String, String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        req.put("sorts", map.get("sorts"));
        String serverCode = map.get("serverCode");
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(serverCode)) {
            filters.put("serverCode", serverCode);
        }
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        req.put("filters", filters);
        Envelop forObject = template.getForObject(url + BaseVersionContants.BaseServerUrlVersion.api_getListNoPage+"?sorts={sorts}&filters={filters}",
                Envelop.class, req);
        return forObject;
    }
    public Envelop saveOrUpdate(BaseServerUrlVersion baseServerUrlVersion,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        //设置值
        if(baseServerUrlVersion.getId()==null){
            baseServerUrlVersion.setCreateUser(userCode);
            baseServerUrlVersion.setStatus(1);
            baseServerUrlVersion.setCreateUserName(userName);
            baseServerUrlVersion.setCode(UUID.randomUUID().toString().replaceAll("-",""));
        }
        baseServerUrlVersion.setUpdateUserName(userName);
        baseServerUrlVersion.setUpdateUser(userCode);
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        JSONObject jsonObj = JSONObject.fromObject(baseServerUrlVersion);
        HttpEntity<String> formEntity = new HttpEntity<String>(jsonObj.toString(), headers);
        Envelop envelop =null;
        if(baseServerUrlVersion.getId()==null){//说明是保存
            ResponseEntity<Envelop> responseEntity = template.postForEntity(url + BaseVersionContants.BaseServerUrlVersion.api_create, formEntity, Envelop.class);
            envelop = responseEntity.getBody();
            return envelop;
        }
        ResponseEntity<Envelop> resp = template.exchange(url + BaseVersionContants.BaseServerUrlVersion.api_update, HttpMethod.PUT,formEntity,Envelop.class);
        envelop = resp.getBody();
        return envelop;
    }
    public Envelop deleteByCode(String codes,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        Map<String, String> map = new HashMap<>();
        map.put("userCode", userCode);
        map.put("userName", userName);
        String urlRequest = url +"/serverUrl/"+codes+"?userCode={userCode}&userName={userName}";
        MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
        RestTemplateUtil restTemplateUtil = new RestTemplateUtil(urlRequest,multiValueMap);
        Envelop envelop = restTemplateUtil.exchange(urlRequest, HttpMethod.DELETE, Envelop.class,map);
        return envelop;
    }
    public Envelop findByCode(String code) {
        Envelop envelop = template.getForObject(url +"/serverUrl/"+code, Envelop.class);
        return envelop;
    }
}

+ 119 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/version/ServerVersionService.java

@ -0,0 +1,119 @@
package com.yihu.jw.manage.service.version;
import com.yihu.jw.manage.model.system.ManageUser;
import com.yihu.jw.manage.model.version.BaseServerVersion;
import com.yihu.jw.manage.service.system.UserService;
import com.yihu.jw.manage.util.RestTemplateUtil;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.Envelop;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
 * Created by chenweida on 2017/6/20.
 */
@Service
public class ServerVersionService {
    @Value("${spring.gateway}"+ BaseVersionContants.api_common)
    private String url;
    @Autowired
    private RestTemplate template;
    @Autowired
    private UserService userService;
    public Envelop list(Integer size, Integer page,Map<String,String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        req.put("size", size);
        req.put("page", page);
        req.put("sorts", map.get("sorts"));
        req.put("filters", "");
        String name = map.get("name");
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(name)) {
            filters.put("name", name);
        }
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        req.put("filters", filters);
        Envelop forObject = template.getForObject(url + BaseVersionContants.BaseServerVersion.api_getList+"?size={size}&page={page}&sorts={sorts}&filters={filters}",
                Envelop.class, req);
        return forObject;
    }
    public Envelop saveOrUpdate(BaseServerVersion baseServerVersion,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        //设置值
        if(baseServerVersion.getId()==null){
            baseServerVersion.setCreateUser(userCode);
            baseServerVersion.setStatus(1);
            baseServerVersion.setCreateUserName(userName);
            baseServerVersion.setCode(UUID.randomUUID().toString().replaceAll("-",""));
        }
        baseServerVersion.setUpdateUserName(userName);
        baseServerVersion.setUpdateUser(userCode);
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        JSONObject jsonObj = JSONObject.fromObject(baseServerVersion);
        HttpEntity<String> formEntity = new HttpEntity<String>(jsonObj.toString(), headers);
        Envelop envelop =null;
        if(baseServerVersion.getId()==null){//说明是保存
            ResponseEntity<Envelop> responseEntity = template.postForEntity(url + BaseVersionContants.BaseServerVersion.api_create, formEntity, Envelop.class);
            envelop = responseEntity.getBody();
            return envelop;
        }
        ResponseEntity<Envelop> resp = template.exchange(url + BaseVersionContants.BaseServerVersion.api_update, HttpMethod.PUT,formEntity,Envelop.class);
        envelop = resp.getBody();
        return envelop;
    }
    public Envelop deleteByCode(String codes,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        Map<String, String> map = new HashMap<>();
        map.put("userCode", userCode);
        map.put("userName", userName);
        String urlRequest = url +"/serverVersion/"+codes+"?userCode={userCode}&userName={userName}";
        MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
        RestTemplateUtil restTemplateUtil = new RestTemplateUtil(urlRequest,multiValueMap);
        Envelop envelop = restTemplateUtil.exchange(urlRequest, HttpMethod.DELETE, Envelop.class,map);
        return envelop;
    }
    public Envelop findByCode(String code) {
        Envelop envelop = template.getForObject(url +"/serverVersion/"+code, Envelop.class);
        return envelop;
    }
    public Envelop getListNoPage(Map<String, String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        req.put("filters", filters);
        return template.getForObject(url+ BaseVersionContants.BaseServerVersion.api_getListNoPage+"?filters={filters}",Envelop.class,req);
    }
}

+ 64 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/version/UserUrlVersionService.java

@ -0,0 +1,64 @@
package com.yihu.jw.manage.service.version;
import com.yihu.jw.manage.model.system.ManageUser;
import com.yihu.jw.manage.service.system.UserService;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.Envelop;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by Administrator on 2017/7/11 0011.
 */
@Service
public class UserUrlVersionService {
    @Value("${spring.gateway}"+ BaseVersionContants.api_common)
    private String url;
    @Autowired
    private RestTemplate template;
    @Autowired
    private UserService userService;
    /**
     * 更改userCode的后台版本
     * @param serverCode
     * @param userCodes
     * @param userCode
     * @param saasId
     * @return
     */
    public Envelop changeUserVersion(String serverCode, String userCodes,String userCode,String saasId) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        Map<String, Object> req = new HashMap<>();
        req.put("serverCode",serverCode);
        req.put("userCodes",userCodes);
        req.put("userCode",userCode);
        req.put("userName",userName);
        req.put("saasId",saasId);
        return template.getForObject(url+ BaseVersionContants.UserUrlVersion.api_changeUserVersion+"?serverCode={serverCode}&userCodes={userCodes}&userCode={userCode}&userName={userName}&saasId={saasId}",Envelop.class,req);
    }
    public Envelop getListNoPage(Map<String, String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        String bsvCode = map.get("bsvCode");
        if (StringUtils.isNotBlank(bsvCode)) {
            filters.put("bsvCode", bsvCode);
        }
        req.put("filters", filters);
        return template.getForObject(url+ BaseVersionContants.UserUrlVersion.api_getListNoPage+"?filters={filters}",Envelop.class,req);
    }
}

+ 108 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/version/WlyyVersionService.java

@ -0,0 +1,108 @@
package com.yihu.jw.manage.service.version;
import com.yihu.jw.manage.model.system.ManageUser;
import com.yihu.jw.manage.model.version.WlyyVersion;
import com.yihu.jw.manage.service.system.UserService;
import com.yihu.jw.manage.util.RestTemplateUtil;
import com.yihu.jw.restmodel.base.version.BaseVersionContants;
import com.yihu.jw.restmodel.common.Envelop;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
 * Created by chenweida on 2017/6/20.
 */
@Service
public class WlyyVersionService {
    @Value("${spring.gateway}"+ BaseVersionContants.api_common)
    private String url;
    @Autowired
    private RestTemplate template;
    @Autowired
    private UserService userService;
    public Envelop list(Integer size, Integer page,Map<String,String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        req.put("size", size);
        req.put("page", page);
        req.put("sorts", map.get("sorts"));
        String name = map.get("name");
        String saasId = map.get("saasId");
        if (StringUtils.isNotBlank(name)) {
            filters.put("name", name);
        }
        if (StringUtils.isNotBlank(saasId)) {
            filters.put("saasId", saasId);
        }
        String filterStr = JSONObject.fromObject(filters).toString();
        req.put("filters", filterStr);
        Envelop forObject = template.getForObject(url + BaseVersionContants.WlyyVersion.api_getList+"?size={size}&page={page}&sorts={sorts}&filters={filters}",
                Envelop.class, req);
        return forObject;
    }
    public Envelop saveOrUpdate(WlyyVersion version,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        //设置值
        if(version.getId()==null){
            version.setCreateUser(userCode);
            version.setStatus(1);
            version.setCreateUserName(userName);
            version.setCode(UUID.randomUUID().toString().replaceAll("-",""));
        }
        version.setUpdateUserName(userName);
        version.setUpdateUser(userCode);
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        JSONObject jsonObj = JSONObject.fromObject(version);
        HttpEntity<String> formEntity = new HttpEntity<String>(jsonObj.toString(), headers);
        Envelop envelop =null;
        if(version.getId()==null){//说明是保存
            ResponseEntity<Envelop> responseEntity = template.postForEntity(url + BaseVersionContants.WlyyVersion.api_create, formEntity, Envelop.class);
            envelop = responseEntity.getBody();
            return envelop;
        }
        ResponseEntity<Envelop> resp = template.exchange(url + BaseVersionContants.WlyyVersion.api_update, HttpMethod.PUT,formEntity,Envelop.class);
        envelop = resp.getBody();
        return envelop;
    }
    public Envelop deleteByCode(String codes,String userCode) {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        Map<String, String> map = new HashMap<>();
        map.put("userCode", userCode);
        map.put("userName", userName);
        String urlRequest = url +"/wlyyVersion/"+codes+"?userCode={userCode}&userName={userName}";
        MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
        RestTemplateUtil restTemplateUtil = new RestTemplateUtil(urlRequest,multiValueMap);
        Envelop envelop = restTemplateUtil.exchange(urlRequest, HttpMethod.DELETE, Envelop.class,map);
        return envelop;
    }
    public Envelop findByCode(String code) {
        Envelop envelop = template.getForObject(url +"/wlyyVersion/"+code, Envelop.class);
        return envelop;
    }
}

+ 125 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/wechat/TemplateService.java

@ -0,0 +1,125 @@
package com.yihu.jw.manage.service.wechat;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.manage.model.system.ManageUser;
import com.yihu.jw.manage.service.system.UserService;
import com.yihu.jw.manage.util.RestTemplateUtil;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.wx.MWxTemplate;
import com.yihu.jw.restmodel.wx.WechatContants;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by Administrator on 2017/6/13 0013.
 */
@Service
public class TemplateService {
    @Value("${spring.gateway}"+ WechatContants.api_common)
    private String url;
    @Autowired
    private RestTemplate template;
    @Autowired
    private UserService userService;
    public Envelop list(Integer size, Integer page ,Map<String,String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        req.put("size",size);
        req.put("page",page);
        req.put("sorts",map.get("sorts"));
        String name = map.get("name");
        if(StringUtils.isNotBlank(name)){
            filters.put("name",name);
        }
        String saasId = map.get("saasId");
        if(StringUtils.isNotBlank(saasId)){
            filters.put("saasId",saasId);
        }
        String filterStr = JSONObject.fromObject(filters).toString();
        req.put("filters",filterStr);
        Envelop forObject = template.getForObject(url + WechatContants.WxTemplate.api_getWxTemplates+"?size={size}&page={page}&sorts={sorts}&filters={filters}", Envelop.class,req);
        return forObject;
    }
    public Envelop deleteByCode(String codes,String userCode) {
        //delete 没有返回值....
        //template.delete(url + "/graphicMessage/delete?codes={codes}", codes);
        MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        Map<String, String> par = new HashMap<>();
        par.put("userCode", userCode);
        par.put("userName", userName);
        String urlRequest = url + "/template/"+codes+"?userCode={userCode}&userName={userName}";
        RestTemplateUtil restTemplateUtil = new RestTemplateUtil(urlRequest,map);
        Envelop envelop = restTemplateUtil.exchange(urlRequest, HttpMethod.DELETE, Envelop.class,par);
        return envelop;
    }
    public Envelop findByCode(String code) {
        Envelop envelop = template.getForObject(url + "/template/"+code, Envelop.class);
        return envelop;
    }
    public Envelop saveOrUpdate(MWxTemplate temp, String userCode) throws JsonProcessingException {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        //设置值
        if(temp.getId()==null){
            temp.setCreateUser(userCode);
            temp.setCreateUserName(userName);
        }
        temp.setUpdateUserName(userName);
        temp.setUpdateUser(userCode);
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        JSONObject jsonObj = JSONObject.fromObject(temp);
        HttpEntity<String> formEntity = new HttpEntity<String>(jsonObj.toString(), headers);
        Envelop envelop =null;
        if(temp.getId()==null){//说明是保存
            ResponseEntity<Envelop> responseEntity = template.postForEntity(url + WechatContants.WxTemplate.api_create, formEntity, Envelop.class);
            envelop = responseEntity.getBody();
            return envelop;
        }
        ResponseEntity<Envelop> resp = template.exchange(url + WechatContants.WxTemplate.api_update,HttpMethod.PUT,formEntity,Envelop.class);
        envelop = resp.getBody();
        return envelop;
    }
    public Envelop getListNoPage(Map<String,String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        String wechatCode = map.get("wechatCode");
        if(StringUtils.isNotBlank(wechatCode)){
            filters.put("wechatCode",wechatCode);
        }
        req.put("filters",JSONObject.fromObject(filters).toString());
        Envelop envelop = template.getForObject(url + WechatContants.WxTemplate.api_getWxTemplatesNoPage+"?filters={filters}", Envelop.class,req);
        return envelop;
    }
}

+ 116 - 0
svr/svr-manage/src/main/java/com/yihu/jw/manage/service/wechat/WechatMenuService.java

@ -0,0 +1,116 @@
package com.yihu.jw.manage.service.wechat;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.yihu.jw.manage.model.system.ManageUser;
import com.yihu.jw.manage.service.system.UserService;
import com.yihu.jw.manage.util.RestTemplateUtil;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.wx.MWxMenu;
import com.yihu.jw.restmodel.wx.WechatContants;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by Administrator on 2017/6/13 0013.
 */
@Service
public class WechatMenuService {
    @Value("${spring.gateway}"+ WechatContants.api_common)
    private String url;
    @Autowired
    private RestTemplate template;
    @Autowired
    private UserService userService;
    public Envelop list(Integer size, Integer page,Map<String,String> map) {
        Map<String, Object> req = new HashMap<>();
        Map<String, Object> filters = new HashMap<>();
        req.put("size",size);
        req.put("page",page);
        req.put("sorts","");
        String name = map.get("name");
        if(StringUtils.isNotBlank(name)){
            filters.put("name",name);
        }
        String saasId = map.get("saasId");
        if(StringUtils.isNotBlank(saasId)){
            filters.put("saasId",saasId);
        }
        req.put("filters", JSONObject.fromObject(filters).toString());
        String requestUrl = url +WechatContants.WxMenu.api_getWxMenus + "?size={size}&page={page}&sorts={sorts}&filters={filters}";
        Envelop forObject = template.getForObject(requestUrl,
                Envelop.class,req);
        return forObject;
    }
    public Envelop deleteByCode(String codes,String userCode) {
        //delete 没有返回值....
        //template.delete(url + "/graphicMessage/delete?codes={codes}", codes);
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        Map<String, String> map = new HashMap<>();
        map.put("userCode", userCode);
        map.put("userName", userName);
        String urlRequest = url + "/menu/"+codes+"/"+userCode+"?userCode={userCode}&userName={userName}";
        RestTemplateUtil restTemplateUtil = new RestTemplateUtil(urlRequest,null);
        Envelop envelop = restTemplateUtil.exchange(urlRequest, HttpMethod.DELETE, Envelop.class,map);
        return envelop;
    }
    public Envelop findByCode(String code) {
        Envelop envelop = template.getForObject(url + "/menu/"+code, Envelop.class);
        return envelop;
    }
    public Envelop saveOrUpdate(MWxMenu menu,String userCode) throws JsonProcessingException {
        ManageUser user = userService.findByCode(userCode);
        String userName = user.getName();
        //设置值
        if(menu.getId()==null){
            menu.setCreateUser(userCode);
            menu.setCreateUserName(userName);
        }
        menu.setUpdateUserName(userName);
        menu.setUpdateUser(userCode);
        menu.setStatus(1);
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        JSONObject jsonObj = JSONObject.fromObject(menu);
        HttpEntity<String> formEntity = new HttpEntity<String>(jsonObj.toString(), headers);
        Envelop envelop =null;
        if(menu.getId()==null){//说明是保存
            ResponseEntity<Envelop> responseEntity = template.postForEntity(url + WechatContants.WxMenu.api_create, formEntity, Envelop.class);
            envelop = responseEntity.getBody();
            return envelop;
        }
        ResponseEntity<Envelop> resp = template.exchange(url +  WechatContants.WxMenu.api_update,HttpMethod.PUT,formEntity,Envelop.class);
        envelop = resp.getBody();
        return envelop;
    }
    public Envelop getParentMenu(String wechatCode) {
        Envelop envelop = template.getForObject(url + "/parentMenu/"+wechatCode, Envelop.class);
        return envelop;
    }
    public Envelop getChildMenus(String parentCode) {
        Envelop envelop = template.getForObject(url + "/childMenu/list/"+parentCode, Envelop.class);
        return envelop;
    }
}

+ 12 - 0
svr/svr-manage/src/main/resources/webapp/common/css/jw.css

@ -0,0 +1,12 @@
/* 解决弹窗输入时变透明*/
.modal-content {
    border:0px !important ;
}
.form-control{
    width: 250px;
}
/* easyui  grid  行高*/
.datagrid-row {
    height: 34px !important ;
}

BIN
svr/svr-manage/src/main/resources/webapp/common/img/a1.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/a2.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/a3.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/a4.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/a5.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/a6.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/a7.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/a8.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/a9.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/iconfont-logo.png


BIN
svr/svr-manage/src/main/resources/webapp/common/img/index.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/index_4.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/locked.png


BIN
svr/svr-manage/src/main/resources/webapp/common/img/login-background.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/p1.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/p2.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/p3.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/p_big1.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/p_big2.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/p_big3.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/profile.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/profile_big.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/profile_small.jpg


BIN
svr/svr-manage/src/main/resources/webapp/common/img/qr_code.png


BIN
svr/svr-manage/src/main/resources/webapp/common/img/user.png


BIN
svr/svr-manage/src/main/resources/webapp/common/img/wenku_logo.png


+ 339 - 0
svr/svr-manage/src/main/resources/webapp/common/js/bootstrap/modal.js

@ -0,0 +1,339 @@
/* ========================================================================
 * Bootstrap: modal.js v3.3.4
 * http://getbootstrap.com/javascript/#modals
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */
+function ($) {
  'use strict';
  // MODAL CLASS DEFINITION
  // ======================
  var Modal = function (element, options) {
    this.options             = options
    this.$body               = $(document.body)
    this.$element            = $(element)
    this.$dialog             = this.$element.find('.modal-dialog')
    this.$backdrop           = null
    this.isShown             = null
    this.originalBodyPad     = null
    this.scrollbarWidth      = 0
    this.ignoreBackdropClick = false
    if (this.options.remote) {
      this.$element
        .find('.modal-content')
        .load(this.options.remote, $.proxy(function () {
          this.$element.trigger('loaded.bs.modal')
        }, this))
    }
  }
  Modal.VERSION  = '3.3.4'
  Modal.TRANSITION_DURATION = 300
  Modal.BACKDROP_TRANSITION_DURATION = 150
  Modal.DEFAULTS = {
    backdrop: true,
    keyboard: true,
    show: true
  }
  Modal.prototype.toggle = function (_relatedTarget) {
    return this.isShown ? this.hide() : this.show(_relatedTarget)
  }
  Modal.prototype.show = function (_relatedTarget) {
    var that = this
    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
    this.$element.trigger(e)
    if (this.isShown || e.isDefaultPrevented()) return
    this.isShown = true
    this.checkScrollbar()
    this.setScrollbar()
    this.$body.addClass('modal-open')
    this.escape()
    this.resize()
    this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
    this.$dialog.on('mousedown.dismiss.bs.modal', function () {
      that.$element.one('mouseup.dismiss.bs.modal', function (e) {
        if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
      })
    })
    this.backdrop(function () {
      var transition = $.support.transition && that.$element.hasClass('fade')
      if (!that.$element.parent().length) {
        that.$element.appendTo(that.$body) // don't move modals dom position
      }
      that.$element
        .show()
        .scrollTop(0)
      that.adjustDialog()
      if (transition) {
        that.$element[0].offsetWidth // force reflow
      }
      that.$element
        .addClass('in')
        .attr('aria-hidden', false)
      that.enforceFocus()
      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
      transition ?
        that.$dialog // wait for modal to slide in
          .one('bsTransitionEnd', function () {
            that.$element.trigger('focus').trigger(e)
          })
          .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
        that.$element.trigger('focus').trigger(e)
    })
  }
  Modal.prototype.hide = function (e) {
    if (e) e.preventDefault()
    e = $.Event('hide.bs.modal')
    this.$element.trigger(e)
    if (!this.isShown || e.isDefaultPrevented()) return
    this.isShown = false
    this.escape()
    this.resize()
    $(document).off('focusin.bs.modal')
    this.$element
      .removeClass('in')
      .attr('aria-hidden', true)
      .off('click.dismiss.bs.modal')
      .off('mouseup.dismiss.bs.modal')
    this.$dialog.off('mousedown.dismiss.bs.modal')
    $.support.transition && this.$element.hasClass('fade') ?
      this.$element
        .one('bsTransitionEnd', $.proxy(this.hideModal, this))
        .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
      this.hideModal()
  }
  Modal.prototype.enforceFocus = function () {
    $(document)
      .off('focusin.bs.modal') // guard against infinite focus loop
      .on('focusin.bs.modal', $.proxy(function (e) {
        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
          this.$element.trigger('focus')
        }
      }, this))
  }
  Modal.prototype.escape = function () {
    if (this.isShown && this.options.keyboard) {
      this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
        e.which == 27 && this.hide()
      }, this))
    } else if (!this.isShown) {
      this.$element.off('keydown.dismiss.bs.modal')
    }
  }
  Modal.prototype.resize = function () {
    if (this.isShown) {
      $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
    } else {
      $(window).off('resize.bs.modal')
    }
  }
  Modal.prototype.hideModal = function () {
    var that = this
    this.$element.hide()
    this.backdrop(function () {
      that.$body.removeClass('modal-open')
      that.resetAdjustments()
      that.resetScrollbar()
      that.$element.trigger('hidden.bs.modal')
    })
  }
  Modal.prototype.removeBackdrop = function () {
    this.$backdrop && this.$backdrop.remove()
    this.$backdrop = null
  }
  Modal.prototype.backdrop = function (callback) {
    var that = this
    var animate = this.$element.hasClass('fade') ? 'fade' : ''
    if (this.isShown && this.options.backdrop) {
      var doAnimate = $.support.transition && animate
      this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
        .appendTo(this.$body)
      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
        if (this.ignoreBackdropClick) {
          this.ignoreBackdropClick = false
          return
        }
        if (e.target !== e.currentTarget) return
        this.options.backdrop == 'static'
          ? this.$element[0].focus()
          : this.hide()
      }, this))
      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
      this.$backdrop.addClass('in')
      if (!callback) return
      doAnimate ?
        this.$backdrop
          .one('bsTransitionEnd', callback)
          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
        callback()
    } else if (!this.isShown && this.$backdrop) {
      this.$backdrop.removeClass('in')
      var callbackRemove = function () {
        that.removeBackdrop()
        callback && callback()
      }
      $.support.transition && this.$element.hasClass('fade') ?
        this.$backdrop
          .one('bsTransitionEnd', callbackRemove)
          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
        callbackRemove()
    } else if (callback) {
      callback()
    }
  }
  // these following methods are used to handle overflowing modals
  Modal.prototype.handleUpdate = function () {
    this.adjustDialog()
  }
  Modal.prototype.adjustDialog = function () {
    var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
    this.$element.css({
      paddingLeft:  !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
      paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
    })
  }
  Modal.prototype.resetAdjustments = function () {
    this.$element.css({
      paddingLeft: '',
      paddingRight: ''
    })
  }
  Modal.prototype.checkScrollbar = function () {
    var fullWindowWidth = window.innerWidth
    if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
      var documentElementRect = document.documentElement.getBoundingClientRect()
      fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
    }
    this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
    this.scrollbarWidth = this.measureScrollbar()
  }
  Modal.prototype.setScrollbar = function () {
    var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
    this.originalBodyPad = document.body.style.paddingRight || ''
    if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
  }
  Modal.prototype.resetScrollbar = function () {
    this.$body.css('padding-right', this.originalBodyPad)
  }
  Modal.prototype.measureScrollbar = function () { // thx walsh
    var scrollDiv = document.createElement('div')
    scrollDiv.className = 'modal-scrollbar-measure'
    this.$body.append(scrollDiv)
    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
    this.$body[0].removeChild(scrollDiv)
    return scrollbarWidth
  }
  // MODAL PLUGIN DEFINITION
  // =======================
  function Plugin(option, _relatedTarget) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.modal')
      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
      if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
      if (typeof option == 'string') data[option](_relatedTarget)
      else if (options.show) data.show(_relatedTarget)
    })
  }
  var old = $.fn.modal
  $.fn.modal             = Plugin
  $.fn.modal.Constructor = Modal
  // MODAL NO CONFLICT
  // =================
  $.fn.modal.noConflict = function () {
    $.fn.modal = old
    return this
  }
  // MODAL DATA-API
  // ==============
  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
    var $this   = $(this)
    var href    = $this.attr('href')
    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
    var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
    if ($this.is('a')) e.preventDefault()
    $target.one('show.bs.modal', function (showEvent) {
      if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
      $target.one('hidden.bs.modal', function () {
        $this.is(':visible') && $this.trigger('focus')
      })
    })
    Plugin.call($target, option, this)
  })
}(jQuery);

+ 569 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/changelog.txt

@ -0,0 +1,569 @@
Version 1.5.2
-------------
* Bug
 * form: The initialized value of the inputing box will disappear after calling the 'reset' method. fixed.
 * textbox: Calling the 'destroy' method does not clean the field label. fixed.
 * datagrid: Calling the 'selectRow' method on an unexisting row causes undesired record set. fixed.
* Improvement
 * datagrid: The ctrl selection is supported on Mac keyboards.
 * datagrid: The 'scrollOnSelect' property is available for the user to determine whether to scroll to the specified row when selecting it.
 * combotree: Add the 'textField' property.
 * combotreegrid: Add the 'textField' property.
 * pagination: Add 'showPageInfo' property.
 * panel: Add 'halign' and 'titleDirection' properties to allow the user to align the panel header to left or right side.
 * accordion: Add 'halign' property to build the horizontal accordion.
 * tagbox: The 'required' propery can be applied to validate whether the value is empty.
Version 1.5.1
-------------
* Bug
 * datagrid: The selecting and checking flags will lose after calling 'updateRow' method. fixed.
 * tabs: The trip tools have a wrong position when calling 'update' method. fixed.
 * window: When the height is set to 'auto', it will disappear after moving the window. fixed.
 * messager: When display the progress message window and then close it immediately, an exception occurs. fixed.
 * form: The 'clear' method does not clear the selected drop-down items of the combobox. fixed.
* Improvement
 * textbox: The 'cls' property is available to add a custom style to textbox.
 * numberbox: Allow the user to format currency in Italian.
 * combo: Add 'multivalue' property that allows the user to determine how to submit the multiple values.
 * combobox: Add 'reversed' property.
 * combobox: Add 'onClick' event.
 * combogrid: Add 'reversed' property.
 * treegrid: Enable multiple selection with the shift key.
* New Plugins
 * tagbox: Allows the user to add tags to a form field.
Version 1.5
-------------
* Bug
 * combobox: The 'onSelect' event does not fire when load data that contains the selected item. fixed.
 * datagrid: The 'updateRow' method sometimes does not work properly when the field is set to a blank value. fixed.
* Improvement
 * A label can be associated to any form fields.
 * combobox: Enhance the 'select' and 'unselect' rules on the drop-down items.
 * combobox: Add 'limitToList' property to limit the inputed values to the listed items.
 * combogrid: Allow the user to clone the component quickly.
 * form: Add the 'dirty' property that allows the user to submit the only changed fields.
 * form: Add 'resetDirty' method.
 * datagrid: Allow the user to display a message when there are no records to be shown.
 * textbox: Add 'label','labelWidth','labelPosition' and 'labelAlign' properties.
 * spinner: Add 'spinAlign' property.
 * calendar: Allow the user to display week number of the year.
 * window: Add 'constrain' property.
* New Plugins
 * passwordbox: The plugin that allows the user to input passwords with nice feedback.
 * combotreegrid: Combines combobox with drop-down treegrid component.
Version 1.4.5
-------------
* Bug
 * datagrid: The 'getChanges' method does not return the updated rows after calling 'updateRow' method. fixed.
 * treegrid: The 'onLoadSuccess' event fires when append or insert a row. fixed.
 * tree: The 'onLoadSuccess' event fires when append or insert a node. fixed.
* Improvement
 * window: The displaying style can be customized.
 * window: The 'border' property allows the user to set different border style.
 * navpanel: The 'href' property is enabled to load content from remote server.
 * combotree: The 'setValue' and 'setValues' methods accept the paremter values in 'id' and 'text' pairs
 * combobox: Add 'showItemIcon' property.
 * combobox: Set 'groupPosition' property to 'sticky' to stick the item group to the top of drop-down panel.
 * messager: Pressing ENTER key on input box will trigger click event of the first button.
 * validatebox: Add 'editable',disabled' and 'readonly' properties.
 * validatebox: Add 'enable','disable','readonly' methods.
 * validatebox: Allow the user to determine how to display the error message.
 * filebox: Add 'accept' and 'multiple' properties.
 * form: Add 'iframe' property and 'onProgress' event.
 * treegrid: Add cascade checkbox selection.
 * treegrid: Add 'getCheckedNodes','checkNode' and 'uncheckNode' methods.
Version 1.4.4
-------------
* Bug
 * filebox: The 'clear' and 'reset' methods do not work properly in IE9. fixed.
 * messager: After calling $.messager.progress() with no arguments, the $.messager.progress('close') does not work properly. fixed.
 * timespinner: The value does not display properly in IE8 while clicking the spin buttons. fixed.
 * window: The window does not display when calling 'options' method in 'onMove' event. fixed.
 * treegrid: The 'getLevel' method does not accept the parameter value of 0. fixed.
* Improvement
 * layout: The 'collapsedContent','expandMode' and 'hideExpandTool' properties are supported in region panel.
 * layout: The 'hideCollapsedContent' property can be set to display the vertical title bar on collapsed panel.
 * layout: Add 'onCollapse','onExpand','onAdd','onRemove' events.
 * datagrid: Display the 'up-down' icon on the sortable columns.
 * datagrid: Add 'gotoPage' method.
 * propertygrid: Add 'groups' method that allows to get all the data groups.
 * messager: Auto scroll feature is supported when displaying long messages.
 * tabs: The 'disabled' property is supported when defining a disabled tab panel.
 * tabs: The percentange size is supported now.
Version 1.4.3
-------------
* Bug
 * textbox: The 'setText' method does not accept value 0. fixed.
 * timespinner: When running in IE11, the error occurs when clicking on the empty textbox. fixed.
 * tabs: The 'update' method can not update only the panel body. fixed.
* Improvement
 * combobox: Improve the performance of displaying the drop-down panel.
 * combogrid: Remember the displaying text when the drop-down datagrid go to other pages.
 * combogrid: The 'setValue' and 'setValues' methods accept a key-value object.
 * window: The inline window's mask can auto-stretch its size to fill parent container.
 * tabs: The 'showTool' and 'hideTool' methods are available for users to show or hide the tools.
 * layout: Allow the user to override the 'cls','headerCls' and 'bodyCls' property values.
* New Plugins
 * switchbutton: The switch button with two states:'on' and 'off'.
Version 1.4.2
-------------
* Bug
 * treegrid: The column will restore its size to original size after recreating the treegrid. fixed.
* Improvement
 * draggable: Add 'delay' property that allows the user to delay the drag operation.
 * tree: Add 'filter' property and 'doFilter' method.
 * tabs: The 'add' method allows the user to insert a tab panel at a specified index.
 * tabs: The user can determine what tab panel can be selected.
 * tabs: Add 'justified' and 'narrow' properties.
 * layout: Add 'unsplit' and 'split' methods.
 * messager: Keyboard navigation features are supported now.
 * form: Add 'onChange' event.
 * combobox: Add 'queryParams' property.
 * slider: Add 'range' property.
 * menu: Add 'itemHeight','inline','noline' properties.
 * panel: The 'header' property allows the user to customize the panel header.
 * menubutton: Add 'hasDownArrow' property.
* New Plugins
 * datalist: The plugin to render items in a list.
 * navpanel: The root component for the mobile page.
 * mobile: The plugin to provide the mobile page stack management and navigation.
Version 1.4.1
-------------
* Bug
 * combogrid: The combogrid has different height than other combo components. fixed.
 * datagrid: The row element loses some class style value after calling 'updateRow' method. fixed.
 * menubutton: Calling 'enable' method on a disabled button can not work well. fixed.
 * form: The filebox components in the form do not work correctly after calling 'clear' method. fixed.
* Improvement
 * tabs: The 'update' method accepts 'type' option that allows the user to update the header,body,or both.
 * panel: Add 'openAnimation','openDuration','closeAnimation' and 'closeDuration' properties to set the animation for opening or closing a panel.
 * panel: Add 'footer' property that allows the user to add a footer bar to the bottom of panel.
 * datagrid: Calling 'endEdit' method will accept the editing value correctly.
 * datagrid: Add 'onBeforeSelect','onBeforeCheck','onBeforeUnselect','onBeforeUncheck' events.
 * propertygrid: The user can edit a row by calling 'beginEdit' method.
 * datebox: Add 'cloneFrom' method to create the datebox component quickly.
 * datetimebox: Add 'cloneFrom' method to create the datetimebox component quickly.
Version 1.4
-------------
* Bug
 * menu: The menu should not has a correct height when removed a menu item. fixed.
 * datagrid: The 'fitColumns' method does not work normally when the datarid width is too small. fixed.
* Improvement
 * The fluid/percentange size is supported now for all easyui components.
 * menu: Add 'showItem', 'hideItem' and 'resize' methods.
 * menu: Auto resize the height upon the window size.
 * menu: Add 'duration' property that allows the user to define duration time in milliseconds to hide menu.
 * validatebox: Add 'onBeforeValidate' and 'onValidate' events.
 * combo: Extended from textbox now.
 * combo: Add 'panelMinWidth','panelMaxWidth','panelMinHeight' and 'panelMaxHeight' properties.
 * searchbox: Extended from textbox now.
 * tree: The 'getRoot' method will return the top parent node of a specified node if pass a 'nodeEl' parameter.
 * tree: Add 'queryParams' property.
 * datetimebox: Add 'spinnerWidth' property.
 * panel: Add 'doLayout' method to cause the panel to lay out its components.
 * panel: Add 'clear' method to clear the panel's content.
 * datagrid: The user is allowed to assign percent width to columns.
 * form: Add 'ajax','novalidate' and 'queryParams' properties.
 * linkbutton: Add 'resize' method.
* New Plugins
 * textbox: A enhanced input field that allows users build their form easily.
 * datetimespinner: A date and time spinner that allows to pick a specific day.
 * filebox: The filebox component represents a file field of the forms.
Version 1.3.6
-------------
* Bug
 * treegrid: The 'getChecked' method can not return correct checked rows. fixed.
 * tree: The checkbox does not display properly on async tree when 'onlyLeafCheck' property is true. fixed.
* Improvement
 * treegrid: All the selecting and checking methods are extended from datagrid component.
 * linkbutton: The icon alignment is fully supported, possible values are: 'top','bottom','left','right'.
 * linkbutton: Add 'size' property, possible values are: 'small','large'.
 * linkbutton: Add 'onClick' event.
 * menubutton: Add 'menuAlign' property that allows the user set top level menu alignment.
 * combo: Add 'panelAlign' property, possible values are: 'left','right'.
 * calendar: The 'formatter','styler' and 'validator' options are available to custom the calendar dates.
 * calendar: Add 'onChange' event.
 * panel: Add 'method','queryParams' and 'loader' options.
 * panel: Add 'onLoadError' event.
 * datagrid: Add 'onBeginEdit' event that fires when a row goes into edit mode.
 * datagrid: Add 'onEndEdit' event that fires when finishing editing but before destroying editors.
 * datagrid: Add 'sort' method and 'onBeforeSortColumn' event.
 * datagrid: The 'combogrid' editor has been integrated into datagrid.
 * datagrid: Add 'ctrlSelect' property that only allows multi-selection when ctrl+click is used.
 * slider: Add 'converter' option that allows users determine how to convert a value to the slider position or the slider position to the value.
 * searchbox: Add 'disabled' property.
 * searchbox: Add 'disable','enable','clear','reset' methods.
 * spinner: Add 'readonly' property, 'readonly' method and 'onChange' event.
Version 1.3.5
-------------
* Bug
 * searchbox: The 'searcher' function can not offer 'name' parameter value correctly. fixed.
 * combo: The 'isValid' method can not return boolean value. fixed.
 * combo: Clicking combo will trigger the 'onHidePanel' event of other combo components that have hidden drop-down panels. fixed.
 * combogrid: Some methods can not inherit from combo. fixed.
* Improvement
 * datagrid: Improve performance on checking rows.
 * menu: Allows to append a menu separator.
 * menu: Add 'hideOnUnhover' property to indicate if the menu should be hidden when mouse exits it.
 * slider: Add 'clear' and 'reset' methods.
 * tabs: Add 'unselect' method that will trigger 'onUnselect' event.
 * tabs: Add 'selected' property to specify what tab panel will be opened.
 * tabs: The 'collapsible' property of tab panel is supported to determine if the tab panel can be collapsed.
 * tabs: Add 'showHeader' property, 'showHeader' and 'hideHeader' methods.
 * combobox: The 'disabled' property can be used to disable some items.
 * tree: Improve loading performance.
 * pagination: The 'layout' property can be used to customize the pagination layout.
 * accordion: Add 'unselect' method that will trigger 'onUnselect' event.
 * accordion: Add 'selected' and 'multiple' properties.
 * accordion: Add 'getSelections' method.
 * datebox: Add 'sharedCalendar' property that allows multiple datebox components share one calendar component.
Version 1.3.4
-------------
* Bug
 * combobox: The onLoadSuccess event fires when parsing empty local data. fixed.
 * form: Calling 'reset' method can not reset datebox field. fixed.
* Improvement
 * mobile: The context menu and double click features are supported on mobile devices.
 * combobox: The 'groupField' and 'groupFormatter' options are available to display items in groups.
 * tree: When append or insert nodes, the 'data' parameter accepts one or more nodes data.
 * tree: The 'getChecked' method accepts a single 'state' or an array of 'state'.
 * tree: Add 'scrollTo' method.
 * datagrid: The 'multiSort' property is added to support multiple column sorting.
 * datagrid: The 'rowStyler' and column 'styler' can return CSS class name or inline styles.
 * treegrid: Add 'load' method to load data and navigate to the first page.
 * tabs: Add 'tabWidth' and 'tabHeight' properties.
 * validatebox: The 'novalidate' property is available to indicate whether to perform the validation.
 * validatebox: Add 'enableValidation' and 'disableValidation' methods.
 * form: Add 'enableValidation' and 'disableValidation' methods.
 * slider: Add 'onComplete' event.
 * pagination: The 'buttons' property accepts the existing element.
Version 1.3.3
-------------
* Bug
 * datagrid: Some style features are not supported by column styler function. fixed.
 * datagrid: IE 31 stylesheet limit. fixed.
 * treegrid: Some style features are not supported by column styler function. fixed.
 * menu: The auto width of menu item displays incorrect in ie6. fixed.
 * combo: The 'onHidePanel' event can not fire when clicked outside the combo area. fixed. 
* Improvement
 * datagrid: Add 'scrollTo' and 'highlightRow' methods.
 * treegrid: Enable treegrid to parse data from <tbody> element.
 * combo: Add 'selectOnNavigation' and 'readonly' options.
 * combobox: Add 'loadFilter' option to allow users to change data format before loading into combobox.
 * tree: Add 'onBeforeDrop' callback event.
 * validatebox: Dependent on tooltip plugin now, add 'deltaX' property.
 * numberbox: The 'filter' options can be used to determine if the key pressed was accepted.
 * linkbutton: The group button is available.
 * layout: The 'minWidth','maxWidth','minHeight','maxHeight' and 'collapsible' properties are available for region panel.
* New Plugins
 * tooltip: Display a popup message when moving mouse over an element.
 
Version 1.3.2
-------------
* Bug
 * datagrid: The loading message window can not be centered when changing the width of datagrid. fixed.
 * treegrid: The 'mergeCells' method can not work normally. fixed.
 * propertygrid: Calling 'endEdit' method to stop editing a row will cause errors. fixed.
 * tree: Can not load empty data when 'lines' property set to true. fixed.
* Improvement
 * RTL feature is supported now.
 * tabs: Add 'scrollBy' method to scroll the tab header by the specified amount of pixels
 * tabs: Add 'toolPosition' property to set tab tools to left or right.
 * tabs: Add 'tabPosition' property to define the tab position, possible values are: 'top','bottom','left','right'.
 * datagrid: Add a column level property 'order' that allows users to define different default sort order per column.
 * datagrid: Add a column level property 'halign' that allows users to define how to align the column header.
 * datagrid: Add 'resizeHandle' property to define the resizing column position, by grabbing the left or right edge of the column.
 * datagrid: Add 'freezeRow' method to freeze some rows that will always be displayed at the top when the datagrid is scrolled down.
 * datagrid: Add 'clearChecked' method to clear all checked records.
 * datagrid: Add 'data' property to initialize the datagrid data.
 * linkbutton: Add 'iconAlgin' property to define the icon position, supported values are: 'left','right'.
 * menu: Add 'minWidth' property.
 * menu: The menu width can be automatically calculated.
 * tree: New events are available including 'onBeforeDrag','onStartDrag','onDragEnter','onDragOver','onDragLeave',etc.
 * combo: Add 'height' property to allow users to define the height of combo.
 * combo: Add 'reset' method.
 * numberbox: Add 'reset' method.
 * spinner: Add 'reset' method.
 * spinner: Add 'height' property to allow users to define the height of spinner.
 * searchbox: Add 'height' property to allow users to define the height of searchbox.
 * form: Add 'reset' method.
 * validatebox: Add 'delay' property to delay validating from the last inputting value.
 * validatebox: Add 'tipPosition' property to define the tip position, supported values are: 'left','right'.
 * validatebox: Multiple validate rules on a field is supported now.
 * slider: Add 'reversed' property to determine if the min value and max value will switch their positions.
 * progressbar: Add 'height' property to allow users to define the height of progressbar.
Version 1.3.1
-------------
* Bug
 * datagrid: Setting the 'pageNumber' property is not valid. fixed.
 * datagrid: The id attribute of rows isn't adjusted properly while calling 'insertRow' or 'deleteRow' method.
 * dialog: When load content from 'href', the script will run twice. fixed.
 * propertygrid: The editors that extended from combo can not accept its changed value. fixed.
* Improvement
 * droppable: Add 'disabled' property.
 * droppable: Add 'options','enable' and 'disable' methods.
 * tabs: The tab panel tools can be changed by calling 'update' method.
 * messager: When show a message window, the user can define the window position by applying 'style' property.
 * window: Prevent script on window body from running twice.
 * window: Add 'hcenter','vcenter' and 'center' methods.
 * tree: Add 'onBeforeCheck' callback event.
 * tree: Extend the 'getChecked' method to allow users to get 'checked','unchecked' or 'indeterminate' nodes.
 * treegrid: Add 'update' method to update a specified node.
 * treegrid: Add 'insert' method to insert a new node.
 * treegrid: Add 'pop' method to remove a node and get the removed node data.
Version 1.3
-----------
* Bug
 * combogrid: When set to 'remote' query mode, the 'queryParams' parameters can't be sent to server. fixed.
 * combotree: The tree nodes on drop-down panel can not be unchecked while calling 'clear' method. fixed.
 * datetimebox: Setting 'showSeconds' property to false cannot hide seconds info. fixed.
 * datagrid: Calling 'mergeCells' method can't auto resize the merged cell while header is hidden. fixed.
 * dialog: Set cache to false and load data via ajax, the content cannot be refreshed. fixed.
* Improvement
 * The HTML5 'data-options' attribute is available for components to declare all custom options, including properties and events.
 * More detailed documentation is available.
 * panel: Prevent script on panel body from running twice.
 * accordion: Add 'getPanelIndex' method.
 * accordion: The tools can be added on panel header.
 * datetimebox: Add 'timeSeparator' option that allows users to define the time separator.
 * pagination: Add 'refresh' and 'select' methods.
 * datagrid: Auto resize the column width to fit the contents when the column width is not defined.
 * datagrid: Double click on the right border of columns to auto resize the columns to the contents in the columns.
 * datagrid: Add 'autoSizeColumn' method that allows users to adjust the column width to fit the contents.
 * datagrid: Add 'getChecked' method to get all rows where the checkbox has been checked.
 * datagrid: Add 'selectOnCheck' and 'checkOnSelect' properties and some checking methods to enhance the row selections.
 * datagrid: Add 'pagePosition' property to allow users to display pager bar at either top,bottom or both places of the grid.
 * datagrid: The buffer view and virtual scroll view are supported to display large amounts of records without pagination.
 * tabs: Add 'disableTab' and 'enableTab' methods to allow users to disable or enable a tab panel.
Version 1.2.6
-------------
* Bug
 * tabs: Call 'add' method with 'selected:false' option, the added tab panel is always selected. fixed.
 * treegrid: The 'onSelect' and 'onUnselect' events can't be triggered. fixed.
 * treegrid: Cannot display zero value field. fixed. 
* Improvement
 * propertygrid: Add 'expandGroup' and 'collapseGroup' methods.
 * layout: Allow users to create collapsed layout panels by assigning 'collapsed' property to true.
 * layout: Add 'add' and 'remove' methods that allow users to dynamically add or remove region panel.
 * layout: Additional tool icons can be added on region panel header.
 * calendar: Add 'firstDay' option that allow users to set first day of week. Sunday is 0, Monday is 1, ...
 * tree: Add 'lines' option, true to display tree lines. 
 * tree: Add 'loadFilter' option that allow users to change data format before loading into the tree.
 * tree: Add 'loader' option that allow users to define how to load data from remote server.
 * treegrid: Add 'onClickCell' and 'onDblClickCell' callback function options.
 * datagrid: Add 'autoRowHeight' property that allow users to determine if set the row height based on the contents of that row.
 * datagrid: Improve performance to load large data set.
 * datagrid: Add 'loader' option that allow users to define how to load data from remote server.
 * treegrid: Add 'loader' option that allow users to define how to load data from remote server.
 * combobox: Add 'onBeforeLoad' callback event function.
 * combobox: Add 'loader' option that allow users to define how to load data from remote server.
 * Add support for other loading mode such as dwr,xml,etc.
* New Plugins
 * slider: Allows the user to choose a numeric value from a finite range.
Version 1.2.5
-------------
* Bug
 * tabs: When add a new tab panel with href property, the content page is loaded twice. fixed.
 * form: Failed to call 'load' method to load form input with complex name. fixed.
 * draggable: End drag in ie9, the cursor cannot be restored. fixed.
* Improvement
 * panel: The tools can be defined via html markup.
 * tabs: Call 'close' method to close specified tab panel, users can pass tab title or index of tab panel. Other methods such 'select','getTab' and 'exists' are similar to 'close' method.
 * tabs: Add 'getTabIndex' method.
 * tabs: Users can define mini tools on tabs.
 * tree: The mouse must move a specified distance to begin drag and drop operation.
 * resizable: Add 'options','enable' and 'disable' methods.
 * numberbox: Allow users to change number format.
 * datagrid: The subgrid is supported now.
 * searchbox: Add 'selectName' method to select searching type name.
Version 1.2.4
-------------
* Bug
 * menu: The menu position is wrong when scroll bar appears. fixed.
 * accordion: Cannot display the default selected panel in jQuery 1.6.2. fixed.
 * tabs: Cannot display the default selected tab panel in jQuery 1.6.2. fixed.
* Improvement
 * menu: Allow users to disable or enable menu item.
 * combo: Add 'delay' property to set the delay time to do searching from the last key input event.
 * treegrid: The 'getEditors' and 'getEditor' methods are supported now.
 * treegrid: The 'loadFilter' option is supported now.
 * messager: Add 'progress' method to display a message box with a progress bar.
 * panel: Add 'extractor' option to allow users to extract panel content from ajax response.
* New Plugins
 * searchbox: Allow users to type words into box and do searching operation.
 * progressbar: To display the progress of a task.
 
Version 1.2.3
-------------
* Bug
 * window: Cannot resize the window with iframe content. fixed.
 * tree: The node will be removed when dragging to its child. fixed.
 * combogrid: The onChange event fires multiple times. fixed.
 * accordion: Cannot add batch new panels when animate property is set to true. fixed.
* Improvement
 * treegrid: The footer row and row styler features are supported now.
 * treegrid: Add 'getLevel','reloadFooter','getFooterRows' methods.
 * treegrid: Support root nodes pagination and editable features.
 * datagrid: Add 'getFooterRows','reloadFooter','insertRow' methods and improve editing performance.
 * datagrid: Add 'loadFilter' option that allow users to change original source data to standard data format.
 * draggable: Add 'onBeforeDrag' callback event function.
 * validatebox: Add 'remote' validation type.
 * combobox: Add 'method' option.
* New Plugins
 * propertygrid: Allow users to edit property value in datagrid. 
Version 1.2.2
-------------
* Bug
 * datagrid: Apply fitColumns cannot work fine while set checkbox column. fixed.
 * datagrid: The validateRow method cannot return boolean type value. fixed.
 * numberbox: Cannot fix value in chrome when min or max property isn't defined. fixed.
* Improvement
 * menu: Add some crud methods.
 * combo: Add hasDownArrow property to determine whether to display the down arrow button.
 * tree: Supports inline editing.
 * calendar: Add some useful methods such as 'resize', 'moveTo' etc.
 * timespinner: Add some useful methods.
 * datebox: Refactoring based on combo and calendar plugin now.
 * datagrid: Allow users to change row style in some conditions.
 * datagrid: Users can use the footer row to display summary information.
* New Plugins
 * datetimebox: Combines datebox with timespinner component.
  
Version 1.2.1
-------------
* Bug
 * easyloader: Some dependencies cannot be loaded by their order. fixed.
 * tree: The checkbox is setted incorrectly when removing a node. fixed.
 * dialog: The dialog layout incorrectly when 'closed' property is setted to true. fixed.
* Improvement
 * parser: Add onComplete callback function that can indicate whether the parse action is complete.
 * menu: Add onClick callback function and some other methods.
 * tree: Add some useful methods.
 * tree: Drag and Drop feature is supported now.
 * tree: Add onContextMenu callback function.
 * tabs: Add onContextMenu callback function.
 * tabs: Add 'tools' property that can create buttons on right bar.
 * datagrid: Add onHeaderContextMenu and onRowContextMenu callback functions.
 * datagrid: Custom view is supported.
 * treegrid: Add onContextMenu callback function and append,remove methods.
  
Version 1.2
-------------
* Improvement
 * tree: Add cascadeCheck,onlyLeafCheck properties and select event.
 * combobox: Enable multiple selection.
 * combotree: Enable multiple selection.
 * tabs: Remember the trace of selection, when current tab panel is closed, the previous selected tab will be selected.
 * datagrid: Extend from panel, so many properties defined in panel can be used for datagrid.
* New Plugins
 * treegrid: Represent tabular data in hierarchical view, combines tree view and datagrid.
 * combo: The basic component that allow user to extend their combo component such as combobox,combotree,etc.
 * combogrid: Combines combobox with drop-down datagrid component.
 * spinner: The basic plugin to create numberspinner,timespinner,etc.
 * numberspinner: The numberbox that allow user to change value by clicking up and down spin buttons.
 * timespinner: The time selector that allow user to quickly inc/dec a time.
 
Version 1.1.2
-------------
* Bug
 * messager: When call show method in layout, the message window will be blocked. fixed.
* Improvement
 * datagrid: Add validateRow method, remember the current editing row status when do editing action.
 * datagrid: Add the ability to create merged cells.
 * form: Add callback functions when loading data.
 * panel,window,dialog: Add maximize,minimize,restore,collapse,expand methods.
 * panel,tabs,accordion: The lazy loading feature is supported.
 * tabs: Add getSelected,update,getTab methods.
 * accordion: Add crud methods.
 * linkbutton: Accept an id option to set the id attribute.
 * tree: Enhance tree node operation.
 
Version 1.1.1
-------------
* Bug
 * form: Cannot clear the value of combobox and combotree component. fixed.
* Improvement
 * tree: Add some useful methods such as 'getRoot','getChildren','update',etc.
 * datagrid: Add editable feature, improve performance while loading data.
 * datebox: Add destroy method.
 * combobox: Add destroy and clear method.
 * combotree: Add destroy and clear method.
 
Version 1.1
-------------
* Bug
 * messager: When call show method with timeout property setted, an error occurs while clicking the close button. fixed.
 * combobox: The editable property of combobox plugin is invalid. fixed.
 * window: The proxy box will not be removed when dragging or resizing exceed browser border in ie. fixed.
* Improvement
 * menu: The menu item can use <a> markup to display a different page.
 * tree: The tree node can use <a> markup to act as a tree menu.
 * pagination: Add some event on refresh button and page list.
 * datagrid: Add a 'param' parameter for reload method, with which users can pass query parameter when reload data.
 * numberbox: Add required validation support, the usage is same as validatebox plugin.
 * combobox: Add required validation support.
 * combotree: Add required validation support.
 * layout: Add some method that can get a region panel and attach event handlers.
* New Plugins
 * droppable: A droppable plugin that supports drag drop operation.
 * calendar: A calendar plugin that can either be embedded within a page or popup.
 * datebox: Combines a textbox with a calendar that let users to select date.
 * easyloader: A JavaScript loader that allows you to load plugin and their dependencies into your page.
 
Version 1.0.5
* Bug
 * panel: The fit property of panel performs incorrectly. fixed.
* Improvement
 * menu: Add a href attribute for menu item, with which user can display a different page in the current browser window.
 * form: Add a validate method to do validation for validatebox component.
 * dialog: The dialog can read collapsible,minimizable,maximizable and resizable attribute from markup.
* New Plugins
 * validatebox: A validation plugin that checks to make sure the user's input value is valid. 
 
Version 1.0.4
-------------
* Bug
 * panel: When panel is invisible, it is abnormal when resized. fixed.
 * panel: Memory leak in method 'destroy'. fixed.
 * messager: Memory leak when messager box is closed. fixed.
 * dialog: No onLoad event occurs when loading remote data. fixed.
* Improvement
 * panel: Add method 'setTitle'.
 * window: Add method 'setTitle'.
 * dialog: Add method 'setTitle'.
 * combotree: Add method 'getValue'.
 * combobox: Add method 'getValue'.
 * form: The 'load' method can load data and fill combobox and combotree field correctly.
 
Version 1.0.3
-------------
* Bug
 * menu: When menu is show in a DIV container, it will be cropped. fixed.
 * layout: If you collpase a region panel and then expand it immediately, the region panel will not show normally. fixed.
 * accordion: If no panel selected then the first one will become selected and the first panel's body height will not set correctly. fixed.
* Improvement
 * tree: Add some methods to support CRUD operation.
 * datagrid: Toolbar can accept a new property named 'disabled' to disable the specified tool button.
* New Plugins
 * combobox: Combines a textbox with a list of options that users are able to choose from.
 * combotree: Combines combobox with drop-down tree component.
 * numberbox: Make input element can only enter number char.
 * dialog: rewrite the dialog plugin, dialog can contains toolbar and buttons.

File diff suppressed because it is too large
+ 190 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/easyloader.js


File diff suppressed because it is too large
+ 16078 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/jquery.easyui.min.js


+ 141 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/jquery.easyui.mobile.js

@ -0,0 +1,141 @@
/**
 * jQuery EasyUI 1.5.2
 * 
 * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved.
 *
 * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
 * To use it on other terms please contact us: info@jeasyui.com
 *
 */
(function($){
$.fn.navpanel=function(_1,_2){
if(typeof _1=="string"){
var _3=$.fn.navpanel.methods[_1];
return _3?_3(this,_2):this.panel(_1,_2);
}else{
_1=_1||{};
return this.each(function(){
var _4=$.data(this,"navpanel");
if(_4){
$.extend(_4.options,_1);
}else{
_4=$.data(this,"navpanel",{options:$.extend({},$.fn.navpanel.defaults,$.fn.navpanel.parseOptions(this),_1)});
}
$(this).panel(_4.options);
});
}
};
$.fn.navpanel.methods={options:function(jq){
return $.data(jq[0],"navpanel").options;
}};
$.fn.navpanel.parseOptions=function(_5){
return $.extend({},$.fn.panel.parseOptions(_5),$.parser.parseOptions(_5,[]));
};
$.fn.navpanel.defaults=$.extend({},$.fn.panel.defaults,{fit:true,border:false,cls:"navpanel"});
$.parser.plugins.push("navpanel");
})(jQuery);
(function($){
$(function(){
$.mobile.init();
});
$.mobile={defaults:{animation:"slide",direction:"left",reverseDirections:{up:"down",down:"up",left:"right",right:"left"}},panels:[],init:function(_6){
$.mobile.panels=[];
var _7=$(_6||"body").children(".navpanel:visible");
if(_7.length){
_7.not(":first").children(".panel-body").navpanel("close");
var p=_7.eq(0).children(".panel-body");
$.mobile.panels.push({panel:p,animation:$.mobile.defaults.animation,direction:$.mobile.defaults.direction});
}
$(document).unbind(".mobile").bind("click.mobile",function(e){
var a=$(e.target).closest("a");
if(a.length){
var _8=$.parser.parseOptions(a[0],["animation","direction",{back:"boolean"}]);
if(_8.back){
$.mobile.back();
e.preventDefault();
}else{
var _9=$.trim(a.attr("href"));
if(/^#/.test(_9)){
var to=$(_9);
if(to.length&&to.hasClass("panel-body")){
$.mobile.go(to,_8.animation,_8.direction);
e.preventDefault();
}
}
}
}
});
$(window).unbind(".mobile").bind("hashchange.mobile",function(){
var _a=$.mobile.panels.length;
if(_a>1){
var _b=location.hash;
var p=$.mobile.panels[_a-2];
if(!_b||_b=="#&"+p.panel.attr("id")){
$.mobile._back();
}
}
});
},nav:function(_c,to,_d,_e){
if(window.WebKitAnimationEvent){
_d=_d!=undefined?_d:$.mobile.defaults.animation;
_e=_e!=undefined?_e:$.mobile.defaults.direction;
var _f="m-"+_d+(_e?"-"+_e:"");
var p1=$(_c).panel("open").panel("resize").panel("panel");
var p2=$(to).panel("open").panel("resize").panel("panel");
p1.add(p2).bind("webkitAnimationEnd",function(){
$(this).unbind("webkitAnimationEnd");
var p=$(this).children(".panel-body");
if($(this).hasClass("m-in")){
p.panel("open").panel("resize");
}else{
p.panel("close");
}
$(this).removeClass(_f+" m-in m-out");
});
p2.addClass(_f+" m-in");
p1.addClass(_f+" m-out");
}else{
$(to).panel("open").panel("resize");
$(_c).panel("close");
}
},_go:function(_10,_11,_12){
_11=_11!=undefined?_11:$.mobile.defaults.animation;
_12=_12!=undefined?_12:$.mobile.defaults.direction;
var _13=$.mobile.panels[$.mobile.panels.length-1].panel;
var to=$(_10);
if(_13[0]!=to[0]){
$.mobile.nav(_13,to,_11,_12);
$.mobile.panels.push({panel:to,animation:_11,direction:_12});
}
},_back:function(){
if($.mobile.panels.length<2){
return;
}
var p1=$.mobile.panels.pop();
var p2=$.mobile.panels[$.mobile.panels.length-1];
var _14=p1.animation;
var _15=$.mobile.defaults.reverseDirections[p1.direction]||"";
$.mobile.nav(p1.panel,p2.panel,_14,_15);
},go:function(_16,_17,_18){
_17=_17!=undefined?_17:$.mobile.defaults.animation;
_18=_18!=undefined?_18:$.mobile.defaults.direction;
location.hash="#&"+$(_16).attr("id");
$.mobile._go(_16,_17,_18);
},back:function(){
history.go(-1);
}};
$.map(["validatebox","textbox","passwordbox","filebox","searchbox","combo","combobox","combogrid","combotree","combotreegrid","datebox","datetimebox","numberbox","spinner","numberspinner","timespinner","datetimespinner"],function(_19){
if($.fn[_19]){
$.extend($.fn[_19].defaults,{iconWidth:28,tipPosition:"bottom"});
}
});
$.map(["spinner","numberspinner","timespinner","datetimespinner"],function(_1a){
if($.fn[_1a]){
$.extend($.fn[_1a].defaults,{iconWidth:56,spinAlign:"horizontal"});
}
});
if($.fn.menu){
$.extend($.fn.menu.defaults,{itemHeight:30,noline:true});
}
})(jQuery);

File diff suppressed because it is too large
+ 5 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/jquery.min.js


+ 14 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/license_freeware.txt

@ -0,0 +1,14 @@
This license agreement refers to jQuery EasyUI software - Freeware License.
jQuery EasyUI Team grants to you a limited, non-transferable and non-exclusive right to use, royalty-free, copy and redistribute the software.
The licensee has the right to use the software for a non-profit projects/sites. There are no limitations on the number of non-profit projects/sites you can use the software in, you can use it on any number of non-profit projects/sites you need. There is no time limit, you can use the software for any period of time you need. There is no restriction while you are developing your solution. There are no royalties of any kind involved.
The governmental entities are not allowed to use this freeware license.
The licensee is allowed to copy and redistribute the software but you may not:
a) Distribute the modified software or part(s) of it as standalone application.
b) Sublicense, rent, lease or lend any portion of the software.
c) Modify or remove any copyright notices from any of the software files.
jQuery EasyUI Team retains all ownership rights to the software.

+ 44 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-af.js

@ -0,0 +1,44 @@
if ($.fn.pagination){
	$.fn.pagination.defaults.beforePageText = 'Bladsy';
	$.fn.pagination.defaults.afterPageText = 'Van {pages}';
	$.fn.pagination.defaults.displayMsg = 'Wys (from) tot (to) van (total) items';
}
if ($.fn.datagrid){
	$.fn.datagrid.defaults.loadMsg = 'Verwerking, wag asseblief ...';
}
if ($.fn.treegrid && $.fn.datagrid){
	$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
}
if ($.messager){
	$.messager.defaults.ok = 'Ok';
	$.messager.defaults.cancel = 'Die styl';
}
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
		'combo','combobox','combogrid','combotree',
		'datebox','datetimebox','numberbox',
		'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
	if ($.fn[plugin]){
		$.fn[plugin].defaults.missingMessage = 'Die veld is verpligtend.';
	}
});
if ($.fn.validatebox){
	$.fn.validatebox.defaults.rules.email.message = "Gee 'n geldige e-pos adres.";
	$.fn.validatebox.defaults.rules.url.message = "Gee 'n geldige URL nie.";
	$.fn.validatebox.defaults.rules.length.message = "Voer 'n waarde tussen {0} en {1}.";
}
if ($.fn.calendar){
	$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
	$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
}
if ($.fn.datebox){
	$.fn.datebox.defaults.currentText = 'Vandag';
	$.fn.datebox.defaults.closeText = 'Sluit';
	$.fn.datebox.defaults.okText = 'Ok';
}
if ($.fn.datetimebox && $.fn.datebox){
	$.extend($.fn.datetimebox.defaults,{
		currentText: $.fn.datebox.defaults.currentText,
		closeText: $.fn.datebox.defaults.closeText,
		okText: $.fn.datebox.defaults.okText
	});
}

+ 46 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-am.js

@ -0,0 +1,46 @@
if ($.fn.pagination){
	$.fn.pagination.defaults.beforePageText = 'Էջ';
	$.fn.pagination.defaults.afterPageText = 'ից {pages}';
	$.fn.pagination.defaults.displayMsg = 'Դիտել {from}-ից {to}-ը {total} գրառումից';
}
if ($.fn.datagrid){
	$.fn.datagrid.defaults.loadMsg = 'Մշակվում է, խնդրում ենք սպասել ...';
}
if ($.fn.treegrid && $.fn.datagrid){
	$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
}
if ($.messager){
	$.messager.defaults.ok = 'Այո';
	$.messager.defaults.cancel = 'Փակել';
}
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
		'combo','combobox','combogrid','combotree',
		'datebox','datetimebox','numberbox',
		'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
	if ($.fn[plugin]){
		$.fn[plugin].defaults.missingMessage = 'Այս դաշտը պարտադիր է.';
	}
});
if ($.fn.validatebox){
	$.fn.validatebox.defaults.rules.email.message = 'Խնդրում ենք մուտքագրել գործող e-mail հասցե.';
	$.fn.validatebox.defaults.rules.url.message = 'Խնդրում ենք մուտքագրել գործող URL.';
	$.fn.validatebox.defaults.rules.length.message = 'Խնդրում ենք մուտքագրել արժեք {0}  {1}.';
	$.fn.validatebox.defaults.rules.remote.message = 'Խնդրում ենք ուղղել այս դաշտը.';
}
if ($.fn.calendar){
	$.fn.calendar.defaults.firstDay = 1;
	$.fn.calendar.defaults.weeks  = ['Կ.','Ե.','Ե.','Չ.','Հ.','Ու.','Շ.'];
	$.fn.calendar.defaults.months = ['Հունվար', 'Փետրվար', 'Մարտ', 'Ապրիլ', 'Մայիս', 'Հունիս', 'Հուլիս', 'Օգոստոս', 'Սեպտեմբեր', 'Հոկտեմբեր', 'Նոյեմբեր', 'Դեկտեմբեր'];
}
if ($.fn.datebox){
	$.fn.datebox.defaults.currentText = 'Այսօր';
	$.fn.datebox.defaults.closeText = 'Փակել';
	$.fn.datebox.defaults.okText = 'Այո';
}
if ($.fn.datetimebox && $.fn.datebox){
	$.extend($.fn.datetimebox.defaults,{
		currentText: $.fn.datebox.defaults.currentText,
		closeText: $.fn.datebox.defaults.closeText,
		okText: $.fn.datebox.defaults.okText
	});
}

+ 45 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-ar.js

@ -0,0 +1,45 @@
if ($.fn.pagination){
	$.fn.pagination.defaults.beforePageText = 'صفحة';
	$.fn.pagination.defaults.afterPageText = 'من {pages}';
	$.fn.pagination.defaults.displayMsg = 'عرض {from} إلى {to} من {total} عنصر';
}
if ($.fn.datagrid){
	$.fn.datagrid.defaults.loadMsg = 'معالجة, الرجاء الإنتظار ...';
}
if ($.fn.treegrid && $.fn.datagrid){
	$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
}
if ($.messager){
	$.messager.defaults.ok = 'موافق';
	$.messager.defaults.cancel = 'إلغاء';
}
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
		'combo','combobox','combogrid','combotree',
		'datebox','datetimebox','numberbox',
		'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
	if ($.fn[plugin]){
		$.fn[plugin].defaults.missingMessage = 'هذا الحقل مطلوب.';
	}
});
if ($.fn.validatebox){
	$.fn.validatebox.defaults.rules.email.message = 'الرجاء إدخال بريد إلكتروني صحيح.';
	$.fn.validatebox.defaults.rules.url.message = 'الرجاء إدخال رابط صحيح.';
	$.fn.validatebox.defaults.rules.length.message = 'الرجاء إدخال قيمة بين {0} و {1}.';
	$.fn.validatebox.defaults.rules.remote.message = 'الرجاء التأكد من الحقل.';
}
if ($.fn.calendar){
	$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
	$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
}
if ($.fn.datebox){
	$.fn.datebox.defaults.currentText = 'اليوم';
	$.fn.datebox.defaults.closeText = 'إغلاق';
	$.fn.datebox.defaults.okText = 'موافق';
}
if ($.fn.datetimebox && $.fn.datebox){
	$.extend($.fn.datetimebox.defaults,{
		currentText: $.fn.datebox.defaults.currentText,
		closeText: $.fn.datebox.defaults.closeText,
		okText: $.fn.datebox.defaults.okText
	});
}

+ 44 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-bg.js

@ -0,0 +1,44 @@
if ($.fn.pagination){
	$.fn.pagination.defaults.beforePageText = 'Страница';
	$.fn.pagination.defaults.afterPageText = 'от {pages}';
	$.fn.pagination.defaults.displayMsg = 'Показани {from} за {to} от {total} продукти';
}
if ($.fn.datagrid){
	$.fn.datagrid.defaults.loadMsg = 'Обработка, моля изчакайте ...';
}
if ($.fn.treegrid && $.fn.datagrid){
	$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
}
if ($.messager){
	$.messager.defaults.ok = 'Добре';
	$.messager.defaults.cancel = 'Задрасквам';
}
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
		'combo','combobox','combogrid','combotree',
		'datebox','datetimebox','numberbox',
		'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
	if ($.fn[plugin]){
		$.fn[plugin].defaults.missingMessage = 'Това поле е задължително.';
	}
});
if ($.fn.validatebox){
	$.fn.validatebox.defaults.rules.email.message = 'Моля, въведете валиден имейл адрес.';
	$.fn.validatebox.defaults.rules.url.message = 'Моля въведете валиден URL.';
	$.fn.validatebox.defaults.rules.length.message = 'Моля, въведете стойност между {0} и {1}.';
}
if ($.fn.calendar){
	$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
	$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
}
if ($.fn.datebox){
	$.fn.datebox.defaults.currentText = 'Днес';
	$.fn.datebox.defaults.closeText = 'Близо';
	$.fn.datebox.defaults.okText = 'Добре';
}
if ($.fn.datetimebox && $.fn.datebox){
	$.extend($.fn.datetimebox.defaults,{
		currentText: $.fn.datebox.defaults.currentText,
		closeText: $.fn.datebox.defaults.closeText,
		okText: $.fn.datebox.defaults.okText
	});
}

+ 44 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-ca.js

@ -0,0 +1,44 @@
if ($.fn.pagination){
	$.fn.pagination.defaults.beforePageText = 'Pàgina';
	$.fn.pagination.defaults.afterPageText = 'de {pages}';
	$.fn.pagination.defaults.displayMsg = "Veient {from} a {to} de {total} d'articles";
}
if ($.fn.datagrid){
	$.fn.datagrid.defaults.loadMsg = 'Elaboració, si us plau esperi ...';
}
if ($.fn.treegrid && $.fn.datagrid){
	$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
}
if ($.messager){
	$.messager.defaults.ok = 'Ok';
	$.messager.defaults.cancel = 'Cancel';
}
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
		'combo','combobox','combogrid','combotree',
		'datebox','datetimebox','numberbox',
		'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
	if ($.fn[plugin]){
		$.fn[plugin].defaults.missingMessage = 'Aquest camp és obligatori.';
	}
});
if ($.fn.validatebox){
	$.fn.validatebox.defaults.rules.email.message = 'Introduïu una adreça de correu electrònic vàlida.';
	$.fn.validatebox.defaults.rules.url.message = 'Si us plau, introduïu un URL vàlida.';
	$.fn.validatebox.defaults.rules.length.message = 'Si us plau, introduïu un valor entre {0} i {1}.';
}
if ($.fn.calendar){
	$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
	$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
}
if ($.fn.datebox){
	$.fn.datebox.defaults.currentText = 'Avui';
	$.fn.datebox.defaults.closeText = 'Tancar';
	$.fn.datebox.defaults.okText = 'Ok';
}
if ($.fn.datetimebox && $.fn.datebox){
	$.extend($.fn.datetimebox.defaults,{
		currentText: $.fn.datebox.defaults.currentText,
		closeText: $.fn.datebox.defaults.closeText,
		okText: $.fn.datebox.defaults.okText
	});
}

+ 44 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-cs.js

@ -0,0 +1,44 @@
if ($.fn.pagination){
	$.fn.pagination.defaults.beforePageText = 'Strana';
	$.fn.pagination.defaults.afterPageText = 'z {pages}';
	$.fn.pagination.defaults.displayMsg = 'Zobrazuji {from} do {to} z {total} položky';
}
if ($.fn.datagrid){
	$.fn.datagrid.defaults.loadMsg = 'Zpracování, čekejte prosím ...';
}
if ($.fn.treegrid && $.fn.datagrid){
	$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
}
if ($.messager){
	$.messager.defaults.ok = 'Ok';
	$.messager.defaults.cancel = 'Zrušit';
}
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
		'combo','combobox','combogrid','combotree',
		'datebox','datetimebox','numberbox',
		'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
	if ($.fn[plugin]){
		$.fn[plugin].defaults.missingMessage = 'Toto pole je vyžadováno.';
	}
});
if ($.fn.validatebox){
	$.fn.validatebox.defaults.rules.email.message = 'Zadejte prosím platnou e-mailovou adresu.';
	$.fn.validatebox.defaults.rules.url.message = 'Zadejte prosím platnou adresu URL.';
	$.fn.validatebox.defaults.rules.length.message = 'Prosím, zadejte hodnotu mezi {0} a {1}.';
}
if ($.fn.calendar){
	$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
	$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
}
if ($.fn.datebox){
	$.fn.datebox.defaults.currentText = 'Dnes';
	$.fn.datebox.defaults.closeText = 'Zavřít';
	$.fn.datebox.defaults.okText = 'Ok';
}
if ($.fn.datetimebox && $.fn.datebox){
	$.extend($.fn.datetimebox.defaults,{
		currentText: $.fn.datebox.defaults.currentText,
		closeText: $.fn.datebox.defaults.closeText,
		okText: $.fn.datebox.defaults.okText
	});
}

+ 44 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-cz.js

@ -0,0 +1,44 @@
if ($.fn.pagination){
	$.fn.pagination.defaults.beforePageText = 'Strana';
	$.fn.pagination.defaults.afterPageText = 'z {pages}';
	$.fn.pagination.defaults.displayMsg = 'Zobrazuji záznam {from} až {to} z {total}.';
}
if ($.fn.datagrid){
	$.fn.datagrid.defaults.loadMsg = 'Pracuji, čekejte prosím…';
}
if ($.fn.treegrid && $.fn.datagrid){
	$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
}
if ($.messager){
	$.messager.defaults.ok = 'Ok';
	$.messager.defaults.cancel = 'Zrušit';
}
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
		'combo','combobox','combogrid','combotree',
		'datebox','datetimebox','numberbox',
		'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
	if ($.fn[plugin]){
		$.fn[plugin].defaults.missingMessage = 'Toto pole je vyžadováno.';
	}
});
if ($.fn.validatebox){
	$.fn.validatebox.defaults.rules.email.message = 'Zadejte, prosím, platnou e-mailovou adresu.';
	$.fn.validatebox.defaults.rules.url.message = 'Zadejte, prosím, platnou adresu URL.';
	$.fn.validatebox.defaults.rules.length.message = 'Zadejte, prosím, hodnotu mezi {0} a {1}.';
}
if ($.fn.calendar){
	$.fn.calendar.defaults.weeks = ['N','P','Ú','S','Č','P','S']; //neděle pondělí úterý středa čtvrtek pátek sobota
	$.fn.calendar.defaults.months = ['led', 'únr', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro']; //leden únor březen duben květen červen červenec srpen září říjen listopad prosinec
}
if ($.fn.datebox){
	$.fn.datebox.defaults.currentText = 'Dnes';
	$.fn.datebox.defaults.closeText = 'Zavřít';
	$.fn.datebox.defaults.okText = 'Ok';
}
if ($.fn.datetimebox && $.fn.datebox){
	$.extend($.fn.datetimebox.defaults,{
		currentText: $.fn.datebox.defaults.currentText,
		closeText: $.fn.datebox.defaults.closeText,
		okText: $.fn.datebox.defaults.okText
	});
}

+ 44 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-da.js

@ -0,0 +1,44 @@
if ($.fn.pagination){
	$.fn.pagination.defaults.beforePageText = 'Page';
	$.fn.pagination.defaults.afterPageText = 'af {pages}';
	$.fn.pagination.defaults.displayMsg = 'Viser {from} til {to} af {total} poster';
}
if ($.fn.datagrid){
	$.fn.datagrid.defaults.loadMsg = 'Behandling, vent venligst ...';
}
if ($.fn.treegrid && $.fn.datagrid){
	$.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg;
}
if ($.messager){
	$.messager.defaults.ok = 'Ok';
	$.messager.defaults.cancel = 'Annuller';
}
$.map(['validatebox','textbox','passwordbox','filebox','searchbox',
		'combo','combobox','combogrid','combotree',
		'datebox','datetimebox','numberbox',
		'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){
	if ($.fn[plugin]){
		$.fn[plugin].defaults.missingMessage = 'Dette felt er påkrævet.';
	}
});
if ($.fn.validatebox){
	$.fn.validatebox.defaults.rules.email.message = 'Angiv en gyldig e-mail-adresse.';
	$.fn.validatebox.defaults.rules.url.message = 'Angiv en gyldig webadresse.';
	$.fn.validatebox.defaults.rules.length.message = 'Angiv en værdi mellem {0} og {1}.';
}
if ($.fn.calendar){
	$.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S'];
	$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
}
if ($.fn.datebox){
	$.fn.datebox.defaults.currentText = 'I dag';
	$.fn.datebox.defaults.closeText = 'Luk';
	$.fn.datebox.defaults.okText = 'Ok';
}
if ($.fn.datetimebox && $.fn.datebox){
	$.extend($.fn.datetimebox.defaults,{
		currentText: $.fn.datebox.defaults.currentText,
		closeText: $.fn.datebox.defaults.closeText,
		okText: $.fn.datebox.defaults.okText
	});
}

+ 0 - 0
svr/svr-manage/src/main/resources/webapp/common/js/jquery-easyui-1.5.2/locale/easyui-lang-de.js


Some files were not shown because too many files changed in this diff