Browse Source

删除测试代码

hulh 8 years ago
parent
commit
c61fd1444e

+ 0 - 9
src/main/java/com/uas/platform/b2c/logistics/controller/DistributionRuleController.java

@@ -144,13 +144,4 @@ public class DistributionRuleController {
 	public List<UsableRuleInfo> findFareRule(Double price, @RequestBody List<UsableRuleInfo> ruleList){
 		return distributionRuleService.findFareOfRule(ruleList, price);
 	}
-
-	/**
-	 * 获取指定运费价格
-	 * @return
-	 */
-	@RequestMapping(value = "/update/price", method = RequestMethod.GET)
-	public List<Goods>  getUpdate(){
-		return distributionRuleService.updateData();
-	}
 }

+ 0 - 1
src/main/java/com/uas/platform/b2c/logistics/service/DistributionRuleService.java

@@ -105,5 +105,4 @@ public interface DistributionRuleService {
 	 */
 	List<UsableRuleInfo> findFareOfRule(List<UsableRuleInfo> ruleList, Double price);
 
-	List<Goods> updateData();
 }

+ 0 - 55
src/main/java/com/uas/platform/b2c/logistics/service/impl/DistributionRuleServiceImpl.java

@@ -539,59 +539,4 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 			return false;
 		}
 	}
-
-	@Override
-	public List<Goods> updateData() {
-		List<Goods> allGoods = goodsDao.findAll();
-		List<Goods> resultList = new ArrayList<>(allGoods.size());
-		for (Goods goods : allGoods) {
-			if (isNeedUpdate(goods)) {
-//				updatePrice(goods);
-				resultList.add(goods);
-			}
-		}
-//		goodsDao.save(resultList);
-		return resultList;
-	}
-
-	private void updatePrice(Goods goods) {
-		if (Currency.RMB.equals(goods.getCurrencyName())) {
-			goods.setMinPriceRMB(GoodsUtil.getMinPriceRMB(goods.getPrices()));
-			goods.setMaxPriceRMB(GoodsUtil.getMaxPriceRMB(goods.getPrices()));
-		} else if (Currency.USD.equals(goods.getCurrencyName())) {
-			goods.setMinPriceUSD(GoodsUtil.getMinPriceUSD(goods.getPrices()));
-			goods.setMaxPriceUSD(GoodsUtil.getMaxPriceUSD(goods.getPrices()));
-		}
-	}
-
-	private boolean isNeedUpdate(Goods goods) {
-		if (Currency.RMB.equals(goods.getCurrencyName())) {
-			return boolRmb(goods);
-		} else if (Currency.USD.equals(goods.getCurrencyName())) {
-			return boolUsd(goods);
-		}
-		return false;
-	}
-
-	private boolean boolRmb(Goods goods) {
-		if (goods.getMinPriceRMB() == null || goods.getMaxPriceRMB() == null) {
-			return true;
-		}
-		if (!goods.getMinPriceRMB().equals(GoodsUtil.getMinPriceRMB(goods.getPrices()))
-				|| !goods.getMaxPriceRMB().equals(GoodsUtil.getMaxPriceRMB(goods.getPrices()))) {
-			return true;
-		}
-		return false;
-	}
-
-	private boolean boolUsd(Goods goods) {
-		if (goods.getMinPriceUSD() == null || goods.getMaxPriceUSD() == null) {
-			return true;
-		}
-		if (!goods.getMinPriceUSD().equals(GoodsUtil.getMinPriceUSD(goods.getPrices()))
-				|| !goods.getMaxPriceUSD().equals(GoodsUtil.getMaxPriceUSD(goods.getPrices()))) {
-			return true;
-		}
-		return false;
-	}
 }