dos 1 mēnesi atpakaļ
vecāks
revīzija
c40d0080ab

+ 3 - 0
game-business/src/main/java/com/game/business/controller/AppAgentController.java

@@ -507,6 +507,9 @@ public class AppAgentController extends BaseController {
     }
 
     private boolean compareTime(Date curTime,Date beginTime,Date endTime){
+        if(null == curTime){
+            return false;
+        }
         beginTime = DateUtil.parse(DateUtil.format(beginTime,"yyyy-MM-dd").concat(" 00:00:00"));
         endTime = DateUtil.parse(DateUtil.format(endTime,"yyyy-MM-dd").concat(" 23:59:59"));
         return curTime.getTime() >= beginTime.getTime() && curTime.getTime() <= endTime.getTime();

+ 36 - 0
game-framework/src/main/java/com/game/framework/config/JacksonConfig.java

@@ -0,0 +1,36 @@
+package com.game.framework.config;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.MapperFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+
+import java.text.SimpleDateFormat;
+import java.util.TimeZone;
+
+@Configuration
+public class JacksonConfig
+{
+    @Bean
+    public MappingJackson2HttpMessageConverter jackson2HttpMessageConverter()
+    {
+        final Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
+        builder.serializationInclusion(JsonInclude.Include.NON_NULL);
+        final ObjectMapper objectMapper = builder.build();
+        SimpleModule simpleModule = new SimpleModule();
+        // Long 转为 String 防止 js 丢失精度
+        simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
+        objectMapper.registerModule(simpleModule);
+        // 忽略 transient 关键词属性
+        objectMapper.configure(MapperFeature.PROPAGATE_TRANSIENT_MARKER, true);
+        // 时区设置
+        objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
+        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+        return new MappingJackson2HttpMessageConverter(objectMapper);
+    }
+}

+ 3 - 2
game-framework/src/main/java/com/game/framework/web/exception/GlobalExceptionHandler.java

@@ -22,7 +22,7 @@ import com.game.common.utils.StringUtils;
  * 
  * @author recruit
  */
-@RestControllerAdvice
+//@RestControllerAdvice
 public class GlobalExceptionHandler
 {
     private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@@ -68,6 +68,7 @@ public class GlobalExceptionHandler
     public AjaxResult handleMissingPathVariableException(MissingPathVariableException e, HttpServletRequest request)
     {
         String requestURI = request.getRequestURI();
+        e.printStackTrace();
         log.error("请求路径中缺少必需的路径变量'{}',发生系统异常.", requestURI, e);
         return AjaxResult.error(String.format("请求路径中缺少必需的路径变量[%s]", e.getVariableName()));
     }
@@ -90,7 +91,7 @@ public class GlobalExceptionHandler
     public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request)
     {
         String requestURI = request.getRequestURI();
-        log.error("请求地址'{}',发生未知异常.", requestURI, e);
+        log.error("请求地址'{}',发生未知异常.,{}", requestURI, e);
         return AjaxResult.error(e.getMessage());
     }
 

+ 2 - 2
game-ui/src/views/business/cashrecord/index.vue

@@ -111,9 +111,9 @@
           <span>{{ parseTime(scope.row.addtime) }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="提现类型" align="center" prop="cashType">
+      <el-table-column label="账号类型" align="center" prop="type">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.app_cash_type" :value="scope.row.cashType"/>
+          <dict-tag :options="dict.type.app_user_cash_account" :value="scope.row.type"/>
         </template>
       </el-table-column>
       <el-table-column label="转出备注" align="center" prop="cashOutRemark" />