liujiankang 6 år sedan
förälder
incheckning
f51e2f6731
47 ändrade filer med 2636 tillägg och 1618 borttagningar
  1. 18 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CmRelation.java
  2. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerInfo.java
  3. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ProcMethod.java
  4. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/RelationOrder.java
  5. 38 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectImg.java
  6. 249 12
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectInfo.java
  7. 0 246
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectItem.java
  8. 37 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintSignclosedImg.java
  9. 66 31
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintSignclosedInfo.java
  10. 18 1
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/SignclosedProductInfo.java
  11. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/Product.java
  12. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/ProductColor.java
  13. 30 16
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintDetectInfoService.java
  14. 34 1
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintSignclosedInfoService.java
  15. 6 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintSignclosedProductInfoService.java
  16. 64 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java
  17. 6 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/CustomerInfoMapper.java
  18. 3 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/cmRelationMapper.xml
  19. 17 4
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml
  20. 3 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/procMethodMapper.xml
  21. 4 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml
  22. 138 22
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintDetectInfoServiceImpl.java
  23. 282 72
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintSignclosedInfoServiceImpl.java
  24. 5 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintSignclosedProductInfoServiceImpl.java
  25. 13 24
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/ComplaintDetectInfoMapper.java
  26. 21 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/ComplaintSignclosedInfoMapper.java
  27. 7 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/ComplaintSignclosedProductInfoMapper.java
  28. 145 196
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/complaintDetectInfoMapper.xml
  29. 70 42
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/complaintSignclosedInfoMapper.xml
  30. 8 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/complaintSignclosedProductInfoMapper.xml
  31. 15 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
  32. 73 108
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java
  33. 40 108
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java
  34. 2 1
      watero-rst-web/src/main/java/com/iamberry/rst/utils/StitchAttrUtil.java
  35. 2 1
      watero-rst-web/src/main/resources/watero-rst-orm.xml
  36. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl
  37. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_list.ftl
  38. 470 100
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_relation.ftl
  39. 30 9
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/add_detect.ftl
  40. 163 67
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl
  41. 115 53
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/update_complete.ftl
  42. 100 226
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/add_signclosed.ftl
  43. 238 197
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/complete_signclosed.ftl
  44. 9 44
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/customer_signclosed_list.ftl
  45. 45 26
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/signclosed_list.ftl
  46. BIN
      watero-rst-web/src/main/webapp/common/images/Conform.jpg
  47. BIN
      watero-rst-web/src/main/webapp/common/images/noConform.jpg

+ 18 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CmRelation.java

@@ -102,6 +102,8 @@ public class CmRelation implements  Serializable{
 
     private String procMethodName; //处理方式名称
     private String procTypeName; //处理方式类型名称
+    private Integer procTypeId; //处理方式类型id
+    private Integer companyId; //所属公司id
 
 
     public Integer getRelationId(){
@@ -423,4 +425,20 @@ public class CmRelation implements  Serializable{
     public void setProcTypeName(String procTypeName) {
         this.procTypeName = procTypeName;
     }
+
+    public Integer getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Integer companyId) {
+        this.companyId = companyId;
+    }
+
+    public Integer getProcTypeId() {
+        return procTypeId;
+    }
+
+    public void setProcTypeId(Integer procTypeId) {
+        this.procTypeId = procTypeId;
+    }
 }

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

@@ -172,6 +172,8 @@ public class CustomerInfo  implements Serializable {
     private List<SendbackInfo> sendbackInfoList;    //寄回信息集合
     private List<SalesOrder> salesOrderList;    //寄出产品订单集合
 
+    private Integer relationId;//处理主键
+
     public void setComplaintDetectList(List<ComplaintDetectInfo> complaintDetectList) {
         this.complaintDetectList = complaintDetectList;
     }
@@ -881,4 +883,12 @@ public class CustomerInfo  implements Serializable {
     public void setCustomerDistrictName(String customerDistrictName) {
         this.customerDistrictName = customerDistrictName;
     }
+
+    public Integer getRelationId() {
+        return relationId;
+    }
+
+    public void setRelationId(Integer relationId) {
+        this.relationId = relationId;
+    }
 }

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

@@ -27,6 +27,8 @@ public class ProcMethod  implements  Serializable{
     private Date procMethodCreateTime;
     //处理方式修改时间'
     private Date procMethodUpdateTime;
+    //是否收费
+    private Integer procMethodIsCharge;//1.收费2不收费 0待定
 
     private String procTypeName;
 
@@ -109,4 +111,12 @@ public class ProcMethod  implements  Serializable{
     public void setProcTypeName(String procTypeName) {
         this.procTypeName = procTypeName;
     }
+
+    public Integer getProcMethodIsCharge() {
+        return procMethodIsCharge;
+    }
+
+    public void setProcMethodIsCharge(Integer procMethodIsCharge) {
+        this.procMethodIsCharge = procMethodIsCharge;
+    }
 }

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

@@ -18,6 +18,8 @@ public class RelationOrder  implements  Serializable{
     private Integer salesId;
     //客诉id
     private Integer relationCustomerId;
+    //所属公司id
+    private Integer companyId;
 
     public Integer getRelationOrderId(){
         return relationOrderId;
@@ -60,4 +62,12 @@ public class RelationOrder  implements  Serializable{
     public void setRelationCustomerId(Integer relationCustomerId) {
         this.relationCustomerId = relationCustomerId;
     }
+
+    public Integer getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Integer companyId) {
+        this.companyId = companyId;
+    }
 }

+ 38 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectImg.java

@@ -0,0 +1,38 @@
+package com.iamberry.rst.core.fm;
+
+import java.io.Serializable;
+
+/**
+ *检测图片表
+ * Created by Administrator on 2019/4/16.
+ */
+public class ComplaintDetectImg implements Serializable {
+    private static final long serialVersionUID = -4743639410360414152L;
+    private Integer detectImgId;
+    private Integer detectId;
+    private String detectImgUrl;
+
+    public Integer getDetectImgId() {
+        return detectImgId;
+    }
+
+    public void setDetectImgId(Integer detectImgId) {
+        this.detectImgId = detectImgId;
+    }
+
+    public Integer getDetectId() {
+        return detectId;
+    }
+
+    public void setDetectId(Integer detectId) {
+        this.detectId = detectId;
+    }
+
+    public String getDetectImgUrl() {
+        return detectImgUrl;
+    }
+
+    public void setDetectImgUrl(String detectImgUrl) {
+        this.detectImgUrl = detectImgUrl;
+    }
+}

+ 249 - 12
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectInfo.java

@@ -13,13 +13,42 @@ import java.util.Date;
  * @date 2017/6/22 16:05
  */
 public class ComplaintDetectInfo implements Serializable {
-    private static final long serialVersionUID = -4586699316347839979L;
-    private Integer detectId;//id
-    private Integer customerId;//客诉id
-    private Integer signclosedId;//签收ID
+    private static final long serialVersionUID = -3623612031356499488L;
+    private Integer detectId;//主键
+    private Integer productId;//产品id
+    private Integer productColorId;//产品颜色id
+    private String machineNo;//机器编号
+    private String detectProductNumber;//产品型号
+    private Integer detectState;//状态 详情见数据库文档
+    private String detectPhenomenon;//工厂检测现象
+    private String detectClassification;//故障分类
+    private String detectFailureCause;//故障原因
+    private String detectResults;//判定结果
+    private String detectPoint;//故障指向
+    private String detectNalysis;//原因分析
+    private String detectContent;//维修内容
+    private Integer isMaintenance;//是否有故障1 有故障 2没有
     private String detectDesc;//备注
+    private Date detectDate;//检测日期
     private Date detectCreateTime;//创建时间
     private Date detectUpdateTime;//修改时间
+    private Integer customerId;//客诉id
+
+    private Integer productTypeId;//产品类型id
+    private String productTypeName;//产品类型名称
+    private String questionTitle;//问题标题
+    private String colorName;//产品颜色名称
+    private String productName;//产品名称
+
+    private Integer detectOffer;//维修报价
+    private Integer detectRenovation;//是否可翻新 1可翻新 2不可翻新
+    private Integer detectProcessingResults;//1付费维修 2免费维修 3退货 4换货 5原机退回
+    private String detectCustomerDesc;//客服备注
+
+    private Integer procMethodId;//处理方式id
+    private Integer procTypeId;//处理方式类型id
+    private String procMethodName;//处理方式名称
+    private String procTypeName;//处理方式类型名
 
     public Integer getDetectId() {
         return detectId;
@@ -29,20 +58,108 @@ public class ComplaintDetectInfo implements Serializable {
         this.detectId = detectId;
     }
 
-    public Integer getCustomerId() {
-        return customerId;
+    public Integer getProductId() {
+        return productId;
     }
 
-    public void setCustomerId(Integer customerId) {
-        this.customerId = customerId;
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getProductColorId() {
+        return productColorId;
+    }
+
+    public void setProductColorId(Integer productColorId) {
+        this.productColorId = productColorId;
+    }
+
+    public String getMachineNo() {
+        return machineNo;
     }
 
-    public Integer getSignclosedId() {
-        return signclosedId;
+    public void setMachineNo(String machineNo) {
+        this.machineNo = machineNo;
     }
 
-    public void setSignclosedId(Integer signclosedId) {
-        this.signclosedId = signclosedId;
+    public String getDetectProductNumber() {
+        return detectProductNumber;
+    }
+
+    public void setDetectProductNumber(String detectProductNumber) {
+        this.detectProductNumber = detectProductNumber;
+    }
+
+    public Integer getDetectState() {
+        return detectState;
+    }
+
+    public void setDetectState(Integer detectState) {
+        this.detectState = detectState;
+    }
+
+    public String getDetectPhenomenon() {
+        return detectPhenomenon;
+    }
+
+    public void setDetectPhenomenon(String detectPhenomenon) {
+        this.detectPhenomenon = detectPhenomenon;
+    }
+
+    public String getDetectClassification() {
+        return detectClassification;
+    }
+
+    public void setDetectClassification(String detectClassification) {
+        this.detectClassification = detectClassification;
+    }
+
+    public String getDetectFailureCause() {
+        return detectFailureCause;
+    }
+
+    public void setDetectFailureCause(String detectFailureCause) {
+        this.detectFailureCause = detectFailureCause;
+    }
+
+    public String getDetectResults() {
+        return detectResults;
+    }
+
+    public void setDetectResults(String detectResults) {
+        this.detectResults = detectResults;
+    }
+
+    public String getDetectPoint() {
+        return detectPoint;
+    }
+
+    public void setDetectPoint(String detectPoint) {
+        this.detectPoint = detectPoint;
+    }
+
+    public String getDetectNalysis() {
+        return detectNalysis;
+    }
+
+    public void setDetectNalysis(String detectNalysis) {
+        this.detectNalysis = detectNalysis;
+    }
+
+    public String getDetectContent() {
+        return detectContent;
+    }
+
+    public void setDetectContent(String detectContent) {
+        this.detectContent = detectContent;
+    }
+
+    public Integer getIsMaintenance() {
+        return isMaintenance;
+    }
+
+    public void setIsMaintenance(Integer isMaintenance) {
+        this.isMaintenance = isMaintenance;
     }
 
     public String getDetectDesc() {
@@ -53,6 +170,14 @@ public class ComplaintDetectInfo implements Serializable {
         this.detectDesc = detectDesc;
     }
 
+    public Date getDetectDate() {
+        return detectDate;
+    }
+
+    public void setDetectDate(Date detectDate) {
+        this.detectDate = detectDate;
+    }
+
     public Date getDetectCreateTime() {
         return detectCreateTime;
     }
@@ -68,4 +193,116 @@ public class ComplaintDetectInfo implements Serializable {
     public void setDetectUpdateTime(Date detectUpdateTime) {
         this.detectUpdateTime = detectUpdateTime;
     }
+
+    public Integer getCustomerId() {
+        return customerId;
+    }
+
+    public void setCustomerId(Integer customerId) {
+        this.customerId = customerId;
+    }
+
+    public Integer getProductTypeId() {
+        return productTypeId;
+    }
+
+    public void setProductTypeId(Integer productTypeId) {
+        this.productTypeId = productTypeId;
+    }
+
+    public String getProductTypeName() {
+        return productTypeName;
+    }
+
+    public void setProductTypeName(String productTypeName) {
+        this.productTypeName = productTypeName;
+    }
+
+    public String getQuestionTitle() {
+        return questionTitle;
+    }
+
+    public void setQuestionTitle(String questionTitle) {
+        this.questionTitle = questionTitle;
+    }
+
+    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;
+    }
+
+    public Integer getDetectOffer() {
+        return detectOffer;
+    }
+
+    public void setDetectOffer(Integer detectOffer) {
+        this.detectOffer = detectOffer;
+    }
+
+    public Integer getDetectRenovation() {
+        return detectRenovation;
+    }
+
+    public void setDetectRenovation(Integer detectRenovation) {
+        this.detectRenovation = detectRenovation;
+    }
+
+    public Integer getDetectProcessingResults() {
+        return detectProcessingResults;
+    }
+
+    public void setDetectProcessingResults(Integer detectProcessingResults) {
+        this.detectProcessingResults = detectProcessingResults;
+    }
+
+    public String getProcMethodName() {
+        return procMethodName;
+    }
+
+    public void setProcMethodName(String procMethodName) {
+        this.procMethodName = procMethodName;
+    }
+
+    public String getProcTypeName() {
+        return procTypeName;
+    }
+
+    public void setProcTypeName(String procTypeName) {
+        this.procTypeName = procTypeName;
+    }
+
+    public String getDetectCustomerDesc() {
+        return detectCustomerDesc;
+    }
+
+    public void setDetectCustomerDesc(String detectCustomerDesc) {
+        this.detectCustomerDesc = detectCustomerDesc;
+    }
+
+    public Integer getProcMethodId() {
+        return procMethodId;
+    }
+
+    public void setProcMethodId(Integer procMethodId) {
+        this.procMethodId = procMethodId;
+    }
+
+    public Integer getProcTypeId() {
+        return procTypeId;
+    }
+
+    public void setProcTypeId(Integer procTypeId) {
+        this.procTypeId = procTypeId;
+    }
 }

+ 0 - 246
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectItem.java

@@ -1,246 +0,0 @@
-package com.iamberry.rst.core.fm;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Created by Administrator on 2018/7/11.
- */
-public class ComplaintDetectItem implements Serializable {
-    private static final long serialVersionUID = -3623612031356499488L;
-    private Integer detectItemId;//主键
-    private Integer detectId;//检测id
-    private Integer productId;//产品id
-    private Integer productColorId;//产品颜色id
-    private String machineNo;//机器编号
-    private String detectProductNumber;//产品型号
-    private Integer detectItemState;//状态 1未检测 2已检测
-    private String detectItemPhenomenon;//工厂检测现象
-    private String detectItemClassification;//故障分类
-    private String detectItemFailureCause;//故障原因
-    private String detectItemResults;//判定结果
-    private String detectItemPoint;//故障指向
-    private String detectItemNalysis;//原因分析
-    private String detectItemContent;//维修内容
-    private Integer isMaintenance;//是否维修
-    private Integer maintenanceResults;//QC检测结果
-    private String detectItemDesc;//备注
-    private Date detectItemDate;//检测日期
-    private Date detectItemCreateTime;//创建时间
-    private Date detectItemUpdateTime;//修改时间
-    private Integer customerId;//客诉id
-
-    private Integer productTypeId;//产品类型id
-    private String productTypeName;//产品类型名称
-    private String questionTitle;//问题标题
-    private String colorName;//产品颜色名称
-    private String productName;//产品名称
-
-    public Integer getDetectItemId() {
-        return detectItemId;
-    }
-
-    public void setDetectItemId(Integer detectItemId) {
-        this.detectItemId = detectItemId;
-    }
-
-    public Integer getDetectId() {
-        return detectId;
-    }
-
-    public void setDetectId(Integer detectId) {
-        this.detectId = detectId;
-    }
-
-    public Integer getProductId() {
-        return productId;
-    }
-
-    public void setProductId(Integer productId) {
-        this.productId = productId;
-    }
-
-    public String getMachineNo() {
-        return machineNo;
-    }
-
-    public void setMachineNo(String machineNo) {
-        this.machineNo = machineNo;
-    }
-
-    public String getDetectProductNumber() {
-        return detectProductNumber;
-    }
-
-    public void setDetectProductNumber(String detectProductNumber) {
-        this.detectProductNumber = detectProductNumber;
-    }
-
-    public Integer getDetectItemState() {
-        return detectItemState;
-    }
-
-    public void setDetectItemState(Integer detectItemState) {
-        this.detectItemState = detectItemState;
-    }
-
-    public String getDetectItemPhenomenon() {
-        return detectItemPhenomenon;
-    }
-
-    public void setDetectItemPhenomenon(String detectItemPhenomenon) {
-        this.detectItemPhenomenon = detectItemPhenomenon;
-    }
-
-    public String getDetectItemClassification() {
-        return detectItemClassification;
-    }
-
-    public void setDetectItemClassification(String detectItemClassification) {
-        this.detectItemClassification = detectItemClassification;
-    }
-
-    public String getDetectItemFailureCause() {
-        return detectItemFailureCause;
-    }
-
-    public void setDetectItemFailureCause(String detectItemFailureCause) {
-        this.detectItemFailureCause = detectItemFailureCause;
-    }
-
-    public String getDetectItemResults() {
-        return detectItemResults;
-    }
-
-    public void setDetectItemResults(String detectItemResults) {
-        this.detectItemResults = detectItemResults;
-    }
-
-    public String getDetectItemPoint() {
-        return detectItemPoint;
-    }
-
-    public void setDetectItemPoint(String detectItemPoint) {
-        this.detectItemPoint = detectItemPoint;
-    }
-
-    public String getDetectItemNalysis() {
-        return detectItemNalysis;
-    }
-
-    public void setDetectItemNalysis(String detectItemNalysis) {
-        this.detectItemNalysis = detectItemNalysis;
-    }
-
-    public String getDetectItemContent() {
-        return detectItemContent;
-    }
-
-    public void setDetectItemContent(String detectItemContent) {
-        this.detectItemContent = detectItemContent;
-    }
-
-    public Integer getIsMaintenance() {
-        return isMaintenance;
-    }
-
-    public void setIsMaintenance(Integer isMaintenance) {
-        this.isMaintenance = isMaintenance;
-    }
-
-    public Integer getMaintenanceResults() {
-        return maintenanceResults;
-    }
-
-    public void setMaintenanceResults(Integer maintenanceResults) {
-        this.maintenanceResults = maintenanceResults;
-    }
-
-    public String getDetectItemDesc() {
-        return detectItemDesc;
-    }
-
-    public void setDetectItemDesc(String detectItemDesc) {
-        this.detectItemDesc = detectItemDesc;
-    }
-
-    public Date getDetectItemDate() {
-        return detectItemDate;
-    }
-
-    public void setDetectItemDate(Date detectItemDate) {
-        this.detectItemDate = detectItemDate;
-    }
-
-    public Date getDetectItemCreateTime() {
-        return detectItemCreateTime;
-    }
-
-    public void setDetectItemCreateTime(Date detectItemCreateTime) {
-        this.detectItemCreateTime = detectItemCreateTime;
-    }
-
-    public Date getDetectItemUpdateTime() {
-        return detectItemUpdateTime;
-    }
-
-    public void setDetectItemUpdateTime(Date detectItemUpdateTime) {
-        this.detectItemUpdateTime = detectItemUpdateTime;
-    }
-
-    public Integer getCustomerId() {
-        return customerId;
-    }
-
-    public void setCustomerId(Integer customerId) {
-        this.customerId = customerId;
-    }
-
-    public Integer getProductTypeId() {
-        return productTypeId;
-    }
-
-    public void setProductTypeId(Integer productTypeId) {
-        this.productTypeId = productTypeId;
-    }
-
-    public String getProductTypeName() {
-        return productTypeName;
-    }
-
-    public void setProductTypeName(String productTypeName) {
-        this.productTypeName = productTypeName;
-    }
-
-    public String getQuestionTitle() {
-        return questionTitle;
-    }
-
-    public void setQuestionTitle(String questionTitle) {
-        this.questionTitle = questionTitle;
-    }
-
-    public Integer getProductColorId() {
-        return productColorId;
-    }
-
-    public void setProductColorId(Integer productColorId) {
-        this.productColorId = productColorId;
-    }
-
-    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;
-    }
-}

+ 37 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintSignclosedImg.java

@@ -0,0 +1,37 @@
+package com.iamberry.rst.core.fm;
+
+import java.io.Serializable;
+
+/**1.8.6	工厂-签收图片表
+ * Created by Administrator on 2019/4/9.
+ */
+public class ComplaintSignclosedImg implements Serializable{
+    private static final long serialVersionUID = 4539964072103301542L;
+    private Integer imgId;
+    private Integer signclosedId;
+    private String imgUrl;
+
+    public Integer getImgId() {
+        return imgId;
+    }
+
+    public void setImgId(Integer imgId) {
+        this.imgId = imgId;
+    }
+
+    public Integer getSignclosedId() {
+        return signclosedId;
+    }
+
+    public void setSignclosedId(Integer signclosedId) {
+        this.signclosedId = signclosedId;
+    }
+
+    public String getImgUrl() {
+        return imgUrl;
+    }
+
+    public void setImgUrl(String imgUrl) {
+        this.imgUrl = imgUrl;
+    }
+}

+ 66 - 31
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintSignclosedInfo.java

@@ -14,28 +14,31 @@ import java.util.List;
 public class ComplaintSignclosedInfo implements Serializable {
     private static final long serialVersionUID = 2416773719172770710L;
     private Integer signclosedId;//id
-    private Integer signclosedType;//签收类型
-    private String signclosedTypeName;//签收类型名称
     private String signclosedLogistics;//寄回物流
     private String signclosedLogisticsNumber;//物流单号
     private String signclosedSendName;//寄件人姓名
     private String signclosedSendTel;//寄件人电话
-    private String signclosedAddrProvinces;//寄件地址(省)
-    private String signclosedAddrCity;//寄件地址(市)
-    private String signclosedAddrArea;//寄件地址(区)
+    private String signclosedAddrProvinces;//寄件地址(省)id
+    private String signclosedAddrCity;//寄件地址(市)id
+    private String signclosedAddrArea;//寄件地址(区)id
     private Date signclosedDate;//签收时间
     private Integer signclosedCustomerId;//客诉id
     private String signclosedDesc;//备注
     private Date signclosedCreateTime;//创建时间
     private Date signclosedUpdateTime;//修改时间
-    private Integer signclosedState;//状态1已签收2已移交QC
     private String signclosedCustomerDesc;//客服备注
     private Integer isBinding;//是否绑定客诉
-
+    private Integer signclosedIsReceiving;//是否签收 1待签收 2已签收
+    private Integer signclosedCompanyId;//所属公司
     private String customerIdDescribe;//客诉标题
     private List<AwaitingSignclosedProductInfo> awaitingSignclosedProductInfoList = new ArrayList<AwaitingSignclosedProductInfo>();	//待签收实体类
     private List<SignclosedProductInfo> signclosedProductInfoList = new ArrayList<SignclosedProductInfo>();	//签收实体类
+    private List<ComplaintSignclosedImg> signclosedImgInfoList = new ArrayList<ComplaintSignclosedImg>();	//签收实体类
     private String describeHandleDesc;//处理描述
+    private String signclosedAddrProvincesName;//寄件地址(省)
+    private String signclosedAddrCityName;//寄件地址(市)
+    private String signclosedAddrAreaName;//寄件地址(区)
+    private Integer sendbackId;//客诉寄回id
     public Integer getSignclosedId() {
         return signclosedId;
     }
@@ -44,22 +47,6 @@ public class ComplaintSignclosedInfo implements Serializable {
         this.signclosedId = signclosedId;
     }
 
-    public Integer getSignclosedType() {
-        return signclosedType;
-    }
-
-    public void setSignclosedType(Integer signclosedType) {
-        this.signclosedType = signclosedType;
-    }
-
-    public String getSignclosedTypeName() {
-        return signclosedTypeName;
-    }
-
-    public void setSignclosedTypeName(String signclosedTypeName) {
-        this.signclosedTypeName = signclosedTypeName;
-    }
-
     public String getSignclosedLogistics() {
         return signclosedLogistics;
     }
@@ -188,14 +175,6 @@ public class ComplaintSignclosedInfo implements Serializable {
         this.describeHandleDesc = describeHandleDesc;
     }
 
-    public Integer getSignclosedState() {
-        return signclosedState;
-    }
-
-    public void setSignclosedState(Integer signclosedState) {
-        this.signclosedState = signclosedState;
-    }
-
     public String getSignclosedCustomerDesc() {
         return signclosedCustomerDesc;
     }
@@ -211,4 +190,60 @@ public class ComplaintSignclosedInfo implements Serializable {
     public void setIsBinding(Integer isBinding) {
         this.isBinding = isBinding;
     }
+
+    public Integer getSignclosedIsReceiving() {
+        return signclosedIsReceiving;
+    }
+
+    public void setSignclosedIsReceiving(Integer signclosedIsReceiving) {
+        this.signclosedIsReceiving = signclosedIsReceiving;
+    }
+
+    public Integer getSignclosedCompanyId() {
+        return signclosedCompanyId;
+    }
+
+    public void setSignclosedCompanyId(Integer signclosedCompanyId) {
+        this.signclosedCompanyId = signclosedCompanyId;
+    }
+
+    public String getSignclosedAddrProvincesName() {
+        return signclosedAddrProvincesName;
+    }
+
+    public void setSignclosedAddrProvincesName(String signclosedAddrProvincesName) {
+        this.signclosedAddrProvincesName = signclosedAddrProvincesName;
+    }
+
+    public String getSignclosedAddrCityName() {
+        return signclosedAddrCityName;
+    }
+
+    public void setSignclosedAddrCityName(String signclosedAddrCityName) {
+        this.signclosedAddrCityName = signclosedAddrCityName;
+    }
+
+    public String getSignclosedAddrAreaName() {
+        return signclosedAddrAreaName;
+    }
+
+    public void setSignclosedAddrAreaName(String signclosedAddrAreaName) {
+        this.signclosedAddrAreaName = signclosedAddrAreaName;
+    }
+
+    public List<ComplaintSignclosedImg> getSignclosedImgInfoList() {
+        return signclosedImgInfoList;
+    }
+
+    public void setSignclosedImgInfoList(List<ComplaintSignclosedImg> signclosedImgInfoList) {
+        this.signclosedImgInfoList = signclosedImgInfoList;
+    }
+
+    public Integer getSendbackId() {
+        return sendbackId;
+    }
+
+    public void setSendbackId(Integer sendbackId) {
+        this.sendbackId = sendbackId;
+    }
 }

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

@@ -21,9 +21,10 @@ public class SignclosedProductInfo implements Serializable {
     private Integer signclosedProductId;//关联产品id  (根据产品类型判断)
     private Integer signclosedProductColor;//关联产品颜色id
     private String machineNo;//机器编号
-
+    private Integer signclosedState;//签收状态 1待签收 2已签收
     private String colorName;//颜色名称
     private String productNumber;//产品型号
+    private Integer colorPrice;//产品价格
 
     public Integer getProductId() {
         return productId;
@@ -120,4 +121,20 @@ public class SignclosedProductInfo implements Serializable {
     public void setMachineNo(String machineNo) {
         this.machineNo = machineNo;
     }
+
+    public Integer getSignclosedState() {
+        return signclosedState;
+    }
+
+    public void setSignclosedState(Integer signclosedState) {
+        this.signclosedState = signclosedState;
+    }
+
+    public Integer getColorPrice() {
+        return colorPrice;
+    }
+
+    public void setColorPrice(Integer colorPrice) {
+        this.colorPrice = colorPrice;
+    }
 }

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/Product.java

@@ -39,6 +39,8 @@ public class Product implements Serializable {
 
     private String typeName;            //产品类型名称
 
+    private Integer productIsDetection;  //是否需要售后检测 1 需要 2不需要
+
     //是否可批发 1:可批发 2:不可批发'
     private Integer productWholesale;
 
@@ -150,6 +152,14 @@ public class Product implements Serializable {
         this.productWholesale = productWholesale;
     }
 
+    public Integer getProductIsDetection() {
+        return productIsDetection;
+    }
+
+    public void setProductIsDetection(Integer productIsDetection) {
+        this.productIsDetection = productIsDetection;
+    }
+
     @Override
     public String toString() {
         return "Product{" +

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/ProductColor.java

@@ -47,6 +47,8 @@ public class ProductColor implements Serializable {
 
     private Integer colorIsMachine; //是否是水机 1:水机 2;其它产品
 
+    private Integer colorIsDetection; //是否需要售后检测 1 需要 2不需要
+
     public String getProductName() {
         return productName;
     }
@@ -175,6 +177,14 @@ public class ProductColor implements Serializable {
         this.colorAbbreviation = colorAbbreviation;
     }
 
+    public Integer getColorIsDetection() {
+        return colorIsDetection;
+    }
+
+    public void setColorIsDetection(Integer colorIsDetection) {
+        this.colorIsDetection = colorIsDetection;
+    }
+
     @Override
     public String toString() {
         return "ProductColor{" +

+ 30 - 16
watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintDetectInfoService.java

@@ -1,7 +1,8 @@
 package com.iamberry.rst.faces.fm;
 
+import com.iamberry.rst.core.fm.ComplaintDetectImg;
 import com.iamberry.rst.core.fm.ComplaintDetectInfo;
-import com.iamberry.rst.core.fm.ComplaintDetectItem;
+import com.iamberry.rst.core.fm.ComplaintSignclosedInfo;
 import com.iamberry.rst.core.fm.DetectionBasis;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
@@ -13,47 +14,60 @@ import java.util.List;
  */
 public interface ComplaintDetectInfoService {
     /**
-     * 添加单个品质检测产品
-     * @return
-     */
-    int insert(ComplaintDetectInfo record);
-    /**
      * 查询单个品质检测产品
      * @return
      */
-    ComplaintDetectItem getDetectItemById(Integer detectId);
+    ComplaintDetectInfo getDetectById(Integer detectId);
     /**
      * 修改单个待品质检测产品
      * @return
      */
-    int updateDetectItemById(ComplaintDetectItem record);
-
-
+    int updateDetectById(ComplaintDetectInfo record);
     /**
-     * 获取品质检测列表
+     * 修改单个待品质检测产品并添加图片
      * @return
      */
-    PagedResult<ComplaintDetectItem> listComplaintDetectItem(PageRequest<ComplaintDetectItem> pageRequest);
+    int updateDetectById(ComplaintDetectInfo record,String[] imgs);
 
     /**
-     * 根据客诉id、查询品检信息
+     * 获取品质检测列表
      * @return
      */
-    ComplaintDetectInfo getDetectByCustomerId(Integer customerId);
+    PagedResult<ComplaintDetectInfo> listComplaintDetect(PageRequest<ComplaintDetectInfo> pageRequest);
+
     /**
      * 添加品检项
      * @return
      */
-    int insertItem(ComplaintDetectItem complaintDetectItem);
+    int insert(ComplaintDetectInfo complaintDetectInfo);
+
     /**
      * 删除品检项
      * @return
      */
-    int deleteDetectItem(Integer detectItemId);
+    int deleteDetect(Integer detectId);
 
     /**
      * 查询检测内容
      * @return
      */
     List<DetectionBasis> listDetectionBasis(DetectionBasis detectionBasis);
+
+    /**
+     * 添加检测图片
+     * @return
+     */
+    int addDetectImg(ComplaintDetectImg complaintDetectImg);
+
+    /**
+     * 获取品质检测列表
+     * @return
+     */
+    List<ComplaintDetectInfo> listComplaintDetect(ComplaintDetectInfo detectInfo);
+
+    /**
+     * 获取品质检测列表
+     * @return
+     */
+    boolean customerConfirm(ComplaintDetectInfo detectInfo);
 }

+ 34 - 1
watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintSignclosedInfoService.java

@@ -1,5 +1,6 @@
 package com.iamberry.rst.faces.fm;
 
+import com.iamberry.rst.core.fm.ComplaintSignclosedImg;
 import com.iamberry.rst.core.fm.ComplaintSignclosedInfo;
 import com.iamberry.rst.core.fm.SignclosedProductInfo;
 import com.iamberry.rst.core.page.PageRequest;
@@ -16,7 +17,7 @@ public interface ComplaintSignclosedInfoService {
      * 添加单个签收记录
      * @return
      */
-    boolean insert(ComplaintSignclosedInfo record,String orderItemString);
+    boolean insert(ComplaintSignclosedInfo record,String orderItemString,String[] componentsImgs);
     /**
      * 查询单个签收记录
      * @return
@@ -30,6 +31,11 @@ public interface ComplaintSignclosedInfoService {
                              Map<String,Integer> alreadyColorMap,
                              Map<String,String[]> machineNumberMap,
                              Map<String,Integer> alreadyFittingsMap);
+    /**
+     * 修改单个签收记录
+     * @return
+     */
+    boolean updateSignclosedById(ComplaintSignclosedInfo record,String orderItemString,String[] componentsImgs);
 
     /**
      * 修改单个签收记录
@@ -50,6 +56,12 @@ public interface ComplaintSignclosedInfoService {
     PagedResult<ComplaintSignclosedInfo> listSignclosed(PageRequest<ComplaintSignclosedInfo> pageRequest);
 
     /**
+     * 查询多个签收记录
+     * @return
+     */
+    List<ComplaintSignclosedInfo> listSignclosed(ComplaintSignclosedInfo complaintSignclosedInfo);
+
+    /**
      * 添加品质信息
      * @return
      */
@@ -60,4 +72,25 @@ public interface ComplaintSignclosedInfoService {
      * @return
      */
     List<SignclosedProductInfo> listSignclosedById(Integer signclosedId);
+
+    /**
+     * 添加产品图片
+     * @return
+     */
+    Integer insertImg(ComplaintSignclosedImg complaintSignclosedImg);
+    /**
+     * 查询产品图片
+     * @return
+     */
+    List<ComplaintSignclosedImg> listSignclosedImgById(Integer signclosedId);
+    /**
+     * 删除产品图片
+     * @return
+     */
+    Integer delSignclosedImg(Integer signclosedId);
+    /**
+     * 删除签收信息
+     * @return
+     */
+    Integer delSignclosedBySendbackId(Integer sendbackId);
 }

+ 6 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintSignclosedProductInfoService.java

@@ -35,4 +35,10 @@ public interface ComplaintSignclosedProductInfoService {
      * @return
      */
     SignclosedProductInfo listSignclosedProductInfoById(Integer productid);
+
+    /**
+     * 删除签收产品
+     * @return
+     */
+    Integer delSignclosedProduct(Integer signclosedId);
 }

+ 64 - 3
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -5,6 +5,7 @@ import com.iamberry.rst.core.cm.*;
 import com.iamberry.rst.core.fm.AwaitingSignclosedProductInfo;
 import com.iamberry.rst.core.fm.ComplaintDetectInfo;
 import com.iamberry.rst.core.fm.ComplaintSignclosedInfo;
+import com.iamberry.rst.core.fm.SignclosedProductInfo;
 import com.iamberry.rst.core.order.*;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.cm.*;
@@ -70,8 +71,6 @@ public class CustomerServiceImpl implements CustomerService {
     @Autowired
     private ProductMapper productMapper;  //产品
     @Autowired
-    private ComplaintSignclosedProductInfoMapper complaintSignclosedProductInfoMapper;
-    @Autowired
     private FittingsInfoMapper fittingsInfoMapper;
     @Autowired
     private EfastOrderService efastOrderService;
@@ -85,6 +84,8 @@ public class CustomerServiceImpl implements CustomerService {
     private CmRelationMapper cmRelationMapper;
     @Autowired
     private RelationOrderMapper relationOrderMapper;
+    @Autowired
+    private ComplaintSignclosedProductInfoMapper complaintSignclosedProductInfoMapper;
 
     @Override
     public CustomerInfo getCustomerInfo(Integer customerId) {
@@ -628,7 +629,6 @@ public class CustomerServiceImpl implements CustomerService {
             return;
         }
         Integer flag;
-        complaintSignclosedInfo.setSignclosedType(1); //客诉寄回
         complaintSignclosedInfo.setSignclosedCustomerId(customerCommon.getCustomerId()); //客诉id
         complaintSignclosedInfo.setSignclosedSendName(customerCommon.getRelationBackName());    //签收姓名
         complaintSignclosedInfo.setSignclosedSendTel(customerCommon.getRelationBackTel());     //签收手机
@@ -1728,11 +1728,71 @@ public class CustomerServiceImpl implements CustomerService {
             return null;
         }
         List<SendbackItem> sendbackItemLists = new ArrayList<>();
+        //查询所属公司
+        CmRelation cmRelation = cmRelationMapper.getCmRelationById(sendbackInfo.getRelationId());
         for (SendbackItem info : sendbackItemList){
             info.setSendbackId(sendbackInfo.getSendbackId());
             if(info.getSendbackProdcueNumber() > 0){
                 sendbackItemLists.add(info);
             }
+
+            /*添加待签收记录 2019年4月11日18:09:34 state*/
+            ComplaintSignclosedInfo signclosedInfo = new ComplaintSignclosedInfo();
+            ProductColor productColor = productMapper.getProduceColor(info.getSendbackColorId());
+            Product product = productMapper.getProduce(productColor.getColorProductId());
+            SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
+            signclosedInfo.setSignclosedLogistics(sendbackInfo.getSendbackLogisticsCompany());
+            signclosedInfo.setSignclosedLogisticsNumber(sendbackInfo.getSendbackLogisticsNo());
+            signclosedInfo.setSignclosedSendName(sendbackInfo.getSendbackName());
+            signclosedInfo.setSignclosedSendTel(sendbackInfo.getSendbackTel());
+            signclosedInfo.setSendbackId(sendbackInfo.getSendbackId());
+            if(sendbackInfo.getSendbackStatus() < 3){
+                signclosedInfo.setSignclosedIsReceiving(1); //未签收
+                signclosedProductInfo.setSignclosedState(1);
+            }else{
+                signclosedInfo.setSignclosedIsReceiving(2);//已签收
+                signclosedProductInfo.setSignclosedState(2);
+                signclosedInfo.setSignclosedDate(sendbackInfo.getSendbackSignTime());
+            }
+            signclosedInfo.setSignclosedCompanyId(cmRelation.getCompanyId());
+            signclosedInfo.setSignclosedCustomerId(cmRelation.getCustomerId());
+            //添加待签收产品
+            signclosedProductInfo.setProductName(productColor.getProductName());
+            signclosedProductInfo.setProductNum(info.getSendbackProdcueNumber());
+            signclosedProductInfo.setSignclosedProductId(info.getSendbackProductId());
+            signclosedProductInfo.setSignclosedProductColor(info.getSendbackColorId());
+            signclosedProductInfo.setSignclosedProductType(productColor.getProductType());
+            for(int i = 0;i< info.getSendbackProdcueNumber();i++){
+                if(complaintSignclosedInfoMapper.insert(signclosedInfo) < 1){
+                    throw new RuntimeException("添加签收记录失败");
+                }
+                signclosedProductInfo.setSignclosedId(signclosedInfo.getSignclosedId());
+                signclosedProductInfo.setProductNum(1);
+                complaintSignclosedProductInfoMapper.insert(signclosedProductInfo);
+                /*//判断是否需要生成维修记录
+                if(sendbackInfo.getSendbackStatus() == 3){
+                    if(product.getProductIsDetection() == 1){
+                        //添加待检测信息
+                        //查询签收信息
+                        ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+                        detectInfo.setProductId(productColor.getColorProductId());
+                        detectInfo.setProductColorId(info.getSendbackColorId());
+                        detectInfo.setDetectProductNumber(product.getProductNumber());
+                        detectInfo.setDetectState(1);
+                        detectInfo.setCustomerId(cmRelation.getCustomerId());
+                        detectInfo.setIsMaintenance(0);
+                        detectInfo.setDetectRenovation(0);
+                        detectInfo.setDetectProcessingResults(0);
+                        try {
+                            complaintDetectInfoMapper.insert(detectInfo);
+                        }catch (Exception e){
+                            throw new RuntimeException("------------生成检测信息出错------------");
+                        }
+                    }
+                }*/
+            }
+            /*添加待签收记录 2019年4月11日18:09:34 end*/
+
         }
         if(sendbackItemLists.size() > 0){
             Integer msgs = customerService.addSendbackItemList(sendbackItemLists);
@@ -1740,6 +1800,7 @@ public class CustomerServiceImpl implements CustomerService {
                 throw new RuntimeException("添加寄回产品项信息失败");
             }
         }
+
         return sendbackInfo;
     }
 

+ 6 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/CustomerInfoMapper.java

@@ -246,4 +246,10 @@ public interface CustomerInfoMapper {
      * @return
      */
     Integer addDownloadProgressInfo(DownloadProgressInfo downloadProgressInfo);
+
+    /**
+     * 修改售后处理处理方式
+     * @return
+     */
+    Integer updateCmRelationProcMethod(CmRelation cmRelation);
 }

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

@@ -145,8 +145,10 @@
     </select>
     <select id="getCmRelationById" resultMap="BaseResultMap" parameterType="Integer" >
         select
-        <include refid="Base_List" />
+        <include refid="Base_List" />,
+        ci.company_id AS companyId
         from tb_rst_cm_relation t
+        LEFT JOIN tb_rst_cm_customer_info ci on t.customer_id = ci.customer_id
         where t.relation_id= #{relationId}
     </select>
 

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

@@ -294,7 +294,8 @@
     cc.customerIsSolve as customerIsSolve,
     cc.procMethodIsBack as procMethodIsBack,
     cc.procMethodIsSend as procMethodIsSend,
-    cc.relationSendAddress as customerSendAddress
+    cc.relationSendAddress as customerSendAddress,
+    cc.relationId as relationId
     FROM
     tb_rst_cm_customer_info c
     LEFT JOIN (
@@ -447,7 +448,6 @@
   <resultMap id="customerMap" type="CustomerInfo">
     <id column="customer_id" property="customerId"/>
     <result column="customer_counsel_type" property="customerCounselType"/>
-    <result column="signclosed_type_name" property="signclosedTypeName"/>
     <result column="admin_name" property="adminName"/>
     <result column="customer_name" property="customerName"/>
     <result column="customer_tel" property="customerTel"/>
@@ -1112,7 +1112,8 @@ LEFT JOIN tb_rst_cm_sendback_info csi ON csi.relation_id = cr.relation_id
     cpm.proc_method_is_back AS procMethodIsBack,
     cpm.proc_method_is_send AS procMethodIsSend,
     cpm.proc_method_name AS procMethodName,
-    cpt.proc_type_name AS procTypeName
+    cpt.proc_type_name AS procTypeName,
+    cpt.proc_type_id AS procTypeId
     FROM
     tb_rst_cm_relation cr
     LEFT JOIN (
@@ -1506,5 +1507,17 @@ LEFT JOIN tb_rst_cm_sendback_info csi ON csi.relation_id = cr.relation_id
     )
   </insert>
   <!--查询客诉下载进度sql end -->
-  
+
+
+  <!-- 修改售后处理处理方式 -->
+  <update id="updateCmRelationProcMethod" parameterType="CmRelation" >
+    UPDATE tb_rst_cm_relation
+    <set>
+      <if test="procMethodId != null and procMethodId != ''" >
+        proc_method_id = #{procMethodId}
+      </if>
+    </set>
+    WHERE
+      customer_id = #{customerId}
+  </update>
 </mapper>

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

@@ -11,6 +11,7 @@
         <result    column="proc_method_is_send"    property="procMethodIsSend" />
         <result    column="proc_method_create_time"    property="procMethodCreateTime" />
         <result    column="proc_method_update_time"    property="procMethodUpdateTime" />
+        <result    column="proc_method_is_charge"    property="procMethodIsCharge" />
     </resultMap>
     <sql    id="Base_List" >
         t.proc_method_id,
@@ -21,7 +22,8 @@
         t.proc_method_is_back,
         t.proc_method_is_send,
         t.proc_method_create_time,
-        t.proc_method_update_time
+        t.proc_method_update_time,
+        t.proc_method_is_charge
     </sql>
     <select id="getProcMethodList" resultMap="BaseResultMap" parameterType="ProcMethod" >
         select

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

@@ -1699,6 +1699,10 @@
         ORDER BY soi.sales_create_time DESC
     </select>
 
+    <select id="getAfterrulesInfo" parameterType="Integer" resultType="AfterrulesInfo">
+        select * from tb_rst_afterrules_info
+        WHERE store_id = #{storeId}
+    </select>
     <select id="listSmsSignatureInfo" parameterType="SmsSignatureInfo" resultType="SmsSignatureInfo">
         select * from tb_rst_smsSignature_info
         <where>

+ 138 - 22
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintDetectInfoServiceImpl.java

@@ -2,17 +2,23 @@ package com.iamberry.rst.service.fm;
 
 
 import com.github.pagehelper.PageHelper;
+import com.iamberry.rst.core.cm.CmRelation;
+import com.iamberry.rst.core.cm.ProcMethod;
+import com.iamberry.rst.core.fm.ComplaintDetectImg;
 import com.iamberry.rst.core.fm.ComplaintDetectInfo;
-import com.iamberry.rst.core.fm.ComplaintDetectItem;
+import com.iamberry.rst.core.fm.ComplaintSignclosedInfo;
 import com.iamberry.rst.core.fm.DetectionBasis;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.fm.ComplaintDetectInfoService;
+import com.iamberry.rst.service.cm.mapper.CustomerInfoMapper;
+import com.iamberry.rst.service.cm.mapper.ProcMethodMapper;
 import com.iamberry.rst.service.fm.mapper.ComplaintDetectInfoMapper;
 import com.iamberry.rst.service.fm.mapper.ComplaintMaintenanceInfoMapper;
 import com.iamberry.rst.util.PageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -21,48 +27,158 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
     @Autowired
     private ComplaintDetectInfoMapper complaintDetectInfoMapper;
     @Autowired
-    private ComplaintMaintenanceInfoMapper complaintMaintenanceInfoMapper;
+    private CustomerInfoMapper customerInfoMapper;
+    @Autowired
+    private ProcMethodMapper procMethodMapper;
 
     @Override
-    public int insert(ComplaintDetectInfo record) {
-        return complaintDetectInfoMapper.insert(record);
+    public ComplaintDetectInfo getDetectById(Integer detectId) {
+        return complaintDetectInfoMapper.getDetectById(detectId);
     }
 
     @Override
-    public ComplaintDetectItem getDetectItemById(Integer detectId) {
-        return complaintDetectInfoMapper.getDetectItemById(detectId);
+    public int updateDetectById(ComplaintDetectInfo record) {
+        return complaintDetectInfoMapper.updateDetectById(record);
     }
-
+    @Transactional
     @Override
-    public int updateDetectItemById(ComplaintDetectItem record) {
-        return complaintDetectInfoMapper.updateDetectItemById(record);
+    public int updateDetectById(ComplaintDetectInfo record,String[] imgs) {
+        //判断售后流程
+        CmRelation cmRelation = new CmRelation();
+        cmRelation.setCustomerId(record.getCustomerId());
+        cmRelation = customerInfoMapper.getCmRelationInfo(cmRelation);
+        ProcMethod procMethod = procMethodMapper.getProcMethodById(cmRelation.getProcMethodId());
+        switch (cmRelation.getProcTypeId()){
+            case 3://维修
+                if(procMethod.getProcMethodIsCharge() == 0){//待定
+                    if(record.getIsMaintenance() == 1){
+                        record.setDetectState(38);//机器故障,待用户确认
+                    }else if(record.getIsMaintenance() == 2){
+                        record.setDetectState(37);//机器无故障,原机退回
+                    }
+                }else if(procMethod.getProcMethodIsCharge() == 1){//付费
+                    record.setDetectState(30);//待用户确认
+                }else if(procMethod.getProcMethodIsCharge() == 2){//免费
+                    record.setDetectState(34);//待客服确认维修
+                }
+            break;
+            default:
+                if(record.getDetectRenovation() == 1){//是否可翻新 1可翻新 2不可翻新
+                    record.setDetectState(20);//待翻新入库
+                }else if(record.getDetectRenovation() == 2){
+                    record.setDetectState(22);//不能翻新,待报废
+                }
+        }
+        try {
+            if(complaintDetectInfoMapper.updateDetectById(record) > 0){
+                if(imgs != null){
+                    if(imgs.length > 0){
+                        for(String img : imgs){
+                            ComplaintDetectImg detectImg = new ComplaintDetectImg();
+                            detectImg.setDetectId(record.getDetectId());
+                            detectImg.setDetectImgUrl(img);
+                            complaintDetectInfoMapper.addDetectImg(detectImg);
+                        }
+                    }
+                }
+            }
+        }catch (Exception e){
+            throw new RuntimeException("完成检测失败");
+        }
+        return 1;
     }
-
-
     @Override
-    public PagedResult<ComplaintDetectItem> listComplaintDetectItem(PageRequest<ComplaintDetectItem> pageRequest) {
+    public PagedResult<ComplaintDetectInfo> listComplaintDetect(PageRequest<ComplaintDetectInfo> pageRequest) {
         PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());
-        List<ComplaintDetectItem> detedctList = complaintDetectInfoMapper.listComplaintDetectItem(pageRequest.getData());
-        return PageUtil.getPage(detedctList);
+        List<ComplaintDetectInfo> detectList = complaintDetectInfoMapper.listComplaintDetect(pageRequest.getData());
+        return PageUtil.getPage(detectList);
+    }
+
+    @Override
+    public int insert(ComplaintDetectInfo record) {
+        return complaintDetectInfoMapper.insert(record);
     }
 
     @Override
-    public ComplaintDetectInfo getDetectByCustomerId(Integer customerId) {
-        return complaintDetectInfoMapper.getDetectByCustomerId(customerId);
+    public int deleteDetect(Integer detectId) {
+        return complaintDetectInfoMapper.deleteDetect(detectId);
     }
 
     @Override
-    public int insertItem(ComplaintDetectItem complaintDetectItem) {
-        return complaintDetectInfoMapper.insertItem(complaintDetectItem);
+    public List<DetectionBasis> listDetectionBasis(DetectionBasis detectionBasis) {
+        return complaintDetectInfoMapper.listDetectionBasis(detectionBasis);
     }
 
     @Override
-    public int deleteDetectItem(Integer detectItemId) {
-        return complaintDetectInfoMapper.deleteDetectItem(detectItemId);
+    public int addDetectImg(ComplaintDetectImg complaintDetectImg) {
+        return complaintDetectInfoMapper.addDetectImg(complaintDetectImg);
     }
 
     @Override
-    public List<DetectionBasis> listDetectionBasis(DetectionBasis detectionBasis) {
-        return complaintDetectInfoMapper.listDetectionBasis(detectionBasis);
+    public List<ComplaintDetectInfo> listComplaintDetect(ComplaintDetectInfo detectInfo) {
+        return complaintDetectInfoMapper.listComplaintDetect(detectInfo);
     }
+    @Transactional
+    @Override
+    public boolean customerConfirm(ComplaintDetectInfo detectInfo) {
+        ComplaintDetectInfo detect = complaintDetectInfoMapper.getDetectById(detectInfo.getDetectId());
+        /*ProcMethod procMethod = procMethodMapper.getProcMethodById(detectInfo.getProcMethodId());*/
+        switch (detectInfo.getDetectState()){
+            case 30:
+                if(detectInfo.getDetectProcessingResults() == 1){//付费维修
+                    detectInfo.setDetectState(31);//同意付费维修
+                }
+                if(detectInfo.getDetectProcessingResults() == 3 || detectInfo.getDetectProcessingResults() == 4){//退货、换货
+                    if(detect.getDetectRenovation() == 1){
+                        detectInfo.setDetectState(20);//待翻新
+                    }else{
+                        detectInfo.setDetectState(22);//待报废
+                    }
+                }
+                if(detectInfo.getDetectProcessingResults() == 5){//原机退回
+                    detectInfo.setDetectState(33);//
+                }
+                break;
+            case 34:
+                detectInfo.setDetectState(35);
+                break;
+            case 38:
+                if(detectInfo.getDetectProcessingResults() == 1){//付费维修
+                    detectInfo.setDetectState(31);//同意付费维修
+                }
+                if(detectInfo.getDetectProcessingResults() == 2){//免费维修
+                    detectInfo.setDetectState(35);//同意免费维修
+                }
+                if(detectInfo.getDetectProcessingResults() == 3 || detectInfo.getDetectProcessingResults() == 4){//退货、换货
+                    if(detect.getDetectRenovation() == 1){
+                        detectInfo.setDetectState(20);//待翻新
+                    }else{
+                        detectInfo.setDetectState(22);//待报废
+                    }
+                }
+                if(detectInfo.getDetectProcessingResults() == 5){//原机退回
+                    detectInfo.setDetectState(37);//原机退回
+                }
+                break;
+        }
+
+        try {
+            if(complaintDetectInfoMapper.updateDetectById(detectInfo) > 0){
+                if(detectInfo.getProcMethodId() != null && !"".equals(detectInfo.getProcMethodId())){
+                    CmRelation cmRelation = new CmRelation();
+                    cmRelation.setCustomerId(detectInfo.getCustomerId());
+                    cmRelation.setProcMethodId(detectInfo.getProcMethodId());
+                    if(customerInfoMapper.updateCmRelationProcMethod(cmRelation) > 0){
+                        return true;
+                    }
+                }
+             return true;
+            }
+        }catch (Exception e){
+            throw new RuntimeException("确认处理失败");
+        }
+        return false;
+    }
+
+
 }

+ 282 - 72
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintSignclosedInfoServiceImpl.java

@@ -3,9 +3,7 @@ package com.iamberry.rst.service.fm;
 
 import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.cm.*;
-import com.iamberry.rst.core.fm.AwaitingSignclosedProductInfo;
-import com.iamberry.rst.core.fm.ComplaintSignclosedInfo;
-import com.iamberry.rst.core.fm.SignclosedProductInfo;
+import com.iamberry.rst.core.fm.*;
 import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.page.PageRequest;
@@ -23,6 +21,7 @@ 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.Date;
 import java.util.List;
 import java.util.Map;
@@ -47,7 +46,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
     @Override
     @Transactional
     public boolean insert(ComplaintSignclosedInfo record,
-                          String orderItemString) {
+                          String orderItemString,String[] componentsImgs) {
         boolean msg = true;
         int num = complaintSignclosedInfoMapper.insert(record);
         if(num < 1){
@@ -62,6 +61,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
                         SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
                         //根据颜色id获取产品信息获取产品信息
                             ProductColor productColor = productMapper.getProduceColor(salesOrderItem.getItemColorId());
+                            Product product = productMapper.getProduce(productColor.getColorProductId());
                             if(productColor == null){
                                 msg = false;
                             }
@@ -73,13 +73,46 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
                             signclosedProductInfo.setSignclosedProductId(productColor.getColorProductId());
                             signclosedProductInfo.setSignclosedProductColor(salesOrderItem.getItemColorId());
                             signclosedProductInfo.setSignclosedCreateTime(new Date());
+                            signclosedProductInfo.setSignclosedState(2);
                             complaintSignclosedProductInfoMapper.insert(signclosedProductInfo);
+                            //判断是否需要生成维修记录
+                            /*if(product.getProductIsDetection() == 1){
+                                //添加待检测信息
+                                //查询签收信息
+                                ComplaintSignclosedInfo signclosedInfo = complaintSignclosedInfoMapper.getSignclosedById(record.getSignclosedId());
+                                ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+                                detectInfo.setProductId(productColor.getColorProductId());
+                                detectInfo.setProductColorId(salesOrderItem.getItemColorId());
+                                detectInfo.setDetectProductNumber(product.getProductNumber());
+                                detectInfo.setDetectState(1);
+                                detectInfo.setCustomerId(signclosedInfo.getSignclosedCustomerId());
+                                detectInfo.setIsMaintenance(0);
+                                detectInfo.setDetectRenovation(0);
+                                detectInfo.setDetectProcessingResults(0);
+                                try {
+                                    complaintDetectInfoMapper.insert(detectInfo);
+                                }catch (Exception e){
+                                    throw new RuntimeException("------------生成检测信息出错------------");
+                                }
+                            }*/
+
                             i++;
                         }
 
                     }
                 }
             }
+            //添加签收图片
+            if(componentsImgs != null) {
+                if (componentsImgs.length > 0) {
+                    for (String componentsImg : componentsImgs) {
+                        ComplaintSignclosedImg complaintSignclosedImg = new ComplaintSignclosedImg();
+                        complaintSignclosedImg.setImgUrl(componentsImg);
+                        complaintSignclosedImg.setSignclosedId(record.getSignclosedId());
+                        complaintSignclosedInfoMapper.insertImg(complaintSignclosedImg);
+                    }
+                }
+            }
         }
         //关联客诉/判断是否生成客诉信息
         try {
@@ -91,67 +124,164 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
         return msg;
     }
 
-    /*关联客诉*/
+    /**
+     * 关联客诉
+     * @param record
+     * @return
+     */
     public int addDetect(ComplaintSignclosedInfo record){
-        CustomerInfo customerInfo = new CustomerInfo();
-        if(record.getSignclosedLogisticsNumber() != null){
-            customerInfo.setSendLogisticsNo(record.getSignclosedLogisticsNumber());
-        }
-        if(record.getSignclosedCustomerId() != null){
-            customerInfo.setCustomerId(record.getSignclosedCustomerId());
-        }
-        List<CustomerInfo> listCustomer = customerInfoMapper.listCustomer(customerInfo);
-        if(listCustomer.size() > 0){
-            customerInfo = listCustomer.get(0);
-            ComplaintSignclosedInfo signclosedInfo = new ComplaintSignclosedInfo();
-            signclosedInfo.setSignclosedCustomerId(customerInfo.getCustomerId());
-            signclosedInfo.setSignclosedId(record.getSignclosedId());
-            Integer msg = complaintSignclosedInfoMapper.updateSignclosedById(signclosedInfo);
-            if(msg != 1){
-                return 0;
+            CustomerInfo customerInfo = new CustomerInfo();
+            if(record.getSignclosedLogisticsNumber() != null){
+                customerInfo.setSendLogisticsNo(record.getSignclosedLogisticsNumber());
+            }
+            if(record.getSignclosedCustomerId() != null){
+                customerInfo.setCustomerId(record.getSignclosedCustomerId());
             }
+            ComplaintSignclosedInfo sigInfo = complaintSignclosedInfoMapper.getSignclosedById(record.getSignclosedId());
+            List<CustomerInfo> listCustomer = customerInfoMapper.listCustomer(customerInfo);
+            boolean m = false;
+            if(listCustomer.size() > 0){
+                customerInfo = listCustomer.get(0);
+                ComplaintSignclosedInfo signclosedInfo = new ComplaintSignclosedInfo();
+                if(customerInfo.getSendbackInfoList().size()>0){
+                    for (SendbackInfo info : customerInfo.getSendbackInfoList()){
+                        if(info.getSendbackLogisticsNo() != null){
+                            if(info.getSendbackLogisticsNo().equals(sigInfo.getSignclosedLogisticsNumber())){
+                                m = true;
+                                //修改该寄回信息为已签收
+                                info.setSendbackStatus(3);
+                                customerInfoMapper.updateSendbackInfo(info);
+                                //同步寄回id到签收信息
+                                record.setSendbackId(info.getSendbackId());
+                                complaintSignclosedInfoMapper.updateSignclosedById(record);
+                            }
+                        }
+                    }
+                }
+                SendbackInfo info = new SendbackInfo();
+                if(!m || customerInfo.getSendbackInfoList().size() == 0){
+                    info.setSendbackStatus(3);
+                    info.setSendbackLogisticsCompany(sigInfo.getSignclosedLogistics());
+                    info.setSendbackLogisticsNo(sigInfo.getSignclosedLogisticsNumber());
+                    info.setSendbackName(sigInfo.getSignclosedSendName());
+                    info.setSendbackTel(sigInfo.getSignclosedSendTel());
+                    info.setRelationId(customerInfo.getRelationId());
+                    info.setSendbackSignTime(sigInfo.getSignclosedDate());
+                    List<SendbackItem> list = new ArrayList<>();
+                    if(customerInfoMapper.addSendbackInfo(info) > 0){
+                        //添加寄回产品项
+                        for(SignclosedProductInfo productInfo : sigInfo.getSignclosedProductInfoList()){
+                            SendbackItem sendbackItem = new SendbackItem();
+                            sendbackItem.setSendbackId(info.getSendbackId());
+                            sendbackItem.setSendbackColorId(productInfo.getSignclosedProductColor());
+                            sendbackItem.setSendbackProductId(productInfo.getSignclosedProductId());
+                            sendbackItem.setSendbackProdcueNumber(productInfo.getProductNum());
+                            list.add(sendbackItem);
+                        }
+                        customerInfoMapper.addSendbackItemList(list);
+                    }
 
-//            if(customerInfo.getIsQuality() != null){
-//                if(customerInfo.getIsQuality() == 1){//需要品检
-//                    //根据客诉id查询是否已存在品检信息
-//                    ComplaintDetectInfo complaintDetectInfo = new ComplaintDetectInfo();
-//                    if(complaintDetectInfoMapper.getDetectByCustomerId(customerInfo.getCustomerId()) == null){
-//                        complaintDetectInfo.setCustomerId(customerInfo.getCustomerId());
-//                        complaintDetectInfo.setSignclosedId(record.getSignclosedId());
-//                        complaintDetectInfo.setDetectCreateTime(new Date());
-//                        Integer msg2 = complaintDetectInfoMapper.insert(complaintDetectInfo);
-//                        if(msg2 != 1){
-//                            return 0;
-//                        }
-//                    }
-//                    //添加品检项
-//                    /*List<SignclosedProductInfo> listProductInfo = complaintSignclosedInfoMapper.listSignclosedById(record.getSignclosedId());
-//                    List<ComplaintDetectItem> listDetectItem = new ArrayList<>();
-//                    for(SignclosedProductInfo productInfo : listProductInfo){
-//                        ComplaintDetectItem detectItem = new ComplaintDetectItem();
-//                        detectItem.setDetectId(complaintDetectInfo.getDetectId());
-//                        detectItem.setDetectItemCreateTime(new Date());
-//                        detectItem.setProductId(productInfo.getProductId());
-//                        detectItem.setDetectProductNumber(productInfo.getProductNumber());
-//                        detectItem.setDetectItemState(1);
-//                        listDetectItem.add(detectItem);
-//                    }
-//                    Integer msg3 =  complaintDetectInfoMapper.insertItemList(listDetectItem);
-//                    if(msg3 != 1){
-//                        return 0;
-//                    }*/
-//                }
-//            }
+                }
+                //同步寄回id到签收信息
+                signclosedInfo.setSendbackId(info.getSendbackId());
+                signclosedInfo.setSignclosedCustomerId(customerInfo.getCustomerId());
+                signclosedInfo.setSignclosedId(record.getSignclosedId());
+                Integer msg = complaintSignclosedInfoMapper.updateSignclosedById(signclosedInfo);
 
+            if(msg == 1){
+                addDet(record.getSignclosedId());
+                //判断是否需要生成维修记录
+                /*if(sigInfo.getSignclosedProductInfoList().size() > 0){
+                    for(SignclosedProductInfo productInfo : sigInfo.getSignclosedProductInfoList()){
+                        ProductColor productColor = productMapper.getProduceColor(productInfo.getSignclosedProductColor());
+                        Product product = productMapper.getProduce(productColor.getColorProductId());
+                        if(product.getProductIsDetection() == 1){
+                            for (int j = 0;j<productInfo.getProductNum();j++){
+                                //添加待检测信息
+                                //查询签收信息
+                                ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+                                detectInfo.setProductId(productColor.getColorProductId());
+                                detectInfo.setProductColorId(productInfo.getSignclosedProductColor());
+                                detectInfo.setDetectProductNumber(product.getProductNumber());
+                                detectInfo.setDetectState(1);
+                                detectInfo.setCustomerId(signclosedInfo.getSignclosedCustomerId());
+                                detectInfo.setIsMaintenance(0);
+                                detectInfo.setDetectRenovation(0);
+                                detectInfo.setDetectProcessingResults(0);
+                                try {
+                                    complaintDetectInfoMapper.insert(detectInfo);
+                                }catch (Exception e){
+                                    throw new RuntimeException("------------生成检测信息出错------------");
+                                }
+                            }
+                        }
+
+                    }
+
+                }*/
+
+            }
         }
         return 1;
     }
 
+    public void addDet(Integer signclosedId){
+        ComplaintSignclosedInfo sigInfo = complaintSignclosedInfoMapper.getSignclosedById(signclosedId);
+        //判断是否需要生成维修记录
+        if(sigInfo.getSignclosedProductInfoList().size() > 0) {
+            for (SignclosedProductInfo productInfo : sigInfo.getSignclosedProductInfoList()) {
+                ProductColor productColor = productMapper.getProduceColor(productInfo.getSignclosedProductColor());
+                Product product = productMapper.getProduce(productColor.getColorProductId());
+                if (product.getProductIsDetection() == 1) {
+                    for (int j = 0; j < productInfo.getProductNum(); j++) {
+                        //添加待检测信息
+                        //查询签收信息
+                        ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+                        detectInfo.setProductId(productColor.getColorProductId());
+                        detectInfo.setProductColorId(productInfo.getSignclosedProductColor());
+                        detectInfo.setDetectProductNumber(product.getProductNumber());
+                        detectInfo.setDetectState(1);
+                        detectInfo.setCustomerId(sigInfo.getSignclosedCustomerId());
+                        detectInfo.setIsMaintenance(0);
+                        detectInfo.setDetectRenovation(0);
+                        detectInfo.setDetectProcessingResults(0);
+                        try {
+                            complaintDetectInfoMapper.insert(detectInfo);
+                        } catch (Exception e) {
+                            throw new RuntimeException("------------生成检测信息出错------------");
+                        }
+                    }
+                }
+
+            }
+        }
+    }
+
     @Override
     public List<SignclosedProductInfo> listSignclosedById(Integer signclosedId) {
         return complaintSignclosedInfoMapper.listSignclosedById(signclosedId);
     }
 
+    @Override
+    public Integer insertImg(ComplaintSignclosedImg complaintSignclosedImg) {
+        return complaintSignclosedInfoMapper.insertImg(complaintSignclosedImg);
+    }
+
+    @Override
+    public List<ComplaintSignclosedImg> listSignclosedImgById(Integer signclosedId) {
+        return complaintSignclosedInfoMapper.listSignclosedImgById(signclosedId);
+    }
+
+    @Override
+    public Integer delSignclosedImg(Integer signclosedId) {
+        return complaintSignclosedInfoMapper.delSignclosedImg(signclosedId);
+    }
+
+    @Override
+    public Integer delSignclosedBySendbackId(Integer sendbackId) {
+        return complaintSignclosedInfoMapper.delSignclosedBySendbackId(sendbackId);
+    }
+
     private Integer addSifnclosed(Map<String,Integer> Map,Integer signclosedId) {
         Integer msg = 0;
         for (Map.Entry<String, Integer> entry : Map.entrySet()) {
@@ -212,29 +342,104 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
 
                 }
             }
-//            if(alreadyFittingsMap != null || alreadyFittingsMap.size() != 0){
-//                for (Map.Entry<String,Integer> entry : alreadyFittingsMap.entrySet()) {
-//                    SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
-//                    //根据配件id获取配件信息
-//                    FittingsInfo fittingsInfo = fittingsInfoMapper.getFittingsById(Integer.valueOf(entry.getKey()));
-//                    if(fittingsInfo == null){
-//                        return false;
-//                    }
-//                    for (int j = 0;j<entry.getValue();j++){
-//                        signclosedProductInfo.setSignclosedId(record.getSignclosedId());
-//                        signclosedProductInfo.setProductName(fittingsInfo.getFittingsName());
-//                        signclosedProductInfo.setProductNum(1);
-//                        signclosedProductInfo.setSignclosedProductType(2);
-//                        signclosedProductInfo.setSignclosedProductId(fittingsInfo.getFittingsId());
-//                        signclosedProductInfo.setSignclosedProductColor(null);
-//                        signclosedProductInfo.setSignclosedCreateTime(new Date());
-//                        complaintSignclosedProductInfoMapper.insert(signclosedProductInfo);
-//                    }
-//                }
-//            }
         }
         return msg;
     }
+    @Transactional
+    @Override
+    public boolean updateSignclosedById(ComplaintSignclosedInfo record, String orderItemString, String[] componentsImgs) {
+        boolean msg = true;
+        int num = complaintSignclosedInfoMapper.updateSignclosedById(record);
+        if(num < 1){
+            msg = false;
+        }else{
+            //删除待收货产品
+            complaintSignclosedProductInfoMapper.delSignclosedProduct(record.getSignclosedId());
+            //删除签收图片
+            complaintSignclosedInfoMapper.delSignclosedImg(record.getSignclosedId());
+            if(orderItemString != null){
+                JSONArray jsonArray = JSONArray.fromObject(orderItemString);
+                List<SalesOrderItem> salesOrderItemList = (List) JSONArray.toCollection(jsonArray, SalesOrderItem.class);
+                for (SalesOrderItem salesOrderItem:salesOrderItemList) {
+                    if(salesOrderItem.getItemNum() > 0 && salesOrderItem.getItemColorId() > 0){
+                        int i = 0;
+                        SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
+                        //根据颜色id获取产品信息获取产品信息
+                        ProductColor productColor = productMapper.getProduceColor(salesOrderItem.getItemColorId());
+                        Product product = productMapper.getProduce(productColor.getColorProductId());
+                        if(productColor == null){
+                            msg = false;
+                        }
+                        for (int j = 0;j<salesOrderItem.getItemNum();j++){
+                            signclosedProductInfo.setSignclosedId(record.getSignclosedId());
+                            signclosedProductInfo.setProductName(productColor.getProductName());
+                            signclosedProductInfo.setProductNum(1);
+                            signclosedProductInfo.setSignclosedProductType(1);
+                            signclosedProductInfo.setSignclosedProductId(productColor.getColorProductId());
+                            signclosedProductInfo.setSignclosedProductColor(salesOrderItem.getItemColorId());
+                            signclosedProductInfo.setSignclosedCreateTime(new Date());
+                            signclosedProductInfo.setSignclosedState(2);
+                            try {
+                                complaintSignclosedProductInfoMapper.insert(signclosedProductInfo);
+                            }catch (Exception e){
+                                    throw new RuntimeException("------------生成签收产品出错------------");
+                            }
+                            /*//判断是否需要生成维修记录
+                            if(product.getProductIsDetection() == 1){
+                                //添加待检测信息
+                                //查询签收信息
+
+                                ComplaintSignclosedInfo signclosedInfo = complaintSignclosedInfoMapper.getSignclosedById(record.getSignclosedId());
+                                ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+                                detectInfo.setProductId(productColor.getColorProductId());
+                                detectInfo.setProductColorId(salesOrderItem.getItemColorId());
+                                detectInfo.setDetectProductNumber(product.getProductNumber());
+                                detectInfo.setDetectState(1);
+                                detectInfo.setCustomerId(signclosedInfo.getSignclosedCustomerId());
+                                detectInfo.setIsMaintenance(0);
+                                detectInfo.setDetectRenovation(0);
+                                detectInfo.setDetectProcessingResults(0);
+                                try {
+                                    complaintDetectInfoMapper.insert(detectInfo);
+                                }catch (Exception e){
+                                    throw new RuntimeException("------------生成检测信息出错------------");
+                                }
+                            }*/
+                            i++;
+                        }
+                    }
+                }
+            }
+            //添加签收图片
+            if(componentsImgs != null){
+                if(componentsImgs.length > 0){
+                    for(String componentsImg : componentsImgs){
+                        ComplaintSignclosedImg complaintSignclosedImg = new ComplaintSignclosedImg();
+                        complaintSignclosedImg.setImgUrl(componentsImg);
+                        complaintSignclosedImg.setSignclosedId(record.getSignclosedId());
+                        complaintSignclosedInfoMapper.insertImg(complaintSignclosedImg);
+                    }
+                }
+            }
+
+            //同步客诉寄回状态和物流信息
+            ComplaintSignclosedInfo signclosedInfo = complaintSignclosedInfoMapper.getSignclosedById(record.getSignclosedId());
+            SendbackInfo sendbackInfo = new SendbackInfo();
+            sendbackInfo.setSendbackId(signclosedInfo.getSendbackId());
+            sendbackInfo.setSendbackStatus(3);
+            sendbackInfo.setSendbackLogisticsCompany(signclosedInfo.getSignclosedLogistics());
+            sendbackInfo.setSendbackLogisticsNo(signclosedInfo.getSignclosedLogisticsNumber());
+            customerInfoMapper.updateSendbackInfo(sendbackInfo);
+        }
+        //关联客诉/判断是否生成客诉信息
+        try {
+            addDet(record.getSignclosedId());
+        }catch (Exception e){
+            throw new RuntimeException("------------关联客诉出错------------");
+        }
+
+        return msg;
+    }
 
     @Override
     public Integer updateSignclosedById(ComplaintSignclosedInfo record) {
@@ -254,4 +459,9 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
 
     }
 
+    @Override
+    public List<ComplaintSignclosedInfo> listSignclosed(ComplaintSignclosedInfo complaintSignclosedInfo) {
+        return complaintSignclosedInfoMapper.listSignclosed(complaintSignclosedInfo);
+    }
+
 }

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintSignclosedProductInfoServiceImpl.java

@@ -39,4 +39,9 @@ public class ComplaintSignclosedProductInfoServiceImpl implements ComplaintSignc
     public SignclosedProductInfo listSignclosedProductInfoById(Integer productid) {
         return complaintSignclosedProductInfoMapper.listSignclosedProductInfoById(productid);
     }
+
+    @Override
+    public Integer delSignclosedProduct(Integer signclosedId) {
+        return complaintSignclosedProductInfoMapper.delSignclosedProduct(signclosedId);
+    }
 }

+ 13 - 24
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/ComplaintDetectInfoMapper.java

@@ -1,7 +1,7 @@
 package com.iamberry.rst.service.fm.mapper;
 
+import com.iamberry.rst.core.fm.ComplaintDetectImg;
 import com.iamberry.rst.core.fm.ComplaintDetectInfo;
-import com.iamberry.rst.core.fm.ComplaintDetectItem;
 import com.iamberry.rst.core.fm.DetectionBasis;
 
 import java.util.List;
@@ -10,56 +10,45 @@ import java.util.List;
  * 客诉-品质检测产品mapper
  */
 public interface ComplaintDetectInfoMapper {
-    /**
-     * 添加单个品质检测产品
-     * @return
-     */
-    int insert(ComplaintDetectInfo record);
-
-    /**
-     * 批量添加品检项
-     * @return
-     */
-    int insertItemList(List<ComplaintDetectItem> detectItemList);
 
     /**
      * 查询单个品质检测产品
      * @return
      */
-    ComplaintDetectItem getDetectItemById(Integer detectId);
+    ComplaintDetectInfo getDetectById(Integer detectId);
     /**
-     * 修改单个待品质检测产品
+     * 修改单个待品质检测
      * @return
      */
-    int updateDetectItemById(ComplaintDetectItem record);
+    int updateDetectById(ComplaintDetectInfo record);
 
     /**
      * 获取品质检测项列表
      * @return
      */
-    List<ComplaintDetectItem> listComplaintDetectItem(ComplaintDetectItem item);
+    List<ComplaintDetectInfo> listComplaintDetect(ComplaintDetectInfo item);
 
     /**
-     * 根据客诉id、查询品检信息
+     * 添加品检
      * @return
      */
-    ComplaintDetectInfo getDetectByCustomerId(Integer customerId);
+    int insert(ComplaintDetectInfo complaintDetectInfo);
 
     /**
-     * 添加品检项
+     * 删除品检项
      * @return
      */
-    int insertItem(ComplaintDetectItem complaintDetectItem);
+    int deleteDetect(Integer detectId);
 
     /**
-     * 删除品检项
+     * 查询检测内容
      * @return
      */
-    int deleteDetectItem(Integer detectItemId);
+    List<DetectionBasis> listDetectionBasis(DetectionBasis detectionBasis);
 
     /**
-     * 查询检测内容
+     * 添加检测图片
      * @return
      */
-    List<DetectionBasis> listDetectionBasis(DetectionBasis detectionBasis);
+    int addDetectImg(ComplaintDetectImg complaintDetectImg);
 }

+ 21 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/ComplaintSignclosedInfoMapper.java

@@ -1,5 +1,6 @@
 package com.iamberry.rst.service.fm.mapper;
 
+import com.iamberry.rst.core.fm.ComplaintSignclosedImg;
 import com.iamberry.rst.core.fm.ComplaintSignclosedInfo;
 import com.iamberry.rst.core.fm.SignclosedProductInfo;
 
@@ -40,4 +41,24 @@ public interface ComplaintSignclosedInfoMapper {
      * @return
      */
     List<SignclosedProductInfo> listSignclosedById(Integer signclosedId);
+    /**
+     * 添加产品图片
+     * @return
+     */
+    Integer insertImg(ComplaintSignclosedImg complaintSignclosedImg);
+    /**
+     * 查询产品图片
+     * @return
+     */
+    List<ComplaintSignclosedImg> listSignclosedImgById(Integer signclosedId);
+    /**
+     * 删除产品图片
+     * @return
+     */
+    Integer delSignclosedImg(Integer signclosedId);
+    /**
+     * 删除签收信息
+     * @return
+     */
+    Integer delSignclosedBySendbackId(Integer sendbackId);
 }

+ 7 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/ComplaintSignclosedProductInfoMapper.java

@@ -45,4 +45,11 @@ public interface ComplaintSignclosedProductInfoMapper {
      * @return
      */
     SignclosedProductInfo listSignclosedProductInfoById(Integer productid);
+
+
+    /**
+     * 删除签收产品
+     * @return
+     */
+    Integer delSignclosedProduct(Integer signclosedId);
 }

+ 145 - 196
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/complaintDetectInfoMapper.xml

@@ -1,81 +1,73 @@
 <?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.fm.mapper.ComplaintDetectInfoMapper" >
-  <resultMap id="BaseResultMap" type="ComplaintDetectInfo" >
-  <id column="detect_id" property="detectId" jdbcType="INTEGER" />
-  <result column="customer_id" property="customerId" jdbcType="INTEGER" />
-  <result column="signclosed_id" property="signclosedId" jdbcType="INTEGER" />
-  <result column="detect_desc" property="detectDesc" jdbcType="VARCHAR" />
-  <result column="detect_create_time" property="detectCreateTime" jdbcType="TIMESTAMP" />
-  <result column="detect_update_time" property="detectUpdateTime" jdbcType="TIMESTAMP" />
-</resultMap>
-  <sql id="Base_Column_List" >
-    detect_id, customer_id,signclosed_id,detect_desc,
-    detect_create_time, detect_update_time
-  </sql>
-  <select id="getDetectItemById" resultType="ComplaintDetectItem" parameterType="java.lang.Integer" >
-    select 
-      detect_item_id detectItemId,
+
+  <select id="getDetectById" resultType="ComplaintDetectInfo" parameterType="java.lang.Integer" >
+    select
       detect_id detectId,
       product_id productId,
+      product_color_id productColorId,
       detect_product_number detectProductNumber,
-      detect_item_state detectItemState,
+      detect_state detectState,
       customer_id customerId,
-      detect_item_phenomenon detectItemPhenomenon,
-      detect_item_classification detectItemClassification,
-      detect_item_failure_cause detectItemFailureCause,
-      detect_item_results detectItemResults,
-      detect_item_point detectItemPoint,
-      detect_item_nalysis detectItemNalysis,
-      detect_item_content detectItemContent,
+      detect_phenomenon detectPhenomenon,
+      detect_classification detectClassification,
+      detect_failure_cause detectFailureCause,
+      detect_results detectResults,
+      detect_point detectPoint,
+      detect_nalysis detectNalysis,
+      detect_content detectContent,
       customer_id customerId,
       is_maintenance isMaintenance,
-      maintenance_results maintenanceResults,
-      detect_item_desc detectItemDesc,
-      detect_item_date detectItemDate,
-      detect_item_create_time detectItemCreateTime,
-      detect_item_update_time detectItemUpdateTime
-    from tb_rst_complaint_detect_item
-    where detect_item_id = #{detectItemId,jdbcType=INTEGER}
-  </select>
-
-  <select id="getDetectByCustomerId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
-    select
-    <include refid="Base_Column_List" />
+      detect_desc detectDesc,
+      detect_date detectDate,
+      detect_create_time detectCreateTime,
+      detect_update_time detectUpdateTime,
+      detect_offer detectOffer,
+      detect_renovation detectRenovation,
+      detect_processing_results detectProcessingResults
     from tb_rst_complaint_detect
-    where customer_id = #{customerId,jdbcType=INTEGER}
+    where detect_id = #{detectId,jdbcType=INTEGER}
   </select>
-  <select id="listComplaintDetectItem" resultType="ComplaintDetectItem" parameterType="ComplaintDetectItem" >
+  <select id="listComplaintDetect" resultType="ComplaintDetectInfo" parameterType="ComplaintDetectInfo" >
     select
-    cd.detect_item_id detectItemId,
     cd.detect_id detectId,
     cd.product_id productId,
+    cd.product_color_id productColorId,
     cd.detect_product_number detectProductNumber,
-    cd.detect_item_state detectItemState,
+    cd.detect_state detectState,
     cd.customer_id customerId,
-    cd.detect_item_phenomenon detectItemPhenomenon,
-    cd.detect_item_classification detectItemClassification,
-    cd.detect_item_failure_cause detectItemFailureCause,
-    cd.detect_item_results detectItemResults,
-    cd.detect_item_point detectItemPoint,
-    cd.detect_item_nalysis detectItemNalysis,
-    cd.detect_item_content detectItemContent,
+    cd.detect_phenomenon detectPhenomenon,
+    cd.detect_classification detectClassification,
+    cd.detect_failure_cause detectFailureCause,
+    cd.detect_results detectResults,
+    cd.detect_point detectPoint,
+    cd.detect_nalysis detectNalysis,
+    cd.detect_content detectContent,
     cd.customer_id customerId,
     cd.is_maintenance isMaintenance,
-    cd.maintenance_results maintenanceResults,
-    cd.detect_item_desc detectItemDesc,
-    cd.detect_item_date detectItemDate,
-    cd.detect_item_create_time detectItemCreateTime,
-    cd.detect_item_update_time detectItemUpdateTime,
+    cd.detect_desc detectDesc,
+    cd.detect_date detectDate,
+    cd.detect_create_time detectCreateTime,
+    cd.detect_update_time detectUpdateTime,
+    cd.detect_offer detectOffer,
+    cd.detect_renovation detectRenovation,
+    cd.detect_processing_results detectProcessingResults,
+    cd.detect_customer_desc detectCustomerDesc,
     qd.describe_title questionTitle,
     pi.product_name productName,
     pt.type_name productTypeName,
-    ci.color_name colorName
-    from tb_rst_complaint_detect_item cd
+    ci.color_name colorName,
+    cpm.proc_method_name procMethodName,
+    cpt.proc_type_name procTypeName
+    from tb_rst_complaint_detect cd
     LEFT JOIN tb_rst_product_info pi ON cd.product_id = pi.product_id
     LEFT JOIN tb_rst_cm_question_describe qd on cd.customer_id = qd.customer_id
     LEFT JOIN tb_rst_product_type pt on pi.product_type = pt.type_id
     LEFT JOIN tb_rst_product_color ci on cd.product_color_id = ci.color_id
+    LEFT JOIN tb_rst_cm_relation cr ON cd.customer_id = cr.customer_id
+    LEFT JOIN tb_rst_cm_proc_method cpm ON cr.proc_method_id = cpm.proc_method_id
+    LEFT JOIN tb_rst_cm_proc_type cpt ON cpm.proc_type_id = cpt.proc_type_id
     <where>
       <if test="productTypeId != null" >
         AND pt.type_id = #{productTypeId,jdbcType=INTEGER}
@@ -89,200 +81,153 @@
       <if test="productColorId != null" >
         AND cd.product_color_id = #{productColorId}
       </if>
-      <if test="detectItemPhenomenon != null and detectItemPhenomenon != ''" >
-        AND cd.detect_item_phenomenon = #{detectItemPhenomenon}
+      <if test="detectPhenomenon != null and detectPhenomenon != ''" >
+        AND cd.detect_phenomenon = #{detectPhenomenon}
       </if>
-      <if test="detectItemClassification != null and detectItemClassification != ''" >
-        AND cd.detect_item_classification = #{detectItemClassification}
+      <if test="detectClassification != null and detectClassification != ''" >
+        AND cd.detect_classification = #{detectClassification}
       </if>
-      <if test="detectItemFailureCause != null and detectItemFailureCause != ''" >
-        AND cd.detect_item_failure_cause = #{detectItemFailureCause}
+      <if test="detectFailureCause != null and detectFailureCause != ''" >
+        AND cd.detect_failure_cause = #{detectFailureCause}
       </if>
-      <if test="detectItemResults != null and detectItemResults != ''" >
-        AND cd.detect_item_results = #{detectItemResults}
+      <if test="detectResults != null and detectResults != ''" >
+        AND cd.detect_results = #{detectResults}
       </if>
-      <if test="detectItemPoint != null and detectItemPoint != ''" >
-        AND cd.detect_item_point = #{detectItemPoint}
+      <if test="detectPoint != null and detectPoint != ''" >
+        AND cd.detect_point = #{detectPoint}
       </if>
-      <if test="detectItemNalysis != null and detectItemNalysis != ''" >
-        AND cd.detect_item_nalysis = #{detectItemNalysis}
+      <if test="detectNalysis != null and detectNalysis != ''" >
+        AND cd.detect_nalysis = #{detectNalysis}
       </if>
-      <if test="detectItemContent != null and detectItemContent != ''" >
-        AND cd.detect_item_content = #{detectItemContent}
+      <if test="detectContent != null and detectContent != ''" >
+        AND cd.detect_content = #{detectContent}
       </if>
       <if test="isMaintenance != null and isMaintenance != ''" >
         AND cd.is_maintenance = #{isMaintenance}
       </if>
-      <if test="maintenanceResults != null and maintenanceResults != ''" >
-        AND cd.maintenance_results = #{maintenanceResults}
+      <if test="detectOffer != null and detectOffer != ''" >
+        AND cd.detect_offer = #{detectOffer}
+      </if>
+      <if test="detectRenovation != null and detectRenovation != ''" >
+        AND cd.detect_renovation = #{detectRenovation}
+      </if>
+      <if test="detectProcessingResults != null and detectProcessingResults != ''" >
+        AND cd.detect_processing_results = #{detectProcessingResults}
       </if>
     </where>
-      ORDER BY cd.detect_item_create_time DESC
+      ORDER BY cd.detect_create_time DESC
   </select>
-  <insert id="insert" parameterType="ComplaintDetectInfo"  useGeneratedKeys="true" keyProperty="detectId" >
-    insert into tb_rst_complaint_detect (
-      customer_id,
-      signclosed_id,
-      detect_desc,
-      detect_create_time
-      )
-    values (
-      #{customerId,jdbcType=INTEGER},
-      #{signclosedId,jdbcType=INTEGER},
-      #{detectDesc,jdbcType=VARCHAR},
-      #{detectCreateTime,jdbcType=TIMESTAMP}
-      )
-  </insert>
 
-  <update id="updateDetectItemById" parameterType="ComplaintDetectItem" >
-    update tb_rst_complaint_detect_item
+  <update id="updateDetectById" parameterType="ComplaintDetectInfo" >
+    update tb_rst_complaint_detect
     <set >
       <if test="customerId != null" >
         customer_id = #{customerId,jdbcType=INTEGER},
       </if>
-      <if test="detectItemState != null" >
-        detect_item_state = #{detectItemState,jdbcType=INTEGER},
+      <if test="detectState != null" >
+        detect_state = #{detectState,jdbcType=INTEGER},
       </if>
-      <if test="detectItemPhenomenon != null" >
-        detect_item_phenomenon = #{detectItemPhenomenon,jdbcType=VARCHAR},
+      <if test="detectPhenomenon != null" >
+        detect_phenomenon = #{detectPhenomenon,jdbcType=VARCHAR},
       </if>
-      <if test="detectItemClassification != null" >
-        detect_item_classification = #{detectItemClassification,jdbcType=VARCHAR},
+      <if test="detectClassification != null" >
+        detect_classification = #{detectClassification,jdbcType=VARCHAR},
       </if>
-      <if test="detectItemFailureCause != null" >
-        detect_item_failure_cause = #{detectItemFailureCause,jdbcType=VARCHAR},
+      <if test="detectFailureCause != null" >
+        detect_failure_cause = #{detectFailureCause,jdbcType=VARCHAR},
       </if>
-      <if test="detectItemResults != null" >
-        detect_item_results = #{detectItemResults,jdbcType=VARCHAR},
+      <if test="detectResults != null" >
+        detect_results = #{detectResults,jdbcType=VARCHAR},
       </if>
-      <if test="detectItemPoint != null" >
-        detect_item_point = #{detectItemPoint,jdbcType=VARCHAR},
+      <if test="detectPoint != null" >
+        detect_point = #{detectPoint,jdbcType=VARCHAR},
       </if>
-      <if test="detectItemNalysis != null" >
-        detect_item_nalysis = #{detectItemNalysis,jdbcType=VARCHAR},
+      <if test="detectNalysis != null" >
+        detect_nalysis = #{detectNalysis,jdbcType=VARCHAR},
       </if>
-      <if test="detectItemContent != null" >
-        detect_item_content = #{detectItemContent,jdbcType=VARCHAR},
+      <if test="detectContent != null" >
+        detect_content = #{detectContent,jdbcType=VARCHAR},
       </if>
       <if test="isMaintenance != null" >
         is_maintenance = #{isMaintenance,jdbcType=INTEGER},
       </if>
-      <if test="maintenanceResults != null" >
-        maintenance_results = #{maintenanceResults,jdbcType=INTEGER},
+      <if test="detectDesc != null" >
+        detect_desc = #{detectDesc,jdbcType=INTEGER},
       </if>
-      <if test="detectItemDesc != null" >
-        detect_item_desc = #{detectItemDesc,jdbcType=INTEGER},
+      <if test="detectDate != null" >
+        detect_date = #{detectDate,jdbcType=INTEGER},
       </if>
-      <if test="detectItemDate != null" >
-        detect_item_date = #{detectItemDate,jdbcType=INTEGER},
+      <if test="detectUpdateTime != null" >
+        detect_update_time = #{detectUpdateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="detectItemUpdateTime != null" >
-        detect_item_update_time = #{detectItemUpdateTime,jdbcType=TIMESTAMP}
+      <if test="detectOffer != null" >
+        detect_offer = #{detectOffer,jdbcType=TIMESTAMP},
       </if>
-    </set>
-    <where>
-      <if test="detectItemId != null and detectItemId != ''" >
-        AND detect_item_id = #{detectItemId,jdbcType=INTEGER}
+      <if test="detectRenovation != null" >
+        detect_renovation = #{detectRenovation,jdbcType=TIMESTAMP},
       </if>
-    </where>
+      <if test="detectProcessingResults != null" >
+        detect_processing_results = #{detectProcessingResults,jdbcType=TIMESTAMP},
+      </if>
+      <if test="detectCustomerDesc != null" >
+        detect_customer_desc = #{detectCustomerDesc,jdbcType=VARCHAR}
+      </if>
+    </set>
+    where
+        detect_id = #{detectId,jdbcType=INTEGER}
   </update>
 
-  <insert id="insertItemList" parameterType="java.util.List" >
-    insert into tb_rst_complaint_detect_item
+  <insert id="insert" parameterType="ComplaintDetectInfo"   useGeneratedKeys="true" keyProperty="detectId">
+    insert into tb_rst_complaint_detect
     (
-    detect_id,
-    product_id,
-    machine_no,
-    detect_product_number,
-    detect_item_state,
-    detect_item_phenomenon,
-    detect_item_classification,
-    detect_item_failure_cause,
-    detect_item_results,
-    detect_item_point,
-    detect_item_nalysis,
-    detect_item_content,
-    is_maintenance,
-    maintenance_results,
-    detect_item_desc,
-    detect_item_date,
-    detect_item_create_time,
-    product_color_id
-    )
-    values
-    <foreach collection="list" item="node" index="index" separator="," open="" close="">
-      (
-      #{node.detectId},
-      #{node.productId},
-      #{node.machineNo},
-      #{node.detectProductNumber},
-      #{node.detectItemState},
-      #{node.detectItemPhenomenon},
-      #{node.detectItemClassification},
-      #{node.detectItemFailureCause},
-      #{node.detectItemResults},
-      #{node.detectItemPoint},
-      #{node.detectItemNalysis},
-      #{node.detectItemContent},
-      #{node.isMaintenance},
-      #{node.maintenanceResults},
-      #{node.detectItemDesc},
-      #{node.detectItemDate},
-      #{node.detectItemCreateTime},
-      #{node.productColorId}
-      )
-    </foreach>
-  </insert>
-
-  <insert id="insertItem" parameterType="ComplaintDetectItem"   useGeneratedKeys="true" keyProperty="detectItemId">
-    insert into tb_rst_complaint_detect_item
-    (
-    detect_id,
     product_id,
+    product_color_id,
     machine_no,
     detect_product_number,
-    detect_item_state,
-    detect_item_phenomenon,
-    detect_item_classification,
-    detect_item_failure_cause,
-    detect_item_results,
-    detect_item_point,
-    detect_item_nalysis,
-    detect_item_content,
+    detect_state,
+    detect_phenomenon,
+    detect_classification,
+    detect_failure_cause,
+    detect_results,
+    detect_point,
+    detect_nalysis,
+    detect_content,
     is_maintenance,
-    maintenance_results,
-    detect_item_desc,
-    detect_item_date,
-    detect_item_create_time,
-    product_color_id,
-    customer_id
+    detect_desc,
+    detect_date,
+    detect_create_time,
+    customer_id,
+    detect_offer,
+    detect_renovation,
+    detect_processing_results
     )
     values
       (
-      #{detectId},
       #{productId},
+      #{productColorId},
       #{machineNo},
       #{detectProductNumber},
-      #{detectItemState},
-      #{detectItemPhenomenon},
-      #{detectItemClassification},
-      #{detectItemFailureCause},
-      #{detectItemResults},
-      #{detectItemPoint},
-      #{detectItemNalysis},
-      #{detectItemContent},
+      #{detectState},
+      #{detectPhenomenon},
+      #{detectClassification},
+      #{detectFailureCause},
+      #{detectResults},
+      #{detectPoint},
+      #{detectNalysis},
+      #{detectContent},
       #{isMaintenance},
-      #{maintenanceResults},
-      #{detectItemDesc},
-      #{detectItemDate},
-      #{detectItemCreateTime},
-      #{productColorId},
-      #{customerId}
+      #{detectDesc},
+      #{detectDate},
+      #{detectCreateTime},
+      #{customerId},
+      #{detectOffer},
+      #{detectRenovation},
+      #{detectProcessingResults}
       )
   </insert>
 
-  <delete id="deleteDetectItem" parameterType="Integer">
-    DELETE FROM tb_rst_complaint_detect_item WHERE detect_item_id = #{detectItemId}
+  <delete id="deleteDetect" parameterType="Integer">
+    DELETE FROM tb_rst_complaint_detect WHERE detect_id = #{detectId}
   </delete>
 
   <select id="listDetectionBasis" parameterType="DetectionBasis" resultType="DetectionBasis">
@@ -299,4 +244,8 @@
       </if>
     </where>
   </select>
+
+  <insert id="addDetectImg" parameterType="ComplaintDetectImg" >
+    INSERT INTO tb_rst_complaint_detect_img( detect_id,detect_img_url) VALUES (#{detectId},#{detectImgUrl})
+  </insert>
 </mapper>

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

@@ -3,42 +3,46 @@
 <mapper namespace="com.iamberry.rst.service.fm.mapper.ComplaintSignclosedInfoMapper" >
   <resultMap id="BaseResultMap" type="ComplaintSignclosedInfo" >
     <id column="signclosed_id" property="signclosedId" jdbcType="INTEGER" />
-    <result column="signclosed_type" property="signclosedType" jdbcType="BIT" />
-    <result column="signclosed_type_name" property="signclosedTypeName" jdbcType="VARCHAR" />
     <result column="signclosed_logistics" property="signclosedLogistics" jdbcType="VARCHAR" />
     <result column="signclosed_logistics_number" property="signclosedLogisticsNumber" jdbcType="VARCHAR" />
     <result column="signclosed_send_name" property="signclosedSendName" jdbcType="VARCHAR" />
     <result column="signclosed_send_tel" property="signclosedSendTel" jdbcType="VARCHAR" />
     <result column="signclosed_addr_provinces" property="signclosedAddrProvinces" jdbcType="VARCHAR" />
     <result column="signclosed_addr_city" property="signclosedAddrCity" jdbcType="VARCHAR" />
-    <result column="signclosed_addr_area" property="signclosedAddrCity" jdbcType="VARCHAR" />
+    <result column="signclosed_addr_area" property="signclosedAddrArea" jdbcType="VARCHAR" />
     <result column="signclosed_date" property="signclosedDate" jdbcType="DATE" />
     <result column="signclosed_customer_id" property="signclosedCustomerId" jdbcType="INTEGER" />
     <result column="signclosed_desc" property="signclosedDesc" jdbcType="VARCHAR" />
     <result column="signclosed_create_time" property="signclosedCreateTime" jdbcType="TIMESTAMP" />
     <result column="signclosed_update_time" property="signclosedUpdateTime" jdbcType="TIMESTAMP" />
-    <result column="signclosed_state" property="signclosedState" jdbcType="INTEGER" />
     <result column="signclosed_customer_desc" property="signclosedCustomerDesc" jdbcType="VARCHAR" />
+    <collection property="signclosedProductInfoList" column="signclosed_id" ofType="SignclosedProductInfo" select="listSignclosedById"/>
+    <collection property="signclosedImgInfoList" column="signclosed_id" ofType="ComplaintSignclosedImg" select="listSignclosedImgById"/>
   </resultMap>
   <sql id="Base_Column_List" >
-    signclosed_id, signclosed_type, signclosed_type_name, signclosed_logistics,
+    signclosed_id, signclosed_logistics,
     signclosed_logistics_number, signclosed_send_name, signclosed_send_tel, signclosed_addr_provinces, 
     signclosed_addr_city,signclosed_addr_area, signclosed_date,signclosed_customer_id,signclosed_desc,
-    signclosed_create_time, signclosed_update_time,signclosed_state,signclosed_customer_desc
+    signclosed_create_time, signclosed_update_time,signclosed_customer_desc,sendback_id
   </sql>
   <select id="getSignclosedById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select
     <include refid="Base_Column_List" />,
-    tb_rst_cm_question_describe.describe_handle_desc describeHandleDesc
+    tb_rst_cm_question_describe.describe_handle_desc describeHandleDesc,
+    ap.province signclosedAddrProvincesName,
+    ac.city signclosedAddrCityName,
+    ad.district signclosedAddrAreaName
     from tb_rst_complaint_signclosed
     LEFT JOIN tb_rst_cm_question_describe on tb_rst_cm_question_describe.customer_id = tb_rst_complaint_signclosed.signclosed_customer_id
+    LEFT JOIN tb_rst_address_province ap ON tb_rst_complaint_signclosed.signclosed_addr_provinces = ap.province_id
+    LEFT JOIN tb_rst_address_city ac ON tb_rst_complaint_signclosed.signclosed_addr_city = ac.city_id
+    LEFT JOIN tb_rst_address_district ad on ad.district_id = tb_rst_complaint_signclosed.signclosed_addr_area
     where signclosed_id = #{signclosedId,jdbcType=INTEGER}
   </select>
 
   <resultMap id="complaintSignclosedInfoMap" type="ComplaintSignclosedInfo">
     <id column="signclosed_id" property="signclosedId" jdbcType="INTEGER" />
-    <result column="signclosed_type" property="signclosedType" jdbcType="BIT" />
-    <result column="signclosed_type_name" property="signclosedTypeName" jdbcType="VARCHAR" />
+
     <result column="signclosed_logistics" property="signclosedLogistics" jdbcType="VARCHAR" />
     <result column="signclosed_logistics_number" property="signclosedLogisticsNumber" jdbcType="VARCHAR" />
     <result column="signclosed_send_name" property="signclosedSendName" jdbcType="VARCHAR" />
@@ -51,11 +55,12 @@
     <result column="signclosed_desc" property="signclosedDesc" jdbcType="VARCHAR" />
     <result column="signclosed_create_time" property="signclosedCreateTime" jdbcType="TIMESTAMP" />
     <result column="signclosed_update_time" property="signclosedUpdateTime" jdbcType="TIMESTAMP" />
-    <result column="signclosed_state" property="signclosedState" jdbcType="INTEGER" />
     <result column="signclosed_customer_desc" property="signclosedCustomerDesc" jdbcType="VARCHAR" />
     <result column="signclosed_customer_desc" property="signclosedCustomerDesc" jdbcType="VARCHAR" />
     <result column="signclosed_customer_desc" property="signclosedCustomerDesc" jdbcType="VARCHAR" />
+    <result column="sendback_id" property="sendbackId" jdbcType="INTEGER" />
     <collection property="signclosedProductInfoList" column="signclosed_id" ofType="SignclosedProductInfo" select="listSignclosedById"/>
+    <collection property="signclosedImgInfoList" column="signclosed_id" ofType="ComplaintSignclosedImg" select="listSignclosedImgById"/>
   </resultMap>
   <select id="listAwaitingSignclosedById" resultType="AwaitingSignclosedProductInfo" parameterType="Integer" >
     select
@@ -97,11 +102,18 @@
     where sp.signclosed_id = #{signclosedId}
     GROUP BY sp.product_name,pc.color_name
   </select>
+  <select id="listSignclosedImgById" resultType="ComplaintSignclosedImg" parameterType="Integer" >
+    select
+    img_id AS imgId,
+    signclosed_id AS signclosedId,
+    img_url AS imgUrl
+    from
+    tb_rst_complaint_signclosed_img si
+    where si.signclosed_id = #{signclosedId}
+  </select>
   <select id="listSignclosed" resultMap="complaintSignclosedInfoMap" parameterType="ComplaintSignclosedInfo" >
     SELECT
     cs.signclosed_id,
-    cs.signclosed_type,
-    cs.signclosed_type_name,
     cs.signclosed_logistics,
     cs.signclosed_logistics_number,
     cs.signclosed_send_name,
@@ -114,16 +126,21 @@
     cs.signclosed_desc,
     cs.signclosed_create_time,
     cs.signclosed_update_time,
-    cs.signclosed_state,
     cs.signclosed_customer_desc,
-    ap.province provincesName,
-    ac.city cityName,
+    cs.signclosed_is_receiving,
+    cs.sendback_id,
+    ap.province signclosedAddrProvincesName,
+    ac.city signclosedAddrCityName,
+    ad.district signclosedAddrAreaName,
     qd.describe_title customerIdDescribe
+
     FROM
     tb_rst_complaint_signclosed cs
     LEFT JOIN tb_rst_address_province ap ON cs.signclosed_addr_provinces = ap.province_id
     LEFT JOIN tb_rst_address_city ac ON cs.signclosed_addr_city = ac.city_id
+    LEFT JOIN tb_rst_address_district ad on ad.district_id = cs.signclosed_addr_area
     LEFT JOIN tb_rst_cm_question_describe qd on cs.signclosed_customer_id = qd.customer_id
+
     <where>
       <if test="signclosedSendName != null and signclosedSendName != ''" >
         cs.signclosed_send_name = #{signclosedSendName}
@@ -134,47 +151,43 @@
       <if test="signclosedLogisticsNumber != null and signclosedLogisticsNumber != ''" >
         AND cs.signclosed_logistics_number = #{signclosedLogisticsNumber}
       </if>
-      <if test="signclosedType != null and signclosedType != ''" >
-        AND cs.signclosed_type = #{signclosedType}
-      </if>
       <if test="signclosedCustomerId != null " >
         AND cs.signclosed_customer_id = #{signclosedCustomerId}
       </if>
       <if test="isBinding != null and isBinding == 1" >
         AND cs.signclosed_customer_id is NULL
       </if>
+      <if test="signclosedIsReceiving != null and signclosedIsReceiving != ''" >
+        AND cs.signclosed_is_receiving = #{signclosedIsReceiving}
+      </if>
     </where>
     order by cs.signclosed_create_time DESC
   </select>
 
   <insert id="insert" parameterType="ComplaintSignclosedInfo" useGeneratedKeys="true" keyProperty="signclosedId" >
-    insert into tb_rst_complaint_signclosed (signclosed_type, signclosed_type_name,
+    insert into tb_rst_complaint_signclosed (
       signclosed_logistics, signclosed_logistics_number,
       signclosed_send_name, signclosed_send_tel, 
       signclosed_addr_provinces, signclosed_addr_city, signclosed_addr_area, signclosed_date,
       signclosed_customer_id,
-      signclosed_desc,signclosed_state,signclosed_customer_desc
+      signclosed_desc,signclosed_customer_desc,signclosed_is_receiving,signclosed_company_id,sendback_id
       )
-    values (#{signclosedType,jdbcType=BIT}, #{signclosedTypeName,jdbcType=VARCHAR},
+    values (
       #{signclosedLogistics,jdbcType=VARCHAR}, #{signclosedLogisticsNumber,jdbcType=VARCHAR},
       #{signclosedSendName,jdbcType=VARCHAR}, #{signclosedSendTel,jdbcType=VARCHAR}, 
       #{signclosedAddrProvinces,jdbcType=VARCHAR}, #{signclosedAddrCity,jdbcType=VARCHAR},#{signclosedAddrArea,jdbcType=VARCHAR},
       #{signclosedDate,jdbcType=DATE},
       #{signclosedCustomerId,jdbcType=INTEGER},
       #{signclosedDesc,jdbcType=VARCHAR},
-      #{signclosedState,jdbcType=INTEGER},
-      #{signclosedCustomerDesc,jdbcType=VARCHAR}
+      #{signclosedCustomerDesc,jdbcType=VARCHAR},
+      #{signclosedIsReceiving,jdbcType=VARCHAR},
+      #{signclosedCompanyId,jdbcType=VARCHAR},
+      #{sendbackId,jdbcType=INTEGER}
       )
   </insert>
   <update id="updateSignclosedById" parameterType="ComplaintSignclosedInfo" >
     update tb_rst_complaint_signclosed
     <set >
-      <if test="signclosedType != null" >
-        signclosed_type = #{signclosedType,jdbcType=BIT},
-      </if>
-      <if test="signclosedTypeName != null" >
-        signclosed_type_name = #{signclosedTypeName,jdbcType=VARCHAR},
-      </if>
       <if test="signclosedLogistics != null" >
         signclosed_logistics = #{signclosedLogistics,jdbcType=VARCHAR},
       </if>
@@ -211,11 +224,14 @@
       <if test="signclosedUpdateTime != null" >
         signclosed_update_time = #{signclosedUpdateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="signclosedState != null" >
-        signclosed_state = #{signclosedState,jdbcType=VARCHAR},
-      </if>
       <if test="signclosedCustomerDesc != null" >
-        signclosed_customer_desc = #{signclosedCustomerDesc,jdbcType=VARCHAR}
+        signclosed_customer_desc = #{signclosedCustomerDesc,jdbcType=VARCHAR},
+      </if>
+      <if test="signclosedIsReceiving != null" >
+        signclosed_is_receiving = #{signclosedIsReceiving,jdbcType=INTEGER},
+      </if>
+      <if test="sendbackId != null" >
+        sendback_id = #{sendbackId,jdbcType=INTEGER}
       </if>
     </set>
       where
@@ -225,12 +241,6 @@
   <update id="updateSignclosedByCustomerId" parameterType="ComplaintSignclosedInfo" >
     update tb_rst_complaint_signclosed
     <set >
-      <if test="signclosedType != null" >
-        signclosed_type = #{signclosedType,jdbcType=BIT},
-      </if>
-      <if test="signclosedTypeName != null" >
-        signclosed_type_name = #{signclosedTypeName,jdbcType=VARCHAR},
-      </if>
       <if test="signclosedLogistics != null" >
         signclosed_logistics = #{signclosedLogistics,jdbcType=VARCHAR},
       </if>
@@ -258,14 +268,32 @@
       <if test="signclosedDesc != null" >
         signclosed_desc = #{signclosedDesc,jdbcType=VARCHAR},
       </if>
-      <if test="signclosedState != null" >
-        signclosed_state = #{signclosedState,jdbcType=VARCHAR},
-      </if>
       <if test="signclosedCustomerDesc != null" >
         signclosed_customer_desc = #{signclosedCustomerDesc,jdbcType=VARCHAR}
       </if>
+      <if test="sendbackId != null" >
+        sendback_id = #{sendbackId,jdbcType=INTEGER}
+      </if>
     </set>
     where
         signclosed_customer_id = #{signclosedCustomerId}
   </update>
+
+  <insert id="insertImg" parameterType="ComplaintSignclosedImg">
+    INSERT INTO tb_rst_complaint_signclosed_img(
+    signclosed_id,
+    img_url
+    )
+    VALUES
+    (
+    #{signclosedId},
+    #{imgUrl}
+    )
+  </insert>
+  <delete id="delSignclosedImg" parameterType="Integer">
+    DELETE FROM tb_rst_complaint_signclosed_img WHERE signclosed_id = #{signclosedId}
+  </delete>
+  <delete id="delSignclosedBySendbackId" parameterType="Integer">
+    DELETE FROM tb_rst_complaint_signclosed WHERE sendback_id = #{sendbackId}
+  </delete>
 </mapper>

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

@@ -37,7 +37,8 @@
 	sp.signclosed_product_color signclosedProductColor,
 	sp.machine_no machineNo,
     pc.color_name colorName,
-    pi.product_number productNumber
+    pi.product_number productNumber,
+    pc.color_price colorPrice
     from
     tb_rst_complaint_signclosed_product sp
     LEFT JOIN tb_rst_product_color pc on sp.signclosed_product_color = pc.color_id
@@ -48,12 +49,13 @@
   <insert id="insert" parameterType="SignclosedProductInfo" >
     insert into tb_rst_complaint_signclosed_product (product_id, signclosed_id, product_name, 
       product_num, signclosed_create_time, signclosed_update_time,signclosed_product_type,signclosed_product_id,
-      signclosed_product_color,machine_no
+      signclosed_product_color,machine_no,signclosed_state
+
       )
     values (#{productId,jdbcType=INTEGER}, #{signclosedId,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR}, 
       #{productNum,jdbcType=INTEGER}, #{signclosedCreateTime,jdbcType=TIMESTAMP}, #{signclosedUpdateTime,jdbcType=TIMESTAMP}
       ,#{signclosedProductType,jdbcType=INTEGER}, #{signclosedProductId,jdbcType=INTEGER},
-       #{signclosedProductColor,jdbcType=INTEGER},#{machineNo,jdbcType=VARCHAR}
+       #{signclosedProductColor,jdbcType=INTEGER},#{machineNo,jdbcType=VARCHAR},#{signclosedState,jdbcType=INTEGER}
       )
   </insert>
 
@@ -116,4 +118,7 @@
     where product_id = #{productId,jdbcType=INTEGER}
   </select>
 
+  <delete id="delSignclosedProduct" parameterType="Integer">
+    DELETE FROM tb_rst_complaint_signclosed_product WHERE signclosed_id = #{signclosedId}
+  </delete>
 </mapper>

+ 15 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -4,6 +4,7 @@ import com.iamberry.rst.core.address.City;
 import com.iamberry.rst.core.address.District;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.cm.*;
+import com.iamberry.rst.core.fm.ComplaintDetectInfo;
 import com.iamberry.rst.core.fm.ComplaintSignclosedInfo;
 import com.iamberry.rst.core.fm.ComplaintSmallClassInfo;
 import com.iamberry.rst.core.order.Product;
@@ -14,6 +15,7 @@ import com.iamberry.rst.core.sys.Admin;
 import com.iamberry.rst.core.tools.LogisticsInfo;
 import com.iamberry.rst.faces.address.AddressService;
 import com.iamberry.rst.faces.cm.*;
+import com.iamberry.rst.faces.fm.ComplaintDetectInfoService;
 import com.iamberry.rst.faces.fm.ComplaintSignclosedInfoService;
 import com.iamberry.rst.faces.fm.ComplaintSmallClassInfoService;
 import com.iamberry.rst.faces.order.EfastOrderService;
@@ -102,6 +104,8 @@ public class AdminCustomerController {
     private ProcMethodService procMethodService ;
     @Autowired
     private LogisticsInfoService logisticsInfoService;
+    @Autowired
+    private ComplaintDetectInfoService complaintDetectInfoService;
 
     /**
      * 获取客诉列表
@@ -1292,6 +1296,12 @@ public class AdminCustomerController {
         List<PostageInfo> listPostageInfo = customerService.listPostageInfo(cmRelation.getRelationId());
         List<SendbackInfo> listSendbackInfo = customerService.listSendbackInfo(cmRelation.getRelationId());
         List<InformationInfo> listInformationInfo = customerService.listInformationInfo(cmRelation.getRelationId());
+        ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+        detectInfo.setCustomerId(Integer.valueOf(customerId));
+        List<ComplaintDetectInfo> detectList = complaintDetectInfoService.listComplaintDetect(detectInfo);
+        ComplaintSignclosedInfo complaintSignclosedInfo = new ComplaintSignclosedInfo();
+        complaintSignclosedInfo.setSignclosedCustomerId(Integer.valueOf(customerId));
+        List<ComplaintSignclosedInfo> signclosedList = complaintSignclosedInfoService.listSignclosed(complaintSignclosedInfo);
         //查询寄回产品
         ClosedProdcue record = new ClosedProdcue();
         record.setRelationId(cmRelation.getRelationId());
@@ -1303,6 +1313,8 @@ public class AdminCustomerController {
         mv.addObject("listPostageInfo", listPostageInfo);
         mv.addObject("procMethod", procMethod);
         mv.addObject("customerId", customerId);
+        mv.addObject("detectList", detectList);
+        mv.addObject("signclosedList", signclosedList);
         return mv;
     }
 
@@ -2397,7 +2409,9 @@ public class AdminCustomerController {
             return new ResponseJson(500, "删除失败,请检查参数!", 500);
         }
         Integer msg = customerService.deleteSendbackInfo(sendbackId);
-        if(msg < 1){
+        if(msg > 0){
+            complaintSignclosedInfoService.delSignclosedBySendbackId(sendbackId);
+        }else{
             return new ResponseJson(500, "删除失败", 500);
         }
         return rj;

+ 73 - 108
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java

@@ -1,10 +1,13 @@
 package com.iamberry.rst.controllers.cm;
 
+import com.iamberry.rst.core.cm.CompanyInfo;
 import com.iamberry.rst.core.fm.*;
 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.faces.cm.CompanyInfoService;
 import com.iamberry.rst.faces.fm.AwaitingSignclosedProductInfoService;
 import com.iamberry.rst.faces.fm.ComplaintDetectInfoService;
 import com.iamberry.rst.faces.fm.ComplaintSignclosedProductInfoService;
@@ -43,6 +46,8 @@ public class AdminDetectController {
     private ComplaintSignclosedProductInfoService signclosedProductInfoService;
     @Autowired
     private AwaitingSignclosedProductInfoService awaitingSignclosedProductService;
+    @Autowired
+    private CompanyInfoService companyInfoService;
     /**
      * 跳转到添加检测记录页面
      *
@@ -54,14 +59,17 @@ public class AdminDetectController {
         ModelAndView mv = new ModelAndView("cm/inspection/add_detect");
         Product product = new Product();
         List<Product> productList = productService.listProductAndColorAndfittings(product);
+        ProductColor color = new ProductColor();
+        color.setColorProductId(product.getProductId());
+        List<ProductColor> productColorList = productService.listProduceColor(color);
+        mv.addObject("productColorList",productColorList);
         mv.addObject("productList",productList);
         //获取所有维修内容
         DetectionBasis detectionBasis = new DetectionBasis();
         List<DetectionBasis> detectionBasisList = complaintDetectInfoService.listDetectionBasis(detectionBasis);
         mv.addObject("detectionBasisList",detectionBasisList);
-        /*//获取所有配件
-        List<FittingsInfo> listFittings = fittingsInfoService.listFittings();
-        mv.addObject("listFittings",listFittings);*/
+        List<CompanyInfo> companyInfoList =  companyInfoService.listCompanyInfo(new CompanyInfo());
+        mv.addObject("companyInfoList",companyInfoList);
         return mv;
     }
 
@@ -78,24 +86,16 @@ public class AdminDetectController {
                                          @RequestParam(value = "pageSize", defaultValue = "5", required = false) Integer pageSize,
                                          @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
                                          @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum,
-                                         ComplaintDetectItem detectItem) {
+                                         ComplaintDetectInfo detect) {
 
         ModelAndView mv = new ModelAndView("cm/inspection/detect_list");
         // 封装请求数据
-        PageRequest<ComplaintDetectItem> pageRequest = new PageRequest<>(detectItem, pageNO, pageSize, totalNum == 0);
+        PageRequest<ComplaintDetectInfo> pageRequest = new PageRequest<>(detect, pageNO, pageSize, totalNum == 0);
         // 查询订单列表
-        PagedResult<ComplaintDetectItem> result = complaintDetectInfoService.listComplaintDetectItem(pageRequest);
+        PagedResult<ComplaintDetectInfo> result = complaintDetectInfoService.listComplaintDetect(pageRequest);
         if (totalNum != 0) {
             result.setTotal(totalNum);
         }
-
-//        long total = 0;
-//        if (pageTotal == null) {
-//            total = result.getPages();
-//        } else {
-//            total = pageTotal;
-//            result.setPages(total);
-//        }
         //获取所有产品类型
         ProductType productType = new ProductType();
         List<ProductType> productTypeList = productService.listProductType(productType);
@@ -103,11 +103,7 @@ public class AdminDetectController {
         Product product = new Product();
         List<Product> productList = productService.listProductAndColorAndfittings(product);
         mv.addObject("productList",productList);
-//        url.append("&pageTotal=").append(total).append("&pageNO=");
-//        mv.addObject("page", result);
-//        mv.addObject("url", url.toString());
-
-         StitchAttrUtil.getSa().setModelAndView(detectItem, mv, "/admin/detect/select_detect_list", result);
+         StitchAttrUtil.getSa().setModelAndView(detect, mv, "/admin/detect/select_detect_list", result);
         return mv;
     }
 
@@ -120,40 +116,23 @@ public class AdminDetectController {
     @RequiresPermissions("detect:add:detect")
     @ResponseBody
     @RequestMapping("/add_detect")
-    public ResponseJson addDetect(HttpServletRequest request, ComplaintDetectInfo detectInfo, ComplaintDetectItem detectItem) throws Exception {
+    public ResponseJson addDetect(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
         ResponseJson msg = new ResponseJson();
         if(detectInfo == null){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
         }
-        String itemDate = request.getParameter("itemDate");
+        /*String itemDate = request.getParameter("itemDate");
         if(itemDate == null ){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
-        }
-        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-        detectItem.setDetectItemDate(format.parse(itemDate));
-        ComplaintDetectInfo detect = new ComplaintDetectInfo();
-        if(detectInfo.getCustomerId() == null){
-            detect.setDetectCreateTime(new Date());
-            complaintDetectInfoService.insert(detect);
-        }else{
-            ComplaintDetectInfo detectinfo = complaintDetectInfoService.getDetectByCustomerId(detectInfo.getCustomerId());
-            if(detectinfo == null){
-                detect.setCustomerId(detectInfo.getCustomerId());
-                detect.setDetectCreateTime(new Date());
-                complaintDetectInfoService.insert(detect);
-            }else{
-                detect.setDetectId(detectinfo.getDetectId());
-            }
-            detectItem.setCustomerId(detectInfo.getCustomerId());
-        }
-        detectItem.setDetectId(detect.getDetectId());
-        detectItem.setDetectItemState(1);
-        detectItem.setDetectItemCreateTime(new Date());
-        if(complaintDetectInfoService.insertItem(detectItem) > 0){
+        }*/
+        detectInfo.setIsMaintenance(0);
+        detectInfo.setDetectRenovation(0);
+        detectInfo.setDetectProcessingResults(0);
+        if(complaintDetectInfoService.insert(detectInfo) > 0){
             msg.setResultCode(200);
             msg.setReturnCode(200);
         }else{
@@ -168,7 +147,7 @@ public class AdminDetectController {
      *
      * @return
      */
-    @RequiresPermissions("info:update:info")
+    /*@RequiresPermissions("info:update:info")
     @RequestMapping(value = "/to_add_remark")
     public ModelAndView toAddRemark(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("cm/inspection/add_remark");
@@ -180,7 +159,7 @@ public class AdminDetectController {
         mv.addObject("detectItemId",detectItemId);
         mv.addObject("detectItem",detectItem);
         return mv;
-    }
+    }*/
     /**
      * 跳转到添加修改转入信息页面
      *
@@ -223,27 +202,27 @@ public class AdminDetectController {
 
 
     /**
-     * 添加/修改检测信息
+     * 修改检测信息备注
      * @param request
      * @return
      * @throws Exception
      */
     @RequiresPermissions("remark:add:remark")
     @ResponseBody
-    @RequestMapping("/add_remark")
-    public ResponseJson addRemark(HttpServletRequest request, ComplaintDetectItem detectInfo) throws Exception {
+    @RequestMapping("/update")
+    public ResponseJson addRemark(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
         ResponseJson msg = new ResponseJson();
         if(detectInfo == null){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
         }
-        if(detectInfo.getDetectItemId() == null){
+        if(detectInfo.getDetectId() == null){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
         }
-        Integer num = complaintDetectInfoService.updateDetectItemById(detectInfo);
+        Integer num = complaintDetectInfoService.updateDetectById(detectInfo);
         if (num < 1) {
             msg.setResultCode(500);
             msg.setReturnCode(500);
@@ -255,53 +234,6 @@ public class AdminDetectController {
     }
 
     /**
-     * 检测完成
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    @RequiresPermissions("complete:update:complete")
-    @ResponseBody
-    @RequestMapping("/detect_complete")
-    public ResponseJson detect_complete(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
-        ResponseJson msg = new ResponseJson();
-        /*if(detectInfo == null){
-            msg.setResultCode(500);
-            msg.setReturnCode(500);
-            return msg;
-        }
-        if(detectInfo.getDetectId() == null || detectInfo.getDetectId().equals("")){
-            msg.setResultCode(500);
-            msg.setReturnCode(500);
-            return msg;
-        }
-
-        if(detectInfo.getMaintenanceResults() == 1){
-            detectInfo.setDetectState(3);
-        }else if(detectInfo.getMaintenanceResults() == 2){
-            detectInfo.setDetectState(4);
-        }
-
-        if(detectInfo.getDetectIsMaintenance() == 2){ //选择不需要转入时 detect_revolution_produced 统一改为待转入
-            detectInfo.setDetectRevolutionProduced(1);
-        }
-        String detectDate = request.getParameter("detect_date");
-        if(detectDate != null){
-            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-            detectInfo.setDetectDate(format.parse(detectDate));
-        }
-        Integer num = complaintDetectInfoService.updateComplaintDetect(detectInfo);
-        if (num < 1) {
-            msg.setResultCode(500);
-            msg.setReturnCode(500);
-        } else {
-            msg.setResultCode(200);
-            msg.setReturnCode(200);
-        }*/
-        return msg;
-    }
-
-    /**
      * 跳转到查看仓储进度页面
      *
      * @return
@@ -354,12 +286,12 @@ public class AdminDetectController {
     @RequestMapping(value = "/to_update_complete")
     public ModelAndView toUpdateComplete(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("cm/inspection/update_complete");
-        String detectItemId = request.getParameter("detectItemId");
-        if(detectItemId == null || detectItemId.equals("")){
+        String detectId = request.getParameter("detectId");
+        if(detectId == null || detectId.equals("")){
             return mv;
         }
-        ComplaintDetectItem detectInfo = complaintDetectInfoService.getDetectItemById(Integer.valueOf(detectItemId));
-        mv.addObject("detectItemId",detectItemId);
+        ComplaintDetectInfo detectInfo = complaintDetectInfoService.getDetectById(Integer.valueOf(detectId));
+        mv.addObject("detectId",detectId);
         mv.addObject("detectInfo",detectInfo);
         return mv;
     }
@@ -385,14 +317,14 @@ public class AdminDetectController {
     @RequiresPermissions("complete:update:complete")
     @ResponseBody
     @RequestMapping("/update_complete")
-    public ResponseJson update_complete(HttpServletRequest request, ComplaintDetectItem detectInfo) throws Exception {
+    public ResponseJson update_complete(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
         ResponseJson msg = new ResponseJson();
         if(detectInfo == null){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
         }
-        if(detectInfo.getDetectItemId() == null || detectInfo.getDetectItemId().equals("")){
+        if(detectInfo.getDetectId() == null || detectInfo.getDetectId().equals("")){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
@@ -400,9 +332,11 @@ public class AdminDetectController {
         String detectDate = request.getParameter("detect_date");
         if(detectDate != null){
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-            detectInfo.setDetectItemDate(format.parse(detectDate));
+            detectInfo.setDetectDate(format.parse(detectDate));
         }
-        Integer num = complaintDetectInfoService.updateDetectItemById(detectInfo);
+        String[] componentsImgs = request.getParameterValues("componentsImg");
+
+        Integer num = complaintDetectInfoService.updateDetectById(detectInfo,componentsImgs);
         if (num < 1) {
             msg.setResultCode(500);
             msg.setReturnCode(500);
@@ -422,14 +356,14 @@ public class AdminDetectController {
     @RequiresPermissions("remark:add:remark")
     @ResponseBody
     @RequestMapping("/delete")
-    public ResponseJson delete(HttpServletRequest request, Integer detectItemId) throws Exception {
+    public ResponseJson delete(HttpServletRequest request, Integer detectId) throws Exception {
         ResponseJson msg = new ResponseJson();
-        if(detectItemId == null){
+        if(detectId == null){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
         }
-        Integer num = complaintDetectInfoService.deleteDetectItem(detectItemId);
+        Integer num = complaintDetectInfoService.deleteDetect(detectId);
         if (num < 1) {
             msg.setResultCode(500);
             msg.setReturnCode(500);
@@ -469,5 +403,36 @@ public class AdminDetectController {
         }
         return msg;
     }
+
+    /**
+     * 客服确认处理结果
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("complete:update:complete")
+    @ResponseBody
+    @RequestMapping("/customer_confirm")
+    public ResponseJson customerConfirm(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(detectInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        if(detectInfo.getDetectId() == null || "".equals(detectInfo.getDetectId())){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        if (!complaintDetectInfoService.customerConfirm(detectInfo)) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
 }
 

+ 40 - 108
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java

@@ -1,13 +1,18 @@
 package com.iamberry.rst.controllers.cm;
 
+import com.iamberry.rst.core.cm.CompanyInfo;
 import com.iamberry.rst.core.fm.*;
 import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.pts.PtsMachine;
+import com.iamberry.rst.core.tools.LogisticsInfo;
+import com.iamberry.rst.faces.cm.CompanyInfoService;
 import com.iamberry.rst.faces.fm.AwaitingSignclosedProductInfoService;
 import com.iamberry.rst.faces.fm.ComplaintDetectInfoService;
 import com.iamberry.rst.faces.fm.ComplaintSignclosedInfoService;
+import com.iamberry.rst.faces.fm.ComplaintSignclosedProductInfoService;
+import com.iamberry.rst.faces.order.LogisticsInfoService;
 import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.faces.pts.MachineService;
 import com.iamberry.rst.service.fm.mapper.ComplaintSignclosedProductInfoMapper;
@@ -42,11 +47,13 @@ public class AdminSignclosedController {
     @Autowired
     private ComplaintSignclosedInfoService complaintSignclosedInfoService;
     @Autowired
-    private AwaitingSignclosedProductInfoService awaitingSignclosedProductInfoService;
-    @Autowired
     private MachineService machineService;
     @Autowired
-    private ComplaintSignclosedProductInfoMapper cmplaintSignclosedProductInfoMapper;
+    private LogisticsInfoService logisticsInfoService;
+    @Autowired
+    private CompanyInfoService companyInfoService;
+    @Autowired
+    private ComplaintSignclosedProductInfoService complaintSignclosedProductInfoService;
 
     /**
      * 跳转到添加签收记录页面
@@ -61,7 +68,10 @@ public class AdminSignclosedController {
         Product product = new Product();
         List<Product> productList = productService.listProductAndColorAndfittings(product);
         mv.addObject("productList",productList);
-
+        List<LogisticsInfo> logisticsInfoList =  logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+        mv.addObject("logisticsInfoList",logisticsInfoList);
+        List<CompanyInfo> companyInfoList =  companyInfoService.listCompanyInfo(new CompanyInfo());
+        mv.addObject("companyInfoList",companyInfoList);
         return mv;
     }
 
@@ -170,15 +180,16 @@ public class AdminSignclosedController {
              msg.setReturnCode(503);
             return msg;
         }
-
+        //获取签收图片
+        String[] componentsImgs = request.getParameterValues("componentsImg");
         String signclosedDate = request.getParameter("signclosed_date");
         if(signclosedDate != null){
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
             signclosedInfo.setSignclosedDate(format.parse(signclosedDate));
         }
         signclosedInfo.setSignclosedCreateTime(new Date());
-        signclosedInfo.setSignclosedState(1);
-        boolean num = complaintSignclosedInfoService.insert(signclosedInfo,orderItemString);
+        signclosedInfo.setSignclosedIsReceiving(2);
+        boolean num = complaintSignclosedInfoService.insert(signclosedInfo,orderItemString,componentsImgs);
 
 
         if (!num) {
@@ -200,13 +211,17 @@ public class AdminSignclosedController {
     @RequestMapping(value = "/to_complete_signclosed")
     public ModelAndView toCompleteDetect(HttpServletRequest request,Integer signclosedId) {
         ModelAndView mv = new ModelAndView("cm/signclosed/complete_signclosed");
-        //获取所有待收产品及其颜色,配件
         if(signclosedId == null){
             return mv;
         }
+        Product product = new Product();
+        List<Product> productList = productService.listProductAndColorAndfittings(product);
+        mv.addObject("productList",productList);
+        List<LogisticsInfo> logisticsInfoList =  logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+        mv.addObject("logisticsInfoList",logisticsInfoList);
+        List<CompanyInfo> companyInfoList =  companyInfoService.listCompanyInfo(new CompanyInfo());
+        mv.addObject("companyInfoList",companyInfoList);
         ComplaintSignclosedInfo complaintSignclosedInfo = complaintSignclosedInfoService.getSignclosedById(signclosedId);
-        List<AwaitingSignclosedProductInfo> signclosedList = awaitingSignclosedProductInfoService.listBySignclosedId(signclosedId);
-        mv.addObject("signclosedList",signclosedList);
         mv.addObject("complaintSignclosedInfo",complaintSignclosedInfo);
         return mv;
     }
@@ -221,48 +236,40 @@ public class AdminSignclosedController {
     @RequiresPermissions("signclosed:update:signclosed")
     @ResponseBody
     @RequestMapping("/complete_signclosed")
-    public ResponseJson completeSignclosed(HttpServletRequest request,ComplaintSignclosedInfo signclosedInfo) throws Exception {
+    public ResponseJson completeSignclosed(HttpServletRequest request,ComplaintSignclosedInfo signclosedInfo,String orderItemString) throws Exception {
         ResponseJson msg = new ResponseJson();
         if(signclosedInfo == null){
-            msg.setResultCode(500);
+            msg.setResultCode(200);
             msg.setReturnCode(500);
             return msg;
         }
 
-
-        /**签收产品**/
-        String[] alreadyColorName = request.getParameterValues("alreadyColorName");
-        String[] alreadyFittingsName = request.getParameterValues("alreadyFittingsName");
-        if(alreadyColorName == null && alreadyFittingsName == null){
+        if(orderItemString == null){
             msg.setResultCode(200);
             msg.setReturnCode(502);
             return msg;
         }
-        Map<String,Integer> alreadyColorMap = new HashMap<>();
-        Map<String,String[]> machineNumberMap = new HashMap<>();
-        if(alreadyColorName != null && alreadyColorName.length> 0){
-            for (int i = 0;i<alreadyColorName.length;i++){
-                /**获取机器数量**/
-                String number = request.getParameter("alreadyColorId"+alreadyColorName[i]);
-                alreadyColorMap.put(alreadyColorName[i],Integer.valueOf(number));
-            }
-        }
-        Map<String, Integer> alreadyFittingsMap = new HashMap<>();
-        if(alreadyFittingsName != null && alreadyFittingsName.length> 0) {
-            for (int i = 0; i < alreadyFittingsName.length; i++) {
-                alreadyFittingsMap.put(alreadyFittingsName[i], Integer.valueOf(request.getParameter("alreadyFittingsId" + alreadyFittingsName[i])));
-            }
+        JSONArray jsonArray = JSONArray.fromObject(orderItemString);
+        JSONObject jsonArray2  = jsonArray.getJSONObject(0);
+        if(jsonArray2.get("itemNum").equals("")){
+            msg.setResultCode(200);
+            msg.setReturnCode(503);
+            return msg;
         }
+        //获取签收图片
+        String[] componentsImgs = request.getParameterValues("componentsImg");
         String signclosedDate = request.getParameter("signclosed_date");
         if(signclosedDate != null){
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
             signclosedInfo.setSignclosedDate(format.parse(signclosedDate));
         }
-        boolean num = complaintSignclosedInfoService.updateSignclosedById(signclosedInfo,alreadyColorMap,machineNumberMap,alreadyFittingsMap);
+        signclosedInfo.setSignclosedCreateTime(new Date());
+        signclosedInfo.setSignclosedIsReceiving(2);
+        boolean num = complaintSignclosedInfoService.updateSignclosedById(signclosedInfo,orderItemString,componentsImgs);
 
 
         if (!num) {
-            msg.setResultCode(500);
+            msg.setResultCode(200);
             msg.setReturnCode(500);
         } else {
             msg.setResultCode(200);
@@ -357,81 +364,6 @@ public class AdminSignclosedController {
         return mv;
     }
 
-    /**
-     * 转入品质(修改状态)
-     *
-     * @return
-     */
-    @ResponseBody
-    @RequiresPermissions("signclosed:update:signclosed")
-    @RequestMapping(value = "/update_states")
-    public ResponseJson updateStates(HttpServletRequest request,ComplaintSignclosedInfo complaintSignclosedInfo){
-        ResponseJson msg = new ResponseJson();
-        if(complaintSignclosedInfo == null){
-            msg.setResultCode(500);
-            msg.setReturnCode(500);
-            return msg;
-        }
-        complaintSignclosedInfo.setSignclosedState(2);
-        complaintSignclosedInfoService.updateSignclosedById(complaintSignclosedInfo);
-        msg.setResultCode(200);
-        msg.setReturnCode(200);
-        return msg;
-    }
-
-    /**
-     * 转入品质
-     *
-     * @return
-     */
-    @ResponseBody
-    @RequiresPermissions("signclosed:update:signclosed")
-    @RequestMapping(value = "/into_complaint")
-    public ResponseJson intoComplaint(HttpServletRequest request,ComplaintSignclosedInfo complaintSignclosedInfo){
-        ResponseJson msg = new ResponseJson();
-        if(complaintSignclosedInfo == null){
-            msg.setResultCode(500);
-            msg.setReturnCode(500);
-            return msg;
-        }
-        //根据客诉id查询是否已存在品检信息
-        ComplaintDetectInfo complaintDetectInfo = new ComplaintDetectInfo();
-        if(complaintDetectInfoService.getDetectByCustomerId(complaintSignclosedInfo.getSignclosedCustomerId()) == null){
-            complaintDetectInfo.setCustomerId(complaintSignclosedInfo.getSignclosedCustomerId());
-            complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId());
-            complaintDetectInfo.setDetectCreateTime(new Date());
-            Integer i = complaintDetectInfoService.insert(complaintDetectInfo);
-            if(i != 1){
-                msg.setResultCode(500);
-                msg.setReturnCode(500);
-                return msg;
-            }
-        }
-        //签收产品id集合
-        String[] productIdList = request.getParameterValues("products");
-        //添加品检项
-        List<Integer> itemIdList = new ArrayList<>();
-        List<ComplaintDetectItem> listDetectItem = new ArrayList<>();
-        for(String productid : productIdList){
-            SignclosedProductInfo signclosedProductInfo = cmplaintSignclosedProductInfoMapper.listSignclosedProductInfoById(Integer.valueOf(productid));
-            ComplaintDetectItem detectItem = new ComplaintDetectItem();
-            detectItem.setDetectId(complaintDetectInfo.getDetectId());
-            detectItem.setDetectItemCreateTime(new Date());
-            detectItem.setProductId(signclosedProductInfo.getSignclosedProductId());
-            detectItem.setDetectProductNumber(signclosedProductInfo.getProductName());
-            detectItem.setDetectItemState(1);
-            detectItem.setCustomerId(complaintSignclosedInfo.getSignclosedCustomerId());
-            Integer msg3 =  complaintDetectInfoService.insertItem(detectItem);
-            if(msg3 != 1){
-                itemIdList.add(detectItem.getDetectItemId());
-            }
-        }
-        msg.setResultCode(200);
-        msg.setReturnCode(200);
-        msg.addResponseKeyValue("itemIdList",itemIdList);
-        return msg;
-    }
-
 
     /**
      * 根据产品名称查询产品数据

+ 2 - 1
watero-rst-web/src/main/java/com/iamberry/rst/utils/StitchAttrUtil.java

@@ -35,7 +35,8 @@ public class StitchAttrUtil {
             "serialVersionUID",
             "awaitingSignclosedProductInfoList",
             "signclosedProductInfoList",
-            "cmRelation"
+            "cmRelation",
+            "signclosedImgInfoList"
     };
 
 

+ 2 - 1
watero-rst-web/src/main/resources/watero-rst-orm.xml

@@ -103,12 +103,13 @@
 		<typeAlias type="com.iamberry.rst.core.fm.ComplaintSignclosedInfo" alias="ComplaintSignclosedInfo"/>
 		<typeAlias type="com.iamberry.rst.core.fm.ComplaintSmallClassInfo" alias="ComplaintSmallClassInfo"/>
 		<typeAlias type="com.iamberry.rst.core.fm.SignclosedProductInfo" alias="SignclosedProductInfo"/>
-		<typeAlias type="com.iamberry.rst.core.fm.ComplaintDetectItem" alias="ComplaintDetectItem"/>
 		<typeAlias type="com.iamberry.rst.core.fm.DetectionBasis" alias="DetectionBasis"/>
 		<typeAlias type="com.iamberry.rst.core.fm.InventoryLog" alias="InventoryLog"/>
 		<typeAlias type="com.iamberry.rst.core.fm.InventoryInfo" alias="InventoryInfo"/>
 		<typeAlias type="com.iamberry.rst.core.fm.WarehouseInfo" alias="WarehouseInfo"/>
 		<typeAlias type="com.iamberry.rst.core.fm.FactoryInfo" alias="FactoryInfo"/>
+		<typeAlias type="com.iamberry.rst.core.fm.ComplaintSignclosedImg" alias="ComplaintSignclosedImg"/>
+		<typeAlias type="com.iamberry.rst.core.fm.ComplaintDetectImg" alias="ComplaintDetectImg"/>
 
 		<typeAlias type="com.iamberry.rst.core.sys.SysConfig" alias="SysConfig"/>
 		<typeAlias type="com.iamberry.rst.core.sys.SystemLogs" alias="SystemLogs"/>

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

@@ -1,4 +1,4 @@
-<!DOCTYPE HTML>
+f<!DOCTYPE HTML>
 <html>
 <head>
     <meta charset="utf-8">

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

@@ -284,7 +284,7 @@
                                                         未寄回
                                                     </#if>
                                                 </#if>
-                                                    <#if customer.procMethodIsBack == 1 && customer.procMethodIsSend == 1>,</#if>
+                                                    <#if customer.procMethodIsBack == 1 && customer.procMethodIsSend == 1 && customer.sendStatus?? >,</#if>
                                                     <#if customer.sendStatus?? && customer.procMethodIsSend == 1>
                                                         <#if customer.sendStatus == 1>
                                                             已发货

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

@@ -43,19 +43,21 @@
         </div>
         <div id="tab_demo" class="HuiTab">
         <div class="tabBar clearfix">
-<#if procMethod.procMethodIsBack == 1>
-            <span>寄回信息</span>
-            <span>邮费信息</span>
-</#if>
-<#if procMethod.procMethodIsSend == 1>
-            <span>寄送信息</span>
-</#if>
-
-<#if procMethod.procMethodIsBack == 1>
-            <span>收费信息</span>
-            <span>工厂检查信息</span>
-            <span>工厂返修进度</span>
-</#if>
+        <#if procMethod.procMethodIsBack == 1>
+                    <span>寄回信息</span>
+                    <span>邮费信息</span>
+        </#if>
+        <#if procMethod.procMethodIsSend == 1>
+                    <span>寄送信息</span>
+        </#if>
+
+        <#if procMethod.procMethodIsBack == 1>
+                    <span>收费信息</span>
+                    <span>维修信息</span>
+                    <span>签收信息</span>
+                    <#--<span>工厂检查信息</span>
+                    <span>工厂返修进度</span>-->
+        </#if>
         </div>
         <div <#if procMethod.procMethodIsBack == 1>class="tabCon"</#if> style="display: none;">
             <div class="row cl">
@@ -548,91 +550,6 @@
                     <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="to_add_order_by_update()">录入寄出订单</button>
                 </div>
             </div>
-
-
-           <#-- <div class="row cl">
-                <div class="formControls col-2 col-sm-2 text-r">
-                    <strong>Efast订单号</strong>
-                </div>
-                <div class="formControls col-5 col-sm-5">
-                    <input type="text" class="input-text" value="" placeholder="Efast订单号" id="relationBackEfastOrderId" name="relationBackEfastOrderId" seleType="sendInformation">
-                </div>
-            </div>
-                <div class="row cl" id="sendUserInfo">
-                    <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="relationSendName" name="relationSendName" seleType="sendInformation">
-                    </div>
-                    <div class="formControls col-5 col-sm-5">
-                        <input type="text" class="input-text" placeholder="填写收件人手机号" id="relationSendTel" name="relationSendTel" seleType="sendInformation">
-                    </div>
-                </div>
-                <div class="row cl" id="sendAddressInfo">
-                    <div class="formControls col-2 col-sm-2 text-r">
-
-                    </div>
-                    <div class="formControls col-10 col-sm-10">
-                        <div style="width: 188px;display: inline-block;margin-right: 20px;">
-                    <span class="select-box" style="padding-right: 0px;">
-                        <select name="provinceNumber" id="provinceNumber" class="select" seleType="sendInformation"></select>
-                    </span>
-                        </div>
-                        <div style="width: 188px;display: inline-block;margin-right: 20px;">
-                    <span class="select-box" style="padding-right: 0px;">
-                        <select name="cityNumber" id="cityNumber" class="select" seleType="sendInformation"></select>
-                    </span>
-                        </div>
-                        <div style="width: 189px;display: inline-block;">
-                    <span class="select-box" style="padding-right: 0px;">
-                        <select name="areaNumber" id="areaNumber" class="select" seleType="sendInformation"></select>
-                        <input type="hidden" id="merge_address" name="merge_address" seleType="sendInformation">
-                    </span>
-                        </div>
-                    </div>
-                </div>
-                <div class="row cl" id="sendaddressDescInfo">
-                    <label class="form-label col-2 col-sm-2"></label>
-                    <div class="formControls col-10 col-sm-10">
-                        <input type="text" class="input-text" placeholder="请填写详细地址" id="relationSendAddress" name="relationSendAddress" seleType="sendInformation">
-                    </div>
-                </div>
-                <div class="row cl"  id="sendLogisticsInfo">
-                    <div class="formControls col-2 col-sm-2 text-r">
-                        <strong>寄出信息</strong>
-                    </div>
-                    <div class="formControls col-10 col-sm-10">
-                        <div style="width: 300px;display: inline-block;margin-right: 10px;">
-			<span class="select-box">
-				<select name="relationSendLogisticsCompany" id="relationSendLogisticsCompany" class="select" seleType="sendInformation">
-                    <option value="">请选择物流公司</option>
-                    <#if logisticsInfoList?? &&  (logisticsInfoList?size > 0) >
-                        <#list logisticsInfoList as logisticsInfo>
-                            <option value="${logisticsInfo.logisticsRstCode!''}">${logisticsInfo.logisticsName!''}(${logisticsInfo.logisticsRstCode!''})</option>
-                        </#list>
-                    </#if>
-				</select>
-			</span>
-                        </div>
-                        <input style="width: 300px;" type="text" class="input-text" value="" placeholder="快递单号" id="relationSendLogisticsNo" name="relationSendLogisticsNo" seleType="sendInformation">
-                    </div>
-                </div>
-                <div class="row cl" id="sendDescInfo">
-                    <div class="formControls col-2 col-sm-2 text-r">
-                        <strong>寄出备注</strong>
-                    </div>
-                    <div class="formControls col-10 col-sm-10">
-                        <input type="text" class="input-text" placeholder="寄出备注" id="relationDesc" name="relationDesc" seleType="sendInformation">
-                    </div>
-                </div>
-                <div class="row cl">
-                    <div class="formControls col-2 col-sm-2">
-                    </div>
-                    <div class="formControls col-8 col-sm-8 text-c">
-                        <button onClick="update_relation_info(3);" class="btn btn-primary" type="button">确认修改</button>
-                    </div>
-                </div>-->
         </div>
 
 
@@ -858,7 +775,298 @@
                     </div>
                 </div>
             </div>
-<#if procMethod.procMethodIsBack == 1>
+        <div <#if procMethod.procMethodIsBack == 1>class="tabCon"</#if>style="display: none;">
+                <div class="row cl" id="detectDiv">
+                    <div class="formControls col-10 col-sm-10">
+                        <table class="table table-border table-bg table-bordered" >
+                            <thead>
+                            <tr>
+                                <th>检测id</th>
+                                <th>当前状态</th>
+                                <th>产品</th>
+                                <th>是否有故障</th>
+                                <th>是否可翻新</th>
+                                <th>维修报价</th>
+                                <th>维修内容</th>
+                                <th>操作</th>
+                            </tr>
+                            </thead>
+                            <tbody id="trbodyInformationInfoId">
+                            <#if (detectList?size > 0)>
+                                <#list detectList as detect>
+                                <tr>
+                                <#--<td class="text-c" width="100">${detect.customerId!}</td>-->
+                                    <td class="text-c" width="100">${detect.detectId!''}</td>
+                                    <td class="text-c" width="100">
+                                        <#if detect.detectState == 1>
+                                            待检测机器
+                                        </#if>
+                                        <#if detect.detectState == 30>
+                                            待用户确认
+                                        </#if>
+                                        <#if detect.detectState == 31>
+                                            用户同意维修(待维修)
+                                        </#if>
+                                        <#if detect.detectState == 32>
+                                            维修完成
+                                        </#if>
+                                        <#if detect.detectState == 33>
+                                            用户不维修(原机退回)
+                                        </#if>
+                                        <#if detect.detectState == 34>
+                                            待客服确认维修
+                                        </#if>
+                                        <#if detect.detectState == 35>
+                                            客服确认维修,(待维修)
+                                        </#if>
+                                        <#if detect.detectState == 36>
+                                            维修完成
+                                        </#if>
+                                        <#if detect.detectState == 37>
+                                            机器无故障,原机退回
+                                        </#if>
+                                        <#if detect.detectState == 38>
+                                            机器故障,待用户确认
+                                        </#if>
+                                        <#if detect.detectState == 20>
+                                            待翻新入库
+                                        </#if>
+                                        <#if detect.detectState == 21>
+                                            已翻新入库
+                                        </#if>
+                                        <#if detect.detectState == 22>
+                                            不能翻新,待报废
+                                        </#if>
+                                        <#if detect.detectState == 23>
+                                            已报废回收
+                                        </#if>
+                                    </td>
+                                    <td class="text-c" width="100">${detect.productName!'暂无产品'}(${detect.colorName!'暂无颜色'})</td>
+                                    <td class="text-c" width="100">
+                                        <#if detect.isMaintenance == 1>
+                                            是
+                                        <#elseif detect.isMaintenance == 2>
+                                            否
+                                        <#else>
+                                            机器待检测
+                                        </#if>
+                                    </td>
+                                    <td class="text-c" width="100">
+                                        <#if detect.detectRenovation??>
+                                            <#if detect.detectRenovation == 1>
+                                                可翻新
+                                            <#elseif detect.detectRenovation == 2>
+                                                不可翻新
+                                            <#else>
+                                                机器待检测
+                                            </#if>
+                                        </#if>
+                                    </td>
+                                    <td class="text-c" width="100"><#if detect.detectOffer??>${detect.detectOffer/100}<#else>-</#if></td>
+                                    <td class="text-c" width="100"><div  title="${detect.detectContent!}">${detect.detectContent!'-'}</div></td>
+                                    <!-- 遍历操作 -->
+                                    <td class="td-manage text-c" width="100">
+                                        <a onclick="getDetectInfo(${(detect.detectId)!});">查看详情</a><br>
+                                        <#--<#if detect.detectState() == 30 || detect.detectState() == 35 || detect.detectState() == 38>-->
+                                            <a onclick="to_updateDetectInfo('${(detect.detectId)!}','${(detect.detectState)!}');">维修处理</a>
+                                        <#--</#if>-->
+                                    </td>
+                                </tr>
+                                </#list>
+                            <#else >
+                            <tr><td class="td-manage text-c" colspan = "18">暂时没有检测信息</td></tr>
+                            </#if>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+                <div class="row cl" id="updateDetect" style="display: none;">
+                    <div class="formControls col-10 col-sm-10">
+                        <div >
+                            <div class="row cl" id="updateDetect_1" style="display: none;">
+                                <div class="formControls col-2 col-sm-2 text-r">
+                                    <strong>处理结果:</strong>
+                                </div>
+                                <div class="formControls col-10 col-sm-10">
+                                    <div class="radio-box">
+                                        <input type="radio" id="tel-001" name="detectProcessingResults_1" checked value="1">
+                                        <label for="tel-001">付费维修</label>
+                                    </div>
+                                    <div class="radio-box" id="updateDetect_1_1">
+                                        <input type="radio" id="tel-002" name="detectProcessingResults_1" value="2">
+                                        <label for="tel-002">免费维修</label>
+                                    </div>
+                                    <div class="radio-box" >
+                                        <input type="radio" id="tel-003" name="detectProcessingResults_1" value="3">
+                                        <label for="tel-003">退货处理</label>
+                                    </div>
+                                    <div class="radio-box">
+                                        <input type="radio" id="tel-004" name="detectProcessingResults_1" value="4">
+                                        <label for="tel-004">换货处理</label>
+                                    </div>
+                                    <div class="radio-box">
+                                        <input type="radio" id="tel-005" name="detectProcessingResults_1" value="5">
+                                        <label for="tel-005">原机退回</label>
+                                    </div>
+                                </div>
+                        </div>
+                            <div class="row cl" id="updateDetect_2" style="display: none;">
+                                <div class="formControls col-2 col-sm-2 text-r">
+                                    <strong>处理结果:</strong>
+                                </div>
+                                <div class="formControls col-10 col-sm-10">
+                                    <div class="radio-box">
+                                        <input type="radio" id="tel-002" name="detectProcessingResults_2" checked value="2">
+                                        <label for="tel-002">免费维修</label>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="row cl" id="updateDetect_3" style="display: none;">
+                                <div class="formControls col-2 col-sm-2 text-r">
+                                    <strong>客诉处理:</strong>
+                                </div>
+                                <div class="formControls col-5 col-sm-5">
+                                    <span class="select-box">
+                                         <select class="select" id="procTypeId" name="procTypeId">
+                                         </select>
+                                     </span>
+                                </div>
+                                <div class="formControls col-5 col-sm-5">
+                                <span class="select-box">
+                                     <select class="select" id="procMethodId" name="procMethodId" >
+                                     </select>
+                                 </span>
+                                </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">
+                                    <textarea type="text" placeholder="" id="detectCustomerDesc" name="detectCustomerDesc" style="width: 100%;height: 80px;"></textarea>
+                                </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="hidden" value="" id="detectId" name="detectId">
+                                    <input type="hidden" value="" id="detectState" name="detectState">
+                                    <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="customerConfirm()">确定处理</button>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+            </div>
+<#--<#if procMethod.procMethodIsBack == 1>
+        <div class="tabCon">
+            <div class="row cl" style="margin-left: -70px;">
+                <div class="formControls col-2 col-sm-2 text-r">
+                    <strong>QC进度</strong>
+                </div>
+                <div class="formControls col-10 col-sm-10">
+                    <table class="table table-border table-bg table-bordered">
+                        <tbody class="text-c" id="detect_table"><tr>
+                            <th>工厂检测现象</th><th>故障分类</th><th>故障原因</th><th>判定结果</th><th>故障指向</th><th>原因分析</th><th>生产维修</th>
+                        </tr>
+                        </tbody></table>
+                </div>
+            </div>
+        </div>
+        <div class="tabCon">
+            <div class="row cl" style="margin-left: -70px;">
+                <div class="formControls col-2 col-sm-2 text-r">
+                    <strong>返修进度</strong>
+                </div>
+                <div class="formControls col-10 col-sm-10">
+                    <table class="table table-border table-bg table-bordered">
+                        <tbody class="text-c" id="maintenance_table"><tr>
+                            <th>是否可返修</th><th>返修内容</th><th>返修日期</th>
+                        </tr>
+                        </tbody></table>
+                </div>
+            </div>
+        </div>
+</#if>-->
+        </div>
+        <div <#if procMethod.procMethodIsBack == 1>class="tabCon"</#if>style="display: none;">
+                <div class="row cl" id="signclosedDiv">
+                    <div class="formControls col-10 col-sm-10">
+                        <table class="table table-border table-bordered table-bg table-hover table-sort">
+                            <thead>
+                            <tr class="text-c">
+                                <th width="90">物流状态</th>
+                                <th width="160">物流</th>
+                                <th width="100">寄件人姓名</th>
+                                <th width="100">寄件人电话</th>
+                                <th width="250">签收产品</th>
+                                <th width="150">签收日期</th>
+                                <th width="150">签收图片</th>
+                                <th width="100">备注</th>
+                            </tr>
+                            </thead>
+                            <tbody id="listid">
+                            <#if (signclosedList?size > 0)>
+                                <#list signclosedList as signclosed>
+                                <tr>
+                                    <td class="text-c" width="100">
+                                        <#if signclosed.signclosedIsReceiving??>
+                                            <#if signclosed.signclosedIsReceiving == 1>
+                                                待签收
+                                            <#elseif signclosed.signclosedIsReceiving == 2>
+                                                已签收
+                                            </#if>
+                                        </#if>
+                                    </td>
+                                    <td class="text-c" width="160">
+                                        <#if signclosed.signclosedLogistics??>
+                                        ${signclosed.signclosedLogistics!}
+                                            -
+                                        </#if>
+                                    ${signclosed.signclosedLogisticsNumber!}</td>
+                                    <td class="text-c" width="100">${signclosed.signclosedSendName!}</td>
+                                    <td class="text-c" width="180">${signclosed.signclosedSendTel!}</td>
+                                    <td style="text-align: left;" width="100">
+                                        <div>
+                                            <#if signclosed.signclosedProductInfoList??>
+                                                <#if (signclosed.signclosedProductInfoList?size > 0)>
+                                                    <#list signclosed.signclosedProductInfoList as info>
+                                                    <#--<#if info.signclosedProductType == 1 >
+                                                        <span class="label label-success radius" title="${info.productName!''}-${info.productNumber!''}(${info.colorName!''})x ${info.productNum!''}台">${info.productName!''}-${info.productNumber!''}(${info.colorName!''})x ${info.productNum!''}台</span><br>
+                                                    <#else >-->
+                                                        <span class="label label-success radius" title="${info.productName!''} x ${info.productNum!''}件">${info.productName!''} x ${info.productNum!''}件</span><br>
+                                                    <#--</#if>-->
+                                                    </#list>
+                                                <#else >
+                                                    暂无数据!
+                                                </#if>
+                                            <#else >
+                                                暂无数据!
+                                            </#if>
+                                        </div>
+                                    </td>
+                                <#--<td class="text-c" width="100">${signclosed.signclosedCustomerDesc!}</td>-->
+                                    <td class="text-c" width="100">${(signclosed.signclosedDate?string("yyyy-MM-dd"))!''}</td>
+                                    <td class="text-c" width="100">
+                                        <#if (signclosed.signclosedImgInfoList?size > 0)>
+                                            <#list signclosed.signclosedImgInfoList as signclosedImgInfo>
+                                                <img src="${signclosedImgInfo.imgUrl!}" style="widows: 50px;height: 50px;">
+                                            </#list>
+                                        </#if>
+
+                                    </td>
+                                    <td class="text-c" width="100">${signclosed.signclosedDesc!}</td>
+                                </tr>
+                                </#list>
+                            <#else >
+                            <tr><td class="td-manage text-c" colspan = "14">暂时没有签收信息</td></tr>
+                            </#if>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+<#--<#if procMethod.procMethodIsBack == 1>
         <div class="tabCon">
             <div class="row cl" style="margin-left: -70px;">
                 <div class="formControls col-2 col-sm-2 text-r">
@@ -887,7 +1095,7 @@
                 </div>
             </div>
         </div>
-</#if>
+</#if>-->
         </div>
         <input type="hidden" id="customerId" name="customerId" value="${customerId!''}" seleType="primary">
     </form>
@@ -2394,6 +2602,168 @@
         parent.to_add_order(customerId);
         parent.layer.close(parent.layer.getFrameIndex(window.name));
     }
+
+    /**
+     * 打开维修处理
+     */
+    function to_updateDetectInfo(detectId,detectState){
+        $("#detectId").val(detectId);
+        $("#detectState").val(detectState);
+        if(detectState === "30"){
+            $("#updateDetect_1").show();
+            $("#updateDetect_2").hide();
+            $("#updateDetect_3").hide();
+            $("#updateDetect_1_1").hide();
+        }
+        if(detectState === "34"){
+            $("#updateDetect_1").hide();
+            $("#updateDetect_2").show();
+            $("#updateDetect_3").hide();
+        }
+        if(detectState === "38"){
+            $("#updateDetect_1").show();
+            $("#updateDetect_2").hide();
+            $("#updateDetect_3").show();
+        }
+        $("#updateDetect").show();
+    }
+
+    /**
+     * 客诉处理方式回显 state
+     */
+    procType();
+
+    $("#procTypeId").change(function (){
+        var procTypeId = parseInt($(this).val());
+        procMethod(procTypeId);
+    });
+    function procType(){
+        var procTypeId;
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/proc/type",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var html = '';
+                    if (data.returnCode == 200) {
+                        for(var i=0;i<data.returnMsg.list.length;i++){
+                            listInfo = data.returnMsg.list[i];
+                            if(i == 0 ){
+                                procTypeId = listInfo.procTypeId;
+                            }
+                            html += '<option value="'+ listInfo.procTypeId +'">'+ listInfo.procTypeName +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("[name='procTypeId']").html(html);
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        })
+        procMethod(procTypeId);
+    }
+    function procMethod(procTypeId){
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {"procTypeId":procTypeId},
+            url: "${path}/admin/proc/method",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var html = '';
+                    if (data.returnCode == 200) {
+                        for(var i=0;i<data.returnMsg.list.length;i++){
+                            listInfo = data.returnMsg.list[i];
+                            html += '<option value="'+ listInfo.procMethodId +'">'+ listInfo.procMethodName +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("#procMethodId").html(html);
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        })
+    }
+    /**
+     * 客诉处理方式回显 end
+     */
+
+    /**
+     *确认结果
+     */
+    function customerConfirm(){
+        var detectState = $("#detectState").val();
+        var detectProcessingResults;
+        var procMethodId = $("#procMethodId").val();
+        if(detectState === "30"){
+            detectProcessingResults = $('input[name="detectProcessingResults_1"]:checked').val();//处理结果
+            if(detectProcessingResults === "1" || detectProcessingResults === "5"){
+                procMethodId = null;
+            }
+        }
+        if(detectState === "34"){
+            detectProcessingResults = $('input[name="detectProcessingResults_2"]:checked').val();//处理结果
+            procMethodId = null;
+        }
+        if(detectState === "38"){
+            detectProcessingResults = $('input[name="detectProcessingResults_1"]:checked').val();//处理结果
+            if(detectProcessingResults === "5"){
+                procMethodId = null;
+            }
+        }
+        var detectCustomerDesc = $("#detectCustomerDesc").val();
+        var detectId = $("#detectId").val();
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {"detectProcessingResults" : detectProcessingResults,
+                "detectCustomerDesc" : detectCustomerDesc,
+                "procMethodId" : procMethodId,
+                "detectId" : detectId,
+                "customerId" : ${customerId},
+                "detectState" : detectState},
+            url: "${path}/admin/detect/customer_confirm",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    layer.msg("操作成功!",{icon: 1,time:1000});
+                } else {
+                    layer.msg("操作失败!",{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                window.parent.admin_result("操作失败!",5);
+            }
+        })
+    }
+
+    $("#tel-001").click(function (){
+        if($("#detectState").val() == "30"){
+            $("#updateDetect_3").hide();
+        };
+    });
+    $("#tel-002").click(function (){
+        if($("#detectState").val() == "30"){
+            $("#updateDetect_3").hide();
+        };
+    });
+    $("#tel-003").click(function (){
+        $("#updateDetect_3").show();
+    });
+    $("#tel-004").click(function (){
+        $("#updateDetect_3").show();
+    });
+    $("#tel-005").click(function (){
+        $("#updateDetect_3").hide();
+    });
+
 </script>
 </body>
 </html>

+ 30 - 9
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/add_detect.ftl

@@ -24,6 +24,8 @@
         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后台系统。">
@@ -31,6 +33,21 @@
 <body>
 <article class="page-container">
     <form class="form form-horizontal" id="form-admin-add">
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>所属公司:</label>
+            <div class="formControls col-7 col-sm-7">
+            <#if companyInfoList?? &&  (companyInfoList?size > 0) >
+                <#list companyInfoList as companyInfo>
+                    <div class="radio-box">
+                        <input type="radio"  name="companyId" <#if companyInfo_index == 0>checked="checked"</#if>value="${companyInfo.companyId!''}" datatype="*" nullmsg="请选择所属公司!">
+                        <label for="tel-1">${companyInfo.companyName!''}</label>
+                    </div>
+                </#list>
+            </#if>
+            </div>
+        </div>
+
         <div class="input-box">
             <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-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
@@ -49,11 +66,15 @@
                 </select>
 
                 <select id="productColorId" name="productColorId" class="my-select" style="width: 158px;">
-
+                    <#if (productColorList?size > 0)>
+                        <#list productColorList as productColor>
+                            <option value="${productColor.colorId!""}">${productColor.colorName!""}</option>
+                        </#list>
+                    </#if>
                 </select>
             </div>
         </div>
-        <div class="input-box">
+        <#--<div class="input-box">
             <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-8 col-sm-8 skin-minimal" style="margin: 10px 0px;">
                 <input class="my-input" type="text" style="width: 78.5%;" name="itemDate" id="itemDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/>
@@ -142,7 +163,7 @@
                 </div>
             </div>
         </div>
-        <#--<div class="input-box">
+        &lt;#&ndash;<div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>是否已转入:</label>
             <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
                 <div class="radio-box">
@@ -153,9 +174,9 @@
                     <input type="radio" id="radio-8" name="detectRevolutionProduced" value="1"/>
                      <label for="radio-8">未转入维修</label>
                 </div>
-        </div>-->
+        </div>&ndash;&gt;
         </div>
-
+-->
         <div class="input-box" >
             <label class="form-label col-3 col-sm-3 huanhang"  style="text-align: right;">备注:</label>
             <div class="formControls col-xs-9 col-sm-9">
@@ -209,7 +230,7 @@
     };
 
     /*初始化单选框样式*/
-        $(function(){
+        /*$(function(){
             $('.skin-minimal input').iCheck({
                 checkboxClass: 'icheckbox-blue',
                 radioClass: 'iradio-blue',
@@ -220,7 +241,7 @@
                     $("#maintenanceEquipmentNumber"+$(this).val()).val("");
                 });
             });
-        });
+        });*/
 
         //查询产品颜色信息
     $('#productId').change(function(){
@@ -254,7 +275,7 @@
         
     function  add() {
 
-        var itemDate = $("#itemDate").val();
+        /*var itemDate = $("#itemDate").val();
         if( itemDate == null || itemDate == "" ){
             layer.msg('请选择检测日期',{icon: 5,time:1000});
             return;
@@ -325,7 +346,7 @@
         if( detectItemContent.length > 300 ){
             layer.msg('维修内容长度不得大于300个字符',{icon: 5,time:1000});
             return;
-        }
+        }*/
         $.ajax({
             cache: true,
             type: "POST",

+ 163 - 67
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl

@@ -34,7 +34,7 @@
 <body>
 <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
     <span class="c-gray en">&gt;</span> RST管理
-    <span class="c-gray en">&gt;</span> 品质检测列表
+    <span class="c-gray en">&gt;</span> 维修列表
     <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
 </nav>
 <div class="page-container">
@@ -43,15 +43,15 @@
             <button type="button" style="cursor:pointer;float: left;" class="my-btn-search" onclick="add_detect('${path}/admin/detect/to_add_detect');">新建品检</button>
             <select id="productId" name="productId" class="my-select" style="width: 120px;">
                 <option value="" >请选择产品</option>
-            <#if (productList?size > 0)>
-                <#list productList as product>
-                <#if productId??>
-                    <option value="${product.productId!""}" <#if product.productId == productId>selected</#if>>${product.productName!""}</option>
-                <#else >
-                    <option value="${product.productId!""}" >${product.productName!""}</option>
+                <#if (productList?size > 0)>
+                    <#list productList as product>
+                    <#if productId??>
+                        <option value="${product.productId!""}" <#if product.productId == productId>selected</#if>>${product.productName!""}</option>
+                    <#else >
+                        <option value="${product.productId!""}" >${product.productName!""}</option>
+                    </#if>
+                    </#list>
                 </#if>
-                </#list>
-            </#if>
             </select>
 
             <select id="productColorId" name="productColorId" class="my-select" style="width: 120px;">
@@ -59,11 +59,11 @@
             </select>
             <input class="my-input" style="width: 70px;height: 29px;" type="text" name="customerId" value="${customerId!}" placeholder="客诉编号"/>
             <input class="my-input" style="width: 70px;height: 29px;" type="text" name="questionTitle" value="${questionTitle!}" placeholder="客诉问题"/>
-            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectItemPhenomenon" value="${detectItemPhenomenon!}" placeholder="工厂检测现象"/>
-            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectItemFailureCause" value="${detectItemFailureCause!}" placeholder="故障原因"/>
-            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectItemPoint" value="${detectItemPoint!}" placeholder="故障指向"/>
-            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectItemNalysis" value="${detectItemNalysis!}" placeholder="原因分析"/>
-            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectItemClassification" value="${detectItemClassification!}" placeholder="故障分类"/>
+            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectPhenomenon" value="${detectPhenomenon!}" placeholder="工厂检测现象"/>
+            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectFailureCause" value="${detectFailureCause!}" placeholder="故障原因"/>
+            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectPoint" value="${detectPoint!}" placeholder="故障指向"/>
+            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectNalysis" value="${detectNalysis!}" placeholder="原因分析"/>
+            <input class="my-input" style="width: 70px;height: 29px;" type="text" name="detectClassification" value="${detectClassification!}" placeholder="故障分类"/>
 
             <#--<select class="my-select" name="detectState" style="height: 30px;width: 150px">
                 <option value ="">选择状态</option>
@@ -88,20 +88,26 @@
             <thead>
             <tr class="text-c">
                 <#--<th width="100">客诉编号</th>-->
+                <th width="100">检测ID</th>
+                <th width="100">客诉处理</th>
                 <th width="100">产品</th>
-                <th width="100">状态</th>
-                <th width="60">工厂检测现象</th>
-                <th width="60">故障分类</th>
-                <th width="60">故障原因</th>
-                <th width="60">判定结果</th>
-                <th width="60">故障指向</th>
-                <th width="60">原因分析</th>
-                <th width="60">维修内容</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>
+                <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="150">是否转入生产部门</th>-->
-                <th width="150">备注</th>
-                <th width="150">检测日期</th>
-                <th width="50">操作</th>
+                <th width="100">备注</th>
+                <th width="100">检测日期</th>
+                <th width="120">操作</th>
             </tr>
             </thead>
             <tbody id="listid">
@@ -109,54 +115,100 @@
                 <#list page.dataList as detect>
                 <tr>
                     <#--<td class="text-c" width="100">${detect.customerId!}</td>-->
+                    <td class="text-c" width="100">${detect.detectId!''}</td>
+                    <td class="text-c" width="100"><#if detect.customerId??>${detect.procTypeName!''}-${detect.procMethodName!''}</#if></td>
                     <td class="text-c" width="100">${detect.productName!'暂无产品'}(${detect.colorName!'暂无颜色'})</td>
                     <td class="text-c" width="100">
-                        <#if detect.detectItemState == 1>
-                            已检测
+                        <#if detect.detectState == 1>
+                            待检测机器
+                        </#if>
+                        <#if detect.detectState == 30>
+                            待用户确认
+                        </#if>
+                        <#if detect.detectState == 31>
+                            用户同意维修(待维修)
+                        </#if>
+                        <#if detect.detectState == 32>
+                            维修完成
+                        </#if>
+                        <#if detect.detectState == 33>
+                            用户不维修(原机退回)
+                        </#if>
+                        <#if detect.detectState == 34>
+                            待客服确认维修
+                        </#if>
+                        <#if detect.detectState == 35>
+                            客服确认维修,(待维修)
+                        </#if>
+                        <#if detect.detectState == 36>
+                            维修完成
+                        </#if>
+                        <#if detect.detectState == 37>
+                            机器无故障,原机退回
+                        </#if>
+                        <#if detect.detectState == 38>
+                            机器故障,待用户确认
                         </#if>
-                        <#if detect.detectItemState == 2>
-                            未检测
+                        <#if detect.detectState == 20>
+                            待翻新入库
+                        </#if>
+                        <#if detect.detectState == 21>
+                            已翻新入库
+                        </#if>
+                        <#if detect.detectState == 22>
+                            不能翻新,待报废
+                        </#if>
+                        <#if detect.detectState == 23>
+                            已报废回收
                         </#if>
                     </td>
-                    <td class="text-c" width="60"><div class="txt" title="${detect.detectItemPhenomenon!}">${detect.detectItemPhenomenon!}</div></td>
-                    <td class="text-c" width="60"><div class="txt" title="${detect.detectItemClassification!}">${detect.detectItemClassification!}</div></td>
-                    <td class="text-c" width="60"><div class="txt" title="${detect.detectItemFailureCause!}">${detect.detectItemFailureCause!}</div></td>
-                    <td class="text-c" width="60"><div class="txt" title="${detect.detectItemResults!}">${detect.detectItemResults!}</div></td>
-                    <td class="text-c" width="60"><div class="txt" title="${detect.detectItemPoint!}">${detect.detectItemPoint!}</div></td>
-                    <td class="text-c" width="60"><div class="txt" title="${detect.detectItemNalysis!}">${detect.detectItemNalysis!}</div></td>
-                    <td class="text-c" width="60"><div class="txt" title="${detect.detectItemContent!}">${detect.detectItemContent!}</div></td>
-                    <#--<td class="text-c" width="100"><span class="label txt2" title="${detect.questionTitle!}" >${detect.questionTitle!}</span><br><#if detect.questionTitle??><#if detect.questionTitle != ""><a href="#" onclick="getDescribeInfo(${detect.customerId!});" style="color : #4149FF;">查看详情</a></#if></#if></td>-->
-                   <#-- <td class="text-c" width="100">
-                    <#if detect.detectIsMaintenance??>
-                        <#if detect.detectIsMaintenance == 2>
-                            不需要转入
-                        <#else >
-                            <#if detect.detectRevolutionProduced == 1>
-                                待转入
-                            </#if>
-                            <#if detect.detectRevolutionProduced == 2>
-                                已转入
+                    <td class="text-c" width="100">
+                        <#if detect.isMaintenance == 1>
+                            是
+                        <#elseif detect.isMaintenance == 2>
+                            否
+                        <#else>
+                            机器待检测
+                        </#if>
+                    </td>
+                    <td class="text-c" width="100">
+                        <#if detect.detectRenovation??>
+                            <#if detect.detectRenovation == 1>
+                                可翻新
+                            <#elseif detect.detectRenovation == 2>
+                                不可翻新
+                            <#else>
+                                机器待检测
                             </#if>
                         </#if>
-                    </#if>
-                    </td>-->
-                    <td class="text-c" width="100">${detect.detectItemDesc!}</td>
-                    <td class="text-c" width="100">${(detect.detectItemDate?string("yyyy-MM-dd"))!''}</td>
+                    </td>
+                    <td class="text-c" width="100"><div  title="${detect.detectPhenomenon!}">${detect.detectPhenomenon!'-'}</div></td>
+                    <td class="text-c" width="100"><div  title="${detect.detectClassification!}">${detect.detectClassification!'-'}</div></td>
+                    <td class="text-c" width="100"><div  title="${detect.detectFailureCause!}">${detect.detectFailureCause!'-'}</div></td>
+                    <td class="text-c" width="100"><div  title="${detect.detectResults!}">${detect.detectResults!'-'}</div></td>
+                    <td class="text-c" width="100"><div  title="${detect.detectPoint!}">${detect.detectPoint!'-'}</div></td>
+                    <td class="text-c" width="100"><div  title="${detect.detectNalysis!}">${detect.detectNalysis!'-'}</div></td>
+                    <td class="text-c" width="100"><div  title="${detect.detectContent!}">${detect.detectContent!'-'}</div></td>
+                    <td class="text-c" width="100"><#if detect.detectOffer??>${detect.detectOffer/100}<#else>-</#if></td>
+                    <td class="text-c" width="100"><span class="label txt2" title="${detect.questionTitle!}" >${detect.questionTitle!'-'}</span><br><#if detect.questionTitle??><#if detect.questionTitle != ""><a href="#" onclick="getDescribeInfo(${detect.customerId!});" style="color : #4149FF;">查看详情</a></#if></#if></td>
+                    <td class="text-c" width="100">${detect.detectDesc!'-'}</td>
+                    <td class="text-c" width="100">${(detect.detectDate?string("yyyy-MM-dd"))!'-'}</td>
                     <!-- 遍历操作 -->
-                    <td class="td-manage text-c">
+                    <td class="td-manage text-c" width="120">
                         <#--<a style="text-decoration:none" href="javascript:;" title="修改备注"
-                           onclick="add_remark('修改备注','${path}/admin/detect/to_add_remark?detectItemId=${detect.detectItemId!''}','570','450');">
+                           onclick="add_remark('修改备注','${path}/admin/detect/update?detectId=${detect.detectId!''}','570','450');">
                             <i class="Hui-iconfont">&#xe6df;</i>
                         </a>-->
-                        <a style="text-decoration:none" href="javascript:;" title="修改检测信息"
-                           onclick="update_info('${path}/admin/detect/to_update_complete?detectItemId=${detect.detectItemId!''}');">
-                           <i class="Hui-iconfont">&#xe60c;</i>
-                        </a>
-                        <a style="text-decoration:none" href="javascript:;" title="删除"
-                           onclick="detele(${detect.detectItemId!''});">
+                        <#--<a style="text-decoration:none" href="javascript:;" title="删除"
+                           onclick="detele(${detect.detectId!''});">
                             <i class="Hui-iconfont">&#xe609;</i>
-                        </a>
-
+                        </a>-->
+                        <#if detect.detectState == 1>
+                            <a style="text-decoration:none" href="javascript:;" title="完成检测"
+                               onclick="update_info('完成检测','${path}/admin/detect/to_update_complete?detectId=${detect.detectId!''}','670','550');">
+                                <i class="Hui-iconfont">完成检测</i><br>
+                            </a>
+                        </#if>
                         <#--<#if detect.signclosedId??>
                             <#if detect.detectState == 1>
                                 <a style="text-decoration:none" href="javascript:;" title="查看仓储进度"
@@ -165,11 +217,35 @@
                                 </a>
                             </#if>
                         </#if>-->
+                            <#if detect.detectState == 22>
+                                <a style="text-decoration:none" href="javascript:;" title="报废完成"
+                                   onclick="updateState('${detect.detectId!''}','23');">
+                                    <i class="Hui-iconfont">报废完成</i><br>
+                                </a>
+                            </#if>
+                            <#if detect.detectState == 20>
+                                <a style="text-decoration:none" href="javascript:;" title="翻新完成"
+                                   onclick="updateState('${detect.detectId!''}','21');">
+                                    <i class="Hui-iconfont">翻新完成</i><br>
+                                </a>
+                            </#if>
+                            <#if detect.detectState == 31>
+                                <a style="text-decoration:none" href="javascript:;" title="维修完成"
+                                   onclick="updateState('${detect.detectId!''}','32');">
+                                    <i class="Hui-iconfont">维修完成</i><br>
+                                </a>
+                            </#if>
+                            <#if detect.detectState == 35>
+                                <a style="text-decoration:none" href="javascript:;" title="维修完成"
+                                   onclick="updateState('${detect.detectId!''}','36');">
+                                    <i class="Hui-iconfont">维修完成</i><br>
+                                </a>
+                            </#if>
                     </td>
                 </tr>
                 </#list>
             <#else >
-            <tr><td class="td-manage text-c" colspan = "12">暂时没有品质检测信息</td></tr>
+            <tr><td class="td-manage text-c" colspan = "18">暂时没有维修信息</td></tr>
             </#if>
             </tbody>
         </table>
@@ -191,9 +267,9 @@
     function add_remark(title,url,w,h){
         layer_show(title,url,w,h);
     }
-    /*转入生产*/
-    function update_info(url){
-        window.location.href=url;
+    /*完成检测*/
+    function update_info(title,url,w,h){
+        layer_show(title,url,w,h);
     }
     /**
      * 进入查询问题描述信息页面
@@ -202,13 +278,13 @@
         layer_show("问题描述","${path}/admin/customer/_question_describe?customerId="+customerId,"800","500");
     }
 
-    function  detele(detectItemId) {
+    function  detele(detectId) {
         layer.confirm('确认要删除吗?',function(index){
             $.ajax({
                 cache: true,
                 type: "POST",
                 url: "${path}/admin/detect/delete",
-                data:{detectItemId:detectItemId},// 你的formid
+                data:{detectId:detectId},// 你的formid
                 async: false,
                 success: function(data){
                     if (data.returnCode == 200) {
@@ -258,6 +334,26 @@
             }
         });
     }
+    //修改状态
+    function  updateState(detectId,state) {
+            $.ajax({
+                cache: true,
+                type: "POST",
+                url: "${path}/admin/detect/update",
+                data:{detectId:detectId,detectState:state},
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg('操作成功!',{icon: 1,time:1000},function () {
+                            location.replace(location.href);
+                        });
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg('操作失败',{icon: 5,time:1000});
+                }
+            });
+    }
 </script>
 </body>
 </html>

+ 115 - 53
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/update_complete.ftl

@@ -32,96 +32,117 @@
 <article class="page-container">
     <form class="form form-horizontal" id="form-admin-add">
         <div class="input-box">
-            <label class="col-3 col-sm-3 huanhang" style="text-align: right;"><span class="c-red">*</span>检测结果:</label>
-            <div class=" col-xs-9 col-sm-9 skin-minimal huanhang" >
+            <label class="col-3 col-sm-3 huanhang" style="text-align: right;"><span class="c-red">*</span>是否故障:</label>
+            <div class=" col-xs-9 col-sm-9 huanhang" >
                 <div class="radio-box">
-                    <input type="radio" id="radio-3" name="detectItemState" value="1"
-                          <#if detectInfo.detectItemState??><#if detectInfo.detectItemState == 1>checked</#if></#if>
-                    /><label for="radio-3">检测通过</label>
+                    <input type="radio" id="radio-3" name="isMaintenance" value="2"
+                          <#if detectInfo.isMaintenance??><#if detectInfo.isMaintenance == 2>checked</#if><#else>checked</#if>/><label for="radio-3">无故障</label>
                 </div>
                 <div class="radio-box">
-                    <input type="radio" id="radio-4" name="detectItemState" value="2"
-                    <#if detectInfo.detectItemState??><#if detectInfo.detectItemState == 2>checked</#if></#if>
-                    /><label for="radio-4">检测未通过</label>
+                    <input type="radio" id="radio-4" name="isMaintenance" value="1"
+                    <#if detectInfo.isMaintenance??><#if detectInfo.isMaintenance == 1>checked</#if></#if>/><label for="radio-4">有故障</label>
+                </div>
+            </div>
+        </div>
+        <div class="input-box" style="margin-top: 20px;">
+            <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>是否可翻新:</label>
+            <div class=" col-xs-9 col-sm-9  huanhang" >
+                <div class="radio-box" style="margin: 10px 0px;">
+                    <input type="radio" id="radio-7" name="detectRenovation" value="1"
+                          <#if detectInfo.detectRenovation??><#if detectInfo.detectRenovation == 1>checked</#if><#else>checked</#if>/><label for="radio-7">可翻新</label>
+                </div>
+                <div class="radio-box">
+                    <input type="radio" id="radio-8" name="detectRenovation" value="2"
+                    <#if detectInfo.detectRenovation??><#if detectInfo.detectRenovation == 2>checked</#if></#if>/><label for="radio-8">不可翻新</label>
                 </div>
             </div>
         </div>
        <div class="input-box" >
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>工厂检测现象:</label>
             <div class="formControls col-xs-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">
-                <textarea style="margin-left: 0%;width: 83%;" rows="3" cols="20" name="detectItemPhenomenon" id="detectItemPhenomenon" class="my-textarea" placeholder="工厂检测现象">${detectInfo.detectItemPhenomenon!''}</textarea>
+                <textarea style="margin-left: 0%;width: 83%;" rows="2" cols="20" name="detectPhenomenon" id="detectPhenomenon" class="my-textarea" placeholder="工厂检测现象">${detectInfo.detectPhenomenon!''}</textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>故障分类:</label>
             <div class="formControls col-xs-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">
-                <textarea style="margin-left: 0%;width: 83%;" rows="3" cols="20" name="detectItemClassification" id="detectItemClassification" class="my-textarea" placeholder="故障分类">${detectInfo.detectItemClassification!''}</textarea>
+                <textarea style="margin-left: 0%;width: 83%;" rows="2" cols="20" name="detectClassification" id="detectClassification" class="my-textarea" placeholder="故障分类">${detectInfo.detectClassification!''}</textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>故障原因:</label>
             <div class="formControls col-xs-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">
-                <textarea style="margin-left: 0%;width: 83%;" rows="3" cols="20" name="detectItemFailureCause" id="detectItemFailureCause" class="my-textarea" placeholder="故障原因">${detectInfo.detectItemFailureCause!''}</textarea>
+                <textarea style="margin-left: 0%;width: 83%;" rows="2" cols="20" name="detectFailureCause" id="detectFailureCause" class="my-textarea" placeholder="故障原因">${detectInfo.detectFailureCause!''}</textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>判定结果:</label>
             <div class="formControls col-xs-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">
-                <textarea style="margin-left: 0%;width: 83%;" rows="3" cols="20" name="detectItemResults" id="detectItemResults" class="my-textarea" placeholder="判定结果">${detectInfo.detectItemResults!''}</textarea>
+                <textarea style="margin-left: 0%;width: 83%;" rows="2" cols="20" name="detectResults" id="detectResults" class="my-textarea" placeholder="判定结果">${detectInfo.detectResults!''}</textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>故障指向:</label>
             <div class="formControls col-xs-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">
-                <textarea style="margin-left: 0%;width: 83%;" rows="3" cols="20" name="detectItemPoint" id="detectItemPoint" class="my-textarea" placeholder="故障指向">${detectInfo.detectItemPoint!''}</textarea>
+                <textarea style="margin-left: 0%;width: 83%;" rows="2" cols="20" name="detectPoint" id="detectPoint" class="my-textarea" placeholder="故障指向">${detectInfo.detectPoint!''}</textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>原因分析:</label>
             <div class="formControls col-xs-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">
-                <textarea style="margin-left: 0%;width: 83%;" rows="3" cols="20" name="detectItemNalysis" id="detectItemNalysis" class="my-textarea" placeholder="原因分析">${detectInfo.detectItemNalysis!''}</textarea>
+                <textarea style="margin-left: 0%;width: 83%;" rows="2" cols="20" name="detectNalysis" id="detectNalysis" class="my-textarea" placeholder="原因分析">${detectInfo.detectNalysis!''}</textarea>
             </div>
         </div>
         <div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>检测内容:</label>
             <div class="formControls col-xs-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">
-                <textarea style="margin-left: 0%;width: 83%;" rows="3" cols="20" name="detectItemContent" id="detectItemContent" class="my-textarea" placeholder="原因分析">${detectInfo.detectItemContent!''}</textarea>
+                <textarea style="margin-left: 0%;width: 83%;" rows="2" cols="20" name="detectContent" id="detectContent" class="my-textarea" placeholder="原因分析">${detectInfo.detectContent!''}</textarea>
             </div>
         </div>
         <div class="input-box">
-            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>检测日期:</label>
-            <div class="formControls col-8 col-sm-8 text-c huanhang" style="margin-left: -4%;margin: 10px 0px 10px -14px;">
-                <input class="my-input" style="width: 94%;" type="text" value="<#if detectInfo.detectItemDate??>${detectInfo.detectItemDate?string("yyyy-MM-dd")!''}</#if>" name="detect_date" id="detectItemDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/>
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;">维修报价:</label>
+            <div class="formControls col-9 col-sm-9 text-c huanhang" style="margin-left: -4%;margin: 10px 0px 10px -14px;">
+                <input class="my-input" style="width: 90%;" type="text" value="" name="detect_Offer" id="detect_Offer"  placeholder="" oninput = "value=value.replace(/[^\d]/g,'')"/>
+                <input type="hidden" name="detectOffer" id="detectOffer" value="">
             </div>
         </div>
         <div class="input-box">
-            <label class="col-3 col-sm-3 huanhang" style="text-align: right;"><span class="c-red">*</span>QC检查状态:</label>
-            <div class="col-xs-9 col-sm-9 skin-minimal">
-                <div class="radio-box">
-                    <input type="radio" id="radio-9" name="maintenanceResults" value="1" <#if detectInfo.maintenanceResults??><#if detectInfo.maintenanceResults == 1>checked</#if></#if>/>
-                    <label for="radio-9">通过</label>
-                </div>
-                <div class="radio-box">
-                    <input type="radio" id="radio-10" name="maintenanceResults" value="2" <#if detectInfo.maintenanceResults??><#if detectInfo.maintenanceResults == 2>checked</#if></#if>/>
-                    <label for="radio-10">不通过</label>
-                </div>
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;"><span class="c-red">*</span>检测日期:</label>
+            <div class="formControls col-9 col-sm-9 text-c huanhang" style="margin-left: -4%;margin: 10px 0px 10px -14px;">
+                <input class="my-input" style="width: 90%;" type="text" value="<#if detectInfo.detectDate??>${detectInfo.detectDate?string("yyyy-MM-dd")!''}</#if>" name="detect_date" id="detectDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/>
             </div>
         </div>
         <div class="input-box">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;">备注:</label>
             <div class="col-xs-9 col-sm-9 skin-minimal">
                 <div class="radio-box" style="padding: 0px; width: 100%;">
-                    <textarea style="height: 60px;margin: 10px 0px 10px 0px;width: 85%;" name="detectItemDesc" id="detectItemDesc" class="my-textarea" placeholder="请详细备注内容,便于以后复查。如果转入生产,则生产部门同事可查看!">${detectInfo.detectItemDesc!''}</textarea>
+                    <textarea style="height: 60px;margin: 10px 0px 10px 0px;width: 85%;" name="detectDesc" id="detectDesc" class="my-textarea" placeholder="请详细备注内容,便于以后复查。如果转入生产,则生产部门同事可查看!">${detectInfo.detectDesc!''}</textarea>
                 </div>
             </div>
         </div>
+
+        <div class="row cl">
+            <label class="form-label col-xs-3 col-sm-3 huanhang" style="text-align: right;">添加附件:</label>
+            <div class="formControls col-xs-2 col-sm-2" id="fileDiv" style="width: 17%;width: 100px;height: 100px;margin-left: 8px;">
+                <input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;">
+                <img alt="介绍图" src="${path}/common/images/pts/addparts.jpg"  id="partsImg" width="90" height="80">
+            <#--<input type="hidden" id="componentsImg" name="componentsImg" value=""/>-->
+            <#--<button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="uploadSubmit"><i class="Hui-iconfont">&#xe665;</i> 上传</button>-->
+            </div>
+            <div id="imgDiv">
+
+            </div>
+        </div>
+
         <div>
-            <input type="hidden" value="${detectItemId!''}" id="detectItemId" name="detectItemId">
+            <input type="hidden" value="${detectId!''}" id="detectId" name="detectId">
+            <input type="hidden" value="${detectInfo.customerId!''}" id="customerId" name="customerId">
            <button type="button" style="margin-left: 35%" class="my-btn-submit" onclick="add();">确认提交</button>
         </div>
     </form>
 </article>
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
 <script type="text/javascript">
     /*初始化单选框样式*/
     $(function(){
@@ -131,75 +152,116 @@
             increaseArea: '20%'
         });
     });
-    function  add() {
+    /***
+     * 删除图片
+     */
+    function deleteImg(obj){
+        layer.confirm("确认要删除该图片吗", { title: "确认" }, function (index) {
+            layer.close(index);
+            obj.remove();
+        });
+    }
+
+    $('#fileid').change(function() {
+        fileUpload();
+    });
+
+    function fileUpload() {
+        $.ajaxFileUpload({
+            url:"${path}/admin/machineParts/fileUpload",
+            secureuri:false,
+            fileElementId:"fileid",//文件选择框的id属性
+            dataType: 'json',   //json
+            success: function (data) {
+                if(data.returnCode == 200){
+                    /*<input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;">*/
+                    $("#imgDiv").append('<div class="col-xs-8 col-sm-8" onclick="deleteImg(this);" style="width: 17%;width: 100px;height: 100px;">'
+                            +'<img  src="'+root_path+data.returnMsg.imgUrl+'"  width="90" height="80">'
+                            +'<input type="hidden"  name="componentsImg" value="'+data.returnMsg.imgUrl+'"/>'
+                            +'</div>');
+                }else{
+                    layer.msg('上传失败,请重试!',{icon: 5,time:2000});
+                }
+            }
+        });
+        $('#fileid').change(function() {
+            fileUpload();
+        });
+    }
 
-        var detectItemPhenomenon = $("#detectItemPhenomenon").val();
-        if( detectItemPhenomenon == null || detectItemPhenomenon == "" ){
-            layer.msg('请输入工厂检测现象',{icon: 5,time:1000});
+    function  add() {
+        var detectPhenomenon = $("#detectPhenomenon").val();
+        if( detectPhenomenon == null || detectPhenomenon == "" ){
+            layer.msg('请输入检测现象',{icon: 5,time:1000});
             return;
         }
-        if( detectItemPhenomenon.length > 300 ){
+        if( detectPhenomenon.length > 300 ){
             layer.msg('工厂检测现象长度不得大于150个字符',{icon: 5,time:1000});
             return;
         }
-        var detectItemClassification = $("#detectItemClassification").val();
-        if( detectItemClassification == null || detectItemClassification == "" ){
+        var detectClassification = $("#detectClassification").val();
+        if( detectClassification == null || detectClassification == "" ){
             layer.msg('请输入故障分类',{icon: 5,time:1000});
             return;
         }
-        if( detectItemClassification.length > 50 ){
+        if( detectClassification.length > 50 ){
             layer.msg('故障分类长度不得大于25个字符',{icon: 5,time:1000});
             return;
         }
-        var detectItemFailureCause = $("#detectItemFailureCause").val();
-        if( detectItemFailureCause == null || detectItemFailureCause == "" ){
+        var detectFailureCause = $("#detectFailureCause").val();
+        if( detectFailureCause == null || detectFailureCause == "" ){
             layer.msg('请输入故障原因',{icon: 5,time:1000});
             return;
         }
-        if( detectItemFailureCause.length > 100 ){
+        if( detectFailureCause.length > 100 ){
             layer.msg('故障原因长度不得大于50个字符',{icon: 5,time:1000});
             return;
         }
 
-        var detectItemResults = $("#detectItemResults").val();
-        if( detectItemResults == null || detectItemResults == "" ){
+        var detectResults = $("#detectResults").val();
+        if( detectResults == null || detectResults == "" ){
             layer.msg('请输入判定结果',{icon: 5,time:1000});
             return;
         }
-        if( detectItemResults.length > 100 ){
+        if( detectResults.length > 100 ){
             layer.msg('判定结果长度不得大于50个字符',{icon: 5,time:1000});
             return;
         }
 
-        var detectItemPoint = $("#detectItemPoint").val();
-        if( detectItemPoint == null || detectItemPoint == "" ){
+        var detectPoint = $("#detectPoint").val();
+        if( detectPoint == null || detectPoint == "" ){
             layer.msg('请输入故障指向',{icon: 5,time:1000});
             return;
         }
-        if( detectItemPoint.length > 100 ){
+        if( detectPoint.length > 100 ){
             layer.msg('故障指向长度不得大于50个字符',{icon: 5,time:1000});
             return;
         }
 
-        var detectItemNalysis = $("#detectItemNalysis").val();
-        if( detectItemNalysis == null || detectItemNalysis == "" ){
+        var detectNalysis = $("#detectNalysis").val();
+        if( detectNalysis == null || detectNalysis == "" ){
             layer.msg('请输入原因分析',{icon: 5,time:1000});
             return;
         }
-        if( detectItemNalysis.length > 100 ){
+        if( detectNalysis.length > 100 ){
             layer.msg('原因分析长度不得大于50个字符',{icon: 5,time:1000});
             return;
         }
 
-        var detectItemContent = $("#detectItemContent").val();
-        if( detectItemContent == null || detectItemContent == "" ){
+        var detectContent = $("#detectContent").val();
+        if( detectContent == null || detectContent == "" ){
             layer.msg('请输入维修内容',{icon: 5,time:1000});
             return;
         }
-        if( detectItemContent.length > 300 ){
+        if( detectContent.length > 300 ){
             layer.msg('维修内容长度不得大于150个字符',{icon: 5,time:1000});
             return;
         }
+
+        var detect_Offer = $("#detect_Offer").val();
+        if(detect_Offer != null && detect_Offer != ""){
+            $("#detectOffer").val(detect_Offer * 100)
+        }
         $.ajax({
             cache: true,
             type: "POST",

+ 100 - 226
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/add_signclosed.ftl

@@ -45,6 +45,8 @@
         .table-bg th{background-color: #e2f6ff;}
         .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
         .my-search-input{padding-left: 30px;background: url(${path}/common/images/cm/search.png) 6px center no-repeat;background-size: auto 60%; }
+        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>
     <title>添加签收 - 客诉管理 - RST</title>
 </head>
@@ -59,55 +61,38 @@
 <article class="page-container" style="padding: 10px;">
     <div class="pd-20 cl">
         <form action="" method="post" class="form form-horizontal" id="form-signclosed-add">
-            <#--<div class="row cl">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收类型:</label>
-                <div class="formControls col-7 col-sm-7  skin-minimal">
-				    <div class="radio-box">
-                        <input type="radio" id="tel-1" name="signclosedType" value="1" datatype="*"  checked nullmsg="请选择签收类型!">
-                        <label for="tel-1">客诉寄回</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-2" name="signclosedType" value="2">
-                        <label for="tel-2">代理商退货</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-3" name="signclosedType" value="3">
-                        <label for="tel-3">其他</label>
-                        <input type="text" style="width: 114px;margin-left: 10px;" class="input-text" placeholder="选择其他时有值" id="signclosedTypeName" name="signclosedTypeName">
-                    </div>
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>所属公司:</label>
+                <div class="formControls col-7 col-sm-7">
+                    <#if companyInfoList?? &&  (companyInfoList?size > 0) >
+                        <#list companyInfoList as companyInfo>
+
+                            <div class="radio-box">
+                                <input type="radio"  name="companyId" <#if companyInfo_index == 0>checked="checked"</#if>value="${companyInfo.companyId!''}" datatype="*" nullmsg="请选择所属公司!">
+                                <label for="tel-1">${companyInfo.companyName!''}</label>
+                            </div>
+                        </#list>
+                    </#if>
                 </div>
-            </div>-->
+            </div>
+            <input value="" id="signclosedCompanyId" name="signclosedCompanyId" type="hidden">
             <div class="row cl">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>快递公司:</label>
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>快递信息:</label>
                 <div class="formControls col-2 col-sm-2 skin-minimal">
                     <span class="select-box">
                     <select id="signclosedLogistics" name="signclosedLogistics" class="select">
-                        <option value="">请选择物流公司</option>
-                        <option value="sto">申通快递</option>
-                        <option value="yto">圆通快递</option>
-                        <option value="sf">顺丰快递</option>
-                        <option value="ems">邮政EMS</option>
-                        <option value="zto">中通快递</option>
-                        <option value="zjs">宅急送</option>
-                        <option value="yunda">韵达快递</option>
-                        <option value="cces">cces快递</option>
-                        <option value="pick">上门提货</option>
-                        <option value="htky">汇通快递</option>
-                        <option value="ttkdex">天天快递</option>
-                        <option value="stars">星晨急便</option>
-                        <option value="jd">京东快递</option>
-                        <option value="01">其他</option>
-                        <option value="02">上门送货</option>
+                        <#if logisticsInfoList?? &&  (logisticsInfoList?size > 0) >
+                            <#list logisticsInfoList as logisticsInfo>
+                                <option value="${logisticsInfo.logisticsRstCode!''}" >${logisticsInfo.logisticsName!''}(${logisticsInfo.logisticsRstCode!''})</option>
+                            </#list>
+                        </#if>
                     </select>
                     </span>
                 </div>
-            </div>
-                <div class="row cl">
-                    <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>快递单号:</label>
-                    <div class="formControls col-2 col-sm-2 skin-minimal">
-                        <input type="text" style="" class="input-text" placeholder="物流单号" id="signclosedLogisticsNumber" name="signclosedLogisticsNumber">
-                    </div>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" style="" class="input-text" placeholder="填写物流单号或条码枪扫描" id="signclosedLogisticsNumber" name="signclosedLogisticsNumber">
                 </div>
+            </div>
                 <div class="row cl">
                     <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收日期:</label>
                     <div class="formControls col-2 col-sm-2 skin-minimal">
@@ -116,30 +101,7 @@
                 </div>
 
 
-            <div class="row cl address_info" style="position: relative;">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>寄件区域:</label>
-                <div class="formControls col-2 col-sm-2" style="">
-                    <span class="select-box">
-                        <select class="select init_province" id="provinces">
-                        </select>
-				    </span>
-                </div>
-                <div class="formControls col-2 col-sm-2">
-                    <span class="select-box">
-                        <select  class="select init_city" id="city">
-                        </select>
-                    </span>
-                </div>
-                <div class="formControls col-2 col-sm-2" style="position: relative;">
-                    <span class="select-box">
-                        <select  class="select init_country" id="area">
-                        </select>
-				    </span>
-                </div>
-                <input type="hidden" name="signclosedAddrProvinces" id="signclosedAddrProvinces" >
-                <input type="hidden" name="signclosedAddrCity" id="signclosedAddrCity" >
-                <input type="hidden" name="signclosedAddrArea" id="signclosedAddrArea" >
-            </div>
+
 
 
                 <div class="row cl" id="" style="">
@@ -153,7 +115,6 @@
                                 <th style="text-align: center;" width="30" >产品名称</th>
                                 <th style="text-align: center;" width="25" >产品颜色</th>
                                 <th style="text-align: center;" width="10">售价</th>
-                                <th style="text-align: center;" width="10">产品编码</th>
                                 <th style="text-align: center;" width="10">数量</th>
                                 <th style="text-align: center;" width="10">操作</th>
                             </tr>
@@ -198,74 +159,42 @@
                         <input type="text" class="input-text" placeholder="寄件方联系电话" id="signclosedSendTel" name="signclosedSendTel">
                     </div>
                 </div>
-
-            <#--<div class="row cl">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否少配件:</label>
-                <div class="formControls col-5 col-sm-5 skin-minimal">
-                    <div class="radio-box">
-                        <input type="radio" id="tel-4" name="signclosedIsFittings" value="1" datatype="*" checked  >
-                        <label for="tel-4">缺少配件</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-5" name="signclosedIsFittings" value="2" datatype="*">
-                        <label for="tel-5">不缺配件</label>
-                    </div>
+            <div class="row cl address_info" style="position: relative;">
+                <label class="form-label col-3 col-sm-3"></label>
+                <div class="formControls col-2 col-sm-2" style="">
+                    <span class="select-box">
+                        <select class="select init_province" id="provinces">
+                        </select>
+				    </span>
                 </div>
-            </div>
-
-
-            <div class="row cl">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否品检:</label>
-                <div class="formControls col-5 col-sm-5 skin-minimal">
-                    <div class="radio-box">
-                        <input type="radio" id="tel-6" name="signclosedIsQuality" value="1" datatype="*" checked  >
-                        <label for="tel-6">需要品检</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-7" name="signclosedIsQuality" value="2" datatype="*">
-                        <label for="tel-7">不需要品检</label>
-                    </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select  class="select init_city" id="city">
+                        </select>
+                    </span>
                 </div>
-            </div>
-            <div class="row cl">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否已转入:</label>
-                <div class="formControls col-5 col-sm-5 skin-minimal">
-                    <div class="radio-box">
-                        <input type="radio" id="tel-8" name="signclosedIsInto" value="1" datatype="*" checked  >
-                        <label for="tel-8">已转入品检</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-9" name="signclosedIsInto" value="2" datatype="*">
-                        <label for="tel-9">未转入品检</label>
-                    </div>
+                <div class="formControls col-2 col-sm-2" style="position: relative;">
+                    <span class="select-box">
+                        <select  class="select init_country" id="area">
+                        </select>
+				    </span>
                 </div>
+                <input type="hidden" name="signclosedAddrProvinces" id="signclosedAddrProvinces" >
+                <input type="hidden" name="signclosedAddrCity" id="signclosedAddrCity" >
+                <input type="hidden" name="signclosedAddrArea" id="signclosedAddrArea" >
             </div>
             <div class="row cl">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否已经签收:</label>
-                <div class="formControls col-5 col-sm-5 skin-minimal">
-                    <div class="radio-box">
-                        <input type="radio" id="tel-10" name="signclosedState" onclick="show();" value="1" datatype="*" checked  >
-                        <label for="tel-10">已签收</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-11" name="signclosedState" onclick="hide();" value="2" datatype="*">
-                        <label for="tel-11">未签收</label>
-                    </div>
+                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>签收图片:</label>
+                <div class="formControls col-xs-2 col-sm-2" id="fileDiv" style="width: 17%;width: 100px;height: 100px;">
+                    <input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;">
+                    <img alt="介绍图" src="${path}/common/images/pts/addparts.jpg" id="partsImg" width="90" height="80">
+                    <#--<input type="hidden" id="componentsImg" name="componentsImg" value=""/>-->
+                <#--<button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="uploadSubmit"><i class="Hui-iconfont">&#xe665;</i> 上传</button>-->
                 </div>
-            </div>
-            <div class="row cl" id="objectsStateId">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>物件状态:</label>
-                <div class="formControls col-5 col-sm-5 skin-minimal">
-                    <div class="radio-box">
-                        <input type="radio" id="tel-12" name="signclosedObjectsState" value="1" datatype="*" checked  >
-                        <label for="tel-12">正常签收</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-13" name="signclosedObjectsState" value="2" datatype="*">
-                        <label for="tel-13">物件不对</label>
-                    </div>
+                <div id="imgDiv">
+
                 </div>
-            </div>-->
+            </div>
             <div class="row cl">
                 <label class="form-label col-3 col-sm-3">备注:</label>
                 <div class="formControls col-5 col-sm-5">
@@ -290,6 +219,7 @@
 <#--<script type="text/javascript" src="${path}/common/lib/cm.lib/dimensions.js"></script>-->
 <script type="text/javascript" src="${path}/common/lib/cm.lib/suggest.js"></script>
 <script type="text/javascript" src="${path}/common/js/common/address.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
 <script type="text/javascript">
 
     /*初始化单选框样式*/
@@ -300,102 +230,50 @@
             increaseArea: '20%'
         });
     });
-    /*初始化省市区*/
-    /*$(".address_info").initAddress();*/
-    var ulc = initAddress($(".address_info"));
-    var sc = initSalesChannel($(".sales_channel"));
-    function hide() {
-        $("#objectsStateId").hide();
-    }
-    function show() {
-        $("#objectsStateId").show();
+    /***
+     * 删除图片
+     */
+    function deleteImg(obj){
+        layer.confirm("确认要删除该图片吗", { title: "确认" }, function (index) {
+            layer.close(index);
+            obj.remove();
+        });
     }
 
-    //动态回显产品js state
-    function selectProduct(){
-        var productName = $("#selectProcuct").val();
-        if(productName == null || productName == ""){
-            var productTable = '<td colspan="3">暂无数据!</td>';
-            $("#addProduct").html(productTable);
-            return false;
-        }
-        $.ajax({
-            cache: true,
-            type: "POST",
-            url: "${path}/admin/signclosed/select_product",
-            data:{'productName':productName},
-            async: false,
-            success: function(data){
-                if (data.returnCode == 200) {
-                    $("#addProduct").html("");
-                    $.each(data.returnMsg.productList,function(i,value) {
-                        var colorTable = '';
-                        var fittingsTable = '';
-
-                        /*var colorlength = value.colorList.length;
-                        var fittingslength = value.fittingsList.length;*/
-                        if(value.colorList != null) {
-                            if (value.colorList.length > 0) {
-                                $.each(value.colorList, function (i, value) {
-                                    colorTable = colorTable + '<td id="tdColorId' + value.colorId + '" style="border: 1px solid #DCDCDC;"><input type="checkbox" value="' + value.colorId + '" name="alreadyColorName" datatype="*">' + value.colorName + ''
-                                            + '<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" oninput="generateInput(' + value.colorId + ')" onpropertychange="generateInput(' + value.colorId + ')"  placeholder="数量" id="alreadyColorId' + value.colorId + '" name="alreadyColorId' + value.colorId + '"><br>' +
-                                            '</td>'
-                                });
-                            }else{
-                                colorTable = '暂无颜色,请先添加产品颜色';
-                            }
-                        }else {
-                            colorTable = '暂无颜色,请先添加产品颜色';
-                        }
-                        if(value.fittingsList != null) {
-                            if (value.fittingsList.length > 0) {
-                                $.each(value.fittingsList, function (i, value) {
-                                    fittingsTable = fittingsTable + '<input type="checkbox" value="' + value.fittingsId + '" name="alreadyFittingsName" datatype="*">' + value.fittingsName + ''
-                                            + '<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="alreadyFittingsId' + value.fittingsId + '" name="alreadyFittingsId' + value.fittingsId + '"><br>'
-                                });
-                            }else{
-                                fittingsTable = '暂无配件,请先添加配件';
-                            }
-                        }else{
-                            fittingsTable = '暂无配件,请先添加配件';
-                        }
-                        var productTable = '<tr">'
-                                +'<td>'+value.productName+'</td>'
-                                +'<td><table border="0">'+colorTable+'</table></td>'
-                                +'<td>'+fittingsTable+'</td>'
-                                +'</tr>';
-                        $("#addProduct").append(productTable);
-                    });
-                }else{
-                    var productTable = '<td colspan="3">暂无数据!</td>';
-                    $("#addProduct").html(productTable);
+    $('#fileid').change(function() {
+        fileUpload();
+    });
+
+    function fileUpload() {
+        $.ajaxFileUpload({
+            url:"${path}/admin/machineParts/fileUpload",
+            secureuri:false,
+            fileElementId:"fileid",//文件选择框的id属性
+            dataType: 'json',   //json
+            success: function (data) {
+                if(data.returnCode == 200){
+                    /*<input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;">*/
+                    $("#imgDiv").append('<div class="col-xs-8 col-sm-8" onclick="deleteImg(this);" style="width: 17%;width: 100px;height: 100px;">'
+                            +'<img  src="'+root_path+data.returnMsg.imgUrl+'"  width="90" height="80">'
+                            +'<input type="hidden"  name="componentsImg" value="'+data.returnMsg.imgUrl+'"/>'
+                            +'</div>');
 
+                }else{
+                    layer.msg('上传失败,请重试!',{icon: 5,time:2000});
                 }
-            },
-            error: function(XmlHttpRequest, textStatus, errorThrown){
-                layer.msg('查询错误,请刷新页面重试',{icon: 5,time:1000});
             }
         });
+        $('#fileid').change(function() {
+            fileUpload();
+        });
     }
 
-    //填写数量后动态生成相同数量的文本框
-    function generateInput(colorId){
-        /*var inputList = "";
-        var number = $("#alreadyColorId"+colorId).val();
-        var machineNumberName = "machineNumber"+colorId;
-        if(!/^\d+$/.test(number)){
-            layer.msg('请输入正确的数量',{icon: 5,time:1000});
-            $('input[name='+machineNumberName+']').remove();
-            return false;
-        }
-        $('input[name='+machineNumberName+']').remove();
-        for (var i = 1;i<=number;i++){
-            inputList = inputList + '<input type="text" class="input-text" style="width: 110px;" placeholder="机器编号" name="machineNumber' + colorId + '" >';
-        }
+    /*初始化省市区*/
+    /*$(".address_info").initAddress();*/
+    var ulc = initAddress($(".address_info"));
+    var sc = initSalesChannel($(".sales_channel"));
 
 
-        $("#tdColorId"+colorId).append(inputList);*/
-    }
 
     //动态回显产品js end
 
@@ -429,15 +307,14 @@
 
 
     function  add() {
+        var typeCompany = parseInt($("input:radio[name='companyId']:checked").val());
+        if(typeCompany === null || typeCompany === ""){
+            layer.msg('请选择所属公司',{icon: 5,time:1000});
+            return;
+        }else{
+            $("#signclosedCompanyId").val(typeCompany);
+        }
 
-        /*var signclosedType = $("#signclosedType").val();
-        if( signclosedType == 3){
-            var signclosedTypeName = $("#signclosedTypeName").val();
-            if( signclosedTypeName == null || signclosedTypeName == "" ) {
-                layer.msg('类型为其他时需填值', {icon: 5, time: 1000});
-                return;
-            }
-        }*/
         var signclosedLogistics = $("#signclosedLogistics").val();
         if( signclosedLogistics == null || signclosedLogistics == "" ){
             layer.msg('请选择物流公司',{icon: 5,time:1000});
@@ -489,9 +366,9 @@
             }
         }
         //设置省市县
-        var provinces = $("#provinces").find("option:selected").text();
-        var city = $("#city").find("option:selected").text();
-        var area = $("#area").find("option:selected").text();
+        var provinces = $("#provinces").find("option:selected").val();
+        var city = $("#city").find("option:selected").val();
+        var area = $("#area").find("option:selected").val();
         $("#signclosedAddrProvinces").val(provinces);
         $("#signclosedAddrCity").val(city);
         $("#signclosedAddrArea").val(area);
@@ -593,12 +470,9 @@
                             var productColor = data.returnMsg.productColorList[i];
                             html += '<tr class="text-c">' +
                                     '<input type="hidden" class="color_id" id="" value="'+ productColor.colorId +'" >' +
-                                    '<input type="hidden" class="color_price" id="" value="'+ productColor.colorPrice +'" >' +
-                                    '<input type="hidden" class="color_discount" id="" value="'+ productColor.colorDiscount +'" >' +
                                     ' <td>'+ cufte(productColor.productName) +'</td>' +
                                     ' <td>'+ cufte(productColor.colorName) +'</td>' +
                                     ' <td>'+ cufte(productColor.colorPrice)/100 +'</td>' +
-                                    ' <td>'+ cufte(productColor.colorBar) +'</td>' +
                                     ' <td><input type="text" class="input-text input-number item-num"  style="width: 100%;border: none;text-align: center;" name="" id="" placeholder="产品数量" value="1" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>' +
                                     ' <td><a href="javascript:void(0)" class="del_product all_down" onclick="delProduct($(this))" >删除</a></td>' +
                                     ' </tr>';

+ 238 - 197
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/complete_signclosed.ftl

@@ -45,6 +45,8 @@
         .table-bg th{background-color: #e2f6ff;}
         .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
         .my-search-input{padding-left: 30px;background: url(${path}/common/images/cm/search.png) 6px center no-repeat;background-size: auto 60%; }
+        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>
     <title>完成签收 - 客诉管理 - RST</title>
 </head>
@@ -60,140 +62,124 @@
     <div class="pd-20 cl">
         <form action="" method="post" class="form form-horizontal" id="form-signclosed-add">
             <div class="row cl">
-                <label class="form-label col-3 col-sm-3">寄送信息:</label>
-                <div class="formControls col-4 col-sm-4">
-                    <#if (signclosedList?size > 0)>
-                        <#list signclosedList as signclosed>
-                        <span class="label label-success radius">
-                            <#if signclosed.signclosedProductType == 1>
-                                ${signclosed.productName!''}-${signclosed.colorName!''}*${signclosed.productNum!''}台
-                            <#else>
-                                ${signclosed.productName!''}*${signclosed.productNum!''}件
-                            </#if>
-                        </span>
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>快递信息:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <span class="select-box">
+                    <select id="signclosedLogistics" name="signclosedLogistics" class="select">
+                    <#if logisticsInfoList?? &&  (logisticsInfoList?size > 0) >
+                        <#list logisticsInfoList as logisticsInfo>
+                            <option value="${logisticsInfo.logisticsRstCode!''}" <#if complaintSignclosedInfo.signclosedLogistics == logisticsInfo.logisticsRstCode>selected</#if>>${logisticsInfo.logisticsName!''}(${logisticsInfo.logisticsRstCode!''})</option>
                         </#list>
                     </#if>
+                    </select>
+                    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" style="" value="${complaintSignclosedInfo.signclosedLogisticsNumber!''}" class="input-text" placeholder="填写物流单号或条码枪扫描" id="signclosedLogisticsNumber" name="signclosedLogisticsNumber">
                 </div>
             </div>
             <div class="row cl">
-                <label class="form-label col-3 col-sm-3">客服备注:</label>
-                <div class="formControls col-4 col-sm-4" style="margin-left: -0.2%">
-                    <#if complaintSignclosedInfo?? >${complaintSignclosedInfo.describeHandleDesc!''}</#if>
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收日期:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" style="" value=""  class="input-text my-input-date Wdate" placeholder="签收日期" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" id="signclosed_date" name="signclosed_date" readonly="readonly"/>
+                    <#--<input type="text" style="" value="${complaintSignclosedInfo.signclosedDate?string("yyyy-MM-dd")!''}"  class="input-text my-input-date Wdate" placeholder="签收日期" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" id="signclosed_date" name="signclosed_date" readonly="readonly"/>-->
                 </div>
             </div>
             <div class="row cl">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>寄回产品:</label>
-                <div class="formControls col-8 col-sm-8 text-c" id="produceSelect">
-                    <div>
-                        <input type="text" oninput="selectProduct();" onpropertychange="selectProduct();" class="input-text" style="width: 100%;" id="selectProcuct" name="selectProcuct" placeholder="请输入产品名称搜索">
-                    </div>
-                    <table class="table table-border table-bg table-bordered">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收产品:</label>
+                <div class="formControls col-8 col-sm-8">
+                    <input type="button" class="btn btn-primary add-order-button" onclick="add_product()" value="添加产品" >
+                    <table class="table table-border table-bg table-bordered" style="margin-top: 10px;" id="all_add_product">
                         <thead>
-                        <tr class="text-c">
-                            <th style="text-align: center;" width="80">产品名称</th>
-                            <th style="text-align: center;" width="130">产品颜色</th>
-                            <th style="text-align: center;" width="100">产品配件</th>
+                        <tr class="text-c" id="table1">
+                            <th style="text-align: center;" width="30" >产品名称</th>
+                            <th style="text-align: center;" width="25" >产品颜色</th>
+                            <th style="text-align: center;" width="10">售价</th>
+                            <th style="text-align: center;" width="10">数量</th>
+                            <th style="text-align: center;" width="10">操作</th>
                         </tr>
                         </thead>
-                        <tbody id="addProduct">
-                        <#if (signclosedList?size > 0)>
-                            <#list signclosedList as signclosed>
-                            <tr>
-                                <#if signclosed.signclosedProductType == 1>
-                                <td>${signclosed.productName!''}</td>
-                                <td style="margin: 0px;padding: 0px;height: 20px;">
-                                    <table border="0">
-                                        <td id="tdColorId${signclosed.signclosedProductColor!''}" style="border-top: 1px solid #ddd;">
-                                            <input type="checkbox" checked value="${signclosed.signclosedProductColor!''}" name="alreadyColorName" datatype="*">${signclosed.colorName!''}
-                                            <input type="text" style="width: 50px;margin-left: 10px;" value="${signclosed.productNum!''}" class="input-text" oninput="generateInput( ${signclosed.signclosedProductColor!''})" onpropertychange="generateInput(${signclosed.signclosedProductColor!''})"  placeholder="数量" id="alreadyColorId${signclosed.signclosedProductColor!''}" name="alreadyColorId${signclosed.signclosedProductColor!''}"><br>
-                                            <#list 1..signclosed.productNum as t>
-                                                <input type="text" class="input-text" style="width: 110px;" placeholder="机器编号" name="machineNumber${signclosed.signclosedProductColor!''}" >
-                                            </#list>
-                                         </td>
-                                    </table>
-                                </td>
-                                <td> </td>
+                        <tbody id="add_product">
+                            <#if complaintSignclosedInfo.signclosedProductInfoList??>
+                                <#if (complaintSignclosedInfo.signclosedProductInfoList?size > 0)>
+                                    <#list complaintSignclosedInfo.signclosedProductInfoList as info>
+                                    <tr class="text-c">
+                                        <input type="hidden" class="color_id" id="" value="${info.signclosedProductColor!''}" >
+                                         <td>${info.productName!''}</td>
+                                         <td>${info.colorName!''}</td>
+                                         <td>${info.colorPrice!''}</td>
+                                         <td><input type="text" class="input-text input-number item-num"  style="width: 100%;border: none;text-align: center;" name="" id="" placeholder="产品数量" value="${info.productNum!''}" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>
+                                         <td><a href="javascript:void(0)" class="del_product all_down" onclick="delProduct($(this))" >删除</a></td>
+                                         </tr>
+                                    </#list>
                                 </#if>
-                                <#if signclosed.signclosedProductType == 2>
-                                <td></td>
-                                <td></td>
-                                <td><input type="checkbox" checked value="${signclosed.signclosedProductId!''}" name="alreadyFittingsName" datatype="*">${signclosed.productName!''}
-                                    <input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="${signclosed.productNum!''}" placeholder="数量" id="alreadyFittingsId${signclosed.signclosedProductId!''}" name="alreadyFittingsId${signclosed.signclosedProductId!''}"><br>
-                                </td>
-                                </#if>
-                            </tr>
-                            </#list>
-                        </#if>
+                            </#if>
                         </tbody>
                     </table>
-                </div>
-            </div>
 
+                    <input type="hidden" id="orderItemString" name="orderItemString" value="" >
 
+                </div>
+            </div>
             <div class="row cl">
                 <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>寄件人信息:</label>
-                <div class="formControls col-4 col-sm-4" style="margin-left: -0.9%">
-                    <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" placeholder="寄件方姓名/公司名称" id="signclosedSendName" name="signclosedSendName" onkeyup="value=value.replace(/[A-Za-z\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[A-Za-z\d]/g,''))">
-                    <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" placeholder="寄件方联系电话" id="signclosedSendTel" name="signclosedSendTel">
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" value="${complaintSignclosedInfo.signclosedSendName!''}" class="input-text" placeholder="寄件方姓名/公司名称" id="signclosedSendName" name="signclosedSendName">
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" value="${complaintSignclosedInfo.signclosedSendTel!''}" class="input-text" placeholder="寄件方联系电话" id="signclosedSendTel" name="signclosedSendTel">
                 </div>
             </div>
 
-            <div class="row cl" style="position: relative;">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>寄件区域:</label>
-                <div class="formControls col-4 col-sm-4 skin-minimal">
-                    <span class="select-box" style="width: 150px;">
-                    <select name="signclosedAddrProvinces" id="province" class="select">
+            <div class="row cl address_info" style="position: relative;">
+                <label class="form-label col-3 col-sm-3"></label>
+                <div class="formControls col-2 col-sm-2" style="">
+                    <span class="select-box">
+                        <select class="select init_province" id="provinces">
 
-                    </select>
-                     </span>
-                    <span class="select-box" style="width: 150px;margin-left: 7px;">
-                    <select name="signclosedAddrCity" id="city" class="select">
-
-                    </select>
+                        </select>
+				    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select  class="select init_city" id="city" >
+                        </select>
                     </span>
                 </div>
-                <div class="formControls col-3 col-sm-3 skin-minimal">
-
-                </div>
-            </div>
-            <div class="row cl">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收日期:</label>
-                <div class="formControls col-5 col-sm-5 skin-minimal" style="margin-left: -0.9%">
-                    <input type="text" style="width: 150px;margin-left: 10px;" class="input-text my-input-date Wdate" placeholder="签收日期" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" id="signclosed_date" name="signclosed_date" readonly="readonly"/>
+                <div class="formControls col-2 col-sm-2" style="position: relative;">
+                    <span class="select-box">
+                        <select  class="select init_country" id="area" >
+                        </select>
+				    </span>
                 </div>
+                <input type="hidden" name="signclosedAddrProvinces" id="signclosedAddrProvinces" >
+                <input type="hidden" name="signclosedAddrCity" id="signclosedAddrCity" >
+                <input type="hidden" name="signclosedAddrArea" id="signclosedAddrArea" >
             </div>
 
             <div class="row cl">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否少配件:</label>
-                <div class="formControls col-5 col-sm-5 skin-minimal">
-                    <div class="radio-box">
-                        <input type="radio" id="tel-5" name="signclosedIsFittings" value="2" datatype="*" checked>
-                        <label for="tel-5">不缺配件</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-4" name="signclosedIsFittings" value="1" datatype="*">
-                        <label for="tel-4">缺少配件</label>
-                    </div>
+                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>签收图片:</label>
+                <div class="formControls col-xs-2 col-sm-2" id="fileDiv" style="width: 17%;width: 100px;height: 100px;">
+                    <input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;">
+                    <img alt="介绍图" src="${path}/common/images/pts/addparts.jpg" id="partsImg" width="90px;" height="80px;">
                 </div>
-            </div>
-
-            <div class="row cl" id="objectsStateId">
-                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>物件状态:</label>
-                <div class="formControls col-5 col-sm-5 skin-minimal">
-                    <div class="radio-box">
-                        <input type="radio" id="tel-12" name="signclosedObjectsState" value="1" datatype="*" checked  >
-                        <label for="tel-12">正常签收</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-13" name="signclosedObjectsState" value="2" datatype="*">
-                        <label for="tel-13">物件不对</label>
-                    </div>
+                <div id="imgDiv">
+                <#if complaintSignclosedInfo.signclosedImgInfoList??>
+                    <#if (complaintSignclosedInfo.signclosedImgInfoList?size > 0)>
+                        <#list complaintSignclosedInfo.signclosedImgInfoList as info>
+                            <div class="col-xs-8 col-sm-8" onclick="deleteImg(this);" style="width: 17%;width: 100px;height: 100px;">
+                                <img  src="${info.imgUrl!''}"  width="90" height="80">
+                                <input type="hidden"  name="componentsImg" value="${info.imgUrl!''}"/>
+                            </div>
+                        </#list>
+                    </#if>
+                </#if>
                 </div>
             </div>
             <div class="row cl">
                 <label class="form-label col-3 col-sm-3">备注:</label>
                 <div class="formControls col-5 col-sm-5">
-                    <textarea name="signclosedDesc" id="signclosedDesc" cols="" rows="2" class="textarea" placeholder="请填写备注"></textarea>
+                    <textarea name="signclosedDesc" id="signclosedDesc" cols="" rows="2" class="textarea" placeholder="请填写备注">${complaintSignclosedInfo.signclosedDesc!''}</textarea>
                 </div>
             </div>
             <div class="row cl">
@@ -214,6 +200,8 @@
 <script type="text/javascript" src="${path}/common/lib/cm.lib/airCity.js"></script>
 <#--<script type="text/javascript" src="${path}/common/lib/cm.lib/dimensions.js"></script>-->
 <script type="text/javascript" src="${path}/common/lib/cm.lib/suggest.js"></script>
+<script type="text/javascript" src="${path}/common/js/common/address.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
 <script type="text/javascript">
 
     /*初始化单选框样式*/
@@ -225,114 +213,105 @@
         });
     });
 
-    //动态回显产品js state
-    function selectProduct(){
-        var productName = $("#selectProcuct").val();
-        if(productName == null || productName == ""){
-            var productTable = '<td colspan="3">暂无数据!</td>';
-            $("#addProduct").html(productTable);
-            return false;
-        }
-        $.ajax({
-            cache: true,
-            type: "POST",
-            url: "${path}/admin/signclosed/select_product",
-            data:{'productName':productName},
-            async: false,
-            success: function(data){
-                if (data.returnCode == 200) {
-                    $("#addProduct").html("");
-                    $.each(data.returnMsg.productList,function(i,value) {
-                        var colorTable = '';
-                        var fittingsTable = '';
+    /***
+     * 删除图片
+     */
+    function deleteImg(obj){
+        layer.confirm("确认要删除该图片吗", { title: "确认" }, function (index) {
+            layer.close(index);
+            obj.remove();
+        });
+    }
 
-                        /*var colorlength = value.colorList.length;
-                        var fittingslength = value.fittingsList.length;*/
-                        if(value.colorList != null) {
-                            if (value.colorList.length > 0) {
-                                $.each(value.colorList, function (i, value) {
-                                    colorTable = colorTable + '<td id="tdColorId' + value.colorId + '" style="border-top: 1px solid #ddd; "><input type="checkbox" value="' + value.colorId + '" name="alreadyColorName" datatype="*">' + value.colorName + ''
-                                            + '<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" oninput="generateInput(' + value.colorId + ')" onpropertychange="generateInput(' + value.colorId + ')"  placeholder="数量" id="alreadyColorId' + value.colorId + '" name="alreadyColorId' + value.colorId + '"><br>' +
-                                            '</td>'
-                                });
-                            }else{
-                                colorTable = '<span>暂无颜色,请先添加产品颜色</span>';
-                            }
-                        }else {
-                            colorTable = '<span>暂无颜色,请先添加产品颜色</span>';
-                        }
-                        if(value.fittingsList != null) {
-                            if (value.fittingsList.length > 0) {
-                                $.each(value.fittingsList, function (i, value) {
-                                    fittingsTable = fittingsTable + '<input type="checkbox" style="margin-left: 5px;" value="' + value.fittingsId + '" name="alreadyFittingsName" datatype="*">' + value.fittingsName + ''
-                                            + '<input type="text" style="width: 50px;" class="input-text" value="" placeholder="数量" id="alreadyFittingsId' + value.fittingsId + '" name="alreadyFittingsId' + value.fittingsId + '"><br>'
-                                });
-                            }else{
-                                fittingsTable = '<span>暂无配件,请先添加配件</span>';
-                            }
-                        }else{
-                            fittingsTable = '<span>暂无配件,请先添加配件</span>';
-                        }
-                        var productTable = '<tr>'
-                                +'<td>'+value.productName+'</td>'
-                                +'<td style="margin: 0px;padding: 0px;height: 20px;"><table border="0" style="height: 65px;">'+colorTable+'</table></td>'
-                                +'<td style="margin: 0px;padding: 0px;height: 20px;">'+fittingsTable+'</td>'
-                                +'</tr>';
-                        $("#addProduct").append(productTable);
-                    });
-                }else{
-                    var productTable = '<td colspan="3">暂无数据!</td>';
-                    $("#addProduct").html(productTable);
+    $('#fileid').change(function() {
+        fileUpload();
+    });
+
+    function fileUpload() {
+        $.ajaxFileUpload({
+            url:"${path}/admin/machineParts/fileUpload",
+            secureuri:false,
+            fileElementId:"fileid",//文件选择框的id属性
+            dataType: 'json',   //json
+            success: function (data) {
+                if(data.returnCode == 200){
+                    /*<input type="file" name="file" id="fileid" style="opacity: 0; position: absolute; width: 90px;height: 80px;">*/
+                    $("#imgDiv").append('<div class="col-xs-8 col-sm-8" onclick="deleteImg(this);" style="width: 17%;width: 100px;height: 100px;">'
+                            +'<img  src="'+root_path+data.returnMsg.imgUrl+'"  width="90" height="80">'
+                            +'<input type="hidden"  name="componentsImg" value="'+data.returnMsg.imgUrl+'"/>'
+                            +'</div>');
 
+                }else{
+                    layer.msg('上传失败,请重试!',{icon: 5,time:2000});
                 }
-            },
-            error: function(XmlHttpRequest, textStatus, errorThrown){
-                layer.msg('查询错误,请刷新页面重试',{icon: 5,time:1000});
             }
         });
+        $('#fileid').change(function() {
+            fileUpload();
+        });
+    }
+    /*初始化省市区*/
+    /*$(".address_info").initAddress();*/
+    /*var ulc = initAddress($(".address_info"));
+    var sc = initSalesChannel($(".sales_channel"));*/
+    var provicesId = setAddressPro();
+    var cityId = setAddressCity('${complaintSignclosedInfo.signclosedAddrProvinces!''}');
+    setAddressDis('${complaintSignclosedInfo.signclosedAddrCity!''}');
+   /*alert('${complaintSignclosedInfo.signclosedAddrProvinces!''}'+'${complaintSignclosedInfo.signclosedAddrCity!''}');*/
+    /*设置省*/
+    function setAddressPro(){
+        var provinceHtml = "";
+        var provices = listProvince();
+        for(var i=0;i<provices.length;i++){
+            provinceHtml += '<option value="'+ provices[i].provinceId +'">'+ provices[i].province +'</option>';
+        }
+        $("#provinces").html(provinceHtml);
+        $("#provinces").val('${complaintSignclosedInfo.signclosedAddrProvinces!''}');
+        return provices[0].provinceId;
     }
 
-    //填写数量后动态生成相同数量的文本框
-    function generateInput(colorId){
-        var inputList = "";
-        var number = $("#alreadyColorId"+colorId).val();
-        var machineNumberName = "machineNumber"+colorId;
-        if(!/^\d+$/.test(number)){
-            layer.msg('请输入正确的数量',{icon: 5,time:1000});
-            $('input[name='+machineNumberName+']').remove();
-            return false;
+    /*设置市*/
+    function setAddressCity(proId){
+        var cityHtml = ''
+        var city = listCity( proId,"");
+        for(var i=0;i<city.length;i++){
+            cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
         }
-        $('input[name='+machineNumberName+']').remove();
-        for (var i = 1;i<=number;i++){
-            inputList = inputList + '<input type="text" class="input-text" style="width: 110px;" placeholder="机器编号" name="machineNumber' + colorId + '" >';
+        $("#city").html(cityHtml);
+        $("#city").val('${complaintSignclosedInfo.signclosedAddrCity!''}');
+        return  city[0].cityId;
+    }
+    /*设置区*/
+    function setAddressDis(cityId){
+        var districtHtml = ''
+        var district = listDistrict(cityId ,"");
+        for(var i=0;i<district.length;i++){
+            districtHtml += '<option value="'+ district[i].districtId +'">'+ district[i].district +'</option>';
         }
-
-
-        $("#tdColorId"+colorId).append(inputList);
+        $("#area").html(districtHtml);
+        $("#area").val('${complaintSignclosedInfo.signclosedAddrArea!''}');
     }
-    //动态回显产品js end
-
 
 
     $(function(){
-        var province = listProvince(null,null);
+        /*var province = listProvince(null,null);
         var provinceHtml = '';
         for(var i=0;i<province.length;i++){
-                provinceHtml += '<option value="'+ province[i].provinceId +'">'+ province[i].province +'</option>';
+            provinceHtml += '<option value="'+ province[i].provinceId +'">'+ province[i].province +'</option>';
         }
-        $("#province").html(provinceHtml);
+        $("#provinces").html(provinceHtml);
 
-       var city = listCity(null,null);
+        var city = listCity(null,null);
         var cityHtml = '';
         for(var i=0;i<city.length;i++){
             cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
         }
-        $("#city").html(cityHtml);
+        $("#city").html(cityHtml);*/
 
 
         /*监听省选择事件*/
-        $(document).on('change', '#province', function() {
-            var proId = $("#province").val();
+        $(document).on('change', '#provinces', function() {
+            var proId = $("#provinces").val();
             var city = listCity(proId,null);
             var cityHtml = '';
             for(var i=0;i<city.length;i++){
@@ -340,20 +319,42 @@
             }
             $("#city").html(cityHtml);
         });
+        /*监听市选择事件*/
+        $(document).on('change', '#city', function() {
+            var city = $("#city").val();
+            setAddressDis(city);
+        });
     });
 
 
     function  add() {
+        var typeCompany = parseInt($("input:radio[name='companyId']:checked").val());
+        if(typeCompany === null || typeCompany === ""){
+            layer.msg('请选择所属公司',{icon: 5,time:1000});
+            return;
+        }else{
+            $("#signclosedCompanyId").val(typeCompany);
+        }
+
+        var signclosedLogistics = $("#signclosedLogistics").val();
+        if( signclosedLogistics == null || signclosedLogistics == "" ){
+            layer.msg('请选择物流公司',{icon: 5,time:1000});
+            return;
+        }
+        var signclosedLogisticsNumber = $("#signclosedLogisticsNumber").val();
+        if( signclosedLogisticsNumber == null || signclosedLogisticsNumber == "" ){
+            layer.msg('物流单号不能为空',{icon: 5,time:1000});
+            return;
+        }
+        if( signclosedLogisticsNumber.length > 300 ){
+            layer.msg('物流单号长度不得大于20个字符',{icon: 5,time:1000});
+            return;
+        }
         var signclosedSendName = $("#signclosedSendName").val();
         if( signclosedSendName == null || signclosedSendName == "" ){
             layer.msg('寄件人姓名不能为空',{icon: 5,time:1000});
             return;
         }
-        /*var reg=/^[\u2E80-\u9FFF]+$/;
-        if(!reg.text(signclosedSendName)){
-            layer.msg('寄件人姓名格式错误',{icon: 5,time:1000});
-            return;
-        }*/
         if( signclosedSendName.length > 10 ){
             layer.msg('寄件人姓名长度不得大于10个字符',{icon: 5,time:1000});
             return;
@@ -367,16 +368,17 @@
             layer.msg('寄件人电话长度不得大于11个字符',{icon: 5,time:1000});
             return;
         }
-        var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
+        /*var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
         if(!myreg.test(signclosedSendTel)){
             layer.msg('寄件人电话格式不正确',{icon: 5,time:1000});
             return;
-        }
+        }*/
         var signclosed_date = $("#signclosed_date").val();
         if( signclosed_date == null || signclosed_date == "" ){
-            layer.msg('签收日期不能为空',{icon: 5,time:1000});
+            layer.msg('请选择签收日期',{icon: 5,time:1000});
             return;
         }
+
         var signclosedDesc = $("#signclosedDesc").val();
         if( signclosedDesc != null || signclosedDesc == "" ){
             if( signclosedDesc.length > 300 ){
@@ -384,6 +386,32 @@
                 return;
             }
         }
+        //设置省市县
+        var provinces = $("#provinces").find("option:selected").val();
+        var city = $("#city").find("option:selected").val();
+        var area = $("#area").find("option:selected").val();
+        $("#signclosedAddrProvinces").val(provinces);
+        $("#signclosedAddrCity").val(city);
+        $("#signclosedAddrArea").val(area);
+
+        //选择产品
+        var flag = false;
+        /*封装订单项*/
+        var orderItemArray = new Array();
+        $("#add_product").find("tr").each(function(){
+            var orderItem = new Object();
+            orderItem.itemColorId = $(this).find(".color_id").val();
+            orderItem.itemNum = $(this).find(".item-num").val();
+            orderItemArray.push(orderItem);
+            flag = true;
+        })
+        if(!flag){
+            vailErrorMsg($(".add-order-button"),"必须要有一个产品");
+            return false;
+        }
+
+        $("#orderItemString").val(JSON.stringify(orderItemArray));
+
         $.ajax({
             cache: true,
             type: "POST",
@@ -392,15 +420,15 @@
             async: false,
             success: function(data){
                 if (data.returnCode == 200) {
-                    //询问框
-                    layer.msg('签收成功,请及时转入品检部门',{icon: 1,time:3000},function () {
+                    layer.msg('签收成功',{icon: 1,time:1000},function () {
+                        location.replace(location.href);
                         window.location.href= "${path}/admin/signclosed/select_signclosed_list";
                     });
-                } else if(data.returnCode == 501) {
-                    layer.msg('机器编号未填写',{icon: 5,time:1000});
                 } else if(data.returnCode == 502) {
                     layer.msg('请至少选择一件已签收的产品',{icon: 5,time:1000});
-                }else {
+                } else if(data.returnCode == 503) {
+                    layer.msg('有产品数量未填写,如本次签收没有此产品,请删除',{icon: 5,time:1000});
+                }else{
                     layer.msg('添加失败',{icon: 5,time:1000});
                 }
             },
@@ -409,6 +437,19 @@
             }
         });
     }
+    /**
+     *  删除商品
+     */
+    function delProduct($this){
+        $this.parents("tr").remove();
+    }
+
+    /**
+     * 打开商品列表
+     */
+    function add_product() {
+        layer_show("商品列表", "${path}/admin/salesOrder/to_add_product","1000","500");
+    }
 </script>
 <!--/请在上方写此页面业务相关的脚本-->
 </body>

+ 9 - 44
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/customer_signclosed_list.ftl

@@ -53,7 +53,7 @@
         <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="160">物流</th>
                 <th width="120">寄件人姓名</th>
                 <th width="120">寄件人电话</th>
@@ -71,45 +71,10 @@
             <#if (page.dataList?size > 0)>
                 <#list page.dataList as signclosed>
                 <tr>
-                    <#--<td class="text-c" width="100">${signclosed.signclosedCustomerId!}</td>-->
-
+                    <td class="text-c" width="100" style="color: #FF0000" >待客服联系</td>
                     <td class="text-c" width="160">
                         <#if signclosed.signclosedLogistics??>
-                            <#if signclosed.signclosedLogistics == "sto">
-                                申通快递
-                            <#elseif signclosed.signclosedLogistics == "yto">
-                                圆通快递
-                            <#elseif signclosed.signclosedLogistics == "zto">
-                                中通速递
-                            <#elseif signclosed.signclosedLogistics == "sf">
-                                顺丰快递
-                            <#elseif signclosed.signclosedLogistics == "ems">
-                                邮政EMS
-                            <#elseif signclosed.signclosedLogistics == "eyb">
-                                E邮宝
-                            <#elseif signclosed.signclosedLogistics == "zjs">
-                                宅急送
-                            <#elseif signclosed.signclosedLogistics == "yunda">
-                                韵达快递
-                            <#elseif signclosed.signclosedLogistics == "cces">
-                                cces快递
-                            <#elseif signclosed.signclosedLogistics == "pick">
-                                上门提货
-                            <#elseif signclosed.signclosedLogistics == "htky">
-                                汇通快递
-                            <#elseif signclosed.signclosedLogistics == "ttkdex">
-                                天天快递
-                            <#elseif signclosed.signclosedLogistics == "stars">
-                                星晨急便
-                            <#elseif signclosed.signclosedLogistics == "jd">
-                                京东快递
-                            <#elseif signclosed.signclosedLogistics == "01">
-                                其他
-                            <#elseif signclosed.signclosedLogistics == "02">
-                                上门送货
-                            <#elseif signclosed.signclosedLogistics == "longbanwuliu">
-                                龙邦快递
-                            </#if>
+                        ${signclosed.signclosedLogistics!}
                             -
                         </#if>
                     ${signclosed.signclosedLogisticsNumber!}</td>
@@ -134,14 +99,14 @@
                         </#if>
                         </div>
                     </td>
-                    <td class="text-c" width="100"><#if signclosed.signclosedState??>
-                        <#if signclosed.signclosedState == 1>
+                    <td class="text-c" width="100"><#if signclosed.signclosedIsReceiving??>
+                        <#if signclosed.signclosedIsReceiving == 1>
                             已签收
-                        <#elseif signclosed.signclosedState == 2>
-                            已移交QC
+                        <#elseif signclosed.signclosedIsReceiving == 2>
+                            未签收
                         </#if>
                     </#if></td>
-                    <td class="text-c" width="100">${signclosed.signclosedAddrProvinces!}-${signclosed.signclosedAddrCity!}-${signclosed.signclosedAddrArea!}</td>
+                    <td class="text-c" width="100">${signclosed.signclosedAddrProvincesName!}-${signclosed.signclosedAddrCityName!}-${signclosed.signclosedAddrAreaName!}</td>
                     <#--<td class="text-c" width="100"><span class="label txt2" title="${signclosed.customerIdDescribe!}" >${signclosed.customerIdDescribe!}</span><br><#if signclosed.customerIdDescribe??><#if signclosed.customerIdDescribe != ""><a href="#" onclick="getDescribeInfo(${signclosed.signclosedCustomerId!});"style="color : #4149FF;">查看详情</a></#if></#if></td>
                     <td class="text-c" width="100">${signclosed.signclosedCustomerDesc!}</td>-->
                     <td class="text-c" width="100">${(signclosed.signclosedDate?string("yyyy-MM-dd"))!''}</td>
@@ -167,7 +132,7 @@
                 </tr>
                 </#list>
             <#else >
-            <tr><td class="td-manage text-c" colspan = "16">暂时没有仓储信息</td></tr>
+            <tr><td class="td-manage text-c" colspan = "16">暂时没有带关联信息</td></tr>
             </#if>
             </tbody>
         </table>

+ 45 - 26
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/signclosed_list.ftl

@@ -34,7 +34,7 @@
 <body>
 <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
     <span class="c-gray en">&gt;</span> RST管理
-    <span class="c-gray en">&gt;</span> 仓储列表
+    <span class="c-gray en">&gt;</span> 签收列表
     <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
 </nav>
 <div class="page-container">
@@ -63,16 +63,19 @@
         <table class="table table-border table-bordered table-bg table-hover table-sort">
             <thead>
             <tr class="text-c">
+                <th width="50">签收ID</th>
                 <th width="50">客诉编号</th>
+                <th width="90">售后原因</th>
+                <th width="90">物流状态</th>
                 <th width="160">物流</th>
                 <th width="100">寄件人姓名</th>
                 <th width="100">寄件人电话</th>
                 <th width="250">签收产品</th>
-                <th width="100">状态</th>
                 <th width="130">退货地区</th>
-                <th width="90">售后原因</th>
-                <th width="150">客服备注</th>
+
+                <#--<th width="150">客服备注</th>-->
                 <th width="150">签收日期</th>
+                <th width="150">签收图片</th>
                 <th width="100">备注</th>
                 <th width="50">操作</th>
             </tr>
@@ -81,10 +84,21 @@
             <#if (page.dataList?size > 0)>
                 <#list page.dataList as signclosed>
                 <tr>
+                    <td class="text-c" width="70">${signclosed.signclosedId!}</td>
                     <td class="text-c" width="70">${signclosed.signclosedCustomerId!}</td>
+                    <td class="text-c" width="100">${signclosed.customerIdDescribe!}</td>
+                    <td class="text-c" width="100">
+                        <#if signclosed.signclosedIsReceiving??>
+                            <#if signclosed.signclosedIsReceiving == 1>
+                                待签收
+                            <#elseif signclosed.signclosedIsReceiving == 2>
+                                已签收
+                            </#if>
+                        </#if>
+                    </td>
                     <td class="text-c" width="160">
                         <#if signclosed.signclosedLogistics??>
-                            <#if signclosed.signclosedLogistics == "sto">
+                            <#--<#if signclosed.signclosedLogistics == "sto">
                                 申通快递
                             <#elseif signclosed.signclosedLogistics == "yto">
                                 圆通快递
@@ -118,7 +132,8 @@
                                 上门送货
                             <#elseif signclosed.signclosedLogistics == "longbanwuliu">
                                 龙邦快递
-                            </#if>
+                            </#if>-->
+                        ${signclosed.signclosedLogistics!}
                             -
                         </#if>
                     ${signclosed.signclosedLogisticsNumber!}</td>
@@ -129,11 +144,11 @@
                         <#if signclosed.signclosedProductInfoList??>
                             <#if (signclosed.signclosedProductInfoList?size > 0)>
                                 <#list signclosed.signclosedProductInfoList as info>
-                                    <#if info.signclosedProductType == 1 >
+                                    <#--<#if info.signclosedProductType == 1 >
                                         <span class="label label-success radius" title="${info.productName!''}-${info.productNumber!''}(${info.colorName!''})x ${info.productNum!''}台">${info.productName!''}-${info.productNumber!''}(${info.colorName!''})x ${info.productNum!''}台</span><br>
-                                    <#else >
-                                        <span class="label label-success radius" title="${info.productName!''} x ${info.productNum!''}件">${info.productName!''} x ${info.productNum!''}件>${info.productName!''} x ${info.productNum!''}件</span><br>
-                                    </#if>
+                                    <#else >-->
+                                        <span class="label label-success radius" title="${info.productName!''} x ${info.productNum!''}件">${info.productName!''} x ${info.productNum!''}件</span><br>
+                                    <#--</#if>-->
                                 </#list>
                             <#else >
                                 暂无数据!
@@ -143,18 +158,17 @@
                         </#if>
                         </div>
                     </td>
-                    <td class="text-c" width="100"><#if signclosed.signclosedState??>
-                        <#if signclosed.signclosedState == 1>
-                            已签收
-                        <#elseif signclosed.signclosedState == 2>
-                            已移交QC
-                        </#if>
-                    </#if></td>
-                    <td class="text-c" width="100">${signclosed.signclosedAddrProvinces!}-${signclosed.signclosedAddrCity!}-${signclosed.signclosedAddrArea!}</td>
-                    <td class="text-c" width="100">${signclosed.customerIdDescribe!}</td>
-                    <td class="text-c" width="100">${signclosed.signclosedCustomerDesc!}</td>
+                    <td class="text-c" width="100">${signclosed.signclosedAddrProvincesName!}-${signclosed.signclosedAddrCityName!}-${signclosed.signclosedAddrAreaName!}</td>
+                    <#--<td class="text-c" width="100">${signclosed.signclosedCustomerDesc!}</td>-->
                     <td class="text-c" width="100">${(signclosed.signclosedDate?string("yyyy-MM-dd"))!''}</td>
+                    <td class="text-c" width="100">
+                        <#if (signclosed.signclosedImgInfoList?size > 0)>
+                            <#list signclosed.signclosedImgInfoList as signclosedImgInfo>
+                                <img src="${signclosedImgInfo.imgUrl!}" style="widows: 50px;height: 50px;">
+                            </#list>
+                        </#if>
 
+                    </td>
                     <td class="text-c" width="100">${signclosed.signclosedDesc!}</td>
                     <!-- 遍历操作 -->
                     <td class="td-manage text-c">
@@ -170,25 +184,30 @@
                             <a style="text-decoration:none" href="javascript:;" title="修改寄件人信息"
                                onclick="add_remark('修改寄件人信息','${path}/admin/signclosed/to_update_sender?signclosedId=${signclosed.signclosedId!''}','570','450');">
                                 <i class="Hui-iconfont">&#xe60c;</i>
-                            </a>
-                            <#if signclosed.signclosedState == 1>
+                            </a><#--
                             <a style="text-decoration:none" href="javascript:;" title="转入品检"
                                onclick="into_complaint('转入品检','${path}/admin/signclosed/to_into_complaint?signclosedId=${signclosed.signclosedId!''}','770','600');">
                                 <i class="Hui-iconfont">&#xe644;</i>
-                            </a>
-                            </#if>
+                            </a>-->
                             <#--<#if !signclosed.signclosedCustomerId??>
                                 <a style="text-decoration:none" href="javascript:;" title="关联客诉"
                                    onclick="associated_customer('关联客诉','${path}/admin/signclosed/to_associated_customer?signclosedId=${signclosed.signclosedId!''}','570','450');">
                                     <i class="Hui-iconfont">&#xe6f1;</i>
                                 </a>
                             </#if>-->
-
+                        <#if signclosed.signclosedIsReceiving??>
+                            <#if signclosed.signclosedIsReceiving == 1>
+                                <a style="text-decoration:none" href="javascript:;" title="签收"
+                                   onclick="update_info('${path}/admin/signclosed/to_complete_signclosed?signclosedId=${signclosed.signclosedId!''}');">
+                                    <i class="Hui-iconfont">签收</i>
+                                </a>
+                            </#if>
+                        </#if>
                     </td>
                 </tr>
                 </#list>
             <#else >
-            <tr><td class="td-manage text-c" colspan = "16">暂时没有仓储信息</td></tr>
+            <tr><td class="td-manage text-c" colspan = "16">暂时没有签收信息</td></tr>
             </#if>
             </tbody>
         </table>

BIN
watero-rst-web/src/main/webapp/common/images/Conform.jpg


BIN
watero-rst-web/src/main/webapp/common/images/noConform.jpg