Просмотр исходного кода

Merge branch 'dev-mysql' into feature_release-tomysql

wangdy 8 лет назад
Родитель
Сommit
2e310f2b90

+ 1 - 1
src/main/java/com/uas/platform/b2c/logistics/model/DistributionRule.java

@@ -89,7 +89,7 @@ public class DistributionRule {
 
 	/**
 	 * 计费方式
-	 * 1-统一规定运费,2-按总金额计算
+	 * 1-统一规定运费,2-按总金额计算, 3-到付,到付设置为统一运费0
 	 */
 	@Column(name = "rule_fare_type")
 	private Short fareType;

+ 13 - 0
src/main/java/com/uas/platform/b2c/logistics/model/UsableRuleInfo.java

@@ -33,6 +33,10 @@ public class UsableRuleInfo {
 	 * 配送规则币别
 	 */
 	private String currencyName;
+	/**
+	 * 支付类型
+	 */
+	private Short fareType;
 
 	public UsableRuleInfo(){
 
@@ -44,6 +48,7 @@ public class UsableRuleInfo {
 		this.method = rule.getShippingMethod();
 		this.currencyName = rule.getCurrencyName();
 		this.enuu = rule.getEnuu();
+		this.fareType = rule.getFareType();
 	}
 
 	public Long getId() {
@@ -101,4 +106,12 @@ public class UsableRuleInfo {
 	public void setUuid(String uuid) {
 		this.uuid = uuid;
 	}
+
+	public Short getFareType() {
+		return fareType;
+	}
+
+	public void setFareType(Short fareType) {
+		this.fareType = fareType;
+	}
 }

+ 14 - 1
src/main/java/com/uas/platform/b2c/logistics/service/impl/DistributionRuleServiceImpl.java

@@ -84,6 +84,13 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 		if (rule.getFareType() == 2 && CollectionUtils.isEmpty(rule.getFares())){
 			return new ResultMap(CodeType.NO_INFO, "请完善计费方式");
 		}
+		if (rule.getFareType() == 2){
+			rule.setUniformPrice(null);
+		}else {
+			if (CollectionUtils.isEmpty(rule.getFares())){
+				rule.setQtyFare(null);
+			}
+		}
 		if (rule.getId() == null){ //新增配送规则,初始化数据
 			Long uu = SystemSession.getUser().getUserUU();
 			Long enuu = SystemSession.getUser().getEnterprise().getUu();
@@ -101,6 +108,9 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 		}else {
 			rule.setActive(ShortConstant.NO_SHORT);
 		}
+		if (rule.getFareType() == 3){ //到付类型
+			rule.setUniformPrice(0d);
+		}
 		if (!isAdd){ //若为另存为,则将主键id设为空
 			if (rule.getId() != null){
 				rule.setId(null);
@@ -397,9 +407,12 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 	 */
 	public Double getFareOfRule(DistributionRule rule, Double price){
 		Double needFare = null;
-		if (rule.getFareType() == 1){
+		if (rule.getFareType() == 1 || rule.getFareType() == 3){
 			needFare = rule.getUniformPrice();
 		}else {
+			if (CollectionUtils.isEmpty(rule.getFares())){
+				throw new  IllegalOperatorException("配送规则信息丢失,刷新后重试");
+			}
 			for (RuleQtyFare fare : rule.getFares()){
 				if (fare.getStart() <= price){
 					if (fare.getEnd() != null){

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/product/component/dao/ComponentGoodsDao.java

@@ -21,7 +21,7 @@ public interface ComponentGoodsDao extends JpaSpecificationExecutor<ComponentGoo
 	 * @param ids
 	 * @return 产品列表信息
 	 */
-	@Query("select cg from ComponentGoods cg where cg.cmpId in (:ids) order by instr(':ids', cg.id) , cg.reserve")
+	@Query("select cg from ComponentGoods cg where cg.cmpId in (:ids) order by instr(':ids', cg.cmpId) , cg.reserve")
 	public List<ComponentGoods> findByIdsInOrder(@Param("ids") Long[] ids);
 
 	/**

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentCrawlTask.java

@@ -121,7 +121,7 @@ public class ComponentCrawlTask implements Serializable {
 	 * 属性对应关系
 	 */
 	@Lob
-	@Column(name = "cct_contrastjson", columnDefinition = "LONGBLOB")
+	@Column(name = "cct_contrastjson", columnDefinition = "TEXT")
 	private String contrast;
 
 	/**

+ 7 - 3
src/main/java/com/uas/platform/b2c/prod/product/component/service/impl/ComponentGoodsServiceImpl.java

@@ -66,11 +66,15 @@ public class ComponentGoodsServiceImpl implements ComponentGoodsService {
 				}
 				searchResult = searchService.getComponentIds(code, pageParams);
 				@SuppressWarnings("unchecked")
-				List<Long> componentIds = (List<Long>) searchResult.get("componentIds");
+				List<Integer> componentIds = (List<Integer>) searchResult.get("componentIds");
+				List<Long> componentIdsLong = new ArrayList<>();
+				for (Integer cid:componentIds) {
+					componentIdsLong.add(cid.longValue());
+				}
 				List<ComponentGoods> componentGoods = new ArrayList<>();
 				if (componentIds.size() > 0) {
-					Long[] idArr = new Long[componentIds.size()];
-					componentGoods = componentGoodsDao.findByIdsInOrder(componentIds.toArray(idArr));
+					Long[] idArr = new Long[componentIdsLong.size()];
+					componentGoods = componentGoodsDao.findByIdsInOrder(componentIdsLong.toArray(idArr));
 				}
 				int length = (int)searchResult.get("total");
 				if(length < componentGoods.size()) {

+ 0 - 1
src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java

@@ -648,7 +648,6 @@ public class OrderServiceImpl implements OrderService {
         JSONObject orderInfo  = ordersInfos[0];
 
         JSONObject splitObject = orderInfo.getJSONObject("splitInfo");
-        System.out.println(splitObject);
 
         if(resultMap1.getCode() != ResultMapType.OK.getCode()) {
             return resultMap1;

+ 0 - 3
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_ctrl.js

@@ -174,9 +174,6 @@ define([ 'app/app' ], function(app) {
                 console.log(res);
             });
 
-            DistributionRule.findAllRuleName({},{},function (data) {
-                $scope.nameArray = data;
-            })
         };
         $scope.loadCityData();
 

+ 1 - 1
src/main/webapp/resources/view/common/site-nav.html

@@ -170,7 +170,7 @@
         </li>
         <li><a href=".">商城首页</a></li>
         <li ng-if="userInfo"><a href="user#/home">买家中心</a></li>
-        <li ng-if="userInfo.enterprises"><a href="vendor#/index">卖家中心</a></li>
+        <li ng-if="userInfo.enterprise.uu"><a href="vendor#/index">卖家中心</a></li>
         <li><a href="help/home" target="_blank">帮助中心</a></li>
         <!-- <li><a href="http://wpa.qq.com/msgrd?v=3&uin=3432892085&site=www.ubtoc.com&menu=yes" target="_blank">在线客服</a></li> -->
        <!-- <li><a href="javascript:void(0)">服务电话:400-830-1818</a></li>-->

+ 4 - 1
src/main/webapp/resources/view/usercenter/forstore/order_detail.html

@@ -487,7 +487,10 @@
 							<i style="color: #999;" ng-if="rule" ng-bind="'(' + rule.ruleName + ')'">(满1000元包邮,未满足的订单收取运费20元)</i>
 						</span>
 						<span class="total-price">
-								<p><strong>运费:</strong><em ng-bind="order.fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em></p>
+								<p><strong>运费:</strong>
+									<em ng-if="rule && rule.fareType != 3" ng-bind="order.fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+									<em ng-if="rule && rule.fareType == 3"  style="font-weight: bold;color:#e64040">到付</em>
+								</p>
 								<p><strong>店铺合计:</strong>
 									<em ng-bind="order.ensurePrice | formateNumber : 2 | currencySysmbol : order.currency" style="font-weight: bold"></em>
 								</p>

+ 7 - 4
src/main/webapp/resources/view/usercenter/forstore/order_pay.html

@@ -796,10 +796,13 @@
 							</span>
 							<span class="total-price">
 								<p><strong>运费:</strong>
-									<em ng-if="order.status==501" ng-bind="fareList[details[0].storeid] | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
-									<em ng-if="order.status!=501" style="font-weight: bold">
-										<em ng-if="!deliveryList" ng-bind="order.fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)"></em>
-										<em ng-if="deliveryList" ng-bind="deliveryList[details[0].storeid].fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)"></em>
+									<em ng-if="order.status==501 && deliveryList[details[0].storeid].fareType == 3" style="font-weight: bold;color:#e64040">到付</em>
+									<em ng-if="order.status==501 && deliveryList[details[0].storeid].fareType != 3" ng-bind="fareList[details[0].storeid] | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+									<em ng-if="order.status!=501">
+										<em ng-if="!deliveryList && rule.fareType != 3" ng-bind="order.fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+										<em ng-if="!deliveryList && rule.fareType == 3" style="font-weight: bold;color:#e64040">到付</em>
+										<em ng-if="deliveryList && deliveryList[details[0].storeid].fareType != 3" ng-bind="deliveryList[details[0].storeid].fare | formateNumber : 2 | currencySysmbol : order.currency.substring(0,3)" style="font-weight: bold"></em>
+										<em ng-if="deliveryList && deliveryList[details[0].storeid].fareType == 3" style="font-weight: bold;color:#e64040">到付</em>
 									</em>
 								</p>
 								<p><strong>店铺合计:</strong>

+ 4 - 1
src/main/webapp/resources/view/vendor/forstore/purchase_detail.html

@@ -540,7 +540,10 @@
 							<i style="color: #999;" ng-if="rule" ng-bind="'(' + rule.ruleName + ')'">(满1000元包邮,未满足的订单收取运费20元)</i>
 						</span>
 						<span class="total-price">
-								<p><strong>运费:</strong><em ng-bind="purchase.fare | formateNumber : 2 | currencySysmbol : purchase.currency.substring(0,3)" style="font-weight: bold"></em></p>
+								<p><strong>运费:</strong>
+									<em ng-if="!rule || rule.fareType != 3" ng-bind="purchase.fare | formateNumber : 2 | currencySysmbol : purchase.currency.substring(0,3)" style="font-weight: bold"></em>
+									<em ng-if="rule && rule.fareType == 3" style="font-weight: bold;color:#e64040">到付</em>
+								</p>
 								<p><strong>店铺合计:</strong>
 									<em ng-if="!isChange" ng-bind="purchase.ensurePrice | formateNumber : 2 | currencySysmbol : purchase.currency" style="font-weight: bold"></em>
 									<em ng-if="isChange" ng-bind="purchase.currentTotal | formateNumber : 2 | currencySysmbol : purchase.currency" style="font-weight: bold"></em>

+ 5 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_delivery_rule.html

@@ -438,6 +438,11 @@
 						<label for="style02"></label>
 						按总金额计算
 					</label>
+					<label class="check-act" ng-click="checkTab(3)">
+						<input type="radio" id="style03" name="radio2" ng-checked="modifyRule.fareType==3"/>
+						<label for="style03"></label>
+						到付
+					</label>
 				</div>
 				<!--统一规定运费-->
 				<div class="style-regulations common-style" ng-if="modifyRule.fareType==1">