فهرست منبع

上朵定制功能基本完成

wangxiaoming 6 سال پیش
والد
کامیت
73051948ad
27فایلهای تغییر یافته به همراه3898 افزوده شده و 25 حذف شده
  1. 255 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/scm/ScmOrderInfo.java
  2. 216 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/scm/ScmOrderItem.java
  3. 69 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/scm/ScmOrderInfoService.java
  4. 45 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/scm/ScmOrderItemService.java
  5. 6 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml
  6. 139 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/scm/ScmOrderInfoServiceImpl.java
  7. 68 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/scm/ScmOrderItemServiceImpl.java
  8. 67 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/scm/mapper/ScmOrderInfoMapper.java
  9. 56 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/scm/mapper/ScmOrderItemMapper.java
  10. 301 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/scm/mapper/scmOrderInfoMapper.xml
  11. 292 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/scm/mapper/scmOrderItemMapper.xml
  12. 30 2
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminSalesOrderController.java
  13. 600 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/scm/AdminScmOrderController.java
  14. 30 1
      watero-rst-web/src/main/java/com/iamberry/rst/utils/GenerateKeyUtil.java
  15. 80 0
      watero-rst-web/src/main/java/com/iamberry/rst/utils/QrCodeUtil.java
  16. 100 0
      watero-rst-web/src/main/java/com/iamberry/rst/utils/UploadFileUtils.java
  17. 6 6
      watero-rst-web/src/main/resources/dev-jdbc.properties
  18. 8 0
      watero-rst-web/src/main/resources/watero-rst-orm.xml
  19. 33 6
      watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/product_list.ftl
  20. 236 0
      watero-rst-web/src/main/webapp/WEB-INF/views/scm/scm_add_order.ftl
  21. 295 0
      watero-rst-web/src/main/webapp/WEB-INF/views/scm/scm_order_list.ftl
  22. 376 0
      watero-rst-web/src/main/webapp/WEB-INF/views/scm/scm_send_order.ftl
  23. 229 0
      watero-rst-web/src/main/webapp/WEB-INF/views/scm/scm_update_order.ftl
  24. 24 2
      watero-rst-web/src/main/webapp/common/js/common/UnlimitedLevelContact.js
  25. 11 2
      watero-rst-web/src/main/webapp/common/js/customer/customer.js
  26. 6 6
      watero-rst-web/src/main/webapp/common/js/product/product.js
  27. 320 0
      watero-rst-web/src/main/webapp/common/js/scmOrder/scmOrder.js

+ 255 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/scm/ScmOrderInfo.java

@@ -0,0 +1,255 @@
+package com.iamberry.rst.core.scm;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.ArrayList;
+import  java.util.Date;
+import  java.io.Serializable;
+import java.util.List;
+
+/**
+ *  上朵定制-订单表类
+ * @author xm
+ * @Date 2019-02-19
+ */
+public class ScmOrderInfo  implements  Serializable{
+    private static final long serialVersionUID = -5845245807550695089L;
+    //订单id
+    private Integer orderId;
+    //生产编号
+    private String orderMadeId;
+    //订单编号
+    private String orderNo;
+    //录入人id
+    private Integer orderAdminId;
+    //发货状态: 0(未发货)1(已发货)
+    private Integer orderShippingStatus;
+    //订单状态:  1,正常   2,作废
+    private Integer orderStatus;
+    //1:线下送货,2:物流发货
+    private Integer orderSendType;
+    //发货时间,发货后存在
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date orderSendTime;
+    //快递单号
+    private String orderPostNum;
+    //快递公司
+    private String orderPostFirm;
+    //详细地址
+    private String orderAddressInfo;
+    //收件人电话
+    private String orderAddressTel;
+    //收件人姓名
+    private String orderAddressName;
+    //邮费
+    private Integer orderShippingFee;
+    //后台的备注
+    private String orderAdminRemark;
+    //用户备注
+    private String orderUserRemark;
+    //店铺id
+    private Integer orderStoreId;
+    //销售公司id
+    private Integer orderCompanyId;
+    //二维码地址
+    private String orderMadeIdPath;
+    //创建时间'
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date orderCreateTime;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date startDate;                 //开始时间
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date endDate;                   //结束时间
+
+    private List<ScmOrderItem> scmOrderItemList = new ArrayList<>(); //订单项
+
+    public Integer getOrderId(){
+        return orderId;
+    }
+
+    public void setOrderId(Integer  orderId){
+        this.orderId=orderId;
+    }
+
+    public String getOrderMadeId() {
+        return orderMadeId;
+    }
+
+    public void setOrderMadeId(String orderMadeId) {
+        this.orderMadeId = orderMadeId;
+    }
+
+    public String getOrderNo(){
+        return orderNo;
+    }
+
+    public void setOrderNo(String  orderNo){
+        this.orderNo=orderNo;
+    }
+
+    public Integer getOrderAdminId(){
+        return orderAdminId;
+    }
+
+    public void setOrderAdminId(Integer  orderAdminId){
+        this.orderAdminId=orderAdminId;
+    }
+
+    public Integer getOrderShippingStatus(){
+        return orderShippingStatus;
+    }
+
+    public void setOrderShippingStatus(Integer  orderShippingStatus){
+        this.orderShippingStatus=orderShippingStatus;
+    }
+
+    public Integer getOrderSendType(){
+        return orderSendType;
+    }
+
+    public void setOrderSendType(Integer  orderSendType){
+        this.orderSendType=orderSendType;
+    }
+
+    public Date getOrderSendTime(){
+        return orderSendTime;
+    }
+
+    public void setOrderSendTime(Date  orderSendTime){
+        this.orderSendTime=orderSendTime;
+    }
+
+    public String getOrderPostNum(){
+        return orderPostNum;
+    }
+
+    public void setOrderPostNum(String  orderPostNum){
+        this.orderPostNum=orderPostNum;
+    }
+
+    public String getOrderPostFirm(){
+        return orderPostFirm;
+    }
+
+    public void setOrderPostFirm(String  orderPostFirm){
+        this.orderPostFirm=orderPostFirm;
+    }
+
+    public String getOrderAddressInfo(){
+        return orderAddressInfo;
+    }
+
+    public void setOrderAddressInfo(String  orderAddressInfo){
+        this.orderAddressInfo=orderAddressInfo;
+    }
+
+    public String getOrderAddressTel(){
+        return orderAddressTel;
+    }
+
+    public void setOrderAddressTel(String  orderAddressTel){
+        this.orderAddressTel=orderAddressTel;
+    }
+
+    public String getOrderAddressName(){
+        return orderAddressName;
+    }
+
+    public void setOrderAddressName(String  orderAddressName){
+        this.orderAddressName=orderAddressName;
+    }
+
+    public Integer getOrderShippingFee(){
+        return orderShippingFee;
+    }
+
+    public void setOrderShippingFee(Integer  orderShippingFee){
+        this.orderShippingFee=orderShippingFee;
+    }
+
+    public String getOrderAdminRemark(){
+        return orderAdminRemark;
+    }
+
+    public void setOrderAdminRemark(String  orderAdminRemark){
+        this.orderAdminRemark=orderAdminRemark;
+    }
+
+    public String getOrderUserRemark(){
+        return orderUserRemark;
+    }
+
+    public void setOrderUserRemark(String  orderUserRemark){
+        this.orderUserRemark=orderUserRemark;
+    }
+
+    public Integer getOrderStoreId(){
+        return orderStoreId;
+    }
+
+    public void setOrderStoreId(Integer  orderStoreId){
+        this.orderStoreId=orderStoreId;
+    }
+
+    public Integer getOrderCompanyId(){
+        return orderCompanyId;
+    }
+
+    public void setOrderCompanyId(Integer  orderCompanyId){
+        this.orderCompanyId=orderCompanyId;
+    }
+
+    public Date getOrderCreateTime(){
+        return orderCreateTime;
+    }
+
+    public void setOrderCreateTime(Date  orderCreateTime){
+        this.orderCreateTime=orderCreateTime;
+    }
+
+    public Date getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(Date startDate) {
+        this.startDate = startDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public String getOrderMadeIdPath() {
+        return orderMadeIdPath;
+    }
+
+    public void setOrderMadeIdPath(String orderMadeIdPath) {
+        this.orderMadeIdPath = orderMadeIdPath;
+    }
+
+    public List<ScmOrderItem> getScmOrderItemList() {
+        return scmOrderItemList;
+    }
+
+    public void setScmOrderItemList(List<ScmOrderItem> scmOrderItemList) {
+        this.scmOrderItemList = scmOrderItemList;
+    }
+
+    public Integer getOrderStatus() {
+        return orderStatus;
+    }
+
+    public void setOrderStatus(Integer orderStatus) {
+        this.orderStatus = orderStatus;
+    }
+}

+ 216 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/scm/ScmOrderItem.java

@@ -0,0 +1,216 @@
+package com.iamberry.rst.core.scm;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  上朵定制-订单项表类
+ * @author xm
+ * @Date 2019-02-19
+ */
+public class ScmOrderItem extends ScmOrderInfo  implements  Serializable{
+    private static final long serialVersionUID = 763781997297923216L;
+    //订单项id
+    private Integer orderItemId;
+    //所属订单id
+    private Integer orderId;
+    //产品id
+    private Integer orderItemProductId;
+    //产品数量
+    private Integer orderItemNum;
+    //产品颜色
+    private Integer orderItemColorId;
+    //产品类型id
+    private Integer orderItemProductType;
+    //商品名称
+    private String orderItemProductName;
+    //产品颜色
+    private String orderItemColorName;
+    //介绍图
+    private String orderItemProductPic;
+    //产品SKU码(百胜)
+    private String orderItemColorBar;
+    //产品市场价
+    private Integer orderItemProductPrice;
+    //产品折扣价
+    private Integer orderItemProductDiscount;
+    //产品设计地址
+    private String orderItemDesignPath;
+    //产品设计地址下载次数
+    private Integer orderItemDesignDuwnnumber;
+    //产品设计地址名称
+    private String orderItemDesignName;
+    //产品预览图
+    private String orderItemDesignPreview;
+
+    //创建时间'
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date orderItemCreateTime;
+
+    private String productAbbreviation;		//商品简称
+    private String colorAbbreviation;	//所属产品简称
+    private Integer colorIsWeight;    //重量
+
+    public Integer getOrderItemId(){
+        return orderItemId;
+    }
+
+    public void setOrderItemId(Integer  orderItemId){
+        this.orderItemId=orderItemId;
+    }
+
+    public Integer getOrderId(){
+        return orderId;
+    }
+
+    public void setOrderId(Integer  orderId){
+        this.orderId=orderId;
+    }
+
+    public Integer getOrderItemProductId(){
+        return orderItemProductId;
+    }
+
+    public void setOrderItemProductId(Integer  orderItemProductId){
+        this.orderItemProductId=orderItemProductId;
+    }
+
+    public Integer getOrderItemNum(){
+        return orderItemNum;
+    }
+
+    public void setOrderItemNum(Integer  orderItemNum){
+        this.orderItemNum=orderItemNum;
+    }
+
+    public Integer getOrderItemColorId(){
+        return orderItemColorId;
+    }
+
+    public void setOrderItemColorId(Integer  orderItemColorId){
+        this.orderItemColorId=orderItemColorId;
+    }
+
+    public Integer getOrderItemProductType(){
+        return orderItemProductType;
+    }
+
+    public void setOrderItemProductType(Integer  orderItemProductType){
+        this.orderItemProductType=orderItemProductType;
+    }
+
+    public String getOrderItemProductName(){
+        return orderItemProductName;
+    }
+
+    public void setOrderItemProductName(String  orderItemProductName){
+        this.orderItemProductName=orderItemProductName;
+    }
+
+    public String getOrderItemColorName(){
+        return orderItemColorName;
+    }
+
+    public void setOrderItemColorName(String  orderItemColorName){
+        this.orderItemColorName=orderItemColorName;
+    }
+
+    public String getOrderItemProductPic(){
+        return orderItemProductPic;
+    }
+
+    public void setOrderItemProductPic(String  orderItemProductPic){
+        this.orderItemProductPic=orderItemProductPic;
+    }
+
+    public String getOrderItemColorBar(){
+        return orderItemColorBar;
+    }
+
+    public void setOrderItemColorBar(String  orderItemColorBar){
+        this.orderItemColorBar=orderItemColorBar;
+    }
+
+    public Integer getOrderItemProductPrice(){
+        return orderItemProductPrice;
+    }
+
+    public void setOrderItemProductPrice(Integer  orderItemProductPrice){
+        this.orderItemProductPrice=orderItemProductPrice;
+    }
+
+    public Integer getOrderItemProductDiscount(){
+        return orderItemProductDiscount;
+    }
+
+    public void setOrderItemProductDiscount(Integer  orderItemProductDiscount){
+        this.orderItemProductDiscount=orderItemProductDiscount;
+    }
+
+    public String getOrderItemDesignPath(){
+        return orderItemDesignPath;
+    }
+
+    public void setOrderItemDesignPath(String  orderItemDesignPath){
+        this.orderItemDesignPath=orderItemDesignPath;
+    }
+
+    public Integer getOrderItemDesignDuwnnumber(){
+        return orderItemDesignDuwnnumber;
+    }
+
+    public void setOrderItemDesignDuwnnumber(Integer  orderItemDesignDuwnnumber){
+        this.orderItemDesignDuwnnumber=orderItemDesignDuwnnumber;
+    }
+
+    public String getOrderItemDesignPreview(){
+        return orderItemDesignPreview;
+    }
+
+    public void setOrderItemDesignPreview(String  orderItemDesignPreview){
+        this.orderItemDesignPreview=orderItemDesignPreview;
+    }
+
+    public Date getOrderItemCreateTime(){
+        return orderItemCreateTime;
+    }
+
+    public void setOrderItemCreateTime(Date  orderItemCreateTime){
+        this.orderItemCreateTime=orderItemCreateTime;
+    }
+
+    public String getOrderItemDesignName() {
+        return orderItemDesignName;
+    }
+
+    public void setOrderItemDesignName(String orderItemDesignName) {
+        this.orderItemDesignName = orderItemDesignName;
+    }
+
+    public String getProductAbbreviation() {
+        return productAbbreviation;
+    }
+
+    public void setProductAbbreviation(String productAbbreviation) {
+        this.productAbbreviation = productAbbreviation;
+    }
+
+    public String getColorAbbreviation() {
+        return colorAbbreviation;
+    }
+
+    public void setColorAbbreviation(String colorAbbreviation) {
+        this.colorAbbreviation = colorAbbreviation;
+    }
+
+    public Integer getColorIsWeight() {
+        return colorIsWeight;
+    }
+
+    public void setColorIsWeight(Integer colorIsWeight) {
+        this.colorIsWeight = colorIsWeight;
+    }
+}

+ 69 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/scm/ScmOrderInfoService.java

@@ -0,0 +1,69 @@
+package com.iamberry.rst.faces.scm;
+
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.scm.ScmOrderInfo;
+
+import java.util.List;
+
+/**
+ *  上朵定制-订单表接口
+ * @author xm
+ * @Date 2019-02-19
+ */
+public interface ScmOrderInfoService {
+    /**
+     * 获取集合
+     * @param  scmOrderInfo
+     * @return List
+     */
+    List<ScmOrderInfo> getScmOrderInfoList(ScmOrderInfo  scmOrderInfo);
+
+    /**
+     * 列表
+     * @param pageNO
+     * @param pageSize
+     * @param scmOrderInfo
+     * @param isTotalNum
+     * @return
+     */
+    PagedResult<ScmOrderInfo> listScmOrderInfoPage(int pageNO, int pageSize, ScmOrderInfo  scmOrderInfo, boolean isTotalNum);
+
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  scmOrderInfo
+     */
+    ScmOrderInfo  getScmOrderInfoById(Integer  id);
+
+    /**
+     * 查询单条数据
+     * @param  MadeId
+     * @return  scmOrderInfo
+     */
+    ScmOrderInfo  getScmOrderInfoByMadeId(String MadeId);
+
+    /**
+     * 增加数据
+     * @param  scmOrderInfo
+     * @return Integer
+     */
+    Integer  save(ScmOrderInfo  scmOrderInfo);
+    /**
+     * 修改数据
+     * @param  scmOrderInfo
+     * @return Integer
+     */
+    Integer  update(ScmOrderInfo  scmOrderInfo);
+    /**
+     * 发货修改
+     * @param  scmOrderInfo
+     * @return Integer
+     */
+    Integer  updateStatus(ScmOrderInfo  scmOrderInfo);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+}

+ 45 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/scm/ScmOrderItemService.java

@@ -0,0 +1,45 @@
+package com.iamberry.rst.faces.scm;
+
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.scm.ScmOrderItem;
+
+import java.util.List;
+
+/**
+ *  上朵定制-订单项表接口
+ * @author xm
+ * @Date 2019-02-19
+ */
+public interface ScmOrderItemService {
+    /**
+     * 获取集合
+     * @param  scmOrderItem
+     * @return List
+     */
+    List<ScmOrderItem> getScmOrderItemList(ScmOrderItem  scmOrderItem);
+    /**
+     * 获取集合
+     * @param  scmOrderItem
+     * @return List
+     */
+    PagedResult<ScmOrderItem> getScmOrderItemListPage(int pageNO, int pageSize, ScmOrderItem  scmOrderItem, boolean isTotalNum);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  scmOrderItem
+     */
+    ScmOrderItem  getScmOrderItemById(Integer  id);
+    /**
+     * 增加数据
+     * @param  scmOrderItem
+     * @return Integer
+     */
+    Integer  save(ScmOrderItem  scmOrderItem);
+    /**
+     * 修改数据
+     * @param  scmOrderItem
+     * @return Integer
+     */
+    Integer  update(ScmOrderItem  scmOrderItem);
+
+}

+ 6 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml

@@ -57,6 +57,9 @@
             <if test="colorName != null and colorName != ''">
                 AND c.color_name  like  CONCAT ('%',#{colorName},'%')
             </if >
+            <if test="productType != null and productType != ''">
+                AND p.product_type  = #{productType}
+            </if >
         </where>
     </select>
 
@@ -100,6 +103,9 @@
           <if test="typeStatus != null and typeStatus != ''">
               type_status = #{typeStatus}
           </if>
+          <if test="typeId != null and typeId != ''">
+              type_id = #{typeId}
+          </if>
       </where>
     </select>
 

+ 139 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/scm/ScmOrderInfoServiceImpl.java

@@ -0,0 +1,139 @@
+package com.iamberry.rst.service.scm;
+
+import com.github.pagehelper.PageHelper;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.scm.ScmOrderInfo;
+import com.iamberry.rst.core.scm.ScmOrderItem;
+import com.iamberry.rst.faces.scm.ScmOrderInfoService;
+import com.iamberry.rst.service.scm.mapper.ScmOrderInfoMapper;
+import com.iamberry.rst.service.scm.mapper.ScmOrderItemMapper;
+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;
+
+/**
+ *  上朵定制-订单表接口
+ * @author xm
+ * @Date 2019-02-19
+ */
+@Service
+public class ScmOrderInfoServiceImpl  implements ScmOrderInfoService {
+    @Autowired
+    private ScmOrderInfoMapper scmOrderInfoMapper;
+    @Autowired
+    private ScmOrderItemMapper scmOrderItemMapper;
+    /**
+     * 获取集合
+     * @param  scmOrderInfo
+     * @return List
+     */
+    @Override
+    public List<ScmOrderInfo> getScmOrderInfoList(ScmOrderInfo  scmOrderInfo){
+        return  scmOrderInfoMapper.getScmOrderInfoList(scmOrderInfo);
+    }
+
+    @Override
+    public PagedResult<ScmOrderInfo> listScmOrderInfoPage(int pageNO, int pageSize, ScmOrderInfo scmOrderInfo, boolean isTotalNum) {
+        PageHelper.startPage(pageNO, pageSize, isTotalNum);
+        List<ScmOrderInfo> list = scmOrderInfoMapper.getScmOrderInfoListPage(scmOrderInfo);
+        return PageUtil.getPage(list);
+    }
+
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  scmOrderInfo
+     */
+    @Override
+    public  ScmOrderInfo  getScmOrderInfoById(Integer  id){
+        return  scmOrderInfoMapper.getScmOrderInfoById(id);
+    }
+
+    /**
+     * 查询单条数据
+     * @param  MadeId
+     * @return  scmOrderInfo
+     */
+    @Override
+    public  ScmOrderInfo  getScmOrderInfoByMadeId(String MadeId){
+        return  scmOrderInfoMapper.getScmOrderInfoByMadeId(MadeId);
+    }
+
+    /**
+     * 增加数据
+     * @param  scmOrderInfo
+     * @return Integer
+     */
+    @Transactional
+    @Override
+    public  Integer  save(ScmOrderInfo  scmOrderInfo){
+        Integer flag = scmOrderInfoMapper.save(scmOrderInfo);
+        if(flag < 1){
+            throw new RuntimeException("添加订单失败");
+        }
+
+        for (ScmOrderItem scmOrderItem:scmOrderInfo.getScmOrderItemList()) {
+            scmOrderItem.setOrderId(scmOrderInfo.getOrderId());
+        }
+        flag = scmOrderItemMapper.saveList(scmOrderInfo.getScmOrderItemList());
+        if(flag < 1){
+            throw new RuntimeException("添加订单项失败");
+        }
+        return flag;
+    }
+    /**
+     * 修改数据
+     * @param  scmOrderInfo
+     * @return Integer
+     */
+    @Override
+    @Transactional
+    public  Integer  update(ScmOrderInfo  scmOrderInfo){
+        Integer flag = scmOrderInfoMapper.update(scmOrderInfo);
+        if(flag < 0){
+            throw new RuntimeException("修改订单失败");
+        }
+
+        flag = scmOrderItemMapper.deleteByOrderId(scmOrderInfo.getOrderId());
+        if(flag < 0){
+            throw new RuntimeException("删除订单项失败");
+        }
+
+        for (ScmOrderItem scmOrderItem:scmOrderInfo.getScmOrderItemList()) {
+            scmOrderItem.setOrderId(scmOrderInfo.getOrderId());
+        }
+        flag = scmOrderItemMapper.saveList(scmOrderInfo.getScmOrderItemList());
+        if(flag < 1){
+            throw new RuntimeException("添加订单项失败");
+        }
+        return  flag;
+    }
+
+    @Override
+    public Integer updateStatus(ScmOrderInfo scmOrderInfo) {
+        return scmOrderInfoMapper.updateStatus(scmOrderInfo);
+    }
+
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    @Override
+    @Transactional
+    public  Integer  delete(Integer  id){
+        Integer flag = scmOrderInfoMapper.delete(id);
+        if(flag < 0){
+            throw new RuntimeException("删除订单失败");
+        }
+
+        flag = scmOrderItemMapper.deleteByOrderId(id);
+        if(flag < 0){
+            throw new RuntimeException("删除订单项失败");
+        }
+        return  flag;
+    }
+}

+ 68 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/scm/ScmOrderItemServiceImpl.java

@@ -0,0 +1,68 @@
+package com.iamberry.rst.service.scm;
+
+import com.github.pagehelper.PageHelper;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.scm.ScmOrderItem;
+import com.iamberry.rst.faces.scm.ScmOrderItemService;
+import com.iamberry.rst.service.scm.mapper.ScmOrderItemMapper;
+import com.iamberry.rst.util.PageUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  上朵定制-订单项表接口
+ * @author xm
+ * @Date 2019-02-19
+ */
+@Service
+public class ScmOrderItemServiceImpl  implements ScmOrderItemService {
+    @Autowired
+    private ScmOrderItemMapper scmOrderItemMapper;
+    /**
+     * 获取集合
+     * @param  scmOrderItem
+     * @return List
+     */
+    @Override
+    public List<ScmOrderItem> getScmOrderItemList(ScmOrderItem  scmOrderItem){
+        return  scmOrderItemMapper.getScmOrderItemList(scmOrderItem);
+    }
+
+    @Override
+    public PagedResult<ScmOrderItem> getScmOrderItemListPage(int pageNO, int pageSize, ScmOrderItem scmOrderItem, boolean isTotalNum) {
+        PageHelper.startPage(pageNO, pageSize, isTotalNum);
+        List<ScmOrderItem> list = scmOrderItemMapper.getScmOrderItemListPage(scmOrderItem);
+        return PageUtil.getPage(list);
+    }
+
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  scmOrderItem
+     */
+    @Override
+    public  ScmOrderItem  getScmOrderItemById(Integer  id){
+        return  scmOrderItemMapper.getScmOrderItemById(id);
+    }
+    /**
+     * 增加数据
+     * @param  scmOrderItem
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(ScmOrderItem  scmOrderItem){
+        return  scmOrderItemMapper.save(scmOrderItem);
+    }
+    /**
+     * 修改数据
+     * @param  scmOrderItem
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(ScmOrderItem  scmOrderItem){
+        return  scmOrderItemMapper.update(scmOrderItem);
+    }
+
+}

+ 67 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/scm/mapper/ScmOrderInfoMapper.java

@@ -0,0 +1,67 @@
+package com.iamberry.rst.service.scm.mapper;
+
+import com.iamberry.rst.core.scm.ScmOrderInfo;
+
+import java.util.List;
+
+/**
+ *  上朵定制-订单表接口
+ * @author xm
+ * @Date 2019-02-19
+ */
+public interface ScmOrderInfoMapper {
+    /**
+     * 获取集合
+     * @param  scmOrderInfo
+     * @return List
+     */
+    List<ScmOrderInfo> getScmOrderInfoList(ScmOrderInfo  scmOrderInfo);
+
+    /**
+     * 获取集合
+     * @param  scmOrderInfo
+     * @return List
+     */
+    List<ScmOrderInfo> getScmOrderInfoListPage(ScmOrderInfo  scmOrderInfo);
+
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  scmOrderInfo
+     */
+    ScmOrderInfo  getScmOrderInfoById(Integer  id);
+
+    /**
+     * 查询单条数据
+     * @param  MadeId
+     * @return  scmOrderInfo
+     */
+    ScmOrderInfo  getScmOrderInfoByMadeId(String MadeId);
+
+    /**
+     * 增加数据
+     * @param  scmOrderInfo
+     * @return Integer
+     */
+    Integer  save(ScmOrderInfo  scmOrderInfo);
+    /**
+     * 修改数据
+     * @param  scmOrderInfo
+     * @return Integer
+     */
+    Integer  update(ScmOrderInfo  scmOrderInfo);
+
+    /**
+     * 发货修改
+     * @param  scmOrderInfo
+     * @return Integer
+     */
+    Integer  updateStatus(ScmOrderInfo  scmOrderInfo);
+
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+}

+ 56 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/scm/mapper/ScmOrderItemMapper.java

@@ -0,0 +1,56 @@
+package com.iamberry.rst.service.scm.mapper;
+
+import com.iamberry.rst.core.scm.ScmOrderItem;
+
+import java.util.List;
+
+/**
+ *  上朵定制-订单项表接口
+ * @author xm
+ * @Date 2019-02-19
+ */
+public interface ScmOrderItemMapper {
+    /**
+     * 获取集合
+     * @param  scmOrderItem
+     * @return List
+     */
+    List<ScmOrderItem> getScmOrderItemList(ScmOrderItem  scmOrderItem);
+    /**
+     * 获取集合
+     * @param  scmOrderItem
+     * @return List
+     */
+    List<ScmOrderItem> getScmOrderItemListPage(ScmOrderItem  scmOrderItem);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  scmOrderItem
+     */
+    ScmOrderItem  getScmOrderItemById(Integer  id);
+    /**
+     * 增加数据
+     * @param  scmOrderItem
+     * @return Integer
+     */
+    Integer  save(ScmOrderItem  scmOrderItem);
+    /**
+     * 修改数据
+     * @param  scmOrderItem
+     * @return Integer
+     */
+    Integer  update(ScmOrderItem  scmOrderItem);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  deleteByOrderId(Integer  id);
+
+    /**
+     * 增加数据 <集合>
+     * @param  scmOrderItemList
+     * @return Integer
+     */
+    Integer  saveList(List<ScmOrderItem>  scmOrderItemList);
+}

+ 301 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/scm/mapper/scmOrderInfoMapper.xml

@@ -0,0 +1,301 @@
+<?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.scm.mapper.ScmOrderInfoMapper">
+    <resultMap  id="BaseResultMap" type="ScmOrderInfo" >
+        <result    column="order_id"    property="orderId" />
+        <result    column="order_made_id"    property="orderMadeId" />
+        <result    column="order_no"    property="orderNo" />
+        <result    column="order_admin_id"    property="orderAdminId" />
+        <result    column="order_shipping_status"    property="orderShippingStatus" />
+        <result    column="order_send_type"    property="orderSendType" />
+        <result    column="order_send_time"    property="orderSendTime" />
+        <result    column="order_post_num"    property="orderPostNum" />
+        <result    column="order_post_firm"    property="orderPostFirm" />
+        <result    column="order_address_info"    property="orderAddressInfo" />
+        <result    column="order_address_tel"    property="orderAddressTel" />
+        <result    column="order_address_name"    property="orderAddressName" />
+        <result    column="order_shipping_fee"    property="orderShippingFee" />
+        <result    column="order_admin_remark"    property="orderAdminRemark" />
+        <result    column="order_user_remark"    property="orderUserRemark" />
+        <result    column="order_store_id"    property="orderStoreId" />
+        <result    column="order_company_id"    property="orderCompanyId" />
+        <result    column="order_made_id_path"    property="orderMadeIdPath" />
+        <result    column="order_create_time"    property="orderCreateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.order_id,
+        t.order_made_id,
+        t.order_no,
+        t.order_admin_id,
+        t.order_shipping_status,
+        t.order_send_type,
+        t.order_send_time,
+        t.order_post_num,
+        t.order_post_firm,
+        t.order_address_info,
+        t.order_address_tel,
+        t.order_address_name,
+        t.order_shipping_fee,
+        t.order_admin_remark,
+        t.order_user_remark,
+        t.order_store_id,
+        t.order_company_id,
+        t.order_made_id_path,
+        t.order_create_time
+    </sql>
+
+    <select id="getScmOrderInfoList" resultMap="ScmOrderInfoMap" parameterType="ScmOrderInfo" >
+        select
+          t.*
+        FROM tb_rst_scm_order_info t
+        <where>
+            <if test="orderId != null ">
+                AND t.order_id = #{orderId}
+            </if >
+            <if test="orderMadeId != null ">
+                AND t.order_made_id  like  CONCAT ('%',#{orderMadeId},'%')
+            </if >
+            <if test="orderNo != null and orderNo != ''">
+                AND t.order_no  like  CONCAT ('%',#{orderNo},'%')
+            </if >
+            <if test="orderAdminId != null ">
+                AND t.order_admin_id = #{orderAdminId}
+            </if >
+            <if test="orderShippingStatus != null ">
+                AND t.order_shipping_status = #{orderShippingStatus}
+            </if >
+            <if test="orderPostNum != null and orderPostNum != ''">
+                AND t.order_post_num  like  CONCAT ('%',#{orderPostNum},'%')
+            </if >
+            <if test="orderPostFirm != null and orderPostFirm != ''">
+                AND t.order_post_firm = #{orderPostFirm}
+            </if >
+            <if test="orderAddressInfo != null and orderAddressInfo != ''">
+                AND t.order_address_info  like  CONCAT ('%',#{orderAddressInfo},'%')
+            </if >
+            <if test="orderAddressTel != null and orderAddressTel != ''">
+                AND t.order_address_tel  like  CONCAT ('%',#{orderAddressTel},'%')
+            </if >
+            <if test="orderAddressName != null and orderAddressName != ''">
+                AND t.order_address_name  like  CONCAT ('%',#{orderAddressName},'%')
+            </if >
+            <if test="orderStoreId != null ">
+                AND t.order_store_id = #{orderStoreId}
+            </if >
+            <if test="orderCompanyId != null ">
+                AND t.order_company_id = #{orderCompanyId}
+            </if >
+        </where>
+    </select>
+
+
+    <resultMap  id="ScmOrderInfoMap" type="ScmOrderInfo" >
+        <result    column="order_id"    property="orderId" />
+        <result    column="order_made_id"    property="orderMadeId" />
+        <result    column="order_no"    property="orderNo" />
+        <result    column="order_admin_id"    property="orderAdminId" />
+        <result    column="order_shipping_status"    property="orderShippingStatus" />
+        <result    column="order_send_type"    property="orderSendType" />
+        <result    column="order_send_time"    property="orderSendTime" />
+        <result    column="order_post_num"    property="orderPostNum" />
+        <result    column="order_post_firm"    property="orderPostFirm" />
+        <result    column="order_address_info"    property="orderAddressInfo" />
+        <result    column="order_address_tel"    property="orderAddressTel" />
+        <result    column="order_address_name"    property="orderAddressName" />
+        <result    column="order_shipping_fee"    property="orderShippingFee" />
+        <result    column="order_admin_remark"    property="orderAdminRemark" />
+        <result    column="order_user_remark"    property="orderUserRemark" />
+        <result    column="order_store_id"    property="orderStoreId" />
+        <result    column="order_company_id"    property="orderCompanyId" />
+        <result    column="order_made_id_path"    property="orderMadeIdPath" />
+        <result    column="order_create_time"    property="orderCreateTime" />
+        <collection property="scmOrderItemList" column="order_id" ofType="ScmOrderItem" select="getScmOrderItemList"/>
+    </resultMap>
+    <select id="getScmOrderInfoListPage" resultMap="ScmOrderInfoMap" parameterType="ScmOrderInfo" >
+        select
+        t.*
+        FROM tb_rst_scm_order_info t
+        <where>
+            <if test="orderId != null ">
+                AND t.order_id = #{orderId}
+            </if >
+            <if test="orderMadeId != null ">
+                AND t.order_made_id  like  CONCAT ('%',#{orderMadeId},'%')
+            </if >
+            <if test="orderNo != null and orderNo != ''">
+                AND t.order_no  like  CONCAT ('%',#{orderNo},'%')
+            </if >
+            <if test="orderAdminId != null ">
+                AND t.order_admin_id = #{orderAdminId}
+            </if >
+            <if test="orderShippingStatus != null ">
+                AND t.order_shipping_status = #{orderShippingStatus}
+            </if >
+            <if test="orderPostNum != null and orderPostNum != ''">
+                AND t.order_post_num  like  CONCAT ('%',#{orderPostNum},'%')
+            </if >
+            <if test="orderPostFirm != null and orderPostFirm != ''">
+                AND t.order_post_firm = #{orderPostFirm}
+            </if >
+            <if test="orderAddressInfo != null and orderAddressInfo != ''">
+                AND t.order_address_info  like  CONCAT ('%',#{orderAddressInfo},'%')
+            </if >
+            <if test="orderAddressTel != null and orderAddressTel != ''">
+                AND t.order_address_tel  like  CONCAT ('%',#{orderAddressTel},'%')
+            </if >
+            <if test="orderAddressName != null and orderAddressName != ''">
+                AND t.order_address_name  like  CONCAT ('%',#{orderAddressName},'%')
+            </if >
+            <if test="orderStoreId != null ">
+                AND t.order_store_id = #{orderStoreId}
+            </if >
+            <if test="orderCompanyId != null ">
+                AND t.order_company_id = #{orderCompanyId}
+            </if >
+        </where>
+        ORDER BY t.order_id DESC
+    </select>
+
+    <!--子查询 订单项-->
+    <select id="getScmOrderItemList" resultType="ScmOrderItem" parameterType="Integer" >
+        select
+          *
+        from tb_rst_scm_order_item t
+        WHERE t.order_id = #{orderId}
+    </select>
+
+    <select id="getScmOrderInfoById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_scm_order_info t
+        where t.order_id= #{orderId}
+    </select>
+
+    <select id="getScmOrderInfoByMadeId" resultMap="BaseResultMap" parameterType="String" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_scm_order_info t
+        where t.order_made_id= #{orderMadeId}
+    </select>
+
+    <insert id="save" parameterType="ScmOrderInfo" keyProperty="orderId" useGeneratedKeys="true">
+        insert into
+        tb_rst_scm_order_info
+        (
+        order_id,
+        order_made_id,
+        order_no,
+        order_admin_id,
+        order_send_type,
+        order_send_time,
+        order_post_num,
+        order_post_firm,
+        order_address_info,
+        order_address_tel,
+        order_address_name,
+        order_shipping_fee,
+        order_admin_remark,
+        order_user_remark,
+        order_store_id,
+        order_company_id,
+        order_made_id_path
+        )
+        values
+        (
+        #{orderId},
+        #{orderMadeId},
+        #{orderNo},
+        #{orderAdminId},
+        #{orderSendType},
+        #{orderSendTime},
+        #{orderPostNum},
+        #{orderPostFirm},
+        #{orderAddressInfo},
+        #{orderAddressTel},
+        #{orderAddressName},
+        #{orderShippingFee},
+        #{orderAdminRemark},
+        #{orderUserRemark},
+        #{orderStoreId},
+        #{orderCompanyId},
+        #{orderMadeIdPath}
+        )
+    </insert>
+
+    <update id="update" parameterType="ScmOrderInfo" >
+        update
+        tb_rst_scm_order_info
+        <set >
+            <if test="orderMadeId != null ">
+                order_made_id = #{orderMadeId},
+            </if >
+            <if test="orderNo != null and orderNo != ''">
+                order_no = #{orderNo},
+            </if >
+            <if test="orderAdminId != null ">
+                order_admin_id = #{orderAdminId},
+            </if >
+            <if test="orderShippingStatus != null ">
+                order_shipping_status = #{orderShippingStatus},
+            </if >
+            <if test="orderSendType != null ">
+                order_send_type = #{orderSendType},
+            </if >
+            <if test="orderSendTime != null and orderSendTime != ''">
+                order_send_time = #{orderSendTime},
+            </if >
+            <if test="orderPostNum != null and orderPostNum != ''">
+                order_post_num = #{orderPostNum},
+            </if >
+            <if test="orderPostFirm != null and orderPostFirm != ''">
+                order_post_firm = #{orderPostFirm},
+            </if >
+            <if test="orderAddressInfo != null and orderAddressInfo != ''">
+                order_address_info = #{orderAddressInfo},
+            </if >
+            <if test="orderAddressTel != null and orderAddressTel != ''">
+                order_address_tel = #{orderAddressTel},
+            </if >
+            <if test="orderAddressName != null and orderAddressName != ''">
+                order_address_name = #{orderAddressName},
+            </if >
+            <if test="orderShippingFee != null ">
+                order_shipping_fee = #{orderShippingFee},
+            </if >
+            <if test="orderAdminRemark != null and orderAdminRemark != ''">
+                order_admin_remark = #{orderAdminRemark},
+            </if >
+            <if test="orderUserRemark != null and orderUserRemark != ''">
+                order_user_remark = #{orderUserRemark},
+            </if >
+            <if test="orderStoreId != null ">
+                order_store_id = #{orderStoreId},
+            </if >
+            <if test="orderCompanyId != null ">
+                order_company_id = #{orderCompanyId},
+            </if >
+            <if test="orderMadeIdPath != null and orderMadeIdPath != ''">
+                order_made_id_path = #{orderMadeIdPath},
+            </if >
+        </set >
+        where order_id= #{orderId}
+    </update>
+
+    <update id="updateStatus" parameterType="ScmOrderInfo" >
+        update
+            tb_rst_scm_order_info
+        SET
+            order_shipping_status = #{orderShippingStatus},
+            order_send_time = now(),
+            order_post_num = #{orderPostNum},
+            order_post_firm = #{orderPostFirm}
+        WHERE
+            order_id= #{orderId}
+    </update>
+
+    <delete id="delete" parameterType="Integer" >
+        delete FROM
+            tb_rst_scm_order_info
+        where order_id=#{orderId}
+    </delete>
+</mapper>

+ 292 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/scm/mapper/scmOrderItemMapper.xml

@@ -0,0 +1,292 @@
+<?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.scm.mapper.ScmOrderItemMapper">
+    <resultMap  id="BaseResultMap" type="ScmOrderItem" >
+        <result    column="order_item_id"    property="orderItemId" />
+        <result    column="order_id"    property="orderId" />
+        <result    column="order_item_product_id"    property="orderItemProductId" />
+        <result    column="order_item_num"    property="orderItemNum" />
+        <result    column="order_item_color_id"    property="orderItemColorId" />
+        <result    column="order_item_product_type"    property="orderItemProductType" />
+        <result    column="order_item_product_name"    property="orderItemProductName" />
+        <result    column="order_item_color_name"    property="orderItemColorName" />
+        <result    column="order_item_product_pic"    property="orderItemProductPic" />
+        <result    column="order_item_color_bar"    property="orderItemColorBar" />
+        <result    column="order_item_product_price"    property="orderItemProductPrice" />
+        <result    column="order_item_product_discount"    property="orderItemProductDiscount" />
+        <result    column="order_item_design_path"    property="orderItemDesignPath" />
+        <result    column="order_item_design_duwnnumber"    property="orderItemDesignDuwnnumber" />
+        <result    column="order_item_design_name"    property="orderItemDesignName" />
+        <result    column="order_item_design_preview"    property="orderItemDesignPreview" />
+        <result    column="order_item_create_time"    property="orderItemCreateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.order_item_id,
+        t.order_id,
+        t.order_item_product_id,
+        t.order_item_num,
+        t.order_item_color_id,
+        t.order_item_product_type,
+        t.order_item_product_name,
+        t.order_item_color_name,
+        t.order_item_product_pic,
+        t.order_item_color_bar,
+        t.order_item_product_price,
+        t.order_item_product_discount,
+        t.order_item_design_path,
+        t.order_item_design_duwnnumber,
+        t.order_item_design_name,
+        t.order_item_design_preview,
+        t.order_item_create_time
+    </sql>
+    <select id="getScmOrderItemList" resultMap="BaseResultMap" parameterType="ScmOrderItem" >
+        select
+            <include refid="Base_List" />,
+            pi.product_abbreviation,
+            pc.color_abbreviation,
+            pc.color_is_weight
+        from tb_rst_scm_order_item t
+        LEFT JOIN tb_rst_product_info pi ON t.order_item_product_id = pi.product_id
+        LEFT JOIN tb_rst_product_color pc ON t.order_item_color_id = pc.color_id
+        <where>
+            <if test="orderId != null ">
+                AND t.order_id = #{orderId}
+            </if >
+            <if test="orderItemProductId != null ">
+                AND t.order_item_product_id = #{orderItemProductId}
+            </if >
+            <if test="orderItemColorId != null ">
+                AND t.order_item_color_id = #{orderItemColorId}
+            </if >
+            <if test="orderItemProductType != null ">
+                AND t.order_item_product_type = #{orderItemProductType}
+            </if >
+            <if test="orderItemProductName != null and orderItemProductName != ''">
+                AND t.order_item_product_name  like  CONCAT ('%',#{orderItemProductName},'%')
+            </if >
+            <if test="orderItemColorName != null and orderItemColorName != ''">
+                AND t.order_item_color_name  like  CONCAT ('%',#{orderItemColorName},'%')
+            </if >
+            <if test="orderItemColorBar != null and orderItemColorBar != ''">
+                AND t.order_item_color_bar = #{orderItemColorBar}
+            </if >
+        </where>
+    </select>
+
+    <select id="getScmOrderItemListPage" resultType="ScmOrderItem" parameterType="ScmOrderItem" >
+        select
+          *
+        from tb_rst_scm_order_item t
+        LEFT  JOIN tb_rst_scm_order_info soi ON  t.order_id = soi.order_id
+        <where>
+            <if test="orderId != null ">
+                AND t.order_id = #{orderId}
+            </if >
+            <if test="orderItemProductId != null ">
+                AND t.order_item_product_id = #{orderItemProductId}
+            </if >
+            <if test="orderItemColorId != null ">
+                AND t.order_item_color_id = #{orderItemColorId}
+            </if >
+            <if test="orderItemProductType != null ">
+                AND t.order_item_product_type = #{orderItemProductType}
+            </if >
+            <if test="orderItemProductName != null and orderItemProductName != ''">
+                AND t.order_item_product_name  like  CONCAT ('%',#{orderItemProductName},'%')
+            </if >
+            <if test="orderItemColorName != null and orderItemColorName != ''">
+                AND t.order_item_color_name  like  CONCAT ('%',#{orderItemColorName},'%')
+            </if >
+            <if test="orderItemColorBar != null and orderItemColorBar != ''">
+                AND t.order_item_color_bar = #{orderItemColorBar}
+            </if >
+            <if test="orderId != null ">
+                AND soi.order_id = #{orderId}
+            </if >
+            <if test="orderMadeId != null ">
+                AND soi.order_made_id  like  CONCAT ('%',#{orderMadeId},'%')
+            </if >
+            <if test="orderNo != null and orderNo != ''">
+                AND soi.order_no  like  CONCAT ('%',#{orderNo},'%')
+            </if >
+            <if test="orderAdminId != null ">
+                AND soi.order_admin_id = #{orderAdminId}
+            </if >
+            <if test="orderShippingStatus != null ">
+                AND soi.order_shipping_status = #{orderShippingStatus}
+            </if >
+            <if test="orderPostNum != null and orderPostNum != ''">
+                AND soi.order_post_num  like  CONCAT ('%',#{orderPostNum},'%')
+            </if >
+            <if test="orderPostFirm != null and orderPostFirm != ''">
+                AND soi.order_post_firm = #{orderPostFirm}
+            </if >
+            <if test="orderAddressInfo != null and orderAddressInfo != ''">
+                AND soi.order_address_info  like  CONCAT ('%',#{orderAddressInfo},'%')
+            </if >
+            <if test="orderAddressTel != null and orderAddressTel != ''">
+                AND soi.order_address_tel  like  CONCAT ('%',#{orderAddressTel},'%')
+            </if >
+            <if test="orderAddressName != null and orderAddressName != ''">
+                AND soi.order_address_name  like  CONCAT ('%',#{orderAddressName},'%')
+            </if >
+            <if test="orderStoreId != null ">
+                AND soi.order_store_id = #{orderStoreId}
+            </if >
+            <if test="orderCompanyId != null ">
+                AND soi.order_company_id = #{orderCompanyId}
+            </if >
+        </where>
+        ORDER BY t.order_id DESC
+    </select>
+
+    <select id="getScmOrderItemById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_scm_order_item t
+        where t.order_id= #{orderId}
+    </select>
+
+    <insert id="save" parameterType="ScmOrderItem" >
+        insert into
+        tb_rst_scm_order_item
+        (
+        order_id,
+        order_item_product_id,
+        order_item_num,
+        order_item_color_id,
+        order_item_product_type,
+        order_item_product_name,
+        order_item_color_name,
+        order_item_product_pic,
+        order_item_color_bar,
+        order_item_product_price,
+        order_item_product_discount,
+        order_item_design_path,
+        order_item_design_duwnnumber,
+        order_item_design_name,
+        order_item_design_preview
+        )
+        values
+        (
+        #{orderId},
+        #{orderItemProductId},
+        #{orderItemNum},
+        #{orderItemColorId},
+        #{orderItemProductType},
+        #{orderItemProductName},
+        #{orderItemColorName},
+        #{orderItemProductPic},
+        #{orderItemColorBar},
+        #{orderItemProductPrice},
+        #{orderItemProductDiscount},
+        #{orderItemDesignPath},
+        #{orderItemDesignDuwnnumber},
+        #{orderItemDesignName},
+        #{orderItemDesignPreview}
+        )
+    </insert>
+    <update id="update" parameterType="ScmOrderItem" >
+        update
+        tb_rst_scm_order_item
+        <set >
+            <if test="orderId != null ">
+                order_id = #{orderId},
+            </if >
+            <if test="orderItemProductId != null ">
+                order_item_product_id = #{orderItemProductId},
+            </if >
+            <if test="orderItemNum != null ">
+                order_item_num = #{orderItemNum},
+            </if >
+            <if test="orderItemColorId != null ">
+                order_item_color_id = #{orderItemColorId},
+            </if >
+            <if test="orderItemProductType != null ">
+                order_item_product_type = #{orderItemProductType},
+            </if >
+            <if test="orderItemProductName != null and orderItemProductName != ''">
+                order_item_product_name = #{orderItemProductName},
+            </if >
+            <if test="orderItemColorName != null and orderItemColorName != ''">
+                order_item_color_name = #{orderItemColorName},
+            </if >
+            <if test="orderItemProductPic != null and orderItemProductPic != ''">
+                order_item_product_pic = #{orderItemProductPic},
+            </if >
+            <if test="orderItemColorBar != null and orderItemColorBar != ''">
+                order_item_color_bar = #{orderItemColorBar},
+            </if >
+            <if test="orderItemProductPrice != null ">
+                order_item_product_price = #{orderItemProductPrice},
+            </if >
+            <if test="orderItemProductDiscount != null ">
+                order_item_product_discount = #{orderItemProductDiscount},
+            </if >
+            <if test="orderItemDesignPath != null and orderItemDesignPath != ''">
+                order_item_design_path = #{orderItemDesignPath},
+            </if >
+            <if test="orderItemDesignDuwnnumber != null ">
+                order_item_design_duwnnumber = #{orderItemDesignDuwnnumber},
+            </if >
+            <if test="orderItemDesignName != null and orderItemDesignName != ''">
+                order_item_design_name = #{orderItemDesignName},
+            </if >
+            <if test="orderItemDesignPreview != null and orderItemDesignPreview != ''">
+                order_item_design_preview = #{orderItemDesignPreview},
+            </if >
+        </set >
+        where order_item_id= #{orderItemId}
+    </update>
+
+    <delete id="deleteByOrderId" parameterType="Integer" >
+        delete FROM
+        tb_rst_scm_order_item
+        where order_id=#{orderId}
+    </delete>
+
+    <insert id="saveList" parameterType="java.util.List" >
+        insert into
+        tb_rst_scm_order_item
+        (
+        order_item_id,
+        order_id,
+        order_item_product_id,
+        order_item_num,
+        order_item_color_id,
+        order_item_product_type,
+        order_item_product_name,
+        order_item_color_name,
+        order_item_product_pic,
+        order_item_color_bar,
+        order_item_product_price,
+        order_item_product_discount,
+        order_item_design_path,
+        order_item_design_duwnnumber,
+        order_item_design_name,
+        order_item_design_preview
+        )
+        values
+        <foreach collection="list" item="node" index="index" separator="," open="" close="">
+            (
+            #{node.orderItemId},
+            #{node.orderId},
+            #{node.orderItemProductId},
+            #{node.orderItemNum},
+            #{node.orderItemColorId},
+            #{node.orderItemProductType},
+            #{node.orderItemProductName},
+            #{node.orderItemColorName},
+            #{node.orderItemProductPic},
+            #{node.orderItemColorBar},
+            #{node.orderItemProductPrice},
+            #{node.orderItemProductDiscount},
+            #{node.orderItemDesignPath},
+            #{node.orderItemDesignDuwnnumber},
+            #{node.orderItemDesignName},
+            #{node.orderItemDesignPreview}
+            )
+        </foreach >
+    </insert>
+
+</mapper>

+ 30 - 2
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminSalesOrderController.java

@@ -7,6 +7,7 @@ import com.iamberry.rst.core.cm.StoreInfo;
 import com.iamberry.rst.core.order.OrderBatch;
 import com.iamberry.rst.core.order.OrderCorrectInfo;
 import com.iamberry.rst.core.order.ProductColor;
+import com.iamberry.rst.core.order.ProductType;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.sys.Admin;
 import com.iamberry.rst.core.tools.LogisticsInfo;
@@ -70,7 +71,6 @@ public class AdminSalesOrderController {
     private GenerateKeyUtil generateKeyUtil ;
     @Autowired
     private LogisticsInfoService logisticsInfoService;
-
     /**
      * 分页查询订单列表信息
      * @param request
@@ -630,13 +630,41 @@ public class AdminSalesOrderController {
         return mv;
     }
 
+    /**
+     *  弹出添加商品页面
+     * @param request
+     * @param productColor
+     * @param isRadio   是否单选  1:单选  0:多选
+     * @return
+     * @throws Exception
+     */
     @RequestMapping("/to_add_product")
     @RequiresPermissions("salesOrder:add:manual")
-    public ModelAndView toAddProduct(HttpServletRequest request) throws Exception {
+    public ModelAndView toAddProduct(HttpServletRequest request, ProductColor productColor,Integer isRadio) throws Exception {
         ModelAndView mv = new ModelAndView("order/salesOrder/product_list");
+
+        ProductType productType = new ProductType();
+        productType.setTypeId(productColor.getProductType());
+        List<ProductType> productTypeList = productService.listProductType(productType);
+
+        if(isRadio == null){
+            isRadio = 0;
+        }
+
+        mv.addObject("productTypeList",productTypeList);
+        mv.addObject("productColor",productColor);
+        mv.addObject("isRadio",isRadio);
         return mv;
     }
 
+    /**
+     * 添加订单
+     * @param request
+     * @param salesOrder
+     * @param orderItemString
+     * @return
+     * @throws Exception
+     */
     @ResponseBody
     @RequestMapping("/add_salesOrder")
     @RequiresPermissions("salesOrder:add:manual")

+ 600 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/scm/AdminScmOrderController.java

@@ -0,0 +1,600 @@
+package com.iamberry.rst.controllers.scm;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.MultiFormatWriter;
+import com.google.zxing.WriterException;
+import com.google.zxing.common.BitMatrix;
+import com.iamberry.rst.core.cm.StoreShip;
+import com.iamberry.rst.core.order.EOrderRequestData;
+import com.iamberry.rst.core.order.ProductColor;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.scm.ScmOrderInfo;
+import com.iamberry.rst.core.scm.ScmOrderItem;
+import com.iamberry.rst.core.sys.Admin;
+import com.iamberry.rst.core.tools.LogisticsInfo;
+import com.iamberry.rst.faces.cm.StoreShipService;
+import com.iamberry.rst.faces.order.LogisticsInfoService;
+import com.iamberry.rst.faces.product.ProductService;
+import com.iamberry.rst.faces.scm.ScmOrderInfoService;
+import com.iamberry.rst.faces.scm.ScmOrderItemService;
+import com.iamberry.rst.utils.*;
+import com.iamberry.wechat.tools.AddrUtil;
+import com.iamberry.wechat.tools.DateTimeUtil;
+import com.iamberry.wechat.tools.ResponseJson;
+import com.iamberry.wechat.tools.UUIDGenerator;
+import net.sf.json.JSONArray;
+import org.apache.shiro.authz.annotation.Logical;
+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.multipart.commons.CommonsMultipartFile;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletRequest;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * 上朵定制-订单列表
+ */
+@Controller
+@RequestMapping("/admin/scm_order")
+public class AdminScmOrderController {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(AdminScmOrderController.class);
+    @Autowired
+    private ScmOrderInfoService scmOrderInfoService;
+    @Autowired
+    private ScmOrderItemService scmOrderItemService;
+    @Autowired
+    private LogisticsInfoService logisticsInfoService;
+    @Autowired
+    private ProductService productService;
+    @Autowired
+    private GenerateKeyUtil generateKeyUtil;
+    @Autowired
+    private StoreShipService storeShipService;
+
+    private static final String pathHead = "D";
+
+    /**
+     * 订单列表
+     * @param request
+     * @return
+     */
+   @RequiresPermissions("scmOrder:order:list")
+    @RequestMapping("/order_list")
+    public ModelAndView orderList(HttpServletRequest request, ScmOrderItem scmOrderItem,
+                                         @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
+                                         @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
+                                         @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
+        ModelAndView mv = new ModelAndView("scm/scm_order_list");
+
+        PagedResult<ScmOrderItem> pagedResult = scmOrderItemService.getScmOrderItemListPage(pageNO, pageSize, scmOrderItem, totalNum == 0);
+        if (totalNum != 0){
+            pagedResult.setTotal(totalNum);
+        }
+
+        StitchAttrUtil.getSa()
+                .addDatePro("yyyy-MM-dd HH:mm:ss","startDate","endDate")
+                .setModelAndView(scmOrderItem, mv, "/admin/scm_order/order_list", pagedResult);
+
+       List<LogisticsInfo> logisticsInfoList = logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+       mv.addObject("logisticsInfoList",logisticsInfoList);
+
+       return mv;
+}
+
+
+    /**
+     * 添加订单
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("scmOrder:order:add")
+    @RequestMapping("/to_add_order")
+    public ModelAndView toAddOrder(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("scm/scm_add_order");
+
+        List<LogisticsInfo> logisticsInfoList = logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+        mv.addObject("logisticsInfoList",logisticsInfoList);
+
+        return mv;
+    }
+
+    /**
+     * 添加订单
+     * @param request
+     * @param scmOrderInfo
+     * @param orderItemString
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping("/add_order")
+    @RequiresPermissions("scmOrder:order:add")
+    public ResponseJson addSalesOrder(HttpServletRequest request,ScmOrderInfo scmOrderInfo,String orderItemString) throws Exception {
+        ResponseJson rj = new ResponseJson();
+        if(scmOrderInfo.getOrderAddressTel() != null && !"".equals(scmOrderInfo.getOrderAddressTel())){
+            scmOrderInfo.setOrderAddressTel(scmOrderInfo.getOrderAddressTel().trim());
+        }
+        Admin admin = AdminUtils.getLoginAdmin();
+        JSONArray jsonArray = JSONArray.fromObject(orderItemString);
+        List<ScmOrderItem> salesOrderItemList = (List) JSONArray.toCollection(jsonArray, ScmOrderItem.class);
+        for (ScmOrderItem scmOrderItem:salesOrderItemList) {
+            if(scmOrderItem.getOrderItemNum() > 0 && scmOrderItem.getOrderItemColorId() > 0){
+                ProductColor productColor = productService.getProduceColor(scmOrderItem.getOrderItemColorId());
+                if(productColor == null){
+                    return  new ResponseJson(500, "商品不存在", 500);
+                }
+                scmOrderItem.setOrderItemProductId(productColor.getColorProductId());  ////产品id
+                scmOrderItem.setOrderItemProductType(productColor.getProductType());
+                scmOrderItem.setOrderItemProductName(productColor.getProductName());
+                scmOrderItem.setOrderItemProductPic(productColor.getColorPicture());
+                scmOrderItem.setOrderItemColorName(productColor.getColorName());
+                scmOrderItem.setOrderItemColorBar(productColor.getColorBar()); ///产品SKU码(百胜)
+                scmOrderItem.setOrderItemProductPrice(productColor.getColorPrice());
+                scmOrderItem.setOrderItemProductDiscount(productColor.getColorDiscount());
+                scmOrderItem.setOrderItemCreateTime(new Date());
+            }else{
+                return  new ResponseJson(500, "添加商品错误", 500);
+            }
+        }
+
+        String orderMadeId = generateKeyUtil.getScmOrderMadeId();   //获取生产编号
+        String realPath = request.getSession().getServletContext().getRealPath("/common/scmOrder/qrCode/"+orderMadeId+"/");
+        realPath = realPath+"/";
+        String name = orderMadeId+".png";
+
+        QrCodeUtil.madeQrCode(realPath,name,orderMadeId,200);
+
+        String url = "common/scmOrder/qrCode/"+orderMadeId+"/"+orderMadeId+".png";
+
+        scmOrderInfo.setOrderMadeId(orderMadeId);
+        scmOrderInfo.setOrderShippingStatus(0);
+        scmOrderInfo.setOrderStatus(1);
+        scmOrderInfo.setOrderAdminId(admin.getAdminId());
+        scmOrderInfo.setOrderMadeIdPath(url);  //二维码地址
+
+        scmOrderInfo.setScmOrderItemList(salesOrderItemList);
+
+        Integer bl = 0;
+        String errorMsg = "";
+        try {
+            bl = scmOrderInfoService.save(scmOrderInfo);
+        }catch (Exception e){
+            errorMsg = e.getMessage();
+            e.printStackTrace();
+            return  new ResponseJson(500, "添加订单失败,失败原因:"+errorMsg, 500);
+        }
+        if(bl > 0){
+            rj = new ResponseJson(200, "添加订单成功", 200);
+            rj.addResponseKeyValue("path",realPath);
+            rj.addResponseKeyValue("orderMadeId",orderMadeId);
+            return rj;
+        }else{
+            return  new ResponseJson(500, "添加订单失败,失败原因:"+errorMsg, 500);
+        }
+    }
+
+    /**
+     * 修改订单页面
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("scmOrder:order:update")
+    @RequestMapping("/to_update_order")
+    public ModelAndView toUpdateOrder(HttpServletRequest request,Integer orderId) {
+        ModelAndView mv = new ModelAndView("scm/scm_update_order");
+
+        List<LogisticsInfo> logisticsInfoList = logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+        mv.addObject("logisticsInfoList",logisticsInfoList);
+        mv.addObject("orderId",orderId);
+        return mv;
+    }
+
+    /**
+     * 修改订单
+     * @param request
+     * @param scmOrderInfo
+     * @param orderItemString
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping("/update_order")
+    @RequiresPermissions("scmOrder:order:update")
+    public ResponseJson updateOrder(HttpServletRequest request,ScmOrderInfo scmOrderInfo,String orderItemString) throws Exception {
+        ResponseJson rj = new ResponseJson();
+        if(scmOrderInfo.getOrderAddressTel() != null && !"".equals(scmOrderInfo.getOrderAddressTel())){
+            scmOrderInfo.setOrderAddressTel(scmOrderInfo.getOrderAddressTel().trim());
+        }
+        Admin admin = AdminUtils.getLoginAdmin();
+        JSONArray jsonArray = JSONArray.fromObject(orderItemString);
+        List<ScmOrderItem> salesOrderItemList = (List) JSONArray.toCollection(jsonArray, ScmOrderItem.class);
+        for (ScmOrderItem scmOrderItem:salesOrderItemList) {
+            if(scmOrderItem.getOrderItemNum() > 0 && scmOrderItem.getOrderItemColorId() > 0){
+                ProductColor productColor = productService.getProduceColor(scmOrderItem.getOrderItemColorId());
+                if(productColor == null){
+                    return  new ResponseJson(500, "商品不存在或商品错误", 500);
+                }
+                scmOrderItem.setOrderItemProductId(productColor.getColorProductId());  ////产品id
+                scmOrderItem.setOrderItemProductType(productColor.getProductType());
+                scmOrderItem.setOrderItemProductName(productColor.getProductName());
+                scmOrderItem.setOrderItemProductPic(productColor.getColorPicture());
+                scmOrderItem.setOrderItemColorName(productColor.getColorName());
+                scmOrderItem.setOrderItemColorBar(productColor.getColorBar()); ///产品SKU码(百胜)
+                scmOrderItem.setOrderItemProductPrice(productColor.getColorPrice());
+                scmOrderItem.setOrderItemProductDiscount(productColor.getColorDiscount());
+                scmOrderItem.setOrderItemCreateTime(new Date());
+            }else{
+                return  new ResponseJson(500, "修改商品错误", 500);
+            }
+        }
+
+        scmOrderInfo.setScmOrderItemList(salesOrderItemList);
+
+        Integer bl = 0;
+        String errorMsg = "";
+        try {
+            bl = scmOrderInfoService.update(scmOrderInfo);
+        }catch (Exception e){
+            errorMsg = e.getMessage();
+            e.printStackTrace();
+            return  new ResponseJson(500, "修改订单失败,失败原因:"+errorMsg, 500);
+        }
+        if(bl > 0){
+            rj = new ResponseJson(200, "修改订单成功", 200);
+//            rj.addResponseKeyValue("path",realPath);
+//            rj.addResponseKeyValue("orderMadeId",orderMadeId);
+            return rj;
+        }else{
+            return  new ResponseJson(500, "修改订单失败,失败原因:"+errorMsg, 500);
+        }
+    }
+
+    /**
+     * 删除订单
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping("/delete_order")
+    @RequiresPermissions("scmOrder:order:delete")
+    public ResponseJson deleteOrder(HttpServletRequest request,Integer orderId) throws Exception {
+        ResponseJson rj = new ResponseJson();
+
+        ScmOrderInfo scmOrderInfo = scmOrderInfoService.getScmOrderInfoById(orderId);
+        if(scmOrderInfo == null ){
+            return  new ResponseJson(500, "删除失败", 500);
+        }
+        Integer flag = scmOrderInfoService.delete(orderId);
+
+        if(flag > 0){
+            rj = new ResponseJson(200, "删除订单成功", 200);
+            return rj;
+        }else{
+            return  new ResponseJson(500, "删除失败", 500);
+        }
+    }
+
+    /**
+     * 查询订单
+     * @param request
+     * @param scmOrderInfo
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping("/get_order")
+    @RequiresPermissions(value = {"scmOrder:order:add", "scmOrder:update:add", "scmOrder:order:list", "scmOrder:order:send"}, logical = Logical.OR)
+    public ResponseJson addSalesOrder(HttpServletRequest request,ScmOrderInfo scmOrderInfo) throws Exception {
+        if(scmOrderInfo.getOrderId() == null && (scmOrderInfo.getOrderMadeId() == null||"".equals(scmOrderInfo.getOrderMadeId())) &&
+                (scmOrderInfo.getOrderNo() == null || "".equals(scmOrderInfo.getOrderNo()))){
+            return new ResponseJson(500, "查询失败", 500);
+        }
+        ResponseJson rj = new ResponseJson(200, "查询成功", 200);
+        List<ScmOrderInfo> scmOrderInfoList = scmOrderInfoService.getScmOrderInfoList(scmOrderInfo);
+        rj.addResponseKeyValue("scmOrderInfoList",scmOrderInfoList);
+        return rj;
+    }
+
+    /**
+     * 查询订单 -- 生产编号
+     * @param request
+     * @param orderMadeId
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping("/get_order_madeId")
+    @RequiresPermissions(value = {"scmOrder:order:add", "scmOrder:update:add", "scmOrder:order:list", "scmOrder:order:send"}, logical = Logical.OR)
+    public ResponseJson getOrderNo(HttpServletRequest request,String orderMadeId) throws Exception {
+        ScmOrderInfo scmOrderInfo = scmOrderInfoService.getScmOrderInfoByMadeId(orderMadeId);
+        if(scmOrderInfo == null){
+            ResponseJson rj = new ResponseJson(500, "查询失败", 500);
+            return rj;
+        }
+
+        ScmOrderItem  scmOrderItem = new ScmOrderItem();
+        scmOrderItem.setOrderId(scmOrderInfo.getOrderId());
+        List<ScmOrderItem>  scmOrderItemList = scmOrderItemService.getScmOrderItemList(scmOrderItem);
+        scmOrderInfo.setScmOrderItemList(scmOrderItemList);
+
+        ResponseJson rj = new ResponseJson(200, "查询成功", 200);
+        rj.addResponseKeyValue("scmOrderInfo",scmOrderInfo);
+        return rj;
+    }
+
+    /**
+     * 上传设计文件
+     * @RequestParam("file") 将name=file控件得到的文件封装成CommonsMultipartFile 对象
+     */
+    @ResponseBody
+    @RequestMapping("/fileUpload")
+    public ResponseJson fileUpload(HttpServletRequest request, @RequestParam("file") CommonsMultipartFile file) throws IOException {
+        ResponseJson responseJson = new ResponseJson();
+        System.out.println("fileName:"+file.getOriginalFilename());
+
+        String realPath = request.getSession().getServletContext().getRealPath("/");
+
+        if(file.getOriginalFilename() == null || "".equals(file.getOriginalFilename())){
+            responseJson.setReturnCode(500);
+            return responseJson;
+        }
+
+        String oldName = file.getOriginalFilename();
+
+        //名称
+        String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().toString().lastIndexOf("."));
+        String name = System.currentTimeMillis()+suffix;
+
+        String path = UploadFileUtils.scmUploadFile(realPath,name,file);
+
+        String url = request.getScheme()+"://"+ request.getServerName();
+
+        responseJson.setReturnCode(200);
+        responseJson.addResponseKeyValue("allImgUrl",url + "/" + path);
+        responseJson.addResponseKeyValue("imgUrl",path);
+        responseJson.addResponseKeyValue("oldName",oldName);
+        responseJson.addResponseKeyValue("name",name);
+        return responseJson;
+    }
+
+    /**
+     * 订单发货页面
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("scmOrder:order:send")
+    @RequestMapping("/order_ship")
+    public ModelAndView orderShip(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("scm/scm_send_order");
+        return mv;
+    }
+
+    /**
+     * 订单发货
+     * @param request
+     * @param scmOrderInfo
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping("/send_order")
+    @RequiresPermissions(value = {"scmOrder:order:send"}, logical = Logical.OR)
+    public ResponseJson sendOrder(HttpServletRequest request,ScmOrderInfo scmOrderInfo) throws Exception {
+        if(scmOrderInfo.getOrderId() == null && (scmOrderInfo.getOrderMadeId() == null||"".equals(scmOrderInfo.getOrderMadeId())) &&
+                (scmOrderInfo.getOrderNo() == null || "".equals(scmOrderInfo.getOrderNo()))){
+            return new ResponseJson(500, "查询失败", 500);
+        }
+        ResponseJson rj = new ResponseJson(200, "查询成功", 200);
+        List<ScmOrderInfo> scmOrderInfoList = scmOrderInfoService.getScmOrderInfoList(scmOrderInfo);
+        rj.addResponseKeyValue("scmOrderInfoList",scmOrderInfoList);
+        return rj;
+    }
+
+
+    /**
+     * 打单发货
+     * @param orderMadeId
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/scm_print_order")
+    @RequiresPermissions("scmOrder:order:send")
+    public ResponseJson printOrder(@RequestParam("orderMadeId") String orderMadeId,
+                                   HttpServletRequest request) {
+        ScmOrderInfo scmOrderInfo = scmOrderInfoService.getScmOrderInfoByMadeId(orderMadeId);
+        if(scmOrderInfo == null){
+            LOGGER.error("{} 获取电子面单失败,原因:{}", orderMadeId, "未查询到该订单");
+            return ResponseJson.getFAILURE().addResponseKeyValue("error","未查询到该订单");
+        }
+
+        if(scmOrderInfo.getOrderShippingStatus() != 0){
+            LOGGER.error("{} 获取电子面单失败,原因:{}", orderMadeId, "该订单已发货");
+            return ResponseJson.getFAILURE().addResponseKeyValue("error","该订单已发货");
+        }
+
+        ScmOrderItem  scmOrderItem = new ScmOrderItem();
+        scmOrderItem.setOrderId(scmOrderInfo.getOrderId());
+        List<ScmOrderItem>  scmOrderItemList = scmOrderItemService.getScmOrderItemList(scmOrderItem);
+        scmOrderInfo.setScmOrderItemList(scmOrderItemList);
+
+        StoreShip storeShip = null;
+        if(scmOrderInfo.getOrderStoreId() != null){
+            storeShip = storeShipService.getStoreShipByStoreId(scmOrderInfo.getOrderStoreId());
+        }
+        if(storeShip == null){
+            LOGGER.error("{} 获取电子面单失败,原因:{}", orderMadeId, "该订单没有绑定店铺或店铺没有发货人信息");
+            return ResponseJson.getFAILURE().addResponseKeyValue("error","该订单没有绑定店铺或店铺没有发货人信息");
+        }
+
+        String  post = scmOrderInfo.getOrderPostFirm();
+        Integer orderId = scmOrderInfo.getOrderId();
+
+        /*
+         * 组装数据
+         */
+        EOrderRequestData eOrderRequestData = new EOrderRequestData();
+        eOrderRequestData.ShipperCode = (post);
+        eOrderRequestData.OrderCode = (UUID.randomUUID().toString().replace("-", ""));
+        eOrderRequestData.PayType = (3);
+        eOrderRequestData.ExpType = ("1");
+        eOrderRequestData.Cost = (0.00);
+        eOrderRequestData.OtherCost = (0.0);
+        eOrderRequestData.Remark = scmOrderInfo.getOrderMadeId() + "-" + scmOrderInfo.getOrderNo();
+        // 不同的快递公司需要做不同的处理
+        if (post.equalsIgnoreCase("EMS")) {
+            // 省内EMS
+            eOrderRequestData.CustomerName = ("90000009971400");
+            eOrderRequestData.CustomerPwd = ("90000009971400");
+        } else if (post.equalsIgnoreCase("SF")) {
+            // 顺丰
+            eOrderRequestData.MonthCode = ("7690035114");
+        } else if (post.equalsIgnoreCase("YZBK")) {
+            // 省外EMS
+            eOrderRequestData.CustomerName = ("90000009971400");
+            eOrderRequestData.CustomerPwd = ("90000009971400");
+            eOrderRequestData.ExpType = "9";
+            eOrderRequestData.ShipperCode = "EMS";
+        } else if (post.equalsIgnoreCase("STO")) {
+            // 申通快递
+            eOrderRequestData.CustomerName = ("爱贝源");
+            eOrderRequestData.CustomerPwd = ("Iamberry321.");
+            eOrderRequestData.SendSite = ("广东东莞公司");
+        } else if (post.equalsIgnoreCase("DBL")) {
+            //德邦 (360特惠件)
+            eOrderRequestData.CustomerName = ("651476854");
+            eOrderRequestData.ExpType = ("2");
+        }
+        LOGGER.info( "===orderNO:" + scmOrderInfo.getOrderNo() + "快递方式:" + post+ "订单编号:"+ scmOrderInfo.getOrderId());
+        // 收件人信息
+        String[] addrs = scmOrderInfo.getOrderAddressInfo().split(" ");
+        if (addrs.length <= 3) {
+            addrs = scmOrderInfo.getOrderAddressInfo().split("-");
+        }
+        // 获取收件人邮编
+        String postCode = AddrUtil.getPostCode(addrs[2]);
+        if (postCode == null || "".equals(postCode)) {
+            postCode = AddrUtil.getPostCode(addrs[1]);
+        }
+        if (postCode == null || "".equals(postCode)) {
+            postCode = AddrUtil.getPostCode(addrs[0]);
+        }
+
+        Map<String, Object> receiver = new HashMap<String, Object>();
+        receiver.put("Name", scmOrderInfo.getOrderAddressName());
+        receiver.put("Tel", scmOrderInfo.getOrderAddressTel());
+        receiver.put("ProvinceName", AddrUtil.dealProvince(addrs[0]));
+        receiver.put("CityName", addrs[1]);
+        receiver.put("ExpAreaName", addrs[2]);
+        receiver.put("Address", scmOrderInfo.getOrderAddressInfo());
+        receiver.put("PostCode", postCode);
+        eOrderRequestData.Receiver = (receiver);
+        // 发件人信息
+        Map<String, Object> sender = new HashMap<String, Object>();
+        sender.put("Name", storeShip.getStoreShipName());
+        sender.put("Tel", storeShip.getStoreShipTel());
+        sender.put("ProvinceName", storeShip.getStoreShipProvince());
+        sender.put("CityName", storeShip.getStoreShipCity());
+        sender.put("ExpAreaName", "清溪镇");
+        sender.put("Address", storeShip.getStoreShipAddress());
+        sender.put("PostCode", "523660");
+        eOrderRequestData.Sender = (sender);
+        // 产品信息
+        List<Map<String, Object>> commodity = new ArrayList<>();
+
+
+        // 整个产品的重量
+        Double colorIsWeight = 0.00;
+        StringBuilder goodName = new StringBuilder();
+
+        int Goodsquantity = 0;
+        for (ScmOrderItem temp : scmOrderItemList) {
+            goodName.append(temp.getProductAbbreviation())
+                    .append("(").append(temp.getColorAbbreviation()).append(")*").append(temp.getOrderItemNum()).append(";");
+            if(temp.getColorIsWeight() != null){
+                colorIsWeight += temp.getColorIsWeight();
+            }
+            Goodsquantity += temp.getOrderItemNum();
+        }
+        // 20181113增加需求:产品名称后面增加打印订单日期
+        goodName.append("【D").append(DateTimeUtil.format(new Date(), "MMdd")).append("】");
+        String uuid = UUIDGenerator.getUUID().substring(0, 8);
+        // 增加产品信息
+        Map<String, Object> product1 = new HashMap<String, Object>();
+        product1.put("GoodsName", uuid);
+        product1.put("Goodsquantity", Goodsquantity);
+        // 计算产品重量deliver_statistics
+        product1.put("GoodsWeight", colorIsWeight/1000);
+        commodity.add(product1);
+        eOrderRequestData.Commodity = (commodity);
+        eOrderRequestData.Weight = (colorIsWeight/1000);
+        eOrderRequestData.Quantity = (1);
+        eOrderRequestData.IsReturnPrintTemplate = (1);
+        try {
+            String json = OrderUtils.orderOnlineByJson(eOrderRequestData);
+            JSONObject jsonObject = JSONObject.parseObject(json);
+            boolean flag = jsonObject.getBoolean("Success");
+            if (flag) {
+                // 替换产品名称
+                json = json.replace(uuid, goodName.toString());
+                // 获取电子面单成功
+                String code = jsonObject.getJSONObject("Order").getString("LogisticCode");
+
+                // 订单发货
+                ScmOrderInfo soi = new ScmOrderInfo();
+                soi.setOrderPostFirm(eOrderRequestData.ShipperCode);
+                soi.setOrderPostNum(code);
+                soi.setOrderShippingStatus(1);
+                soi.setOrderSendTime(new Date());
+                soi.setOrderId(orderId);
+                Integer fl = scmOrderInfoService.updateStatus(soi);
+
+                // 保存HTML
+                String filePath = request.getServletContext().getRealPath("/common/scmOrder/");
+                File dir = new File(filePath + File.separator + "send_order");
+                if (!dir.exists()) {
+                    dir.mkdir();
+                }
+                File file = new File(dir.getAbsolutePath() + File.separator + orderMadeId + ".txt");
+                if (!file.createNewFile()) {
+                    return ResponseJson.getFAILURE().addResponseKeyValue("error", "创建文件失败");
+                }
+                FileWriter fileWriter = null;
+                try {
+                    fileWriter = new FileWriter(file, false);
+                    fileWriter.write(json);
+                } catch (Exception e) {
+                    LOGGER.error("", e);
+                } finally {
+                    if (fileWriter != null) {
+                        fileWriter.close();
+                    }
+                }
+            } else {
+                // 获取电子面单失败
+                LOGGER.error("{} 获取电子面单失败,原因:{}", orderId, jsonObject.get("Reason"));
+            }
+            return ResponseJson.getSUCCESS().addResponseKeyValue("json", json);
+        } catch (Exception e) {
+            LOGGER.error("", e);
+            return ResponseJson.getFAILURE().addResponseKeyValue("error", e.getMessage());
+        }
+    }
+
+}

+ 30 - 1
watero-rst-web/src/main/java/com/iamberry/rst/utils/GenerateKeyUtil.java

@@ -37,9 +37,12 @@ public class GenerateKeyUtil {
 
     private final static Integer orderNo = 3;
     private final static Integer bacthNo = 4;
+    private final static Integer scmOrderMadeNo= 5; //
 
     private static SimpleDateFormat SDF_ORDERID = new SimpleDateFormat("yyMMdd");
 
+    private static SimpleDateFormat SDF_YEAR = new SimpleDateFormat("yy");
+
     private static SimpleDateFormat SDF_BATCH = new SimpleDateFormat("yyMMdd");
 
     /*订单交易号前两位,D标识一定为手动增加  */
@@ -138,7 +141,7 @@ public class GenerateKeyUtil {
      * 获取最新的批次
      * @return
      */
-    public synchronized Integer  getBatch(){
+    private synchronized Integer  getBatch(){
         SysConfig sysConfig = sysConfigService.getSysConfigAll(bacthNo);
         Integer number = Integer.valueOf(sysConfig.getConfigParameter())+1;
         SysConfig sc = new SysConfig();
@@ -158,6 +161,32 @@ public class GenerateKeyUtil {
 
 
     /**
+     * ------------------
+     * scm -----  上朵定制牙刷 生产编号
+     * YYxxxxx
+     */
+    public String getScmOrderMadeId(){
+        Integer number = getScmOrderMadeNo();
+        return  SDF_YEAR.format(new Date()) + String.format("%05d", number);
+    }
+
+    /**
+     * scm -----  上朵定制牙刷
+     * 获取最新的生产编号
+     * @return
+     */
+    private synchronized Integer  getScmOrderMadeNo(){
+        SysConfig sysConfig = sysConfigService.getSysConfigAll(scmOrderMadeNo);
+        Integer number = Integer.valueOf(sysConfig.getConfigParameter())+1;
+        SysConfig sc = new SysConfig();
+        sc.setConfigId(sysConfig.getConfigId());
+        sc.setConfigParameter(String.valueOf(number));
+        sysConfigService.updateSysConfig(sc);
+        return number;
+    }
+
+
+    /**
      * 产生4位随机数
      * @return
      */

+ 80 - 0
watero-rst-web/src/main/java/com/iamberry/rst/utils/QrCodeUtil.java

@@ -0,0 +1,80 @@
+package com.iamberry.rst.utils;
+
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.MultiFormatWriter;
+import com.google.zxing.WriterException;
+import com.google.zxing.common.BitMatrix;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.util.Hashtable;
+
+public class QrCodeUtil {
+
+    /**
+     * <pre>
+     * 生成二维码图片对象
+     * </pre>
+     * @author naveu
+     * @date 2018年8月6日 下午12:44:27
+     * @param qrUrl 二维码链接
+     * @param qrLen 二维码边长,正方形
+     * @return
+     * @throws WriterException
+     */
+    private static final int BLACK = 0xFF000000;
+    private static final int WHITE = 0xFFFFFFFF;
+
+    public static BufferedImage getQRImg(String qrUrl, int qrLen) throws WriterException {
+        Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
+        hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
+        hints.put(EncodeHintType.MARGIN, 1);
+        BitMatrix matrix = new MultiFormatWriter().encode(qrUrl, BarcodeFormat.QR_CODE, qrLen, qrLen, hints);
+        BufferedImage image = new BufferedImage(qrLen, qrLen, BufferedImage.TYPE_INT_RGB);
+        for (int x = 0; x < qrLen; x++) {
+            for (int y = 0; y < qrLen; y++) {
+                image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE);
+            }
+        }
+        return image;
+    }
+
+    /**
+     * 创建二维码文件
+     * @param path
+     * @param url
+     * @param size
+     * @return
+     */
+    public static Boolean madeQrCode(String path,String name,String url,Integer size){
+        try {
+            BufferedImage image = getQRImg(url,size);
+            File outputfile = new File(path);
+            if (!outputfile.exists()) {
+                outputfile.mkdirs();
+            }
+            File file = new File(path+name);
+            if(file.createNewFile()){
+                ImageIO.write(image, "png", file);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return true;
+    }
+
+
+
+    public static void main(String[] args) {
+        try {
+            BufferedImage image = getQRImg("0900001",200);
+            File outputfile = new File("C:\\Users\\Administrator\\Desktop\\ad_02.jpg");
+            ImageIO.write(image, "png", outputfile);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 100 - 0
watero-rst-web/src/main/java/com/iamberry/rst/utils/UploadFileUtils.java

@@ -0,0 +1,100 @@
+package com.iamberry.rst.utils;
+
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.io.*;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 文件上传
+ */
+public class UploadFileUtils {
+    private static UploadFileUtils uploadFileUtils = new UploadFileUtils();
+    public static UploadFileUtils getUf(){
+        return  uploadFileUtils;
+    }
+
+    private final Map<String,String> map = new HashMap<String,String>();
+
+    private UploadFileUtils(){
+        map.put("scmOrder","scmOrder");
+    };
+
+    /**
+     * 获取路径
+     * @param uploadType
+     * @param soonPath
+     * @return
+     */
+    public String getAllpath(String uploadType,String soonPath){
+        String path = "";
+        for (Map.Entry<String, String> entry: map.entrySet()) {
+            if(entry.getKey().equals(uploadType)){
+                path = "common/" +entry.getValue() + soonPath;
+            }
+        }
+        if("".equals(path)){
+            if(soonPath ==null || "".equals(soonPath)){
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                soonPath = sdf.format(new Date());
+            }
+            path = "common/other/"+soonPath +"/";
+        }
+        return path;
+    }
+
+    /**
+     * 文件上传
+     * @param uploadType
+     * @param rootPath
+     * @param soonPath
+     * @param name
+     * @param file
+     * @return
+     */
+    public String upload(String uploadType, String rootPath, String soonPath, String name, CommonsMultipartFile file){
+        Integer flag = 0;
+        String path = getAllpath(uploadType,soonPath);  //common/scmOrder/upload/2019-02-21/
+        try {
+            File targetFile = new File(rootPath + path);
+            if (!targetFile.exists()) {
+                targetFile.mkdirs();
+            }
+            //获取输出流
+            OutputStream os=new FileOutputStream(rootPath+path+name);
+
+            //获取输入流 CommonsMultipartFile 中可以直接得到文件的流
+            InputStream is = file.getInputStream();
+            byte[] bts = new byte[1024];
+            //一个一个字节的读取并写入
+            while(is.read(bts)!=-1)
+            {
+                os.write(bts);
+            }
+            os.flush();
+            os.close();
+            is.close();
+        } catch (FileNotFoundException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return path+name;
+    }
+
+    /**
+     * 上朵牙刷定制的图片上传
+     * @param name
+     * @param file
+     * @return
+     */
+    public static String scmUploadFile(String rootPathh, String name, CommonsMultipartFile file){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        String soonPath = "/upload/"+ sdf.format(new Date()) + "/";
+        String path = UploadFileUtils.getUf().upload("scmOrder",rootPathh,soonPath,name,file);
+        return path;
+    }
+
+}

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

@@ -1,8 +1,8 @@
 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 #####
 
 #\u6D4B\u8BD5
@@ -10,9 +10,9 @@ jdbc.password=watero_RST
 #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
+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
 
 ### \uFFFD\uFFFD\uFFFD\u053B\uFFFD\uFFFD\uFFFD
 #jdbc.url=jdbc:mysql://192.168.1.254/rst_test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull

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

@@ -191,6 +191,10 @@
 		<typeAlias type="com.iamberry.rst.core.cm.PostageInfo" alias="PostageInfo"/>
 		<typeAlias type="com.iamberry.rst.core.cm.SendbackInfo" alias="SendbackInfo"/>
 		<typeAlias type="com.iamberry.rst.core.cm.SendbackItem" alias="SendbackItem"/>
+
+		<!-- scm - 上朵定制 -->
+		<typeAlias type="com.iamberry.rst.core.scm.ScmOrderInfo" alias="ScmOrderInfo"/>
+		<typeAlias type="com.iamberry.rst.core.scm.ScmOrderItem" alias="ScmOrderItem"/>
 	</typeAliases>
 	<!-- PageHelper -->
 	<plugins>
@@ -291,5 +295,9 @@
 		<mapper resource="com/iamberry/rst/service/wechat/mapper/menuKeySetMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/wechat/mapper/tokenMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/wechat/mapper/wechatShareMapper.xml"/>
+
+		<!-- scm - 上朵定制 -->
+		<mapper resource="com/iamberry/rst/service/scm/mapper/scmOrderInfoMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/scm/mapper/scmOrderItemMapper.xml"/>
 	</mappers>
 </configuration>

+ 33 - 6
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/product_list.ftl

@@ -61,15 +61,32 @@
             <form action="" method="post">
                 <div class="row cl" style="margin-left: 0px;">
 
-                    <div class="formControls col-md-offset-4 col-2 col-sm-2"  style="padding: 0px 10px 0px 0px; width: 110px;">
-                        <input type="text" class="input-text" value="" placeholder="产品名称" id="productName" name="productName">
+                    <input type="hidden" value="${isRadio!0}" id="isRadio">
+
+                    <div class="formControls col-md-offset-2 col-2 col-sm-2"  style="padding: 0px 10px 0px 0px; width: 110px;">
+                     <span class="select-box" >
+                        <select class="select" name="productType" id="productType" >
+                            <option value="" >产品类型</option>
+                            <#list productTypeList as productType>
+                                <option value="${productType.typeId}" <#if productColor.productType??><#if productColor.productType == productType.typeId></#if>selected = "selected"</#if> >${productType.typeName}</option>
+                            </#list>
+                        </select>
+				     </span>
+                    </div>
+
+                    <div class="formControls col-2 col-sm-2"  style="padding: 0px 10px 0px 0px; width: 110px;">
+                        <input type="text" class="input-text" value="${productColor.productName!''}" placeholder="产品名称" id="productName" name="productName">
                     </div>
                     <div class="formControls  col-2 col-sm-2"  style="padding: 0px 10px 0px 0px; width: 110px;">
-                        <input type="text" class="input-text" value="" placeholder="颜色名称" id="colorName" name="colorName">
+                        <input type="text" class="input-text" value="${productColor.colorName!''}" placeholder="颜色名称" id="colorName" name="colorName">
                     </div>
                      <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;" >
-                         <input type="text" class="input-text" value="" placeholder="颜色编码" id="colorBar" name="colorBar">
+                         <input type="text" class="input-text" value="${productColor.colorBar!''}" placeholder="颜色编码" id="colorBar" name="colorBar">
                      </div>
+
+                     <input type="hidden" class="input-text" value="${productColor.colorProductId!''}" placeholder="产品ID" id="colorProductId" name="colorProductId">
+                     <input type="hidden" class="input-text" value="${productColor.colorId!''}" placeholder="产品ID" id="colorId" name="colorId">
+
                      <div class="formControls col-1 col-sm-1" >
                          <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="searchOrder" name="">搜索</button>
                      </div>
@@ -108,7 +125,15 @@
 </tfoot>
 
 <script>
+
+    var selectType = "checkbox";
+
     $(function () {
+        var isRadio = $("#isRadio").val();
+        if(isRadio != null && isRadio == 1){
+            selectType = "radio";
+        }
+
         /*搜索*/
         $(document).on('click', '#searchOrder', function() {
             searchOrder();
@@ -136,13 +161,15 @@
         var productName = cufte($("#productName").val());
         var colorName = cufte($("#colorName").val());
         var colorBar = cufte($("#colorBar").val());
+        var productType = cufte($("#productType").val());
 
         $.ajax({
             type: "POST",
             data: {
                 productName : productName,
                 colorName : colorName,
-                colorBar : colorBar
+                colorBar : colorBar,
+                productType : productType
             },
             url: "${path}/admin/product/get_product",
             success: function(data){
@@ -151,7 +178,7 @@
                     for(var i=0;i<data.returnMsg.productColorList.length;i++){
                         var productColor = data.returnMsg.productColorList[i];
                         html += '<tr class="text-c">' +
-                                ' <td><input type="checkbox" class="color_id" id="" value="'+ productColor.colorId +'" ></td>' +
+                                ' <td><input type="'+ selectType +'" class="color_id" id=""  name="color_id" value="'+ productColor.colorId +'" ></td>' +
                                 ' <td>'+ cufte(productColor.productName) +'</td>' +
                                 ' <td>'+ cufte(productColor.colorName) +'</td>' +
                                 ' <td>'+ cufte(productColor.colorPrice)/100 +'</td>' +

+ 236 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/scm/scm_add_order.ftl

@@ -0,0 +1,236 @@
+<!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">
+
+    <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;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
+        .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
+        .ac_results li {border:1px solid #fff}
+        .ac_results li a span {float:right}
+        .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
+        .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 25px;}
+        .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
+        .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
+        .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent  #32a3d8 transparent transparent;font-size:0; line-height:0;}
+        .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
+        .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
+        .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
+        .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
+        .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
+        .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
+        .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent  transparent  transparent #32a3d8;font-size:0; line-height:0;}
+        .time-line-list>li:first-child .arrow{display: none;}
+        .table-bg th{background-color: #e2f6ff;}
+        .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
+        .msg-phone{height: 35px;line-height: 35px;}
+        .col-sm-1{width: 150px;}
+
+        .all_down{text-decoration: underline;color: #00c;}
+    </style>
+    <title>添加订单 - 上朵牙刷定制管理 - RST</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 上朵牙刷定制管理
+    <span class="c-gray en">&gt;</span> 添加订单
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;margin-right: 5px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       href="javascript:history.back(-1);" title="后退"><i class="Hui-iconfont">&#xe6d4;</i></a>
+</nav>
+<article class="page-container" style="padding: 10px;">
+    <div class="pd-20 cl">
+        <form action="${path}/admin/scm_order/add_order" method="post" class="form form-horizontal" id="form-order-add"  onkeydown="if(event.keyCode==13)return false;">
+
+            <div class="row cl">
+                <label class="form-label col-3">
+                    <div class="tit-2">订单基本信息</div>
+                </label>
+                <div class="formControls col-9">
+                </div>
+            </div>
+
+            <input type="hidden" name="orderCompanyId" id="orderCompanyId" value="4" >
+            <input type="hidden" id="orderStoreId" name="orderStoreId" value="76" >
+
+            <input type="hidden" id="orderSendType" name="orderSendType" value="2" >
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">订单编号:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" value="" placeholder="订单编号" id="orderNo" datatype="*1-30" name="orderNo" >
+                </div>
+            </div>
+
+            <div class="row cl" id="showScmOrder" style="display: none;">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-9 col-sm-9 text-c">
+                    <table class="table table-border table-bg table-bordered">
+                        <thead>
+                            <tr>
+                                <th style="text-align: center;">生产编号</th>
+                                <th style="text-align: center;">订单编号</th>
+                                <th style="text-align: center;">姓名电话</th>
+                                <th style="text-align: center;">发货状态</th>
+                                <th style="text-align: center;">收货地址</th>
+                                <th style="text-align: center;">创建时间</th>
+                            </tr>
+                        </thead>
+                        <tbody id="showScmOrderTbody">
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">用户信息:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" value="" placeholder="填写收件人姓名" id="orderAddressName" name="orderAddressName" datatype="*1-16" errormsg="联系人格式不正确!" >
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" value="" placeholder="填写收件人手机号" id="orderAddressTel" name="orderAddressTel" datatype="*1-20" errormsg="联系人电话格式不正确!">
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">快递公司:</label>
+                <div class="formControls col-2 col-sm-2" >
+                    <span class="select-box">
+                        <select class="select" name="orderPostFirm" id="orderPostFirm" >
+                            <#list logisticsInfoList as logisticsInfo>
+                                <option value="${logisticsInfo.logisticsRstCode}" >${logisticsInfo.logisticsName}</option>
+                            </#list>
+                        </select>
+				    </span>
+                </div>
+            </div>
+
+            <div class="row cl address_info" id="" style="">
+                <label class="form-label col-1 col-sm-1">地址信息:</label>
+                <div class="formControls col-2 col-sm-2" >
+                    <span class="select-box">
+                        <select class="select init_province" id="addressProvince"  >
+                        </select>
+				    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select  class="select init_city" id="addressCity"   >
+                        </select>
+                    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select  class="select init_country" id="addressCountry" >
+                        </select>
+				    </span>
+                </div>
+            </div>
+
+            <div class="row cl" id="recipientAddressText" style="">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-6 col-sm-6">
+                    <textarea name="addressDesc" style="height: 50px;" id="addressDesc" cols="" rows="2" datatype="*" errormsg="收货地址不正确!" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)"></textarea>
+                    <span id="addrssMsg"></span>
+                </div>
+                <input type="hidden" name="orderAddressInfo" id="orderAddressInfo" value="">
+            </div>
+
+            <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" id="" style="">
+                <label class="form-label col-1 col-sm-1">商品信息:</label>
+                <div class="formControls col-8 col-sm-8">
+                    <input type="button" class="btn btn-primary add-order-button" onclick="add_product()" value="添加商品" >
+                    <table class="table table-border table-bg table-bordered" style="margin-top: 10px;display: none" id="all_add_product">
+                        <thead>
+                            <tr class="text-c" id="table1">
+                                <th style="text-align: center;" width="30" >产品名称</th>
+                                <th style="text-align: center;" width="25" >产品颜色</th>
+                                <th style="text-align: center;" width="10">数量</th>
+                                <th style="text-align: center;" width="10">设计文件</th>
+                                <th style="text-align: center;" width="10">预览图</th>
+                                <th style="text-align: center;" width="10">操作</th>
+                            </tr>
+                        </thead>
+                        <tbody id="add_product">
+                        </tbody>
+                    </table>
+                    <input type="hidden" id="orderItemString" name="orderItemString" value="" >
+                </div>
+            </div>
+
+            <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" id="" style="">
+                <label class="form-label col-1 col-sm-1">用户备注:</label>
+                <div class="formControls col-6 col-sm-6">
+                    <textarea name="orderUserRemark" id="orderUserRemark" cols="" rows="2"  class="textarea" placeholder="请填写用户备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
+                    <#--<span id="addrssMsg"></span>-->
+                </div>
+            </div>
+
+         <#--   <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">后台备注:</label>
+                <div class="formControls col-6 col-sm-6">
+                    <textarea name="salesAdminRemark" id="salesAdminRemark" cols="" rows="2" class="textarea" placeholder="请填写后台备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
+                </div>
+            </div>-->
+
+            <div class="row cl">
+                <div class="col-2 col-sm-2 col-offset-3">
+                    <button class="btn btn-block btn-primary size-XL" type="submit">确认录入</button>
+                </div>
+            </div>
+        </form>
+    </div>
+</article>
+
+<script type="text/javascript">
+    var url_path = "${path}";
+</script>
+<#--时间控件-->
+<#--<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>-->
+<script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
+
+
+<script type="text/javascript">
+    var scm_ulc = initAddress($(".address_info"));
+    var is_update = false;
+
+    $("#orderNo").blur(function(){
+        showOldOrder();
+    });
+</script>
+
+
+<script type="text/javascript" charset="utf-8" src="${path}/common/js/scmOrder/scmOrder.js"></script>
+
+
+</body>
+</html>

+ 295 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/scm/scm_order_list.ftl

@@ -0,0 +1,295 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/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" />
+    <link rel="Bookmark" href="/favicon.ico" >
+    <link rel="Shortcut Icon" href="/favicon.ico" />
+<#include "/base/list_base.ftl">
+    <title>订单列表</title>
+    <style>
+        html{-webkit-text-size-adjust:none;}
+        *{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;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
+        .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
+        .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;}
+        .text_un{    text-decoration: underline;color: #4776fd;}
+    </style>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 上朵牙刷定制管理
+    <span class="c-gray en">&gt;</span> 订单列表
+    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="page-container">
+    <div class="text-c">
+        <form action="${path}/admin/scm_order/order_list" method="post">
+
+            <div style="float: left;display: block;width: 110px;height: 30px;" id="addOrderDiv" >
+                <button type="button" style="height: 30px;top: 0px;cursor: pointer;" class="my-btn-search my-order" id="" onclick="toAddOrder();" >录入订单</button>
+            </div>
+
+            <input type="text" class="my-input trim_input"  style="margin-top: -3px;width:118px;margin-right: 0px;height: 28px;padding: 0px;" value="${scmOrderItem.orderNo!}" placeholder="订单编号" name="orderNo" id="orderNo">
+            <select class="select" name="orderShippingStatus" id="orderShippingStatus" style="height: 30px;width: 120px;margin: 0px;margin-bottom: 10px;">
+                <option value ="">订单状态</option>
+                <option value ="0" <#if scmOrderItem.orderShippingStatus??><#if scmOrderItem.orderShippingStatus == 0 >selected="selected"</#if></#if>>未发货</option>
+                <option value ="1" <#if scmOrderItem.orderShippingStatus??><#if scmOrderItem.orderShippingStatus == 1 >selected="selected"</#if></#if>>已发货</option>
+            </select>
+
+            <input type="text" class="my-input trim_input"  style="margin-top: -3px;width:118px;margin-right: 0px;height: 28px;padding: 0px;" value="${scmOrderItem.orderAddressName!}" placeholder="姓名" name="orderAddressName" id="orderAddressName">
+            <input type="text" class="my-input trim_input"  style="margin-top: -3px;width:118px;margin-right: 0px;height: 28px;padding: 0px;" value="${scmOrderItem.orderAddressTel!}" placeholder="电话号码" name="orderAddressTel" id="orderAddressTel">
+            <input type="text" class="my-input trim_input"  style="margin-top: -3px;width:118px;margin-right: 0px;height: 28px;padding: 0px;" value="${scmOrderItem.orderAddressInfo!}" placeholder="地址" name="orderAddressInfo" id="orderAddressInfo">
+
+            <select class="select" name="orderPostFirm" id="orderPostFirm" style="height: 30px;width: 120px;margin: 0px;margin-bottom: 10px;"">
+                <option value="">快递公司</option>
+                <#if logisticsInfoList?? &&  (logisticsInfoList?size > 0) >
+                    <#list logisticsInfoList as logisticsInfo>
+                        <option value="${logisticsInfo.logisticsRstCode!''}" <#if scmOrderItem.orderPostFirm??><#if scmOrderItem.orderPostFirm == logisticsInfo.logisticsRstCode >selected="selected"</#if></#if>>${logisticsInfo.logisticsName!''}(${logisticsInfo.logisticsRstCode!''})</option>
+                    </#list>
+                </#if>
+            </select>
+            <input type="text" class="my-input trim_input"  style="margin-top: -3px;width:118px;margin-right: 0px;height: 28px;padding: 0px;" value="${scmOrderItem.orderPostNum!}" placeholder="物流编号" name="orderPostNum" id="orderPostNum">
+
+
+            <#--<input type="text" style="margin-top: -3px;width:120px;height:30px;margin-right: 0px;font-size: 9px;" name="startDate" id="startDate" class="input-text" placeholder="开始时间" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${(orderBatch.startDate?string("yyyy-MM-dd HH:mm:ss"))!''}" readonly="readonly"/>--->
+            <#--<input type="text" style="margin-top: -3px;width:120px;height:30px;margin-right: 0px;font-size: 9px;" name="endDate" id="endDate" class="input-text" placeholder="结束时间" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${(orderBatch.endDate?string("yyyy-MM-dd HH:mm:ss"))!''}" readonly="readonly"/>-->
+
+            <button type="submit" class="my-btn-search" style="" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+        </form>
+    </div>
+
+    <div class="mt-20">
+        <table class="table table-border table-bordered table-bg table-hover table-sort">
+        <thead>
+        <tr class="text-c">
+            <th width="40">生产编号</th>
+            <th width="60">订单编号</th>
+            <th width="50">二维码</th>
+            <th width="50">发货状态</th>
+            <th width="40">收件人</th>
+            <th width="70">收件人地址</th>
+            <th width="45">定制产品信息</th>
+            <th width="50">设计文件</th>
+            <th width="50">订单备注</th>
+            <th width="50">物流信息</th>
+            <th width="50">录入日期</th>
+            <th width="50">操作</th>
+        </tr>
+        </thead>
+        <tbody>
+            <#if page.dataList?? &&  (page.dataList?size > 0) >
+                    <#list page.dataList as scmOrderItem>
+                        <tr class="text-c">
+                            <td>${scmOrderItem.orderMadeId!''}</td>
+                            <td>${scmOrderItem.orderNo!''}</td>
+                            <td><img style="width: 60px;" src="/${scmOrderItem.orderMadeIdPath!''}"  class=""></td>
+
+                            <td>
+                                <#if (scmOrderItem.orderShippingStatus == 0)>
+                                    未发货
+                                <#elseif (scmOrderItem.orderShippingStatus == 1)>
+                                    已发货
+                                <#else>
+                                    其他
+                                </#if>
+                            </td>
+                            <td>
+                                ${scmOrderItem.orderAddressName!''}<br>
+                                ${scmOrderItem.orderAddressTel!''}
+                            </td>
+                            <td>${scmOrderItem.orderAddressInfo!''}</td>
+
+                            <td>
+                                <span class="label label-success radius">${(scmOrderItem.orderItemProductName)!}(${(scmOrderItem.orderItemColorName)!})*${(scmOrderItem.orderItemNum)!}</span>
+                            </td>
+
+                            <td>
+                                <a href="/${(scmOrderItem.orderItemDesignPath)!''}" class="text_un" download="${(scmOrderItem.orderItemProductName)!''}(${(scmOrderItem.orderItemColorName)!})">下载</a>
+                            </td>
+
+                            <td>${scmOrderItem.orderUserRemark!''}</td>
+
+                            <td>
+                                <#if scmOrderItem.orderPostFirm ??>
+                                    <#list logisticsInfoList as logisticsInfo>
+                                        <#if scmOrderItem.orderPostFirm == logisticsInfo.logisticsRstCode>
+                                            ${logisticsInfo.logisticsName}
+                                        </#if>
+                                    </#list>
+                                </#if></br>
+                                ${scmOrderItem.orderPostNum!''}
+                            </td>
+
+                            <td>
+                                ${(scmOrderItem.orderCreateTime?string("yyyy-MM-dd"))!''}<br>
+                                ${(scmOrderItem.orderCreateTime?string("HH:mm:ss"))!''}
+                            </td>
+                            <td>
+                                <a class="scm_update_order " style="text-decoration: none"  href="javascript:void(0);" title="修改订单" alt="修改订单" onclick="toUpdateOrder(${scmOrderItem.orderId!''})">
+                                    <i class="Hui-iconfont"> &#xe6df;</i>
+                                </a> &nbsp;
+
+                                <a class="scm_print_order " style="text-decoration: none"  href="javascript:void(0);" title="打印二维码" alt="打印二维码" onclick="toPrintOrder(${scmOrderItem.orderId!''},'${scmOrderItem.orderMadeIdPath!''}')">
+                                    <i class="Hui-iconfont">&#xe652;</i>
+                                </a> &nbsp;
+
+                                <#if (scmOrderItem.orderShippingStatus == 0)>
+                                    <a class="scm_update_order "  style="text-decoration: none" href="javascript:void(0);" title="删除订单" alt="删除订单" onclick="deleteOrder(${scmOrderItem.orderId!''})">
+                                        <i class="Hui-iconfont">&#xe609;</i>
+                                    </a>
+                                </#if>
+
+                            </td>
+                        </tr>
+                    </#list>
+            <#else>
+                <tr><td colspan="11" class="td-manage text-c" >暂时没有订单,请添加!</td></tr>
+            </#if>
+        </tbody>
+    </table>
+    </div>
+</div>
+
+
+<div id="printOrderHtml" style="display: none">
+
+    <div style="width: 90%;margin-left: 5%;margin-top: 20px;" class="main_print">
+        <input type="hidden" id="print_order_id" name="" value="">
+        <input type="hidden" id="print_order_img" name="" value="">
+        <div class="row cl" id="" style="">
+            <label class="form-label col-4 col-sm-4" style="text-align: right">订单张数:</label>
+            <div class="formControls col-7 col-sm-7">
+                <input type="text" class="input-text trim_input" value="6" placeholder="" id="orderNumber" name="orderNumber" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)" >
+            </div>
+        </div>
+        <div class="row cl" id="" style="margin-top: 20px;">
+            <#--<label class="form-label col-3 col-sm-3"></label>-->
+            <div class="formControls col-11 col-sm-11">
+                每个定制生产好的牙刷外包装上,都需要粘贴生产编号,以便发货时统一区分
+            </div>
+        </div>
+        <div class="row cl" id="" style="margin-top: 50px;">
+            <div class="formControls col-11 col-sm-11" style="text-align: center;">
+                <input type="button" class="btn btn-primary add-order-button" onclick="start_print(this)" value="开始打印" >
+            </div>
+        </div>
+    </div>
+
+</div>
+
+
+<div  style="display:none;" >
+    <div id="printlist">
+    </div>
+</div>
+
+<tfoot>
+<#include "/base/page_util.ftl">
+</tfoot>
+
+<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>
+
+    var pring_orderId,pring_img;
+
+    /**
+     *toAddOrder
+     */
+    function toAddOrder() {
+        window.location.href=root_path + '/admin/scm_order/to_add_order';
+    }
+   /**
+     *toUpdateOrder
+     */
+    function toUpdateOrder(orderId) {
+        window.location.href=root_path + '/admin/scm_order/to_update_order?orderId='+orderId;
+    }
+
+   /**
+     *delete
+     */
+    function deleteOrder(orderId) {
+       layer.confirm('是否确认删除,删除后无法恢复?',function(index){
+           $.ajax({
+               type:'POST',
+               url: '${path}/admin/salesOrder/delSalesOrder',
+               data:{
+                   "id" : salesId
+               },
+               dataType: 'json',
+               success:function(res) {
+                   if(res.resultCode == 200 && res.returnCode == 200){
+                       location.reload();
+                   }else{
+                       layer.alert("删除失败!", function(index){
+                           layer.close(index);
+                       });
+                       layer.close(index);
+                   }
+                   return false;
+               }
+           });
+       });
+    }
+
+    /**
+     *下载
+     * @param employee
+     */
+    function download_order(batchId) {
+    }
+
+    /**
+     * 打印二维码
+     */
+    function toPrintOrder(orderId,img){
+        pring_orderId = orderId;
+        pring_img = img;
+        var printOrderHtml = $("#printOrderHtml").html();
+        layer.open({
+            type: 1,
+            area: ['400px', '300px'],
+            fix: false, //不固定
+            shade:0.4,
+            title: '批量添加机器',
+            content: printOrderHtml
+        });
+    }
+
+    /**
+     * 打印二维码
+     */
+    function start_print(node){
+        var index = layer.load(1, {
+            shade: [0.5,'#fff'] //0.1透明度的白色背景
+        });
+        var pring_number = $(node).parents(".main_print").find("#orderNumber").val();
+        if(pring_number > 20){
+            layer.close(index);
+            layer.msg('一次最多支持打印20张二维码', {icon: 2, time: 2000});
+            return false;
+        }
+        for (var i=0; i<pring_number; i++){
+            $("#printlist").append('<div style="width: 242px;height: 120px;position: relative;">' +
+                    '<img style="position: absolute;top:18px;width: 100px;height: 100px; " id="qrcodeImg" src="/'+pring_img+'" /> ' +
+                    '</div>');
+        }
+        $("#printlist").printArea();
+        $("#printlist").html("");
+        layer.close(index);
+    }
+
+</script>
+</body>
+</html>

+ 376 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/scm/scm_send_order.ftl

@@ -0,0 +1,376 @@
+<!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">
+
+    <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;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
+        .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
+        .ac_results li {border:1px solid #fff}
+        .ac_results li a span {float:right}
+        .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
+        .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 25px;}
+        .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
+        .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
+        .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent  #32a3d8 transparent transparent;font-size:0; line-height:0;}
+        .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
+        .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
+        .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
+        .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
+        .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
+        .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
+        .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent  transparent  transparent #32a3d8;font-size:0; line-height:0;}
+        .time-line-list>li:first-child .arrow{display: none;}
+        .table-bg th{background-color: #e2f6ff;}
+        .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
+        .msg-phone{height: 35px;line-height: 35px;}
+        .col-sm-1{width: 150px;}
+
+        .all_down{text-decoration: underline;color: #00c;}
+    </style>
+    <title>订单发货 - 上朵牙刷定制管理 - RST</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 上朵牙刷定制管理
+    <span class="c-gray en">&gt;</span> 订单发货
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container" style="padding: 10px;">
+    <div class="pd-20 cl">
+
+        <form action="${path}/admin/scm_order/get_order_madeId" method="post" class="form form-horizontal" id="form-order-add"  onkeydown="if(event.keyCode==13)return false;">
+
+            <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" id="" style="">
+                <label class="form-label col-1 col-sm-1">生产编号:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" value="" placeholder="请扫描二维码或输入编号" id="orderMadeId" datatype="n6-7" name="orderMadeId" >
+                </div>
+                <input type="submit" class="btn btn-primary add-order-button" value="查询订单" >
+            </div>
+        </form>
+
+        <div class="row cl" id="productOrder" style="display: none;margin-top: 20px;">
+            <label class="form-label col-3">
+                <div class="tit-2">产品明细</div>
+            </label>
+            <div class="formControls col-9">
+            </div>
+        </div>
+
+        <div class="row cl" id="" style="">
+            <label class="form-label col-1 col-sm-1"></label>
+            <div class="formControls col-1 col-sm-8">
+
+                <table class="table table-border table-bg table-bordered" style="margin-top: 10px;display: none" id="scmOrderItemTable">
+                    <thead>
+                    <tr class="text-c" id="table1">
+                        <th style="text-align: center;" width="30" >订单编号</th>
+                        <th style="text-align: center;" width="20" >状态</th>
+                        <th style="text-align: center;" width="55" >产品名称</th>
+                        <th style="text-align: center;" width="25" >产品颜色</th>
+                        <th style="text-align: center;" width="10">数量</th>
+                        <th style="text-align: center;" width="30">预览图</th>
+                    </tr>
+                    </thead>
+                    <tbody id="scmOrderItemTbody">
+                    </tbody>
+                </table>
+
+            </div>
+        </div>
+
+
+        <div class="row cl sendOrder" id="sendOrderSumbit" style="display: none;    margin-top: 20px;">
+            <label class="form-label col-1 col-sm-1"></label>
+            <div class="formControls col-1 col-sm-2">
+                <button class="btn btn-block btn-primary size-XL" type="button" id="sub-post" >订单发货</button>
+            </div>
+        </div>
+
+        <div class="row cl sendOrder"  style="display: none;">
+            <label class="form-label col-1 col-sm-1"></label>
+            <div class="formControls col-1 col-sm-2" id="orderMsg" printNum="0">
+            </div>
+        </div>
+
+        <div id="temp-print-order" style="zoom:0.9;display:none"></div>
+
+        <div id="print-pageview-div" style="display: none"></div>
+
+    </div>
+</article>
+<script type="text/javascript" src="https://s.iamberry.com/js/LodopFuncs.js"></script>
+<script type="text/javascript">
+    var url_path = "${path}";
+</script>
+
+
+<script type="text/javascript">
+
+    var status = -1;
+
+    $(function(){
+        // 获得焦点
+        $("#postNum").select();
+
+        var loadIndex = 0;
+        $("#form-order-add").Validform({
+            tiptype: function (msg, o, cssctl) {
+                if (o.type == 3) {//失败
+                    layer.msg(msg, {icon: 5, time: 3000});
+                    $(window).scrollTop(o.obj.offset().top - 40);
+                }
+            },
+            datatype: {//自定义验证类型
+            },
+            ignoreHidden: true,
+            tipSweep: true, //若为true,则只在表单提交时验证
+            ajaxPost: true, //异步提交
+            beforeCheck: function (curform) {  //验证通过之前执行的函数
+                var flag = false;
+            },
+            beforeSubmit: function (curform) {  //验证通过之后执行的函数
+                $("#scmOrderItemTbody").html("");
+                $(".sendOrder").hide();
+                $("#orderMsg").html("");
+                loadIndex = layer.load(1, {
+                    shade: [0.5,'#fff'] //0.1透明度的白色背景
+                });
+            },
+            callback: function (data) {//异步回调函数
+                if (data.returnCode == 200 && data.returnMsg.scmOrderInfo.scmOrderItemList.length > 0) {
+                    status = data.returnMsg.scmOrderInfo.orderShippingStatus;
+                    for (var i = 0; i < data.returnMsg.scmOrderInfo.scmOrderItemList.length; i++) {
+                        var scmOrderItem = data.returnMsg.scmOrderInfo.scmOrderItemList[i];
+                        var status = '';
+                        if(data.returnMsg.scmOrderInfo.orderShippingStatus == 0){
+                            status = '未发货';
+                        }else  if(data.returnMsg.scmOrderInfo.orderShippingStatus == 1){
+                            status = '已发货';
+                        }else{
+                            status = '其他';
+                        }
+                        var html = '<tr class="text-c">'
+                            + '<td msg='+ data.returnMsg.scmOrderInfo.orderNo +'>'+ data.returnMsg.scmOrderInfo.orderNo +'</td>'
+                            + '<td msg='+ status +'>'+ status +'</td>'
+                            + '<td>'+ scmOrderItem.orderItemProductName +'</td>'
+                            + '<td>'+ scmOrderItem.orderItemColorName +'</td>'
+                            + '<td>'+ scmOrderItem.orderItemNum +'</td>'
+                            + '<td><img style="width: 75px;" src="/'+ scmOrderItem.orderItemDesignPreview +'"></td>'
+                            + '</tr>';
+                        $("#scmOrderItemTbody").append(html);
+                    }
+                    $("#scmOrderItemTable").show();
+                    $(".sendOrder").show();
+                    $("#productOrder").show();
+                    tableMana(0);
+                    tableMana(1);
+                }else{
+                    layer.msg('查询失败,未查询到该订单',{icon: 5,time:2000});
+                }
+                layer.close(loadIndex);
+                return false;
+            }
+        });
+    });
+
+    $(function () {
+
+    })
+</script>
+<script type="text/javascript">
+    // 选择打印设备
+    var LODOP=getLodop();
+    $(function () {
+        $.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","click","0");
+        // 获取系统的打印机
+        //setPrintMachine();
+        function setPrintMachine() {
+            var count = LODOP.GET_PRINTER_COUNT() - 1;
+            for (var i = 0; i <= count; i++) {
+                var text = LODOP.GET_PRINTER_NAME(i+":PrinterName");
+                $("#print-machine").append("<option value='" + i + "'>" + text + "</option>")
+            }
+        }
+        // 开始打印
+        $("#sub-post").click(function() {
+            if(status != 0){
+                layer.msg("该订单已发货",{icon: 2,time:3000});
+                return false;
+            }
+            LODOP.SELECT_PRINTER();
+//            var index = getCurrTab()    ;
+//            var orders = $("." + index + "-wait-print-order");
+//            if (orders == null || orders.length <= 0) {
+//                layer.msg("未选中订单",{icon: 2,time:3000});
+//                return;
+//            }
+            // 启动打印
+            startPrint();
+        });
+
+        function nextPrintOrder() {
+            var index = getCurrTab();
+            var orders = $("." + index + "-wait-print-order");
+            for(var i = 0; i < orders.length; i++) {
+                var temp = $(orders[i]);
+                var printNum = parseInt(temp.attr("printNum"));
+                if (temp.attr("printState") == "1" && printNum < 3) {
+                    // 待打印
+                    return temp;
+                }
+            }
+        }
+
+        function startPrint() {
+            var order = $("#orderMsg");
+//            var order = nextPrintOrder();
+//            if (order == null || typeof(order) == undefined) {
+//                alert("打印完成,请切换快递公司继续打印");
+//                return;
+//            }
+//            var $td = $(order.find("td")[1]);
+//            var orderId = $td.text().trim();
+//            var salesId = $td.attr("salesId");
+//            var post = $td.attr("post");
+            var orderMadeId = $("#orderMadeId").val();
+            // 单个打印
+            $.ajax({
+                type: "POST",
+                data: {
+//                    "post":post,
+//                    "orderId":orderId
+//                    "salesId":salesId
+                    "orderMadeId":orderMadeId
+                },
+                async: true,
+                url: "${path}/admin/scm_order/scm_print_order",
+                beforeSend: function () {
+                    // 请求开始
+//                    order.attr("printState", "2");
+                   // $(order.find("td")[0]).html("<span style='color: rgba(243, 123, 29, 1);'>处理中</span>");
+                },
+                success: function(data){
+                    var tempObject = data;
+                    if ('string' == typeof(data)) {
+                        tempObject = $.parseJSON(data);
+                    }
+                    if (tempObject.hasOwnProperty("error")) {
+                        // 捕获系统级的错误(比如因为空指针抛出的Exception)
+                        re_print(order, tempObject.error_msg);
+                    } else {
+                        if (data && data.returnCode && data.returnCode != 200) {
+                            // 捕获业务级的操作(如订单的店铺没有绑定发货人信息)
+                            re_print(order, data.returnMsg.error);
+                        } else {
+                            var res = $.parseJSON(data.returnMsg.json);
+                            if (data.resultMsg && res.Success) {
+                                var html = res.PrintTemplate;
+                                $("#temp-print-order").html(html);
+                                LODOP.PRINT_INIT('打印订单');
+                                LODOP.SET_PRINT_PAGESIZE(0, 0, 0,"");
+                                LODOP.ADD_PRINT_HTM("0mm","0mm","100%","100%", $("#temp-print-order").html());
+                                var flag = LODOP.PRINT();
+                                if (flag) {
+//                                    startPrint();
+                                    $(order).html("<span style='color: blue'>打印完成</span>");
+                                } else {
+                                    // 向后台提交失败打印的信息
+                                    order.attr("printState", "2");
+                                    $(order).html("<span style='color: red;'>失败(打印机异常)</span>");
+                                }
+                            } else {
+                                // 第三方接口错误
+                                re_print(order, res.Reason);
+                            }
+                        }
+                    }
+                }
+            });
+        }
+
+        /* 打印失败后,重新打印 */
+        function re_print(order, errorMsg) {
+            // 设置当前被打印的内容为“未打印”
+            var printNum = parseInt(order.attr("printNum"));
+            if(printNum >= 2) {
+                // 已重试两次,不允许重试
+                order.attr("printState", "2");
+                $(order).html("<span style='color: red;'>失败(" + errorMsg + ")</span>");
+            } else {
+                order.attr("printState", "1");
+                order.attr("printNum", (printNum + 1));
+                $(order).html("<span style='color: blue;'>正在重试(" + errorMsg + ")</span>");
+                startPrint();
+            }
+        }
+
+        function getCurrTab() {
+            var spans = $(".tabBar").find("span");
+            for (var i = 0 ; i < spans.length; i++) {
+                var temp = $(spans[i]).attr("class");
+                if (temp == null || "" === temp || undefined === typeof(temp)) {
+
+                }else if ($(spans[i]).attr("class").indexOf("current") !== -1) {
+                    return i;
+                }
+            }
+        }
+    });
+</script>
+
+<script>
+    /**
+     * 合并单元格
+     * @param num
+     */
+    function tableMana(num) {
+        var rowspanName = null;
+        var rowspanNum = 1;
+        var $rowspan=null;
+        $("#scmOrderItemTbody").find("tr").each(function(){
+            var $tdNode =  $(this).find("td").eq(num);
+            $tdNode.hide();
+            if(rowspanName == null){
+                rowspanName = $tdNode.attr("msg");
+                $rowspan = $tdNode;
+                return true;
+            }
+            if(rowspanName == $tdNode.attr("msg")){
+                rowspanNum ++;
+            }else{
+                $rowspan.show();
+                $rowspan.attr("rowspan",rowspanNum);
+
+                $rowspan = $tdNode;
+                rowspanNum = 1;
+                rowspanName = $tdNode.attr("msg");
+            }
+        });
+        $rowspan.show();
+        $rowspan.attr("rowspan",rowspanNum);
+    }
+</script>
+</body>
+</html>

+ 229 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/scm/scm_update_order.ftl

@@ -0,0 +1,229 @@
+<!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">
+
+    <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;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
+        .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
+        .ac_results li {border:1px solid #fff}
+        .ac_results li a span {float:right}
+        .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
+        .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 25px;}
+        .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
+        .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
+        .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent  #32a3d8 transparent transparent;font-size:0; line-height:0;}
+        .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
+        .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
+        .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
+        .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
+        .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
+        .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
+        .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent  transparent  transparent #32a3d8;font-size:0; line-height:0;}
+        .time-line-list>li:first-child .arrow{display: none;}
+        .table-bg th{background-color: #e2f6ff;}
+        .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
+        .msg-phone{height: 35px;line-height: 35px;}
+        .col-sm-1{width: 150px;}
+
+        .all_down{text-decoration: underline;color: #00c;}
+    </style>
+    <title>修改订单 - 上朵牙刷定制管理 - RST</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 上朵牙刷定制管理
+    <span class="c-gray en">&gt;</span> 修改订单
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;margin-right: 5px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       href="javascript:history.back(-1);" title="后退"><i class="Hui-iconfont">&#xe6d4;</i></a>
+</nav>
+<article class="page-container" style="padding: 10px;">
+    <div class="pd-20 cl">
+        <form action="${path}/admin/scm_order/update_order" method="post" class="form form-horizontal" id="form-order-add"  onkeydown="if(event.keyCode==13)return false;">
+
+            <div class="row cl">
+                <label class="form-label col-3">
+                    <div class="tit-2">订单基本信息</div>
+                </label>
+                <div class="formControls col-9">
+                </div>
+            </div>
+
+            <input type="hidden" id="orderId" name="orderId" value="${orderId!''}" >
+
+            <input type="hidden" name="orderCompanyId" id="orderCompanyId" value="4" >
+            <input type="hidden" id="orderStoreId" name="orderStoreId" value="76" >
+
+            <input type="hidden" id="orderSendType" name="orderSendType" value="2" >
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">订单编号:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" value="" placeholder="订单编号" id="orderNo" name="orderNo" >
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">用户信息:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" value="" placeholder="填写收件人姓名" id="orderAddressName" name="orderAddressName" datatype="*1-16" errormsg="联系人格式不正确!" >
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" value="" placeholder="填写收件人手机号" id="orderAddressTel" name="orderAddressTel" datatype="*1-20" errormsg="联系人电话格式不正确!">
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">快递公司:</label>
+                <div class="formControls col-2 col-sm-2" >
+                    <span class="select-box">
+                        <select class="select" name="orderPostFirm" id="orderPostFirm" >
+                            <#list logisticsInfoList as logisticsInfo>
+                                <option value="${logisticsInfo.logisticsRstCode}" >${logisticsInfo.logisticsName}</option>
+                            </#list>
+                        </select>
+				    </span>
+                </div>
+            </div>
+
+            <div class="row cl address_info" id="" style="">
+                <label class="form-label col-1 col-sm-1">地址信息:</label>
+                <div class="formControls col-2 col-sm-2" >
+                    <span class="select-box">
+                        <select class="select init_province" id="addressProvince"  >
+                        </select>
+				    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select  class="select init_city" id="addressCity"   >
+                        </select>
+                    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select  class="select init_country" id="addressCountry" >
+                        </select>
+				    </span>
+                </div>
+            </div>
+
+            <div class="row cl" id="recipientAddressText" style="">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-6 col-sm-6">
+                    <textarea name="addressDesc" style="height: 50px;" id="addressDesc" cols="" rows="2" datatype="*" errormsg="收货地址不正确!" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)"></textarea>
+                    <span id="addrssMsg"></span>
+                </div>
+                <input type="hidden" name="orderAddressInfo" id="orderAddressInfo" value="">
+            </div>
+
+            <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" id="" style="">
+                <label class="form-label col-1 col-sm-1">商品信息:</label>
+                <div class="formControls col-8 col-sm-8">
+                    <input type="button" class="btn btn-primary add-order-button" onclick="add_product()" value="添加商品" >
+                    <table class="table table-border table-bg table-bordered" style="margin-top: 10px;display: none" id="all_add_product">
+                        <thead>
+                            <tr class="text-c" id="table1">
+                                <th style="text-align: center;" width="30" >产品名称</th>
+                                <th style="text-align: center;" width="25" >产品颜色</th>
+                                <th style="text-align: center;" width="10">数量</th>
+                                <th style="text-align: center;" width="10">设计文件</th>
+                                <th style="text-align: center;" width="10">预览图</th>
+                                <th style="text-align: center;" width="10">操作</th>
+                            </tr>
+                        </thead>
+                        <tbody id="add_product">
+                        </tbody>
+                    </table>
+                    <input type="hidden" id="orderItemString" name="orderItemString" value="" >
+                </div>
+            </div>
+
+            <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" id="" style="">
+                <label class="form-label col-1 col-sm-1">用户备注:</label>
+                <div class="formControls col-6 col-sm-6">
+                    <textarea name="orderUserRemark" id="orderUserRemark" cols="" rows="2"  class="textarea" placeholder="请填写用户备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
+                    <#--<span id="addrssMsg"></span>-->
+                </div>
+            </div>
+
+         <#--   <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">后台备注:</label>
+                <div class="formControls col-6 col-sm-6">
+                    <textarea name="salesAdminRemark" id="salesAdminRemark" cols="" rows="2" class="textarea" placeholder="请填写后台备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
+                </div>
+            </div>-->
+
+            <div class="row cl">
+                <div class="col-2 col-sm-2 col-offset-3">
+                    <button class="btn btn-block btn-primary size-XL" type="submit">确认录入</button>
+                </div>
+            </div>
+        </form>
+    </div>
+</article>
+
+<script type="text/javascript">
+    var url_path = "${path}";
+</script>
+
+<script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
+
+
+<script type="text/javascript">
+    var scm_ulc = initAddress($(".address_info"));
+
+    var is_update = true;   //表示修改页面
+    
+    $(function () {
+        var orderId = $("#orderId").val();
+        if(orderId == null || orderId == ""){
+            layer.msg('修改页面获取数据失败,请重试!',{icon: 5,time:2000});
+            return false;
+        }
+        var scmOrderInfo = new Object();
+        scmOrderInfo.orderId = orderId;
+        getOrder(scmOrderInfo);
+    });
+
+    $("#orderNo").blur(function(){
+        showOldOrder();
+    });
+</script>
+
+
+<script type="text/javascript" charset="utf-8" src="${path}/common/js/scmOrder/scmOrder.js"></script>
+
+
+</body>
+</html>

+ 24 - 2
watero-rst-web/src/main/webapp/common/js/common/UnlimitedLevelContact.js

@@ -199,12 +199,23 @@
                 upperLevelId = ulc.options.ulcLevel[level-1].ulcId;
             }
 
+            //判断第二个参数是否为数组
+            var openList = new Array();
+            if(arguments[1].constructor == Array){
+                openList.push(level);
+                for(var k=0;k<arguments[1].length;k++){
+                    openList.push(arguments[1][k]);
+                }
+            }else{
+                openList = arguments;
+            }
+
             /*此后数据加载为 以名称为主*/
             ulc.setMasterData(level,1);
 
             /*将后续参数赋值到id中去*/
             for(var i=0; i<ulc.options.ulcLevel.length-level; i++){
-                ulc.options.ulcLevel[i+level].ulcId = arguments[i+1];
+                ulc.options.ulcLevel[i+level].ulcId = openList[i+1];
             }
 
             if(ulc.options.ulcLevel[level].isLoad){
@@ -236,12 +247,23 @@
                 upperLevelId = ulc.options.ulcLevel[level-1].ulcId;
             }
 
+            //判断第二个参数是否为数组
+            var openList = new Array();
+            if(arguments[1].constructor == Array){
+                openList.push(level);
+                for(var k=0;k<arguments[1].length;k++){
+                    openList.push(arguments[1][k]);
+                }
+            }else{
+                openList = arguments;
+            }
+
             /*此后数据加载为 以名称为主*/
             ulc.setMasterData(level,2);
 
             /*将后续参数赋值到name中去*/
             for(var i=0; i<ulc.options.ulcLevel.length-level; i++){
-                ulc.options.ulcLevel[i+level].ulcName = arguments[i+1];
+                ulc.options.ulcLevel[i+level].ulcName = openList[i+1];
             }
 
             if(ulc.options.ulcLevel[level].isLoad){

+ 11 - 2
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -462,12 +462,21 @@ function initProcessResult(procMethodIsBack,procMethodIsSend){
 
         if((procMethodIsBack == 2 && procMethodIsSend == 2)){ //不需要寄回,不需要寄出就是 已解决,未解决
             visitByType(1);
-            isNeedSelectOrder = 2
+            isNeedSelectOrder = 2;
+        }else{
+            isNeedSelectOrder = 1;
+        }
+
+        if(procMethodIsBack == 1 || procMethodIsSend == 1){
+            var produceType =  $("input[name='typeId']:checked").val();
+            if(produceType == 1){
+                isNeedSelectOrder = 2;
+            }
         }
 
         var promType = $("#procTypeId").val() //查看是否为维修
         if(promType == 3){
-            $("#customerCostsDiv").hide();  //工厂报价
+            $("#customerCostsDiv").show();  //工厂报价
         }
 
         if((procMethodIsBack == 1 || procMethodIsSend == 1) && isNeedSelectOrder == 1){  //是否有订单

+ 6 - 6
watero-rst-web/src/main/webapp/common/js/product/product.js

@@ -46,7 +46,7 @@ $(function(){
     $("#fileId_0").change(function() {
         fileUpload("fileId_0");
     });
-})
+});
 
 $(function(){
     var loadIndex = 0;
@@ -73,15 +73,15 @@ $(function(){
                 $(this).find("input").each(function(){
                     var inputName = $(this).attr("name");
                     color[inputName] = $(this).val()
-                })
+                });
 
                 $(this).find("select").each(function(){
                     var inputName = $(this).attr("name");
                     color[inputName] = $(this).val()
-                })
+                });
 
                 colorList.push(color);
-            })
+            });
 
             $("#colorListJson").val(JSON.stringify(colorList));
 
@@ -127,10 +127,10 @@ function fileUpload(idValue) {
                 var html = '<img style="width: 75px;" src="'+ url_path + data.returnMsg.imgUrl +'"  class="del_product all_down" onclick="fileOnclick(this)">';
                 $("#"+idValue).parent().find(".download_file").html(html);
                 // $("#"+idValue).parent().find(".colorPicture").val(data.returnMsg.imgUrl);
-                $("#xxx").val(data.returnMsg.imgUrl);
+
+            }             $("#xxx").val(data.returnMsg.imgUrl);
             }else{
                 layer.msg('上传失败,请重试!',{icon: 5,time:2000});
             }
         }
     });
-}

+ 320 - 0
watero-rst-web/src/main/webapp/common/js/scmOrder/scmOrder.js

@@ -0,0 +1,320 @@
+var allCustomerId = "";
+
+var upload_file_id = 0;
+
+/* add = 添加    update = 修改*/
+var isAddOrUpDate = "add";
+var $isUpDateNode;   //当isAddOrUpDate = update 的时候才会有值
+
+/**
+ * 打开商品列表
+ */
+function add_product() {
+    isAddOrUpDate ="add";
+    layer_show("商品列表",url_path + "/admin/salesOrder/to_add_product?productType=1&productName=定制牙刷","1000","500");
+}
+
+$(function(){
+    var loadIndex = 0;
+    $("#form-order-add").Validform({
+        tiptype: function (msg, o, cssctl) {
+            if (o.type == 3) {//失败
+                layer.msg(msg, {icon: 5, time: 3000});
+                $(window).scrollTop(o.obj.offset().top - 40);
+            }
+        },
+        datatype: {//自定义验证类型
+        },
+        ignoreHidden: true,
+        tipSweep: true, //若为true,则只在表单提交时验证
+        ajaxPost: true, //异步提交
+        beforeCheck: function (curform) {  //验证通过之前执行的函数
+            var flag = false;
+        },
+        beforeSubmit: function (curform) {  //验证通过之后执行的函数
+            var addressProvince = $("#addressProvince").find("option:selected").text();
+            var addressCity = $("#addressCity").find("option:selected").text();
+            var addressCountry = $("#addressCountry").find("option:selected").text();
+            var addressDesc = $("#addressDesc").val();
+            var salesAddressInfo = addressProvince + " " + addressCity + " " + addressCountry + " " + addressDesc;
+            $("#orderAddressInfo").val(salesAddressInfo);
+
+            var flag = false;
+            var fileUpload = true;
+            /*封装订单项*/
+            var orderItemArray = new Array();
+            $("#add_product").find("tr").each(function(){
+                var orderItem = new Object();
+                orderItem.orderItemColorId = $(this).find(".color_id").val();
+                orderItem.orderItemNum = $(this).find(".item-num").val();
+                orderItem.orderItemDesignPreview = $(this).find(".upload_path_img").val();
+                orderItem.orderItemDesignPath = $(this).find(".upload_path_view").val();
+                orderItem.orderItemDesignName = $(this).find(".orderItemDesignName").val();
+                orderItemArray.push(orderItem);
+                flag = true;
+
+                if($(this).find(".add_file").length < 2){
+                    fileUpload = false;
+                }
+            });
+            if(!flag){
+                vailErrorMsg($(".add-order-button"),"必须要有一个产品");
+                return false;
+            }
+
+            if(!fileUpload){
+                vailErrorMsg($(".add-order-button"),"产品需要上传设计文件和预览图片");
+                return false;
+            }
+
+            $("#orderItemString").val(JSON.stringify(orderItemArray));
+
+            loadIndex = layer.load(1, {
+                shade: [0.5,'#fff'] //0.1透明度的白色背景
+            });
+        },
+        callback: function (data) {//异步回调函数
+            if (data) {
+                var index = layer.alert(data.resultMsg, function (index) {
+                    if (data.resultCode == 200) {
+                        location.href = url_path + "/admin/scm_order/order_list";
+                    }else {
+                        layer.close(index);
+                    }
+                });
+                if(loadIndex != 0 ){
+                    layer.close(loadIndex);
+                }
+            }
+            return false;
+        }
+    });
+});
+
+/**
+ * 选择商品回调
+ * @param colorIds
+ */
+function setSelectProduct(colorIds){
+    var index = layer.load(1, {
+        shade: [0.5,'#fff'] //0.1透明度的白色背景
+    });
+
+    $("#all_add_product").show();
+
+    var colorIdArray = colorIds.split("_");
+    for(var i=0;i<colorIdArray.length;i++){
+        var colorId = colorIdArray[i];
+        if(colorId == ""){
+            break;
+        }
+
+        var flag = true;
+        $("#add_product").find("tr").each(function (){
+            var colId = $(this).find(".color_id").eq(0).val();
+            if(colId == colorId){
+                flag  = false;
+            }
+        });
+        if(!flag){
+            continue;
+        }
+        $.ajax({
+            type: "POST",
+            data: { colorId : colorId},
+            url: url_path +"/admin/product/get_product",
+            success: function(data){
+
+                if (data.returnCode == 200 && data.returnMsg.productColorList.length > 0 ) {
+                    for(var i=0;i<data.returnMsg.productColorList.length;i++){
+                        var productColor = data.returnMsg.productColorList[i];
+
+                        if(isAddOrUpDate == "update"){
+                            $isUpDateNode.parents("tr").find("input.color_id").value();
+                            $isUpDateNode.parents("tr").find("td").eq(0);
+                        }
+
+                        var viewIdValue = 'fileId_view_' + upload_file_id ;
+                        var designIdValue = 'fileId_design_' + upload_file_id ;
+                        upload_file_id++;
+
+                        var html = '<tr class="text-c">' +
+                            '<input type="hidden" class="color_id" id="" value="'+ productColor.colorId +'" >' +
+                            ' <td>'+ cufte(productColor.productName) +'</td>' +
+                            ' <td>'+ cufte(productColor.colorName) +'</td>' +
+                            ' <td style="width: 20px;"><input type="text" class="input-text input-number item-num" value="1"  style="width: 100%;text-align: center;" name="" id="" placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>' +
+
+                            ' <td>' +
+                            '   <input type="file" class="up_file" name="file" upload_type="file" id="'+ designIdValue +'" style="display: none">' +
+                            '   <div class="upload_file"><a href="javascript:void(0)" class="del_product all_down"  onclick="fileOnclick(this)">上传设计文件</a></div>'+
+                            '   <input type="hidden" class="upload_path_view upload_path" name="" id="" value="" >'+
+                            '   <input type="hidden" class="orderItemDesignName" name="orderItemDesignName" id="" value="" >'+
+                            ' </td>' +
+
+                            ' <td>' +
+                            '   <input type="file" class="up_file" name="file" upload_type="img" id="'+ viewIdValue +'" style="display: none">' +
+                            '   <div class="upload_file"><a href="javascript:void(0)" class="del_product all_down"  onclick="fileOnclick(this)">上传预览图</a></div>'+
+                            '   <input type="hidden" class="upload_path_img upload_path" name="" id="" value="" >'+
+                            ' </td>' +
+
+                            ' <td>' +
+                            '  <a href="javascript:void(0)" class="del_product all_down" onclick="updateProduct($(this))" >修改</a>' +
+                            '  <a href="javascript:void(0)" class="del_product all_down" onclick="delProduct($(this))" >删除</a>' +
+                            ' </td>' +
+
+                            ' </tr>';
+
+                        $("#add_product").append(html);
+
+                        $("#"+designIdValue).change(function() {
+                            fileUpload(designIdValue);
+                        });
+                        $("#"+viewIdValue).change(function() {
+                            fileUpload(viewIdValue);
+                        });
+                    }
+                }else{
+                    html = '<tr class="text-c"><td colspan="12">没有搜索到商品,请重试!</td></tr>';
+                }
+            }
+        });
+    }
+    layer.close(index);
+}
+
+/**
+ *  删除商品
+ */
+function delProduct($this){
+    $this.parents("tr").remove();
+}
+
+/**
+ *  修改商品
+ */
+function updateProduct($this){
+    isAddOrUpDate ="update";
+    $isUpDateNode = $($this);
+    layer_show("商品列表",url_path + "/admin/salesOrder/to_add_product?productType=1&productName=定制牙刷&isRadio=1","1000","500");
+}
+
+function fileOnclick(node){
+    $(node).parent().siblings('.up_file').click();
+}
+
+function fileUpload(idValue) {
+    $.ajaxFileUpload({
+        url:"/admin/scm_order/fileUpload",
+        secureuri:false,
+        fileElementId : idValue,//文件选择框的id属性/名称
+        dataType: 'json',   //json
+        success: function (data) {
+            if(data.returnCode == 200){
+                var type = $("#"+idValue).attr("upload_type");
+                if(type == "img"){
+                    var html = '<img style="width: 75px;" src="'+ url_path + root_path + data.returnMsg.allImgUrl +'"  class="del_product  add_file">'+
+                        '<br><a href="javascript:void(0)" class="del_product all_down"  onclick="fileOnclick(this)">重新上传</a>';
+                    $("#"+idValue).parent().find(".upload_file").html(html);
+
+                    $("#"+idValue).change(function() {
+                        fileUpload(idValue);
+                    });
+                }else{  //type == "file"
+                    var html = '<span onclick="fileOnclick(this)" class="add_file" style="cursor: pointer;">'+ data.returnMsg.oldName +'</span>'+
+                        '<br><a href="javascript:void(0)" class="del_product all_down"  onclick="fileOnclick(this)">重新上传</a>';
+                    $("#"+idValue).parent().find(".upload_file").html(html);
+
+                    $("#"+idValue).change(function() {
+                        fileUpload(idValue);
+                    });
+                    $("#"+idValue).parent().find(".orderItemDesignName").val(data.returnMsg.oldName);
+                }
+                $("#"+idValue).parent().find(".upload_path").val(data.returnMsg.imgUrl);
+            }else{
+                layer.msg('上传失败,请重试!',{icon: 5,time:2000});
+            }
+        }
+    });
+}
+
+/**
+ * 修改页面,或者 输入订单编号,赋值
+ */
+function getOrder(scmOrderInfo) {
+    $.ajax({
+        type: "POST",
+        data: scmOrderInfo,
+        url: url_path +"/admin/scm_order/get_order",
+        success: function(data){
+            if (data.returnCode == 200) {
+                var scmOrderInfo = data.returnMsg.scmOrderInfoList[0];
+
+                $("#orderNo").val(scmOrderInfo.orderNo);
+                $("#orderAddressName").val(scmOrderInfo.orderAddressName);
+                $("#orderAddressTel").val(scmOrderInfo.orderAddressTel);
+                $("#orderPostFirm").val(scmOrderInfo.orderPostFirm);
+
+                var scmAddress = scmOrderInfo.orderAddressInfo;
+                if(scmAddress != null && scmAddress!=""){
+                    var scm_address = scmAddress.split(" ");
+                    if(scm_address.length > 2){
+                        scm_ulc.setUlcByName(0,scm_address);
+                        var addressInfo  = scmAddress.substring(scmAddress.indexOf(scm_address[2])+scm_address[2].length,scmAddress.length);
+                        $("#addressDesc").text(addressInfo);
+                    }
+                }
+                $("#orderUserRemark").text(scmOrderInfo.orderUserRemark);
+
+                //订单项
+                $("#all_add_product").show();
+                for (var i=0;i<scmOrderInfo.scmOrderItemList.length;i++){
+                    var viewIdValue = 'fileId_view_' + upload_file_id ;
+                    var designIdValue = 'fileId_design_' + upload_file_id ;
+
+                    var scmOrderItem = scmOrderInfo.scmOrderItemList[i];
+                    var name = scmOrderItem.orderItemDesignName;
+                    if(!isEmpty(scmOrderItem.orderItemDesignName)){
+                        name="暂无设计文件";
+                    }
+                    var html = '<tr class="text-c">'
+                        +'<input type="hidden" class="color_id" id="" value="'+ scmOrderItem.orderItemColorId +'"> '
+                        +'<td>'+ scmOrderItem.orderItemProductName +'</td> <td>'+ scmOrderItem.orderItemColorName +'</td>'
+                        +'<td style="width: 20px;"> <input type="text" class="input-text input-number item-num" value="'+ scmOrderItem.orderItemNum +'" style="width: 100%;text-align: center;" name="" id="" placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>'
+                        +'<td>'
+                        +'<input type="file" class="up_file" name="file" upload_type="file" id="'+ designIdValue +'" style="display: none">'
+                        +'<div class="upload_file"><span onclick="fileOnclick(this)" class="add_file" style="cursor: pointer;">'+ name +'</span><br><a href="javascript:void(0)" class="del_product all_down" onclick="fileOnclick(this)">重新上传</a></div> '
+                        +'<input type="hidden" class="upload_path_view upload_path" name="" id="" value="'+ scmOrderItem.orderItemDesignPath +'" > '
+                        +'<input type="hidden" class="orderItemDesignName" name="" id="" value="'+ scmOrderItem.orderItemDesignName +'" > '
+                        +'</td>'
+                        +'<td> '
+                        +'<input type="file" class="up_file" name="file" upload_type="img" id="'+ viewIdValue +'" style="display: none">'
+                        +'<div class="upload_file"><img style="width: 75px;" src="/'+ scmOrderItem.orderItemDesignPreview +'" class="del_product  add_file"><br><a href="javascript:void(0)" class="del_product all_down" onclick="fileOnclick(this)">重新上传</a></div>'
+                        +'<input type="hidden" class="upload_path_img upload_path" name="" id="" value="'+ scmOrderItem.orderItemDesignPreview +'">'
+                        +'</td>'
+                        +'<td>  <a href="javascript:void(0)" class="del_product all_down" onclick="updateProduct($(this))">修改</a>  <a href="javascript:void(0)" class="del_product all_down" onclick="delProduct($(this))">删除</a> </td> </tr>';
+                    $("#add_product").append(html);
+                    upload_file_id++;
+
+                    $("#"+designIdValue).change(function() {
+                        fileUpload(designIdValue);
+                    });
+                    $("#"+viewIdValue).change(function() {
+                        fileUpload(viewIdValue);
+                    });
+                }
+            }else{
+                layer.msg('查询数据失败,请重试!',{icon: 5,time:2000});
+            }
+        }
+    });
+}
+
+/**
+ * 通过输入的订单编号展示以前的订单,并且赋值
+ */
+function showOldOrder() {
+    var orderNo = $("#orderNo").val();
+    var scmOrderInfo = new Object();
+    scmOrderInfo.orderNo = orderNo;
+    getOrder(scmOrderInfo);
+}