|
|
@ -7,10 +7,7 @@ import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.utils.CoordCommonUtil; |
|
|
|
import com.hfkj.common.utils.CoordCommonUtil; |
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
import com.hfkj.entity.BsMer; |
|
|
|
import com.hfkj.entity.*; |
|
|
|
import com.hfkj.entity.BsStore; |
|
|
|
|
|
|
|
import com.hfkj.entity.BsStoreGroupContent; |
|
|
|
|
|
|
|
import com.hfkj.entity.BsStoreGroupDetail; |
|
|
|
|
|
|
|
import com.hfkj.group.BsStoreGroupProductService; |
|
|
|
import com.hfkj.group.BsStoreGroupProductService; |
|
|
|
import com.hfkj.group.BsStoreGroupService; |
|
|
|
import com.hfkj.group.BsStoreGroupService; |
|
|
|
import com.hfkj.model.GroupContentModel; |
|
|
|
import com.hfkj.model.GroupContentModel; |
|
|
@ -68,6 +65,7 @@ public class OpenGroupController { |
|
|
|
for (OpenStoreModel storeModel : list) { |
|
|
|
for (OpenStoreModel storeModel : list) { |
|
|
|
Map<String , Object > map = new HashMap<>(); |
|
|
|
Map<String , Object > map = new HashMap<>(); |
|
|
|
map.put("storeId" , storeModel.getStoreId()); |
|
|
|
map.put("storeId" , storeModel.getStoreId()); |
|
|
|
|
|
|
|
map.put("status" , 1); |
|
|
|
List<BsStoreGroupContent> storeGroupContent = storeGroupProductService.getStoreGroupContentByList(map); |
|
|
|
List<BsStoreGroupContent> storeGroupContent = storeGroupProductService.getStoreGroupContentByList(map); |
|
|
|
if (longitude != null && latitude != null && storeModel.getLatitude() != null && storeModel.getLongitude() != null) { |
|
|
|
if (longitude != null && latitude != null && storeModel.getLatitude() != null && storeModel.getLongitude() != null) { |
|
|
|
double distance = CoordCommonUtil.getDistance(Double.valueOf(storeModel.getLatitude()), Double.valueOf(storeModel.getLongitude()), Double.valueOf(latitude), Double.valueOf(longitude)); |
|
|
|
double distance = CoordCommonUtil.getDistance(Double.valueOf(storeModel.getLatitude()), Double.valueOf(storeModel.getLongitude()), Double.valueOf(latitude), Double.valueOf(longitude)); |
|
|
@ -81,6 +79,7 @@ public class OpenGroupController { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
storeModel.setStoreGroupContentList(storeGroupContent); |
|
|
|
storeModel.setStoreGroupContentList(storeGroupContent); |
|
|
|
|
|
|
|
storeModel.setBsStoreExtMsg(storeGroupService.findStoreExtMsgByStoreId(Long.valueOf(storeModel.getStoreId()))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
list = list.stream().filter(data -> !data.getStoreGroupContentList().isEmpty()).sorted(Comparator.comparing(OpenStoreModel::getDistance)).collect(Collectors.toList()); |
|
|
|
list = list.stream().filter(data -> !data.getStoreGroupContentList().isEmpty()).sorted(Comparator.comparing(OpenStoreModel::getDistance)).collect(Collectors.toList()); |
|
|
@ -106,7 +105,7 @@ public class OpenGroupController { |
|
|
|
|
|
|
|
|
|
|
|
List<BsStoreGroupDetail> list = storeGroupProductService.getGroupDetailByList(map); |
|
|
|
List<BsStoreGroupDetail> list = storeGroupProductService.getGroupDetailByList(map); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, List<BsStoreGroupDetail>> collect = list.stream().collect(Collectors.groupingBy(BsStoreGroupDetail::getName)); |
|
|
|
Map<String, List<BsStoreGroupDetail>> collect = list.stream().sorted(Comparator.comparing(BsStoreGroupDetail::getCreateTime)).collect(Collectors.groupingBy(BsStoreGroupDetail::getName)); |
|
|
|
|
|
|
|
|
|
|
|
List<JSONObject> groupDetails = collect.keySet().stream().map(key -> { |
|
|
|
List<JSONObject> groupDetails = collect.keySet().stream().map(key -> { |
|
|
|
JSONObject detailObject = new JSONObject(true); |
|
|
|
JSONObject detailObject = new JSONObject(true); |
|
|
@ -134,6 +133,7 @@ public class OpenGroupController { |
|
|
|
|
|
|
|
|
|
|
|
Map<String , Object > map = new HashMap<>(); |
|
|
|
Map<String , Object > map = new HashMap<>(); |
|
|
|
map.put("storeId" , storeId); |
|
|
|
map.put("storeId" , storeId); |
|
|
|
|
|
|
|
map.put("status" , 1); |
|
|
|
|
|
|
|
|
|
|
|
BsStore bsStore = bsStoreService.getStoreById(storeId); |
|
|
|
BsStore bsStore = bsStoreService.getStoreById(storeId); |
|
|
|
|
|
|
|
|
|
|
|