'修复定位排序错误'

dev-discount
199901012 4 years ago
parent f361810945
commit bef91af72b
  1. 2
      hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java
  2. 2
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  3. 2
      hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java
  4. 6
      hai-service/src/main/java/com/hai/entity/HighMerchantStore.java
  5. 2
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java

@ -20,7 +20,7 @@ public class HighCouponSchedule {
private HighUserCouponService highUserCouponService; private HighUserCouponService highUserCouponService;
// @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 // @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
// @Scheduled(cron = "0 0 0 * * ?") //每天 凌晨0点执行 @Scheduled(cron = "0 0 0 * * ?") //每天 凌晨0点执行
public void expiredCoupon() { public void expiredCoupon() {
List<HighUserCoupon> userCoupons = highUserCouponService.getOverdueCoupon(); List<HighUserCoupon> userCoupons = highUserCouponService.getOverdueCoupon();
for (HighUserCoupon highUserCoupon : userCoupons) { for (HighUserCoupon highUserCoupon : userCoupons) {

@ -24,7 +24,7 @@ public class HighOrderSchedule {
@Resource @Resource
private HighOrderService highOrderService; private HighOrderService highOrderService;
// @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void certification() { public void certification() {
List<HighOrder> orderList = highOrderService.getCloseOrder(); List<HighOrder> orderList = highOrderService.getCloseOrder();

@ -29,7 +29,7 @@ public class SynchronizeCNPC {
private static final String[] HEX_DIGITS = {"0" ,"1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}; private static final String[] HEX_DIGITS = {"0" ,"1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"};
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 //@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void certification() { public void certification() {
Map<String, Object> tokenMap = new HashMap<>(); Map<String, Object> tokenMap = new HashMap<>();
tokenMap.put("appId", "jsVpwDoHZfR2rrpjhA"); tokenMap.put("appId", "jsVpwDoHZfR2rrpjhA");

@ -104,15 +104,15 @@ public class HighMerchantStore implements Serializable {
private String ext3; private String ext3;
private String distance; private Double distance;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public String getDistance() { public Double getDistance() {
return distance; return distance;
} }
public void setDistance(String distance) { public void setDistance(Double distance) {
this.distance = distance; this.distance = distance;
} }

@ -163,7 +163,7 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
List<HighMerchantStore> storeList = getMerchantStoreList(map); List<HighMerchantStore> storeList = getMerchantStoreList(map);
for (HighMerchantStore store : storeList) { for (HighMerchantStore store : storeList) {
double distance = CoordCommonUtil.getDistance(Double.valueOf(store.getLatitude()), Double.valueOf(store.getLongitude()), Double.valueOf(map.get("latitude").toString()), Double.valueOf(map.get("longitude").toString())); double distance = CoordCommonUtil.getDistance(Double.valueOf(store.getLatitude()), Double.valueOf(store.getLongitude()), Double.valueOf(map.get("latitude").toString()), Double.valueOf(map.get("longitude").toString()));
store.setDistance(String.valueOf( Math.round(distance/100d)/10d)); store.setDistance(Math.round(distance/100d)/10d);
} }
List<HighMerchantStore> collect = storeList.stream().sorted(Comparator.comparing(HighMerchantStore::getDistance)).collect(Collectors.toList()); List<HighMerchantStore> collect = storeList.stream().sorted(Comparator.comparing(HighMerchantStore::getDistance)).collect(Collectors.toList());
return collect; return collect;

Loading…
Cancel
Save