贾艺驰 4 years ago
parent
commit
3b71605cdc
47 changed files with 159 additions and 111 deletions
  1. 2 1
      .gitignore
  2. 0 2
      base/src/main/java/com/api/base/config/auth/JwtAuthenticationTokenFilter.java
  3. 2 1
      base/src/main/java/com/api/base/config/auth/SecurityConfig.java
  4. 7 0
      games/src/main/java/com/api/games/controller/GameLogController.java
  5. 2 0
      games/src/main/java/com/api/games/dao/GamePlayTimeMapper.java
  6. 3 0
      games/src/main/java/com/api/games/dao/mapper/GamePlayTimeMapper.xml
  7. 8 2
      games/src/main/java/com/api/games/dao/mapper/UserConfigMapper.xml
  8. 2 0
      games/src/main/java/com/api/games/service/GameLogService.java
  9. 8 0
      games/src/main/java/com/api/games/service/impl/GameLogServiceImpl.java
  10. 1 0
      games/src/main/java/com/api/games/service/impl/PushLogServiceImpl.java
  11. 42 1
      games/src/main/java/com/api/games/service/impl/UserConfigServiceImpl.java
  12. 2 0
      games/src/main/resources/application-dev.properties
  13. 80 0
      games/src/main/resources/application-prd.properties
  14. BIN
      games/src/main/resources/static/favicon.ico
  15. 0 18
      games/src/main/resources/static/index.html
  16. 0 1
      games/src/main/resources/static/static/css/app.db1381fb.css
  17. 0 1
      games/src/main/resources/static/static/css/chunk-02e35d74.40f76b5c.css
  18. 0 1
      games/src/main/resources/static/static/css/chunk-07fb5858.40f76b5c.css
  19. 0 1
      games/src/main/resources/static/static/css/chunk-0bffc718.a3bbc3f3.css
  20. 0 1
      games/src/main/resources/static/static/css/chunk-16dc0734.40f76b5c.css
  21. 0 1
      games/src/main/resources/static/static/css/chunk-2cfbcef8.40f76b5c.css
  22. 0 1
      games/src/main/resources/static/static/css/chunk-4de1c2b6.a37cd815.css
  23. 0 1
      games/src/main/resources/static/static/css/chunk-54f17038.d31b1d68.css
  24. 0 1
      games/src/main/resources/static/static/css/chunk-55ba4a02.40f76b5c.css
  25. 0 1
      games/src/main/resources/static/static/css/chunk-680322ae.40f76b5c.css
  26. 0 1
      games/src/main/resources/static/static/css/chunk-7fcc9fc8.16a486f1.css
  27. 0 1
      games/src/main/resources/static/static/css/chunk-c719cad2.a5e793a3.css
  28. 0 1
      games/src/main/resources/static/static/css/chunk-elementUI.ded27da0.css
  29. 0 9
      games/src/main/resources/static/static/css/chunk-libs.8cf2019f.css
  30. BIN
      games/src/main/resources/static/static/fonts/element-icons.535877f5.woff
  31. BIN
      games/src/main/resources/static/static/fonts/element-icons.732389de.ttf
  32. BIN
      games/src/main/resources/static/static/img/404.a57b6f31.png
  33. BIN
      games/src/main/resources/static/static/img/404_cloud.0f4bc32b.png
  34. 0 1
      games/src/main/resources/static/static/js/app.1bb5dc8c.js
  35. 0 1
      games/src/main/resources/static/static/js/chunk-02e35d74.61b83881.js
  36. 0 1
      games/src/main/resources/static/static/js/chunk-07fb5858.40558037.js
  37. 0 1
      games/src/main/resources/static/static/js/chunk-0bffc718.933ddd49.js
  38. 0 1
      games/src/main/resources/static/static/js/chunk-16dc0734.fc3bc03e.js
  39. 0 1
      games/src/main/resources/static/static/js/chunk-2cfbcef8.d3762303.js
  40. 0 1
      games/src/main/resources/static/static/js/chunk-4de1c2b6.128b6b35.js
  41. 0 1
      games/src/main/resources/static/static/js/chunk-54f17038.2508c102.js
  42. 0 1
      games/src/main/resources/static/static/js/chunk-55ba4a02.4c51c640.js
  43. 0 1
      games/src/main/resources/static/static/js/chunk-680322ae.e8a801c4.js
  44. 0 1
      games/src/main/resources/static/static/js/chunk-7fcc9fc8.a3c7a10b.js
  45. 0 1
      games/src/main/resources/static/static/js/chunk-c719cad2.deef58c4.js
  46. 0 1
      games/src/main/resources/static/static/js/chunk-elementUI.1d3df44e.js
  47. 0 51
      games/src/main/resources/static/static/js/chunk-libs.ea6b99c5.js

+ 2 - 1
.gitignore

@@ -23,4 +23,5 @@
 target
 # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
 hs_err_pid*
-games.iml
+games.iml
+*.xlsx

+ 0 - 2
base/src/main/java/com/api/base/config/auth/JwtAuthenticationTokenFilter.java

@@ -75,6 +75,4 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
 
 
 
-
-
 }

+ 2 - 1
base/src/main/java/com/api/base/config/auth/SecurityConfig.java

@@ -87,8 +87,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
 
     @Override
     protected void configure(HttpSecurity http) throws Exception {
+
         http.headers().frameOptions().disable();
-        List<SysWhitelist> whitelists=sysWhitelistService.selectAll();
+        List<SysWhitelist> whitelists= sysWhitelistService.selectAll();
 
         http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                 .and()

+ 7 - 0
games/src/main/java/com/api/games/controller/GameLogController.java

@@ -36,6 +36,13 @@ public class GameLogController extends Ctrl {
     @Resource
     private GameLogService gameLogService;
 
+    @PostMapping(value = "/game_time/list", name = "游戏测试记录添加")
+    public Result add(
+            @RequestParam("userId") Long userId
+    ) {
+        return gameLogService.listGameTime(userId);
+    }
+
     @ApiOperation(value = "游戏测试记录添加", tags = {"游戏测试记录"}, notes = "游戏测试记录添加")
     @PostMapping(value = "/add", name = "游戏测试记录添加")
     public Result add(@ApiParam GameLog gameLog) {

+ 2 - 0
games/src/main/java/com/api/games/dao/GamePlayTimeMapper.java

@@ -11,6 +11,8 @@ public interface GamePlayTimeMapper extends Mapper<GamePlayTime> {
 
     List<GamePlayTime> listUid(Long uid);
 
+    List<GamePlayTime> listUidOrderByPlayTime(Long uid);
+
     List<GamePlayTime> getScalePlayTime(Long uid, String startDate, String endDate);
 
     List<GamePlayTime> listUidAndInPeriod(Long uid, String startDate, String endDate);

+ 3 - 0
games/src/main/java/com/api/games/dao/mapper/GamePlayTimeMapper.xml

@@ -13,6 +13,9 @@
     <select id="listUid" resultMap="BaseResultMap">
       select * from game_play_time where uid = #{uid}
     </select>
+    <select id="listUidOrderByPlayTime" resultMap="BaseResultMap">
+      select * from game_play_time where uid = #{uid} order by game_time
+    </select>
     <select id="listUidAndInPeriod" resultMap="BaseResultMap">
         SELECT * FROM game_play_time where uid=#{uid} and str_to_date(game_time, '%Y-%m-%d %H:%i:%s') &gt;= str_to_date(#{startDate}, '%Y-%m-%d %H:%i:%s') and str_to_date(game_time, '%Y-%m-%d %H:%i:%s') &lt;= str_to_date(#{endDate}, '%Y-%m-%d %H:%i:%s');
     </select>

+ 8 - 2
games/src/main/java/com/api/games/dao/mapper/UserConfigMapper.xml

@@ -29,8 +29,14 @@
         <if test="params.nickname !=null and params.nickname !=''">
             and u.nickname = #{params.nickname}
         </if>
-        <if test="params.status !=null and params.status !=''">
-            and u.status = #{params.status}
+        <if test="params.status !=null and params.status == 0">
+            and now() &lt;= date(scale_start)
+        </if>
+        <if test="params.status !=null and params.status == 1">
+            and now() &gt;= date(scale_start) and now() &lt;= date(scale_end)
+        </if>
+        <if test="params.status !=null and params.status == 2">
+            and now() &gt;= date(scale_end)
         </if>
         <if test="params.scaleStart !=null and params.scaleStart !=''">
             and date(scale_start) = #{params.scaleStart}

+ 2 - 0
games/src/main/java/com/api/games/service/GameLogService.java

@@ -14,6 +14,8 @@ public interface GameLogService extends Service<GameLog> {
 
     Result list(String search, String order, Integer page, Integer size);
 
+    Result listGameTime(Long uid);
+
     Result detail(Integer id);
 
     /**

+ 8 - 0
games/src/main/java/com/api/games/service/impl/GameLogServiceImpl.java

@@ -6,6 +6,7 @@ import com.api.core.response.ResultGenerator;
 import com.api.core.service.AbstractService;
 import com.api.games.dao.GameAnswerMapper;
 import com.api.games.dao.GameLogMapper;
+import com.api.games.dao.GamePlayTimeMapper;
 import com.api.games.model.GameLog;
 import com.api.games.service.GameLogService;
 import com.github.pagehelper.PageHelper;
@@ -30,6 +31,13 @@ public class GameLogServiceImpl extends AbstractService<GameLog> implements Game
     private GameLogMapper gameLogMapper;
     @Resource
     private GameAnswerMapper gameAnswerMapper;
+    @Resource
+    GamePlayTimeMapper gamePlayTimeMapper;
+
+    @Override
+    public Result listGameTime(Long uid) {
+        return ResultGenerator.genSuccessResult(gamePlayTimeMapper.listUidOrderByPlayTime(uid));
+    }
 
     @Override
     public Result list(String search, String ordermap, Integer page, Integer size) {

+ 1 - 0
games/src/main/java/com/api/games/service/impl/PushLogServiceImpl.java

@@ -185,6 +185,7 @@ public class PushLogServiceImpl extends AbstractService<PushLog> implements Push
                         pushLog.setMsgId(gamePlayTimeId + "");
                         pushLog.setStatus(ConstUser.PUSH_DELAY);
                         pushLogMapper.insert(pushLog);
+                        gamePlayTime.setGameTime(UtilFun.DateToString(newTime.getTime(), UtilFun.YYYYMMDDHHMMSS));
                         gamePlayTimeMapper.updateByPrimaryKey(gamePlayTime);
                         return ResultGenerator.genSuccessResult();
                     }

+ 42 - 1
games/src/main/java/com/api/games/service/impl/UserConfigServiceImpl.java

@@ -74,7 +74,28 @@ public class UserConfigServiceImpl extends AbstractService<UserConfig> implement
         PageHelper.startPage(page, size);
 
         List<Map<String, Object>> list = userConfigMapper.list(params, order);
+
+        for(Map<String, Object> item : list){
+            String scaleStart = item.get("scaleStart") == null ? null : (String) item.get("scaleStart");
+            String scaleEnd =  item.get("scaleEnd") == null ? null : (String) item.get("scaleEnd");
+            if (scaleStart != null && scaleEnd != null){
+                Calendar current = Calendar.getInstance();
+                Calendar calendarStart = Calendar.getInstance();
+                calendarStart.setTime(UtilFun.StringToDate(scaleStart, UtilFun.YYYYMMDDHHMMSS));
+                Calendar calendarEnd = Calendar.getInstance();
+                calendarEnd.setTime(UtilFun.StringToDate(scaleEnd, UtilFun.YYYYMMDDHHMMSS));
+                if (current.before(calendarStart)){
+                    item.put("status", 0);
+                } else if (current.after(calendarEnd)){
+                    item.put("status", 2);
+                } else if(current.after(calendarStart) && current.before(calendarEnd)){
+                    item.put("status", 1);
+                }
+            }
+        }
+
         PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
+
         return ResultGenerator.genSuccessResult(pageInfo);
     }
 
@@ -111,6 +132,16 @@ public class UserConfigServiceImpl extends AbstractService<UserConfig> implement
 
         config.setUserId(user.getId());
         config.setGameCount(gameConfigs.size());
+
+        String end = config.getScaleEnd();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(UtilFun.StringToDate(end, UtilFun.YYYYMMDDHHMMSS));
+        calendar.set(Calendar.HOUR_OF_DAY, 23);
+        calendar.set(Calendar.MINUTE, 59);
+        calendar.set(Calendar.SECOND, 59);
+        calendar.set(Calendar.MILLISECOND, 999);
+        config.setScaleEnd(UtilFun.DateToString(calendar.getTime(), UtilFun.YYYYMMDDHHMMSS));
+
         save(config);
         return ResultGenerator.genSuccessResult();
     }
@@ -127,10 +158,20 @@ public class UserConfigServiceImpl extends AbstractService<UserConfig> implement
     @Override
     public Result update(User user, UserConfig config, Long configId, String configs) {
         User oldUser = userMapper.selectByPrimaryKey(user.getId());
+        UserConfig oldConfig = userConfigMapper.findByUid(user.getId());
         //用戶開始測試後無法再修改用戶信息
-        if (oldUser.getStatus() != ConstUser.STATUS_NORMAL) {
+        Calendar current = Calendar.getInstance();
+        Calendar calendarStart = Calendar.getInstance();
+        calendarStart.setTime(UtilFun.StringToDate(oldConfig.getScaleStart(), UtilFun.YYYYMMDDHHMMSS));
+        Calendar calendarEnd = Calendar.getInstance();
+        calendarEnd.setTime(UtilFun.StringToDate(oldConfig.getScaleEnd(), UtilFun.YYYYMMDDHHMMSS));
+        if(current.after(calendarStart) && current.before(calendarEnd)){
             return ResultGenerator.genResult(USER_ING);
         }
+
+//        if (oldUser.getStatus() != ConstUser.STATUS_NORMAL) {
+//            return ResultGenerator.genResult(USER_ING);
+//        }
         if (user.getOpenid() != null && user.getOpenid().equals("")) user.setOpenid(null);
         //判斷嗎密碼是否發生變化,無變化不修改
         if (!oldUser.getPassword().equals(user.getPassword())) {

+ 2 - 0
games/src/main/resources/application-dev.properties

@@ -3,6 +3,8 @@ spring.datasource.url=jdbc:mysql://localhost:3306/three_games?useSSL=false&zeroD
 spring.datasource.username=root
 spring.datasource.password=a1251312
 
+spring.resources.add-mappings=true
+
 spring.jpa.database=MYSQL
 spring.jpa.show-sql=true
 

+ 80 - 0
games/src/main/resources/application-prd.properties

@@ -0,0 +1,80 @@
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.url=jdbc:mysql://localhost:3306/three_games?useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+spring.datasource.username=root
+spring.datasource.password=6zUcIiEO!
+
+spring.resources.add-mappings=true
+
+spring.jpa.database=MYSQL
+spring.jpa.show-sql=true
+
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+spring.jackson.serialization.write-dates-as-timestamps=false
+
+logging.level.com.api.dao=DEBUG
+logging.level.com.common.mybatis = debug
+logging.level.com.api.games.dao = debug
+
+jpush.appkey=513ff596f6f2ea9a23db434d
+jpush.masterSecret=8087c837ab35f4fa4353d49d
+jpush.liveTime=300000
+#jwt
+jwt.secret=mySecret
+jwt.header=Authorization
+jwt.expiration=3162240000
+jwt.tokenHead=Bearer
+
+#wxPay
+wx.config.appID=wx4c202ab98659addb
+wx.config.mchID=1539277401
+wx.config.key=chiputabutuputaopi2019zaichiyici
+wx.pay.notifyUrl=https://ylt.djfy365.com:8080/payment/notify
+wx.config.certPath=cert/apiclient_cert.p12
+wx.pay.prefix=mall
+
+#mybatis xml hot reload
+mybatis.hot.reload.delaySeconds=5
+mybatis.hot.reload.sleepSeconds=5
+mybatis.hot.reload.enabled=true
+mybatis.hot.reload.mappingPath=mapper
+mybatis.hot.reload.mapperLocation = classpath*:com/api/**/*.xml
+
+server.port=8080
+server.servlet.context-path=
+server.tomcat.uri-encoding=UTF-8
+
+#https
+#server.ssl.key-store= classpath:www.com.pfx
+#server.ssl.key-store-password=000000
+#server.ssl.keyStoreType=JKS
+#server.ssl.keyAlias=alias
+#server.ssl.enabled=false
+
+spring.http.encoding.force=true
+spring.http.encoding.charset=UTF-8
+spring.http.encoding.enabled=true
+
+spring.servlet.multipart.max-file-size=100MB
+spring.servlet.multipart.max-request-size=100MB
+
+spring.mvc.static-path-pattern=/static/**
+
+#spring.cache.type=redis
+
+#redis
+#spring.redis.database=3
+#spring.redis.host=127.0.0.1
+#spring.redis.port=6379
+#spring.redis.password=
+#spring.redis.jedis.pool.max-active=8
+#spring.redis.jedis.pool.max-wait=-1
+#spring.redis.jedis.pool.max-idle=8
+#spring.redis.jedis.pool.min-idle=0
+#spring.redis.timeout=5000
+
+#/
+upload.img.file-path=/home/wanghuiwen/photo/
+upload.img.host=https://localhost:8080/
+upload.img.prefix=image/
+

BIN
games/src/main/resources/static/favicon.ico


File diff suppressed because it is too large
+ 0 - 18
games/src/main/resources/static/index.html


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/css/app.db1381fb.css


+ 0 - 1
games/src/main/resources/static/static/css/chunk-02e35d74.40f76b5c.css

@@ -1 +0,0 @@
-.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}

+ 0 - 1
games/src/main/resources/static/static/css/chunk-07fb5858.40f76b5c.css

@@ -1 +0,0 @@
-.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}

+ 0 - 1
games/src/main/resources/static/static/css/chunk-0bffc718.a3bbc3f3.css

@@ -1 +0,0 @@
-.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}.flex.vc[data-v-16ddfbf6]{-webkit-box-align:center;-ms-flex-align:center;align-items:center}

+ 0 - 1
games/src/main/resources/static/static/css/chunk-16dc0734.40f76b5c.css

@@ -1 +0,0 @@
-.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}

+ 0 - 1
games/src/main/resources/static/static/css/chunk-2cfbcef8.40f76b5c.css

@@ -1 +0,0 @@
-.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}

File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/css/chunk-4de1c2b6.a37cd815.css


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/css/chunk-54f17038.d31b1d68.css


+ 0 - 1
games/src/main/resources/static/static/css/chunk-55ba4a02.40f76b5c.css

@@ -1 +0,0 @@
-.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}

+ 0 - 1
games/src/main/resources/static/static/css/chunk-680322ae.40f76b5c.css

@@ -1 +0,0 @@
-.pagination-container[data-v-6af373ef]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-6af373ef]{display:none}

+ 0 - 1
games/src/main/resources/static/static/css/chunk-7fcc9fc8.16a486f1.css

@@ -1 +0,0 @@
-.dashboard-container[data-v-57386697]{margin:30px}.dashboard-text[data-v-57386697]{font-size:30px;line-height:46px}

+ 0 - 1
games/src/main/resources/static/static/css/chunk-c719cad2.a5e793a3.css

@@ -1 +0,0 @@
-.customer-form[data-v-7a4884c3]{width:500px}

File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/css/chunk-elementUI.ded27da0.css


File diff suppressed because it is too large
+ 0 - 9
games/src/main/resources/static/static/css/chunk-libs.8cf2019f.css


BIN
games/src/main/resources/static/static/fonts/element-icons.535877f5.woff


BIN
games/src/main/resources/static/static/fonts/element-icons.732389de.ttf


BIN
games/src/main/resources/static/static/img/404.a57b6f31.png


BIN
games/src/main/resources/static/static/img/404_cloud.0f4bc32b.png


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/app.1bb5dc8c.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-02e35d74.61b83881.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-07fb5858.40558037.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-0bffc718.933ddd49.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-16dc0734.fc3bc03e.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-2cfbcef8.d3762303.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-4de1c2b6.128b6b35.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-54f17038.2508c102.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-55ba4a02.4c51c640.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-680322ae.e8a801c4.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-7fcc9fc8.a3c7a10b.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-c719cad2.deef58c4.js


File diff suppressed because it is too large
+ 0 - 1
games/src/main/resources/static/static/js/chunk-elementUI.1d3df44e.js


File diff suppressed because it is too large
+ 0 - 51
games/src/main/resources/static/static/js/chunk-libs.ea6b99c5.js