Browse Source

5. 工厂生产管理

liujiankang 5 years ago
parent
commit
9c6d3b6a3d

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

@@ -0,0 +1,144 @@
+package com.iamberry.rst.core.order;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class DeliveryStrategy implements Serializable {
+    private static final long serialVersionUID = -8130367521062365902L;
+    private Integer strategyId;
+    private Integer strategyCompanyId;
+    private Integer strategyStoreId;
+    private Integer strategyProvinceNumber;
+    private Integer strategyColorId;
+    private Integer strategyPriority;
+    private String strategyPostFirm;
+    private Date strategyUpdateDate;
+    private Date strategyCreateDate;
+    private Integer strategyStatus;
+
+    private String strategyCompanyName;
+    private String strategyStoreName;
+    private String strategyProvinceName;
+    private String strategyProductName;
+    private String strategyColorName;
+
+    public Integer getStrategyId() {
+        return strategyId;
+    }
+
+    public void setStrategyId(Integer strategyId) {
+        this.strategyId = strategyId;
+    }
+
+    public Integer getStrategyCompanyId() {
+        return strategyCompanyId;
+    }
+
+    public void setStrategyCompanyId(Integer strategyCompanyId) {
+        this.strategyCompanyId = strategyCompanyId;
+    }
+
+    public Integer getStrategyStoreId() {
+        return strategyStoreId;
+    }
+
+    public void setStrategyStoreId(Integer strategyStoreId) {
+        this.strategyStoreId = strategyStoreId;
+    }
+
+    public Integer getStrategyProvinceNumber() {
+        return strategyProvinceNumber;
+    }
+
+    public void setStrategyProvinceNumber(Integer strategyProvinceNumber) {
+        this.strategyProvinceNumber = strategyProvinceNumber;
+    }
+
+    public Integer getStrategyColorId() {
+        return strategyColorId;
+    }
+
+    public void setStrategyColorId(Integer strategyColorId) {
+        this.strategyColorId = strategyColorId;
+    }
+
+    public Integer getStrategyPriority() {
+        return strategyPriority;
+    }
+
+    public void setStrategyPriority(Integer strategyPriority) {
+        this.strategyPriority = strategyPriority;
+    }
+
+    public String getStrategyPostFirm() {
+        return strategyPostFirm;
+    }
+
+    public void setStrategyPostFirm(String strategyPostFirm) {
+        this.strategyPostFirm = strategyPostFirm;
+    }
+
+    public Date getStrategyUpdateDate() {
+        return strategyUpdateDate;
+    }
+
+    public void setStrategyUpdateDate(Date strategyUpdateDate) {
+        this.strategyUpdateDate = strategyUpdateDate;
+    }
+
+    public Date getStrategyCreateDate() {
+        return strategyCreateDate;
+    }
+
+    public void setStrategyCreateDate(Date strategyCreateDate) {
+        this.strategyCreateDate = strategyCreateDate;
+    }
+
+    public Integer getStrategyStatus() {
+        return strategyStatus;
+    }
+
+    public void setStrategyStatus(Integer strategyStatus) {
+        this.strategyStatus = strategyStatus;
+    }
+
+    public String getStrategyCompanyName() {
+        return strategyCompanyName;
+    }
+
+    public void setStrategyCompanyName(String strategyCompanyName) {
+        this.strategyCompanyName = strategyCompanyName;
+    }
+
+    public String getStrategyStoreName() {
+        return strategyStoreName;
+    }
+
+    public void setStrategyStoreName(String strategyStoreName) {
+        this.strategyStoreName = strategyStoreName;
+    }
+
+    public String getStrategyProvinceName() {
+        return strategyProvinceName;
+    }
+
+    public void setStrategyProvinceName(String strategyProvinceName) {
+        this.strategyProvinceName = strategyProvinceName;
+    }
+
+    public String getStrategyProductName() {
+        return strategyProductName;
+    }
+
+    public void setStrategyProductName(String strategyProductName) {
+        this.strategyProductName = strategyProductName;
+    }
+
+    public String getStrategyColorName() {
+        return strategyColorName;
+    }
+
+    public void setStrategyColorName(String strategyColorName) {
+        this.strategyColorName = strategyColorName;
+    }
+}

+ 57 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/order/DeliveryStrategyService.java

@@ -0,0 +1,57 @@
+package com.iamberry.rst.faces.order;
+
+import com.iamberry.rst.core.order.DeliveryStrategy;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.ProductionPlan;
+
+import java.util.List;
+
+/**
+ *
+ * @author ljk
+ * @Date 2018-09-12
+ */
+public interface DeliveryStrategyService {
+    /**
+     * 获取集合
+     * @param
+     * @return List
+     */
+    PagedResult<DeliveryStrategy> getDeliveryStrategyList(PageRequest<DeliveryStrategy> pageRequest);
+    /**
+     * 获取集合
+     * @param
+     * @return List
+     */
+    List<DeliveryStrategy> getDeliveryStrategyList(DeliveryStrategy pageRequest);
+    /**
+     * 查询单条数据
+     * @param  strategyId
+     * @return  DeliveryStrategy
+     */
+    DeliveryStrategy  getDeliveryStrategyById(Integer strategyId);
+    /**
+     * 增加数据
+     * @param  deliveryStrategy
+     * @return Integer
+     */
+    Integer  save(DeliveryStrategy deliveryStrategy);
+    /**
+     * 修改数据
+     * @param  deliveryStrategy
+     * @return Integer
+     */
+    Integer  update(DeliveryStrategy deliveryStrategy);
+    /**
+     * 删除数据
+     * @param  strategyId
+     * @return Integer
+     */
+    Integer  delete(Integer strategyId);
+    /**
+     * 获取优先级最大的值
+     * @return Integer
+     */
+    Integer  getTop();
+}

+ 38 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -27,6 +27,7 @@ import com.iamberry.rst.service.dm.mapper.SupplierProductMapper;
 import com.iamberry.rst.service.fm.mapper.ComplaintDetectInfoMapper;
 import com.iamberry.rst.service.fm.mapper.InventoryLogMapper;
 import com.iamberry.rst.service.fm.mapper.InventoryMapper;
+import com.iamberry.rst.service.order.mapper.DeliveryStrategyMapper;
 import com.iamberry.rst.service.order.mapper.ProvincesLogisticsMapper;
 import com.iamberry.rst.service.product.mapper.ProductMapper;
 import com.iamberry.rst.service.sys.mapper.SysConfigMapper;
@@ -87,6 +88,8 @@ public class SalesOrderServiceImpl implements SalesOrderService {
     private SupplierProductMapper supplierProductMapper;
     @Autowired
     private OrderBatchService orderBatchService;
+    @Autowired
+    private DeliveryStrategyMapper deliveryStrategyMapper;
 
     /**
      * 缓存订单项的前缀
@@ -639,6 +642,14 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         }
         // 计算金额
         calculationTotal(mainOrder,mainOrder.getSalesOrderItemList());
+
+        //2019年12月27日15:49:16新增快递策略 分配物流方式
+        List<SalesOrder> listS = new ArrayList<>();
+        listS.add(mainOrder);
+        setStrategyLogistics(listS);
+        //子订单根据快递策略分配物流方式
+        setStrategyLogistics(listSalesOrder);
+
         // 保存订单信息
         int res = salesOrderMapper.addSalesOrder(mainOrder);
         if (res <= 0) {
@@ -737,7 +748,33 @@ public class SalesOrderServiceImpl implements SalesOrderService {
             }
         }
     }
-
+    /**
+     * 根据快递策略来分配物流公司
+     * @param listSalesOrder
+     * @return
+     */
+    public void setStrategyLogistics(List<SalesOrder> listSalesOrder){
+        if(listSalesOrder.size() > 0){
+        //查询所有快递策略
+        DeliveryStrategy deliveryStrategy = new DeliveryStrategy();
+        deliveryStrategy.setStrategyStatus(1);
+        List<DeliveryStrategy> trategyList = deliveryStrategyMapper.getPriorityList(deliveryStrategy);
+        for (SalesOrder salesOrder:listSalesOrder) {
+            for(DeliveryStrategy strategy : trategyList){
+                //判断销售公司、销售店铺,地区(省)
+                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;
+                        }
+                    }
+                }
+            }
+        }
+        }
+    }
     @Override
     public List<SalesOrderItem> listSalesOrderItem(SalesOrderItem salesOrderItem) {
         return salesOrderMapper.listSalesOrderItem(salesOrderItem);

+ 90 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/DeliveryStrategyServiceImpl.java

@@ -0,0 +1,90 @@
+package com.iamberry.rst.service.order;
+
+import com.github.pagehelper.PageHelper;
+import com.iamberry.rst.core.order.DeliveryStrategy;
+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.order.mapper.DeliveryStrategyMapper;
+import com.iamberry.rst.util.PageUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *
+ * @author ljk
+ * @Date 2019年12月26日11:19:07
+ */
+@Service
+public class DeliveryStrategyServiceImpl implements DeliveryStrategyService {
+    @Autowired
+    private DeliveryStrategyMapper deliveryStrategyMapper;
+
+    @Override
+    public PagedResult<DeliveryStrategy> getDeliveryStrategyList(PageRequest<DeliveryStrategy> pageRequest) {
+        PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());
+        List<DeliveryStrategy> deliveryStrategyList = deliveryStrategyMapper.getDeliveryStrategyList(pageRequest.getData());
+        return PageUtil.getPage(deliveryStrategyList);
+    }
+
+    @Override
+    public List<DeliveryStrategy> getDeliveryStrategyList(DeliveryStrategy deliveryStrategy) {
+        return deliveryStrategyMapper.getDeliveryStrategyList(deliveryStrategy);
+    }
+
+    @Override
+    public DeliveryStrategy getDeliveryStrategyById(Integer strategyId) {
+        return deliveryStrategyMapper.getDeliveryStrategyById(strategyId);
+    }
+
+    @Override
+    public Integer save(DeliveryStrategy deliveryStrategy) {
+        DeliveryStrategy ds2 = new DeliveryStrategy();
+        ds2.setStrategyPriority(deliveryStrategy.getStrategyPriority());
+        updatePriority(ds2);
+        return deliveryStrategyMapper.save(deliveryStrategy);
+    }
+
+    @Override
+    public Integer update(DeliveryStrategy deliveryStrategy) {
+        if(deliveryStrategy.getStrategyPriority() != null){
+            DeliveryStrategy ds2 = new DeliveryStrategy();
+            ds2.setStrategyPriority(deliveryStrategy.getStrategyPriority());
+            ds2.setStrategyId(deliveryStrategy.getStrategyId());
+            updatePriority(ds2);
+        }
+
+        return deliveryStrategyMapper.update(deliveryStrategy);
+    }
+
+    @Override
+    public Integer delete(Integer strategyId) {
+        return deliveryStrategyMapper.delete(strategyId);
+    }
+
+    @Override
+    public Integer getTop() {
+        return deliveryStrategyMapper.getTop();
+    }
+
+    //修改排序
+    public void updatePriority(DeliveryStrategy delivery){
+        DeliveryStrategy ds = new DeliveryStrategy();
+        ds.setStrategyPriority(delivery.getStrategyPriority());
+        ds.setStrategyId(delivery.getStrategyId());
+        if(deliveryStrategyMapper.getPriorityList(ds).size() > 0){
+            List<DeliveryStrategy> list = deliveryStrategyMapper.getDeliveryStrategyPriorityList(delivery);
+            if(list.size() > 0){
+                for(DeliveryStrategy strategy : list){
+                    DeliveryStrategy deliveryStrategy = new DeliveryStrategy();
+                    deliveryStrategy.setStrategyId(strategy.getStrategyId());
+                    deliveryStrategy.setStrategyPriority(strategy.getStrategyPriority() + 1);
+                    deliveryStrategyMapper.update(deliveryStrategy);
+                }
+            }
+        }
+    }
+
+}

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

@@ -0,0 +1,59 @@
+package com.iamberry.rst.service.order.mapper;
+
+import com.iamberry.rst.core.order.DeliveryStrategy;
+import com.iamberry.rst.core.tools.LogisticsInfo;
+
+import java.util.List;
+
+/**
+ *
+ * @author ljk
+ * @Date 2019年12月26日11:09:56
+ */
+public interface DeliveryStrategyMapper {
+    /**
+     * 获取集合
+     * @param  deliveryStrategy
+     * @return List
+     */
+    List<DeliveryStrategy> getDeliveryStrategyList(DeliveryStrategy deliveryStrategy);
+    /**
+     * 查询单条数据
+     * @param  strategyId
+     * @return  DeliveryStrategy
+     */
+    DeliveryStrategy  getDeliveryStrategyById(Integer strategyId);
+    /**
+     * 增加数据
+     * @param  deliveryStrategy
+     * @return Integer
+     */
+    Integer  save(DeliveryStrategy deliveryStrategy);
+    /**
+     * 修改数据
+     * @param  deliveryStrategy
+     * @return Integer
+     */
+    Integer  update(DeliveryStrategy deliveryStrategy);
+    /**
+     * 删除数据
+     * @param  strategyId
+     * @return Integer
+     */
+    Integer  delete(Integer strategyId);
+    /**
+     * 获取优先级最大的值
+     * @return Integer
+     */
+    Integer  getTop();
+    /**
+     * 获取优先级大于某个值的策略
+     * @return Integer
+     */
+    List<DeliveryStrategy> getDeliveryStrategyPriorityList(DeliveryStrategy deliveryStrategy);
+    /**
+     * 获取优先级等于某个值的策略
+     * @return Integer
+     */
+    List<DeliveryStrategy> getPriorityList(DeliveryStrategy deliveryStrategy);
+}

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

@@ -0,0 +1,173 @@
+<?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" >
+        select
+        strategy_id,
+        strategy_company_id,
+        strategy_store_id,
+        strategy_province_number,
+        strategy_color_id,
+        strategy_priority,
+        strategy_post_firm,
+        strategy_status,
+        strategy_update_date,
+        strategy_create_date,
+        sc.company_name strategyCompanyName,
+        si.store_name strategyStoreName,
+        ap.province strategyProvinceName,
+        pc.color_name strategyColorName,
+        pi.product_name strategyProductName
+        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>
+            <if test="strategyStatus != null ">
+                AND strategy_status = #{strategyStatus}
+            </if >
+            <if test="strategyPriority != null ">
+                AND strategy_priority = #{strategyPriority}
+            </if >
+        </where>
+        ORDER BY strategy_priority
+    </select>
+    <select id="getDeliveryStrategyById" resultType="DeliveryStrategy" parameterType="Integer" >
+        select
+        strategy_id,
+        strategy_company_id,
+        strategy_store_id,
+        strategy_province_number,
+        strategy_color_id,
+        strategy_priority,
+        strategy_post_firm,
+        strategy_status,
+        strategy_update_date,
+        strategy_create_date,
+        sc.company_name strategyCompanyName,
+        si.store_name strategyStoreName,
+        ap.province strategyProvinceName,
+        pc.color_name strategyColorName,
+        pi.product_name strategyProductName
+        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 into
+        tb_rst_order_delivery_strategy
+        (
+        strategy_company_id,
+        strategy_store_id,
+        strategy_province_number,
+        strategy_color_id,
+        strategy_priority,
+        strategy_post_firm,
+        strategy_status,
+        strategy_create_date
+        )
+        values
+        (
+        #{strategyCompanyId},
+        #{strategyStoreId},
+        #{strategyProvinceNumber},
+        #{strategyColorId},
+        #{strategyPriority},
+        #{strategyPostFirm},
+        #{strategyStatus},
+        #{strategyCreateDate}
+        )
+    </insert>
+    <update id="update" parameterType="DeliveryStrategy" >
+        update
+        tb_rst_order_delivery_strategy
+        <set >
+            <if test="strategyCompanyId != null and strategyCompanyId != ''">
+                strategy_company_id = #{strategyCompanyId},
+            </if >
+            <if test="strategyStoreId != null and strategyStoreId != ''">
+                strategy_store_id = #{strategyStoreId},
+            </if >
+            <if test="strategyProvinceNumber != null and strategyProvinceNumber != ''">
+                strategy_province_number = #{strategyProvinceNumber},
+            </if >
+            <if test="strategyColorId != null and strategyColorId != ''">
+                strategy_color_id = #{strategyColorId},
+            </if >
+            <if test="strategyPriority != null and strategyPriority != ''">
+                strategy_priority = #{strategyPriority},
+            </if >
+            <if test="strategyPostFirm != null and strategyPostFirm != ''">
+                strategy_post_firm = #{strategyPostFirm},
+            </if >
+            <if test="strategyStatus != null and strategyStatus != ''">
+                strategy_status = #{strategyStatus}
+            </if >
+        </set >
+        where strategy_id = #{strategyId}
+    </update>
+    <delete id="delete" parameterType="Integer">
+        DELETE FROM tb_rst_order_delivery_strategy where strategy_id = #{strategyId}
+    </delete>
+    <select id="getTop" resultType="Integer">
+        SELECT max(strategy_priority) from tb_rst_order_delivery_strategy
+    </select>
+    <select id="getDeliveryStrategyPriorityList" resultType="DeliveryStrategy" parameterType="DeliveryStrategy" >
+        select
+        strategy_id,
+        strategy_company_id,
+        strategy_store_id,
+        strategy_province_number,
+        strategy_color_id,
+        strategy_priority,
+        strategy_post_firm,
+        strategy_status,
+        strategy_update_date,
+        strategy_create_date
+        from tb_rst_order_delivery_strategy
+        <where>
+            <if test="strategyPriority != null ">
+                AND strategy_priority &gt;= #{strategyPriority}
+            </if >
+            <if test="strategyId != null ">
+                AND strategy_id != #{strategyId}
+            </if >
+        </where>
+    </select>
+    <select id="getPriorityList" resultType="DeliveryStrategy" parameterType="DeliveryStrategy" >
+        select
+        strategy_id,
+        strategy_company_id,
+        strategy_store_id,
+        strategy_province_number,
+        strategy_color_id,
+        strategy_priority,
+        strategy_post_firm,
+        strategy_status,
+        strategy_update_date,
+        strategy_create_date,
+        ap.province strategyProvinceName
+        from tb_rst_order_delivery_strategy ds
+        LEFT JOIN tb_rst_address_province ap on ds.strategy_province_number = ap.division_code
+        <where>
+            <if test="strategyStatus != null ">
+                AND strategy_status = #{strategyStatus}
+            </if >
+            <if test="strategyPriority != null ">
+                AND strategy_priority = #{strategyPriority}
+            </if >
+            <if test="strategyId != null ">
+                AND strategy_id != #{strategyId}
+            </if >
+        </where>
+        ORDER BY strategy_priority
+    </select>
+</mapper>

+ 226 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/DeliveryStrategyController.java

@@ -0,0 +1,226 @@
+package com.iamberry.rst.controllers.order;
+
+import com.iamberry.rst.controllers.sys.SysController;
+import com.iamberry.rst.core.address.Province;
+import com.iamberry.rst.core.cm.CompanyInfo;
+import com.iamberry.rst.core.cm.StoreInfo;
+import com.iamberry.rst.core.order.DeliveryStrategy;
+import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.order.ProductColor;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.tools.LogisticsInfo;
+import com.iamberry.rst.faces.address.AddressService;
+import com.iamberry.rst.faces.cm.CompanyInfoService;
+import com.iamberry.rst.faces.cm.StoreInfoService;
+import com.iamberry.rst.faces.order.DeliveryStrategyService;
+import com.iamberry.rst.faces.order.LogisticsInfoService;
+import com.iamberry.rst.faces.product.ProductService;
+import com.iamberry.rst.utils.StitchAttrUtil;
+import com.iamberry.wechat.tools.ResponseJson;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * 快递策略 handler
+ *
+ * @company LJK
+ * @website www.iamberry.com
+ * @date 2019年12月26日11:28:40
+ */
+@Controller
+@RequestMapping("/admin/deliveryStrategy")
+public class DeliveryStrategyController {
+    private static Logger logger = LoggerFactory.getLogger(SysController.class);
+    @Autowired
+    private DeliveryStrategyService deliveryStrategyService;
+    @Autowired
+    private CompanyInfoService companyInfoService;
+    @Autowired
+    private StoreInfoService storeInfoService;
+    @Autowired
+    private AddressService addressService;
+    @Autowired
+    private ProductService productService;
+    @Autowired
+    private LogisticsInfoService logisticsInfoService;
+    /**
+     * 查询快递策略列表信息
+     *
+     * @param request
+     * @param pageNO
+     * @param pageTotal
+     * @param pageSize
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("deliveryStrategy:select:deliveryStrategy")
+    @RequestMapping("/select_deliveryStrategy_list")
+    public ModelAndView selectDeliveryStrategyList(HttpServletRequest request,
+                                                 @RequestParam(value = "pageNO", defaultValue = "1", required = false) int pageNO,
+                                                 @RequestParam(value = "pageTotal", required = false) Integer pageTotal,
+                                                 @RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize,
+                                                 DeliveryStrategy deliveryStrategy
+    ) throws Exception {
+        ModelAndView mv = new ModelAndView("/order/strategy/deliveryStrategy_list");
+        StringBuilder url = new StringBuilder("/admin/deliveryStrategy/select_deliveryStrategy_list?pageSize=" + pageSize);
+        // 封装请求数据
+        PageRequest<DeliveryStrategy> pageRequest = new PageRequest<>(deliveryStrategy, pageNO, pageSize, pageTotal == null);
+        // 查询生产计划列表
+        PagedResult<DeliveryStrategy> result = deliveryStrategyService.getDeliveryStrategyList(pageRequest);
+        long total = 0;
+        if (pageTotal == null) {
+            total = result.getPages();
+        } else {
+            total = pageTotal;
+            result.setPages(total);
+        }
+        StitchAttrUtil.getSa().setModelAndView(deliveryStrategy, mv, "/admin/deliveryStrategy/select_deliveryStrategy_list", result);
+        return mv;
+    }
+    /**
+     * 进入添加快递策略计划
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/to_addProductionPlan")
+    public ModelAndView to_addProductionPlan(DeliveryStrategy deliveryStrategy) throws Exception {
+        ModelAndView mv = new ModelAndView("order/strategy/add_deliveryStrategy");
+        List<CompanyInfo> companyInfoList =  companyInfoService.listCompanyInfo(new CompanyInfo());
+        StoreInfo storeInfo = new StoreInfo();
+        storeInfo.setStoreStatus(1);
+        List<StoreInfo> storeInfoList = storeInfoService.listStore(storeInfo);
+        Province province = new Province();
+        List<Province> provinceList = addressService.listProvince(province);
+        Product product = new Product();
+        List<Product> productList = productService.listProductAndColorAndfittings(product);
+        ProductColor color = new ProductColor();
+        color.setColorProductId(productList.get(0).getProductId());
+        List<ProductColor> productColorList = productService.listProduceColor(color);
+        List<LogisticsInfo> logisticsInfoList =  logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+        mv.addObject("productColorList",productColorList);
+        mv.addObject("companyInfoList",companyInfoList);
+        mv.addObject("storeInfoList", storeInfoList);
+        mv.addObject("logisticsInfoList",logisticsInfoList);
+        mv.addObject("provinceList", provinceList);
+        mv.addObject("productList",productList);
+        mv.addObject("priorityNum",deliveryStrategyService.getTop() + 1);
+        return mv;
+    }
+    /**
+     * 添加快递策略
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/addDeliveryStrategy")
+    public ResponseJson addDeliveryStrategy(HttpServletRequest request, DeliveryStrategy deliveryStrategy) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(deliveryStrategy == null ){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        deliveryStrategy.setStrategyStatus(1);
+        if(deliveryStrategyService.save(deliveryStrategy) > 0){
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }else{
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+        }
+        return msg;
+    }
+    /**
+     * 进入修改快递策略计划
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/to_updateProductionPlan")
+    public ModelAndView to_updateProductionPlan(Integer strategyId) throws Exception {
+        ModelAndView mv = new ModelAndView("order/strategy/update_deliveryStrategy");
+        DeliveryStrategy deliveryStrategy = deliveryStrategyService.getDeliveryStrategyById(strategyId);
+        List<CompanyInfo> companyInfoList =  companyInfoService.listCompanyInfo(new CompanyInfo());
+        StoreInfo storeInfo = new StoreInfo();
+        storeInfo.setStoreStatus(1);
+        storeInfo.setCompanyId(deliveryStrategy.getStrategyCompanyId());
+        List<StoreInfo> storeInfoList = storeInfoService.listStore(storeInfo);
+        Province province = new Province();
+        List<Province> provinceList = addressService.listProvince(province);
+        Product product = new Product();
+        List<Product> productList = productService.listProductAndColorAndfittings(product);
+        ProductColor color = productService.getProduceColor(deliveryStrategy.getStrategyColorId());
+        ProductColor productColor = new ProductColor();
+        productColor.setColorProductId(color.getColorProductId());
+        List<ProductColor> productColorList = productService.listProduceColor(productColor);
+        List<LogisticsInfo> logisticsInfoList =  logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+        mv.addObject("logisticsInfoList",logisticsInfoList);
+        mv.addObject("productColorList",productColorList);
+        mv.addObject("productId",color.getColorProductId());
+        mv.addObject("productList",productList);
+        mv.addObject("storeInfoList", storeInfoList);
+        mv.addObject("companyInfoList",companyInfoList);
+        mv.addObject("provinceList", provinceList);
+        mv.addObject("priorityNum",deliveryStrategyService.getTop() + 1);
+        mv.addObject("deliveryStrategy",deliveryStrategy);
+        return mv;
+    }
+    /**
+     * 修改快递策略
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/updateDeliveryStrategy")
+    public ResponseJson updateDeliveryStrategy(HttpServletRequest request, DeliveryStrategy deliveryStrategy) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(deliveryStrategy == null ){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        if(deliveryStrategyService.update(deliveryStrategy) > 0){
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }else{
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+        }
+        return msg;
+    }
+    /**
+     * 删除快递策略
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/deleteDeliveryStrategy")
+    public ResponseJson deleteDeliveryStrategy( Integer strategyId) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(strategyId == null ){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        if(deliveryStrategyService.delete(strategyId) > 0){
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }else{
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+        }
+        return msg;
+    }
+}

+ 6 - 6
watero-rst-web/src/main/resources/dev-jdbc.properties

@@ -1,13 +1,13 @@
 jdbc.driver=com.mysql.jdbc.Driver
 ##### \uFFFD\uFFFD\u02BD\uFFFD\uFFFD\uFFFD\uFFFD ####
-jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/rst?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
-jdbc.username=watero_rst
-jdbc.password=watero_RST
+#jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/rst?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+#jdbc.username=watero_rst
+#jdbc.password=watero_RST
 ##### \uFFFD\uFFFD\u02BD\uFFFD\uFFFD\uFFFD\uFFFD end #####
 
-#jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/rst_test_2?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
-#jdbc.username=rst_test
-#jdbc.password=RST_test
+jdbc.url=jdbc:mysql://iamberry.mysql.rds.aliyuncs.com/rst_test_2?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+jdbc.username=rst_test
+jdbc.password=RST_test
 
 #pool settings
 jdbc.pool.init=1

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

@@ -237,6 +237,8 @@
 		<typeAlias type="com.iamberry.rst.core.pts.ProductionEmployees" alias="ProductionEmployees"/>
 		<typeAlias type="com.iamberry.rst.core.pts.ProductionProcess" alias="ProductionProcess"/>
 		<typeAlias type="com.iamberry.rst.core.pts.ProductionPlan" alias="ProductionPlan"/>
+		<!-- 快递策略-->
+		<typeAlias type="com.iamberry.rst.core.order.DeliveryStrategy" alias="DeliveryStrategy"/>
 	</typeAliases>
 	<!-- PageHelper -->
 	<plugins>
@@ -364,5 +366,7 @@
 		<mapper resource="com/iamberry/rst/service/dm/mapper/dmChannelTypeMapper.xml"/>
 		<!--生产计划 -->
 		<mapper resource="com/iamberry/rst/service/pts/mapper/productionPlanningMapper.xml"/>
+		<!--快递策略 -->
+		<mapper resource="com/iamberry/rst/service/order/mapper/deliveryStrategyMapper.xml"/>
 	</mappers>
 </configuration>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_list.ftl

@@ -334,7 +334,7 @@
         <#if identity != 2>
             <div style="float: left;margin-top: 20px;">
                 <button type="button" class="btn" style="border: 1px solid #50a2ea;background-color: #fff;color: #50a2ea;-webkit-transform:translateY(-5%);height: 35px;" id="" onclick="confirmOrder()">确认订单</button>
-                <button type="button" class="btn" style="border: 1px solid #50a2ea;background-color: #fff;color: #50a2ea;-webkit-transform:translateY(-5%);height: 35px;" id="" onclick="distribution_express(null)">分配物流</button>
+                <#--<button type="button" class="btn" style="border: 1px solid #50a2ea;background-color: #fff;color: #50a2ea;-webkit-transform:translateY(-5%);height: 35px;" id="" onclick="distribution_express(null)">分配物流</button>-->
                 <button type="button" class="btn" style="border: 1px solid #50a2ea;background-color: #fff;color: #50a2ea;-webkit-transform:translateY(-5%);height: 35px;" id="" onclick="chooseWarehouse(null)">通知配货</button>
                 <button type="button" onClick="upFiles2();"  class="btn" style="border: 1px solid #50a2ea;background-color: #fff;color: #50a2ea;-webkit-transform:translateY(-5%);height: 35px;">上传发货信息</button>
                 <button onClick="downloadOrderPage();" class="btn" style="border: 1px solid #50a2ea;background-color: #fff;color: #50a2ea;-webkit-transform:translateY(-5%);height: 35px;" type="button" title="下载订单">下载订单</button>

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

@@ -0,0 +1,258 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>添加快递策略 - H-ui.filter v2.4</title>
+    <style>
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;font-size: 16px;padding-left: 10px;color: #50a2ea;display: inline-block;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 50%;height: 6px;width: 6px;border-radius: 6px;margin-top: -3px; background-color: #32a3d8;}
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 14px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 77%;border:1px solid rgba(0,0,0,.1);margin-left: 12.5%;}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 158px; background-color: #50a2ea;color: #fff;border: 1px solid #50a2ea;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select {
+            border: 1px solid rgba(0,0,0,.1);
+            padding: 6px 50px 6px 15px;
+            height: 34px;
+            -webkit-appearance: none;
+            appearance: none;
+            background: url(/common/images/pts/select-11.png) right center no-repeat;
+            background-size: auto 100%;
+        }
+        .check-box, .radio-box{padding-left: 0;}
+        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;}
+        .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;}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="row cl">
+            <label class="form-label col-3">
+                <div class="tit-2">新增快递策略</div>
+            </label>
+            <div class="formControls col-9">
+            </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="companyId" class="my-select" name="strategyCompanyId" style="width: 195px">
+                    <option value="">选择销售公司</option>
+                            <#if companyInfoList?? &&  (companyInfoList?size > 0) >
+                                <#list companyInfoList as type>
+                                    <option value ="${type.companyId!}">${type.companyName!}</option>
+                                </#list>
+                            </#if>
+                </select>
+                <select id="storeId" class="my-select" name="strategyStoreId" style="width: 195px">
+                    <option value="">选择销售店铺</option>
+                            <#if storeList?? &&  (storeList?size > 0) >
+                                <#list storeList as type>
+                                    <option value ="${type.storeId!}">${type.storeName!}</option>
+                                </#list>
+                            </#if>
+                </select>
+            </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="strategyProvinceNumber" class="my-select" name="strategyProvinceNumber" style="width: 195px">
+                    <option value="">选择省份</option>
+                            <#if provinceList?? &&  (provinceList?size > 0) >
+                                <#list provinceList as province>
+                                    <option value ="${province.divisionCode!}">${province.province!}</option>
+                                </#list>
+                            </#if>
+                </select>
+            </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="productId" name="productId" class="my-select" style="width: 195px">
+                    <#if (productList?size > 0)>
+                            <#list productList as product>
+                                <option value="${product.productId!""}" >${product.productName!""}</option>
+                            </#list>
+                    </#if>
+                </select>
+
+                <select id="productColorId" name="strategyColorId" class="my-select" style="width: 195px">
+                    <#if (productColorList?size > 0)>
+                        <#list productColorList as productColor>
+                            <option value="${productColor.colorId!""}" >${productColor.colorName!""}</option>
+                        </#list>
+                    </#if>
+                </select>
+            </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="strategyPostFirm" name="strategyPostFirm" class="my-select" style="width: 195px">
+                    <#if (logisticsInfoList?size > 0)>
+                            <#list logisticsInfoList as logisticsInfo>
+                                <option value="${logisticsInfo.logisticsRstCode!""}" >${logisticsInfo.logisticsName!""}</option>
+                            </#list>
+                    </#if>
+                </select>
+            </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;">
+                <input class="my-input" type="text" value="${priorityNum!""}"  name="strategyPriority" id="strategyPriority" placeholder="请输入优先级" style="width: 78%;"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <button type="button" class="my-btn-submit" onclick="addDeliveryStrategy();" style="margin-top: 20px;">确认新建</button>
+            </div>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+    /**
+     * 打开员工列表
+     */
+    function add_employee() {
+        layer_show("员工列表","${path}/admin/employee/employee_list?pageSize=1000","800","500");
+    }
+
+
+    /**
+     *  删除员工
+     */
+    function delEmployee($this){
+        $this.parents("tr").remove();
+    }
+
+    /**
+     * 添加回访信息
+     */
+    function addDeliveryStrategy() {
+        var companyId = $("#companyId").val();
+        if(companyId == null || companyId == ""){
+            layer.msg("销售公司不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var storeId = $("#storeId").val();
+        if(storeId == null || storeId == ""){
+            layer.msg("店铺不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var strategyProvinceNumber = $("#strategyProvinceNumber").val();
+        if(strategyProvinceNumber == null || strategyProvinceNumber == ""){
+            layer.msg("省份不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var strategyPriority = $("#strategyPriority").val();
+        if(strategyPriority == null || strategyPriority == ""){
+            layer.msg("优先级不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: $('#form-admin-add').serialize(),
+                url: "${path}/admin/deliveryStrategy/addDeliveryStrategy",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg("添加成功!", {icon: 1, time: 1000},function () {
+                            window.location.href= '${path}/admin/deliveryStrategy/select_deliveryStrategy_list';
+                        });
+                        /*layer.msg("添加成功!", {icon: 1, time: 2000});*/
+                    } else {
+                        layer.msg("添加失败!", {icon: 5, time: 5000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg("添加失败!", {icon: 5, time: 2000});
+                }
+            });
+
+    }
+
+    $("#companyId").change(function (){
+        setStore($("#companyId").val());
+    });
+    /*获取销售店铺*/
+    function setStore(companyId){
+        $.ajax({
+            type: "POST",
+            data: {
+                companyId : companyId
+            },
+            url: "${path}/admin/customer/select_storeInfo",
+            success: function(data){
+                $("#storeId").empty();    //清空下拉框
+                $("#storeId").append("<option value=''>选择销售店铺</option>");
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.storeInfoList.length;i++){
+                        var storeInfo = data.returnMsg.storeInfoList[i];
+                        $("#storeId").append("<option  data-id='"+storeInfo.storeId+"' value='"+ storeInfo.storeId +"'>"+ storeInfo.storeName +"</option>");
+                    }
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+
+    //查询产品颜色信息
+    $('#productId').change(function(){
+        getProduct($(this).children('option:selected').val())
+    })
+    function  getProduct(productId) {
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/product/get_product",
+            data:{colorProductId:productId},// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    $("#productColorId").empty();
+                    if(data.returnMsg.productColorList.length > 0){
+                        for(var i=0;i<data.returnMsg.productColorList.length;i++){
+                            var productColor = data.returnMsg.productColorList[i];
+                            $("#productColorId").append('<option value='+productColor.colorId+'>'+productColor.colorName+'</option>');
+                        }
+                    }
+
+                }
+
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('添加错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>

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

@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta charset="UTF-8">
+		<title></title>
+        <#include "/base/list_base.ftl">
+		<style>
+			*{padding: 0;margin: 0;}
+			.my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
+			/*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
+            .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-11.png) right center no-repeat;background-size:auto 100%;}
+            .my-btn-search{border: 1px solid #50a2ea;padding: 1px 25px;height: 32px;background-color: #fff;color: #50a2ea;}
+            .barcodeImg{margin:10px 0px}
+            .table-bg thead th{background-color: #e2f6ff;}
+            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;}
+		</style>
+	</head>
+	<body>
+    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+        <span class="c-gray en">/</span> PST管理
+        <span class="c-gray en">/</span> 快递策略列表
+        <a class="btn radius r" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+    </nav>
+		<div class="text-c" style="margin-top: 20px;">
+			<form action="${path}/admin/deliveryStrategy/select_deliveryStrategy_list" method="post">
+                <button type="button" class="my-btn-search" onclick="add_employee('${path}/admin/deliveryStrategy/to_addProductionPlan');" style="cursor:pointer; margin-right: 50px;">添加快递策略</button>
+			</form>
+		</div>
+		<div class="mt-20" style="margin: 20px;">
+			<table class="table table-border table-bordered table-bg table-hover table-sort">
+				<thead>
+				<tr class="text-c">
+                    <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>
+				</tr>
+				</thead>
+				<tbody id="listid">
+                <#if page.dataList?? &&  (page.dataList?size > 0) >
+					<#list page.dataList as list>
+						<tr>
+                            <td class="text-c" width="140">${list.strategyCompanyName!''}</td>
+							<td class="text-c" width="100">${list.strategyStoreName!''}</td>
+							<td class="text-c" width="100">${list.strategyProvinceName!''}</td>
+							<td class="text-c" width="100">${list.strategyProductName!''}-(${list.strategyColorName!''})</td>
+							<td class="text-c" width="100">${list.strategyPriority!''}</td>
+							<td class="text-c" width="100">${list.strategyPostFirm!''}</td>
+							<!-- 遍历操作 -->
+							<td class="td-manage text-c">
+                                <a onclick="add_employee('${path}/admin/deliveryStrategy/to_updateProductionPlan?strategyId='+${list.strategyId!''});" title="修改" href="javascript:;"  class="ml-5" style="text-decoration:none">修改</a>
+                                <a onclick="del(${list.strategyId!''});" title="删除" href="javascript:;"  class="ml-5" style="text-decoration:none">删除</a>
+                                </td>
+						</tr>
+					</#list>
+                <#else>
+                <tr><td id="noMachineTr" colspan="7" class="td-manage text-c" >暂时没有快递策略,请添加!</td></tr>
+                </#if>
+				</tbody>
+			</table>
+			<div  style="display:none;" >
+				<div id="printlist">
+                </div>
+			</div>
+		</div>
+		<#include "/base/page_util.ftl">
+
+        <#--jquery.PrintArea 2.4-->
+        <script type="text/javascript" src="${path}/common/lib/jquery.PrintArea/jquery.PrintArea.js"></script>
+        <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery-barcode.js"></script>
+
+		<script type="text/javascript">
+            function add_employee(url) {
+                window.location.href= url;
+            }
+
+            /*删除计*/
+            function del(strategyId){
+                layer.confirm('是否确认删除,删除后无法恢复?',function(index) {
+                    if (strategyId != null) {
+                        $.ajax({
+                            type: "POST",
+                            url: "${path}/admin/deliveryStrategy/deleteDeliveryStrategy",
+                            async: false,
+                            data: {strategyId: strategyId},
+                            success: function (data) {
+                                if (data.returnCode == 200) {
+                                    layer.msg("删除成功!", {icon: 1, time: 2000});
+                                    location.reload();
+                                } else {
+                                    layer.msg("删除失败!", {icon: 5, time: 2000});
+                                }
+                            },
+                            error: function () {
+                                console.log("删除失败!");
+                            }
+                        });
+                    }
+                })
+            }
+            /*编辑计划*/
+            function update(planId){
+                    if (planId != null) {
+                        $.ajax({
+                            type: "POST",
+                            url: "${path}/admin/productionPlan/to_product_productionPlan",
+                            async: false,
+                            data: {planId: planId},
+                            success: function (data) {
+                                if (data.returnCode == 200) {
+                                    layer.msg("删除成功!", {icon: 1, time: 2000});
+                                    location.reload();
+                                } else {
+                                    layer.msg("删除失败!", {icon: 5, time: 2000});
+                                }
+                            },
+                            error: function () {
+                                console.log("删除失败!");
+                            }
+                        });
+                    }
+            }
+        </script>
+	</body>
+</html>

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

@@ -0,0 +1,216 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>修改快递策略 - H-ui.filter v2.4</title>
+    <style>
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;font-size: 16px;padding-left: 10px;color: #50a2ea;display: inline-block;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 50%;height: 6px;width: 6px;border-radius: 6px;margin-top: -3px; background-color: #32a3d8;}
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 14px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 77%;border:1px solid rgba(0,0,0,.1);margin-left: 12.5%;}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 158px; background-color: #50a2ea;color: #fff;border: 1px solid #50a2ea;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select {
+            border: 1px solid rgba(0,0,0,.1);
+            padding: 6px 50px 6px 15px;
+            height: 34px;
+            -webkit-appearance: none;
+            appearance: none;
+            background: url(/common/images/pts/select-11.png) right center no-repeat;
+            background-size: auto 100%;
+        }
+        .check-box, .radio-box{padding-left: 0;}
+        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;}
+        .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;}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="row cl">
+            <label class="form-label col-3">
+                <div class="tit-2">修改快递策略</div>
+            </label>
+            <div class="formControls col-9">
+            </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="companyId" class="my-select" name="strategyCompanyId" style="width: 195px">
+                    <option value="">选择销售公司</option>
+                            <#if companyInfoList?? &&  (companyInfoList?size > 0) >
+                                <#list companyInfoList as type>
+                                    <option value ="${type.companyId!}" <#if deliveryStrategy.strategyCompanyId == type.companyId>selected</#if>>${type.companyName!}</option>
+                                </#list>
+                            </#if>
+                </select>
+                <select id="storeId" class="my-select" name="strategyStoreId" style="width: 195px">
+                    <option value="">选择销售店铺</option>
+                            <#if storeInfoList?? &&  (storeInfoList?size > 0) >
+                                <#list storeInfoList as type>
+                                    <option value ="${type.storeId!}" <#if deliveryStrategy.strategyStoreId == type.storeId>selected</#if>>${type.storeName!}</option>
+                                </#list>
+                            </#if>
+                </select>
+            </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="strategyProvinceNumber" class="my-select" name="strategyProvinceNumber" style="width: 195px">
+                    <option value="">选择省份</option>
+                            <#if provinceList?? &&  (provinceList?size > 0) >
+                                <#list provinceList as province>
+                                    <option value ="${province.divisionCode!}" <#if deliveryStrategy.strategyProvinceNumber == province.divisionCode>selected</#if>>${province.province!}</option>
+                                </#list>
+                            </#if>
+                </select>
+            </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="productId" name="productId" class="my-select" style="width: 195px">
+                    <#if (productList?size > 0)>
+                            <#list productList as product>
+                                <option value="${product.productId!""}" <#if productId == product.productId>selected</#if> >${product.productName!""}</option>
+                            </#list>
+                    </#if>
+                </select>
+
+                <select id="productColorId" name="strategyColorId" class="my-select" style="width: 195px">
+                    <#if (productColorList?size > 0)>
+                        <#list productColorList as productColor>
+                            <option value="${productColor.colorId!""}" <#if deliveryStrategy.strategyColorId == productColor.colorId>selected</#if> >${productColor.colorName!""}</option>
+                        </#list>
+                    </#if>
+                </select>
+            </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="strategyPostFirm" name="strategyPostFirm" class="my-select" style="width: 195px">
+                    <#if (logisticsInfoList?size > 0)>
+                            <#list logisticsInfoList as logisticsInfo>
+                                <option value="${logisticsInfo.logisticsRstCode!""}" <#if deliveryStrategy.strategyPostFirm == logisticsInfo.logisticsRstCode>selected</#if> >${logisticsInfo.logisticsName!""}</option>
+                            </#list>
+                    </#if>
+                </select>
+            </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;">
+                <input class="my-input" type="text" value="${deliveryStrategy.strategyPriority!""}"  name="strategyPriority" id="strategyPriority" placeholder="请输入优先级" style="width: 78%;"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
+                <input type="hidden" name="strategyId" value="${deliveryStrategy.strategyId!""}">
+                <button type="button" class="my-btn-submit" onclick="addDeliveryStrategy();" style="margin-top: 20px;">确认修改</button>
+            </div>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+
+
+
+    /**
+     * 修改
+     */
+    function addDeliveryStrategy() {
+        var companyId = $("#companyId").val();
+        if(companyId == null || companyId == ""){
+            layer.msg("销售公司不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var storeId = $("#storeId").val();
+        if(storeId == null || storeId == ""){
+            layer.msg("店铺不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var strategyProvinceNumber = $("#strategyProvinceNumber").val();
+        if(strategyProvinceNumber == null || strategyProvinceNumber == ""){
+            layer.msg("省份不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var strategyPriority = $("#strategyPriority").val();
+        if(strategyPriority == null || strategyPriority == ""){
+            layer.msg("优先级不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: $('#form-admin-add').serialize(),
+                url: "${path}/admin/deliveryStrategy/updateDeliveryStrategy",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg("修改成功!", {icon: 1, time: 1000},function () {
+                            window.location.href= '${path}/admin/deliveryStrategy/select_deliveryStrategy_list';
+                        });
+                        /*layer.msg("添加成功!", {icon: 1, time: 2000});*/
+                    } else {
+                        layer.msg("修改失败!", {icon: 5, time: 5000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg("修改失败!", {icon: 5, time: 2000});
+                }
+            });
+    }
+
+    $("#companyId").change(function (){
+        setStore($("#companyId").val());
+    });
+    /*获取销售店铺*/
+    function setStore(companyId){
+        $.ajax({
+            type: "POST",
+            data: {
+                companyId : companyId
+            },
+            url: "${path}/admin/customer/select_storeInfo",
+            success: function(data){
+                $("#storeId").empty();    //清空下拉框
+                $("#storeId").append("<option value=''>选择销售店铺</option>");
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.storeInfoList.length;i++){
+                        var storeInfo = data.returnMsg.storeInfoList[i];
+                        $("#storeId").append("<option  data-id='"+storeInfo.storeId+"' value='"+ storeInfo.storeId +"'>"+ storeInfo.storeName +"</option>");
+                    }
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+</script>
+</body>
+</html>