|
|
@@ -263,6 +263,41 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
|
|
|
return distributionRuleDao.findShippingMethodByEnuuAndActive(enuu, ShortConstant.YES_SHORT);
|
|
|
}
|
|
|
|
|
|
+ public Map<String, Map<String, Object>> findRuleMatchArea(List<String> uuidArray, String area){
|
|
|
+ if (area == null){
|
|
|
+ throw new IllegalOperatorException("地址信息缺失,请重新确认收货地址");
|
|
|
+ }
|
|
|
+ for (String uuid : uuidArray){
|
|
|
+ findRuleMatchArea(uuid, area);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, Object> findRuleMatchArea(String uuid, String area){
|
|
|
+ StoreIn store = storeInDao.findByUuid(uuid);
|
|
|
+ if (store == null){
|
|
|
+ throw new IllegalOperatorException("店铺信息,请刷新后重试");
|
|
|
+ }
|
|
|
+ List<DistributionRule> allRuleList = distributionRuleDao.findAllByEnuu(store.getEnUU());
|
|
|
+ List<DistributionRule> ruleList = new ArrayList<>();
|
|
|
+ List<Integer> methodList = new ArrayList<>();
|
|
|
+ for (DistributionRule rule : allRuleList){
|
|
|
+ if (!methodList.contains(rule.getShippingMethod())){
|
|
|
+ List<RuleQtyArea> qtyArea = rule.getAreas();
|
|
|
+ Map<String, Map<String, List<String>>> resultMap = convertArea(qtyArea);
|
|
|
+ boolean isContains = containsArea(resultMap, area);
|
|
|
+ if (isContains){
|
|
|
+ methodList.add(rule.getShippingMethod());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (methodList.size() == 3){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 根据配送方式获取匹配地区的配送规则列表
|
|
|
* @param method
|