Commit 519c0994 authored by yangshuxing's avatar yangshuxing

ui以及点成绩记录

parent 8e4c5a7b
...@@ -52,6 +52,11 @@ ...@@ -52,6 +52,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId> <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId> <artifactId>spring-boot-starter-jdbc</artifactId>
...@@ -260,11 +265,7 @@ ...@@ -260,11 +265,7 @@
<artifactId>spring-cloud-starter</artifactId> <artifactId>spring-cloud-starter</artifactId>
<version>2.0.4.RELEASE</version> <version>2.0.4.RELEASE</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>2.0.4.RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId> <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
......
...@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List; import java.util.List;
@FeignClient(name = "NEWS-SERVICE", configuration = FeignConfig.class, fallbackFactory = NewsFallbackFactory.class) @FeignClient(name = "news-service", configuration = FeignConfig.class, fallbackFactory = NewsFallbackFactory.class)
@RequestMapping("news") @RequestMapping("news")
public interface NewsService { public interface NewsService {
......
package com.dlbridge.feign.bean;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 赛事打卡点坐标
* </p>
*
* @author sunyuhua
* @since 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="CmptScoreCheckpoint对象", description="赛事打卡点坐标")
public class CmptScoreCheckpoint{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "打卡点的Id")
private Integer checkpointId;
@ApiModelProperty(value = "赛事Id(现在是计时赛事Id,后期修改为报名赛事Id)")
private Integer cmptId;
@ApiModelProperty(value = "项目Id(现在是计时项目id,后期修改为报名项目id)")
private Integer roadId;
@ApiModelProperty(value = "打卡点的名字")
private String name;
@ApiModelProperty(value = "打卡点的距离,(导入gps轨迹上点和点的距离或者手动修改的打卡点之间的距离)")
private Float distance;
@ApiModelProperty(value = "打卡点是否是计时点")
private Boolean isTime;
@ApiModelProperty(value = "是否被删除")
private Boolean isDelete;
@ApiModelProperty(value = "记录插入时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime insertTime;
@ApiModelProperty(value = "记录更新时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
private Double longitude;
private Double latitude;
}
...@@ -11,7 +11,6 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer ...@@ -11,7 +11,6 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix; import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -32,7 +31,6 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc; ...@@ -32,7 +31,6 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@EnableAspectJAutoProxy(proxyTargetClass = true) @EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableScheduling @EnableScheduling
@EnableFeignClients(basePackages="com.dlbridge.feign") @EnableFeignClients(basePackages="com.dlbridge.feign")
@EnableEurekaClient
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableCircuitBreaker @EnableCircuitBreaker
@EnableHystrix @EnableHystrix
......
package com.dlbridge.jadp.config.web;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/**
* @author <a href="mailto:kobe524348@gmail.com">黄钰朝</a>
* @description LocalDateTime序列化配置
* @date 2020-05-04 16:32
*/
@Configuration
public class LocalDateTimeSerializerConfig {
private static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
private static final String DATE_PATTERN = "yyyy-MM-dd";
/**
* string转localdate
*/
@Bean
public Converter<String, LocalDate> localDateConverter() {
return new Converter<String, LocalDate>() {
@Override
public LocalDate convert(String source) {
if (source.trim().length() == 0)
return null;
try {
return LocalDate.parse(source);
} catch (Exception e) {
return LocalDate.parse(source, DateTimeFormatter.ofPattern(DATE_PATTERN));
}
}
};
}
/**
* string转localdatetime
*/
@Bean
public Converter<String, LocalDateTime> localDateTimeConverter() {
return new Converter<String, LocalDateTime>() {
@Override
public LocalDateTime convert(String source) {
if (source.trim().length() == 0) {
return null;
}
// 先尝试ISO格式: 2019-07-15T16:00:00
try {
return LocalDateTime.parse(source);
} catch (Exception e) {
return LocalDateTime.parse(source, DateTimeFormatter.ofPattern(DATE_TIME_PATTERN));
}
}
};
}
/**
* 统一配置
*/
@Bean
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
JavaTimeModule module = new JavaTimeModule();
LocalDateTimeDeserializer localDateTimeDeserializer = new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
module.addDeserializer(LocalDateTime.class, localDateTimeDeserializer);
return builder -> {
builder.simpleDateFormat(DATE_TIME_PATTERN);
builder.serializers(new LocalDateSerializer(DateTimeFormatter.ofPattern(DATE_PATTERN)));
builder.serializers(new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DATE_TIME_PATTERN)));
builder.modules(module);
};
}
}
...@@ -54,6 +54,7 @@ public class WebConfig implements WebMvcConfigurer { ...@@ -54,6 +54,7 @@ public class WebConfig implements WebMvcConfigurer {
.addResolver(new VersionResourceResolver() .addResolver(new VersionResourceResolver()
.addFixedVersionStrategy("1.0.0", "/**")); .addFixedVersionStrategy("1.0.0", "/**"));
}*/ }*/
@Bean @Bean
public RestTemplate restTemplate() { public RestTemplate restTemplate() {
System.out.println("resttemplate ... .. init....."); System.out.println("resttemplate ... .. init.....");
......
package com.dlbridge.jadp.fallback;
import com.dlbridge.feign.ScoreService;
import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;
@Component
@Log4j2
public class GeexekScoreFallbackFactory implements FallbackFactory<ScoreService> {
@Override
public ScoreService create(Throwable throwable) {
return null;
}
}
package com.dlbridge.jadp.plugins.cmpt.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@ApiModel(value = "最佳路线耗时统计", description = "最佳路线耗时统计")
@Accessors(chain = true)
public class PbStatistic {
private int userId;
// 单位 公里 小数点2位
@ApiModelProperty(value = "最佳成绩的里程")
private double miles;
// 最短耗时
@ApiModelProperty(value = "最佳成绩的耗时")
private int duration;
// 单位 公里 小数点2位
@ApiModelProperty(value = "累计里程")
private double totalMiles;
}
...@@ -41,4 +41,6 @@ public class RoadGpsPoint { ...@@ -41,4 +41,6 @@ public class RoadGpsPoint {
"}") "}")
private String points; private String points;
private String placeMark;
} }
package com.dlbridge.jadp.plugins.cmpt.bean;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@Accessors(chain = true)
public class ScoreItemDetail {
private int id;
private String cpName;
private Date createTime;
}
package com.dlbridge.jadp.plugins.cmpt.bean;
import lombok.Data;
import java.util.Date;
@Data
public class ScoreItemInfo {
private int id;
private Date createTime;
private int duration;
private double miles;
}
package com.dlbridge.jadp.plugins.cmpt.bean;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@Accessors(chain = true)
public class ScoreRank {
private int rankNo;
private String name;
private int duration;
private double miles;
private Date createTime;
}
package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.plugins.cmpt.bean.Album;
import com.dlbridge.jadp.plugins.cmpt.bean.Road;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.*;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@Log4j2
@RequestMapping("gk/cert/")
@ApiIgnore
public class CertController {
@Resource
private CmptService cmptService;
@RequestMapping("index/{cmptId}")
@PageView
public ModelAndView index(@PathVariable("cmptId") Integer cmptId, ModelAndView mv) {
Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId);
mv.setViewName("cmpt/cert");
mv.addObject("cmpt", cmpt);
return mv;
}
}
package com.dlbridge.jadp.plugins.cmpt.web; package com.dlbridge.jadp.plugins.cmpt.web;
import com.neusoft.www.utils.web.Result; import com.neusoft.www.utils.web.Result;
import lombok.extern.log4j.Log4j2;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
...@@ -8,11 +9,13 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -8,11 +9,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
@ControllerAdvice @ControllerAdvice
@Order(0) @Order(0)
@Log4j2
public class ExceptionController { public class ExceptionController {
@ResponseBody @ResponseBody
@ExceptionHandler(value = Exception.class) @ExceptionHandler(value = Exception.class)
public Result errorHandler(Exception ex) { public Result errorHandler(Exception ex) {
return Result.fail().setMsg(ex.getMessage()); log.info(ex.getMessage(),ex);
return Result.fail().setMsg(ex.getMessage());
} }
} }
package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.plugins.cmpt.bean.PbStatistic;
import com.dlbridge.jadp.plugins.cmpt.bean.ScoreItemDetail;
import com.dlbridge.jadp.plugins.cmpt.bean.ScoreItemInfo;
import com.dlbridge.jadp.plugins.cmpt.bean.ScoreRank;
import com.dlbridge.jadp.plugins.cmpt.utils.Page;
import com.dlbridge.jadp.plugins.cmpt.utils.PageFactory;
import com.neusoft.www.utils.web.Result;
import io.swagger.annotations.*;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@RestController("api")
@Api(tags = "多次提交成绩版本")
public class MicroApiExtendController {
@ApiResponses({
@ApiResponse(code = 200, message = "成功"),
@ApiResponse(code = -1, message = "失败", response = ObjectUtils.Null.class)})
@ApiImplicitParams({
@ApiImplicitParam(value = "赛事ID", name = "cmptId", required = true,dataType = "int"),
@ApiImplicitParam(value = "号码牌", name = "markNo", required = true),
@ApiImplicitParam(value = "类型 【0总里程 1、最佳耗时pb】", name = "type", required = true,dataType = "int" )})
@ApiOperation(value = "当前累计跑量/当前最佳", notes = "当前累计跑量/当前最佳" )
@GetMapping("{cmptId}/runner/{markNo}/{type}")
public Result<PbStatistic> getRunnerStatistic(@PathVariable("cmptId") int cmptId,
@PathVariable("markNo") String markNo,
@PathVariable("type") int type){
PbStatistic pbStatistic = new PbStatistic().setDuration(9831).setMiles(19.01).setTotalMiles(121.21);
return Result.success().setContent(pbStatistic);
}
/**
* 获取赛事下的成绩记录
*
*/
@ApiResponses({
@ApiResponse(code = 200, message = "成功"),
@ApiResponse(code = -1, message = "失败", response = ObjectUtils.Null.class)})
@ApiImplicitParams({
@ApiImplicitParam(value = "赛事ID", name = "cmptId", required = true,dataType = "int"),
@ApiImplicitParam(value = "号码牌", name = "markNo", required = true),
@ApiImplicitParam(value = "类型 【0总里程 1、最佳耗时pb】", name = "type", required = true,dataType = "int" )})
@ApiOperation(value = "成绩记录列表", notes = "成绩记录列表")
@GetMapping("scores/{cmptId}/{markNo}/{type}")
public Result<List<ScoreItemInfo>> scores(@PathVariable("cmptId") int cmptId,
@PathVariable("markNo") String markNo,
@PathVariable("type") int type){
ScoreItemInfo info = new ScoreItemInfo();
info.setCreateTime(new Date());
info.setDuration(123);
info.setId(1);
info.setMiles(21.12);
return Result.success().setContent(Collections.singletonList(info));
}
/**
* 获取打卡记录的点集合记录
*
* 场景:自助打卡、扫码打卡
*
*/
@ApiResponses({
@ApiResponse(code = 200, message = "成功"),
@ApiResponse(code = -1, message = "失败", response = ObjectUtils.Null.class)})
@ApiImplicitParams({
@ApiImplicitParam(value = "赛事ID", name = "scoreId", required = true,dataType = "int")})
@ApiOperation(value = "成绩记录详情", notes = "成绩记录详情")
@GetMapping("score/{scoreId}/cps")
public Result<List<ScoreItemDetail>> cps(@PathVariable("scoreId") int scoreId){
List<ScoreItemDetail> details = new ArrayList<>();
ScoreItemDetail detail = new ScoreItemDetail();
detail.setCpName("起点");
detail.setCreateTime(new Date());
detail.setId(1);
ScoreItemDetail detail1 = new ScoreItemDetail();
detail1.setCpName("CP1");
detail1.setCreateTime(new Date());
detail1.setId(2);
ScoreItemDetail detail2 = new ScoreItemDetail();
detail2.setCpName("CP2");
detail2.setCreateTime(new Date());
detail2.setId(3);
details.add(detail);
details.add(detail1);
details.add(detail2);
return Result.success().setContent(details);
}
/**
* 项目下的榜单
*
* type : 1、总榜 2日榜
*/
@ApiResponses({
@ApiResponse(code = 200, message = "成功"),
@ApiResponse(code = -1, message = "失败", response = ObjectUtils.Null.class)})
@ApiImplicitParams({
@ApiImplicitParam(value = "页码", name = "page", required = false, paramType = "query"),
@ApiImplicitParam(value = "条数", name = "size", required = false, paramType = "query"),
@ApiImplicitParam(value = "项目Id", name = "roadId", required = true,dataType = "int"),
@ApiImplicitParam(value = "类型 1、总榜 2日榜", name = "type", required = true,dataType = "int")})
@ApiOperation(value = "成绩榜单", notes = "成绩榜单")
@GetMapping("{roadId}/rank/{type}")
public Page<ScoreRank> rank(Pageable pageable, @PathVariable("roadId") int roadId,
@PathVariable("type") String type){
ScoreRank rank = new ScoreRank();
rank.setCreateTime(new Date());
rank.setDuration(2912);
rank.setMiles(123.1);
rank.setName("test");
rank.setRankNo(1);
List<ScoreRank> scoreRanks = Collections.singletonList(rank);
Page page = PageFactory.setContent(scoreRanks, pageable, 1);
return page;
}
/**
* 项目下的榜单
*
* type : 1、总榜 2日榜
*
* 包含个人成绩榜单
*/
@ApiResponses({
@ApiResponse(code = 200, message = "成功"),
@ApiResponse(code = -1, message = "失败", response = ObjectUtils.Null.class)})
@ApiImplicitParams({
@ApiImplicitParam(value = "赛事ID", name = "roadId", required = true,dataType = "int"),
@ApiImplicitParam(value = "号码牌", name = "markNo", required = true),
@ApiImplicitParam(value = "类型 1、总榜 2日榜", name = "type", required = true,dataType = "int")})
@ApiOperation(value = "个人成绩榜", notes = "个人成绩榜")
@GetMapping("{roadId}/rank/{type}/{markNo}")
public Result<ScoreRank> pRank(@PathVariable("roadId") int roadId,
@PathVariable("markNo") String markNo,
@PathVariable("type") int type){
ScoreRank rank = new ScoreRank();
rank.setCreateTime(new Date());
rank.setDuration(2211);
rank.setMiles(13.1);
rank.setName("张三");
rank.setRankNo(1);
return Result.success().setContent(rank);
}
}
package com.dlbridge.jadp.plugins.cmpt.web; package com.dlbridge.jadp.plugins.cmpt.web;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dlbridge.feign.GeexekScoreService;
import com.dlbridge.feign.bean.CmptScoreCheckpoint;
import com.dlbridge.jadp.common.interceptor.PageView; import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.plugins.cmpt.bean.Equipment; import com.dlbridge.jadp.plugins.cmpt.bean.Equipment;
import com.dlbridge.jadp.plugins.cmpt.bean.Road; import com.dlbridge.jadp.plugins.cmpt.bean.Road;
...@@ -12,13 +16,15 @@ import com.dlbridge.jadp.plugins.cmpt.service.RoadService; ...@@ -12,13 +16,15 @@ import com.dlbridge.jadp.plugins.cmpt.service.RoadService;
import com.neusoft.www.utils.web.Result; import com.neusoft.www.utils.web.Result;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List; import java.util.List;
@Log4j2 @Log4j2
...@@ -30,12 +36,13 @@ public class RoadController { ...@@ -30,12 +36,13 @@ public class RoadController {
@Resource @Resource
private CmptService cmptService; private CmptService cmptService;
@Resource
private RemoteService remoteService;
@Resource @Resource
private RoadService roadService; private RoadService roadService;
@Resource
GeexekScoreService geexekScoreService;
@RequestMapping("index/{cmptId}") @RequestMapping("index/{cmptId}")
@PageView @PageView
public ModelAndView index(@PathVariable("cmptId") Integer cmptId, ModelAndView mv) { public ModelAndView index(@PathVariable("cmptId") Integer cmptId, ModelAndView mv) {
...@@ -52,9 +59,50 @@ public class RoadController { ...@@ -52,9 +59,50 @@ public class RoadController {
return mv; return mv;
} }
@GetMapping("getCheckPoints/{roadId}")
@ResponseBody
public Result getCheckPoints(@PathVariable("roadId") int roadId) {
List<CmptScoreCheckpoint> checkPointByRoadId = geexekScoreService.getCheckPointByRoadId(roadId);
return Result.success().setContent(checkPointByRoadId);
}
@PostMapping("saveCheckPoint")
@ResponseBody
public Result saveCheckPoint(@RequestBody List<CmptScoreCheckpoint> list) {
geexekScoreService.saveOrUpdateCheckPoint(list);
return Result.success().setContent(null);
}
@RequestMapping("save") @RequestMapping("save")
@ResponseBody @ResponseBody
public Result save(Road road) { public Result save(Road road) {
geexekScoreService.deleteAllByRoadId(road.getRoadId());
String json = roadService.loadGpsFromNet(road.getFileUrl());
JSONObject jsonObject = JSONObject.parseObject(json);
JSONArray placeMark = jsonObject.getJSONArray("placeMark");
RoadGpsPoint roadGpsPoint = new RoadGpsPoint().
setPoints(json).setRoadId(road.getRoadId())
.setCmptId(road.getCmptId());
roadService.saveGps(roadGpsPoint);
Iterator<Object> iterator = placeMark.iterator();
List<CmptScoreCheckpoint> list = new ArrayList<>();
while (iterator.hasNext()){
JSONObject next = (JSONObject)iterator.next();
CmptScoreCheckpoint cp = new CmptScoreCheckpoint();
cp.setCmptId(road.getCmptId());
cp.setIsTime(false);
cp.setRoadId(road.getRoadId());
cp.setIsDelete(false);
cp.setInsertTime(LocalDateTime.now());
cp.setUpdateTime(LocalDateTime.now());
cp.setName(next.getString("name"));
cp.setLatitude(next.getDouble("latitude"));
cp.setLongitude(next.getDouble("longitude"));
list.add(cp);
}
geexekScoreService.batchInsert(list);
int count = roadService.saveOrUpdate(road); int count = roadService.saveOrUpdate(road);
return Result.success().setContent(road); return Result.success().setContent(road);
} }
...@@ -76,12 +124,8 @@ public class RoadController { ...@@ -76,12 +124,8 @@ public class RoadController {
@RequestMapping("gps") @RequestMapping("gps")
@ResponseBody @ResponseBody
public Result gps(String url, Integer roadId, Integer cmptId) { public Result gps(String url, Integer roadId, Integer cmptId) {
String json = roadService.loadGpsFromNet(url); RoadGpsPoint gps = roadService.getGps(roadId);
RoadGpsPoint roadGpsPoint = new RoadGpsPoint(). return Result.success().setContent(gps);
setPoints(json).setRoadId(roadId)
.setCmptId(cmptId);
roadService.saveGps(roadGpsPoint);
return Result.success().setContent(roadGpsPoint);
} }
@RequestMapping("gps/{roadId}") @RequestMapping("gps/{roadId}")
......
package com.dlbridge.jadp.plugins.cmpt.web; package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.feign.GeexekScoreService;
import com.dlbridge.feign.bean.CmptScoreCheckpoint;
import com.dlbridge.jadp.common.interceptor.PageView; import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.plugins.cmpt.bean.Road; import com.dlbridge.jadp.plugins.cmpt.bean.Road;
import com.dlbridge.jadp.plugins.cmpt.bean.RoadsGpsCheckpointMap; import com.dlbridge.jadp.plugins.cmpt.bean.RoadsGpsCheckpointMap;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt; import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.*; import com.dlbridge.jadp.plugins.cmpt.service.*;
import com.dlbridge.jadp.plugins.cmpt.utils.QRCodeUtil; import com.dlbridge.jadp.plugins.cmpt.utils.QRCodeUtil;
import com.neusoft.www.utils.web.Result;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
...@@ -38,20 +42,12 @@ public class ScanController { ...@@ -38,20 +42,12 @@ public class ScanController {
@Resource @Resource
private CmptService cmptService; private CmptService cmptService;
@Resource
private CmptScoreFieldService cmptScoreFieldService;
@Resource
private CmptScoreFieldValueService cmptScoreFieldValueService;
@Resource
private CmptScoreRuleService ruleService;
@Resource @Resource
RemoteService remoteService; RemoteService remoteService;
@Resource
ScanService scanService;
@Resource
GeexekScoreService geexekScoreService;
/** /**
* 返回扫描打卡的设置页面 * 返回扫描打卡的设置页面
* @param cmptId * @param cmptId
...@@ -66,9 +62,19 @@ public class ScanController { ...@@ -66,9 +62,19 @@ public class ScanController {
mv.setViewName("cmpt/scan"); mv.setViewName("cmpt/scan");
mv.addObject("cmpt", cmpt); mv.addObject("cmpt", cmpt);
mv.addObject("roads", roads); mv.addObject("roads", roads);
int count = geexekScoreService.hasCheckPoint(cmptId);
mv.addObject("hasCp", count > 0);
return mv; return mv;
} }
@RequestMapping("hasCheckPoint/{cmptId}")
@ResponseBody
public Result hasCheckPoint(@PathVariable("cmptId") Integer cmptId){
int count = geexekScoreService.hasCheckPoint(cmptId);
return Result.success().setContent(count);
}
/** /**
* 根据赛事id或者项目Id,获取全部的二维码图片,下载zip文件 * 根据赛事id或者项目Id,获取全部的二维码图片,下载zip文件
* @param httpServletRequest * @param httpServletRequest
...@@ -79,49 +85,52 @@ public class ScanController { ...@@ -79,49 +85,52 @@ public class ScanController {
* @throws Exception * @throws Exception
*/ */
@GetMapping("downLoadAllQRByRoadId/{cmptId}/{roadId}") @GetMapping("downLoadAllQRByRoadId/{cmptId}/{roadId}")
public void downLoadAllQRByRoadId(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, @PathVariable("cmptId") int cmptId,@PathVariable("roadId") int roadId) { public void downLoadAllQRByRoadId(@PathVariable("cmptId") int cmptId,
@PathVariable("roadId") int roadId,
HttpServletResponse httpServletResponse) {
//获取项目的名字 //获取项目的名字
HashMap<String,Object> roadinfo= remoteService.getRoadinfoByroadId(cmptId,roadId); HashMap<String, Object> roadinfo = remoteService.getRoadinfoByroadId(cmptId, roadId);
String roadName=(String)roadinfo.get("roadName"); String roadName = (String) roadinfo.get("roadName");
//获取赛事logo放在二维码中间 //获取赛事logo放在二维码中间
Cmpt cmpt=cmptService.queryCmptBycmptId(cmptId); Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId);
String logostr=cmpt.getLogo(); String logostr = cmpt.getLogo();
HttpURLConnection httpUrl = null; HttpURLConnection httpUrl = null;
BufferedImage logoimg=null; BufferedImage logoimg = null;
try { try {
if(logostr!=null && logostr.isEmpty()) { if (logostr != null && logostr.isEmpty()) {
URL url = new URL(logostr); URL url = new URL(logostr);
httpUrl = (HttpURLConnection) url.openConnection(); httpUrl = (HttpURLConnection) url.openConnection();
httpUrl.connect(); httpUrl.connect();
InputStream in = httpUrl.getInputStream(); InputStream in = httpUrl.getInputStream();
logoimg = ImageIO.read(in); logoimg = ImageIO.read(in);
} }
//导出zip文件的名字 //导出zip文件的名字
String zipName=new String(roadName.getBytes(),"ISO-8859-1") + ".zip"; String zipName = new String(roadName.getBytes(), "ISO-8859-1") + ".zip";
//定义返回zip文件的输出流格式 //定义返回zip文件的输出流格式
httpServletResponse.setContentType("application/zip"); httpServletResponse.setContentType("application/zip");
//设置heard头 //设置heard头
httpServletResponse.setHeader("Content-disposition","attachment; filename=" +zipName ); httpServletResponse.setHeader("Content-disposition", "attachment; filename=" + zipName);
//将文件的输出流放在zip输出流中,以zip格式输出 //将文件的输出流放在zip输出流中,以zip格式输出
OutputStream outputStream = httpServletResponse.getOutputStream(); OutputStream outputStream = httpServletResponse.getOutputStream();
ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream); ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream);
//获取这个项目有多少打卡点,生成相应的二维码 //获取这个项目有多少打卡点,生成相应的二维码
List<RoadsGpsCheckpointMap> roadsGpsCheckpointMapList=remoteService.getTimeCheckpointByRoadId(cmptId,roadId); List<CmptScoreCheckpoint> checkPoints = geexekScoreService.getCheckPointByRoadId(roadId);
for(int i=0;i<roadsGpsCheckpointMapList.size();i++){ for (int i = 0; i < checkPoints.size(); i++) {
int checkpointId=roadsGpsCheckpointMapList.get(i).getCheckpointId(); int checkpointId = checkPoints.get(i).getCheckpointId();
String checkpointName=roadsGpsCheckpointMapList.get(i).getCheckpointName(); String checkpointName = checkPoints.get(i).getName();
BufferedImage buffImg = QRCodeUtil.getBufferedImage(logoimg, String.valueOf(checkpointId)); BufferedImage buffImg = QRCodeUtil.getBufferedImage(logoimg, String.valueOf(checkpointId));
ZipEntry entry = new ZipEntry(checkpointName+".png"); ZipEntry entry = new ZipEntry(checkpointName + ".png");
zipOutputStream.putNextEntry(entry); zipOutputStream.putNextEntry(entry);
ImageIO.write(buffImg, "png", zipOutputStream); ImageIO.write(buffImg, "png", zipOutputStream);
} }
//zip文件流执行完,将各种流关闭 //zip文件流执行完,将各种流关闭
zipOutputStream.flush(); zipOutputStream.flush();
zipOutputStream.close(); zipOutputStream.close();
outputStream.flush(); outputStream.flush();
outputStream.close(); outputStream.close();
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); log.info(e.getMessage(), e);
} }
} }
......
package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.job.CountJob;
import com.dlbridge.jadp.plugins.cmpt.bean.Album;
import com.dlbridge.jadp.plugins.cmpt.bean.Banner;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.AlbumService;
import com.dlbridge.jadp.plugins.cmpt.service.BannerService;
import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
@Log4j2
@RequestMapping("gk/rule/")
@ApiIgnore
public class ScoreSettingController {
@Resource
private CmptService cmptService;
@Resource
BannerService bannerService;
@Resource
ValueOperations valueOperations;
@RequestMapping("index/{cmptId}")
@PageView
public ModelAndView getAlbumCounts(@PathVariable("cmptId") Integer cmptId, ModelAndView mv) {
Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId);
mv.addObject("cmpt", cmpt);
mv.setViewName("cmpt/scoreSetting");
return mv;
}
}
package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.BannerService;
import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
import lombok.extern.log4j.Log4j2;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
@Controller
@Log4j2
@RequestMapping("gk/data/")
@ApiIgnore
public class ScoreStatisticController {
@Resource
private CmptService cmptService;
@RequestMapping("index/{cmptId}")
@PageView
public ModelAndView getAlbumCounts(@PathVariable("cmptId") Integer cmptId, ModelAndView mv) {
Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId);
mv.addObject("cmpt", cmpt);
mv.setViewName("cmpt/statistic");
return mv;
}
}
package com.dlbridge.jadp.plugins.cmpt.web;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Log4j2
public class TestController {
@Value("${server.port}")
private String port;
@RequestMapping("/api/test")
@ResponseBody
public String test(){
log.info(port);
return port;
}
@RequestMapping("/gksite/test")
@ResponseBody
public String gksite(){
log.info(port);
return port;
}
}
package com.dlbridge.jadp.plugins.score.bean;
public class ScoreRule {
}
...@@ -28,13 +28,10 @@ spring.mvc.view.prefix=/WEB-INF/views/ ...@@ -28,13 +28,10 @@ spring.mvc.view.prefix=/WEB-INF/views/
spring.mvc.view.suffix=.jsp spring.mvc.view.suffix=.jsp
spring.freemarker.template-loader-path=classpath:/templates spring.freemarker.template-loader-path=classpath:/templates
spring.resources.static-locations=/static/ spring.resources.static-locations=/static/
spring.mvc.static-path-pattern=/**
spring.resources.cache.cachecontrol.no-cache=true spring.resources.cache.cachecontrol.no-cache=true
spring.resources.cache.period=0 spring.resources.cache.period=0
spring.resources.chain.cache=false spring.resources.chain.cache=false
spring.mvc.static-path-pattern=/**
spring.resources.chain.strategy.fixed.enabled=true
spring.resources.chain.strategy.fixed.paths=/**
spring.resources.chain.strategy.fixed.version=1.1.0
##scheduler ##scheduler
spring.task.scheduler.pool=10 spring.task.scheduler.pool=10
spring.task.thread=spring-task-thread spring.task.thread=spring-task-thread
...@@ -51,8 +48,8 @@ spring.data.web.pageable.default-page-size=10 ...@@ -51,8 +48,8 @@ spring.data.web.pageable.default-page-size=10
spring.data.web.pageable.max-page-size=100 spring.data.web.pageable.max-page-size=100
weixin.micro.appid=wx96ce27826f39cdb3 weixin.micro.appid=wx96ce27826f39cdb3
weixin.micro.secret=11bfc4902e7c992b57a2cdcfeded623f weixin.micro.secret=11bfc4902e7c992b57a2cdcfeded623f
geexek.user.url=http://test.geexek.com.cn/ geexek.user.url=https://test.geexek.com.cn/
geexek.cmpt.url=http://testtimerbackend.geexek.cn/ geexek.cmpt.url=https://testtimerbackend.geexek.cn/
geexek.shamus.url=http://shamus.geexek.com.cn/ geexek.shamus.url=http://shamus.geexek.com.cn/
timer.url=http://testtimer.geexek.cn/ timer.url=http://testtimer.geexek.cn/
...@@ -68,8 +65,10 @@ spring.servlet.multipart.max-file-size=10Mb ...@@ -68,8 +65,10 @@ spring.servlet.multipart.max-file-size=10Mb
spring.servlet.multipart.enabled=true spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-request-size=50Mb spring.servlet.multipart.max-request-size=50Mb
spring.application.name=micro-gksite spring.application.name=micro-gksite
eureka.client.service-url.defaultZone=http://eureka.geexek.com.cn/eureka/ spring.cloud.nacos.server-addr=http://nacos.geexek.com.cn
eureka.client.instance.instance-id=gksite management.endpoints.web.exposure.include=*
spring.cloud.nacos.discovery.namespace=dev
spring.cloud.nacos.discovery.group=dev
#feign调用连接超时时间 #feign调用连接超时时间
feign.client.config.default.connect-timeout=30000 feign.client.config.default.connect-timeout=30000
#feign调用读取超时时间 #feign调用读取超时时间
......
...@@ -43,8 +43,8 @@ pagehelper.supportMethodsArguments=true ...@@ -43,8 +43,8 @@ pagehelper.supportMethodsArguments=true
pagehelper.params=count=countSql pagehelper.params=count=countSql
weixin.micro.appid=wx96ce27826f39cdb3 weixin.micro.appid=wx96ce27826f39cdb3
weixin.micro.secret=11bfc4902e7c992b57a2cdcfeded623f weixin.micro.secret=11bfc4902e7c992b57a2cdcfeded623f
geexek.user.url=http://test.geexek.com.cn/ geexek.user.url=https://test.geexek.com.cn/
geexek.cmpt.url=http://testtimerbackend.geexek.cn/ geexek.cmpt.url=https://testtimerbackend.geexek.cn/
geexek.shamus.url=http://shamus.geexek.com.cn/ geexek.shamus.url=http://shamus.geexek.com.cn/
timer.url=http://testtimer.geexek.cn/ timer.url=http://testtimer.geexek.cn/
server.url=http://testzs.geexek.com.cn/ server.url=http://testzs.geexek.com.cn/
...@@ -55,16 +55,19 @@ spring.servlet.multipart.max-file-size=1500Mb ...@@ -55,16 +55,19 @@ spring.servlet.multipart.max-file-size=1500Mb
spring.servlet.multipart.enabled=true spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-request-size=50Mb spring.servlet.multipart.max-request-size=50Mb
spring.application.name=micro-gksite spring.application.name=micro-gksite
eureka.client.service-url.defaultZone=http://eureka238.com:8020/eureka/,http://eureka234.com:8020/eureka/ spring.cloud.nacos.server-addr=http://nacos.geexek.com.cn
eureka.client.instance.instance-id=gksite spring.cloud.nacos.discovery.group=test
management.endpoints.web.exposure.include=*
#feign调用连接超时时间 #feign调用连接超时时间
feign.client.config.default.connect-timeout=1000 feign.client.config.default.connect-timeout=1000
#feign调用读取超时时间 #feign调用读取超时时间
feign.client.config.default.readTimeout=1000 feign.client.config.default.readTimeout=1000
#feign调用的log 等级 #feign调用的log 等级
feign.client.config.default.loggerLevel=full feign.client.config.default.loggerLevel=full
feign.okhttp.enabled=true feign.okhttp.enabled=true
feign.hystrix.enabled=true feign.hystrix.enabled=true
ribbon.okhttp.enabled=true
ribbon.restclient.enabled=true
#feign.compression.request.enabled=true #feign.compression.request.enabled=true
#feign.compression.request.mime-types=text/xml,application/xml,application/json #feign.compression.request.mime-types=text/xml,application/xml,application/json
#feign.compression.request.min-request-size=2048 #feign.compression.request.min-request-size=2048
......
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!doctype html>
<html>
<head>
<title>完赛证书</title>
<!-- Bootstrap CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/font-awesome/css/font-awesome.min.css">
<!-- Fontastic Custom icon font-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/fontastic.css">
<!-- Google fonts - Poppins -->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/font-css.css">
<!-- theme stylesheet-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/style.default.css" id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/juery-ui-1.12.css">
<!-- Favicon-->
<link rel="shortcut icon" href="img/favicon.ico">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/main.css">
<link rel="stylesheet" href="${ctxStatic}/cmpt/setting.css">
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet.css?v=<%=System.currentTimeMillis()%>"/>
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet_label.css"/>
<link rel="stylesheet" href="${ctxStatic}/cmpt/road.css"/>
<link rel="stylesheet" href="${ctxStatic}/cmpt/road-new.css"/>
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script>
<script src="${ctxStatic}/newdermon/js/jquery-ui.js"></script>
<script type="text/javascript" src="${ctxStatic}/leaflet/leaflet.js"></script>
<script type="text/javascript" src="${ctxStatic}/leaflet/label.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctxStatic}/layer/layer.js"></script>
<link rel="stylesheet" href="${ctxStatic}/layer/skin/layer.css">
<style>
.btn{
cursor: pointer;
}
.download{
width: 146px;
height: 40px;
background: rgba(206,57,57,1);
border-radius: 4px;
position: absolute;
right: 40px;
top: 20px;
line-height: 40px;
font-size: 18px;
margin: 0px;
font-weight: initial;
color: white;
text-align: center;
cursor: pointer;
}
.title-new{
padding: 15px!important;
height: auto!important;
position: relative;
}
.road-notice{
margin: 0px 5px;
width: 18px;
height: 18px;
}
.section{
background: white;
padding: 20px;
margin: 20px 0px 0px 0px;
border-radius: 4px;
}
.section label{
font-size:20px;
font-weight:500;
color:rgba(51,51,51,1);
}
.section span{
font-size: 20px;
color: #333;
}
.section li{
list-style: none;
margin: 4px 0px;
}
</style>
</head>
<body>
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
<jsp:include page="../common/menu.jsp"></jsp:include>
<div class="rght">
<div class="force">
<div class="title-new" style="background:rgba(255,255,255,1)!important;">
<div>
<span class="title-txt">赛事广告</span>
</div>
<div>
<span class="road-notice"></span>
<span style="font-size: 16px;color: #ce3939;margin-left: 5px;font-weight: normal;">制作证书需要使用指定的软件(目前仅提供Windows系统) </span>
</div>
<span class="download ">下载</span>
</div>
<div class="section">
<label for="">容制作步骤</label>
<ul>
<li><span style="transform: scale(1.2);margin-right: 5px">❶</span> 登录:用平台账户登录;</li>
<li><span style="transform: scale(1.2);margin-right: 5px">❷</span> 证书模板:点击 <span style="background:rgba(246,194,194,0.5);">‘插入电子证书模板’</span> 载入证书底图,如同标注‘2’所示;</li>
<li><span style="transform: scale(1.2);margin-right: 5px">❸</span> 文字设置:设置 <span style="background:rgba(246,194,194,0.5);"> 字体 大小、颜色、字体类型</span>,如图标注‘3’所示;</li>
<li><span style="transform: scale(1.2);margin-right: 5px">❹</span> 将【姓名】【号码牌】【项目名称】【备用显示项】<span style="background:rgba(246,194,194,0.5);">从左侧内容栏拖放到证书上的相应位置</span>, 如图标注‘4’所示。</li>
</ul>
</div>
<img src="/static/images/manage/demo1.png" style="width: 1044px;" alt="">
<div class="section">
<label for="">效果验证</label>
<ul>
<li><span style="transform: scale(1.2);margin-right: 5px">❶</span> 配置好证书并成功保存;</li>
<li><span style="transform: scale(1.2);margin-right: 5px">❷</span> 启用:‘完赛证书’,‘手机绑定’功能; </li>
<li><span style="transform: scale(1.2);margin-right: 5px">❸</span> 扫赛事专属小程序码,进入赛事首页,用参赛手机号进行绑定,可以看到‘完赛证书’功能,如图所示;</li>
<li><span style="transform: scale(1.2);margin-right: 5px">❹</span> 完成成绩提交并审核通过后,可以点击‘完赛证书’按钮,查看证书的最终效果,如图所示。</li>
</ul>
</div>
<img src="/static/images/manage/demo2.png" style="width: 1044px;" alt="">
</div>
</div>
</div>
</body>
</html>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<div id="map" class="map"></div> <div id="map" class="map"></div>
<div class="map-data"> <div class="map-data">
<div class="flex" style="justify-content: space-between"> <div class="flex" style="justify-content: space-between">
<label class="marker-label">标准列表</label> <label class="marker-label">标注列表</label>
<div class="flex" style="align-items: center"> <div class="flex" style="align-items: center">
<span class="cancel">取消</span> <span class="cancel">取消</span>
<span class="save">保存</span> <span class="save">保存</span>
...@@ -117,7 +117,10 @@ ...@@ -117,7 +117,10 @@
</div> </div>
<div class="markers-edit"> <div class="markers-edit">
<span style="font-size: 12px;color: rgba(153,153,153,1);display: inline-block; width: 100%; text-align: right;">用作<br/>计时点</span> <div style="display: flex">
<span class="edit-tip-distance">里程</span>
<span class="edit-tip-cp">用作<br/>计时点</span>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
line-height: 33px; line-height: 33px;
} }
.road-name{ .road-name{
width: 860px; width: 960px;
height: 70px; height: 70px;
background: rgba(250,250,250,1); background: rgba(250,250,250,1);
border-radius: 4px; border-radius: 4px;
...@@ -84,10 +84,40 @@ ...@@ -84,10 +84,40 @@
margin: 10px 0px; margin: 10px 0px;
padding: 0px 20px; padding: 0px 20px;
} }
.notice {
vertical-align: middle;
background: url(/static/images/notice.png);
width: 18px;
display: inline-block;
height: 18px;
background-repeat: no-repeat;
-webkit-background-size: contain;
background-size: contain;
margin-bottom: 5px;
}
.tip-section{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
margin-top: 50px;
}
.tip-section span{
font-size:20px;
text-align: center;
color:rgba(206,57,57,1);
}
</style> </style>
</head> </head>
<body> <body>
<jsp:include page="../common/header.jsp"></jsp:include> <jsp:include page="../common/header.jsp"></jsp:include>
<c:if test="${!hasCp}">
<style>
.title,.road-text,.down {
color: #999;
}
</style>
</c:if>
<div class="page-content d-flex align-items-stretch main-body"> <div class="page-content d-flex align-items-stretch main-body">
<jsp:include page="../common/menu.jsp"></jsp:include> <jsp:include page="../common/menu.jsp"></jsp:include>
<div class="rght"> <div class="rght">
...@@ -99,15 +129,22 @@ ...@@ -99,15 +129,22 @@
<div class="road-name ${idx.index==0?'active':''}" road-id="${item.roadId}"> <div class="road-name ${idx.index==0?'active':''}" road-id="${item.roadId}">
<input type="hidden" id="roadId" name="roadId" value="${item.roadId}"> <input type="hidden" id="roadId" name="roadId" value="${item.roadId}">
<span class="road-text">${item.name}</span> <span class="road-text">${item.name}</span>
<span class="down QRCodeDown">下载全部二维码</span> <span class="down QRCodeDown" data-hasCp="${hasCp}">下载全部二维码</span>
</div> </div>
</c:forEach> </c:forEach>
</div> </div>
</div> </div>
<div style="display: flex;justify-content: center; margin: 60px;">
<span class=" save-btn">保存</span>
</div>
<div class="tip-section" style="display: ${hasCp ? 'none':'flex'}">
<div>
<span class="notice"></span>
<span>当前功能无法启用</span>
</div>
<span>请先到‘路线导入’页面导入路线,并且路线除了起终点外至少要有1个标注,<br/> ‘路线导入’的入口位置如下图所示</span>
<img style="width: 400px" src="/static/images/manage/demo3.png" alt="">
</div>
</div> </div>
<script src="${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"></script> <script src="${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"></script>
......
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!doctype html>
<html>
<head>
<title>成绩规则</title>
<!-- Bootstrap CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/font-awesome/css/font-awesome.min.css">
<!-- Fontastic Custom icon font-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/fontastic.css">
<!-- Google fonts - Poppins -->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/font-css.css">
<!-- theme stylesheet-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/style.default.css" id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/juery-ui-1.12.css">
<!-- Favicon-->
<link rel="shortcut icon" href="img/favicon.ico">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/main.css">
<link rel="stylesheet" href="${ctxStatic}/cmpt/setting.css">
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet.css?v=<%=System.currentTimeMillis()%>"/>
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet_label.css"/>
<link rel="stylesheet" href="${ctxStatic}/cmpt/road.css"/>
<link rel="stylesheet" href="${ctxStatic}/cmpt/road-new.css"/>
<script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctxStatic}/layer/layer.js"></script>
<link rel="stylesheet" href="${ctxStatic}/layer/skin/layer.css">
<link rel="stylesheet" href="/static/cmpt/score.css?<%=System.currentTimeMillis()%>">
<style>
input[type=checkbox]::before{
border:2px solid rgba(102,102,102,1);
}
input[type=checkbox] {
position: relative;
top: -2px;
left: -10px;
}
input[type=radio] {
position: relative;
top: -14px;
left: 26px;
width: 1px;
height: 1px;
cursor: pointer;
}
input[type=radio]::before {
position: absolute;
content: '';
width: 24px;
height: 24px;
border:2px solid rgba(153,153,153,1);
border-radius: 50%;
left: 0px;
top: 0px;
}
input[type=radio]:checked::before{
border:none;
}
input[type=radio]:checked::after {
position: absolute;
content: '';
width: 24px;
height: 24px;
background: url('/static/images/manage/radio_selected.png') no-repeat center;
border-radius: 50%;
left: 2px;
top: 2px;
background-size: 100%;
}
.setting-item{
width:880px;
height:75px;
background:rgba(255,255,255,1);
border-radius:4px;
border:1px solid rgba(229,229,229,1);
display: flex;
align-items: center;
}
</style>
</head>
<body>
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
<jsp:include page="../common/menu.jsp"></jsp:include>
<div class="rght">
<div class="section">
<div style="display: flex;justify-content: space-between;align-items: center;">
<h3 class="title">成绩规则</h3>
<div>
<input type="checkbox" >
<span style="font-size:20px;color: #333;">是定向赛,没有固定打卡顺序。</span>
</div>
</div>
<div class="data">
<div class="setting-item">
<input type="radio" name="rule">
<span style="font-size:20px;color: #333;margin-left: 75px;">仅记录一次成绩,此成绩为最终成绩。</span>
</div>
<div class="setting-item">
<input type="radio" name="rule">
<span style="font-size:20px;color: #333;margin-left: 75px;">允许记录多次成绩,取所有成绩中的最佳成绩作为最终成绩。</span>
</div>
<div class="setting-item">
<input type="radio" name="rule">
<span style="font-size:20px;color: #333;margin-left: 75px;">允许记录多次成绩,取所有成绩之和,即总跑量,作为最终成绩。</span>
</div>
</div>
</div>
<div class="section" style="display: flex;justify-content: space-between;align-items: center;">
<span style="font-size:24px;color: #333">榜单设置</span>
<div>
<input type="checkbox">
<span style="font-size:20px;color: #333">启用日榜</span>
</div>
</div>
</div>
</div>
<script src="${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"></script>
<script src="${ctxStatic}/js/qikoo.js"></script>
</body>
</html>
\ No newline at end of file
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!doctype html>
<html>
<head>
<title>扫码打卡</title>
<!-- Bootstrap CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/font-awesome/css/font-awesome.min.css">
<!-- Fontastic Custom icon font-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/fontastic.css">
<!-- Google fonts - Poppins -->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/font-css.css">
<!-- theme stylesheet-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/style.default.css" id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/juery-ui-1.12.css">
<!-- Favicon-->
<link rel="shortcut icon" href="img/favicon.ico">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/main.css">
<link rel="stylesheet" href="${ctxStatic}/cmpt/setting.css">
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet.css?v=<%=System.currentTimeMillis()%>"/>
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet_label.css"/>
<link rel="stylesheet" href="${ctxStatic}/cmpt/road.css"/>
<link rel="stylesheet" href="${ctxStatic}/cmpt/road-new.css"/>
<script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctxStatic}/layer/layer.js"></script>
<link rel="stylesheet" href="${ctxStatic}/layer/skin/layer.css">
<link rel="stylesheet" href="/static/cmpt/score.css?<%=System.currentTimeMillis()%>">
<style>
.title{
width: 192px;
height: 33px;
font-size: 24px;
font-family: PingFangSC-Medium,PingFang SC;
font-weight: 500;
color: rgba(51,51,51,1);
line-height: 33px;
}
.road-name{
width: 960px;
height: 70px;
background: rgba(250,250,250,1);
border-radius: 4px;
line-height: 70px;
padding: 0px 40px 0px 20px;
margin-bottom: 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
.road-text{
width:93px;
height:28px;
font-size:20px;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(51,51,51,1);
line-height:28px;
}
.down{
width:105px;
height:21px;
font-size:15px;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(206,57,57,1);
cursor: pointer;
line-height:21px;
}
.data label{
height: 22px;
font-size: 16px;
font-family: PingFangSC-Medium,PingFang SC;
font-weight: 500;
color: rgba(153,153,153,1);
line-height: 22px;
margin: 10px 0px;
padding: 0px 20px;
}
.notice {
vertical-align: middle;
background: url(/static/images/notice.png);
width: 18px;
display: inline-block;
height: 18px;
background-repeat: no-repeat;
-webkit-background-size: contain;
background-size: contain;
margin-bottom: 5px;
}
.tip-section{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
margin-top: 50px;
}
.tip-section span{
font-size:20px;
text-align: center;
color:rgba(206,57,57,1);
}
</style>
</head>
<body>
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
<jsp:include page="../common/menu.jsp"></jsp:include>
<div class="rght">
<div class="section">
<h3 class="title">打卡点二维码下载</h3>
<div class="data">
<label for="">项目</label>
<c:forEach var="item" items="${roads}" varStatus="idx">
<div class="road-name ${idx.index==0?'active':''}" road-id="${item.roadId}">
<input type="hidden" id="roadId" name="roadId" value="${item.roadId}">
<span class="road-text">${item.name}</span>
<span class="down QRCodeDown">下载全部二维码</span>
</div>
</c:forEach>
</div>
</div>
<div class="tip-section">
<div>
<span class="notice"></span>
<span>当前功能无法启用</span>
</div>
<span>请先到‘路线导入’页面导入路线,并且路线除了起终点外至少要有1个标注,<br/> ‘路线导入’的入口位置如下图所示</span>
<img style="width: 400px" src="/static/images/manage/demo3.png" alt="">
</div>
</div>
<script src="${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"></script>
<script src="${ctxStatic}/js/qikoo.js"></script>
<script src="${ctxStatic}/js/scan.js"></script>
</body>
</html>
\ No newline at end of file
...@@ -167,10 +167,12 @@ ...@@ -167,10 +167,12 @@
<span class="menu-txt">扫码打卡</span> <span class="menu-txt">扫码打卡</span>
</a> </a>
</li> </li>
<li class="review menu-sub-item">
<a href="/gk/review/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<li class="cert menu-sub-item">
<a href="/gk/cert/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="left-arrow"></span> <span class="left-arrow"></span>
<span class="menu-txt">成绩审核</span> <span class="menu-txt">完赛证书</span>
</a> </a>
</li> </li>
<li class="customer menu-sub-item"> <li class="customer menu-sub-item">
...@@ -210,15 +212,32 @@ ...@@ -210,15 +212,32 @@
<span class="menu-txt">相册设置</span> <span class="menu-txt">相册设置</span>
</a> </a>
</li> </li>
<li class="rule menu-sub-item">
<a href="/gk/rule/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="left-arrow"></span>
<span class="menu-txt">成绩规则</span>
</a>
</li>
<li class="review menu-sub-item">
<a href="/gk/review/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="left-arrow"></span>
<span class="menu-txt">成绩管理</span>
</a>
</li>
<li class="data menu-sub-item">
<a href="/gk/data/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="left-arrow"></span>
<span class="menu-txt">成绩统计</span>
</a>
</li>
</ul> </ul>
</li> </li>
</ul> </ul>
</nav> </nav>
<script> <script>
var classes = ['cmptSetting', 'nameList', 'manual', 'contact', var classes = ['cmptSetting', 'nameList', 'manual', 'contact','manage',
'route', 'road', 'equip', 'photo', 'news', 'route', 'road', 'equip', 'photo', 'news','cert','data',
'banner','score','auto','scan','review','customer']; 'banner','score','auto','scan','review','customer','rule'];
let url = document.location.href; let url = document.location.href;
var done = false; var done = false;
for (var i in classes) { for (var i in classes) {
......
.force .title-new { .force .title-new {
width: 959px; width: 1038px;
height: 30px; height: 30px;
background: #F6F6F6 !important; background: #F6F6F6 !important;
border-radius: 4px; border-radius: 4px;
......
.force .title-new { .force .title-new {
width: 959px; width: 1038px;
height: 30px; height: 30px;
background: #F6F6F6 !important; background: #F6F6F6 !important;
border-radius: 4px; border-radius: 4px;
......
...@@ -89,8 +89,30 @@ ...@@ -89,8 +89,30 @@
right: 4px; right: 4px;
left: auto; left: auto;
} }
.marker input[type=text]{ .edit-tip-cp{
width: 220px; font-size: 12px;
color: rgba(153,153,153,1);
text-align: right;
flex: 1;
}
.edit-tip-distance{
font-size: 12px;
color: rgba(153,153,153,1);
display: inline-block;
text-align: right;
flex: 4;
line-height: 35px;
}
.marker input[type=text]:first-child{
width: 160px;
height: 50px;
background: rgba(247,247,247,1);
border-radius: 4px;
border: 1px solid rgba(238,238,238,1);
padding: 0px 10px 0px;
}
.marker input:nth-child(2n){
width: 80px;
height: 50px; height: 50px;
background: rgba(247,247,247,1); background: rgba(247,247,247,1);
border-radius: 4px; border-radius: 4px;
......
.section{ .section{
width: 910px; width: 1010px;
background: white; background: white;
padding: 20px 25px; padding: 20px 25px;
margin: 10px 0px; margin: 10px 0px;
......
...@@ -32,20 +32,25 @@ $(document).ready(function () { ...@@ -32,20 +32,25 @@ $(document).ready(function () {
}); });
$('body').on('click', '.save', function () { $('body').on('click', '.save', function () {
var id = $(this).attr('data-id');
var type = $(this).parents('.equip-container').attr('data-type');
var name = $(this).prev().val();
var obj = $(this); var obj = $(this);
var param = [];
$.each($('.markers-edit .marker'),function (i,e) {
var obj = {};
obj.checkpointId = $(e).attr('data-checkpointid');
obj.distance = $(e).find('input[type=number]').val();
obj.isTime = $(e).find('input[type=checkbox]').get(0).checked;
obj.name = $(e).find('input[type=text]').val();
param.push(obj)
})
console.log(JSON.stringify(param));
$.ajax({ $.ajax({
url: '/gk/equip/save', url: '/gk/road/saveCheckPoint',
type: 'post', type: 'post',
data: {roadId: id, name: name, type: type, cmptId: getCmptId()}, contentType:'application/json',
data: JSON.stringify(param),
success: function (data) { success: function (data) {
if (data.status) { if(data.code == 200){
obj.attr('data-id', data.content.id); layer.msg('保存成功', {icon: 1, time: 1500});
layer.msg('操作成功', {icon: 1, time: 1500});
} else {
layer.msg('操作失败', {icon: 5, time: 1500});
} }
}, error: function () { }, error: function () {
layer.msg('操作失败', {icon: 5, time: 1500}); layer.msg('操作失败', {icon: 5, time: 1500});
...@@ -78,7 +83,10 @@ $(document).ready(function () { ...@@ -78,7 +83,10 @@ $(document).ready(function () {
if (id) { if (id) {
getPath(id); getPath(id);
} }
$.ajax({ $('.map-container').css('transform', 'none');
$('.map-container').attr('data-id', id);
$('.force').hide();
/*$.ajax({
url: '/gk/road/save', url: '/gk/road/save',
data: { data: {
'roadId': id, 'roadId': id,
...@@ -97,7 +105,7 @@ $(document).ready(function () { ...@@ -97,7 +105,7 @@ $(document).ready(function () {
$('.force').hide(); $('.force').hide();
} }
} }
}) })*/
}); });
$('body').on('click','.map-data .edit',function () { $('body').on('click','.map-data .edit',function () {
...@@ -115,17 +123,13 @@ $(document).ready(function () { ...@@ -115,17 +123,13 @@ $(document).ready(function () {
$('.edit').show(); $('.edit').show();
}) })
$('body').on('click','.map-data .save',function () { /*$('body').on('click','.map-data .save',function () {
$('.save').hide(); $('.save').hide();
$('.cancel').hide(); $('.cancel').hide();
$('.markers').fadeIn(); $('.markers').fadeIn();
$('.markers-edit').fadeOut(); $('.markers-edit').fadeOut();
$('.edit').show(); $('.edit').show();
// 更新数据 });*/
/*$.ajax({
})*/
})
}) })
//文件上传处理 //文件上传处理
...@@ -168,8 +172,7 @@ function uploadFile(obj) { ...@@ -168,8 +172,7 @@ function uploadFile(obj) {
function loadGps(fileurl) { function loadGps(fileurl) {
$.ajax({ $.ajax({
url: '/gk/road/gps', url: '/gk/road/gps/'+$('.map-container').attr('data-id'),
data: {url: fileurl, roadId: $('.map-container').attr('data-id'), cmptId: getCmptId()},
success: function (data) { success: function (data) {
console.log(data); console.log(data);
createPath(data.content); createPath(data.content);
...@@ -196,6 +199,7 @@ function saveRoad(id, fileName, fileUrl, fileSize) { ...@@ -196,6 +199,7 @@ function saveRoad(id, fileName, fileUrl, fileSize) {
$('.map-container').css('transform', 'none'); $('.map-container').css('transform', 'none');
$('.map-container').attr('data-id', data.content.roadId); $('.map-container').attr('data-id', data.content.roadId);
$('.force').hide(); $('.force').hide();
getPlaceMakers(id);
} }
} }
}) })
...@@ -260,15 +264,6 @@ function createPath(pathObj) { ...@@ -260,15 +264,6 @@ function createPath(pathObj) {
lineArr.push([e.latitude, e.longitude]); lineArr.push([e.latitude, e.longitude]);
}); });
$.each(points.placeMark, function (i, e) {
var myIcon1 = L.divIcon({
html: '<div class="cp-div"><span>' + e.name + '</span></div>',
iconSize: 30
});
var marker = L.marker([Number(e.latitude), Number(e.longitude)]).setIcon(myIcon1);
marker.addTo(map.instance);
layers.push(marker)
});
var polyline = L.polyline(lineArr, {stroke: true, fill: false, color: 'red', lineCap: 'none', weight: 6}); var polyline = L.polyline(lineArr, {stroke: true, fill: false, color: 'red', lineCap: 'none', weight: 6});
layers.push(polyline); layers.push(polyline);
...@@ -291,17 +286,38 @@ function getPath(roadId) { ...@@ -291,17 +286,38 @@ function getPath(roadId) {
map.initMap(); map.initMap();
if (data.status && data.content) { if (data.status && data.content) {
createPath(data.content); createPath(data.content);
if(data.content){ getPlaceMakers(roadId);
var points = JSON.parse(data.content.points);
console.log(JSON.stringify(points)) }
$.each(points.placeMark,function (i,e) { }
$('.markers').append('<div class="marker"><label for="" class="marker-name">'+e.name+'</label>\n' + })
' <span class="marker-tip">用作计时点</span></div>'); }
function getPlaceMakers(roadId) {
$.ajax({
url : '/gk/road//getCheckPoints/'+roadId,
success:function (data) {
console.log(JSON.stringify(data))
if(data.code == 200){
$.each(data.content, function (i, e) {
var myIcon1 = L.divIcon({
html: '<div class="cp-div"><span>' + e.name + '</span></div>',
iconSize: 30
});
var marker = L.marker([Number(e.latitude), Number(e.longitude)]).setIcon(myIcon1);
marker.addTo(map.instance);
layers.push(marker);
$('.markers').append('<div data-checkpointId="'+e.checkpointId+'" class="marker"><label for="" class="marker-name">'+e.name+'</label>\n' +
(e.isTime ? ' <span class="marker-tip">用作计时点</span>':'') +
'</div>');
$('.markers-edit').append('<div data-checkpointId="'+e.checkpointId+'" class="marker">' +
'<input data-before="'+e.name+'" type="text" value="'+e.name+'">' +
'<input type="number" value="'+(e.distance?e.distance:"")+'">'+
'<input type="checkbox" '+(e.isTime ? "checked=checked":"")+'></div>');
});
$('.markers-edit').append('<div class="marker"><input data-before="'+e.name+'" type="text" value="'+e.name+'"> <input type="checkbox"></div>');
})
}
} }
} }
}) })
} }
\ No newline at end of file
...@@ -14,9 +14,9 @@ $(document).ready(function () { ...@@ -14,9 +14,9 @@ $(document).ready(function () {
}); });
/** /* /!**
* 点击项目切换不同项目的配置情况 * 点击项目切换不同项目的配置情况
*/ *!/
$('body').on('click','.road-name',function () { $('body').on('click','.road-name',function () {
$('.road-name').removeClass('active'); $('.road-name').removeClass('active');
$(this).addClass("active"); $(this).addClass("active");
...@@ -24,7 +24,7 @@ $(document).ready(function () { ...@@ -24,7 +24,7 @@ $(document).ready(function () {
//获取计时系统的计时点列表 //获取计时系统的计时点列表
getTimeCp(roadId); getTimeCp(roadId);
}); });
*/
$('.save-btn').click(function () { $('.save-btn').click(function () {
var params = []; var params = [];
var roadId = $('.road-name.active').attr('road-id'); var roadId = $('.road-name.active').attr('road-id');
...@@ -61,15 +61,10 @@ $(document).ready(function () { ...@@ -61,15 +61,10 @@ $(document).ready(function () {
* 点击‘下载全部二维码’按钮,完成二维码的下载 * 点击‘下载全部二维码’按钮,完成二维码的下载
*/ */
$('.QRCodeDown').click(function () { $('.QRCodeDown').click(function () {
var hasCp = $(this).attr('data-hasCp');
if(hasCp == 'false') return;
var roadId = $('.road-name.active').attr('road-id'); var roadId = $('.road-name.active').attr('road-id');
console.log(roadId); console.log(roadId);
// $.ajax({
// type: 'GET',
// url : '/gk/scan/downLoadAllQRByRoadId/'+getCId()+"/"+roadId,
// contentType: 'application/zip',
// dataType: 'text',
// headers: {'Api-Version': '3.4'}
// });
const link = document.createElement('a') const link = document.createElement('a')
const body = document.querySelector('body') const body = document.querySelector('body')
link.href = "/gk/scan/downLoadAllQRByRoadId/"+getCId()+"/"+roadId link.href = "/gk/scan/downLoadAllQRByRoadId/"+getCId()+"/"+roadId
......
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