Commit b2a6e626 authored by yangshuxing's avatar yangshuxing

自动提交代码

parent f2a941c6
......@@ -3,6 +3,7 @@ package com.dlbridge.jadp.job;
import com.alibaba.fastjson.JSONObject;
import com.dlbridge.jadp.config.properties.WeiXin;
import lombok.extern.log4j.Log4j2;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
......@@ -18,10 +19,13 @@ public class WeiXinAccessToken {
@Resource
RestTemplate restTemplate;
public static String ACCESS_TOKEN;
private static String ACCESS_TOKEN;
@Resource
WeiXin weiXin;
@Resource
private ValueOperations valueOperations;
@Scheduled(fixedRate = 3600 * 1000)
public void accessToken() {
......@@ -32,6 +36,18 @@ public class WeiXinAccessToken {
log.info("appId:"+weiXin.getAppid()+",获取token结果:" + forEntity.getBody());
ACCESS_TOKEN = JSONObject.parseObject(forEntity.getBody()).getString("access_token");
log.info("access_token:" + ACCESS_TOKEN);
valueOperations.set("micro_gk:access_token",ACCESS_TOKEN);
}
/* @Scheduled(fixedRate = 3600 * 1000)
public void accessToken() {
log.info("获取access_token...");
ACCESS_TOKEN = (String) valueOperations.get("micro_gk:access_token");
}*/
public static String getAccessToken(){
return ACCESS_TOKEN;
}
}
......@@ -157,7 +157,7 @@
</select>
<select id="getGeeRunnerMobile" resultType="java.lang.String">
SELECT user_id from geerunner_test.sys_admin where id=#{id} limit 1
SELECT user_id from geerunner.sys_admin where id=#{id} limit 1
</select>
<select id="getRaceEnrollUserId" resultType="java.lang.Integer">
......
......@@ -75,7 +75,7 @@
from gksite.gk_cmpt_score_rule rule
inner join gksite.gk_cmpt_score_rule_map rulemap on rule.id = rulemap.rule_id
inner join geexekscore.cmpt_subsection_score score on rulemap.score_item_id = score.id
inner join geerunner_test.cmpt_enroll enroll on rule.cmpt_id=enroll.cmpt_id and rulemap.mark_no=enroll.nick_id and enroll.del_flg=0
inner join geerunner.cmpt_enroll enroll on rule.cmpt_id=enroll.cmpt_id and rulemap.mark_no=enroll.nick_id and enroll.del_flg=0
where rule.cmpt_id=#{cmptId} and rule.id=#{ruleId}
and enroll.cmpt_item=#{roadId}
</select>
......@@ -109,11 +109,11 @@
enroll.nick_id user_markNo,rulemap.rule_id score_ruleId,
score.id score_scoreId,score.subsectionscore score_duration,score.subsectionTime score_date,
fv.id score_field_fvid, fv.scoreFieldValue score_field_scoreFieldValue,fv.scoreFieldName score_field_scoreFieldName
from geerunner_test.cmpt_enroll enroll
from geerunner.cmpt_enroll enroll
left join gksite.gk_cmpt_score_rule rule on rule.cmpt_id=enroll.cmpt_id
LEFT join gksite.gk_cmpt_score_rule_map rulemap on rule.id = rulemap.rule_id and enroll.nick_id=rulemap.mark_no
left join geexekscore.cmpt_subsection_score score on rulemap.score_item_id = score.id
left join geerunner_test.cmpt_item item on item.item_id = enroll.cmpt_item
left join geerunner.cmpt_item item on item.item_id = enroll.cmpt_item
left join gksite.gk_cmpt_score_field_value fv on fv.rule_id=rule.id and fv.markNo=enroll.nick_id
where enroll.cmpt_id=#{cmptId}
and enroll.cmpt_item=#{roadId} and enroll.del_flg=0
......
......@@ -526,8 +526,12 @@ public class MicroApiController {
@ApiResponse(code = -1, message = "失败"),
@ApiResponse(code = 200, message = "成功", response = Result.class)})
@ApiOperation(value = "获取赛事资讯", notes = "获取赛事资讯", response = Result.class, tags = "获取赛事资讯")
public Result enroll_list(@PathVariable("cmptId") Integer cmptId, @PathVariable("userId") Integer userId) {
List<RoadUser> users = remoteService.getEnrollUsers(cmptId, userId);
public Result enroll_list(@PathVariable("cmptId") Integer cmptId, @PathVariable("userId") String userId) {
if(StringUtils.isBlank(userId) || "null".equals(userId)){
log.info("上传用户Id为null");
return Result.fail();
}
List<RoadUser> users = remoteService.getEnrollUsers(cmptId, Integer.valueOf(userId));
return Result.success().setContent(users);
}
......
......@@ -57,7 +57,7 @@ public class ResourcesController {
JSONObject obj = new JSONObject();
obj.put("scene", "raceId=" + cmptid);
ResponseEntity<org.springframework.core.io.Resource> resourceResponseEntity = restTemplate.postForEntity("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="
+ accessToken.ACCESS_TOKEN, obj.toString(), org.springframework.core.io.Resource.class);
+ WeiXinAccessToken.getAccessToken(), obj.toString(), org.springframework.core.io.Resource.class);
ServletOutputStream outputStream = response.getOutputStream();
org.springframework.core.io.Resource body = resourceResponseEntity.getBody();
......@@ -79,7 +79,7 @@ public class ResourcesController {
obj.put("scene", "raceId=" + cmptid);
;
ResponseEntity<org.springframework.core.io.Resource> resourceResponseEntity = restTemplate.postForEntity("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="
+ accessToken.ACCESS_TOKEN, obj.toString(), org.springframework.core.io.Resource.class);
+ WeiXinAccessToken.getAccessToken(), obj.toString(), org.springframework.core.io.Resource.class);
Cmpt cmpt = cmptService.queryCmptBycmptId(cmptid);
BufferedImage bg = ImageIO.read(resourceResponseEntity.getBody().getInputStream());
......
......@@ -64,9 +64,9 @@ ribbon.eureka.enable=true
eureka.instance.lease-renewal-interval-in-seconds=2
eureka.instance.lease-expiration-duration-in-seconds=5
#feign调用连接超时时间
feign.client.config.default.connect-timeout=1000
feign.client.config.default.connect-timeout=2000
#feign调用读取超时时间
feign.client.config.default.readTimeout=1000
feign.client.config.default.readTimeout=2000
#feign调用的log 等级
feign.client.config.default.loggerLevel=basic
feign.okhttp.enabled=true
......@@ -75,10 +75,13 @@ feign.hystrix.enabled=true
#feign.compression.request.mime-types=text/xml,application/xml,application/json
#feign.compression.request.min-request-size=2048
hystrix.metrics.enabled=true
hystrix.command.default.execution.timeout.enabled=false
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=5000
logging.level.com.dlbridge.feign.NewsService=debug
logging.level.org.springframework.cloud.openfeign=debug
hystrix.command.default.execution.timeout.enabled=true
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=2000
hystrix.threadpool.default.coreSize=200
hystrix.threadpool.default.maxQueueSize=1000
hystrix.threadpool.default.queueSizeRejectionThreshold=800
logging.level.com.dlbridge.feign.NewsService=info
logging.level.org.springframework.cloud.openfeign=info
spring.zipkin.base-url=http://10.29.116.151:9001
spring.sleuth.sampler.probability=0.1
spring.zipkin.sender.type=web
......
......@@ -69,8 +69,8 @@ feign.hystrix.enabled=true
#feign.compression.request.mime-types=text/xml,application/xml,application/json
#feign.compression.request.min-request-size=2048
hystrix.metrics.enabled=true
hystrix.command.default.execution.timeout.enabled=false
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=5000
hystrix.command.default.execution.timeout.enabled=true
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=2000
logging.level.com.dlbridge.feign.NewsService=debug
logging.level.org.springframework.cloud.openfeign=debug
spring.zipkin.base-url=http://zipkin.geexke.com.cn
......
......@@ -211,7 +211,7 @@
<script src="${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"></script>
<script src="${ctxStatic}/js/qikoo.js"></script>
<script src="${ctxStatic}/js/autoscore.js"></script>
<script src="${ctxStatic}/js/autoscore.js?<%=System.currentTimeMillis()%>"></script>
</body>
......
......@@ -148,7 +148,7 @@
<span class="menu-txt">提交成绩</span>
</a>
</li>
<li class="autoscore menu-item">
<li class="auto menu-item">
<a href="/gk/autoscore/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="menuico left-arrow"></span>
<span class="menu-txt">自助打卡</span>
......@@ -160,7 +160,7 @@
<script>
var classes = ['cmptSetting', 'nameList', 'manual', 'contact',
'route', 'road', 'equip', 'photo', 'news',
'banner','score','autoscore'];
'banner','score','auto'];
let url = document.location.href;
var done = false;
for (var i in classes) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment