|
@@ -5,11 +5,9 @@ import com.uas.platform.b2c.core.config.SysConf;
|
|
|
import com.uas.platform.b2c.core.constant.ShortConstant;
|
|
import com.uas.platform.b2c.core.constant.ShortConstant;
|
|
|
import com.uas.platform.b2c.core.constant.SplitChar;
|
|
import com.uas.platform.b2c.core.constant.SplitChar;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
|
|
+import com.uas.platform.b2c.logistics.dao.AddressTakeSelfDao;
|
|
|
import com.uas.platform.b2c.logistics.dao.DistributionRuleDao;
|
|
import com.uas.platform.b2c.logistics.dao.DistributionRuleDao;
|
|
|
-import com.uas.platform.b2c.logistics.model.DistributionRule;
|
|
|
|
|
-import com.uas.platform.b2c.logistics.model.RuleQtyArea;
|
|
|
|
|
-import com.uas.platform.b2c.logistics.model.RuleQtyFare;
|
|
|
|
|
-import com.uas.platform.b2c.logistics.model.UsableRuleInfo;
|
|
|
|
|
|
|
+import com.uas.platform.b2c.logistics.model.*;
|
|
|
import com.uas.platform.b2c.logistics.service.DistributionRuleService;
|
|
import com.uas.platform.b2c.logistics.service.DistributionRuleService;
|
|
|
import com.uas.platform.b2c.prod.store.dao.StoreInDao;
|
|
import com.uas.platform.b2c.prod.store.dao.StoreInDao;
|
|
|
import com.uas.platform.b2c.prod.store.model.StoreIn;
|
|
import com.uas.platform.b2c.prod.store.model.StoreIn;
|
|
@@ -18,6 +16,7 @@ import com.uas.platform.b2c.trade.support.ResultMap;
|
|
|
import com.uas.platform.core.exception.IllegalOperatorException;
|
|
import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
|
|
+import com.uas.platform.core.model.Type;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
@@ -47,6 +46,9 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private StoreInDao storeInDao;
|
|
private StoreInDao storeInDao;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private AddressTakeSelfDao takeSelfDao;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SysConf sysConf;
|
|
private SysConf sysConf;
|
|
|
|
|
|
|
@@ -287,12 +289,14 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
|
|
|
throw new IllegalOperatorException("配送规则信息丢失,请刷新后重试");
|
|
throw new IllegalOperatorException("配送规则信息丢失,请刷新后重试");
|
|
|
}
|
|
}
|
|
|
for (UsableRuleInfo info : ruleList){
|
|
for (UsableRuleInfo info : ruleList){
|
|
|
- DistributionRule rule = distributionRuleDao.findOne(info.getId());
|
|
|
|
|
- if (rule == null){
|
|
|
|
|
- throw new IllegalOperatorException("配送规则信息丢失,请刷新后重试");
|
|
|
|
|
|
|
+ if (info.getId() != null && info.getMethod() != Type.Delivery_BySelf_Code.value()){
|
|
|
|
|
+ DistributionRule rule = distributionRuleDao.findOne(info.getId());
|
|
|
|
|
+ if (rule == null){
|
|
|
|
|
+ throw new IllegalOperatorException("配送规则信息丢失,请刷新后重试");
|
|
|
|
|
+ }
|
|
|
|
|
+ Double fare = getFareOfRule(rule, price);
|
|
|
|
|
+ info.setFare(fare);
|
|
|
}
|
|
}
|
|
|
- Double fare = getFareOfRule(rule, price);
|
|
|
|
|
- info.setFare(fare);
|
|
|
|
|
}
|
|
}
|
|
|
return ruleList;
|
|
return ruleList;
|
|
|
}
|
|
}
|
|
@@ -347,10 +351,15 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
|
|
|
ruleInfoList.add(info);
|
|
ruleInfoList.add(info);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (methodList.size() == 3){
|
|
|
|
|
|
|
+ if (methodList.size() == 2){
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ List<AddressTakeSelf> takeSelfList = takeSelfDao.findByEnuuAndActiveOrderByCreatetimeDesc(store.getEnUU(), ShortConstant.YES_SHORT);
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(takeSelfList)){
|
|
|
|
|
+ UsableRuleInfo takeRule = UsableRuleInfo.getTakeSelfRule();
|
|
|
|
|
+ ruleInfoList.add(takeRule);
|
|
|
|
|
+ }
|
|
|
return ruleInfoList;
|
|
return ruleInfoList;
|
|
|
}
|
|
}
|
|
|
|
|
|