Commit 00f06cc0 authored by sunyuhua's avatar sunyuhua

扫描二维码打卡,增加二维码坐标的经纬度问题

parent eccbd669
......@@ -27,6 +27,9 @@ public class RoadTimerCheckpoint {
private long cpStartTime;
@ApiModelProperty(value = "打卡点的分段的结束时间", notes = "打卡点的分段的结束时间")
private long cpStopTime;
@ApiModelProperty(value = "打卡点的纬度", notes = "打卡点的纬度")
private String cpLatitude;
@ApiModelProperty(value = "打卡点的经度", notes = "打卡点的经度")
private String cpLongitude;
}
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.dlbridge.jadp.plugins.cmpt.bean.*;
import com.dlbridge.jadp.plugins.cmpt.dao.mapper.CmptMapper;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.factory.annotation.Value;
......@@ -38,6 +39,9 @@ public class RemoteService {
@Resource
private CmptService cmptService;
@Resource
private RoadsGpsCheckpointService roadsGpsCheckpointService;
public int getCmptEnrollCount(Integer cmptId) {
ResponseEntity<String> forEntity = restTemplate.getForEntity(timerURL + "getCmptEnrollCount.do?cmptId="
+ cmptId, String.class);
......@@ -452,7 +456,8 @@ public class RemoteService {
* @param markNo
* @return
*/
public List<RoadTimerCheckpoint> getAllCPScoreByMarkNo(Integer cmptId,String markNo){
public List<RoadTimerCheckpoint> getAllCPScoreByMarkNo(Integer cmptId,Integer roadId,String markNo){
List<RoadsGpsCheckpointMap> roadsGpsCheckpointMapList=roadsGpsCheckpointService.getRoadsGpsCheckpoint(cmptId,roadId);
ResponseEntity<String> forEntity = restTemplate.getForEntity(timerURL + "personAllCPScoreByMarkNo.do?cmptId="+ cmptId + "&markNo="+markNo, String.class);
if (forEntity.getStatusCode() == HttpStatus.OK) {
List<RoadTimerCheckpoint> roadTimerCheckpointList = new ArrayList<>();
......@@ -471,12 +476,22 @@ public class RemoteService {
RoadTimerCheckpoint roadTimerCheckpoint = new RoadTimerCheckpoint();
JSONObject o = (JSONObject) result.get(i);
String cpId = o.getString("cpId");
//根据打卡点匹配获取已经配置好的经纬度
String cpLatitude="";//纬度
String cpLongitude="";//经度
for(int k=0;k<roadsGpsCheckpointMapList.size();k++){
if(roadsGpsCheckpointMapList.get(k).getCheckpointId()==Integer.parseInt(cpId)){
cpLatitude=roadsGpsCheckpointMapList.get(k).getCheckpointLatitude();
cpLongitude=roadsGpsCheckpointMapList.get(k).getCheckpointLongitude();
break;
}
}
String cpName = o.getString("cpName");
String cpLength = o.getString("cpLength");
String cpTimespan= o.getString("cpTimespan");
String cpStartTime=o.getString("cpStartTime");
String cpStopTime=o.getString("cpStopTime");
roadTimerCheckpoint.setCpId(Integer.parseInt(cpId)).setCpName(cpName).setCpLength(Integer.parseInt(cpLength)).setCpTimespan(Long.parseLong(cpTimespan)).setCpStartTime(Long.parseLong(cpStartTime)).setCpStopTime(Long.parseLong(cpStopTime));
roadTimerCheckpoint.setCpId(Integer.parseInt(cpId)).setCpName(cpName).setCpLength(Integer.parseInt(cpLength)).setCpTimespan(Long.parseLong(cpTimespan)).setCpStartTime(Long.parseLong(cpStartTime)).setCpStopTime(Long.parseLong(cpStopTime)).setCpLatitude(cpLatitude).setCpLongitude(cpLongitude);
roadTimerCheckpointList.add(roadTimerCheckpoint);
}
}
......
......@@ -1011,18 +1011,19 @@ public class MicroApiController {
}
/**
* 根据号码牌获取此号码牌的打卡记录和成绩
* 根据号码牌获取此号码牌的打卡记录和成绩,打卡点对应的经纬度信息
* 扫描打卡时,判断是否在经纬度范围内,在的化允许打卡
* @param cmptId
* @param markNo
* @return
*/
@GetMapping(value = "/getCheckPointRecordByMarkNo/{cmptId}/{markNo}")
@GetMapping(value = "/getCheckPointRecordByMarkNo/{cmptId}/{roadId}/{markNo}")
@ApiResponses({
@ApiResponse(code = -1, message = "失败", response = ObjectUtils.Null.class),
@ApiResponse(code = 200, message = "成功", response = Result.class, responseContainer = "List")})
@ApiOperation(value = "根据号码牌获取此号码牌的打卡记录和成绩", notes = "根据号码牌获取此号码牌的打卡记录和成绩", tags = "根据号码牌获取此号码牌的打卡记录和成绩")
public Result getCheckPointRecordByMarkNo(@PathVariable("cmptId") int cmptId,@PathVariable("markNo") String markNo){
List<RoadTimerCheckpoint> roadTimerCheckpointList=remoteService.getAllCPScoreByMarkNo(cmptId,markNo);
@ApiOperation(value = "根据号码牌获取此号码牌的打卡记录和成绩,打卡点对应的经纬度信息", notes = "根据号码牌获取此号码牌的打卡记录和成绩,打卡点对应的经纬度信息", tags = "根据号码牌获取此号码牌的打卡记录和成绩,打卡点对应的经纬度信息")
public Result getCheckPointRecordByMarkNo(@PathVariable("cmptId") int cmptId,@PathVariable("roadId") int roadId,@PathVariable("markNo") String markNo){
List<RoadTimerCheckpoint> roadTimerCheckpointList=remoteService.getAllCPScoreByMarkNo(cmptId,roadId,markNo);
return Result.success().setContent(roadTimerCheckpointList);
}
......
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