Commit e12abcb2 authored by daniel's avatar daniel

feat(road): 新增轨迹排序功能

parent c2cf9f8d
......@@ -40,6 +40,9 @@ public class Path {
private String createTime;
@ApiModelProperty(value = "轨迹排序", notes = "轨迹排序")
private Integer sort;
@Override
public boolean equals(Object o) {
if (this == o) {
......
......@@ -46,6 +46,12 @@ public class Road {
private String createTime;
@ApiModelProperty(value = "轨迹排序", notes = "轨迹排序")
private Integer sort;
@Override
public boolean equals(Object o) {
if (this == o) {
......
......@@ -53,4 +53,7 @@ public class RoadGpsPoint {
private double fileSize;
@ApiModelProperty(value = "排序", notes = "排序")
private Integer sort;
}
package com.dlbridge.jadp.plugins.cmpt.dao.mapper;
import com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusTicketParam;
import com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusVerifyRecordParam;
import com.dlbridge.jadp.plugins.cmpt.dto.*;
import feign.Param;
......@@ -70,5 +71,12 @@ public interface BusMapper {
*/
List<BusVerificationRecord> selectVerifyRecordByPage(BusVerifyRecordParam queryDTO);
/**
* 查询车票记录列表
* @param queryDTO 查询参数
* @return 查询车票记录列表
*/
List<BusTicketVerification> queryBusTicketByPage(BusTicketParam queryDTO);
}
......@@ -232,4 +232,19 @@
AND bvr.ticket_no = #{ticketNo}
</if>
</select>
<select id="queryBusTicketByPage" resultType="com.dlbridge.jadp.plugins.cmpt.dto.BusTicketVerification">
SELECT
*
FROM gksite.bus_ticket_verification
WHERE cmpt_id = #{cmptId}
<if test="keyword != null and keyword != '' ">
AND (ticket_no LIKE #{keyword} OR passenger_name LIKE #{keyword} OR passenger_phone LIKE #{keyword})
</if>
<if test="ticketStatus != null and ticketStatus != '' ">
AND ticket_status = #{ticketStatus}
</if>
<if test="scheduleId != null and scheduleId != ''">
AND schedule_id = #{scheduleId}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -39,4 +39,12 @@ public interface RoadMapper {
* @return 配置信息
*/
Map<String, String> getMultiRouteInfo(Integer cmptId);
/**
* 更新路线排序
* @param pathId 路线ID
* @param sort 排序
* @return 更新数量
*/
int updateGpsPathSort(int pathId, int sort);
}
......@@ -11,6 +11,7 @@
, a.id pathId
, a.path_name pathName
, a.create_time createTime
, a.sort
from gk_roads_gps a
WHERE 1=1
AND a.is_delete = 0
......@@ -35,22 +36,24 @@
</select>
<select id="queryRoadsMultiPath" resultType="com.dlbridge.jadp.plugins.cmpt.bean.Road">
select a.road_id roadId
, a.cmpt_id cmptId
, a.road_name name
, c.file_name fileName
, c.file_url fileUrl
select a.road_id roadId
, a.cmpt_id cmptId
, a.road_name name
, c.file_name fileName
, c.file_url fileUrl
, a.times
, c.file_size fileSize
, b.item_type roadType
, c.file_size fileSize
, b.item_type roadType
, case when b.item_type = 2 then '团队赛' when b.item_type = 1 then '个人赛' else '其他' end roadTypeName
, c.id pathId
, c.path_name pathName
, c.id pathId
, c.path_name pathName
, c.sort
from gk_road a
LEFT JOIN geerunner.cmpt_item b ON a.cmpt_id = b.cmpt_id AND a.road_id = b.item_id
LEFT JOIN gk_roads_gps c ON c.cmpt_id = a.cmpt_id AND a.road_id=c.road_id AND c.is_delete = 0
LEFT JOIN gk_roads_gps c ON c.cmpt_id = a.cmpt_id AND a.road_id = c.road_id AND c.is_delete = 0
WHERE a.cmpt_id = #{cmptId}
AND a.is_delete = 0
ORDER BY c.sort ASC
</select>
<update id="delete">
......@@ -82,8 +85,8 @@
</insert>
<insert id="saveGps" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
insert into gk_roads_gps(cmpt_id ,road_id,points,path_name,file_name,file_url,file_size,create_time)
values (#{cmptId},#{roadId},#{points},#{pathName},#{fileName},#{fileUrl},#{fileSize},now())
insert into gk_roads_gps(cmpt_id ,road_id,points,path_name,file_name,file_url,file_size,create_time,sort)
values (#{cmptId},#{roadId},#{points},#{pathName},#{fileName},#{fileUrl},#{fileSize},now(),#{sort})
</insert>
<update id="updateRoadGps" parameterType="com.dlbridge.jadp.plugins.cmpt.bean.RoadGpsPoint">
......@@ -94,11 +97,12 @@
, file_url=#{fileUrl}
, file_size=#{fileSize}
, create_time=now()
, sort = #{sort}
where id = #{pathId}
</update>
<select id="getGps" resultType="com.dlbridge.jadp.plugins.cmpt.bean.RoadGpsPoint">
SELECT id,cmpt_id cmptId,road_id roadId,points,path_name pathName,file_name fileName,file_url fileUrl,file_size fileSize
SELECT id,cmpt_id cmptId,road_id roadId,points,path_name pathName,file_name fileName,file_url fileUrl,file_size fileSize,sort
FROM gk_roads_gps
WHERE road_id = #{roadId}
AND id = #{pathId}
......@@ -107,7 +111,7 @@
</select>
<select id="getRoadGpsList" resultType="com.dlbridge.jadp.plugins.cmpt.bean.RoadGpsPoint">
select id,cmpt_id cmptId,road_id roadId,points,path_name pathName,file_name fileName,file_url fileUrl,file_size fileSize
select id,cmpt_id cmptId,road_id roadId,points,path_name pathName,file_name fileName,file_url fileUrl,file_size fileSize,sort
from gk_roads_gps
where road_id = #{roadId}
AND is_delete = 0
......@@ -123,7 +127,11 @@
update gk_road set times = times+1
where road_id = #{roadId}
</update>
<update id="updateGpsPathSort">
update gk_roads_gps
set sort = #{sort}
where id = #{pathId}
</update>
<select id="getMultiRouteInfo" resultType="java.util.Map">
SELECT b.cmptName, concat(b.createUserId,'') createUserId, IFNULL(c.partner_id,'') partnerId
,IFNULL(c.is_multi_route, '1') isMultiRoute
......
package com.dlbridge.jadp.plugins.cmpt.dao.model.param;
import com.dlbridge.jadp.plugins.cmpt.dto.PageDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = false)
@Data
public class BusTicketParam extends PageDTO {
private Integer cmptId;
private Integer ticketStatus;
private String keyword;
private Integer scheduleId;
}
......@@ -8,11 +8,13 @@ import lombok.Data;
@Data
public class BusVerifyStatistics {
private String scheduleName;
private Integer scheduleId;
private Integer verifyCount;
public BusVerifyStatistics() {}
public BusVerifyStatistics(String scheduleName, Integer verifyCount) {
public BusVerifyStatistics(Integer scheduleId, String scheduleName, Integer verifyCount) {
this.scheduleId = scheduleId;
this.scheduleName = scheduleName;
this.verifyCount = verifyCount;
}
......
......@@ -3,6 +3,7 @@ package com.dlbridge.jadp.plugins.cmpt.service;
import com.dlbridge.jadp.common.web.Result;
import com.dlbridge.jadp.plugins.cmpt.dao.mapper.BusMapper;
import com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusParam;
import com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusTicketParam;
import com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusVerifyRecordParam;
import com.dlbridge.jadp.plugins.cmpt.dao.model.vo.BusVerifyStatistics;
import com.dlbridge.jadp.plugins.cmpt.dto.*;
......@@ -25,6 +26,7 @@ import com.dlbridge.jadp.plugins.cmpt.utils.PageConvertUtil;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -227,18 +229,50 @@ public class BusService {
return busMapper.selectVerificationRecord(cmptId, verifierId, ticketNo);
}
// public List<BusVerifyStatistics> busVerifyStatistics(Integer cmptId) {
// List<BusVerificationRecord> records = busMapper.selectVerificationRecord(cmptId, null, null);
// Map<String, Long> scheduleCountMap = records.stream()
// .collect(Collectors.groupingBy(
// BusVerificationRecord::getScheduleName,
// Collectors.counting()
// ));
//
// // 转换为BusVerifyStatistics列表
// return scheduleCountMap.entrySet().stream()
// .map(entry -> new BusVerifyStatistics(entry.getKey(), entry.getValue().intValue()))
// .collect(Collectors.toList());
// }
/**
* 查询班车核销统计列表
* @param cmptId 赛事ID
* @return List<BusVerifyStatistics>
*/
public List<BusVerifyStatistics> busVerifyStatistics(Integer cmptId) {
List<BusVerificationRecord> records = busMapper.selectVerificationRecord(cmptId, null, null);
Map<String, Long> scheduleCountMap = records.stream()
// 按 scheduleId 和 scheduleName 进行分组统计
Map<Integer, Map<String, Long>> scheduleCountMap = records.stream()
.collect(Collectors.groupingBy(
BusVerificationRecord::getScheduleName,
Collectors.counting()
BusVerificationRecord::getScheduleId, // 按 scheduleId 分组
Collectors.groupingBy(
BusVerificationRecord::getScheduleName,
Collectors.counting()
)
));
// 转换为BusVerifyStatistics列表
return scheduleCountMap.entrySet().stream()
.map(entry -> new BusVerifyStatistics(entry.getKey(), entry.getValue().intValue()))
.collect(Collectors.toList());
// 转换为 BusVerifyStatistics 列表
List<BusVerifyStatistics> statisticsList = new ArrayList<>();
for (Map.Entry<Integer, Map<String, Long>> entry : scheduleCountMap.entrySet()) {
Integer scheduleId = entry.getKey();
for (Map.Entry<String, Long> inner : entry.getValue().entrySet()) {
String scheduleName = inner.getKey();
Integer verifyCount = inner.getValue().intValue();
statisticsList.add(new BusVerifyStatistics(scheduleId, scheduleName, verifyCount));
}
}
return statisticsList;
}
/**
......@@ -268,10 +302,27 @@ public class BusService {
// List<BusVerificationRecord> list = busMapper.selectVerifyRecordByPage(queryDTO);
// return new PageInfo<>(list);
// }
/**
* 查询班车核销记录列表
* @param queryDTO 查询参数
* @return 班车核销记录分页列表
*/
public Page<List<BusVerificationRecord>> verifyPageRecord(BusVerifyRecordParam queryDTO) {
PageHelper.startPage(queryDTO.getPageNum(), queryDTO.getPageSize());
List<BusVerificationRecord> list = busMapper.selectVerifyRecordByPage(queryDTO);
PageInfo<BusVerificationRecord> pageInfo = new PageInfo<>(list);
return PageConvertUtil.convert(pageInfo);
}
/**
* 查询车票记录列表
* @param queryDTO 查询参数
* @return 查询车票记录列表
*/
public Page<List<BusTicketVerification>> busTicketPage(BusTicketParam queryDTO) {
PageHelper.startPage(queryDTO.getPageNum(), queryDTO.getPageSize());
List<BusTicketVerification> list = busMapper.queryBusTicketByPage(queryDTO);
PageInfo<BusTicketVerification> pageInfo = new PageInfo<>(list);
return PageConvertUtil.convert(pageInfo);
}
}
......@@ -49,37 +49,40 @@ public class RoadService {
/**
* 根据赛事、组别 获取路线列表
*
* @param cmptId 赛事ID
* @param roadId 路线ID
* @return 路线列表
*/
public List<Path> queryPaths(Integer cmptId, Integer roadId){
public List<Path> queryPaths(Integer cmptId, Integer roadId) {
return roadMapper.queryPaths(cmptId, roadId);
}
public List<Road> queryRoads(Integer cmptId) {
// log.info("=====queryRoads -> RoadService enter");
// log.info("=====queryRoads -> RoadService enter");
List<Road> roads = remoteService.getRoads(cmptId);
if(roads == null) {
if (roads == null) {
return null;
}
// for (Road road : roads) {
// log.info("RoadService api接口 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
// for (Road road : roads) {
// log.info("RoadService api接口 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
List<Road> localRoads = roadMapper.queryRoadsMultiPath(cmptId);
// for (Road road : localRoads) {
// log.info("RoadService 数据库接口 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
// for (Road road : localRoads) {
// log.info("RoadService 数据库接口 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
for (Road road : roads) { // 更新 插入操作
if (localRoads.contains(road)) {
Road rd = localRoads.get(localRoads.indexOf(road));
if (!rd.getName().equals(road.getName())) {
if (!rd.getName()
.equals(road.getName())) {
rd.setName(road.getName());
roadMapper.update(road);
}
// log.info("RoadService contains getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName());
// log.info("RoadService contains getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName());
} else {
roadMapper.save(road);
// log.info("RoadService not contains getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName());
// log.info("RoadService not contains getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName());
}
}
for (Road road : localRoads) { // 删除操作
......@@ -88,41 +91,43 @@ public class RoadService {
}
}
// for (Road road : localRoads) {
// log.info("RoadService 接口和api更新后数据 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
// for (Road road : localRoads) {
// log.info("RoadService 接口和api更新后数据 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
return roadMapper.queryRoadsMultiPath(cmptId);
}
/**
* 获取组别(多路线支持)
*
* @param cmptId
* @return
*/
public List<Road> queryRoadsMultiPath(Integer cmptId) {
// log.info("===== queryRoadsMultiPath -> RoadService enter");
// log.info("===== queryRoadsMultiPath -> RoadService enter");
List<Road> roads = remoteService.getRoads(cmptId);
if(roads == null) {
if (roads == null) {
return null;
}
// for (Road road : roads) {
// log.info("RoadService api接口 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
// for (Road road : roads) {
// log.info("RoadService api接口 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
List<Road> localRoads = roadMapper.queryRoadsMultiPath(cmptId);
// for (Road road : localRoads) {
// log.info("RoadService 数据库接口 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
// for (Road road : localRoads) {
// log.info("RoadService 数据库接口 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
for (Road road : roads) { // 更新 插入操作
if (localRoads.contains(road)) {
Road rd = localRoads.get(localRoads.indexOf(road));
if (!rd.getName().equals(road.getName())) {
if (!rd.getName()
.equals(road.getName())) {
rd.setName(road.getName());
roadMapper.update(road);
}
// log.info("RoadService contains getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName());
// log.info("RoadService contains getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName());
} else {
roadMapper.save(road);
// log.info("RoadService not contains getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName());
// log.info("RoadService not contains getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName());
}
}
for (Road road : localRoads) { // 删除操作
......@@ -131,14 +136,15 @@ public class RoadService {
}
}
// for (Road road : localRoads) {
// log.info("RoadService 接口和api更新后数据 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
// for (Road road : localRoads) {
// log.info("RoadService 接口和api更新后数据 getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName() + " getFileUrl:" + road.getFileUrl());
// }
return roadMapper.queryRoadsMultiPath(cmptId);
}
/**
* 将gps文件转化为json文件
*
* @param url
* @return
*/
......@@ -146,7 +152,8 @@ public class RoadService {
ResponseEntity<org.springframework.core.io.Resource> entity = restTemplate.getForEntity(url, org.springframework.core.io.Resource.class);
InputStream inputStream = null;
try {
inputStream = entity.getBody().getInputStream();
inputStream = entity.getBody()
.getInputStream();
String json = "";
if (url.indexOf(".gpx") > -1) {
json = GpxParserUtil.parseGpx(inputStream);
......@@ -162,13 +169,13 @@ public class RoadService {
public int saveGps(RoadGpsPoint point) {
// 存在pathId的时候先把原来的路线删除再保存
// if(point.getPathId() > 0){
// roadMapper.deleteGps(point.getRoadId(), point.getPathId());
// }
// if(point.getPathId() > 0){
// roadMapper.deleteGps(point.getRoadId(), point.getPathId());
// }
return roadMapper.saveGps(point);
}
public int updateRoadGps(RoadGpsPoint point){
public int updateRoadGps(RoadGpsPoint point) {
return roadMapper.updateRoadGps(point);
}
......@@ -184,7 +191,11 @@ public class RoadService {
roadMapper.countDownload(roadId);
}
public Map<String, String> getMultiRouteInfo(Integer cmptId){
public Map<String, String> getMultiRouteInfo(Integer cmptId) {
return roadMapper.getMultiRouteInfo(cmptId);
}
public int updateGpsPathSort(int pathId, int sort) {
return roadMapper.updateGpsPathSort(pathId, sort);
}
}
......@@ -2,6 +2,7 @@ package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.common.web.Result;
import com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusParam;
import com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusTicketParam;
import com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusVerifyRecordParam;
import com.dlbridge.jadp.plugins.cmpt.dao.model.vo.BusVerifyStatistics;
import com.dlbridge.jadp.plugins.cmpt.dto.*;
......@@ -162,5 +163,18 @@ public class BusController {
Page<List<BusVerificationRecord>> result = busService.verifyPageRecord(queryDTO);
return Result.success(result);
}
/**
* 查询车票记录分页列表接口
*
* @param queryDTO 查询参数
* @return 查询车票记录列表
*/
@ResponseBody
@PostMapping("/bus-ticket-page")
@ApiOperation(value = "获取班车车票列表", notes = "获取班车车票列表")
public Result<?> busTicketPage(@RequestBody BusTicketParam queryDTO) {
Page<List<BusTicketVerification>> result = busService.busTicketPage(queryDTO);
return Result.success(result);
}
}
......@@ -98,7 +98,7 @@ public class RoadController {
setPoints(json).setRoadId(road.getRoadId())
.setCmptId(road.getCmptId()).setPathName(road.getPathName())
.setFileName(road.getFileName()).setFileUrl(road.getFileUrl())
.setFileSize(road.getFileSize()).setPathId(road.getPathId());
.setFileSize(road.getFileSize()).setPathId(road.getPathId()).setSort(road.getSort());
roadService.saveGps(roadGpsPoint);
newPahtId = roadGpsPoint.getId();
log.info("=====生成新的路线ID:{}",newPahtId);
......@@ -110,7 +110,7 @@ public class RoadController {
setPoints(json).setRoadId(road.getRoadId())
.setCmptId(road.getCmptId()).setPathName(road.getPathName())
.setFileName(road.getFileName()).setFileUrl(road.getFileUrl())
.setFileSize(road.getFileSize()).setPathId(road.getPathId());
.setFileSize(road.getFileSize()).setPathId(road.getPathId()).setSort(road.getSort());
roadService.updateRoadGps(roadGpsPoint);
}
......@@ -155,6 +155,12 @@ public class RoadController {
int count = roadService.deleteGpsPath(pathId);
return Result.success();
}
@PostMapping("updateGpsPathSort/{pathId}/{sort}")
@ResponseBody
public Result updateGpsPathSort(@PathVariable("pathId") int pathId, @PathVariable("sort") int sort) {
int count = roadService.updateGpsPathSort(pathId, sort);
return Result.success();
}
/**
* 上传轨迹的接口,针对不同的项目,上传不同的gpx,kml轨迹文件
......
<%@ 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?v=<%=System.currentTimeMillis()%>" 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="https://img.geexek.com/files/home/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?v=<%=System.currentTimeMillis()%>">
<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?v=<%=System.currentTimeMillis()%>"/>
<link rel="stylesheet" href="${ctxStatic}/cmpt/road-new.css?v=<%=System.currentTimeMillis()%>"/>
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.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">
<script src="${ctxStatic}/newdermon/vendor/bootstrap/js/bootstrap.js"></script>
</head>
<style type="text/css">
.editCpDis-box {
display: flex;
justify-content: space-around;
margin: 8px;
}
.dis-name {
line-height: 2rem;
}
</style>
<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">
<span class="title-txt">项目设置</span>
<div style="line-height: 22px">
<span class="road-notice"></span>
<span class="road-notice-txt">比赛项目需要在赛客计时系统中创建/修改</span>
</div>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ 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" %>
<%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>
<%@ taglib prefix="fnc" uri="/WEB-INF/tlds/fnc.tld" %>
<!doctype html>
<html>
<%--<span class="btn right addTempalte">添加</span>--%>
</div>
<div class="equip-container-new">
<c:choose>
<c:when test="${fn:length(list) > 0}">
<c:forEach var="item" items="${list}">
<div class="equip-item-new equip-item" data-id="${item.roadId}" data-name="${item.name}"
data-file-name="${item.fileName}" data-file-url="${item.fileUrl}"
data-file-size="${item.fileSize}" data-path-id="${item.pathId}" data-path-name="${item.pathName}">
<div class="divhorizontal divhorizontal-item1">
<span class="name-color">${item.name}</span>
</div>
<div class="divhorizontal divhorizontal-item4">
<span class="name-color">${item.pathName}</span>
</div>
<div class="divhorizontal divhorizontal-item2">
<p class="">状态</p>
<c:if test="${item.fileUrl != null && item.fileUrl != ''}">
<p class="status-color"> 线路已上传 </p>
</c:if>
<c:if test="${item.fileUrl == null || item.fileUrl == ''}">
<p class="status-2-color"> 线路未上传 </p>
</c:if>
</div>
<div class="divhorizontal divhorizontal-item3 edit-new">
<span class="edit-road"></span>
<span class="edit-text " name="name">编辑路线</span>
</div>
<c:if test="${item.isMultiRoute == '1'}">
<div class="divhorizontal divhorizontal-item3 add-new">
<span class="edit-road"></span>
<span class="edit-text " name="name">新增路线</span>
</div>
</c:if>
<div class="divhorizontal divhorizontal-item3 del-new">
<span class="edit-road"></span>
<span class="edit-text " name="name">删除路线</span>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="no-data-div">
<p class="road-nodata-pic"></p>
<p class="nodata-text-1">未设置</p>
<p class="nodata-text-2">请在“赛客计时系统”中创建项目</p>
<%--<span class="btn right del">删除</span>--%>
</div>
</c:otherwise>
</c:choose>
</div>
</div>
<div class="map-container" style="transform: translateX(-9999px)">
<div class="flex flex-row back-div" style="align-items: center; margin: 10px 0px;">
<span class="back"></span><span style="font-size:20px;color:rgba(0,0,0,1)">返回</span>
</div>
<div class="map-title">
<div class="flex flex-column">
<input type="hidden" id="roadId">
<input type="hidden" id="pathId">
<span id="roadName"></span>
<span id="gpsName"></span>
<input type="text" id="pathName" class="ipt-middle" placeholder="请输入路线名">
</div>
<div class="right">
<button type="button" class="btn upload">载入路线</button>
<input type="file" id="route-file" style="display: none;" onchange="uploadFile(this)">
<button type="button" id="editCpDisBtn" class="btn" data-toggle="modal" data-target="#editCpDis" style="display: none;">点位距离设置</button>
</div>
</div>
<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?v=<%=System.currentTimeMillis()%>"
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="https://img.geexek.com/files/home/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?v=<%=System.currentTimeMillis()%>">
<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?v=<%=System.currentTimeMillis()%>" />
<link rel="stylesheet"
href="${ctxStatic}/cmpt/road-new.css?v=<%=System.currentTimeMillis()%>" />
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.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">
<script src="${ctxStatic}/newdermon/vendor/bootstrap/js/bootstrap.js"></script>
</head>
<style type="text/css">
.editCpDis-box {
display: flex;
justify-content: space-around;
margin: 8px;
}
.dis-name {
line-height: 2rem;
}
.layui-layer-title {
color: white;
}
<div id="map" class="map"></div>
<div class="map-data">
<div class="flex" style="justify-content: space-between">
<label class="marker-label">标注列表</label>
<div class="flex" style="align-items: center">
<span class="cancel">取消</span>
<span class="save">保存</span>
<span class="edit">编辑</span>
</div>
</div>
.layui-layer-btn {
color: white;
}
</style>
<div class="markers">
<label for="" class="marker-name"></label>
<%--<span class="marker-tip">用作计时点</span>--%>
</div>
<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">
<span class="title-txt">项目设置</span>
<div style="line-height: 22px">
<span class="road-notice"></span>
<span class="road-notice-txt">比赛项目需要在赛客计时系统中创建/修改</span>
</div>
<div class="markers-edit">
<div style="display: flex">
<span class="edit-tip-distance">里程<br/>距起点</span>
<span class="edit-tip-cp">用作<br/>计时点</span>
</div>
</div>
</div>
</div>
<%--<span class="btn right addTempalte">添加</span>--%>
</div>
<div class="equip-container-new">
<c:choose>
<c:when test="${fn:length(list) > 0}">
<c:forEach var="item" items="${list}">
<div class="equip-item-new equip-item"
data-id="${item.roadId}" data-name="${item.name}"
data-id="${item.roadId}" data-sort="${item.sort}"
data-file-name="${item.fileName}"
data-file-url="${item.fileUrl}"
data-file-size="${item.fileSize}"
data-path-id="${item.pathId}"
data-path-name="${item.pathName}">
<div class="divhorizontal divhorizontal-item1">
<span class="name-color">${item.name}</span>
</div>
<div class="divhorizontal divhorizontal-item4">
<span class="name-color">
${item.pathName}
</span>
</div>
<div class="divhorizontal divhorizontal-item2 edit-sort"
style="cursor: pointer;">
<p class="">排序</p>
<c:if test="${item.sort != null}">
<p class="status-color ">
${item.sort}
</p>
</c:if>
</div>
<div class="divhorizontal divhorizontal-item2">
<p class="">状态</p>
<c:if
test="${item.fileUrl != null && item.fileUrl != ''}">
<p class="status-color"> 线路已上传 </p>
</c:if>
<c:if
test="${item.fileUrl == null || item.fileUrl == ''}">
<p class="status-2-color"> 线路未上传 </p>
</c:if>
</div>
<div class="divhorizontal divhorizontal-item3 edit-new">
<span class="edit-road"></span>
<span class="edit-text " name="name">编辑路线</span>
</div>
<c:if test="${item.isMultiRoute == '1'}">
<div
class="divhorizontal divhorizontal-item3 add-new">
<span class="edit-road"></span>
<span class="edit-text " name="name">新增路线</span>
</div>
</c:if>
<div class="divhorizontal divhorizontal-item3 del-new">
<span class="edit-road"></span>
<span class="edit-text " name="name">删除路线</span>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="no-data-div">
<p class="road-nodata-pic"></p>
<p class="nodata-text-1">未设置</p>
<p class="nodata-text-2">请在“赛客计时系统”中创建项目</p>
<%--<span class="btn right del">删除</span>--%>
</div>
</c:otherwise>
</c:choose>
</div>
</div>
<div class="map-container" style="transform: translateX(-9999px)">
<div class="flex flex-row back-div"
style="align-items: center; margin: 10px 0px;">
<span class="back"></span><span
style="font-size:20px;color:rgba(0,0,0,1)">返回</span>
</div>
<div class="map-title">
<div class="flex flex-column">
<input type="hidden" id="roadId">
<input type="hidden" id="pathId">
<span id="roadName"></span>
<span id="gpsName"></span>
<input type="text" id="pathName" class="ipt-middle"
placeholder="请输入路线名">
</div>
<div class="right">
<button type="button" class="btn upload">载入路线</button>
<input type="file" id="route-file" style="display: none;"
onchange="uploadFile(this)">
<button type="button" id="editCpDisBtn" class="btn"
data-toggle="modal" data-target="#editCpDis"
style="display: none;">点位距离设置</button>
</div>
</div>
<div id="map" class="map"></div>
<div class="map-data">
<div class="flex" style="justify-content: space-between">
<label class="marker-label">标注列表</label>
<div class="flex" style="align-items: center">
<span class="cancel">取消</span>
<span class="save">保存</span>
<span class="edit">编辑</span>
</div>
</div>
<div class="markers">
<label for="" class="marker-name"></label>
<%--<span class="marker-tip">用作计时点</span>--%>
</div>
<div class="markers-edit">
<div style="display: flex">
<span class="edit-tip-distance">里程<br />距起点</span>
<span class="edit-tip-cp">用作<br />计时点</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editCpDis" tabindex="-1" role="dialog"
aria-labelledby="editCpDisLabel" style="z-index: 9999999;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header" style="display: block;">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="editCpDisLabel">间距设置(单位:KM)</h4>
</div>
<div class="modal-body">
<div id="editCpDis-list">
<%-- <div class="editCpDis-box">--%>
<%-- <div class="dis-name">--%>
<%-- 计时点1-计时点2--%>
<%-- </div>--%>
<%-- <div class="dis-input">--%>
<%-- <input type="number" name=""
placeholder="单位:M" step="1"
class="form-control" />--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <div class="editCpDis-box">--%>
<%-- <div class="dis-name">--%>
<%-- 计时点1-计时--%>
<%-- </div>--%>
<%-- <div
class="dis-input">--%>
<%-- <input
type="number"
name=""
placeholder="单位:M"
step="1"
class="form-control" />--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <div
class="editCpDis-box">--%>
<%-- <div
class="dis-name">--%>
<%--
计时点1-计时点2121121--%>
<%--
</div>--%>
<%-- <div
class="dis-input">--%>
<%-- <input
type="number"
name=""
placeholder="单位:M"
step="1"
class="form-control" />--%>
<%--
</div>--%>
<%--
</div>--%>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary"
onclick="saveCpDis()">保存</button>
</div>
</div>
</div>
</div>
</body>
<script src="${ctxStatic}/js/qikoo.js"></script>
<script type="text/javascript" src="${ctxStatic}/js/road-new.js"></script>
</div>
</div>
<div class="modal fade" id="editCpDis" tabindex="-1" role="dialog" aria-labelledby="editCpDisLabel" style="z-index: 9999999;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header" style="display: block;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="editCpDisLabel">间距设置(单位:KM)</h4>
</div>
<div class="modal-body">
<div id="editCpDis-list">
<%-- <div class="editCpDis-box">--%>
<%-- <div class="dis-name">--%>
<%-- 计时点1-计时点2--%>
<%-- </div>--%>
<%-- <div class="dis-input">--%>
<%-- <input type="number" name="" placeholder="单位:M" step="1" class="form-control"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <div class="editCpDis-box">--%>
<%-- <div class="dis-name">--%>
<%-- 计时点1-计时--%>
<%-- </div>--%>
<%-- <div class="dis-input">--%>
<%-- <input type="number" name="" placeholder="单位:M" step="1" class="form-control"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <div class="editCpDis-box">--%>
<%-- <div class="dis-name">--%>
<%-- 计时点1-计时点2121121--%>
<%-- </div>--%>
<%-- <div class="dis-input">--%>
<%-- <input type="number" name="" placeholder="单位:M" step="1" class="form-control"/>--%>
<%-- </div>--%>
<%-- </div>--%>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="saveCpDis()">保存</button>
</div>
</div>
</div>
</div>
</body>
<script src="${ctxStatic}/js/qikoo.js"></script>
<script type="text/javascript" src="${ctxStatic}/js/road-new.js"></script>
</html>
</html>
\ No newline at end of file
......@@ -130,6 +130,75 @@ $(document).ready(function () {
}
})*/
});
$('body').on('click', '.edit-sort', function () {
// layer.msg('click触发了',{icon:3,time:1500});
var parent = $(this).parent();
var pathId = parent.attr('data-path-id');
var pathName = parent.attr('data-path-name');
var sort = parent.attr('data-sort');
if (!sort) {
return layer.msg('请先上传路线', { icon: 3, time: 1500 });
}
const index = layer.open({
type: 1,
title: '设置' + pathName + '排序',
content: `
<div style="padding:20px;">
<div class="form-group">
<label>排序数字(越小越靠前)</label>
<input type="number" class="form-control" id="sort"
placeholder="请输入排序数字" value="${sort || 100}">
</div>
</div>
`,
btn: ['确定', '取消'],
yes: () => {
let loadIndex = 0;
const newSort = $('#sort').val();
if (newSort === '') {
layer.msg('请输入排序数字');
return;
}
if (isNaN(newSort)) {
layer.msg('排序必须是数字');
return;
}
$.ajax({
url: '/gk/road/updateGpsPathSort/' + pathId + '/' + newSort,
contentType: 'application/json',
type: 'post',
beforeSend: function () {
loadIndex = layer.load();
},
success: () => {
layer.close(loadIndex);
layer.msg('排序更新成功', () => layer.close(index));
window.location.reload();
}
});
}
});
/*$.ajax({
url: '/gk/road/save',
data: {
'roadId': id,
'fileName': fileName,
'fileUrl': fileUrl,
'name': name,
cmptId: getCmptId(),
'fileSize': fileSize
},
type: 'post',
success: function (data) {
if (data.status) {
// parent.attr('data-id', data.content.roadId);
$('.map-container').css('transform', 'none');
$('.map-container').attr('data-id', data.content.roadId);
$('.force').hide();
}
}
})*/
});
// 新增路线
$('body').on('click', '.add-new', function () {
......
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