Jelajahi Sumber

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

# Conflicts:
#	watero-rst-core/src/main/java/com.iamberry.rst.core/tools/KuaiDi100.java
wangxiaoming 5 tahun lalu
induk
melakukan
ba2b020346
66 mengubah file dengan 4429 tambahan dan 671 penghapusan
  1. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerInfo.java
  2. 97 4
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Postage.java
  3. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/PostageAuthorityLog.java
  4. 67 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/PostageInfo.java
  5. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintAfterSalesNum.java
  6. 10 1
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/SignclosedProductInfo.java
  7. 45 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/OrderStatisticsInfo.java
  8. 74 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/pts/ProductionEmployees.java
  9. 132 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/pts/ProductionPlan.java
  10. 83 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/pts/ProductionProcess.java
  11. 18 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/pts/PtsEmployee.java
  12. 6 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/PostageService.java
  13. 8 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/SalesOrderService.java
  14. 59 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/ProductionPlanService.java
  15. 57 10
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java
  16. 5 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/PostageServiceImpl.java
  17. 109 88
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java
  18. 14 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/PostageMapper.java
  19. 8 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/SalesOrderMapper.java
  20. 46 5
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml
  21. 2 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/postageAuthorityLogMapper.xml
  22. 50 7
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/postageMapper.xml
  23. 27 2
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml
  24. 13 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintSignclosedInfoServiceImpl.java
  25. 3 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/complaintSignclosedInfoMapper.xml
  26. 137 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/ProductionPlanServiceImpl.java
  27. 30 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/PtsEmployeeServiceImpl.java
  28. 51 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/ProductionPlanningMapper.java
  29. 235 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/productionPlanningMapper.xml
  30. 2 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/sys/mapper/sysMapper.xml
  31. 11 3
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
  32. 78 22
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminPostageController.java
  33. 1 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/kuaidi/LogisticsController.java
  34. 24 34
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/mq/MQTask.java
  35. 37 53
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminOrderController.java
  36. 159 77
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminSalesOrderController.java
  37. 16 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AwaitSendController.java
  38. 53 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminPtsEmployeeController.java
  39. 342 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/ProductionPlanController.java
  40. 6 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/sys/LoginController.java
  41. 6 4
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/sys/SysController.java
  42. 6 0
      watero-rst-web/src/main/resources/watero-rst-orm.xml
  43. 5 4
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl
  44. 41 27
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_list.ftl
  45. 21 4
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/order_list.ftl
  46. 7 7
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_customer.ftl
  47. 433 97
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_relation.ftl
  48. 9 105
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/postage/postage_list.ftl
  49. 155 18
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/associated_customer.ftl
  50. 27 11
      watero-rst-web/src/main/webapp/WEB-INF/views/home/pc_index.ftl
  51. 5 27
      watero-rst-web/src/main/webapp/WEB-INF/views/order/excel_to_order_new.ftl
  52. 2 1
      watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/add_order.ftl
  53. 252 0
      watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_check_list.ftl
  54. 31 2
      watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_list.ftl
  55. 12 8
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/employee_list.ftl
  56. 2 2
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/save_employee.ftl
  57. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/update_employee.ftl
  58. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl
  59. 284 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/add_productionPlan.ftl
  60. 124 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/employee_list.ftl
  61. 267 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/perfect_productionPlan.ftl
  62. 150 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/productionPlan_List.ftl
  63. 139 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/productionPlan_statistical.ftl
  64. 276 0
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/update_productionPlan.ftl
  65. 10 31
      watero-rst-web/src/main/webapp/common/js/customer/customer.js
  66. 18 7
      watero-rst-web/src/main/webapp/common/js/salesOrder/salesOrder.js

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerInfo.java

@@ -205,6 +205,8 @@ public class CustomerInfo  implements Serializable {
     private Integer customerTagId;//标记id
     private String tagDesc;//标记内容
     private Integer tagFlag;//标记旗帜1红、2黄、3绿、4蓝、5紫
+
+    private String detectNumber;//维修编号
     public Date getVisitDate() {
         return visitDate;
     }
@@ -1110,4 +1112,12 @@ public class CustomerInfo  implements Serializable {
     public void setTagFlag(Integer tagFlag) {
         this.tagFlag = tagFlag;
     }
+
+    public String getDetectNumber() {
+        return detectNumber;
+    }
+
+    public void setDetectNumber(String detectNumber) {
+        this.detectNumber = detectNumber;
+    }
 }

+ 97 - 4
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Postage.java

@@ -30,8 +30,8 @@ public class Postage implements Serializable {
     private Integer postageOrderSource;
     //售后处理方式 3:换新  4:维修  5:补发  6:退货  7:无理由退货
     private Integer postageTreatmentMethod;
-    //efast订单号
-    private String salesOrderId;
+    //客诉关联订单号
+    private Integer salesOrderId;
     //客户姓名
     private String postageClientName;
     //联系电话
@@ -68,9 +68,22 @@ public class Postage implements Serializable {
     private Integer financeManager;    //财务审核权限   1有权限
     private Integer financePay;    //财务转账         1有权限
 
+    private Integer customerPostageId;    //邮费信息id
+
     //邮费转账日志记录
     private List<PostageAuthorityLog> postageAuthorityLogList = new ArrayList<PostageAuthorityLog>();
 
+    private String postageCoding;//审批编码
+    private Date postageCustomerTime;//客服经理审核时间
+    private Date postageFinanceTime;//财务经理审核时间
+    private String questionTitle;//退换货原因
+    private Integer postagePayType;//1支付宝2微信3银行卡
+    private String postagePayWhere;//开户行
+    private String procTypeName; //处理方式类型名称
+    private String procMethodName; //处理方式名称
+
+    private Integer postageIsPrint;//是否已打印1:未打印2:已打印
+
     public Integer getPostageId() {
         return postageId;
     }
@@ -127,11 +140,11 @@ public class Postage implements Serializable {
         this.postageTreatmentMethod = postageTreatmentMethod;
     }
 
-    public String getSalesOrderId() {
+    public Integer getSalesOrderId() {
         return salesOrderId;
     }
 
-    public void setSalesOrderId(String salesOrderId) {
+    public void setSalesOrderId(Integer salesOrderId) {
         this.salesOrderId = salesOrderId;
     }
 
@@ -310,4 +323,84 @@ public class Postage implements Serializable {
     public void setPostageAuthorityLogList(List<PostageAuthorityLog> postageAuthorityLogList) {
         this.postageAuthorityLogList = postageAuthorityLogList;
     }
+
+    public Integer getCustomerPostageId() {
+        return customerPostageId;
+    }
+
+    public void setCustomerPostageId(Integer customerPostageId) {
+        this.customerPostageId = customerPostageId;
+    }
+
+    public String getPostageCoding() {
+        return postageCoding;
+    }
+
+    public void setPostageCoding(String postageCoding) {
+        this.postageCoding = postageCoding;
+    }
+
+    public Date getPostageCustomerTime() {
+        return postageCustomerTime;
+    }
+
+    public void setPostageCustomerTime(Date postageCustomerTime) {
+        this.postageCustomerTime = postageCustomerTime;
+    }
+
+    public Date getPostageFinanceTime() {
+        return postageFinanceTime;
+    }
+
+    public void setPostageFinanceTime(Date postageFinanceTime) {
+        this.postageFinanceTime = postageFinanceTime;
+    }
+
+    public String getQuestionTitle() {
+        return questionTitle;
+    }
+
+    public void setQuestionTitle(String questionTitle) {
+        this.questionTitle = questionTitle;
+    }
+
+    public Integer getPostagePayType() {
+        return postagePayType;
+    }
+
+    public void setPostagePayType(Integer postagePayType) {
+        this.postagePayType = postagePayType;
+    }
+
+    public String getPostagePayWhere() {
+        return postagePayWhere;
+    }
+
+    public void setPostagePayWhere(String postagePayWhere) {
+        this.postagePayWhere = postagePayWhere;
+    }
+
+    public String getProcTypeName() {
+        return procTypeName;
+    }
+
+    public void setProcTypeName(String procTypeName) {
+        this.procTypeName = procTypeName;
+    }
+
+    public String getProcMethodName() {
+        return procMethodName;
+    }
+
+    public void setProcMethodName(String procMethodName) {
+        this.procMethodName = procMethodName;
+    }
+
+    public Integer getPostageIsPrint() {
+        return postageIsPrint;
+    }
+
+    public void setPostageIsPrint(Integer postageIsPrint) {
+        this.postageIsPrint = postageIsPrint;
+    }
 }

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/PostageAuthorityLog.java

@@ -20,6 +20,8 @@ public class PostageAuthorityLog  implements  Serializable{
     //审核创建时间'
     private Date authorityLogCreateTime;
 
+    private String adminName;
+
     public Integer getAuthorityLogId(){
         return authorityLogId;
     }
@@ -59,4 +61,12 @@ public class PostageAuthorityLog  implements  Serializable{
     public void setAuthorityLogCreateTime(Date  authorityLogCreateTime){
         this.authorityLogCreateTime=authorityLogCreateTime;
     }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
 }

+ 67 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/PostageInfo.java

@@ -21,6 +21,17 @@ public class PostageInfo implements Serializable{
     private String postageDesc;//备注
     private Date postageCreateTime;//创建时间
     private Date postageUpdateTime;//修改时间
+    private Integer postagePayType;//1支付宝2微信3银行卡
+    private String postagePayWhere;//开户行
+    //状态(客服操作)1:待申请    2:申请中
+    private Integer postageCustomerStatus;
+    //状态(客服经理审核)1:审核中 2:通过  3:驳回
+    private Integer postageManagerStatus;
+    //状态(财务审核) 1:审核中 2:通过(已申请待转账)  3:驳回
+    private Integer postageFinanceStatus;
+    //转账状态  是否转账:1待转   2:已转
+    private Integer postageTransferStatus;
+    private Integer postId;//审核付费记录id
 
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
@@ -167,4 +178,60 @@ public class PostageInfo implements Serializable{
     public void setCustomerCreateTime(Date customerCreateTime) {
         this.customerCreateTime = customerCreateTime;
     }
+
+    public Integer getPostagePayType() {
+        return postagePayType;
+    }
+
+    public void setPostagePayType(Integer postagePayType) {
+        this.postagePayType = postagePayType;
+    }
+
+    public String getPostagePayWhere() {
+        return postagePayWhere;
+    }
+
+    public void setPostagePayWhere(String postagePayWhere) {
+        this.postagePayWhere = postagePayWhere;
+    }
+
+    public Integer getPostageCustomerStatus() {
+        return postageCustomerStatus;
+    }
+
+    public void setPostageCustomerStatus(Integer postageCustomerStatus) {
+        this.postageCustomerStatus = postageCustomerStatus;
+    }
+
+    public Integer getPostageManagerStatus() {
+        return postageManagerStatus;
+    }
+
+    public void setPostageManagerStatus(Integer postageManagerStatus) {
+        this.postageManagerStatus = postageManagerStatus;
+    }
+
+    public Integer getPostageFinanceStatus() {
+        return postageFinanceStatus;
+    }
+
+    public void setPostageFinanceStatus(Integer postageFinanceStatus) {
+        this.postageFinanceStatus = postageFinanceStatus;
+    }
+
+    public Integer getPostageTransferStatus() {
+        return postageTransferStatus;
+    }
+
+    public void setPostageTransferStatus(Integer postageTransferStatus) {
+        this.postageTransferStatus = postageTransferStatus;
+    }
+
+    public Integer getPostId() {
+        return postId;
+    }
+
+    public void setPostId(Integer postId) {
+        this.postId = postId;
+    }
 }

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintAfterSalesNum.java

@@ -27,6 +27,8 @@ public class ComplaintAfterSalesNum implements Serializable{
 
     private Integer completeSent;//待换货发出数量
 
+    private Integer postagePrintedNum;//待打印邮费申请
+
     public Integer getTodaysignNum() {
         return todaysignNum;
     }
@@ -170,4 +172,12 @@ public class ComplaintAfterSalesNum implements Serializable{
     public void setCompleteSent(Integer completeSent) {
         this.completeSent = completeSent;
     }
+
+    public Integer getPostagePrintedNum() {
+        return postagePrintedNum;
+    }
+
+    public void setPostagePrintedNum(Integer postagePrintedNum) {
+        this.postagePrintedNum = postagePrintedNum;
+    }
 }

+ 10 - 1
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/SignclosedProductInfo.java

@@ -17,7 +17,7 @@ public class SignclosedProductInfo implements Serializable {
     private Integer productNum;//产品数量
     private Date signclosedCreateTime;//创建时间
     private Date signclosedUpdateTime;//修改时间
-    private Integer signclosedProductType;//1 产品  2配件
+    private Integer signclosedProductType;
     private Integer signclosedProductId;//关联产品id  (根据产品类型判断)
     private Integer signclosedProductColor;//关联产品颜色id
     private String machineNo;//机器编号
@@ -27,6 +27,7 @@ public class SignclosedProductInfo implements Serializable {
     private String colorBar;//产品sku
     private Integer colorPrice;//产品价格
     private String signclosedLogisticsNumber;//物流单号
+    private String productTypeName;//产品型号名称
 
     public Integer getProductId() {
         return productId;
@@ -155,4 +156,12 @@ public class SignclosedProductInfo implements Serializable {
     public void setSignclosedLogisticsNumber(String signclosedLogisticsNumber) {
         this.signclosedLogisticsNumber = signclosedLogisticsNumber;
     }
+
+    public String getProductTypeName() {
+        return productTypeName;
+    }
+
+    public void setProductTypeName(String productTypeName) {
+        this.productTypeName = productTypeName;
+    }
 }

+ 45 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/OrderStatisticsInfo.java

@@ -22,6 +22,11 @@ public class OrderStatisticsInfo implements Serializable {
     private Integer invalidType;//作废类型 1通知配货后作废 2打单后作废 3出库后作废
     private Integer warehouseId;//发货出库id
     private String logisticsName;//快递名称
+    private Integer num;//数量
+    private Date checkStartDate;//核对开始时间
+    private Date pickingStartDate;//拣货开始时间
+    private String colorName;//颜色名称
+    private String productName;//产品名称
 
     public Date getOrderDate() {
         return orderDate;
@@ -141,4 +146,44 @@ public class OrderStatisticsInfo implements Serializable {
     public void setLogisticsName(String logisticsName) {
         this.logisticsName = logisticsName;
     }
+
+    public Integer getNum() {
+        return num;
+    }
+
+    public void setNum(Integer num) {
+        this.num = num;
+    }
+
+    public Date getCheckStartDate() {
+        return checkStartDate;
+    }
+
+    public void setCheckStartDate(Date checkStartDate) {
+        this.checkStartDate = checkStartDate;
+    }
+
+    public Date getPickingStartDate() {
+        return pickingStartDate;
+    }
+
+    public void setPickingStartDate(Date pickingStartDate) {
+        this.pickingStartDate = pickingStartDate;
+    }
+
+    public String getColorName() {
+        return colorName;
+    }
+
+    public void setColorName(String colorName) {
+        this.colorName = colorName;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
 }

+ 74 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/ProductionEmployees.java

@@ -0,0 +1,74 @@
+package com.iamberry.rst.core.pts;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 生产计划员工项表
+ */
+public class ProductionEmployees implements Serializable {
+    private static final long serialVersionUID = -277668524468599800L;
+    private Integer prpeId;
+    private Integer pePlanId;//工作计划id
+    private Integer peEmployeeId;//员工id
+    private Date peUpdateTime;
+    private Date peCreateTime;
+    private String peEmployeeName;//员工姓名
+    private String peEmployeeNo;//员工编号
+
+    public Integer getPrpeId() {
+        return prpeId;
+    }
+
+    public void setPrpeId(Integer prpeId) {
+        this.prpeId = prpeId;
+    }
+
+    public Integer getPePlanId() {
+        return pePlanId;
+    }
+
+    public void setPePlanId(Integer pePlanId) {
+        this.pePlanId = pePlanId;
+    }
+
+    public Integer getPeEmployeeId() {
+        return peEmployeeId;
+    }
+
+    public void setPeEmployeeId(Integer peEmployeeId) {
+        this.peEmployeeId = peEmployeeId;
+    }
+
+    public Date getPeUpdateTime() {
+        return peUpdateTime;
+    }
+
+    public void setPeUpdateTime(Date peUpdateTime) {
+        this.peUpdateTime = peUpdateTime;
+    }
+
+    public Date getPeCreateTime() {
+        return peCreateTime;
+    }
+
+    public void setPeCreateTime(Date peCreateTime) {
+        this.peCreateTime = peCreateTime;
+    }
+
+    public String getPeEmployeeName() {
+        return peEmployeeName;
+    }
+
+    public void setPeEmployeeName(String peEmployeeName) {
+        this.peEmployeeName = peEmployeeName;
+    }
+
+    public String getPeEmployeeNo() {
+        return peEmployeeNo;
+    }
+
+    public void setPeEmployeeNo(String peEmployeeNo) {
+        this.peEmployeeNo = peEmployeeNo;
+    }
+}

+ 132 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/ProductionPlan.java

@@ -0,0 +1,132 @@
+package com.iamberry.rst.core.pts;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 生产计划表
+ */
+public class ProductionPlan implements Serializable {
+    private static final long serialVersionUID = -7727638297170439411L;
+    private Integer planId;
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date planDate;//工作日期
+    private Integer planProcessId;//工序id
+    private String planStay;//拉线
+    private Double planWorkHours;//工作时长
+    private Integer planResults;//工作成果
+    private Date planCreateTime;
+    private Date planUpdateTime;
+
+    private String processName;//工序名称
+    private Integer employeesNum;//员工数量
+    private String employeeString;//员工id集合 _线隔开
+    private Integer processWorkinghours;//每人每小时数量
+    private Integer employeeId;//员工id
+    public Integer getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(Integer planId) {
+        this.planId = planId;
+    }
+
+    public Date getPlanDate() {
+        return planDate;
+    }
+
+    public void setPlanDate(Date planDate) {
+        this.planDate = planDate;
+    }
+
+    public Integer getPlanProcessId() {
+        return planProcessId;
+    }
+
+    public void setPlanProcessId(Integer planProcessId) {
+        this.planProcessId = planProcessId;
+    }
+
+    public String getPlanStay() {
+        return planStay;
+    }
+
+    public void setPlanStay(String planStay) {
+        this.planStay = planStay;
+    }
+
+    public Double getPlanWorkHours() {
+        return planWorkHours;
+    }
+
+    public void setPlanWorkHours(Double planWorkHours) {
+        this.planWorkHours = planWorkHours;
+    }
+
+    public Integer getPlanResults() {
+        return planResults;
+    }
+
+    public void setPlanResults(Integer planResults) {
+        this.planResults = planResults;
+    }
+    public Date getPlanCreateTime() {
+        return planCreateTime;
+    }
+
+    public void setPlanCreateTime(Date planCreateTime) {
+        this.planCreateTime = planCreateTime;
+    }
+
+    public Date getPlanUpdateTime() {
+        return planUpdateTime;
+    }
+
+    public void setPlanUpdateTime(Date planUpdateTime) {
+        this.planUpdateTime = planUpdateTime;
+    }
+
+    public String getProcessName() {
+        return processName;
+    }
+
+    public void setProcessName(String processName) {
+        this.processName = processName;
+    }
+
+    public Integer getEmployeesNum() {
+        return employeesNum;
+    }
+
+    public void setEmployeesNum(Integer employeesNum) {
+        this.employeesNum = employeesNum;
+    }
+
+    public String getEmployeeString() {
+        return employeeString;
+    }
+
+    public void setEmployeeString(String employeeString) {
+        this.employeeString = employeeString;
+    }
+
+    public Integer getProcessWorkinghours() {
+        return processWorkinghours;
+    }
+
+    public void setProcessWorkinghours(Integer processWorkinghours) {
+        this.processWorkinghours = processWorkinghours;
+    }
+
+    public Integer getEmployeeId() {
+        return employeeId;
+    }
+
+    public void setEmployeeId(Integer employeeId) {
+        this.employeeId = employeeId;
+    }
+}

+ 83 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/ProductionProcess.java

@@ -0,0 +1,83 @@
+package com.iamberry.rst.core.pts;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 生产管理工序表
+ */
+public class ProductionProcess implements Serializable{
+    private static final long serialVersionUID = -3296263203529211154L;
+    private Integer processId;
+    private String processName;//工序名称
+    private Integer processWorkinghours;//每人每小时数量
+    private String processUnit;//单位
+    private Integer processStatus;//工序状态
+    private String processNo;//工序编号
+    private Date processCreateTime;
+    private Date processUpdateTime;
+
+    public Integer getProcessId() {
+        return processId;
+    }
+
+    public void setProcessId(Integer processId) {
+        this.processId = processId;
+    }
+
+    public String getProcessName() {
+        return processName;
+    }
+
+    public void setProcessName(String processName) {
+        this.processName = processName;
+    }
+
+    public Integer getProcessWorkinghours() {
+        return processWorkinghours;
+    }
+
+    public void setProcessWorkinghours(Integer processWorkinghours) {
+        this.processWorkinghours = processWorkinghours;
+    }
+
+    public String getProcessUnit() {
+        return processUnit;
+    }
+
+    public void setProcessUnit(String processUnit) {
+        this.processUnit = processUnit;
+    }
+
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
+
+    public String getProcessNo() {
+        return processNo;
+    }
+
+    public void setProcessNo(String processNo) {
+        this.processNo = processNo;
+    }
+
+    public Date getProcessCreateTime() {
+        return processCreateTime;
+    }
+
+    public void setProcessCreateTime(Date processCreateTime) {
+        this.processCreateTime = processCreateTime;
+    }
+
+    public Date getProcessUpdateTime() {
+        return processUpdateTime;
+    }
+
+    public void setProcessUpdateTime(Date processUpdateTime) {
+        this.processUpdateTime = processUpdateTime;
+    }
+}

+ 18 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/PtsEmployee.java

@@ -32,6 +32,8 @@ public class PtsEmployee implements Serializable{
     private Date employeeUpdateTime; //修改时间
 
     private String employeeLine;  //拉线
+    private Integer isJoinProcess;//是否已加入当日其他工序 1是 2 否
+    private String processName;//已加入当日其他工序名称
 
     public Integer getEmployeeId() {
         return employeeId;
@@ -136,4 +138,20 @@ public class PtsEmployee implements Serializable{
     public void setEmployeeLine(String employeeLine) {
         this.employeeLine = employeeLine;
     }
+
+    public Integer getIsJoinProcess() {
+        return isJoinProcess;
+    }
+
+    public void setIsJoinProcess(Integer isJoinProcess) {
+        this.isJoinProcess = isJoinProcess;
+    }
+
+    public String getProcessName() {
+        return processName;
+    }
+
+    public void setProcessName(String processName) {
+        this.processName = processName;
+    }
 }

+ 6 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/PostageService.java

@@ -64,4 +64,10 @@ public interface PostageService {
     Integer getPostageNumber(Postage postage);
 
 
+    /**
+     *  查询待打印条数
+     * @param
+     * @return
+     */
+    Integer getPostagePrintedNum();
 }

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

@@ -544,4 +544,12 @@ public interface SalesOrderService {
      *定时任务-查询没有揽件时间的订单
      */
     List<SalesOrder> orderAfterCaseDate();
+    /**
+     *查询拣货单信息
+     */
+    List<OrderStatisticsInfo> getPickingOrders(OrderStatisticsInfo orderStatisticsInfo);
+    /**
+     *查询核对单信息
+     */
+    List<OrderStatisticsInfo> getCheckOrders(OrderStatisticsInfo orderStatisticsInfo);
 }

+ 59 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/ProductionPlanService.java

@@ -0,0 +1,59 @@
+package com.iamberry.rst.faces.pts;
+
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.ProductionEmployees;
+import com.iamberry.rst.core.pts.ProductionPlan;
+import com.iamberry.rst.core.pts.ProductionProcess;
+
+import java.util.List;
+
+/**
+ * 生产计划管理
+ * Created by LJK on 2019年12月12日14:16:26
+ */
+public interface ProductionPlanService {
+    //获取生产计划
+    ProductionPlan getProductionPlan(Integer planId);
+
+    //添加生产计划
+    Integer addProductionPlan(ProductionPlan productionPlan);
+
+    //查询生产计划列表(分页)
+    PagedResult<ProductionPlan> listProductionPlan(PageRequest<ProductionPlan> pageRequest);
+    //查询生产计划列表
+    List<ProductionPlan> listProductionPlan(ProductionPlan productionPlan);
+
+    //修改生产计划列表
+    Integer updateProductionPlan(ProductionPlan productionPlan);
+
+    //添加生产计划员工
+    Integer addProductionEmployees(ProductionEmployees productionEmployees);
+
+    //删除单个生产计划员工
+    Integer delProductionEmployees(Integer peId);
+
+    //删除生产计划所有员工
+    Integer delProductionEmployeesList(Integer pePlanId);
+
+    //查询生产计划所有员工
+    List<ProductionEmployees> listProductionEmployees(Integer pePlanId);
+
+    //查询生产工序
+    ProductionProcess getProductionProcess(Integer processId);
+
+    //查询生产工序
+    Integer addProductionProcess(ProductionProcess productionProcess);
+
+    //查询所有生产工序
+    List<ProductionProcess> listProductionProcess(ProductionProcess productionProcess);
+
+    //删除生产计划
+    Integer delProductionPlan(Integer planId);
+
+    //获取当日工作计划条数
+    Integer getPlanCount();
+
+    //获取工序重复员工条数
+    List<ProductionPlan> getPlanRepeat(ProductionPlan productionPlan);
+}

+ 57 - 10
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -19,6 +19,7 @@ import com.iamberry.rst.service.fm.mapper.ComplaintSignclosedProductInfoMapper;
 import com.iamberry.rst.service.product.mapper.ProductMapper;
 import com.iamberry.rst.util.CustomerCommonUtil;
 import com.iamberry.rst.util.PageUtil;
+import com.iamberry.wechat.tools.TenpayUtil;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 import org.slf4j.Logger;
@@ -27,10 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 @Service
 public class CustomerServiceImpl implements CustomerService {
@@ -73,6 +72,8 @@ public class CustomerServiceImpl implements CustomerService {
     private RelationOrderMapper relationOrderMapper;
     @Autowired
     private ComplaintSignclosedProductInfoMapper complaintSignclosedProductInfoMapper;
+    @Autowired
+    private PostageMapper postageMapper;
 
     @Override
     public CustomerInfo getCustomerInfo(Integer customerId) {
@@ -97,7 +98,7 @@ public class CustomerServiceImpl implements CustomerService {
         QuestionDescribe questionDescribe = new QuestionDescribe();
         questionDescribe.setCustomerId(customerInfo.getCustomerId());
         questionDescribe.setDescribeTitle(customerInfo.getDescribeTitle());  //客诉问题标题
-        questionDescribe.setDescribeContent(customerInfo.getDescribeContent());  //客诉问题描述
+        questionDescribe.setDescribeContent(null);  //客诉问题描述
         questionDescribe.setDescribeHandleDesc(customerInfo.getDescribeHandleDesc());   //处理描述
         flag = questionDescribeMapper.insert(questionDescribe);
         if(flag < 1){
@@ -236,7 +237,7 @@ public class CustomerServiceImpl implements CustomerService {
 //        questionDescribe.setCustomerId(customerInfo.getCustomerId());
         questionDescribe.setDescribeId(customerInfo.getDescribeId());//客诉问题主键
         questionDescribe.setDescribeTitle(customerInfo.getDescribeTitle());  //客诉问题标题
-        questionDescribe.setDescribeContent(customerInfo.getDescribeContent());  //客诉问题描述
+        questionDescribe.setDescribeContent(null);  //客诉问题描述
         questionDescribe.setDescribeHandleDesc(customerInfo.getDescribeHandleDesc());   //处理描述
         flag = questionDescribeMapper.updateByPrimaryKeySelective(questionDescribe);
         if(flag < 1){
@@ -1430,10 +1431,51 @@ public class CustomerServiceImpl implements CustomerService {
     public List<PostageInfo> listPostageInfo(Integer relationId) {
         return customerInfoMapper.listPostageInfo(relationId);
     }
-
+    @Transactional
     @Override
     public Integer addPostageInfo(PostageInfo postageInfo) {
-        return customerInfoMapper.addPostageInfo(postageInfo);
+        int msg;
+        msg = customerInfoMapper.addPostageInfo(postageInfo);
+        if( msg > 0){
+            //添加邮费转账列表
+            CmRelation cmRelation = cmRelationMapper.getCmRelationById(postageInfo.getRelationId());
+            CustomerInfo customerInfo = customerService.getCustomerInfo(cmRelation.getCustomerId());
+            RelationOrder relationOrder = new RelationOrder();
+            relationOrder.setRelationId(postageInfo.getRelationId());
+            List<RelationOrder> relationOrderList = relationOrderMapper.getRelationOrderList(relationOrder);
+            Integer orderid = null;
+            if(relationOrderList.size() > 0){
+                orderid = relationOrderList.get(0).getSalesId();
+            }
+            Postage postage = new Postage();
+            postage.setCompanyId(customerInfo.getCompanyId());      //销售公司
+            postage.setAdminId(customerInfo.getAdminId());      //客服
+            postage.setCustomerId(customerInfo.getCustomerId());        //客诉id
+            postage.setPostageCustomerStatus(2);            //------考虑手动点, 直接变为申请中
+            postage.setPostageManagerStatus(1);     //------考虑手动点, 直接变为申请中
+            postage.setPostageOrderSource(customerInfo.getStoreId());   //店铺id
+            postage.setPostageTreatmentMethod(cmRelation.getProcMethodId()); //处理方式
+            postage.setSalesOrderId(orderid);       //客诉关联订单号
+            postage.setPostageClientName(cmRelation.getRelationBackName());
+            postage.setPostageClientTel(cmRelation.getRelationBackTel());
+            postage.setPostageClientAddress(cmRelation.getRelationSendAddress());
+            postage.setPostageLogisticsCompany(cmRelation.getRelationBackLogisticsCompany());
+            postage.setPostageLogisticsNo(cmRelation.getRelationBackLogisticsNo());
+            postage.setPostageAmount(postageInfo.getPostageAmount());  //寄回邮费
+            postage.setPostageAlipay(postageInfo.getPostageAlipay());   //支付宝账户
+            postage.setPostageAlipayName(postageInfo.getPostageAlipayName());   //支付宝账号名称
+           // postage.setPostageLogisticsImg();
+            postage.setCustomerPostageId(postageInfo.getPostageId());//邮费信息id
+            postage.setPostageTransferStatus(1);
+
+            //审批编码
+            postage.setPostageCoding(TenpayUtil.formatDate(new Date()) + new Date().getTime());
+            if(postageMapper.savePostage(postage) < 1){
+                throw new RuntimeException("添加邮费转账失败");
+            }
+        }
+
+        return msg;
     }
 
     @Override
@@ -1443,7 +1485,12 @@ public class CustomerServiceImpl implements CustomerService {
 
     @Override
     public Integer deletePostageInfo(Integer postageId) {
-        return customerInfoMapper.deletePostageInfo(postageId);
+        if(customerInfoMapper.deletePostageInfo(postageId) > 0){
+            postageMapper.delCustomerPostage(postageId);
+        }else{
+            return 0;
+        }
+        return 1;
     }
 
     @Override
@@ -1566,7 +1613,7 @@ public class CustomerServiceImpl implements CustomerService {
         signclosedInfo.setSignclosedCompanyId(cmRelation.getCompanyId());
         signclosedInfo.setSignclosedCustomerId(cmRelation.getCustomerId());
         //查询是否已存在相同单号
-        if(sendbackInfo.getSendbackLogisticsNo() != null){
+        if(sendbackInfo.getSendbackLogisticsNo() != null && !sendbackInfo.getSendbackLogisticsNo().equals("")){
             ComplaintSignclosedInfo sinfo = new ComplaintSignclosedInfo();
             sinfo.setSignclosedLogisticsNumber(sendbackInfo.getSendbackLogisticsNo());
             if(complaintSignclosedInfoMapper.listSignclosed(sinfo).size() <= 0){

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/PostageServiceImpl.java

@@ -45,6 +45,11 @@ public class PostageServiceImpl implements PostageService {
     }
 
     @Override
+    public Integer getPostagePrintedNum() {
+        return postageMapper.getPostagePrintedNum();
+    }
+
+    @Override
     public Postage getPostage(Integer postageId) {
         return postageMapper.getPostage(postageId);
     }

+ 109 - 88
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.sql.SQLException;
@@ -83,6 +84,19 @@ public class SalesOrderServiceImpl implements SalesOrderService {
     @Autowired
     private SupplierProductMapper supplierProductMapper;
 
+    /**
+     * 缓存订单项的前缀
+     */
+    public static String CACHE_ORDER_ITEM_NAME = null;
+    static {
+        Map<String,String> map = System.getenv();
+        if ("iZ94klno8qrZ".equalsIgnoreCase(map.get("COMPUTERNAME"))) {
+            CACHE_ORDER_ITEM_NAME = "RST_ORDER_ITEM_";
+        } else {
+            CACHE_ORDER_ITEM_NAME = "adv_ORDER_ITEM_";
+        }
+    }
+
     @Override
     public Integer addSalesOrder(SalesOrder salesOrder) {
         return salesOrderMapper.addSalesOrder(salesOrder);
@@ -151,14 +165,14 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         return  salesOrderMapper.updateSalesOrder(salesOrder);
     }
 
-    @Transactional
     @Override
+    @Transactional(rollbackFor = {SQLException.class, Exception.class}, isolation = Isolation.REPEATABLE_READ)
     public Integer updateOrderInfo(SalesOrder salesOrder) {
         int flag = 0;
         if(salesOrder.getSalesId()==null){
             throw new RuntimeException("订单ID不存在!");
         }
-
+        // 处理订单项
         for (SalesOrderItem addItem:salesOrder.getSalesOrderItemList()) {
             if(addItem.getItemNum() > 0 && addItem.getItemColorId() > 0){
                 ProductColor productColor = productService.getProduceColor(addItem.getItemColorId());
@@ -192,7 +206,6 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         SalesOrderItem soi = new SalesOrderItem();
         soi.setItemOrderId(salesOrder.getSalesId());
         List<SalesOrderItem> salesOrderItemList = salesOrderMapper.listSalesOrderItem(soi);
-//        List<SalesOrderItem> addsaleSOrderItemList = new ArrayList<>();
         List<SalesOrderItem> updateSalesOrderItemList = new ArrayList<>();
         List<SalesOrderItem>deleteSalesOrderItemList = new ArrayList<>();
 
@@ -235,7 +248,7 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         }
 
         //批量修改订单
-        if(updateSalesOrderItemList != null && updateSalesOrderItemList.size() > 0) {
+        if(updateSalesOrderItemList.size() > 0) {
             for (SalesOrderItem salesOrderItem : updateSalesOrderItemList) {
                 flag = salesOrderMapper.updateOrderItemObj(salesOrderItem);
             }
@@ -250,14 +263,7 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         }
 
         // 更新Redis缓存
-        Map<String,String> map = System.getenv();
-        String name = map.get("COMPUTERNAME");
-        if ("iZ94klno8qrZ".equalsIgnoreCase(name)) {
-            name = "RST_";
-        } else {
-            name = "adv_";
-        }
-        RedisUtils.del(name + "ORDER_ITEM_" + salesOrder.getSalesId());
+        cacheOrderItem(salesOrder.getSalesId());
         return flag;
     }
 
@@ -276,29 +282,47 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         return salesOrderMapper.listSalesOrderNum(salesOrder);
     }
 
+    /**
+     * 获取订单的订单项,首先从REDIS中获取,如果没有获取到,尝试从数据库获取
+     * @param salesId
+     * @return
+     */
+    private List<SalesOrderItem> listOrderItem(Integer salesId) {
+        String key = CACHE_ORDER_ITEM_NAME + salesId;
+        List<SalesOrderItem> list = RedisUtils.list(key, SalesOrderItem.class);
+        if (list == null) {
+            cacheOrderItem(salesId);
+            list = RedisUtils.list(key, SalesOrderItem.class);
+        }
+        return list;
+    }
+
+    /**
+     * 更新缓存订单项(从数据库获取一次)
+     * @param salesId
+     */
+    private void cacheOrderItem(Integer salesId) {
+        // 查询数据库的数据
+        SalesOrderItem salesOrderItem = new SalesOrderItem();
+        salesOrderItem.setItemOrderId(salesId);
+        List<SalesOrderItem> list = salesOrderMapper.listSalesOrderItem(salesOrderItem);
+        // 缓存
+        String key = CACHE_ORDER_ITEM_NAME + salesId;
+        RedisUtils.put(key, list);
+        RedisUtils.expire(key,DateTimeUtil.addDay(1));
+    }
+
     @Override
     public PagedResult<SalesOrder> listSalesOrderPage(int pageNO, int pageSize, SalesOrder salesOrder, boolean isTotalNum) {
+        // 初始化页面分页的数据
         salesOrder.setStartOrderNO((pageNO-1) * pageSize);
         salesOrder.setEndOrderNO(pageSize);
         //查询订单列表信息
         List<SalesOrder> orderList = salesOrderMapper.listSalesOrderNew(salesOrder);
         for(SalesOrder so : orderList){
-            SalesOrderItem salesOrderItem = new SalesOrderItem();
-            salesOrderItem.setItemOrderId(so.getSalesId());
-            List<SalesOrderItem> salesOrderItemList = salesOrderMapper.listSalesOrderItem(salesOrderItem);
-            //去除已退货的订单项
-            /*int num = salesOrderItemList.size();  2019年7月10日 更新
-            for(int i = 0;i< num;){
-                SalesOrderItem item = salesOrderItemList.get(i);
-                if(item.getItemNum().intValue() == item.getItemReturnNum().intValue()){
-                    salesOrderItemList.remove(i);
-                    num = salesOrderItemList.size();
-                    i = 0;
-                }else{
-                    i++;
-                }
-            }*/
-            for(SalesOrderItem item : salesOrderItemList){//判断是否包含净水机 1是 2否
+            List<SalesOrderItem> salesOrderItemList = listOrderItem(so.getSalesId());
+            for(SalesOrderItem item : salesOrderItemList){
+                //判断是否包含净水机 1是 2否
                 if(item.getColorIsMachine() != null){
                     if(item.getColorIsMachine() == 1){
                         so.setIsDevelop(1);
@@ -596,72 +620,75 @@ public class SalesOrderServiceImpl implements SalesOrderService {
     }
 
     @Override
-    @Transactional
+    @Transactional(rollbackFor = {SQLException.class, Exception.class}, isolation = Isolation.REPEATABLE_READ)
     public boolean addRstOrderinfo(SalesOrder mainOrder,List<SalesOrder> listSalesOrder,String[] detectIds) {
-         Integer flag = salesOrderMapper.getOrderBySalesDealCodeNum(mainOrder.getSalesDealCode());
+        // 查询交易号的数量(注意,此处可能重复,应该增加唯一索引)
+        Integer flag = salesOrderMapper.getOrderBySalesDealCodeNum(mainOrder.getSalesDealCode());
         if(flag > 0){
-            throw  new RuntimeException("交易号("+ mainOrder.getSalesDealCode() +")重复,请重新生成交易号!");
+            throw new RuntimeException("交易号("+ mainOrder.getSalesDealCode() +")重复,请重新生成交易号!");
         }
 
         if(mainOrder.getSalesAddressPostcode() == null){
-            throw  new RuntimeException("未获取到邮政编码信息,请检查地址信息!");
+            throw new RuntimeException("未获取到邮政编码信息,请检查地址信息!");
         }
 
         if(mainOrder.getSalesCreateTime() == null){
             /*保证时间与以前一样*/
             mainOrder.setSalesCreateTime(new Date());
         }
-
+        // 计算金额
         calculationTotal(mainOrder,mainOrder.getSalesOrderItemList());
-        int orderNum = salesOrderMapper.addSalesOrder(mainOrder);
-        if (orderNum <= 0) {
-            throw  new RuntimeException("添加订单出错--------!");
+        // 保存订单信息
+        int res = salesOrderMapper.addSalesOrder(mainOrder);
+        if (res <= 0) {
+            throw new RuntimeException("添加订单出错,请核查内容");
         }
         for (SalesOrderItem item : mainOrder.getSalesOrderItemList()) {
             item.setItemOrderId(mainOrder.getSalesId());
         }
         //批量添加订单项数据
-        int itemNum = salesOrderMapper.addOrderItemList(mainOrder.getSalesOrderItemList());
-        if (itemNum <= 0) {
-            throw  new RuntimeException("添加订单出错--------!");
-        }else{
-            if(listSalesOrder.size() > 0){
-                for (int i = 0;i<listSalesOrder.size();i++){
-                    listSalesOrder.get(i).setSalesDealCode(listSalesOrder.get(i).getSalesDealCode()+"-"+(i+1));
-                    if(listSalesOrder.get(i).getSalesOrderId() != null && !"".equals(listSalesOrder.get(i).getSalesOrderId())){
-                        listSalesOrder.get(i).setSalesOrderId(listSalesOrder.get(i).getSalesOrderId()+"-"+(i+1));
-                    }
-                    listSalesOrder.get(i).setSalesMainOrderId(mainOrder.getSalesId());
-                    listSalesOrder.get(i).setSalesId(null);
-                    calculationTotal(listSalesOrder.get(i),listSalesOrder.get(i).getSalesOrderItemList());
-                    orderNum = salesOrderMapper.addSalesOrder(listSalesOrder.get(i));
-                    if (orderNum <= 0) {
-                        throw  new RuntimeException("添加订单出错--------!");
-                    }
-                    for (SalesOrderItem item : listSalesOrder.get(i).getSalesOrderItemList()) {
-                        item.setItemOrderId(listSalesOrder.get(i).getSalesId());
-                    }
-                    //批量添加订单项数据
-                    itemNum = salesOrderMapper.addOrderItemList(listSalesOrder.get(i).getSalesOrderItemList());
-                    if (itemNum <= 0) {
-                        throw  new RuntimeException("添加订单出错--------!");
-                    }
+        res = salesOrderMapper.addOrderItemList(mainOrder.getSalesOrderItemList());
+        if (res <= 0) {
+            throw  new RuntimeException("添加订单出错,保存订单项失败");
+        }
+        // 保存子订单的内容
+        if(listSalesOrder.size() > 0){
+            for (int i = 0;i<listSalesOrder.size();i++){
+                // 生产交易号
+                listSalesOrder.get(i).setSalesDealCode(listSalesOrder.get(i).getSalesDealCode()+"-"+(i+1));
+                if(listSalesOrder.get(i).getSalesOrderId() != null && !"".equals(listSalesOrder.get(i).getSalesOrderId())){
+                    listSalesOrder.get(i).setSalesOrderId(listSalesOrder.get(i).getSalesOrderId()+"-"+(i+1));
+                }
+                // 主订单id
+                listSalesOrder.get(i).setSalesMainOrderId(mainOrder.getSalesId());
+                listSalesOrder.get(i).setSalesId(null);
+                calculationTotal(listSalesOrder.get(i),listSalesOrder.get(i).getSalesOrderItemList());
+                res = salesOrderMapper.addSalesOrder(listSalesOrder.get(i));
+                if (res <= 0) {
+                    throw  new RuntimeException("添加子订单出错");
+                }
+                for (SalesOrderItem item : listSalesOrder.get(i).getSalesOrderItemList()) {
+                    item.setItemOrderId(listSalesOrder.get(i).getSalesId());
+                }
+                // 批量添加订单项数据
+                res = salesOrderMapper.addOrderItemList(listSalesOrder.get(i).getSalesOrderItemList());
+                if (res <= 0) {
+                    throw  new RuntimeException("添加子订单出错,保存订单项失败");
                 }
             }
         }
-        //修为维修记录为已下单
-        if(detectIds != null){
-            if(detectIds.length > 0){
-                for(String detectId : detectIds){
-                    ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
-                    detectInfo.setDetectId(Integer.valueOf(detectId));
-                    detectInfo.setDetectPlaceorder(2);
-                    detectInfo.setSalesOrderId(mainOrder.getSalesOrderId());
-                    /*detectInfo.setDetectSalesId(mainOrder.getSalesId());*/
-                    complaintDetectInfoMapper.updateDetectById(detectInfo);
-                }
+        // 修为维修记录为已下单
+        if(detectIds != null && detectIds.length > 0){
+            for(String detectId : detectIds){
+                ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+                detectInfo.setDetectId(Integer.valueOf(detectId));
+                detectInfo.setDetectPlaceorder(2);
+                detectInfo.setSalesOrderId(mainOrder.getSalesOrderId());
+                complaintDetectInfoMapper.updateDetectById(detectInfo);
             }
         }
+        // 缓存订单项
+        cacheOrderItem(mainOrder.getSalesId());
         return true;
     }
 
@@ -712,22 +739,6 @@ public class SalesOrderServiceImpl implements SalesOrderService {
 
     @Override
     public List<SalesOrderItem> listSalesOrderItem(SalesOrderItem salesOrderItem) {
-        // 通过计算机名称来判断服务器环境
-        /*Map<String,String> map = System.getenv();
-        String name = map.get("COMPUTERNAME");
-        if ("iZ94klno8qrZ".equalsIgnoreCase(name)) {
-            name = "RST_";
-        } else {
-            name = "adv_";
-        }
-        // 获取数据
-        String key = name + "ORDER_ITEM_" + salesOrderItem.getItemOrderId();
-        List<SalesOrderItem> list = RedisUtils.list(key, SalesOrderItem.class);
-        if (list == null ) {
-            list = salesOrderMapper.listSalesOrderItem(salesOrderItem);
-            RedisUtils.put(key, list);
-            RedisUtils.expire(key, new Date(259200000 + System.currentTimeMillis()));
-        }*/
         return salesOrderMapper.listSalesOrderItem(salesOrderItem);
     }
 
@@ -1849,6 +1860,16 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         return salesOrderMapper.orderAfterCaseDate();
     }
 
+    @Override
+    public List<OrderStatisticsInfo> getPickingOrders(OrderStatisticsInfo orderStatisticsInfo) {
+        return salesOrderMapper.getPickingOrders(orderStatisticsInfo);
+    }
+
+    @Override
+    public List<OrderStatisticsInfo> getCheckOrders(OrderStatisticsInfo orderStatisticsInfo) {
+        return salesOrderMapper.getCheckOrders(orderStatisticsInfo);
+    }
+
     /***
      * 计算金额
      * @param salesOrder

+ 14 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/PostageMapper.java

@@ -49,4 +49,18 @@ public interface PostageMapper {
      * @return
      */
     Integer getPostageNumber(Postage postage);
+
+    /**
+     *  根据客诉邮费id删除
+     * @param
+     * @return
+     */
+    Integer delCustomerPostage(Integer postageId);
+
+    /**
+     *  查询待打印条数
+     * @param
+     * @return
+     */
+    Integer getPostagePrintedNum();
 }

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

@@ -470,4 +470,12 @@ public interface SalesOrderMapper {
      *定时任务-查询没有揽件时间的订单
      */
     List<SalesOrder> orderAfterCaseDate();
+    /**
+     *查询拣货单信息
+     */
+    List<OrderStatisticsInfo> getPickingOrders(OrderStatisticsInfo orderStatisticsInfo);
+    /**
+     *查询核对单信息
+     */
+    List<OrderStatisticsInfo> getCheckOrders(OrderStatisticsInfo orderStatisticsInfo);
 }

+ 46 - 5
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml

@@ -421,6 +421,7 @@
       LEFT JOIN tb_rst_complaint_signclosed cs ON cs.signclosed_customer_id = c.customer_id
       LEFT JOIN tb_rst_complaint_detect cd ON c.customer_id = cd.customer_id
       LEFT JOIN tb_rst_cm_tag_info ti ON ti.tag_id = c.customer_tag_id
+      LEFT JOIN tb_rst_postage pag ON pag.customer_id = c.customer_id
     <where>
       <if test="customerName != null and customerName != ''">
         c.customer_name like CONCAT('%',#{customerName},'%')
@@ -526,6 +527,12 @@
       <if test="afterState != null and afterState == 11">
         and  cc.procTypeId = 2  AND cs.signclosed_is_receiving = 2 AND ((soi.sales_shipping_status = 0 and soi.sales_status != 3) OR soi.sales_shipping_status is NULL)
       </if>
+      <if test="afterState != null and afterState == 12">
+          AND pag.postage_manager_status = 2
+          AND pag.postage_finance_status = 2
+          AND pag.postage_transfer_status = 1
+          AND pag.postage_is_print = 1
+      </if>
       <if test="warehouseDate != null">
         and cs.signclosed_date = #{warehouseDate}
       </if>
@@ -562,6 +569,12 @@
       <if test="salesOrderId != null and salesOrderId != ''">
         and oi.sales_orderId = #{salesOrderId}
       </if>
+      <if test="tagFlag != null and tagFlag != ''">
+        and ti.tag_flag = #{tagFlag}
+      </if>
+      <if test="detectNumber != null and detectNumber != ''">
+        and cd.detect_number = #{detectNumber}
+      </if>
     </where>
     GROUP BY c.customer_id
     ORDER BY c.customer_id desc
@@ -1272,11 +1285,29 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
   </select>
 
   <select id="getPostageInfo" parameterType="Integer" resultType="PostageInfo">
-      SELECT * from tb_rst_postage_info where postage_id = #{postageId}
+      SELECT
+      p.*,
+      pa.postage_customer_status postageCustomerStatus,
+      pa.postage_manager_status postageManagerStatus,
+      pa.postage_finance_status postageFinanceStatus,
+      pa.postage_transfer_status postageTransferStatus,
+      pa.postage_id postId
+       from tb_rst_postage_info p
+      LEFT JOIN tb_rst_postage pa ON pa.customer_postage_id = p.postage_id
+      where p.postage_id = #{postageId}
   </select>
 
   <select id="listPostageInfo" parameterType="Integer" resultType="PostageInfo">
-      SELECT * from tb_rst_postage_info where relation_id = #{relationId}
+      SELECT
+       p.*,
+      pa.postage_customer_status postageCustomerStatus,
+      pa.postage_manager_status postageManagerStatus,
+      pa.postage_finance_status postageFinanceStatus,
+      pa.postage_transfer_status postageTransferStatus,
+      pa.postage_id postId
+       from tb_rst_postage_info p
+      LEFT JOIN tb_rst_postage pa ON pa.customer_postage_id = p.postage_id
+      where p.relation_id = #{relationId}
   </select>
 
   <select id="listPostageInfoByCustomerId" parameterType="Integer" resultType="PostageInfo">
@@ -1294,7 +1325,9 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
       postage_alipay_name,
       postage_alipay_type,
       postage_desc,
-      postage_create_time
+      postage_create_time,
+      postage_pay_type,
+      postage_pay_where
     )
     VALUES
     ( #{relationId},
@@ -1304,7 +1337,9 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
       #{postageAlipayName},
       #{postageAlipayType},
       #{postageDesc},
-      NOW()
+      NOW(),
+      #{postagePayType},
+      #{postagePayWhere}
       )
   </insert>
   <update id="updatePostageInfo" parameterType="PostageInfo">
@@ -1326,7 +1361,13 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
           postage_alipay_type = #{postageAlipayType},
       </if>
       <if test="postageDesc != null and postageDesc != ''">
-        postage_desc = #{postageDesc}
+        postage_desc = #{postageDesc},
+      </if>
+      <if test="postagePayType != null and postagePayType != ''">
+          postage_pay_type = #{postagePayType},
+      </if>
+      <if test="postagePayWhere != null and postagePayWhere != ''">
+          postage_pay_where = #{postagePayWhere}
       </if>
     </set>
     WHERE postage_id = #{postageId}

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

@@ -17,8 +17,9 @@
     </sql>
     <select id="getPostageAuthorityLogList" resultMap="BaseResultMap" parameterType="PostageAuthorityLog" >
         select
-        <include refid="Base_List" />
+        <include refid="Base_List" />, tb_rst_sys_admin.admin_name adminName
         from tb_rst_postage_authority_log t
+        LEFT JOIN tb_rst_sys_admin on tb_rst_sys_admin.admin_id = t.admin_id
         <where>
             <if test="authorityLogId != null ">
                 AND t.authority_log_id = #{authorityLogId}

+ 50 - 7
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/postageMapper.xml

@@ -22,23 +22,33 @@
     <result column="postage_logistics_img" property="postageLogisticsImg" jdbcType="VARCHAR" />
     <result column="postage_create_time" property="postageCreateTime" jdbcType="TIMESTAMP" />
     <result column="postage_update_time" property="postageUpdateTime" jdbcType="TIMESTAMP" />
+    <result column="postage_coding" property="postageCoding" jdbcType="VARCHAR" />
+    <result column="postage_customer_time" property="postageCustomerTime" jdbcType="TIMESTAMP" />
+    <result column="postage_finance_time" property="postageFinanceTime" jdbcType="TIMESTAMP" />
   </resultMap>
 
   <sql id="Base_Column_List" >
     p.postage_id, p.admin_id, p.customer_id, p.company_id,  p.postage_customer_status, p.postage_manager_status, p.postage_finance_status, p.postage_transfer_status, p.postage_logistics_img,
     p.postage_order_source, p.postage_treatment_method, p.sales_orderId, p.postage_client_name,
     p.postage_client_tel,p.postage_client_address, p.postage_logistics_company, p.postage_logistics_no, p.postage_amount,
-    p.postage_alipay, p.postage_alipay_name, p.postage_create_time, p.postage_update_time
+    p.postage_alipay, p.postage_alipay_name, p.postage_create_time, p.postage_update_time,postage_coding,postage_customer_time,postage_finance_time,postage_is_print
   </sql>
 
   <select id="listPostage" resultMap="BaseResultMap" parameterType="Postage" >
     select
     <include refid="Base_Column_List" />,
     sa.admin_name AS adminName,
-    si.store_name AS storeName
+    si.store_name AS storeName,
+    pi.postage_pay_type postagePayType,
+    pi.postage_pay_where postagePayWhere,
+    pt.proc_type_name procTypeName,
+    pm.proc_method_name procMethodName
     from tb_rst_postage p
     LEFT JOIN tb_rst_sys_admin sa ON p.admin_id = sa.admin_id
     LEFT JOIN tb_rst_store_info si ON p.postage_order_source = si.store_id
+    LEFT JOIN tb_rst_postage_info pi on pi.postage_id = p.customer_postage_id
+    LEFT JOIN tb_rst_cm_proc_method pm ON pm.proc_method_id = p.postage_treatment_method
+    LEFT JOIN tb_rst_cm_proc_type pt ON pt.proc_type_id = pm.proc_type_id
     <where>
       <if test="adminId != null and adminId != ''">
         p.admin_id = #{adminId}
@@ -88,6 +98,9 @@
       <if test="postageAlipayName != null and postageAlipayName != ''">
         AND p.postage_alipay_name like CONCAT('%',#{postageAlipayName},'%')
       </if>
+      <if test="postageIsPrint != null and postageIsPrint != ''">
+        AND p.postage_is_print = #{postageIsPrint}
+      </if>
       <if test="companyIds != null and companyIds != ''">
         AND p.company_id IN
           <foreach collection="companyIds" item="item" index="index" separator="," open="(" close=")">
@@ -102,10 +115,15 @@
     select
     <include refid="Base_Column_List" />,
     sa.admin_name AS adminName,
-    si.store_name AS storeName
+    si.store_name AS storeName,
+    qd.describe_title questionTitle,
+    pi.postage_pay_type postagePayType,
+    pi.postage_pay_where postagePayWhere
     from tb_rst_postage p
     LEFT JOIN tb_rst_sys_admin sa ON p.admin_id = sa.admin_id
     LEFT JOIN tb_rst_store_info si ON p.postage_order_source = si.store_id
+    LEFT JOIN tb_rst_cm_question_describe qd on p.customer_id = qd.customer_id
+    LEFT JOIN tb_rst_postage_info pi on pi.postage_id = p.customer_postage_id
    WHERE  p.postage_id = #{postageId}
   </select>
 
@@ -116,7 +134,7 @@
     sales_orderId, postage_client_name, postage_client_tel,
     postage_client_address,
     postage_logistics_company, postage_logistics_no,
-    postage_amount, postage_alipay, postage_alipay_name,postage_logistics_img
+    postage_amount, postage_alipay, postage_alipay_name,postage_logistics_img,customer_postage_id,postage_coding,postage_is_print
     )
     values (#{postageId,jdbcType=INTEGER}, #{adminId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER},#{companyId,jdbcType=INTEGER}, #{postageCustomerStatus,jdbcType=INTEGER},
     #{postageManagerStatus,jdbcType=INTEGER}, #{postageFinanceStatus,jdbcType=INTEGER},  #{postageTransferStatus,jdbcType=INTEGER},
@@ -124,7 +142,8 @@
     #{salesOrderId,jdbcType=VARCHAR}, #{postageClientName,jdbcType=VARCHAR}, #{postageClientTel,jdbcType=VARCHAR},
     #{postageClientAddress,jdbcType=VARCHAR},
     #{postageLogisticsCompany,jdbcType=VARCHAR}, #{postageLogisticsNo,jdbcType=VARCHAR},
-    #{postageAmount,jdbcType=INTEGER}, #{postageAlipay,jdbcType=VARCHAR}, #{postageAlipayName,jdbcType=VARCHAR}, #{postageLogisticsImg,jdbcType=VARCHAR}
+    #{postageAmount,jdbcType=INTEGER}, #{postageAlipay,jdbcType=VARCHAR}, #{postageAlipayName,jdbcType=VARCHAR}, #{postageLogisticsImg,jdbcType=VARCHAR},
+    #{customerPostageId,jdbcType=INTEGER},#{postageCoding,jdbcType=VARCHAR},1
     )
   </insert>
 
@@ -189,7 +208,16 @@
             postage_update_time = #{postageUpdateTime,jdbcType=TIMESTAMP},
         </if>
         <if test="postageClientAddress != null" >
-            postage_client_address = #{postageClientAddress,jdbcType=TIMESTAMP}
+            postage_client_address = #{postageClientAddress,jdbcType=TIMESTAMP},
+        </if>
+        <if test="postageCustomerTime != null" >
+          postage_customer_time = #{postageCustomerTime,jdbcType=TIMESTAMP},
+        </if>
+        <if test="postageFinanceTime != null" >
+          postage_finance_time = #{postageFinanceTime,jdbcType=TIMESTAMP},
+        </if>
+        <if test="postageIsPrint != null" >
+          postage_is_print = #{postageIsPrint,jdbcType=INTEGER}
         </if>
     </set>
     where postage_id = #{postageId,jdbcType=INTEGER}
@@ -235,5 +263,20 @@
     </where>
     ORDER BY postage_id DESC
   </select>
-
+  <delete id="delCustomerPostage" parameterType="java.lang.Integer" >
+    delete from tb_rst_postage
+    <where>
+      customer_postage_id = #{postageId}
+    </where>
+  </delete>
+  <select id="getPostagePrintedNum" resultType="Integer" >
+    SELECT
+    count(1)
+    from tb_rst_postage p
+    where
+    p.postage_manager_status = 2
+    AND p.postage_finance_status = 2
+    AND p.postage_transfer_status = 1
+    AND p.postage_is_print = 1
+  </select>
 </mapper>

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

@@ -207,7 +207,7 @@
             GROUP BY
             soi.sales_id
             ORDER BY
-            soi.sales_create_time DESC
+            soi.sales_id DESC
             LIMIT #{startOrderNO}, #{endOrderNO}
         ) temp
         LEFT JOIN tb_rst_sales_company trsc ON temp.sales_company_id = trsc.company_id
@@ -683,7 +683,7 @@
         GROUP BY
         soi.sales_id
         ORDER BY
-        soi.sales_create_time DESC
+        soi.sales_id DESC
         ) temp
         LEFT JOIN tb_rst_sales_company trsc ON temp.sales_company_id = trsc.company_id
         LEFT JOIN tb_rst_store_info trsi ON temp.sales_store_id = trsi.store_id
@@ -2161,6 +2161,7 @@
         AND sales_address_tel = #{salesAddressTel}
         AND sales_address_name = #{salesAddressName}
         AND sales_post_firm = #{salesPostFirm}
+        AND sales_id != #{salesId}
     </select>
 <!--查询子订单数量-->
     <select id="listSublistCount" parameterType="Integer" resultType="SalesOrder">
@@ -2361,5 +2362,29 @@
         AND sales_post_num is not null
         AND sales_post_firm is not null
     </select>
+    <!--查询拣货单信息-->
+    <select id="getPickingOrders" parameterType="OrderStatisticsInfo" resultType="OrderStatisticsInfo">
+        SELECT soi.item_product_name AS productName,soi.item_product_color AS  colorName,sum(soi.item_num) AS num FROM tb_rst_sales_order_item soi
+        LEFT JOIN tb_rst_sales_order_info oi on soi.item_order_id = oi.sales_id
+        WHERE
+        sales_status != 3
+        AND sales_batch_id != 'KS00000000000001'
+        AND sales_send_time > #{pickingStartDate} AND  sales_send_time &lt; NOW()
+        AND sales_warehouse_id = #{warehouseId}
+        GROUP BY soi.item_color_id
+        ORDER BY num desc
+    </select>
+    <!--查询核对单信息-->
+    <select id="getCheckOrders" parameterType="OrderStatisticsInfo" resultType="OrderStatisticsInfo">
+        SELECT li.logistics_name AS logisticsName,count(1) AS num FROM  tb_rst_sales_order_info oi
+        LEFT JOIN tb_rst_logistics_info li on li.logistics_rst_code = oi.sales_post_firm
+        WHERE
+        sales_status != 3
+        AND sales_batch_id != 'KS00000000000001'
+        AND sales_send_time > #{checkStartDate} AND  sales_send_time &lt; NOW()
+        AND sales_warehouse_id = #{warehouseId}
+        GROUP BY oi.sales_post_firm
+        ORDER BY num desc
+    </select>
 
 </mapper>

+ 13 - 3
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintSignclosedInfoServiceImpl.java

@@ -652,19 +652,29 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
             LogisticsInfo log = new LogisticsInfo();
             log.setLogisticsRstCode(signclosedInfo.getSignclosedLogistics());
             List<LogisticsInfo> listlog = logisticsInfoService.getLogisticsInfoList(log);
-            Date signTime = kuaidi100.selectCourierSignTime(listlog.get(0).getLogisticsOnehundredCode(),signclosedInfo.getSignclosedLogisticsNumber());
+            /*Date signTime = kuaidi100.selectCourierSignTime(listlog.get(0),signclosedInfo.getSignclosedLogisticsNumber());*/
             SendbackInfo sendbackInfo = new SendbackInfo();
             sendbackInfo.setSendbackId(signclosedInfo.getSendbackId());
             sendbackInfo.setSendbackStatus(3);
             sendbackInfo.setSendbackLogisticsCompany(signclosedInfo.getSignclosedLogistics());
             sendbackInfo.setSendbackLogisticsNo(signclosedInfo.getSignclosedLogisticsNumber());
-            if (signTime != null) {
+            /*if (signTime != null) {
                 sendbackInfo.setSendbackSignTime(signTime);
             }else{
                 sendbackInfo.setSendbackSignTime(new Date());
-            }
+            }*/
+            sendbackInfo.setSendbackSignTime(new Date());
             if(record.getSendbackIsUse() != null){
                 sendbackInfo.setSendbackIsUse(record.getSendbackIsUse());
+                if(record.getSendbackIsUse() == 1){
+                    puoductbuffer.append(",状态:未使用");
+                }else if(record.getSendbackIsUse() == 2){
+                    puoductbuffer.append(",状态:已使用");
+                }
+
+            }
+            if(record.getSignclosedDesc() != null && !record.getSignclosedDesc().equals("")){
+                puoductbuffer.append(",备注:"+record.getSignclosedDesc());
             }
             customerInfoMapper.updateSendbackInfo(sendbackInfo);
 

+ 3 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/complaintSignclosedInfoMapper.xml

@@ -100,11 +100,13 @@
     sp.signclosed_product_id signclosedProductId,
     sp.signclosed_product_color signclosedProductColor,
     pc.color_name colorName,
-    sp.product_num productNum
+    sp.product_num productNum,
+    pt.type_name productTypeName
     from
     tb_rst_complaint_signclosed_product sp
     LEFT JOIN tb_rst_product_color pc on sp.signclosed_product_color = pc.color_id
     LEFT JOIN tb_rst_product_info pi on pc.color_product_id = pi.product_id
+    LEFT JOIN tb_rst_product_type pt ON pt.type_id = sp.signclosed_product_type
     where sp.signclosed_id = #{signclosedId}
     GROUP BY sp.product_name,pc.color_name
   </select>

+ 137 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/ProductionPlanServiceImpl.java

@@ -0,0 +1,137 @@
+package com.iamberry.rst.service.pts;
+
+import com.github.pagehelper.PageHelper;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.ProductionEmployees;
+import com.iamberry.rst.core.pts.ProductionPlan;
+import com.iamberry.rst.core.pts.ProductionProcess;
+import com.iamberry.rst.faces.pts.ProductionPlanService;
+import com.iamberry.rst.service.pts.mapper.ProductionPlanningMapper;
+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;
+
+
+/**
+ * 生产计划管理
+ * Created by LJK on 2019年12月12日16:04:01
+ */
+@Service
+public class ProductionPlanServiceImpl implements ProductionPlanService {
+
+    @Autowired
+    public ProductionPlanningMapper productionPlanningMapper;
+
+    @Override
+    public ProductionPlan getProductionPlan(Integer planId) {
+        return productionPlanningMapper.getProductionPlan(planId);
+    }
+    @Transactional
+    @Override
+    public Integer addProductionPlan(ProductionPlan productionPlan) {
+        if(productionPlanningMapper.addProductionPlan(productionPlan) > 0){
+            //添加员工项
+            if(productionPlan.getEmployeeString() != null && !productionPlan.getEmployeeString().equals("")){
+                String[] employees = productionPlan.getEmployeeString().split("_");
+                for(String employee : employees){
+                    if(!employee.equals("")){
+                        ProductionEmployees productionEmployees = new ProductionEmployees();
+                        productionEmployees.setPeEmployeeId(Integer.valueOf(employee));
+                        productionEmployees.setPePlanId(productionPlan.getPlanId());
+                        productionPlanningMapper.addProductionEmployees(productionEmployees);
+                    }
+                }
+            }
+        }else{
+            return 0;
+        }
+        return 1;
+    }
+
+    @Override
+    public PagedResult<ProductionPlan> listProductionPlan(PageRequest<ProductionPlan> pageRequest) {
+        PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());
+        List<ProductionPlan> productionPlanList = productionPlanningMapper.listProductionPlan(pageRequest.getData());
+        return PageUtil.getPage(productionPlanList);
+    }
+    @Override
+    public List<ProductionPlan> listProductionPlan(ProductionPlan productionPlan) {
+        return productionPlanningMapper.listProductionPlan(productionPlan);
+    }
+
+    @Override
+    public Integer updateProductionPlan(ProductionPlan productionPlan) {
+        //删除员工项
+        productionPlanningMapper.delProductionEmployeesList(productionPlan.getPlanId());
+        //添加员工项
+        if(productionPlan.getEmployeeString() != null && !productionPlan.getEmployeeString().equals("")){
+            String[] employees = productionPlan.getEmployeeString().split("_");
+            for(String employee : employees){
+                if(!employee.equals("")){
+                    ProductionEmployees productionEmployees = new ProductionEmployees();
+                    productionEmployees.setPeEmployeeId(Integer.valueOf(employee));
+                    productionEmployees.setPePlanId(productionPlan.getPlanId());
+                    productionPlanningMapper.addProductionEmployees(productionEmployees);
+                }
+            }
+        }
+        return productionPlanningMapper.updateProductionPlan(productionPlan);
+    }
+
+    @Override
+    public Integer addProductionEmployees(ProductionEmployees productionEmployees) {
+        return productionPlanningMapper.addProductionEmployees(productionEmployees);
+    }
+
+    @Override
+    public Integer delProductionEmployees(Integer peId) {
+        return productionPlanningMapper.delProductionEmployees(peId);
+    }
+
+    @Override
+    public Integer delProductionEmployeesList(Integer pePlanId) {
+        return productionPlanningMapper.delProductionEmployeesList(pePlanId);
+    }
+
+    @Override
+    public List<ProductionEmployees> listProductionEmployees(Integer pePlanId) {
+        return productionPlanningMapper.listProductionEmployees(pePlanId);
+    }
+
+    @Override
+    public ProductionProcess getProductionProcess(Integer processId) {
+        return productionPlanningMapper.getProductionProcess(processId);
+    }
+
+    @Override
+    public Integer addProductionProcess(ProductionProcess productionProcess) {
+        return productionPlanningMapper.addProductionProcess(productionProcess);
+    }
+
+    @Override
+    public List<ProductionProcess> listProductionProcess(ProductionProcess productionProcess) {
+        return productionPlanningMapper.listProductionProcess(productionProcess);
+    }
+    @Transactional
+    @Override
+    public Integer delProductionPlan(Integer planId) {
+        if(productionPlanningMapper.delProductionPlan(planId) > 0){
+            productionPlanningMapper.delProductionEmployeesList(planId);
+        }
+        return 1;
+    }
+
+    @Override
+    public Integer getPlanCount() {
+        return productionPlanningMapper.getPlanCount();
+    }
+
+    @Override
+    public List<ProductionPlan> getPlanRepeat(ProductionPlan productionPlan) {
+        return productionPlanningMapper.getPlanRepeat(productionPlan);
+    }
+}

+ 30 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/PtsEmployeeServiceImpl.java

@@ -3,13 +3,19 @@ package com.iamberry.rst.service.pts;
 import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.faq.FAQDetails;
 import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.ProductionPlan;
 import com.iamberry.rst.core.pts.PtsEmployee;
 import com.iamberry.rst.faces.pts.PtsEmployeeService;
+import com.iamberry.rst.service.pts.mapper.ProductionPlanningMapper;
 import com.iamberry.rst.service.pts.mapper.PtsEmployeeMapper;
 import com.iamberry.rst.util.PageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -21,6 +27,8 @@ public class PtsEmployeeServiceImpl implements PtsEmployeeService {
 
     @Autowired
     private PtsEmployeeMapper ptsEmployeeMapper;
+    @Autowired
+    private ProductionPlanningMapper productionPlanningMapper;
 
     /**
      * 获取员工信息
@@ -51,6 +59,28 @@ public class PtsEmployeeServiceImpl implements PtsEmployeeService {
     public PagedResult<PtsEmployee> getEmployeeList(int pageNO, int pageSize,PtsEmployee employee, boolean isTotalNum) {
         PageHelper.startPage(pageNO, pageSize, isTotalNum);
         List<PtsEmployee> list = ptsEmployeeMapper.getPtsEmployeeList(employee);
+        //判断是否已经参加其他工作计划
+        if(list != null && list.size() > 0){
+            boolean is = false;
+            ProductionPlan plan = new ProductionPlan();
+            SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
+            try {
+                plan.setPlanDate(sd.parse(sd.format(new Date())));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            for(PtsEmployee e : list){
+                    plan.setEmployeeId(e.getEmployeeId());
+                List<ProductionPlan> plans = productionPlanningMapper.getPlanRepeat(plan);
+                if(plans != null && plans.size() > 0){
+                        e.setIsJoinProcess(1);
+                        e.setProcessName(plans.get(0).getProcessName());
+                    }else{
+                        e.setIsJoinProcess(2);
+                    }
+            }
+
+        }
         return PageUtil.getPage(list);
     }
 

+ 51 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/ProductionPlanningMapper.java

@@ -0,0 +1,51 @@
+package com.iamberry.rst.service.pts.mapper;
+
+import com.iamberry.rst.core.pts.ProductionEmployees;
+import com.iamberry.rst.core.pts.ProductionPlan;
+import com.iamberry.rst.core.pts.ProductionProcess;
+
+import java.util.List;
+
+public interface ProductionPlanningMapper {
+        //获取生产计划
+        ProductionPlan getProductionPlan(Integer planId);
+
+        //添加生产计划
+        Integer addProductionPlan(ProductionPlan productionPlan);
+
+        //查询生产计划列表
+        List<ProductionPlan> listProductionPlan(ProductionPlan productionPlan);
+
+        //修改生产计划列表
+        Integer updateProductionPlan(ProductionPlan productionPlan);
+
+        //添加生产计划员工
+        Integer addProductionEmployees(ProductionEmployees productionEmployees);
+
+        //删除单个生产计划员工
+        Integer delProductionEmployees(Integer peId);
+
+        //删除生产计划所有员工
+        Integer delProductionEmployeesList(Integer pePlanId);
+
+        //查询生产计划所有员工
+        List<ProductionEmployees> listProductionEmployees(Integer pePlanId);
+
+        //查询生产工序
+        ProductionProcess getProductionProcess(Integer processId);
+
+        //查询生产工序
+        Integer addProductionProcess(ProductionProcess productionProcess);
+
+        //查询所有生产工序
+        List<ProductionProcess> listProductionProcess(ProductionProcess productionProcess);
+
+        //删除生产计划
+        Integer delProductionPlan(Integer planId);
+
+        //获取当日工作计划条数
+        Integer getPlanCount();
+
+        //获取工序重复员工条数
+        List<ProductionPlan> getPlanRepeat(ProductionPlan productionPlan);
+}

+ 235 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/productionPlanningMapper.xml

@@ -0,0 +1,235 @@
+<?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.pts.mapper.ProductionPlanningMapper">
+
+    <select id="getProductionPlan" parameterType="Integer" resultType="ProductionPlan">
+        SELECT
+        plan_id AS planId,
+        plan_date AS planDate,
+        plan_process_id AS planProcessId,
+        plan_stay AS  planStay,
+        plan_work_hours AS planWorkHours,
+        plan_results AS  planResults,
+        plan_create_time AS planCreateTime,
+        plan_update_time AS planUpdateTime,
+        process_name AS processName,
+        process_workinghours AS processWorkinghours,
+        count(pe.pe_id) AS employeesNum
+        FROM
+        tb_rst_pts_production_plan  pp
+        LEFT JOIN tb_rst_pts_production_process ppp on pp.plan_process_id = ppp.process_id
+        LEFT JOIN tb_rst_pts_production_employees pe on pe.pe_plan_id = pp.plan_id
+        WHERE
+        plan_id = #{planId}
+    </select>
+
+    <insert id="addProductionPlan" parameterType="ProductionPlan" keyProperty="planId" useGeneratedKeys="true">
+        INSERT INTO tb_rst_pts_production_plan
+        (
+        plan_date,
+        plan_process_id,
+        plan_stay,
+        plan_work_hours,
+        plan_results,
+        plan_create_time
+        )
+        VALUES
+        (
+        #{planDate},
+        #{planProcessId},
+        #{planStay},
+        #{planWorkHours},
+        #{planResults},
+        NOW()
+        )
+    </insert>
+
+    <select id="listProductionPlan" parameterType="ProductionPlan" resultType="ProductionPlan">
+        SELECT
+        plan_id AS planId,
+        plan_date AS planDate,
+        plan_process_id AS planProcessId,
+        plan_stay AS  planStay,
+        plan_work_hours AS planWorkHours,
+        plan_results AS  planResults,
+        plan_create_time AS planCreateTime,
+        plan_update_time AS planUpdateTime,
+        process_name AS processName,
+        process_workinghours AS processWorkinghours,
+        count(pe.pe_id) AS employeesNum
+        FROM
+        tb_rst_pts_production_plan  pp
+        LEFT JOIN tb_rst_pts_production_process ppp on pp.plan_process_id = ppp.process_id
+        LEFT JOIN tb_rst_pts_production_employees pe on pe.pe_plan_id = pp.plan_id
+        <where>
+            <if test="planDate != null and planDate != ''">
+                plan_date = #{planDate}
+            </if>
+            <if test="planProcessId != null and planProcessId != ''">
+                AND plan_process_id = #{planProcessId}
+            </if>
+            <if test="employeeId != null and employeeId != ''">
+                AND pe.pe_employee_id = #{employeeId}
+            </if>
+        </where>
+        group by plan_id
+    </select>
+
+    <update id="updateProductionPlan" parameterType="ProductionPlan">
+        UPDATE tb_rst_pts_production_plan
+        <set>
+            <if test="planDate !=null and planDate !=''">
+                plan_date = #{planDate},
+            </if>
+            <if test="planProcessId !=null and planProcessId !=''">
+                plan_process_id = #{planProcessId},
+            </if>
+            <if test="planStay !=null and planStay !=''">
+                plan_stay = #{planStay},
+            </if>
+            <if test="planWorkHours !=null and planWorkHours !=''">
+                plan_work_hours = #{planWorkHours},
+            </if>
+            <if test="planResults !=null">
+                plan_results = #{planResults}
+            </if>
+        </set>
+        WHERE
+        plan_id = #{planId}
+    </update>
+
+    <insert id="addProductionEmployees" parameterType="ProductionEmployees">
+        INSERT INTO tb_rst_pts_production_employees
+        (
+        pe_plan_id,
+        pe_employee_id,
+        pe_create_time
+        )
+        VALUES
+        (
+        #{pePlanId},
+        #{peEmployeeId},
+        NOW()
+        )
+    </insert>
+    <delete id="delProductionEmployees" parameterType="Integer">
+        delete from tb_rst_pts_production_employees
+        where
+        pe_id = #{peId}
+    </delete>
+    <delete id="delProductionEmployeesList" parameterType="Integer">
+        delete from tb_rst_pts_production_employees
+        where
+        pe_plan_id = #{pePlanId}
+    </delete>
+    <select id="listProductionEmployees" parameterType="Integer" resultType="ProductionEmployees">
+        SELECT
+        pe_id AS peId,
+        pe_plan_id AS pePlanId,
+        pe_employee_id AS peEmployeeId,
+        pe_update_time AS  peUpdateTime,
+        pe_create_time AS  pcCreateTime,
+        pee.employee_name AS  peEmployeeName,
+        pee.employee_no AS  peEmployeeNo
+        FROM
+        tb_rst_pts_production_employees pe
+        LEFT  JOIN tb_rst_pts_employee pee on pe.pe_employee_id = pee.employee_id
+        WHERE
+        pe_plan_id = #{planId}
+    </select>
+
+
+    <delete id="delProductionPlan" parameterType="Integer">
+        delete from tb_rst_pts_production_plan
+        where
+        plan_id = #{planId}
+    </delete>
+
+
+
+
+    <select id="getProductionProcess" parameterType="Integer" resultType="ProductionProcess">
+        SELECT
+        process_id AS processId,
+        process_name AS processName,
+        process_workinghours AS processWorkinghours,
+        process_unit AS  processUnit,
+        process_status AS processStatus,
+        process_no AS  processNo,
+        process_create_time AS processCreateTime,
+        process_update_time AS processUpdateTime
+        FROM
+        tb_rst_pts_production_process
+        WHERE
+        process_id = #{processId}
+    </select>
+
+    <insert id="addProductionProcess" parameterType="ProductionProcess" keyProperty="processId" useGeneratedKeys="true">
+        INSERT INTO tb_rst_pts_production_process
+        (
+        process_name,
+        process_workinghours,
+        process_unit,
+        process_status,
+        process_no,
+        process_create_time
+        )
+        VALUES
+        (
+        #{processName},
+        #{processWorkinghours},
+        #{processUnit},
+        #{processStatus},
+        #{processNo},
+        NOW()
+        )
+    </insert>
+    <select id="listProductionProcess" parameterType="ProductionProcess" resultType="ProductionProcess">
+        SELECT
+        process_id AS processId,
+        process_name AS processName,
+        process_workinghours AS processWorkinghours,
+        process_unit AS  processUnit,
+        process_status AS processStatus,
+        process_no AS  processNo,
+        process_create_time AS processCreateTime,
+        process_update_time AS processUpdateTime
+        FROM
+        tb_rst_pts_production_process
+        <where>
+            <if test="processName != null and processName != ''">
+                process_name like CONCAT('%',#{processName},'%')
+            </if>
+            <if test="processWorkinghours != null and processWorkinghours != ''">
+                AND process_workinghours = #{processWorkinghours}
+            </if>
+            <if test="processStatus != null and processStatus != ''">
+                AND process_status = #{processStatus}
+            </if>
+        </where>
+    </select>
+    <select id="getPlanCount" resultType="Integer">
+        select count(1) from tb_rst_pts_production_plan where to_days(plan_date) = to_days(now())
+    </select>
+    <select id="getPlanRepeat" parameterType="ProductionPlan" resultType="ProductionPlan">
+        SELECT
+        plan_id AS planId,
+        plan_date AS planDate,
+        plan_process_id AS planProcessId,
+        plan_stay AS  planStay,
+        plan_work_hours AS planWorkHours,
+        plan_results AS  planResults,
+        plan_create_time AS planCreateTime,
+        plan_update_time AS planUpdateTime,
+        process_name AS processName
+        FROM
+            tb_rst_pts_production_plan pp
+        LEFT JOIN tb_rst_pts_production_employees pe on pe.pe_plan_id = pp.plan_id
+                LEFT JOIN tb_rst_pts_production_process ppp on pp.plan_process_id = ppp.process_id
+        WHERE
+            to_days(plan_date) = to_days(#{planDate})
+        AND
+        pe.pe_employee_id = #{employeeId}
+        group by plan_id
+    </select>
+</mapper>

+ 2 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/sys/mapper/sysMapper.xml

@@ -234,7 +234,8 @@
 	</select>
 	<!-- 获取管理员信息 -->
 	<select id="getAdminInfo" parameterType="Admin" resultType="Admin">
-		SELECT * FROM tb_rst_sys_admin
+		SELECT *,tb_rst_sys_admin_depart.depart_name departName FROM tb_rst_sys_admin
+		LEFT JOIN tb_rst_sys_admin_depart on tb_rst_sys_admin.admin_dept = tb_rst_sys_admin_depart.depart_id
 		<where>
 			<if test="adminOpenId != null">
 				admin_open_id = #{adminOpenId}

+ 11 - 3
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -1330,6 +1330,12 @@ public class AdminCustomerController {
     public ModelAndView toUpdateRenewed(HttpServletRequest request) throws Exception {
         ModelAndView mv = new ModelAndView("cm/customer/update_relation");
         String customerId = request.getParameter("customerId");
+        String type = request.getParameter("type");
+        if(type != null && !type.equals("")){
+            mv.addObject("type",type);
+        }else{
+            mv.addObject("type",0);
+        }
         CmRelation cmRelation = new CmRelation();
         cmRelation.setCustomerId(Integer.valueOf(customerId));
         cmRelation = customerService.getCmRelationInfo(cmRelation);
@@ -1629,14 +1635,14 @@ public class AdminCustomerController {
             return new ResponseJson(500, "该条客诉已在申请邮费中了", 500);
         }
 
-        String orderId = "";
+        /*String orderId = "";
         for (SalesOrder salesOrder : cmRelation.getSalesOrderList()) {
             if ("".equals(orderId)) {
                 orderId = salesOrder.getSalesOrderId();
             } else {
                 orderId += "," + salesOrder.getSalesOrderId();
             }
-        }
+        }*/
 
         Integer flag = 0;
         Postage postage = new Postage();
@@ -1647,7 +1653,7 @@ public class AdminCustomerController {
         postage.setPostageManagerStatus(1);     //------考虑手动点, 直接变为申请中
         postage.setPostageOrderSource(customerInfo.getStoreId());   //店铺id
 //        postage.setPostageTreatmentMethod(cmRelation.getProcMethodId()); //处理方式
-        postage.setSalesOrderId(orderId);       //efast订单号
+       // postage.setSalesOrderId(orderId);       //efast订单号
         postage.setPostageClientName(cmRelation.getRelationBackName());
         postage.setPostageClientTel(cmRelation.getRelationBackTel());
         postage.setPostageClientAddress(cmRelation.getRelationSendAddress());
@@ -2720,6 +2726,8 @@ public class AdminCustomerController {
         }
         complaintAfterSalesNum.setCompleteSent(complaintSignclosedInfoService.getCompleteSent(signcloseds));
         /*查询签收数据 end*/
+        //待打印邮费申请
+        complaintAfterSalesNum.setPostagePrintedNum(postageService.getPostagePrintedNum());
         rj.addResponseKeyValue("complaintAfterSalesNum",complaintAfterSalesNum);
         rj.addResponseKeyValue("isOneself",isOneself);
         return rj;

+ 78 - 22
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminPostageController.java

@@ -4,10 +4,9 @@ import com.iamberry.rst.core.cm.*;
 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.faces.cm.CompanyInfoService;
-import com.iamberry.rst.faces.cm.PostageAuthorityLogService;
-import com.iamberry.rst.faces.cm.PostageAuthorityService;
-import com.iamberry.rst.faces.cm.PostageService;
+import com.iamberry.rst.core.sys.SysConfig;
+import com.iamberry.rst.faces.cm.*;
+import com.iamberry.rst.faces.sys.SysConfigService;
 import com.iamberry.rst.faces.sys.SysService;
 import com.iamberry.rst.utils.AdminUtils;
 import com.iamberry.rst.utils.StitchAttrUtil;
@@ -24,10 +23,7 @@ import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
 import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * Created by wxm
@@ -48,6 +44,14 @@ public class AdminPostageController {
     private CompanyInfoService companyInfoService;
     @Autowired
     private PostageAuthorityLogService postageAuthorityLogService;
+    @Autowired
+    private SalesOrderService salesOrderService;
+    @Autowired
+    private ProcMethodService procMethodService;
+    @Autowired
+    private SysConfigService sysConfigService;
+    @Autowired
+    private CustomerService customerService;
 
     /**
      * 获取客诉列表
@@ -67,9 +71,9 @@ public class AdminPostageController {
         PagedResult<Postage> pagedResult = new PagedResult<>();
 
         List<CompanyInfo> companyInfoList = companyInfoService.listCompanyInfo(new CompanyInfo());
-
+        String adminid = sysConfigService.getSysConfig(8);//客服经理配置id
         //获取登录人id
-        if(loginAdmin.getAdminDept() == 3){        //客服
+        if(loginAdmin.getAdminDept() == 3 && !loginAdmin.getAdminId().equals(Integer.valueOf(adminid))){//客服
             postage.setAdminId(loginAdmin.getAdminId());
 
             if(companyInfoList != null && companyInfoList.size() > 0){
@@ -99,7 +103,8 @@ public class AdminPostageController {
 
         getManager(loginAdmin,pagedResult);
 
-         StitchAttrUtil.getSa().setModelAndView(postage, mv, "/admin/postage/postage_list", pagedResult);
+         StitchAttrUtil.getSa().addNoPro("companyIds").addNoPro("postageAuthorityLogList")
+                 .setModelAndView(postage, mv, "/admin/postage/postage_list", pagedResult);
         return mv;
     }
 
@@ -115,14 +120,15 @@ public class AdminPostageController {
             ArrayList authorityFinancialPaymentList =  new ArrayList();
             List<PostageAuthority> postageAuthorityList = postageAuthorityService.getPostageAuthorityListByAdminId(loginAdmin.getAdminId());
             for (PostageAuthority postageAuthority:postageAuthorityList ) {
-                if(companyId == postageAuthority.getCompanyId()){
-                    if(loginAdmin.getAdminId() == postageAuthority.getAuthorityCustomerManager()){
+                if(companyId.intValue() == postageAuthority.getCompanyId().intValue()){
+
+                    if(loginAdmin.getAdminId().intValue() == postageAuthority.getAuthorityCustomerManager().intValue()){
                         authorityCustomerManagerList.add(postageAuthority.getAuthorityCustomerManager());
                     }
-                    if(loginAdmin.getAdminId() == postageAuthority.getAuthorityFinancialManager()){
+                    if(loginAdmin.getAdminId().intValue() == postageAuthority.getAuthorityFinancialManager().intValue()){
                         authorityFinancialManagerList.add(postageAuthority.getAuthorityFinancialManager());
                     }
-                    if(loginAdmin.getAdminId() == postageAuthority.getAuthorityFinancialPayment()){
+                    if(loginAdmin.getAdminId().intValue() == postageAuthority.getAuthorityFinancialPayment().intValue()){
                         authorityFinancialPaymentList.add(postageAuthority.getAuthorityFinancialPayment());
                     }
                 }
@@ -145,7 +151,7 @@ public class AdminPostageController {
                 pagedResult.getDataList().get(i).setFinancePay(0);
             }
 
-            if(pagedResult.getDataList().get(i).getAdminId() == loginAdmin.getAdminId()){
+            if(pagedResult.getDataList().get(i).getAdminId().intValue() ==  loginAdmin.getAdminId().intValue()){
                 pagedResult.getDataList().get(i).setCustomerConfirm(1);
             }else{
                 pagedResult.getDataList().get(i).setCustomerConfirm(0);
@@ -171,17 +177,17 @@ public class AdminPostageController {
         for (PostageAuthority authority : postageAuthorityList) {
             switch (reviewNumber){
                 case 2:
-                    if(authority.getAuthorityCustomerManager() == loginAdmin.getAdminId()){
+                    if(authority.getAuthorityCustomerManager().intValue() == loginAdmin.getAdminId().intValue()){
                         flag = true;
                     }
                     break;
                 case 3:
-                    if(authority.getAuthorityFinancialManager() == loginAdmin.getAdminId()){
+                    if(authority.getAuthorityFinancialManager().intValue() == loginAdmin.getAdminId().intValue()){
                         flag = true;
                     }
                     break;
                 case 4:
-                    if(authority.getAuthorityFinancialPayment() == loginAdmin.getAdminId()){
+                    if(authority.getAuthorityFinancialPayment().intValue() == loginAdmin.getAdminId().intValue()){
                         flag = true;
                     }
                     break;
@@ -229,8 +235,10 @@ public class AdminPostageController {
                     if(status == 2){    //状态(客服经理审核)1:审核中 2:通过  3:驳回
                         postage.setPostageManagerStatus(status);
                         postage.setPostageFinanceStatus(1);     //审核中
+                        postage.setPostageCustomerTime(new Date());     //审核时间
                     }else{
                         postage.setPostageManagerStatus(status);    //驳回
+                        postage.setPostageCustomerTime(new Date());     //审核时间
                     }
                     num = postageService.updatePostage(postage);
                     if(num > 0){        //客服经理审核
@@ -248,11 +256,13 @@ public class AdminPostageController {
                     if(status == 2){
                         postage.setPostageFinanceStatus(status);
                         postage.setPostageTransferStatus(1);
+                        postage.setPostageFinanceTime(new Date());     //审核时间
                     }else{
                         postage.setPostageFinanceStatus(status);
+                        postage.setPostageFinanceTime(new Date());     //审核时间
                     }
                     num = postageService.updatePostage(postage);
-                    if(num > 0){        //客服经理审核
+                    if(num > 0){        //财务审核记录
                         PostageAuthorityLog postageAuthorityLog = new PostageAuthorityLog();
                         postageAuthorityLog.setAdminId(loginAdmin.getAdminId());
                         postageAuthorityLog.setPostageId(postageId);
@@ -266,12 +276,18 @@ public class AdminPostageController {
                     //转账状态 是否转账:1已转   2:未转
                     postage.setPostageTransferStatus(status);
                     num = postageService.updatePostage(postage);
-                    if(num > 0){        //客服经理审核
+                    if(num > 0){        //财务打款记录
                         PostageAuthorityLog postageAuthorityLog = new PostageAuthorityLog();
                         postageAuthorityLog.setAdminId(loginAdmin.getAdminId());
                         postageAuthorityLog.setPostageId(postageId);
                         postageAuthorityLog.setAuthorityLogType(4);
                         postageAuthorityLogService.save(postageAuthorityLog);       //增加日志
+
+                        //同步客诉邮费记录为已转账
+                        PostageInfo postageInfo= new PostageInfo();
+                        postageInfo.setPostageId(post.getCustomerPostageId());
+                        postageInfo.setPostageStatus(3);
+                        customerService.updatePostageInfo(postageInfo);
                     }
                 }
                 break;
@@ -294,15 +310,33 @@ public class AdminPostageController {
         if(postageId == null || postageId == 0){
             return new ResponseJson(500, "未获取到记录id", 500);
         }
+        Admin loginAdmin = AdminUtils.getLoginAdmin();
+        ResponseJson responseJson = new ResponseJson(200, "查询成功", 200);
         Postage  postage = postageService.getPostage(postageId);
 
         PostageAuthorityLog postageAuthorityLog = new PostageAuthorityLog();
         postageAuthorityLog.setPostageId(postageId);
         List<PostageAuthorityLog> postageAuthorityLogList = postageAuthorityLogService.getPostageAuthorityLogList(postageAuthorityLog);
         postage.setPostageAuthorityLogList(postageAuthorityLogList);
+        if(postage.getSalesOrderId() != null){
+            SalesOrder salesOrder = salesOrderService.getSalesOrderById(postage.getSalesOrderId());
+            responseJson.addResponseKeyValue("salesOrder",salesOrder);
+            SalesOrderItem salesOrderItem = new SalesOrderItem();
+            salesOrderItem.setItemOrderId(salesOrder.getSalesId());
+            List<SalesOrderItem> itemList = salesOrderService.listSalesOrderItem(salesOrderItem);
+            responseJson.addResponseKeyValue("itemList",itemList);
 
+        }
+        ProcMethod procMethod = procMethodService.getProcMethodById(postage.getPostageTreatmentMethod());
+        responseJson.addResponseKeyValue("procMethod",procMethod);
+        Admin admin = new Admin();
+        admin.setAdminId(postage.getAdminId());
+        admin = sysService.getAdminInfo(admin);
+        responseJson.addResponseKeyValue("admin",admin);//申请人信息
+        responseJson.addResponseKeyValue("loginAdmin",loginAdmin);//登录人信息
         if(postage != null){
-            return new ResponseJson(200, "修改状态成功", 200);
+            responseJson.addResponseKeyValue("postage",postage);
+            return responseJson;
         }else{
             return new ResponseJson(500, "修改状态失败", 500);
         }
@@ -323,6 +357,28 @@ public class AdminPostageController {
         num = postageService.delPostage(postageId);
 
         if(num > 0){
+            return new ResponseJson(200, "删除成功", 200);
+        }else{
+            return new ResponseJson(500, "删除失败", 500);
+        }
+    }
+
+    /**
+     * 修改打印状态
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/updatePostagePrint")
+    public ResponseJson updatePostagePrint(HttpServletRequest request, Integer postageId) throws Exception {
+        if(postageId == null || postageId == 0){
+            return new ResponseJson(500, "未获取到记录id", 500);
+        }
+        Integer num = 0;
+        Postage postage = new Postage();
+        postage.setPostageId(postageId);
+        postage.setPostageIsPrint(2);
+        num = postageService.updatePostage(postage);
+        if(num > 0){
             return new ResponseJson(200, "修改状态成功", 200);
         }else{
             return new ResponseJson(500, "修改状态失败", 500);

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/kuaidi/LogisticsController.java

@@ -49,7 +49,7 @@ public class LogisticsController {
         LogisticsInfo log = new LogisticsInfo();
         log.setLogisticsRstCode(com);
         List<LogisticsInfo> listlog = logisticsInfoService.getLogisticsInfoList(log);
-        rst = kuaidi100.selectCourierCompany2(listlog.get(0).getLogisticsOnehundredCode(),nu);
+        rst = kuaidi100.selectCourierCompany2(listlog.get(0),nu);
         msg.setResultCode(ResultInfo.SUCCESSCODE);
         msg.setMessage(NameUtils.getConfig("SUCCESSINFO"));
         msg.setData(rst);

+ 24 - 34
watero-rst-web/src/main/java/com/iamberry/rst/controllers/mq/MQTask.java

@@ -46,7 +46,7 @@ import static com.iamberry.rst.util.SmsConfig.*;
 @Lazy(false)
 public class MQTask implements InitializingBean {
 
-	private static Logger logger = LoggerFactory.getLogger(SysController.class);
+	private static Logger logger = LoggerFactory.getLogger(MQTask.class);
 
 	@Autowired
 	private MessageService messageService;
@@ -589,42 +589,32 @@ public class MQTask implements InitializingBean {
 	//@Scheduled(cron = "*/10 * * * * ?")
 	//@Scheduled(cron = "0 0 9,11,14,16,18,20 * * ? ")//推送时间分别为每天早上九点、中午十一点、下午三点、下午六点、晚上八点
 	//@Scheduled(cron = "0 0 */1 * * ?")//每小时执行一次
-//	@Scheduled(cron = "0 0/3 * * * ?")//每三分钟执行一次
+	/*@Scheduled(cron = "0 0/3 * * * ?")//每三分钟执行一次*/
 	@Scheduled(cron = "0 0/30 * * * ?")//每半个小时执行一次
 	public void orderCaseDate(){
-		logger.info("------------查询订单揽件时间 start-----------");
+		logger.info("查询订单揽件时间");
 		List<SalesOrder> salesOrderList = salesOrderService.orderAfterCaseDate();
-		Integer num = 0;
-		Integer numSellpNum = 0;
-		if(salesOrderList != null && salesOrderList.size()>0){
-			logger.info("------------查询订单揽件时间 - 需要查询揽件订单数量:"+ salesOrderList.size() +"-----------");
-			for (SalesOrder salesOrder:salesOrderList) {
-				try {
-					if(numSellpNum > 30){
-						numSellpNum =0;
-						Thread.sleep(60000);
-					}
-				} catch (InterruptedException e) {
-					e.printStackTrace();
-				}
-				LogisticsInfo log = new LogisticsInfo();
-				log.setLogisticsRstCode(salesOrder.getSalesPostFirm());
-				List<LogisticsInfo> listlog = logisticsInfoService.getLogisticsInfoList(log);
-				Date date = kuaidi100.selectCourierSignCaseTime(listlog.get(0).getLogisticsOnehundredCode(),salesOrder.getSalesPostNum());
-				if(date != null){
-					SalesOrder so = new SalesOrder();
-					so.setSalesId(salesOrder.getSalesId());
-					so.setOrderCaseDate(date);
-					Integer flag = salesOrderService.update(so);
-					if(flag < 1){
-						logger.info("修改揽件时间异常,订单号:"+salesOrder.getSalesOrderId());
-					}
-					num ++;
-				}
-				numSellpNum++;
-			}
-		}
-		logger.info("------------查询订单揽件时,本次处理揽件事件数量"+ num +" end-----------");
+		if (salesOrderList == null || salesOrderList.isEmpty()) {
+		    return;
+        }
+        for (SalesOrder salesOrder:salesOrderList) {
+            // 查询订单对应的物流公司
+            LogisticsInfo log = new LogisticsInfo();
+            log.setLogisticsRstCode(salesOrder.getSalesPostFirm());
+            List<LogisticsInfo> listlog = logisticsInfoService.getLogisticsInfoList(log);
+            // 调用第三方接口查询物流信息
+            Date date = kuaidi100.selectCourierSignCaseTime(listlog.get(0),salesOrder.getSalesPostNum());
+            if(date == null){
+                continue;
+            }
+            // 编辑订单的揽件时间
+            SalesOrder so = new SalesOrder();
+            so.setSalesId(salesOrder.getSalesId());
+            so.setOrderCaseDate(date);
+            if(salesOrderService.update(so) <= 0){
+                logger.info("修改揽件时间异常,订单号:"+salesOrder.getSalesOrderId());
+            }
+        }
 	}
 
 }

+ 37 - 53
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminOrderController.java

@@ -1055,29 +1055,29 @@ public class AdminOrderController {
         }else{
             batchId = orderBatch;
         }
-        StringBuffer sb = new StringBuffer();
-         for(SalesOrder salesOrders: mapsalesOrderList.values()){
-             String salesDealCode = salesOrders.getSalesDealCode();
-             salesOrders.setSalesBatchId(batchId);
-             //增加订单方式 1:手动增加 2:Excel导入
-
-             try{
-                 DealerChannel dealerChannel = new DealerChannel();
-                 boolean flag = true;
-                 if(salesOrders.getSalesStoreId() != null){
-                     dealerChannel.setStoreId(salesOrders.getSalesStoreId());
-                     List<DealerChannel>  dealerChannelList = dealerChannelService.getDealerChannelList(dealerChannel);
-                     if(dealerChannelList!= null && dealerChannelList.size() > 0){
-                         dealerChannel = dealerChannelList.get(0);
-                     }else{
-                         salesOrders.setSalesDealCode("1");  //salesDealCode
-                         throw new Exception("订单导入失败-查询店铺对应客户信息失败,店铺ID:"+salesOrders.getSalesStoreId()+"。");
-                     }
+        StringBuilder sb = new StringBuilder();
+        for(SalesOrder salesOrders: mapsalesOrderList.values()){
+            String salesDealCode = salesOrders.getSalesDealCode();
+            salesOrders.setSalesBatchId(batchId);
+            //增加订单方式 1:手动增加 2:Excel导入
+
+            try{
+                DealerChannel dealerChannel = new DealerChannel();
+                boolean flag = true;
+                if(salesOrders.getSalesStoreId() != null){
+                    dealerChannel.setStoreId(salesOrders.getSalesStoreId());
+                    List<DealerChannel>  dealerChannelList = dealerChannelService.getDealerChannelList(dealerChannel);
+                    if(dealerChannelList!= null && dealerChannelList.size() > 0){
+                        dealerChannel = dealerChannelList.get(0);
+                    }else{
+                        salesOrders.setSalesDealCode("1");
+                        throw new Exception("订单导入失败-查询店铺对应客户信息失败,店铺ID:"+salesOrders.getSalesStoreId()+"。");
+                    }
 
-                     DealerProduct smallDp = new DealerProduct();
-                     smallDp.setDealerId(dealerChannel.getDealerId());
-                     smallDp.setDealChannelId(dealerChannel.getDealChannelId());
-                     List<DealerProduct> smallDpList = dealerProductService.getProductByChannelList(smallDp);
+                    DealerProduct smallDp = new DealerProduct();
+                    smallDp.setDealerId(dealerChannel.getDealerId());
+                    smallDp.setDealChannelId(dealerChannel.getDealChannelId());
+                    List<DealerProduct> smallDpList = dealerProductService.getProductByChannelList(smallDp);
 
                      //表示分配剩余总金额
                      Integer lastTotal = salesOrders.getSalesAmount();
@@ -1107,11 +1107,11 @@ public class AdminOrderController {
                                  }
                              }
                              if(!isHaveColorId){
-                                 salesOrders.setSalesDealCode("1");  //salesDealCode
+                                 salesOrders.setSalesDealCode("1");
                                  throw new Exception("订单导入-未能从该客户中获取到对应产品的信息,客户名称:"+dealerChannel.getDealerName()+",---产品:"+ salesOrderItem.getItemProductName()+"("+ salesOrderItem.getItemProductColor() +")。");
                              }
                          }else{
-                             salesOrders.setSalesDealCode("1");  //salesDealCode
+                             salesOrders.setSalesDealCode("1");
                              throw new Exception("订单导入-未能从该客户中获取到对应产品的信息,客户名称:"+dealerChannel.getDealerName()+",---产品:"+ salesOrderItem.getItemProductName()+"("+ salesOrderItem.getItemProductColor() +")。");
                          }
 
@@ -1154,35 +1154,19 @@ public class AdminOrderController {
                              }
                          }
                      }
-                 }else{
-                     salesOrders.setSalesDealCode("1");  //salesDealCode
-                     throw new Exception("订单导入-获取店铺ID失败,店铺ID:"+salesOrders.getSalesStoreId()+"。");
-                 }
-
-                 //计算订单总金额
-//                 Integer itemProductPrice=0;   //产品市场价
-//                 Integer itemProductDiscount=0; //产品折扣价
-                 for (SalesOrderItem salesOrderItem:salesOrders.getSalesOrderItemList()) {
-                     salesOrderItem.setItemProductPrice(0);
-                     salesOrderItem.setItemProductDiscount(0);
-                 }
-                 salesOrders.setSalesPayMoney(salesOrders.getSalesAmount());
-
-
-//                    bl = salesOrderService.addRstOrderAndIteminfo(salesOrders);
-//                    if(bl == false){
-//                        logger.info("合并订单出错+:"+bl + "错误交易号为:"+salesDealCode);
-//                        for(EfastOrder efastOrderStyle:orderEfasts){
-//                            if(salesDealCode.equals(efastOrderStyle.getPlatformOrderId()))
-//                                efastOrderStyle.setStyleColor("color:red;");
-//                        }
-//                    }else{
-//                        for(EfastOrder efastOrderStyle:orderEfasts){
-//                            if(salesDealCode.equals(efastOrderStyle.getPlatformOrderId()))
-//                                efastOrderStyle.setStyleColor("color:black;");
-//                        }
-//                        sb.append(salesDealCode+"\r\n");
-//                    }
+                     }else{
+                         salesOrders.setSalesDealCode("1");
+                         throw new Exception("订单导入-获取店铺ID失败,店铺ID:"+salesOrders.getSalesStoreId()+"。");
+                     }
+
+                    //计算订单总金额
+                    //Integer itemProductPrice=0;   //产品市场价
+                    //Integer itemProductDiscount=0; //产品折扣价
+                    for (SalesOrderItem salesOrderItem:salesOrders.getSalesOrderItemList()) {
+                        salesOrderItem.setItemProductPrice(0);
+                        salesOrderItem.setItemProductDiscount(0);
+                    }
+                    salesOrders.setSalesPayMoney(salesOrders.getSalesAmount());
                     bl = salesOrderService.addRstOrderinfo(salesOrders,new ArrayList<SalesOrder>(),null);
                 }catch (Exception e){
                     e.printStackTrace();

+ 159 - 77
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminSalesOrderController.java

@@ -1,5 +1,6 @@
 package com.iamberry.rst.controllers.order;
 
+import com.iamberry.redis.RedisUtils;
 import com.iamberry.rst.core.cm.CompanyInfo;
 import com.iamberry.rst.core.cm.SalesOrder;
 import com.iamberry.rst.core.cm.SalesOrderItem;
@@ -26,6 +27,7 @@ import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.faces.sms.SmsService;
 import com.iamberry.rst.utils.*;
 import com.iamberry.wechat.tools.ResponseJson;
+import com.iamberry.wechat.tools.UUIDGenerator;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 import org.apache.commons.lang.StringUtils;
@@ -102,43 +104,45 @@ public class AdminSalesOrderController {
                                         @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) throws Exception {
-        ModelAndView mv = new ModelAndView("order/salesOrder/sales_order_list");
-
-        Admin admin = AdminUtils.getLoginAdmin();
-        Integer identity = admin.getAdminDept();
-        if(identity == 2){
-            salesOrder.setSalesAdminId(admin.getAdminId());
+        // 开始装配查询订单的数据
+        if(AdminUtils.getLoginAdmin().getAdminDept() == 2){
+            // 如果是销售部门,只允许查看自己的订单
+            salesOrder.setSalesAdminId(AdminUtils.getLoginAdmin().getAdminId());
         }
-        salesOrder.setIsSelectCustomer(2);//不查询客诉添加的订单
-
+        // 不查询客诉添加的订单
+        salesOrder.setIsSelectCustomer(2);
         //分页获取订单信息
         PagedResult<SalesOrder> pagedResult = salesOrderService.listSalesOrderPage(pageNO, pageSize, salesOrder,totalNum == 0);
         if (totalNum != 0) {
             pagedResult.setTotal(totalNum);
         }
-
+        // 查询条件的店铺信息
         StoreInfo storeInfo = new StoreInfo();
+        // 查询条件的产品信息
         ProductColor productColor = new ProductColor();
         if(salesOrder.getSalesCompanyId() != null){
             storeInfo.setCompanyId(salesOrder.getSalesCompanyId());
             productColor.setTypeCompany(salesOrder.getSalesCompanyId());
         }
+        // 搜索店铺
         List<StoreInfo> listStoreInfo = storeInfoService.listStore(storeInfo);
+        // 搜索物流方式
         List<LogisticsInfo> logisticsInfoList = logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
-        salesOrder.setSalesOrderItemList(null);
+        // 查询产品颜色
         List<ProductColor> productColorList = productService.listproductAndColor(productColor);
-        SalesOrder orderNum = salesOrderService.getStatusNum();//查询订单各个状态数量
+        ModelAndView mv = new ModelAndView("order/salesOrder/sales_order_list");
         StitchAttrUtil.getSa()
                 .addDatePro("yyyy-MM-dd HH:mm:ss","startDate","endDate")
                 .addNoPro("suSalesOrderItemList")
                 .setModelAndView(salesOrder, mv, "/admin/salesOrder/list_order_page", pagedResult);
-
-        mv.addObject("orderNum",orderNum);
+        salesOrder.setSalesOrderItemList(null);
+        // 查询订单各个状态数量
+        mv.addObject("orderNum",salesOrderService.getStatusNum());
         mv.addObject("listStoreInfo",listStoreInfo);
         mv.addObject("logisticsInfoList",logisticsInfoList);
-        mv.addObject("identity",identity);
+        mv.addObject("identity",AdminUtils.getLoginAdmin().getAdminDept());
         mv.addObject("productColorList",productColorList);
-        mv.addObject("admin",admin);
+        mv.addObject("admin",AdminUtils.getLoginAdmin());
         return mv;
     }
 
@@ -771,10 +775,7 @@ public class AdminSalesOrderController {
     @ResponseBody
     @RequestMapping("/add_salesOrder")
     @RequiresPermissions("salesOrder:add:manual")
-    public ResponseJson addSalesOrder(HttpServletRequest request,
-        SalesOrder salesOrder,
-        String orderItemString
-    ) throws Exception {
+    public ResponseJson addSalesOrder(HttpServletRequest request, SalesOrder salesOrder, String orderItemString) throws Exception {
 
         if(salesOrder.getSalesStoreId() == null){
             return  new ResponseJson(500, "添加订单失败,失败原因:未选择店铺", 500);
@@ -791,72 +792,70 @@ public class AdminSalesOrderController {
         String salesPayTime = request.getParameter("payTime");
         salesOrder.setSalesPayTime(sdf.parse(salesPayTime));
         JSONArray jsonArray = JSONArray.fromObject(orderItemString);
-        List<SalesOrderItem> salesOrderItemList = (List) JSONArray.toCollection(jsonArray, SalesOrderItem.class);
-
-        //根据店铺查询客户是否自营
-        /*DealerChannel  dealerChannel = new DealerChannel();
-        dealerChannel.setStoreId(salesOrder.getSalesStoreId());
-        List<DealerChannel> listDealer = dealerChannelService.getDealerChannelList(dealerChannel);
-        if(listDealer.size() < 1){
-            return  new ResponseJson(500, "未找到店铺客户信息", 500);
-        }*/
+        List<SalesOrderItem> salesOrderItemList = (List<SalesOrderItem>) JSONArray.toCollection(jsonArray, SalesOrderItem.class);
+        // 补充产品信息
         for (SalesOrderItem salesOrderItem:salesOrderItemList) {
             if(salesOrderItem.getItemNum() > 0 && salesOrderItem.getItemColorId() > 0){
                 ProductColor productColor = productService.getProduceColor(salesOrderItem.getItemColorId());
                 if(productColor == null){
                     return  new ResponseJson(500, "商品不存在", 500);
                 }
-                salesOrderItem.setItemProductId(productColor.getColorProductId());  ////产品id
+                // 补充订单项所需的产品信息
+                salesOrderItem.setItemProductId(productColor.getColorProductId());
                 salesOrderItem.setItemColorId(productColor.getColorId());
                 salesOrderItem.setItemProductType(productColor.getProductType());
                 salesOrderItem.setItemProductName(productColor.getProductName());
                 salesOrderItem.setItemProductPic(productColor.getColorPicture());
                 salesOrderItem.setItemProductColor(productColor.getColorName());
-                salesOrderItem.setItemColorBar(productColor.getColorBar()); ///产品SKU码(百胜)
-//                salesOrderItem.setItemProductPrice(productColor.getColorPrice());
-//                salesOrderItem.setItemProductDiscount(productColor.getColorDiscount());
+                salesOrderItem.setItemColorBar(productColor.getColorBar());
                 salesOrderItem.setItemCreateTime(new Date());
                 salesOrderItem.setItemIsSource(1);
             }else{
                 return  new ResponseJson(500, "添加商品错误", 500);
             }
         }
-
+        // 交易号
         if(salesOrder.getSalesDealCode() != null && !"".equals(salesOrder.getSalesDealCode())){
-            salesOrder.setSalesDealCode(salesOrder.getSalesDealCode().trim());  //交易号
+            // 用户填写交易号,需要去除空格
+            salesOrder.setSalesDealCode(salesOrder.getSalesDealCode().trim());
         }else{
-            String dealCode = generateKeyUtil.getSalesOrderKey();   //获取交易号
-            salesOrder.setSalesDealCode(dealCode);  //交易号
-        }
-        salesOrder.setSalesOrderId(salesOrder.getSalesDealCode());  //订单号
-        salesOrder.setSalesOpenId("0"); //身份证号/openid
-        salesOrder.setSalesPledgeMoney(0);  ///押金金额
-        salesOrder.setSalesRemainDeposit(0);     //待提取金额
-        salesOrder.setSalesStatus(0);   //确认状态 未确认
-        salesOrder.setSalesSendType(2); //2:物流发货
+            // 系统生成交易号
+            String dealCode = generateKeyUtil.getSalesOrderKey();
+            salesOrder.setSalesDealCode(dealCode);
+        }
+        /*
+         * 开始组装订单数据
+         */
+        //订单号
+        salesOrder.setSalesOrderId(salesOrder.getSalesDealCode());
+        salesOrder.setSalesOpenId("0");
+        salesOrder.setSalesPledgeMoney(0);
+        salesOrder.setSalesRemainDeposit(0);
         salesOrder.setSalesCreateTime(new Date());
-        salesOrder.setSalesType(1); //订单类型  1:购买2:租赁
-        salesOrder.setSalesOrderStatus(1);   //订单状态 订单状态:1:正常 2:换货 3:退货  4:维修  5:补发
-        salesOrder.setSalesShippingStatus(0);      //发货状态 0(未发货
-        salesOrder.setSalesPayStatus(2);    //2(已付款)
-        salesOrder.setSalesProcessStatus(0); //0(正常单)
-        salesOrder.setSalesIsSend(0);  //是否通知配货    0:否1:是
-        salesOrder.setSalesIsLocked(0); //是否锁定 0:否1:是
-        salesOrder.setSalesIsSeparate(0);    //是否缺货  0:否1:是
-        salesOrder.setSalesIsDownload(1);    // 1 未下载
-        salesOrder.setSalesAddType(1);  //手动添加
-        salesOrder.setSalesAdminId(admin.getAdminId()); //admin id
-
-//        salesOrder.setSalesAmount(salesOrder.getSalesAmount()*100);
-//        salesOrder.setSalesDiscountMoney(salesOrder.getSalesDiscountMoney()*100);;
-//        salesOrder.setSalesPayMoney(salesOrder.getSalesPayMoney()*100);
-//        salesOrder.setSalesWaitMoney(salesOrder.getSalesWaitMoney()*100);
-//        salesOrder.setSalesLastMoney(salesOrder.getSalesLastMoney()*100);
-//        salesOrder.setSalesShippingFee(salesOrder.getSalesShippingFee()*100);
-
+        salesOrder.setSalesType(1);
+        salesOrder.setSalesPayStatus(2);
+        salesOrder.setSalesProcessStatus(0);
+        salesOrder.setSalesIsLocked(0);
+        salesOrder.setSalesIsSeparate(0);
+        //确认状态 未确认
+        salesOrder.setSalesStatus(0);
+        //2:物流发货
+        salesOrder.setSalesSendType(2);
+        //订单状态 订单状态:1:正常 2:换货 3:退货  4:维修  5:补发
+        salesOrder.setSalesOrderStatus(1);
+        //发货状态 0(未发货
+        salesOrder.setSalesShippingStatus(0);
+        //是否通知配货    0:否1:是
+        salesOrder.setSalesIsSend(0);
+        // 1 未下载
+        salesOrder.setSalesIsDownload(1);
+        //手动添加
+        salesOrder.setSalesAddType(1);
+        //admin id
+        salesOrder.setSalesAdminId(admin.getAdminId());
         salesOrder.setSalesOrderItemList(salesOrderItemList);
-
         if(salesOrder.getSalesBatchId() == null || "".equals(salesOrder.getSalesBatchId()) || "1".equals(salesOrder.getSalesBatchId())){
+            // 用户新建批次,系统自动新建
             String batchId = generateKeyUtil.getSalesBatchIdSD();
             OrderBatch ob = new OrderBatch();
             ob.setBatchId(batchId);
@@ -867,22 +866,13 @@ public class AdminSalesOrderController {
             }
             salesOrder.setSalesBatchId(batchId);
         }
-        boolean bl = true;
-        String errorMsg = "";
         try {
-           // bl = salesOrderService.addRstOrderAndIteminfo(salesOrder);
-            bl = salesOrderService.addRstOrderinfo(salesOrder,new ArrayList<SalesOrder>(),detectIds);
-        }catch (Exception e){
-            errorMsg = e.getMessage();
-            e.printStackTrace();
-            return  new ResponseJson(500, "添加订单失败,失败原因:"+errorMsg, 500);
-        }
-        if(bl){
+            // 添加订单
+            salesOrderService.addRstOrderinfo(salesOrder,new ArrayList<SalesOrder>(),detectIds);
             return new ResponseJson(200, "添加订单成功,订单交易号为:"+ salesOrder.getSalesDealCode(), 200);
-
-
-        }else{
-            return  new ResponseJson(500, "添加订单失败,失败原因:"+errorMsg, 500);
+        }catch (Exception e){
+            logger.error("", e);
+            return  new ResponseJson(500, "添加订单失败,失败原因:"+e.getMessage(), 500);
         }
     }
 
@@ -1175,6 +1165,7 @@ public class AdminSalesOrderController {
             isOrder.setSalesAddressTel(order.getSalesAddressTel());
             isOrder.setSalesAddressName(order.getSalesAddressName());
             isOrder.setSalesPostFirm(order.getSalesPostFirm());
+            isOrder.setSalesId(order.getSalesId());
             List<SalesOrder> listOrder = salesOrderService.listSalesOrderByAddr(isOrder);
             if(listOrder != null &&  listOrder.size() > 0){
                 salesOrder.setSalesIsSublist(2);
@@ -2209,4 +2200,95 @@ public class AdminSalesOrderController {
         rj.addResponseKeyValue("admin",admin);
         return rj;
     }
+
+    /**
+     * 进入订单核对
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("salesOrder:eheck:salesOrder")
+    @RequestMapping("/to_getSalesOrderCheck")
+    public ModelAndView to_getSalesOrderCheck(HttpServletRequest request){
+        ModelAndView mv = new ModelAndView("order/salesOrder/sales_order_check_list");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Admin admin = AdminUtils.getLoginAdmin();
+        OrderWarehouse orderWarehouse = salesOrderService.selectAdminWarehouse(admin.getAdminId());
+        String checkStartDate = RedisUtils.get("checkStartDate"+orderWarehouse.getWarehouseId());
+        String pickingStartDate = RedisUtils.get("pickingStartDate"+orderWarehouse.getWarehouseId());
+        String date = format.format(new Date());
+        if(checkStartDate == null){
+            RedisUtils.put("checkStartDate"+orderWarehouse.getWarehouseId(),date);
+            checkStartDate = date;
+        }
+        if(pickingStartDate == null){
+            RedisUtils.put("pickingStartDate"+orderWarehouse.getWarehouseId(),date);
+            pickingStartDate = date;
+        }
+        mv.addObject("checkStartDate",checkStartDate);
+        mv.addObject("pickingStartDate",pickingStartDate);
+        return mv;
+    }
+
+    /**
+     * 获取拣货单信息
+     *
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping("/getSalesOrderCheck")
+    public ResponseJson getsalesOrderCheck(HttpServletRequest request,OrderStatisticsInfo orderStatisticsInfo) throws Exception {
+        ResponseJson rj =  new ResponseJson(200, "SUCCESS", 200);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String pickingStartDate = request.getParameter("startDate1");//1拣货单 2核对单
+        String checkStartDate = request.getParameter("startDate2");//1拣货单 2核对单
+        List<OrderStatisticsInfo> infos = null;
+        Admin admin = AdminUtils.getLoginAdmin();
+        OrderWarehouse orderWarehouse = salesOrderService.selectAdminWarehouse(admin.getAdminId());
+        orderStatisticsInfo.setWarehouseId(orderWarehouse.getWarehouseId());
+        if(pickingStartDate != null){//揀貨
+            orderStatisticsInfo.setPickingStartDate(format.parse(pickingStartDate));
+            infos = salesOrderService.getPickingOrders(orderStatisticsInfo);
+            RedisUtils.put("pickingStartDate"+orderWarehouse.getWarehouseId(),format.format(new Date()));
+        }
+        if(checkStartDate != null){//核对
+            orderStatisticsInfo.setCheckStartDate(format.parse(checkStartDate));
+            infos =  salesOrderService.getCheckOrders(orderStatisticsInfo);
+            RedisUtils.put("checkStartDate"+orderWarehouse.getWarehouseId(),format.format(new Date()));
+        }
+        rj.addResponseKeyValue("infos",infos);
+        rj.addResponseKeyValue("admin",admin);
+        return rj;
+    }
+
+    /**
+     * 取消通知配货
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping("/cancel_distribution")
+    @RequiresPermissions("salesOrder:distribution:salesOrder")
+    public ResponseJson cancelDistribution(HttpServletRequest request,String id) throws Exception {
+        ResponseJson rj = ResponseJson.getFAILURE();
+        if(id == null || "".equals(id)){
+            return rj;
+        }
+        Integer salesId = Integer.valueOf(id);
+        SalesOrder salesOrder = salesOrderService.getSalesOrderById(salesId);
+        //判断是否是已通知配货状态
+        if(salesOrder.getSalesShippingStatus() == 11){
+            SalesOrder order = new SalesOrder();
+            order.setSalesId(Integer.valueOf(id));
+            order.setSalesShippingStatus(0);
+            order.setSalesOldOrderStatus(11);
+            if(salesOrderService.update(order) > 0){
+                rj = new ResponseJson(200, "修改成功", 200);
+                return rj;
+            }
+        }
+        rj = new ResponseJson(500, "修改失败", 500);
+        return rj;
+    }
 }

+ 16 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AwaitSendController.java

@@ -928,6 +928,22 @@ public class AwaitSendController {
             rj.setResultMsg("标记为未出库状态成功");
         }else{
             rj.setResultMsg("出库成功");
+            //如果为子母件则子件也需要出库
+            if(salesOrder.getSalesIsSublist() == 1){
+                List<SalesOrder> orderList = salesOrderService.listSublistCount(salesOrder.getSalesId());
+                if(orderList.size() > 0){
+                    for(SalesOrder order : orderList){
+                        order.setSalesOldDeliver(salesOrder.getSalesDeliver());
+                        order.setSalesDeliver(type);
+                        try{
+                            salesOrderService.updateDeliver(order);
+                        }catch (Exception e){
+                            rj.setResultMsg("子订单标记出库失败;</br>原因:"+e.getMessage());
+                            return rj;
+                        }
+                    }
+                }
+            }
         }
         return rj;
     }

+ 53 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminPtsEmployeeController.java

@@ -213,5 +213,58 @@ public class AdminPtsEmployeeController {
             return new ResponseJson(200, "SUCCESS", 200);
         }
     }
+    /**
+     * 查询单个员工
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value="/get_employee")
+    public ResponseJson getEmployee(PtsEmployee ptsEmployee, HttpServletRequest request) {
+        ResponseJson rs = new ResponseJson(200, "SUCCESS", 200);
+        ptsEmployee = ptsEmployeeService.getPtsEmployee(ptsEmployee);
+        if (ptsEmployee !=null ){
+            rs.addResponseKeyValue("ptsEmployee",ptsEmployee);
+            return rs;
+
+        }else {
+            return new ResponseJson(500, "ERROR", 500);
+        }
+    }
+
 
+    /**
+     * 查询员工列表
+     * @param pageSize
+     * @param pageNO
+     * @param totalNum
+     * @return
+     */
+    @RequestMapping("/employee_list")
+    public ModelAndView getEmployeeLists(HttpServletRequest request,
+                                        @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("pts/productionPlan/employee_list");
+        PtsEmployee employee = new PtsEmployee();
+
+        String employeeName = request.getParameter("employeeName");
+        String employeeNo = request.getParameter("employeeNo");
+        Integer employeeState = null;
+
+        if (employeeName != null && !"".equals(employeeName)) {
+            employee.setEmployeeName(employeeName);
+        }
+        if (employeeNo != null && !"".equals(employeeNo)) {
+            employee.setEmployeeNo(employeeNo);
+        }
+
+        PagedResult<PtsEmployee> pagedResult = ptsEmployeeService.getEmployeeList(pageNO, pageSize, employee, totalNum == 0);
+        if (totalNum != 0){
+            pagedResult.setTotal(totalNum);
+        }
+
+        StitchAttrUtil.getSa().setModelAndView(employee, mv, "/admin/employee/employee_list", pagedResult);
+        return mv;
+    }
 }

+ 342 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/ProductionPlanController.java

@@ -0,0 +1,342 @@
+package com.iamberry.rst.controllers.pts;
+
+import com.iamberry.rst.core.fm.InventoryInfo;
+import com.iamberry.rst.core.fm.InventoryLog;
+import com.iamberry.rst.core.order.OrderWarehouse;
+import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.order.ProductColor;
+import com.iamberry.rst.core.order.ProductType;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.ProductionEmployees;
+import com.iamberry.rst.core.pts.ProductionPlan;
+import com.iamberry.rst.core.pts.ProductionProcess;
+import com.iamberry.rst.core.pts.PtsEmployee;
+import com.iamberry.rst.core.sys.Admin;
+import com.iamberry.rst.faces.cm.InventoryLogService;
+import com.iamberry.rst.faces.cm.InventoryService;
+import com.iamberry.rst.faces.cm.SalesOrderService;
+import com.iamberry.rst.faces.order.OrderWarehouseService;
+import com.iamberry.rst.faces.product.ProductColorService;
+import com.iamberry.rst.faces.product.ProductService;
+import com.iamberry.rst.faces.pts.ProductionPlanService;
+import com.iamberry.rst.faces.pts.PtsEmployeeService;
+import com.iamberry.rst.utils.AdminUtils;
+import com.iamberry.rst.utils.StitchAttrUtil;
+import com.iamberry.wechat.tools.ResponseJson;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by LJK on 2019年12月12日
+ */
+@Controller
+@RequestMapping("/admin/productionPlan")
+public class ProductionPlanController {
+    @Autowired
+    private ProductionPlanService productionPlanService;
+    @Autowired
+    private PtsEmployeeService ptsEmployeeService;
+
+    /**
+     * 查询生产计划列表信息
+     *
+     * @param request
+     * @param pageNO
+     * @param pageTotal
+     * @param pageSize
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("productionPlan:select:productionPlan")
+    @RequestMapping("/select_productionPlan_list")
+    public ModelAndView selectProductionPlanList(HttpServletRequest request,
+                                            @RequestParam(value = "pageNO", defaultValue = "1", required = false) int pageNO,
+                                            @RequestParam(value = "pageTotal", required = false) Integer pageTotal,
+                                            @RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize,
+                                            ProductionPlan productionPlan
+    ) throws Exception {
+        ModelAndView mv = new ModelAndView("pts/productionPlan/productionPlan_list");
+        StringBuilder url = new StringBuilder("/admin/productionPlan/select_productionPlan_list?pageSize=" + pageSize);
+        String planDate = request.getParameter("plan_Date");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        if(planDate != null && !planDate.equals("")){
+            productionPlan.setPlanDate(format.parse(planDate));
+        }
+        // 封装请求数据
+        PageRequest<ProductionPlan> pageRequest = new PageRequest<>(productionPlan, pageNO, pageSize, pageTotal == null);
+        // 查询生产计划列表
+        PagedResult<ProductionPlan> result = productionPlanService.listProductionPlan(pageRequest);
+        ProductionProcess productionProcess = new ProductionProcess();
+        productionProcess.setProcessStatus(1);
+        List<ProductionProcess> listProductionProcess = productionPlanService.listProductionProcess(productionProcess);
+        mv.addObject("listProductionProcess", listProductionProcess);
+        long total = 0;
+        if (pageTotal == null) {
+            total = result.getPages();
+        } else {
+            total = pageTotal;
+            result.setPages(total);
+        }
+        StitchAttrUtil.getSa().setModelAndView(productionPlan, mv, "/admin/productionPlan/select_productionPlan_list", result);
+        return mv;
+    }
+    /**
+     * 查询生产计划统计列表信息
+     *
+     * @param request
+     * @param pageNO
+     * @param pageTotal
+     * @param pageSize
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("productionPlan:statistical:productionPlan")
+    @RequestMapping("/select_productionPlan_statistical")
+    public ModelAndView select_productionPlan_statistical(HttpServletRequest request,
+                                            @RequestParam(value = "pageNO", defaultValue = "1", required = false) int pageNO,
+                                            @RequestParam(value = "pageTotal", required = false) Integer pageTotal,
+                                            @RequestParam(value = "pageSize", defaultValue = "10", required = false) int pageSize,
+                                            ProductionPlan productionPlan
+    ) throws Exception {
+        ModelAndView mv = new ModelAndView("pts/productionPlan/productionPlan_statistical");
+        StringBuilder url = new StringBuilder("/admin/productionPlan/select_productionPlan_statistical?pageSize=" + pageSize);
+        String planDate = request.getParameter("plan_Date");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        if(planDate != null && !planDate.equals("")){
+            productionPlan.setPlanDate(format.parse(planDate));
+        }
+        // 封装请求数据
+        PageRequest<ProductionPlan> pageRequest = new PageRequest<>(productionPlan, pageNO, pageSize, pageTotal == null);
+        // 查询生产计划列表
+        PagedResult<ProductionPlan> result = productionPlanService.listProductionPlan(pageRequest);
+        ProductionProcess productionProcess = new ProductionProcess();
+        productionProcess.setProcessStatus(1);
+        List<ProductionProcess> listProductionProcess = productionPlanService.listProductionProcess(productionProcess);
+        mv.addObject("listProductionProcess", listProductionProcess);
+        long total = 0;
+        if (pageTotal == null) {
+            total = result.getPages();
+        } else {
+            total = pageTotal;
+            result.setPages(total);
+        }
+        StitchAttrUtil.getSa().setModelAndView(productionPlan, mv, "/admin/productionPlan/select_productionPlan_statistical", result);
+        return mv;
+    }
+
+
+    /**
+     * 进入添加生产计划
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/to_addProductionPlan")
+    public ModelAndView to_addProductionPlan(ProductionPlan productionPlan) throws Exception {
+        ModelAndView mv = new ModelAndView("pts/productionPlan/add_productionPlan");
+        ProductionProcess productionProcess = new ProductionProcess();
+        productionProcess.setProcessStatus(1);
+        List<ProductionProcess> listProductionProcess = productionPlanService.listProductionProcess(productionProcess);
+        mv.addObject("listProductionProcess", listProductionProcess);
+        Integer planCount = productionPlanService.getPlanCount();
+        mv.addObject("planCount", planCount);
+        mv.addObject("plan_date", new Date());
+        return mv;
+    }
+
+    /**
+     * 添加生产计划
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/addProductionPlan")
+    public ResponseJson addProductionPlan(HttpServletRequest request,ProductionPlan productionPlan) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(productionPlan == null ){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        String planDate = request.getParameter("plan_date");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        if(planDate != null && !planDate.equals("")){
+            productionPlan.setPlanDate(format.parse(planDate));
+        }else {
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+            return msg;
+        }
+        if(productionPlan.getEmployeeString() == null && !productionPlan.getEmployeeString().equals("")){
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+            return msg;
+        }
+        //判断是否有员工重复工序
+        if(productionPlan.getEmployeeString() != null && !productionPlan.getEmployeeString().equals("")){
+            List<PtsEmployee> employeeList = new ArrayList<>();
+            boolean is = false;
+            ProductionPlan plan = new ProductionPlan();
+            plan.setPlanDate(productionPlan.getPlanDate());
+            String[] employees = productionPlan.getEmployeeString().split("_");
+            for(String employee : employees){
+                if(!employee.equals("")){
+                    plan.setEmployeeId(Integer.valueOf(employee));
+                    List<ProductionPlan> plans = productionPlanService.getPlanRepeat(plan);
+                    if(plans != null && plans.size() > 0){
+                        is = true;
+                        //查询重复员工姓名
+                        employeeList.add(ptsEmployeeService.getPtsEmployeeById(Integer.valueOf(employee)));
+                    }
+                }
+            }
+            if(is){
+                msg.addResponseKeyValue("employeeList",employeeList);
+                msg.setResultCode(501);
+                msg.setReturnCode(501);
+                return msg;
+            }
+
+        }
+        if(productionPlanService.addProductionPlan(productionPlan) > 0){
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }else{
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+        }
+        return msg;
+    }
+
+    /**
+     *删除生产计划
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/delProductionPlan")
+    public ResponseJson delProductionPlan(HttpServletRequest request,Integer planId) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(planId == null ){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        if(productionPlanService.delProductionPlan(planId) > 0){
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }else{
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+        }
+        return msg;
+    }
+    /**
+     *进入完善工作计划页面
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/to_perfect_productionPlan")
+    public ModelAndView toPerfectProductionPlan(Integer planId) throws Exception {
+        ModelAndView mv = new ModelAndView("pts/productionPlan/perfect_productionPlan");
+        ProductionPlan productionPlan = productionPlanService.getProductionPlan(planId);
+        List<ProductionEmployees> listProductionEmployees = productionPlanService.listProductionEmployees(planId);
+        mv.addObject("productionPlan", productionPlan);
+        mv.addObject("listProductionEmployees", listProductionEmployees);
+        return mv;
+    }
+    /**
+     *进入修改工作计划页面
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/to_update_productionPlan")
+    public ModelAndView to_update_productionPlan(Integer planId) throws Exception {
+        ModelAndView mv = new ModelAndView("pts/productionPlan/update_productionPlan");
+        ProductionPlan productionPlan = productionPlanService.getProductionPlan(planId);
+        ProductionProcess productionProcess = new ProductionProcess();
+        productionProcess.setProcessStatus(1);
+        List<ProductionProcess> listProductionProcess = productionPlanService.listProductionProcess(productionProcess);
+        mv.addObject("listProductionProcess", listProductionProcess);
+        List<ProductionEmployees> listProductionEmployees = productionPlanService.listProductionEmployees(planId);
+        mv.addObject("productionPlan", productionPlan);
+        mv.addObject("listProductionEmployees", listProductionEmployees);
+        return mv;
+    }
+    /**
+     * 完善生产计划
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/perfect_productionPlan")
+    public ResponseJson perfectProductionPlan(HttpServletRequest request,ProductionPlan productionPlan) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(productionPlan == null ){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        String planDate = request.getParameter("plan_date");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        if(planDate != null && !planDate.equals("")){
+            productionPlan.setPlanDate(format.parse(planDate));
+        }else {
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+            return msg;
+        }
+        if(productionPlan.getEmployeeString() == null && !productionPlan.getEmployeeString().equals("")){
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+            return msg;
+        }
+        if(productionPlanService.updateProductionPlan(productionPlan) > 0){
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }else{
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+        }
+        return msg;
+    }
+    /**
+     * 完善生产计划
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/get_process")
+    public ResponseJson get_process(HttpServletRequest request,Integer planProcessId) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(planProcessId == null ){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        ProductionProcess productionProcess = productionPlanService.getProductionProcess(planProcessId);
+        if(productionProcess != null){
+            msg.addResponseKeyValue("productionProcess",productionProcess);
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }else{
+            msg.setResultCode(500);
+            msg.setReturnCode(501);
+        }
+        return msg;
+    }
+}

+ 6 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/sys/LoginController.java

@@ -51,7 +51,12 @@ public class LoginController {
         Subject currentUser = SecurityUtils.getSubject();
         if (!currentUser.isAuthenticated()) {
             // 判断是否已经记住过密码
-            Admin admin = AdminUtils.getAdminCookie(request);
+            Admin admin = null;
+            try {
+                admin = AdminUtils.getAdminCookie(request);
+            } catch (IllegalArgumentException e) {
+                return new ModelAndView("login");
+            }
             if (admin == null) {
                 return new ModelAndView("login");
             }

+ 6 - 4
watero-rst-web/src/main/java/com/iamberry/rst/controllers/sys/SysController.java

@@ -85,8 +85,10 @@ public class SysController {
         // 注入数据:管理员名称、管理员部门
         String dept = depart.getDepartName();
         List<Menu> list = sysService.listMenu(AdminUtils.getLoginAdminId());
-        return new ModelAndView("home/pc_index").addObject("adminName", admin.getAdminName())
-                .addObject("deptName", dept).addObject("menus", sysService.listMenu(AdminUtils.getLoginAdminId()));
+        return new ModelAndView("home/pc_index")
+                .addObject("adminName", admin.getAdminName())
+                .addObject("deptName", dept)
+                .addObject("menus", sysService.listMenu(AdminUtils.getLoginAdminId()));
     }
 
     /**
@@ -207,7 +209,7 @@ public class SysController {
         // 查询
         PagedResult<Admin> result = sysService.listAdmin(pageRequest);
         if (pageTotal != null) {
-            result.setPages(pageTotal);         // 合法化数据
+            result.setPages(pageTotal);
         }
 
         // 返回
@@ -354,7 +356,7 @@ public class SysController {
     @RequestMapping("/add_admin_info")
     public ResponseJson addAdminInfo(Admin admin,HttpServletRequest request) throws Exception {
         md5 = new MD5("inlongadMD5");
-        StringBuilder salt = new StringBuilder();   //颜值
+        StringBuilder salt = new StringBuilder();
         String adminSalt = "";
         if (admin.getAdminAccount() == null || admin.getAdminPassword() == null) {
             return new ResponseJson(200, "账号和密码不能为空", 500);

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

@@ -233,6 +233,10 @@
 		<typeAlias type="com.iamberry.rst.core.order.OrderStatisticsInfo" alias="OrderStatisticsInfo"/>
 		<!-- 客诉新增-->
 		<typeAlias type="com.iamberry.rst.core.cm.TagInfo" alias="TagInfo"/>
+		<!-- 生成计划-->
+		<typeAlias type="com.iamberry.rst.core.pts.ProductionEmployees" alias="ProductionEmployees"/>
+		<typeAlias type="com.iamberry.rst.core.pts.ProductionProcess" alias="ProductionProcess"/>
+		<typeAlias type="com.iamberry.rst.core.pts.ProductionPlan" alias="ProductionPlan"/>
 	</typeAliases>
 	<!-- PageHelper -->
 	<plugins>
@@ -358,5 +362,7 @@
 		<mapper resource="com/iamberry/rst/service/dm/mapper/supplierProductItemMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/dm/mapper/supplierProductMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/dm/mapper/dmChannelTypeMapper.xml"/>
+		<!--生产计划 -->
+		<mapper resource="com/iamberry/rst/service/pts/mapper/productionPlanningMapper.xml"/>
 	</mappers>
 </configuration>

+ 5 - 4
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl

@@ -222,7 +222,7 @@
                             <th style="text-align: center;" width="60">用户电话</th>
                             <th style="text-align: center;" width="60">处理方式</th>
                             <th style="text-align: center;" width="60">客诉问题</th>
-                            <th style="text-align: center;" width="60">问题简介</th>
+                            <#--<th style="text-align: center;" width="60">问题简介</th>-->
                             <th style="text-align: center;" width="60">操作</th>
                         </tr>
                         </thead>
@@ -311,15 +311,16 @@
                 </div>
             </div>
 
-            <div class="row cl">
+            <#--<div class="row cl">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题回复:</label>
                 <div class="formControls col-9 col-sm-9">
                     <input type="hidden" name="questionId" id="questionId" value="">
                     <script id="describeContentText" type="text/plain" style="width:100%;height:150px;"></script>
                     <input type="hidden" name="describeContent" id="describeContent" value="">
                 </div>
-            </div>
-
+            </div>-->
+            <input type="hidden" name="questionId" id="questionId" value="">
+            <input type="hidden" name="describeId" id="describeId" value="">
             <div class="row cl">
             <#--处理描述 - 客诉备注-->
                 <label class="form-label col-1 col-sm-1">问题描述:</label>

File diff ditekan karena terlalu besar
+ 41 - 27
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_list.ftl


+ 21 - 4
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/order_list.ftl

@@ -190,8 +190,8 @@
                     </div>
 
                     <div class="formControls col-3 col-sm-3">
-                        <span class="select-box">
-                            <select name="salesStoreId" class="select" id="salesStoreId">
+                        <span >
+                            <select name="salesStoreId" class="chosen" id="salesStoreId">
 
                             </select>
                         </span>
@@ -604,7 +604,7 @@
      * 展示销售公司
      */
     function setStore(companyId,node){
-        var companyId = $("#companyId").val();
+        var companyId = $("#salesCompanyId").val();
         var html = '<option value="">店铺</option>';
         $.ajax({
             type: "POST",
@@ -623,10 +623,12 @@
                     html = '';
                 }
                 $(node).html(html);
+                $("#salesStoreId").trigger("chosen:updated");//初始化
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){
             }
         });
+
     }
 
     /**
@@ -708,7 +710,22 @@
         return productList;
     }
 
-
+    $('.chosen').chosen({
+        no_results_text: "没有找到结果!",//搜索无结果时显示的提示
+        search_contains:true,   //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+        allow_single_deselect:true, //单选下拉框是否允许取消选择。如果允许,选中选项会有一个x号可以删除选项
+        disable_search: false, //禁用搜索。设置为true,则无法搜索选项。
+        disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
+        inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
+        placeholder_text_single: '选择店铺', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
+        width: '200px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
+        max_shown_results: 1000, //下拉框最大显示选项数量
+        display_disabled_options: false,
+        single_backstroke_delete: false, //false表示按两次删除键才能删除选项,true表示按一次删除键即可删除
+        case_sensitive_search: false, //搜索大小写敏感。此处设为不敏感
+        group_search: false, //选项组是否可搜。此处搜索不可搜
+        include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
+    });
 </script>
 </body>
 </html>

+ 7 - 7
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_customer.ftl

@@ -289,17 +289,17 @@
                 </div>
             </div>
 
-            <div class="row cl">
+            <#--<div class="row cl">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题回复:</label>
                 <div class="formControls col-9 col-sm-9">
-                    <input type="hidden" name="questionId" id="questionId" value="${customerInfo.questionId!''}">
+
                     <script id="describeContentText" type="text/plain" style="width:100%;height:250px;"></script>
                     </script>
                     <input type="hidden" name="describeContent" id="describeContent" value="">
-                    <input type="hidden" name="describeId" id="describeId" value="">
                 </div>
-            </div>
-
+            </div>-->
+            <input type="hidden" name="questionId" id="questionId" value="${customerInfo.questionId!''}">
+            <input type="hidden" name="describeId" id="describeId" value="">
             <div class="row cl">
             <#--处理描述 - 客诉备注-->
                 <label class="form-label col-1 col-sm-1">问题描述:</label>
@@ -1035,9 +1035,9 @@
                     $("#describeId").val(questionDescribe.describeId);
                     $("#describeHandleDesc").val(questionDescribe.describeHandleDesc);
 
-                    describeContentText.ready(function(){
+                    /*describeContentText.ready(function(){
                         describeContentText.setContent(questionDescribe.describeContent);
-                    });
+                    });*/
                     describeHandleDescText.ready(function(){
                         describeHandleDescText.setContent(questionDescribe.describeHandleDesc);
                     });

+ 433 - 97
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_relation.ftl

@@ -35,8 +35,9 @@
     <title></title>
 </head>
 <body>
-<article class="cl pd-20">
+<article  class="cl pd-20">
     <form action="" method="post" class="form form-horizontal" id="form-update-renewed" name="form-update-renewed">
+        <a id="test" class="js-btnHistory" href="#Targetname"></a>
         <div class="row cl" style="margin-left: -60px;margin-bottom: 20px;">
             <div class="formControls col-2 col-sm-2 text-r">
                 <strong>当前进度</strong>
@@ -50,7 +51,7 @@
         <div class="tabBar clearfix">
         <#if procMethod.procMethodIsBack == 1>
                     <span>寄回信息</span>
-                    <span>费信息</span>
+                    <span>费信息</span>
         </#if>
         <#if procMethod.procMethodIsSend == 1>
                     <span>寄送信息</span>
@@ -452,12 +453,15 @@
                 <table class="table table-border table-bg table-bordered" >
                     <thead>
                     <tr>
-                        <th>邮费id</th>
-                        <th>邮费金额</th>
-                        <th>支付宝姓名</th>
-                        <th>支付宝账号</th>
+                        <th>付费id</th>
+                        <th>付费金额</th>
+                        <th>支付方式</th>
+                        <th>账户姓名</th>
+                        <th>支付账号</th>
+                        <th>开户行</th>
                         <th>付款类型</th>
-                        <th>状态</th>
+                        <th>付费状态</th>
+                        <th>审核状态</th>
                         <th>备注</th>
                         <th>操作</th>
                     </tr>
@@ -468,8 +472,16 @@
                         <tr id="deleteId${(postageInfo.postageId)!''}">
                             <td>${(postageInfo.postageId)!''}</td>
                             <td>${(postageInfo.postageAmount/100)!''}</td>
+                            <td>
+                                <#if postageInfo.postagePayType??>
+                                    <#if postageInfo.postagePayType == 1>支付宝</#if>
+                                    <#if postageInfo.postagePayType == 2>微信</#if>
+                                    <#if postageInfo.postagePayType == 3>银行卡</#if>
+                                </#if>
+                            </td>
                             <td>${(postageInfo.postageAlipayName)!''}</td>
                             <td>${(postageInfo.postageAlipay)!''}</td>
+                            <td>${(postageInfo.postagePayWhere)!''}</td>
                             <td>
                                 <#if postageInfo.postageAlipayType??>
                                     <#if postageInfo.postageAlipayType == 1>用户付款</#if>
@@ -480,22 +492,46 @@
                             <#if postageInfo.postageStatus??>
                                 <#if postageInfo.postageStatus == 0><td>未申请</td></#if>
                                 <#if postageInfo.postageStatus == 1><td>未申请</td></#if>
-                                <#if postageInfo.postageStatus == 2><td>已申请(待转账)</td></#if>
+                                <#if postageInfo.postageStatus == 2><td>已申请</td></#if>
                                 <#if postageInfo.postageStatus == 3><td>已转账</td></#if>
                                 <#if postageInfo.postageStatus == 4><td>未知</td></#if>
                             <#else>
-                                <td></td>
+                            <td></td>
+                            </#if>
+                            <#if postageInfo.postageTransferStatus??>
+                                <#if postageInfo.postageTransferStatus == 1>
+                                    <#if postageInfo.postageFinanceStatus??>
+                                    <#if postageInfo.postageFinanceStatus == 1><td>待审核</td></#if>
+                                    <#if postageInfo.postageFinanceStatus == 2><td>已审核(待转账)</td></#if>
+                                    <#else>
+                                        <td></td>
+                                    </#if>
+                                <#else>
+                                        <td>已转账</td>
+                                </#if>
                             </#if>
                             <td>${postageInfo.postageDesc!''}</td>
-                            <td><a onclick="deletePostage(${(postageInfo.postageId)!});">删除</a>&nbsp;&nbsp;<a onclick="getPostage(${(postageInfo.postageId)!});">修改</a></td>
+                            <td><a onclick="deletePostage(${(postageInfo.postageId)!});">删除</a>
+                                &nbsp;&nbsp;<a onclick="getPostage(${(postageInfo.postageId)!});">修改</a>&nbsp;&nbsp;
+                                <#if postageInfo.postageTransferStatus??>
+                                    <#if postageInfo.postageTransferStatus == 1>
+                                        <#if postageInfo.postageFinanceStatus??>
+                                            <#if postageInfo.postageFinanceStatus == 2>
+                                                <a onclick="printPostage(${postageInfo.postId});">打印</a>
+                                            </#if>
+                                        </#if>
+                                    </#if>
+                                </#if>
+
+                            </td>
                         </tr>
                         </#list>
                     <#else>
-                    <tr id="colspanId"><td colspan="8" class="td-manage text-c" >暂时没有邮费信息,请添加!</td></tr>
+                    <tr id="colspanId"><td colspan="11" class="td-manage text-c" >暂时没有付费信息,请添加!</td></tr>
                     </#if>
                     </tbody>
                 </table>
-                    <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="showPostageDiv();">录入邮费转账</button>
+                    <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="showPostageDiv();">录入费转账</button>
                 </div>
             </div>
             <div class="row cl" id="addPostageId" style="display: none;">
@@ -504,17 +540,17 @@
             </div>
             <div class="formControls col-12 col-sm-12">
             <div >
-                <div class="row cl">
+                <div class="row cl" style="display:none;">
                     <div class="formControls col-2 col-sm-2 text-r">
                         <strong>状态</strong>
                     </div>
                     <div class="formControls col-12 col-sm-12">
-                        <div class="radio-box">
+                        <#--<div class="radio-box">
                             <input type="radio" id="tel-66" name="postageStatus" checked value="1">
                             <label for="tel-66">未申请</label>
-                        </div>
+                        </div>-->
                         <div class="radio-box">
-                            <input type="radio" id="tel-77" name="postageStatus" value="2">
+                            <input type="radio" id="tel-77" name="postageStatus" value="2" checked>
                             <label for="tel-77">已申请(待转账)</label>
                         </div>
 
@@ -534,13 +570,30 @@
                 </div>
                 <div class="row cl">
                     <div class="formControls col-2 col-sm-2 text-r">
-                        <strong>支付</strong>
+                        <strong>支付方式</strong>
                     </div>
                     <div class="formControls col-5 col-sm-5">
-                        <input type="text" class="input-text" placeholder="填写支付宝姓名" id="postageAlipayName" name="postageAlipayName">
+                        <span class="select-box" >
+                            <select class="select" name="postagePayType" id="postagePayType">
+                                <option value="1">支付宝</option>
+                                <option value="2">微信</option>
+                                <option value="3">银行卡</option>
+                            </select>
+                        </span>
+                    </div>
+                    <div class="formControls col-5 col-sm-5" style="display: none;" id="postagePayWhereDiv">
+                        <input type="text" class="input-text" placeholder="开户行" id="postagePayWhere" name="postagePayWhere">
+                    </div>
+                </div>
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>账户信息</strong>
                     </div>
                     <div class="formControls col-5 col-sm-5">
-                        <input type="text" class="input-text" placeholder="填写支付宝账号" id="postageAlipay" name="postageAlipay">
+                        <input type="text" class="input-text" placeholder="填写账户姓名" id="postageAlipayName" name="postageAlipayName">
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <input type="text" class="input-text" placeholder="填写支付账号" id="postageAlipay" name="postageAlipay">
                     </div>
                 </div>
                 <div class="row cl">
@@ -570,7 +623,7 @@
                         <strong></strong>
                     </div>
                     <div class="formControls col-5 col-sm-5">
-                        <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="addPostage()">确定录入费转账</button>
+                        <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="addPostage()">确定录入费转账</button>
                     </div>
                 </div>
             </div>
@@ -582,17 +635,17 @@
                   </div>
             <div class="formControls col-12 col-sm-12">
             <div>
-                <div class="row cl">
+                <div class="row cl" style="display:none;">
                     <div class="formControls col-2 col-sm-2 text-r">
                         <strong>状态</strong>
                     </div>
                     <div class="formControls col-12 col-sm-12 skin-minimal">
-                        <div class="radio-box">
+                        <#--<div class="radio-box">
                             <input type="radio" id="tel-666" name="postageStatuss" value="1">
                             <label for="tel-666">未申请</label>
-                        </div>
+                        </div>-->
                         <div class="radio-box">
-                            <input type="radio" id="tel-777" name="postageStatuss" value="2">
+                            <input type="radio" id="tel-777" name="postageStatuss" value="2" checked>
                             <label for="tel-777">已申请(待转账)</label>
                         </div>
 
@@ -612,13 +665,30 @@
                 </div>
                 <div class="row cl">
                     <div class="formControls col-2 col-sm-2 text-r">
-                        <strong>支付</strong>
+                        <strong>支付方式</strong>
                     </div>
                     <div class="formControls col-5 col-sm-5">
-                        <input type="text" class="input-text" placeholder="填写支付宝姓名" id="postageAlipayNames" name="postageAlipayNames">
+                        <span class="select-box" >
+                            <select class="select" name="postagePayTypes" id="postagePayTypes">
+                                <option value="1">支付宝</option>
+                                <option value="2">微信</option>
+                                <option value="3">银行卡</option>
+                            </select>
+                        </span>
+                    </div>
+                    <div class="formControls col-5 col-sm-5" style="display: none;" id="postagePayWhereDivs">
+                        <input type="text" class="input-text" placeholder="开户行" id="postagePayWheres" name="postagePayWheres">
+                    </div>
+                </div>
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>账户信息</strong>
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <input type="text" class="input-text" placeholder="填写账户姓名" id="postageAlipayNames" name="postageAlipayNames">
                     </div>
                     <div class="formControls col-5 col-sm-5">
-                        <input type="text" class="input-text" placeholder="填写支付宝账号" id="postageAlipays" name="postageAlipays">
+                        <input type="text" class="input-text" placeholder="填写支付账号" id="postageAlipays" name="postageAlipays">
                     </div>
                 </div>
                 <div class="row cl">
@@ -649,7 +719,7 @@
                         <strong></strong>
                     </div>
                     <div class="formControls col-5 col-sm-5">
-                        <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="updatePostage()">确定修改费信息</button>
+                        <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="updatePostage()">确定修改费信息</button>
                     </div>
                 </div>
             </div>
@@ -1151,6 +1221,8 @@
                                     <td class="td-manage text-c" width="100">
                                         <a onclick="getDetectInfo('${detect.detectId}');">查看详情</a><br>
                                         <#if detect.detectState == 30 || detect.detectState == 34 || detect.detectState == 38 || detect.detectState == 37>
+                                        <input type="hidden" name="detectIds" value="${(detect.detectId)!}">
+                                        <input type="hidden" name="detectStates" value="${(detect.detectState)!}">
                                             <a onclick="to_updateDetectInfo('${(detect.detectId)!}','${(detect.detectState)!}');">维修处理</a>
                                         </#if>
                                     </td>
@@ -1343,17 +1415,121 @@
                     </div>
             </div>
         </div>
+        </div>
         <input type="hidden" id="customerId" name="customerId" value="${customerId!''}" seleType="primary">
+        <a name="Targetname" id="Targetname"></a>
     </form>
+    <div  style="padding: 0px;margin: 0px;display: none;" >
+        <div id="printlist" style="">
+            <ul style=" height: 460px;margin-left: 20px;margin-right: 20px;">
+                <li style="font-size: 22px;height: 25px;display: block;text-align: center;font-weight: bold;margin-top: 15px">商品换货退货退款审批</li>
+                <li style="font-size: 12px;height: 30px;display: block;text-align: left;margin-top: 15px">深圳爱贝源科技有限公司&nbsp;&nbsp;&nbsp;&nbsp;申请日期:<span id="applyTime"></span></li>
+                <table class="table table-border table-bg table-bordered" style="border: 1px solid #000;border-collapse: collapse;text-align: left;">
+                    <thead>
+                    <tr>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;width: 3.5cm;">审批编码</td>
+                        <td id="postageCoding" colspan="15" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+
+                    </tr>
+
+                    <tr>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">申请人</td>
+                        <td  id="applicantPeople" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;" colspan="15"></td>
+                    </tr>
+                    <tr>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;h">申请人部门</td>
+                        <td id="applicantDepa" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;" colspan="15"></td>
+                    </tr>
+                    <#--<tr style="font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">-->
+                    <tr class="text-c">
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">客户成交入口</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">售后类型</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">销售时间及退换货原因</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">交易号</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">客户名称</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">联系电话</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">快递公司</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">详细地址</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">快递单号</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">快递费用承担方</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">退回商品名称/型号</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">销售员</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">数量(台)</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">退款金额</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">退款账户</td>
+                    </tr>
+                    <tr>
+                        <td  style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">客户明细1</td>
+                        <td id="postinfo1" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo2" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo3" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo4" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo5" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo6" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo7" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo8" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo9" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo10" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo11" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo12" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo13" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo14" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="postinfo15" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                    </tr>
+                    <tr>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="totalNum" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td id="totalAmount" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;"></td>
+                    </tr>
+                    <tr style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
+                        <td rowspan="2" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">审批人</td>
+                        <td id="customerApproval" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;" colspan="15"></td>
+                    </tr>
+                    <tr style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
+                        <td id="financialApproval" style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;" colspan="15"></td>
+                    </tr>
+                    <tr style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;">抄送人</td>
+                        <td style="font-size: 0.75rem;padding:0.5rem 0;text-indent: 0.5rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;" colspan="15">沈秋梅</td>
+                    </tr>
+                </table>
+                <li style="font-size: 12px;height: 30px;display: block;text-align: left;margin-top: 15px">打印时间:<span id="printTime"></span>&nbsp;&nbsp;&nbsp;&nbsp;打印人:<span id="printPeople"></span></li>
+            </ul>
+        </div>
+    </div>
 </article>
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
 <script type="text/javascript" src="${path}/common/lib/icheck/jquery.icheck.min.js"></script>
 <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery.PrintArea/jquery.PrintArea.js"></script>
 <script type="text/javascript">
+    var type= "${type }";
     //产品类型
     var productType = null;
-    $(function(){
-        $.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","click","0")});
+    if(type > 0){
+        $(function(){
+            $.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","click",4)});
+        $(function(){
+            $.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","click",5)});
+    }else{
+        $(function(){
+            $.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","click",0)});
+    }
+
     // #tab_demo 父级id
     // #tab_demo .tabBar span 控制条
     // #tab_demo .tabCon 内容区
@@ -1361,11 +1537,20 @@
     // 1	默认第2个tab为当前状态(从0开始)
 
 
-
     var mobile= /^1(3|4|5|7|8)\d{9}$/; //手机号码
     var uname = /^[\u4e00-\u9fa5a-zA-Z]{1,12}$/; //中文英文
     var money = /^(0{1}|([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;//金额
-
+    var node = $("#Targetname");
+    $(function () {
+        if(type === "4"){
+            var detectId = $("input[name='detectIds']").val();
+            var detectState = $("input[name='detectStates']").val();
+            to_updateDetectInfo(detectId,detectState);
+            /*var btn = document.getElementById("test");
+            btn.click();*/
+            $("html,body").animate({scrollTop:node.offset().top},300);
+        }
+    });
 
     //添加寄回信息按钮
     function showSendbackDiv() {
@@ -1479,18 +1664,19 @@
                 layer.msg("请输入物流公司!",{icon: 5,time:1000});
                 return;
             }
+            */
             if(sendbackLogisticsNo == null || sendbackLogisticsNo == ""){
                 layer.msg("请输入物流单号!",{icon: 5,time:1000});
                 return;
-            }*/
-            if(sendbackName == null || sendbackName == ""){
+            }
+            /*if(sendbackName == null || sendbackName == ""){
                 layer.msg("请输入寄回人姓名!",{icon: 5,time:1000});
                 return;
             }
             if(sendbackTel == null || sendbackTel == ""){
                 layer.msg("请输入寄回人电话!",{icon: 5,time:1000});
                 return;
-            }
+            }*/
             /*if(sendbackSignTime == null || postageAlipayName == ""){
                 layer.msg("请输入签收时间!",{icon: 5,time:1000});
                 return;
@@ -1745,6 +1931,8 @@
         var postageAlipay = $("#postageAlipay").val();
         var postageDesc = $("#postageDesc").val();
         var postageAlipayType = $("#postageAlipayType").val();
+        var postagePayType = $("#postagePayType").val();
+        var postagePayWhere = $("#postagePayWhere").val();
         if(postageStatus == null || postageStatus == ""){
             layer.msg("请选择邮费状态!",{icon: 5,time:1000});
             return;
@@ -1774,7 +1962,9 @@
                        "postageAlipayName" : postageAlipayName,
                        "postageAlipay" : postageAlipay,
                        "postageAlipayType" : postageAlipayType,
-                       "postageDesc" : postageDesc},
+                       "postageDesc" : postageDesc,
+                       "postagePayType" : postagePayType,
+                       "postagePayWhere" : postagePayWhere},
                 url: "${path}/admin/customer/add_PostageInfo",
                 async: false,
                 success: function(data){
@@ -1786,7 +1976,7 @@
                             postageStatuss = "未申请";
                         }
                         if(postageInfo.postageStatus == 2){
-                            postageStatuss = "已申请(待转账)";
+                            postageStatuss = "已申请";
                         }
                         if(postageInfo.postageStatus == 3){
                             postageStatuss = "已转账";
@@ -1795,7 +1985,7 @@
                             postageStatuss = "未知";
                         }
                         //付款类型  1:用户付款  2:客户付款  3:公司付款
-                        var postageAlipayType = ''
+                        var postageAlipayType = '';
                         if(postageInfo.postageAlipayType == 1){
                             postageAlipayType = '用户付款';
                         }else if(postageInfo.postageAlipayType == 2){
@@ -1803,12 +1993,36 @@
                         }else if(postageInfo.postageAlipayType == 3){
                             postageAlipayType = '公司付款';
                         }
+                        //支付类型
+                        var postagePayType = '';
+                        if(postageInfo.postagePayType == 1){
+                            postagePayType = '支付宝';
+                        }else if(postageInfo.postagePayType == 2){
+                            postagePayType = '微信';
+                        }else if(postageInfo.postagePayType == 3){
+                            postagePayType = '银行卡';
+                        }
+                        //审核状态
+                        var postageTransferStatus = '';
+                        if(postageInfo.postageTransferStatus == 1){
+                            if(postageInfo.postageFinanceStatus == null || postageInfo.postageFinanceStatus == 1){
+                                postageTransferStatus = '待审核';
+                            }
+                            if(postageInfo.postageFinanceStatus == 2){
+                                postageTransferStatus = '已审核(待转账)';
+                            }
+                        }else if(postageInfo.postageTransferStatus == 2){
+                            postageTransferStatus = '已转账';
+                        }
                         $("#trbodyId").append('<tr id="deleteId'+postageInfo.postageId+'"><td>'+postageInfo.postageId+'</td>' +
                                 '<td>'+(postageInfo.postageAmount)/100+'</td>' +
+                                '<td>'+postagePayType+'</td>' +
                                 '<td>'+postageInfo.postageAlipayName+'</td>' +
                                 '<td>'+postageInfo.postageAlipay+'</td>' +
+                                '<td>'+postageInfo.postagePayWhere+'</td>' +
                                 '<td>'+postageAlipayType+'</td>' +
                                 '<td>'+postageStatuss+'</td>' +
+                                '<td>'+postageTransferStatus+'</td>' +
                                 '<td>'+postageInfo.postageDesc+'</td>' +
                                 '<td><a onclick="deletePostage('+postageInfo.postageId+');">删除</a>&nbsp&nbsp<a onclick="getPostage('+postageInfo.postageId+');">修改</a></td></tr>');
                         layer.msg("添加成功!",{icon: 1,time:1000});
@@ -1866,7 +2080,13 @@
                     $("#postageAlipayNames").val(postageInfo.postageAlipayName);
                     $("#postageAlipayTypes").val(postageInfo.postageAlipayTypes);
                     $("#postageDescs").val(postageInfo.postageDesc);
-
+                    $("#postagePayTypes").val(postageInfo.postagePayType);
+                    $("#postagePayWheres").val(postageInfo.postagePayWhere);
+                    if(postageInfo.postagePayType != null && postageInfo.postagePayType === 3){
+                        $("#postagePayWhereDivs").show();
+                    }else{
+                        $("#postagePayWhereDivs").hide();
+                    }
                 } else {
                     layer.msg("修改失败!",{icon: 5,time:1000});
                 }
@@ -1887,6 +2107,8 @@
         var postageAlipay = $("#postageAlipays").val();
         var postageAlipayTypes = $("#postageAlipayTypes").val();
         var postageDesc = $("#postageDescs").val();
+        var postagePayTypes = $("#postagePayTypes").val();
+        var postagePayWheres = $("#postagePayWheres").val();
         if(postageStatus == null || postageStatus == ""){
             layer.msg("请选择邮费状态!",{icon: 5,time:1000});
             return;
@@ -1900,11 +2122,11 @@
             return;
         }
         if(postageAlipayName == null || postageAlipayName == ""){
-            layer.msg("请输入支付宝姓名!",{icon: 5,time:1000});
+            layer.msg("请输入账户姓名!",{icon: 5,time:1000});
             return;
         }
         if(postageAlipay == null || postageAlipay == ""){
-            layer.msg("请输入支付账号!",{icon: 5,time:1000});
+            layer.msg("请输入支付账号!",{icon: 5,time:1000});
             return;
         }
         $.ajax({
@@ -1917,18 +2139,21 @@
                 "postageAlipayName" : postageAlipayName,
                 "postageAlipay" : postageAlipay,
                 "postageAlipayType" : postageAlipayTypes,
-                "postageDesc" : postageDesc},
+                "postagePayWhere" : postagePayWheres,
+                "postagePayType" : postagePayTypes,
+                "postageDesc" : postageDesc
+            },
             url: "${path}/admin/customer/update_PostageInfo",
             async: false,
             success: function(data){
                 if (data.returnCode == 200) {
                     postageInfo = data.returnMsg.postageInfo;
-                    var postageStatuss
+                    var postageStatuss;
                     if(postageInfo.postageStatus == 1){
                         postageStatuss = "未申请";
                     }
                     if(postageInfo.postageStatus == 2){
-                        postageStatuss = "已申请(待转账)";
+                        postageStatuss = "已申请";
                     }
                     if(postageInfo.postageStatus == 3){
                         postageStatuss = "已转账";
@@ -1936,12 +2161,47 @@
                     if(postageInfo.postageStatus == 4){
                         postageStatuss = "未知";
                     }
+                    //付款类型  1:用户付款  2:客户付款  3:公司付款
+                    var postageAlipayType = '';
+                    if(postageInfo.postageAlipayType == 1){
+                        postageAlipayType = '用户付款';
+                    }else if(postageInfo.postageAlipayType == 2){
+                        postageAlipayType = '客户付款';
+                    }else if(postageInfo.postageAlipayType == 3){
+                        postageAlipayType = '公司付款';
+                    }
+                    //支付类型
+                    var postagePayType = '';
+                    if(postageInfo.postagePayType == 1){
+                        postagePayType = '支付宝';
+                    }else if(postageInfo.postagePayType == 2){
+                        postagePayType = '微信';
+                    }else if(postageInfo.postagePayType == 3){
+                        postagePayType = '银行卡';
+                    }
+                    //审核状态
+                    var postageTransferStatus = '';
+                    if(postageInfo.postageTransferStatus == 1){
+                        if(postageInfo.postageFinanceStatus == null ||postageInfo.postageFinanceStatus == 1){
+                            postageTransferStatus = '待审核';
+                        }
+                        if(postageInfo.postageFinanceStatus == 2){
+                            postageTransferStatus = '已审核(待转账)';
+                        }
+                    }else if(postageInfo.postageTransferStatus == 2){
+                        postageTransferStatus = '已转账';
+                    }
+
                     $("#deleteId"+postageId).html("");
                     $("#deleteId"+postageId).append('<td>'+postageInfo.postageId+'</td>' +
                             '<td>'+(postageInfo.postageAmount)/100+'</td>' +
+                            '<td>'+postagePayType+'</td>' +
                             '<td>'+postageInfo.postageAlipayName+'</td>' +
                             '<td>'+postageInfo.postageAlipay+'</td>' +
+                            '<td>'+postageInfo.postagePayWhere+'</td>' +
+                            '<td>'+postageAlipayType+'</td>' +
                             '<td>'+postageStatuss+'</td>' +
+                            '<td>'+postageTransferStatus+'</td>' +
                             '<td>'+postageInfo.postageDesc+'</td>' +
                             '<td><a onclick="deletePostage('+postageInfo.postageId+');">删除</a>&nbsp&nbsp<a onclick="getPostage('+postageInfo.postageId+');">修改</a></td>');
 
@@ -2215,62 +2475,9 @@
         get_product_type();
 
         get_customer();
-        /*/!* 监听寄回状态按钮 *!/
-        $("input[name='renewedBackStatus']").change(function (){
-            initBackInfo($(this).val());
-        })
 
-        /!* 监听寄出状态按钮 *!/
-        $("input[name='renewedSendStatus']").change(function (){
-            initSendInfo($(this).val());
-        })
-
-        /!* 监听邮费状态按钮 *!/
-        $("input[name='renewedIsTransfer']").change(function (){
-            initPostageInfo($(this).val());
-        })*/
     });
 
-    /*/!*初始化寄回信息*!/
-    function initBackInfo(statusCode){
-        if(statusCode == 1){
-            $("#backLogisticsInfo").hide();
-            /!*$("#backTransferInfo").hide();*!/
-            $("#backUserInfo").hide();
-        }else{
-            $("#backLogisticsInfo").show();
-            $("#backTransferInfo").show();
-            $("#backUserInfo").show();
-        }
-    }
-
-    /!*显示隐藏邮费信息*!/
-    function initPostageInfo(statusCode){
-        if(statusCode == 1){
-            $("#postageInformation").show();
-        }else{
-            $("#postageInformation").hide();
-        }
-    }
-
-    /!*初始化寄出信息*!/
-    function initSendInfo(statusCode){
-        if(statusCode == 1){
-            $("#sendUserInfo").hide();
-            $("#sendAddressInfo").hide();
-            $("#sendaddressDescInfo").hide();
-            $("#sendLogisticsInfo").hide();
-            $("#sendDescInfo").hide();
-        }else{
-            $("#sendUserInfo").show();
-            $("#sendAddressInfo").show();
-            $("#sendaddressDescInfo").show();
-            $("#sendLogisticsInfo").show();
-            $("#sendDescInfo").show();
-        }
-    }*/
-
-
     /*显示所有产品及配件信息*/
     function showUpdateSendProduct() {
         var productList = getProduct() ; //所有产品
@@ -3419,8 +3626,137 @@
           $("#sendbackPresaleAdminDiv2").hide();
         }
     }
+    $("#postagePayType").change(function(){
+        var postagePayType = parseInt($("#postagePayType").val());
+        if(postagePayType === 3){
+            $("#postagePayWhereDiv").show();
+        }else{
+            $("#postagePayWhereDiv").hide();
+        }
+    });
+    $("#postagePayTypes").change(function(){
+        var postagePayType = parseInt($("#postagePayTypes").val());
+        if(postagePayType === 3){
+            $("#postagePayWhereDivs").show();
+        }else{
+            $("#postagePayWhereDivs").hide();
+        }
+    });
+    /**
+     * 打印
+     */
+    function printPostage(postageId) {
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {"postageId":postageId},
+            url: "${path}" + "/admin/postage/print_postage",
+            async: true,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var salesOrder = data.returnMsg.salesOrder;
+                    var procMethod = data.returnMsg.procMethod;
+                    var admin = data.returnMsg.admin;
+                    var postage = data.returnMsg.postage;
+                    var itemList = data.returnMsg.itemList;
+                    var loginAdmin = data.returnMsg.loginAdmin;
+                    var product = "";
+                    var productNum = 0;
+                    for(var i=0;i<itemList.length;i++){
+                        product += itemList[i].itemProductName +"("+itemList[i].itemProductColor+");"
+                        productNum += itemList[i].itemNum;
+                    }
+                    var postageCreateTime = formatDate(new Date(postage.postageCreateTime),"yyyy-MM-dd");
+                    var account = "";
+                    if(postage.postagePayType === 3){
+                        account = "银行卡"+"("+postage.postagePayWhere+")"+postage.postageAlipay+" "+postage.postageAlipayName;
+                    }else if(postage.postagePayType === 2){
+                        account = "微信"+postage.postageAlipay+" "+postage.postageAlipayName;
+                    }else if(postage.postagePayType === 1){
+                        account = "支付宝"+postage.postageAlipay+" "+postage.postageAlipayName;
+                    }
 
+                    $("#applyTime").html(postageCreateTime);
+                    $("#postageCoding").html(postage.postageCoding);
+                    $("#applicantPeople").html(admin.adminName);
+                    $("#applicantDepa").html(admin.departName);
+                    $("#postinfo1").html(salesOrder.companyName);
+                    $("#postinfo2").html(procMethod.procTypeName);
+                    $("#postinfo3").html(salesOrder.salesPayTime+postage.questionTitle);
+                    $("#postinfo4").html(salesOrder.salesDealCode);
+                    $("#postinfo5").html(postage.postageClientName);
+                    $("#postinfo6").html(postage.postageClientTel);
+                    $("#postinfo7").html(salesOrder.salesPostFirmName);
+                    $("#postinfo8").html(salesOrder.salesAddressInfo);
+                    $("#postinfo9").html(salesOrder.salesPostNum);
+                    $("#postinfo10").html("爱贝源");
+                    $("#postinfo11").html(product);
+                    $("#postinfo12").html(salesOrder.storeName);
+                    $("#postinfo13").html(productNum);
+                    $("#postinfo14").html(postage.postageAmount /100);
+                    $("#postinfo15").html(account);
+
+                    var postageAuthorityLogList = postage.postageAuthorityLogList;
+                    var customerApproval = "";
+                    var customerApprovalTime = "";
+                    var financialApproval = "";
+                    var financialApprovalTime = "";
+                    for(var i=0;i<postageAuthorityLogList.length;i++){
+                        var log = postageAuthorityLogList[i];
+                        if(log.authorityLogType === 2){
+                            customerApproval = log.adminName;
+                            customerApprovalTime = formatDate(new Date(log.authorityLogCreateTime),"yyyy-MM-dd HH:mm:ss");
+                        }
+                        if(log.authorityLogType === 3){
+                            financialApproval = log.adminName;
+                            financialApprovalTime = formatDate(new Date(log.authorityLogCreateTime),"yyyy-MM-dd HH:mm:ss");
+                        }
 
+                    }
+                    $("#customerApproval").html(customerApproval + "  已同意" +"   "+customerApprovalTime);
+                    $("#financialApproval").html(financialApproval + "  已同意" +"   "+financialApprovalTime);
+                    $("#printTime").html(formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
+                    $("#printPeople").html(loginAdmin.adminName);
+                    $("#totalNum").html("总数量:"+productNum);
+                    $("#totalAmount").html("总退款金额(元):"+postage.postageAmount /100 + "("+swapper(postage.postageAmount /100));
+
+                    //修改打印状态
+                    updateprint(postageId);
+                     $("#printlist").printArea();
+                } else {
+                    layer.msg(data.resultMsg,{icon: 5,time:3000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        })
+    }
+    function updateprint(postageId) {
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {"postageId":postageId},
+            url: "${path}/admin/postage/updatePostagePrint",
+            async: false,
+            success: function(data){
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+    function swapper(n) {
+        if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n))
+            return "数据非法";
+        var unit = "千百拾亿千百拾万千百拾元角分", str = "";
+        n += "00";
+        var p = n.indexOf('.');
+        if (p >= 0)
+            n = n.substring(0, p) + n.substr(p+1, 2);
+        unit = unit.substr(unit.length - n.length);
+        for (var i=0; i < n.length; i++)
+            str += '零壹贰叁肆伍陆柒捌玖'.charAt(n.charAt(i)) + unit.charAt(i);
+        return str.replace(/零(千|百|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
+    }
 </script>
 </body>
 </html>

+ 9 - 105
watero-rst-web/src/main/webapp/WEB-INF/views/cm/postage/postage_list.ftl

@@ -85,8 +85,9 @@
                 <th width="60">退回快递名称</th>
                 <th width="80">快递单号</th>
                 <th width="60">退款金额</th>
-                <th width="60">支付宝账户</th>
-                <th width="80">支付宝姓名</th>
+                <th width="60">支付账户</th>
+                <th width="80">账户姓名</th>
+                <th width="80">开户行</th>
                 <th width="80">快递单号图片</th>
                 <th width="100">操作</th>
             </tr>
@@ -142,18 +143,7 @@
                         </#if>
                     </td>
                     <td>${postage.storeName!''}</td>
-                    <td>
-                        <#if postage.postageTreatmentMethod == 3>
-                            换新
-                        <#elseif postage.postageTreatmentMethod == 4>
-                            维修
-                        <#elseif postage.postageTreatmentMethod == 5>
-                            补发
-                        <#elseif postage.postageTreatmentMethod == 6>
-                            退货
-                        <#elseif postage.postageTreatmentMethod == 7>
-                            无理由退货
-                        </#if></td>
+                    <td>${postage.procTypeName!''}</td>
                     <td>${postage.salesOrderId!''}</td>
                     <td>${postage.postageClientName!''}</td>
                     <td>
@@ -167,21 +157,7 @@
                     <td>${postage.postageClientAddress!''}</td>
                     <td>
                         <#if postage.postageLogisticsCompany??>
-                            <#if postage.postageLogisticsCompany == "sto">申通快递</#if>
-                            <#if postage.postageLogisticsCompany == "yto">圆通快递</#if>
-                            <#if postage.postageLogisticsCompany == "sf">顺丰快递</#if>
-                            <#if postage.postageLogisticsCompany == "ems">邮政EMS</#if>
-                            <#if postage.postageLogisticsCompany == "zto">中通快递</#if>
-                            <#if postage.postageLogisticsCompany == "zjs">宅急送</#if>
-                            <#if postage.postageLogisticsCompany == "yunda">韵达快递</#if>
-                            <#if postage.postageLogisticsCompany == "cces">cces快递</#if>
-                            <#if postage.postageLogisticsCompany == "pick">上门提货</#if>
-                            <#if postage.postageLogisticsCompany == "htky">汇通快递</#if>
-                            <#if postage.postageLogisticsCompany == "ttkdex">天天快递</#if>
-                            <#if postage.postageLogisticsCompany == "stars">星晨急便</#if>
-                            <#if postage.postageLogisticsCompany == "jd">京东快递</#if>
-                            <#if postage.postageLogisticsCompany == "01">其他</#if>
-                            <#if postage.postageLogisticsCompany == "02">上门送货</#if>
+                            ${postage.postageLogisticsCompany!''}
                         <#else>
                             未知
                         </#if>
@@ -190,6 +166,7 @@
                     <td>${postage.postageAmount/100!''}</td>
                     <td>${postage.postageAlipay!''}</td>
                     <td>${postage.postageAlipayName!''}</td>
+                    <td>${postage.postagePayWhere!''}</td>
                     <td>
                         <#if (postage.postageLogisticsImg) ??>
                             <#if (postage.postageLogisticsImg) != "">
@@ -209,7 +186,6 @@
                                 <i class="Hui-iconfont">&#xe6a7;</i>
                             </a>
                          </#if>
-
                         <#if postage.postageManagerStatus?? && postage.postageManagerStatus == 1 && postage.customerManager == 1>
                                 <a style="text-decoration:none" href="javascript:;" title="审核通过" onclick="updatePostage(${postage.postageId},2,2);">
                                     <i class="iconfont icon-pass-2-copy"></i>
@@ -252,59 +228,6 @@
     </div>
 </div>
 
-<div  style="padding: 0px;margin: 0px;display: none;" >
-    <div id="printlist" style="">
-        <ul style=" height: 460px;margin-left: 20px;margin-right: 20px;">
-            <li style="font-size: 23px;height: 25px;display: block;text-align: center;font-weight: bold;margin-top: 15px">商品换货退货退款审批</li>
-            <li style="font-size: 15px;height: 30px;display: block;text-align: left;margin-top: 15px">深圳爱贝源科技有限公司&nbsp;&nbsp;&nbsp;&nbsp;申请日期:<span>2018-12-11</span></li>
-            <li style="height: 40px;font-size: 12px;font-weight: normal;border: 1px solid #000000;">
-                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">审批编码</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">2018xxxxxxxxxxxxxxxx</div>
-            </li>
-            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
-                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">申请人</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">wxm</div>
-            </li>
-            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
-                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">申请部门</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">运营部</div>
-            </li>
-            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
-                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;"></div>
-                <div style="float:left;display:block;width:99px;line-height: 15px;height: 40px;border-right: 1px solid #000000;text-align: center;">客户成交入口</div>
-                <div style="float:left;display:block;width:50px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">售后类型</div>
-                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">销售时间及退换货原因</div>
-                <div style="float:left;display:block;width:50px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">交易号</div>
-                <div style="float:left;display:block;width:89px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">客户名称</div>
-                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">联系电话</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">详细地址</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">快递公司</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">快递单号</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">快递费用承担方</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">退回商品名称/型号</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">销售员</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">数量</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">退款金额</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">退款账户</div>
-            </li>
-
-            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
-                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">客服经理审批</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">xxx</div>
-            </li>
-            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
-                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">财务经理审批</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">xxx</div>
-            </li>
-            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
-                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">财务打款</div>
-                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">xxx</div>
-            </li>
-
-            <li style="font-size: 15px;height: 30px;display: block;text-align: left;margin-top: 15px">打印时间:<span>2018-12-11</span>&nbsp;&nbsp;&nbsp;&nbsp;打印人:<span>xxx</span></li>
-        </ul>
-    </div>
-</div>
 
 
 <tfoot>
@@ -326,7 +249,7 @@
                 async: false,
                 success: function(data){
                     if (data.returnCode == 200) {
-                        //layer.msg(data.resultMsg,{icon: 1,time:3000});
+                        layer.msg(data.resultMsg,{icon: 1,time:3000});
                         location.replace(location.href);
                     } else {
                         layer.msg(data.resultMsg,{icon: 5,time:3000});
@@ -339,27 +262,8 @@
         });
     }
 
-    /**
-     * 打印
-     */
-    function printPostage(postageId) {
-            $.ajax({
-                cache: true,
-                type: "POST",
-                data: {"postageId":postageId},
-                url: "${path}" + "/admin/postage/print_postage",
-                async: true,
-                success: function(data){
-                    if (data.returnCode == 200) {
-                        $("#printlist").printArea();
-                    } else {
-                        layer.msg(data.resultMsg,{icon: 5,time:3000});
-                    }
-                },
-                error: function(XmlHttpRequest, textStatus, errorThrown){
-                }
-            })
-    }
+
+
 </script>
 </body>
 </html>

+ 155 - 18
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/associated_customer.ftl

@@ -33,21 +33,16 @@
         <div class="input-box"  >
             <span class="input-dic spanhidth" style="margin-top: 12px;">客诉编号:</span>
             <input type="text" style="width: 400px;" class="input-text" placeholder="客诉编号" id="signclosedCustomerId" name="signclosedCustomerId">
-            <button type="button" class="my-btn-submit" style="margin-top: 4px;width: 120px;" onclick="select();">查询</button>
+            <button  id="buttonId" type="button" class="my-btn-submit" style="margin-top: 4px;width: 120px;" onclick="select();">查询</button>
         </div>
         <div id="noCustomerDiv" style="display: none; text-align:center;">
             <h3><strong style="color: #93da67">?没有搜索到客诉哦</strong></h3>
         </div>
         <div id="customerDiv" style="display: none;">
-            <#--<div class="row cl">
-                <div class="formControls col-2 col-sm-2 text-r">
-                    <strong>客诉时间:</strong>
-                </div>
-                <div class="formControls col-8 col-sm-8" id="customerCreateTime">
 
-                </div>
-            </div>-->
-                <table class="table table-border table-bg table-bordered" style="margin-top: 10px;width: 500px;">
+            <div class="row cl">
+                <div class="formControls col-10 col-sm-10 text-c" style="margin-left: 50px;" >
+                <table class="table table-border table-bg table-bordered" style="margin-top: 10px;">
                     <thead>
                     <tr>
                         <th width="5" style="text-align: center">客诉标题</th>
@@ -71,14 +66,40 @@
                     </tr>
                     </thead>
                 </table>
+            </div>
+            </div>
         </div>
+
+        <div class="row cl">
+            <div class="formControls col-10 col-sm-10 text-c" style="display:none;margin-left: 50px;" id="onCustomerTable">
+                <table class="table table-border table-bg table-bordered">
+                    <thead>
+                    <tr class="text-c">
+                        <th style="text-align: center;" width="60">客诉时间</th>
+                        <th style="text-align: center;" width="60">跟进客服</th>
+                        <th style="text-align: center;" width="60">用户姓名</th>
+                        <th style="text-align: center;" width="60">用户昵称</th>
+                        <th style="text-align: center;" width="60">用户电话</th>
+                        <th style="text-align: center;" width="60">处理方式</th>
+                        <th style="text-align: center;" width="60">客诉问题</th>
+                        <th style="text-align: center;" width="60">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="onCustomer">
+
+                    </tbody>
+                </table>
+            </div>
+        </div>
+
         <div style="text-align:center;display: none" id="associatedId">
         <#if signclosedId??>
             <input type="hidden" value="${signclosedId!''}" id="signclosedId" name="signclosedId">
         </#if>
-            <button type="button" class="my-btn-submit" onclick="update();">确认关联</button>
+            <button type="button" id="submitId" class="my-btn-submit" onclick="update();">确认关联</button>
         </div>
-
+    <input type="hidden" value="${complaintSignclosedInfo.signclosedSendName!''}" id="signclosedSendName">
+    <input type="hidden" value="${complaintSignclosedInfo.signclosedSendTel!''}" id="signclosedSendTel">
     </form>
 </article>
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
@@ -118,14 +139,13 @@
 
 
     function  update() {
-        var signclosedCustomerId = $("#signclosedCustomerId").val();
-        if( signclosedCustomerId != null){
-            if( signclosedCustomerId.length > 10 ){
-                layer.msg('编号长度不得大于10个字符',{icon: 5,time:1000});
-                return;
+            var signclosedCustomerId = $("#signclosedCustomerId").val();
+            if( signclosedCustomerId != null){
+                if( signclosedCustomerId.length > 10 ){
+                    layer.msg('编号长度不得大于10个字符',{icon: 5,time:1000});
+                    return;
+                }
             }
-        }
-
         $.ajax({
             cache: true,
             type: "POST",
@@ -148,6 +168,123 @@
             }
         });
     }
+
+    function  to_update(customerId) {
+        $("#signclosedCustomerId").val(customerId);
+        $("#buttonId").click();
+        $("#submitId").click();
+
+
+    }
+    selectOnCustomer();
+    /*根据寄回信息查询老的客诉---start--*/
+    function selectOnCustomer() {
+        var customerName = $("#signclosedSendName").val();
+        var customerTel = $("#signclosedSendTel").val();
+        if(
+                (customerName == null || customerName == "") &&
+                (customerTel == null || customerTel == "")){
+            $("#onCustomerTable").hide();
+            return;
+            alert(11);
+        }
+        $.ajax({
+            type: "POST",
+            data: {
+                "customerName":customerName,
+                "customerTel":customerTel},
+            url: "${path}/admin/customer/selectOnCustomer",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var onCustomerList = data.returnMsg.onCustomerList;
+                    if(onCustomerList != null && onCustomerList.length >0 ){
+                        $("#onCustomerTable").show();
+                        var onCustomerTd = "";
+                        for(var i = 0;i < onCustomerList.length; i++){
+                            var onCustomer = onCustomerList[i];
+                            //客诉时间
+                            var time = formatDate(new Date(onCustomer.customerCreateTime),"yyyy-MM-dd");
+                            //处理方式
+                            var customerIsSolve = "";
+                            switch (onCustomer.customerIsSolve){
+                                case 1:
+                                    customerIsSolve = "已解决";
+                                    break;
+                                case 2:
+                                    customerIsSolve = "未解决";
+                                    break;
+                                case 3:
+                                    customerIsSolve = "换新"+ backStatus(onCustomer.backStatus)+sendStatus(onCustomer.sendStatus);
+                                    break;
+                                case 4:
+                                    customerIsSolve = "维修"+ backStatus(onCustomer.backStatus)+sendStatus(onCustomer.sendStatus);
+                                    break;
+                                case 5:
+                                    customerIsSolve = "补发"+ sendStatus(onCustomer.sendStatus);
+                                    break;
+                                case 6:
+                                    customerIsSolve = "退货"+ backStatus(onCustomer.backStatus);
+                                    break;
+                                case 7:
+                                    customerIsSolve = "无理由退货"+ backStatus(onCustomer.backStatus);
+                                    break;
+                            }
+                            var customerWechatName = onCustomer.customerWechatName;
+                            //微信昵称
+                            if(typeof(onCustomer.customerWechatName)=="undefined"){
+                                customerWechatName = "";
+                            }
+                            var customerName = onCustomer.customerName;
+                            //姓名
+                            if(typeof(onCustomer.customerName)=="undefined"){
+                                customerName = "";
+                            }
+                            onCustomerTd += '' +
+                                    ' <tr>' +
+                                    ' <td style="text-align: center;">'+ time+'</td>' +
+                                    ' <td style="text-align: center;">'+onCustomer.adminName +'</td>' +
+                                    ' <td style="text-align: center;">'+customerName +'</td>' +
+                                    ' <td style="text-align: center;">'+customerWechatName +'</td>' +
+                                    ' <td style="text-align: center;">'+onCustomer.customerTel +'</td>' +
+                                    ' <td style="text-align: center;">'+customerIsSolve +'</td>' +
+                                    ' <td style="text-align: center;">'+onCustomer.describeTitle +'</td>' +
+                                    ' <td style="text-align: center;"><a onclick="to_update('+onCustomer.customerId +')">关联此客诉</a>' +
+                                    ' </tr>' +
+                                    '';
+                        }
+                        $("#onCustomer").html(onCustomerTd);
+                    }
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+
+
+        function backStatus(status) {
+            if(status == 1){
+                return "(未寄回)";
+            }
+            if(status == 2){
+                return "(已寄回)";
+            }
+            if(status == 3){
+                return "(已收货)";
+            }
+        }
+        function sendStatus(status) {
+            if(status == 1){
+                return "(未寄送)";
+            }
+            if(status == 2){
+                return "(已寄送)";
+            }
+            if(status == 3){
+                return "(已收货)";
+            }
+        }
+    }
 </script>
 </body>
 </html>

+ 27 - 11
watero-rst-web/src/main/webapp/WEB-INF/views/home/pc_index.ftl

@@ -99,18 +99,33 @@
     </div>
 
     <div id="selectTodo" class="menu_dropdown bk_2" style="display:none">
-        <div>
-            <div>订单</div>
-            <a onclick="toOrserList('${path}/admin/salesOrder/list_order_page?salesStatus=0',1,'',this)"  ><span>(</span><span id="toBeConfirmedOrder" style="color: #f00">0</span><span>)待确认订单数量</span></a><br>
-            <a onclick="toOrserList('${path}/admin/salesOrder/list_order_page?salesShippingStatus=0',1,'',this)"  ><span>(</span><span id="toBeAnnounced" style="color: #f00">0</span><span>)待通知配货数量</span></a><br>
-            <a onclick="toOrserList('${path}/admin/salesOrder/list_order_page?salesShippingStatus=11',1,'',this)"  ><span>(</span><span id="toBeDelivered" style="color: #f00">0</span><span>)待发货数量</span></a><br>
-            <a onclick="toOrserList('${path}/admin/salesOrder/list_order_page?1=1',1,'today',this)"  ><span>(</span><span id="allToDayOrder" style="color: #f00">0</span><span>)今日订单总数</span></a><br>
+        <ul>
+            <li style="margin-top: 10px;width: 200px;margin-left: 10px;">
+                <a onclick="toOrserList('${path}/admin/salesOrder/list_order_page?salesStatus=0',1,'',this)">
+                    <span style="color: red">待确认订单数量(<span id="toBeConfirmedOrder" style="color: #f00">0</span>)</span>
+                </a>
+            </li>
+            <li style="margin-top: 10px;width: 200px;margin-left: 10px;">
+                <a onclick="toOrserList('${path}/admin/salesOrder/list_order_page?salesShippingStatus=0',1,'',this)">
+                    <span style="color: red">待通知配货数量(<span id="toBeAnnounced" style="color: #f00">0</span>)</span>
+                </a>
+            </li>
+            <li style="margin-top: 10px;width: 200px;margin-left: 10px;">
+                <a onclick="toOrserList('${path}/admin/salesOrder/list_order_page?salesShippingStatus=11',1,'',this)">
+                    <span style="color: red">待发货数量(<span id="toBeDelivered" style="color: #f00">0</span>)</span>
+                </a>
+            </li>
+            <li style="margin-top: 10px;width: 200px;margin-left: 10px;">
+                <a onclick="toOrserList('${path}/admin/salesOrder/list_order_page?1=1',1,'today',this)">
+                    <span style="color: red">今日订单总数(<span id="allToDayOrder" style="color: #f00">0</span>)</span>
+                </a>
+            </li>
             <#--<div>客诉</div>-->
             <#--<a onclick="toOrserList('${path}/admin/customer/select_customer_list?customerIsSolve=2&isFirst=1',2,'')"  ><span>(</span><span id="notSolvedCustomer" style="color: #f00">0</span><span>)未解决客诉数量</span></a><br>-->
             <#--<a onclick="toOrserList('${path}/admin/customer/select_customer_list?backStatus=4&isFirst=1',2,'')"  ><span>(</span><span id="amountReceivedCustomer" style="color: #f00">0</span><span>)需要向工厂确认是否已签收的产品数量</span></a><br>-->
             <#--<a onclick="toOrserList('${path}/admin/customer/select_customer_list?backStatus=3&isFirst=1',2,'')"  ><span>(</span><span id="noEntryCustomer" style="color: #f00">0</span><span>)需要填写Efast订单号的客诉数量</span></a><br>-->
             <#--<a onclick="toOrserList('${path}/admin/customer/select_customer_list?backStatus=1&isFirst=1',2,'')"  ><span>(</span><span id="notSendCustomer" style="color: #f00">0</span><span>)录入三天后未寄回的客诉数量</span></a>-->
-        </div>
+        </ul>
     </div>
 </section>
 
@@ -129,12 +144,13 @@
     function toDoShow(){
         //页面层
         layer.open({
-            title: '待办事项',
             type: 1,
-            area: ['300px', '175px'], //宽高
-            content: $("#selectTodo").html(),
+            shade: false,
             offset: 'rb',
-            shade: 0
+            /*closeBtn: 0, 是否展示关闭按钮*/
+            title: false,
+            area: ['300px', '175px'], //宽高
+            content: $("#selectTodo").html()
         });
     }
     function toDoShow2(playSingle,outbound){

+ 5 - 27
watero-rst-web/src/main/webapp/WEB-INF/views/order/excel_to_order_new.ftl

@@ -535,22 +535,23 @@
                 layer.msg('加载失败,请重试!',{icon: 5,time:3000});
             } else {
                     $("#selectStore").html("");
-                    var temp;
+                    var temp = "";
                     for (var i = 0; i < result.returnMsg.values.length; i++) {
                         temp += '<tr class="text-c">'
                              + '<td style=" width: 265px;">' + result.returnMsg.values[i] + '</td>'
                              + '<td style="text-align: left;">'
                              + '<label>'
-                             + '<select class="chosen order_store_select" name="states" id="" style="height: 30px;width: 180px;margin: 0px;">';
+                             + '<select class="chosen order_store_select" name="states" id="statesId'+i+'" style="height: 30px;width: 180px;margin: 0px;">';
                         for (var j = 0; j < result.returnMsg.stores.length; j++) {
                             temp += '<option value="' + result.returnMsg.values[i] + '_' + result.returnMsg.stores[j].storeId + '" >' + result.returnMsg.stores[j].storeName + '</option>'
                         }
                         temp += '</select></label>'
                              + '</td>'
                              + '</tr>';
-
+                        $("#selectStore").append(temp);
+                        $("#statesId"+i).chosen({allow_single_deselect:true});
+                        temp = "";
                     }
-                    $("#selectStore").html(temp);
             }
             layer.close(index);
         });
@@ -764,28 +765,5 @@
         search_contains:false,
         enable_split_word_search: true //分词搜索,选项词可通过空格或'[]'分隔。search_contains为false时才能看出效果
     });
-    chonsens();
-    function chonsens() {
-        $('.chosen').chosen({
-            no_results_text: "没有找到结果!",//搜索无结果时显示的提示
-            search_contains:true,   //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
-            allow_single_deselect:true, //单选下拉框是否允许取消选择。如果允许,选中选项会有一个x号可以删除选项
-            disable_search: false, //禁用搜索。设置为true,则无法搜索选项。
-            disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
-            inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
-            placeholder_text_single: '选择国家', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
-            width: '227px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
-            max_shown_results: 1000, //下拉框最大显示选项数量
-            display_disabled_options: false,
-            single_backstroke_delete: false, //false表示按两次删除键才能删除选项,true表示按一次删除键即可删除
-            case_sensitive_search: false, //搜索大小写敏感。此处设为不敏感
-            group_search: false, //选项组是否可搜。此处搜索不可搜
-            include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
-        });
-        $('.chosen2').chosen({
-            search_contains:false,
-            enable_split_word_search: true //分词搜索,选项词可通过空格或'[]'分隔。search_contains为false时才能看出效果
-        });
-    }
 </script>
 </html>

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

@@ -389,6 +389,7 @@
             url: "${path}/admin/customer/select_storeInfo",
             success: function(data){
                 $("#salesStoreId").empty();    //清空下拉框
+                $("#salesStoreId").append("<option  value=''></option>");
                 if (data.returnCode == 200) {
                     for(var i=0;i<data.returnMsg.storeInfoList.length;i++){
                         var storeInfo = data.returnMsg.storeInfoList[i];
@@ -409,7 +410,7 @@
         disable_search: false, //禁用搜索。设置为true,则无法搜索选项。
         disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
         inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
-        placeholder_text_single: '选择国家', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
+        placeholder_text_single: '选择店铺', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
         width: '260px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
         max_shown_results: 1000, //下拉框最大显示选项数量
         display_disabled_options: false,

+ 252 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_check_list.ftl

@@ -0,0 +1,252 @@
+<!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" />
+    <link rel="Bookmark" href="/favicon.ico" >
+    <link rel="Shortcut Icon" href="/favicon.ico" />
+    <#include "/base/list_base.ftl">
+    <title>出库列表</title>
+    <style>
+        *{padding: 0;margin: 0;}
+        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
+        .my-input::-webkit-input-placeholder{text-indent: 1em;}
+        .table-bg thead th{background-color: #f7fafd;}
+        .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
+    </style>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">/</span> 仓库管理
+    <span class="c-gray en">/</span> 打单核对
+    <a class="btn radius r" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+    <div class="pd-20 cl">
+            <div class="row cl"  style="margin-bottom: 20px;">
+                <div class="col-2 col-sm-2">
+                    <input type="text" class="my-input trim_input" style="width:193px;margin-right: 0px; margin-bottom: 10px;" name="pickingStartDate" id="pickingStartDate"  placeholder="开始时间" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',skin:'whyGreen' })" value="${pickingStartDate!''}" readonly="readonly"/>
+                </div>
+                <div class="col-2 col-sm-2">
+                    <button type="button" class="btn" style="background: #50a2ea;border: 1px solid #50a2ea;color: #fff;height: 35px;margin-bottom: 3px;" onclick="print1();">打印拣货单</button>
+                </div>
+            </div>
+            <div class="row cl"  style="margin-bottom: 20px;">
+                <div class="col-2 col-sm-2">
+                    <input type="text" class="my-input trim_input" style="width:193px;margin-right: 0px; margin-bottom: 10px;" name="checkStartDate" id="checkStartDate"  placeholder="开始时间" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',skin:'whyGreen' })" value="${checkStartDate!''}" readonly="readonly"/>
+                </div>
+                <div class="col-2 col-sm-2">
+                    <button type="button" class="btn" style="background: #50a2ea;border: 1px solid #50a2ea;color: #fff;height: 35px;margin-bottom: 3px;" onclick="print2();">打印快递核对单</button>
+                </div>
+            </div>
+    </div>
+
+
+    <div   style="display: none;">
+        <div class="page" id="pageid1">
+            <html>
+            <head>
+
+            </head>
+            <body>
+            <table class="table2" style="margin:0 0 0.5cm 1cm;width: 19cm;border: 1px solid #000;border-collapse: collapse;text-align: left;">
+                <thead style="display:table-header-group">
+                <tr>
+                    <th colspan="3" >
+                        <span style="text-align:center;font-size: 1.75rem;">拣货单</span>
+                        <div style="float: right;margin-top: 0.5cm">
+                            <span style="margin-right: 2cm;" id="dateId1">时间:</span>
+                            <span style="margin-right: 2cm;">仓库人员:</span>
+                            <span style="margin-right: 2cm;">仓库主管:</span>
+                        </div>
+                    </th>
+                </tr>
+                <tr>
+                    <th style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"><strong>产品名称</strong></th>
+                    <th style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"><strong>颜色</strong></th>
+                    <th style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"><strong>数量</strong></th>
+                </tr>
+                </thead>
+                <tbody id="listid1">
+                <tr>
+                </tr>
+                </tbody>
+            </table>
+            </body>
+            </html>
+        </div>
+    </div>
+<div   style="display: none;">
+    <div class="page" id="pageid2">
+        <html>
+        <head>
+
+        </head>
+        <body>
+        <table class="table2" style="margin:0 0 0.5cm 1cm;width: 19cm;border: 1px solid #000;border-collapse: collapse;text-align: left;">
+            <thead style="display:table-header-group">
+            <tr>
+                <th colspan="6" >
+                    <span style="text-align:center;font-size: 1.75rem;">核对单</span>
+                    <div style="float: right;margin-top: 0.5cm">
+                        <span style="margin-right: 2cm;" id="dateId2">时间:</span>
+                    </div>
+                </th>
+            </tr>
+            <tr>
+                <th style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"><strong>快递公司</strong></th>
+                <th style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"><strong>面单数</strong></th>
+                <th style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"><strong>未发单</strong></th>
+                <th style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"><strong>截单数</strong></th>
+                <th style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"><strong>快递实际取件</strong></th>
+                <th style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"><strong>快递签名</strong></th>
+            </tr>
+            </thead>
+            <tbody id="listid2">
+            <tr>
+
+            </tr>
+            </tbody>
+        </table>
+        </body>
+        </html>
+    </div>
+</div>
+<script type="text/javascript" src="https://s.iamberry.com/js/LodopFuncs_v_5_0.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery.PrintArea/jquery.PrintArea.js"></script>
+<script type="text/javascript">
+
+    function print1(){
+        var LODOP=getLodop();
+        var pickingStartDate = $("#pickingStartDate").val();
+        $.ajax({
+            type: "POST",
+            url: "${path}/admin/salesOrder/getSalesOrderCheck",
+            data:{"startDate1":pickingStartDate},
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var html = '';
+                    if(data.returnMsg.infos.length < 1){
+                        layer.msg('未查询到数据',{icon: 5,time:1000});
+                        return;
+                    }
+                    data.returnMsg.infos.forEach(function (value, i) {
+                        html += '<tr>' +
+                                '<td style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;">' + value.productName + '</td>' +
+                                '<td style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;">' + value.colorName + '</td>' +
+                                '<td style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;">' + value.num + '</td>' +
+                                '</tr>';
+                    });
+                    $("#listid1").html(html);
+                    var day1 = new Date();
+                    $("#dateId1").html("打印时间:"+formatDate(day1,"yyyy-MM-dd HH:mm:ss"));
+                    // 选择打印设备
+                    var isIE = (navigator.userAgent.indexOf('MSIE')>=0) || (navigator.userAgent.indexOf('Trident')>=0);
+                    if (!isIE) {
+                        LODOP.PRINT_INIT('打印拣货单');
+                        LODOP.SET_PRINT_PAGESIZE(0, 0, 0,"");
+                        LODOP.ADD_PRINT_HTM("0mm","-7mm","100%","100%", $("#pageid1").html());
+                        LODOP.SELECT_PRINTER(true);
+                        // 注意,选择打印机后,需要更改打印机事件,否则无法执行回调
+                        var spans = $("span");
+                        for (var i = 0; i < spans.length; i++) {
+                            if ($(spans[i]).text() === "打印份数:") {
+                                $(spans[i]).parent().next()[0].onclick = function () {
+                                    CLODOP.SelectBox.clickOK(false);
+                                    layer.msg("打印成功", {icon: 6, time: 3000});
+                                };
+                            }
+                        }
+                    } else {
+                        LODOP.SELECT_PRINTER();
+                        LODOP.PRINT_INIT('打印拣货单');
+                        LODOP.SET_PRINT_PAGESIZE(0, 0, 0,"");
+                        LODOP.ADD_PRINT_HTM("0mm","-7mm","100%","100%", $("#pageid1").html());
+                        var flag = LODOP.PRINT();
+                        if (flag) {
+                            layer.msg("打印成功", {icon: 6, time: 3000});
+                        }
+                    }
+                }
+
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('打印失败',{icon: 5,time:1000});
+            }
+        });
+
+    }
+
+
+
+
+    function print2(){
+        var LODOP=getLodop();
+        var checkStartDate = $("#checkStartDate").val();
+        $.ajax({
+            type: "POST",
+            url: "${path}/admin/salesOrder/getSalesOrderCheck",
+            data:{"startDate2":checkStartDate},
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var html = '';
+                    if(data.returnMsg.infos.length < 1){
+                        layer.msg('未查询到数据',{icon: 5,time:1000});
+                        return;
+                    }
+                    data.returnMsg.infos.forEach(function (value, i) {
+                        html += '<tr>' +
+                                '<td style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;">' + value.logisticsName + '</td>' +
+                                '<td style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;">' + value.num + '</td>' +
+                                '<td style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"></td>' +
+                                '<td style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"></td>' +
+                                '<td style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"></td>' +
+                                '<td style="width: 2.4cm; font-size: 0.75rem;padding:0.5rem 0;text-indent: 1.2rem; color: #333;border: 1px solid #000;border-collapse: collapse;background-color: #fff;height: 0.28cm;"></td>' +
+                                '</tr>';
+                    });
+                    $("#listid2").html(html);
+                    var day1 = new Date();
+                    $("#dateId2").html("打印时间:"+formatDate(day1,"yyyy-MM-dd HH:mm:ss"));
+// 选择打印设备
+                    var isIE = (navigator.userAgent.indexOf('MSIE')>=0) || (navigator.userAgent.indexOf('Trident')>=0);
+                    if (!isIE) {
+                        LODOP.PRINT_INIT('打印拣货单');
+                        LODOP.SET_PRINT_PAGESIZE(0, 0, 0,"");
+                        LODOP.ADD_PRINT_HTM("0mm","-7mm","100%","100%", $("#pageid2").html());
+                        LODOP.SELECT_PRINTER(true);
+                        // 注意,选择打印机后,需要更改打印机事件,否则无法执行回调
+                        var spans = $("span");
+                        for (var i = 0; i < spans.length; i++) {
+                            if ($(spans[i]).text() === "打印份数:") {
+                                $(spans[i]).parent().next()[0].onclick = function () {
+                                    CLODOP.SelectBox.clickOK(false);
+                                    layer.msg("打印成功", {icon: 6, time: 3000});
+                                };
+                            }
+                        }
+                    } else {
+                        LODOP.SELECT_PRINTER();
+                        LODOP.PRINT_INIT('打印拣货单');
+                        LODOP.SET_PRINT_PAGESIZE(0, 0, 0,"");
+                        LODOP.ADD_PRINT_HTM("0mm","-7mm","100%","100%", $("#pageid2").html());
+                        var flag = LODOP.PRINT();
+                        if (flag) {
+                            layer.msg("打印成功", {icon: 6, time: 3000});
+                        }
+                    }
+
+                }
+
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('打印失败',{icon: 5,time:1000});
+            }
+        });
+
+    }
+</script>
+
+</body>
+</html>

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

@@ -240,7 +240,7 @@
                         <#elseif order.salesStatus == 2>
                             挂起
                         <#elseif order.salesStatus == 3>
-                            作废
+                            <span style="color: #dd0000">作废</span>
                         </#if>
                     </td>
                     <td>
@@ -267,6 +267,9 @@
                         <a class="edit_order_target" style="text-decoration:none;display: none" href="javascript:void(0);" title="修改订单" alt="修改订单" onclick="sales_order_update(${order.salesId!''})">
                             <i class="Hui-iconfont">&#xe6df;</i>
                         </a>
+                        <a class="order_cancel_distribution" style="text-decoration:none;display: none" href="javascript:void(0);" title="撤销配货" alt="撤销配货" onclick="cancelDistribution(${order.salesId!''})">
+                            <i class="Hui-iconfont">&#xe66b;</i>
+                        </a>
                         <a class="allocation_logistics_target" style="text-decoration:none;display: none" href="javascript:void(0);" title="分配物流" onclick="distribution_express(${order.salesId!''})">
                             <i class="Hui-iconfont">&#xe669;</i>
                         </a>
@@ -401,12 +404,13 @@
                                tr.find(".manual_ship_target").show();
                                tr.find(".invalid_order_target").show();
                                tr.find(".del_order_target").show();
+                               tr.find(".order_cancel_distribution").show();
                            } else {
                                // 已出库
                                tr.find(".order_details_target").show();
                                tr.find(".invalid_order_target").show();
                            }
-                       } else if (orderStatus == "0") {
+                       }else if (orderStatus == "0") {
                            // 未发货
                            tr.find(".order_details_target").show();
                            tr.find(".allocation_logistics_target").show();
@@ -415,6 +419,7 @@
                            tr.find(".notice_distribution_target").show();
                            tr.find(".del_order_target").show();
                            tr.find(".split_order_target").show();
+                           tr.find(".edit_order_target").show();
                        } else {
                            tr.find(".order_details_target").show();
                            tr.find(".invalid_order_target").show();
@@ -829,6 +834,30 @@ function isConfirm(salesOrderIds,isSplit) {
                 });
             });
         }
+        /**
+         * 撤销通知配货
+         */
+        function cancelDistribution(salesId) {
+                $.ajax({
+                    type:'POST',
+                    url: '${path}/admin/salesOrder/cancel_distribution',
+                    data:{
+                        "id" : salesId
+                    },
+                    dataType: 'json',
+                    success:function(res) {
+                        if(res.resultCode == 200 && res.returnCode == 200){
+                            layer.alert("撤销成功!", function(index){
+                                location.reload();
+                            });
+
+                        }else{
+                            layer.alert("撤销失败!");
+                        }
+                        return false;
+                    }
+                });
+        }
 
         /**
          *跳转到详情页面

+ 12 - 8
watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/employee_list.ftl

@@ -54,14 +54,14 @@
         &lt;#&ndash;<th scope="col" colspan="2">共有数据:<strong>#{page.total}</strong> 条</th>&ndash;&gt;
         </tr>-->
         <tr class="text-c">
+            <th width="100">所属部门</th>
             <th width="80">员工编号</th>
             <th width="100">员工姓名</th>
             <th width="120">员工电话</th>
             <th width="55">员工状态</th>
             <th width="80">入职日期</th>
             <th width="100">员工岗位</th>
-            <th width="100">是否具有清空卡权限</th>
-            <th width="100">拉线</th>
+            <#--<th width="100">是否具有清空卡权限</th>-->
             <th width="80">离职日期</th>
             <th width="150">添加时间</th>
             <th width="100">操作</th>
@@ -71,6 +71,7 @@
             <#if page.dataList?? &&  (page.dataList?size > 0) >
                     <#list page.dataList as employee>
                         <tr class="text-c">
+                            <td>${employee.employeeLine!}</td>
                             <td>${employee.employeeNo!}</td>
                             <td>${employee.employeeName!}</td>
                             <td>${employee.employeeTel!}</td>
@@ -83,23 +84,26 @@
                             </td>
                             <td>${(employee.employeeEntryDate?string("yyyy-MM-dd"))!''}</td>
                             <td>${employee.employeePost!}</td>
-                            <td>
+                            <#--<td>
                                 <#if employee.employeeClearPower == 0>
                                 <#elseif employee.employeeClearPower == 1>
                                 </#if>
-                            </td>
-                            <td>${employee.employeeLine!}</td>
+                            </td>-->
                             <td>${(employee.employeeDepartureDate?string("yyyy-MM-dd"))!''}</td>
                             <td>${(employee.employeeCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
                             <td>
                                 <a style="text-decoration:none" href="javascript:void(0);" title="编辑" onclick="admin_update_employee(${employee.employeeId!});">
-                                    <i class="Hui-iconfont">&#xe6df;</i>
+                                    编辑
                                 </a>
-                                <a style="text-decoration:none" href="javascript:;" title="查看作用工序"
+                                <#--<a style="text-decoration:none" href="javascript:;" title="查看作用工序"
                                    onclick="edit_process('${path}/admin/equipment/_update_process?deviceId=0');">
-                                    <i class="Hui-iconfont">&#xe70c;</i>
+                                    查看作用工序
+                                </a>-->
+                                <a style="text-decoration:none" href="javascript:;" title="查看工作效率"
+                                onclick="admin_edit('查看工作效率','${path}/admin/productionPlan/select_productionPlan_statistical?employeeId='+${employee.employeeId!},300,1000);">
+                                查看工作效率
                                 </a>
                             </td>
                         </tr>

+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/save_employee.ftl

@@ -36,6 +36,7 @@
     <form class="form form-horizontal" id="form-admin-addEmployee">
         <div style="padding: 10px;width: 600px;margin: 0 auto;">
             <div class="my-title">员工信息</div>
+            <div class="input-box"><span class="input-dic"><span class="c-red">*</span>所属部门</span>&nbsp;&nbsp;<input class="my-input" type="text" name="employeeLine" id="employeeLine" value="" placeholder="请输入2-30位中文、英文、数字字符描述" required   maxlength="30"  minlength="2" /> </div>
             <div class="input-box"><span class="input-dic"><span class="c-red">*</span>员工编号</span>&nbsp;&nbsp;<input class="my-input" name="employeeNo" id="employeeNo" type="text" value="" placeholder="请输入员工编号" required   maxlength="10"  /> <span style="color: red;" id="employeeNoMsg"></span></div>
             <div class="input-box"><span class="input-dic"><span class="c-red">*</span>员工姓名</span>&nbsp;&nbsp;<input class="my-input" name="employeeName" id="employeeName" type="text" value="" placeholder="请输入2-10位中文" required   maxlength="10" minlength="2" /> </div>
             <div class="input-box"><span class="input-dic"><span class="c-red">&nbsp;</span>手机号码</span>&nbsp;&nbsp;<input class="my-input" name="employeeTel" id="employeeTel" type="text" value="" placeholder="请输入11位的手机号码" /><span style="color: red;" id="employeeTelMsg"></span> </div>
@@ -43,7 +44,7 @@
                 <input type="radio" id="employeeState1" name="employeeState" value="1" checked/><label for="employeeState1">在职</label>
                 <input type="radio" id="employeeState2" name="employeeState" value="0"/><label for="employeeState2">离职</label>
             </div>
-            <div class="input-box"><span class="input-dic" style="margin-top: 0"><span class="c-red">*</span>清空卡权限</span>
+            <div class="input-box" style="display: none;"><span class="input-dic" style="margin-top: 0;"><span class="c-red">*</span>清空卡权限</span>
                 <input type="radio" id="employeeClearPower1" name="employeeClearPower" value="0" /><label for="employeeClearPower1">具有</label>
                 <input type="radio" id="employeeClearPower2" name="employeeClearPower" value="1" checked /><label for="employeeClearPower2">不具有</label>
             </div>
@@ -51,7 +52,6 @@
             <div class="input-box"><span class="input-dic"><span class="c-red">*</span>入职日期</span>&nbsp;&nbsp;<input class="my-input-date" type="text" name="employeeEntryDate" id="employeeEntryDate" value="" placeholder="请选择入职日期" onclick="WdatePicker({skin:'whyGreen'})"  readonly="readonly" /> </div>
             <div class="input-box" id="isDeparture"><span class="input-dic"><span class="c-red">*</span>离职日期</span>&nbsp;&nbsp;<input class="my-input-date" type="text" name="employeeDepartureDate" id="employeeDepartureDate" value="" placeholder="请选择离职日期"  onclick="WdatePicker({ dateFmt:'yyyy-MM-dd',skin:'whyGreen',minDate:'#F{$dp.$D(\'employeeEntryDate\')||\'%y-%M-%d\'}' })"  readonly="readonly"/></div>
             <div class="input-box"><span class="input-dic"><span class="c-red">*</span>员工岗位</span>&nbsp;&nbsp;<input class="my-input" type="text" name="employeePost" id="employeePost" value="" placeholder="请输入2-20位中文、英文字符描述" required   maxlength="20"  minlength="2" /> </div>
-            <div class="input-box"><span class="input-dic">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c-red">*</span>拉线</span>&nbsp;&nbsp;<input class="my-input" type="text" name="employeeLine" id="employeeLine" value="" placeholder="请输入2-30位中文、英文、数字字符描述" required   maxlength="30"  minlength="2" /> </div>
             <div style="clear: both;"></div>
             <div class="input-box"><span class="input-dic">员工备注</span>&nbsp;&nbsp;
                 <textarea rows="3" cols="20" class="my-textarea" name="employeeDesc" id="employeeDesc"  maxlength="200" msg="员工备注" ></textarea>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/employee/update_employee.ftl

@@ -45,7 +45,7 @@
                 <input type="radio" id="employeeState1" name="employeeState" value="1" <#if employee.employeeState == 1>checked</#if>/><label for="employeeState1">在职</label>
                 <input type="radio" id="employeeState2" name="employeeState" value="0" <#if employee.employeeState == 0>checked</#if>/><label for="employeeState2">离职</label>
             </div>
-            <div class="input-box"><span class="input-dic" style="margin-top: 0">清空卡权限</span>
+            <div class="input-box" style="display: none;"><span class="input-dic" style="margin-top: 0;">清空卡权限</span>
                 <input type="radio" id="employeeClearPower1" name="employeeClearPower" value="0" <#if employee.employeeClearPower == 0>checked</#if>/><label for="employeeClearPower1">具有</label>
                 <input type="radio" id="employeeClearPower2" name="employeeClearPower" value="1" <#if employee.employeeClearPower == 1>checked</#if>/><label for="employeeClearPower2">不具有</label>
             </div>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl

@@ -220,7 +220,7 @@
                                     /* '<span style="position: absolute;padding-top: 100px;padding-left: -100px;" id="barcodeId">'+machineBarcode+'</span>' +*/
                                     '</div>');
                         }else{
-                            $("#printlist").append('<div style="width: 242px;height: 120px;position: relative;">' +
+                            $("#printlist").append('<div style="width: 242px;height: 122px;position: relative;">' +
                                     '<span style="position: absolute;left: 10px;font-size: 14px;">反渗透净水机</span>' +
                                     '<span style="position: absolute;top: 25px;left: 10px;font-size: 12px;visibility:hidden;">型号:'+producePattern+'-'+produceModel+'</span>' +
                                     '<span style="position: absolute;top: 40px;left: 10px;font-size: 12px;visibility:hidden;">S/N</span>' +

+ 284 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/add_productionPlan.ftl

@@ -0,0 +1,284 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>添加生产计划 - H-ui.filter v2.4</title>
+    <style>
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;font-size: 16px;padding-left: 10px;color: #50a2ea;display: inline-block;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 50%;height: 6px;width: 6px;border-radius: 6px;margin-top: -3px; background-color: #32a3d8;}
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 14px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 77%;border:1px solid rgba(0,0,0,.1);margin-left: 12.5%;}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 158px; background-color: #50a2ea;color: #fff;border: 1px solid #50a2ea;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select {
+            border: 1px solid rgba(0,0,0,.1);
+            padding: 6px 50px 6px 15px;
+            height: 34px;
+            -webkit-appearance: none;
+            appearance: none;
+            background: url(/common/images/pts/select-11.png) right center no-repeat;
+            background-size: auto 100%;
+        }
+        .check-box, .radio-box{padding-left: 0;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .huanhang{ float:left}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="row cl">
+            <label class="form-label col-3">
+                <div class="tit-2">新建工作计划</div>
+            </label>
+            <div class="formControls col-9">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <span style="font-size: 16px;">这是本日的第<span style="color: #dd0000">${planCount+1}</span>个工作计划</span>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工作日期:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input type="text" style="width: 80%;" class="input-text my-input-date Wdate" value="${plan_date?string('yyyy-MM-dd')}" placeholder="工作日期" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" id="plan_date" name="plan_date" readonly="readonly"/>
+            </div>
+        </div>
+        <div class="row cl">
+        <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工序选择:</label>
+        <div class="formControls col-xs-9 col-sm-9" style="margin: 10px 0px;padding-left: 0;">
+            <select class="my-select" id="planProcessId" name="planProcessId" class="chosen" onchange="getProcess();" style="width: 80%;">
+                <option value="">请选择工序</option>
+                    <#if (listProductionProcess?size > 0)>
+                        <#list listProductionProcess as info>
+                                <option  value="${info.processId!""}">${info.processName!""}</option>
+                        </#list>
+                    </#if>
+            </select><br>
+            <span id="ProcessSpanOne" style="display: none; color: #6d6d72;">已选择工序:<span id="ProcessSpan"></span></span>
+        </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>拉线:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input class="my-input" type="text"  name="planStay" id="planStay" placeholder="请输入拉线" style="width: 78%;"/>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>员工选择</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input type="button" style="color: #32a3d8;border: 1px solid #32a3d8;" class="btn add-order-button" onclick="add_employee()" value="选择员工" >
+                <table class="table table-border table-bordered table-bg table-hover table-sort" style="margin-top: 10px;display: none;width: 80%;" id="all_add_employee">
+                    <thead>
+                    <tr class="text-c" id="table1">
+                        <th style="text-align: center;" width="40" >员工编号</th>
+                        <th style="text-align: center;" width="25" >员工姓名</th>
+                        <th style="text-align: center;" width="10">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="add_employee">
+                    </tbody>
+                </table>
+                <input type="hidden" id="employeeString" name="employeeString" value="" >
+            </div>
+            <br>
+        </div>
+        <div class="row cl" >
+            <label class="form-label col-1 col-sm-1"></label>
+            <div id="product_color_error" style="color: red;"></div>
+        </div>
+        <div class="input-box" style="margin-left: 30%">
+
+
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <span style="color: #6d6d72;">在当日的工作中,同一个员工不允许在多个工序工作</span><br>
+                <button type="button" class="my-btn-submit" onclick="addProductionPlan();" style="margin-top: 20px;">确认新建</button>
+            </div>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+    /**
+     * 打开员工列表
+     */
+    function add_employee() {
+        layer_show("员工列表","${path}/admin/employee/employee_list?pageSize=1000","800","500");
+    }
+    /**
+     * 选择员工回调
+     * @param colorIds
+     */
+    function setSelectEmployee(employeeIds){
+        var index = layer.load(1, {
+            shade: [0.5,'#fff'] //0.1透明度的白色背景
+        });
+
+        $("#all_add_employee").show();
+
+        var employeeIdArray = employeeIds.split("_");
+        for(var j=0;j<employeeIdArray.length;j++){
+            var employeeId = employeeIdArray[j];
+            if(employeeId == ""){
+                break;
+            }
+
+            var flag = true;
+            $("#add_employee").find("tr").each(function (){
+                var emp_Id = $(this).find(".employee_id").eq(0).val();
+                if(emp_Id == employeeId){
+                    flag  = false;
+                }
+            });
+            if(!flag){
+                continue;
+            }
+
+            $.ajax({
+                type: "POST",
+                data: {
+                    employeeId : employeeId
+                },
+                url: "${path}/admin/employee/get_employee",
+                async:false,
+                success: function(data){
+                    var html = "";
+                    if (data.returnCode == 200) {
+                        var employee = data.returnMsg.ptsEmployee;
+                            html += '<tr class="text-c">' +
+                                    '<input type="hidden" class="employee_id" id="" value="'+ employee.employeeId +'" >' +
+                                    ' <td>'+ cufte(employee.employeeNo) +'</td>' +
+                                    ' <td>'+ cufte(employee.employeeName) +'</td>' +
+                                    ' <td><a href="javascript:void(0)" class="del_product all_down" onclick="delEmployee($(this))" >删除</a></td>' +
+                                    ' </tr>';
+
+                    }else{
+                        $("#product_color_error").html(data.resultMsg);
+                        return false;
+                    }
+                    $("#add_employee").append(html);
+                }
+            });
+        }
+        layer.close(index);
+    }
+
+    /**
+     *  删除员工
+     */
+    function delEmployee($this){
+        $this.parents("tr").remove();
+    }
+
+    /**
+     * 添加回访信息
+     */
+    function addProductionPlan() {
+        var plan_date = $("#plan_date").val();
+        if(plan_date == null || plan_date == ""){
+            layer.msg("工作日期不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var planStay = $("#planStay").val();
+        if(planStay == null || planStay == ""){
+            layer.msg("拉线不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        /*封装员工项*/
+        var employeeItem = "";
+        $("#add_employee").find("tr").each(function(){
+            employeeItem += "_"+$(this).find(".employee_id").val();
+            flag = true;
+        });
+        if(!flag){
+            layer.msg("必须要有至少一个员工!", {icon: 5, time: 2000});
+            return false;
+        }
+        $("#employeeString").val(employeeItem);
+        if (flag) {
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: $('#form-admin-add').serialize(),
+                url: "${path}/admin/productionPlan/addProductionPlan",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        /*layer.msg("添加成功!", {icon: 1, time: 1000},function () {
+                            layer_close();
+                        });*/
+                        layer.msg("添加成功!", {icon: 1, time: 2000});
+                    } else if(data.returnCode == 501){
+                        var names = "";
+                        var employeeList = data.returnMsg.employeeList;
+                        $.each(employeeList,function(index,element){
+                            if(names === ""){
+                                names += this.employeeName;
+                            }else{
+                                names += "," + this.employeeName;
+                            }
+                        });
+                        layer.msg("添加失败!工序重复的员工:"+names, {icon: 5, time: 5000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg("添加失败!", {icon: 5, time: 2000});
+                }
+            });
+        } else {
+            layer.msg(msg, {icon: 5, time: 2000});
+        }
+    }
+
+    /*查询工序计划*/
+    function getProcess(){
+        var planProcessId = $("#planProcessId").val();
+            if (planProcessId != null) {
+                $.ajax({
+                    type: "POST",
+                    url: "${path}/admin/productionPlan/get_process",
+                    async: false,
+                    data: {planProcessId: planProcessId},
+                    success: function (data) {
+                        if (data.returnCode == 200) {
+                            var productionProcess = data.returnMsg.productionProcess;
+                            var strings = productionProcess.processName + ",标准工时为:每" +productionProcess.processUnit+"每人" + (60/productionProcess.processWorkinghours)+"分钟";
+                            $("#ProcessSpan").html(strings);
+                            $("#ProcessSpanOne").show();
+                        }
+                    },
+                    error: function () {
+                        console.log("查询工序失败!");
+                    }
+                });
+            }
+    }
+</script>
+</body>
+</html>

+ 124 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/employee_list.ftl

@@ -0,0 +1,124 @@
+<!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" />
+    <link rel="Bookmark" href="/favicon.ico" >
+    <link rel="Shortcut Icon" href="/favicon.ico" />
+<#include "/base/add_base.ftl">
+    <title>商品列表</title>
+    <style>
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;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;}
+        #suggest, #suggest2 {width:200px}
+        .gray {color:gray}
+        .ac_results {background:#fff;border:1px solid #7f9db9;position: absolute;z-index: 10000;display: none}
+        .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_over, .ac_results li a:hover {background:#c8e3fc}
+        .ac_results li a span {float:right}
+        .ac_result_tip {border-bottom:1px dashed #666;padding:3px}
+        .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: 15px;}
+        .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;}
+        .dalog-ask .ask{color: #000;margin: 10px 0 5px 0;}
+        .dalog-ask .answer{color: #666;margin-bottom: 10px;}
+        .dalog-ask .answer:hover{color: #32a3d8;cursor: pointer;}
+        .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;}
+
+    </style>
+</head>
+<body>
+<div class="page-container">
+    <div class="order-list">
+        <div class="text-c">
+            <form action="${path}/admin/employee/employee_list?pageSize=1000" method="post">
+                <div class="row cl" style="margin-left: 0px;">
+
+                    <div class="formControls col-2 col-sm-2"  style="padding: 0px 10px 0px 0px; width: 110px;">
+                        <input type="text" class="input-text" value="<#if PtsEmployee??>${PtsEmployee.employeeName!''}</#if>" placeholder="员工名称" id="employeeName" name="employeeName">
+                    </div>
+                    <div class="formControls  col-2 col-sm-2"  style="padding: 0px 10px 0px 0px; width: 110px;">
+                        <input type="text" class="input-text" value="<#if PtsEmployee??>${PtsEmployee.employeeNo!''}</#if>" placeholder="员工编号" id="employeeNo" name="employeeNo">
+                    </div>
+                     <div class="formControls col-1 col-sm-1" >
+                         <button type="submit" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="searchEmployee" name="">搜索</button>
+                     </div>
+                </div>
+            </form>
+        </div>
+
+        <div class="mt-20" style="height: 330px;overflow: auto;overflow-x: hidden;margin-bottom: 12px;border: 1px solid #ddd;">
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
+                <thead>
+                <tr class="text-c">
+                    <th width="10"><input type="checkbox" ></th>
+                    <th width="50">员工编号</th>
+                    <th width="50">员工名称</th>
+                    <th width="50">员工电话</th>
+                    <th width="100">员工岗位</th>
+                </tr>
+                </thead>
+                <tbody id="employeeHtml">
+                <#if page.dataList?? &&  (page.dataList?size > 0) >
+                    <#list page.dataList as employee>
+                        <tr class="text-c" <#if employee.isJoinProcess == 1>title="该员工已于本日参加${employee.processName}工序"</#if>>
+                            <td><input type="checkbox" class="employee_id" <#if employee.isJoinProcess == 1>disabled="true"</#if>  name="employee_Id" value="${employee.employeeId!}" ></td>
+                            <td>${employee.employeeNo!}</td>
+                            <td>${employee.employeeName!}</td>
+                            <td>${employee.employeeTel!}</td>
+                            <td>${employee.employeePost!}</td>
+                        </tr>
+                    </#list>
+                <#else>
+                <tr><td colspan="5" class="td-manage text-c" >暂时没有员工,请添加!</td></tr>
+                </#if>
+                </tbody>
+            </table>
+        </div>
+
+        <div class="formControls col-1 col-sm-1" style="margin-left: 45%;">
+            <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="selectEmployee()">确认选择</button>
+        </div>
+    </div>
+
+</div>
+<tfoot>
+<#--<#include "/base/page_util.ftl">-->
+</tfoot>
+
+<script>
+    /**
+     * 选择订单,返回订单内容到父级
+     */
+    function selectEmployee() {
+        var employeeId = "";
+        $(".employee_id").each(function(){
+            if($(this).is(':checked')){
+                employeeId += $(this).val() + "_";
+            }
+        })
+        parent.setSelectEmployee(employeeId);
+        parent.layer.close(parent.layer.getFrameIndex(window.name));
+    }
+</script>
+
+</body>
+</html>

+ 267 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/perfect_productionPlan.ftl

@@ -0,0 +1,267 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>完善工作计划 - H-ui.filter v2.4</title>
+    <style>
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;font-size: 16px;padding-left: 10px;color: #50a2ea;display: inline-block;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 50%;height: 6px;width: 6px;border-radius: 6px;margin-top: -3px; background-color: #32a3d8;}
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 14px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 77%;border:1px solid rgba(0,0,0,.1);margin-left: 12.5%;}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 158px; background-color: #50a2ea;color: #fff;border: 1px solid #50a2ea;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select {
+            border: 1px solid rgba(0,0,0,.1);
+            padding: 6px 50px 6px 15px;
+            height: 34px;
+            -webkit-appearance: none;
+            appearance: none;
+            background: url(/common/images/pts/select-11.png) right center no-repeat;
+            background-size: auto 100%;
+        }
+        .check-box, .radio-box{padding-left: 0;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .huanhang{ float:left}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="row cl">
+            <label class="form-label col-3">
+                <div class="tit-2">完善工作计划</div>
+            </label>
+            <div class="formControls col-9">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工序选择:</label>
+            <div class="formControls col-xs-9 col-sm-9" style="margin: 10px 0px;padding-left: 0;">
+                <span style="color: #6d6d72;">${productionPlan.processName!''},标准工时为:每台每人需要${productionPlan.processWorkinghours/60}分钟</span>
+            </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工作日期:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input type="text" style="width: 80%;" class="input-text my-input-date Wdate" value="${productionPlan.planDate?string('yyyy-MM-dd')}" placeholder="工作日期" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" id="plan_date" name="plan_date" readonly="readonly"/>
+            </div>
+        </div>
+
+    </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>拉线:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input class="my-input" type="text" value="${productionPlan.planStay!''}"  name="planStay" id="planStay" placeholder="请输入拉线名称" style="width: 78%;"/>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>员工选择</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input type="button" style="color: #32a3d8;border: 1px solid #32a3d8;" class="btn add-order-button" onclick="add_employee()" value="选择员工" >
+                <table class="table table-border table-bordered table-bg table-hover table-sort" style="margin-top: 10px;width: 80%;" id="all_add_employee">
+                    <thead>
+                    <tr class="text-c" id="table1">
+                        <th style="text-align: center;" width="40" >员工编号</th>
+                        <th style="text-align: center;" width="25" >员工姓名</th>
+                        <th style="text-align: center;" width="10">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="add_employee">
+
+                        <#if listProductionEmployees?? &&  (listProductionEmployees?size > 0) >
+                            <#list listProductionEmployees as employee>
+                        <tr class="text-c">
+                            <input type="hidden" class="employee_id" id="" value="${employee.peEmployeeId!''}" >
+                            <td>${employee.peEmployeeNo!''}</td>
+                            <td>${employee.peEmployeeName!''}</td>
+                            <td><a href="javascript:void(0)" class="del_product all_down" onclick="delEmployee($(this))" >删除</a></td>
+                        </tr>
+                            </#list>
+                        <#else>
+                        <tr><td colspan="5" class="td-manage text-c" >暂时没有员工,请添加!</td></tr>
+                        </#if>
+
+                    </tbody>
+                </table>
+                <input type="hidden" id="employeeString" name="employeeString" value="" >
+            </div>
+            <br>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工作时长:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input class="my-input" type="text" value=""  name="planWorkHours" id="planWorkHours" placeholder="请输入工作时长,单位为小时,精确到两位小数" style="width: 78%;"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工作成果:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input class="my-input" type="text" value=""  name="planResults" id="planResults" placeholder="请输入在此时长内完成的数量" style="width: 78%;"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <button type="button" class="my-btn-submit" onclick="perfectProductionPlan();" style="margin-top: 20px;">确认</button>
+                <input type="hidden" value="${productionPlan.planId!''}" id="planId" name="planId">
+            </div>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+    /**
+     * 打开员工列表
+     */
+    function add_employee() {
+        layer_show("员工列表","${path}/admin/employee/employee_list","800","500");
+    }
+    /**
+     * 选择员工回调
+     * @param colorIds
+     */
+    function setSelectEmployee(employeeIds){
+        var index = layer.load(1, {
+            shade: [0.5,'#fff'] //0.1透明度的白色背景
+        });
+
+        $("#all_add_employee").show();
+
+        var employeeIdArray = employeeIds.split("_");
+        for(var j=0;j<employeeIdArray.length;j++){
+            var employeeId = employeeIdArray[j];
+            if(employeeId == ""){
+                break;
+            }
+
+            var flag = true;
+            $("#add_employee").find("tr").each(function (){
+                var emp_Id = $(this).find(".employee_id").eq(0).val();
+                if(emp_Id == employeeId){
+                    flag  = false;
+                }
+            });
+            if(!flag){
+                continue;
+            }
+
+            $.ajax({
+                type: "POST",
+                data: {
+                    employeeId : employeeId
+                },
+                url: "${path}/admin/employee/get_employee",
+                async:false,
+                success: function(data){
+                    var html = "";
+                    if (data.returnCode == 200) {
+                        var employee = data.returnMsg.ptsEmployee;
+                            html += '<tr class="text-c">' +
+                                    '<input type="hidden" class="employee_id" id="" value="'+ employee.employeeId +'" >' +
+                                    ' <td>'+ cufte(employee.employeeNo) +'</td>' +
+                                    ' <td>'+ cufte(employee.employeeName) +'</td>' +
+                                    ' <td><a href="javascript:void(0)" class="del_product all_down" onclick="delEmployee($(this))" >删除</a></td>' +
+                                    ' </tr>';
+
+                    }else{
+                        $("#product_color_error").html(data.resultMsg);
+                        return false;
+                    }
+                    $("#add_employee").append(html);
+                }
+            });
+        }
+        layer.close(index);
+    }
+
+    /**
+     *  删除员工
+     */
+    function delEmployee($this){
+        $this.parents("tr").remove();
+    }
+
+    /**
+     * 完善信息
+     */
+    function perfectProductionPlan() {
+        var plan_date = $("#plan_date").val();
+        if(plan_date == null || plan_date == ""){
+            layer.msg("工作日期不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var planStay = $("#planStay").val();
+        if(planStay == null || planStay == ""){
+            layer.msg("拉线不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var planWorkHours = $("#planWorkHours").val();
+        if(planWorkHours == null || planWorkHours == ""){
+            layer.msg("工作时长不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var planResults = $("#planResults").val();
+        if(planResults == null || planResults == ""){
+            layer.msg("工作成果不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        /*封装员工项*/
+        var employeeItem = "";
+        $("#add_employee").find("tr").each(function(){
+            employeeItem += "_"+$(this).find(".employee_id").val();
+            flag = true;
+        });
+        if(!flag){
+            layer.msg("必须要有至少一个员工!", {icon: 5, time: 2000});
+            return false;
+        }
+        $("#employeeString").val(employeeItem);
+        if (flag) {
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: $('#form-admin-add').serialize(),
+                url: "${path}/admin/productionPlan/perfect_productionPlan",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        l/*ayer.msg("完善成功!", {icon: 1, time: 1000},function () {
+                            layer_close();
+                        });*/
+                        layer.msg("完善成功!", {icon: 1, time: 2000});
+                    } else {
+                        layer.msg("完善失败!", {icon: 5, time: 2000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg("完善失败!", {icon: 5, time: 2000});
+                }
+            });
+        } else {
+            layer.msg(msg, {icon: 5, time: 2000});
+        }
+    }
+
+</script>
+</body>
+</html>

+ 150 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/productionPlan_List.ftl

@@ -0,0 +1,150 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta charset="UTF-8">
+		<title></title>
+        <#include "/base/list_base.ftl">
+		<style>
+			*{padding: 0;margin: 0;}
+			.my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
+			/*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
+            .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-11.png) right center no-repeat;background-size:auto 100%;}
+            .my-btn-search{border: 1px solid #50a2ea;padding: 1px 25px;height: 32px;background-color: #fff;color: #50a2ea;}
+            .barcodeImg{margin:10px 0px}
+            .table-bg thead th{background-color: #e2f6ff;}
+            input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+            input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+		</style>
+	</head>
+	<body>
+    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+        <span class="c-gray en">/</span> PST管理
+        <span class="c-gray en">/</span> 工作计划列表
+        <a class="btn radius r" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+    </nav>
+		<div class="text-c" style="margin-top: 20px;">
+			<form action="${path}/admin/productionPlan/select_productionPlan_list" method="post">
+                <button type="button" class="my-btn-search" onclick="add_employee('${path}/admin/productionPlan/to_addProductionPlan');" style="cursor:pointer; margin-right: 50px;">添加工作计划</button>
+                <input class="my-input" style="width: 12%;" type="text" value="<#if planDate??>${planDate?string("yyyy-MM-dd")!''}</#if>" name="plan_Date" id="plan_Date" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="工作计划日期" readonly="readonly"/>
+                <select class="my-select" id="planProcessId" name="planProcessId"  style="width: 12%;">
+                    <option value="">请选择工序</option>
+                    <#if (listProductionProcess?size > 0)>
+                        <#list listProductionProcess as info>
+                                <option <#if planProcessId??><#if planProcessId == info.processId>selected</#if></#if> value="${info.processId!""}">${info.processName!""}</option>
+                        </#list>
+                    </#if>
+                </select>
+						<button type="submit" style="cursor:pointer; " class="my-btn-search">搜索</button>
+			</form>
+		</div>
+		<div class="mt-20" style="margin: 20px;">
+			<table class="table table-border table-bordered table-bg table-hover table-sort">
+				<thead>
+				<tr class="text-c">
+                    <th width="100">日期</th>
+					<th width="100">拉线</th>
+					<th width="100">工序</th>
+					<th width="100">员工数量</th>
+					<th width="100">工作时长</th>
+					<th width="100">工作成果</th>
+					<th width="100">更新时间</th>
+					<th width="100">操作</th>
+				</tr>
+				</thead>
+				<tbody id="listid">
+                <#if page.dataList?? &&  (page.dataList?size > 0) >
+					<#list page.dataList as list>
+						<tr>
+                            <td class="text-c" width="140">${(list.planDate?string("yyyy-MM-dd"))!''}</td>
+							<td class="text-c" width="100">${list.planStay!''}</td>
+							<td class="text-c" width="100">${list.processName!''}</td>
+							<td class="text-c" width="100">${list.employeesNum!''}</td>
+							<td class="text-c" width="100">${list.planWorkHours!''}</td>
+							<td class="text-c" width="100">${list.planResults!''}</td>
+							<td class="text-c" width="100">${(list.planUpdateTime?string("yyyy-MM-dd HH:mm:ss"))!''!''}</td>
+							<!-- 遍历操作 -->
+							<td class="td-manage text-c">
+                                <a onclick="add_employee('${path}/admin/productionPlan/to_update_productionPlan?planId='+${list.planId!''});" title="编辑" href="javascript:;"  class="ml-5" style="text-decoration:none">编辑</a>
+                                <a onclick="delProductionPlan(${list.planId!''});" title="删除生产计划" href="javascript:;"  class="ml-5" style="text-decoration:none">删除</a>
+                                <#if !list.planWorkHours??>
+                                    <a onclick="add_employee('${path}/admin/productionPlan/to_perfect_productionPlan?planId='+${list.planId!''});" title="完善工作计划" href="javascript:;"  class="ml-5" style="text-decoration:none">完善工作计划</a>
+                                </#if>
+                                </td>
+						</tr>
+					</#list>
+                <#else>
+                <tr><td id="noMachineTr" colspan="11" class="td-manage text-c" >暂时没有工作计划,请添加!</td></tr>
+                </#if>
+				</tbody>
+			</table>
+			<div  style="display:none;" >
+				<div id="printlist">
+                </div>
+			</div>
+		</div>
+		<#include "/base/page_util.ftl">
+
+        <#--jquery.PrintArea 2.4-->
+        <script type="text/javascript" src="${path}/common/lib/jquery.PrintArea/jquery.PrintArea.js"></script>
+        <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery-barcode.js"></script>
+
+		<script type="text/javascript">
+
+
+
+            /*function add_employee(title,url,w,h){
+                layer_show(title,url,w,h);
+            }*/
+            function add_employee(url) {
+                window.location.href= url;
+            }
+
+            /*删除计划*/
+            function delProductionPlan(planId){
+                layer.confirm('是否确认删除,删除后无法恢复?',function(index) {
+                    if (planId != null) {
+                        $.ajax({
+                            type: "POST",
+                            url: "${path}/admin/productionPlan/delProductionPlan",
+                            async: false,
+                            data: {planId: planId},
+                            success: function (data) {
+                                if (data.returnCode == 200) {
+                                    layer.msg("删除成功!", {icon: 1, time: 2000});
+                                    location.reload();
+                                } else {
+                                    layer.msg("删除失败!", {icon: 5, time: 2000});
+                                }
+                            },
+                            error: function () {
+                                console.log("删除失败!");
+                            }
+                        });
+                    }
+                })
+            }
+            /*编辑计划*/
+            function perfectProductionPlan(planId){
+                    if (planId != null) {
+                        $.ajax({
+                            type: "POST",
+                            url: "${path}/admin/productionPlan/to_product_productionPlan",
+                            async: false,
+                            data: {planId: planId},
+                            success: function (data) {
+                                if (data.returnCode == 200) {
+                                    layer.msg("删除成功!", {icon: 1, time: 2000});
+                                    location.reload();
+                                } else {
+                                    layer.msg("删除失败!", {icon: 5, time: 2000});
+                                }
+                            },
+                            error: function () {
+                                console.log("删除失败!");
+                            }
+                        });
+                    }
+            }
+        </script>
+	</body>
+</html>

+ 139 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/productionPlan_statistical.ftl

@@ -0,0 +1,139 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta charset="UTF-8">
+		<title></title>
+        <#include "/base/list_base.ftl">
+		<style>
+			*{padding: 0;margin: 0;}
+			.my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 30px;margin-right: 10px;}
+			/*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
+            .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-11.png) right center no-repeat;background-size:auto 100%;}
+            .my-btn-search{border: 1px solid #50a2ea;padding: 1px 25px;height: 32px;background-color: #fff;color: #50a2ea;}
+            .barcodeImg{margin:10px 0px}
+            .table-bg thead th{background-color: #e2f6ff;}
+            input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+            input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+		</style>
+	</head>
+	<body>
+    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+        <span class="c-gray en">/</span> PST管理
+        <span class="c-gray en">/</span> 工作计划统计列表
+        <a class="btn radius r" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+    </nav>
+		<div class="text-c" style="margin-top: 20px;">
+			<form action="${path}/admin/productionPlan/select_productionPlan_statistical" method="post">
+                <input class="my-input" style="width: 12%;" type="text" value="<#if planDate??>${planDate?string("yyyy-MM-dd")!''}</#if>" name="plan_Date" id="plan_Date" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="工作计划日期" readonly="readonly"/>
+                <select class="my-select" id="planProcessId" name="planProcessId"  style="width: 12%;">
+                    <option value="">请选择工序</option>
+                    <#if (listProductionProcess?size > 0)>
+                        <#list listProductionProcess as info>
+                                <option <#if planProcessId??><#if planProcessId == info.processId>selected</#if></#if> value="${info.processId!""}">${info.processName!""}</option>
+                        </#list>
+                    </#if>
+                </select>
+						<button type="submit" style="cursor:pointer; " class="my-btn-search">搜索</button>
+			</form>
+		</div>
+		<div class="mt-20" style="margin: 20px;">
+			<table class="table table-border table-bordered table-bg table-hover table-sort">
+				<thead>
+				<tr class="text-c">
+                    <th width="100">日期</th>
+					<th width="100">工序</th>
+					<th width="100">总人数</th>
+					<th width="100">总工时</th>
+					<th width="100">完成总工作量</th>
+					<th width="150">实际效率(实际完成数量/时间/人数)</th>
+					<th width="100">标准效率</th>
+					<th width="100">实际效率比</th>
+				</tr>
+				</thead>
+				<tbody id="listid">
+                <#if page.dataList?? &&  (page.dataList?size > 0) >
+					<#list page.dataList as list>
+						<tr>
+                            <td class="text-c" width="140">${(list.planDate?string("yyyy-MM-dd"))!''}</td>
+							<td class="text-c" width="100">${list.processName!''}</td>
+							<td class="text-c" width="100">${list.employeesNum!''}</td>
+							<td class="text-c" width="100">${list.planWorkHours!''}</td>
+							<td class="text-c" width="100">${list.planResults!''}</td>
+							<td class="text-c" width="100"><#if list.planResults??><#if list.planWorkHours??><#if list.employeesNum??>${list.planResults/list.planWorkHours/list.employeesNum}</#if></#if></#if></td>
+							<td class="text-c" width="100">${list.processWorkinghours!''}</td>
+							<td class="text-c" width="100"><#if list.planResults??><#if list.planWorkHours??><#if list.employeesNum??>${list.processWorkinghours/(list.planResults/list.planWorkHours/list.employeesNum) * 100}%</#if></#if></#if></td>
+						</tr>
+					</#list>
+                <#else>
+                <tr><td id="noMachineTr" colspan="11" class="td-manage text-c" >暂时没有工作计划,请添加!</td></tr>
+                </#if>
+				</tbody>
+			</table>
+			<div  style="display:none;" >
+				<div id="printlist">
+                </div>
+			</div>
+		</div>
+		<#include "/base/page_util.ftl">
+
+        <#--jquery.PrintArea 2.4-->
+        <script type="text/javascript" src="${path}/common/lib/jquery.PrintArea/jquery.PrintArea.js"></script>
+        <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery-barcode.js"></script>
+
+		<script type="text/javascript">
+
+
+
+            function add_employee(title,url,w,h){
+                layer_show(title,url,w,h);
+            }
+
+            /*删除计划*/
+            function delProductionPlan(planId){
+                layer.confirm('是否确认删除,删除后无法恢复?',function(index) {
+                    if (planId != null) {
+                        $.ajax({
+                            type: "POST",
+                            url: "${path}/admin/productionPlan/delProductionPlan",
+                            async: false,
+                            data: {planId: planId},
+                            success: function (data) {
+                                if (data.returnCode == 200) {
+                                    layer.msg("删除成功!", {icon: 1, time: 2000});
+                                    location.reload();
+                                } else {
+                                    layer.msg("删除失败!", {icon: 5, time: 2000});
+                                }
+                            },
+                            error: function () {
+                                console.log("删除失败!");
+                            }
+                        });
+                    }
+                })
+            }
+            /*编辑计划*/
+            function perfectProductionPlan(planId){
+                    if (planId != null) {
+                        $.ajax({
+                            type: "POST",
+                            url: "${path}/admin/productionPlan/to_product_productionPlan",
+                            async: false,
+                            data: {planId: planId},
+                            success: function (data) {
+                                if (data.returnCode == 200) {
+                                    layer.msg("删除成功!", {icon: 1, time: 2000});
+                                    location.reload();
+                                } else {
+                                    layer.msg("删除失败!", {icon: 5, time: 2000});
+                                }
+                            },
+                            error: function () {
+                                console.log("删除失败!");
+                            }
+                        });
+                    }
+            }
+        </script>
+	</body>
+</html>

+ 276 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/productionPlan/update_productionPlan.ftl

@@ -0,0 +1,276 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>添加生产计划 - H-ui.filter v2.4</title>
+    <style>
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;font-size: 16px;padding-left: 10px;color: #50a2ea;display: inline-block;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 50%;height: 6px;width: 6px;border-radius: 6px;margin-top: -3px; background-color: #32a3d8;}
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 14px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 77%;border:1px solid rgba(0,0,0,.1);margin-left: 12.5%;}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 158px; background-color: #50a2ea;color: #fff;border: 1px solid #50a2ea;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select {
+            border: 1px solid rgba(0,0,0,.1);
+            padding: 6px 50px 6px 15px;
+            height: 34px;
+            -webkit-appearance: none;
+            appearance: none;
+            background: url(/common/images/pts/select-11.png) right center no-repeat;
+            background-size: auto 100%;
+        }
+        .check-box, .radio-box{padding-left: 0;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .huanhang{ float:left}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="row cl">
+            <label class="form-label col-3">
+                <div class="tit-2">编辑工作计划</div>
+            </label>
+            <div class="formControls col-9">
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工作日期:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input type="text" style="width: 80%;" class="input-text my-input-date Wdate" value="${productionPlan.planDate?string('yyyy-MM-dd')}" placeholder="工作日期" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" id="plan_date" name="plan_date" readonly="readonly"/>
+            </div>
+        </div>
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工序选择:</label>
+                <div class="formControls col-xs-9 col-sm-9" style="margin: 10px 0px;padding-left: 0;">
+                    <select class="my-select" id="planProcessId" name="planProcessId" class="chosen" style="width: 80%;">
+                        <option value="">请选择工序</option>
+                        <#if (listProductionProcess?size > 0)>
+                            <#list listProductionProcess as info>
+                                    <option  <#if productionPlan.planProcessId == info.processId>selected</#if> value="${info.processId!""}">${info.processName!""}</option>
+                            </#list>
+                        </#if>
+                    </select>
+                    <span style="display: none;">已选择工序:<span></span></span>
+                </div>
+            </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>拉线:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input class="my-input" type="text" value="${productionPlan.planStay!''}"  name="planStay" id="planStay" placeholder="请输入拉线" style="width: 78%;"/>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>员工选择</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input type="button" style="color: #32a3d8;border: 1px solid #32a3d8;" class="btn add-order-button" onclick="add_employee()" value="选择员工" >
+                <table class="table table-border table-bordered table-bg table-hover table-sort" style="margin-top: 10px;width: 80%;" id="all_add_employee">
+                    <thead>
+                    <tr class="text-c" id="table1">
+                        <th style="text-align: center;" width="40" >员工编号</th>
+                        <th style="text-align: center;" width="25" >员工姓名</th>
+                        <th style="text-align: center;" width="10">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="add_employee">
+
+                        <#if listProductionEmployees?? &&  (listProductionEmployees?size > 0) >
+                            <#list listProductionEmployees as employee>
+                        <tr class="text-c">
+                            <input type="hidden" class="employee_id" id="" value="${employee.peEmployeeId!''}" >
+                            <td>${employee.peEmployeeNo!''}</td>
+                            <td>${employee.peEmployeeName!''}</td>
+                            <td><a href="javascript:void(0)" class="del_product all_down" onclick="delEmployee($(this))" >删除</a></td>
+                        </tr>
+                            </#list>
+                        <#else>
+                        <tr><td colspan="5" class="td-manage text-c" >暂时没有员工,请添加!</td></tr>
+                        </#if>
+
+                    </tbody>
+                </table>
+                <input type="hidden" id="employeeString" name="employeeString" value="" >
+            </div>
+            <br>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工作时长:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input class="my-input" type="text" value="${productionPlan.planWorkHours!''}"  name="planWorkHours" id="planWorkHours" placeholder="请输入工作时长" style="width: 78%;"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>工作成果:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input class="my-input" type="text" value="${productionPlan.planResults!''}"  name="planResults" id="planResults" placeholder="请输入工作成果" style="width: 78%;"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <button type="button" class="my-btn-submit" onclick="perfectProductionPlan();" style="margin-top: 20px;">确认修改</button>
+                <input type="hidden" value="${productionPlan.planId!''}" id="planId" name="planId">
+            </div>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+    /**
+     * 打开员工列表
+     */
+    function add_employee() {
+        layer_show("员工列表","${path}/admin/employee/employee_list?pageSize=1000","800","500");
+    }
+    /**
+     * 选择员工回调
+     * @param colorIds
+     */
+    function setSelectEmployee(employeeIds){
+        var index = layer.load(1, {
+            shade: [0.5,'#fff'] //0.1透明度的白色背景
+        });
+
+        $("#all_add_employee").show();
+
+        var employeeIdArray = employeeIds.split("_");
+        for(var j=0;j<employeeIdArray.length;j++){
+            var employeeId = employeeIdArray[j];
+            if(employeeId == ""){
+                break;
+            }
+
+            var flag = true;
+            $("#add_employee").find("tr").each(function (){
+                var emp_Id = $(this).find(".employee_id").eq(0).val();
+                if(emp_Id == employeeId){
+                    flag  = false;
+                }
+            });
+            if(!flag){
+                continue;
+            }
+
+            $.ajax({
+                type: "POST",
+                data: {
+                    employeeId : employeeId
+                },
+                url: "${path}/admin/employee/get_employee",
+                async:false,
+                success: function(data){
+                    var html = "";
+                    if (data.returnCode == 200) {
+                        var employee = data.returnMsg.ptsEmployee;
+                            html += '<tr class="text-c">' +
+                                    '<input type="hidden" class="employee_id" id="" value="'+ employee.employeeId +'" >' +
+                                    ' <td>'+ cufte(employee.employeeNo) +'</td>' +
+                                    ' <td>'+ cufte(employee.employeeName) +'</td>' +
+                                    ' <td><a href="javascript:void(0)" class="del_product all_down" onclick="delEmployee($(this))" >删除</a></td>' +
+                                    ' </tr>';
+
+                    }else{
+                        $("#product_color_error").html(data.resultMsg);
+                        return false;
+                    }
+                    $("#add_employee").append(html);
+                }
+            });
+        }
+        layer.close(index);
+    }
+
+    /**
+     *  删除员工
+     */
+    function delEmployee($this){
+        $this.parents("tr").remove();
+    }
+
+    /**
+     * 完善信息
+     */
+    function perfectProductionPlan() {
+        var plan_date = $("#plan_date").val();
+        if(plan_date == null || plan_date == ""){
+            layer.msg("工作日期不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var planStay = $("#planStay").val();
+        if(planStay == null || planStay == ""){
+            layer.msg("拉线不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var planWorkHours = $("#planWorkHours").val();
+        if(planWorkHours == null || planWorkHours == ""){
+            layer.msg("工作时长不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        var planResults = $("#planResults").val();
+        if(planResults == null || planResults == ""){
+            layer.msg("工作成果不能为空!", {icon: 5, time: 2000});
+            return;
+        }
+        /*封装员工项*/
+        var employeeItem = "";
+        $("#add_employee").find("tr").each(function(){
+            employeeItem += "_"+$(this).find(".employee_id").val();
+            flag = true;
+        });
+        if(!flag){
+            layer.msg("必须要有至少一个员工!", {icon: 5, time: 2000});
+            return false;
+        }
+        $("#employeeString").val(employeeItem);
+        if (flag) {
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: $('#form-admin-add').serialize(),
+                url: "${path}/admin/productionPlan/perfect_productionPlan",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg("编辑成功!", {icon: 1, time: 1000},function () {
+                            parent.location.reload();
+                            layer_close();
+
+                        });
+
+                    } else {
+                        layer.msg("编辑失败!", {icon: 5, time: 2000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg("编辑失败!", {icon: 5, time: 2000});
+                }
+            });
+        } else {
+            layer.msg(msg, {icon: 5, time: 2000});
+        }
+    }
+
+</script>
+</body>
+</html>

+ 10 - 31
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -30,11 +30,11 @@ $(document).on('click', '.dalog-ask .answer', function() {
 
     var questionId = $(this).find(".quesId").val();
     var title = $(this).find("span").html();
-    var desc = $(this).find("#questionProfile").html();
+    /*var desc = $(this).find("#questionProfile").html();*/
 
     $("#questionId").val(questionId);
     $("#describeTitle").val(title);
-    UE.getEditor('describeContentText').setContent(desc);
+    /*UE.getEditor('describeContentText').setContent(desc);*/
 
     //$("#answer-textarea").text();
     $(".dalog-ask").hide(); //隐藏qa
@@ -140,13 +140,13 @@ var tool = [
 ];
 
 /*问题描述*/
-var describeContentText = UE.getEditor('describeContentText', {
+/*var describeContentText = UE.getEditor('describeContentText', {
     toolbars: [tool],
     autoHeightEnabled: true,
     autoFloatEnabled: true,
-    elementPathEnabled : false,/*去掉元素路径*/
+    elementPathEnabled : false,/!*去掉元素路径*!/
     zIndex : 5
-});
+});*/
 /*处理描述*/
 var describeHandleDescText = UE.getEditor('describeHandleDescText', {
     toolbars: [tool],
@@ -744,7 +744,7 @@ function sendPhone(type,node){
         phone = $("#p-phone").val();
         questionId = $("#questionId").val();
         describeTitle = $("#describeTitle").val();
-        desc = UE.getEditor('describeContentText').getContent();
+        /*desc = UE.getEditor('describeContentText').getContent();*/
         smallClassId = $("#smallClassId").val();
         if(smallClassId == null || smallClassId == "" ){
             layer.close(index);
@@ -761,11 +761,11 @@ function sendPhone(type,node){
             layer.msg("问题标题长度不能高于50个字符!", {icon: 5, time: 3000});
             return false;
         }
-        if(desc == null || desc == ""){
+        /*if(desc == null || desc == ""){
             layer.close(index);
             layer.msg("请填写问题回复!", {icon: 5, time: 3000});
             return false;
-        }
+        }*/
     }else if(type == "m"){
         phone = $("#m-phone").val();
         questionId = complaint_questionId;
@@ -790,8 +790,7 @@ function sendPhone(type,node){
             phone : phone,
             questionId : questionId,
             smallClassId : smallClassId,
-            questionName : describeTitle,
-            questionProfile : desc       //回复内容
+            questionName : describeTitle
         },
         url: url_path + "/admin/customer/send_phone_sms",
         async: true,
@@ -834,7 +833,6 @@ function saveQuestion(type){
 
     questionId = $("#questionId").val();
     describeTitle = $("#describeTitle").val();
-    desc = UE.getEditor('describeContentText').getContent();
     smallClassId = $("#smallClassId").val();
     if((smallClassId == null || smallClassId == "") && (questionId == null || questionId == "") ){
         layer.close(index);
@@ -846,19 +844,13 @@ function saveQuestion(type){
         layer.msg("请填写问题标题!", {icon: 5, time: 3000});
         return false;
     }
-    if(desc == null || desc == ""){
-        layer.close(index);
-        layer.msg("请填写问题回复!", {icon: 5, time: 3000});
-        return false;
-    }
 
     $.ajax({
         type: "POST",
         data: {
             questionId : questionId,
             smallClassId : smallClassId,
-            questionName : describeTitle,
-            questionProfile : desc       //回复内容
+            questionName : describeTitle
         },
         url: url_path + "/admin/complaintQuestion/save_question",
         async: false,
@@ -1277,18 +1269,6 @@ function addCustomerReady(){
         vailErrorMsg($("#questionId"),"未保存QA!");
         return false;
     }
-    var describeContentText = UE.getEditor('describeContentText').getContent();
-    if(describeContentText == null || describeContentText == ""){
-        //layer.msg("未填写问题描述", {icon: 5, time: 3000});
-        vailErrorMsg($("#describeTitle"),"未填写问题描述");
-        return false;
-    }
-    if(describeContentText.length > 3000){
-        vailErrorMsg($("#describeContent"),"问题回复最大支持3000个字符");
-        return false;
-    }
-    $("#describeContent").val(describeContentText);
-    /*----问题描述--end-----*/
 
     /*----处理描述- start --*/
     var describeHandleDescText = UE.getEditor('describeHandleDescText').getContent();
@@ -1442,7 +1422,6 @@ function selectOnCustomer() {
                            ' <td style="text-align: center;">'+onCustomer.customerTel +'</td>' +
                            ' <td style="text-align: center;">'+customerIsSolve +'</td>' +
                            ' <td style="text-align: center;">'+onCustomer.describeTitle +'</td>' +
-                           ' <td style="text-align: center;"><span class="txt2" style="display: inline-block;padding: 2px 4px;font-size: 11.844px;" title="'+onCustomer.describeContent +'" >'+onCustomer.describeContent +'</span></td>' +
                            ' <td style="text-align: center;"><a onclick="admin_update_customer('+onCustomer.customerId +')">继续跟进</a>' +
                            '<br><a onclick="markedSecondary('+onCustomer.customerId +','+onCustomer.customerInitialId +',this)">标记为二次售后</a>' +
                            '<a style="display: none;" onclick="cancelMarkedSecondary('+onCustomer.customerId+','+onCustomer.customerInitialId +',this)">取消二次售后标记</a></td>' +

+ 18 - 7
watero-rst-web/src/main/webapp/common/js/salesOrder/salesOrder.js

@@ -327,13 +327,24 @@ function setSelectCustomer(customerId){
                         if(detet.detectState === 37 ){
                             detectStateName = "原机退回,待发货";
                         }
-                        html += '<tr class="text-c">' +
-                            ' <td><input type="radio" name="detectId" value="'+detet.detectId+'"><label></td>' +
-                            ' <td>'+ cufte(detet.detectNumber) +'</td>' +
-                            ' <td>'+ detectStateName +'</td>' +
-                            ' <td>'+ cufte(detet.productName) +'</td>' +
-                            ' <td>'+ cufte(detet.colorName) +'</td>' +
-                            ' </tr>';
+                        if(i === 0){
+                            html += '<tr class="text-c">' +
+                                ' <td><input type="radio" name="detectId" value="'+detet.detectId+'" checked><label></td>' +
+                                ' <td>'+ cufte(detet.detectNumber) +'</td>' +
+                                ' <td>'+ detectStateName +'</td>' +
+                                ' <td>'+ cufte(detet.productName) +'</td>' +
+                                ' <td>'+ cufte(detet.colorName) +'</td>' +
+                                ' </tr>';
+                        }else{
+                            html += '<tr class="text-c">' +
+                                ' <td><input type="radio" name="detectId" value="'+detet.detectId+'"><label></td>' +
+                                ' <td>'+ cufte(detet.detectNumber) +'</td>' +
+                                ' <td>'+ detectStateName +'</td>' +
+                                ' <td>'+ cufte(detet.productName) +'</td>' +
+                                ' <td>'+ cufte(detet.colorName) +'</td>' +
+                                ' </tr>';
+                        }
+
                     }
                     $("#detect_product").html(html);
                 }