|
@@ -10,14 +10,18 @@ import com.bofeng.entity.MsTripDet;
|
|
import com.yvan.platform.Conv;
|
|
import com.yvan.platform.Conv;
|
|
import org.joda.time.DateTime;
|
|
import org.joda.time.DateTime;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Author: xielianghe
|
|
* @Author: xielianghe
|
|
@@ -28,6 +32,13 @@ import java.util.List;
|
|
@Transactional(readOnly = true)
|
|
@Transactional(readOnly = true)
|
|
public class MsSuspectedService {
|
|
public class MsSuspectedService {
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 上报确定位置是否变更增加时间段判断
|
|
|
|
+ */
|
|
|
|
+ @Value("${submit.startTime}")
|
|
|
|
+ private String startTime;
|
|
|
|
+ @Value("${submit.endTime}")
|
|
|
|
+ private String endTime;
|
|
@Autowired
|
|
@Autowired
|
|
private MsSuspectedMapper msSuspectedMapper;
|
|
private MsSuspectedMapper msSuspectedMapper;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -43,8 +54,16 @@ public class MsSuspectedService {
|
|
|
|
|
|
//获取最近的定位
|
|
//获取最近的定位
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
- public String getLatelyAutoLocal(long userId) {
|
|
|
|
- MsSuspected msSuspected = msSuspectedMapper.selectLatelyAutoLocal(userId);
|
|
|
|
|
|
+ public String getLatelyAutoLocal(long userId) throws ParseException {
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Long now = System.currentTimeMillis();
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+ if (now >= sdf.parse(startTime).getTime() && now <= sdf.parse(endTime).getTime()) {
|
|
|
|
+ map.put("startTime", startTime);
|
|
|
|
+ map.put("endTime", endTime);
|
|
|
|
+ }
|
|
|
|
+ map.put("userId", userId);
|
|
|
|
+ MsSuspected msSuspected = msSuspectedMapper.selectLatelyAutoLocal(map);
|
|
if (msSuspected != null) {
|
|
if (msSuspected != null) {
|
|
return msSuspected.getAutoLocal();
|
|
return msSuspected.getAutoLocal();
|
|
} else {
|
|
} else {
|