Jelajahi Sumber

Merge branch 'obt'

tianboguang 3 tahun lalu
induk
melakukan
c62208c225
100 mengubah file dengan 14149 tambahan dan 16695 penghapusan
  1. 0 35
      platform-admin/pom.xml
  2. 64 0
      platform-admin/src/main/java/com/platform/config/NacosConfiguration.java
  3. 2 1
      platform-admin/src/main/java/com/platform/controller/SysDeptController.java
  4. 13 0
      platform-admin/src/main/resources/application.properties
  5. 0 117
      platform-admin/src/main/resources/dev/platform.properties
  6. 0 0
      platform-admin/src/main/resources/log4j.properties
  7. 0 66
      platform-admin/src/main/resources/prod/log4j.properties
  8. 0 114
      platform-admin/src/main/resources/prod/platform.properties
  9. 1 1
      platform-admin/src/main/resources/spring-jdbc.xml
  10. 1 1
      platform-admin/src/main/resources/spring-mvc.xml
  11. 1 1
      platform-admin/src/main/webapp/WEB-INF/page/shop/brand.html
  12. 186 196
      platform-admin/src/main/webapp/WEB-INF/page/shop/sceneAllocation.html
  13. 216 128
      platform-admin/src/main/webapp/WEB-INF/page/shop/staff.html
  14. 82 0
      platform-admin/src/main/webapp/WEB-INF/page/sys/bindAccount.html
  15. 1 0
      platform-admin/src/main/webapp/WEB-INF/page/sys/menu.html
  16. 205 129
      platform-admin/src/main/webapp/WEB-INF/page/sys/user.html
  17. 11209 10714
      platform-admin/src/main/webapp/js/shop/brand.js
  18. 650 622
      platform-admin/src/main/webapp/js/shop/sceneAllocation.js
  19. 86 79
      platform-admin/src/main/webapp/js/shop/selectUser.js
  20. 126 0
      platform-admin/src/main/webapp/js/sys/bindAccount.js
  21. 278 233
      platform-admin/src/main/webapp/js/sys/menu.js
  22. 487 455
      platform-admin/src/main/webapp/js/sys/user.js
  23. 4 3
      platform-api/src/main/java/com/platform/util/ApiBaseAction.java
  24. 28 0
      platform-common/pom.xml
  25. 106 0
      platform-common/src/main/java/com/platform/aop/RestTemplateAspect.java
  26. 24 19
      platform-common/src/main/java/com/platform/controller/SysLoginController.java
  27. 8 1
      platform-common/src/main/java/com/platform/controller/SysMenuController.java
  28. 3 0
      platform-common/src/main/java/com/platform/entity/Result.java
  29. 9 9
      platform-common/src/main/java/com/platform/entity/SysUserEntity.java
  30. 34 0
      platform-common/src/main/java/com/platform/enums/SysRoleEnum.java
  31. 1 2
      platform-common/src/main/java/com/platform/exception/GlobalExceptionHandler.java
  32. 1 1
      platform-common/src/main/java/com/platform/service/SysUserService.java
  33. 4 2
      platform-common/src/main/java/com/platform/service/custom/MySysUserBrandService.java
  34. 34 0
      platform-common/src/main/java/com/platform/service/impl/FdkkService.java
  35. 61 22
      platform-common/src/main/java/com/platform/service/impl/SysUserServiceImpl.java
  36. 127 0
      platform-common/src/main/java/com/platform/service/impl/ZhiHouseService.java
  37. 12 59
      platform-common/src/main/java/com/platform/utils/ResourceUtil.java
  38. 34 29
      platform-common/src/main/java/com/platform/utils/WxOpUtils.java
  39. 45 0
      platform-common/src/main/java/com/platform/vos/ReturnDTO.java
  40. 6 32
      platform-common/src/main/resources/com/platform/dao/SysUserDao.xml
  41. 0 19
      platform-gen/pom.xml
  42. 0 77
      platform-gen/src/main/java/com/platform/controller/SysGeneratorController.java
  43. 0 22
      platform-gen/src/main/java/com/platform/dao/SysGeneratorDao.java
  44. 0 25
      platform-gen/src/main/java/com/platform/dao/SysOracleGeneratorDao.java
  45. 0 82
      platform-gen/src/main/java/com/platform/entity/ColumnEntity.java
  46. 0 60
      platform-gen/src/main/java/com/platform/entity/ResultMap.java
  47. 0 74
      platform-gen/src/main/java/com/platform/entity/TableEntity.java
  48. 0 106
      platform-gen/src/main/java/com/platform/generator/ApiMysqlGenerator.java
  49. 0 107
      platform-gen/src/main/java/com/platform/generator/MysqlGenerator.java
  50. 0 27
      platform-gen/src/main/java/com/platform/service/SysGeneratorService.java
  51. 0 125
      platform-gen/src/main/java/com/platform/service/impl/SysGeneratorServiceImpl.java
  52. 0 242
      platform-gen/src/main/java/com/platform/utils/GenUtils.java
  53. 0 33
      platform-gen/src/main/resources/com/platform/dao/SysGeneratorDao.xml
  54. 0 67
      platform-gen/src/main/resources/com/platform/dao/SysOracleGeneratorDao.xml
  55. 0 29
      platform-gen/src/main/resources/generator.properties
  56. 0 126
      platform-gen/src/main/resources/template/Controller.java.vm
  57. 0 47
      platform-gen/src/main/resources/template/Dao.java.vm
  58. 0 27
      platform-gen/src/main/resources/template/Dao.xml.vm
  59. 0 49
      platform-gen/src/main/resources/template/Entity.java.vm
  60. 0 75
      platform-gen/src/main/resources/template/Service.java.vm
  61. 0 69
      platform-gen/src/main/resources/template/ServiceImpl.java.vm
  62. 0 60
      platform-gen/src/main/resources/template/list.html.vm
  63. 0 116
      platform-gen/src/main/resources/template/list.js.vm
  64. 0 13
      platform-gen/src/main/resources/template/menu.sql.vm
  65. 0 26
      platform-mp/pom.xml
  66. 0 14
      platform-mp/src/main/java/com/platform/builder/AbstractBuilder.java
  67. 0 21
      platform-mp/src/main/java/com/platform/builder/ImageBuilder.java
  68. 0 19
      platform-mp/src/main/java/com/platform/builder/TextBuilder.java
  69. 0 148
      platform-mp/src/main/java/com/platform/controller/MpMenuController.java
  70. 0 46
      platform-mp/src/main/java/com/platform/entity/WxMenuKey.java
  71. 0 11
      platform-mp/src/main/java/com/platform/handler/AbstractHandler.java
  72. 0 22
      platform-mp/src/main/java/com/platform/handler/KfSessionHandler.java
  73. 0 42
      platform-mp/src/main/java/com/platform/handler/LocationHandler.java
  74. 0 37
      platform-mp/src/main/java/com/platform/handler/LogHandler.java
  75. 0 65
      platform-mp/src/main/java/com/platform/handler/MenuHandler.java
  76. 0 121
      platform-mp/src/main/java/com/platform/handler/MsgHandler.java
  77. 0 21
      platform-mp/src/main/java/com/platform/handler/NullHandler.java
  78. 0 22
      platform-mp/src/main/java/com/platform/handler/StoreCheckNotifyHandler.java
  79. 0 61
      platform-mp/src/main/java/com/platform/handler/SubscribeHandler.java
  80. 0 24
      platform-mp/src/main/java/com/platform/handler/UnsubscribeHandler.java
  81. 0 13
      platform-mp/src/main/java/com/platform/service/MpMenuService.java
  82. 0 177
      platform-mp/src/main/java/com/platform/service/WeixinService.java
  83. 0 34
      platform-schedule/pom.xml
  84. 0 149
      platform-schedule/src/main/java/com/platform/controller/ScheduleJobController.java
  85. 0 52
      platform-schedule/src/main/java/com/platform/controller/ScheduleJobLogController.java
  86. 0 38
      platform-schedule/src/main/java/com/platform/dao/ScheduleJobDao.java
  87. 0 29
      platform-schedule/src/main/java/com/platform/dao/ScheduleJobLogDao.java
  88. 0 71
      platform-schedule/src/main/java/com/platform/entity/ScheduleJobEntity.java
  89. 0 65
      platform-schedule/src/main/java/com/platform/entity/ScheduleJobLogEntity.java
  90. 0 23
      platform-schedule/src/main/java/com/platform/service/ScheduleJobLogService.java
  91. 0 73
      platform-schedule/src/main/java/com/platform/service/ScheduleJobService.java
  92. 0 28
      platform-schedule/src/main/java/com/platform/service/impl/ScheduleJobLogServiceImpl.java
  93. 0 121
      platform-schedule/src/main/java/com/platform/service/impl/ScheduleJobServiceImpl.java
  94. 0 79
      platform-schedule/src/main/java/com/platform/utils/ScheduleJob.java
  95. 0 45
      platform-schedule/src/main/java/com/platform/utils/ScheduleRunnable.java
  96. 0 149
      platform-schedule/src/main/java/com/platform/utils/ScheduleUtils.java
  97. 0 30
      platform-schedule/src/main/resources/com/platform/dao/ScheduleJobDao.xml
  98. 0 25
      platform-schedule/src/main/resources/com/platform/dao/ScheduleJobLogDao.xml
  99. 0 46
      platform-schedule/src/main/resources/platform-scheduler.xml
  100. 0 0
      platform-shop/pom.xml

+ 0 - 35
platform-admin/pom.xml

@@ -38,38 +38,12 @@
         </dependency>
     </dependencies>
 
-    <profiles>
-        <profile>
-            <id>dev</id>
-            <properties>
-                <env>dev</env>
-            </properties>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-        </profile>
-        <profile>
-            <id>prod</id>
-            <properties>
-                <env>prod</env>
-            </properties>
-        </profile>
-    </profiles>
-
     <build>
         <scriptSourceDirectory>src/main/java</scriptSourceDirectory>
         <resources>
             <resource>
-                <directory>src/main/resources/${env}</directory>
-                <filtering>true</filtering>
-            </resource>
-            <resource>
                 <directory>src/main/resources</directory>
                 <filtering>true</filtering>
-                <excludes>
-                    <exclude>dev/*</exclude>
-                    <exclude>prod/*</exclude>
-                </excludes>
             </resource>
             <resource>
                 <directory>src/main/java</directory>
@@ -87,17 +61,8 @@
                     <failOnMissingWebXml>false</failOnMissingWebXml>
                     <webResources>
                         <resource>
-                            <directory>src/main/resources/${env}</directory>
-                            <targetPath>WEB-INF/classes</targetPath>
-                            <filtering>true</filtering>
-                        </resource>
-                        <resource>
                             <directory>src/main/resources</directory>
                             <filtering>true</filtering>
-                            <excludes>
-                                <exclude>dev/*</exclude>
-                                <exclude>prod/*</exclude>
-                            </excludes>
                         </resource>
                     </webResources>
                 </configuration>

+ 64 - 0
platform-admin/src/main/java/com/platform/config/NacosConfiguration.java

@@ -0,0 +1,64 @@
+package com.platform.config;
+
+import com.alibaba.nacos.api.annotation.NacosInjected;
+import com.alibaba.nacos.api.annotation.NacosProperties;
+import com.alibaba.nacos.api.config.ConfigType;
+import com.alibaba.nacos.api.exception.NacosException;
+import com.alibaba.nacos.api.naming.NamingService;
+import com.alibaba.nacos.spring.context.annotation.EnableNacos;
+import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.annotation.PropertySources;
+import org.springframework.util.ObjectUtils;
+
+import javax.annotation.PostConstruct;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+@Configuration
+@PropertySources({
+        @PropertySource({
+                "classpath:application.properties"
+        })
+})
+@EnableNacos(
+    globalProperties = @NacosProperties(serverAddr = "${nacos.config.server-addr}",namespace = "${nacos.config.namespace}")
+)
+@NacosPropertySource(dataId = "${nacos.config.data-id}", autoRefreshed = true,type = ConfigType.PROPERTIES,groupId = "${nacos.config.group}")
+public class NacosConfiguration {
+
+    protected Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @NacosInjected
+    private NamingService namingService;
+
+    @Value("${spring.application.name}")
+    private String applicationName;
+
+    @Value("${nacos.discovery.register.group-name}")
+    private String groupName;
+
+    @Value("${server.port}")
+    private Integer port;
+
+    @Value("${local.ip:#{null}}")
+    private String ip;
+
+    @PostConstruct
+    public void init() {
+        try {
+            if(ObjectUtils.isEmpty(ip)){
+                InetAddress address = InetAddress.getLocalHost();
+                ip = address.getHostAddress();
+            }
+            logger.info("service registed {}:{}",ip,port);
+            namingService.registerInstance(applicationName, groupName, ip, port);
+        } catch (UnknownHostException | NacosException e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 2 - 1
platform-admin/src/main/java/com/platform/controller/SysDeptController.java

@@ -100,7 +100,8 @@ public class SysDeptController extends AbstractController {
         Map<String,Object> params = new HashMap<>();
         params.put("deptIdList",entityMap.keySet());
         List<SysUserEntity> users = sysUserService.queryList(params);
-        users.parallelStream().filter(user -> user.getRoleId() == 6 && entityMap.containsKey(user.getDeptId()))
+        users.parallelStream().filter(user -> !ObjectUtils.isEmpty(user.getRoleId()))
+                .filter(user -> user.getRoleId() == 6 && entityMap.containsKey(user.getDeptId()))
                 .forEach(user -> {
                     SysDeptEntity deptEntity = entityMap.get(user.getDeptId());
                     String mobile = user.getMobile();

+ 13 - 0
platform-admin/src/main/resources/application.properties

@@ -0,0 +1,13 @@
+spring.application.name=shop-platform
+server.port=8190
+
+nacos.config.bootstrap.enable=true
+nacos.config.server-addr=120.24.202.7:8848
+nacos.config.type=properties
+nacos.config.namespace=dev
+nacos.config.group=zfb
+nacos.config.data-id=shop-platform.properties
+
+nacos.discovery.server-addr=120.24.202.7:8848
+nacos.discovery.namespace=dev
+nacos.discovery.register.group-name=zfb

+ 0 - 117
platform-admin/src/main/resources/dev/platform.properties

@@ -1,117 +0,0 @@
-jdbc.url=jdbc:mysql://120.24.202.7:3306/4dage-zfb?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&characterSetResults=utf8&autoReconnect=true
-jdbc.username=root
-jdbc.password=zfb@20210727%
-
-jdbc.initialSize=5
-jdbc.maxActive=30
-jdbc.minPoolSize=2
-jdbc.maxIdleTime=30000
-jdbc.idleConnectionTestPeriod=100
-
-
-#小程序ID
-wx.appId=wxf1eb182777211ed7
-#小程序密钥
-wx.secret=d1c7e5894ddf44d0bcc2d0da476bcc01
-#商户号
-wx.mchId=1384865002
-#支付签名
-wx.paySignKey=hangzhoutianmenkejizfbvr82350800
-#交易类型
-wx.tradeType=JSAPI
-#证书名称,对应不同的商户号
-#wx.certName=/cert/apiclient_cert.p12
-wx.certName=/root/user/java/apache-tomcat-8.0.51-platform/apiclient_cert.p12
-#支付回调地址
-wx.notifyUrl=https://testshop.4dkankan.com/platform-framework/api/pay/notify
-#获取code的请求地址
-wx.getCode=https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=STAT#wechat_redirect
-#获取Web_access_tokenhttps的请求地址
-wx.webAccessTokenhttps = https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code
-#拉取用户信息的请求地址
-wx.userMessage=https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN
-#微信统一下单接口路径
-wx.uniformorder=https://api.mch.weixin.qq.com/pay/unifiedorder
-#退款地址
-wx.refundUrl=https://api.mch.weixin.qq.com/secapi/pay/refund
-#退款查询地址
-wx.refundqueryUrl=https://api.mch.weixin.qq.com/pay/refundquery
-#微信查询订单状态
-wx.orderquery=https://api.mch.weixin.qq.com/pay/orderquery
-
-ali.webAccessTokenhttps=https://openapi.alipay.com/gateway.do
-ali.appId=
-ali.privateKey=
-ali.pubKey=
-
-#安全起见,暴露的短信接口需要配置有效的请求IP
-sms.validIp=127.0.0.1
-
-#演示环境  1:是  0:否
-sys.demo=0
-
-#微信公众号appId
-mp.appId=
-#微信公众号secret
-mp.secret=
-#令牌(Token)
-mp.token=
-#消息加解密密钥
-mp.aesKey=
-
-scenePath=https://zfb.4dkankan.com/
-sceneData=https://4dkk.4dage.com/
-showHtml=shop.html
-editHtml=editShopPC.html
-
-#H5 微信分享二维码url前缀
-
-h5.wx.mini.program.url.pre=pages/webview/index?id=
-
-
-oss.point=http://oss-cn-shenzhen.aliyuncs.com
-oss.key=LTAIUrvuHqj8pvry
-oss.secrey=JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
-oss.bucket=4d-tjw
-oss.video.file.path=domain/shop/video/
-oss.image.file.path=domain/shop/image/
-oss.excel.file.path=domain/shop/excel/
-oss.query.url=https://houseoss.4dkankan.com/
-
-#video-file-path: D:/video-files/
-video-file-path: shop/video-files/
-#file-backup-path: shop/im-files/
-file-backup-path: D:/im-files/
-
-#商品信息来自哪个小程序
-origin=fashilong
-
-webpSheelPath=/opt/libwebp-0.4.3-linux-x86-64/bin/cwebp.sh
-filePath=D:/platform/
-
-
-api.host.query.url=https://testopen.4dkankan.com/api/shop/format?
-api.host.url=https://testopen.4dkankan.com
-api.id= 10305d97abc0b40f79b1607491893621
-api.secret=10405fbabccca8f8cc91607491893623
-
-#四维看看的登录域名
-4dkankan.host=https://test.4dkankan.com/
-4dkankan.api.vr.show.host=https://testopen.4dkankan.com/
-
-#直播间默认商品信息
-goods.cover.image=https://4dkk.4dage.com/shop/huafa/20200915/17145240908b6e.jpg
-goods.name=钻石世家 18K金钻石戒指
-goods.price=4290.00
-goods.buy.url=https://item.jd.com/32579640875.html
-goods.id=1181354
-
-spring.redis.host=127.0.0.1
-spring.redis.port=6379
-
-base.dept.id=91
-
-
-
-wx_miniprogram_state=trial
-wx_subscribe.template.id=klhtcMH_MixbhY2AqKjZ6sl7y51UkpWJ4Xj4P4Cn9U0

platform-admin/src/main/resources/dev/log4j.properties → platform-admin/src/main/resources/log4j.properties


+ 0 - 66
platform-admin/src/main/resources/prod/log4j.properties

@@ -1,66 +0,0 @@
-log4j.rootLogger=INFO,stdout,info,warn,error,file
-#控制台输出
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.Threshold=INFO
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#INFO所有日志
-log4j.logger.file=info
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.File=/usr/local/platform/logs/info.log
-log4j.appender.file.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.file.append=true
-log4j.appender.file.Threshold=INFO
-log4j.appender.file.encoding=UTF-8
-log4j.appender.file.ImmediateFlush=true
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#INFO日志
-log4j.logger.info=info
-log4j.appender.info=com.platform.log4j.GradeLogDailyRollingFileAppender
-log4j.appender.info.File=/usr/local/platform/logs/info/info.log
-log4j.appender.info.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.info.append=true
-log4j.appender.info.Threshold=INFO
-log4j.appender.info.encoding=UTF-8
-log4j.appender.info.ImmediateFlush=true
-log4j.appender.info.layout=org.apache.log4j.PatternLayout
-log4j.appender.info.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#WARN日志
-log4j.appender.warn=com.platform.log4j.GradeLogDailyRollingFileAppender
-log4j.appender.warn.File=/usr/local/platform/logs/warn/warn.log
-log4j.appender.warn.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.warn.append=true
-log4j.appender.warn.Threshold=WARN
-log4j.appender.warn.encoding=UTF-8
-log4j.appender.warn.ImmediateFlush=true
-log4j.appender.warn.layout=org.apache.log4j.PatternLayout
-log4j.appender.warn.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#ERROR日志
-log4j.appender.error=com.platform.log4j.GradeLogDailyRollingFileAppender
-log4j.appender.error.File=/usr/local/platform/logs/error/error.log
-log4j.appender.error.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.error.append=true
-log4j.appender.error.Threshold=ERROR
-log4j.appender.error.encoding=UTF-8
-log4j.appender.error.ImmediateFlush=true
-log4j.appender.error.layout=org.apache.log4j.PatternLayout
-log4j.appender.error.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#执行慢的SQL
-log4j.logger.com.alibaba.druid.filter.stat.StatFilter=ERROR,slowsql
-log4j.appender.slowsql=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.slowsql.File=/usr/local/platform/logs/slow_sql/slow_sql.log
-log4j.appender.slowsql.datePattern='.'yyyy-MM-dd'.log'
-log4j.appender.slowsql.append=true
-log4j.appender.slowsql.encoding=UTF-8
-log4j.appender.slowsql.ImmediateFlush=true
-log4j.appender.slowsql.layout=org.apache.log4j.PatternLayout
-log4j.appender.slowsql.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS}|%5p|%F.%M:%L|%m%n
-#控制台输出所有SQL
-#便于调试  生产环境注释
-log4j.logger.com.platform.dao=DEBUG,sql
-log4j.appender.sql=org.apache.log4j.ConsoleAppender
-log4j.appender.sql.Target=DEBUG
-log4j.appender.sql.layout=org.apache.log4j.PatternLayout
-log4j.appender.sql.layout.ConversionPattern=%m %n

+ 0 - 114
platform-admin/src/main/resources/prod/platform.properties

@@ -1,114 +0,0 @@
-jdbc.url=jdbc:mysql://localhost:3306/4dage-zfb?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&characterSetResults=utf8&autoReconnect=true
-jdbc.username=root
-jdbc.password=4dkankancuikuan%
-
-jdbc.initialSize=5
-jdbc.maxActive=30
-jdbc.minPoolSize=2
-jdbc.maxIdleTime=30000
-jdbc.idleConnectionTestPeriod=100
-
-#小程序ID
-wx.appId=wxf1eb182777211ed7
-#小程序密钥
-wx.secret=d1c7e5894ddf44d0bcc2d0da476bcc01
-#商户号
-wx.mchId=1384865002
-#支付签名
-wx.paySignKey=hangzhoutianmenkejizfbvr82350800
-#交易类型
-wx.tradeType=JSAPI
-#证书名称,对应不同的商户号
-wx.certName=/root/user/java/apache-tomcat-8.0.51-platform/apiclient_cert.p12
-#支付回调地址
-wx.notifyUrl=https://shop.4dkankan.com/platform-framework/api/pay/notify
-#获取code的请求地址
-wx.getCode=https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=STAT#wechat_redirect
-#获取Web_access_tokenhttps的请求地址
-wx.webAccessTokenhttps = https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code
-#拉取用户信息的请求地址
-wx.userMessage=https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN
-#微信统一下单接口路径
-wx.uniformorder=https://api.mch.weixin.qq.com/pay/unifiedorder
-#退款地址
-wx.refundUrl=https://api.mch.weixin.qq.com/secapi/pay/refund
-#退款查询地址
-wx.refundqueryUrl=https://api.mch.weixin.qq.com/pay/refundquery
-#微信查询订单状态
-wx.orderquery=https://api.mch.weixin.qq.com/pay/orderquery
-
-ali.webAccessTokenhttps=https://openapi.alipay.com/gateway.do
-ali.appId=
-ali.privateKey=
-ali.pubKey=
-
-#安全起见,暴露的短信接口需要配置有效的请求IP
-sms.validIp=127.0.0.1
-
-#演示环境  1:是  0:否
-sys.demo=0
-
-#微信公众号appId
-mp.appId=
-#微信公众号secret
-mp.secret=
-#令牌(Token)
-mp.token=
-#消息加解密密钥
-mp.aesKey=
-
-scenePath=https://www.4dkankan.com/
-sceneData=https://4dkk.4dage.com/
-showHtml=shop.html
-editHtml=editShopPC.html
-
-#H5 微信分享二维码url前缀
-
-h5.wx.mini.program.url.pre=pages/webview/index?id=
-
-
-oss.point=http://oss-cn-shenzhen-internal.aliyuncs.com
-oss.key=LTAIUrvuHqj8pvry
-oss.secrey=JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
-oss.bucket=4d-tjw
-oss.video.file.path=domain/shop/video/
-oss.image.file.path=domain/shop/image/
-oss.excel.file.path=domain/shop/excel/
-oss.query.url=https://houseoss.4dkankan.com/
-
-video-file-path: shop/video-files/
-file-backup-path: shop/im-files/
-
-#商品信息来自哪个小程序
-origin=fashilong
-
-webpSheelPath=/opt/libwebp-0.4.3-linux-x86-64/bin/cwebp.sh
-filePath=/platform/
-
-api.host.query.url=https://open.4dkankan.com/api/shop/format?
-api.host.url=https://open.4dkankan.com
-api.id= 10305d97abc0b40f79b1607491893621
-api.secret=10405fbabccca8f8cc91607491893623
-
-
-#四维看看的登录域名
-4dkankan.host=https://www.4dkankan.com/
-4dkankan.api.vr.show.host=https://open.4dkankan.com/
-
-#直播间默认商品信息
-goods.cover.image=https://4dkk.4dage.com/shop/huafa/20200915/17145240908b6e.jpg
-goods.name=钻石世家 18K金钻石戒指
-goods.price=4290.00
-goods.buy.url=https://item.jd.com/32579640875.html
-goods.id=1181354
-
-
-spring.redis.host=127.0.0.1
-spring.redis.port=6379
-
-
-base.dept.id=91
-
-
-wx_miniprogram_state=formal
-wx_subscribe.template.id=klhtcMH_MixbhY2AqKjZ6sl7y51UkpWJ4Xj4P4Cn9U0

+ 1 - 1
platform-admin/src/main/resources/spring-jdbc.xml

@@ -15,7 +15,7 @@
 
     <tx:annotation-driven/>
     <!-- Import Properties -->
-    <context:property-placeholder location="classpath*:platform.properties"/>
+    <context:property-placeholder location="classpath*:shop-platform.properties"/>
 
     <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
           init-method="init" destroy-method="close">

+ 1 - 1
platform-admin/src/main/resources/spring-mvc.xml

@@ -14,7 +14,7 @@
 		http://www.springframework.org/schema/mvc 
      	http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd">
 
-    <context:component-scan base-package="com.platform"/>
+    <context:component-scan base-package="com.platform.*,com.alibaba.nacos.*"/>
     <context:annotation-config/>
     <mvc:default-servlet-handler/>
     <aop:aspectj-autoproxy proxy-target-class="true"/>

+ 1 - 1
platform-admin/src/main/webapp/WEB-INF/page/shop/brand.html

@@ -38,7 +38,7 @@
                 </div>
                 <div class="buttons-group">
                     <i-button
-                        v-if="(localStorage.getItem('userExpTime') > Date.now() && JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] ==6)|| (localStorage.getItem('userExpTime') == 'null' &&JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] ==6)"
+                        v-if="(localStorage.getItem('userExpTime') > Date.now() && JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] ==5)|| (localStorage.getItem('userExpTime') == 'null' &&JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] ==5)||(localStorage.getItem('userExpTime') > Date.now() && JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] ==6)|| (localStorage.getItem('userExpTime') == 'null' &&JSON.parse(localStorage.getItem('userInfo')).roleIdList[0] ==6)"
                         type="info"
                         @click="open">绑定主播</i-button>
                     #if($shiro.hasPermission("brand:save"))

+ 186 - 196
platform-admin/src/main/webapp/WEB-INF/page/shop/sceneAllocation.html

@@ -1,50 +1,49 @@
 <!DOCTYPE html>
 <html>
-
-<head>
+  <head>
     <title>场景分配</title>
     #parse("sys/header.html")
     <style>
-        .ivu-spin-fix {
-            z-index: 99999999;
-        }
-
-        .demo-spin-icon-load {
-            animation: ani-demo-spin 1s linear infinite;
-        }
+      .ivu-spin-fix {
+        z-index: 99999999;
+      }
 
-        @keyframes ani-demo-spin {
-            from {
-                transform: rotate(0deg);
-            }
+      .demo-spin-icon-load {
+        animation: ani-demo-spin 1s linear infinite;
+      }
 
-            50% {
-                transform: rotate(180deg);
-            }
+      @keyframes ani-demo-spin {
+        from {
+          transform: rotate(0deg);
+        }
 
-            to {
-                transform: rotate(360deg);
-            }
+        50% {
+          transform: rotate(180deg);
         }
 
-        .demo-spin-col {
-            height: 100px;
-            position: relative;
-            border: 1px solid #eee;
+        to {
+          transform: rotate(360deg);
         }
+      }
+
+      .demo-spin-col {
+        height: 100px;
+        position: relative;
+        border: 1px solid #eee;
+      }
     </style>
-</head>
+  </head>
 
-<body>
+  <body>
     <div id="rrapp" v-cloak>
-        <div v-show="showList">
-            <Row :gutter="16">
-                <div class="search-group">
-                    <i-col span="8">
-                        <div style="display: inline-block;">
-                            <i-input v-model="q.name" @on-enter="query" placeholder="场景名称" />
-                        </div>
-                        <!-- <div style="display: inline-block;">
+      <div v-show="showList">
+        <Row :gutter="16">
+          <div class="search-group">
+            <i-col span="8">
+              <div style="display: inline-block">
+                <i-input v-model="q.name" @on-enter="query" placeholder="场景名称" />
+              </div>
+              <!-- <div style="display: inline-block;">
                         <i-input v-model="q.brandName" @on-enter="query" placeholder="VR场景名称"/>
                     </div>
                     <div style="display: inline-block;">
@@ -55,177 +54,168 @@
 
                         </i-select>
                     </div> -->
-                        <div style="display: inline-block;">
-                            <i-button @click="query">查询</i-button>
-                        </div>
-
-                        <!-- <div style="display: inline-block;margin-left: 10px;">可新增数量为 {{lessNum}} 个</div> -->
-                    </i-col>
-
-                </div>
-                <div class="buttons-group">
-                    #if($shiro.hasPermission("brand:list"))
-                    <!-- <i-button v-if="localStorage.getItem('userExpTime') > Date.now()" type="info" @click="open">绑定员工</i-button> -->
-                    <i-button
-                        v-if="localStorage.getItem('userExpTime') > Date.now() || localStorage.getItem('userExpTime') == 'null'"
-                        type="info" @click="showYoN">修改</i-button>
-                    #end
-                </div>
-            </Row>
-            <table id="jqGrid"></table>
-            <div id="jqGridPager"></div>
-        </div>
-
-        <Card v-show="showInApp">
-            <p slot="title">{{title}}</p>
-            <i-form :model="appShow" ref="formValidate1" :rules="ruleValidate1" :label-width="120">
-                <div>
-                    <Form-item label="场景名称:" prop="name">
-                        <!-- <div>{{appShow.name}}</div> -->
-                        <div>
-                            {{appShow.name}}
-                        </div>
-                        <!-- <i-input type="text" maxlength="50" v-model="appShow.name" /> -->
-                    </Form-item>
-                    <Form-item label="封面" prop="appListPicUrl">
-                        <div class="demo-upload-list">
-                            <template>
-                                <img v-if="!appShow.appListPicUrl" style="width: 167px;"
-                                    src="../statics/img/pic_bg@2x.png">
-                                <img v-else style="width: 167px;" :src="appShow.appListPicUrl">
-                                <div class="demo-upload-list-cover">
-                                    <i class="ivu-icon ivu-icon-eye" @click="eyeImage(appShow.appListPicUrl)"></i>
-                                    <i class="ivu-icon ivu-icon-trash-a" @click="appShow.appListPicUrl=''"></i>
-                                </div>
-                            </template>
-                        </div>
-                        <div class="c-btn">
-                            <Upload action="../sys/oss/upload" :format="['jpg','jpeg','png','gif']" :max-size="1024*2"
-                                :on-success="handleSuccessListPicUrl" :on-format-error="handleFormatError"
-                                :show-upload-list="false" :on-exceeded-size="handleMaxSize">
-                                <i-button type="warning" icon="ios-cloud-upload-outline">上传图片</i-button>
-                            </Upload>
-                        </div>
-                        <p>1、支持png、jpg和gif图片格式;</p>
-                        <p>2、最大可上传2M的图片。</p>
-                        <p>3、推荐大小:400 * 400 像素</p>
-                        <div>
-                        </div>
-                    </Form-item>
-                    <Form-item label="是否在小程序里显示" prop="isShow">
-                        <Radio-group v-model="appShow.isShow">
-                            <Radio label="0">
-                                <span>否</span>
-                            </Radio>
-                            <Radio label="1">
-                                <span>是</span>
-                            </Radio>
-                        </Radio-group>
-                    </Form-item>
-                    <Form-item>
-                        <i-button type="primary" @click="handleSubmit1('formValidate1')">提交</i-button>
-                        <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
-                    </Form-item>
-                </div>
-            </i-form>
-        </Card>
-        <div v-show="loading">
-            <Spin fix>
-                <Icon type="load-c" size=30 class="demo-spin-icon-load"></Icon>
-                <div style="font-size: 20px;">Loading</div>
-            </Spin>
-        </div>
-
-
-
-
-        <Card v-show="roleBangding">
-            <p slot="title">{{title}}</p>
-            <i-form ref="formValidate" :model="user" :rules="ruleValidate" :label-width="80">
-                <div style="width: 100%;">
-                    <Form-item label="用户名" prop="username">
-                        <div class="c-winput">
-                            <i-input v-model="user.username" placeholder="登录账号" />
-                        </div>
-                    </Form-item>
-                    <Form-item label="所属公司" prop="deptName">
-                        <div class="c-winput" @click="deptTree">
-                            <i-input type="text" v-model="user.deptName" icon="eye" readonly="readonly"
-                                readonly="readonly" placeholder="所属公司" />
-                        </div>
-                    </Form-item>
-                    <Form-item label="邮箱" prop="email">
-                        <div class="c-winput">
-                            <i-input v-model="user.email" placeholder="邮箱" />
-                        </div>
-                    </Form-item>
-
-                    <Form-item label="手机号" prop="mobile">
-                        <div class="c-winput">
-                            <i-input v-model="user.mobile" placeholder="手机号" />
-                        </div>
-                    </Form-item>
-
-                    <Form-item label="VR场景关联">
-                        <i-button @click="getBrandList">添加VR场景</i-button>
-
-                        <div v-if="user.brandList">
-                            <span style="margin-right: 20px;" v-for="(item,i) in user.brandList"
-                                :key="i">{{item.brandName||item.name}}</span>
-                        </div>
-
-                    </Form-item>
-
-                    <Form-item label="角色" prop="roleIdList">
-                        <Checkbox-group v-model="user.roleIdList">
-                            <Checkbox :label="role.roleId" v-for="role in roleList">{{role.roleName}}</Checkbox>
-                        </Checkbox-group>
-                    </Form-item>
-
-                    <Form-item label="状态" prop="status">
-                        <Radio-group v-model="user.status">
-                            <Radio label="0">
-                                <span>禁用</span>
-                            </Radio>
-                            <Radio label="1">
-                                <span>正常</span>
-                            </Radio>
-                        </Radio-group>
-                    </Form-item>
-                    <Form-item>
-                        <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
-                        <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
-                        <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置
-                        </i-button>
-                    </Form-item>
-                </div>
-            </i-form>
-        </Card>
-
-        <Modal v-model="modal1" title="添加VR场景关联" @on-ok="ok" @on-cancel="cancel">
-            <!-- 
+              <div style="display: inline-block">
+                <i-button @click="query">查询</i-button>
+              </div>
+
+              <!-- <div style="display: inline-block;margin-left: 10px;">可新增数量为 {{lessNum}} 个</div> -->
+            </i-col>
+          </div>
+          <div class="buttons-group">
+            #if($shiro.hasPermission("brand:list"))
+            <!-- <i-button v-if="localStorage.getItem('userExpTime') > Date.now()" type="info" @click="open">绑定员工</i-button> -->
+
+            <!-- <i-button type="info" @click="syncScene">同步场景</i-button> -->
+            <i-button v-if="localStorage.getItem('userExpTime') > Date.now() || localStorage.getItem('userExpTime') == 'null'" type="info" @click="showYoN">修改</i-button>
+            #end
+          </div>
+        </Row>
+        <table id="jqGrid"></table>
+        <div id="jqGridPager"></div>
+      </div>
+
+      <Card v-show="showInApp">
+        <p slot="title">{{title}}</p>
+        <i-form :model="appShow" ref="formValidate1" :rules="ruleValidate1" :label-width="120">
+          <div>
+            <Form-item label="场景名称:" prop="name">
+              <!-- <div>{{appShow.name}}</div> -->
+              <div>{{appShow.name}}</div>
+              <!-- <i-input type="text" maxlength="50" v-model="appShow.name" /> -->
+            </Form-item>
+            <Form-item label="封面" prop="appListPicUrl">
+              <div class="demo-upload-list">
+                <template>
+                  <img v-if="!appShow.appListPicUrl" style="width: 167px" src="../statics/img/pic_bg@2x.png" />
+                  <img v-else style="width: 167px" :src="appShow.appListPicUrl" />
+                  <div class="demo-upload-list-cover">
+                    <i class="ivu-icon ivu-icon-eye" @click="eyeImage(appShow.appListPicUrl)"></i>
+                    <i class="ivu-icon ivu-icon-trash-a" @click="appShow.appListPicUrl=''"></i>
+                  </div>
+                </template>
+              </div>
+              <div class="c-btn">
+                <Upload
+                  action="../sys/oss/upload"
+                  :format="['jpg','jpeg','png','gif']"
+                  :max-size="1024*2"
+                  :on-success="handleSuccessListPicUrl"
+                  :on-format-error="handleFormatError"
+                  :show-upload-list="false"
+                  :on-exceeded-size="handleMaxSize"
+                >
+                  <i-button type="warning" icon="ios-cloud-upload-outline">上传图片</i-button>
+                </Upload>
+              </div>
+              <p>1、支持png、jpg和gif图片格式;</p>
+              <p>2、最大可上传2M的图片。</p>
+              <p>3、推荐大小:400 * 400 像素</p>
+              <div></div>
+            </Form-item>
+            <Form-item label="是否在小程序里显示" prop="isShow">
+              <Radio-group v-model="appShow.isShow">
+                <Radio label="0">
+                  <span>否</span>
+                </Radio>
+                <Radio label="1">
+                  <span>是</span>
+                </Radio>
+              </Radio-group>
+            </Form-item>
+            <Form-item>
+              <i-button type="primary" @click="handleSubmit1('formValidate1')">提交</i-button>
+              <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
+            </Form-item>
+          </div>
+        </i-form>
+      </Card>
+      <div v-show="loading">
+        <Spin fix>
+          <Icon type="load-c" size="30" class="demo-spin-icon-load"></Icon>
+          <div style="font-size: 20px">Loading</div>
+        </Spin>
+      </div>
+
+      <Card v-show="roleBangding">
+        <p slot="title">{{title}}</p>
+        <i-form ref="formValidate" :model="user" :rules="ruleValidate" :label-width="80">
+          <div style="width: 100%">
+            <Form-item label="用户名" prop="username">
+              <div class="c-winput">
+                <i-input v-model="user.username" placeholder="登录账号" />
+              </div>
+            </Form-item>
+            <Form-item label="所属公司" prop="deptName">
+              <div class="c-winput" @click="deptTree">
+                <i-input type="text" v-model="user.deptName" icon="eye" readonly="readonly" readonly="readonly" placeholder="所属公司" />
+              </div>
+            </Form-item>
+            <Form-item label="邮箱" prop="email">
+              <div class="c-winput">
+                <i-input v-model="user.email" placeholder="邮箱" />
+              </div>
+            </Form-item>
+
+            <Form-item label="手机号" prop="mobile">
+              <div class="c-winput">
+                <i-input v-model="user.mobile" placeholder="手机号" />
+              </div>
+            </Form-item>
+
+            <Form-item label="VR场景关联">
+              <i-button @click="getBrandList">添加VR场景</i-button>
+
+              <div v-if="user.brandList">
+                <span style="margin-right: 20px" v-for="(item,i) in user.brandList" :key="i">{{item.brandName||item.name}}</span>
+              </div>
+            </Form-item>
+
+            <Form-item label="角色" prop="roleIdList">
+              <Checkbox-group v-model="user.roleIdList">
+                <Checkbox :label="role.roleId" v-for="role in roleList">{{role.roleName}}</Checkbox>
+              </Checkbox-group>
+            </Form-item>
+
+            <Form-item label="状态" prop="status">
+              <Radio-group v-model="user.status">
+                <Radio label="0">
+                  <span>禁用</span>
+                </Radio>
+                <Radio label="1">
+                  <span>正常</span>
+                </Radio>
+              </Radio-group>
+            </Form-item>
+            <Form-item>
+              <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
+              <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
+              <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置 </i-button>
+            </Form-item>
+          </div>
+        </i-form>
+      </Card>
+
+      <Modal v-model="modal1" title="添加VR场景关联" @on-ok="ok" @on-cancel="cancel">
+        <!-- 
        <CheckboxGroup v-model="social" @on-change="checkAllGroupChange">
         <Checkbox  :label="brand.name" v-for="(brand,idx) in brandsList" :key='idx'>
             <span>{{brand.name}}</span>
         </Checkbox>
     </CheckboxGroup> -->
 
-            <div class="checkbox-item" @click="clickCheck(brand,idx)" v-for="(brand,idx) in brandsList" :key='idx'>
-                <span class="checkbox-kuang"></span>
-                <img v-if="brand.checked" src="http://4d-tjw.oss-cn-shenzhen.aliyuncs.com/images/fdsq-click.png" alt="">
-                <span>{{brand.name}}</span>
-            </div>
-
-            <Page style="margin-top: 20px;" :total="brandTotal" @on-change="pageChange" :page-size='brandPerPage'
-                :current='brandPage' size="small" />
-        </Modal>
+        <div class="checkbox-item" @click="clickCheck(brand,idx)" v-for="(brand,idx) in brandsList" :key="idx">
+          <span class="checkbox-kuang"></span>
+          <img v-if="brand.checked" src="http://4d-tjw.oss-cn-shenzhen.aliyuncs.com/images/fdsq-click.png" alt="" />
+          <span>{{brand.name}}</span>
+        </div>
 
+        <Page style="margin-top: 20px" :total="brandTotal" @on-change="pageChange" :page-size="brandPerPage" :current="brandPage" size="small" />
+      </Modal>
     </div>
     <!-- 选择公司 -->
-    <div id="deptLayer" style="display: none;padding:10px;">
-        <ul id="deptTree" class="ztree"></ul>
+    <div id="deptLayer" style="display: none; padding: 10px">
+      <ul id="deptTree" class="ztree"></ul>
     </div>
     <script src="${rc.contextPath}/js/shop/sceneAllocation.js?_${date.systemTime}"></script>
-</body>
-
-</html>
+  </body>
+</html>

+ 216 - 128
platform-admin/src/main/webapp/WEB-INF/page/shop/staff.html

@@ -1,159 +1,247 @@
 <!DOCTYPE html>
 <html>
-
-<head>
+  <head>
     <title>员工管理</title>
     #parse("sys/header.html")
-</head>
+  </head>
 
-<body>
+  <body>
     <div id="rrapp" v-cloak>
-        <div v-show="showList">
-            <Row :gutter="16">
-                <div class="search-group">
-                    <i-col span="8">
-                        <div style="display: inline-block;">
-                            <i-input v-model="q.key" @on-enter="query" placeholder="员工名称" />
-                        </div>
-                        <!-- <div style="display: inline-block;">
+      <div v-show="showList">
+        <Row :gutter="16">
+          <div class="search-group">
+            <i-col span="8">
+              <div style="display: inline-block">
+                <i-input
+                  v-model="q.key"
+                  @on-enter="query"
+                  placeholder="员工名称"
+                />
+              </div>
+              <!-- <div style="display: inline-block;">
                         <i-select v-model="q.deptId" placeholder="请选择所属公司">
                             <i-option value=" ">全部</i-option>
                             <i-option v-for="(item,i) in brands" :key="i" :value="item.id">{{item.name}}</i-option>
                         </i-select>
                     </div> -->
-                        <div style="display: inline-block;">
-                            <i-input v-model="q.deptName" @on-enter="query" placeholder="所属公司" />
-                        </div>
-                        <div style="display: inline-block;">
-                            <i-button @click="query">查询</i-button>
-                        </div>
-                        <!-- <div v-if="userRole!=5&&userRole!=6" style="display: inline-block;margin-left: 10px;">可新增数量为 {{lessNum}} 个</div> -->
-                        <div v-if="userRole==6" style="display: inline-block;margin-left: 10px;">可新增数量为 {{lessNum}} 个
-                        </div>
-                    </i-col>
-
-                </div>
-                <div class="buttons-group">
-                    <div class="buttons-group">
-                        <i-button
-                            v-if="(localStorage.getItem('userExpTime') > Date.now() && userRole == 6) || (localStorage.getItem('userExpTime') == 'null' && userRole == 6)"
-                            type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
-                        <i-button
-                            v-if="(localStorage.getItem('userExpTime') > Date.now() && userRole == 6) || (localStorage.getItem('userExpTime') == 'null' && userRole == 6)"
-                            type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
-                        <i-button
-                            v-if="(localStorage.getItem('userExpTime') > Date.now() && userRole == 6) || (localStorage.getItem('userExpTime') == 'null' && userRole == 6)"
-                            type="error" @click="checkDel"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
-
-                        <!-- #if($shiro.hasPermission("user:save"))
+              <div style="display: inline-block">
+                <i-input
+                  v-model="q.deptName"
+                  @on-enter="query"
+                  placeholder="所属公司"
+                />
+              </div>
+              <div style="display: inline-block">
+                <i-button @click="query">查询</i-button>
+              </div>
+              <!-- <div v-if="userRole!=5&&userRole!=6" style="display: inline-block;margin-left: 10px;">可新增数量为 {{lessNum}} 个</div> -->
+              <div
+                v-if="userRole==6"
+                style="display: inline-block; margin-left: 10px"
+              >
+                可新增数量为 {{lessNum}} 个
+              </div>
+            </i-col>
+          </div>
+          <div class="buttons-group">
+            <div class="buttons-group">
+              <i-button
+                v-if="(localStorage.getItem('userExpTime') > Date.now() && userRole == 6) || (localStorage.getItem('userExpTime') == 'null' && userRole == 6)"
+                type="info"
+                @click="add"
+                ><i class="fa fa-plus"></i>&nbsp;新增</i-button
+              >
+              <i-button
+                v-if="(localStorage.getItem('userExpTime') > Date.now() && userRole == 6) || (localStorage.getItem('userExpTime') == 'null' && userRole == 6)"
+                type="warning"
+                @click="update"
+                ><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button
+              >
+              <i-button
+                v-if="(localStorage.getItem('userExpTime') > Date.now() && userRole == 6) || (localStorage.getItem('userExpTime') == 'null' && userRole == 6)"
+                type="error"
+                @click="checkDel"
+                ><i class="fa fa-trash-o"></i>&nbsp;删除</i-button
+              >
+
+              <!-- #if($shiro.hasPermission("user:save"))
                         <i-button v-if="(localStorage.getItem('userExpTime') > Date.now() && userRole == 6) || (localStorage.getItem('userExpTime') == 'null' && userRole == 6)" type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                         #end #if($shiro.hasPermission("user:update"))
                         <i-button v-if="(localStorage.getItem('userExpTime') > Date.now() && userRole == 6) || (localStorage.getItem('userExpTime') == 'null' && userRole == 6)" type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                         #end #if($shiro.hasPermission("user:delete"))
                         <i-button v-if="(localStorage.getItem('userExpTime') > Date.now() && userRole == 6) || (localStorage.getItem('userExpTime') == 'null' && userRole == 6)" type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                         #end -->
-                    </div>
-                </div>
-            </Row>
-            <table id="jqGrid"></table>
-            <div id="jqGridPager"></div>
-        </div>
-        <Modal v-model="show_delModal" title="删除员工">
-            <p v-if="delInfo.type==1" style="padding:10px 0 20px 20px;">是否确定删除员工?</p>
-            <p v-if="delInfo.type==2" style="padding:10px 0 20px 20px;">删除失败,公司仅剩一名员工,不可进行删除</p>
-            <p v-if="delInfo.type==3" style="padding:10px 0 20px 20px;">请将当前员工的直播间数据进行迁移后,再删除员工</p>
-
-            <div v-if="delInfo.type==3">
-                <i-form :model="delInfo" :label-width="120" ref="formDelValidate" :rules="delValidate">
-                    <Form-item label="选择迁移的员工" prop="select">
-                        <i-select v-model="delInfo.select" placeholder="请选择">
-                            <i-option :value="i" v-for="i in delInfo.list">{{i}}</i-option>
-                        </i-select>
-                    </Form-item>
-                </i-form>
-            </div>
-
-            <div slot="footer">
-                <i-button type="primary" size="large" @click="comfirmDel">确定</i-button>
-                <i-button type="text" size="large" v-if="delInfo.type!=2" @click="cancelDel">取消</i-button>
-
             </div>
-        </Modal>
-        <Card v-show="!showList">
-            <p slot="title">{{title}}</p>
-            <i-form ref="formValidate" :model="user" :rules="ruleValidate" :label-width="80">
-                <div style="width: 100%;">
-
-                    <Form-item label="手机号" prop="mobile">
-                        <div class="c-winput">
-                            <i-input :maxlength='11' v-model="user.mobile" placeholder="手机号" />
-                        </div>
-                        <div class="ivu-form-item-error-tip" style="display: none;" id="isSign">手机号未在指房宝APP中进行注册</div>
-                        <Tooltip content="" placement="right">
-                            <i class="ivu-icon ivu-icon-help-circled"></i>
-                            <div slot="content">
-                                <p>手机号需在指房宝APP注册后才可新增</p>
-                            </div>
-                        </Tooltip>
-                    </Form-item>
-
-                    <Form-item label="员工名称" prop="username">
-                        <div class="c-winput">
-                            <i-input :maxlength='20' v-model="user.username" placeholder="请输入员工名称" />
-                        </div>
-                    </Form-item>
-
-                    <Form-item label="角色" prop="roleId">
-                        <Radio-group v-model="user.roleId">
-                            <Radio :key="role" :value="role.roleId" :label="role.roleId" v-for="role in roleList">
-                                {{role.roleName}}</Radio>
-                        </Radio-group>
-                    </Form-item>
+          </div>
+        </Row>
+        <table id="jqGrid"></table>
+        <div id="jqGridPager"></div>
+      </div>
+      <Modal v-model="show_delModal" title="删除员工">
+        <p v-if="delInfo.type==1" style="padding: 10px 0 20px 20px">
+          是否确定删除员工?
+        </p>
+        <p v-if="delInfo.type==2" style="padding: 10px 0 20px 20px">
+          删除失败,公司仅剩一名员工,不可进行删除
+        </p>
+        <p v-if="delInfo.type==3" style="padding: 10px 0 20px 20px">
+          请将当前员工的直播间数据进行迁移后,再删除员工
+        </p>
+
+        <div v-if="delInfo.type==3">
+          <i-form
+            :model="delInfo"
+            :label-width="120"
+            ref="formDelValidate"
+            :rules="delValidate"
+          >
+            <Form-item label="选择迁移的员工" prop="select">
+              <i-select v-model="delInfo.select" placeholder="请选择">
+                <i-option :value="i" v-for="i in delInfo.list">{{i}}</i-option>
+              </i-select>
+            </Form-item>
+          </i-form>
+        </div>
 
-                    <Form-item label="状态" prop="status">
-                        <Radio-group v-model="user.status">
-                            <Radio value="1" label="1">
-                                <span>正常</span>
-                            </Radio>
-                            <Radio value="0" label="0">
-                                <span>禁用</span>
-                            </Radio>
-                        </Radio-group>
-                    </Form-item>
-                    <Form-item>
-                        <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
-                        <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
-                        <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置
-                        </i-button>
-                    </Form-item>
+        <div slot="footer">
+          <i-button type="primary" size="large" @click="comfirmDel"
+            >确定</i-button
+          >
+          <i-button
+            type="text"
+            size="large"
+            v-if="delInfo.type!=2"
+            @click="cancelDel"
+            >取消</i-button
+          >
+        </div>
+      </Modal>
+      <Card v-show="!showList">
+        <p slot="title">{{title}}</p>
+        <i-form
+          ref="formValidate"
+          :model="user"
+          :rules="ruleValidate"
+          :label-width="80"
+        >
+          <div style="width: 100%">
+            <Form-item label="手机号" prop="mobile">
+              <div class="c-winput">
+                <i-input
+                  :maxlength="11"
+                  v-model="user.mobile"
+                  placeholder="手机号"
+                />
+              </div>
+              <div
+                class="ivu-form-item-error-tip"
+                style="display: none"
+                id="isSign"
+              >
+                手机号未在指房宝APP中进行注册
+              </div>
+              <Tooltip content="" placement="right">
+                <i class="ivu-icon ivu-icon-help-circled"></i>
+                <div slot="content">
+                  <p>手机号需在指房宝APP注册后才可新增</p>
                 </div>
-            </i-form>
-        </Card>
-
-        <Modal v-model="modal1" title="添加VR场景关联" @on-ok="ok" @on-cancel="cancel">
-            <!-- 
+              </Tooltip>
+            </Form-item>
+
+            <Form-item label="员工名称" prop="username">
+              <div class="c-winput">
+                <i-input
+                  :maxlength="20"
+                  v-model="user.username"
+                  placeholder="请输入员工名称"
+                />
+              </div>
+            </Form-item>
+
+            <Form-item label="角色" prop="roleId">
+              <Radio-group v-model="user.roleId">
+                <Radio
+                  :key="role"
+                  :value="role.roleId"
+                  :label="role.roleId"
+                  v-for="role in roleList"
+                  v-if="role.roleId!==9"
+                >
+                  {{role.roleName}}</Radio
+                >
+              </Radio-group>
+            </Form-item>
+
+            <Form-item label="状态" prop="status">
+              <Radio-group v-model="user.status">
+                <Radio value="1" label="1">
+                  <span>正常</span>
+                </Radio>
+                <Radio value="0" label="0">
+                  <span>禁用</span>
+                </Radio>
+              </Radio-group>
+            </Form-item>
+            <Form-item>
+              <i-button type="primary" @click="handleSubmit('formValidate')"
+                >提交</i-button
+              >
+              <i-button type="warning" @click="reload" style="margin-left: 8px"
+                >返回</i-button
+              >
+              <i-button
+                type="ghost"
+                @click="handleReset('formValidate')"
+                style="margin-left: 8px"
+                >重置
+              </i-button>
+            </Form-item>
+          </div>
+        </i-form>
+      </Card>
+
+      <Modal
+        v-model="modal1"
+        title="添加VR场景关联"
+        @on-ok="ok"
+        @on-cancel="cancel"
+      >
+        <!-- 
        <CheckboxGroup v-model="social" @on-change="checkAllGroupChange">
         <Checkbox  :label="brand.name" v-for="(brand,idx) in brandsList" :key='idx'>
             <span>{{brand.name}}</span>
         </Checkbox>
     </CheckboxGroup> -->
 
-            <div class="checkbox-item" @click="clickCheck(brand,idx)" v-for="(brand,idx) in brandsList" :key='idx'>
-                <span class="checkbox-kuang"></span>
-                <img v-if="brand.checked" src="http://4d-tjw.oss-cn-shenzhen.aliyuncs.com/images/fdsq-click.png" alt="">
-                <span>{{brand.name}}</span>
-            </div>
-
-            <Page style="margin-top: 20px;" :total="brandTotal" @on-change="pageChange" :page-size='brandPerPage'
-                :current='brandPage' size="small" />
-        </Modal>
+        <div
+          class="checkbox-item"
+          @click="clickCheck(brand,idx)"
+          v-for="(brand,idx) in brandsList"
+          :key="idx"
+        >
+          <span class="checkbox-kuang"></span>
+          <img
+            v-if="brand.checked"
+            src="http://4d-tjw.oss-cn-shenzhen.aliyuncs.com/images/fdsq-click.png"
+            alt=""
+          />
+          <span>{{brand.name}}</span>
+        </div>
 
+        <Page
+          style="margin-top: 20px"
+          :total="brandTotal"
+          @on-change="pageChange"
+          :page-size="brandPerPage"
+          :current="brandPage"
+          size="small"
+        />
+      </Modal>
     </div>
     <!-- 选择公司 -->
-    <div id="deptLayer" style="display: none;padding:10px;">
-        <ul id="deptTree" class="ztree"></ul>
+    <div id="deptLayer" style="display: none; padding: 10px">
+      <ul id="deptTree" class="ztree"></ul>
     </div>
     <script src="${rc.contextPath}/js/shop/staff.js?_${date.systemTime}"></script>
-</body>
-
-</html>
+  </body>
+</html>

+ 82 - 0
platform-admin/src/main/webapp/WEB-INF/page/sys/bindAccount.html

@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>绑定账号</title>
+    #parse("sys/header.html")
+  </head>
+
+  <body>
+    <div id="rrapp" v-cloak>
+      <div
+        v-if="loading"
+        style="padding: 40px 20px; box-sizing: border-box; width: 600px"
+      >
+        <div v-if="info.fdkkUser" style="position: relative">
+          <i-form :model="info" :label-width="80">
+            <Form-item label="手机号">
+              <i-input disabled v-model="show_fdkkUser" />
+            </Form-item>
+          </i-form>
+          <span
+            style="
+              position: absolute;
+              top: 50%;
+              transform: translateY(-50%);
+              right: -65px;
+              color: #02a7f0;
+              cursor: pointer;
+            "
+            @click="unbind"
+            >解绑账号</span
+          >
+        </div>
+        <div v-else>
+          <i-form
+            ref="formValidate"
+            :model="form"
+            :rules="ruleValidate"
+            :label-width="80"
+          >
+            <div style="width: 100%">
+              <Form-item label="手机号" prop="fdkkUser">
+                <i-input v-model="form.fdkkUser" placeholder="请输入手机号" />
+              </Form-item>
+
+              <Form-item label="密码" prop="fdkkPassword">
+                <i-input
+                  v-model="form.fdkkPassword"
+                  type="password"
+                  placeholder="请输入密码"
+                />
+              </Form-item>
+            </div>
+          </i-form>
+        </div>
+
+        <div style="padding: 20px 35px; line-height: 30px; margin-bottom: 20px">
+          <p>温馨提示:</p>
+          <p>1、绑定的账号是四维看看pro相机的账号信息。</p>
+          <p>2、绑定后,编辑该相机拍摄的场景可进行自动登录,不需要重复登录。</p>
+        </div>
+
+        <div
+          v-if="!info.fdkkUser"
+          style="padding: 0 0 0 35px; box-sizing: border-box"
+        >
+          <i-button
+            type="warning"
+            @click="handleReset('formValidate')"
+            style="margin-right: 20px"
+            >重置</i-button
+          >
+          <i-button type="primary" @click="handleSubmit('formValidate')"
+            >提交</i-button
+          >
+        </div>
+      </div>
+    </div>
+    <script src="${rc.contextPath}/statics/libs/base64.min.js"></script>
+    <script src="${rc.contextPath}/statics/libs/common.js"></script>
+    <script src="${rc.contextPath}/js/sys/bindAccount.js?_${date.systemTime}"></script>
+  </body>
+</html>

+ 1 - 0
platform-admin/src/main/webapp/WEB-INF/page/sys/menu.html

@@ -81,6 +81,7 @@
                         <i-input v-model="menu.icon" placeholder="图标,点击右边按钮选取图标"  icon="eye"/>
                     </div>
                 </Form-item>
+                {{menu.icon}}
                 <Form-item label="状态" prop="status">
                     <Radio-group v-model="menu.status">
                         <Radio label="0">

+ 205 - 129
platform-admin/src/main/webapp/WEB-INF/page/sys/user.html

@@ -1,95 +1,156 @@
 <!DOCTYPE html>
 <html>
-
-<head>
+  <head>
     <title>管理员列表</title>
     #parse("sys/header.html")
-</head>
+  </head>
 
-<body>
+  <body>
     <div id="rrapp" v-cloak>
-        <div v-show="showList">
-            <Row :gutter="16">
-                <div class="search-group">
-                    <i-col span="8">
-                        <div style="display: inline-block;">
-                            <i-input v-model="q.username" @on-enter="query" placeholder="用户名" />
-                        </div>
-                        <div style="display: inline-block;">
-                            <i-button @click="query">查询</i-button>
-                        </div>
-                    </i-col>
-                </div>
-                <div class="buttons-group">
-                    #if($shiro.hasPermission("sys:user:save"))
-                    <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
-                    #end #if($shiro.hasPermission("sys:user:update"))
-                    <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
-                    #end #if($shiro.hasPermission("sys:user:delete"))
-                    <!-- <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button> -->
-                    <i-button type="error" @click="checkDel"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
-                    #end
-                </div>
-            </Row>
-            <table id="jqGrid"></table>
-            <div id="jqGridPager"></div>
+      <div v-show="showList">
+        <Row :gutter="16">
+          <div class="search-group">
+            <i-col span="8">
+              <div style="display: inline-block">
+                <i-input
+                  v-model="q.username"
+                  @on-enter="query"
+                  placeholder="用户名"
+                />
+              </div>
+              <div style="display: inline-block">
+                <i-button @click="query">查询</i-button>
+              </div>
+            </i-col>
+          </div>
+          <div class="buttons-group">
+            #if($shiro.hasPermission("sys:user:save"))
+            <i-button type="info" @click="add"
+              ><i class="fa fa-plus"></i>&nbsp;新增</i-button
+            >
+            #end #if($shiro.hasPermission("sys:user:update"))
+            <i-button type="warning" @click="update"
+              ><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button
+            >
+            #end #if($shiro.hasPermission("sys:user:delete"))
+            <!-- <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button> -->
+            <i-button type="error" @click="checkDel"
+              ><i class="fa fa-trash-o"></i>&nbsp;删除</i-button
+            >
+            #end
+          </div>
+        </Row>
+        <table id="jqGrid"></table>
+        <div id="jqGridPager"></div>
+      </div>
+      <Modal v-model="show_delModal" title="删除员工">
+        <p v-if="delInfo.type==1" style="padding: 10px 0 20px 20px">
+          是否确定删除员工?
+        </p>
+        <p v-if="delInfo.type==2" style="padding: 10px 0 20px 20px">
+          删除失败,公司仅剩一名员工,不可进行删除
+        </p>
+        <p v-if="delInfo.type==3" style="padding: 10px 0 20px 20px">
+          请将当前员工的直播间数据进行迁移后,再删除员工
+        </p>
+
+        <div v-if="delInfo.type==3">
+          <i-form
+            :model="delInfo"
+            :label-width="120"
+            ref="formDelValidate"
+            :rules="delValidate"
+          >
+            <Form-item label="选择迁移的员工" prop="select">
+              <i-select v-model="delInfo.select" placeholder="请选择">
+                <i-option :value="i" v-for="i in delInfo.list">{{i}}</i-option>
+              </i-select>
+            </Form-item>
+          </i-form>
         </div>
-        <Modal v-model="show_delModal" title="删除员工">
-            <p v-if="delInfo.type==1" style="padding:10px 0 20px 20px;">是否确定删除员工?</p>
-            <p v-if="delInfo.type==2" style="padding:10px 0 20px 20px;">删除失败,公司仅剩一名员工,不可进行删除</p>
-            <p v-if="delInfo.type==3" style="padding:10px 0 20px 20px;">请将当前员工的直播间数据进行迁移后,再删除员工</p>
-
-            <div v-if="delInfo.type==3">
-                <i-form :model="delInfo" :label-width="120" ref="formDelValidate" :rules="delValidate">
-                    <Form-item label="选择迁移的员工" prop="select">
-                        <i-select v-model="delInfo.select" placeholder="请选择">
-                            <i-option :value="i" v-for="i in delInfo.list">{{i}}</i-option>
-                        </i-select>
-                    </Form-item>
-                </i-form>
-            </div>
 
-            <div slot="footer">
-                <i-button type="primary" size="large" @click="comfirmDel">确定</i-button>
-                <i-button type="text" size="large" v-if="delInfo.type!=2" @click="cancelDel">取消</i-button>
-
-            </div>
-        </Modal>
-        <Card v-show="!showList">
-            <p slot="title">{{title}}</p>
-            <i-form ref="formValidate" :model="user" :rules="ruleValidate" :label-width="80">
-                <div style="width: 100%;">
-                    <Form-item label="用户名" prop="username">
-                        <div class="c-winput">
-                            <i-input v-model="user.username" placeholder="登录账号" />
-                        </div>
-                    </Form-item>
-                    <Form-item label="所属公司" prop="deptName">
-                        <div class="c-winput" @click="deptTree">
-                            <i-input type="text" v-model="user.deptName" icon="eye" readonly="readonly"
-                                readonly="readonly" placeholder="所属公司" />
-                        </div>
-                    </Form-item>
-                    <Form-item label="邮箱" prop="email">
+        <div slot="footer">
+          <i-button type="primary" size="large" @click="comfirmDel"
+            >确定</i-button
+          >
+          <i-button
+            type="text"
+            size="large"
+            v-if="delInfo.type!=2"
+            @click="cancelDel"
+            >取消</i-button
+          >
+        </div>
+      </Modal>
+      <Card v-show="!showList">
+        <p slot="title">{{title}}</p>
+        <i-form
+          ref="formValidate"
+          :model="user"
+          :rules="ruleValidate"
+          :label-width="80"
+        >
+          <div style="width: 100%">
+            <Form-item label="角色" prop="roleIdList">
+              <!-- <Checkbox-group v-model="user.roleIdList">
+                        <Checkbox :label="role.roleId" v-for="role in roleList">{{role.roleName}}</Checkbox>
+                    </Checkbox-group> -->
+              <Radio-group
+                v-model="user.roleIdList[0]"
+                @on-change="change_role"
+              >
+                <Radio :label="role.roleId" v-for="role in roleList"
+                  >{{role.roleName}}
+                </Radio>
+              </Radio-group>
+            </Form-item>
+            <Form-item label="用户名" prop="username">
+              <div class="c-winput">
+                <i-input v-model="user.username" placeholder="登录账号" />
+              </div>
+            </Form-item>
+            <Form-item
+              v-if="user.roleIdList[0]!=9"
+              label="所属公司"
+              prop="deptName"
+            >
+              <div class="c-winput" @click="deptTree">
+                <i-input
+                  type="text"
+                  v-model="user.deptName"
+                  icon="eye"
+                  readonly="readonly"
+                  readonly="readonly"
+                  placeholder="所属公司"
+                />
+              </div>
+            </Form-item>
+            <!-- <Form-item label="邮箱" prop="email">
                         <div class="c-winput">
                             <i-input v-model="user.email" placeholder="邮箱" />
                         </div>
-                    </Form-item>
-
-                    <Form-item label="手机号" prop="mobile">
-                        <div class="c-winput">
-                            <i-input v-model="user.mobile" placeholder="手机号" />
-                        </div>
-                        <div class="ivu-form-item-error-tip" style="display: none;" id="isSign1">手机号未在指房宝APP中进行注册</div>
-                        <Tooltip content="" placement="right">
-                            <i class="ivu-icon ivu-icon-help-circled"></i>
-                            <div slot="content">
-                                <p>手机号需在指房宝APP注册后才可新增</p>
-                            </div>
-                        </Tooltip>
-                    </Form-item>
+                    </Form-item> -->
+
+            <Form-item label="手机号" prop="mobile">
+              <div class="c-winput">
+                <i-input v-model="user.mobile" placeholder="手机号" />
+              </div>
+              <div
+                class="ivu-form-item-error-tip"
+                style="display: none"
+                id="isSign1"
+              >
+                手机号未在指房宝APP中进行注册
+              </div>
+              <Tooltip content="" placement="right">
+                <i class="ivu-icon ivu-icon-help-circled"></i>
+                <div slot="content">
+                  <p>手机号需在指房宝APP注册后才可新增</p>
+                </div>
+              </Tooltip>
+            </Form-item>
 
-                    <!-- <Form-item label="VR场景关联">
+            <!-- <Form-item label="VR场景关联">
                 <i-button  @click="getBrandList">添加VR场景</i-button>
 
                 <div v-if="user.brandList">
@@ -98,63 +159,78 @@
 
             </Form-item> -->
 
-                    <Form-item label="角色" prop="roleIdList">
-                        <!-- <Checkbox-group v-model="user.roleIdList">
-                            <Checkbox :label="role.roleId" v-for="role in roleList">{{role.roleName}}</Checkbox>
-                        </Checkbox-group> -->
-                        <Radio-group v-model="user.roleIdList" @on-change="change_role">
-                            <Radio :label="role.roleId" v-for="role in roleList">{{role.roleName}}
-                            </Radio>
-                        </Radio-group>
-                    </Form-item>
-
-                    <Form-item label="状态" prop="status">
-                        <Radio-group v-model="user.status">
-                            <Radio label="0">
-                                <span>禁用</span>
-                            </Radio>
-                            <Radio label="1">
-                                <span>正常</span>
-                            </Radio>
-                        </Radio-group>
-                    </Form-item>
-                    <Form-item>
-                        <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
-                        <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
-                        <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置
-                        </i-button>
-                    </Form-item>
-                </div>
-            </i-form>
-        </Card>
-
-        <Modal v-model="modal1" title="添加VR场景关联" @on-ok="ok" @on-cancel="cancel">
-            <!-- 
+            <Form-item label="状态" prop="status">
+              <Radio-group v-model="user.status">
+                <Radio label="0">
+                  <span>禁用</span>
+                </Radio>
+                <Radio label="1">
+                  <span>正常</span>
+                </Radio>
+              </Radio-group>
+            </Form-item>
+            <Form-item>
+              <i-button type="primary" @click="handleSubmit('formValidate')"
+                >提交</i-button
+              >
+              <i-button type="warning" @click="reload" style="margin-left: 8px"
+                >返回</i-button
+              >
+              <i-button
+                type="ghost"
+                @click="handleReset('formValidate')"
+                style="margin-left: 8px"
+                >重置
+              </i-button>
+            </Form-item>
+          </div>
+        </i-form>
+      </Card>
+
+      <Modal
+        v-model="modal1"
+        title="添加VR场景关联"
+        @on-ok="ok"
+        @on-cancel="cancel"
+      >
+        <!-- 
        <CheckboxGroup v-model="social" @on-change="checkAllGroupChange">
         <Checkbox  :label="brand.name" v-for="(brand,idx) in brandsList" :key='idx'>
             <span>{{brand.name}}</span>
         </Checkbox>
     </CheckboxGroup> -->
 
-            <div class="checkbox-item" @click="clickCheck(brand,idx)" v-for="(brand,idx) in brandsList" :key='idx'>
-                <div>
-                    <span class="checkbox-kuang"></span>
-                    <img v-if="brand.checked" src="http://4d-tjw.oss-cn-shenzhen.aliyuncs.com/images/fdsq-click.png"
-                        alt="">
-                    <span>{{brand.sceneName}}</span>
-                </div>
-            </div>
-
-            <Page style="margin-top: 20px;" :total="brandTotal" @on-change="pageChange" :page-size='brandPerPage'
-                :current='brandPage' size="small" />
-        </Modal>
+        <div
+          class="checkbox-item"
+          @click="clickCheck(brand,idx)"
+          v-for="(brand,idx) in brandsList"
+          :key="idx"
+        >
+          <div>
+            <span class="checkbox-kuang"></span>
+            <img
+              v-if="brand.checked"
+              src="http://4d-tjw.oss-cn-shenzhen.aliyuncs.com/images/fdsq-click.png"
+              alt=""
+            />
+            <span>{{brand.sceneName}}</span>
+          </div>
+        </div>
 
+        <Page
+          style="margin-top: 20px"
+          :total="brandTotal"
+          @on-change="pageChange"
+          :page-size="brandPerPage"
+          :current="brandPage"
+          size="small"
+        />
+      </Modal>
     </div>
     <!-- 选择公司 -->
-    <div id="deptLayer" style="display: none;padding:10px;">
-        <ul id="deptTree" class="ztree"></ul>
+    <div id="deptLayer" style="display: none; padding: 10px">
+      <ul id="deptTree" class="ztree"></ul>
     </div>
     <script src="${rc.contextPath}/js/sys/user.js?_${date.systemTime}"></script>
-</body>
-
-</html>
+  </body>
+</html>

File diff ditekan karena terlalu besar
+ 11209 - 10714
platform-admin/src/main/webapp/js/shop/brand.js


File diff ditekan karena terlalu besar
+ 650 - 622
platform-admin/src/main/webapp/js/shop/sceneAllocation.js


+ 86 - 79
platform-admin/src/main/webapp/js/shop/selectUser.js

@@ -22,27 +22,31 @@ $(function() {
             var rowKey = grid.getGridParam("selarrrow");
             $('#selctedNum').html(rowKey.length)
 
-            cacheData.forEach(item => {
-                $('#' + item.userId).children('input').attr("disabled", true)
-            })
-            var data = getSelectedRowDatas("#jqGrid");
-            data.forEach(item => {
-                $('#' + item.userId).children('input').attr("disabled", false)
-            })
-        },
-        beforeSelectRow(rowid) {
-            var grid = $('#jqGrid');
-            var item = grid.jqGrid('getRowData', rowid);
-            let idx = cacheItems.findIndex(sub => {
-                return sub.userId == item.userId
-            })
-            console.log(idx);
+      cacheData.forEach((item) => {
+        $('#' + item.userId)
+          .children('input')
+          .attr('disabled', true)
+      })
+      var data = getSelectedRowDatas('#jqGrid')
+      data.forEach((item) => {
+        $('#' + item.userId)
+          .children('input')
+          .attr('disabled', false)
+      })
+    },
+    beforeSelectRow(rowid) {
+      var grid = $('#jqGrid')
+      var item = grid.jqGrid('getRowData', rowid)
+      let idx = cacheItems.findIndex((sub) => {
+        return sub.userId == item.userId
+      })
+      console.log(idx)
 
-            if (idx == -1) {
-                cacheItems.push(item)
-            } else {
-                cacheItems[idx] = item
-            }
+      if (idx == -1) {
+        cacheItems.push(item)
+      } else {
+        cacheItems[idx] = item
+      }
 
             // cacheItems.indexOf(item)<=-1 && cacheItems.push(rowid)
         },
@@ -96,29 +100,33 @@ $(function() {
                     return `<div  id="${row.userId}" style="display: flex;align-items: center;justify-content: center;">
                 <input style="width:20px;height:20px;" name="${row.userId}" disabled id="${row.userId}" type="radio" value="1" ${value?'checked':''}  >
                 <span style="margin-right:10px;">是</span>
-                <input  style="width:20px;height:20px;" name="${row.userId}" disabled id="${row.userId}" type="radio"  value="0" ${!value?'checked':''}> 
+                <input  style="width:20px;height:20px;" name="${
+                  row.userId
+                }" disabled id="${row.userId}" type="radio"  value="0" ${
+            !value ? 'checked' : ''
+          }> 
                 <span>否</span>
                </div>`
-                }
-            }
-        ]
-    });
-});
+        },
+      },
+    ],
+  })
+})
 
 var setting = {
-    data: {
-        simpleData: {
-            enable: true,
-            idKey: "deptId",
-            pIdKey: "parentId",
-            rootPId: -1
-        },
-        key: {
-            url: "nourl"
-        }
-    }
-};
-var ztree;
+  data: {
+    simpleData: {
+      enable: true,
+      idKey: 'deptId',
+      pIdKey: 'parentId',
+      rootPId: -1,
+    },
+    key: {
+      url: 'nourl',
+    },
+  },
+}
+var ztree
 
 let id = getQueryString("id");
 let sceneName = getQueryString("sceneName");
@@ -166,40 +174,43 @@ var vm = new Vue({
                 { required: true, validator: validatePhoneCheck, trigger: 'blur' }
             ]
         },
-        brandsList: [],
-        brandPage: 1,
-        brandPerPage: 10,
-        brandTotal: 0,
-        brandSeleced: [],
-        social: [],
-        cacheData: {},
-        cacheDataFirst: {}
+      ],
     },
-    watch: {
-        brandPage: function name(newVal) {
-            this.getBrandList()
-        }
+    brandsList: [],
+    brandPage: 1,
+    brandPerPage: 10,
+    brandTotal: 0,
+    brandSeleced: [],
+    social: [],
+    cacheData: {},
+    cacheDataFirst: {},
+  },
+  watch: {
+    brandPage: function name(newVal) {
+      this.getBrandList()
     },
-    methods: {
-        submit() {
-            var data = getSelectedRowDatas("#jqGrid");
-
+  },
+  methods: {
+    submit() {
+      var data = getSelectedRowDatas('#jqGrid')
 
-            let parmas = cacheItems.map(ele => {
-                let canshow = $('#' + ele.userId).children(':radio[name="' + ele.userId + '"]:checked').val()
-                let type = -1
-                data.forEach(item => {
-                    if (ele.userId == item.userId) {
-                        type = 1
-                    }
-                })
-                return {
-                    "brandId": vm.brandId,
-                    "canShow": Number(canshow),
-                    "type": type,
-                    "userId": ele.userId
-                }
-            })
+      let parmas = cacheItems.map((ele) => {
+        let canshow = $('#' + ele.userId)
+          .children(':radio[name="' + ele.userId + '"]:checked')
+          .val()
+        let type = -1
+        data.forEach((item) => {
+          if (ele.userId == item.userId) {
+            type = 1
+          }
+        })
+        return {
+          brandId: vm.brandId,
+          canShow: Number(canshow),
+          type: type,
+          userId: ele.userId,
+        }
+      })
 
             if (parmas.length <= 0) {
                 return alert('操作成功', function(index) {
@@ -272,10 +283,8 @@ var vm = new Vue({
                     if (node != null) {
                         ztree.selectNode(node);
 
-                        vm.user.deptName = node.name;
-                    }
-                }
-            });
+            vm.user.deptName = node.name
+          }
         },
         pageChange: function(page) {
             this.brandPage = page
@@ -287,8 +296,8 @@ var vm = new Vue({
                 return;
             }
 
-            vm.showList = false;
-            vm.title = "修改";
+      vm.showList = false
+      vm.title = '修改'
 
             Ajax.request({
                 url: "../sys/user/info/" + userId,
@@ -369,9 +378,7 @@ var vm = new Vue({
                     vm.user.deptId = node[0].deptId;
                     vm.user.deptName = node[0].name;
 
-                    layer.close(index);
-                }
-            });
+          layer.close(index)
         },
         handleSubmit: function(name) {
             handleSubmitValidate(this, name, function() {

+ 126 - 0
platform-admin/src/main/webapp/js/sys/bindAccount.js

@@ -0,0 +1,126 @@
+const validatePhoneCheck = async function (rule, value, callback) {
+  if (value === '' || !value) {
+    callback(new Error('手机号不能为空'))
+  } else if (!/^1[3456789]\d{9}$/.test(value)) {
+    callback(new Error('手机号不正确'))
+  } else {
+    callback()
+  }
+}
+var vm = new Vue({
+  el: '#rrapp',
+  data: {
+    loading: false,
+    show_fdkkUser: '',
+    info: {
+      fdkkUser: null,
+    },
+    form: {
+      fdkkPassword: '',
+      fdkkUser: '',
+    },
+    ruleValidate: {
+      fdkkUser: [
+        {
+          required: true,
+          validator: validatePhoneCheck,
+          trigger: 'blur',
+        },
+      ],
+      fdkkPassword: [
+        { required: true, message: '密码不能为空', trigger: 'blur' },
+      ],
+    },
+  },
+  watch: {},
+  created() {
+    this.getBindInfo()
+  },
+  methods: {
+    handleSubmit: function (name) {
+      handleSubmitValidate(vm, name, function () {
+        var data = {
+          fdkkPassword: encodeStr(Base64.encode(vm.form.fdkkPassword)),
+          fdkkUser: vm.form.fdkkUser,
+        }
+        $.ajax({
+          type: 'POST',
+          url: '../sys/user/bind4dkkUser',
+          data: data,
+          dataType: 'json',
+          headers: { token: localStorage.getItem('token') },
+          success: function (result) {
+            if (result.code == 0) {
+              console.log(result)
+              alert('操作成功', function (index) {
+                vm.getBindInfo()
+                vm.form = {
+                  password: '',
+                  mobild: '',
+                }
+              })
+            } else {
+              alert(result.msg)
+            }
+          },
+          error: function (err) {},
+        })
+      })
+    },
+    handleReset: function (name) {
+      handleResetForm(vm, name)
+      vm.form = {
+        password: '',
+        mobild: '',
+      }
+    },
+    unbind() {
+      confirm('解绑后,场景对应绑定的数据将被删除,请谨慎操作', function () {
+        $.ajax({
+          type: 'POST',
+          url: '../sys/user/unBind4dkkUser',
+          headers: { token: localStorage.getItem('token') },
+          data: { fdkkUser: vm.info.fdkkUser },
+          dataType: 'json',
+          success: function (result) {
+            if (result.code == 0) {
+              vm.info.fdkkUser = null
+              alert('操作成功', function (index) {
+                // vm.reload()
+              })
+            } else {
+              alert(res.msg)
+            }
+          },
+        })
+      })
+    },
+    getBindInfo() {
+      var userId = JSON.parse(localStorage.getItem('userInfo')).userId
+      $.ajax({
+        type: 'GET',
+        url: `../sys/user/info/${userId}`,
+        // data: data,
+        // dataType: 'json',
+        success: function (res) {
+          vm.loading = true
+          console.log(res)
+          if (res.code == 0) {
+            vm.info = res.user
+            if (res.user.fdkkUser) {
+              vm.show_fdkkUser =
+                res.user.fdkkUser.substring(0, 4) +
+                '****' +
+                res.user.fdkkUser.substring(8, res.user.fdkkUser.length)
+            }
+          } else {
+            alert(res.msg)
+          }
+        },
+        error: function (err) {
+          vm.loading = true
+        },
+      })
+    },
+  },
+})

+ 278 - 233
platform-admin/src/main/webapp/js/sys/menu.js

@@ -1,261 +1,306 @@
 $(function () {
-    initialPage();
-    getGrid();
-});
+  initialPage()
+  getGrid()
+})
 
 function initialPage() {
-    $(window).resize(function () {
-        TreeGrid.table.resetHeight({height: $(window).height() - 100});
-    });
+  $(window).resize(function () {
+    TreeGrid.table.resetHeight({ height: $(window).height() - 100 })
+  })
 }
 
 function getGrid() {
-    var colunms = TreeGrid.initColumn();
-    var table = new TreeTable(TreeGrid.id, '../sys/menu/queryAll', colunms);
-    table.setExpandColumn(2);
-    table.setIdField("menuId");
-    table.setCodeField("menuId");
-    table.setParentCodeField("parentId");
-    table.setExpandAll(false);
-    table.setHeight($(window).height() - 100);
-    table.init();
-    TreeGrid.table = table;
+  var colunms = TreeGrid.initColumn()
+  var table = new TreeTable(TreeGrid.id, '../sys/menu/queryAll', colunms)
+  table.setExpandColumn(2)
+  table.setIdField('menuId')
+  table.setCodeField('menuId')
+  table.setParentCodeField('parentId')
+  table.setExpandAll(false)
+  table.setHeight($(window).height() - 100)
+  table.init()
+  TreeGrid.table = table
 }
 
 var TreeGrid = {
-    id: "jqGrid",
-    table: null,
-    layerIndex: -1
-};
+  id: 'jqGrid',
+  table: null,
+  layerIndex: -1,
+}
 
 /**
  * 初始化表格的列
  */
 TreeGrid.initColumn = function () {
-    var columns = [
-        {field: 'selectItem', radio: true},
-        {title: '编号', field: 'menuId', visitable: false, align: 'center', valign: 'middle', width: '80px'},
-        {title: '名称', field: 'name', align: 'center', valign: 'middle', width: '180px'},
-        {title: '上级菜单', field: 'parentName', align: 'center', valign: 'middle', width: '100px'},
-        {
-            title: '图标',
-            field: 'icon',
-            align: 'center',
-            valign: 'middle',
-            width: '50px',
-            formatter: function (item, index) {
-                return item.icon == null ? '' : '<i class="' + item.icon + ' fa-lg"></i>';
-            }
-        },
-        {
-            title: '类型',
-            field: 'type',
-            align: 'center',
-            valign: 'middle',
-            width: '60px',
-            formatter: function (item) {
-                if (item.type === 0) {
-                    return '<span class="label label-primary">目录</span>';
-                }
-                if (item.type === 1) {
-                    return '<span class="label label-success">菜单</span>';
-                }
-                if (item.type === 2) {
-                    return '<span class="label label-warning">按钮</span>';
-                }
-            }
-        },
-        {title: '排序', field: 'orderNum', align: 'center', valign: 'middle', width: '50px'},
-        {title: '菜单URL', field: 'url', align: 'center', valign: 'middle', width: '200px'},
-        {title: '授权标识', field: 'perms', align: 'center', valign: 'middle'},
-        {
-            title: '状态', field: 'status', align: 'center', valign: 'middle', width: '80px',
-            formatter: function (item) {
-                if (item.status === 1) {
-                    return '<span class="label label-danger">无效</span>';
-                }
-                return '<span class="label label-success">有效</span>';
-            }
-        }];
-    return columns;
-};
+  var columns = [
+    { field: 'selectItem', radio: true },
+    {
+      title: '编号',
+      field: 'menuId',
+      visitable: false,
+      align: 'center',
+      valign: 'middle',
+      width: '80px',
+    },
+    {
+      title: '名称',
+      field: 'name',
+      align: 'center',
+      valign: 'middle',
+      width: '180px',
+    },
+    {
+      title: '上级菜单',
+      field: 'parentName',
+      align: 'center',
+      valign: 'middle',
+      width: '100px',
+    },
+    {
+      title: '图标',
+      field: 'icon',
+      align: 'center',
+      valign: 'middle',
+      width: '50px',
+      formatter: function (item, index) {
+        return item.icon == null
+          ? ''
+          : '<i class="' + item.icon + ' fa-lg"></i>'
+      },
+    },
+    {
+      title: '类型',
+      field: 'type',
+      align: 'center',
+      valign: 'middle',
+      width: '60px',
+      formatter: function (item) {
+        if (item.type === 0) {
+          return '<span class="label label-primary">目录</span>'
+        }
+        if (item.type === 1) {
+          return '<span class="label label-success">菜单</span>'
+        }
+        if (item.type === 2) {
+          return '<span class="label label-warning">按钮</span>'
+        }
+      },
+    },
+    {
+      title: '排序',
+      field: 'orderNum',
+      align: 'center',
+      valign: 'middle',
+      width: '50px',
+    },
+    {
+      title: '菜单URL',
+      field: 'url',
+      align: 'center',
+      valign: 'middle',
+      width: '200px',
+    },
+    { title: '授权标识', field: 'perms', align: 'center', valign: 'middle' },
+    {
+      title: '状态',
+      field: 'status',
+      align: 'center',
+      valign: 'middle',
+      width: '80px',
+      formatter: function (item) {
+        if (item.status === 1) {
+          return '<span class="label label-danger">无效</span>'
+        }
+        return '<span class="label label-success">有效</span>'
+      },
+    },
+  ]
+  return columns
+}
 
 var setting = {
-    data: {
-        simpleData: {
-            enable: true,
-            idKey: "menuId",
-            pIdKey: "parentId",
-            rootPId: -1
-        },
-        key: {
-            url: "nourl"
-        }
-    }
-};
-var ztree;
+  data: {
+    simpleData: {
+      enable: true,
+      idKey: 'menuId',
+      pIdKey: 'parentId',
+      rootPId: -1,
+    },
+    key: {
+      url: 'nourl',
+    },
+  },
+}
+var ztree
 
 var vm = new Vue({
-    el: '#rrapp',
-    data: {
-        showList: true,
-        title: null,
-        menu: {
-            parentName: null,
-            parentId: 0,
-            type: 1,
-            orderNum: 0,
-            status: 0
-        },
-        q: {
-            menuName: '',
-            parentName: ''
-        },
-        ruleValidate: {
-            name: [
-                {required: true, message: '菜单名称不能为空', trigger: 'blur'}
-            ],
-            url: [
-                {required: true, message: '菜单url不能为空', trigger: 'blur'}
-            ],
-            parentName: [
-                {required: true, message: '上级菜单不能为空', trigger: 'blur'}
-            ]
-        }
+  el: '#rrapp',
+  data: {
+    showList: true,
+    title: null,
+    menu: {
+      icon: '',
+      parentName: null,
+      parentId: 0,
+      type: 1,
+      orderNum: 0,
+      status: 0,
     },
-    methods: {
-        selectIcon: function () {
-            openWindow({
-                type: 2,
-                title: '选取图标',
-                area: ['1030px', '500px'],
-                content: ['icon.html'],
-                btn: ['确定', '取消'],
-                btn1: function (index, layero) {
-                    var icon = layero.find("iframe")[0].contentWindow.$("#icon").val();
-                    vm.menu.icon = icon;
-                    top.layer.close(index);
-                    layer.close(index);
-                }
-            });
-        },
-        getMenu: function (menuId) {
-            //加载菜单树
-            Ajax.request({
-                url: "../sys/menu/select",
-                async: true,
-                successCallback: function (r) {
-                    ztree = $.fn.zTree.init($("#menuTree"), setting, r.menuList);
-                    var node = ztree.getNodeByParam("menuId", vm.menu.parentId);
-                    if (node) {
-                        ztree.selectNode(node);
-                        vm.menu.parentName = node.name;
-                    } else {
-                        node = ztree.getNodeByParam("menuId", 0);
-                        ztree.selectNode(node);
-                        vm.menu.parentName = node.name;
-                    }
-                }
-            });
+    q: {
+      menuName: '',
+      parentName: '',
+    },
+    ruleValidate: {
+      name: [{ required: true, message: '菜单名称不能为空', trigger: 'blur' }],
+      url: [{ required: true, message: '菜单url不能为空', trigger: 'blur' }],
+      parentName: [
+        { required: true, message: '上级菜单不能为空', trigger: 'blur' },
+      ],
+    },
+  },
+  methods: {
+    selectIcon: function () {
+      openWindow({
+        type: 2,
+        title: '选取图标',
+        area: ['1030px', '500px'],
+        content: ['icon.html'],
+        btn: ['确定', '取消'],
+        btn1: function (index, layero) {
+          var icon = layero.find('iframe')[0].contentWindow.$('#icon').val()
+          vm.menu.icon = icon
+          console.log(vm.menu.icon)
+          vm.$forceUpdate()
+          top.layer.close(index)
+          layer.close(index)
         },
-        add: function () {
-            vm.showList = false;
-            vm.title = "新增";
-            var menuId = TreeGrid.table.getSelectedRow();
-            var parentId = 0;
-            if (menuId.length != 0) {
-                parentId = menuId[0].id;
-            }
-            vm.menu = {parentName: null, parentId: parentId, type: 1, orderNum: 0, status: 0};
-            vm.getMenu();
+      })
+    },
+    getMenu: function (menuId) {
+      //加载菜单树
+      Ajax.request({
+        url: '../sys/menu/select',
+        async: true,
+        successCallback: function (r) {
+          ztree = $.fn.zTree.init($('#menuTree'), setting, r.menuList)
+          var node = ztree.getNodeByParam('menuId', vm.menu.parentId)
+          if (node) {
+            ztree.selectNode(node)
+            vm.menu.parentName = node.name
+          } else {
+            node = ztree.getNodeByParam('menuId', 0)
+            ztree.selectNode(node)
+            vm.menu.parentName = node.name
+          }
         },
-        update: function (event) {
-            var menuId = TreeGrid.table.getSelectedRow();
-            if (menuId.length == 0) {
-                alert("请选择一条记录");
-                return;
-            }
+      })
+    },
+    add: function () {
+      vm.showList = false
+      vm.title = '新增'
+      var menuId = TreeGrid.table.getSelectedRow()
+      var parentId = 0
+      if (menuId.length != 0) {
+        parentId = menuId[0].id
+      }
+      vm.menu = {
+        parentName: null,
+        parentId: parentId,
+        type: 1,
+        orderNum: 0,
+        status: 0,
+      }
+      vm.getMenu()
+    },
+    update: function (event) {
+      var menuId = TreeGrid.table.getSelectedRow()
+      if (menuId.length == 0) {
+        alert('请选择一条记录')
+        return
+      }
 
-            Ajax.request({
-                url: "../sys/menu/info/" + menuId[0].id,
-                async: true,
-                successCallback: function (r) {
-                    vm.showList = false;
-                    vm.title = "修改";
-                    vm.menu = r.menu;
+      Ajax.request({
+        url: '../sys/menu/info/' + menuId[0].id,
+        async: true,
+        successCallback: function (r) {
+          vm.showList = false
+          vm.title = '修改'
+          vm.menu = r.menu
 
-                    vm.getMenu();
-                }
-            });
+          vm.getMenu()
         },
-        del: function (event) {
-            var menuIds = TreeGrid.table.getSelectedRow(), ids = [];
-            if (menuIds.length == 0) {
-                iview.Message.error("");
-                return;
-            }
+      })
+    },
+    del: function (event) {
+      var menuIds = TreeGrid.table.getSelectedRow(),
+        ids = []
+      if (menuIds.length == 0) {
+        iview.Message.error('')
+        return
+      }
 
-            confirm('确定要删除选中的记录?', function () {
-                $.each(menuIds, function (idx, item) {
-                    ids[idx] = item.id;
-                });
-                Ajax.request({
-                    url: "../sys/menu/delete",
-                    params: JSON.stringify(ids),
-                    contentType: "application/json",
-                    type: 'POST',
-                    successCallback: function () {
-                        alert('操作成功', function (index) {
-                            vm.reload();
-                        });
-                    }
-                });
-            });
-        },
-        saveOrUpdate: function (event) {
-            var url = vm.menu.menuId == null ? "../sys/menu/save" : "../sys/menu/update";
-            Ajax.request({
-                url: url,
-                params: JSON.stringify(vm.menu),
-                contentType: "application/json",
-                type: 'POST',
-                successCallback: function () {
-                    alert('操作成功', function (index) {
-                        vm.reload();
-                    });
-                }
-            });
+      confirm('确定要删除选中的记录?', function () {
+        $.each(menuIds, function (idx, item) {
+          ids[idx] = item.id
+        })
+        Ajax.request({
+          url: '../sys/menu/delete',
+          params: JSON.stringify(ids),
+          contentType: 'application/json',
+          type: 'POST',
+          successCallback: function () {
+            alert('操作成功', function (index) {
+              vm.reload()
+            })
+          },
+        })
+      })
+    },
+    saveOrUpdate: function (event) {
+      var url =
+        vm.menu.menuId == null ? '../sys/menu/save' : '../sys/menu/update'
+      Ajax.request({
+        url: url,
+        params: JSON.stringify(vm.menu),
+        contentType: 'application/json',
+        type: 'POST',
+        successCallback: function () {
+          alert('操作成功', function (index) {
+            vm.reload()
+          })
         },
-        menuTree: function () {
-            openWindow({
-                title: "选择菜单",
-                area: ['300px', '450px'],
-                content: jQuery("#menuLayer"),
-                btn: ['确定', '取消'],
-                btn1: function (index) {
-                    var node = ztree.getSelectedNodes();
-                    //选择上级菜单
-                    vm.menu.parentId = node[0].menuId;
-                    vm.menu.parentName = node[0].name;
+      })
+    },
+    menuTree: function () {
+      openWindow({
+        title: '选择菜单',
+        area: ['300px', '450px'],
+        content: jQuery('#menuLayer'),
+        btn: ['确定', '取消'],
+        btn1: function (index) {
+          var node = ztree.getSelectedNodes()
+          //选择上级菜单
+          vm.menu.parentId = node[0].menuId
+          vm.menu.parentName = node[0].name
 
-                    layer.close(index);
-                }
-            });
-        },
-        query: function () {
-            vm.reload();
-        },
-        reload: function (event) {
-            vm.showList = true;
-            TreeGrid.table.refresh();
+          layer.close(index)
         },
-        handleSubmit: function (name) {
-            handleSubmitValidate(this, name, function () {
-                vm.saveOrUpdate()
-            });
-        },
-        handleReset: function (name) {
-            handleResetForm(this, name);
-        }
-    }
-});
+      })
+    },
+    query: function () {
+      vm.reload()
+    },
+    reload: function (event) {
+      vm.showList = true
+      TreeGrid.table.refresh()
+    },
+    handleSubmit: function (name) {
+      handleSubmitValidate(this, name, function () {
+        vm.saveOrUpdate()
+      })
+    },
+    handleReset: function (name) {
+      handleResetForm(this, name)
+    },
+  },
+})

+ 487 - 455
platform-admin/src/main/webapp/js/sys/user.js

@@ -1,496 +1,528 @@
 $(function () {
-    $("#jqGrid").Grid({
-        url: '../sys/user/list',
-        rownumWidth: 60,
-        multiboxonly: true,
-        colModel: [{
-                label: '用户ID',
-                name: 'userId',
-                index: "user_id",
-                key: true,
-                hidden: true
-            },
-            {
-                label: '用户名',
-                name: 'username',
-                width: 75
-            },
-            // {label: '所属公司', name: 'deptName', width: 75},
-            // {label: '邮箱', name: 'email', width: 90},
-            {
-                label: '手机号',
-                name: 'mobile',
-                width: 100
-            },
-            // {label: 'VR场景关联', name: 'brandList', width: 100,sortable:false,formatter:function (value) {
-            //     let temp = []
-            //     value.forEach(function (item) {
-            //         temp.push(item.brandName||item.name)
-            //     })
+  $('#jqGrid').Grid({
+    url: '../sys/user/list',
+    rownumWidth: 60,
+    multiboxonly: true,
+    colModel: [
+      {
+        label: '用户ID',
+        name: 'userId',
+        index: 'user_id',
+        key: true,
+        hidden: true,
+      },
+      {
+        label: '用户名',
+        name: 'username',
+        width: 75,
+      },
+      // {label: '所属公司', name: 'deptName', width: 75},
+      // {label: '邮箱', name: 'email', width: 90},
+      {
+        label: '手机号',
+        name: 'mobile',
+        width: 100,
+      },
+      // {label: 'VR场景关联', name: 'brandList', width: 100,sortable:false,formatter:function (value) {
+      //     let temp = []
+      //     value.forEach(function (item) {
+      //         temp.push(item.brandName||item.name)
+      //     })
 
-            //     return temp.join('、')
-            // }},
-            {
-                label: '角色',
-                name: 'roleList',
-                width: 100,
-                sortable: false,
-                formatter: function (value, row, col) {
-                    let roleList = col.roleList
-                    return roleList[0] ? roleList[0].roleName : '-'
-                }
-            },
-            {
-                label: '状态',
-                name: 'status',
-                width: 80,
-                formatter: function (value) {
-                    return value === 0 ?
-                        '<span class="label label-danger">禁用</span>' :
-                        '<span class="label label-success">正常</span>';
-                }
-            },
-            {
-                label: '创建时间',
-                name: 'createTime',
-                index: "create_time",
-                width: 80,
-                formatter: function (value) {
-                    return transDate(value);
-                }
-            }
-        ]
-    });
-});
+      //     return temp.join('、')
+      // }},
+      {
+        label: '角色',
+        name: 'roleList',
+        width: 100,
+        sortable: false,
+        formatter: function (value, row, col) {
+          let roleList = col.roleList
+          return roleList[0] ? roleList[0].roleName : '-'
+        },
+      },
+      {
+        label: '状态',
+        name: 'status',
+        width: 80,
+        formatter: function (value) {
+          return value === 0
+            ? '<span class="label label-danger">禁用</span>'
+            : '<span class="label label-success">正常</span>'
+        },
+      },
+      {
+        label: '创建时间',
+        name: 'createTime',
+        index: 'create_time',
+        width: 80,
+        formatter: function (value) {
+          return transDate(value)
+        },
+      },
+    ],
+  })
+})
 
 var setting = {
-    data: {
-        simpleData: {
-            enable: true,
-            idKey: "deptId",
-            pIdKey: "parentId",
-            rootPId: -1
-        },
-        key: {
-            url: "nourl"
-        }
-    }
-};
-var ztree;
+  data: {
+    simpleData: {
+      enable: true,
+      idKey: 'deptId',
+      pIdKey: 'parentId',
+      rootPId: -1,
+    },
+    key: {
+      url: 'nourl',
+    },
+  },
+}
+var ztree
 
 const validatePhoneCheck = async function (rule, value, callback) {
-    if (value === '' || !value) {
-        callback(new Error('手机号不能为空'));
-    } else if (!(/^1[3456789]\d{9}$/.test(value))) {
-        callback(new Error('手机号不正确'));
-    } else {
-        await $.ajax({
-            url: "../sys/user/checkUser?phoneNum=" + value,
-            async: true,
-            success: function (data) {
-                if (data.code == 0) {
-                    $('#isSign1').hide()
-                } else {
-                    $('#isSign1').show()
-                }
-
-            }
-        })
+  if (value === '' || !value) {
+    callback(new Error('手机号不能为空'))
+  } else if (!/^1[3456789]\d{9}$/.test(value)) {
+    callback(new Error('手机号不正确'))
+  } else {
+    await $.ajax({
+      url: '../sys/user/checkUser?phoneNum=' + value,
+      async: true,
+      success: function (data) {
+        if (data.code == 0) {
+          $('#isSign1').hide()
+        } else {
+          $('#isSign1').show()
+        }
+      },
+    })
 
-        callback();
+    callback()
 
-        // callback(new Error('手机号未在指房宝APP中进行注册'));
-    }
-};
+    // callback(new Error('手机号未在指房宝APP中进行注册'));
+  }
+}
 
 var vm = new Vue({
-    el: '#rrapp',
-    data: {
-        delInfo: {
-            list: [],
-            type: 1,
-            select: '',
-        },
-        delValidate: {
-            select: [{
-                required: true,
-                message: '请选择迁移的员工',
-                trigger: 'change'
-            }],
+  el: '#rrapp',
+  data: {
+    delInfo: {
+      list: [],
+      type: 1,
+      select: '',
+    },
+    delValidate: {
+      select: [
+        {
+          required: true,
+          message: '请选择迁移的员工',
+          trigger: 'change',
         },
-        show_delModal: false,
+      ],
+    },
+    show_delModal: false,
 
-        modal1: false,
-        q: {
-            username: null
-        },
-        showList: true,
-        title: null,
-        roleList: {},
-        user: {
-            status: 1,
-            deptName: '',
-            roleIdList: [],
-            brandIdList: [],
-            brandList: []
-        },
-        ruleValidate: {
-            username: [{
-                required: true,
-                message: '姓名不能为空',
-                trigger: 'blur'
-            }],
-            deptName: [{
-                required: true,
-                message: '所属公司不能为空',
-                trigger: 'change'
-            }],
-            // email: [
-            //     {required: true, message: '邮箱不能为空', trigger: 'blur'},
-            //     {type: 'email', message: '邮箱格式不正确', trigger: 'blur'}
-            // ],
-            mobile: [{
-                required: true,
-                validator: validatePhoneCheck,
-                trigger: 'blur'
-            }],
-            roleIdList: [{
-                required: true,
-                message: '请选择角色类型'
-            }]
-        },
-        brandsList: [],
-        brandPage: 1,
-        brandPerPage: 10,
-        brandTotal: 0,
-        brandSeleced: [],
-        social: [],
-        cacheData: {},
-        cacheDataFirst: {}
+    modal1: false,
+    q: {
+      username: null,
     },
-    watch: {
-        brandPage: function name(newVal) {
-            this.getBrandList()
-        }
+    showList: true,
+    title: null,
+    roleList: [],
+    user: {
+      status: 1,
+      deptName: '',
+      roleIdList: [],
+      brandIdList: [],
+      brandList: [],
     },
-    methods: {
-        change_role: function (e) {
-            this.user.roleIdList = [e]
-        },
-        clickCheck: function (item, idx) {
-            item['checked'] = !item['checked']
-            this.$set(this.brandsList, idx, item)
+    ruleValidate: {
+      username: [
+        {
+          required: true,
+          message: '姓名不能为空',
+          trigger: 'blur',
         },
-        ok: function () {
-            let temp = []
-            let tempid = []
-            var that = this
-            Object.keys(vm.cacheData).forEach(function (item) {
-                that.cacheData[item].page.list.forEach(function (sub) {
-                    if (sub['checked']) {
-                        temp.push(sub)
-                        tempid.push(sub.id)
-                    }
-                })
-            })
-            vm.user.brandList = temp
-            vm.user.brandIdList = tempid
+      ],
+      deptName: [
+        {
+          required: true,
+          message: '所属公司不能为空',
+          trigger: 'change',
         },
-        cancel: function () {
-            this.cacheData = {}
-            this.modal1 = false
+      ],
+      // email: [
+      //     {required: true, message: '邮箱不能为空', trigger: 'blur'},
+      //     {type: 'email', message: '邮箱格式不正确', trigger: 'blur'}
+      // ],
+      mobile: [
+        {
+          required: true,
+          validator: validatePhoneCheck,
+          trigger: 'blur',
         },
-        query: function () {
-            vm.reload();
+      ],
+      roleIdList: [
+        {
+          required: true,
+          message: '请选择角色类型',
         },
-        add: function () {
-            vm.showList = false;
-            vm.title = "新增(默认密码为 注册的账号密码)";
-            vm.roleList = {};
-            vm.user = {
-                status: 1,
-                roleIdList: [6],
-                brandIdList: [],
-                deptId: '',
-                deptName: ''
-            };
-            vm.deptExpirationDate = 0;
+      ],
+    },
+    brandsList: [],
+    brandPage: 1,
+    brandPerPage: 10,
+    brandTotal: 0,
+    brandSeleced: [],
+    social: [],
+    cacheData: {},
+    cacheDataFirst: {},
+  },
+  watch: {
+    brandPage: function name(newVal) {
+      this.getBrandList()
+    },
+  },
+  methods: {
+    change_role: function (e) {
+      console.log(e)
+      this.user.roleIdList = [e]
+    },
+    clickCheck: function (item, idx) {
+      item['checked'] = !item['checked']
+      this.$set(this.brandsList, idx, item)
+    },
+    ok: function () {
+      let temp = []
+      let tempid = []
+      var that = this
+      Object.keys(vm.cacheData).forEach(function (item) {
+        that.cacheData[item].page.list.forEach(function (sub) {
+          if (sub['checked']) {
+            temp.push(sub)
+            tempid.push(sub.id)
+          }
+        })
+      })
+      vm.user.brandList = temp
+      vm.user.brandIdList = tempid
+    },
+    cancel: function () {
+      this.cacheData = {}
+      this.modal1 = false
+    },
+    query: function () {
+      vm.reload()
+    },
+    add: function () {
+      vm.showList = false
+      vm.title = '新增(默认密码为 注册的账号密码)'
+      vm.roleList = []
+      vm.user = {
+        status: 1,
+        roleIdList: [6],
+        brandIdList: [],
+        deptId: '',
+        deptName: '',
+      }
+      vm.deptExpirationDate = 0
 
-            //获取角色信息
-            this.getRoleList();
-            vm.getDept();
-        },
-        getDept: function () {
-            //加载公司树
-            Ajax.request({
-                url: "../sys/dept/list?name=",
-                async: true,
-                successCallback: function (r) {
-                    ztree = $.fn.zTree.init($("#deptTree"), setting, r.list);
-                    var node = ztree.getNodeByParam("deptId", vm.user.deptId);
-                    if (node != null) {
-                        ztree.selectNode(node);
+      //获取角色信息
+      this.getRoleList(1)
+      vm.getDept()
+    },
+    getDept: function () {
+      //加载公司树
+      Ajax.request({
+        url: '../sys/dept/list?name=',
+        async: true,
+        successCallback: function (r) {
+          ztree = $.fn.zTree.init($('#deptTree'), setting, r.list)
+          var node = ztree.getNodeByParam('deptId', vm.user.deptId)
+          if (node != null) {
+            ztree.selectNode(node)
 
-                        vm.user.deptName = node.name;
-                    }
-                }
-            });
-        },
-        pageChange: function (page) {
-            this.brandPage = page
+            vm.user.deptName = node.name
+          }
         },
-        getBrandList: function () {
-            this.modal1 = true
-            if (this.cacheData[this.brandPage]) {
-                let temp = this.cacheData[this.brandPage]
-                this.brandsList = temp.page.list
-                this.brandPage = temp.page.currPage
-                this.brandTotal = temp.page.totalCount
-                return
-            }
-            let that = this
-            let params = {
-                token: localStorage.getItem('token'),
-                pageSize: that.brandPerPage,
-                pageNum: that.brandPage,
-                _search: false,
-                sidx: 'asc',
-                order: 'asc'
+      })
+    },
+    pageChange: function (page) {
+      this.brandPage = page
+    },
+    getBrandList: function () {
+      this.modal1 = true
+      if (this.cacheData[this.brandPage]) {
+        let temp = this.cacheData[this.brandPage]
+        this.brandsList = temp.page.list
+        this.brandPage = temp.page.currPage
+        this.brandTotal = temp.page.totalCount
+        return
+      }
+      let that = this
+      let params = {
+        token: localStorage.getItem('token'),
+        pageSize: that.brandPerPage,
+        pageNum: that.brandPage,
+        _search: false,
+        sidx: 'asc',
+        order: 'asc',
+      }
+      Ajax.request({
+        // url: '../brand/list?_search=false&limit='+that.brandPerPage+'&page='+that.brandPage+'&sidx=&order=asc',
+        url: '../brand/list',
+        type: 'POST',
+        params: JSON.stringify(params),
+        contentType: 'application/json',
+        async: true,
+        successCallback: function (res) {
+          res.page.list.forEach(function (item, index) {
+            item['checked'] = false
+            if (that.user.brandList) {
+              that.user.brandList.forEach(function (sub) {
+                // item['checked'] = false
+                if (item.id === sub.brandId || item.id === sub.id) {
+                  item['checked'] = true
+                  return
+                }
+              })
             }
-            Ajax.request({
-                // url: '../brand/list?_search=false&limit='+that.brandPerPage+'&page='+that.brandPage+'&sidx=&order=asc',
-                url: '../brand/list',
-                type: 'POST',
-                params: JSON.stringify(params),
-                contentType: 'application/json',
-                async: true,
-                successCallback: function (res) {
-                    res.page.list.forEach(function (item, index) {
-                        item['checked'] = false
-                        if (that.user.brandList) {
-                            that.user.brandList.forEach(function (sub) {
-                                // item['checked'] = false
-                                if (item.id === sub.brandId || item.id === sub.id) {
-                                    item['checked'] = true
-                                    return
-                                }
-                            })
-                        }
-                    })
+          })
 
-                    that.cacheData[res.page.currPage] = res
-                    that.brandsList = res.page.list
-                    that.brandPage = res.page.pageNum
-                    that.brandTotal = res.page.total
-                }
-            });
+          that.cacheData[res.page.currPage] = res
+          that.brandsList = res.page.list
+          that.brandPage = res.page.pageNum
+          that.brandTotal = res.page.total
         },
-        update: function () {
-            var userId = getSelectedRow("#jqGrid");
-            if (userId == null) {
-                return;
-            }
+      })
+    },
+    update: function () {
+      var userId = getSelectedRow('#jqGrid')
+      if (userId == null) {
+        return
+      }
 
-            vm.showList = false;
-            vm.title = "修改";
+      vm.showList = false
+      vm.title = '修改'
 
-            Ajax.request({
-                url: "../sys/user/info/" + userId,
-                async: true,
-                successCallback: function (r) {
-                    vm.user = r.user;
-                    //获取角色信息
-                    vm.getRoleList();
-                    vm.getDept();
-                    // window.localStorage.setItem('deptExpirationDate',vm.deptExpirationDate)
-                }
-            });
+      Ajax.request({
+        url: '../sys/user/info/' + userId,
+        async: true,
+        successCallback: function (r) {
+          vm.user = r.user
+          if (r.user.roleIdList[0] == 8 && r.user.isPlatformStreamer) {
+            vm.user.roleIdList[0] = 9
+          }
+          vm.$forceUpdate()
 
+          //获取角色信息
+          vm.getRoleList(2)
+          vm.getDept()
+          // window.localStorage.setItem('deptExpirationDate',vm.deptExpirationDate)
         },
-        comfirmDel() {
-            if (this.delInfo.type == 3) {
-                this.$refs['formDelValidate'].validate((valid) => {
-                    if (valid) {
-                        vm.del()
-                    }
-                })
-            } else if (this.delInfo.type == 2) {
-                vm.show_delModal = false
-            } else if (this.delInfo.type == 1) {
-                vm.del()
-            }
+      })
+    },
+    comfirmDel() {
+      if (this.delInfo.type == 3) {
+        this.$refs['formDelValidate'].validate((valid) => {
+          if (valid) {
+            vm.del()
+          }
+        })
+      } else if (this.delInfo.type == 2) {
+        vm.show_delModal = false
+      } else if (this.delInfo.type == 1) {
+        vm.del()
+      }
+    },
+    cancelDel() {
+      // this.$Message.info('点击了取消');
+      vm.show_delModal = false
+    },
+    checkDel: function () {
+      var userIds = getSelectedRows('#jqGrid')
 
+      if (userIds == null) {
+        return
+      }
+      if (userIds.length > 1) {
+        alert('只能选择一条记录')
 
-        },
-        cancelDel() {
-            // this.$Message.info('点击了取消');
-            vm.show_delModal = false
-        },
-        checkDel: function () {
-            var userIds = getSelectedRows("#jqGrid");
+        return
+      }
+      let params = {
+        userId: userIds.join(),
+      }
 
-            if (userIds == null) {
-                return;
-            }
-            if (userIds.length > 1) {
-                alert("只能选择一条记录");
+      Ajax.request({
+        url: '../sys/user/preDeleteStaff',
+        contentType: 'application/json',
+        dataType: 'json',
+        params: JSON.stringify(params),
+        type: 'POST',
+        successCallback: function (r) {
+          console.log(r)
+          vm.show_delModal = true
+          if (r.code == 0) {
+            if (r.list) {
+              //需先进行场景重新分配用户
+              vm.delInfo.type = 3
+              vm.delInfo.list = r.list
+              // vm.delInfo.msg = r.msg
+            } else {
+              //可删除
 
-                return;
+              vm.delInfo.type = 1
             }
-            let params = {
-                "userId": userIds.join(),
-            }
-
-            Ajax.request({
-                url: "../sys/user/preDeleteStaff",
-                contentType: 'application/json',
-                dataType: 'json',
-                params: JSON.stringify(params),
-                type: 'POST',
-                successCallback: function (r) {
-                    console.log(r)
-                    vm.show_delModal = true
-                    if (r.code == 0) {
-                        if (r.list) {
-                            //需先进行场景重新分配用户
-                            vm.delInfo.type = 3
-                            vm.delInfo.list = r.list
-                            // vm.delInfo.msg = r.msg
-                        } else {
-                            //可删除
-
-                            vm.delInfo.type = 1
-                        }
-
-                        // vm.delInfo.msg = r.msg
-                    } else if (r.code == 500) {
-                        //不可删除
-                        vm.delInfo.type = 2
-                        // vm.delInfo.msg = r.msg
-                    }
-
 
-                },
-                failCallback: function (error) {
-                    // vm.show_delModal = true
-                }
-
-            });
+            // vm.delInfo.msg = r.msg
+          } else if (r.code == 500) {
+            //不可删除
+            vm.delInfo.type = 2
+            // vm.delInfo.msg = r.msg
+          }
         },
-        del: function () {
-            var userIds = getSelectedRows("#jqGrid");
-            // if (userIds == null) {
-            //     return;
-            // }
-            let params = {
-                userId: userIds.join(),
-            }
-            if (vm.delInfo.type == 3) {
-                params.toUser = vm.delInfo.select
-            }
-            vm.show_delModal = false
-            // confirm('确定要删除选中的记录?', function () {
-            Ajax.request({
-                url: "../sys/user/deleteStaff",
-                params: JSON.stringify(params),
-                contentType: "application/json",
-                type: 'POST',
-                successCallback: function () {
-                    alert('操作成功', function (index) {
-                        vm.reload();
-                    });
-                }
-            });
-            // });
+        failCallback: function (error) {
+          // vm.show_delModal = true
         },
-        // del: function() {
-        //     var userIds = getSelectedRows("#jqGrid");
-        //     if (userIds == null) {
-        //         return;
-        //     }
-
-        //     confirm('确定要删除选中的记录?', function() {
-        //         Ajax.request({
-        //             url: "../sys/user/delete",
-        //             params: JSON.stringify(userIds),
-        //             contentType: "application/json",
-        //             type: 'POST',
-        //             successCallback: function() {
-        //                 alert('操作成功', function(index) {
-        //                     vm.reload();
-        //                 });
-        //             }
-        //         });
-        //     });
-        // },
-        saveOrUpdate: function (event) {
-            if ($('#isSign1').css("display") == 'block') {
-                return alert('手机号未在指房宝APP中进行注册')
-            }
-            var url = vm.user.userId == null ? "../sys/user/save" : "../sys/user/update";
-            Ajax.request({
-                url: url,
-                params: JSON.stringify(vm.user),
-                contentType: "application/json",
-                type: 'POST',
-                successCallback: function () {
-                    alert('操作成功', function (index) {
-                        vm.reload();
-                    });
-                }
-            });
+      })
+    },
+    del: function () {
+      var userIds = getSelectedRows('#jqGrid')
+      // if (userIds == null) {
+      //     return;
+      // }
+      let params = {
+        userId: userIds.join(),
+      }
+      if (vm.delInfo.type == 3) {
+        params.toUser = vm.delInfo.select
+      }
+      vm.show_delModal = false
+      // confirm('确定要删除选中的记录?', function () {
+      Ajax.request({
+        url: '../sys/user/deleteStaff',
+        params: JSON.stringify(params),
+        contentType: 'application/json',
+        type: 'POST',
+        successCallback: function () {
+          alert('操作成功', function (index) {
+            vm.reload()
+          })
         },
-        getRoleList: function () {
-            Ajax.request({
-                url: '../sys/role/select',
-                async: true,
-                successCallback: function (r) {
-                    vm.roleList = r.list;
-                }
-            });
+      })
+      // });
+    },
+    // del: function() {
+    //     var userIds = getSelectedRows("#jqGrid");
+    //     if (userIds == null) {
+    //         return;
+    //     }
+
+    //     confirm('确定要删除选中的记录?', function() {
+    //         Ajax.request({
+    //             url: "../sys/user/delete",
+    //             params: JSON.stringify(userIds),
+    //             contentType: "application/json",
+    //             type: 'POST',
+    //             successCallback: function() {
+    //                 alert('操作成功', function(index) {
+    //                     vm.reload();
+    //                 });
+    //             }
+    //         });
+    //     });
+    // },
+    saveOrUpdate: function (event) {
+      if ($('#isSign1').css('display') == 'block') {
+        return alert('手机号未在指房宝APP中进行注册')
+      }
+      var url =
+        vm.user.userId == null ? '../sys/user/save' : '../sys/user/update'
+      console.log(vm.user)
+      if (vm.user.roleIdList[0] == 9) {
+        vm.user.deptId = ''
+      }
+      Ajax.request({
+        url: url,
+        params: JSON.stringify(vm.user),
+        contentType: 'application/json',
+        type: 'POST',
+        successCallback: function () {
+          alert('操作成功', function (index) {
+            vm.reload()
+          })
         },
-        reload: function (event) {
-            vm.showList = true;
-            var page = $("#jqGrid").jqGrid('getGridParam', 'page');
-            $("#jqGrid").jqGrid('setGridParam', {
-                postData: {
-                    'username': vm.q.username
-                },
-                page: 1
-            }).trigger("reloadGrid");
-            vm.handleReset('formValidate');
+      })
+    },
+    getRoleList: function (type) {
+      vm.roleList = []
+      Ajax.request({
+        url: '../sys/role/select',
+        async: true,
+        successCallback: function (r) {
+          vm.roleList = r.list
+          if (type == 1) {
+            vm.roleList = r.list
+          } else {
+            if (vm.user.isPlatformStreamer) {
+              vm.roleList = r.list.filter((i) => {
+                return i.roleId == 9
+              })
+            } else {
+              vm.roleList = r.list.filter((i) => {
+                return i.roleId != 9
+              })
+            }
+          }
         },
-        deptTree: function () {
-            openWindow({
-                title: "选择公司",
-                area: ['300px', '450px'],
-                content: jQuery("#deptLayer"),
-                btn: ['确定', '取消'],
-                btn1: function (index) {
-                    var node = ztree.getSelectedNodes();
-                    //选择上级公司
-                    vm.user.deptId = node[0].deptId;
-                    vm.user.deptName = node[0].name;
+      })
+    },
 
-                    layer.close(index);
-                }
-            });
-        },
-        handleSubmit: function (name) {
-            handleSubmitValidate(this, name, function () {
-                vm.saveOrUpdate()
-            });
+    reload: function (event) {
+      vm.showList = true
+      var page = $('#jqGrid').jqGrid('getGridParam', 'page')
+      $('#jqGrid')
+        .jqGrid('setGridParam', {
+          postData: {
+            username: vm.q.username,
+          },
+          page: 1,
+        })
+        .trigger('reloadGrid')
+      vm.handleReset('formValidate')
+    },
+    deptTree: function () {
+      openWindow({
+        title: '选择公司',
+        area: ['300px', '450px'],
+        content: jQuery('#deptLayer'),
+        btn: ['确定', '取消'],
+        btn1: function (index) {
+          var node = ztree.getSelectedNodes()
+          //选择上级公司
+          vm.user.deptId = node[0].deptId
+          vm.user.deptName = node[0].name
+
+          layer.close(index)
         },
-        handleReset: function (name) {
-            handleResetForm(this, name);
-            this.cacheData = {}
-            this.user = {
-                status: 1,
-                deptName: '',
-                roleIdList: [],
-                brandIdList: [],
-                brandList: []
-            }
-        }
-    }
-});
+      })
+    },
+    handleSubmit: function (name) {
+      handleSubmitValidate(this, name, function () {
+        vm.saveOrUpdate()
+      })
+    },
+    handleReset: function (name) {
+      handleResetForm(this, name)
+      this.cacheData = {}
+      this.user = {
+        status: 1,
+        deptName: '',
+        roleIdList: [],
+        brandIdList: [],
+        brandList: [],
+      }
+    },
+  },
+})

+ 4 - 3
platform-api/src/main/java/com/platform/util/ApiBaseAction.java

@@ -4,8 +4,9 @@ import com.alibaba.fastjson.JSONObject;
 import com.platform.entity.TokenEntity;
 import com.platform.interceptor.AuthorizationInterceptor;
 import com.platform.service.TokenService;
-import org.apache.log4j.Logger;
 import org.apache.shiro.authz.UnauthorizedException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.TypeMismatchException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.propertyeditors.StringTrimmerEditor;
@@ -33,7 +34,7 @@ import java.util.Map;
  * @date 2016年9月2日
  */
 public class ApiBaseAction {
-    protected Logger logger = Logger.getLogger(getClass());
+    protected Logger logger = LoggerFactory.getLogger(this.getClass());
     /**
      * 得到request对象
      */
@@ -83,7 +84,7 @@ public class ApiBaseAction {
 
     public Map<String, Object> toResponsSuccess(Object data) {
         Map<String, Object> rp = toResponsObject(0, "执行成功", data);
-        logger.info("response:" + rp);
+        logger.info("response:{}",JSONObject.toJSONString(rp));
         return rp;
     }
 

+ 28 - 0
platform-common/pom.xml

@@ -319,6 +319,34 @@
         </dependency>
 
 
+        <dependency>
+            <groupId>com.alibaba.nacos</groupId>
+            <artifactId>nacos-spring-context</artifactId>
+            <version>1.1.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework</groupId>
+                    <artifactId>spring-context</artifactId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>javax.annotation-api</artifactId>
+                    <groupId>javax.annotation</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.netflix.ribbon/ribbon-loadbalancer -->
+        <dependency>
+            <groupId>com.netflix.ribbon</groupId>
+            <artifactId>ribbon-loadbalancer</artifactId>
+            <version>2.2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.5</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
   <!--  <build>

+ 106 - 0
platform-common/src/main/java/com/platform/aop/RestTemplateAspect.java

@@ -0,0 +1,106 @@
+package com.platform.aop;
+
+import com.alibaba.nacos.api.annotation.NacosInjected;
+import com.alibaba.nacos.api.exception.NacosException;
+import com.alibaba.nacos.api.naming.NamingService;
+import com.alibaba.nacos.api.naming.pojo.Instance;
+import com.netflix.loadbalancer.ILoadBalancer;
+import com.netflix.loadbalancer.LoadBalancerBuilder;
+import com.netflix.loadbalancer.Server;
+import org.apache.http.client.utils.URIBuilder;
+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.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.stream.Collectors;
+
+/**
+ * 系统日志,切面处理类
+ *
+ * @author lipengjun
+ * @email 939961241@qq.com
+ * @gitee https://gitee.com/fuyang_lipengjun/platform
+ * @date 2017年3月8日 上午11:07:35
+ */
+@Aspect
+@Component
+public class RestTemplateAspect {
+
+    @NacosInjected
+    private NamingService namingService;
+
+    @Value("${nacos.discovery.register.group-name}")
+    private String groupName;
+
+    private static Map<String, ILoadBalancer> loadBalancerMap = new HashMap<>();
+
+
+    /**
+     * 切点
+     */
+    @Pointcut("execution (public * org.springframework.web.client.RestTemplate.getForObject(..)) " +
+            "|| execution (public * org.springframework.web.client.RestTemplate.postForEntity(..)) ")
+    public void logPointCut() {
+
+    }
+
+    /**
+     * 环绕通知
+     */
+    @Around("logPointCut()")
+    public Object saveSysLog(ProceedingJoinPoint point) throws Throwable {
+        Object[] args = point.getArgs();
+        // 获取请求链接
+        String url = args[0].toString();
+        URIBuilder uriBuilder = new URIBuilder(url);
+        if (uriBuilder.getPort() > 0) {
+            return point.proceed();
+        }
+        String serviceName = uriBuilder.getHost();
+        if (serviceName.contains(".")) {
+            return point.proceed();
+        }
+        args[0] = url.replace(serviceName, getServer(serviceName).getHostPort());
+        try {
+            return point.proceed(args);
+        } catch (Exception e) {
+            e.printStackTrace();
+            initLoadBalancerMap(serviceName);
+            throw new RuntimeException("请求失败!");
+        }
+    }
+
+    private Server getServer(String hostName) {
+        if (!loadBalancerMap.containsKey(hostName)) {
+            initLoadBalancerMap(hostName);
+        }
+        return loadBalancerMap.get(hostName).chooseServer(null);
+    }
+
+    private void initLoadBalancerMap(String hostName) {
+        // 获取服务列表
+        List<Instance> instances = null;
+        try {
+            instances = namingService.getAllInstances(hostName, groupName);
+        } catch (NacosException e) {
+            e.printStackTrace();
+            throw new RuntimeException("获取服务实例失败,服务名称:" + hostName);
+        }
+        if (CollectionUtils.isEmpty(instances)) {
+            throw new RuntimeException("未获取到服务实例,服务名称:" + hostName);
+        }
+        List<Server> servers = instances.stream().map(instance -> new Server(instance.getIp(), instance.getPort())).collect(Collectors.toList());
+        ILoadBalancer loadBalancer = LoadBalancerBuilder.newBuilder().buildFixedServerListLoadBalancer(servers);
+        loadBalancerMap.put(hostName, loadBalancer);
+    }
+
+}

+ 24 - 19
platform-common/src/main/java/com/platform/controller/SysLoginController.java

@@ -14,6 +14,7 @@ import com.platform.service.SysDeptService;
 import com.platform.service.impl.SysSmsLogServiceImpl;
 import com.platform.service.impl.SysUserRoleServiceImpl;
 import com.platform.service.impl.SysUserServiceImpl;
+import com.platform.service.impl.ZhiHouseService;
 import com.platform.utils.*;
 import com.platform.vos.CurrentUserLoginVo;
 import com.platform.vos.UserOnlyLoginVo;
@@ -27,15 +28,17 @@ import org.apache.shiro.subject.Subject;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 
 import javax.imageio.ImageIO;
-import javax.servlet.ServletException;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import java.awt.image.BufferedImage;
@@ -75,13 +78,17 @@ public class SysLoginController {
     private SysDeptService sysDeptService;
 
     @Value("${scenePath}")
-    private String KankanHost;
+    private String zhiHouseHost;
 
+    @Autowired
+    private RestTemplate restTemplate;
 
+    @Autowired
+    private ZhiHouseService zhiHouseService;
 
 
     @RequestMapping("captcha.jpg")
-    public void captcha(HttpServletResponse response) throws ServletException, IOException {
+    public void captcha(HttpServletResponse response) throws IOException {
         response.setHeader("Cache-Control", "no-store, no-cache");
         response.setContentType("image/jpeg");
 
@@ -183,7 +190,7 @@ public class SysLoginController {
     @SysLog("登录")
     @ResponseBody
     @RequestMapping(value = "/sys/loginWithoutAuth", method = RequestMethod.POST)
-    public R onlyLogin(@RequestBody UserOnlyLoginVo userOnlyLoginVo) throws IOException {
+    public R onlyLogin(@RequestBody UserOnlyLoginVo userOnlyLoginVo){
 
         ZhiHouseUserLoginVo userLoginVo = new ZhiHouseUserLoginVo();
         userLoginVo.setUserName(userOnlyLoginVo.getUsername());
@@ -192,13 +199,14 @@ public class SysLoginController {
         userOnlyLoginVo.setPassword(password);
         userLoginVo.setUserPassword(userOnlyLoginVo.getPassword());
         userLoginVo.setArea("1234");
-        String url = KankanHost + "api/platform/login";
-        String json = JsonUtils.objectToJson(userLoginVo);
-        log.info("请求四维看看的参数为:{}" , json);
-        String kankanResult = HttpClientUtil.doPostJson(url, json);
+        String url = zhiHouseHost + "api/platform/login";
+        ResponseEntity<String> kankanResult = restTemplate.postForEntity(url, userLoginVo,String.class);
+        if(kankanResult.getStatusCode()!= HttpStatus.OK){
+            return R.error("账户验证失败");
+        }
         //解析返回结果
-        JSONObject res = JSONObject.parseObject(kankanResult);
-        log.info("四维看看返回登录数据:{}", kankanResult);
+        JSONObject res = JSONObject.parseObject(kankanResult.getBody());
+        log.info("四维看看返回登录数据:{}", kankanResult.getBody());
         R result = parseResult(res, "登录失败", userLoginVo);
         if(StringUtils.equals(result.get("code").toString(),"0")){
             SysUserEntity manager = sysUserService.queryByUserMobile(userOnlyLoginVo.getUsername());
@@ -227,16 +235,12 @@ public class SysLoginController {
         //对前端传的密码解密
         password = Base64Converter.decode(Base64Converter.subText(password));
 
-        ZhiHouseUserLoginVo userLoginVo = new ZhiHouseUserLoginVo();
-        userLoginVo.setUserName(username);
-        userLoginVo.setUserPassword(password);
-        userLoginVo.setArea("1234");
-        String url = KankanHost + "api/platform/login";
-        String json = JsonUtils.objectToJson(userLoginVo);
-        String kankanResult = HttpClientUtil.doPostJson(url, json);
+        ResponseEntity<String> loginResult = zhiHouseService.login(username, password);
+        if(loginResult.getStatusCode()!= HttpStatus.OK){
+            return R.error("登录失败");
+        }
         //解析返回结果
-        JSONObject res = JSONObject.parseObject(kankanResult);
-        log.info("四维看看返回登录数据:{}", res.toJSONString());
+        JSONObject res = JSONObject.parseObject(loginResult.getBody());
         R result = parseResultWithoutAddUser(res, "登录失败");
         if (null != result && result.containsKey("code") && result.get("code").equals(0)) {
             log.info("四维看看登录完成,将执行本地登录验证");
@@ -302,6 +306,7 @@ public class SysLoginController {
                 userVo.setDeptExpirationDate(deptEntity.getExpirationDate());
                 userVo.setParentDeptId(deptEntity.getParentId());
                 userVo.setParentDeptName(deptEntity.getParentName());
+                userVo.setFdkkPassword(null);
             }
             resultMap.put("user", userVo);
             return R.ok(resultMap);

+ 8 - 1
platform-common/src/main/java/com/platform/controller/SysMenuController.java

@@ -5,9 +5,11 @@ import com.platform.entity.SysMenuEntity;
 import com.platform.service.SysMenuService;
 import com.platform.utils.*;
 import com.platform.utils.Constant.MenuType;
+import com.platform.vos.CurrentUserLoginVo;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
@@ -156,7 +158,12 @@ public class SysMenuController extends AbstractController {
     @RequestMapping("/user")
     public R user() {
         List<SysMenuEntity> menuList = sysMenuService.getUserMenuList(getUserId());
-
+        CurrentUserLoginVo user = getUser();
+        if(!ObjectUtils.isEmpty(user.getIsPlatformStreamer()) && user.getIsPlatformStreamer()){
+            menuList.removeIf(menu->menu.getName().equals("商品管理"));
+        }
+        // 隐藏绑定账号
+        menuList.removeIf(menu->menu.getName().equals("绑定账号"));
         return R.ok().put("menuList", menuList);
     }
 

+ 3 - 0
platform-common/src/main/java/com/platform/entity/Result.java

@@ -32,6 +32,9 @@ public class Result<T> implements Serializable {
 
     private T data;
 
+    public Result(){
+
+    }
 
     public Result(Integer code, String msg, T data) {
         this.code = code;

+ 9 - 9
platform-common/src/main/java/com/platform/entity/SysUserEntity.java

@@ -59,11 +59,6 @@ public class SysUserEntity implements Serializable {
     private List<Long> roleIdList;
 
     /**
-     * 关联的品牌id列表
-     */
-    private List<Long> brandIdList;
-
-    /**
      * 关联的品牌列表
      */
     private List<SysUserBrand> brandList;
@@ -86,6 +81,11 @@ public class SysUserEntity implements Serializable {
     private Long deptId;
 
     /**
+     * 是否是平台主持人
+     */
+    private Boolean isPlatformStreamer;
+
+    /**
      * 部门名称
      */
     private String deptName;
@@ -323,11 +323,11 @@ public class SysUserEntity implements Serializable {
         this.deptName = deptName;
     }
 
-    public List<Long> getBrandIdList() {
-        return brandIdList;
+    public Boolean getIsPlatformStreamer() {
+        return isPlatformStreamer;
     }
 
-    public void setBrandIdList(List<Long> brandIdList) {
-        this.brandIdList = brandIdList;
+    public void setIsPlatformStreamer(Boolean platformStreamer) {
+        isPlatformStreamer = platformStreamer;
     }
 }

+ 34 - 0
platform-common/src/main/java/com/platform/enums/SysRoleEnum.java

@@ -0,0 +1,34 @@
+package com.platform.enums;
+
+public enum SysRoleEnum {
+    ADMIN(5L, "超级管理员"),
+    COMPONY_ADMIN(6L, "平台主持人"),
+    COMPONY_EMPLOYEE(8L, "公司员工"),
+    PLATFORM_STREAMER(9L, "平台主持人");
+
+    private Long code;
+    private String desc;
+
+    public static Long PLATFORM_STREAMER_CODE = 9L;
+
+    SysRoleEnum(Long code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public Long getCode() {
+        return code;
+    }
+
+    public void setCode(Long code) {
+        this.code = code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}

+ 1 - 2
platform-common/src/main/java/com/platform/exception/GlobalExceptionHandler.java

@@ -8,7 +8,6 @@ package com.platform.exception;
 
 
 import com.platform.entity.Result;
-import lombok.extern.log4j.Log4j2;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.http.HttpStatus;
 import org.springframework.util.StringUtils;
@@ -30,7 +29,7 @@ public class GlobalExceptionHandler {
     @ResponseBody
     @ExceptionHandler(CommonBaseException.class)
     @ResponseStatus(HttpStatus.OK)
-    public Result runtimeExceptionHandler(HttpServletRequest request, CommonBaseException e) {
+    public Result CommonBaseExceptionHandler(HttpServletRequest request, CommonBaseException e) {
         log.error(request.getRequestURI() + ":" + e.getMsg());
         return Result.failure(StringUtils.isEmpty(e.getCode()) ? Result.CODE_FAILURE : e.getCode(), e.getMsg());
     }

+ 1 - 1
platform-common/src/main/java/com/platform/service/SysUserService.java

@@ -95,7 +95,7 @@ public interface SysUserService {
      * @param password    原密码
      * @param newPassword 新密码
      */
-    int updatePassword(Long userId, String password, String newPassword, String fdkkUser);
+    void updatePassword(String mobile, String password, String newPassword, String fdkkUser);
 
     /**
      * 根据条件分页查询

+ 4 - 2
platform-common/src/main/java/com/platform/service/custom/MySysUserBrandService.java

@@ -68,9 +68,11 @@ public class MySysUserBrandService extends SysUserBrandServiceImpl {
         return getBaseMapper().update(sysUserBrand , updateWrapper);
     }
 
-    public SysUserBrand getUserBrandById(long userId , long brandId){
+    public SysUserBrand getUserBrandById(Long userId , Integer brandId){
         QueryWrapper<SysUserBrand> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("user_id" , userId);
+        if(!ObjectUtils.isEmpty(userId)){
+            queryWrapper.eq("user_id" , userId);
+        }
         queryWrapper.eq("brand_id" , brandId);
         queryWrapper.eq("enable" , 1);
         return getBaseMapper().selectOne(queryWrapper);

+ 34 - 0
platform-common/src/main/java/com/platform/service/impl/FdkkService.java

@@ -0,0 +1,34 @@
+package com.platform.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class FdkkService {
+
+    @Value("${fdkankan.host}")
+    private String kankanHost;
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    /**
+     * 登录指房宝
+     * @param username
+     * @param password
+     * @return
+     */
+    public ResponseEntity<String> login(String username, String password) {
+        Map<String,String> params = new HashMap<>();
+        params.put("password",password);
+        params.put("phoneNum",username);
+        String url = kankanHost + "api/sso/user/getToken";
+        return restTemplate.postForEntity(url, params, String.class);
+    }
+}

+ 61 - 22
platform-common/src/main/java/com/platform/service/impl/SysUserServiceImpl.java

@@ -1,14 +1,13 @@
 package com.platform.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.pagehelper.util.StringUtil;
 import com.platform.dao.SysUserDao;
-import com.platform.entity.SysDeptEntity;
-import com.platform.entity.SysRoleEntity;
-import com.platform.entity.SysUserEntity;
-import com.platform.entity.UserWindowDto;
+import com.platform.entity.*;
 import com.platform.enums.ResultCodeEnum;
+import com.platform.enums.SysRoleEnum;
 import com.platform.exception.CommonBaseException;
 import com.platform.page.Page;
 import com.platform.page.PageHelper;
@@ -16,13 +15,15 @@ import com.platform.service.SysDeptService;
 import com.platform.service.SysRoleService;
 import com.platform.service.SysUserRoleService;
 import com.platform.service.SysUserService;
-import com.platform.utils.Constant;
-import com.platform.utils.PasswordUtils;
-import com.platform.utils.RRException;
+import com.platform.utils.*;
+import com.platform.vos.CurrentUserLoginVo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.crypto.hash.Sha256Hash;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
@@ -52,6 +53,12 @@ public class SysUserServiceImpl implements SysUserService {
     @Autowired
     private SysDeptService sysDeptService;
 
+    @Autowired
+    private ZhiHouseService zhiHouseService;
+
+    @Autowired
+    private FdkkService fdkkService;
+
 
     @Override
     public Long getUserNumOfDept(Long dptId) {
@@ -96,10 +103,10 @@ public class SysUserServiceImpl implements SysUserService {
     public IPage<SysUserEntity> getSysUserList(List<Long> deptIdList , String key , long brandId , long pageNum, long pageSize) {
 
         QueryWrapper<SysUserEntity> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("sysUser.status" , 1);
         if(!CollectionUtils.isEmpty(deptIdList)){
-            queryWrapper.in("sysUser.dept_id" , deptIdList);
+            queryWrapper.and(wrapper->wrapper.in("sysUser.dept_id" , deptIdList).or().eq("sysUser.is_platform_streamer",true));
         }
-        queryWrapper.eq("sysUser.status" , 1);
         if(StringUtils.isNotBlank(key)){
             queryWrapper.like("sysUser.username" , key);
         }
@@ -199,9 +206,14 @@ public class SysUserServiceImpl implements SysUserService {
     @Transactional
     public void update(SysUserEntity user) {
         if(ObjectUtils.isEmpty(user.getUserId())){
-            throw new RuntimeException("id 为空!");
+            throw new CommonBaseException(500,"id 为空!");
+        }
+        if(user.getRoleIdList().contains(SysRoleEnum.PLATFORM_STREAMER.getCode())){
+            user.setIsPlatformStreamer(true);
+            user.setRoleIdList(Collections.singletonList(8L));
+        }else{
+            user.setIsPlatformStreamer(false);
         }
-
         SysUserEntity userEntity = queryObject(user.getUserId());
         //检查角色是否越权
         checkRole(user);
@@ -245,20 +257,44 @@ public class SysUserServiceImpl implements SysUserService {
     }
 
     @Override
-    public int updatePassword(Long userId, String password, String newPassword, String fdkkUser) {
+    public void updatePassword(String mobile,String password, String fdkkPassword, String fdkkUser) {
+        CurrentUserLoginVo userEntity = ShiroUtils.getUserEntity();
+        ResponseEntity<String> loginResult;
+        if(!ObjectUtils.isEmpty(password)){
+            // 对指房宝密码解密
+            password = Base64Converter.decode(Base64Converter.subText(password));
+            // 登录指房宝进行当前密码校验
+            loginResult = zhiHouseService.login(mobile, password);
+            if(loginResult.getStatusCode()!= HttpStatus.OK){
+                throw new CommonBaseException(500,"请求失败");
+            }
+        }
+        if(!ObjectUtils.isEmpty(fdkkPassword)){
+            // 对4d看看密码解密
+            String decryptFdkkPassword = Base64Converter.decode(Base64Converter.subText(fdkkPassword));
+            // 登录4dkankan
+            loginResult = fdkkService.login(fdkkUser,decryptFdkkPassword);
+            if(loginResult.getStatusCode()!= HttpStatus.OK){
+                throw new CommonBaseException(500,"请求失败");
+            }
+            JSONObject result = JSONObject.parseObject(loginResult.getBody());
+            if (result.getInteger("code") == 3015) {
+                throw new CommonBaseException(500, "此账号未注册,请先注册后再绑定。");
+            }
+            if(result.getInteger("code") == 3014){
+                throw new CommonBaseException(500, "四维看看账号密码有误,请重新输入。");
+            }
+            if (result.getInteger("code") != Result.CODE_SUCCESS) {
+                throw new CommonBaseException(500, "请求失败,请重试");
+            }
+        }
         Map<String, Object> map = new HashMap<>();
-        map.put("userId", userId);
-        map.put("password", password);
-        map.put("newPassword", newPassword);
-        if(StringUtil.isNotEmpty(fdkkUser)){
+        map.put("userId", userEntity.getUserId());
+        if(!ObjectUtils.isEmpty(fdkkPassword)){
             map.put("fdkkUser", fdkkUser);
-
-            if(userId == 1){
-                String encryptPwd = PasswordUtils.encrypt(newPassword, fdkkUser, PasswordUtils.getStaticSalt());
-                map.put("fdkkPassword", encryptPwd);
-            }
+            map.put("fdkkPassword", fdkkPassword);
         }
-        return sysUserDao.updatePassword(map);
+        sysUserDao.updatePassword(map);
     }
 
     /**
@@ -315,6 +351,9 @@ public class SysUserServiceImpl implements SysUserService {
 
     @Override
     public List<SysUserEntity> getSysUserListByDeptIds(List<Long> deptList) {
+        if(ObjectUtils.isEmpty(deptList)){
+            return new ArrayList<>();
+        }
         return sysUserDao.getSysUserListByDeptIds(deptList);
     }
 }

+ 127 - 0
platform-common/src/main/java/com/platform/service/impl/ZhiHouseService.java

@@ -0,0 +1,127 @@
+package com.platform.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.platform.enums.ResultCodeEnum;
+import com.platform.exception.CommonBaseException;
+import com.platform.vos.RequestScene;
+import com.platform.vos.ReturnDTO;
+import com.platform.vos.ZhiHouseUserLoginVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class ZhiHouseService {
+
+    @Value("${scenePath}")
+    private String zhiHouseHost;
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    /**
+     * 登录指房宝
+     * @param username
+     * @param password
+     * @return
+     */
+    public ResponseEntity<String> login(String username, String password) {
+        ZhiHouseUserLoginVo userLoginVo = new ZhiHouseUserLoginVo();
+        userLoginVo.setUserName(username);
+        userLoginVo.setUserPassword(password);
+        userLoginVo.setArea("1234");
+        String url = zhiHouseHost + "api/platform/login";
+        return restTemplate.postForEntity(url, userLoginVo, String.class);
+    }
+
+    public ReturnDTO generateSceneEditToken(String token, String userName, String sceneNum) {
+        if(ObjectUtils.isEmpty(token)){
+            throw new CommonBaseException(ResultCodeEnum.D101);
+        }
+        Map<String, String> param = new HashMap<>();
+        param.put("userName",userName);
+        param.put("sceneNum",sceneNum);
+        String url = zhiHouseHost + "api/platform/generateSceneEditToken";
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("token", token);
+        HttpEntity<Object> formEntity = new HttpEntity<>(param, headers);
+        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,formEntity,ReturnDTO.class);
+        if(responseEntity.getStatusCode()!= HttpStatus.OK){
+            throw new CommonBaseException(ResultCodeEnum.D100,"连接失败");
+        }
+        if (responseEntity.getBody().getCode() != 200) {
+            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
+        }
+
+        return responseEntity.getBody();
+    }
+
+    /**
+     * 获取四维看看场景数据
+     * @param username
+     * @return
+     */
+    public ReturnDTO sync4dkkSceneData(String username) {
+        Map<String ,Object> params = new HashMap<>(1);
+        params.put("phone",username);
+        String url = zhiHouseHost + "api/platform/sync4dkkSceneData";
+        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url, params, ReturnDTO.class);
+        if(responseEntity.getStatusCode()!= HttpStatus.OK){
+            throw new CommonBaseException(ResultCodeEnum.D100);
+        }
+        if (responseEntity.getBody().getCode() != 200) {
+            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
+        }
+        return responseEntity.getBody();
+    }
+
+    public JSONObject getSceneFromZhiHouse(RequestScene requestScene){
+        String url = zhiHouseHost + "scene/list";
+        if(org.apache.commons.lang3.StringUtils.isBlank(url )){
+            throw new CommonBaseException(ResultCodeEnum.D101 , "入参不全,无法获取四维场景列表");
+        }
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("token", requestScene.getToken());
+        HttpEntity<Object> formEntity = new HttpEntity<>(requestScene, headers);
+        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,formEntity,ReturnDTO.class);
+        if(responseEntity.getStatusCode()!= HttpStatus.OK){
+            throw new CommonBaseException(ResultCodeEnum.D100);
+        }
+        if (responseEntity.getBody().getCode() != 200) {
+            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
+        }
+        //把信息封装为json
+        return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getMessage()));
+    }
+
+    public void bind4dkkUser(String fdkkUser, String fdkkPassword, String token) {
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("token", token);
+        Map<String ,Object> params = new HashMap<>(1);
+        params.put("fdkkUser",fdkkUser);
+        params.put("fdkkPassword",fdkkPassword);
+        HttpEntity<Object> formEntity = new HttpEntity<>(params, headers);
+        String url = null;
+        if (ObjectUtils.isEmpty(fdkkUser) || ObjectUtils.isEmpty(fdkkPassword)) {
+            url = zhiHouseHost.concat("/user/unBind4dkkUser");
+        } else {
+            url = zhiHouseHost.concat("/user/bind4dkkUser");
+        }
+        ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url, formEntity, ReturnDTO.class);
+        if(responseEntity.getStatusCode()!= HttpStatus.OK){
+            throw new CommonBaseException(ResultCodeEnum.D100);
+        }
+        if (responseEntity.getBody().getCode() != 200) {
+            throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
+        }
+    }
+}

+ 12 - 59
platform-common/src/main/java/com/platform/utils/ResourceUtil.java

@@ -1,7 +1,10 @@
 package com.platform.utils;
 
-import java.io.UnsupportedEncodingException;
-import java.util.ResourceBundle;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
 
 /**
  * 名称:ResourceUtil <br>
@@ -11,68 +14,18 @@ import java.util.ResourceBundle;
  * @version 1.0
  * @since 1.0.0
  */
-public class ResourceUtil {
-    private static ResourceUtil RESOURCE_UTIL = null;
+@Component
+public class ResourceUtil implements ApplicationContextAware {
 
-    private static ResourceBundle BUNDLE = java.util.ResourceBundle.getBundle("platform");
+    private static Environment environment;
 
-    private ResourceUtil() {
 
-    }
-
-    /**
-     * 工厂实现配置文件读取
-     *
-     * @param properties 参数
-     * @return ResourceUtil 工具类
-     */
-    public static ResourceUtil getInstance(String properties) {
-        if (RESOURCE_UTIL == null) {
-            RESOURCE_UTIL = new ResourceUtil();
-        }
-        if (properties != null) {
-            BUNDLE = java.util.ResourceBundle.getBundle(properties);
-        }
-        return RESOURCE_UTIL;
-    }
-
-    /**
-     * 工厂实现配置文件读取
-     *
-     * @return ResourceUtil
-     */
-    public static ResourceUtil getInstance() {
-        if (RESOURCE_UTIL == null) {
-            RESOURCE_UTIL = new ResourceUtil();
-        }
-        return RESOURCE_UTIL;
-    }
-
-    /**
-     * 主要功能:获取配置文件参数
-     * 注意事项:无
-     *
-     * @param name 参数名称
-     * @return 参数名称对应值
-     */
     public static String getConfigByName(String name) {
-        String value = "";
-        try {
-            value = new String(BUNDLE.getString(name).getBytes("iso8859-1"), "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        return value;
+        return environment.getProperty(name);
     }
 
-    /**
-     * 主要功能:取得分隔符
-     * 注意事项:无
-     *
-     * @return 分隔符
-     */
-    public static String getSeparator() {
-        return System.getProperty("file.separator");
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        ResourceUtil.environment = applicationContext.getEnvironment();
     }
-
 }

+ 34 - 29
platform-common/src/main/java/com/platform/utils/WxOpUtils.java

@@ -16,6 +16,7 @@ import org.apache.http.client.methods.HttpPost;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -37,6 +38,13 @@ import java.util.*;
 @Component
 public class WxOpUtils {
 
+    private static RestTemplate restTemplate;
+
+    @Autowired
+    public void setRestTemplate(RestTemplate restTemplate){
+        WxOpUtils.restTemplate = restTemplate;
+    }
+
     public static final String SESSION_KEY = "session_key";
     public static final String WX_OPEN_ID_KEY = "openid";
     public static final String WX_ACCESS_TOKEN = "WX_ACCESS_TOKEN_";
@@ -52,9 +60,6 @@ public class WxOpUtils {
     private static final String UP_LOAD_MEDIA = "https://api.weixin.qq.com/cgi-bin/media/upload";
     private static final String GET_TEMP_DATA_URL = "https://api.weixin.qq.com/cgi-bin/media/get";
 
-
-    private static RestTemplate restTemplate = new RestTemplate();
-
     private static String agencyWxAppId;
 
     private static String agencyWxAppSecret;
@@ -82,10 +87,12 @@ public class WxOpUtils {
         param.put("grant_type", "client_credential");
         param.put("appid", appId);
         param.put("secret", secret);
-        String vxResult = HttpClientUtil.doGet(SUBSCRIBE_ACCESS_TOKEN_URL, param);
-        log.info(vxResult);
+        ResponseEntity<String> vxResult = restTemplate.getForEntity(SUBSCRIBE_ACCESS_TOKEN_URL
+                        +"?grant_type=client_credential&appid="+appId+"&secret="+secret
+                ,String.class);
+        log.info(vxResult.getBody());
 
-        AccessTokenModel accessTokenModel = JsonUtils.jsonToPojo(vxResult, AccessTokenModel.class);
+        AccessTokenModel accessTokenModel = JsonUtils.jsonToPojo(vxResult.getBody(), AccessTokenModel.class);
         //采用默认的缓存时长一个半小时
         LettuceRedisClientUtils.setStrKeyValue(redisKey , accessTokenModel.getAccess_token() , 5400);
         return accessTokenModel.getAccess_token();
@@ -131,9 +138,9 @@ public class WxOpUtils {
         String accessToken = getAccessToken(appId, appSecret);
         String url = PUBLIC_SUBSCRIBE_TWO_REQUEST_URL + accessToken;
         String json = JsonUtils.objectToJson(wxMssVO);
-        String vxResult = HttpClientUtil.doPostJson(url, json);
+        ResponseEntity<String> vxResult = restTemplate.postForEntity(url, wxMssVO,String.class);
         //把信息封装为json
-        JSONObject res = JSONObject.parseObject(vxResult);
+        JSONObject res = JSONObject.parseObject(vxResult.getBody());
         //把信息封装到map
         Map<String, Object> map = parseJSON2Map(res);
         if (null != map && map.containsKey("errcode")) {
@@ -145,10 +152,9 @@ public class WxOpUtils {
                     log.info("token过期了");
                     accessToken = updateAccessToken(appId, appSecret);
                     url = PUBLIC_SUBSCRIBE_TWO_REQUEST_URL + accessToken;
-                    json = JsonUtils.objectToJson(wxMssVO);
-                    vxResult = HttpClientUtil.doPostJson(url, json);
+                    vxResult = restTemplate.postForEntity(url, wxMssVO,String.class);
                     //把信息封装为json
-                    res = JSONObject.parseObject(vxResult);
+                    res = JSONObject.parseObject(vxResult.getBody());
                     //把信息封装到map
                     map = parseJSON2Map(res);
                 }
@@ -179,10 +185,9 @@ public class WxOpUtils {
         wxMssVO.setLang("zh_CN");
         wxMssVO.setPage(page);
         String url = SUBSCRIBE_REQUEST_URL + accessToken;
-        String json = JsonUtils.objectToJson(wxMssVO);
-        String vxResult = HttpClientUtil.doPostJson(url, json);
+        ResponseEntity<String> vxResult = restTemplate.postForEntity(url, wxMssVO,String.class);
         //把信息封装为json
-        JSONObject res = JSONObject.parseObject(vxResult);
+        JSONObject res = JSONObject.parseObject(vxResult.getBody());
         //把信息封装到map
         Map<String, Object> map = parseJSON2Map(res);
         if (null != map && map.containsKey("errcode")) {
@@ -195,10 +200,9 @@ public class WxOpUtils {
                     accessToken = updateAccessToken(appId, appSecret);
                     wxMssVO.setAccess_token(accessToken);
                     url = SUBSCRIBE_REQUEST_URL + accessToken;
-                    json = JsonUtils.objectToJson(wxMssVO);
-                    vxResult = HttpClientUtil.doPostJson(url, json);
+                    vxResult = restTemplate.postForEntity(url, wxMssVO,String.class);
                     //把信息封装为json
-                    res = JSONObject.parseObject(vxResult);
+                    res = JSONObject.parseObject(vxResult.getBody());
                     //把信息封装到map
                     map = parseJSON2Map(res);
                 }
@@ -215,10 +219,11 @@ public class WxOpUtils {
         param.put("appid", appId);
         param.put("secret", secret);
 
-        String vxResult = HttpClientUtil.doGet(SUBSCRIBE_ACCESS_TOKEN_URL, param);
-        log.info(vxResult);
+        ResponseEntity<String> vxResult = restTemplate.getForEntity(SUBSCRIBE_ACCESS_TOKEN_URL
+                +"?grant_type=client_credential&appid="+appId+"&secret="+secret,String.class);
+        log.info(vxResult.getBody());
 
-        AccessTokenModel accessTokenModel = JsonUtils.jsonToPojo(vxResult, AccessTokenModel.class);
+        AccessTokenModel accessTokenModel = JsonUtils.jsonToPojo(vxResult.getBody(), AccessTokenModel.class);
         //TODO:这里需要改成缓存到redis上去
         //采用默认的缓存时长一个半小时
         LettuceRedisClientUtils.setAndExpStrKeyValue(redisKey , accessTokenModel.getAccess_token() , 5400);
@@ -318,9 +323,9 @@ public class WxOpUtils {
             throw new CommonBaseException(ResultCodeEnum.D3014);
         }
         String url = CREATE_LIVE_ROOM_URL + "?access_token=" + token;
-        String wxRspStr = HttpClientUtil.doPostJson(url , JSON.toJSONString(wxLiveRoomRequestVo));
-        log.info("创建直播间,微信返回内容为:{}" , wxRspStr);
-        JSONObject wxLiveRoomRspVo = JsonUtils.jsonToPojo(wxRspStr , JSONObject.class);
+        ResponseEntity<String> wxRspStr = restTemplate.postForEntity(url , JSON.toJSONString(wxLiveRoomRequestVo),String.class);
+        log.info("创建直播间,微信返回内容为:{}" , wxRspStr.getBody());
+        JSONObject wxLiveRoomRspVo = JsonUtils.jsonToPojo(wxRspStr.getBody() , JSONObject.class);
         return wxLiveRoomRspVo;
     }
 
@@ -336,9 +341,9 @@ public class WxOpUtils {
         param.put("start" , start);
         param.put("limit" , limit);
         String url = GET_LIVE_ROOM_LIST_URL + "?access_token=" + token;
-        String wxRspStr = HttpClientUtil.doPostJson(url ,  JSON.toJSONString(param));
-        log.info("创建直播间,微信返回内容为:{}" , wxRspStr);
-        JSONObject wxLiveRoomRspVo = JsonUtils.jsonToPojo(wxRspStr , JSONObject.class);
+        ResponseEntity<String> wxRspStr = restTemplate.postForEntity(url ,  JSON.toJSONString(param),String.class);
+        log.info("创建直播间,微信返回内容为:{}" , wxRspStr.getBody());
+        JSONObject wxLiveRoomRspVo = JsonUtils.jsonToPojo(wxRspStr.getBody() , JSONObject.class);
         return wxLiveRoomRspVo;
     }
 
@@ -356,9 +361,9 @@ public class WxOpUtils {
         }
 
         String url = GET_TEMP_DATA_URL + "?access_token=" + token + "&media_id=" + mediaId;
-        String wxRsp = HttpClientUtil.doGet(url);
-        log.info("微信返回的照片链接为:{}" , wxRsp);
-        JSONObject jsonObject = JSON.parseObject(wxRsp);
+        ResponseEntity<String> wxRsp = restTemplate.getForEntity(url,String.class);
+        log.info("微信返回的照片链接为:{}" , wxRsp.getBody());
+        JSONObject jsonObject = JSON.parseObject(wxRsp.getBody());
         log.info("微信小程序返回数据为:{}" , jsonObject.toJSONString());
         if(null != jsonObject){
             if(jsonObject.containsKey("video_url")){

+ 45 - 0
platform-common/src/main/java/com/platform/vos/ReturnDTO.java

@@ -0,0 +1,45 @@
+package com.platform.vos;
+
+public class ReturnDTO {
+    private int code;
+    private String error;
+    private Object message;
+
+    public ReturnDTO(int code, String error, Object message) {
+        this.code = code;
+        this.error = error;
+        this.message = message;
+    }
+
+    public ReturnDTO(int code, String error) {
+        this.code = code;
+        this.error = error;
+    }
+
+    public ReturnDTO() {
+    }
+
+    public int getCode() {
+        return this.code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getError() {
+        return this.error;
+    }
+
+    public void setError(String error) {
+        this.error = error;
+    }
+
+    public Object getMessage() {
+        return this.message;
+    }
+
+    public void setMessage(Object message) {
+        this.message = message;
+    }
+}

+ 6 - 32
platform-common/src/main/resources/com/platform/dao/SysUserDao.xml

@@ -141,30 +141,10 @@
 	</select>
 	
 	<insert id="save" parameterType="com.platform.entity.SysUserEntity" useGeneratedKeys="true" keyProperty="userId">
-		insert into sys_user
-		(
-			`user_id`, 
-			`username`, 
-			`password`, 
-			`email`, 
-			`mobile`, 
-			`status`, 
-			`create_user_id`,
-			`dept_id`,
-			`create_time`
-		)
-		values
-		(
-			#{userId}, 
-			#{username}, 
-			#{password}, 
-			#{email}, 
-			#{mobile}, 
-			#{status}, 
-			#{createUserId},
-			#{deptId},
-			#{createTime}
-		)
+		insert into sys_user(`user_id`, `username`, `password`, `email`, `mobile`, `status`, `create_user_id`,
+		`dept_id`, `create_time`, `is_platform_streamer`)
+		values(#{userId}, #{username}, #{password},#{email}, #{mobile}, #{status}, #{createUserId},#{deptId},
+			#{createTime},#{isPlatformStreamer})
 	</insert>
 	 
 	<update id="update" parameterType="com.platform.entity.SysUserEntity">
@@ -175,6 +155,7 @@
 			<if test="mobile != null">`mobile` = #{mobile}, </if>
 			<if test="status != null">`status` = #{status}, </if>
 			<if test="deptId != null">`dept_id` = #{deptId}, </if>
+			<if test="isPlatformStreamer != null">`is_platform_streamer` = #{isPlatformStreamer}, </if>
 		</set>
 		where user_id = #{userId} 
 		<if test="createUserId != null">
@@ -183,14 +164,7 @@
 	</update>
 	
 	<update id="updatePassword" parameterType="map">
-		update sys_user set `password` = #{newPassword}
-			<if test="fdkkUser != null">
-				, fdkk_user = #{fdkkUser}
-			</if>
-			<if test="fgkkPassword != null">
-				, fgkk_password = #{fgkkPassword}
-			</if>
-			where user_id = #{userId} and password = #{password}
+		update sys_user set fdkk_user = #{fdkkUser} ,fdkk_password = #{fdkkPassword} where user_id = #{userId}
 	</update>
 	
 	<delete id="deleteBatch">

+ 0 - 19
platform-gen/pom.xml

@@ -1,19 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>com.platform</groupId>
-        <artifactId>platform</artifactId>
-        <version>1.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>platform-gen</artifactId>
-    <packaging>jar</packaging>
-    <description>代码生成器模块</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.platform</groupId>
-            <artifactId>platform-common</artifactId>
-            <version>1.0.0</version>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 77
platform-gen/src/main/java/com/platform/controller/SysGeneratorController.java

@@ -1,77 +0,0 @@
-package com.platform.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.platform.service.SysGeneratorService;
-import com.platform.utils.DateUtils;
-import com.platform.utils.PageUtils;
-import com.platform.utils.Query;
-import com.platform.utils.R;
-import com.platform.xss.XssHttpServletRequestWrapper;
-import org.apache.commons.io.IOUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 代码生成器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017年1月3日 下午6:35:28
- */
-@Controller
-@RequestMapping("/sys/generator")
-public class SysGeneratorController {
-    @Autowired
-    private SysGeneratorService sysGeneratorService;
-
-    /**
-     * 列表
-     */
-    @ResponseBody
-    @RequestMapping("/list")
-    @RequiresPermissions("sys:generator:list")
-    public R list(@RequestParam Map<String, Object> params) {
-        //查询列表数据
-        Query query = new Query(params);
-        List<Map<String, Object>> list = sysGeneratorService.queryList(query);
-        int total = sysGeneratorService.queryTotal(query);
-
-        PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
-
-        return R.ok().put("page", pageUtil);
-    }
-
-    /**
-     * 生成代码
-     */
-    @RequestMapping("/code")
-    @RequiresPermissions("sys:generator:code")
-    public void code(HttpServletRequest request, HttpServletResponse response) throws IOException {
-        String[] tableNames = new String[]{};
-        //获取表名,不进行xss过滤
-        HttpServletRequest orgRequest = XssHttpServletRequestWrapper.getOrgRequest(request);
-        String tables = orgRequest.getParameter("tables");
-        tableNames = JSON.parseArray(tables).toArray(tableNames);
-
-        byte[] data = sysGeneratorService.generatorCode(tableNames);
-
-        response.reset();
-        response.setHeader("Content-Disposition", "attachment; filename=\"AutoCode"
-                + DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_YYYY_MM_DD_HH_MM_SS_SSS) + ".zip\"");
-        response.addHeader("Content-Length", "" + data.length);
-        response.setContentType("application/octet-stream; charset=UTF-8");
-
-        IOUtils.write(data, response.getOutputStream());
-    }
-}

+ 0 - 22
platform-gen/src/main/java/com/platform/dao/SysGeneratorDao.java

@@ -1,22 +0,0 @@
-package com.platform.dao;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 代码生成器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月19日 下午3:32:04
- */
-public interface SysGeneratorDao {
-
-    List<Map<String, Object>> queryList(Map<String, Object> map);
-
-    int queryTotal(Map<String, Object> map);
-
-    Map<String, String> queryTable(String tableName);
-
-    List<Map<String, String>> queryColumns(String tableName);
-}

+ 0 - 25
platform-gen/src/main/java/com/platform/dao/SysOracleGeneratorDao.java

@@ -1,25 +0,0 @@
-package com.platform.dao;
-
-
-import com.platform.entity.ResultMap;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * oracle代码生成器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017年07月23日 上午13:06:04
- */
-public interface SysOracleGeneratorDao {
-
-    List<Map<String, Object>> queryList(Map<String, Object> map);
-
-    int queryTotal(Map<String, Object> map);
-
-    Map<String, String> queryTable(String tableName);
-
-    List<ResultMap> queryColumns(String tableName);
-}

+ 0 - 82
platform-gen/src/main/java/com/platform/entity/ColumnEntity.java

@@ -1,82 +0,0 @@
-package com.platform.entity;
-
-/**
- * 列的属性
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月20日 上午12:01:45
- */
-public class ColumnEntity {
-    //列名
-    private String columnName;
-    //列名类型
-    private String dataType;
-    //列名备注
-    private String comments;
-
-    //属性名称(第一个字母大写),如:user_name => UserName
-    private String attrName;
-    //属性名称(第一个字母小写),如:user_name => userName
-    private String attrname;
-    //属性类型
-    private String attrType;
-    //auto_increment
-    private String extra;
-
-    public String getColumnName() {
-        return columnName;
-    }
-
-    public void setColumnName(String columnName) {
-        this.columnName = columnName;
-    }
-
-    public String getDataType() {
-        return dataType;
-    }
-
-    public void setDataType(String dataType) {
-        this.dataType = dataType;
-    }
-
-    public String getComments() {
-        return comments;
-    }
-
-    public void setComments(String comments) {
-        this.comments = comments;
-    }
-
-    public String getAttrname() {
-        return attrname;
-    }
-
-    public void setAttrname(String attrname) {
-        this.attrname = attrname;
-    }
-
-    public String getAttrName() {
-        return attrName;
-    }
-
-    public void setAttrName(String attrName) {
-        this.attrName = attrName;
-    }
-
-    public String getAttrType() {
-        return attrType;
-    }
-
-    public void setAttrType(String attrType) {
-        this.attrType = attrType;
-    }
-
-    public String getExtra() {
-        return extra;
-    }
-
-    public void setExtra(String extra) {
-        this.extra = extra;
-    }
-}

+ 0 - 60
platform-gen/src/main/java/com/platform/entity/ResultMap.java

@@ -1,60 +0,0 @@
-package com.platform.entity;
-
-/**
- * 名称:ResultMap <br>
- * 描述:查询表信息返回的BaseResultMap<br>
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017-09-17 20:20
- */
-public class ResultMap {
-    /**
-     * 数据库字段名
-     */
-    private String columnName;
-    /**
-     * 字段类型
-     */
-    private String dataType;
-    /**
-     * 字段注释
-     */
-    private String columnComment;
-    /**
-     * 主键
-     */
-    private String columnKey;
-
-    public String getColumnName() {
-        return columnName;
-    }
-
-    public void setColumnName(String columnName) {
-        this.columnName = columnName;
-    }
-
-    public String getDataType() {
-        return dataType;
-    }
-
-    public void setDataType(String dataType) {
-        this.dataType = dataType;
-    }
-
-    public String getColumnComment() {
-        return columnComment;
-    }
-
-    public void setColumnComment(String columnComment) {
-        this.columnComment = columnComment;
-    }
-
-    public String getColumnKey() {
-        return columnKey;
-    }
-
-    public void setColumnKey(String columnKey) {
-        this.columnKey = columnKey;
-    }
-}

+ 0 - 74
platform-gen/src/main/java/com/platform/entity/TableEntity.java

@@ -1,74 +0,0 @@
-package com.platform.entity;
-
-import java.util.List;
-
-/**
- * 表数据
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月20日 上午12:02:55
- */
-public class TableEntity {
-    //表的名称
-    private String tableName;
-    //表的备注
-    private String comments;
-    //表的主键
-    private ColumnEntity pk;
-    //表的列名(不包含主键)
-    private List<ColumnEntity> columns;
-
-    //类名(第一个字母大写),如:sys_user => SysUser
-    private String className;
-    //类名(第一个字母小写),如:sys_user => sysUser
-    private String classname;
-
-    public String getTableName() {
-        return tableName;
-    }
-
-    public void setTableName(String tableName) {
-        this.tableName = tableName;
-    }
-
-    public String getComments() {
-        return comments;
-    }
-
-    public void setComments(String comments) {
-        this.comments = comments;
-    }
-
-    public ColumnEntity getPk() {
-        return pk;
-    }
-
-    public void setPk(ColumnEntity pk) {
-        this.pk = pk;
-    }
-
-    public List<ColumnEntity> getColumns() {
-        return columns;
-    }
-
-    public void setColumns(List<ColumnEntity> columns) {
-        this.columns = columns;
-    }
-
-    public String getClassName() {
-        return className;
-    }
-
-    public void setClassName(String className) {
-        this.className = className;
-    }
-
-    public String getClassname() {
-        return classname;
-    }
-
-    public void setClassname(String classname) {
-        this.classname = classname;
-    }
-}

+ 0 - 106
platform-gen/src/main/java/com/platform/generator/ApiMysqlGenerator.java

@@ -1,106 +0,0 @@
-package com.platform.generator;
-
-import com.baomidou.mybatisplus.generator.AutoGenerator;
-import com.baomidou.mybatisplus.generator.InjectionConfig;
-import com.baomidou.mybatisplus.generator.config.*;
-import com.baomidou.mybatisplus.generator.config.po.TableInfo;
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author abnerhou
- * @date 2020/9/11 19:32
- * @desciption
- */
-public class ApiMysqlGenerator {
-
-
-    public static void main(String[] args) {
-        AutoGenerator mpg = new AutoGenerator();
-
-        GlobalConfig gc = new GlobalConfig();
-        String projectPath = System.getProperty("user.dir");
-        gc.setOutputDir(projectPath + "/platform-api/src/main/java");
-        gc.setAuthor("abner");   // 作者
-        gc.setOpen(false);      //生成代码后是否打开文件夹
-        gc.setSwagger2(true);
-        gc.setMapperName("Api%sDao");
-        gc.setServiceImplName("Api%sServiceImpl");
-        gc.setServiceName("Api%sService");
-        gc.setEntityName("Api%sVo");
-//        gc.setXmlName("%sMapper");
-//        gc.setControllerName("%sController");
-        gc.setFileOverride(true);//是否覆盖
-        mpg.setGlobalConfig(gc);
-
-        DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://120.25.146.52:3306/4dage-zfb?useUnicode=true&serverTimezone=GMT&useSSL=false&characterEncoding=utf8");
-        dsc.setDriverName("com.mysql.jdbc.Driver");
-        dsc.setUsername("root");
-        dsc.setPassword("4dkk2020test%");
-        mpg.setDataSource(dsc);
-
-        // 包配置
-        PackageConfig pc = new PackageConfig();
-        pc.setModuleName("platform"); // 模块名称, 这里可以根据不同模块来写
-        pc.setParent("com"); // 父包名
-        pc.setMapper("dao");
-        pc.setController("controller");
-
-        mpg.setPackageInfo(pc);
-
-        // 配置模板
-        TemplateConfig templateConfig = new TemplateConfig();
-
-        //控制 不生成 controller
-        templateConfig.setController("");
-
-        templateConfig.setXml(null);
-        mpg.setTemplate(templateConfig);
-
-
-        // 注入自定义配置,可以在 VM 中使用 cfg.abc 【可无】
-        InjectionConfig cfg = new InjectionConfig() {
-            @Override
-            public void initMap() {
-                Map<String, Object> map = new HashMap<String, Object>();
-                map.put("abc", this.getConfig().getGlobalConfig().getAuthor() + "-mp");
-                this.setMap(map);
-            }
-        };
-
-        // 调整 xml 生成目录演示
-        List<FileOutConfig> focList = new ArrayList<FileOutConfig>();
-        focList.add(new FileOutConfig("/templates/mapper.xml.vm") {
-            @Override
-            public String outputFile(TableInfo tableInfo) {
-                String mapperCoreName = tableInfo.getEntityName().substring(3 , (tableInfo.getEntityName().length() - 2));
-                return  "E:\\code\\projects\\dev_shop\\platform-api\\src\\main\\resources\\com\\platform\\dao\\" +  "Api" + mapperCoreName + "Mapper.xml";
-            }
-        });
-        cfg.setFileOutConfigList(focList);
-        mpg.setCfg(cfg);
-
-
-        // 策略配置
-        StrategyConfig strategy = new StrategyConfig();
-        strategy.setNaming(NamingStrategy.underline_to_camel);
-        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
-//        strategy.setSuperEntityClass("house.api.base.model");
-
-        strategy.setEntityLombokModel(true);
-       /* strategy.setInclude("tm_slide_show","tm_live_room_info",
-                "tm_scene_census","tm_brand_admin");  // 如果要生成多个,这里可以传入String[]
-        strategy.setInclude("tm_scene_census");*/  // 如果要生成多个,这里可以传入String[]
-//        strategy.setInclude("tm_deal_log");
-        strategy.setInclude("tm_brand_type");
-        mpg.setStrategy(strategy);
-        //TODO:使用的时候,释放出来就可以了
-        mpg.execute();
-        System.out.println("代码自动生成执行完成");
-    }
-}

+ 0 - 107
platform-gen/src/main/java/com/platform/generator/MysqlGenerator.java

@@ -1,107 +0,0 @@
-package com.platform.generator;
-
-import com.baomidou.mybatisplus.generator.AutoGenerator;
-import com.baomidou.mybatisplus.generator.InjectionConfig;
-import com.baomidou.mybatisplus.generator.config.*;
-import com.baomidou.mybatisplus.generator.config.po.TableInfo;
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author abnerhou
- * @date 2020/6/3 14:54
- * @desciption
- */
-public class MysqlGenerator {
-
-
-    public static void main(String[] args) {
-        AutoGenerator mpg = new AutoGenerator();
-
-        GlobalConfig gc = new GlobalConfig();
-        String projectPath = System.getProperty("user.dir");
-//        gc.setOutputDir(projectPath + "/platform-shop/src/main/java");
-        gc.setOutputDir(projectPath + "/platform-common/src/main/java");
-        gc.setAuthor("abner");   // 作者
-        gc.setOpen(false);      //生成代码后是否打开文件夹
-        gc.setSwagger2(true);
-        gc.setMapperName("%sDao");
-//        gc.setXmlName("%sMapper");
-//        gc.setControllerName("%sController");
-        gc.setFileOverride(true);//是否覆盖
-        mpg.setGlobalConfig(gc);
-
-        DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://120.25.146.52:3306/4dage-zfb?useUnicode=true&serverTimezone=GMT&useSSL=false&characterEncoding=utf8");
-        dsc.setDriverName("com.mysql.jdbc.Driver");
-        dsc.setUsername("root");
-        dsc.setPassword("4dkk2020test%");
-        mpg.setDataSource(dsc);
-
-        // 包配置
-        PackageConfig pc = new PackageConfig();
-        pc.setModuleName("platform"); // 模块名称, 这里可以根据不同模块来写
-        pc.setParent("com"); // 父包名
-        pc.setMapper("dao");
-        pc.setController("controller");
-
-        mpg.setPackageInfo(pc);
-
-        // 配置模板
-        TemplateConfig templateConfig = new TemplateConfig();
-
-        //控制 不生成 controller
-        templateConfig.setController("");
-
-        templateConfig.setXml(null);
-        mpg.setTemplate(templateConfig);
-
-
-        // 注入自定义配置,可以在 VM 中使用 cfg.abc 【可无】
-        InjectionConfig cfg = new InjectionConfig() {
-            @Override
-            public void initMap() {
-                Map<String, Object> map = new HashMap<String, Object>();
-                map.put("abc", this.getConfig().getGlobalConfig().getAuthor() + "-mp");
-                this.setMap(map);
-            }
-        };
-
-        // 调整 xml 生成目录演示
-        List<FileOutConfig> focList = new ArrayList<FileOutConfig>();
-        focList.add(new FileOutConfig("/templates/mapper.xml.vm") {
-            @Override
-            public String outputFile(TableInfo tableInfo) {
-                return  "E:\\code\\projects\\dev_shop\\platform-common\\src\\main\\resources\\com\\platform\\dao\\" + tableInfo.getEntityName() + "Mapper.xml";
-            }
-        });
-        cfg.setFileOutConfigList(focList);
-        mpg.setCfg(cfg);
-
-
-        // 策略配置
-        StrategyConfig strategy = new StrategyConfig();
-        strategy.setNaming(NamingStrategy.underline_to_camel);
-        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
-//        strategy.setSuperEntityClass("house.api.base.model");
-
-        strategy.setEntityLombokModel(true);
-      /*  strategy.setInclude("tm_slide_show",
-                "tm_live_room_info",
-                "tm_live_goods","tm_scene_census",
-                "tm_task_log","tm_goods_visit_history",
-                "tm_brand_admin","tm_goods_detail_log");  // 如果要生成多个,这里可以传入String[]
-        strategy.setInclude("tm_scene_census"); */  // 如果要生成多个,这里可以传入String[]
-
-//        strategy.setInclude("tm_deal_log");
-        strategy.setInclude("sys_user_brand");
-        mpg.setStrategy(strategy);
-        //TODO:使用的时候,释放出来就可以了
-        mpg.execute();
-        System.out.println("代码自动生成执行完成");
-    }
-}

+ 0 - 27
platform-gen/src/main/java/com/platform/service/SysGeneratorService.java

@@ -1,27 +0,0 @@
-package com.platform.service;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 代码生成器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月19日 下午3:33:38
- */
-public interface SysGeneratorService {
-
-    List<Map<String, Object>> queryList(Map<String, Object> map);
-
-    int queryTotal(Map<String, Object> map);
-
-    Map<String, String> queryTable(String tableName);
-
-    List<Map<String, String>> queryColumns(String tableName);
-
-    /**
-     * 生成代码
-     */
-    byte[] generatorCode(String[] tableNames);
-}

+ 0 - 125
platform-gen/src/main/java/com/platform/service/impl/SysGeneratorServiceImpl.java

@@ -1,125 +0,0 @@
-package com.platform.service.impl;
-
-import com.platform.dao.SysGeneratorDao;
-import com.platform.dao.SysOracleGeneratorDao;
-import com.platform.entity.ResultMap;
-import com.platform.service.SysGeneratorService;
-import com.platform.utils.Constant;
-import com.platform.utils.GenUtils;
-import com.platform.utils.StringUtils;
-import org.apache.commons.io.IOUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.io.ByteArrayOutputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.zip.ZipOutputStream;
-
-@Service("sysGeneratorService")
-public class SysGeneratorServiceImpl implements SysGeneratorService {
-    @Autowired
-    private SysGeneratorDao sysGeneratorDao;
-    @Autowired
-    private SysOracleGeneratorDao sysOracleGeneratorDao;
-
-    @Override
-    public List<Map<String, Object>> queryList(Map<String, Object> map) {
-        if ("ORACLE".equals(Constant.USE_DATA)) {
-            List<Map<String, Object>> list = sysOracleGeneratorDao.queryList(map);
-
-            //oracle需转为驼峰命名
-            List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
-            for (Map<String, Object> stringObjectMap : list) {
-                Map<String, Object> objectMap = new HashMap<String, Object>();
-                for (String key : stringObjectMap.keySet()) {
-                    String mapKey = StringUtils.lineToHump(key);
-                    objectMap.put(mapKey, stringObjectMap.get(key));
-                }
-                mapList.add(objectMap);
-            }
-            return mapList;
-        }
-        return sysGeneratorDao.queryList(map);
-    }
-
-    @Override
-    public int queryTotal(Map<String, Object> map) {
-        if ("ORACLE".equals(Constant.USE_DATA)) {
-            return sysOracleGeneratorDao.queryTotal(map);
-        }
-        return sysGeneratorDao.queryTotal(map);
-    }
-
-    @Override
-    public Map<String, String> queryTable(String tableName) {
-        if ("ORACLE".equals(Constant.USE_DATA)) {
-            Map<String, String> objectMap = sysOracleGeneratorDao.queryTable(tableName);
-
-            //oracle需转为驼峰命名
-            Map<String, String> map = new HashMap<String, String>();
-            for (String key : objectMap.keySet()) {
-                String mapKey = StringUtils.lineToHump(key);
-                map.put(mapKey, objectMap.get(key));
-            }
-            return map;
-        }
-        return sysGeneratorDao.queryTable(tableName);
-    }
-
-    @Override
-    public List<Map<String, String>> queryColumns(String tableName) {
-        if ("ORACLE".equals(Constant.USE_DATA)) {
-            List<ResultMap> list = sysOracleGeneratorDao.queryColumns(tableName);
-
-            //oracle
-            List<Map<String, String>> mapList = new ArrayList<Map<String, String>>();
-            for (ResultMap stringObjectMap : list) {
-                // 获取实体类的所有属性,返回Field数组
-                Field[] field = stringObjectMap.getClass().getDeclaredFields();
-
-                Map<String, String> objectMap = new HashMap<String, String>();
-                for (int j = 0; j < field.length; j++) {
-                    // 获取属性的名字
-                    String name = field[j].getName();
-                    // 将属性的首字符大写,方便构造get,set方法
-                    String Name = name.substring(0, 1).toUpperCase() + name.substring(1);
-
-                    try {
-                        Method m = stringObjectMap.getClass().getMethod("get" + Name);
-                        // 调用getter方法获取属性值
-                        String value = (String) m.invoke(stringObjectMap);
-                        objectMap.put(name, value);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                }
-                mapList.add(objectMap);
-            }
-            return mapList;
-        }
-        return sysGeneratorDao.queryColumns(tableName);
-    }
-
-    @Override
-    public byte[] generatorCode(String[] tableNames) {
-        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        ZipOutputStream zip = new ZipOutputStream(outputStream);
-
-        for (String tableName : tableNames) {
-            //查询表信息
-            Map<String, String> table = queryTable(tableName);
-            //查询列信息
-            List<Map<String, String>> columns = queryColumns(tableName);
-            //生成代码
-            GenUtils.generatorCode(table, columns, zip);
-        }
-        IOUtils.closeQuietly(zip);
-        return outputStream.toByteArray();
-    }
-
-}

+ 0 - 242
platform-gen/src/main/java/com/platform/utils/GenUtils.java

@@ -1,242 +0,0 @@
-package com.platform.utils;
-
-import com.platform.entity.ColumnEntity;
-import com.platform.entity.TableEntity;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.WordUtils;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.*;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-/**
- * 代码生成器   工具类
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2017年1月3日 下午6:35:28
- */
-public class GenUtils {
-
-    private static List<String> getTemplates() {
-        List<String> templates = new ArrayList<String>();
-        templates.add("template/Entity.java.vm");
-        templates.add("template/Dao.java.vm");
-        templates.add("template/Dao.xml.vm");
-        templates.add("template/Service.java.vm");
-        templates.add("template/ServiceImpl.java.vm");
-        templates.add("template/Controller.java.vm");
-        templates.add("template/list.html.vm");
-        templates.add("template/list.js.vm");
-        templates.add("template/menu.sql.vm");
-        return templates;
-    }
-
-    /**
-     * 生成代码
-     */
-    public static void generatorCode(Map<String, String> table,
-                                     List<Map<String, String>> columns, ZipOutputStream zip) {
-        //配置信息
-        Configuration config = getConfig();
-
-        //表信息
-        TableEntity tableEntity = new TableEntity();
-        tableEntity.setTableName(table.get("tableName"));
-        tableEntity.setComments(table.get("tableComment"));
-        String tablePrefix = table.get("tableName").split("_")[0];
-        //表名转换成Java类名
-        String className = tableToJava(tableEntity.getTableName(), tablePrefix);
-        tableEntity.setClassName(className);
-        tableEntity.setClassname(StringUtils.uncapitalize(className));
-
-        //列信息
-        List<ColumnEntity> columsList = new ArrayList<>();
-        boolean hasDate = false;
-        boolean hasBigDecimal = false;
-        for (Map<String, String> column : columns) {
-            ColumnEntity columnEntity = new ColumnEntity();
-            columnEntity.setColumnName(column.get("columnName"));
-            columnEntity.setDataType(column.get("dataType"));
-            columnEntity.setComments(column.get("columnComment"));
-            columnEntity.setExtra(column.get("extra"));
-
-            //列名转换成Java属性名
-            String attrName = columnToJava(columnEntity.getColumnName());
-            columnEntity.setAttrName(attrName);
-            columnEntity.setAttrname(StringUtils.uncapitalize(attrName));
-
-            //列的数据类型,转换成Java类型
-            String attrType = config.getString(columnEntity.getDataType(), "String");
-            columnEntity.setAttrType(attrType);
-
-            if ("Date".equals(attrType)) {
-                hasDate = true;
-            }
-            if ("BigDecimal".equals(attrType)) {
-                hasBigDecimal = true;
-            }
-            //是否主键
-            if ("ORACLE".equals(Constant.USE_DATA)) {
-                if ((column.get("columnName").equalsIgnoreCase(column.get("columnKey")) && tableEntity.getPk() == null)) {
-                    tableEntity.setPk(columnEntity);
-                }
-            } else {
-                if (("PRI".equalsIgnoreCase(column.get("columnKey")) && tableEntity.getPk() == null)) {
-                    tableEntity.setPk(columnEntity);
-                }
-            }
-
-            columsList.add(columnEntity);
-        }
-        tableEntity.setColumns(columsList);
-
-        //若没主键
-        if (tableEntity.getPk() == null) {
-            //设置columnName为id的为主键
-            boolean flag = true;
-            for (ColumnEntity columnEntity : tableEntity.getColumns()) {
-                if ("id".equals(columnEntity.getAttrname())) {
-                    tableEntity.setPk(columnEntity);
-                    flag = false;
-                    break;
-                }
-            }
-            //若无id字段则第一个字段为主键
-            if (flag) {
-                tableEntity.setPk(tableEntity.getColumns().get(0));
-            }
-        }
-
-        String pre = tablePrefix.replace("_", "").toLowerCase();
-
-        //设置velocity资源加载器
-        Properties prop = new Properties();
-        prop.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
-        Velocity.init(prop);
-
-        //封装模板数据
-        Map<String, Object> map = new HashMap<>();
-        map.put("tableName", tableEntity.getTableName());
-        map.put("comments", tableEntity.getComments());
-        map.put("pk", tableEntity.getPk());
-        map.put("className", tableEntity.getClassName());
-        map.put("classname", tableEntity.getClassname());
-        map.put("pathName", tableEntity.getClassname().toLowerCase());
-        map.put("columns", tableEntity.getColumns());
-        map.put("package", config.getString("package"));
-        map.put("author", config.getString("author"));
-        map.put("datetime", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));
-        map.put("hasDate", hasDate);
-        map.put("hasBigDecimal", hasBigDecimal);
-        map.put("pre", pre);
-        VelocityContext context = new VelocityContext(map);
-
-        //获取模板列表
-        List<String> templates = getTemplates();
-        for (String template : templates) {
-            //渲染模板
-            StringWriter sw = new StringWriter();
-            Template tpl = Velocity.getTemplate(template, "UTF-8");
-            tpl.merge(context, sw);
-
-            try {
-                //添加到zip
-                zip.putNextEntry(new ZipEntry(getFileName(template, tableEntity.getClassName(), config.getString("package"), pre)));
-                IOUtils.write(sw.toString(), zip, "UTF-8");
-                IOUtils.closeQuietly(sw);
-                zip.closeEntry();
-            } catch (IOException e) {
-                throw new RRException("渲染模板失败,表名:" + tableEntity.getTableName(), e);
-            }
-        }
-    }
-
-    /**
-     * 列名转换成Java属性名
-     */
-    private static String columnToJava(String columnName) {
-        return WordUtils.capitalizeFully(columnName, new char[]{'_'}).replace("_", "");
-    }
-
-    /**
-     * 表名转换成Java类名
-     */
-    public static String tableToJava(String tableName, String tablePrefix) {
-        if (StringUtils.isNotBlank(tablePrefix)) {
-            tableName = tableName.replace(tablePrefix, "");
-        }
-        return columnToJava(tableName);
-    }
-
-    /**
-     * 获取配置信息
-     */
-    private static Configuration getConfig() {
-        try {
-            return new PropertiesConfiguration("generator.properties");
-        } catch (ConfigurationException e) {
-            throw new RRException("获取配置文件失败,", e);
-        }
-    }
-
-    /**
-     * 获取文件名
-     */
-    private static String getFileName(String template, String className, String packageName, String tablePrefix) {
-
-        String packagePath = "main" + File.separator + "java" + File.separator;
-        if (StringUtils.isNotBlank(packageName)) {
-            packagePath += packageName.replace(".", File.separator) + File.separator;
-        }
-
-        if (template.contains("Entity.java.vm")) {
-            return packagePath + "entity" + File.separator + className + "Entity.java";
-        }
-
-        if (template.contains("Dao.java.vm")) {
-            return packagePath + "dao" + File.separator + className + "Dao.java";
-        }
-
-        if (template.contains("Dao.xml.vm")) {
-            return packagePath + "dao" + File.separator + className + "Dao.xml";
-        }
-
-        if (template.contains("Service.java.vm")) {
-            return packagePath + "service" + File.separator + className + "Service.java";
-        }
-
-        if (template.contains("ServiceImpl.java.vm")) {
-            return packagePath + "service" + File.separator + "impl" + File.separator + className + "ServiceImpl.java";
-        }
-
-        if (template.contains("Controller.java.vm")) {
-            return packagePath + "controller" + File.separator + className + "Controller.java";
-        }
-
-        if (template.contains("list.html.vm")) {
-            return "main" + File.separator + "webapp" + File.separator + "WEB-INF" + File.separator + "page"
-                    + File.separator + tablePrefix + File.separator + className.toLowerCase() + ".html";
-        }
-
-        if (template.contains("list.js.vm")) {
-            return "main" + File.separator + "webapp" + File.separator + "js" + File.separator + tablePrefix + File.separator + className.toLowerCase() + ".js";
-        }
-
-        if (template.contains("menu.sql.vm")) {
-            return className.toLowerCase() + "_menu.sql";
-        }
-
-        return null;
-    }
-}

+ 0 - 33
platform-gen/src/main/resources/com/platform/dao/SysGeneratorDao.xml

@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.platform.dao.SysGeneratorDao">
-	<select id="queryList" resultType="map">
-		select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables 
-			where table_schema = (select database()) 
-		<if test="tableName != null and tableName.trim() != ''">
-			and table_name like concat('%', #{tableName}, '%') 
-		</if>
-		order by create_time desc
-		<if test="offset != null and limit != null">
-			limit #{offset}, #{limit}
-		</if>
-	</select>
-	
-	<select id="queryTotal" resultType="int">
-		select count(*) from information_schema.tables where table_schema = (select database())
-		<if test="tableName != null and tableName.trim() != ''">
-			and table_name like concat('%', #{tableName}, '%') 
-		</if> 
-	</select> 
-	
-	<select id="queryTable" resultType="map">
-		select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables 
-			where table_schema = (select database()) and table_name = #{tableName}
-	</select> 
-	
-	<select id="queryColumns" resultType="map">
-		select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns
- 			where table_name = #{tableName} and table_schema = (select database()) order by ordinal_position
-	</select>
-</mapper>

+ 0 - 67
platform-gen/src/main/resources/com/platform/dao/SysOracleGeneratorDao.xml

@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.platform.dao.SysOracleGeneratorDao">
-    <resultMap id="BaseResultMap" type="com.platform.entity.ResultMap">
-        <result column="column_name" property="columnName" jdbcType="VARCHAR"/>
-        <result column="data_type" property="dataType" jdbcType="VARCHAR"/>
-        <result column="column_comment" property="columnComment" jdbcType="VARCHAR"/>
-        <result column="column_key" property="columnKey" jdbcType="VARCHAR"/>
-    </resultMap>
-    <select id="queryList" resultType="map">
-        SELECT TABLE_NAME, COMMENTS table_Comment
-        FROM (SELECT ROWNUM AS RN,
-        USER_TAB_COMMENTS.TABLE_NAME TABLE_NAME,
-        USER_TAB_COMMENTS.COMMENTS COMMENTS,
-        USER_TABLES.TABLESPACE_NAME
-        FROM USER_TAB_COMMENTS
-        LEFT JOIN USER_TABLES
-        ON USER_TABLES.TABLE_NAME = USER_TAB_COMMENTS.TABLE_NAME
-        WHERE 1 = 1
-        <if test="tableName != null and tableName.trim() != ''">
-            AND USER_TABLES.table_Name LIKE concat(concat('%', #{tableName}), '%')
-        </if>
-        )
-        WHERE 1 = 1
-        <if test="offset != null and limit != null">
-            AND rn &gt;= #{offset} AND rn &lt;= #{rnum}
-        </if>
-    </select>
-
-    <select id="queryTotal" resultType="int">
-        SELECT COUNT(*)
-        FROM USER_TAB_COMMENTS
-        LEFT JOIN USER_TABLES
-        ON USER_TABLES.TABLE_NAME = USER_TAB_COMMENTS.TABLE_NAME
-        WHERE 1 = 1
-        <if test="tableName != null and tableName.trim() != ''">
-            and USER_TAB_COMMENTS.table_name like concat(concat('%', #{tableName}), '%')
-        </if>
-    </select>
-
-    <select id="queryTable" resultType="map">
-        SELECT USER_TAB_COMMENTS.TABLE_NAME TABLE_NAME,
-        USER_TAB_COMMENTS.COMMENTS   table_Comment,
-        USER_TABLES.TABLESPACE_NAME
-        FROM USER_TAB_COMMENTS
-        LEFT JOIN USER_TABLES
-        ON USER_TABLES.TABLE_NAME = USER_TAB_COMMENTS.TABLE_NAME
-        WHERE USER_TAB_COMMENTS.table_name = #{tableName}
-    </select>
-
-    <select id="queryColumns" resultMap="BaseResultMap">
-		select column_name column_name,
-       lower(DATA_TYPE ||
-             decode(DATA_TYPE,
-                    'DATE',
-                    '',
-                    '(' || nvl(DATA_PRECISION, data_length) ||
-                    nvl2(nullif(DATA_SCALE, 0), ',' || data_scale, '') || ')')) data_type,
-       (select comments from user_col_comments where table_name = #{tableName} and column_name = user_tab_columns.column_Name) column_comment,
-       (select col.column_name from user_constraints con, user_cons_columns col where con.constraint_name = col.constraint_name and con.constraint_type = 'P' and col.table_name = #{tableName}) column_key
-          from user_tab_columns
-          LEFT JOIN USER_TABLES
-            ON USER_TABLES.TABLE_NAME = user_tab_columns.TABLE_NAME
-         WHERE user_tab_columns.table_name = #{tableName}
-	</select>
-</mapper>

+ 0 - 29
platform-gen/src/main/resources/generator.properties

@@ -1,29 +0,0 @@
-#\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F
-
-
-#\u5305\u540D
-package=com.platform
-#\u4F5C\u8005
-author=lipengjun
-
-#\u7C7B\u578B\u8F6C\u6362\uFF0C\u914D\u7F6E\u4FE1\u606F
-tinyint=Integer
-smallint=Integer
-mediumint=Integer
-int=Integer
-integer=Integer
-bigint=Long
-float=Float
-double=Double
-decimal=BigDecimal
-
-char=String
-varchar=String
-tinytext=String
-text=String
-mediumtext=String
-longtext=String
-
-date=Date
-datetime=Date
-timestamp=Date

+ 0 - 126
platform-gen/src/main/resources/template/Controller.java.vm

@@ -1,126 +0,0 @@
-/*
- * 类名称:${className}Controller.java
- * 包名称:${package}.controller
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.controller;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.platform.annotation.SysLog;
-import com.platform.utils.R;
-import com.platform.controller.AbstractController;
-import ${package}.entity.${className}Entity;
-import ${package}.service.${className}Service;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * ${comments}Controller
- *
- * @author ${author}
- * @date ${datetime}
- */
-@RestController
-@RequestMapping("${pre}/${pathName}")
-public class ${className}Controller extends AbstractController {
-    @Autowired
-    private ${className}Service ${classname}Service;
-
-    /**
-     * 查看所有列表
-     *
-     * @param params 查询参数
-     * @return R
-     */
-    @RequestMapping("/queryAll")
-    @RequiresPermissions("${pre}:${pathName}:list")
-    public R queryAll(@RequestParam Map<String, Object> params) {
-        List<${className}Entity> list = ${classname}Service.queryAll(params);
-
-        return R.ok().put("list", list);
-    }
-
-    /**
-     * 分页查询${comments}
-     *
-     * @param params 查询参数
-     * @return R
-     */
-    @GetMapping("/list")
-    @RequiresPermissions("${pre}:${pathName}:list")
-    public R list(@RequestParam Map<String, Object> params) {
-        Page page = ${classname}Service.queryPage(params);
-
-        return R.ok().put("page", page);
-    }
-
-    /**
-     * 根据主键查询详情
-     *
-     * @param ${pk.attrname} 主键
-     * @return R
-     */
-    @RequestMapping("/info/{${pk.attrname}}")
-    @RequiresPermissions("${pre}:${pathName}:info")
-    public R info(@PathVariable("${pk.attrname}") ${pk.attrType} ${pk.attrname}) {
-        ${className}Entity ${classname} = ${classname}Service.getById(${pk.attrname});
-
-        return R.ok().put("${pathName}", ${classname});
-    }
-
-    /**
-     * 新增${comments}
-     *
-     * @param ${classname} ${classname}
-     * @return R
-     */
-    @SysLog("新增${comments}")
-    @RequestMapping("/save")
-    @RequiresPermissions("${pre}:${pathName}:save")
-    public R save(@RequestBody ${className}Entity ${classname}) {
-
-        ${classname}Service.add(${classname});
-
-        return R.ok();
-    }
-
-    /**
-     * 修改${comments}
-     *
-     * @param ${classname} ${classname}
-     * @return R
-     */
-    @SysLog("修改${comments}")
-    @RequestMapping("/update")
-    @RequiresPermissions("${pre}:${pathName}:update")
-    public R update(@RequestBody ${className}Entity ${classname}) {
-
-        ${classname}Service.update(${classname});
-
-        return R.ok();
-    }
-
-    /**
-     * 根据主键删除${comments}
-     *
-     * @param ${pk.attrname}s ${pk.attrname}s
-     * @return R
-     */
-    @SysLog("删除${comments}")
-    @RequestMapping("/delete")
-    @RequiresPermissions("${pre}:${pathName}:delete")
-    public R delete(@RequestBody ${pk.attrType}[] ${pk.attrname}s) {
-        ${classname}Service.deleteBatch(${pk.attrname}s);
-
-        return R.ok();
-    }
-}

+ 0 - 47
platform-gen/src/main/resources/template/Dao.java.vm

@@ -1,47 +0,0 @@
-/*
- * 类名称:${className}Dao.java
- * 包名称:${package}.dao
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import ${package}.entity.${className}Entity;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * ${comments}Dao
- *
- * @author ${author}
- * @date ${datetime}
- */
-@Mapper
-public interface ${className}Dao extends BaseMapper<${className}Entity> {
-
-    /**
-     * 查询所有列表
-     *
-     * @param params 查询参数
-     * @return List
-     */
-    List<${className}Entity> queryAll(@Param("params") Map<String, Object> params);
-
-    /**
-     * 自定义分页查询
-     *
-     * @param page   分页参数
-     * @param params 查询参数
-     * @return List
-     */
-    List<${className}Entity> select${className}Page(IPage page, @Param("params") Map<String, Object> params);
-}

+ 0 - 27
platform-gen/src/main/resources/template/Dao.xml.vm

@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="${package}.dao.${className}Dao">
-
-    <sql id="selectSql">
-        SELECT
-#foreach($column in $columns)
-        T.$column.columnName#if($velocityCount != $columns.size()),
-#end
-#end
-
-        FROM ${tableName} T
-        WHERE 1=1
-        <if test="params.name != null and params.name.trim() != ''">
-            AND T.NAME LIKE '%${params.name}%'
-        </if>
-    </sql>
-
-    <select id="select${className}Page" resultType="${package}.entity.${className}Entity">
-        <include refid="selectSql"/>
-    </select>
-
-    <select id="queryAll" resultType="${package}.entity.${className}Entity">
-        <include refid="selectSql"/>
-    </select>
-</mapper>

+ 0 - 49
platform-gen/src/main/resources/template/Entity.java.vm

@@ -1,49 +0,0 @@
-/*
- * 类名称:${className}Entity.java
- * 包名称:${package}.entity
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import java.io.Serializable;
-#if(${hasBigDecimal})
-import java.math.BigDecimal;
-#end
-#if(${hasDate})
-import java.util.Date;
-#end
-
-/**
- * ${comments}实体
- *
- * @author ${author}
- * @date ${datetime}
- */
-@Data
-@TableName("${tableName}")
-public class ${className}Entity implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-#foreach ($column in $columns)
-#if($column.columnName == $pk.columnName)
-    /**
-     * $column.comments
-     */
-    @TableId
-    private $column.attrType $column.attrname;
-#else
-    /**
-     * $column.comments
-     */
-    private $column.attrType $column.attrname;
-#end#end
-}

+ 0 - 75
platform-gen/src/main/resources/template/Service.java.vm

@@ -1,75 +0,0 @@
-/*
- * 类名称:${className}Service.java
- * 包名称:${package}.service
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.service;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
-import ${package}.entity.${className}Entity;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * ${comments}Service接口
- *
- * @author ${author}
- * @date ${datetime}
- */
-public interface ${className}Service extends IService<${className}Entity> {
-
-    /**
-     * 查询所有列表
-     *
-     * @param params 查询参数
-     * @return List
-     */
-    List<${className}Entity> queryAll(Map<String, Object> params);
-
-    /**
-     * 分页查询${comments}
-     *
-     * @param params 查询参数
-     * @return Page
-     */
-    Page queryPage(Map<String, Object> params);
-
-    /**
-     * 新增${comments}
-     *
-     * @param ${classname} ${comments}
-     * @return 新增结果
-     */
-    boolean add(${className}Entity ${classname});
-
-    /**
-     * 根据主键更新${comments}
-     *
-     * @param ${classname} ${comments}
-     * @return 更新结果
-     */
-    boolean update(${className}Entity ${classname});
-
-    /**
-     * 根据主键删除${comments}
-     *
-     * @param ${pk.attrname} ${pk.attrname}
-     * @return 删除结果
-     */
-    boolean delete(${pk.attrType} ${pk.attrname});
-
-    /**
-     * 根据主键批量删除
-     *
-     * @param ${pk.attrname}s ${pk.attrname}s
-     * @return 删除结果
-     */
-    boolean deleteBatch(${pk.attrType}[] ${pk.attrname}s);
-}

+ 0 - 69
platform-gen/src/main/resources/template/ServiceImpl.java.vm

@@ -1,69 +0,0 @@
-/*
- * 类名称:${className}ServiceImpl.java
- * 包名称:${package}.service.impl
- *
- * 修改履历:
- *     日期                       修正者        主要内容
- *     ${datetime}        ${author}     初版做成
- *
- * Copyright (c) 2019-2019 微同科技
- */
-package ${package}.service.impl;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.platform.utils.QueryPlus;
-import ${package}.dao.${className}Dao;
-import ${package}.entity.${className}Entity;
-import ${package}.service.${className}Service;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-/**
- * ${comments}Service实现类
- *
- * @author ${author}
- * @date ${datetime}
- */
-@Service("${classname}Service")
-public class ${className}ServiceImpl extends ServiceImpl<${className}Dao, ${className}Entity> implements ${className}Service {
-
-    @Override
-    public List<${className}Entity> queryAll(Map<String, Object> params) {
-        return baseMapper.queryAll(params);
-    }
-
-    @Override
-    public Page queryPage(Map<String, Object> params) {
-        //排序
-        params.put("sidx", "T.${pk.columnName}");
-        params.put("asc", false);
-        Page<${className}Entity> page = new QueryPlus<${className}Entity>(params).getPage();
-        return page.setRecords(baseMapper.select${className}Page(page, params));
-    }
-
-    @Override
-    public boolean add(${className}Entity ${classname}) {
-        return this.save(${classname});
-    }
-
-    @Override
-    public boolean update(${className}Entity ${classname}) {
-        return this.updateById(${classname});
-    }
-
-    @Override
-    public boolean delete(${pk.attrType} ${pk.attrname}) {
-        return this.removeById(${pk.attrname});
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public boolean deleteBatch(${pk.attrType}[] ${pk.attrname}s) {
-        return this.removeByIds(Arrays.asList(${pk.attrname}s));
-    }
-}

+ 0 - 60
platform-gen/src/main/resources/template/list.html.vm

@@ -1,60 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <title>${comments}</title>
-#set($header='#parse("sys/header.html")')
-#set($save='#if($shiro.hasPermission("'+${pathName}+':save"))')
-#set($update='#if($shiro.hasPermission("'+${pathName}+':update"))')
-#set($delete='#if($shiro.hasPermission("'+${pathName}+':delete"))')
-#set($end='#end')
-    $header
-</head>
-<body>
-<div id="rrapp" v-cloak>
-	<div v-show="showList">
-        <Row :gutter="16">
-            <div class="search-group">
-                <i-col span="4">
-                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
-                </i-col>
-                <i-button @click="query">查询</i-button>
-                <i-button @click="reloadSearch">重置</i-button>
-            </div>
-            <div class="buttons-group">
-                $save
-                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
-                $end
-                $update
-                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
-                $end
-                $delete
-                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
-                $end
-            </div>
-        </Row>
-	    <table id="jqGrid"></table>
-	    <div id="jqGridPager"></div>
-    </div>
-
-    <Card v-show="!showList">
-        <p slot="title">{{title}}</p>
-		<i-form ref="formValidate" :model="${classname}" :rules="ruleValidate" :label-width="80">
-#foreach($column in $columns)
-#if($column.columnName != $pk.columnName)
-            <Form-item label="${column.comments}" prop="${column.attrname}">
-                <i-input v-model="${classname}.${column.attrname}" placeholder="${column.comments}"/>
-            </Form-item>
-#end
-#end
-            <Form-item>
-                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
-                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
-                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
-            </Form-item>
-        </i-form>
-	</Card>
-</div>
-
-<script src="${rc.contextPath}/js/shop/${pathName}.js?_${date.systemTime}"></script>
-</body>
-</html>

+ 0 - 116
platform-gen/src/main/resources/template/list.js.vm

@@ -1,116 +0,0 @@
-$(function () {
-    $("#jqGrid").Grid({
-        url: '../${pathName}/list',
-        colModel: [
-#foreach($column in $columns)
-#if($column.columnName == $pk.columnName)
-			{label: '${column.attrname}', name: '${column.attrname}', index: '${column.columnName}', key: true, hidden: true},
-#else
-			{label: '${column.comments}', name: '${column.attrname}', index: '${column.columnName}', width: 80}#if($velocityCount != $columns.size()),
-#end#end#end
-]
-    });
-});
-
-let vm = new Vue({
-	el: '#rrapp',
-	data: {
-        showList: true,
-        title: null,
-		${classname}: {},
-		ruleValidate: {
-			name: [
-				{required: true, message: '名称不能为空', trigger: 'blur'}
-			]
-		},
-		q: {
-		    name: ''
-		}
-	},
-	methods: {
-		query: function () {
-			vm.reload();
-		},
-		add: function () {
-			vm.showList = false;
-			vm.title = "新增";
-			vm.${classname} = {};
-		},
-		update: function (event) {
-            let $pk.attrname = getSelectedRow("#jqGrid");
-			if ($pk.attrname == null) {
-				return;
-			}
-			vm.showList = false;
-            vm.title = "修改";
-
-            vm.getInfo(${pk.attrname})
-		},
-		saveOrUpdate: function (event) {
-            let url = vm.${classname}.${pk.attrname} == null ? "../${pathName}/save" : "../${pathName}/update";
-            Ajax.request({
-			    url: url,
-                params: JSON.stringify(vm.${classname}),
-                type: "POST",
-			    contentType: "application/json",
-                successCallback: function (r) {
-                    alert('操作成功', function (index) {
-                        vm.reload();
-                    });
-                }
-			});
-		},
-		del: function (event) {
-            let ${pk.attrname}s = getSelectedRows("#jqGrid");
-			if (${pk.attrname}s == null){
-				return;
-			}
-
-			confirm('确定要删除选中的记录?', function () {
-                Ajax.request({
-				    url: "../${pathName}/delete",
-                    params: JSON.stringify(${pk.attrname}s),
-                    type: "POST",
-				    contentType: "application/json",
-                    successCallback: function () {
-                        alert('操作成功', function (index) {
-                            vm.reload();
-                        });
-					}
-				});
-			});
-		},
-		getInfo: function(${pk.attrname}){
-            Ajax.request({
-                url: "../${pathName}/info/"+${pk.attrname},
-                async: true,
-                successCallback: function (r) {
-                    vm.${classname} = r.${classname};
-                }
-            });
-		},
-		reload: function (event) {
-			vm.showList = true;
-            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
-			$("#jqGrid").jqGrid('setGridParam', {
-                postData: {'name': vm.q.name},
-                page: page
-            }).trigger("reloadGrid");
-            vm.handleReset('formValidate');
-		},
-        reloadSearch: function() {
-            vm.q = {
-                name: ''
-            }
-            vm.reload();
-        },
-        handleSubmit: function (name) {
-            handleSubmitValidate(this, name, function () {
-                vm.saveOrUpdate()
-            });
-        },
-        handleReset: function (name) {
-            handleResetForm(this, name);
-        }
-	}
-});

+ 0 - 13
platform-gen/src/main/resources/template/menu.sql.vm

@@ -1,16 +0,0 @@
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    VALUES ('1', '${comments}', '${pre}/${pathName}.html', NULL, '1', 'fa fa-file-code-o', '6');
-
-set @parentId = @@identity;
-
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    SELECT @parentId, '查看', null, '${pathName}:list,${pathName}:info', '2', null, '6';
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    SELECT @parentId, '新增', null, '${pathName}:save', '2', null, '6';
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    SELECT @parentId, '修改', null, '${pathName}:update', '2', null, '6';
-INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
-    SELECT @parentId, '删除', null, '${pathName}:delete', '2', null, '6';

+ 0 - 26
platform-mp/pom.xml

@@ -1,26 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>com.platform</groupId>
-        <artifactId>platform</artifactId>
-        <version>1.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>platform-mp</artifactId>
-    <packaging>jar</packaging>
-    <description>微信公众号</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.platform</groupId>
-            <artifactId>platform-common</artifactId>
-            <version>1.0.0</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.github.binarywang</groupId>
-            <artifactId>weixin-java-mp</artifactId>
-            <version>${weixin-java-mp.version}</version>
-        </dependency>
-    </dependencies>
-
-</project>

+ 0 - 14
platform-mp/src/main/java/com/platform/builder/AbstractBuilder.java

@@ -1,14 +0,0 @@
-package com.platform.builder;
-
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractBuilder {
-    protected final Logger logger = LoggerFactory.getLogger(getClass());
-
-    public abstract WxMpXmlOutMessage build(String content,
-                                            WxMpXmlMessage wxMessage, WeixinService service);
-}

+ 0 - 21
platform-mp/src/main/java/com/platform/builder/ImageBuilder.java

@@ -1,21 +0,0 @@
-package com.platform.builder;
-
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-
-public class ImageBuilder extends AbstractBuilder {
-
-    @Override
-    public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage,
-                                   WeixinService service) {
-
-        WxMpXmlOutImageMessage m = WxMpXmlOutMessage.IMAGE().mediaId(content)
-                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
-                .build();
-
-        return m;
-    }
-
-}

+ 0 - 19
platform-mp/src/main/java/com/platform/builder/TextBuilder.java

@@ -1,19 +0,0 @@
-package com.platform.builder;
-
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutTextMessage;
-
-public class TextBuilder extends AbstractBuilder {
-
-    @Override
-    public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage,
-                                   WeixinService service) {
-        WxMpXmlOutTextMessage m = WxMpXmlOutMessage.TEXT().content(content)
-                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
-                .build();
-        return m;
-    }
-
-}

+ 0 - 148
platform-mp/src/main/java/com/platform/controller/MpMenuController.java

@@ -1,148 +0,0 @@
-package com.platform.controller;
-
-import com.platform.service.MpMenuService;
-import com.platform.utils.R;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.bean.menu.WxMenu;
-import me.chanjar.weixin.common.bean.menu.WxMenuButton;
-import me.chanjar.weixin.mp.bean.menu.WxMpGetSelfMenuInfoResult;
-import me.chanjar.weixin.mp.bean.menu.WxMpMenu;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * 公众号菜单Controller
- *
- * @author liepngjun
- * @email 939961241@qq.com
- * @date 2018-10-30 13:01:47
- */
-@Controller
-@RequestMapping("/mp/menu")
-public class MpMenuController {
-    @Autowired
-    private MpMenuService mpMenuService;
-
-    @GetMapping("/create")
-    @ResponseBody
-    public String menuCreate(@RequestBody WxMenu wxMenu) throws Exception {
-        return mpMenuService.menuCreate(wxMenu);
-    }
-
-    @GetMapping("/menuCreateSample")
-    @ResponseBody
-    public String menuCreateSample() throws Exception {
-        return mpMenuService.menuCreate(initMenu());
-    }
-
-    /**
-     * 初始化菜单,
-     * TODO 后面可以考虑把菜单存入数据库来维护
-     *
-     * @return
-     */
-    public WxMenu initMenu() {
-        WxMenuButton mainBtn1 = new WxMenuButton();
-        mainBtn1.setName("官网");
-        mainBtn1.setType(WxConsts.MenuButtonType.VIEW);
-        mainBtn1.setUrl("http://fly2you.cn");
-
-        WxMenuButton btn21 = new WxMenuButton();
-        btn21.setName("便利主义超市");
-        btn21.setType(WxConsts.MenuButtonType.MINIPROGRAM);
-        btn21.setUrl("http://mp.weixin.qq.com");
-        btn21.setAppId("wx2a601dffd92609df");
-        btn21.setPagePath("/pages/index/index");
-
-        WxMenuButton btn22 = new WxMenuButton();
-        btn22.setName("海数据在线");
-        btn22.setType(WxConsts.MenuButtonType.MINIPROGRAM);
-        btn22.setUrl("http://mp.weixin.qq.com");
-        btn22.setAppId("wx69de7e7034266a70");
-        btn22.setPagePath("/pages/index/index");
-
-        WxMenuButton mainBtn2 = new WxMenuButton();
-        mainBtn2.setName("客户案例");
-        mainBtn2.getSubButtons().add(btn21);
-        mainBtn2.getSubButtons().add(btn22);
-
-        WxMenuButton btn31 = new WxMenuButton();
-        btn31.setName("历史消息");
-        btn31.setType(WxConsts.MenuButtonType.VIEW);
-        btn31.setUrl("https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIxMTc5MzUyMQ==#wechat_redirect");
-
-        WxMenuButton btn32 = new WxMenuButton();
-        btn32.setName("商务合作");
-        btn32.setType(WxConsts.MenuButtonType.VIEW);
-        btn32.setUrl("https://mp.weixin.qq.com/s/srJyUVzwK6wGwGFCQFch1A");
-
-        WxMenuButton btn33 = new WxMenuButton();
-        btn33.setName("更多资讯");
-        btn33.setType(WxConsts.MenuButtonType.VIEW);
-        btn33.setUrl("http://mp.weixin.qq.com/mp/homepage?__biz=MzIxMTc5MzUyMQ==&hid=1&sn=f8765358ef19c3423224069d333be5bf&scene=18#wechat_redirect");
-
-        WxMenuButton btn34 = new WxMenuButton();
-        btn34.setName("曾获荣誉");
-        btn34.setType(WxConsts.MenuButtonType.VIEW);
-        btn34.setUrl("https://mp.weixin.qq.com/s/5mbU7Kp2TavasrZhfOUc7w");
-
-        WxMenuButton mainBtn3 = new WxMenuButton();
-        mainBtn3.setName("更多");
-        mainBtn3.getSubButtons().add(btn31);
-        mainBtn3.getSubButtons().add(btn32);
-        mainBtn3.getSubButtons().add(btn33);
-        mainBtn3.getSubButtons().add(btn34);
-
-        WxMenu menu = new WxMenu();
-        menu.getButtons().add(mainBtn1);
-        menu.getButtons().add(mainBtn2);
-        menu.getButtons().add(mainBtn3);
-        return menu;
-    }
-
-    @GetMapping("/create/{json}")
-    @ResponseBody
-    public String menuCreate(@PathVariable String json) throws Exception {
-        return mpMenuService.menuCreate(json);
-    }
-
-    @GetMapping("/delete")
-    public void menuDelete() throws Exception {
-        mpMenuService.menuDelete();
-    }
-
-    @GetMapping("/delete/{menuId}")
-    public void menuDelete(@PathVariable String menuId) throws Exception {
-        mpMenuService.menuDelete(menuId);
-    }
-
-    @GetMapping("/get")
-    @ResponseBody
-    public WxMpMenu menuGet() throws Exception {
-        return mpMenuService.menuGet();
-    }
-
-    @GetMapping("/menuTryMatch/{userid}")
-    @ResponseBody
-    public WxMenu menuTryMatch(@PathVariable String userid) throws Exception {
-        return mpMenuService.menuTryMatch(userid);
-    }
-
-    @GetMapping("/getSelfMenuInfo")
-    @ResponseBody
-    public WxMpGetSelfMenuInfoResult getSelfMenuInfo() throws Exception {
-        return mpMenuService.getSelfMenuInfo();
-    }
-
-    /**
-     * 获取本地设置的菜单
-     *
-     * @return
-     */
-    @RequestMapping("/getMenu")
-    @ResponseBody
-    public R getMenu() {
-        return R.ok().put("menu", initMenu());
-    }
-}

+ 0 - 46
platform-mp/src/main/java/com/platform/entity/WxMenuKey.java

@@ -1,46 +0,0 @@
-package com.platform.entity;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * 菜单的dto对象
- *
- * @author liepngjun
- * @email 939961241@qq.com
- * @date 2018-12-16 13:01:47
- */
-public class WxMenuKey {
-    private String type;
-    private String content;
-
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public WxMenuKey() {
-
-    }
-
-    public WxMenuKey(String type, String content) {
-        this.type = type;
-        this.content = content;
-    }
-
-    public String getType() {
-        return this.type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getContent() {
-        return this.content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-}

+ 0 - 11
platform-mp/src/main/java/com/platform/handler/AbstractHandler.java

@@ -1,11 +0,0 @@
-package com.platform.handler;
-
-import com.google.gson.Gson;
-import me.chanjar.weixin.mp.api.WxMpMessageHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractHandler implements WxMpMessageHandler {
-    protected Logger logger = LoggerFactory.getLogger(getClass());
-    protected final Gson gson = new Gson();
-}

+ 0 - 22
platform-mp/src/main/java/com/platform/handler/KfSessionHandler.java

@@ -1,22 +0,0 @@
-package com.platform.handler;
-
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class KfSessionHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        //TODO 对会话做处理
-        return null;
-    }
-
-}

+ 0 - 42
platform-mp/src/main/java/com/platform/handler/LocationHandler.java

@@ -1,42 +0,0 @@
-package com.platform.handler;
-
-import com.platform.builder.TextBuilder;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class LocationHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        if (wxMessage.getMsgType().equals(WxConsts.XmlMsgType.LOCATION)) {
-            //TODO 接收处理用户发送的地理位置消息
-            try {
-                String content = "感谢反馈,您的的地理位置已收到!";
-                return new TextBuilder().build(content, wxMessage, null);
-            } catch (Exception e) {
-                this.logger.error("位置消息接收处理失败", e);
-                return null;
-            }
-        }
-
-        //上报地理位置事件
-        this.logger.info("\n上报地理位置 。。。 ");
-        this.logger.info("\n纬度 : " + wxMessage.getLatitude());
-        this.logger.info("\n经度 : " + wxMessage.getLongitude());
-        this.logger.info("\n精度 : " + String.valueOf(wxMessage.getPrecision()));
-
-        //TODO  可以将用户地理位置信息保存到本地数据库,以便以后使用
-
-        return null;
-    }
-
-}

+ 0 - 37
platform-mp/src/main/java/com/platform/handler/LogHandler.java

@@ -1,37 +0,0 @@
-package com.platform.handler;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class LogHandler extends AbstractHandler {
-    private static final ObjectMapper JSON = new ObjectMapper();
-
-    static {
-        JSON.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        JSON.configure(SerializationFeature.INDENT_OUTPUT, Boolean.TRUE);
-    }
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        try {
-            this.logger.info("\n接收到请求消息,内容:{}", JSON.writeValueAsString(wxMessage));
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-}

+ 0 - 65
platform-mp/src/main/java/com/platform/handler/MenuHandler.java

@@ -1,65 +0,0 @@
-package com.platform.handler;
-
-import com.alibaba.fastjson.JSON;
-import com.platform.builder.AbstractBuilder;
-import com.platform.builder.ImageBuilder;
-import com.platform.builder.TextBuilder;
-import com.platform.entity.WxMenuKey;
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class MenuHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        WeixinService weixinService = (WeixinService) wxMpService;
-
-        String key = wxMessage.getEventKey();
-        WxMenuKey menuKey;
-        try {
-            menuKey = JSON.parseObject(key, WxMenuKey.class);
-        } catch (Exception e) {
-            return WxMpXmlOutMessage.TEXT().content(key)
-                    .fromUser(wxMessage.getToUser())
-                    .toUser(wxMessage.getFromUser()).build();
-        }
-
-        AbstractBuilder builder = null;
-        switch (menuKey.getType()) {
-            case WxConsts.XmlMsgType.TEXT:
-                builder = new TextBuilder();
-                break;
-            case WxConsts.XmlMsgType.IMAGE:
-                builder = new ImageBuilder();
-                break;
-            case WxConsts.XmlMsgType.VOICE:
-                break;
-            case WxConsts.XmlMsgType.VIDEO:
-                break;
-            case WxConsts.XmlMsgType.NEWS:
-                break;
-            default:
-                break;
-        }
-
-        if (builder != null) {
-            try {
-                return builder.build(menuKey.getContent(), wxMessage, weixinService);
-            } catch (Exception e) {
-                this.logger.error(e.getMessage(), e);
-            }
-        }
-
-        return null;
-    }
-}

+ 0 - 121
platform-mp/src/main/java/com/platform/handler/MsgHandler.java

@@ -1,121 +0,0 @@
-package com.platform.handler;
-
-import com.platform.builder.TextBuilder;
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class MsgHandler extends AbstractHandler {
-    private static final Logger LOGGER = LoggerFactory.getLogger(MsgHandler.class);
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-
-        WeixinService weixinService = (WeixinService) wxMpService;
-
-        if (!wxMessage.getMsgType().equals(WxConsts.XmlMsgType.EVENT)) {
-            //TODO 可以选择将消息保存到本地
-        }
-
-        //当用户输入关键词如“你好”,“客服”等,并且有客服在线时,把消息转发给在线客服
-        if (StringUtils.startsWithAny(wxMessage.getContent(), "你好", "客服")
-                && weixinService.hasKefuOnline()) {
-            return WxMpXmlOutMessage
-                    .TRANSFER_CUSTOMER_SERVICE().fromUser(wxMessage.getToUser())
-                    .toUser(wxMessage.getFromUser()).build();
-        }
-
-        switch (wxMessage.getContent()) {
-            case "签到表单":
-                return sendInSignMessage(wxMessage, context, wxMpService, sessionManager);
-            case "发送弹幕":
-                return handleDanmu(wxMessage, context, wxMpService, sessionManager);
-            case "年会节目单":
-                return handleContent(wxMessage, context, wxMpService, sessionManager);
-            case "投票":
-                return handleVote(wxMessage, context, wxMpService, sessionManager);
-            default:
-                String content = "回复信息内容";
-                return new TextBuilder().build(content, wxMessage, weixinService);
-        }
-    }
-
-    private WxMpXmlOutNewsMessage sendInSignMessage(WxMpXmlMessage wxMessage,
-                                                    Map<String, Object> context, WxMpService wxMpService,
-                                                    WxSessionManager sessionManager) {
-
-        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
-        item.setDescription("签到表单");
-        item.setPicUrl("https://mmbiz.qlogo.cn/mmbiz_jpg/rFTQWsGze4G89XqNehSdSBGt1ic6ricfgBvaxnXGhsicia3xhIaKJB0hWMIqDXqLXC3OmBKnwfMiaXaBbrECialjOJiaQ/0?wx_fmt=jpeg");
-        item.setTitle("签到");
-        item.setUrl("https://fly2you.cn");
-
-        WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
-                .fromUser(wxMessage.getToUser())
-                .toUser(wxMessage.getFromUser())
-                .addArticle(item)
-                .build();
-        return m;
-    }
-
-    private WxMpXmlOutMessage handleDanmu(WxMpXmlMessage wxMessage, Map<String, Object> context,
-                                          WxMpService wxMpService, WxSessionManager sessionManager) {
-        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
-        item.setDescription("发送弹幕");
-        item.setPicUrl("https://mmbiz.qlogo.cn/mmbiz_jpg/rFTQWsGze4G89XqNehSdSBGt1ic6ricfgBfr8ThJnpIIibwpPhGjGrKpraiaNULFLfv238cC3sIxgCYZza6TYLKicBg/0?wx_fmt=jpeg");
-        item.setTitle("评论上墙");
-        item.setUrl("https://fly2you.cn");
-
-        WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
-                .fromUser(wxMessage.getToUser())
-                .toUser(wxMessage.getFromUser())
-                .addArticle(item)
-                .build();
-        return m;
-    }
-
-    private WxMpXmlOutMessage handleContent(WxMpXmlMessage wxMessage, Map<String, Object> context,
-                                            WxMpService wxMpService, WxSessionManager sessionManager) {
-        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
-        item.setDescription("年会节目单");
-        item.setPicUrl("https://mmbiz.qlogo.cn/mmbiz/bVoOkrvEGHqgetjIc7VcFoCWgLCNaTOnZaXvR9J04EgxMfbm3WM9OreMfTcMcKN8UFkWtDwUbiatU7Qtxsutglg/0?wx_fmt=png");
-        item.setTitle("节目单");
-        item.setUrl("https://fly2you.cn");
-
-        WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
-                .fromUser(wxMessage.getToUser())
-                .toUser(wxMessage.getFromUser())
-                .addArticle(item)
-                .build();
-        return m;
-    }
-
-    private WxMpXmlOutMessage handleVote(WxMpXmlMessage wxMessage, Map<String, Object> context,
-                                         WxMpService wxMpService, WxSessionManager sessionManager) {
-        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
-        item.setDescription("来投票吧");
-        item.setPicUrl("https://mmbiz.qlogo.cn/mmbiz_jpg/rFTQWsGze4EdewBW92AAD6Ap8ydAQrgBnndVMdAIXB4CmGiaGiassibiaKhWID6icmdMg3kvWSejFd5omyUdjcvb0GA/0?wx_fmt=jpeg");
-        item.setTitle("投票");
-        item.setUrl("https://fly2you.cn");
-
-        WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
-                .fromUser(wxMessage.getToUser())
-                .toUser(wxMessage.getFromUser())
-                .addArticle(item)
-                .build();
-        return m;
-    }
-}

+ 0 - 21
platform-mp/src/main/java/com/platform/handler/NullHandler.java

@@ -1,21 +0,0 @@
-package com.platform.handler;
-
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class NullHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        return null;
-    }
-
-}

+ 0 - 22
platform-mp/src/main/java/com/platform/handler/StoreCheckNotifyHandler.java

@@ -1,22 +0,0 @@
-package com.platform.handler;
-
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class StoreCheckNotifyHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        // TODO 处理门店审核事件
-        return null;
-    }
-
-}

+ 0 - 61
platform-mp/src/main/java/com/platform/handler/SubscribeHandler.java

@@ -1,61 +0,0 @@
-package com.platform.handler;
-
-import com.platform.builder.TextBuilder;
-import com.platform.service.WeixinService;
-import me.chanjar.weixin.common.error.WxErrorException;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import me.chanjar.weixin.mp.bean.result.WxMpUser;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class SubscribeHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) throws WxErrorException {
-
-        this.logger.info("新关注用户 OPENID: " + wxMessage.getFromUser());
-
-        WeixinService weixinService = (WeixinService) wxMpService;
-
-        // 获取微信用户基本信息
-        WxMpUser userWxInfo = weixinService.getUserService().userInfo(wxMessage.getFromUser(), null);
-
-        if (userWxInfo != null) {
-            // TODO 可以添加关注用户到本地
-        }
-
-        WxMpXmlOutMessage responseResult = null;
-        try {
-            responseResult = handleSpecial(wxMessage);
-        } catch (Exception e) {
-            this.logger.error(e.getMessage(), e);
-        }
-
-        if (responseResult != null) {
-            return responseResult;
-        }
-
-        try {
-            return new TextBuilder().build("感谢关注", wxMessage, weixinService);
-        } catch (Exception e) {
-            this.logger.error(e.getMessage(), e);
-        }
-
-        return null;
-    }
-
-    /**
-     * 处理特殊请求,比如如果是扫码进来的,可以做相应处理
-     */
-    protected WxMpXmlOutMessage handleSpecial(WxMpXmlMessage wxMessage) throws Exception {
-        //TODO
-        return null;
-    }
-
-}

+ 0 - 24
platform-mp/src/main/java/com/platform/handler/UnsubscribeHandler.java

@@ -1,24 +0,0 @@
-package com.platform.handler;
-
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import org.springframework.stereotype.Component;
-
-import java.util.Map;
-
-@Component
-public class UnsubscribeHandler extends AbstractHandler {
-
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService wxMpService,
-                                    WxSessionManager sessionManager) {
-        String openId = wxMessage.getFromUser();
-        this.logger.info("取消关注用户 OPENID: " + openId);
-        // TODO 可以更新本地数据库为取消关注状态
-        return null;
-    }
-
-}

+ 0 - 13
platform-mp/src/main/java/com/platform/service/MpMenuService.java

@@ -1,13 +0,0 @@
-package com.platform.service;
-
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.api.impl.WxMpMenuServiceImpl;
-import org.springframework.stereotype.Service;
-
-@Service("mpMenuService")
-public class MpMenuService extends WxMpMenuServiceImpl {
-
-    public MpMenuService(WxMpService wxMpService) {
-        super(wxMpService);
-    }
-}

+ 0 - 177
platform-mp/src/main/java/com/platform/service/WeixinService.java

@@ -1,177 +0,0 @@
-package com.platform.service;
-
-import com.platform.handler.*;
-import com.platform.utils.ResourceUtil;
-import me.chanjar.weixin.common.api.WxConsts;
-import me.chanjar.weixin.common.api.WxConsts.EventType;
-import me.chanjar.weixin.common.api.WxConsts.MenuButtonType;
-import me.chanjar.weixin.common.api.WxConsts.XmlMsgType;
-import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
-import me.chanjar.weixin.mp.api.WxMpMessageRouter;
-import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
-import me.chanjar.weixin.mp.bean.kefu.result.WxMpKfOnlineList;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import me.chanjar.weixin.mp.constant.WxMpEventConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-
-@Service("weixinService")
-public class WeixinService extends WxMpServiceImpl {
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    protected LogHandler logHandler;
-
-    @Autowired
-    protected NullHandler nullHandler;
-
-    @Autowired
-    protected KfSessionHandler kfSessionHandler;
-
-    @Autowired
-    protected StoreCheckNotifyHandler storeCheckNotifyHandler;
-
-    @Autowired
-    private LocationHandler locationHandler;
-
-    @Autowired
-    private MenuHandler menuHandler;
-
-    @Autowired
-    private MsgHandler msgHandler;
-
-    @Autowired
-    private UnsubscribeHandler unsubscribeHandler;
-
-    @Autowired
-    private SubscribeHandler subscribeHandler;
-
-    private WxMpMessageRouter router;
-
-    @PostConstruct
-    public void init() {
-        final WxMpInMemoryConfigStorage config = new WxMpInMemoryConfigStorage();
-        // 设置微信公众号的appid
-        config.setAppId(ResourceUtil.getConfigByName("mp.appId"));
-        // 设置微信公众号的app corpSecret
-        config.setSecret(ResourceUtil.getConfigByName("mp.secret"));
-        // 设置微信公众号的token
-        config.setToken(ResourceUtil.getConfigByName("mp.token"));
-        // 设置消息加解密密钥
-        config.setAesKey(ResourceUtil.getConfigByName("mp.aesKey"));
-        super.setWxMpConfigStorage(config);
-
-        this.refreshRouter();
-    }
-
-    private void refreshRouter() {
-        final WxMpMessageRouter newRouter = new WxMpMessageRouter(this);
-
-        // 记录所有事件的日志
-        newRouter.rule().handler(this.logHandler).next();
-
-        // 接收客服会话管理事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxMpEventConstants.CustomerService.KF_CREATE_SESSION)
-                .handler(this.kfSessionHandler).end();
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxMpEventConstants.CustomerService.KF_CLOSE_SESSION)
-                .handler(this.kfSessionHandler).end();
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxMpEventConstants.CustomerService.KF_SWITCH_SESSION)
-                .handler(this.kfSessionHandler).end();
-
-        // 门店审核事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxMpEventConstants.POI_CHECK_NOTIFY)
-                .handler(this.storeCheckNotifyHandler)
-                .end();
-
-        // 自定义菜单事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(WxConsts.MenuButtonType.CLICK).handler(this.getMenuHandler()).end();
-
-        // 点击菜单连接事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(MenuButtonType.VIEW).handler(this.nullHandler).end();
-
-        // 关注事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(EventType.SUBSCRIBE).handler(this.getSubscribeHandler())
-                .end();
-
-        // 取消关注事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(EventType.UNSUBSCRIBE).handler(this.getUnsubscribeHandler())
-                .end();
-
-        // 上报地理位置事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(EventType.LOCATION).handler(this.getLocationHandler()).end();
-
-        // 接收地理位置消息
-        newRouter.rule().async(false).msgType(XmlMsgType.LOCATION)
-                .handler(this.getLocationHandler()).end();
-
-        // 扫码事件
-        newRouter.rule().async(false).msgType(XmlMsgType.EVENT)
-                .event(EventType.SCAN).handler(this.getScanHandler()).end();
-
-        // 默认
-        newRouter.rule().async(false).handler(this.getMsgHandler()).end();
-
-        this.router = newRouter;
-    }
-
-
-    public WxMpXmlOutMessage route(WxMpXmlMessage message) {
-        try {
-            return this.router.route(message);
-        } catch (Exception e) {
-            this.logger.error(e.getMessage(), e);
-        }
-
-        return null;
-    }
-
-    public boolean hasKefuOnline() {
-        try {
-            WxMpKfOnlineList kfOnlineList = this.getKefuService().kfOnlineList();
-            return kfOnlineList != null && kfOnlineList.getKfOnlineList().size() > 0;
-        } catch (Exception e) {
-            this.logger.error("获取客服在线状态异常: " + e.getMessage(), e);
-        }
-
-        return false;
-    }
-
-    protected MenuHandler getMenuHandler() {
-        return this.menuHandler;
-    }
-
-    protected SubscribeHandler getSubscribeHandler() {
-        return this.subscribeHandler;
-    }
-
-    protected UnsubscribeHandler getUnsubscribeHandler() {
-        return this.unsubscribeHandler;
-    }
-
-    protected AbstractHandler getLocationHandler() {
-        return this.locationHandler;
-    }
-
-    protected MsgHandler getMsgHandler() {
-        return this.msgHandler;
-    }
-
-    protected AbstractHandler getScanHandler() {
-        return null;
-    }
-
-}

+ 0 - 34
platform-schedule/pom.xml

@@ -1,34 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>com.platform</groupId>
-        <artifactId>platform</artifactId>
-        <version>1.0.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>platform-schedule</artifactId>
-    <packaging>jar</packaging>
-    <description>定时任务模块</description>
-
-    <properties>
-        <quartz-version>2.2.3</quartz-version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.platform</groupId>
-            <artifactId>platform-common</artifactId>
-            <version>1.0.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.quartz-scheduler</groupId>
-            <artifactId>quartz</artifactId>
-            <version>${quartz-version}</version>
-            <exclusions>
-                <exclusion>
-                    <artifactId>c3p0</artifactId>
-                    <groupId>c3p0</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 149
platform-schedule/src/main/java/com/platform/controller/ScheduleJobController.java

@@ -1,149 +0,0 @@
-package com.platform.controller;
-
-import com.platform.annotation.SysLog;
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.service.ScheduleJobService;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.R;
-import com.platform.validator.ValidatorUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Map;
-
-/**
- * 定时任务
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月28日 下午2:16:40
- */
-@RestController
-@RequestMapping("/sys/schedule")
-public class ScheduleJobController {
-    @Autowired
-    private ScheduleJobService scheduleJobService;
-
-    /**
-     * 分页查询定时任务
-     *
-     * @param params 查询参数
-     * @return R
-     */
-    @GetMapping("/list")
-    @RequiresPermissions("sys:schedule:list")
-    public R list(@RequestParam Map<String, Object> params) {
-        PageUtilsPlus pageUtil = scheduleJobService.queryPage(params);
-        return R.ok().put("page", pageUtil);
-    }
-
-    /**
-     * 根据主键查询详情
-     *
-     * @param jobId 主键
-     * @return R
-     */
-    @GetMapping("/info/{jobId}")
-    @RequiresPermissions("sys:schedule:info")
-    public R info(@PathVariable("jobId") Long jobId) {
-        ScheduleJobEntity schedule = scheduleJobService.getById(jobId);
-
-        return R.ok().put("schedule", schedule);
-    }
-
-    /**
-     * 新增定时任务
-     *
-     * @param scheduleJob scheduleJob
-     * @return R
-     */
-    @SysLog("新增定时任务")
-    @PostMapping("/save")
-    @RequiresPermissions("sys:schedule:save")
-    public R save(@RequestBody ScheduleJobEntity scheduleJob) {
-        ValidatorUtils.validateEntity(scheduleJob);
-
-        scheduleJobService.add(scheduleJob);
-
-        return R.ok();
-    }
-
-    /**
-     * 修改定时任务
-     *
-     * @param scheduleJob scheduleJob
-     * @return R
-     */
-    @SysLog("修改定时任务")
-    @PostMapping("/update")
-    @RequiresPermissions("sys:schedule:update")
-    public R update(@RequestBody ScheduleJobEntity scheduleJob) {
-        ValidatorUtils.validateEntity(scheduleJob);
-
-        scheduleJobService.update(scheduleJob);
-
-        return R.ok();
-    }
-
-    /**
-     * 删除定时任务
-     *
-     * @param jobIds jobIds
-     * @return R
-     */
-    @SysLog("删除定时任务")
-    @PostMapping("/delete")
-    @RequiresPermissions("sys:schedule:delete")
-    public R delete(@RequestBody Long[] jobIds) {
-        scheduleJobService.deleteBatch(jobIds);
-
-        return R.ok();
-    }
-
-    /**
-     * 立即执行任务
-     *
-     * @param jobIds jobIds
-     * @return R
-     */
-    @SysLog("立即执行任务")
-    @PostMapping("/run")
-    @RequiresPermissions("sys:schedule:run")
-    public R run(@RequestBody Long[] jobIds) {
-        scheduleJobService.run(jobIds);
-
-        return R.ok();
-    }
-
-    /**
-     * 暂停定时任务
-     *
-     * @param jobIds jobIds
-     * @return R
-     */
-    @SysLog("暂停定时任务")
-    @PostMapping("/pause")
-    @RequiresPermissions("sys:schedule:pause")
-    public R pause(@RequestBody Long[] jobIds) {
-        scheduleJobService.pause(jobIds);
-
-        return R.ok();
-    }
-
-    /**
-     * 恢复定时任务
-     *
-     * @param jobIds jobIds
-     * @return R
-     */
-    @SysLog("恢复定时任务")
-    @PostMapping("/resume")
-    @RequiresPermissions("sys:schedule:resume")
-    public R resume(@RequestBody Long[] jobIds) {
-        scheduleJobService.resume(jobIds);
-
-        return R.ok();
-    }
-
-}

+ 0 - 52
platform-schedule/src/main/java/com/platform/controller/ScheduleJobLogController.java

@@ -1,52 +0,0 @@
-package com.platform.controller;
-
-import com.platform.entity.ScheduleJobLogEntity;
-import com.platform.service.ScheduleJobLogService;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.R;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Map;
-
-/**
- * 定时任务日志
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月1日 下午10:39:52
- */
-@RestController
-@RequestMapping("/sys/scheduleLog")
-public class ScheduleJobLogController {
-    @Autowired
-    private ScheduleJobLogService scheduleJobLogService;
-
-    /**
-     * 分页查询定时任务日志
-     *
-     * @param params 查询参数
-     * @return R
-     */
-    @GetMapping("/list")
-    @RequiresPermissions("sys:schedule:log")
-    public R list(@RequestParam Map<String, Object> params) {
-        PageUtilsPlus page = scheduleJobLogService.queryPage(params);
-
-        return R.ok().put("page", page);
-    }
-
-    /**
-     * 根据主键查询详情
-     *
-     * @param logId logId
-     * @return R
-     */
-    @GetMapping("/info/{logId}")
-    public R info(@PathVariable("logId") Long logId) {
-        ScheduleJobLogEntity log = scheduleJobLogService.getById(logId);
-
-        return R.ok().put("log", log);
-    }
-}

+ 0 - 38
platform-schedule/src/main/java/com/platform/dao/ScheduleJobDao.java

@@ -1,38 +0,0 @@
-package com.platform.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.platform.entity.ScheduleJobEntity;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 定时任务
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年12月1日 下午10:29:57
- */
-@Mapper
-public interface ScheduleJobDao extends BaseMapper<ScheduleJobEntity> {
-
-    /**
-     * 批量更新状态
-     *
-     * @param map map
-     * @return int
-     */
-    int updateBatch(Map<String, Object> map);
-
-    /**
-     * 自定义分页查询
-     *
-     * @param page   分页参数
-     * @param params 查询参数
-     * @return List
-     */
-    List<ScheduleJobEntity> selectScheduleJobPage(IPage page, @Param("params") Map<String, Object> params);
-}

+ 0 - 29
platform-schedule/src/main/java/com/platform/dao/ScheduleJobLogDao.java

@@ -1,29 +0,0 @@
-package com.platform.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.platform.entity.ScheduleJobLogEntity;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 定时任务日志Dao
- *
- * @author 李鹏军
- * @date 2019-01-22 10:13:48
- */
-@Mapper
-public interface ScheduleJobLogDao extends BaseMapper<ScheduleJobLogEntity> {
-
-    /**
-     * 自定义分页查询
-     *
-     * @param page   分页参数
-     * @param params 查询参数
-     * @return List
-     */
-    List<ScheduleJobLogEntity> selectScheduleJobLogPage(IPage page, @Param("params") Map<String, Object> params);
-}

+ 0 - 71
platform-schedule/src/main/java/com/platform/entity/ScheduleJobEntity.java

@@ -1,71 +0,0 @@
-package com.platform.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-import org.hibernate.validator.constraints.NotBlank;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * 定时器
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月28日 下午12:54:44
- */
-@Data
-@TableName("SCHEDULE_JOB")
-public class ScheduleJobEntity implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 任务调度参数key
-     */
-    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";
-
-    /**
-     * 任务id
-     */
-    @TableId
-    private Long jobId;
-
-    /**
-     * spring bean名称
-     */
-    @NotBlank(message = "bean名称不能为空")
-    private String beanName;
-
-    /**
-     * 方法名
-     */
-    @NotBlank(message = "方法名称不能为空")
-    private String methodName;
-
-    /**
-     * 参数
-     */
-    private String params;
-
-    /**
-     * cron表达式
-     */
-    @NotBlank(message = "cron表达式不能为空")
-    private String cronExpression;
-
-    /**
-     * 任务状态
-     */
-    private Integer status;
-
-    /**
-     * 备注
-     */
-    private String remark;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-}

+ 0 - 65
platform-schedule/src/main/java/com/platform/entity/ScheduleJobLogEntity.java

@@ -1,65 +0,0 @@
-package com.platform.entity;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * 定时任务日志
- *
- * @author 李鹏军
- */
-@Data
-@TableName("SCHEDULE_JOB_LOG")
-public class ScheduleJobLogEntity implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 日志id
-     */
-    @TableId
-    private Long logId;
-
-    /**
-     * 任务id
-     */
-    private Long jobId;
-
-    /**
-     * spring bean名称
-     */
-    private String beanName;
-
-    /**
-     * 方法名
-     */
-    private String methodName;
-
-    /**
-     * 参数
-     */
-    private String params;
-
-    /**
-     * 任务状态    0:成功    1:失败
-     */
-    private Integer status;
-
-    /**
-     * 失败信息
-     */
-    private String error;
-
-    /**
-     * 耗时(单位:毫秒)
-     */
-    private Integer times;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-}

+ 0 - 23
platform-schedule/src/main/java/com/platform/service/ScheduleJobLogService.java

@@ -1,23 +0,0 @@
-package com.platform.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.platform.entity.ScheduleJobLogEntity;
-import com.platform.utils.PageUtilsPlus;
-
-import java.util.Map;
-
-/**
- * 定时任务日志
- *
- * @author 李鹏军
- */
-public interface ScheduleJobLogService extends IService<ScheduleJobLogEntity> {
-
-    /**
-     * 获取分页数据
-     *
-     * @param params 查询参数
-     * @return Page
-     */
-    PageUtilsPlus queryPage(Map<String, Object> params);
-}

+ 0 - 73
platform-schedule/src/main/java/com/platform/service/ScheduleJobService.java

@@ -1,73 +0,0 @@
-package com.platform.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.utils.PageUtilsPlus;
-
-import java.util.Map;
-
-/**
- * 定时任务
- *
- * @author 李鹏军
- */
-public interface ScheduleJobService extends IService<ScheduleJobEntity> {
-
-    /**
-     * 获取分页数据
-     *
-     * @param params 查询参数
-     * @return Page
-     */
-    PageUtilsPlus queryPage(Map<String, Object> params);
-
-    /**
-     * 新增定时任务
-     *
-     * @param scheduleJob scheduleJob
-     */
-    void add(ScheduleJobEntity scheduleJob);
-
-    /**
-     * 更新定时任务
-     *
-     * @param scheduleJob scheduleJob
-     */
-    void update(ScheduleJobEntity scheduleJob);
-
-    /**
-     * 批量删除定时任务
-     *
-     * @param jobIds jobIds
-     */
-    void deleteBatch(Long[] jobIds);
-
-    /**
-     * 批量更新定时任务状态
-     *
-     * @param jobIds jobIds
-     * @param status status
-     */
-    void updateBatch(Long[] jobIds, int status);
-
-    /**
-     * 立即执行
-     *
-     * @param jobIds jobIds
-     */
-    void run(Long[] jobIds);
-
-    /**
-     * 暂停运行
-     *
-     * @param jobIds jobIds
-     */
-    void pause(Long[] jobIds);
-
-    /**
-     * 恢复运行
-     *
-     * @param jobIds jobIds
-     */
-    void resume(Long[] jobIds);
-}

+ 0 - 28
platform-schedule/src/main/java/com/platform/service/impl/ScheduleJobLogServiceImpl.java

@@ -1,28 +0,0 @@
-package com.platform.service.impl;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.platform.dao.ScheduleJobLogDao;
-import com.platform.entity.ScheduleJobLogEntity;
-import com.platform.service.ScheduleJobLogService;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.QueryPlus;
-import org.springframework.stereotype.Service;
-
-import java.util.Map;
-
-/**
- * @author 李鹏军
- */
-@Service("scheduleJobLogService")
-public class ScheduleJobLogServiceImpl extends ServiceImpl<ScheduleJobLogDao, ScheduleJobLogEntity> implements ScheduleJobLogService {
-
-    @Override
-    public PageUtilsPlus queryPage(Map<String, Object> params) {
-        //排序
-        params.put("sidx", "T.CREATE_TIME");
-        params.put("asc", false);
-        Page<ScheduleJobLogEntity> page = new QueryPlus<ScheduleJobLogEntity>(params).getPage();
-        return new PageUtilsPlus(page.setRecords(baseMapper.selectScheduleJobLogPage(page, params)));
-    }
-}

+ 0 - 121
platform-schedule/src/main/java/com/platform/service/impl/ScheduleJobServiceImpl.java

@@ -1,121 +0,0 @@
-package com.platform.service.impl;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.platform.dao.ScheduleJobDao;
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.service.ScheduleJobService;
-import com.platform.utils.Constant;
-import com.platform.utils.PageUtilsPlus;
-import com.platform.utils.QueryPlus;
-import com.platform.utils.ScheduleUtils;
-import org.quartz.CronTrigger;
-import org.quartz.Scheduler;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.PostConstruct;
-import java.util.*;
-
-/**
- * @author 李鹏军
- */
-@Service("scheduleJobService")
-public class ScheduleJobServiceImpl extends ServiceImpl<ScheduleJobDao, ScheduleJobEntity> implements ScheduleJobService {
-    @Autowired
-    private Scheduler scheduler;
-
-    /**
-     * 项目启动时,初始化定时器
-     */
-    @PostConstruct
-    public void init() {
-        List<ScheduleJobEntity> scheduleJobList = this.list();
-        for (ScheduleJobEntity scheduleJob : scheduleJobList) {
-            CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getJobId());
-            //如果不存在,则创建
-            if (cronTrigger == null) {
-                ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
-            } else {
-                ScheduleUtils.updateScheduleJob(scheduler, scheduleJob);
-            }
-        }
-    }
-
-    @Override
-    public PageUtilsPlus queryPage(Map<String, Object> params) {
-        //排序
-        params.put("sidx", "T.CREATE_TIME");
-        params.put("asc", false);
-        Page<ScheduleJobEntity> page = new QueryPlus<ScheduleJobEntity>(params).getPage();
-        return new PageUtilsPlus(page.setRecords(baseMapper.selectScheduleJobPage(page, params)));
-    }
-
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void add(ScheduleJobEntity scheduleJob) {
-        scheduleJob.setCreateTime(new Date());
-        scheduleJob.setStatus(Constant.ScheduleStatus.NORMAL.getValue());
-        this.save(scheduleJob);
-
-        ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void update(ScheduleJobEntity scheduleJob) {
-        ScheduleUtils.updateScheduleJob(scheduler, scheduleJob);
-
-        this.updateById(scheduleJob);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void deleteBatch(Long[] jobIds) {
-        for (Long jobId : jobIds) {
-            ScheduleUtils.deleteScheduleJob(scheduler, jobId);
-        }
-
-        //删除数据
-        this.removeByIds(Arrays.asList(jobIds));
-    }
-
-    @Override
-    public void updateBatch(Long[] jobIds, int status) {
-        Map<String, Object> map = new HashMap<>(4);
-        map.put("list", jobIds);
-        map.put("status", status);
-        baseMapper.updateBatch(map);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void run(Long[] jobIds) {
-        for (Long jobId : jobIds) {
-            ScheduleUtils.run(scheduler, this.getById(jobId));
-        }
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void pause(Long[] jobIds) {
-        for (Long jobId : jobIds) {
-            ScheduleUtils.pauseJob(scheduler, jobId);
-        }
-
-        updateBatch(jobIds, Constant.ScheduleStatus.PAUSE.getValue());
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void resume(Long[] jobIds) {
-        for (Long jobId : jobIds) {
-            ScheduleUtils.resumeJob(scheduler, jobId);
-        }
-
-        updateBatch(jobIds, Constant.ScheduleStatus.NORMAL.getValue());
-    }
-
-}

+ 0 - 79
platform-schedule/src/main/java/com/platform/utils/ScheduleJob.java

@@ -1,79 +0,0 @@
-package com.platform.utils;
-
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.entity.ScheduleJobLogEntity;
-import com.platform.service.ScheduleJobLogService;
-import org.apache.commons.lang.StringUtils;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.scheduling.quartz.QuartzJobBean;
-
-import java.util.Date;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
-
-/**
- * 定时任务
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月30日 下午12:44:21
- */
-public class ScheduleJob extends QuartzJobBean {
-    private Logger logger = LoggerFactory.getLogger(getClass());
-    private ExecutorService service = Executors.newSingleThreadExecutor();
-
-    @Override
-    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
-        ScheduleJobEntity scheduleJob = (ScheduleJobEntity) context.getMergedJobDataMap()
-                .get(ScheduleJobEntity.JOB_PARAM_KEY);
-
-        //获取spring bean
-        ScheduleJobLogService scheduleJobLogService = (ScheduleJobLogService) SpringContextUtils.getBean("scheduleJobLogService");
-
-        //数据库保存执行记录
-        ScheduleJobLogEntity log = new ScheduleJobLogEntity();
-        log.setJobId(scheduleJob.getJobId());
-        log.setBeanName(scheduleJob.getBeanName());
-        log.setMethodName(scheduleJob.getMethodName());
-        log.setParams(scheduleJob.getParams());
-        log.setCreateTime(new Date());
-
-        //任务开始时间
-        long startTime = System.currentTimeMillis();
-
-        try {
-            //执行任务
-            logger.info("任务准备执行,任务ID:" + scheduleJob.getJobId());
-            ScheduleRunnable task = new ScheduleRunnable(scheduleJob.getBeanName(),
-                    scheduleJob.getMethodName(), scheduleJob.getParams());
-            Future<?> future = service.submit(task);
-
-            future.get();
-
-            //任务执行总时长
-            long times = System.currentTimeMillis() - startTime;
-            log.setTimes((int) times);
-            //任务状态    0:成功    1:失败
-            log.setStatus(0);
-
-            logger.info("任务执行完毕,任务ID:" + scheduleJob.getJobId() + "  总共耗时:" + times + "毫秒");
-        } catch (Exception e) {
-            logger.error("任务执行失败,任务ID:" + scheduleJob.getJobId(), e);
-
-            //任务执行总时长
-            long times = System.currentTimeMillis() - startTime;
-            log.setTimes((int) times);
-
-            //任务状态    0:成功    1:失败
-            log.setStatus(1);
-            log.setError(StringUtils.substring(e.toString(), 0, 2000));
-        } finally {
-            scheduleJobLogService.save(log);
-        }
-    }
-}

+ 0 - 45
platform-schedule/src/main/java/com/platform/utils/ScheduleRunnable.java

@@ -1,45 +0,0 @@
-package com.platform.utils;
-
-import org.apache.commons.lang.StringUtils;
-import org.springframework.util.ReflectionUtils;
-
-import java.lang.reflect.Method;
-
-/**
- * 执行定时任务
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月30日 下午12:49:33
- */
-public class ScheduleRunnable implements Runnable {
-    private Object target;
-    private Method method;
-    private String params;
-
-    public ScheduleRunnable(String beanName, String methodName, String params) throws NoSuchMethodException, SecurityException {
-        this.target = SpringContextUtils.getBean(beanName);
-        this.params = params;
-
-        if (StringUtils.isNotBlank(params)) {
-            this.method = target.getClass().getDeclaredMethod(methodName, String.class);
-        } else {
-            this.method = target.getClass().getDeclaredMethod(methodName);
-        }
-    }
-
-    @Override
-    public void run() {
-        try {
-            ReflectionUtils.makeAccessible(method);
-            if (StringUtils.isNotBlank(params)) {
-                method.invoke(target, params);
-            } else {
-                method.invoke(target);
-            }
-        } catch (Exception e) {
-            throw new RRException("执行定时任务失败", e);
-        }
-    }
-
-}

+ 0 - 149
platform-schedule/src/main/java/com/platform/utils/ScheduleUtils.java

@@ -1,149 +0,0 @@
-package com.platform.utils;
-
-import com.platform.entity.ScheduleJobEntity;
-import com.platform.utils.Constant.ScheduleStatus;
-import org.quartz.*;
-
-/**
- * 定时任务工具类
- *
- * @author lipengjun
- * @email 939961241@qq.com
- * @date 2016年11月30日 下午12:44:59
- */
-public class ScheduleUtils {
-    private final static String JOB_NAME = "TASK_";
-
-    /**
-     * 获取触发器key
-     */
-    public static TriggerKey getTriggerKey(Long jobId) {
-        return TriggerKey.triggerKey(JOB_NAME + jobId);
-    }
-
-    /**
-     * 获取jobKey
-     */
-    public static JobKey getJobKey(Long jobId) {
-        return JobKey.jobKey(JOB_NAME + jobId);
-    }
-
-    /**
-     * 获取表达式触发器
-     */
-    public static CronTrigger getCronTrigger(Scheduler scheduler, Long jobId) {
-        try {
-            return (CronTrigger) scheduler.getTrigger(getTriggerKey(jobId));
-        } catch (SchedulerException e) {
-            throw new RRException("获取定时任务CronTrigger出现异常", e);
-        }
-    }
-
-    /**
-     * 创建定时任务
-     */
-    public static void createScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
-        try {
-            //构建job信息
-            JobDetail jobDetail = JobBuilder.newJob(ScheduleJob.class).withIdentity(getJobKey(scheduleJob.getJobId())).build();
-
-            //表达式调度构建器
-            CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression())
-                    .withMisfireHandlingInstructionDoNothing();
-
-            //按新的cronExpression表达式构建一个新的trigger
-            CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(scheduleJob.getJobId())).withSchedule(scheduleBuilder).build();
-
-            //放入参数,运行时的方法可以获取
-            jobDetail.getJobDataMap().put(ScheduleJobEntity.JOB_PARAM_KEY, scheduleJob);
-
-            scheduler.scheduleJob(jobDetail, trigger);
-
-            //暂停任务
-            if (scheduleJob.getStatus() == ScheduleStatus.PAUSE.getValue()) {
-                pauseJob(scheduler, scheduleJob.getJobId());
-            }
-        } catch (SchedulerException e) {
-            throw new RRException("创建定时任务失败", e);
-        }
-    }
-
-    /**
-     * 更新定时任务
-     */
-    public static void updateScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
-        try {
-            TriggerKey triggerKey = getTriggerKey(scheduleJob.getJobId());
-
-            //表达式调度构建器
-            CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression())
-                    .withMisfireHandlingInstructionDoNothing();
-
-            CronTrigger trigger = getCronTrigger(scheduler, scheduleJob.getJobId());
-
-            //按新的cronExpression表达式重新构建trigger
-            trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
-
-            //参数
-            trigger.getJobDataMap().put(ScheduleJobEntity.JOB_PARAM_KEY, scheduleJob);
-
-            scheduler.rescheduleJob(triggerKey, trigger);
-
-            //暂停任务
-            if (scheduleJob.getStatus() == ScheduleStatus.PAUSE.getValue()) {
-                pauseJob(scheduler, scheduleJob.getJobId());
-            }
-
-        } catch (SchedulerException e) {
-            throw new RRException("更新定时任务失败", e);
-        }
-    }
-
-    /**
-     * 立即执行任务
-     */
-    public static void run(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
-        try {
-            //参数
-            JobDataMap dataMap = new JobDataMap();
-            dataMap.put(ScheduleJobEntity.JOB_PARAM_KEY, scheduleJob);
-
-            scheduler.triggerJob(getJobKey(scheduleJob.getJobId()), dataMap);
-        } catch (SchedulerException e) {
-            throw new RRException("立即执行定时任务失败", e);
-        }
-    }
-
-    /**
-     * 暂停任务
-     */
-    public static void pauseJob(Scheduler scheduler, Long jobId) {
-        try {
-            scheduler.pauseJob(getJobKey(jobId));
-        } catch (SchedulerException e) {
-            throw new RRException("暂停定时任务失败", e);
-        }
-    }
-
-    /**
-     * 恢复任务
-     */
-    public static void resumeJob(Scheduler scheduler, Long jobId) {
-        try {
-            scheduler.resumeJob(getJobKey(jobId));
-        } catch (SchedulerException e) {
-            throw new RRException("暂停定时任务失败", e);
-        }
-    }
-
-    /**
-     * 删除定时任务
-     */
-    public static void deleteScheduleJob(Scheduler scheduler, Long jobId) {
-        try {
-            scheduler.deleteJob(getJobKey(jobId));
-        } catch (SchedulerException e) {
-            throw new RRException("删除定时任务失败", e);
-        }
-    }
-}

+ 0 - 30
platform-schedule/src/main/resources/com/platform/dao/ScheduleJobDao.xml

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.platform.dao.ScheduleJobDao">
-
-	<!-- 批量更新状态 -->
-	<update id="updateBatch">
-		UPDATE SCHEDULE_JOB SET STATUS = #{status} WHERE JOB_ID IN
-		<foreach item="jobId" collection="list"  open="(" separator="," close=")">
-			#{jobId}
-		</foreach>
-	</update>
-
-	<select id="selectScheduleJobPage" resultType="com.platform.entity.ScheduleJobEntity">
-		SELECT
-		T.JOB_ID,
-		T.BEAN_NAME,
-		T.METHOD_NAME,
-		T.PARAMS,
-		T.CRON_EXPRESSION,
-		T.STATUS,
-		T.REMARK,
-		T.CREATE_TIME
-		FROM SCHEDULE_JOB T
-		WHERE 1=1
-		<if test="params.beanName != null and params.beanName.trim() != ''">
-			AND T.BEAN_NAME LIKE '%${params.beanName}%'
-		</if>
-	</select>
-</mapper>

+ 0 - 25
platform-schedule/src/main/resources/com/platform/dao/ScheduleJobLogDao.xml

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.platform.dao.ScheduleJobLogDao">
-	<select id="selectScheduleJobLogPage" resultType="com.platform.entity.ScheduleJobLogEntity">
-		SELECT
-		T.LOG_ID,
-		T.JOB_ID,
-		T.BEAN_NAME,
-		T.METHOD_NAME,
-		T.PARAMS,
-		T.STATUS,
-		T.ERROR,
-		T.TIMES,
-		T.CREATE_TIME
-		FROM SCHEDULE_JOB_LOG T
-		WHERE 1=1
-		<if test="params.beanName != null and params.beanName.trim() != ''">
-			AND T.BEAN_NAME LIKE '%${params.beanName}%'
-		</if>
-		<if test="params.methodName != null and params.methodName.trim() != ''">
-			AND T.METHOD_NAME LIKE '%${params.methodName}%'
-		</if>
-	</select>
-</mapper>

+ 0 - 46
platform-schedule/src/main/resources/platform-scheduler.xml

@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="
-        http://www.springframework.org/schema/beans 
-        http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
-
-	<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
-        <property name="dataSource" ref="dataSource" />
-        <property name="quartzProperties">
-            <props>
-                <prop key="org.quartz.scheduler.instanceName">PlatformScheduler</prop>
-                <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
-                <!-- 线程池配置 -->
-                <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
-                <prop key="org.quartz.threadPool.threadCount">20</prop>
-                <prop key="org.quartz.threadPool.threadPriority">5</prop>
-                <!-- JobStore 配置 -->
-                <prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop>
-                <!-- 集群配置 -->
-                <prop key="org.quartz.jobStore.isClustered">true</prop>
-                <prop key="org.quartz.jobStore.clusterCheckinInterval">15000</prop>
-                <prop key="org.quartz.jobStore.maxMisfiresToHandleAtATime">1</prop>
-                
-                <prop key="org.quartz.jobStore.misfireThreshold">12000</prop>
-				<!-- 表前缀 -->
-                <prop key="org.quartz.jobStore.tablePrefix">QRTZ_</prop>
-            </props>
-        </property>
-
-        <property name="schedulerName" value="PlatformScheduler" />
-
-        <!--延时启动 -->
-        <property name="startupDelay" value="30" />
-
-        <property name="applicationContextSchedulerContextKey" value="applicationContextKey" />
-
-        <!--可选,QuartzScheduler 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 -->
-        <property name="overwriteExistingJobs" value="true" />
-
-        <!-- 设置自动启动   默认为true -->
-        <property name="autoStartup" value="true" />
-
-    </bean>
-	
-</beans>

+ 0 - 0
platform-shop/pom.xml


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini