Browse Source

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

# Conflicts:
#	watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/SalesOrderService.java
liujiankang 5 years ago
parent
commit
708140be55
16 changed files with 701 additions and 51 deletions
  1. 56 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/DeliveryStrategy.java
  2. 9 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/StrategyColor.java
  3. 9 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/StrategyProduct.java
  4. 9 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/StrategyStore.java
  5. 12 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/SalesOrderService.java
  6. 74 9
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java
  7. 12 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/SalesOrderMapper.java
  8. 23 2
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml
  9. 65 4
      watero-rst-service/src/main/java/com/iamberry/rst/service/order/DeliveryStrategyServiceImpl.java
  10. 15 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/DeliveryStrategyMapper.java
  11. 58 19
      watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/deliveryStrategyMapper.xml
  12. 46 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/DeliveryStrategyController.java
  13. 3 0
      watero-rst-web/src/main/resources/watero-rst-orm.xml
  14. 131 4
      watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/add_deliveryStrategy.ftl
  15. 23 5
      watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/deliveryStrategy_List.ftl
  16. 156 7
      watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/update_deliveryStrategy.ftl

+ 56 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/DeliveryStrategy.java

@@ -2,6 +2,7 @@ package com.iamberry.rst.core.order;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 public class DeliveryStrategy implements Serializable {
     private static final long serialVersionUID = -8130367521062365902L;
@@ -23,6 +24,13 @@ public class DeliveryStrategy implements Serializable {
     private String strategyProductName;
     private String strategyColorName;
 
+    private List<StrategyProduct> listStrategyProduct;
+    private List<StrategyColor> listStrategyColor;
+    private List<StrategyStore> listStrategyStore;
+    private String[] strategyProducts;
+    private String[] strategyColors;
+    private String[] strategyStores;
+
     public Integer getStrategyId() {
         return strategyId;
     }
@@ -150,4 +158,52 @@ public class DeliveryStrategy implements Serializable {
     public void setStrategyColorName(String strategyColorName) {
         this.strategyColorName = strategyColorName;
     }
+
+    public List<StrategyProduct> getListStrategyProduct() {
+        return listStrategyProduct;
+    }
+
+    public void setListStrategyProduct(List<StrategyProduct> listStrategyProduct) {
+        this.listStrategyProduct = listStrategyProduct;
+    }
+
+    public List<StrategyColor> getListStrategyColor() {
+        return listStrategyColor;
+    }
+
+    public void setListStrategyColor(List<StrategyColor> listStrategyColor) {
+        this.listStrategyColor = listStrategyColor;
+    }
+
+    public List<StrategyStore> getListStrategyStore() {
+        return listStrategyStore;
+    }
+
+    public void setListStrategyStore(List<StrategyStore> listStrategyStore) {
+        this.listStrategyStore = listStrategyStore;
+    }
+
+    public String[] getStrategyProducts() {
+        return strategyProducts;
+    }
+
+    public void setStrategyProducts(String[] strategyProducts) {
+        this.strategyProducts = strategyProducts;
+    }
+
+    public String[] getStrategyColors() {
+        return strategyColors;
+    }
+
+    public void setStrategyColors(String[] strategyColors) {
+        this.strategyColors = strategyColors;
+    }
+
+    public String[] getStrategyStores() {
+        return strategyStores;
+    }
+
+    public void setStrategyStores(String[] strategyStores) {
+        this.strategyStores = strategyStores;
+    }
 }

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/StrategyColor.java

@@ -7,6 +7,7 @@ public class StrategyColor implements Serializable {
     private Integer strategyColorId;
     private Integer strategyId;
     private Integer colorId;
+    private String colorName;
 
     public Integer getStrategyColorId() {
         return strategyColorId;
@@ -31,4 +32,12 @@ public class StrategyColor implements Serializable {
     public void setColorId(Integer colorId) {
         this.colorId = colorId;
     }
+
+    public String getColorName() {
+        return colorName;
+    }
+
+    public void setColorName(String colorName) {
+        this.colorName = colorName;
+    }
 }

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/StrategyProduct.java

@@ -7,6 +7,7 @@ public class StrategyProduct implements Serializable {
     private Integer strategyPorudctId;
     private Integer strategyId;
     private Integer productId;
+    private String productName;
 
     public Integer getStrategyPorudctId() {
         return strategyPorudctId;
@@ -31,4 +32,12 @@ public class StrategyProduct implements Serializable {
     public void setProductId(Integer productId) {
         this.productId = productId;
     }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
 }

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/StrategyStore.java

@@ -7,6 +7,7 @@ public class StrategyStore implements Serializable {
     private Integer strategyStoreId;
     private Integer strategyId;
     private Integer storeId;
+    private String  storeName;
 
     public Integer getStrategyStoreId() {
         return strategyStoreId;
@@ -31,4 +32,12 @@ public class StrategyStore implements Serializable {
     public void setStoreId(Integer storeId) {
         this.storeId = storeId;
     }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
 }

+ 12 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/SalesOrderService.java

@@ -597,4 +597,16 @@ public interface SalesOrderService {
    *添加快递策略店铺项
    */
   Integer addStrategyStore(StrategyStore strategyStore);
+  /**
+   *查询快递策略产品项
+   */
+  List<StrategyProduct> selectStrategyProduct(Integer strategyId);
+  /**
+   *查询快递策略颜色项
+   */
+  List<StrategyColor> selectStrategyColor(Integer strategyId);
+  /**
+   *查询快递策略店铺项
+   */
+  List<StrategyStore> selectStrategyStore(Integer strategyId);
 }

+ 74 - 9
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -778,7 +778,9 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         for (SalesOrder salesOrder:listSalesOrder) {
             for(DeliveryStrategy strategy : trategyList){
                 if(salesOrder.getSalesCompanyId().equals(strategy.getStrategyCompanyId())){
-                    if(salesOrder.getSalesStoreId().equals(strategy.getStrategyStoreId()) || strategy.getStrategyStoreId() == 0){
+
+
+                    /*if(salesOrder.getSalesStoreId().equals(strategy.getStrategyStoreId()) || strategy.getStrategyStoreId() == 0){
                         if(strategy.getStrategyProvinceNumber() == 0 || (salesOrder.getSalesAddressInfo().indexOf(strategy.getStrategyProvinceName()))!=-1){
                             //判断产品
                             for(SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()){
@@ -793,18 +795,66 @@ public class SalesOrderServiceImpl implements SalesOrderService {
                                 }
                             }
                         }
+                    }*/
+
+                    //判断店铺
+                    boolean isMeet1 = false;
+                    if(strategy.getStrategyStoreId() == 0){
+                        isMeet1 = true;
+                    }else{
+                        for(StrategyStore strategyStore : strategy.getListStrategyStore()){
+                            if(salesOrder.getSalesStoreId().equals(strategyStore.getStoreId())){
+                                isMeet1 = true;
+                            }
+                        }
                     }
-                }
-                //判断销售公司、销售店铺,地区(省)
-               /* if(salesOrder.getSalesCompanyId().equals(strategy.getStrategyCompanyId()) && salesOrder.getSalesStoreId().equals(strategy.getStrategyStoreId()) && (salesOrder.getSalesAddressInfo().indexOf(strategy.getStrategyProvinceName()))!=-1){
                     //判断产品
-                    for(SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()){
-                        if(salesOrderItem.getItemColorId().equals(strategy.getStrategyColorId())){
-                            salesOrder.setSalesPostFirm(strategy.getStrategyPostFirm());
-                            return;
+                    boolean isMeet2 = false;
+                    if(strategy.getStrategyProductId() == 0){
+                        isMeet2 = true;
+                    }else{
+                        for(SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()){
+                            boolean isProduct = false;
+                            for(StrategyProduct strategyProduct : strategy.getListStrategyProduct()){
+                                if(salesOrderItem.getItemProductId().equals(strategyProduct.getProductId())){
+                                    isProduct = true;
+                                    break;
+                                }
+                            }
+                            if(!isProduct){
+                                isMeet2 = false;
+                                break;
+                            }else{
+                                isMeet2 = true;
+                            }
+                        }
+                    }
+                    //判断颜色
+                    boolean isMeet3 = false;
+                    if(strategy.getStrategyProductId() == 0 || strategy.getStrategyColorId() == 0){
+                        isMeet3 = true;
+                    }else{
+                        for(SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()){
+                            boolean isProduct = false;
+                            for(StrategyColor strategyColor : strategy.getListStrategyColor()){
+                                if(salesOrderItem.getItemColorId().equals(strategyColor.getColorId())){
+                                    isProduct = true;
+                                    break;
+                                }
+                            }
+                            if(!isProduct){
+                                isMeet3 = false;
+                                break;
+                            }else{
+                                isMeet3 = true;
+                            }
                         }
                     }
-                }*/
+                    if(isMeet1 && isMeet2 && isMeet3){
+                        salesOrder.setSalesPostFirm(strategy.getStrategyPostFirm());
+                        return;
+                    }
+                }
             }
         }
         }
@@ -2036,6 +2086,21 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         return salesOrderMapper.addStrategyStore(strategyStore);
     }
 
+    @Override
+    public List<StrategyProduct> selectStrategyProduct(Integer strategyId) {
+        return salesOrderMapper.selectStrategyProduct(strategyId);
+    }
+
+    @Override
+    public List<StrategyColor> selectStrategyColor(Integer strategyId) {
+        return salesOrderMapper.selectStrategyColor(strategyId);
+    }
+
+    @Override
+    public List<StrategyStore> selectStrategyStore(Integer strategyId) {
+        return salesOrderMapper.selectStrategyStore(strategyId);
+    }
+
     /***
      * 计算金额
      * @param salesOrder

+ 12 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/SalesOrderMapper.java

@@ -531,4 +531,16 @@ public interface SalesOrderMapper {
      *添加快递策略店铺项
      */
     Integer addStrategyStore(StrategyStore strategyStore);
+    /**
+     *查询快递策略产品项
+     */
+    List<StrategyProduct> selectStrategyProduct(Integer strategyId);
+    /**
+     *查询快递策略颜色项
+     */
+    List<StrategyColor> selectStrategyColor(Integer strategyId);
+    /**
+     *查询快递策略店铺项
+     */
+    List<StrategyStore> selectStrategyStore(Integer strategyId);
 }

+ 23 - 2
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml

@@ -2501,7 +2501,7 @@
       VALUES
       (
         #{strategyId},
-        #{ProductId})
+        #{productId})
     </insert>
     <!-- 添加快递策略颜色项 -->
     <insert id="addStrategyColor" parameterType="StrategyColor">
@@ -2513,7 +2513,7 @@
       VALUES
       (
         #{strategyId},
-        #{ColorId})
+        #{colorId})
     </insert>
     <!-- 添加快递策略店铺项 -->
     <insert id="addStrategyStore" parameterType="StrategyStore">
@@ -2527,4 +2527,25 @@
         #{strategyId},
         #{storeId})
     </insert>
+    <select id="selectStrategyProduct" parameterType="Integer" resultType="StrategyProduct">
+        SELECT
+        *
+        FROM tb_rst_order_strategy_product
+        where
+        strategy_id = #{strategyId}
+    </select>
+    <select id="selectStrategyColor" parameterType="Integer" resultType="StrategyColor">
+        SELECT
+        *
+        FROM tb_rst_order_strategy_color
+        where
+        strategy_id = #{strategyId}
+    </select>
+    <select id="selectStrategyStore" parameterType="Integer" resultType="StrategyStore">
+        SELECT
+        *
+        FROM tb_rst_order_strategy_store
+        where
+        strategy_id = #{strategyId}
+    </select>
 </mapper>

+ 65 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/order/DeliveryStrategyServiceImpl.java

@@ -2,13 +2,18 @@ package com.iamberry.rst.service.order;
 
 import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.order.DeliveryStrategy;
+import com.iamberry.rst.core.order.StrategyColor;
+import com.iamberry.rst.core.order.StrategyProduct;
+import com.iamberry.rst.core.order.StrategyStore;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.order.DeliveryStrategyService;
+import com.iamberry.rst.service.cm.mapper.SalesOrderMapper;
 import com.iamberry.rst.service.order.mapper.DeliveryStrategyMapper;
 import com.iamberry.rst.util.PageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -21,6 +26,8 @@ import java.util.List;
 public class DeliveryStrategyServiceImpl implements DeliveryStrategyService {
     @Autowired
     private DeliveryStrategyMapper deliveryStrategyMapper;
+    @Autowired
+    private SalesOrderMapper salesOrderMapper;
 
     @Override
     public PagedResult<DeliveryStrategy> getDeliveryStrategyList(PageRequest<DeliveryStrategy> pageRequest) {
@@ -38,15 +45,41 @@ public class DeliveryStrategyServiceImpl implements DeliveryStrategyService {
     public DeliveryStrategy getDeliveryStrategyById(Integer strategyId) {
         return deliveryStrategyMapper.getDeliveryStrategyById(strategyId);
     }
-
+    @Transactional
     @Override
     public Integer save(DeliveryStrategy deliveryStrategy) {
         DeliveryStrategy ds2 = new DeliveryStrategy();
         ds2.setStrategyPriority(deliveryStrategy.getStrategyPriority());
         updatePriority(ds2);
-        return deliveryStrategyMapper.save(deliveryStrategy);
+        deliveryStrategyMapper.save(deliveryStrategy);
+        //添加策略项
+        if(deliveryStrategy.getStrategyProducts() != null){
+            for(String prductId : deliveryStrategy.getStrategyProducts()){
+                StrategyProduct strategyProduct = new StrategyProduct();
+                strategyProduct.setStrategyId(deliveryStrategy.getStrategyId());
+                strategyProduct.setProductId(Integer.valueOf(prductId));
+                salesOrderMapper.addStrategyProduct(strategyProduct);
+            }
+        }
+        if(deliveryStrategy.getStrategyColors() != null){
+            for(String colorId : deliveryStrategy.getStrategyColors()){
+                StrategyColor strategyColor = new StrategyColor();
+                strategyColor.setStrategyId(deliveryStrategy.getStrategyId());
+                strategyColor.setColorId(Integer.valueOf(colorId));
+                salesOrderMapper.addStrategyColor(strategyColor);
+            }
+        }
+        if(deliveryStrategy.getStrategyStores() != null){
+            for(String storeId : deliveryStrategy.getStrategyStores()){
+                StrategyStore strategyStore = new StrategyStore();
+                strategyStore.setStrategyId(deliveryStrategy.getStrategyId());
+                strategyStore.setStoreId(Integer.valueOf(storeId));
+                salesOrderMapper.addStrategyStore(strategyStore);
+            }
+        }
+        return 1;
     }
-
+    @Transactional
     @Override
     public Integer update(DeliveryStrategy deliveryStrategy) {
         if(deliveryStrategy.getStrategyPriority() != null){
@@ -55,7 +88,35 @@ public class DeliveryStrategyServiceImpl implements DeliveryStrategyService {
             ds2.setStrategyId(deliveryStrategy.getStrategyId());
             updatePriority(ds2);
         }
-
+        //删除策略项
+        deliveryStrategyMapper.delStrategyStore(deliveryStrategy.getStrategyId());
+        deliveryStrategyMapper.delStrategyProduct(deliveryStrategy.getStrategyId());
+        deliveryStrategyMapper.delStrategyColor(deliveryStrategy.getStrategyId());
+        //添加策略项
+        if(deliveryStrategy.getStrategyProducts() != null){
+            for(String prductId : deliveryStrategy.getStrategyProducts()){
+                StrategyProduct strategyProduct = new StrategyProduct();
+                strategyProduct.setStrategyId(deliveryStrategy.getStrategyId());
+                strategyProduct.setProductId(Integer.valueOf(prductId));
+                salesOrderMapper.addStrategyProduct(strategyProduct);
+            }
+        }
+        if(deliveryStrategy.getStrategyColors() != null){
+            for(String colorId : deliveryStrategy.getStrategyColors()){
+                StrategyColor strategyColor = new StrategyColor();
+                strategyColor.setStrategyId(deliveryStrategy.getStrategyId());
+                strategyColor.setColorId(Integer.valueOf(colorId));
+                salesOrderMapper.addStrategyColor(strategyColor);
+            }
+        }
+        if(deliveryStrategy.getStrategyStores() != null){
+            for(String storeId : deliveryStrategy.getStrategyStores()){
+                StrategyStore strategyStore = new StrategyStore();
+                strategyStore.setStrategyId(deliveryStrategy.getStrategyId());
+                strategyStore.setStoreId(Integer.valueOf(storeId));
+                salesOrderMapper.addStrategyStore(strategyStore);
+            }
+        }
         return deliveryStrategyMapper.update(deliveryStrategy);
     }
 

+ 15 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/DeliveryStrategyMapper.java

@@ -56,4 +56,19 @@ public interface DeliveryStrategyMapper {
      * @return Integer
      */
     List<DeliveryStrategy> getPriorityList(DeliveryStrategy deliveryStrategy);
+    /**
+     * 删除策略店铺
+     * @return Integer
+     */
+    Integer delStrategyStore(Integer strategyId);
+    /**
+     * 删除策略产品
+     * @return Integer
+     */
+    Integer delStrategyProduct(Integer strategyId);
+    /**
+     * 删除策略颜色
+     * @return Integer
+     */
+    Integer delStrategyColor(Integer strategyId);
 }

+ 58 - 19
watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/deliveryStrategyMapper.xml

@@ -1,8 +1,23 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.iamberry.rst.service.order.mapper.DeliveryStrategyMapper">
-
-    <select id="getDeliveryStrategyList" resultType="DeliveryStrategy" parameterType="DeliveryStrategy" >
+    <resultMap id="deliveryStrategyMap" type="DeliveryStrategy">
+        <id column="strategy_id" property="strategyId"/>
+        <result column="strategy_company_id" property="strategyCompanyId"/>
+        <result column="strategy_store_id" property="strategyStoreId"/>
+        <result column="strategy_province_number" property="strategyProvinceNumber"/>
+        <result column="strategy_color_id" property="strategyColorId"/>
+        <result column="strategy_priority" property="strategyPriority"/>
+        <result column="strategy_post_firm" property="strategyPostFirm"/>
+        <result column="strategy_status" property="strategyStatus"/>
+        <result column="strategy_update_date" property="strategyUpdateDate"/>
+        <result column="strategy_create_date" property="strategyCreateDate"/>
+        <result column="strategy_product_id" property="strategyProductId"/>
+        <collection property="listStrategyProduct" column="strategy_id" ofType="StrategyProduct" select="selectStrategyProduct"/>
+        <collection property="listStrategyColor" column="strategy_id" ofType="StrategyColor" select="selectStrategyColor"/>
+        <collection property="listStrategyStore" column="strategy_id" ofType="StrategyStore" select="selectStrategyStore"/>
+    </resultMap>
+    <select id="getDeliveryStrategyList" resultMap="deliveryStrategyMap" parameterType="DeliveryStrategy" >
         select
         strategy_id,
         strategy_company_id,
@@ -16,16 +31,10 @@
         strategy_create_date,
         strategy_product_id,
         sc.company_name strategyCompanyName,
-        si.store_name strategyStoreName,
-        ap.province strategyProvinceName,
-        pc.color_name strategyColorName,
-        pi.product_name strategyProductName
+        ap.province strategyProvinceName
         from tb_rst_order_delivery_strategy ds
         LEFT JOIN tb_rst_sales_company sc on ds.strategy_company_id = sc.company_id
-        LEFT JOIN tb_rst_store_info si on ds.strategy_store_id = si.store_id
         LEFT JOIN tb_rst_address_province ap on ds.strategy_province_number = ap.division_code
-        LEFT JOIN tb_rst_product_color pc on ds.strategy_color_id = pc.color_id
-        LEFT JOIN tb_rst_product_info pi on ds.strategy_product_id = pi.product_id
         <where>
             <if test="strategyStatus != null ">
                 AND strategy_status = #{strategyStatus}
@@ -36,7 +45,7 @@
         </where>
         ORDER BY strategy_priority
     </select>
-    <select id="getDeliveryStrategyById" resultType="DeliveryStrategy" parameterType="Integer" >
+    <select id="getDeliveryStrategyById" resultMap="deliveryStrategyMap" parameterType="Integer" >
         select
         strategy_id,
         strategy_company_id,
@@ -50,20 +59,14 @@
         strategy_create_date,
         strategy_product_id,
         sc.company_name strategyCompanyName,
-        si.store_name strategyStoreName,
-        ap.province strategyProvinceName,
-        pc.color_name strategyColorName,
-        pi.product_name strategyProductName
+        ap.province strategyProvinceName
         from tb_rst_order_delivery_strategy ds
         LEFT JOIN tb_rst_sales_company sc on ds.strategy_company_id = sc.company_id
-        LEFT JOIN tb_rst_store_info si on ds.strategy_store_id = si.store_id
         LEFT JOIN tb_rst_address_province ap on ds.strategy_province_number = ap.division_code
-        LEFT JOIN tb_rst_product_color pc on ds.strategy_color_id = pc.color_id
-        LEFT JOIN tb_rst_product_info pi on pc.color_product_id = pi.product_id
         where
         strategy_id = #{strategyId}
     </select>
-    <insert id="save" parameterType="DeliveryStrategy" >
+    <insert id="save" parameterType="DeliveryStrategy" useGeneratedKeys="true"  keyProperty="strategyId" >
         insert into
         tb_rst_order_delivery_strategy
         (
@@ -150,7 +153,7 @@
             </if >
         </where>
     </select>
-    <select id="getPriorityList" resultType="DeliveryStrategy" parameterType="DeliveryStrategy" >
+    <select id="getPriorityList" resultMap="deliveryStrategyMap" parameterType="DeliveryStrategy" >
         select
         strategy_id,
         strategy_company_id,
@@ -179,4 +182,40 @@
         </where>
         ORDER BY strategy_priority
     </select>
+    <select id="selectStrategyProduct" parameterType="Integer" resultType="StrategyProduct">
+        SELECT
+        sp.*,
+        pi.product_name AS productName
+        FROM tb_rst_order_strategy_product sp
+        LEFT JOIN tb_rst_product_info pi on sp.product_id = pi.product_id
+        where
+        strategy_id = #{strategyId}
+    </select>
+    <select id="selectStrategyColor" parameterType="Integer" resultType="StrategyColor">
+        SELECT
+        sc.*,
+        pc.color_name AS colorName
+        FROM tb_rst_order_strategy_color sc
+        LEFT JOIN tb_rst_product_color pc on sc.color_id = pc.color_id
+        where
+        strategy_id = #{strategyId}
+    </select>
+    <select id="selectStrategyStore" parameterType="Integer" resultType="StrategyStore">
+        SELECT
+        ss.*,
+        si.store_name AS storeName
+        FROM tb_rst_order_strategy_store ss
+        LEFT JOIN tb_rst_store_info si on ss.store_id = si.store_id
+        where
+        strategy_id = #{strategyId}
+    </select>
+    <delete id="delStrategyStore" parameterType="Integer">
+        DELETE FROM tb_rst_order_strategy_store where strategy_id = #{strategyId}
+    </delete>
+    <delete id="delStrategyProduct" parameterType="Integer">
+        DELETE FROM tb_rst_order_strategy_product where strategy_id = #{strategyId}
+    </delete>
+    <delete id="delStrategyColor" parameterType="Integer">
+        DELETE FROM tb_rst_order_strategy_color where strategy_id = #{strategyId}
+    </delete>
 </mapper>

+ 46 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/DeliveryStrategyController.java

@@ -115,7 +115,7 @@ public class DeliveryStrategyController {
         mv.addObject("logisticsInfoList",logisticsInfoList);
         mv.addObject("provinceList", provinceList);
         mv.addObject("productList",productList);
-        mv.addObject("priorityNum",deliveryStrategyService.getTop() + 1);
+        mv.addObject("priorityNum",deliveryStrategyService.getTop() == null? 0:deliveryStrategyService.getTop() + 1);
         return mv;
     }
     /**
@@ -132,6 +132,29 @@ public class DeliveryStrategyController {
             msg.setReturnCode(500);
             return msg;
         }
+        String[] storeId1 = request.getParameterValues("storeId1");
+        String[] productId1 = request.getParameterValues("productId1");
+        String[] productColorId1 = request.getParameterValues("productColorId1");
+        if(storeId1 != null && storeId1.length > 0){
+            deliveryStrategy.setStrategyStoreId(1);
+            deliveryStrategy.setStrategyStores(storeId1);
+        }else{
+            deliveryStrategy.setStrategyStoreId(0);
+        }
+        if(productId1 != null && productId1.length > 0){
+            deliveryStrategy.setStrategyProductId(1);
+            deliveryStrategy.setStrategyProducts(productId1);
+            if(productColorId1 != null && productColorId1.length > 0){
+                deliveryStrategy.setStrategyColorId(1);
+                deliveryStrategy.setStrategyColors(productColorId1);
+            }else{
+                deliveryStrategy.setStrategyColorId(0);
+            }
+        }else{
+            deliveryStrategy.setStrategyProductId(0);
+            deliveryStrategy.setStrategyColorId(0);
+        }
+
         deliveryStrategy.setStrategyStatus(1);
         if(deliveryStrategyService.save(deliveryStrategy) > 0){
             msg.setResultCode(200);
@@ -196,6 +219,28 @@ public class DeliveryStrategyController {
             msg.setReturnCode(500);
             return msg;
         }
+        String[] storeId1 = request.getParameterValues("storeId1");
+        String[] productId1 = request.getParameterValues("productId1");
+        String[] productColorId1 = request.getParameterValues("productColorId1");
+        if(storeId1 != null && storeId1.length > 0){
+            deliveryStrategy.setStrategyStoreId(1);
+            deliveryStrategy.setStrategyStores(storeId1);
+        }else{
+            deliveryStrategy.setStrategyStoreId(0);
+        }
+        if(productId1 != null && productId1.length > 0){
+            deliveryStrategy.setStrategyProductId(1);
+            deliveryStrategy.setStrategyProducts(productId1);
+            if(productColorId1 != null && productColorId1.length > 0){
+                deliveryStrategy.setStrategyColorId(1);
+                deliveryStrategy.setStrategyColors(productColorId1);
+            }else{
+                deliveryStrategy.setStrategyColorId(0);
+            }
+        }else{
+            deliveryStrategy.setStrategyProductId(0);
+            deliveryStrategy.setStrategyColorId(0);
+        }
         if(deliveryStrategyService.update(deliveryStrategy) > 0){
             msg.setResultCode(200);
             msg.setReturnCode(200);

+ 3 - 0
watero-rst-web/src/main/resources/watero-rst-orm.xml

@@ -239,6 +239,9 @@
 		<typeAlias type="com.iamberry.rst.core.pts.ProductionPlan" alias="ProductionPlan"/>
 		<!-- 快递策略-->
 		<typeAlias type="com.iamberry.rst.core.order.DeliveryStrategy" alias="DeliveryStrategy"/>
+		<typeAlias type="com.iamberry.rst.core.order.StrategyProduct" alias="StrategyProduct"/>
+		<typeAlias type="com.iamberry.rst.core.order.StrategyColor" alias="StrategyColor"/>
+		<typeAlias type="com.iamberry.rst.core.order.StrategyStore" alias="StrategyStore"/>
 		<!-- 订单跟踪-->
 		<typeAlias type="com.iamberry.rst.core.order.OrderTracking" alias="OrderTracking"/>
 	</typeAliases>

+ 131 - 4
watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/add_deliveryStrategy.ftl

@@ -39,6 +39,10 @@
         .huanhang{ float:left}
         input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
         input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .b-close{position: relative; display: inline-block;margin: 2px 0; padding:4px 1em 4px 4px; width: 150px;background: #f0f0f0;border: 1px solid rgba(0,0,0,.1);border-radius: 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;cursor: pointer;}
+        .my-close{position:absolute;right: 0.5em;top: 0.45em;width:0.15em;height:1em;background: #333;-webkit-transform: rotate(45deg);transform: rotate(45deg);display: inline-block;}
+        .my-close:after{content: "";position: absolute;top: 0;left: 0;width:0.15em;height:1em;background: #333;-webkit-transform: rotate(270deg);transform: rotate(270deg);}
+
     </style>
     <meta name="keywords" content="${path}">
     <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
@@ -64,7 +68,13 @@
                                 </#list>
                             </#if>
                 </select>
-                <select id="storeId" class="my-select" name="strategyStoreId" style="width: 195px">
+
+            </div>
+        </div>
+        <div class="row cl" >
+            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>销售店铺:</label>
+            <div class="formControls col-9 col-sm-9">
+                <select id="storeId"  class="chosen" name="strategyStoreId" style="width: 195px;">
                     <option value="0">所有店铺</option>
                             <#if storeList?? &&  (storeList?size > 0) >
                                 <#list storeList as type>
@@ -74,6 +84,17 @@
                 </select>
             </div>
         </div>
+        <div class="input-box" style="margin-top: -20px;">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" id="config1">
+                <div class="row">
+                    <ul class="close-box" id="configui1">
+
+                    </ul>
+                </div>
+
+            </div>
+        </div>
         <div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>地址:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
@@ -90,7 +111,7 @@
         <div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>产品:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
-                <select id="productId" name="strategyProductId" class="my-select" style="width: 195px">
+                <select id="productId" name="strategyProductId" class="chosen" class="my-select" style="width: 195px">
                     <option value="0">所有产品</option>
                     <#if (productList?size > 0)>
                             <#list productList as product>
@@ -98,8 +119,23 @@
                             </#list>
                     </#if>
                 </select>
+            </div>
+        </div>
+        <div class="input-box" style="margin-top: -20px;">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" id="config2">
+                <div class="row">
+                    <ul class="close-box" id="configui2">
+
+                    </ul>
+                </div>
 
-                <select id="productColorId" name="strategyColorId" class="my-select" style="width: 195px">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>产品颜色:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
+                <select id="productColorId" name="strategyColorId" class="chosen" class="my-select" style="width: 195px">
                     <option value="0">所有颜色</option>
                     <#if (productColorList?size > 0)>
                         <#list productColorList as productColor>
@@ -109,6 +145,17 @@
                 </select>
             </div>
         </div>
+        <div class="input-box" style="margin-top: -20px;">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" id="config3">
+                <div class="row">
+                    <ul class="close-box" id="configui3">
+
+                    </ul>
+                </div>
+
+            </div>
+        </div>
         <div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>快递公司:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
@@ -124,7 +171,7 @@
         <div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>优先级:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
-                <input class="my-input" type="text" value="${priorityNum!""}"  name="strategyPriority" id="strategyPriority" placeholder="请输入优先级" style="width: 78%;"/>
+                <input class="my-input" type="text" value="${priorityNum!""}"  name="strategyPriority" id="strategyPriority" placeholder="请输入优先级" style="width: 195px;"/>
             </div>
         </div>
         <div class="row cl">
@@ -137,7 +184,69 @@
 </article>
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
 <script type="text/javascript">
+    $('#storeId').change(function() {
+        var name = $("#storeId option:selected").text();
+        var id = $('#storeId').val();
+        var bl = true;
+        if(id != "" && id != 0) {
+            $("input[name='strategyStoreId']").each(function (j, item) {
+                var s = $(item).val();
+                if (s === id) {
+                    bl = false;
+                }
+            });
+            if (bl) {
+                $("#configui1").append('<li class="b-close" id="storeId1">' +
+                        ' <input type="hidden" value="' + id + '" name="storeId1">' + name +
+                        '<span class="my-close" onclick="deleteli(this)"></span>' +
+                        '</li>');
+            }
+        }
+
+    });
+    $('#productId').change(function() {
+        var name = $("#productId option:selected").text();
+        var id = $('#productId').val();
+        var bl = true;
+        if(id != "" && id != 0) {
+            $("input[name='strategyProductId']").each(function (j, item) {
+                var s = $(item).val();
+                if (s === id) {
+                    bl = false;
+                }
+            });
+            if (bl) {
+                $("#configui2").append('<li class="b-close" id="productId1">' +
+                        ' <input type="hidden" value="' + id + '" name="productId1">' + name +
+                        '<span class="my-close" onclick="deleteli(this)"></span>' +
+                        '</li>');
+            }
+        }
 
+    });
+    $('#productColorId').change(function() {
+        var name = $("#productColorId option:selected").text();
+        var id = $('#productColorId').val();
+        var bl = true;
+        if(id != "" && id != 0) {
+            $("input[name='strategyColorId']").each(function (j, item) {
+                var s = $(item).val();
+                if (s === id) {
+                    bl = false;
+                }
+            });
+            if (bl) {
+                $("#configui3").append('<li class="b-close" id="productColorId1">' +
+                        ' <input type="hidden" value="' + id + '" name="productColorId1">' + name +
+                        '<span class="my-close" onclick="deleteli(this)"></span>' +
+                        '</li>');
+            }
+        }
+
+    });
+    function deleteli(obj) {
+        $(obj).parent().remove();
+    }
     /**
      * 打开员工列表
      */
@@ -219,6 +328,7 @@
                         var storeInfo = data.returnMsg.storeInfoList[i];
                         $("#storeId").append("<option  data-id='"+storeInfo.storeId+"' value='"+ storeInfo.storeId +"'>"+ storeInfo.storeName +"</option>");
                     }
+                    $("#storeId").trigger("chosen:updated");//初始化
                 }
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){
@@ -246,6 +356,7 @@
                             var productColor = data.returnMsg.productColorList[i];
                             $("#productColorId").append('<option value='+productColor.colorId+'>'+productColor.colorName+'</option>');
                         }
+                        $("#productColorId").trigger("chosen:updated");//初始化
                     }
 
                 }
@@ -256,6 +367,22 @@
             }
         });
     }
+    $('.chosen').chosen({
+        no_results_text: "没有找到结果!",//搜索无结果时显示的提示
+        search_contains:true,   //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+        allow_single_deselect:true, //单选下拉框是否允许取消选择。如果允许,选中选项会有一个x号可以删除选项
+        disable_search: false, //禁用搜索。设置为true,则无法搜索选项。
+        disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
+        inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
+        placeholder_text_single: '选择国家', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
+        width: '195px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
+        max_shown_results: 1000, //下拉框最大显示选项数量
+        display_disabled_options: false,
+        single_backstroke_delete: false, //false表示按两次删除键才能删除选项,true表示按一次删除键即可删除
+        case_sensitive_search: false, //搜索大小写敏感。此处设为不敏感
+        group_search: false, //选项组是否可搜。此处搜索不可搜
+        include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
+    });
 </script>
 </body>
 </html>

+ 23 - 5
watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/deliveryStrategy_List.ftl

@@ -35,6 +35,7 @@
 					<th width="100">店铺</th>
 					<th width="100">地区</th>
 					<th width="100">产品</th>
+					<th width="100">颜色</th>
 					<th width="100">优先级</th>
 					<th width="100">快递</th>
 					<th width="100">操作</th>
@@ -49,7 +50,11 @@
                                 <#if list.strategyStoreId == 0>
                                     所有店铺
                                 <#else>
-                                    ${list.strategyStoreName!''}
+                                    <#if list.listStrategyStore?? &&  (list.listStrategyStore?size > 0) >
+                                        <#list list.listStrategyStore as listStore>
+                                            ${listStore.storeName}<br>
+                                        </#list>
+                                    </#if>
                                 </#if>
                             </td>
 							<td class="text-c" width="100">
@@ -62,10 +67,23 @@
 							<td class="text-c" width="100">
                                 <#if list.strategyProductId == 0>
                                     所有产品
-                                <#elseif list.strategyColorId == 0 >
-                                    ${list.strategyProductName!''}-(所有颜色)
                                 <#else>
-                                    ${list.strategyProductName!''}-(${list.strategyColorName!''})
+                                    <#if list.listStrategyProduct?? &&  (list.listStrategyProduct?size > 0) >
+                                        <#list list.listStrategyProduct as listProduct>
+                                            ${listProduct.productName}<br>
+                                        </#list>
+                                    </#if>
+                                </#if>
+                            </td>
+							<td class="text-c" width="100">
+                                <#if list.strategyColorId == 0>
+                                    所有颜色
+                                <#else>
+                                    <#if list.listStrategyColor?? &&  (list.listStrategyColor?size > 0) >
+                                        <#list list.listStrategyColor as listColor>
+                                            ${listColor.colorName}<br>
+                                        </#list>
+                                    </#if>
                                 </#if>
                             </td>
 
@@ -79,7 +97,7 @@
 						</tr>
 					</#list>
                 <#else>
-                <tr><td id="noMachineTr" colspan="7" class="td-manage text-c" >暂时没有快递策略,请添加!</td></tr>
+                <tr><td id="noMachineTr" colspan="8" class="td-manage text-c" >暂时没有快递策略,请添加!</td></tr>
                 </#if>
 				</tbody>
 			</table>

+ 156 - 7
watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/update_deliveryStrategy.ftl

@@ -39,6 +39,10 @@
         .huanhang{ float:left}
         input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
         input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .b-close{position: relative; display: inline-block;margin: 2px 0; padding:4px 1em 4px 4px; width: 150px;background: #f0f0f0;border: 1px solid rgba(0,0,0,.1);border-radius: 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;cursor: pointer;}
+        .my-close{position:absolute;right: 0.5em;top: 0.45em;width:0.15em;height:1em;background: #333;-webkit-transform: rotate(45deg);transform: rotate(45deg);display: inline-block;}
+        .my-close:after{content: "";position: absolute;top: 0;left: 0;width:0.15em;height:1em;background: #333;-webkit-transform: rotate(270deg);transform: rotate(270deg);}
+
     </style>
     <meta name="keywords" content="${path}">
     <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
@@ -64,14 +68,39 @@
                                 </#list>
                             </#if>
                 </select>
-                <select id="storeId" class="my-select" name="strategyStoreId" style="width: 195px">
+
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>销售店铺:</label>
+            <div class="formControls col-9 col-sm-9">
+                <select id="storeId" class="chosen" name="strategyStoreId" style="width: 195px">
                     <option value="0" <#if deliveryStrategy.strategyStoreId == 0>selected</#if>>所有店铺</option>
                             <#if storeInfoList?? &&  (storeInfoList?size > 0) >
                                 <#list storeInfoList as type>
-                                    <option value ="${type.storeId!}" <#if deliveryStrategy.strategyStoreId == type.storeId>selected</#if>>${type.storeName!}</option>
+                                    <option value ="${type.storeId!}" >${type.storeName!}</option>
                                 </#list>
                             </#if>
                 </select>
+
+            </div>
+        </div>
+        <div class="input-box" style="margin-top: -20px;">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" id="config1">
+                <div class="row">
+                    <ul class="close-box" id="configui1">
+                        <#if deliveryStrategy.listStrategyStore?? &&  (deliveryStrategy.listStrategyStore?size > 0) >
+                            <#list deliveryStrategy.listStrategyStore as list>
+                                 <li class="b-close" id="storeId1">
+                                 <input type="hidden" value="${list.storeId}" name="storeId1">${list.storeName}
+                                 <span class="my-close" onclick="deleteli(this)"></span>
+                                 </li>
+                            </#list>
+                        </#if>
+                    </ul>
+                </div>
+
             </div>
         </div>
         <div class="row cl">
@@ -90,25 +119,65 @@
         <div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>产品:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
-                <select id="productId" name="strategyProductId" class="my-select" style="width: 195px">
+                <select id="productId" name="strategyProductId" class="chosen" style="width: 195px">
                     <option value="0" <#if deliveryStrategy.strategyProductId == 0>selected</#if>>所有产品</option>
                     <#if (productList?size > 0)>
                             <#list productList as product>
-                                <option value="${product.productId!""}" <#if productId == product.productId>selected</#if> >${product.productName!""}</option>
+                                <option value="${product.productId!""}">${product.productName!""}</option>
                             </#list>
                     </#if>
                 </select>
+            </div>
+        </div>
+        <div class="input-box" style="margin-top: -20px;">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" id="config2">
+                <div class="row">
+                    <ul class="close-box" id="configui2">
+                        <#if deliveryStrategy.listStrategyProduct?? &&  (deliveryStrategy.listStrategyProduct?size > 0) >
+                            <#list deliveryStrategy.listStrategyProduct as list>
+                                 <li class="b-close" id="productId1">
+                                     <input type="hidden" value="${list.productId}" name="productId1">${list.productName}
+                                     <span class="my-close" onclick="deleteli(this)"></span>
+                                 </li>
+                            </#list>
+                        </#if>
+                    </ul>
+                </div>
 
-                <select id="productColorId" name="strategyColorId" class="my-select" style="width: 195px">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>产品:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
+                <select id="productColorId" name="strategyColorId" class="chosen" style="width: 195px">
                     <option value="0" <#if deliveryStrategy.strategyColorId == 0>selected</#if>>所有颜色</option>
                     <#if (productColorList?size > 0)>
                         <#list productColorList as productColor>
-                            <option value="${productColor.colorId!""}" <#if deliveryStrategy.strategyColorId == productColor.colorId>selected</#if> >${productColor.colorName!""}</option>
+                            <option value="${productColor.colorId!""}">${productColor.colorName!""}</option>
                         </#list>
                     </#if>
                 </select>
             </div>
         </div>
+        <div class="input-box" style="margin-top: -20px;">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" id="config3">
+                <div class="row">
+                    <ul class="close-box" id="configui3">
+                        <#if deliveryStrategy.listStrategyColor?? &&  (deliveryStrategy.listStrategyColor?size > 0) >
+                            <#list deliveryStrategy.listStrategyColor as list>
+                                 <li class="b-close" id="productColorId1">
+                                     <input type="hidden" value="${list.colorId}" name="productColorId1">${list.colorName}
+                                     <span class="my-close" onclick="deleteli(this)"></span>
+                                 </li>
+                            </#list>
+                        </#if>
+                    </ul>
+                </div>
+
+            </div>
+        </div>
         <div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>快递公司:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
@@ -124,7 +193,7 @@
         <div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>优先级:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
-                <input class="my-input" type="text" value="${deliveryStrategy.strategyPriority!""}"  name="strategyPriority" id="strategyPriority" placeholder="请输入优先级" style="width: 78%;"/>
+                <input class="my-input" type="text" value="${deliveryStrategy.strategyPriority!""}"  name="strategyPriority" id="strategyPriority" placeholder="请输入优先级" style="width: 195pxx;"/>
             </div>
         </div>
         <div class="row cl">
@@ -138,7 +207,69 @@
 </article>
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
 <script type="text/javascript">
+    $('#storeId').change(function() {
+        var name = $("#storeId option:selected").text();
+        var id = $('#storeId').val();
+        var bl = true;
+        if(id != "" && id != 0) {
+            $("input[name='strategyStoreId']").each(function (j, item) {
+                var s = $(item).val();
+                if (s === id) {
+                    bl = false;
+                }
+            });
+            if (bl) {
+                $("#configui1").append('<li class="b-close" id="storeId1">' +
+                        ' <input type="hidden" value="' + id + '" name="storeId1">' + name +
+                        '<span class="my-close" onclick="deleteli(this)"></span>' +
+                        '</li>');
+            }
+        }
 
+    });
+    $('#productId').change(function() {
+        var name = $("#productId option:selected").text();
+        var id = $('#productId').val();
+        var bl = true;
+        if(id != "" && id != 0) {
+            $("input[name='strategyProductId']").each(function (j, item) {
+                var s = $(item).val();
+                if (s === id) {
+                    bl = false;
+                }
+            });
+            if (bl) {
+                $("#configui2").append('<li class="b-close" id="productId1">' +
+                        ' <input type="hidden" value="' + id + '" name="productId1">' + name +
+                        '<span class="my-close" onclick="deleteli(this)"></span>' +
+                        '</li>');
+            }
+        }
+
+    });
+    $('#productColorId').change(function() {
+        var name = $("#productColorId option:selected").text();
+        var id = $('#productColorId').val();
+        var bl = true;
+        if(id != "" && id != 0) {
+            $("input[name='strategyColorId']").each(function (j, item) {
+                var s = $(item).val();
+                if (s === id) {
+                    bl = false;
+                }
+            });
+            if (bl) {
+                $("#configui3").append('<li class="b-close" id="productColorId1">' +
+                        ' <input type="hidden" value="' + id + '" name="productColorId1">' + name +
+                        '<span class="my-close" onclick="deleteli(this)"></span>' +
+                        '</li>');
+            }
+        }
+
+    });
+    function deleteli(obj) {
+        $(obj).parent().remove();
+    }
 
 
 
@@ -207,6 +338,7 @@
                         var storeInfo = data.returnMsg.storeInfoList[i];
                         $("#storeId").append("<option  data-id='"+storeInfo.storeId+"' value='"+ storeInfo.storeId +"'>"+ storeInfo.storeName +"</option>");
                     }
+                    $("#storeId").trigger("chosen:updated");//初始化
                 }
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){
@@ -233,6 +365,7 @@
                             var productColor = data.returnMsg.productColorList[i];
                             $("#productColorId").append('<option value='+productColor.colorId+'>'+productColor.colorName+'</option>');
                         }
+                        $("#productColorId").trigger("chosen:updated");//初始化
                     }
 
                 }
@@ -243,6 +376,22 @@
             }
         });
     }
+    $('.chosen').chosen({
+        no_results_text: "没有找到结果!",//搜索无结果时显示的提示
+        search_contains:true,   //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+        allow_single_deselect:true, //单选下拉框是否允许取消选择。如果允许,选中选项会有一个x号可以删除选项
+        disable_search: false, //禁用搜索。设置为true,则无法搜索选项。
+        disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
+        inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
+        placeholder_text_single: '选择国家', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
+        width: '195px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
+        max_shown_results: 1000, //下拉框最大显示选项数量
+        display_disabled_options: false,
+        single_backstroke_delete: false, //false表示按两次删除键才能删除选项,true表示按一次删除键即可删除
+        case_sensitive_search: false, //搜索大小写敏感。此处设为不敏感
+        group_search: false, //选项组是否可搜。此处搜索不可搜
+        include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
+    });
 </script>
 </body>
 </html>