Commit 4606b554 by 丁伟峰

地址分单、坐标分单,分别处理

1 parent 1a054066
......@@ -42,6 +42,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
import static com.dituhui.pea.order.config.OrderConfig.PATTERN_DATE;
import static com.dituhui.pea.order.config.OrderConfig.PATTERN_DATETIME;
......@@ -122,11 +123,16 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity.setCounty(location.getDistrict());
entity.setAddress(location.getFormattedAddress());
// 根据分单,填写clusterId/branchId/groupId/teamId等
String loc = String.format("%f,%f", req.getLocation().getLng(), req.getLocation().getLat());
List<String> blockIds = null;
List<String> layerIds = capacityUtils.getLayers(req.getBrand(), req.getType(), req.getSkill());
List<String> blockIds = saasUtils .queryBlockIds(loc, req.getAddress());
if (blockIds == null || blockIds.size() == 0) {
if(req.getLocation() != null){
String loc = String.format("%f,%f", req.getLocation().getLng(), req.getLocation().getLat());
blockIds = saasUtils.queryBlocksByLocation(loc).stream().map(SaasUtils.BlockInfo::getBlockId).collect(Collectors.toList());
} else {
blockIds = saasUtils.queryBlocksByAddress(req.getAddress()).stream().map(SaasUtils.BlockInfo::getBlockId).collect(Collectors.toList());
}
if (blockIds.size() == 0) {
log.error("分单接口没有查到对应的结果");
Result.failed(String.format("分单接口(address:%s)(location:%s) 没有查到配置区块", req.getAddress(), req.getLocation()));
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!