瀏覽代碼

优尼雅售后系统上线

xian 4 年之前
父節點
當前提交
480c2fba89
共有 45 個文件被更改,包括 3808 次插入1160 次删除
  1. 12 8
      watero-common-tool/src/main/java/com/iamberry/wechat/tools/StrUtils.java
  2. 49 10
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CompanyInfo.java
  3. 11 2
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ProcMethod.java
  4. 248 67
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectInfo.java
  5. 49 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/DetectCustmoerPhenomenon.java
  6. 49 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/DetectPhenomenon.java
  7. 159 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/DetectTransport.java
  8. 99 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/MaintainPhenomenon.java
  9. 50 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/fm/MaintainType.java
  10. 9 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/pts/Produce.java
  11. 14 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintDetectInfoService.java
  12. 20 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/MaintainPhenomenonMapper.java
  13. 61 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/MaintainPhenomenonMapper.xml
  14. 22 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/MaintainTypeMapper.java
  15. 35 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/MaintainTypeMapper.xml
  16. 14 25
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/companyInfoMapper.xml
  17. 17 35
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/procMethodMapper.xml
  18. 436 119
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintDetectInfoServiceImpl.java
  19. 84 63
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintSignclosedInfoServiceImpl.java
  20. 16 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/ComplaintDetectInfoMapper.java
  21. 21 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/DetectCustmoerPhenomenonMapper.java
  22. 43 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/DetectCustmoerPhenomenonMapper.xml
  23. 15 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/DetectTransportMapper.java
  24. 75 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/DetectTransportMapper.xml
  25. 69 105
      watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/complaintDetectInfoMapper.xml
  26. 5 4
      watero-rst-service/src/main/java/com/iamberry/rst/service/order/OrderSyncLogServiceImpl.java
  27. 315 9
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminAfterSaleController.java
  28. 8 4
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java
  29. 1 9
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java
  30. 1 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/detectController.java
  31. 6 6
      watero-rst-web/src/main/resources/dev-jdbc.properties
  32. 1 1
      watero-rst-web/src/main/resources/log4j.properties
  33. 10 0
      watero-rst-web/src/main/resources/watero-rst-orm.xml
  34. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl
  35. 136 83
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_relation.ftl
  36. 286 286
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_detail.ftl
  37. 180 82
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl
  38. 168 92
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_msg.ftl
  39. 133 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/print.ftl
  40. 62 9
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/update_complete.ftl
  41. 52 8
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/update_detect.ftl
  42. 463 37
      watero-rst-web/src/main/webapp/WEB-INF/views/yulia/add.ftl
  43. 161 0
      watero-rst-web/src/main/webapp/WEB-INF/views/yulia/edit_transport.ftl
  44. 54 27
      watero-rst-web/src/main/webapp/WEB-INF/views/yulia/list.ftl
  45. 88 67
      watero-rst-web/src/test/java/junit/com/iamberry/rst/Test.java

+ 12 - 8
watero-common-tool/src/main/java/com/iamberry/wechat/tools/StrUtils.java

@@ -26,21 +26,25 @@ public class StrUtils {
 		String res;
 		switch (state) {
 			case 0:res = "待确认收货";break;
-			case 1:res = "检测机器中";break;
-			case 30:res = "待确认";break;
-			case 31:res = "维修中";break;
+			case 1:res = "待检测机器完成";break;
+			case 30:res = "待用户确认(付费维修)";break;
+			case 31:res = "用户同意维修(待维修)";break;
 			case 32:res = "维修完成";break;
-			case 33:res = "不维修(原机退回)";break;
-			case 34:res = "待确认维修";break;
-			case 35:res = "维修中";break;
+			case 33:res = "用户不维修(原机退回)";break;
+			case 34:res = "待用户确认(免费维修)";break;
+			case 35:res = "客服确认维修(待维修)";break;
 			case 36:res = "维修完成";break;
-			case 37:res = "机器无故障,原机退回";break;
-			case 38:res = "机器故障,待确认";break;
+			case 37:res = "机器无故障,待用户确认";break;
+			case 38:res = "机器故障,待用户确认";break;
 			case 20:res = "待翻新入库";break;
 			case 21:res = "已翻新入库";break;
 			case 22:res = "不能翻新,待报废";break;
 			case 23:res = "已报废回收";break;
 			case 40:res = "待完善信息";break;
+			case 24:res = "待确认是否付费翻新";break;
+			case 25:res = "待翻新(付费)";break;
+			case 26:res = "已翻新(付费)";break;
+			case 27:res = "客户不翻新(原机退回)";break;
 			default: res = "未知";
 		}
 		return res;

+ 49 - 10
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CompanyInfo.java

@@ -7,20 +7,59 @@ import java.util.List;
 
 /**
  * 客诉销售公司实体类
- * Created by liuzhiwei on 2017/10/31.
+ * @author 何秀刚
+ * @date 2017/10/31
  */
 public class CompanyInfo implements Serializable {
 
     private static final long serialVersionUID = 5881619733609391385L;
-    private Integer companyId;          //主键
-    private String companyName;         //公司名称
-    private String companyAbbreviation; //公司简称
-    private String companyAddress;      //公司地址
-    private Integer companyStatus;      //状态
-    private String companyRemark;       //备注
-    private Date companyCreateTime;     //创建时间
-
-    private List<StoreInfo> storeInfoList = new ArrayList<>();  //店铺集合
+
+    /**主键*/
+    private Integer companyId;
+    /** 公司名称 */
+    private String companyName;
+    /** 公司简称 */
+    private String companyAbbreviation;
+    /** 公司地址 */
+    private String companyAddress;
+    /** 状态 */
+    private Integer companyStatus;
+    /** 售后期 */
+    private Integer companyAfterMonth;
+    /** 维修期 */
+    private Integer companyMaintainMonth;
+    /** 仓储期 */
+    private Integer compaynStorageMonth;
+    /** 备注 */
+    private String companyRemark;
+    /** 创建时间 */
+    private Date companyCreateTime;
+    /** 店铺集合 */
+    private List<StoreInfo> storeInfoList = new ArrayList<>();
+
+    public Integer getCompanyMaintainMonth() {
+        return companyMaintainMonth;
+    }
+
+    public void setCompanyMaintainMonth(Integer companyMaintainMonth) {
+        this.companyMaintainMonth = companyMaintainMonth;
+    }
+
+    public Integer getCompanyAfterMonth() {
+        return companyAfterMonth;
+    }
+
+    public void setCompanyAfterMonth(Integer companyAfterMonth) {
+        this.companyAfterMonth = companyAfterMonth;
+    }
+
+    public Integer getCompaynStorageMonth() {
+        return compaynStorageMonth;
+    }
+
+    public void setCompaynStorageMonth(Integer compaynStorageMonth) {
+        this.compaynStorageMonth = compaynStorageMonth;
+    }
 
     public Integer getCompanyId() {
         return companyId;

+ 11 - 2
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ProcMethod.java

@@ -27,13 +27,22 @@ public class ProcMethod  implements  Serializable{
     private Date procMethodCreateTime;
     //处理方式修改时间'
     private Date procMethodUpdateTime;
-    //是否收费 1.收费2不收费 0待定
+    // 是否收费 1.收费2不收费 0待定
     private Integer procMethodIsCharge;
-
+    // 是否维修:1、不维修;2维修
+    private Integer procMethodIsMaintain;
     private String procTypeName;
     // 是否展示给优尼雅售后系统其他客户 1:不展示,默认 2:展示
     private Integer procMethodIsShow;
 
+    public Integer getProcMethodIsMaintain() {
+        return procMethodIsMaintain;
+    }
+
+    public void setProcMethodIsMaintain(Integer procMethodIsMaintain) {
+        this.procMethodIsMaintain = procMethodIsMaintain;
+    }
+
     public Integer getProcMethodIsShow() {
         return procMethodIsShow;
     }

+ 248 - 67
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectInfo.java

@@ -5,6 +5,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 客诉-品质检测表
@@ -14,70 +15,168 @@ import java.util.Date;
  */
 public class ComplaintDetectInfo implements Serializable {
     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 Integer detectId;
+    /** 维修编号 */
+    private String detectNumber;
+    /** 数据来源:1、客诉添加;2、手动添加;3、售后系统录入 */
+    private Integer detectSource;
+
+    /*
+     * 产品信息
+     */
+    /** 产品id */
+    private Integer productId;
+    /** 产品颜色id */
+    private Integer productColorId;
+    /** 产品型号 */
+    private String detectProductNumber;
+
+    /*
+     * 客户录入信息
+     */
+    /** 客户问题信息 */
+    private Integer phenomenonId;
+    /** 客户问题现象 */
+    private String detectCustmoerQuestion;
+    /** 问题描述 */
+    private String questionDescription;
+    /** 客户姓名 */
+    private String  detectName;
+    /** 客户电话 */
+    private String detectTel;
+    /** 购买时间 */
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date detectBuytime;
+    /** 所属店铺(优尼雅售后系统新增) */
+    private Integer storeId;
+    /** 机身条码 */
+    private String detectFuselageBarcode;
+    /** 客服备注 */
+    private String detectCustomerDesc;
+    /** 是否维修 */
+    private Integer detectIsMaintain;
+    private List<DetectCustmoerPhenomenon> custmoerPhenomena;
+
+    /*
+     * 检测信息
+     */
+    /** 是否有故障1 有故障 2没有 */
+    private Integer isMaintenance;
+    /** 故障原因:1、质量问题;2、非质量问题 */
+    private Integer deleteMaintainType;
+    /** 是否使用:1、已过水;2、未过水 */
+    private Integer deleteIsUse;
+    /** 是否可翻新 1可翻新 2不可翻新 */
+    private Integer detectRenovation;
+    /** 生产月份 */
+    private String detectProduction;
+    /** 厚膜类型1圆、2扁 */
+    private Integer detectFilmType;
+    /** 浮子类型1长、2短 */
+    private Integer detectFloatType;
+    /** 版本号 */
+    private String detectVersionNumber;
+    /** 是否翻新机1是 2否 */
+    private Integer detectIsRefurbishing;
+    /** 维修备注 */
+    private String detectDesc;
+    /** 机器编号 */
+    private String machineNo;
+    /** 维修报价 */
+    private Integer detectOffer;
+    /** 检测现象id */
+    private Integer detectPhenomenonId;
+    /** 工厂检测现象 */
+    private String detectPhenomenon;
+    /** 检测日期 */
+    private Date detectDate;
+    /** 故障现象 */
+    private Integer[] detectPhenomenonIds;
+
+    /** 状态 详情见数据库文档 */
+    private Integer detectState;
+
+    private List<DetectPhenomenon> phenomena;
+
+    /*
+     * 维修信息
+     */
+    /** 故障分类 */
+    private String detectClassification;
+    /** 故障原因 */
+    private String detectFailureCause;
+    /** 判定结果 */
+    private String detectResults;
+    /** 故障指向 */
+    private String detectPoint;
+    /** 原因分析 */
+    private String detectNalysis;
+    /** 维修内容(维修记录) */
+    private String detectContent;
+
+    /*
+     * QC检测信息
+     */
+    /** 检测备注 */
+    private String qcDesc;
+    /** QC检测结果1.通过 2不通过 */
+    private Integer maintenanceResults;
+
+    /** 创建时间 */
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
-    private Date detectDate;//检测日期
-    private String qcDesc;//检测备注
-    private Date detectCreateTime;//创建时间
-    private Date detectUpdateTime;//修改时间
-    private Integer customerId;//客诉id
-    private Integer signclosedId;//签收id
-
-    private Integer productTypeId;//产品类型id
-    private String productTypeName;//产品类型名称
-    private String questionTitle;//问题标题
-    private String describeContent;//问题回复
-    private String describeHandleDesc;//客服描述
-    private String colorName;//产品颜色名称
-    private String productName;//产品名称
-    private String productAbbreviation;//产品简称
-
-    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;//处理方式类型名
+    private Date detectCreateTime;
+    /** 修改时间 */
+    private Date detectUpdateTime;
+    /** 客诉id */
+    private Integer customerId;
+    /** 签收id */
+    private Integer signclosedId;
+    /** 产品类型id */
+    private Integer productTypeId;
+    /** 产品类型名称 */
+    private String productTypeName;
+    /** 问题标题 */
+    private String questionTitle;
+    /** 问题回复 */
+    private String describeContent;
+    /** 客服描述 */
+    private String describeHandleDesc;
+    /** 产品颜色名称 */
+    private String colorName;
+    /** 产品名称 */
+    private String productName;
+    /** 产品简称 */
+    private String productAbbreviation;
+    /** 1付费维修 2免费维修 3退货 4换货 5原机退回 */
+    private Integer detectProcessingResults;
+    /** 处理方式id */
+    private Integer procMethodId;
+    /** 处理方式类型id */
+    private Integer procTypeId;
+    /** 处理方式名称 */
+    private String procMethodName;
+    /** 处理方式类型名 */
+    private String procTypeName;
+    /** 确认时间(客诉创建时间) */
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
-    private Date customerCreateTime;//确认时间(客诉创建时间)
+    private Date customerCreateTime;
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
-    private Date salesPayTime;//购买时间
+    /** 购买时间 */
+    private Date salesPayTime;
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
-    private Date signclosedDate;//签收时间
-
-    private Date maintenanceCutTime;//待检测截止时间
-    private Date completeCutTime;//待完成维修截止时间
-
-    //5月8号新增字段
-    private String detectProduction;//生产月份
-    private String detectFuselageBarcode;//机身条码
-    private Integer detectFilmType;//厚膜类型1圆、2扁
-    private Integer detectFloatType;//浮子类型1长、2短
-    private String detectVersionNumber;//版本号
-    private Integer detectIsRefurbishing;//是否翻新机1是 2否
-    private Integer maintenanceResults;//QC检测结果1.通过 2不通过
-    private String detectNumber;//维修编号
+    /** 签收时间 */
+    private Date signclosedDate;
+    /** 待检测截止时间 */
+    private Date maintenanceCutTime;
+    /** 待完成维修截止时间 */
+    private Date completeCutTime;
 
     private Date salesTime;//购买时间
     private String signclosedAddrProvincesName;//省
@@ -123,14 +222,11 @@ public class ComplaintDetectInfo implements Serializable {
     private Integer signclosedIsWhetherLess;//是否少件 1是 2否
     private Integer salesmanAdminId;//业务员id
     private String salesmanAdminName;//业务员姓名
-    private String  detectName;//客户姓名
-    private String detectTel;//客户电话
     private Integer questionId;//客户问题id
     private Integer methodId;//新增维修 处理方式id
     private Integer typeId;//新增维修 处理方式类型id
     private String methodName;//新增维修 处理方式名称
     private String typeName;//新增维修 处理方式类型名称
-    private Integer detectSource;//数据来源1,自动录入2手动添加
     private String questionName;//问题名称
     private String questionProfile;//问题回复
     private Integer companyId;//所屬公司
@@ -144,18 +240,103 @@ public class ComplaintDetectInfo implements Serializable {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     private Date detectConfirmTime;//确认时间
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
-    private Date detectBuytime;//购买时间
-
-    private String questionDescription;//问题描述
-
-    // 所属店铺(优尼雅售后系统新增)
-    private Integer storeId;
     // 店铺名称
     private String storeName;
     // 店铺集合(可能存在多个店铺)
     private Integer[] storeIds;
+    // 工厂检测信息
+    private MaintainPhenomenon phenomen;
+
+    /* 运输信息 */
+    private DetectTransport transport;
+
+    public DetectTransport getTransport() {
+        return transport;
+    }
+
+    public void setTransport(DetectTransport transport) {
+        this.transport = transport;
+    }
+
+    public List<DetectCustmoerPhenomenon> getCustmoerPhenomena() {
+        return custmoerPhenomena;
+    }
+
+    public void setCustmoerPhenomena(List<DetectCustmoerPhenomenon> custmoerPhenomena) {
+        this.custmoerPhenomena = custmoerPhenomena;
+    }
+
+    public List<DetectPhenomenon> getPhenomena() {
+        return phenomena;
+    }
+
+    public void setPhenomena(List<DetectPhenomenon> phenomena) {
+        this.phenomena = phenomena;
+    }
+
+    public Integer[] getDetectPhenomenonIds() {
+        return detectPhenomenonIds;
+    }
+
+    public void setDetectPhenomenonIds(Integer[] detectPhenomenonIds) {
+        this.detectPhenomenonIds = detectPhenomenonIds;
+    }
+
+    public MaintainPhenomenon getPhenomen() {
+        return phenomen;
+    }
+
+    public void setPhenomen(MaintainPhenomenon phenomen) {
+        this.phenomen = phenomen;
+    }
+
+    public Integer getPhenomenonId() {
+        return phenomenonId;
+    }
+
+    public void setPhenomenonId(Integer phenomenonId) {
+        this.phenomenonId = phenomenonId;
+    }
+
+    public String getDetectCustmoerQuestion() {
+        return detectCustmoerQuestion;
+    }
+
+    public void setDetectCustmoerQuestion(String detectCustmoerQuestion) {
+        this.detectCustmoerQuestion = detectCustmoerQuestion;
+    }
+
+    public Integer getDetectIsMaintain() {
+        return detectIsMaintain;
+    }
+
+    public void setDetectIsMaintain(Integer detectIsMaintain) {
+        this.detectIsMaintain = detectIsMaintain;
+    }
+
+    public Integer getDeleteMaintainType() {
+        return deleteMaintainType;
+    }
+
+    public void setDeleteMaintainType(Integer deleteMaintainType) {
+        this.deleteMaintainType = deleteMaintainType;
+    }
+
+    public Integer getDeleteIsUse() {
+        return deleteIsUse;
+    }
+
+    public void setDeleteIsUse(Integer deleteIsUse) {
+        this.deleteIsUse = deleteIsUse;
+    }
+
+    public Integer getDetectPhenomenonId() {
+        return detectPhenomenonId;
+    }
+
+    public void setDetectPhenomenonId(Integer detectPhenomenonId) {
+        this.detectPhenomenonId = detectPhenomenonId;
+    }
 
     public Integer[] getStoreIds() {
         return storeIds;

+ 49 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/DetectCustmoerPhenomenon.java

@@ -0,0 +1,49 @@
+package com.iamberry.rst.core.fm;
+
+import java.io.Serializable;
+
+/**
+ * @author root
+ */
+public class DetectCustmoerPhenomenon implements Serializable {
+
+    private Integer dcpId;
+
+    private Integer detectId;
+
+    private Integer phenomenonId;
+
+    private String dcpName;
+
+    public Integer getDcpId() {
+        return dcpId;
+    }
+
+    public void setDcpId(Integer dcpId) {
+        this.dcpId = dcpId;
+    }
+
+    public Integer getDetectId() {
+        return detectId;
+    }
+
+    public void setDetectId(Integer detectId) {
+        this.detectId = detectId;
+    }
+
+    public Integer getPhenomenonId() {
+        return phenomenonId;
+    }
+
+    public void setPhenomenonId(Integer phenomenonId) {
+        this.phenomenonId = phenomenonId;
+    }
+
+    public String getDcpName() {
+        return dcpName;
+    }
+
+    public void setDcpName(String dcpName) {
+        this.dcpName = dcpName == null ? null : dcpName.trim();
+    }
+}

+ 49 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/DetectPhenomenon.java

@@ -0,0 +1,49 @@
+package com.iamberry.rst.core.fm;
+
+import java.io.Serializable;
+
+/**
+ * @author root
+ */
+public class DetectPhenomenon implements Serializable {
+
+    private Integer dpId;
+
+    private Integer detectId;
+
+    private Integer phenomenonId;
+
+    private String dpName;
+
+    public Integer getDpId() {
+        return dpId;
+    }
+
+    public void setDpId(Integer dpId) {
+        this.dpId = dpId;
+    }
+
+    public Integer getDetectId() {
+        return detectId;
+    }
+
+    public void setDetectId(Integer detectId) {
+        this.detectId = detectId;
+    }
+
+    public Integer getPhenomenonId() {
+        return phenomenonId;
+    }
+
+    public void setPhenomenonId(Integer phenomenonId) {
+        this.phenomenonId = phenomenonId;
+    }
+
+    public String getDpName() {
+        return dpName;
+    }
+
+    public void setDpName(String dpName) {
+        this.dpName = dpName;
+    }
+}

+ 159 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/DetectTransport.java

@@ -0,0 +1,159 @@
+package com.iamberry.rst.core.fm;
+
+import java.io.Serializable;
+
+/**
+ * @author root
+ */
+public class DetectTransport implements Serializable {
+
+    private Integer transportId;
+
+    private Integer detectId;
+
+    private String transportSendFirm;
+
+    private String transportSendPost;
+
+    private String transportSendName;
+
+    private String transportSendTel;
+
+    private String transportSignName;
+
+    private String transportSignTel;
+
+    private String transportSignAddr;
+
+    private String transportSignFirm;
+
+    private String transportSignPost;
+
+    private String transportSignProv;
+
+    private String transportSignCity;
+
+    private String transportSignArea;
+
+    private String transportSignCode;
+
+    public String getTransportSignCode() {
+        return transportSignCode;
+    }
+
+    public void setTransportSignCode(String transportSignCode) {
+        this.transportSignCode = transportSignCode;
+    }
+
+    public Integer getTransportId() {
+        return transportId;
+    }
+
+    public void setTransportId(Integer transportId) {
+        this.transportId = transportId;
+    }
+
+    public Integer getDetectId() {
+        return detectId;
+    }
+
+    public void setDetectId(Integer detectId) {
+        this.detectId = detectId;
+    }
+
+    public String getTransportSendFirm() {
+        return transportSendFirm;
+    }
+
+    public void setTransportSendFirm(String transportSendFirm) {
+        this.transportSendFirm = transportSendFirm == null ? null : transportSendFirm.trim();
+    }
+
+    public String getTransportSendPost() {
+        return transportSendPost;
+    }
+
+    public void setTransportSendPost(String transportSendPost) {
+        this.transportSendPost = transportSendPost == null ? null : transportSendPost.trim();
+    }
+
+    public String getTransportSendName() {
+        return transportSendName;
+    }
+
+    public void setTransportSendName(String transportSendName) {
+        this.transportSendName = transportSendName == null ? null : transportSendName.trim();
+    }
+
+    public String getTransportSendTel() {
+        return transportSendTel;
+    }
+
+    public void setTransportSendTel(String transportSendTel) {
+        this.transportSendTel = transportSendTel == null ? null : transportSendTel.trim();
+    }
+
+    public String getTransportSignName() {
+        return transportSignName;
+    }
+
+    public void setTransportSignName(String transportSignName) {
+        this.transportSignName = transportSignName == null ? null : transportSignName.trim();
+    }
+
+    public String getTransportSignTel() {
+        return transportSignTel;
+    }
+
+    public void setTransportSignTel(String transportSignTel) {
+        this.transportSignTel = transportSignTel == null ? null : transportSignTel.trim();
+    }
+
+    public String getTransportSignAddr() {
+        return transportSignAddr;
+    }
+
+    public void setTransportSignAddr(String transportSignAddr) {
+        this.transportSignAddr = transportSignAddr == null ? null : transportSignAddr.trim();
+    }
+
+    public String getTransportSignFirm() {
+        return transportSignFirm;
+    }
+
+    public void setTransportSignFirm(String transportSignFirm) {
+        this.transportSignFirm = transportSignFirm == null ? null : transportSignFirm.trim();
+    }
+
+    public String getTransportSignPost() {
+        return transportSignPost;
+    }
+
+    public void setTransportSignPost(String transportSignPost) {
+        this.transportSignPost = transportSignPost == null ? null : transportSignPost.trim();
+    }
+
+    public String getTransportSignProv() {
+        return transportSignProv;
+    }
+
+    public void setTransportSignProv(String transportSignProv) {
+        this.transportSignProv = transportSignProv == null ? null : transportSignProv.trim();
+    }
+
+    public String getTransportSignCity() {
+        return transportSignCity;
+    }
+
+    public void setTransportSignCity(String transportSignCity) {
+        this.transportSignCity = transportSignCity == null ? null : transportSignCity.trim();
+    }
+
+    public String getTransportSignArea() {
+        return transportSignArea;
+    }
+
+    public void setTransportSignArea(String transportSignArea) {
+        this.transportSignArea = transportSignArea == null ? null : transportSignArea.trim();
+    }
+}

+ 99 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/MaintainPhenomenon.java

@@ -0,0 +1,99 @@
+package com.iamberry.rst.core.fm;
+
+import java.util.Date;
+
+/**
+ * @author root
+ */
+public class MaintainPhenomenon {
+
+    private Integer phenomenonId;
+
+    private Integer typeId;
+
+    private String phenomenonName;
+
+    private String phenomenonDetails;
+
+    private Integer phenomenonMaintainPrice;
+
+    private Integer phenomenonRenovatePrice;
+
+    private Integer phenomenonUseRenovatePrice;
+
+    private Integer phenomenonState;
+
+    private Date phenomenonCreateTime;
+
+    public Integer getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(Integer typeId) {
+        this.typeId = typeId;
+    }
+
+    public Integer getPhenomenonId() {
+        return phenomenonId;
+    }
+
+    public void setPhenomenonId(Integer phenomenonId) {
+        this.phenomenonId = phenomenonId;
+    }
+
+    public String getPhenomenonName() {
+        return phenomenonName;
+    }
+
+    public void setPhenomenonName(String phenomenonName) {
+        this.phenomenonName = phenomenonName == null ? null : phenomenonName.trim();
+    }
+
+    public String getPhenomenonDetails() {
+        return phenomenonDetails;
+    }
+
+    public void setPhenomenonDetails(String phenomenonDetails) {
+        this.phenomenonDetails = phenomenonDetails == null ? null : phenomenonDetails.trim();
+    }
+
+    public Integer getPhenomenonMaintainPrice() {
+        return phenomenonMaintainPrice;
+    }
+
+    public void setPhenomenonMaintainPrice(Integer phenomenonMaintainPrice) {
+        this.phenomenonMaintainPrice = phenomenonMaintainPrice;
+    }
+
+    public Integer getPhenomenonRenovatePrice() {
+        return phenomenonRenovatePrice;
+    }
+
+    public void setPhenomenonRenovatePrice(Integer phenomenonRenovatePrice) {
+        this.phenomenonRenovatePrice = phenomenonRenovatePrice;
+    }
+
+    public Integer getPhenomenonUseRenovatePrice() {
+        return phenomenonUseRenovatePrice;
+    }
+
+    public void setPhenomenonUseRenovatePrice(Integer phenomenonUseRenovatePrice) {
+        this.phenomenonUseRenovatePrice = phenomenonUseRenovatePrice;
+    }
+
+    public Integer getPhenomenonState() {
+        return phenomenonState;
+    }
+
+    public void setPhenomenonState(Integer phenomenonState) {
+        this.phenomenonState = phenomenonState;
+    }
+
+    public Date getPhenomenonCreateTime() {
+        return phenomenonCreateTime;
+    }
+
+    public void setPhenomenonCreateTime(Date phenomenonCreateTime) {
+        this.phenomenonCreateTime = phenomenonCreateTime;
+    }
+}

+ 50 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/MaintainType.java

@@ -0,0 +1,50 @@
+package com.iamberry.rst.core.fm;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author root
+ */
+public class MaintainType implements Serializable {
+
+    private Integer typeId;
+
+    private String typeName;
+
+    private String typeDetails;
+
+    private Date typeCreateTime;
+
+    public Integer getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(Integer typeId) {
+        this.typeId = typeId;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+
+    public String getTypeDetails() {
+        return typeDetails;
+    }
+
+    public void setTypeDetails(String typeDetails) {
+        this.typeDetails = typeDetails;
+    }
+
+    public Date getTypeCreateTime() {
+        return typeCreateTime;
+    }
+
+    public void setTypeCreateTime(Date typeCreateTime) {
+        this.typeCreateTime = typeCreateTime;
+    }
+}

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/Produce.java

@@ -33,6 +33,15 @@ public class Produce implements Serializable {
     private String generalQrcode;       //通用二维码
     private Integer berGenerateRules;   //1 序列化生成(原有生成规则)、2 随机生成 3 博乐宝生成规则
     private Integer productId;          // 绑定的销售产品
+    private Integer produceIsW;
+
+    public Integer getProduceIsW() {
+        return produceIsW;
+    }
+
+    public void setProduceIsW(Integer produceIsW) {
+        this.produceIsW = produceIsW;
+    }
 
     private List<ProduceProcess>  process = new ArrayList<ProduceProcess>();  //工序集合
 

+ 14 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintDetectInfoService.java

@@ -240,4 +240,18 @@ public interface ComplaintDetectInfoService {
      * @return
      */
     Integer addMaterial(MaterialNumberInfo materialNumberInfo);
+
+    /***
+     * 查询问题现象
+     */
+    List<MaintainPhenomenon> listPhenomenon(Integer typeId);
+
+    /**
+     * 编辑运输信息
+     * @param detectTransport
+     * @return
+     */
+    int editTransport(DetectTransport detectTransport);
+
+    MaintainPhenomenon getPhenomenon(Integer id);
 }

+ 20 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/MaintainPhenomenonMapper.java

@@ -0,0 +1,20 @@
+package com.iamberry.rst.service.cm.mapper;
+
+
+import com.iamberry.rst.core.fm.MaintainPhenomenon;
+
+import java.util.List;
+
+public interface MaintainPhenomenonMapper {
+
+    int del(Integer phenomenonId);
+
+    int add(MaintainPhenomenon record);
+
+    MaintainPhenomenon get(Integer phenomenonId);
+
+    int edit(MaintainPhenomenon record);
+
+    List<MaintainPhenomenon> list(MaintainPhenomenon record);
+
+}

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

@@ -0,0 +1,61 @@
+<?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.cm.mapper.MaintainPhenomenonMapper" >
+
+  <select id="get" resultType="MaintainPhenomenon" parameterType="java.lang.Integer" >
+    select * from tb_rst_complaint_maintain_phenomenon where phenomenon_id = #{phenomenonId,jdbcType=INTEGER}
+  </select>
+
+  <delete id="del" parameterType="java.lang.Integer" >
+    delete from tb_rst_complaint_maintain_phenomenon where phenomenon_id = #{phenomenonId,jdbcType=INTEGER}
+  </delete>
+
+  <insert id="add" parameterType="MaintainPhenomenon" useGeneratedKeys="true" keyProperty="phenomenonId">
+    insert into tb_rst_complaint_maintain_phenomenon (phenomenon_name, phenomenon_details,
+      phenomenon_maintain_price, phenomenon_renovate_price, 
+      phenomenon_use_renovate_price, phenomenon_state, 
+      phenomenon_create_time, type_id)
+    values (#{phenomenonName,jdbcType=VARCHAR}, #{phenomenonDetails,jdbcType=VARCHAR},
+      #{phenomenonMaintainPrice,jdbcType=INTEGER}, #{phenomenonRenovatePrice,jdbcType=INTEGER}, 
+      #{phenomenonUseRenovatePrice,jdbcType=INTEGER}, #{phenomenonState,jdbcType=TINYINT}, NOW(), #{typeId})
+  </insert>
+
+  <update id="edit" parameterType="MaintainPhenomenon" >
+    update tb_rst_complaint_maintain_phenomenon
+    <set >
+      <if test="phenomenonName != null" >
+        phenomenon_name = #{phenomenonName,jdbcType=VARCHAR},
+      </if>
+      <if test="phenomenonDetails != null" >
+        phenomenon_details = #{phenomenonDetails,jdbcType=VARCHAR},
+      </if>
+      <if test="phenomenonMaintainPrice != null" >
+        phenomenon_maintain_price = #{phenomenonMaintainPrice,jdbcType=INTEGER},
+      </if>
+      <if test="phenomenonRenovatePrice != null" >
+        phenomenon_renovate_price = #{phenomenonRenovatePrice,jdbcType=INTEGER},
+      </if>
+      <if test="phenomenonUseRenovatePrice != null" >
+        phenomenon_use_renovate_price = #{phenomenonUseRenovatePrice,jdbcType=INTEGER},
+      </if>
+      <if test="phenomenonState != null" >
+        phenomenon_state = #{phenomenonState,jdbcType=TINYINT},
+      </if>
+      <if test="typeId != null" >
+        type_id = #{typeId},
+      </if>
+    </set>
+    where phenomenon_id = #{phenomenonId,jdbcType=INTEGER}
+  </update>
+
+  <select id="list" resultType="MaintainPhenomenon" parameterType="java.lang.Integer">
+    select * from tb_rst_complaint_maintain_phenomenon
+    <where>
+      <if test="typeId != null and typeId != 0">
+        type_id = #{typeId}
+      </if>
+      AND phenomenon_state = 1
+    </where>
+  </select>
+
+</mapper>

+ 22 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/MaintainTypeMapper.java

@@ -0,0 +1,22 @@
+package com.iamberry.rst.service.cm.mapper;
+
+import com.iamberry.rst.core.fm.MaintainType;
+
+import java.util.List;
+
+/**
+ * @author root
+ */
+public interface MaintainTypeMapper {
+
+    int addType(MaintainType t);
+
+    int editType(MaintainType t);
+
+    int delType(MaintainType t);
+
+    MaintainType get(Integer id);
+
+    List<MaintainType> list();
+
+}

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

@@ -0,0 +1,35 @@
+<?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.cm.mapper.MaintainTypeMapper" >
+
+  <select id="get" resultType="MaintainType" parameterType="java.lang.Integer" >
+    select * from tb_rst_complaint_maintain_type where type_id = #{phenomenonId,jdbcType=INTEGER}
+  </select>
+
+  <delete id="del" parameterType="java.lang.Integer" >
+    delete from tb_rst_complaint_maintain_type where type_id = #{phenomenonId,jdbcType=INTEGER}
+  </delete>
+
+  <insert id="add" parameterType="MaintainType" useGeneratedKeys="true" keyProperty="typeId">
+    insert into tb_rst_complaint_maintain_type (type_name, type_details, type_create_time)
+    values (#{typeName,jdbcType=VARCHAR}, #{typeDetails,jdbcType=VARCHAR}, NOW())
+  </insert>
+
+  <update id="edit" parameterType="MaintainType" >
+    update tb_rst_complaint_maintain_type
+    <set >
+      <if test="typeName != null" >
+        type_name = #{typeName,jdbcType=VARCHAR},
+      </if>
+      <if test="typeDetails != null" >
+        type_details = #{typeDetails,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where type_id = #{typeId,jdbcType=INTEGER}
+  </update>
+
+  <select id="list" resultType="MaintainType">
+    select * from tb_rst_complaint_maintain_type
+  </select>
+
+</mapper>

+ 14 - 25
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/companyInfoMapper.xml

@@ -1,36 +1,19 @@
 <?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.cm.mapper.CompanyInfoMapper" >
-  <resultMap id="BaseResultMap" type="CompanyInfo" >
-    <id column="company_id" property="companyId" jdbcType="INTEGER" />
-    <result column="company_name" property="companyName" jdbcType="VARCHAR" />
-    <result column="company_abbreviation" property="companyAbbreviation" jdbcType="VARCHAR" />
-    <result column="company_address" property="companyAddress" jdbcType="VARCHAR" />
-    <result column="company_status" property="companyStatus" jdbcType="INTEGER" />
-    <result column="company_remark" property="companyRemark" jdbcType="VARCHAR" />
-    <result column="company_create_time" property="companyCreateTime" jdbcType="TIMESTAMP" />
-  </resultMap>
-  <sql id="companyInfo" >
-    company_id, company_name, company_abbreviation, company_address, company_status, 
-    company_remark, company_create_time
-  </sql>
+
 
   <!-- 根据id查询销售公司信息 -->
   <select id="getCompanyInfoById" resultType="CompanyInfo" parameterType="java.lang.Integer" >
-    select 
-    <include refid="companyInfo" />
-    from tb_rst_sales_company
-    where company_id = #{companyId,jdbcType=INTEGER}
+    select * from tb_rst_sales_company where company_id = #{companyId,jdbcType=INTEGER}
   </select>
 
   <select id="listCompanyInfo" resultType="CompanyInfo" parameterType="CompanyInfo" >
-    select
-    <include refid="companyInfo" />
-    from tb_rst_sales_company
+    select * from tb_rst_sales_company
     <where>
-    <if test="companyId != null and companyId != ''">
-      AND company_id = #{companyId}
-    </if >
+      <if test="companyId != null and companyId != ''">
+        AND company_id = #{companyId}
+      </if >
       AND company_status = 1
     </where>
   </select>
@@ -39,10 +22,10 @@
   <!-- 添加销售公司信息 -->
   <insert id="addCompanyInfo" parameterType="CompanyInfo" useGeneratedKeys="true" keyProperty="companyId">
     insert into tb_rst_sales_company (company_id, company_name, company_abbreviation, 
-      company_address, company_status, company_remark, company_create_time)
+      company_address, company_status, company_remark, company_create_time, company_after_month, compayn_storage_month)
     values (#{companyId,jdbcType=INTEGER}, #{companyName,jdbcType=VARCHAR}, #{companyAbbreviation,jdbcType=VARCHAR}, 
       #{companyAddress,jdbcType=VARCHAR}, #{companyStatus,jdbcType=INTEGER}, #{companyRemark,jdbcType=VARCHAR}, 
-      NOW())
+      NOW(), #{companyAfterMonth}, #{compaynStorageMonth})
   </insert>
 
   <!-- 修改销售公司信息 -->
@@ -61,6 +44,12 @@
       <if test="companyStatus != null" >
         company_status = #{companyStatus,jdbcType=INTEGER},
       </if>
+      <if test="companyAfterMonth != null" >
+        company_after_month = #{companyAfterMonth,jdbcType=INTEGER},
+      </if>
+      <if test="compaynStorageMonth != null" >
+        compayn_storage_month = #{compaynStorageMonth,jdbcType=INTEGER},
+      </if>
       <if test="companyRemark != null" >
         company_remark = #{companyRemark,jdbcType=VARCHAR},
       </if>

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

@@ -1,34 +1,9 @@
 <?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.cm.mapper.ProcMethodMapper">
-    <resultMap  id="BaseResultMap" type="ProcMethod" >
-        <result    column="proc_method_id"    property="procMethodId" />
-        <result    column="proc_type_id"    property="procTypeId" />
-        <result    column="proc_method_name"    property="procMethodName" />
-        <result    column="proc_method_status"    property="procMethodStatus" />
-        <result    column="proc_method_desc"    property="procMethodDesc" />
-        <result    column="proc_method_is_back"    property="procMethodIsBack" />
-        <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,
-        t.proc_type_id,
-        t.proc_method_name,
-        t.proc_method_status,
-        t.proc_method_desc,
-        t.proc_method_is_back,
-        t.proc_method_is_send,
-        t.proc_method_create_time,
-        t.proc_method_update_time,
-        t.proc_method_is_charge
-    </sql>
-    <select id="getProcMethodList" resultMap="BaseResultMap" parameterType="ProcMethod" >
-        select
-        <include refid="Base_List" />
-        from tb_rst_cm_proc_method t
+
+    <select id="getProcMethodList" resultType="ProcMethod" parameterType="ProcMethod" >
+        select * from tb_rst_cm_proc_method t
         <where>
             <if test="procMethodId != null ">
                 AND t.proc_method_id = #{procMethodId}
@@ -53,11 +28,8 @@
             </if >
         </where>
     </select>
-    <select id="getProcMethodById" resultMap="BaseResultMap" parameterType="Integer" >
-        select
-        <include refid="Base_List" />,
-        cpt.proc_type_name
-        from tb_rst_cm_proc_method t
+    <select id="getProcMethodById" resultType="ProcMethod" parameterType="Integer" >
+        select t.*, cpt.proc_type_name from tb_rst_cm_proc_method t
         LEFT JOIN tb_rst_cm_proc_type cpt ON  t.proc_type_id = cpt.proc_type_id
         where t.proc_method_id= #{procMethodId}
     </select>
@@ -70,7 +42,9 @@
         proc_method_status,
         proc_method_desc,
         proc_method_is_back,
-        proc_method_is_send
+        proc_method_is_send,
+        proc_method_is_show,
+        proc_method_is_maintain
         )
         values
         (
@@ -79,7 +53,9 @@
         #{procMethodStatus},
         #{procMethodDesc},
         #{procMethodIsBack},
-        #{procMethodIsSend}
+        #{procMethodIsSend},
+        #{procMethodIsShow},
+        #{procMethodIsMaintain}
         )
     </insert>
     <update id="update" parameterType="ProcMethod" >
@@ -92,6 +68,12 @@
             <if test="procMethodName != null and procMethodName != ''">
                 proc_method_name = #{procMethodName},
             </if >
+            <if test="procMethodIsMaintain != null ">
+                proc_method_is_maintain = #{procMethodIsMaintain},
+            </if >
+            <if test="procMethodIsShow != null ">
+                proc_method_is_show = #{procMethodIsShow},
+            </if >
             <if test="procMethodStatus != null ">
                 proc_method_status = #{procMethodStatus},
             </if >

+ 436 - 119
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintDetectInfoServiceImpl.java

@@ -3,25 +3,33 @@ package com.iamberry.rst.service.fm;
 
 import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.cm.CmRelation;
+import com.iamberry.rst.core.cm.CompanyInfo;
 import com.iamberry.rst.core.cm.ProcMethod;
 import com.iamberry.rst.core.cm.SalesOrderItem;
 import com.iamberry.rst.core.fm.*;
 import com.iamberry.rst.core.order.OrderWarehouse;
+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.Produce;
 import com.iamberry.rst.core.sys.Admin;
 import com.iamberry.rst.faces.cm.InventoryService;
 import com.iamberry.rst.faces.cm.SalesOrderService;
 import com.iamberry.rst.faces.fm.ComplaintDetectInfoService;
 import com.iamberry.rst.faces.sms.SmsService;
-import com.iamberry.rst.service.cm.mapper.CustomerInfoMapper;
-import com.iamberry.rst.service.cm.mapper.ProcMethodMapper;
+import com.iamberry.rst.service.cm.mapper.*;
 import com.iamberry.rst.service.fm.mapper.ComplaintDetectInfoMapper;
 import com.iamberry.rst.service.fm.mapper.ComplaintMaintenanceInfoMapper;
+import com.iamberry.rst.service.fm.mapper.DetectCustmoerPhenomenonMapper;
+import com.iamberry.rst.service.fm.mapper.DetectTransportMapper;
+import com.iamberry.rst.service.product.mapper.ProductMapper;
+import com.iamberry.rst.service.pts.mapper.ProduceMapper;
+import com.iamberry.rst.service.sys.mapper.SysConfigMapper;
 import com.iamberry.rst.service.sys.mapper.SysMapper;
 import com.iamberry.rst.util.PageUtil;
 import com.iamberry.rst.util.SmsConfig;
 import com.iamberry.wechat.core.entity.AdminUtils;
+import com.iamberry.wechat.tools.DateTimeUtil;
 import com.iamberry.wechat.tools.ResponseJson;
 import com.iamberry.wechat.tools.ResultInfo;
 import org.slf4j.Logger;
@@ -56,6 +64,22 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
     private InventoryService inventoryService;
     @Autowired
     private SysMapper sysMapper;
+    @Autowired
+    private MaintainPhenomenonMapper phenomenonMapper;
+    @Autowired
+    private CompanyInfoMapper companyInfoMapper;
+    @Autowired
+    private StoreInfoMapper storeInfoMapper;
+    @Autowired
+    private ProductMapper productMapper;
+    @Autowired
+    private ProduceMapper produceMapper;
+    @Autowired
+    private SysConfigMapper sysConfigMapper;
+    @Autowired
+    private DetectCustmoerPhenomenonMapper detectCustmoerPhenomenonMapper;
+    @Autowired
+    private DetectTransportMapper detectTransportMapper;
 
     @Override
     public ComplaintDetectInfo getDetectByMachine(String machine) {
@@ -64,7 +88,18 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
 
     @Override
     public ComplaintDetectInfo getDetectById(Integer detectId) {
-        return complaintDetectInfoMapper.getDetectById(detectId);
+        ComplaintDetectInfo res = complaintDetectInfoMapper.getDetectById(detectId);
+        if (res == null) {
+            return res;
+        }
+        if (res.getSalesmanAdminId() != null) {
+            Admin temp = new Admin();
+            temp.setAdminId(res.getSalesmanAdminId());
+            res.setSalesmanAdminName(sysMapper.get(temp).getAdminName());
+        }
+        res.setPhenomena(complaintDetectInfoMapper.listDetectPhenomenon(detectId));
+        res.setTransport(detectTransportMapper.get(detectId));
+        return res;
     }
 
     @Override
@@ -246,7 +281,8 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
             throw new RuntimeException("修改QC检测状态");
         }
 
-        if(record.getMaintenanceResults() == 1){ //maintenanceResults
+        if(record.getMaintenanceResults() == 1){
+            //maintenanceResults
             //判断是否为维修
             ComplaintDetectInfo cdi = complaintDetectInfoMapper.getDetectById(record.getDetectId());
             Integer typeId = cdi.getProcTypeId();
@@ -287,8 +323,6 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                     inventoryInfo2.setInventoryRecentRecord("退货/换货,从售后不良品仓转入正常销售良品仓(维修ID:"+record.getDetectNumber()+")");
                     inventoryService.addInventory(inventoryInfo2);
                 }
-            }else{
-                throw new RuntimeException("未知的维修类型");
             }
         }
         return flag;
@@ -311,73 +345,246 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
             cmRelation = customerInfoMapper.getCmRelationInfo(cmRelation);
             procMethod = procMethodMapper.getProcMethodById(cmRelation.getProcMethodId());
         }
-        procTypeId = procMethod.getProcTypeId();
-        switch (procTypeId){
-            case 3:
-                //维修
-                if(procMethod.getProcMethodIsCharge() == 0){
-                    //待定
-                    if(record.getIsMaintenance() == 1){
-                        //机器故障,待用户确认
-                        record.setDetectState(38);
-                    }else if(record.getIsMaintenance() == 2){
-                        //机器无故障,待用户确认
-                        record.setDetectState(37);
+        if (procMethod != null) {
+            procTypeId = procMethod.getProcTypeId();
+            switch (procTypeId){
+                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);
                     }
-                }else if(procMethod.getProcMethodIsCharge() == 1){
-                    //付费
-                    //待用户确认
-                    record.setDetectState(30);
-                }else if(procMethod.getProcMethodIsCharge() == 2){
-                    //免费
-                    //待客服确认维修
-                    record.setDetectState(34);
-                }
-                break;
-            default:
-                // 退货/换货
-                String processingResults = "";
-                String text = "";
-                if(record.getDetectRenovation() == 1){
-                    // 是否可翻新 1可翻新 2不可翻新
-                    // 待翻新入库
-                    record.setDetectState(20);
-                    processingResults = "维修";
-                }else if(record.getDetectRenovation() == 2){
-                    // 不能翻新,待报废
-                    record.setDetectState(22);
-                    processingResults = "报废";
-                }
-                // 查询维修编号
-                ComplaintDetectInfo info = complaintDetectInfoMapper.getDetectById(record.getDetectId());
-                // 客诉状态为换货或退货时完成检测需要短信通知维修人员
-                if(procTypeId == 2){
-                    //换货
-                    text = MessageFormat.format(SmsConfig.CUSTOMER_EXCHANGE, info.getDetectNumber(),processingResults);
-                }
-                if(procTypeId == 4){
-                    //退货
-                    text = MessageFormat.format(SmsConfig.CUSTOMER_RETURN, info.getDetectNumber(),processingResults);
-                }
-                if(procTypeId == 2 || procTypeId == 4){
-                    String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
-                    logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送完成检测结果("+processingResults+"):"+result);
-                }
+                    if (complaintDetectInfo.getDetectIsMaintain() == null) {
+                        complaintDetectInfo.setDetectIsMaintain(1);
+                    }
+                    break;
+                default:
+                    // 退货/换货
+                    String processingResults = "";
+                    String text = "";
+                    if(record.getDetectRenovation() == 1){
+                        // 是否可翻新 1可翻新 2不可翻新
+                        // 待翻新入库
+                        record.setDetectState(20);
+                        processingResults = "维修";
+                    }else if(record.getDetectRenovation() == 2){
+                        // 不能翻新,待报废
+                        record.setDetectState(22);
+                        processingResults = "报废";
+                    }
+                    // 查询维修编号
+                    ComplaintDetectInfo info = complaintDetectInfoMapper.getDetectById(record.getDetectId());
+                    // 客诉状态为换货或退货时完成检测需要短信通知维修人员
+                    if(procTypeId == 2){
+                        //换货
+                        text = MessageFormat.format(SmsConfig.CUSTOMER_EXCHANGE, info.getDetectNumber(),processingResults);
+                    }
+                    if(procTypeId == 4){
+                        //退货
+                        text = MessageFormat.format(SmsConfig.CUSTOMER_RETURN, info.getDetectNumber(),processingResults);
+                    }
+                    if(procTypeId == 2 || procTypeId == 4){
+                        String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
+                        logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送完成检测结果("+processingResults+"):"+result);
+                    }
+
+                    if (complaintDetectInfo.getDetectIsMaintain() == null) {
+                        complaintDetectInfo.setDetectIsMaintain(2);
+                    }
+            }
+        }
+        Product product = productMapper.getProduce(complaintDetectInfo.getProductId());
+        Produce temp = new Produce();
+        if (product != null && product.getProduceId() != null) {
+            temp.setProduceId(product.getProduceId());
+            temp = produceMapper.getProduceByPro(temp);
+            if (temp == null) {
+                throw new RuntimeException("销售产品未获取到对应的绑定生产产品");
+            }
         }
 
         try {
-            //封装检测信息
-            //检测现象
-            if(record.getConfigli1() != null) {
-                if (record.getConfigli1().length > 0) {
-                    StringBuilder detectPhenomenon = new StringBuilder();
-                    for (String configid : record.getConfigli1()) {
-                        detectPhenomenon.append(adddetectItem(configid, record.getDetectId())).append(";");
+            // 维修报价
+            CompanyInfo companyInfo = null;
+            if (record.getDetectPhenomenonIds() != null && record.getDetectPhenomenonIds().length >= 1) {
+
+                // 是否维修,1表示判断维修、2表示判断翻新
+                if (complaintDetectInfo.getDetectIsMaintain() == 1) {
+                    if (complaintDetectInfo.getStoreId() == null) {
+                        // 爱贝源客户
+                        companyInfo = companyInfoMapper.getCompanyInfoById(1);
+                    } else {
+                        // 其他客户
+                        companyInfo = companyInfoMapper.getCompanyInfoById(storeInfoMapper.getStoreInfoById(complaintDetectInfo.getStoreId()).getCompanyId());
+                    }
+                    Date createDate = DateTimeUtil.parse(record.getDetectProduction(), "yyyy-MM-dd");
+                    createDate = DateTimeUtil.addMonth(createDate, companyInfo.getCompanyMaintainMonth());
+                    createDate = DateTimeUtil.addMonth(createDate, companyInfo.getCompaynStorageMonth());
+                    if (createDate.getTime() >= complaintDetectInfo.getDetectCreateTime().getTime()
+                            && record.getIsMaintenance() == 1
+                            && record.getDeleteMaintainType() == 1) {
+                        // 质保期内、机器有故障,并且为质量问题导致的(免费维修)
+                        record.setDetectState(34);
+                        record.setDetectOffer(0);
+                    } else if (procMethod != null && procMethod.getProcMethodIsCharge() != null && procMethod.getProcMethodIsCharge() == 0) {
+                        // 此处为了兼容爱贝源的检测待定选项
+                        if(record.getIsMaintenance() == 1){
+                            // 机器故障,待用户确认
+                            if (createDate.getTime() >= complaintDetectInfo.getDetectCreateTime().getTime() && record.getDeleteMaintainType() == 1) {
+                                // 质保期内、机器有故障,并且为质量问题导致的(免费维修)
+                                record.setDetectState(34);
+                                record.setDetectOffer(0);
+                            } else {
+                                for (Integer id : record.getDetectPhenomenonIds()) {
+                                    if (record.getDetectOffer() == null) {
+                                        record.setDetectOffer(phenomenonMapper.get(id).getPhenomenonMaintainPrice());
+                                    } else {
+                                        record.setDetectOffer(record.getDetectOffer() + phenomenonMapper.get(id).getPhenomenonMaintainPrice());
+                                    }
+                                }
+                                record.setDetectState(30);
+                            }
+                        }else if(record.getIsMaintenance() == 2){
+                            // 机器无故障,待用户确认
+                            record.setDetectState(37);
+                        }
+                    } else {
+                        // 质保期外(付费维修) , 并且机器非检测待定的
+                        for (Integer id : record.getDetectPhenomenonIds()) {
+                            if (record.getDetectOffer() == null) {
+                                record.setDetectOffer(phenomenonMapper.get(id).getPhenomenonMaintainPrice());
+                            } else {
+                                record.setDetectOffer(record.getDetectOffer() + phenomenonMapper.get(id).getPhenomenonMaintainPrice());
+                            }
+                        }
+                        record.setDetectState(30);
+                    }
+                } else {
+                    if (record.getIsMaintenance() == 1) {
+                        // 无故障(付费翻新)
+                        if (record.getDeleteIsUse() == 1) {
+                            // 未过水(翻新)
+                            if (temp.getProduceIsW() == 1) {
+                                // W系列
+                                record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(12)));
+                            } else if (temp.getProduceIsW() == 2) {
+                                // S系列
+                                record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(14)));
+                            }
+                        } else {
+                            // 已过水(翻新)
+                            if (temp.getProduceIsW() == 1) {
+                                // W系列
+                                record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(11)));
+                            } else if (temp.getProduceIsW() == 2) {
+                                // S系列
+                                record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(13)));
+                            }
+                        }
+                        record.setDetectState(24);
+                    } else {
+                        // 有故障
+                        if (record.getDeleteMaintainType() == 1) {
+                            // 质量问题(获取当前客户录入日期和仓储期+售后期,对比机器生产日期)
+                            if (complaintDetectInfo.getStoreId() == null) {
+                                // 爱贝源客户
+                                companyInfo = companyInfoMapper.getCompanyInfoById(1);
+                            } else {
+                                // 其他客户
+                                companyInfo = companyInfoMapper.getCompanyInfoById(storeInfoMapper.getStoreInfoById(complaintDetectInfo.getStoreId()).getCompanyId());
+                            }
+                            Date createDate = DateTimeUtil.parse(record.getDetectProduction(), "yyyy-MM-dd");
+                            createDate = DateTimeUtil.addMonth(createDate, companyInfo.getCompanyAfterMonth());
+                            createDate = DateTimeUtil.addMonth(createDate, companyInfo.getCompaynStorageMonth());
+                            if (createDate.getTime() >= complaintDetectInfo.getDetectCreateTime().getTime()) {
+                                // 质保期内(免费换新)
+                                record.setDetectOffer(0);
+                                if (record.getDetectRenovation() == 1) {
+                                    // 可以翻新
+                                    record.setDetectState(20);
+                                } else {
+                                    // 不可翻新
+                                    record.setDetectState(22);
+                                }
+                            } else {
+                                // 质保期外
+                                if (record.getDeleteIsUse() == 1) {
+                                    // 未过水(翻新)
+                                    if (temp.getProduceIsW() == 1) {
+                                        // W系列
+                                        record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(12)));
+                                    } else if (temp.getProduceIsW() == 2) {
+                                        // S系列
+                                        record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(14)));
+                                    }
+                                } else {
+                                    // 已过水(翻新)
+                                    if (temp.getProduceIsW() == 1) {
+                                        // W系列
+                                        record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(11)));
+                                    } else if (temp.getProduceIsW() == 2) {
+                                        // S系列
+                                        record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(13)));
+                                    }
+                                }
+                                record.setDetectState(24);
+                            }
+                        } else {
+                            // 非质量问题导致
+                            if (record.getDeleteIsUse() == 1) {
+                                // 未过水(翻新)
+                                if (temp.getProduceIsW() == 1) {
+                                    // W系列
+                                    record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(12)));
+                                } else if (temp.getProduceIsW() == 2) {
+                                    // S系列
+                                    record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(14)));
+                                }
+                            } else {
+                                // 已过水(翻新)
+                                if (temp.getProduceIsW() == 1) {
+                                    // W系列
+                                    record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(11)));
+                                } else if (temp.getProduceIsW() == 2) {
+                                    // S系列
+                                    record.setDetectOffer(Integer.parseInt(sysConfigMapper.getSysConfig(13)));
+                                }
+                            }
+                            record.setDetectState(24);
+                        }
                     }
-                    record.setDetectPhenomenon(detectPhenomenon.toString());
                 }
+
+                // 录入检测现象
+                StringBuilder detectPhenomenon = new StringBuilder();
+                complaintDetectInfoMapper.delPhenomenon(complaintDetectInfo.getDetectId());
+                for (Integer id : record.getDetectPhenomenonIds()) {
+                    DetectPhenomenon dp = new DetectPhenomenon();
+                    dp.setDetectId(record.getDetectId());
+                    dp.setPhenomenonId(id);
+                    dp.setDpName(phenomenonMapper.get(id).getPhenomenonName());
+                    detectPhenomenon.append(dp.getDpName()).append(";");
+                    complaintDetectInfoMapper.addPhenomenon(dp);
+                }
+                // 检测现象描述
+                record.setDetectPhenomenon(detectPhenomenon.toString());
             }
 
+            // 修改
             if(complaintDetectInfoMapper.updateDetectById(record) > 0){
                 if(imgs != null){
                     if(imgs.length > 0){
@@ -391,10 +598,26 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                 }
             }
             if(complaintDetectInfo.getDetectSource() == 2 || complaintDetectInfo.getDetectSource() == 3){
-                //手动添加需要给业务员发送短信
-                //发送短信通知维修检测人员
-                if(record.getDetectState() == 30 || record.getDetectState() == 34|| record.getDetectState() == 38 || record.getDetectState() == 37){
-                    if(complaintDetectInfo.getDetectTel() != null && !complaintDetectInfo.getDetectTel().equals("") && complaintDetectInfo.getSalesmanAdminId() != null){
+                // 给客户发送短信
+                if (complaintDetectInfo.getAdminId() != null) {
+                    Admin admin = new Admin();
+                    admin.setAdminId(complaintDetectInfo.getAdminId());
+                    admin = sysMapper.get(admin);
+                    String result = smsService.sendOtherCMS(admin.getAdminTel(), "【优尼雅电子科技】尊敬的客户您好,您的机器" + complaintDetectInfo.getDetectNumber() + "已经检测完成,请登入我司系统确认处理机器的方案。");
+                    logger.info("给 " + admin.getAdminTel() + " 手机用户发送短信:通知客户选择处理方式:"+result+"维修id:"+record.getDetectId());
+                }
+                // 给业务员发短信
+                if (complaintDetectInfo.getSalesmanAdminId() != null && companyInfo != null && companyInfo.getCompanyName() != null) {
+                    Admin admin = new Admin();
+                    admin.setAdminId(complaintDetectInfo.getSalesmanAdminId());
+                    admin = sysMapper.get(admin);
+                    String result = smsService.sendOtherCMS(admin.getAdminTel(), "【优尼雅电子科技】您客户 " + companyInfo.getCompanyName() + " 的机器" + complaintDetectInfo.getDetectNumber() + "已检测完成,请联系客户进入系统确认处理机器的方案。");
+                    logger.info("给 " + admin.getAdminTel() + " 手机用户发送短信:通知业务员选择处理方式:"+result+"维修id:"+record.getDetectId());
+                }
+
+                // 手动添加需要给业务员发送短信
+                if(complaintDetectInfo.getDetectState() == 30 || complaintDetectInfo.getDetectState() == 34|| complaintDetectInfo.getDetectState() == 38 || complaintDetectInfo.getDetectState() == 37){
+                    if(complaintDetectInfo.getDetectTel() != null && !"".equals(complaintDetectInfo.getDetectTel()) && complaintDetectInfo.getSalesmanAdminId() != null){
                         String text = MessageFormat.format(SmsConfig.NOTIFY_SALESMAN, complaintDetectInfo.getDetectName()+complaintDetectInfo.getDetectTel(), ResultInfo.DETECT_MSG+complaintDetectInfo.getDetectId());
                         Admin admin = new Admin();
                         admin.setAdminId(complaintDetectInfo.getSalesmanAdminId());
@@ -426,18 +649,59 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
     public PagedResult<ComplaintDetectInfo> listComplaintDetect(PageRequest<ComplaintDetectInfo> pageRequest) {
         PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());
         List<ComplaintDetectInfo> detectList = complaintDetectInfoMapper.listComplaintDetect(pageRequest.getData());
-        return PageUtil.getPage(detectList);
+        PagedResult<ComplaintDetectInfo> result = PageUtil.getPage(detectList);
+        if (result.getDataList() != null && !result.getDataList().isEmpty()) {
+            for (ComplaintDetectInfo detectInfo : result.getDataList()) {
+                detectInfo.setTransport(detectTransportMapper.get(detectInfo.getDetectId()));
+            }
+        }
+        return result;
     }
 
     @Override
     public PagedResult<ComplaintDetectInfo> listAfterSales(PageRequest<ComplaintDetectInfo> pageRequest) {
         PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());
         List<ComplaintDetectInfo> detectList = complaintDetectInfoMapper.listAfterSales(pageRequest.getData());
-        return PageUtil.getPage(detectList);
+        PagedResult<ComplaintDetectInfo> result = PageUtil.getPage(detectList);
+        if (result.getDataList() != null && !result.getDataList().isEmpty()) {
+            for (ComplaintDetectInfo detectInfo : result.getDataList()) {
+                detectInfo.setTransport(detectTransportMapper.get(detectInfo.getDetectId()));
+            }
+        }
+        return result;
     }
 
     @Override
+    @Transactional(rollbackFor = {Exception.class}, isolation = Isolation.REPEATABLE_READ)
     public int insert(ComplaintDetectInfo record) {
+        // 判断是否有多个客户传递的问题现象
+        if (record.getCustmoerPhenomena() != null && !record.getCustmoerPhenomena().isEmpty()) {
+            record.setDetectCustmoerQuestion(null);
+            for (DetectCustmoerPhenomenon custmoerPhenomenon : record.getCustmoerPhenomena()) {
+                if (record.getDetectCustmoerQuestion() != null) {
+                    record.setDetectCustmoerQuestion(record.getDetectCustmoerQuestion() + custmoerPhenomenon.getDcpName() + ";");
+                } else {
+                    record.setDetectCustmoerQuestion(custmoerPhenomenon.getDcpName() + ";");
+                }
+            }
+            int res = complaintDetectInfoMapper.insert(record);
+            // 添加问题现象
+            for (DetectCustmoerPhenomenon custmoerPhenomenon : record.getCustmoerPhenomena()) {
+                custmoerPhenomenon.setDetectId(record.getDetectId());
+                detectCustmoerPhenomenonMapper.add(custmoerPhenomenon);
+            }
+            // 添加运输信息
+            if (record.getTransport() == null) {
+                DetectTransport transport = new DetectTransport();
+                transport.setDetectId(record.getDetectId());
+                detectTransportMapper.add(transport);
+            } else {
+                record.getTransport().setDetectId(record.getDetectId());
+                detectTransportMapper.add(record.getTransport());
+            }
+            return res;
+        }
+        // 单个问题现象
         return complaintDetectInfoMapper.insert(record);
     }
 
@@ -458,7 +722,21 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
 
     @Override
     public List<ComplaintDetectInfo> listComplaintDetect(ComplaintDetectInfo detectInfo) {
-        return complaintDetectInfoMapper.listComplaintDetect(detectInfo);
+        List<ComplaintDetectInfo> res = complaintDetectInfoMapper.listComplaintDetect(detectInfo);
+        if (res == null || res.isEmpty()) {
+            return null;
+        }
+        res.forEach((d) -> {
+            if (d != null && d.getDetectPhenomenonId() != null) {
+                d.setPhenomen(phenomenonMapper.get(d.getDetectPhenomenonId()));
+            }
+            if (d != null && d.getSalesmanAdminId() != null) {
+                Admin temp = new Admin();
+                temp.setAdminId(d.getSalesmanAdminId());
+                d.setSalesmanAdminName(sysMapper.get(temp).getAdminName());
+            }
+        });
+        return res;
     }
     @Transactional
     @Override
@@ -483,7 +761,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
             date.set(Calendar.DATE, date.get(Calendar.DATE) + 5);
         }
 
-        switch (detectInfo.getDetectState()){
+        /*switch (detectInfo.getDetectState()){
             case 30:
                 if(detectInfo.getDetectProcessingResults() == 1){//付费维修
                     detectInfo.setDetectState(31);//同意付费维修
@@ -549,7 +827,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                     detectInfo.setDetectState(37);//原机退回
                 }
                 break;
-        }
+        }*/
 
         try {
             if(complaintDetectInfoMapper.updateDetectById(detectInfo) > 0){
@@ -566,10 +844,33 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                 log.setDetectId(detectInfo.getDetectId());
                 log.setRecordAdminId(admin.getAdminId());
                 log.setRecordDesc(detectInfo.getDetectCustomerDesc());
-                log.setRecordProcessingResults(detectInfo.getDetectProcessingResults());
+                if (detectInfo.getDetectState() == 25) {
+                    log.setRecordProcessingResults(6);
+                } else if (detectInfo.getDetectState() == 27) {
+                    log.setRecordProcessingResults(5);
+                } else if (detectInfo.getDetectState() == 31) {
+                    log.setRecordProcessingResults(1);
+                } else if (detectInfo.getDetectState() == 33) {
+                    log.setRecordProcessingResults(6);
+                }
+
                 complaintDetectInfoMapper.addTreatmentRecordLog(log);
                 //发送确认短信
-                String results = "";
+                //发送确认短信
+                if (detectInfo.getDetectState() != null) {
+                    String msg = null;
+                    switch (detect.getDetectState()) {
+                        case 31: msg="【优尼雅电子科技】客户已确认" + detect.getDetectNumber() + "维修,请立即开始维修处理。";break;
+                        case 33: msg="【优尼雅电子科技】客户确认" + detect.getDetectNumber() + "机器不维修(原机退回给客户),请联系业务员,并请业务员联系客户,将此机器寄回。";break;
+                        case 25: msg="【优尼雅电子科技】客户确认" + detect.getDetectNumber() + "机器不翻新(原机退回给客户),请联系业务员,并请业务员联系客户,将此机器寄回。";break;
+                        case 27: msg="【优尼雅电子科技】客户已确认" + detect.getDetectNumber() + "翻新,请立即开始翻新处理。";break;
+                        default: break;
+                    }
+                    if (msg != null) {
+                        smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, msg);
+                    }
+                }
+               /* String results = "";
                 switch (detectInfo.getDetectProcessingResults()){
                     case 1:
                         results = "付费维修";
@@ -589,7 +890,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                 }
                 String text = MessageFormat.format(SmsConfig.CUSTOMER_CONFIRM, detect.getDetectNumber(),results);
                 String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
-                logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送结果:"+result);
+                logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送结果:"+result);*/
              return true;
             }
         }catch (Exception e){
@@ -600,11 +901,11 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
     }
 
 
-    @Transactional
+    @Transactional(rollbackFor = {RuntimeException.class})
     @Override
     public boolean salesmanConfirm(ComplaintDetectInfo detectInfo) {
         ComplaintDetectInfo detect = complaintDetectInfoMapper.getDetectById(detectInfo.getDetectId());
-        if(detect.getDetectState() != 30 && detect.getDetectState() != 34 && detect.getDetectState() != 38 && detect.getDetectState() != 37){
+        if(detect.getDetectState() != 30 && detect.getDetectState() != 24 && detect.getDetectState() != 34 && detect.getDetectState() != 38 && detect.getDetectState() != 37){
             return false;
         }
         //计算待维修完成时间
@@ -624,58 +925,57 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
         }else{
             date.set(Calendar.DATE, date.get(Calendar.DATE) + 5);
         }
-                if(detectInfo.getDetectProcessingResults() == 1){//付费维修
-                    detectInfo.setDetectState(31);//同意付费维修
-                    detectInfo.setCompleteCutTime(date.getTime());
-                }else if(detectInfo.getDetectProcessingResults() == 2){//免费维修
-                    detectInfo.setDetectState(35);//同意付费维修
-                    detectInfo.setCompleteCutTime(date.getTime());
-                }
-                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);//
+        if (detectInfo.getDetectProcessingResults() != null) {
+            if(detectInfo.getDetectProcessingResults() == 1){
+                //付费维修
+                detectInfo.setDetectState(31);//同意付费维修
+                detectInfo.setCompleteCutTime(date.getTime());
+            }else if(detectInfo.getDetectProcessingResults() == 2){
+                //免费维修
+                detectInfo.setDetectState(35);//同意付费维修
+                detectInfo.setCompleteCutTime(date.getTime());
+            }
+            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);
+            }
+        }
         try {
             if(complaintDetectInfoMapper.updateDetectById(detectInfo) > 0){
                 //添加业务员操作记录
-                if(detect.getSalesmanAdminId() != null && !detect.getSalesmanAdminId().equals("")){
+                if(detect.getSalesmanAdminId() != null){
                     TreatmentRecordLog log = new TreatmentRecordLog();
                     log.setDetectId(detectInfo.getDetectId());
                     log.setRecordAdminId(detect.getSalesmanAdminId());
                     log.setRecordDesc(detect.getDetectCustomerDesc());
                     log.setRecordProcessingResults(detectInfo.getDetectProcessingResults());
                     complaintDetectInfoMapper.addTreatmentRecordLog(log);
-                    //发送确认短信
-                    String results = "";
-                    switch (detectInfo.getDetectProcessingResults()){
-                        case 1:
-                            results = "付费维修";
-                            break;
-                        case 2:
-                            results = "免费维修";
-                            break;
-                        case 3:
-                            results = "退货";
-                            break;
-                        case 4:
-                            results = "换货";
-                            break;
-                        case 5:
-                            results = "原机退回";
-                            break;
+                }
+                //发送确认短信
+                if (detectInfo.getDetectState() != null) {
+                    String msg = null;
+                    switch (detect.getDetectState()) {
+                        case 31: msg="【优尼雅电子科技】客户已确认" + detect.getDetectNumber() + "维修,请立即开始维修处理。";break;
+                        case 33: msg="【优尼雅电子科技】客户确认" + detect.getDetectNumber() + "机器不维修(原机退回给客户),请联系业务员,并请业务员联系客户,将此机器寄回。";break;
+                        case 25: msg="【优尼雅电子科技】客户确认" + detect.getDetectNumber() + "机器不翻新(原机退回给客户),请联系业务员,并请业务员联系客户,将此机器寄回。";break;
+                        case 27: msg="【优尼雅电子科技】客户已确认" + detect.getDetectNumber() + "翻新,请立即开始翻新处理。";break;
+                        default: break;
+                    }
+                    if (msg != null) {
+                        smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, msg);
                     }
-                    String text = MessageFormat.format(SmsConfig.CUSTOMER_CONFIRM, detect.getDetectNumber(),results);
-                    String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
-                    logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送结果:"+result);
-                    return true;
                 }
-
+                return true;
             }
         }catch (Exception e){
             e.printStackTrace();
@@ -844,5 +1144,22 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
         return complaintDetectInfoMapper.addMaterial(materialNumberInfo);
     }
 
+    @Override
+    public List<MaintainPhenomenon> listPhenomenon(Integer typeId) {
+        MaintainPhenomenon maintainPhenomenon = new MaintainPhenomenon();
+        maintainPhenomenon.setTypeId(typeId);
+        return phenomenonMapper.list(maintainPhenomenon);
+    }
+
+    @Override
+    public int editTransport(DetectTransport detectTransport) {
+        return detectTransportMapper.edit(detectTransport);
+    }
+
+    @Override
+    public MaintainPhenomenon getPhenomenon(Integer id) {
+        return phenomenonMapper.get(id);
+    }
+
 
 }

+ 84 - 63
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintSignclosedInfoServiceImpl.java

@@ -59,19 +59,18 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
     private InventoryLogMapper inventoryLogMapper;
     @Autowired
     private SmsService smsService;
-
     @Autowired
     private InventoryService inventoryService;
-
     @Autowired
     private SysMapper sysMapper;
-
     @Autowired
     private SalesOrderMapper salesOrderMapper;
     @Autowired
     private KuaiDi100 kuaidi100;
     @Autowired
     private LogisticsInfoService logisticsInfoService;
+    @Autowired
+    private ProcMethodMapper procMethodMapper;
 
     @Override
     @Transactional(rollbackFor = {Exception.class}, isolation = Isolation.REPEATABLE_READ)
@@ -209,7 +208,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
         }else if(record.getSignclosedLogisticsNumber() != null){
             //判断是否是京东
             if (record.getSignclosedLogisticsNumber().contains("-")){
-                    //截取-前的内容搜索一次
+                //截取-前的内容搜索一次
                 customerInfo.setSendLogisticsNo(StringUtils.substringBefore(record.getSignclosedLogisticsNumber(), "-"));
                 listCustomer = customerInfoMapper.listCustomer(customerInfo);
                 if(listCustomer.size() <= 0){
@@ -270,66 +269,72 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
             signclosedInfo.setSendbackId(info.getSendbackId());
             signclosedInfo.setSignclosedCustomerId(customerInfo.getCustomerId());
             signclosedInfo.setSignclosedId(record.getSignclosedId());
-            Integer msg = complaintSignclosedInfoMapper.updateSignclosedById(signclosedInfo);
-
-        if(msg == 1){
-            ComplaintSignclosedInfo infos = complaintSignclosedInfoMapper.getSignclosedById(record.getSignclosedId());
-            //判断是否需要生成维修记录
-            if(infos.getSignclosedProductInfoList().size() > 0) {
-                for (SignclosedProductInfo productInfo : infos.getSignclosedProductInfoList()) {
-                    ProductColor productColor = productMapper.getProduceColor(productInfo.getSignclosedProductColor());
-                    Product product = productMapper.getProduce(productColor.getColorProductId());
-                    if(product.getProductIsDetection() != null){
-                        if (product.getProductIsDetection() == 1) {
-                            for (int j = 0; j < productInfo.getProductNum(); j++) {
-                                //添加待检测信息
-                                //查询签收信息
-                                ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
-                                //生成维修编号
-                                String number = detectNumber();
-                                detectInfo.setDetectNumber(number);
-                                detectInfo.setProductId(productColor.getColorProductId());
-                                detectInfo.setProductColorId(productInfo.getSignclosedProductColor());
-                                detectInfo.setDetectProductNumber(product.getProductNumber());
-                                detectInfo.setDetectState(1);
-                                detectInfo.setCustomerId(infos.getSignclosedCustomerId());
-                                detectInfo.setIsMaintenance(0);
-                                detectInfo.setDetectRenovation(0);
-                                detectInfo.setDetectProcessingResults(0);
-                                detectInfo.setSignclosedId(infos.getSignclosedId());
-                                detectInfo.setDetectSource(1);
-                                Calendar date = Calendar.getInstance();
-                                date.setTime(new Date());
-                                boolean fl = false;
-                                for (int i = 1 ; i <= 3; i++){
-                                    date.set(Calendar.DATE, date.get(Calendar.DATE) + i);
-                                    //1--7的值,对应:星期日,星期一,星期二,星期三....星期六
-                                    int week = date.get(Calendar.DAY_OF_WEEK);
-                                    if(week == 1){
-                                        fl = true;
+            int msg = complaintSignclosedInfoMapper.updateSignclosedById(signclosedInfo);
+
+            if(msg == 1){
+                ComplaintSignclosedInfo infos = complaintSignclosedInfoMapper.getSignclosedById(record.getSignclosedId());
+                //判断是否需要生成维修记录
+                if(infos.getSignclosedProductInfoList().size() > 0) {
+                    for (SignclosedProductInfo productInfo : infos.getSignclosedProductInfoList()) {
+                        ProductColor productColor = productMapper.getProduceColor(productInfo.getSignclosedProductColor());
+                        Product product = productMapper.getProduce(productColor.getColorProductId());
+                        if(product.getProductIsDetection() != null){
+                            if (product.getProductIsDetection() == 1) {
+                                for (int j = 0; j < productInfo.getProductNum(); j++) {
+                                    //添加待检测信息
+                                    //查询签收信息
+                                    ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+                                    //生成维修编号
+                                    String number = detectNumber();
+                                    detectInfo.setDetectNumber(number);
+                                    detectInfo.setProductId(productColor.getColorProductId());
+                                    detectInfo.setProductColorId(productInfo.getSignclosedProductColor());
+                                    detectInfo.setDetectProductNumber(product.getProductNumber());
+                                    detectInfo.setDetectState(1);
+                                    detectInfo.setCustomerId(infos.getSignclosedCustomerId());
+                                    detectInfo.setIsMaintenance(0);
+                                    detectInfo.setDetectRenovation(0);
+                                    detectInfo.setDetectProcessingResults(0);
+                                    detectInfo.setSignclosedId(infos.getSignclosedId());
+                                    detectInfo.setDetectSource(1);
+                                    // 兼容后续的售后系统
+                                    detectInfo.setDetectCustmoerQuestion(customerInfo.getDescribeTitle());
+                                    detectInfo.setQuestionDescription(customerInfo.getCustomerDesc());
+                                    ProcMethod method = procMethodMapper.getProcMethodById(customerInfo.getProcMethodId());
+                                    detectInfo.setDetectIsMaintain(method.getProcMethodIsMaintain() == 2 ? 1 : 2);
+                                    detectInfo.setDetectName(customerInfo.getCustomerName() == null ? (customerInfo.getCustomerWechatName()) : customerInfo.getCustomerName());
+                                    detectInfo.setDetectTel(customerInfo.getCustomerTel());
+                                    detectInfo.setDetectBuytime(customerInfo.getSalesTime());
+
+                                    // 待检测截止时间
+                                    Calendar date = Calendar.getInstance();
+                                    date.setTime(new Date());
+                                    boolean fl = false;
+                                    for (int i = 1 ; i <= 3; i++){
+                                        date.set(Calendar.DATE, date.get(Calendar.DATE) + i);
+                                        //1--7的值,对应:星期日,星期一,星期二,星期三....星期六
+                                        int week = date.get(Calendar.DAY_OF_WEEK);
+                                        if(week == 1){
+                                            fl = true;
+                                        }
+                                        date.set(Calendar.DATE, date.get(Calendar.DATE) - i);
                                     }
-                                    date.set(Calendar.DATE, date.get(Calendar.DATE) - i);
-                                }
-                                if(fl){
-                                    date.set(Calendar.DATE, date.get(Calendar.DATE) + 4);
-                                }else{
-                                    date.set(Calendar.DATE, date.get(Calendar.DATE) + 3);
-                                }
-                                detectInfo.setMaintenanceCutTime(date.getTime());
-                                try {
-                                    complaintDetectInfoMapper.insert(detectInfo);
-                                    if(type == 1){
-                                        //客服关联客诉才发送通知短信
-                                        //发送短信通知维修检测人员
-                                        // 仓库电话
-                                        String tel = "18574702550";
-                                        String text = MessageFormat.format(SmsConfig.CUSTOMER_CONTACT, sigInfo.getSignclosedLogisticsNumber(),number);
-                                        String result = smsService.sendOtherCMS(tel, text);
-                                        logger.info("给 " + tel + " 手机用户发送短信:" + text+"发送关联客诉通知维修人员:"+result);
+                                    date.set(Calendar.DATE, date.get(Calendar.DATE) + (fl?4:3));
+                                    detectInfo.setMaintenanceCutTime(date.getTime());
+                                    try {
+                                        complaintDetectInfoMapper.insert(detectInfo);
+                                        if(type == 1){
+                                            // 客服关联客诉才发送通知短信
+                                            // 发送短信通知维修检测人员
+                                            // 仓库电话
+                                            String tel = "18574702550";
+                                            String text = MessageFormat.format(SmsConfig.CUSTOMER_CONTACT, sigInfo.getSignclosedLogisticsNumber(),number);
+                                            String result = smsService.sendOtherCMS(tel, text);
+                                            logger.info("给 " + tel + " 手机用户发送短信:" + text+"发送关联客诉通知维修人员:"+result);
+                                        }
+                                    } catch (Exception e) {
+                                        throw new RuntimeException("------------生成检测信息出错------------");
                                     }
-
-                                } catch (Exception e) {
-                                    throw new RuntimeException("------------生成检测信息出错------------");
                                 }
                             }
                         }
@@ -337,7 +342,6 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
                 }
             }
         }
-        }
         return 1;
     }
     /**
@@ -347,6 +351,11 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
      */
     public void addDet(Integer signclosedId,Integer detectState){
         ComplaintSignclosedInfo sigInfo = complaintSignclosedInfoMapper.getSignclosedById(signclosedId);
+        // 查询客诉信息
+        CustomerInfo temp = new CustomerInfo();
+        temp.setCustomerId(sigInfo.getSignclosedCustomerId());
+        CustomerInfo customerInfo = customerInfoMapper.listCustomer(temp).get(0);
+
         //判断是否需要生成维修记录
         if(sigInfo.getSignclosedProductInfoList().size() > 0) {
             for (SignclosedProductInfo productInfo : sigInfo.getSignclosedProductInfoList()) {
@@ -370,6 +379,16 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
                             detectInfo.setDetectRenovation(0);
                             detectInfo.setDetectProcessingResults(0);
                             detectInfo.setSignclosedId(sigInfo.getSignclosedId());
+
+                            // 兼容后续的售后系统
+                            detectInfo.setDetectCustmoerQuestion(customerInfo.getDescribeTitle());
+                            detectInfo.setQuestionDescription(customerInfo.getCustomerDesc());
+                            ProcMethod method = procMethodMapper.getProcMethodById(customerInfo.getProcMethodId());
+                            detectInfo.setDetectIsMaintain(method.getProcMethodIsMaintain() == 2 ? 1 : 2);
+                            detectInfo.setDetectName(customerInfo.getCustomerName() == null ? (customerInfo.getCustomerWechatName()) : customerInfo.getCustomerName());
+                            detectInfo.setDetectTel(customerInfo.getCustomerTel());
+                            detectInfo.setDetectBuytime(customerInfo.getSalesTime());
+                            
                             if(detectState != 40){
                                 detectInfo.setDetectSource(1);
                                 Calendar date = Calendar.getInstance();
@@ -396,6 +415,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
                             try {
                                 complaintDetectInfoMapper.insert(detectInfo);
                             } catch (Exception e) {
+                                e.printStackTrace();
                                 throw new RuntimeException("------------生成检测信息出错------------");
                             }
                         }
@@ -721,6 +741,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
         try {
             addDet(record.getSignclosedId(),1);
         }catch (Exception e){
+            e.printStackTrace();
             throw new RuntimeException("------------关联客诉出错------------");
         }
 

+ 16 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/ComplaintDetectInfoMapper.java

@@ -29,6 +29,22 @@ public interface ComplaintDetectInfoMapper {
     int updateDetectById(ComplaintDetectInfo record);
 
     /**
+     * 删除检测的问题现象
+     * @param id
+     * @return
+     */
+    int delPhenomenon(Integer id);
+
+    /**
+     * 录入检测现象
+     * @param detectPhenomenon
+     * @return
+     */
+    int addPhenomenon(DetectPhenomenon detectPhenomenon);
+
+    List<DetectPhenomenon> listDetectPhenomenon(Integer detectId);
+
+    /**
      * 获取品质检测项列表
      * @return
      */

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

@@ -0,0 +1,21 @@
+package com.iamberry.rst.service.fm.mapper;
+
+import com.iamberry.rst.core.fm.DetectCustmoerPhenomenon;
+
+import java.util.List;
+
+/**
+ * @author root
+ */
+public interface DetectCustmoerPhenomenonMapper{
+
+    int del(Integer dcpId);
+
+    int add(DetectCustmoerPhenomenon record);
+
+    DetectCustmoerPhenomenon get(Integer dcpId);
+
+    int edit(DetectCustmoerPhenomenon record);
+
+    List<DetectCustmoerPhenomenon> list(Integer detectId);
+}

+ 43 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/DetectCustmoerPhenomenonMapper.xml

@@ -0,0 +1,43 @@
+<?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.DetectCustmoerPhenomenonMapper" >
+
+  <select id="get" resultType="DetectCustmoerPhenomenon" parameterType="java.lang.Integer" >
+    select *
+    from tb_rst_complaint_detect_custmoer_phenomenon
+    where dcp_id = #{dcpId,jdbcType=INTEGER}
+  </select>
+
+  <select id="list" resultType="DetectCustmoerPhenomenon" parameterType="java.lang.Integer" >
+    select *
+    from tb_rst_complaint_detect_custmoer_phenomenon
+    where detect_id = #{detectId,jdbcType=INTEGER}
+  </select>
+
+  <delete id="del" parameterType="java.lang.Integer" >
+    delete from tb_rst_complaint_detect_custmoer_phenomenon
+    where dcp_id = #{dcpId,jdbcType=INTEGER}
+  </delete>
+
+  <insert id="add" parameterType="DetectCustmoerPhenomenon" useGeneratedKeys="true" keyProperty="dcpId">
+    insert into tb_rst_complaint_detect_custmoer_phenomenon (detect_id, phenomenon_id, dcp_name)
+    values (#{detectId,jdbcType=INTEGER}, #{phenomenonId,jdbcType=INTEGER}, #{dcpName,jdbcType=VARCHAR})
+  </insert>
+
+  <update id="edit" parameterType="DetectCustmoerPhenomenon" >
+    update tb_rst_complaint_detect_custmoer_phenomenon
+    <set >
+      <if test="detectId != null" >
+        detect_id = #{detectId,jdbcType=INTEGER},
+      </if>
+      <if test="phenomenonId != null" >
+        phenomenon_id = #{phenomenonId,jdbcType=INTEGER},
+      </if>
+      <if test="dcpName != null" >
+        dcp_name = #{dcpName,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where dcp_id = #{dcpId,jdbcType=INTEGER}
+  </update>
+
+</mapper>

+ 15 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/DetectTransportMapper.java

@@ -0,0 +1,15 @@
+package com.iamberry.rst.service.fm.mapper;
+
+import com.iamberry.rst.core.fm.DetectTransport;
+
+public interface DetectTransportMapper {
+
+    int del(Integer transportId);
+
+    int add(DetectTransport record);
+
+    DetectTransport get(Integer detectId);
+
+    int edit(DetectTransport record);
+
+}

+ 75 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/DetectTransportMapper.xml

@@ -0,0 +1,75 @@
+<?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.DetectTransportMapper" >
+
+  <select id="get" resultType="DetectTransport" parameterType="java.lang.Integer" >
+    select * from tb_rst_complaint_detect_transport where detect_id = #{detectId,jdbcType=INTEGER}
+  </select>
+
+  <delete id="del" parameterType="java.lang.Integer" >
+    delete from tb_rst_complaint_detect_transport where transport_id = #{transportId,jdbcType=INTEGER}
+  </delete>
+
+  <insert id="add" parameterType="DetectTransport" useGeneratedKeys="true" keyProperty="transportId">
+    insert into tb_rst_complaint_detect_transport (transport_id, detect_id, transport_send_firm, 
+      transport_send_post, transport_send_name, transport_send_tel, 
+      transport_sign_name, transport_sign_tel, transport_sign_addr, 
+      transport_sign_firm, transport_sign_post, transport_sign_prov, 
+      transport_sign_city, transport_sign_area, transport_sign_code)
+    values (#{transportId,jdbcType=INTEGER}, #{detectId,jdbcType=INTEGER}, #{transportSendFirm,jdbcType=VARCHAR}, 
+      #{transportSendPost,jdbcType=VARCHAR}, #{transportSendName,jdbcType=VARCHAR}, #{transportSendTel,jdbcType=VARCHAR}, 
+      #{transportSignName,jdbcType=VARCHAR}, #{transportSignTel,jdbcType=VARCHAR}, #{transportSignAddr,jdbcType=VARCHAR}, 
+      #{transportSignFirm,jdbcType=VARCHAR}, #{transportSignPost,jdbcType=VARCHAR}, #{transportSignProv,jdbcType=VARCHAR}, 
+      #{transportSignCity,jdbcType=VARCHAR}, #{transportSignArea,jdbcType=VARCHAR}, #{transportSignCode})
+  </insert>
+
+  <update id="edit" parameterType="DetectTransport" >
+    update tb_rst_complaint_detect_transport
+    <set >
+      <if test="detectId != null" >
+        detect_id = #{detectId,jdbcType=INTEGER},
+      </if>
+      <if test="transportSendFirm != null" >
+        transport_send_firm = #{transportSendFirm,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSendPost != null" >
+        transport_send_post = #{transportSendPost,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSendName != null" >
+        transport_send_name = #{transportSendName,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSendTel != null" >
+        transport_send_tel = #{transportSendTel,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSignName != null" >
+        transport_sign_name = #{transportSignName,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSignTel != null" >
+        transport_sign_tel = #{transportSignTel,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSignAddr != null" >
+        transport_sign_addr = #{transportSignAddr,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSignFirm != null" >
+        transport_sign_firm = #{transportSignFirm,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSignPost != null" >
+        transport_sign_post = #{transportSignPost,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSignProv != null" >
+        transport_sign_prov = #{transportSignProv,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSignCity != null" >
+        transport_sign_city = #{transportSignCity,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSignArea != null" >
+        transport_sign_area = #{transportSignArea,jdbcType=VARCHAR},
+      </if>
+      <if test="transportSignCode != null" >
+        transport_sign_code = #{transportSignCode,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where transport_id = #{transportId,jdbcType=INTEGER}
+  </update>
+
+</mapper>

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

@@ -8,39 +8,8 @@
 
   <select id="getDetectById" resultType="ComplaintDetectInfo" parameterType="java.lang.Integer" >
     select
-      detect_id detectId,
-      cd.product_id productId,
-      product_color_id productColorId,
-      detect_product_number detectProductNumber,
-      detect_state detectState,
-      cd.customer_id customerId,
-      detect_phenomenon detectPhenomenon,
-      detect_classification detectClassification,
-      detect_failure_cause detectFailureCause,
-      detect_results detectResults,
-      detect_point detectPoint,
-      detect_nalysis detectNalysis,
-      detect_content detectContent,
-      is_maintenance isMaintenance,
-      detect_desc detectDesc,
-      detect_date detectDate,
-      detect_create_time detectCreateTime,
-      detect_update_time detectUpdateTime,
+      cd.*,
       qd.describe_title questionTitle,
-      detect_offer detectOffer,
-      detect_renovation detectRenovation,
-      detect_processing_results detectProcessingResults,
-      detect_production detectProduction,
-      detect_fuselage_barcode detectFuselageBarcode,
-      detect_film_type detectFilmType,
-      detect_float_type detectFloatType,
-      detect_version_number detectVersionNumber,
-      detect_is_refurbishing detectIsRefurbishing,
-      maintenance_results maintenanceResults,
-      detect_number detectNumber,
-      complete_cut_time completeCutTime,
-      maintenance_cut_time maintenanceCutTime,
-      cd.signclosed_id signclosedId,
       pi.product_name productName,
       ci.color_name colorName,
       c.customer_create_time customerCreateTime,
@@ -56,23 +25,10 @@
       cs.signclosed_logistics_number logisticsNumber,
       cs.signclosed_send_name signclosedName,
       cs.signclosed_send_tel signclosedTel,
-      cd.detect_is_print detectIsPrint,
-      cd.detect_print_time detectPrintTime,
-      cd.detect_placeorder detectPlaceorder,
-      cd.detect_completion_time detectCompletionTime,
-      cd.maintenance_completion_time maintenanceCompletionTime,
-      cd.renovation_completion_time renovationCompletionTime,
-      cd.scrap_completion_time scrapCompletionTime,
       qd.describe_content describeContent,
       qd.describe_handle_desc describeHandleDesc,
       sa.admin_name adminName,
       cs.signclosed_is_whetherLess signclosedIsWhetherLess,
-      cd.salesman_admin_id salesmanAdminId,
-      cd.detect_name detectName,
-      cd.detect_tel detectTel,
-      cd.question_id questionId,
-      cd.method_id methodId,
-      cd.detect_source detectSource,
       cq.question_name questionName,
       cq.question_profile questionProfile,
       ssa.admin_name salesmanAdminName,
@@ -80,11 +36,8 @@
       cpms.proc_method_name methodName,
       cpts.proc_type_name typeName,
       cpts.proc_type_id typeId,
-      cd.company_id companyId,
-      si.store_name signclosedStoreName,
-      cd.detect_confirm_time detectConfirmTime,
-      cd.detect_buy_time detectBuytime,
-      cd.question_description questionDescription
+      si.store_name signclosedStoreName
+
     from tb_rst_complaint_detect cd
     LEFT JOIN tb_rst_cm_question_describe qd on cd.customer_id = qd.customer_id
     LEFT JOIN tb_rst_product_color ci on cd.product_color_id = ci.color_id
@@ -119,39 +72,7 @@
 
   <select id="listComplaintDetect" resultType="ComplaintDetectInfo" parameterType="ComplaintDetectInfo" >
     select
-      cd.detect_id detectId,
-      cd.product_id productId,
-      cd.product_color_id productColorId,
-      cd.detect_product_number detectProductNumber,
-      cd.detect_state detectState,
-      cd.detect_phenomenon detectPhenomenon,
-      cd.detect_classification detectClassification,
-      cd.detect_failure_cause detectFailureCause,
-      cd.signclosed_id signclosedId,
-      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.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,
-      cd.detect_production detectProduction,
-      cd.detect_fuselage_barcode detectFuselageBarcode,
-      cd.detect_film_type detectFilmType,
-      cd.detect_float_type detectFloatType,
-      cd.detect_version_number detectVersionNumber,
-      cd.detect_is_refurbishing detectIsRefurbishing,
-      cd.maintenance_results maintenanceResults,
-      cd.detect_number detectNumber,
-      cd.complete_cut_time completeCutTime,
-      maintenance_cut_time maintenanceCutTime,
+      cd.*,
       qd.describe_title questionTitle,
       pi.product_name productName,
       pi.product_abbreviation productAbbreviation,
@@ -166,37 +87,19 @@
       cs.signclosed_date signclosedDate,
       c.customer_create_time customerCreateTime,
       cs.signclosed_logistics_number logisticsNumber,
-      cd.detect_is_print detectIsPrint,
-      cd.detect_print_time detectPrintTime,
       cs.signclosed_send_name signclosedName,
       cs.signclosed_send_tel signclosedTel,
-      cd.detect_placeorder detectPlaceorder,
-      cd.detect_completion_time detectCompletionTime,
-      cd.maintenance_completion_time maintenanceCompletionTime,
-      cd.renovation_completion_time renovationCompletionTime,
-      cd.scrap_completion_time scrapCompletionTime,
       qd.describe_content describeContent,
       qd.describe_handle_desc describeHandleDesc,
       sa.admin_name adminName,
       cs.signclosed_is_whetherLess signclosedIsWhetherLess,
-      cd.salesman_admin_id salesmanAdminId,
-      cd.detect_name detectName,
-      cd.detect_tel detectTel,
-      cd.question_id questionId,
-      cd.method_id methodId,
-      cd.detect_source detectSource,
       ssa.admin_name salesmanAdminName,
       cq.question_name questionName,
       cq.question_profile questionProfile,
       cpms.proc_method_name methodName,
       cpts.proc_type_name typeName,
-      cd.company_id companyId,
-      si.store_name signclosedStoreName,
-      cd.detect_is_download detectIsDownload,
       cs.signclosed_customer_desc signclosedCustomerDesc,
-      cd.detect_confirm_time detectConfirmTime,
-      cd.detect_buy_time detectBuytime,
-      cd.question_description questionDescription,
+      si.store_name signclosedStoreName,
       ssi.store_name storeName
     from tb_rst_complaint_detect cd
     LEFT JOIN tb_rst_cm_question_describe qd on cd.customer_id = qd.customer_id
@@ -287,6 +190,9 @@
       <if test="detectIsPrint != null and detectIsPrint != ''" >
         AND cd.detect_is_print  = #{detectIsPrint}
       </if>
+      <if test="status != null and status == 0">
+        and cd.detect_state = 0
+      </if>
       <if test="status != null and status == 1">
         and cd.detect_state = 1
       </if>
@@ -420,6 +326,12 @@
       <if test="methodName != null and methodName != ''">
         AND m.proc_method_name LIKE CONCAT('%', #{methodName}, '%')
       </if>
+      <if test="startTime != null and startTime != ''" >
+        AND d.detect_create_time &gt;= #{startTime}
+      </if>
+      <if test="endTime != null and endTime != ''" >
+        AND d.detect_create_time  &lt;= #{endTime}
+      </if>
     </where>
   </select>
 
@@ -559,6 +471,9 @@
       <if test="companyId != null" >
         company_id = #{companyId},
       </if>
+      <if test="adminId != null" >
+        admin_id = #{adminId},
+      </if>
       <if test="detectIsDownload != null" >
         detect_is_download = #{detectIsDownload},
       </if>
@@ -569,7 +484,22 @@
         detect_buy_time = #{detectBuytime},
       </if>
       <if test="questionDescription != null" >
-        question_description = #{questionDescription}
+        question_description = #{questionDescription},
+      </if>
+      <if test="phenomenonId != null" >
+        phenomenon_id = #{phenomenonId},
+      </if>
+      <if test="detectCustmoerQuestion != null" >
+        detect_custmoer_question = #{detectCustmoerQuestion},
+      </if>
+      <if test="deleteMaintainType != null" >
+        delete_maintain_type = #{deleteMaintainType},
+      </if>
+      <if test="deleteIsUse != null" >
+        delete_is_use = #{deleteIsUse},
+      </if>
+      <if test="detectPhenomenonId != null" >
+        detect_phenomenon_id = #{detectPhenomenonId},
       </if>
     </set>
     where
@@ -619,7 +549,15 @@
     detect_confirm_time,
     detect_buy_time,
     question_description,
-    store_id
+    store_id,
+    phenomenon_id,
+    detect_custmoer_question,
+    detect_is_maintain,
+    delete_maintain_type,
+    delete_is_use,
+    detect_phenomenon_id,
+    admin_id,
+    detect_customer_desc
     )
     values
       (
@@ -663,7 +601,15 @@
       #{detectConfirmTime},
       #{detectBuytime},
       #{questionDescription},
-      #{storeId}
+      #{storeId},
+      #{phenomenonId},
+      #{detectCustmoerQuestion},
+      #{detectIsMaintain},
+      #{deleteMaintainType},
+      #{deleteIsUse},
+      #{detectPhenomenonId},
+      #{adminId},
+      #{detectCustomerDesc}
       )
   </insert>
 
@@ -791,6 +737,23 @@
     detect_id = #{detectId}
   </select>
 
+  <delete id="delPhenomenon" parameterType="Integer">
+    delete FROM tb_rst_complaint_detect_phenomenon where detect_id = #{detectId}
+  </delete>
+
+  <select id="listDetectPhenomenon" parameterType="Integer" resultType="DetectPhenomenon">
+    select * from tb_rst_complaint_detect_phenomenon where detect_id = #{detectId}
+  </select>
+
+  <insert id="addPhenomenon" parameterType="DetectPhenomenon" useGeneratedKeys="true" keyProperty="dpId">
+    INSERT INTO
+    tb_rst_complaint_detect_phenomenon (
+            detect_id, phenomenon_id, dp_name
+    )
+    VALUES
+        ( #{detectId}, #{phenomenonId}, #{dpName} )
+  </insert>
+
   <insert id="addTreatmentRecordLog" parameterType="TreatmentRecordLog">
     INSERT INTO tb_rst_treatment_record_log (
         record_processing_results,
@@ -803,6 +766,7 @@
         (
             #{recordProcessingResults},#{recordDesc},#{recordAdminId},#{detectId},NOW())
   </insert>
+
   <select id="listTreatmentRecordLog" parameterType="Integer" resultType="TreatmentRecordLog">
     SELECT
     *,

+ 5 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/order/OrderSyncLogServiceImpl.java

@@ -644,13 +644,12 @@ public class OrderSyncLogServiceImpl implements OrderSyncLogService {
     public Integer syncXYTOrderOne(Integer type, String orderId) {
         Integer flag = 0;
         OrderSyncPlatform orderSyncPlatform =  getXYTPlatform();
-        Map<String,Object> paramsMap = new HashMap<>();
-        List<Map<String,Object>> conditionTypeList = new ArrayList<>();
+        List<Map<String,Object>> conditionTypeList = new ArrayList<>(5);
 
         String[] orderIds = {orderId};
 
         //receiverName 收件人姓名 //receiverMobile收件人手机号码 //outOrderId原始订单号 //orderId系统订单号
-        Map<String,Object> orderIdMap = new HashMap<>();
+        Map<String,Object> orderIdMap = new HashMap<>(2);
         orderIdMap.put("condType","orderId");
         orderIdMap.put("condValue",orderIds);
         conditionTypeList.add(orderIdMap);
@@ -660,10 +659,12 @@ public class OrderSyncLogServiceImpl implements OrderSyncLogService {
         Integer amountSuccessAllNum = 0;   //同步成功总数量
         String batchId = ""; //批次id
 
-        Map<String,Object> condMap = new HashMap<>();
+        Map<String,Object> condMap = new HashMap<>(3);
         condMap.put("pageNumber",1);
         condMap.put("pageSize",20);
         condMap.put("conditionType",conditionTypeList);
+
+        Map<String,Object> paramsMap = new HashMap<>(1);
         paramsMap.put("cond",condMap);
         String json = this.syncXYT("IOrderService.query",paramsMap);
 

+ 315 - 9
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminAfterSaleController.java

@@ -1,11 +1,13 @@
 package com.iamberry.rst.controllers.cm;
 
-import com.iamberry.rst.core.cm.CompanyInfo;
-import com.iamberry.rst.core.cm.ComplaintQuestionInfo;
-import com.iamberry.rst.core.cm.StoreInfo;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.iamberry.rst.core.cm.*;
 import com.iamberry.rst.core.fm.ComplaintAfterSalesNum;
 import com.iamberry.rst.core.fm.ComplaintDetectInfo;
+import com.iamberry.rst.core.fm.DetectTransport;
 import com.iamberry.rst.core.fm.DetectionBasis;
+import com.iamberry.rst.core.order.EOrderRequestData;
 import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.order.ProductType;
@@ -15,21 +17,27 @@ import com.iamberry.rst.core.pts.Produce;
 import com.iamberry.rst.core.pts.PtsBatch;
 import com.iamberry.rst.core.pts.PtsMachine;
 import com.iamberry.rst.core.sys.Admin;
+import com.iamberry.rst.core.tools.LogisticsInfo;
+import com.iamberry.rst.faces.cm.CompanyInfoService;
 import com.iamberry.rst.faces.cm.StoreInfoService;
+import com.iamberry.rst.faces.cm.StoreShipService;
 import com.iamberry.rst.faces.fm.ComplaintDetectInfoService;
+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.faces.pts.ProduceService;
 import com.iamberry.rst.faces.pts.PtsBatchService;
+import com.iamberry.rst.service.cm.mapper.CompanyInfoMapper;
 import com.iamberry.rst.service.cm.mapper.ComplaintQuestionInfoMapper;
+import com.iamberry.rst.service.cm.mapper.MaintainTypeMapper;
+import com.iamberry.rst.service.fm.mapper.DetectTransportMapper;
 import com.iamberry.rst.util.GenerateKeyUtil;
 import com.iamberry.rst.utils.*;
 import com.iamberry.url.URLUtils;
-import com.iamberry.wechat.tools.DateTimeUtil;
-import com.iamberry.wechat.tools.ResponseJson;
-import com.iamberry.wechat.tools.StrUtils;
+import com.iamberry.wechat.tools.*;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -37,11 +45,16 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.charset.StandardCharsets;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /***
  * 优尼雅客户系统-售后服务功能
@@ -66,6 +79,21 @@ public class AdminAfterSaleController {
     private GenerateKeyUtil generateKeyUtil;
     @Autowired
     private PtsBatchService batchService;
+    @Autowired
+    private MaintainTypeMapper maintainTypeMapper;
+
+    @Autowired
+    private LogisticsInfoService logisticsInfoService;
+
+    @Autowired
+    private StoreShipService storeShipService;
+
+    @Autowired
+    private DetectTransportMapper detectTransportMapper;
+
+    @Autowired
+    private CompanyInfoService companyInfoService;
+
 
     @RequiresPermissions("afterSales:SysAfterSales")
     @RequestMapping(value = "/adafterSalesUI")
@@ -82,6 +110,8 @@ public class AdminAfterSaleController {
         ModelAndView mv = new ModelAndView("yulia/add");
         mv.addObject("listComplaintQuestionInfo",listComplaintQuestionInfo);
         mv.addObject("storeInfos",storeInfos);
+        mv.addObject("types",maintainTypeMapper.list());
+        mv.addObject("company", companyInfoService.getCompanyInfoById(AdminUtils.getLoginAdmin().getAdminPcId()));
         return mv;
     }
 
@@ -190,6 +220,75 @@ public class AdminAfterSaleController {
         mv.addObject("url", request.getRequestURI().replace(request.getContextPath(), "") + "?" + URLUtils.getString(detect, pageSize));
         return mv;
     }
+    /**
+     * 下载
+     * @return
+     */
+    @RequiresPermissions("afterSales:list")
+    @RequestMapping("/downloadAfterSales")
+    public ModelAndView downloadAfterSales(HttpServletRequest request,
+                                         ComplaintDetectInfo detect) {
+        // 查询当前管理员所属的公司的店铺
+        StoreInfo store = new StoreInfo();
+        store.setCompanyId(AdminUtils.getLoginAdmin().getAdminPcId());
+        List<StoreInfo> storeInfos = storeInfoService.listStore(store);
+        if (detect == null) {
+            detect = new ComplaintDetectInfo();
+        }
+        if (storeInfos != null && !storeInfos.isEmpty()) {
+            Integer[] temp = new Integer[storeInfos.size()];
+            for (int i = 0; i < storeInfos.size(); i++) {
+                temp[i] = storeInfos.get(i).getStoreId();
+            }
+            detect.setStoreIds(temp);
+        }
+        // 设置查询数据
+        PagedResult<ComplaintDetectInfo> result = complaintDetectInfoService.listAfterSales(new PageRequest<>(detect, 1, 10_000, false));
+        // 下载的文件头
+        List<String> titles = new ArrayList<>();
+        titles.add("维修状态");
+        titles.add("维修编号");
+        titles.add("产品信息");
+        titles.add("客户姓名");
+        titles.add("客户电话");
+        titles.add("寄回物流");
+        titles.add("客户反馈问题");
+        titles.add("处理方式");
+        titles.add("机器条码");
+        titles.add("报价");
+        titles.add("寄送物流");
+        titles.add("录入时间");
+        // 组装数据
+
+        List<List<String>> varList = new ArrayList<>();
+        result.getDataList().forEach((master) -> {
+                List<String> cols = new ArrayList<>();
+                if (master.getDetectState() == 20 || master.getDetectState() == 24) {
+                    cols.add("售后期内,免费换新");
+                } else {
+                    cols.add(StrUtils.detectState(master.getDetectState()));
+                }
+                cols.add(master.getDetectNumber());
+                cols.add(master.getProductName());
+                cols.add(master.getDetectName());
+                cols.add(master.getDetectTel());
+                cols.add(master.getTransport().getTransportSendPost());
+                cols.add(master.getDetectCustmoerQuestion());
+                cols.add(master.getDetectIsMaintain() == 1 ? "付费维修" : "待工厂检测翻新");
+                cols.add(master.getMachineNo());
+                cols.add((master.getDetectOffer() == null) ? "" : (master.getDetectOffer()/100)+"");
+                cols.add(master.getTransport().getTransportSignPost());
+                cols.add(DateTimeUtil.format(master.getDetectCreateTime(), "yyyy/MM/dd HH:mm:ss"));
+                varList.add(cols);
+            }
+        );
+
+        Map<String, Object> model = new HashMap<String, Object>(3);
+        model.put("fileName", "维修统计");
+        model.put("titles", titles);
+        model.put("varList", varList);
+        return new ModelAndView(new ObjectExcelView(), model);
+    }
 
     /**
      * 删除检测信息
@@ -207,6 +306,24 @@ public class AdminAfterSaleController {
         return new ModelAndView("yulia/confirm");
     }
 
+
+    @RequestMapping("/editTransportUI")
+    @RequiresPermissions("afterSales:list")
+    public ModelAndView editTransportUI(@RequestParam("id") Integer id) {
+        return new ModelAndView("yulia/edit_transport").addObject("obj", complaintDetectInfoService.getDetectById(id));
+    }
+
+    /**
+     * 查询售后系统的问题现象
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/editTransport")
+    @RequiresPermissions("afterSales:list")
+    public ResponseJson editTransport(DetectTransport transport) {
+        return complaintDetectInfoService.editTransport(transport) >= 1 ? ResponseJson.getSUCCESS() : ResponseJson.getFAILURE();
+    }
+
     /**
      * 维修部处理,此处需要 预计完成时间 maintenanceCutTime,并将状态更改为1(待检测)
      */
@@ -246,4 +363,193 @@ public class AdminAfterSaleController {
         return complaintDetectInfoService.updateDetectById(temp) >= 1 ? ResponseJson.getSUCCESS().addResponseKeyValue("no", detectByMachine.getDetectNumber()) : ResponseJson.getFAILURE();
     }
 
+    @RequestMapping("/printDetectUI")
+    @RequiresPermissions("afterSales:confirmMachine")
+    public ModelAndView printDetectUI(@RequestParam("id") Integer id) {
+        return new ModelAndView("cm/inspection/print")
+                .addObject("id", id)
+                .addObject("list", logisticsInfoService.getLogisticsInfoList(new LogisticsInfo()));
+    }
+
+
+    /**
+     * 打单发货,兼容多台打印机并发打印
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/printDetect")
+    @RequiresPermissions("afterSales:confirmMachine")
+    public ResponseJson printDetect(@RequestParam("id") Integer detectId,
+                                   @RequestParam("firm") String firm,
+                                   HttpServletRequest request) {
+        ComplaintDetectInfo detect = complaintDetectInfoService.getDetectById(detectId);
+        // 检查仓库的发货人信息
+        StoreShip storeShip = null;
+        if(detect.getStoreId() != null){
+            storeShip = storeShipService.getStoreShipByStoreId(detect.getStoreId());
+        }
+        if(storeShip == null){
+            return ResponseJson.getFAILURE().addResponseKeyValue("error","该订单没有绑定店铺或店铺没有发货人信息");
+        }
+        // 获取物流公司的设置数据
+        LogisticsInfo logisticsInfo = new LogisticsInfo();
+        logisticsInfo.setLogisticsRstCode(firm);
+        List<LogisticsInfo> list = logisticsInfoService.getLogisticsInfoList(logisticsInfo);
+        if (list == null || list.isEmpty() || list.size() != 1 || list.get(0) == null || list.get(0).getLogisticsReamk() == null) {
+            return ResponseJson.getFAILURE().addResponseKeyValue("error","该订单未搜索到对应的物流公司");
+        }
+        logisticsInfo = list.get(0);
+        EOrderRequestData eOrderRequestData = JSONObject.parseObject(logisticsInfo.getLogisticsReamk(), EOrderRequestData.class);
+        if (eOrderRequestData == null) {
+            return ResponseJson.getFAILURE().addResponseKeyValue("error","物流公司未设置对应的数据");
+        }
+
+        /* 组装通用数据 */
+        eOrderRequestData.OrderCode = detect.getDetectNumber();
+        eOrderRequestData.Cost = (0.00);
+        eOrderRequestData.OtherCost = (0.0);
+        eOrderRequestData.PayType = 1;
+        eOrderRequestData.Remark = detectId.toString();
+        eOrderRequestData.IsReturnPrintTemplate = 1;
+        /* 收件人信息 */
+        Map<String, Object> receiver = new HashMap<String, Object>(7);
+        receiver.put("Name", detect.getTransport().getTransportSignName());
+        receiver.put("Tel", detect.getTransport().getTransportSignTel());
+        receiver.put("ProvinceName", detect.getTransport().getTransportSignProv());
+        receiver.put("CityName", detect.getTransport().getTransportSignCity());
+        receiver.put("ExpAreaName", detect.getTransport().getTransportSignArea());
+        receiver.put("Address", detect.getTransport().getTransportSignAddr());
+        receiver.put("PostCode", detect.getTransport().getTransportSignCode());
+        eOrderRequestData.Receiver = (receiver);
+        /* 发件人信息 */
+        Map<String, Object> sender = new HashMap<String, Object>(7);
+        sender.put("Name", storeShip.getStoreShipName());
+        sender.put("Tel", storeShip.getStoreShipTel());
+        sender.put("ProvinceName", storeShip.getStoreShipProvince());
+        sender.put("CityName", storeShip.getStoreShipCity());
+        sender.put("ExpAreaName", "清溪镇");
+        sender.put("Address", storeShip.getStoreShipAddress());
+        sender.put("PostCode", "523660");
+        eOrderRequestData.Sender = (sender);
+        /* 产品信息 */
+        List<Map<String, Object>> commodity = new ArrayList<>();
+        Map<String, Object> product1 = new HashMap<String, Object>(3);
+        product1.put("GoodsName", detect.getProductName());
+        product1.put("Goodsquantity", 1);
+        product1.put("GoodsWeight", 10.0);
+        commodity.add(product1);
+        double colorIsWeight = 10.0;
+        eOrderRequestData.Commodity = (commodity);
+        eOrderRequestData.Weight = (colorIsWeight/1000);
+        eOrderRequestData.Quantity = 1;
+        JSONObject jsonObject = null;
+        try {
+            // 向第三方系统【快递鸟】提交订单数据,第三方系统会检测订单是否重复
+            jsonObject = JSONObject.parseObject(OrderUtils.orderOnlineByJson(eOrderRequestData));
+            if (!jsonObject.getBoolean("Success")) {
+                // 获取电子面单失败
+                String reason = jsonObject.get("Reason").toString();
+                throw new RuntimeException(reason);
+            }
+            // 提交数据库
+            DetectTransport transport = new DetectTransport();
+            transport.setTransportId(detect.getTransport().getTransportId());
+            transport.setTransportSignFirm(firm);
+            transport.setTransportSignPost(jsonObject.getJSONObject("Order").getString("LogisticCode"));
+            detectTransportMapper.edit(transport);
+            // 保存HTML
+            savePostFile(request.getServletContext().getRealPath("/common/"), jsonObject.toJSONString(), detect.getDetectNumber());
+        } catch (Exception e) {
+            return ResponseJson.getFAILURE().addResponseKeyValue("error", e.getMessage());
+        }
+        // 成功
+        return ResponseJson.getSUCCESS().addResponseKeyValue("json", jsonObject.toJSONString());
+    }
+
+    // 重新打印发货
+    @ResponseBody
+    @RequestMapping(value = "/rePrintOrder", produces= MediaType.APPLICATION_JSON_VALUE+";charset=utf-8")
+    @RequiresPermissions("afterSales:confirmMachine")
+    public ResponseJson rePrintOrder(@RequestParam("no") String no,
+                                     HttpServletRequest request) throws IOException {
+        String filePath = request.getServletContext().getRealPath("/common/send_order");
+        filePath = filePath + File.separator + no + ".txt";
+        return ResponseJson.getSUCCESS().addResponseKeyValue("json", readNIO(filePath));
+    }
+
+    private String readNIO(String pathname) {
+        FileInputStream fin = null;
+        StringBuilder temp = new StringBuilder();
+        try {
+            fin = new FileInputStream(new File(pathname));
+            FileChannel channel = fin.getChannel();
+            ByteBuffer bf = ByteBuffer.allocate(1024);
+            int length;
+            while ((length = channel.read(bf)) != -1) {
+                bf.clear();
+                temp.append(new String(bf.array(), 0, length, StandardCharsets.UTF_8));
+            }
+            channel.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if (fin != null) {
+                try {
+                    fin.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return temp.toString();
+    }
+
+    /**
+     * 保存物流文件
+     * @param filePath
+     * @param text
+     * @param orderId
+     * @throws IOException
+     */
+    private void savePostFile(String filePath, String text, String orderId) throws IOException {
+        File dir = new File(filePath + File.separator + "send_order");
+        if (!dir.exists()) {
+            dir.mkdir();
+        }
+        File file = new File(dir.getAbsolutePath() + File.separator + orderId + ".txt");
+        if (!file.exists()) {
+            if (!file.createNewFile()) {
+                throw new RuntimeException("创建文件失败");
+            }
+        }
+        FileChannel foChannel = null;
+        try {
+            byte[] jsonByte = text.getBytes(StandardCharsets.UTF_8);
+            ByteBuffer buffer = ByteBuffer.allocate(jsonByte.length);
+            buffer.put(jsonByte);
+            foChannel = new FileOutputStream(file).getChannel();
+            buffer.flip();
+            foChannel.write(buffer);
+        } catch (Exception e) {
+
+        } finally {
+            if (foChannel != null) {
+                foChannel.close();
+            }
+        }
+    }
+
+    /**
+     * 查询售后系统的问题现象
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/listPhenomenon")
+    @RequiresPermissions("afterSales:SysAfterSales")
+    public ResponseJson listPhenomenon(@RequestParam("typeId") Integer id) {
+        return ResponseJson.getSUCCESS().addResponseKeyValue("list", complaintDetectInfoService.listPhenomenon(id));
+    }
+
+
 }

+ 8 - 4
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java

@@ -21,8 +21,10 @@ import com.iamberry.rst.service.cm.mapper.ComplaintQuestionInfoMapper;
 import com.iamberry.rst.service.sys.mapper.SysMapper;
 import com.iamberry.rst.utils.AdminUtils;
 import com.iamberry.rst.util.GenerateKeyUtil;
+import com.iamberry.rst.utils.StaticModelUtil;
 import com.iamberry.rst.utils.StitchAttrUtil;
 import com.iamberry.wechat.tools.ResponseJson;
+import com.iamberry.wechat.tools.StrUtils;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.HorizontalAlignment;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -143,8 +145,8 @@ public class AdminDetectController {
         //查询各个状态数量
         ComplaintAfterSalesNum complaintAfterSalesNum = complaintDetectInfoService.getDetectCount();
         mv.addObject("complaintAfterSalesNum",complaintAfterSalesNum);
-
-         StitchAttrUtil.getSa().setModelAndView(detect, mv, "/admin/detect/select_detect_list", result);
+        mv.addObject("util", StaticModelUtil.useStaticPacker(StrUtils.class.getName()));
+        StitchAttrUtil.getSa().setModelAndView(detect, mv, "/admin/detect/select_detect_list", result);
         return mv;
     }
 
@@ -321,6 +323,7 @@ public class AdminDetectController {
         mv.addObject("listMaterialItem",listMaterialItem);
         mv.addObject("detectinfo",detectinfo);
         mv.addObject("imgList",imgList);
+        mv.addObject("util", StaticModelUtil.useStaticPacker(StrUtils.class.getName()));
         return mv;
     }
 
@@ -378,6 +381,7 @@ public class AdminDetectController {
         mv.addObject("listMaterial",listMaterial);
         mv.addObject("detectInfo",detectinfo);
         mv.addObject("imgList",imgList);
+        mv.addObject("phenomenonList", complaintDetectInfoService.listPhenomenon(0));
         return mv;
     }
 
@@ -582,6 +586,7 @@ public class AdminDetectController {
         detectInfo.setDetectDate(new Date());
         mv.addObject("detectId",detectId);
         mv.addObject("detectInfo",detectInfo);
+        mv.addObject("phenomenonList", complaintDetectInfoService.listPhenomenon(0));
         return mv;
     }
     /**
@@ -659,7 +664,7 @@ public class AdminDetectController {
             msg.setReturnCode(500);
             return msg;
         }
-        if(detectInfo.getDetectId() == null || detectInfo.getDetectId().equals("")){
+        if(detectInfo.getDetectId() == null || "".equals(detectInfo.getDetectId())){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
@@ -672,7 +677,6 @@ public class AdminDetectController {
         String[] componentsImgs = request.getParameterValues("componentsImg");
         String[] configli1 = request.getParameterValues("configli1");
         detectInfo.setConfigli1(configli1);
-        detectInfo.setDetectCompletionTime(new Date());
         Integer num = complaintDetectInfoService.updateDetectById(detectInfo,componentsImgs);
         if (num < 1) {
             msg.setResultCode(500);

+ 1 - 9
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java

@@ -141,20 +141,12 @@ public class AdminSignclosedController {
 
         List results = new ArrayList();
         for (PtsMachine machine : ptsMachineList){
-            Map<String,Object> m = new HashMap<String,Object>();
+            Map<String,Object> m = new HashMap<String,Object>(2);
             m.put("id",machine.getMachineId());
             m.put("text",machine.getMachineBarcode());
             results.add(m);
         }
 
-//        Map<String,Object> paginationMap = new HashMap<String,Object>();
-//        paginationMap.put("more",true);
-//
-//        Map<String,Object> map = new HashMap<String,Object>();
-//        map.put("results",results);
-//        map.put("pagination",paginationMap);
-//
-//        rj.addResponseKeyValue("map",map);
         rj.addResponseKeyValue("results",results);
         return rj;
     }

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

@@ -35,7 +35,7 @@ public class detectController {
     @RequestMapping(value = "/to_detect_msg")
     public ModelAndView toDetectMsg(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("cm/inspection/detect_msg");
-        String detectId = request.getParameter("detectId");
+        Integer detectId = Integer.parseInt(request.getParameter("detectId"));
         mv.addObject("detectId",detectId);
         return mv;
     }

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

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

+ 1 - 1
watero-rst-web/src/main/resources/log4j.properties

@@ -41,7 +41,7 @@ log4j.logger.org.apache=DEBUG
 # 工作流日志级别
 log4j.logger.org.activiti=INFO
 # 整个项目代码的日志级别
-log4j.logger.com.iamberry=INFO
+log4j.logger.com.iamberry=DEBUG
 # mybatis日志配置,为了方便定位问题,将日志级别设置为DEBUG,方便打印SQL语句
 log4j.logger.com.apache.ibatis=DEBUG
 log4j.logger.com.mybatis=DEBUG

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

@@ -71,6 +71,7 @@
 		<typeAlias type="com.iamberry.rst.core.pts.PtsSalesCompany" alias="PtsSalesCompany"/>
 		<typeAlias type="com.iamberry.rst.core.pts.WechatMp" alias="WechatMp"/>
 
+
 		<typeAlias type="com.iamberry.rst.core.cm.ClosedProdcue" alias="ClosedProdcue"/>
 		<typeAlias type="com.iamberry.rst.core.cm.CompanyInfo" alias="CompanyInfo"/>
 		<typeAlias type="com.iamberry.rst.core.cm.ComplaintQuestionInfo" alias="ComplaintQuestionInfo"/>
@@ -96,6 +97,8 @@
 		<typeAlias type="com.iamberry.rst.core.cm.CmRelation" alias="CmRelation"/>
 
 
+		<typeAlias type="com.iamberry.rst.core.fm.MaintainPhenomenon" alias="MaintainPhenomenon"/>
+		<typeAlias type="com.iamberry.rst.core.fm.MaintainType" alias="MaintainType"/>
 		<typeAlias type="com.iamberry.rst.core.fm.AwaitingSignclosedProductInfo" alias="AwaitingSignclosedProductInfo"/>
 		<typeAlias type="com.iamberry.rst.core.fm.ComplaintDetectInfo" alias="ComplaintDetectInfo"/>
 		<typeAlias type="com.iamberry.rst.core.fm.ComplaintMaintenanceInfo" alias="ComplaintMaintenanceInfo"/>
@@ -222,6 +225,9 @@
 		<typeAlias type="com.iamberry.rst.core.dm.SupplierProduct" alias="SupplierProduct"/>
 		<typeAlias type="com.iamberry.rst.core.dm.SupplierProductItem" alias="SupplierProductItem"/>
 		<typeAlias type="com.iamberry.rst.core.dm.DmChannelType" alias="DmChannelType"/>
+		<typeAlias type="com.iamberry.rst.core.fm.DetectPhenomenon" alias="DetectPhenomenon"/>
+		<typeAlias type="com.iamberry.rst.core.fm.DetectCustmoerPhenomenon" alias="DetectCustmoerPhenomenon"/>
+		<typeAlias type="com.iamberry.rst.core.fm.DetectTransport" alias="DetectTransport"/>
 
 		<!--客诉统计新增-->
 		<typeAlias type="com.iamberry.rst.core.cm.CustomerStatistics" alias="CustomerStatistics"/>
@@ -306,6 +312,8 @@
 		<mapper resource="com/iamberry/rst/service/cm/mapper/procTypeMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/cm/mapper/procMethodMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/cm/mapper/cmRelationMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/cm/mapper/MaintainPhenomenonMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/cm/mapper/MaintainTypeMapper.xml"/>
 
 		<mapper resource="com/iamberry/rst/service/fm/mapper/awaitingSignclosedProductMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/fm/mapper/complaintDetectInfoMapper.xml"/>
@@ -316,6 +324,8 @@
 		<mapper resource="com/iamberry/rst/service/fm/mapper/inventoryLogMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/fm/mapper/inventoryMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/fm/mapper/detectStatisticMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/fm/mapper/DetectCustmoerPhenomenonMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/fm/mapper/DetectTransportMapper.xml"/>
 
 
 		<mapper resource="com/iamberry/rst/service/address/mapper/addressMapper.xml"/>

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

@@ -6,7 +6,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
     <meta http-equiv="Cache-Control" content="no-siteapp" />
-<#include "/base/add_base.ftl">
+    <#include "/base/add_base.ftl">
     <link href="${path}/common/lib/jquery.ui/jquery-ui.css" rel="stylesheet" type="text/css"/>
     <link href="${path}/common/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css"/>
     <link href="${path}/common/lib/icheck/icheck.css" rel="stylesheet" type="text/css"/>

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

@@ -1140,7 +1140,10 @@
                                 <th>维修编号</th>
                                 <th>当前状态</th>
                                 <th>产品</th>
+                                <th>工厂检测现象</th>
                                 <th>是否有故障</th>
+                                <th>故障原因</th>
+                                <th>是否过水</th>
                                 <th>是否可翻新</th>
                                 <th>维修报价</th>
                                 <th>维修内容</th>
@@ -1149,59 +1152,24 @@
                             </tr>
                             </thead>
                             <tbody id="trbodyInformationInfoId">
-                            <#if (detectList?size > 0)>
+                            <#if detectList?? && (detectList?size > 0)>
                                 <#list detectList as detect>
                                 <tr>
                                 <#--<td class="text-c" width="100">${detect.customerId!}</td>-->
                                     <td class="text-c" width="100">${detect.detectNumber!''}</td>
                                     <td class="text-c" width="100" id="detectState${(detect.detectId)!}">
                                         <#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 == 39>
-                                            机器无故障,原机退回
-                                        </#if>
-                                        <#if detect.detectState == 20>
-                                            待翻新入库
-                                        </#if>
-                                        <#if detect.detectState == 21>
-                                            已翻新入库
-                                        </#if>
-                                        <#if detect.detectState == 22>
-                                            不能翻新,待报废
-                                        </#if>
-                                        <#if detect.detectState == 23>
-                                            已报废回收
+                                            <span class="c-red">待检测机器<#if detect.maintenanceCutTime??>(${detect.maintenanceCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
+                                        <#elseif detect.detectState == 31>
+                                             <span class="c-red">待维修(付费)<#if detect.completeCutTime??>(${detect.completeCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
+                                        <#elseif detect.detectState == 35>
+                                            <span class="c-red">待维修(免费)<#if detect.completeCutTime??>(${detect.completeCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
+                                        <#else>
+                                            ${util.detectState(detect.detectState)}
                                         </#if>
                                     </td>
                                     <td class="text-c" width="100">${detect.productName!'暂无产品'}(${detect.colorName!'暂无颜色'})</td>
+                                    <td class="text-c" width="100">${(detect.phenomen.phenomenonName)!}</td>
                                     <td class="text-c" width="100">
                                         <#if detect.isMaintenance??>
                                            <#if detect.isMaintenance == 1>
@@ -1212,6 +1180,29 @@
                                             机器待检测
                                            </#if>
                                         </#if>
+                                    </td>
+                                    <td class="text-c" width="100">
+                                        <#if detect.deleteMaintainType??>
+                                           <#if detect.deleteMaintainType == 1>
+                                                质量问题
+                                           <#elseif detect.deleteMaintainType == 2>
+                                                非质量问题导致
+                                           <#else>
+                                                机器待检测
+                                           </#if>
+                                        </#if>
+
+                                    </td>
+                                    <td class="text-c" width="100">
+                                        <#if detect.deleteIsUse??>
+                                           <#if detect.deleteIsUse == 1>
+                                                未过水
+                                           <#elseif detect.deleteIsUse == 2>
+                                                已过水
+                                           <#else>
+                                                机器待检测
+                                           </#if>
+                                        </#if>
 
                                     </td>
                                     <td class="text-c" width="100">
@@ -1238,10 +1229,10 @@
                                     </td>
                                     <!-- 遍历操作 -->
                                     <td class="td-manage text-c" width="100">
-                                        <a onclick="getDetectInfo('${detect.detectId}');">查看详情</a><br>
-                                        <#if detect.detectState == 30 || detect.detectState == 34 || detect.detectState == 38 || detect.detectState == 37>
-                                        <input type="hidden" name="detectIds" value="${(detect.detectId)!}">
-                                        <input type="hidden" name="detectStates" value="${(detect.detectState)!}">
+                                        <#--<a onclick="getDetectInfo('${detect.detectId}');">查看详情</a><br>-->
+                                        <#if detect.detectState == 30 || detect.detectState == 24 || detect.detectState == 34 || detect.detectState == 38 || detect.detectState == 37>
+                                            <input type="hidden" name="detectIds" value="${(detect.detectId)!}">
+                                            <input type="hidden" name="detectStates" value="${(detect.detectState)!}">
                                             <a onclick="to_updateDetectInfo('${(detect.detectId)!}','${(detect.detectState)!}');">维修处理</a>
                                         </#if>
                                     </td>
@@ -1263,10 +1254,10 @@
                                 </div>
                                 <div class="formControls col-12 col-sm-12">
                                     <div class="radio-box">
-                                        <input type="radio" id="tel-001" name="detectProcessingResults_1" checked value="1">
+                                        <input type="radio" id="tel-001" name="detectProcessingResults_1" checked value="31">
                                         <label for="tel-001">付费维修</label>
                                     </div>
-                                    <div class="radio-box" id="updateDetect_1_1">
+                                    <#--<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>
@@ -1277,9 +1268,9 @@
                                     <div class="radio-box">
                                         <input type="radio" id="tel-004" name="detectProcessingResults_1" value="4">
                                         <label for="tel-004">换货处理</label>
-                                    </div>
+                                    </div>-->
                                     <div class="radio-box">
-                                        <input type="radio" id="tel-005" name="detectProcessingResults_1" value="5">
+                                        <input type="radio" id="tel-005" name="detectProcessingResults_1" value="33">
                                         <label for="tel-005">原机退回</label>
                                     </div>
                                 </div>
@@ -1290,12 +1281,34 @@
                                 </div>
                                 <div class="formControls col-12 col-sm-12">
                                     <div class="radio-box">
-                                        <input type="radio" id="tel-002" name="detectProcessingResults_2" checked value="2">
+                                        <input type="radio" id="tel-002" name="detectProcessingResults_2" checked value="35">
                                         <label for="tel-002">免费维修</label>
                                     </div>
+                                </div>
+                            </div>
+                            <div class="row cl" id="updateDetect_fx" style="display: none;">
+                                <div class="formControls col-2 col-sm-2 text-r">
+                                    <strong>处理结果:</strong>
+                                </div>
+                                <div class="formControls col-12 col-sm-12">
                                     <div class="radio-box">
-                                        <input type="radio" id="tel-005" name="detectProcessingResults_2" value="5">
-                                        <label for="tel-005">原机退回</label>
+                                        <input type="radio" id="tel-002" name="detectProcessingResults_3" checked value="25">
+                                        <label for="tel-002">翻新(付费)</label>
+                                    </div>
+                                    <div class="radio-box">
+                                        <input type="radio" id="tel-005" name="detectProcessingResults_3" value="27">
+                                        <label for="tel-005">不翻新(原机退回)</label>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="row cl" id="updateDetect_wu_gu_zhang" style="display: none;">
+                                <div class="formControls col-2 col-sm-2 text-r">
+                                    <strong>处理结果:</strong>
+                                </div>
+                                <div class="formControls col-12 col-sm-12">
+                                    <div class="radio-box">
+                                        <input type="radio" id="tel-002" name="detectProcessingResults_3" checked value="39">
+                                        <label for="tel-002">机器无故障,原机退回</label>
                                     </div>
                                 </div>
                             </div>
@@ -1562,7 +1575,7 @@
 
     var mobile= /^1(3|4|5|7|8)\d{9}$/; //手机号码
     var uname = /^[\u4e00-\u9fa5a-zA-Z]{1,12}$/; //中文英文
-    var money = /^(0{1}|([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;//金额
+    var money = /(^([-]?)[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^([-]?)(0){1}$)|(^([-]?)[0-9]\.[0-9]([0-9])?$)/;//金额
     var node = $("#Targetname");
     $(function () {
         if(type === "4"){
@@ -3178,46 +3191,58 @@
                     switch (detectInfo.detectState){
                         case 1:
                             detectStateName = "待检测机器";
-                            break
+                            break;
                         case 30:
                             detectStateName = "待用户确认";
-                            break
+                            break;
                         case 31:
                             detectStateName = "用户同意维修(待维修)";
-                            break
+                            break;
                         case 32:
                             detectStateName = "维修完成";
-                            break
+                            break;
                         case 33:
                             detectStateName = "用户不维修(原机退回)";
-                            break
+                            break;
                         case 34:
                             detectStateName = "待客服确认维修";
-                            break
+                            break;
                         case 35:
                             detectStateName = "客服确认维修,(待维修)";
-                            break
+                            break;
                         case 36:
                             detectStateName = "维修完成";
-                            break
+                            break;
                         case 37:
                             detectStateName = "机器无故障,原机退回";
-                            break
+                            break;
                         case 38:
                             detectStateName = "机器故障,待用户确认";
-                            break
+                            break;
                         case 20:
                             detectStateName = "待翻新入库";
-                            break
+                            break;
                         case 21:
                             detectStateName = "已翻新入库";
-                            break
+                            break;
                         case 22:
                             detectStateName = "不能翻新,待报废";
-                            break
+                            break;
                         case 23:
                             detectStateName = "已报废回收";
-                            break
+                            break;
+                        case 24:
+                            detectStateName = "待确认是否翻新(付费)";
+                            break;
+                        case 25:
+                            detectStateName = "待翻新(付费)";
+                            break;
+                        case 26:
+                            detectStateName = "已翻新(付费)";
+                            break;
+                        case 27:
+                            detectStateName = "客户不翻新(原机退回)";
+                            break;
                     }
                     var isMaintenanceName;
                     if(detectInfo.isMaintenance === 1){
@@ -3234,7 +3259,7 @@
                         detectRenovationName = "不可翻新";
                     }
                     var detectOfferName;
-                    if(detectInfo.detectOffer != null && detectInfo.detectOffer != ""){
+                    if(detectInfo.detectOffer != null && detectInfo.detectOffer !== ""){
                         detectOfferName = detectInfo.detectOffer/100;
                         detectOfferName = detectOfferName+"元";
                     }else{
@@ -3292,20 +3317,43 @@
         $("#detectId").val(detectId);
         $("#detectState").val(detectState);
         if(detectState === "30"){
+            /** 当工厂检测为付费维修时,我司确认即可 */
+            // 付费维修
             $("#updateDetect_1").show();
+            $("#updateDetect_3").show();
+            // 免费维修
             $("#updateDetect_2").hide();
-            /*$("#updateDetect_3").hide();*/
-            $("#updateDetect_1_1").hide();
+            // 付费翻新
+            $("#updateDetect_fx").hide();
+            // 检测带订单-原机退回
+            $("#updateDetect_wu_gu_zhang").hide();
         }
         if(detectState === "34"){
+            /** 当工厂检测为免费维修时,我司确认免费维修、付费维修 */
+            // 免费维修
             $("#updateDetect_1").hide();
             $("#updateDetect_2").show();
-            $("#updateDetect_3").hide();
+            $("#updateDetect_3").show();
+            $("#updateDetect_fx").hide();
+            // 检测带订单-原机退回
+            $("#updateDetect_wu_gu_zhang").hide();
         }
-        if(detectState === "38" || detectState === "37"){
-            $("#updateDetect_1").show();
+        if(detectState === "37"){
+            // 检测待定(机器无故障,待用户确认)
+            $("#updateDetect_3").show();
+            $("#updateDetect_wu_gu_zhang").show();
+            $("#updateDetect_1").hide();
             $("#updateDetect_2").hide();
+            $("#updateDetect_fx").hide();
+        }
+        if(detectState === "24"){
+            // 付费翻新
             $("#updateDetect_3").show();
+            $("#updateDetect_fx").show();
+            $("#updateDetect_1").hide();
+            $("#updateDetect_2").hide();
+            // 检测带订单-原机退回
+            $("#updateDetect_wu_gu_zhang").hide();
         }
         $("#updateDetect").show();
     }
@@ -3394,11 +3442,12 @@
             detectProcessingResults = $('input[name="detectProcessingResults_2"]:checked').val();//处理结果
             procMethodId = null;
         }
+        if(detectState === "24"){
+            detectProcessingResults = $('input[name="detectProcessingResults_3"]:checked').val();//处理结果
+            procMethodId = null;
+        }
         if(detectState === "38" || detectState === "37"){
             detectProcessingResults = $('input[name="detectProcessingResults_1"]:checked').val();//处理结果
-            /*if(detectProcessingResults === "5"){
-                procMethodId = null;
-            }*/
         }
         var detectCustomerDesc = $("#detectCustomerDesc").val();
         var detectId = $("#detectId").val();
@@ -3409,12 +3458,14 @@
                 $.ajax({
                     cache: true,
                     type: "POST",
-                    data: {"detectProcessingResults" : detectProcessingResults,
+                    data: {
+                        /*"detectProcessingResults" : detectProcessingResults,*/
                         "detectCustomerDesc" : detectCustomerDesc,
                         "procMethodId" : procMethodId,
                         "detectId" : detectId,
                         "customerId" : ${customerId},
-                        "detectState" : detectState},
+                        "detectState" : detectProcessingResults
+                    },
                     url: "${path}/admin/detect/customer_confirm",
                     async: false,
                     success: function(data){
@@ -3487,12 +3538,14 @@
             $.ajax({
                 cache: true,
                 type: "POST",
-                data: {"detectProcessingResults" : detectProcessingResults,
+                data: {
+                    /*"detectProcessingResults" : detectProcessingResults,*/
                     "detectCustomerDesc" : detectCustomerDesc,
                     "procMethodId" : procMethodId,
                     "detectId" : detectId,
                     "customerId" : ${customerId},
-                    "detectState" : detectState},
+                    "detectState" : detectProcessingResults
+                },
                 url: "${path}/admin/detect/customer_confirm",
                 async: false,
                 success: function(data){

+ 286 - 286
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_detail.ftl

@@ -80,82 +80,24 @@
         <table class="table table-bordered table-bg table-hover table-sort" style="margin-top: 10px;">
             <thead>
             <tr>
-                <th width="10">维修编号:</th>
-                <td width="10" style="font-weight: normal;"><span>${detectinfo.detectNumber!''}</span></td>
-                <td width="10"></td>
-                <th width="10">产品名称:</th>
-                <td width="10" style="font-weight: normal;"><span>${detectinfo.productName!''}(${detectinfo.colorName!''})</span></td>
+                <th width="10%">维修编号:</th>
+                <td width="35%" style="font-weight: normal;"><span>${detectinfo.detectNumber!''}</span></td>
+                <td width="10%"></td>
+                <th width="10%">产品名称:</th>
+                <td width="35%" style="font-weight: normal;"><span>${detectinfo.productName!''}(${detectinfo.colorName!''})</span></td>
             </tr>
-            <#--<tr>
-                <th width="10">是否可翻新:</th>
-                <td width="10" style="font-weight: normal;">
-                <#if detectinfo.detectRenovation == 1>
-                    可翻新
-                <#elseif detectinfo.detectRenovation == 2>
-                    不可翻新
-                </#if>
-                </span></td>
-                <td width="10"></td>
-                <th width="10">是否有故障:</th>
-                <td width="10" style="font-weight: normal;"><span>
-                <#if detectinfo.isMaintenance == 1>
-                    有故障
-                <#elseif detectinfo.isMaintenance == 2>
-                    无故障
-                </#if>
-                </span></td>
-            </tr>-->
             <tr>
                 <th width="10">当前状态:</th>
                 <td width="10" style="font-weight: normal;">
                     <span>
                         <#if detectinfo.detectState == 1>
                             <span class="c-red">待检测机器<#if detectinfo.maintenanceCutTime??>(${detectinfo.maintenanceCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
-                        </#if>
-                        <#if detectinfo.detectState == 0>
-                            待收货确认
-                        </#if>
-                        <#if detectinfo.detectState == 30>
-                            待用户确认
-                        </#if>
-                        <#if detectinfo.detectState == 31>
+                        <#elseif detectinfo.detectState == 31>
                             <span class="c-red">待维修<#if detectinfo.completeCutTime??>(${detectinfo.completeCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
-                        </#if>
-                        <#if detectinfo.detectState == 32>
-                            <span class="c-success">维修完成</span>
-                        </#if>
-                        <#if detectinfo.detectState == 33>
-                            <span class="c-success">用户不维修(原机退回)</span>
-                        </#if>
-                        <#if detectinfo.detectState == 34>
-                            待客服确认维修
-                        </#if>
-                        <#if detectinfo.detectState == 35>
+                        <#elseif detectinfo.detectState == 35>
                             <span class="c-red">待维修<#if detectinfo.completeCutTime??>(${detectinfo.completeCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
-                        </#if>
-                        <#if detectinfo.detectState == 36>
-                            <span class="c-success">维修完成</span>
-                        </#if>
-                        <#if detectinfo.detectState == 37>
-                            机器无故障,原机退回
-                        </#if>
-                        <#if detectinfo.detectState == 38>
-                            机器故障,待用户确认
-                        </#if>
-                        <#if detectinfo.detectState == 39>
-                            <span class="c-success">机器无故障,原机退回</span>
-                        </#if>
-                        <#if detectinfo.detectState == 20>
-                            待翻新入库
-                        </#if>
-                        <#if detectinfo.detectState == 21>
-                        <span class="c-success">已翻新入库</span>
-                        </#if>
-                        <#if detectinfo.detectState == 22>
-                            不能翻新,待报废
-                        </#if>
-                        <#if detectinfo.detectState == 23>
-                            <span class="c-success">已报废回收</span>
+                        <#else>
+                            ${util.detectState(detectinfo.detectState)}
                         </#if>
                     </span>
                 </td>
@@ -171,77 +113,91 @@
                 <td width="10" style="font-weight: normal;"><span><#if detectinfo.signclosedAddrProvincesName??>${detectinfo.signclosedAddrProvincesName!''}</#if>-<#if detectinfo.signclosedAddrCityName??>${detectinfo.signclosedAddrCityName!''}</#if>-<#if detectinfo.signclosedAddrCityName??>${detectinfo.signclosedAddrCityName!''}</#if></span></td>
                 <td width="10"></td>
                 <th width="10">物流单号:</th>
-                <td width="10" style="font-weight: normal;"><span>${detectinfo.logisticsNumber!''}</span></td>
+                <td width="10" style="font-weight: normal;"><span>
+                    <#if (detectinfo.logisticsNumber)??>
+                        ${detectinfo.logisticsNumber!''}
+                    <#else>
+                        ${(detectinfo.transport.transportSendPost)!}
+                    </#if>
+                </span>
+                </td>
             </tr>
             <tr>
-                <th width="10">购买时间:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.signclosedDate??>${(detectinfo.salesTime?string("yyyy-MM-dd HH:mm:ss"))!''}<#else>-</#if></span></td>
-                <td width="10"></td>
-                <th width="10" style="font-weight: normal;"></th>
-                <td width="10"></td>
+                <th width="40">购买时间:</th>
+                <td width="200" colspan="4" style="font-weight: normal;">
+                    <span>
+                        <#if (detectinfo.detectBuytime)??>
+                            ${(detectinfo.detectBuytime?string("yyyy-MM-dd"))!}
+                        <#else>
+                            <#if detectinfo.salesTime??> ${(detectinfo.salesTime?string("yyyy-MM-dd"))!'-'} </#if>
+                        </#if>
+                    </span>
+                </td>
             </tr>
 
             </thead>
         </table>
-        <div class="row cl">
-            <label class="form-label col-3">
-                <div class="tit-2">
-                    客诉信息
+        <#if detectinfo.customerId??>
+            <div class="row cl">
+                <label class="form-label col-3">
+                    <div class="tit-2">
+                        客诉信息
+                    </div>
+                </label>
+                <div class="formControls col-10 col-sm-10">
                 </div>
-            </label>
-            <div class="formControls col-10 col-sm-10">
             </div>
-        </div>
-        <table class="table table-bordered table-bg table-hover table-sort" style="margin-top: 10px;">
-            <thead>
-            <tr>
-                <th width="10">客诉编号:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.customerId??>${detectinfo.customerId!''}</#if></span></td>
-                <td width="10"></td>
-                <th width="10">客诉处理:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.customerId??>${detectinfo.procTypeName!''}-${detectinfo.procMethodName!''}</#if></span></td>
+            <table class="table table-bordered table-bg table-hover table-sort" style="margin-top: 10px;">
+                <thead>
+                <tr>
+                    <th width="10%">客诉编号:</th>
+                    <td width="35%" style="font-weight: normal;"><span><#if detectinfo.customerId??>${detectinfo.customerId!''}</#if></span></td>
+                    <td width="10%"></td>
+                    <th width="10%">客诉处理:</th>
+                    <td width="35%" style="font-weight: normal;">
+                        <span>
+                            <#if detectinfo.customerId??>
+                                ${detectinfo.procTypeName!''}-${detectinfo.procMethodName!''}
+                            </#if>
+                        </span>
+                    </td>
 
-            </tr>
-            <tr>
-                <th width="10">客服信息:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.adminName??>${detectinfo.adminName!''}</#if></span></td>
-                <td width="10"></td>
-                <th width="10">客诉描述:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.describeHandleDesc??>${detectinfo.describeHandleDesc!''}</#if></span></td>
+                </tr>
+                <tr>
+                    <th width="10">客服信息:</th>
+                    <td width="10" style="font-weight: normal;"><span><#if detectinfo.adminName??>${detectinfo.adminName!''}</#if></span></td>
+                    <td width="10"></td>
+                    <th width="10">客诉描述:</th>
+                    <td width="10" style="font-weight: normal;"><span><#if detectinfo.describeHandleDesc??>${detectinfo.describeHandleDesc!''}</#if></span></td>
 
-            </tr>
-            <tr>
-                <th width="10">问题回复:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.describeContent??>${detectinfo.describeContent!''}</#if></span></td>
-                <td width="10"></td>
-                <th width="10">客服备注:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.detectCustomerDesc??>${detectinfo.detectCustomerDesc!''}</#if></span></td>
+                </tr>
+                <tr>
+                    <th width="10">问题回复:</th>
+                    <td width="10" style="font-weight: normal;"><span><#if detectinfo.describeContent??>${detectinfo.describeContent!''}</#if></span></td>
+                    <td width="10"></td>
+                    <th width="10">客服备注:</th>
+                    <td width="10" style="font-weight: normal;"><span><#if detectinfo.detectCustomerDesc??>${detectinfo.detectCustomerDesc!''}</#if></span></td>
 
-            </tr>
-            <tr>
-                <th width="10">问题描述:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.questionTitle??>${detectinfo.questionTitle!''}-${detectinfo.questionTitle!''}</#if>
-                <br><#if detectinfo.questionTitle??><#if detectinfo.questionTitle != ""><a href="#" onclick="getDescribeInfo(${detectinfo.customerId!});" style="color : #50a2ea;">查看详情</a></#if></#if>
-                </span>
-                <#if detectinfo.questionDescription??>${detectinfo.questionDescription!''}</#if></td>
-                <td width="10"></td>
-                <th width="10"></th>
-                <td width="10" style="font-weight: normal;"></td>
+                </tr>
+                <tr>
+                    <th width="10">问题描述:</th>
+                    <td width="10" style="font-weight: normal;">
+                        <span>
+                            <#if detectinfo.questionTitle??>${detectinfo.questionTitle!''}-${detectinfo.questionTitle!''}</#if>
+                            <br>
+                            <#if detectinfo.questionTitle??><#if detectinfo.questionTitle != ""><a href="#" onclick="getDescribeInfo(${detectinfo.customerId!});" style="color : #50a2ea;">查看详情</a></#if></#if>
+                        </span>
+                        <#if detectinfo.questionDescription??>${detectinfo.questionDescription!''}</#if>
+                    </td>
+                    <td width="10"></td>
+                    <th width="10"></th>
+                    <td width="10" style="font-weight: normal;"></td>
+
+                </tr>
+                </thead>
+            </table>
+        </#if>
 
-            </tr>
-            <#--<tr>
-                <th width="10">客服备注:</th>
-                <td width="10" style="font-weight: normal;"><span>${detectinfo.detectCustomerDesc!''}</span></td>
-                <td width="10"></td>
-                <th width="10">是否下单:</th>
-                <td width="10" style="font-weight: normal;"><span>
-                <#if detectinfo.procTypeId??><#if detectinfo.procTypeId == 3 || detectinfo.detectState == 37><#if detectinfo.detectPlaceorder??>
-                    <#if detectinfo.detectPlaceorder == 1>未下单</#if>
-                    <#if detectinfo.detectPlaceorder == 2>已下单</#if>
-                </#if></#if></#if></span></td>
-            </tr>-->
-            </thead>
-        </table>
         <div class="row cl">
             <label class="form-label col-3">
                 <div class="tit-2">
@@ -254,25 +210,39 @@
         <table class="table table-bordered table-bg table-hover table-sort" style="margin-top: 10px;">
             <thead>
             <tr>
-                <th width="10">业务员:</th>
-                <td width="10" style="font-weight: normal;" colspan="4"><span><#if detectinfo.salesmanAdminName??>${detectinfo.salesmanAdminName!''}</#if></span></td>
-
-
+                <th width="10%">业务员:</th>
+                <td width="90%" style="font-weight: normal;" colspan="4"><span><#if detectinfo.salesmanAdminName??>${detectinfo.salesmanAdminName!''}</#if></span></td>
             </tr>
             <tr>
-                <th width="10">客户姓名:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.detectName??>${detectinfo.detectName!''}</#if></span></td>
-                <td width="10"></td>
-                <th width="10">客户电话:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.detectTel??>${detectinfo.detectTel!''}</#if></span></td>
+                <th width="10%">客户姓名:</th>
+                <td width="35%" style="font-weight: normal;"><span><#if detectinfo.detectName??>${detectinfo.detectName!''}</#if></span></td>
+                <td width="10%"></td>
+                <th width="10%">客户电话:</th>
+                <td width="35%" style="font-weight: normal;"><span><#if detectinfo.detectTel??>${detectinfo.detectTel!''}</#if></span></td>
 
             </tr>
             <tr>
                 <th width="10">客户问题:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.questionName??>${detectinfo.questionName!''}</#if></span></td>
+                <td width="10" style="font-weight: normal;">
+                    <span>
+                        <#if detectinfo.detectCustmoerQuestion??>
+                            ${detectinfo.detectCustmoerQuestion}
+                        <#else>
+                            <#if detectinfo.questionName??>${detectinfo.questionName!''}</#if>
+                        </#if>
+                    </span>
+                </td>
                 <td width="10"></td>
-                <th width="10">问题回复:</th>
-                <td width="10" style="font-weight: normal;"><span><#if detectinfo.questionProfile??>${detectinfo.questionProfile!''}</#if></span></td>
+                <th width="10">问题描述:</th>
+                <td width="10" style="font-weight: normal;">
+                    <span>
+                        <#if detectinfo.questionDescription??>
+                            ${detectinfo.questionDescription}
+                        <#else>
+                            <#if detectinfo.questionProfile??>${detectinfo.questionProfile!''}</#if>
+                        </#if>
+                    </span>
+                </td>
 
             </tr>
             </thead>
@@ -289,25 +259,54 @@
         <table class="table table-bordered table-bg table-hover table-sort" style="margin-top: 10px;">
             <thead>
             <tr>
-                <th width="10">是否可翻新:</th>
-                <td width="10" style="font-weight: normal;">
-                <#if detectinfo.detectRenovation??>
-                    <#if detectinfo.detectRenovation == 1>
-                        可翻新
-                    <#elseif detectinfo.detectRenovation == 2>
-                        不可翻新
+                <th width="10%">是否可翻新:</th>
+                <td width="35%" style="font-weight: normal;">
+                    <#if detectinfo.detectRenovation??>
+                        <#if detectinfo.detectRenovation == 1>
+                            可翻新
+                        <#elseif detectinfo.detectRenovation == 2>
+                            不可翻新
+                        </#if>
                     </#if>
-                </#if>
-                    </span></td>
+                </td>
+                <td width="10%"></td>
+                <th width="10%">是否有故障:</th>
+                <td width="35%" style="font-weight: normal;">
+                    <span>
+                        <#if detectinfo.isMaintenance == 1>
+                            有故障
+                        <#elseif detectinfo.isMaintenance == 2>
+                            无故障
+                        </#if>
+                    </span>
+                </td>
+            </tr>
+            <tr>
+                <th width="10">故障原因:</th>
+                <td width="10" style="font-weight: normal;">
+                    <span>
+                        <#if detectinfo.deleteMaintainType??>
+                            <#if detectinfo.deleteMaintainType == 1>
+                                质量问题
+                            <#elseif detectinfo.deleteMaintainType == 2>
+                                非质量问题导致
+                            </#if>
+                        </#if>
+                    </span>
+                </td>
                 <td width="10"></td>
-                <th width="10">是否有故障:</th>
-                <td width="20" style="font-weight: normal;"><span>
-                <#if detectinfo.isMaintenance == 1>
-                    有故障
-                <#elseif detectinfo.isMaintenance == 2>
-                    无故障
-                </#if>
-                </span></td>
+                <th width="10">过水使用:</th>
+                <td width="10" style="font-weight: normal;">
+                    <span>
+                        <#if detectinfo.deleteIsUse??>
+                            <#if detectinfo.deleteIsUse == 1>
+                                未过水
+                            <#elseif detectinfo.deleteIsUse == 2>
+                                已过水
+                            </#if>
+                        </#if>
+                    </span>
+                </td>
             </tr>
             <tr>
                 <th width="10">厚膜类型:</th>
@@ -353,18 +352,25 @@
                 <td width="10"></td>
                 <th width="10">版本号:</th>
                 <td width="10" style="font-weight: normal;"><span>${detectinfo.detectVersionNumber!''}</span></td>
-
             </tr>
+            <#--<tr>
+                <th width="10">检测现象(客户):</th>
+                <td width="10" style="  font-weight: normal;" colspan="5">
+                    <span>
+                        <#if (detectinfo.phenomen.phenomenonName)??>
+                            ${detectinfo.phenomen.phenomenonName}
+                        </#if>
+                    </span>
+                </td>
+            </tr>-->
             <tr>
-                <th width="10">检测现象:</th>
+                <th width="10">现象明细:</th>
                 <td width="10" style="  font-weight: normal;" colspan="5"><span>
                 <#if detectPhenomenonList??>
-                    <#if (detectPhenomenonList?size > 0)>
-                        <#list detectPhenomenonList as detectPhenomenon>
+                    <#if (detectinfo.phenomena?size > 0)>
+                        <#list detectinfo.phenomena as p>
                         <li class="b-close" id="configDetele1">
-                            <input type="hidden" value="${detectPhenomenon.itemConfigId!''}" name="configli1">
-                            ${detectPhenomenon.itemDetectContent!''}
-                            <span style="display: none" class="my-close" onclick="deleteli(this)"></span>
+                            ${(p.dpName)!''};
                         </li>
                         </#list>
                     </#if>
@@ -372,66 +378,6 @@
                 </span></td>
             </tr>
             <tr>
-                <th width="10">故障原因:</th>
-                <td width="10" style="font-weight: normal;" colspan="5"><span>
-                    <#if detectFailureCauseList??>
-                         <#if (detectFailureCauseList?size > 0)>
-                              <#list detectFailureCauseList as detectFailureCause>
-                               <li class="b-close" id="configDetele2">
-                                   <input type="hidden" value="${detectFailureCause.itemConfigId!''}" name="configli2">
-                                   ${detectFailureCause.itemDetectContent!''}
-                                   <span style="display: none" class="my-close" onclick="deleteli(this)"></span>
-                                </li>
-                         </#list>
-                         </#if>
-                    </#if>
-                </span></td>
-            </tr>
-            <tr>
-                <th width="10">判定结果:</th>
-                <td width="10" style="font-weight: normal;" colspan="5"><span>
-                <#if detectResultsList??>
-                    <#if (detectResultsList?size > 0)>
-                        <#list detectResultsList as detectResults>
-                        <li class="b-close" id="configDetele3">
-                            <input type="hidden" value="${detectResults.itemConfigId!''}" name="configli3">
-                            ${detectResults.itemDetectContent!''}
-                            <span style="display: none" class="my-close" onclick="deleteli(this)"></span>
-                        </li>
-                        </#list>
-                    </#if>
-                </#if>
-                </span></td>
-            </tr>
-            <tr>
-                <th width="10">故障指向:</th>
-                <td width="10" style="font-weight: normal;" colspan="5"><span>
-                <#if (detectPointList?size > 0)>
-                    <#list detectPointList as detectPoint>
-                        <li class="b-close" id="configDetele4">
-                            <input type="hidden" value="${detectPoint.itemConfigId!''}" name="configli4">
-                            ${detectPoint.itemDetectContent!''}
-                            <span style="display: none" class="my-close" onclick="deleteli(this)"></span>
-                        </li>
-                    </#list>
-                </#if>
-                </span></td>
-            </tr>
-            <tr>
-                <th width="10">原因分析:</th>
-                <td width="10" style="font-weight: normal;" colspan="5"><span>
-                <#if (detectNalysisList?size > 0)>
-                    <#list detectNalysisList as detectNalysis>
-                        <li class="b-close" id="configDetele5">
-                            <input type="hidden" value="${detectNalysis.itemConfigId!''}" name="configli5">
-                            ${detectNalysis.itemDetectContent!''}
-                            <span style="display: none" class="my-close" onclick="deleteli(this)"></span>
-                        </li>
-                    </#list>
-                </#if>
-                </span></td>
-            </tr>
-            <tr>
                 <th width="10">维修报价:</th>
                 <td width="10" style="font-weight: normal;"><span><#if detectinfo.detectOffer??>${detectinfo.detectOffer/100}<#else>-</#if></span></td>
                 <td width="10"></td>
@@ -440,12 +386,12 @@
 
             </tr>
             <tr>
-                <th width="10">备注:</th>
+                <th width="10">检测备注:</th>
                 <td width="10" style="font-weight: normal;" colspan="5"><span>${detectinfo.detectDesc!''}</span></td>
             </tr>
             <tr>
-                <th width="10">维修附件:</th>
-                <td width="10" style="font-weight: normal;" colspan="5"><span>
+                <th width="10%">检测附件:</th>
+                <td width="90%" style="font-weight: normal;" colspan="5"><span>
                 <#if (imgList?size > 0)>
                     <#list imgList as img>
                         <img  src="${img.detectImgUrl!''}"  width="90" height="80">
@@ -454,23 +400,9 @@
                 </#if>
                 </span></td>
             </tr>
-
-            <#--<tr>
-                <th width="10">维修配件:</th>
-                <td width="10" style="font-weight: normal;" colspan="5"><span>
-                <#if (listMaterialItem?size > 0)>
-                    <#list listMaterialItem as item>
-                        <li class="b-close" >
-                    <input type="hidden" value="">${item.materialName}
-
-                    </li>
-                    </div>
-                    </#list>
-                </#if>
-                </span></td>
-            </tr>-->
             </thead>
         </table>
+
         <div class="row cl">
             <label class="form-label col-3">
                 <div class="tit-2">
@@ -482,23 +414,87 @@
         </div>
         <table class="table table-bordered table-bg table-hover table-sort" style="margin-top: 10px;">
             <thead>
-            <tr>
-                <th width="10">维修配件:</th>
-                <td width="10" style="font-weight: normal;"><span>
-                <#if (listMaterialItem?size > 0)>
-                    <#list listMaterialItem as item>
-                        <li class="b-close" >
-                    <input type="hidden" value="">${item.materialName}
 
-                    </li>
-                    </div>
-                    </#list>
-                </#if>
-                </span></td>
-                <td width="10"></td>
-                <th width="10">维修内容:</th>
-                <td width="10" style="font-weight: normal;"><span>${detectinfo.detectContent!''}</span></td>
-            </tr>
+                <tr>
+                    <th width="10%">故障原因:</th>
+                    <td width="90%" style="font-weight: normal;" colspan="5"><span>
+                        <#if detectFailureCauseList??>
+                             <#if (detectFailureCauseList?size > 0)>
+                                 <#list detectFailureCauseList as detectFailureCause>
+                                   <li class="b-close" id="configDetele2">
+                                       <input type="hidden" value="${detectFailureCause.itemConfigId!''}" name="configli2">
+                                       ${detectFailureCause.itemDetectContent!''}
+                                       <span style="display: none" class="my-close" onclick="deleteli(this)"></span>
+                                    </li>
+                                 </#list>
+                             </#if>
+                        </#if>
+                    </span></td>
+                </tr>
+                <tr>
+                    <th width="10">判定结果:</th>
+                    <td width="10" style="font-weight: normal;" colspan="5"><span>
+                    <#if detectResultsList??>
+                        <#if (detectResultsList?size > 0)>
+                            <#list detectResultsList as detectResults>
+                            <li class="b-close" id="configDetele3">
+                                <input type="hidden" value="${detectResults.itemConfigId!''}" name="configli3">
+                                ${detectResults.itemDetectContent!''}
+                                <span style="display: none" class="my-close" onclick="deleteli(this)"></span>
+                            </li>
+                            </#list>
+                        </#if>
+                    </#if>
+                    </span></td>
+                </tr>
+                <tr>
+                    <th width="10">故障指向:</th>
+                    <td width="10" style="font-weight: normal;" colspan="5"><span>
+                    <#if (detectPointList?size > 0)>
+                        <#list detectPointList as detectPoint>
+                            <li class="b-close" id="configDetele4">
+                                <input type="hidden" value="${detectPoint.itemConfigId!''}" name="configli4">
+                                ${detectPoint.itemDetectContent!''}
+                                <span style="display: none" class="my-close" onclick="deleteli(this)"></span>
+                            </li>
+                        </#list>
+                    </#if>
+                    </span></td>
+                </tr>
+                <tr>
+                    <th width="10">原因分析:</th>
+                    <td width="10" style="font-weight: normal;" colspan="5"><span>
+                    <#if (detectNalysisList?size > 0)>
+                        <#list detectNalysisList as detectNalysis>
+                            <li class="b-close" id="configDetele5">
+                                <input type="hidden" value="${detectNalysis.itemConfigId!''}" name="configli5">
+                                ${detectNalysis.itemDetectContent!''}
+                                <span style="display: none" class="my-close" onclick="deleteli(this)"></span>
+                            </li>
+                        </#list>
+                    </#if>
+                    </span></td>
+                </tr>
+
+                <tr>
+                    <th width="10">维修配件:</th>
+                    <td width="10" style="font-weight: normal;" colspan="5">
+                        <span>
+                            <#if (listMaterialItem?size > 0)>
+                                <#list listMaterialItem as item>
+                                    <li class="b-close" >
+                                        <input type="hidden" value="">${item.materialName}
+                                    </li>
+                                </#list>
+                            </#if>
+                        </span>
+                    </td>
+                </tr>
+
+                <tr>
+                    <th width="10">维修内容:</th>
+                    <td width="10" colspan="5" style="font-weight: normal;"><span>${detectinfo.detectContent!''}</span></td>
+                </tr>
             </thead>
         </table>
         <div class="row cl">
@@ -521,21 +517,21 @@
     <#--<label class="form-label col-2 col-sm-2">购买产品信息:</label>-->
         <table class="table table-bordered table-bg table-hover table-sort" style="margin-top: 10px;">
             <tr class="text-c">
-                <th>是否通过</th>
-                <th>QC备注</th>
-                <th>操作时间</th>
+                <th width="10%">是否通过</th>
+                <th width="35%">QC备注</th>
+                <th width="55%">操作时间</th>
             </tr>
-                    <#if listQcInfo?? &&  (listQcInfo?size > 0) >
-                        <#list listQcInfo as item>
-                            <tr class="text-c">
-                                <td><#if item.qcIsThrough == 1>通过</#if><#if item.qcIsThrough == 2>不通过</#if></td>
-                                <td><#if item.qcInfoDesc??>${item.qcInfoDesc!''}</#if></td>
-                                <td>${item.qcCreateTime?string("yyyy/MM/dd HH:mm:ss")}</td>
-                            </tr>
-                        </#list>
-                    <#else>
-                        <tr><td class="td-manage text-c" colspan = "3">暂时没有QC操作记录</td></tr>
-                    </#if>
+            <#if listQcInfo?? &&  (listQcInfo?size > 0) >
+                <#list listQcInfo as item>
+                    <tr class="text-c">
+                        <td><#if item.qcIsThrough == 1>通过</#if><#if item.qcIsThrough == 2>不通过</#if></td>
+                        <td><#if item.qcInfoDesc??>${item.qcInfoDesc!''}</#if></td>
+                        <td>${item.qcCreateTime?string("yyyy/MM/dd HH:mm:ss")}</td>
+                    </tr>
+                </#list>
+            <#else>
+                <tr><td class="td-manage text-c" colspan = "3">暂时没有QC操作记录</td></tr>
+            </#if>
         </table>
         <div class="row cl">
             <label class="form-label col-3">
@@ -554,23 +550,27 @@
                 <th>操作客服</th>
                 <th>操作时间</th>
             </tr>
-                    <#if listTreatmentRecordLog?? &&  (listTreatmentRecordLog?size > 0) >
-                        <#list listTreatmentRecordLog as item>
-                            <tr class="text-c">
-                                <td><#if item.recordProcessingResults == 1>付费维修</#if>
-                                    <#if item.recordProcessingResults == 2>免费维修</#if>
-                                    <#if item.recordProcessingResults == 3>退货</#if>
-                                    <#if item.recordProcessingResults == 4>换货</#if>
-                                    <#if item.recordProcessingResults == 5>原机退回</#if>
-                                </td>
-                                <td>${item.recordDesc!''}</td>
-                                <td>${item.adminName!''}</td>
-                                <td>${item.recordCreateTime?string("yyyy/MM/dd HH:mm:ss")}</td>
-                            </tr>
-                        </#list>
-                    <#else>
-                        <tr><td class="td-manage text-c" colspan = "4">暂时没有客服操作记录</td></tr>
+            <#if listTreatmentRecordLog?? &&  (listTreatmentRecordLog?size > 0) >
+                <#list listTreatmentRecordLog as item>
+                    <#if (item.recordProcessingResults)??>
+
+                        <tr class="text-c">
+                            <td><#if item.recordProcessingResults == 1>付费维修</#if>
+                                <#if item.recordProcessingResults == 2>免费维修</#if>
+                                <#if item.recordProcessingResults == 3>退货</#if>
+                                <#if item.recordProcessingResults == 4>换货</#if>
+                                <#if item.recordProcessingResults == 5>原机退回</#if>
+                                <#if item.recordProcessingResults == 6>付费翻新</#if>
+                            </td>
+                            <td>${item.recordDesc!''}</td>
+                            <td>${item.adminName!''}</td>
+                            <td>${item.recordCreateTime?string("yyyy/MM/dd HH:mm:ss")}</td>
+                        </tr>
                     </#if>
+                </#list>
+            <#else>
+                <tr><td class="td-manage text-c" colspan = "4">暂时没有客服操作记录</td></tr>
+            </#if>
         </table>
         <div class="row cl">
             <label class="form-label col-3">

文件差異過大導致無法顯示
+ 180 - 82
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl


+ 168 - 92
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_msg.ftl

@@ -5,30 +5,29 @@
 		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
 		<meta name="apple-mobile-web-app-capable" content="yes">
 		<meta name="apple-mobile-web-app-status-bar-style" content="black">
-		<title></title>
+		<title>确认机器处理</title>
 		<#include "/base/list_base.ftl">
-
 		<style>
-			.Hui-aside{top:60px;padding-top: 0;background-color: #292f36;width:138px;}
-        .container-fluid{padding: 8px 15px;}
-        #Hui-userbar{top:8px;}
-        .Hui-article-box{top:58px;}
-        .navbar{background: #292f36;}
-        .navbar-slogan{font-size: 14px;}
-        .Hui-aside .menu_dropdown dt{border-bottom: 0}
-        .Hui-aside .menu_dropdown dt {color: #fff; background: #292f36;}
-        .Hui-aside .menu_dropdown dt.selected{background: #50a2ea;color:#fff;border-left: 4px solid #1f6eb3;}
-        .Hui-aside .menu_dropdown dt:hover {  color: #f0f0f0 !important;  }
-        .Hui-aside .menu_dropdown dt .Hui-iconfont {  color: #fff;  }
-        .menu_dropdown dt .menu_dropdown-arrow {  color: #fff;  }
-        .Hui-aside .menu_dropdown dd ul{background: #292f36;  }
-        .Hui-aside .menu_dropdown li a{color: #94a0b5;}
-        .Hui-aside .menu_dropdown li.active a{color: #50a2ea;}
-        .acrossTab li{color: #999;}
-        .acrossTab li.active{color:#50a2ea;}
-		table{border: 1px solid rgba(0,0,0,.1);}
-		table th{background: #f7fafd;}
-		table th,table td{border-collapse: collapse;border: 1px solid rgba(0,0,0,.1);text-align: center;padding: 5px 0;}
+            .Hui-aside{top:60px;padding-top: 0;background-color: #292f36;width:138px;}
+            .container-fluid{padding: 8px 15px;}
+            #Hui-userbar{top:8px;}
+            .Hui-article-box{top:58px;}
+            .navbar{background: #292f36;}
+            .navbar-slogan{font-size: 14px;}
+            .Hui-aside .menu_dropdown dt{border-bottom: 0}
+            .Hui-aside .menu_dropdown dt {color: #fff; background: #292f36;}
+            .Hui-aside .menu_dropdown dt.selected{background: #50a2ea;color:#fff;border-left: 4px solid #1f6eb3;}
+            .Hui-aside .menu_dropdown dt:hover {  color: #f0f0f0 !important;  }
+            .Hui-aside .menu_dropdown dt .Hui-iconfont {  color: #fff;  }
+            .menu_dropdown dt .menu_dropdown-arrow {  color: #fff;  }
+            .Hui-aside .menu_dropdown dd ul{background: #292f36;  }
+            .Hui-aside .menu_dropdown li a{color: #94a0b5;}
+            .Hui-aside .menu_dropdown li.active a{color: #50a2ea;}
+            .acrossTab li{color: #999;}
+            .acrossTab li.active{color:#50a2ea;}
+            table{border: 1px solid rgba(0,0,0,.1);}
+            table th{background: #f7fafd;}
+            table th,table td{border-collapse: collapse;border: 1px solid rgba(0,0,0,.1);text-align: center;padding: 5px 0;}
 		</style>
 	</head>
 	<body>
@@ -59,6 +58,12 @@
 							<th>是否故障</th><td id="isMaintenance" style="width: 50%;">是</td>
 						</tr>
 						<tr>
+							<th>故障原因</th><td id="deleteMaintainType" style="width: 50%;">非质量问题</td>
+						</tr>
+						<tr>
+							<th>过水使用</th><td id="deleteIsUse" style="width: 50%;">已过水使用</td>
+						</tr>
+						<tr>
 							<th>是否可翻新</th><td id="detectRenovation">否</td>
 						</tr>
 						<tr>
@@ -68,9 +73,6 @@
 							<th>厚膜类型</th><td id="detectFilmType"></td>
 						</tr>
 						<tr>
-							<th>是否为翻新机</th><td id="detectIsRefurbishing"></td>
-						</tr>
-						<tr>
 							<th>生产月份</th><td id="detectProduction"></td>
 						</tr>
 						<tr>
@@ -80,7 +82,10 @@
 							<th>检测现象</th><td id="detectPhenomenon"></td>
 						</tr>
 						<tr>
-							<th>维修报价</th><td id="detectOffer"></td>
+							<th>工厂报价</th><td id="detectOffer"></td>
+						</tr>
+						<tr>
+							<th>检测日期</th><td id="detectDate"></td>
 						</tr>
 						<tr>
 							<th>备注信息</th><td id="detectDesc"></td>
@@ -94,26 +99,35 @@
                 </div>
                 <div class="row cl">
                     <div class="formControls col-12 col-sm-12 skin-minimal customerSourceType_text_all">
-                        <div class="radio-box">
-                            <input type="radio" name="detectProcessingResults" value="2" id="radio-1" checked="checked">
-                            <label for="radio-1" class="">免费维修</label>
-                        </div>
-                        <div class="radio-box">
-                            <input type="radio" name="detectProcessingResults" value="1" id="radio-2"/>
-                            <label for="radio-2">付费维修</label>
-                        </div>
-                        <div class="radio-box">
-                            <input type="radio" name="detectProcessingResults" value="5" id="radio-3"/>
-                            <label for="radio-3" class="">原机退回</label>
+                        <div id="ff_wx">
+                            <div class="radio-box">
+                                <input type="radio" name="detectProcessingResults" value="31" id="radio-2"/>
+                                <label for="radio-2">确认维修</label>
+                            </div>
+                            <div class="radio-box">
+                                <input type="radio" name="detectProcessingResults" value="33" id="radio-3"/>
+                                <label for="radio-3" class="">不维修,原机退回</label>
+                            </div>
                         </div>
-                        <div class="radio-box">
-                            <input type="radio" name="detectProcessingResults" value="4" id="radio-4"/>
-                            <label for="radio-4" class="">换货</label>
+
+                        <div id="ff_fx">
+                            <div class="radio-box">
+                                <input type="radio" name="detectProcessingResults" value="25" id="radio-4"/>
+                                <label for="radio-4" class="">确认翻新</label>
+                            </div>
+                            <div class="radio-box">
+                                <input type="radio" name="detectProcessingResults" value="27" id="radio-5"/>
+                                <label for="radio-5" class="">不翻新,原机退回</label>
+                            </div>
                         </div>
-                        <div class="radio-box">
-                            <input type="radio" name="detectProcessingResults" value="3" id="radio-5"/>
-                            <label for="radio-5" class="">退货</label>
+
+                        <div id="mf_wx">
+                            <div class="radio-box">
+                                <input type="radio" name="detectProcessingResults" value="35" id="radio-6"/>
+                                <label for="radio-6">确认维修</label>
+                            </div>
                         </div>
+
                     </div>
                 </div>
                 <div class="row cl">
@@ -130,28 +144,13 @@
     <script type="text/javascript" src="${path}/common/lib/icheck/jquery.icheck.min.js"></script>
 	<script>
         var detectId = getParam("detectId");
+        $(function() {
             $('.skin-minimal input').iCheck({
                 checkboxClass: 'icheckbox-blue',
                 radioClass: 'iradio-blue',
                 increaseArea: '20%'
             });
             getDetect();
-
-
-        $("#radio-1").click(function (){
-            $("#methodId").val(6);
-        });
-        $("#radio-2").click(function (){
-            $("#methodId").val(7);
-        });
-        $("#radio-3").click(function (){
-            $("#methodId").val(44);
-        });
-        $("#radio-4").click(function (){
-            $("#methodId").val(3);
-        });
-        $("#radio-5").click(function (){
-            $("#methodId").val(8);
         });
 
         function getDetect() {
@@ -164,58 +163,98 @@
                 success: function(data){
                     if (data.returnCode == 200) {
                         var detectinfo = data.returnMsg.detectinfo;
+                        // 是否有故障
                         var isMaintenance = "";
                         if(detectinfo.isMaintenance === 1){
                             isMaintenance = "有故障";
                         }else if(detectinfo.isMaintenance === 2){
                             isMaintenance = "无故障";
                         }
-                        var detectRenovation = "";
-                        if(detectinfo.detectRenovation === 1){
-                            detectRenovation = "可翻新";
-                        }else if(detectinfo.detectRenovation === 2){
-                            detectRenovation = "不可翻新";
+                        $("#isMaintenance").text(isMaintenance);
+                        // 故障原因
+                        let deleteMaintainType = "未知";
+                        if (detectinfo.deleteMaintainType === 1) {
+                            deleteMaintainType = "质量问题";
+                        } else if (detectinfo.deleteMaintainType === 2) {
+                            deleteMaintainType = "非质量问题导致故障";
+                        }
+                        $("#deleteMaintainType").text(deleteMaintainType);
+                        // 过水使用
+                        let deleteIsUse = "未知";
+                        if (detectinfo.deleteIsUse === 1) {
+                            deleteIsUse = "未过水使用";
+                        } else if (detectinfo.deleteIsUse === 2) {
+                            deleteIsUse = "已过水使用";
                         }
+                        $("#deleteIsUse").text(deleteIsUse);
+                        // 浮子类型
                         var detectFloatType = "";
                         if(detectinfo.detectFloatType === 1){
                             detectFloatType = "长";
                         }else if(detectinfo.detectFloatType === 2){
                             detectFloatType = "短";
                         }
+                        $("#detectFloatType").text(detectFloatType);
+                        // 厚膜类型
                         var detectFilmType = "";
                         if(detectinfo.detectFilmType === 1){
-                            detectFilmType = "圆";
+                            detectFilmType = "圆厚膜";
                         }else if(detectinfo.detectFilmType === 2){
-                            detectFilmType = "扁";
+                            detectFilmType = "扁厚膜";
                         }
-                        var detectIsRefurbishing = "";
-                        if(detectinfo.detectIsRefurbishing === 1){
-                            detectIsRefurbishing = "是";
-                        }else if(detectinfo.detectIsRefurbishing === 2){
-                            detectIsRefurbishing = "否";
+                        $("#detectFilmType").text(detectFilmType);
+                        // 是否是翻新机
+                        var detectRenovation = "";
+                        if(detectinfo.detectRenovation === 1){
+                            detectRenovation = "可翻新";
+                        }else if(detectinfo.detectRenovation === 2){
+                            detectRenovation = "不可翻新";
                         }
-                        var detectPhenomenon = "";
-                        $(detectinfo.configli1).each(function (){
-                            detectPhenomenon = detectPhenomenon+this.configDetectContent+";";
-                        });
-
-                        $("#detectName").text(detectinfo.detectName+","+detectinfo.detectTel);
-                        $("#productName").text(detectinfo.productName+"("+detectinfo.colorName+")");
-                        $("#questionName").text(detectinfo.questionName);
-                        $("#isMaintenance").text(isMaintenance);
                         $("#detectRenovation").text(detectRenovation);
-                        $("#detectFloatType").text(detectFloatType);
-                        $("#detectFilmType").text(detectFilmType);
-                        $("#detectIsRefurbishing").text(detectIsRefurbishing);
+                        // 生产日期
                         $("#detectProduction").text(detectinfo.detectProduction);
+                        // 版本号
                         $("#detectVersionNumber").text(detectinfo.detectVersionNumber);
-                        $("#detectPhenomenon").text(detectinfo.detectPhenomenon);
-                        if(detectinfo.detectOffer != null && detectinfo.detectOffer != ""){
+                        // 检测现象
+                        if (!!detectinfo.phenomen && !!detectinfo.phenomen.phenomenonName) {
+                            $("#detectPhenomenon").text(detectinfo.phenomen.phenomenonName);
+                        } else {
+                            $("#detectPhenomenon").text(detectinfo.detectPhenomenon);
+                        }
+                        // 维修报价
+                        if(detectinfo.detectOffer != null && detectinfo.detectOffer !== ""){
                             $("#detectOffer").text(detectinfo.detectOffer/100);
                         }
+                        // 检测日期
+                        $("#detectDate").text(formatDate(detectinfo.detectDate, "yyyy-MM-dd"));
+                        // 备注信息
                         $("#detectDesc").text(detectinfo.detectDesc);
-                        if(detectinfo.detectState === 30 || detectinfo.detectState === 34 || detectinfo.detectState === 38){
+                        // 姓名
+                        $("#detectName").text(detectinfo.detectName+","+detectinfo.detectTel);
+                        // 产品信息
+                        $("#productName").text(detectinfo.productName+"("+detectinfo.colorName+")");
+                        // 反馈问题现象
+                        if (!!detectinfo.detectCustmoerQuestion) {
+                            $("#questionName").text(detectinfo.detectCustmoerQuestion);
+                        } else {
+                            $("#questionName").text(detectinfo.questionName);
+                        }
+
+                        if(detectinfo.detectState === 30){
                             $("#detectDiv").show();
+                            $("#ff_wx").show();
+                            $("#ff_fx").hide();
+                            $("#mf_wx").hide();
+                        } else if (detectinfo.detectState === 24) {
+                            $("#detectDiv").show();
+                            $("#ff_wx").hide();
+                            $("#ff_fx").show();
+                            $("#mf_wx").hide();
+                        } else if (detectinfo.detectState === 34) {
+                            $("#detectDiv").show();
+                            $("#ff_wx").hide();
+                            $("#ff_fx").hide();
+                            $("#mf_wx").show();
                         }
 
                     }
@@ -231,16 +270,14 @@
             var detectProcessingResults = $('input[name="detectProcessingResults"]:checked').val();//处理结果
             //查询处理方式
             var methodId = $("#methodId").val();//处理结果
-
-
-
             $.ajax({
                 cache: true,
                 type: "POST",
                 url: "${path}/detect/salesman_confirm",
-                data:{ "detectId": detectId,
-                    "detectProcessingResults": detectProcessingResults,// 你的formid
-                    "methodId": methodId},
+                data:{
+                    "detectId": detectId,
+                    "detectState": detectProcessingResults
+                },
                 async: false,
                 success: function(data){
                     if (data.returnCode == 200) {
@@ -258,6 +295,45 @@
         };
 
 
+        /**
+         * 格式化时间日期
+         * @param date              时间对象/时间戳
+         * @param format            格式化的格式
+         * @returns {XML|string|void|*}
+         */
+        function formatDate(date, format) {
+            if (!date) {
+                if (date !== 0) {
+                    return;
+                }
+            }
+            if (!format) format = "yyyy-MM-dd";
+            switch(typeof date) {
+                case "string":
+                    date = new Date(date.replace(/-/, "/"));
+                    break;
+                case "number":
+                    date = new Date(date);
+                    break;
+            }
+            if (!date instanceof Date) return;
+            var dict = {
+                "yyyy": date.getFullYear(),
+                "M": date.getMonth() + 1,
+                "d": date.getDate(),
+                "H": date.getHours(),
+                "m": date.getMinutes(),
+                "s": date.getSeconds(),
+                "MM": ("" + (date.getMonth() + 101)).substr(1),
+                "dd": ("" + (date.getDate() + 100)).substr(1),
+                "HH": ("" + (date.getHours() + 100)).substr(1),
+                "mm": ("" + (date.getMinutes() + 100)).substr(1),
+                "ss": ("" + (date.getSeconds() + 100)).substr(1)
+            };
+            return format.replace(/(yyyy|MM?|dd?|HH?|ss?|mm?)/g, function() {
+                return dict[arguments[0]];
+            });
+        }
 
         function getParam(paramName) {
             paramValue = "", isFound = !1;

+ 133 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/print.ftl

@@ -0,0 +1,133 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+    <#include "/base/add_base.ftl">
+    <!-- 新增需求引入js、css -->
+    <link href="${path}/common/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
+    <title>打印电子面单</title>
+    <style>
+        .input-text{
+            height: 31px;
+        }
+        .form-label {
+            padding-left: 0;
+            margin-left: 0px;
+            width: 17%;
+        }
+        .formControls{
+            padding-top: 3px;
+        }
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+
+    </style>
+</head>
+<body>
+<div class="pd-20">
+    <form class="form form-horizontal" id="form-admin-add">
+        <input type="hidden" name="id" value="${(id)!}">
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 16%;"><h5 style="font-weight: bold;">打印物流单</h5></label>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>店铺信息:</label>
+            <div class="formControls col-9 col-sm-9">
+                <select id="firm" name="firm" style="width: 99%;height: 31px">
+                    <#if list??>
+                        <#list list as s>
+                            <option value="${(s.logisticsRstCode)!}">${(s.logisticsName)!}</option>
+                        </#list>
+                    </#if>
+                </select>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <div class="form-label" style="margin-left: 7%;">
+                <button type="button" class="btn btn-primary radius" onclick="add();">确认打印</button>
+            </div>
+        </div>
+
+        <div id="temp-print-order" style="zoom:0.9;display:none"></div>
+    </form>
+</div>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
+<script type="text/javascript" src="//s.iamberry.com/js/LodopFuncs_v_5_0.js"></script>
+
+<script type="text/javascript">
+
+    /** 添加事件 */
+    function add() {
+        let LODOP=getLodop();
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/afterSales/printDetect",
+            data:$('#form-admin-add').serialize(),
+            async: false,
+            success: function(data){
+                if (data.hasOwnProperty("error")) {
+                    // 捕获系统级的错误(比如因为空指针抛出的Exception)
+                    layer.msg(data.error_msg,{icon: 5,time:1000});
+                } else if (data && data.returnCode && data.returnCode !== 200) {
+                    // 捕获业务级的操作(如订单的店铺没有绑定发货人信息)
+                    layer.msg(data.returnMsg.error,{icon: 5,time:1000});
+                } else {
+                    let res = $.parseJSON(data.returnMsg.json);
+                    if (data.resultMsg && !res.Success) {
+                        // 捕获第三方系统返回的错误
+                        layer.msg(res.Reason,{icon: 5,time:1000});
+                    } else {
+                        // 选择打印设备,注意:选择打印机时,需要区别IE类浏览器和非IE浏览器
+                        let isIE = (navigator.userAgent.indexOf('MSIE')>=0) || (navigator.userAgent.indexOf('Trident')>=0);
+                        if (!isIE) {
+                            let html = res.PrintTemplate;
+                            $("#temp-print-order").html(html);
+                            LODOP.PRINT_INIT('打印订单');
+                            LODOP.SET_PRINT_PAGESIZE(0, 0, 0,"");
+                            LODOP.ADD_PRINT_HTM("0mm","0mm","100%","100%", $("#temp-print-order").html());
+                            LODOP.SELECT_PRINTER(true);
+                            // 注意,选择打印机后,需要更改打印机事件,否则无法执行回调
+                            let spans = $("span");
+                            for (var i = 0; i < spans.length; i++) {
+                                if ($(spans[i]).text() === "打印份数:") {
+                                    $(spans[i]).parent().next()[0].onclick = function () {
+                                        CLODOP.SelectBox.clickOK(false);
+                                        layer.msg("打印成功",{icon: 6,time:3000});
+                                    };
+                                }
+                            }
+                        } else {
+                            LODOP.SELECT_PRINTER();
+                            let html = res.PrintTemplate;
+                            $("#temp-print-order").html(html);
+                            LODOP.PRINT_INIT('打印订单');
+                            LODOP.SET_PRINT_PAGESIZE(0, 0, 0,"");
+                            LODOP.ADD_PRINT_HTM("0mm","0mm","100%","100%", $("#temp-print-order").html());
+                            let flag = LODOP.PRINT();
+                            if (flag) {
+                                layer.msg("打印成功",{icon: 6,time:3000});
+                            }
+                        }
+                    }
+                }
+
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('修改错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>

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

@@ -31,11 +31,12 @@
         .close-box{width: 500px;margin-left: 15px;margin-top: -15px;}
     </style>
     <meta name="keywords" content="${path}">
-    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+    <meta name="description" content="RST售后系统">
 </head>
 <body>
 <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 huanhang" >
@@ -49,6 +50,24 @@
                 </div>
             </div>
         </div>
+
+        <div class="input-box" style="padding-top: 35px;">
+            <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" style="margin: 10px 0px;">
+                    <input type="radio" id="radio-5" name="deleteMaintainType" value="1"  checked
+                          <#if detectInfo.deleteMaintainType??><#if detectInfo.deleteMaintainType == 1>checked</#if></#if>/><label for="radio-5">质量问题</label>
+                </div>
+                <div class="radio-box">
+                    <input type="radio" id="radio-6" name="deleteMaintainType" value="2"
+                    <#if detectInfo.deleteMaintainType??><#if detectInfo.deleteMaintainType == 2>checked</#if></#if>/><label for="radio-6">非质量问题导致</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" >
@@ -101,10 +120,25 @@
                 </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;">是否过水:</label>
+            <div class=" col-xs-9 col-sm-9  huanhang" >
+                <div class="radio-box" style="margin: 10px 0px;">
+                    <input type="radio" id="radio-15" name="deleteIsUse" value="1"  checked
+                          <#if detectInfo.deleteIsUse??><#if detectInfo.deleteIsUse == 1>checked</#if></#if>/><label for="radio-15">未过水</label>
+                </div>
+                <div class="radio-box">
+                    <input type="radio" id="radio-16" name="deleteIsUse" value="2"
+                    <#if detectInfo.deleteIsUse??><#if detectInfo.deleteIsUse == 2>checked</#if></#if>/><label for="radio-16">已过水</label>
+                </div>
+            </div>
+        </div>
+
         <div class="input-box">
             <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 -19px;">
-                <input class="my-input" style="width: 90%;" type="text" value="" name="detectProduction" id="detectProduction" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M',dateFmt: 'yyyy-MM'})" placeholder="请选择月份" readonly="readonly"/>
+                <input class="my-input" style="width: 90%;" type="text" value="${(detectInfo.detectProduction)!}" name="detectProduction" id="detectProduction" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d',dateFmt: 'yyyy-MM-dd'})" placeholder="请选择月份" readonly="readonly"/>
             </div>
         </div>
         <div class="input-box" >
@@ -119,7 +153,22 @@
                 <input class="my-input" style="width: 90%;" type="text" value="${detectInfo.detectVersionNumber!''}" name="detectVersionNumber" id="detectVersionNumber"  placeholder="请输入版本号"/>
             </div>
         </div>
+
         <div class="input-box">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;">问题现象:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px;">
+                <select name="detectPhenomenonIds" id="detectPhenomenonIds" style="width: 93%;" multiple="multiple" size="9">
+                    <#list phenomenonList as p>
+                        <option value="${p.phenomenonId!}" <#if (detectInfo.detectPhenomenonId)?? && (detectInfo.detectPhenomenonId == p.phenomenonId)>selected</#if>>
+                            ${p.phenomenonName}
+                        </option>
+                    </#list>
+                </select>
+                <p style="font-size: 10px;color: #999895">注意:按住Ctrl键可多选;请确认录入,一旦录入后,将不允许修改</p>
+            </div>
+        </div>
+
+        <#--<div class="input-box">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;">检测现象:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px;">
                 <select id="configSelect1" name="configSelect1" class="chosen" style="width: 93%;">
@@ -132,26 +181,26 @@
                 </select>
 
             </div>
-        </div>
+        </div>-->
+
         <div class="input-box">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
             <div class="formControls col-9 col-sm-9 huanhang" id="config1" style="margin: 10px 0px;">
                 <div class="row">
                     <ul class="close-box" id="configui1">
-
                     </ul>
                 </div>
-
             </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: 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="">
+                <input type="hidden" readonly="readonly" name="detectOffer" id="detectOffer" value="">
             </div>
-        </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-9 col-sm-9 text-c huanhang" style="margin-left: -4%;margin: 10px 0px 10px -14px;">
@@ -261,9 +310,13 @@
 
     function  add() {
         var detect_Offer = $("#detect_Offer").val();
-        if(detect_Offer != null && detect_Offer != ""){
+        if(detect_Offer != null && detect_Offer !== ""){
             $("#detectOffer").val(detect_Offer * 100)
         }
+        if (!isEmpty(document.getElementById("detectPhenomenonIds").value)) {
+            layer.msg('检测现象必须选一个',{icon: 5,time:1000});
+            return;
+        }
         $.ajax({
             cache: true,
             type: "POST",

+ 52 - 8
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/update_detect.ftl

@@ -36,20 +36,49 @@
 <body>
 <article class="page-container">
     <form class="form form-horizontal" id="form-admin-add">
-        <div class="row cl">
+    <div class="row cl">
+    <#-- <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 huanhang" >
+            <div class="radio-box">
+                <input type="radio" id="radio-3" name="isMaintenance" value="2" checked
+                      <#if detectInfo.isMaintenance??><#if detectInfo.isMaintenance == 2>checked</#if></#if>/><label for="radio-3">无故障</label>
+            </div>
+            <div class="radio-box">
+                <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">
             <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="isMaintenance" value="2" checked
-                          <#if detectInfo.isMaintenance??><#if detectInfo.isMaintenance == 2>checked</#if></#if>/><label for="radio-3">无故障</label>
+                      <#if detectInfo.isMaintenance??><#if detectInfo.isMaintenance == 2>checked</#if></#if>/><label for="radio-3">无故障</label>
                 </div>
                 <div class="radio-box">
                     <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>
+                <#if detectInfo.isMaintenance??><#if detectInfo.isMaintenance == 1>checked</#if></#if>/><label for="radio-4">有故障</label>
+                </div>
+            </div>
+        </div>
+
+        <div class="input-box" style="padding-top: 35px;">
+            <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" style="margin: 10px 0px;">
+                    <input type="radio" id="radio-5" name="deleteMaintainType" value="1"  checked
+                      <#if detectInfo.deleteMaintainType??><#if detectInfo.deleteMaintainType == 1>checked</#if></#if>/><label for="radio-5">质量问题</label>
+                </div>
+                <div class="radio-box">
+                    <input type="radio" id="radio-6" name="deleteMaintainType" value="2"
+                <#if detectInfo.deleteMaintainType??><#if detectInfo.deleteMaintainType == 2>checked</#if></#if>/><label for="radio-6">非质量问题导致</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" >
@@ -105,7 +134,7 @@
         <div class="input-box">
             <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  skin-minimal huanhang" style="margin: 10px 0px">
-                <input class="my-input" style="width: 90%;" type="text" value="${detectInfo.detectProduction!''}" name="detectProduction" id="detectProduction" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M',dateFmt: 'yyyy-MM'})" placeholder="请选择月份" readonly="readonly"/>
+                <input class="my-input" style="width: 90%;" type="text" value="${detectInfo.detectProduction!''}" name="detectProduction" id="detectProduction" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d',dateFmt: 'yyyy-MM-dd'})" placeholder="请选择月份" readonly="readonly"/>
             </div>
         </div>
         <div class="input-box" >
@@ -120,7 +149,22 @@
                 <input class="my-input" style="width: 90%;" type="text" value="${detectInfo.detectVersionNumber!''}" name="detectVersionNumber" id="detectVersionNumber"  placeholder="请输入版本号"/>
             </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;">问题现象:</label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px;">
+                <select name="detectPhenomenonId" id="detectPhenomenonId" style="width: 93%;">
+                    <#list phenomenonList as p>
+                        <option value="${p.phenomenonId!}" <#if (detectInfo.detectPhenomenonId)?? && (detectInfo.detectPhenomenonId == p.phenomenonId)>selected</#if>>
+                            ${p.phenomenonName}
+                        </option>
+                    </#list>
+                </select>
+            </div>
+        </div>-->
+
+            <#--<div class="input-box">
                 <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;">检测现象:</label>
                 <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px;">
                     <select id="configSelect1" name="configSelect1" class="chosen" style="width: 93%;">
@@ -133,7 +177,7 @@
                     </select>
 
                 </div>
-            </div>
+            </div>-->
             <div class="input-box">
                 <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
                 <div class="formControls col-9 col-sm-9 huanhang" id="config1" style="margin: 10px 0px;">
@@ -345,13 +389,13 @@
 
             </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: 10px 0px;">维修报价:</label>
             <div class="formControls col-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">
                 <input class="my-input" style="width: 90%;" type="text" value="<#if detectInfo.detectOffer??>${detectInfo.detectOffer/100}</#if>" name="detect_Offer" id="detect_Offer"  placeholder="请输入维修报价" oninput = "value=value.replace(/[^\d]/g,'')"/>
                 <input type="hidden" name="detectOffer" id="detectOffer" value="">
             </div>
-        </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-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">

+ 463 - 37
watero-rst-web/src/main/webapp/WEB-INF/views/yulia/add.ftl

@@ -23,13 +23,23 @@
         .formControls{
             padding-top: 3px;
         }
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+
     </style>
 </head>
 <body>
 <div class="pd-20">
     <form class="form form-horizontal" id="form-admin-add">
+        <input type="hidden" id="storeDate" value="${(company.compaynStorageMonth)!}">
+        <input type="hidden" id="exchangeDate" value="${(company.companyAfterMonth)!}">
+        <input type="hidden" id="mainmitaDate" value="${(company.companyMaintainMonth)!}">
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 19%;"><h4 style="font-weight: bold;">添加售后信息</h4></label>
+        </div>
+
         <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 17%;"><h4 style="font-weight: bold;">添加售后信息</h4></label>
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 16%;"><h5 style="font-weight: bold;">机器信息</h5></label>
         </div>
 
         <div class="row cl">
@@ -54,31 +64,27 @@
         </div>
 
         <div class="row cl">
-            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>店铺信息:</label>
-            <div class="formControls col-9 col-sm-9">
-                <select id="storeId" name="storeId" style="width: 99%;height: 31px">
-                    <#if storeInfos??>
-                        <#list storeInfos as s>
-                            <option value="${(s.storeId)!}">${(s.storeName)!}</option>
-                        </#list>
-                    </#if>
-                </select>
-            </div>
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 16%;"><h5 style="font-weight: bold;">问题信息</h5></label>
         </div>
 
         <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-xs-9 col-sm-9 skin-minimal">
-                <select name="complaintId"  id="complaintId" class="chosen3 question_class"></select>
-                <select name="smallClassId" id="smallClassId" class="chosen3 question_class"></select>
-                <select id="questionId" name="questionId" class="chosen question_class">
-                    <option value="">请选择客户问题</option>
-                    <#if (listComplaintQuestionInfo?size > 0)>
-                        <#list listComplaintQuestionInfo as info>
-                            <option value="${info.questionId!}">${info.questionName!}</option>
-                        </#list>
-                    </#if>
+                <select id="typeId" name="typeId" class="my-select" style="width: 45%;">
+                    <#list types as t>
+                        <option value="${(t.typeId)!}">${(t.typeName)!}</option>
+                    </#list>
                 </select>
+
+                <select style="width: 44%;height: 31px" name="phenomenonId-html" id="phenomenonId"></select>
+
+                <span class="btn btn-primary radius" style="width: 10%" id="add-phenomenon-btn">添加问题现象</span>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <div class="formControls col-xs-9 col-sm-9 skin-minimal" style="margin-left: 17%" id="phenomenon-list-div">
+
             </div>
         </div>
 
@@ -91,6 +97,30 @@
         </div>
 
         <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 16%;"><h5 style="font-weight: bold;">客户信息</h5></label>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red"></span>购买日期:</label>
+            <div class="formControls col-9 col-sm-9 text-c">
+                <input style="width: 100%" class="text" type="text" value="" name="detectBuytime" id="detectDate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'%y-%M-%d 00:00:00'})" placeholder="请选择购买日期" 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-9 col-sm-9">
+                <select id="storeId" name="storeId" style="width: 99%;height: 31px">
+                    <#if storeInfos??>
+                        <#list storeInfos as s>
+                            <option value="${(s.storeId)!}">${(s.storeName)!}</option>
+                        </#list>
+                    </#if>
+                </select>
+            </div>
+        </div>
+
+        <div class="row cl">
             <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>客户信息:</label>
             <div class="formControls col-9 col-sm-9">
                 <input style="height: 31px;width: 50%" class="input-text" type="text" name="detectName" id="detectName" placeholder="请输入客户姓名或昵称"/>
@@ -99,18 +129,75 @@
         </div>
 
         <div class="row cl">
-            <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>处理方式:</label>
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 16%;"><h5 style="font-weight: bold;">寄回工厂信息</h5></label>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red"></span>物流信息:</label>
             <div class="formControls col-9 col-sm-9">
-                <select style="width: 50%" class="my-select" id="procTypeId" name="procTypeId"></select>
-                <select style="width: 49%" class="my-select" id="procMethodId" name="methodId"></select>
+                <input style="height: 31px;width: 50%" class="input-text" type="text" name="transport.transportSendFirm" id="transportSendFirm" placeholder="物流公司"/>
+                <input style="height: 31px;width: 49%" class="input-text" type="text" name="transport.transportSendPost" id="transportSendPost" placeholder="物流单号"/>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 16%;"><h5 style="font-weight: bold;">寄送客户信息</h5></label>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red"></span>客户信息:</label>
+            <div class="formControls col-9 col-sm-9">
+                <input style="height: 31px;width: 50%" class="input-text" type="text" name="transport.transportSignName" id="transportSignName" placeholder="请输入客户姓名或昵称"/>
+                <input style="height: 31px;width: 49%" class="input-text" type="text" name="transport.transportSignTel" id="transportSignTel" placeholder="请输入客户电话或手机号码"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red"></span>地址信息:</label>
+            <div class="formControls col-9 col-sm-9 init_address" id="TDScollect" code="returnCode" msg="resultMsg" data="returnMsg" urlPrefix="${path}">
+                <select style="width: 33%" name="provinceId" class="select ulc_select" id="initProvince"
+                        ulcValName="province" ulcValId="provinceId"  ulcURL="/address/list_province" ulcMsg="" ulcList="provinceList"
+                        ulcIsFristSelect="1" ulcFristSelectMsg="请选择省份">
+                </select>
+                <select style="width: 33%" name="cityId" class="select ulc_select" id="initCity"
+                        ulcValName="city" ulcValId="cityId"  ulcURL="/address/list_city?provinceId=" ulcMsg="" ulcList="cityList"
+                        ulcIsFristSelect="1" ulcFristSelectMsg="请选择市">
+                </select>
+                <select style="width: 33%" name="districtId" class="select ulc_select" id="initCountry"
+                        ulcValName="district" ulcValId="districtId"  ulcURL="/address/list_district?cityId=" ulcMsg="" ulcList="districtList"
+                        ulcIsFristSelect="1" ulcFristSelectMsg="请选择区/县">
+                </select>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3">详细地址:</label>
+            <div class="formControls col-xs-9 col-sm-9">
+                <textarea style="width: 98%" rows="3" cols="20" name="transport.transportSignAddr" id="transportSignAddr" class="my-textarea" placeholder="详细地址"></textarea>
             </div>
         </div>
 
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 16%;"><h5 style="font-weight: bold;">处理方式</h5></label>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>处理方式:</label>
+            <div class="formControls col-5 col-sm-5 skin-minimal" id="handler-type-div">
+                <#--<div class="radio-box">
+                    <label for="detect_is_maintain-1">
+                        <input type="radio" id="detect_is_maintain-1" name="detectIsMaintain" value="1" checked>待工厂检测维修
+                    </label>
+                </div>
+                <div class="radio-box">
+                    <label for="detect_is_maintain-2">
+                        <input type="radio" id="detect_is_maintain-2" name="detectIsMaintain" value="2" >待工厂检测翻新
+                    </label>
+                </div>-->
+            </div>
+        </div>
 
-        <div class="row cl" style="display: none">
+
+        <div class="row cl">
             <label class="form-label col-3 col-sm-3">备注信息:</label>
             <div class="formControls col-xs-9 col-sm-9">
-                <textarea style="width: 98%" rows="3" cols="20" name="detectItemDesc" id="detectItemDesc" class="my-textarea" placeholder="备注信息"></textarea>
+                <textarea style="width: 98%" rows="3" cols="20" name="detectCustomerDesc" id="detectCustomerDesc" class="my-textarea" placeholder="备注信息"></textarea>
             </div>
         </div>
 
@@ -120,20 +207,143 @@
             </div>
         </div>
 
+        <div style="display: none" id="hide-input-div">
+
+        </div>
+
         <input type="hidden" id="detectProduction" name="detectProduction">
         <input type="hidden" id="detectFuselageBarcode" name="detectFuselageBarcode">
+        <input type="hidden" id="detectCustmoerQuestion" name="detectCustmoerQuestion">
+        <input type="hidden" id="transportSignCode" name="transport.transportSignCode">
     </form>
 </div>
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
 <script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
 <script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
 <script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
+<script type="text/javascript" src="${path}/common/js/common/address.js"></script>
+
 <script type="text/plain" id="upload_ue"></script>
 
 <script type="text/javascript">
     let _editor;
+    let _map = new Map();
+    let phon_map = new Map();
     $(function() {
-        procType();
+
+        /**
+         * 百度富文本编辑器的 tool
+         * 用于客诉的添加/修改 页面的配置
+         */
+        let tool = [
+            'anchor', //锚点
+            'undo', //撤销
+            'redo', //重做
+            'bold', //加粗
+            'indent', //首行缩进
+            'snapscreen', //截图
+            'italic', //斜体
+            'underline', //下划线
+            'strikethrough', //删除线
+            'subscript', //下标
+            'fontborder', //字符边框
+            'superscript', //上标
+            'formatmatch', //格式刷
+            // 'source', //源代码 --
+            'blockquote', //引用
+            'pasteplain', //纯文本粘贴模式
+            'selectall', //全选
+            'print', //打印
+            'preview', //预览
+            'horizontal', //分隔线
+            'removeformat', //清除格式
+            'time', //时间
+            'date', //日期
+            'unlink', //取消链接
+            'insertrow', //前插入行
+            'insertcol', //前插入列
+            'mergeright', //右合并单元格
+            'mergedown', //下合并单元格
+            'deleterow', //删除行
+            'deletecol', //删除列
+            'splittorows', //拆分成行
+            'splittocols', //拆分成列
+            'splittocells', //完全拆分单元格
+            'deletecaption', //删除表格标题
+            'inserttitle', //插入标题
+            'mergecells', //合并多个单元格
+            'deletetable', //删除表格
+            'cleardoc', //清空文档
+            'insertparagraphbeforetable', //"表格前插入行"
+            //'insertcode', //代码语言
+            'fontfamily', //字体
+            'fontsize', //字号
+            'paragraph', //段落格式
+            'simpleupload', //单图上传
+            'insertimage', //多图上传
+            'edittable', //表格属性
+            'edittd', //单元格属性
+            'link', //超链接
+            'emotion', //表情
+            'spechars', //特殊字符
+            'searchreplace', //查询替换
+            // 'map', //Baidu地图
+            // 'gmap', //Google地图
+            'insertvideo', //视频
+            'help', //帮助
+            'justifyleft', //居左对齐
+            'justifyright', //居右对齐
+            'justifycenter', //居中对齐
+            'justifyjustify', //两端对齐
+            'forecolor', //字体颜色
+            'backcolor', //背景色
+            'insertorderedlist', //有序列表
+            'insertunorderedlist', //无序列表
+            'fullscreen', //全屏
+            'directionalityltr', //从左向右输入
+            'directionalityrtl', //从右向左输入
+            'rowspacingtop', //段前距
+            'rowspacingbottom', //段后距
+            'pagebreak', //分页
+            'insertframe', //插入Iframe
+            'imagenone', //默认
+            'imageleft', //左浮动
+            'imageright', //右浮动
+            'attachment', //附件
+            'imagecenter', //居中
+            'wordimage', //图片转存
+            'lineheight', //行间距
+            'edittip ', //编辑提示
+            'customstyle', //自定义标题
+            'autotypeset', //自动排版
+            // 'webapp', //百度应用
+            'touppercase', //字母大写
+            'tolowercase', //字母小写
+            'background', //背景
+            'template', //模板
+            // 'scrawl', //涂鸦
+            'music', //音乐
+            'inserttable', //插入表格
+            'drafts', // 从草稿箱加载
+            'charts' // 图表
+        ];
+        /*处理描述*/
+        UE.getEditor('questionDescription', {
+            toolbars: [tool],
+            autoHeightEnabled: true,
+            autoFloatEnabled: true,
+            elementPathEnabled : false,  /*去掉元素路径*/
+            zIndex : 5
+        });
+        /** 初始化地址 */
+        let ulc = init_address($(".init_address"));
+        ulc.setUlcAllCallback(function (data) {
+            let obj = data[2];
+            if (obj.hasOwnProperty("postcode")) {
+                $("#transportSignCode").val(data[2].postcode);
+            }
+        });
+        /*procType();*/
         /* 初始化上传插件 */
         _editor = UE.getEditor('upload_ue',{
             initialFrameWidth : 375,
@@ -186,7 +396,7 @@
             getProduct($(this).children('option:selected').val())
         });
         /* 初始化问题大类*/
-        initComplaintTypeInfo();
+        /*initComplaintTypeInfo();*/
         /* 监听问题类型 选择事件 */
         $("[name='smallClassId']").change(function(){
             listQuestion();
@@ -196,10 +406,15 @@
             placeholder_text_single: '请选择', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
             width: '33%', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
         });
+        /** 检测问题现象的类型 */
+        $("#typeId").change(function() {
+           initPhenomenon();
+        });
         // 文本框失去焦点时校验
         $("#machineNo").blur(function() {
             getProductByMachineNo();
         });
+        initPhenomenon();
         let chosenData = {
             no_results_text: "没有找到结果!",//搜索无结果时显示的提示
             search_contains:true,   //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
@@ -222,8 +437,75 @@
             search_contains:false,
             enable_split_word_search: true //分词搜索,选项词可通过空格或'[]'分隔。search_contains为false时才能看出效果
         });
+        /** 问题现象改变时间 */
+        $("#phenomenonId").change(function () {
+           let id = $(this).val();
+           let details = _map.get(id);
+           if (!!details) {
+                $("#phenomenon_detail_pre").html(details).show();
+           } else {
+                $("#phenomenon_detail_pre").hide();
+           }
+        });
+        /** 添加问题现象 */
+        $("#add-phenomenon-btn").click(function() {
+            let id = $("#phenomenonId").val();
+            let temp = phon_map.get(id);
+            if (temp != null) {
+                return;
+            }
+            // 添加到div中
+            let name = $("#phenomenonId").find("option:selected").text();
+            $("#phenomenon-list-div").append(
+                '<span title="点击删除" onclick="del_phenomenon_span(this)" style="color:red;background-color: gainsboro;margin-right: 10px;padding: 7px;cursor: pointer;" pid="' + id + '">'+name+'</span>')
+
+            // 保存Map
+            phon_map.set(id, name);
+        });
     });
 
+    /** 删除选中的问题现象 */
+    function del_phenomenon_span(obj) {
+        let $span = $(obj);
+        let id = $span.attr("pid");
+        phon_map.delete(id);
+        $span.remove();
+    }
+
+    /** 加载问题现象 */
+    function initPhenomenon() {
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {"typeId":$("#typeId").val()},
+            url: "${path}/admin/afterSales/listPhenomenon",
+            async: false,
+            success: function(data){
+                if (data.returnCode === 200) {
+                    let list = data.returnMsg.list;
+                    let selectTarg = $("#phenomenonId");
+                    selectTarg.empty();
+                    for (let i = 0; i < list.length; i++) {
+                        let temp = list[i];
+                        selectTarg.append('<option value="'+ temp.phenomenonId +'">'+ temp.phenomenonName +'</option>');
+                        _map.set(temp.phenomenonId+"",temp.phenomenonDetails);
+                        if (i == 0) {
+                            if (!!temp.phenomenonDetails) {
+                                $("#phenomenon_detail_pre").html(temp.phenomenonDetails).show();
+                            } else {
+                                $("#phenomenon_detail_pre").hide();
+                            }
+                        }
+                    }
+                } else {
+                    layer.msg('问题现象加载失败,请重试,若多次重试无法加载,请联系业务员!',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+
     /** 设置产品 */
     function setProduct(data) {
         // 设置生产批次和生产日期
@@ -236,8 +518,133 @@
         $productId.empty();
         $productId.append("<option value='" + product.productId + "'>" + product.productName + "</option>");
         getProduct(product.productId);
+        // 设置售后方式(生产日期+仓储期+售后期)
+        let date = new Date(data.returnMsg.ctrDate);
+        let storeDate = parseInt($("#storeDate").val());
+        let mainmianDate = parseInt($("#mainmitaDate").val());
+        let exchangeDate = parseInt($("#exchangeDate").val());
+        // 判断是否存在仓储期
+        if (storeDate >= 1) {
+            date = dateAdd("M", storeDate, date);
+        }
+        // 清空处理方式
+        $("#handler-type-div").empty();
+        /**
+         * 判断是否支持维修
+         */
+        if (mainmianDate >= 1) {
+            // 支持维修
+            let mainDate = dateAdd("M", mainmianDate, date);
+            if (mainDate >= new Date()) {
+                // 售后期内
+                $("#handler-type-div").append(
+                    '<div class="radio-box">' +
+                        '<label for="detect_is_maintain_no_monye">' +
+                            '<input type="radio" id="detect_is_maintain_no_monye" name="detectIsMaintain" value="1" checked>待工厂检测维修' +
+                        '</label>' +
+                    '</div>');
+            } else {
+                // 售后期外
+                $("#handler-type-div").append(
+                        '<div class="radio-box">' +
+                        '<label for="detect_is_maintain_use_monye">' +
+                            '<input type="radio" id="detect_is_maintain_use_monye" name="detectIsMaintain" value="1" checked>付费维修' +
+                        '</label>' +
+                    '</div>');
+            }
+        } else {
+            // 付费维修
+            $("#handler-type-div").append(
+                    '<div class="radio-box">' +
+                    '<label for="detect_is_maintain_use_monye">' +
+                        '<input type="radio" id="detect_is_maintain_use_monye" name="detectIsMaintain" value="1" checked>付费维修' +
+                    '</label>' +
+                '</div>');
+        }
+        /**
+         * 判断是否支持换新
+         */
+        if (exchangeDate >= 1) {
+            // 支持翻新
+            let exchange = dateAdd("M", exchangeDate, date);
+            if (exchange >= new Date()) {
+                // 免费翻新
+                $("#handler-type-div").append(
+                        '<div class="radio-box">' +
+                        '<label for="detect_is_maintain_no_monye_exchange">' +
+                            '<input type="radio" id="detect_is_maintain_no_monye_exchange" name="detectIsMaintain" value="2" checked>待工厂检测换新' +
+                        '</label>' +
+                '</div>');
+            } else {
+                // 付费换新
+                $("#handler-type-div").append(
+                        '<div class="radio-box">' +
+                        '<label for="detect_is_maintain_use_monye_exchange">' +
+                            '<input type="radio" id="detect_is_maintain_use_monye_exchange" name="detectIsMaintain" value="2" checked>付费翻新' +
+                        '</label>' +
+                '</div>');
+            }
+        } else {
+            // 付费翻新
+            $("#handler-type-div").append(
+                    '<div class="radio-box">' +
+                    '<label for="detect_is_maintain_use_monye_exchange">' +
+                        '<input type="radio" id="detect_is_maintain_use_monye_exchange" name="detectIsMaintain" value="2" checked>付费翻新' +
+                    '</label>' +
+            '</div>');
+        }
     }
 
+    function dateAdd(interval, number, date) {
+        switch (interval) {
+            case "Y": {
+                // 加上年份
+                date.setFullYear(date.getFullYear() + number);
+                return date;
+            }
+            case "q": {
+                // 加上指定的N个季度
+                date.setMonth(date.getMonth() + number * 3);
+                return date;
+            }
+            case "M": {
+                // 加上指定月份
+                date.setMonth(date.getMonth() + number);
+                return date;
+            }
+            case "w": {
+                // 加上指定的N周
+                date.setDate(date.getDate() + number * 7);
+                return date;
+            }
+            case "d": {
+                // 加上指定的天数
+                date.setDate(date.getDate() + number);
+                return date;
+            }
+            case "H": {
+                // 加上指定的小时
+                date.setHours(date.getHours() + number);
+                return date;
+            }
+            case "m": {
+                // 加上指定的分钟
+                date.setMinutes(date.getMinutes() + number);
+                return date;
+            }
+            case "s": {
+                // 加上指定的秒数
+                date.setSeconds(date.getSeconds() + number);
+                return date;
+            }
+            default: {
+                date.setDate(d.getDate() + number);
+                return date;
+            }
+        }
+    }
+
+
     /** 根据产品编码查询机产品信息 */
     function getProductByMachineNo() {
         let no = $("#machineNo").val();
@@ -342,16 +749,18 @@
     }
     /** 添加事件 */
     function  add() {
-        let questionId = $("#questionId").val();
+        /*let questionId = $("#questionId").val();
         if( questionId == null || questionId === "" ){
             layer.msg('请选择客户问题',{icon: 5,time:1000});
             return;
-        }
+        }*/
+        $("#detectCustmoerQuestion").val($('#phenomenonId option:selected').text());
         let machineNo = $("#machineNo").val();
         if (machineNo == null || machineNo === "") {
             layer.msg('请填写或上传产品条码',{icon: 5,time:1000});
             return;
         }
+        $("#detectFuselageBarcode").val(machineNo);
         let productId = $("#productId").val();
         if (productId == null || productId === "") {
             layer.msg('产品信息不能为空',{icon: 5,time:1000});
@@ -377,15 +786,32 @@
             layer.msg('联系人电话或手机号码 不能为空',{icon: 5,time:1000});
             return;
         }
-        let procTypeId = $("#procTypeId").val();
-        if (procTypeId == null || procTypeId === "") {
-            layer.msg('处理方式不能为空',{icon: 5,time:1000});
+        // 初始化选中的问题现象
+        let $hide = $("#hide-input-div");
+        $hide.empty();
+        let $div = $("#phenomenon-list-div");
+        let $spans = $div.find("span");
+        if ($spans.length <= 0) {
+            layer.msg('未选择问题现象,问题现象选择后请点击“添加问题现象”按钮,至少选择一个',{icon: 5,time:1000});
             return;
         }
-        let procMethodId = $("#procTypeId").val();
-        if (procMethodId == null || procMethodId === "") {
-            layer.msg('处理方式不能为空',{icon: 5,time:1000});
-            return;
+        for (let i = 0; i < $spans.length; i++) {
+            let $t = $($spans[i]);
+            let id = $t.attr("pid");
+            let name = $t.text();
+            $hide.append('<input type="hidden" name="custmoerPhenomena[' + i + '].phenomenonId" value="' + id + '">');
+            $hide.append('<input type="hidden" name="custmoerPhenomena[' + i + '].dcpName" value="' + name + '">');
+        }
+        // 寄回给用户的信息
+        let provId = $("#initProvince").val();
+        if (provId != null && provId !== '') {
+            let prov = $("#initProvince").find("option:selected").text();
+            let city = $("#initCity").find("option:selected").text();
+            let area = $("#initCountry").find("option:selected").text();
+
+            $hide.append('<input type="hidden" name="transport.transportSignProv" value="' + prov + '">');
+            $hide.append('<input type="hidden" name="transport.transportSignCity" value="' + city + '">');
+            $hide.append('<input type="hidden" name="transport.transportSignArea" value="' + area + '">');
         }
 
         $.ajax({

+ 161 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/yulia/edit_transport.ftl

@@ -0,0 +1,161 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+    <#include "/base/add_base.ftl">
+    <!-- 新增需求引入js、css -->
+    <link href="${path}/common/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
+    <title>编辑运输信息</title>
+    <style>
+        .input-text{
+            height: 31px;
+        }
+        .form-label {
+            padding-left: 0;
+            margin-left: 0px;
+            width: 17%;
+        }
+        .formControls{
+            padding-top: 3px;
+        }
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+
+    </style>
+</head>
+<body>
+<div class="pd-20">
+    <form class="form form-horizontal" id="form-admin-add">
+        <input type="hidden" name="transportId" value="${(obj.transport.transportId)!}">
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 16%;"><h5 style="font-weight: bold;">寄回工厂信息</h5></label>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red"></span>物流信息:</label>
+            <div class="formControls col-9 col-sm-9">
+                <input style="height: 31px;width: 50%" class="input-text" value="${(obj.transport.transportSendFirm)!}" type="text" name="transportSendFirm" id="transportSendFirm" placeholder="物流公司"/>
+                <input style="height: 31px;width: 49%" class="input-text" value="${(obj.transport.transportSendPost)!}" type="text" name="transportSendPost" id="transportSendPost" placeholder="物流单号"/>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-3" style="padding-left: 0;margin-left: 0px;width: 16%;"><h5 style="font-weight: bold;">寄送客户信息</h5></label>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red"></span>客户信息:</label>
+            <div class="formControls col-9 col-sm-9">
+                <input style="height: 31px;width: 50%" class="input-text" type="text" value="${(obj.transport.transportSignName)!}" name="transportSignName" id="transportSignName" placeholder="请输入客户姓名或昵称"/>
+                <input style="height: 31px;width: 49%" class="input-text" type="text" value="${(obj.transport.transportSignTel)!}" name="transportSignTel" id="transportSignTel" placeholder="请输入客户电话或手机号码"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3"><span class="c-red"></span>地址信息:</label>
+            <div class="formControls col-9 col-sm-9 init_address" id="TDScollect" code="returnCode" msg="resultMsg" data="returnMsg" urlPrefix="${path}">
+                <select style="width: 30%"
+                        ulcName="${(obj.transport.transportSignProv)!}"
+                        name="provinceId"
+                        class="select ulc_select"
+                        id="initProvince"
+                        ulcValName="province"
+                        ulcValId="provinceId"
+                        ulcURL="/address/list_province"
+                        ulcMsg="" ulcList="provinceList"
+                        ulcIsFristSelect="1"
+                        ulcFristSelectMsg="请选择省份">
+                </select>
+                <select style="width: 30%" ulcName="${(obj.transport.transportSignCity)!}" name="cityId" class="select ulc_select" id="initCity"
+                        ulcValName="city" ulcValId="cityId"  ulcURL="/address/list_city?provinceId=" ulcMsg="" ulcList="cityList"
+                        ulcIsFristSelect="1" ulcFristSelectMsg="请选择市">
+                </select>
+                <select style="width: 30%" ulcName="${(obj.transport.transportSignArea)!}" name="districtId" class="select ulc_select" id="initCountry"
+                        ulcValName="district" ulcValId="districtId"  ulcURL="/address/list_district?cityId=" ulcMsg="" ulcList="districtList"
+                        ulcIsFristSelect="1" ulcFristSelectMsg="请选择区/县">
+                </select>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-3 col-sm-3">详细地址:</label>
+            <div class="formControls col-xs-9 col-sm-9">
+                <textarea style="width: 98%" rows="3" cols="20" name="transportSignAddr" id="transportSignAddr" class="my-textarea" placeholder="详细地址">${(obj.transport.transportSignAddr)!}</textarea>
+            </div>
+        </div>
+
+        <div class="row cl">
+            <div class="form-label" style="margin-left: 7%;">
+                <button type="button" class="btn btn-primary radius" onclick="add();">确认提交</button>
+            </div>
+        </div>
+
+        <div style="display: none" id="hide-input-div">
+
+        </div>
+        <input type="hidden" id="transportSignCode" name="transportSignCode">
+
+    </form>
+</div>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
+<script type="text/javascript" src="${path}/common/js/common/address.js"></script>
+
+<script type="text/javascript">
+    $(function() {
+
+        /** 初始化地址 */
+        let ulc = init_address($(".init_address"));
+        ulc.setUlcAllCallback(function (data) {
+            try {
+                let obj = data[2];
+                if (obj.hasOwnProperty("postcode")) {
+                    $("#transportSignCode").val(data[2].postcode);
+                }
+            } catch (e) {
+                
+            }
+        });
+    });
+
+    /** 添加事件 */
+    function  add() {
+        let $hide = $("#hide-input-div");
+        // 寄回给用户的信息
+        let provId = $("#initProvince").val();
+        if (provId != null && provId !== '') {
+            let prov = $("#initProvince").find("option:selected").text();
+            let city = $("#initCity").find("option:selected").text();
+            let area = $("#initCountry").find("option:selected").text();
+
+            $hide.append('<input type="hidden" name="transportSignProv" value="' + prov + '">');
+            $hide.append('<input type="hidden" name="transportSignCity" value="' + city + '">');
+            $hide.append('<input type="hidden" name="transportSignArea" value="' + area + '">');
+        }
+
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/afterSales/editTransport",
+            data:$('#form-admin-add').serialize(),
+            async: false,
+            success: function(data){
+                if (data.returnCode === 200) {
+                    layer.msg('修改成功',{icon: 1,time:1000},function () {
+                        parent.layer.close(parent.layer.getFrameIndex(window.name));
+                    });
+                } else {
+                    layer.msg('修改失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('修改错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 54 - 27
watero-rst-web/src/main/webapp/WEB-INF/views/yulia/list.ftl

@@ -25,16 +25,15 @@
                 <option <#if (req.detectState)??><#if req.detectState == 31>selected="selected"</#if></#if> value="31">${(util.detectState(31))}</option>
                 <option <#if (req.detectState)??><#if req.detectState == 32>selected="selected"</#if></#if> value="32">${(util.detectState(32))}</option>
                 <option <#if (req.detectState)??><#if req.detectState == 33>selected="selected"</#if></#if> value="33">${(util.detectState(33))}</option>
-                <option <#if (req.detectState)??><#if req.detectState == 34>selected="selected"</#if></#if> value="34">${(util.detectState(34))}</option>
-                <option <#if (req.detectState)??><#if req.detectState == 35>selected="selected"</#if></#if> value="35">${(util.detectState(35))}</option>
-                <option <#if (req.detectState)??><#if req.detectState == 36>selected="selected"</#if></#if> value="36">${(util.detectState(36))}</option>
-                <option <#if (req.detectState)??><#if req.detectState == 37>selected="selected"</#if></#if> value="37">${(util.detectState(37))}</option>
-                <option <#if (req.detectState)??><#if req.detectState == 38>selected="selected"</#if></#if> value="38">${(util.detectState(38))}</option>
-                <option <#if (req.detectState)??><#if req.detectState == 20>selected="selected"</#if></#if> value="20">${(util.detectState(20))}</option>
+                <option <#if (req.detectState)??><#if req.detectState == 20>selected="selected"</#if></#if> value="20">售后期内,免费换新</option>
                 <option <#if (req.detectState)??><#if req.detectState == 21>selected="selected"</#if></#if> value="21">${(util.detectState(21))}</option>
-                <option <#if (req.detectState)??><#if req.detectState == 22>selected="selected"</#if></#if> value="22">${(util.detectState(22))}</option>
+                <option <#if (req.detectState)??><#if req.detectState == 22>selected="selected"</#if></#if> value="22">售后期内,免费换新</option>
                 <option <#if (req.detectState)??><#if req.detectState == 23>selected="selected"</#if></#if> value="23">${(util.detectState(23))}</option>
                 <option <#if (req.detectState)??><#if req.detectState == 40>selected="selected"</#if></#if> value="40">${(util.detectState(40))}</option>
+                <option <#if (req.detectState)??><#if req.detectState == 24>selected="selected"</#if></#if> value="40">${(util.detectState(24))}</option>
+                <option <#if (req.detectState)??><#if req.detectState == 25>selected="selected"</#if></#if> value="40">${(util.detectState(25))}</option>
+                <option <#if (req.detectState)??><#if req.detectState == 26>selected="selected"</#if></#if> value="40">${(util.detectState(26))}</option>
+                <option <#if (req.detectState)??><#if req.detectState == 27>selected="selected"</#if></#if> value="40">${(util.detectState(27))}</option>
             </select>
             <select class="select" name="storeId" id="storeId" style="height: 31px;width:8%">
                 <option value="">店铺信息</option>
@@ -44,10 +43,13 @@
             </select>
             <input type="text" class="input-text" style="width:8%;margin-top: -3px;" value="${(req.machineNo)!}" placeholder="机器条码" id="machineNo" name="machineNo">
             <input type="text" class="input-text" style="width:8%;margin-top: -3px;" value="${(req.productName)!}" placeholder="产品名称" id="productName" name="productName">
-            <input type="text" class="input-text" style="width:11%;margin-top: -3px;" value="${(req.detectName)!}" placeholder="客户姓名/昵称" id="detectName" name="detectName">
-            <input type="text" class="input-text" style="width:11%;margin-top: -3px;" value="${(req.detectTel)!}" placeholder="客户电话/手机" id="detectTel" name="detectTel">
+            <input type="text" class="input-text" style="width:8%;margin-top: -3px;" value="${(req.detectName)!}" placeholder="客户姓名/昵称" id="detectName" name="detectName">
+            <input type="text" class="input-text" style="width:8%;margin-top: -3px;" value="${(req.detectTel)!}" placeholder="客户电话/手机" id="detectTel" name="detectTel">
             <input type="text" class="input-text" style="width:8%;margin-top: -3px;" value="${(req.methodName)!}" placeholder="处理方式" id="methodName" name="methodName">
-            <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索 </button>
+            <input type="text" class="input-text" style="width:8%;margin-top: -3px;" name="startTime" id="startTime"  placeholder="录入开始时间" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',skin:'whyGreen' })" value="${(req.startTime)!''}" readonly="readonly"/>
+            <input type="text" class="input-text" style="width:8%;margin-top: -3px;" name="endTime" id="endTime"  placeholder="录入结束时间" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',skin:'whyGreen' })" value="${(req.endTime)!''}" readonly="readonly"/>
+            <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);"><i class="Hui-iconfont">&#xe665;</i> 搜索 </button>
+            <button type="button" onclick="downLoadExcel()" class="btn" style="width:8%;margin-top: -3px;"><i class="Hui-iconfont">&#xe640;</i> 下载 </button>
         </form>
     </div>
      <table class="table table-border table-bordered table-hover" style="margin-top: 20px">
@@ -56,46 +58,59 @@
             <th width="20">维修状态<i class="Hui-iconfont" style="cursor: pointer;color: blue;" title="点击查看状态说明" onclick="state_details()">&#xe633;</i></th>
             <th width="20">维修编号<i class="Hui-iconfont" style="cursor: pointer;color: blue;" title="此为维修部的唯一编号,后期可通过此编号沟通具体事项">&#xe633;</i></th>
             <th width="40">产品信息</th>
-            <th width="50">客户姓名/昵称</th>
-            <th width="50">客户电话/手机</th>
+            <th width="50">客户姓名/客户电话</th>
+            <th width="50">寄回物流</th>
             <th width="50">客户反馈问题</th>
             <th width="40">处理方式</th>
             <th width="45">机器条码</th>
+            <th width="45">报价</th>
+            <th width="45">寄送物流</th>
             <th width="20">录入时间</th>
             <th width="40">操作</th>
         </tr>
         </thead>
         <tbody>
         <#if (page.dataList?size <= 0)>
-            <tr class="text-c"><td colspan="10">暂无数据</td></tr>
+            <tr class="text-c"><td colspan="12">暂无数据</td></tr>
         <#else>
             <#list page.dataList as o>
             <tr class="text-c">
                 <td>
-                    ${(util.detectState(o.detectState))}
-                    <#if o.detectState == 1>
-                        <br>
-                        <span class="c-red"><#if o.maintenanceCutTime??>(${o.maintenanceCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
-                    </#if>
-                    <#if o.detectState == 31 || o.detectState == 35>
-                        <br>
-                        <span class="c-red"><#if o.completeCutTime??>(${o.completeCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
+                    <#if o.detectState == 20 || o.detectState == 24>
+                        售后期内,免费换新
+                    <#else>
+                        ${(util.detectState(o.detectState))}
+                        <#if o.detectState == 1>
+                            <br><span class="c-red"><#if o.maintenanceCutTime??>(${o.maintenanceCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
+                        </#if>
+                        <#if o.detectState == 31 || o.detectState == 35>
+                            <br><span class="c-red"><#if o.completeCutTime??>(${o.completeCutTime?string("yyyy/MM/dd")}前完成)</#if></span>
+                        </#if>
                     </#if>
+
+
                 </td>
                 <td>${(o.detectNumber)!}</td>
                 <td>${(o.productName)!}(${(o.colorName)!})</td>
-                <td>${(o.detectName)!}</td>
-                <td>${(o.detectTel)!}</td>
-                <td>${(o.questionTitle)!}</td>
-                <td>${(o.methodName)!}</td>
+                <td>${(o.detectName)!}/${(o.detectTel)!}</td>
+                <td>
+                    ${(o.transport.transportSendFirm)!}/${(o.transport.transportSendPost)!}
+                </td>
+                <td>${(o.detectCustmoerQuestion)!}</td>
+                <td>${((o.detectIsMaintain==1)?string("待工厂检测维修","待工厂检测翻新"))!}</td>
                 <td>${(o.machineNo)!}</td>
+                <td>${((o.detectOffer/100)?string.currency)!}</td>
+                <td>${(o.transport.transportSignFirm)!}/${(o.transport.transportSignPost)!}</td>
                 <td>${(o.detectCreateTime?string("yyyy-MM-dd HH:mm:ss"))!}</td>
                 <td class="td-manage">
-                    <#if o.detectState == 30 || o.detectState == 34|| o.detectState == 38>
-                        <a style="text-decoration:none" href="javascript:;" title="确认处理" onclick="layer_show('确认处理','${path}/detect/to_detect_msg?detectId=${o.detectId!''}','570','750');">
+                    <#if o.detectState == 30 || o.detectState == 34 || o.detectState == 38 || o.detectState == 24>
+                        <a style="text-decoration:none" href="javascript:;" title="确认处理" onclick="layer_show('确认处理','${path}/detect/to_detect_msg?detectId=${o.detectId!''}','600','680');">
                             <i class="Hui-iconfont">&#xe6e1;</i>
                         </a>
                     </#if>
+                    <#if !((o.transport.transportSignFirm)??)>
+                        <a title="编辑运输信息" href="javascript:layer_show('编辑运输信息','${path}/admin/afterSales/editTransportUI?id=${o.detectId}','800','600');" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe669;</i></a>
+                    </#if>
                     <a title="查看详情" href="javascript:layer_show('维修详情','${path}/admin/detect/to_detail?detectId=${o.detectId}','800','600');" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe695;</i></a>
                     <#if (o.detectState == 0)>
                         <a title="删除" href="javascript:del_detect(${(o.detectId)!})" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe609;</i></a>
@@ -112,6 +127,18 @@
 </body>
 <script type="text/javascript" src="${path}/common/lib/lightbox2/2.8.1/js/lightbox.min.js"></script>
 <script type="text/javascript">
+    /** 下载Excel */
+    function downLoadExcel() {
+        layer.confirm('是否确认开始下载?',function(index){
+            let $form = $("#search-form");
+            let uri = $form.attr("action");
+            $form.attr("action", root_path + "/admin/afterSales/downloadAfterSales");
+            $form.submit();
+            $form.attr("action", uri);
+            layer.close(index);
+        });
+    }
+
     function state_details() {
         layer.open({
             type: 1,

文件差異過大導致無法顯示
+ 88 - 67
watero-rst-web/src/test/java/junit/com/iamberry/rst/Test.java