'提交代码'

dev-discount
= 3 years ago
parent e88b3ed481
commit 31d08ea7fc
  1. 7
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  2. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  3. 1
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java

@ -66,7 +66,9 @@ public class HighGasController {
if (StringUtils.isBlank(storeName)) { if (StringUtils.isBlank(storeName)) {
storeName = null; storeName = null;
} }
List<Map<String, Object>> storeList = highGasOilPriceService.getStoreListByOilNo(storeName,regionId, oilNoName); SecRegion region = commonService.getParentByRegion(regionId);
if (region != null) {
List<Map<String, Object>> storeList = highGasOilPriceService.getStoreListByOilNo(storeName,region.getRegionId(), oilNoName);
for (Map<String, Object> store : storeList) { for (Map<String, Object> store : storeList) {
double distance = CoordCommonUtil.getDistance(Double.valueOf(store.get("latitude").toString()), Double.valueOf(store.get("longitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude)); double distance = CoordCommonUtil.getDistance(Double.valueOf(store.get("latitude").toString()), Double.valueOf(store.get("longitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
store.put("distance", Math.round(distance/100d)/10d); store.put("distance", Math.round(distance/100d)/10d);
@ -79,7 +81,8 @@ public class HighGasController {
} }
} }
return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum,distance.size(),pageSize,new PageInfo<>(distance))); return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum,distance.size(),pageSize,new PageInfo<>(distance)));
}
return ResponseMsgUtil.success(new PageInfo<>());
} catch (Exception e) { } catch (Exception e) {
log.error("HighGasController -> getGasDetailByStoreKey() error!",e); log.error("HighGasController -> getGasDetailByStoreKey() error!",e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);

@ -60,7 +60,7 @@ public class HighTestController {
JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000);
JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class);
for (int i = 1; i < resultObjectP.getInteger("totalPageNum").intValue();i++) { for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) {
JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000);
JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class);
JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList");

@ -150,6 +150,7 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
if (mainAccount != null) { if (mainAccount != null) {
model.setSecUser(mainAccount); model.setSecUser(mainAccount);
} }
return model;
} }
return null; return null;
} }

Loading…
Cancel
Save