Bläddra i källkod

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

wangxiaoming 7 år sedan
förälder
incheckning
ff0fd257cf
40 ändrade filer med 1811 tillägg och 177 borttagningar
  1. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/BackGoods.java
  2. 9 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintDetectInfo.java
  3. 86 5
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintMaintenanceInfo.java
  4. 18 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintQuestionInfo.java
  5. 25 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerCommon.java
  6. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/NoreasonBack.java
  7. 5 5
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Renewed.java
  8. 5 5
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Repair.java
  9. 9 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/SalesOrderItem.java
  10. 38 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/EfastOrder.java
  11. 48 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/EfastOrderItem.java
  12. 16 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/order/EfastOrderService.java
  13. 1 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintDetectInfoServiceImpl.java
  14. 42 15
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java
  15. 5 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/backGoodsMapper.xml
  16. 9 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintDetectInfoMapper.xml
  17. 96 32
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintMaintenanceInfoMapper.xml
  18. 3 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/fittingsInfoMapper.xml
  19. 5 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/noreasonBackMapper.xml
  20. 2 2
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/reissueMapper.xml
  21. 2 2
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/renewedMapper.xml
  22. 2 2
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/repairMapper.xml
  23. 3 2
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml
  24. 79 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/order/EfastOrderServiceImpl.java
  25. 9 9
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml
  26. 27 23
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml
  27. 23 4
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
  28. 8 5
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java
  29. 187 4
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintMaintenanceController.java
  30. 22 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintQuestionInfoController.java
  31. 3 3
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/mq/MQTask.java
  32. 149 3
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_detail.ftl
  33. 44 34
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_list.ftl
  34. 21 13
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/add_detect.ftl
  35. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl
  36. 160 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/add_maintenance.ftl
  37. 146 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/complete_reorder.ftl
  38. 186 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/maintenance_list.ftl
  39. 136 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/perfecting_machine.ftl
  40. 161 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/update_maintenance.ftl

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

@@ -48,10 +48,20 @@ public class BackGoods  implements Serializable {
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
     private Date salesPayTime;                  //支付时间
 
+    private Integer detectState;                //品质检测状态
+
     private List<ClosedFitting> closedFittings = new ArrayList<ClosedFitting>();//寄回配件集合
 
     private List<ClosedProdcue> closedProdcues = new ArrayList<ClosedProdcue>();//机会产品集合
 
+    public Integer getDetectState() {
+        return detectState;
+    }
+
+    public void setDetectState(Integer detectState) {
+        this.detectState = detectState;
+    }
+
     public Date getSalesPayTime() {
         return salesPayTime;
     }

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintDetectInfo.java

@@ -33,6 +33,7 @@ public class ComplaintDetectInfo implements Serializable {
     private Date signclosedCreateTime;//创建时间
     private Date signclosedUpdateTime;//修改时间
     private String machineNo;//机器编号
+    private Integer productColorId;//产品颜色id
 
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
@@ -227,4 +228,12 @@ public class ComplaintDetectInfo implements Serializable {
     public void setMaintenanceResults(Integer maintenanceResults) {
         this.maintenanceResults = maintenanceResults;
     }
+
+    public Integer getProductColorId() {
+        return productColorId;
+    }
+
+    public void setProductColorId(Integer productColorId) {
+        this.productColorId = productColorId;
+    }
 }

+ 86 - 5
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintMaintenanceInfo.java

@@ -28,7 +28,7 @@ public class ComplaintMaintenanceInfo  implements Serializable {
 
     private Integer maintenanceCustomerId;//客诉id
 
-    private Integer maintenanceIdRepair;//是否可返修
+    private Integer maintenanceIsRepair;//是否可返修
 
     private Date maintenanceContentDate;//返修日期
 
@@ -36,6 +36,23 @@ public class ComplaintMaintenanceInfo  implements Serializable {
 
     private Date maintenanceUpdateTime;//修改时间
 
+    private Integer maintenanceIsWarehousing;// 是否入库1待入库2已入库3无法入库
+
+    private String maintenanceDesc;//备注
+
+    private Integer productColorId;//产品颜色id
+
+    private Integer productType;    //1.净水机 2.配件
+
+    private Integer maintenanceResults;//QC检测结果 1.通过 2不通过
+
+
+    private String detectDesc;//品质备注
+
+    private Integer equipmentNumber;//维修次数
+
+    private String customerIdDescribe;//客诉描述
+
     public Integer getMaintenanceId() {
         return maintenanceId;
     }
@@ -100,12 +117,12 @@ public class ComplaintMaintenanceInfo  implements Serializable {
         this.maintenanceCustomerId = maintenanceCustomerId;
     }
 
-    public Integer getMaintenanceIdRepair() {
-        return maintenanceIdRepair;
+    public Integer getMaintenanceIsRepair() {
+        return maintenanceIsRepair;
     }
 
-    public void setMaintenanceIdRepair(Integer maintenanceIdRepair) {
-        this.maintenanceIdRepair = maintenanceIdRepair;
+    public void setMaintenanceIsRepair(Integer maintenanceIsRepair) {
+        this.maintenanceIsRepair = maintenanceIsRepair;
     }
 
     public Date getMaintenanceContentDate() {
@@ -131,4 +148,68 @@ public class ComplaintMaintenanceInfo  implements Serializable {
     public void setMaintenanceUpdateTime(Date maintenanceUpdateTime) {
         this.maintenanceUpdateTime = maintenanceUpdateTime;
     }
+
+    public Integer getProductType() {
+        return productType;
+    }
+
+    public void setProductType(Integer productType) {
+        this.productType = productType;
+    }
+
+    public Integer getMaintenanceResults() {
+        return maintenanceResults;
+    }
+
+    public void setMaintenanceResults(Integer maintenanceResults) {
+        this.maintenanceResults = maintenanceResults;
+    }
+
+    public Integer getMaintenanceIsWarehousing() {
+        return maintenanceIsWarehousing;
+    }
+
+    public void setMaintenanceIsWarehousing(Integer maintenanceIsWarehousing) {
+        this.maintenanceIsWarehousing = maintenanceIsWarehousing;
+    }
+
+    public String getDetectDesc() {
+        return detectDesc;
+    }
+
+    public void setDetectDesc(String detectDesc) {
+        this.detectDesc = detectDesc;
+    }
+
+    public Integer getEquipmentNumber() {
+        return equipmentNumber;
+    }
+
+    public void setEquipmentNumber(Integer equipmentNumber) {
+        this.equipmentNumber = equipmentNumber;
+    }
+
+    public String getCustomerIdDescribe() {
+        return customerIdDescribe;
+    }
+
+    public void setCustomerIdDescribe(String customerIdDescribe) {
+        this.customerIdDescribe = customerIdDescribe;
+    }
+
+    public String getMaintenanceDesc() {
+        return maintenanceDesc;
+    }
+
+    public void setMaintenanceDesc(String maintenanceDesc) {
+        this.maintenanceDesc = maintenanceDesc;
+    }
+
+    public Integer getProductColorId() {
+        return productColorId;
+    }
+
+    public void setProductColorId(Integer productColorId) {
+        this.productColorId = productColorId;
+    }
 }

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

@@ -20,6 +20,8 @@ public class ComplaintQuestionInfo implements Serializable {
     private Integer questionIsQcDetect; //是否需要QC检测0 .不需要;1 需要
     private Date questionCreateTime; //创建时间
     private Date questionUpdateTime; //修改时间
+    private Integer questionResolvedNum;//已解决总数
+    private Integer questionNotSolvedNum;//未解决总数
 
     public Integer getQuestionId() {
         return questionId;
@@ -84,4 +86,20 @@ public class ComplaintQuestionInfo implements Serializable {
     public void setQuestionUpdateTime(Date questionUpdateTime) {
         this.questionUpdateTime = questionUpdateTime;
     }
+
+    public Integer getQuestionResolvedNum() {
+        return questionResolvedNum;
+    }
+
+    public void setQuestionResolvedNum(Integer questionResolvedNum) {
+        this.questionResolvedNum = questionResolvedNum;
+    }
+
+    public Integer getQuestionNotSolvedNum() {
+        return questionNotSolvedNum;
+    }
+
+    public void setQuestionNotSolvedNum(Integer questionNotSolvedNum) {
+        this.questionNotSolvedNum = questionNotSolvedNum;
+    }
 }

+ 25 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerCommon.java

@@ -75,6 +75,26 @@ public class CustomerCommon implements Serializable {
     private List<ClosedProdcue> closedProdcues = new ArrayList<ClosedProdcue>();
     //售后寄回产品配件表
     private List<ClosedFitting> closedFittings = new ArrayList<ClosedFitting>();
+    //是否可返修
+    private Integer maintenanceIsRepair;
+    //品质检测状态
+    private Integer detectState;
+
+    public Integer getDetectState() {
+        return detectState;
+    }
+
+    public void setDetectState(Integer detectState) {
+        this.detectState = detectState;
+    }
+
+    public Integer getMaintenanceIsRepair() {
+        return maintenanceIsRepair;
+    }
+
+    public void setMaintenanceIsRepair(Integer maintenanceIsRepair) {
+        this.maintenanceIsRepair = maintenanceIsRepair;
+    }
 
     public List<SendProdcue> getSendProdcues() {
         return sendProdcues;
@@ -511,6 +531,7 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationIsTransfer(renewed.getRenewedIsTransfer());
                 customerCommon.setRelationCreateTime(renewed.getRenewedCreateTime());
                 customerCommon.setRelationUpdateTime(renewed.getRenewedUpdateTime());
+                customerCommon.setMaintenanceIsRepair(renewed.getMaintenanceIsRepair());
                 break;
             case 4://维修
                 Repair repair = (Repair)object;
@@ -542,6 +563,8 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationIsTransfer(repair.getRepairIsTransfer());
                 customerCommon.setRelationCreateTime(repair.getRepairCreateTime());
                 customerCommon.setRelationUpdateTime(repair.getRepairUpdateTime());
+                customerCommon.setMaintenanceIsRepair(repair.getMaintenanceIsRepair());
+                customerCommon.setDetectState(repair.getDetectState());
                 break;
             case 5://补发
                 Reissue reissue = (Reissue)object;
@@ -583,6 +606,7 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationIsTransfer(backGoods.getBackGoodsIsTransfer());
                 customerCommon.setRelationCreateTime(backGoods.getBackGoodsCreateTime());
                 customerCommon.setRelationUpdateTime(backGoods.getBackGoodsUpdateTime());
+                customerCommon.setDetectState(backGoods.getDetectState());
                 break;
             case 7://无理由退货
                 NoreasonBack noreasonBack = (NoreasonBack)object;
@@ -603,6 +627,7 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationIsTransfer(noreasonBack.getNoreasonBackIsTransfer());
                 customerCommon.setRelationCreateTime(noreasonBack.getNoreasonBackCreateTime());
                 customerCommon.setRelationUpdateTime(noreasonBack.getNoreasonBackUpdateTime());
+                customerCommon.setDetectState(noreasonBack.getDetectState());
                 break;
                 default:
                     customerCommon = null;

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

@@ -48,10 +48,20 @@ public class NoreasonBack  implements Serializable {
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
     private Date salesPayTime;                  //支付时间
 
+    private Integer detectState;                //品质检测状态
+
     private List<ClosedFitting> closedFittings = new ArrayList<ClosedFitting>();//寄回配件集合
 
     private List<ClosedProdcue> closedProdcues = new ArrayList<ClosedProdcue>();//机会产品集合
 
+    public Integer getDetectState() {
+        return detectState;
+    }
+
+    public void setDetectState(Integer detectState) {
+        this.detectState = detectState;
+    }
+
     public Date getSalesPayTime() {
         return salesPayTime;
     }

+ 5 - 5
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Renewed.java

@@ -79,7 +79,7 @@ public class Renewed  implements Serializable {
     private String detectPoint;                 //故障指向
     private String detectAnalysis;              //原因分析
     private Integer detectRevolutionProduced;   //是否转入生产部门
-    private Integer maintenanceIdRepair;        //是否可返修
+    private Integer maintenanceIsRepair;        //是否可返修
     private String maintenanceContent;          //返修内容
     private Date maintenanceContentDate;        //返修日期
     private Integer closedProdcueNumber;        //寄回产品数量
@@ -196,12 +196,12 @@ public class Renewed  implements Serializable {
         this.detectRevolutionProduced = detectRevolutionProduced;
     }
 
-    public Integer getMaintenanceIdRepair() {
-        return maintenanceIdRepair;
+    public Integer getMaintenanceIsRepair() {
+        return maintenanceIsRepair;
     }
 
-    public void setMaintenanceIdRepair(Integer maintenanceIdRepair) {
-        this.maintenanceIdRepair = maintenanceIdRepair;
+    public void setMaintenanceIsRepair(Integer maintenanceIsRepair) {
+        this.maintenanceIsRepair = maintenanceIsRepair;
     }
 
     public String getMaintenanceContent() {

+ 5 - 5
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Repair.java

@@ -79,7 +79,7 @@ public class Repair implements Serializable {
     private String detectPoint;                 //故障指向
     private String detectAnalysis;              //原因分析
     private Integer detectRevolutionProduced;   //是否转入生产部门
-    private Integer maintenanceIdRepair;        //是否可返修
+    private Integer maintenanceIsRepair;        //是否可返修
     private String maintenanceContent;          //返修内容
     private Date maintenanceContentDate;        //返修日期
     private Integer closedProdcueNumber;        //寄回产品数量
@@ -172,12 +172,12 @@ public class Repair implements Serializable {
         this.detectRevolutionProduced = detectRevolutionProduced;
     }
 
-    public Integer getMaintenanceIdRepair() {
-        return maintenanceIdRepair;
+    public Integer getMaintenanceIsRepair() {
+        return maintenanceIsRepair;
     }
 
-    public void setMaintenanceIdRepair(Integer maintenanceIdRepair) {
-        this.maintenanceIdRepair = maintenanceIdRepair;
+    public void setMaintenanceIsRepair(Integer maintenanceIsRepair) {
+        this.maintenanceIsRepair = maintenanceIsRepair;
     }
 
     public String getMaintenanceContent() {

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/SalesOrderItem.java

@@ -22,6 +22,15 @@ public class SalesOrderItem implements Serializable {
     private Integer itemProductPrice;   //产品市场价
     private Integer itemProductDiscount;//产品折扣价
     private Date itemCreateTime;        //创建时间
+    private Integer itemIsSource;       //产品来源 1:产品颜色表,2:配件表
+
+    public Integer getItemIsSource() {
+        return itemIsSource;
+    }
+
+    public void setItemIsSource(Integer itemIsSource) {
+        this.itemIsSource = itemIsSource;
+    }
 
     public Integer getItemId() {
         return itemId;

+ 38 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/EfastOrder.java

@@ -5,6 +5,7 @@ package com.iamberry.rst.core.order;
  */
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * Created by ${muzx} on 2017/5/26.
@@ -38,10 +39,47 @@ public class EfastOrder implements Serializable{
     private String orderPostType;                //送货方式
     private String orderStoreId;                 //仓库id
 
+    private String orderPostNum;                //快递单号
+    private String orderPostFirm;               //快递公司
+    private String orderDealCode;               //交易号
+    private List<EfastOrderItem> itemList;      //订单项集合
+
     // 推送状态
     private String returnStatus;
     private String returnMsg;
 
+    public List<EfastOrderItem> getItemList() {
+        return itemList;
+    }
+
+    public void setItemList(List<EfastOrderItem> itemList) {
+        this.itemList = itemList;
+    }
+
+    public String getOrderPostNum() {
+        return orderPostNum;
+    }
+
+    public void setOrderPostNum(String orderPostNum) {
+        this.orderPostNum = orderPostNum;
+    }
+
+    public String getOrderPostFirm() {
+        return orderPostFirm;
+    }
+
+    public void setOrderPostFirm(String orderPostFirm) {
+        this.orderPostFirm = orderPostFirm;
+    }
+
+    public String getOrderDealCode() {
+        return orderDealCode;
+    }
+
+    public void setOrderDealCode(String orderDealCode) {
+        this.orderDealCode = orderDealCode;
+    }
+
     public String getReturnStatus() {
         return returnStatus;
     }

+ 48 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/EfastOrderItem.java

@@ -0,0 +1,48 @@
+package com.iamberry.rst.core.order;
+
+import java.io.Serializable;
+
+/**
+ * efast订单项信息
+ * Created by liuzhiwei on 2017/11/17.
+ */
+public class EfastOrderItem implements Serializable {
+
+    private static final long serialVersionUID = -6322782896641717243L;
+    private Integer itemId;         //id
+    private String itemColorBar;    //产品69码
+    private Integer itemNum;         //产品数量
+    private Integer itemDiscount;   //产品金额
+
+    public Integer getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(Integer itemId) {
+        this.itemId = itemId;
+    }
+
+    public String getItemColorBar() {
+        return itemColorBar;
+    }
+
+    public void setItemColorBar(String itemColorBar) {
+        this.itemColorBar = itemColorBar;
+    }
+
+    public Integer getItemNum() {
+        return itemNum;
+    }
+
+    public void setItemNum(Integer itemNum) {
+        this.itemNum = itemNum;
+    }
+
+    public Integer getItemDiscount() {
+        return itemDiscount;
+    }
+
+    public void setItemDiscount(Integer itemDiscount) {
+        this.itemDiscount = itemDiscount;
+    }
+}

+ 16 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/order/EfastOrderService.java

@@ -78,4 +78,20 @@ public interface EfastOrderService {
      * @throws Exception
      */
     JSONObject listReturnOrderFormEfast(int pageNo,int pageSize, String date) throws Exception;
+
+    /**
+     * 百胜订单退货
+     * @param efastOrder
+     * @return
+     * @throws Exception
+     */
+    JSONObject returnOrderFormEfast(EfastOrder efastOrder) throws Exception;
+
+    /**
+     * 百胜退单收货
+     * @param efastOrder
+     * @return
+     * @throws Exception
+     */
+    JSONObject receiveOrderFormEfast(EfastOrder efastOrder) throws Exception;
 }

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

@@ -54,7 +54,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                 complaintMaintenanceInfo.setMaintenanceState(1);//默认待维修更换
                 complaintMaintenanceInfo.setMaintenanceAnalysis(record.getDetectAnalysis());
                 complaintMaintenanceInfo.setMaintenanceCustomerId(detectInfo.getCustomerId() == null ? null:detectInfo.getCustomerId());
-                complaintMaintenanceInfo.setMaintenanceIdRepair(1);//默认未评估
+                complaintMaintenanceInfo.setMaintenanceIsRepair(1);//默认未评估
                 complaintMaintenanceInfo.setMaintenanceContentDate(new Date());
                 complaintMaintenanceInfo.setMaintenanceCreateTime(new Date());
                 complaintMaintenanceInfoMapper.insert(complaintMaintenanceInfo);

+ 42 - 15
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -1,5 +1,6 @@
 package com.iamberry.rst.service.cm;
 
+import com.iamberry.rst.core.cm.FittingsInfo;
 import com.iamberry.rst.core.cm.SalesOrder;
 import com.iamberry.rst.core.cm.SalesOrderItem;
 import com.iamberry.rst.core.cm.StoreInfo;
@@ -8,6 +9,7 @@ import com.iamberry.rst.faces.cm.SalesOrderService;
 import com.iamberry.rst.faces.cm.StoreInfoService;
 import com.iamberry.rst.faces.order.EfastOrderService;
 import com.iamberry.rst.faces.product.ProductService;
+import com.iamberry.rst.service.cm.mapper.FittingsInfoMapper;
 import com.iamberry.rst.service.cm.mapper.SalesOrderMapper;
 import com.iamberry.wechat.tools.DateTimeUtil;
 import net.sf.json.JSONArray;
@@ -36,6 +38,8 @@ public class SalesOrderServiceImpl implements SalesOrderService {
     private EfastOrderService efastOrderService;
     @Autowired
     private SalesOrderService salesOrderService;
+    @Autowired
+    private FittingsInfoMapper fittingsInfoMapper;
 
     @Override
     public Integer addSalesOrder(SalesOrder salesOrder) {
@@ -245,22 +249,45 @@ public class SalesOrderServiceImpl implements SalesOrderService {
                 SalesOrderItem item = new SalesOrderItem();
                 color.setColorBar(itemJson.getString("goods_sn"));
                 List<ProductColor> colorList = productService.listproductAndColor(color);
-                if (colorList == null || colorList.size() == 0) {
-                    return;
+                if (colorList != null || colorList.size() > 0) {
+                    color = colorList.get(0);
+                    item.setItemColorBar(itemJson.getString("goods_sn"));//商品69码
+                    item.setItemNum(itemJson.getInt("sn"));//商品数量
+                    item.setItemCreateTime(salesOrder.getSalesCreateTime());
+                    item.setItemColorId(color.getColorId());
+                    item.setItemProductColor(color.getColorName());
+                    item.setItemProductDiscount(color.getColorDiscount());
+                    item.setItemProductId(color.getColorProductId());
+                    item.setItemProductName(color.getProductName());
+                    item.setItemProductPic(color.getColorPicture());
+                    item.setItemProductType(color.getProductType());
+                    item.setItemProductPrice(color.getColorPrice());
+                    item.setItemIsSource(1);
+                    itemList.add(item);
+                } else {
+                    //获取配件信息
+                    FittingsInfo fittingsInfo = new FittingsInfo();
+                    fittingsInfo.setFittingsBar(itemJson.getString("goods_sn"));
+                    List<FittingsInfo> Fittings = fittingsInfoMapper.listFittings(fittingsInfo);
+                    if (Fittings == null || Fittings.size() == 0) {
+                        return;
+                    }
+                    fittingsInfo = Fittings.get(0);
+                    item.setItemColorBar(itemJson.getString("goods_sn"));//商品69码
+                    item.setItemNum(itemJson.getInt("sn"));//商品数量
+                    item.setItemCreateTime(salesOrder.getSalesCreateTime());
+                    item.setItemColorId(fittingsInfo.getFittingsId());
+                    item.setItemProductColor(fittingsInfo.getFittingsName());
+                    item.setItemProductDiscount(fittingsInfo.getFittingsDiscount());
+                    item.setItemProductId(fittingsInfo.getProductId());
+                    item.setItemProductName(fittingsInfo.getFittingsName());
+                    item.setItemProductPic("");
+                    item.setItemProductType(0);
+                    item.setItemProductPrice(fittingsInfo.getFittingsPrice());
+                    item.setItemIsSource(2);
+                    itemList.add(item);
                 }
-                color = colorList.get(0);
-                item.setItemColorBar(itemJson.getString("goods_sn"));//商品69码
-                item.setItemNum(itemJson.getInt("sn"));//商品数量
-                item.setItemCreateTime(salesOrder.getSalesCreateTime());
-                item.setItemColorId(color.getColorId());
-                item.setItemProductColor(color.getColorName());
-                item.setItemProductDiscount(color.getColorDiscount());
-                item.setItemProductId(color.getColorProductId());
-                item.setItemProductName(color.getProductName());
-                item.setItemProductPic(color.getColorPicture());
-                item.setItemProductType(color.getProductType());
-                item.setItemProductPrice(color.getColorPrice());
-                itemList.add(item);
+
             }
             //添加订单和订单项
             salesOrderService.addOrderAndItem(salesOrder,itemList);

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

@@ -37,16 +37,18 @@
   <select id="listBackGoods" resultType="BackGoods" parameterType="BackGoods">
     select
       g.*,
-      o.sales_pay_time salesPayTime
+      o.sales_pay_time salesPayTime,
+      d.detect_state detectState
     from
       tb_rst_back_goods g
     LEFT JOIN tb_rst_sales_order_info o ON g.order_id = o.sales_id
+    LEFT JOIN tb_rst_complaint_detect d ON g.customer_id = d.customer_id
     <where>
       <if test="customerId != null and customerId != ''">
-        customer_id = #{customerId}
+        g.customer_id = #{customerId}
       </if>
       <if test="backGoodsState != null and backGoodsState != ''">
-        and back_goods_state = #{backGoodsState}
+        and g.back_goods_state = #{backGoodsState}
       </if>
     </where>
   </select>

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

@@ -22,12 +22,14 @@
     <result column="detect_is_maintenance" property="detectIsMaintenance" jdbcType="BIT" />
     <result column="detect_date" property="detectDate" jdbcType="DATE" />
     <result column="maintenance_results" property="maintenanceResults" jdbcType="BIT" />
+    <result column="product_color_id" property="productColorId" jdbcType="INTEGER" />
   </resultMap>
   <sql id="Base_Column_List" >
     detect_id, customer_id,signclosed_id,product_id,detect_product_number, detect_state,
     detect_phenomenon, detect_failure_classification, detect_failure_cause, detect_results, 
     detect_point, detect_analysis, detect_revolution_produced, detect_desc,
-    signclosed_create_time, signclosed_update_time,detect_is_maintenance,detect_date,maintenance_results
+    signclosed_create_time, signclosed_update_time,detect_is_maintenance,detect_date,maintenance_results,
+    product_color_id
   </sql>
   <select id="getComplaintDetectById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
@@ -57,6 +59,7 @@
       cd.machine_no machineNo,
       cd.detect_is_maintenance detectIsMaintenance,
       cd.detect_date detectDate,
+      cd.product_color_id productColorId,
       ci.customer_question_title questionTitle,
       pi.product_name productName,
       cd.maintenance_results maintenanceResults
@@ -106,6 +109,7 @@
       detect_revolution_produced,
       detect_desc, signclosed_create_time, signclosed_update_time,
       machine_no,detect_is_maintenance,detect_date,maintenance_results
+      ,product_color_id
       )
     values (#{detectId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER},#{signclosedId,jdbcType=INTEGER},
       #{productId,jdbcType=INTEGER},
@@ -115,6 +119,7 @@
       #{detectRevolutionProduced,jdbcType=BIT},
       #{detectDesc,jdbcType=VARCHAR}, #{signclosedCreateTime,jdbcType=TIMESTAMP}, #{signclosedUpdateTime,jdbcType=TIMESTAMP}
       ,#{machineNo,jdbcType=VARCHAR},#{detectIsMaintenance,jdbcType=BIT},#{detectDate,jdbcType=DATE},#{maintenanceResults,jdbcType=BIT}
+      ,#{productColorId,jdbcType=INTEGER}
       )
   </insert>
 
@@ -187,6 +192,9 @@
       <if test="maintenanceResults != null" >
         maintenance_results = #{maintenanceResults,jdbcType=BIT}
       </if>
+      <if test="productColorId != null" >
+        product_color_id = #{productColorId,jdbcType=INTEGER}
+      </if>
     </set>
     <where>
       <if test="detectId != null and detectId != ''" >

+ 96 - 32
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintMaintenanceInfoMapper.xml

@@ -10,16 +10,22 @@
     <result column="maintenance_state" property="maintenanceState" jdbcType="INTEGER" />
     <result column="maintenance_analysis" property="maintenanceAnalysis" jdbcType="VARCHAR" />
     <result column="maintenance_customer_id" property="maintenanceCustomerId" jdbcType="INTEGER" />
-    <result column="maintenance_id_repair" property="maintenanceIdRepair" jdbcType="INTEGER" />
+    <result column="maintenance_is_repair" property="maintenanceIsRepair" jdbcType="INTEGER" />
     <result column="maintenance_content_date" property="maintenanceContentDate" jdbcType="TIMESTAMP" />
     <result column="maintenance_create_time" property="maintenanceCreateTime" jdbcType="TIMESTAMP" />
     <result column="maintenance_update_time" property="maintenanceUpdateTime" jdbcType="TIMESTAMP" />
+    <result column="maintenance_is_warehousing" property="maintenanceIsWarehousing" jdbcType="INTEGER" />
+    <result column="maintenance_desc" property="maintenanceDesc" jdbcType="VARCHAR" />
+    <result column="product_color_id" property="productColorId" jdbcType="INTEGER" />
+
+
   </resultMap>
   <sql id="Base_Column_List" >
     maintenance_id, detect_id, maintenance_equipment_number, product_id,
     maintenance_product_number, maintenance_state, maintenance_analysis,
-    maintenance_customer_id, maintenance_id_repair,maintenance_content_date,
-    maintenance_create_time, maintenance_update_time
+    maintenance_customer_id, maintenance_is_repair,maintenance_content_date,
+    maintenance_create_time, maintenance_update_time,maintenance_is_warehousing,maintenance_desc,
+    product_color_id
   </sql>
   <select id="getMaintenanceByid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
@@ -27,68 +33,117 @@
     from tb_rst_complaint_maintenance
     where maintenance_id = #{maintenanceId,jdbcType=INTEGER}
   </select>
-  <select id="listMaintenance" resultMap="BaseResultMap" parameterType="ComplaintMaintenanceInfo" >
+
+  <resultMap id="listMaintenanceMap" type="ComplaintMaintenanceInfo" >
+    <id column="maintenance_id" property="maintenanceId" jdbcType="INTEGER" />
+    <result column="detect_id" property="detectId" jdbcType="INTEGER" />
+    <result column="maintenance_equipment_number" property="maintenanceEquipmentNumber" jdbcType="VARCHAR" />
+    <result column="product_id" property="productId" jdbcType="INTEGER" />
+    <result column="maintenance_product_number" property="maintenanceProductNumber" jdbcType="VARCHAR" />
+    <result column="maintenance_state" property="maintenanceState" jdbcType="INTEGER" />
+    <result column="maintenance_analysis" property="maintenanceAnalysis" jdbcType="VARCHAR" />
+    <result column="maintenance_customer_id" property="maintenanceCustomerId" jdbcType="INTEGER" />
+    <result column="maintenance_is_repair" property="maintenanceIsRepair" jdbcType="INTEGER" />
+    <result column="maintenance_content_date" property="maintenanceContentDate" jdbcType="TIMESTAMP" />
+    <result column="maintenance_create_time" property="maintenanceCreateTime" jdbcType="TIMESTAMP" />
+    <result column="maintenance_update_time" property="maintenanceUpdateTime" jdbcType="TIMESTAMP" />
+    <result column="maintenance_is_warehousing" property="maintenanceIsWarehousing" jdbcType="INTEGER" />
+    <result column="maintenance_desc" property="maintenanceDesc" jdbcType="VARCHAR" />
+    <result column="product_color_id" property="productColorId" jdbcType="VARCHAR" />
+    <collection property="equipmentNumber" column="maintenance_equipment_number" ofType="String" select="selectEquipmentNumber"/>
+  </resultMap>
+  <select id="selectEquipmentNumber" resultType="Integer" parameterType="String" >
     select
-    maintenance_id maintenanceId,
-    detect_id detectId,
-    maintenance_equipment_number maintenanceEquipmentNumber,
-    product_id productId,
-    maintenance_product_number maintenanceProductNumber,
-    maintenance_state maintenanceState,
-    maintenance_analysis maintenanceAnalysis,
-    maintenance_customer_id maintenanceCustomerId,
-    maintenance_id_repair maintenanceIdRepair,
-    maintenance_content_date maintenanceContentDate,
-    maintenance_create_time maintenanceCreateTime,
-    maintenance_update_time maintenanceUpdateTime
+    COUNT(*)
     from tb_rst_complaint_maintenance
+    where maintenance_equipment_number = #{maintenanceEquipmentNumber}
+  </select>
+
+  <select id="listMaintenance" resultMap="listMaintenanceMap" parameterType="ComplaintMaintenanceInfo" >
+    select
+    cm.maintenance_id,
+    cm.detect_id,
+    cm.maintenance_equipment_number,
+    cm.product_id,
+    cm.maintenance_product_number,
+    cm.maintenance_state,
+    cm.maintenance_analysis,
+    cm.maintenance_customer_id,
+    cm.maintenance_is_repair,
+    cm.maintenance_content_date,
+    cm.maintenance_create_time,
+    cm.maintenance_update_time,
+    cm.maintenance_is_warehousing,
+    cm.maintenance_desc,
+    cm.product_color_id,
+    pi.product_type productType,
+    cd.maintenance_results maintenanceResults,
+    cd.detect_desc detectDesc,
+    qd.describe_title customerIdDescribe
+    from tb_rst_complaint_maintenance cm
+    LEFT JOIN tb_rst_product_info pi on cm.product_id = pi.product_id
+    LEFT JOIN	tb_rst_complaint_detect cd on cm.detect_id = cd.detect_id
+    LEFT JOIN tb_rst_question_describe qd on cm.maintenance_customer_id = qd.customer_id
     <where>
       <if test="maintenanceId != null and maintenanceId != ''" >
         AND maintenance_id = #{maintenanceId}
       </if>
       <if test="detectId != null and detectId != ''" >
-        AND detect_id = #{detectId}
+        AND cm.detect_id = #{detectId}
       </if>
-      <if test="maintenanceEquipmentNumber != null maintenanceEquipmentNumber != ''" >
+      <if test="maintenanceEquipmentNumber != null and maintenanceEquipmentNumber != ''" >
         AND maintenance_equipment_number = #{maintenanceEquipmentNumber}
       </if>
-      <if test="maintenanceState != null maintenanceState != ''" >
-        AND maintenance_state = #{maintenanceEquipmentNumber}
+      <if test="maintenanceState != null and maintenanceState != ''" >
+        AND maintenance_state = #{maintenanceState}
       </if>
-      <if test="maintenanceAnalysis != null maintenanceAnalysis != ''" >
+      <if test="maintenanceAnalysis != null and maintenanceAnalysis != ''" >
         AND maintenance_analysis = #{maintenanceAnalysis}
       </if>
-      <if test="maintenanceCustomerId != null maintenanceCustomerId != ''" >
+      <if test="maintenanceCustomerId != null and maintenanceCustomerId != ''" >
         AND maintenance_customer_id = #{maintenanceCustomerId}
       </if>
-      <if test="maintenanceIdRepair != null maintenanceIdRepair != ''" >
-        AND maintenance_id_repair = #{maintenanceIdRepair}
+      <if test="maintenanceIsRepair != null and maintenanceIsRepair != ''" >
+        AND maintenance_is_repair = #{maintenanceIsRepair}
       </if>
-      <if test="maintenanceContentDate != null maintenanceContentDate != ''" >
+      <if test="maintenanceContentDate != null and maintenanceContentDate != ''" >
         AND maintenance_content_date = #{maintenanceContentDate}
       </if>
-      <if test="maintenanceCreateTime != null maintenanceCreateTime != ''" >
+      <if test="maintenanceCreateTime != null and maintenanceCreateTime != ''" >
         AND maintenance_create_time = #{maintenanceCreateTime}
       </if>
-      <if test="maintenanceUpdateTime != null maintenanceUpdateTime != ''" >
+      <if test="maintenanceUpdateTime != null and maintenanceUpdateTime != ''" >
         AND maintenanceUpdateTime = #{maintenanceUpdateTime}
       </if>
+      <if test="customerIdDescribe != null and customerIdDescribe != ''" >
+        AND qd.describe_title like CONCAT('%',#{customerIdDescribe},'%')
+      </if>
+      <if test="maintenanceResults != null and maintenanceResults != ''" >
+        AND cd.maintenance_results = #{maintenanceResults}
+      </if>
+      <if test="productColorId != null and productColorId != ''" >
+        AND product_color_id = #{productColorId}
+      </if>
     </where>
   </select>
   <insert id="insert" parameterType="ComplaintMaintenanceInfo" >
     insert into tb_rst_complaint_maintenance (maintenance_id, detect_id, maintenance_equipment_number, 
       product_id, maintenance_product_number,
       maintenance_state, maintenance_analysis,
-      maintenance_customer_id, maintenance_id_repair, 
+      maintenance_customer_id, maintenance_is_repair,
       maintenance_content_date,
-      maintenance_create_time, maintenance_update_time
+      maintenance_create_time, maintenance_update_time,
+      maintenance_is_warehousing,
+      maintenance_desc,product_color_id
       )
     values (#{maintenanceId,jdbcType=INTEGER}, #{detectId,jdbcType=INTEGER}, #{maintenanceEquipmentNumber,jdbcType=INTEGER}, 
       #{productId,jdbcType=BIT}, #{maintenanceProductNumber,jdbcType=VARCHAR},
       #{maintenanceState,jdbcType=INTEGER}, #{maintenanceAnalysis,jdbcType=VARCHAR},
-      #{maintenanceCustomerId,jdbcType=INTEGER}, #{maintenanceIdRepair,jdbcType=INTEGER},
+      #{maintenanceCustomerId,jdbcType=INTEGER}, #{maintenanceIsRepair,jdbcType=INTEGER},
       #{maintenanceContentDate,jdbcType=TIMESTAMP},
       #{maintenanceCreateTime,jdbcType=TIMESTAMP}, #{maintenanceUpdateTime,jdbcType=TIMESTAMP}
+      , #{maintenanceIsWarehousing,jdbcType=INTEGER}, #{maintenanceDesc,jdbcType=VARCHAR}
+      , #{productColorId,jdbcType=INTEGER}
       )
   </insert>
 
@@ -116,8 +171,8 @@
       <if test="maintenanceCustomerId != null" >
         maintenance_customer_id = #{maintenanceCustomerId,jdbcType=INTEGER},
       </if>
-      <if test="maintenanceIdRepair != null" >
-        maintenance_id_repair = #{maintenanceIdRepair,jdbcType=INTEGER},
+      <if test="maintenanceIsRepair != null" >
+        maintenance_is_repair = #{maintenanceIsRepair,jdbcType=INTEGER},
       </if>
       <if test="maintenanceContentDate != null" >
         maintenance_content_date = #{maintenanceContentDate,jdbcType=TIMESTAMP},
@@ -128,6 +183,15 @@
       <if test="maintenanceUpdateTime != null" >
         maintenance_update_time = #{maintenanceUpdateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="maintenanceIsWarehousing != null" >
+        maintenance_is_warehousing = #{maintenanceIsWarehousing,jdbcType=TIMESTAMP},
+      </if>
+      <if test="maintenanceDesc != null" >
+        maintenance_desc = #{maintenanceDesc,jdbcType=VARCHAR},
+      </if>
+      <if test="productColorId != null" >
+        product_color_id = #{productColorId,jdbcType=INTEGER}
+      </if>
     </set>
     where maintenance_id = #{maintenanceId,jdbcType=INTEGER}
   </update>

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

@@ -33,6 +33,9 @@
       <if test="productId != null">
         product_id = #{productId}
       </if>
+      <if test="fittingsBar != null">
+        and fittings_bar = #{fittingsBar}
+      </if>
     </where>
   </select>
 

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

@@ -38,16 +38,18 @@
   <select id="listNoreasonBack" resultType="NoreasonBack" parameterType="NoreasonBack">
     select
       b.*,
-      o.sales_pay_time salesPayTime
+      o.sales_pay_time salesPayTime,
+      d.detect_state detectState
     from
       tb_rst_noreason_back b
     LEFT JOIN tb_rst_sales_order_info o ON b.order_id = o.sales_id
+    LEFT JOIN tb_rst_complaint_detect d ON b.customer_id = d.customer_id
     <where>
       <if test="customerId != null and customerId != ''">
-        customer_id = #{customerId}
+        b.customer_id = #{customerId}
       </if>
       <if test="noreasonBackState != null and noreasonBackState != ''">
-        and noreason_back_state = #{noreasonBackState}
+        and b.noreason_back_state = #{noreasonBackState}
       </if>
     </where>
   </select>

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

@@ -44,10 +44,10 @@
     LEFT JOIN tb_rst_sales_order_info o ON r.order_id = o.sales_id
     <where>
       <if test="customerId != null and customerId != ''">
-        customer_id = #{customerId}
+        r.customer_id = #{customerId}
       </if>
       <if test="reissueState != null and reissueState != ''">
-        and reissue_state = #{reissueState}
+        and r.reissue_state = #{reissueState}
       </if>
     </where>
   </select>

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

@@ -53,7 +53,7 @@
       d.detect_point detectPoint,
       d.detect_analysis detectAnalysis,
       d.detect_revolution_produced detectRevolutionProduced,
-      m.maintenance_id_repair maintenanceIdRepair,
+      m.maintenance_is_repair maintenanceIsRepair,
       m.maintenance_content maintenanceContent,
       m.maintenance_content_date maintenanceContentDate
     from
@@ -62,7 +62,7 @@
     LEFT JOIN tb_rst_complaint_maintenance m ON d.detect_id = m.detect_id
     <where>
       <if test="renewedId != null and renewedId != ''">
-        renewed_id = #{renewedId}
+        r.renewed_id = #{renewedId}
       </if>
       <if test="customerId != null and customerId != ''">
         and r.customer_id = #{customerId}

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

@@ -76,7 +76,7 @@
       d.detect_point detectPoint,
       d.detect_analysis detectAnalysis,
       d.detect_revolution_produced detectRevolutionProduced,
-      m.maintenance_id_repair maintenanceIdRepair,
+      m.maintenance_is_repair maintenanceIsRepair,
       m.maintenance_content maintenanceContent,
       m.maintenance_content_date maintenanceContentDate
     from
@@ -85,7 +85,7 @@
     LEFT JOIN tb_rst_complaint_maintenance m ON d.detect_id = m.detect_id
     <where>
       <if test="repairId != null and repairId != ''">
-        repair_id = #{repairId}
+        r.repair_id = #{repairId}
       </if>
       <if test="customerId != null and customerId != ''">
         and r.customer_id = #{customerId}

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

@@ -145,14 +145,15 @@
       (
         item_order_id,item_product_id,item_num,item_color_id,item_product_type,
         item_product_name,item_product_pic,item_product_color,item_color_bar,
-        item_product_price,item_product_discount,item_create_time
+        item_product_price,item_product_discount,item_create_time,item_is_source
       )
     VALUES
     <foreach collection="list" item="item" separator=",">
       (
         #{item.itemOrderId},#{item.itemProductId},#{item.itemNum},#{item.itemColorId},
         #{item.itemProductType},#{item.itemProductName},#{item.itemProductPic},#{item.itemProductColor},
-        #{item.itemColorBar},#{item.itemProductPrice},#{item.itemProductDiscount},#{item.itemCreateTime}
+        #{item.itemColorBar},#{item.itemProductPrice},#{item.itemProductDiscount},#{item.itemCreateTime},
+        #{item.itemIsSource}
       )
     </foreach>
   </insert>

+ 79 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/EfastOrderServiceImpl.java

@@ -3,6 +3,7 @@ package com.iamberry.rst.service.order;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.iamberry.rst.core.order.EfastOrder;
+import com.iamberry.rst.core.order.EfastOrderItem;
 import com.iamberry.rst.core.order.Order;
 import com.iamberry.rst.core.order.OrderItem;
 import com.iamberry.rst.faces.order.EfastOrderService;
@@ -455,4 +456,82 @@ public class EfastOrderServiceImpl implements EfastOrderService {
             return null;
         }
     }
+
+    @Override
+    public JSONObject returnOrderFormEfast(EfastOrder efastOrder) throws Exception {
+        StringBuilder returnDetail = new StringBuilder();
+        if (efastOrder == null) {
+            return null;
+        }
+        if (efastOrder.getItemList() == null || efastOrder.getItemList().size() == 0) {
+            return null;
+        }
+        List<EfastOrderItem> itemList = efastOrder.getItemList();
+        for (int i = 0;i < itemList.size();i++) {
+            EfastOrderItem item = itemList.get(i);
+            returnDetail.append(item.getItemColorBar());
+            returnDetail.append("@");
+            returnDetail.append(item.getItemNum());
+            returnDetail.append("@");
+            returnDetail.append(item.getItemDiscount());
+            returnDetail.append("@");
+            returnDetail.append(efastOrder.getOrderDealCode());
+            if (i < itemList.size() - 1) {
+                returnDetail.append(",");
+            }
+        }
+        // 组装数据
+        Map<String, String> requestData = new HashMap<String, String>();
+        requestData.put("return_shipping_name", efastOrder.getOrderPostFirm());		// 退单物流代码
+        requestData.put("kehu_return_invoice_no", efastOrder.getOrderPostNum());	// 退单物流单号
+        requestData.put("return_type", "2");
+        requestData.put("app_nick", NameUtils.getConfig("app_nick"));
+        requestData.put("app_key", NameUtils.getConfig("app_key"));
+        requestData.put("app_secret", NameUtils.getConfig("app_secret"));
+        requestData.put("timestamp",DateTimeUtil.format(new Date(),"yyyyMMddHHmmss"));
+        requestData.put("app_act", "efast.trade.return");
+        requestData.put("order_sn", efastOrder.getOrderId());
+        requestData.put("return_shipping", "");
+        requestData.put("return_pfje_fee", "");
+        requestData.put("return_other_discount", "");
+        requestData.put("return_pay", "2");
+        requestData.put("return_reason", "");
+        requestData.put("return_desc", "");
+        requestData.put("return_ck", "");
+        requestData.put("return_detail", returnDetail.toString());
+        try {
+            String resultJson = HttpClient431Util.doPost(requestData, NameUtils.getConfig("efast_base_url"));
+            resultJson = StringEscapeUtils.unescapeJava(resultJson);
+            logger.info("return-订单号为:" + efastOrder.getOrderDealCode() + "的订单,百胜返回信息:" + resultJson);
+            JSONObject jsonObject = JSONObject.fromObject(resultJson);
+            JSONObject respData = JSONObject.fromObject(jsonObject.get("resp_data"));
+            return respData;
+        } catch (Exception e) {
+            logger.error("return-订单号为:" + efastOrder.getOrderDealCode() + "的订单,发生错误:" + e.getMessage());
+            throw e;
+        }
+    }
+
+    @Override
+    public JSONObject receiveOrderFormEfast(EfastOrder efastOrder) throws Exception {
+        // 组装数据
+        Map<String, String> requestData = new HashMap<String, String>();
+        requestData.put("app_nick", NameUtils.getConfig("app_nick"));
+        requestData.put("app_key", NameUtils.getConfig("app_key"));
+        requestData.put("app_secret", NameUtils.getConfig("app_secret"));
+        requestData.put("app_act", "efast.return_receive");
+        requestData.put("return_sn", efastOrder.getOrderId());
+        requestData.put("timestamp",DateTimeUtil.format(new Date(),"yyyyMMddHHmmss"));
+        try {
+            String resultJson = HttpClient431Util.doPost(requestData, NameUtils.getConfig("efast_base_url"));
+            resultJson = StringEscapeUtils.unescapeJava(resultJson);
+            logger.info("receive-订单号为:" + efastOrder.getOrderDealCode() + "的订单,百胜返回信息:" + resultJson);
+            JSONObject jsonObject = JSONObject.fromObject(resultJson);
+            JSONObject respData = JSONObject.fromObject(jsonObject.get("resp_data"));
+            return respData;
+        } catch (Exception e) {
+            logger.error("return-订单号为:" + efastOrder.getOrderDealCode() + "的订单,发生错误:" + e.getMessage());
+            throw e;
+        }
+    }
 }

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

@@ -119,15 +119,15 @@
     </select>
 
     <resultMap id="productColorFittingsMap" type="Product">
-        <id property="product_id" column="productId"/>
-        <result property="product_name" column="productName"/>
-        <result property="product_abbreviation" column="productAbbreviation"/>
-        <result property="product_salesnum" column="productSalesnum"/>
-        <result property="product_status" column="productStatus"/>
-        <result property="product_create_time" column="ProductCreateTime"/>
-        <result property="product_remark" column="productRemark"/>
-        <result property="product_type" column="productType"/>
-        <result property="product_number" column="ProductNumber"/>
+        <id column="product_id" property="productId"/>
+        <result column="product_name" property="productName"/>
+        <result column="product_abbreviation" property="productAbbreviation"/>
+        <result column="product_salesnum" property="productSalesnum"/>
+        <result column="product_status" property="productStatus"/>
+        <result column="product_create_time" property="productCreateTime"/>
+        <result column="product_remark" property="productRemark"/>
+        <result column="product_type" property="productType"/>
+        <result column="product_number" property="productNumber"/>
         <collection property="colorList" column="PRODUCT_ID" ofType="ProductColor" select="listProduceColorById"/>
         <collection property="fittingsList" column="PRODUCT_ID" ofType="FittingsInfo" select="listProduceFittingsById"/>
     </resultMap>

+ 27 - 23
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml

@@ -412,28 +412,32 @@
     </insert>
 
     <select id="getMachineByBarCode" parameterType="String" resultType="PtsMachine">
-        select machine_id machineId,
-        machine_qrcode machineQrcode,
-        machine_barcode machineBarcode,
-        machine_sales_date machineSalesDate,
-        machine_sales_state machineSalesState,
-        machine_status machineStatus,
-        machine_produced_time machineProducedTime,
-        machine_sub_time machineSubTime,
-        machine_is_print machineIsPrint,
-        machine_compound_img machineCompoundImg,
-        machine_process_state machineProcessState,
-        machine_software_version machineSoftwareVersion,
-        machine_hardware_version machineHardwareVersion,
-        machine_create_time machineCreateTime,
-        machine_update_time machineUpdateTime,
-        machine_produce_type machineProduceType,
-        machine_produce_id machineProduceId,
-        machine_batch_id machineBatchId,
-        machine_bom_id  machineBomId,
-        machine_is_retreading  machineIsRetreading,
-        machine_line  machineLine,
-        machine_sales_company_id machineSalesCompanyId
-        from tb_rst_pts_machine WHERE  machine_barcode = #{machineBarcode} AND machine_sales_state = 1
+        SELECT
+            machine_id machineId,
+            machine_qrcode machineQrcode,
+            machine_barcode machineBarcode,
+            machine_sales_date machineSalesDate,
+            machine_sales_state machineSalesState,
+            machine_status machineStatus,
+            machine_produced_time machineProducedTime,
+            machine_sub_time machineSubTime,
+            machine_is_print machineIsPrint,
+            machine_compound_img machineCompoundImg,
+            machine_process_state machineProcessState,
+            machine_software_version machineSoftwareVersion,
+            machine_hardware_version machineHardwareVersion,
+            machine_create_time machineCreateTime,
+            machine_update_time machineUpdateTime,
+            machine_produce_type machineProduceType,
+            machine_produce_id machineProduceId,
+            machine_batch_id machineBatchId,
+            machine_bom_id machineBomId,
+            machine_is_retreading machineIsRetreading,
+            machine_line machineLine,
+            machine_sales_company_id machineSalesCompanyId,
+            sc.sales_company_abbreviation machineSalesCompanyName
+        FROM
+            tb_rst_pts_machine pm LEFT JOIN tb_rst_pts_sales_company sc on pm.machine_sales_company_id = sc.sales_company_id
+             WHERE  machine_barcode = #{machineBarcode}
     </select>
 </mapper>

+ 23 - 4
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -1,9 +1,7 @@
 package com.iamberry.rst.controllers.cm;
 
 import com.iamberry.rst.core.cm.*;
-import com.iamberry.rst.core.order.Product;
-import com.iamberry.rst.core.order.ProductColor;
-import com.iamberry.rst.core.order.ProductType;
+import com.iamberry.rst.core.order.*;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.pts.ProcessNode;
 import com.iamberry.rst.core.pts.ProduceProcess;
@@ -33,7 +31,7 @@ import java.util.*;
  * Created by wxm
  */
 @Controller
-@RequestMapping("/admin/customer")
+@RequestMapping("/customer")
 public class AdminCustomerController {
 
     @Autowired
@@ -71,6 +69,23 @@ public class AdminCustomerController {
 
     private Object lock = new Object();
 
+    @RequestMapping("/test_efast")
+    public void testEfast() throws Exception{
+        EfastOrder efastOrder = new EfastOrder();
+        efastOrder.setOrderDealCode("060619392147176-1");
+        efastOrder.setOrderId("706060002366");
+        efastOrder.setOrderPostFirm("yto");
+        efastOrder.setOrderPostNum("sss");
+        List<EfastOrderItem> itemList = new ArrayList<EfastOrderItem>();
+        EfastOrderItem item = new EfastOrderItem();
+        item.setItemNum(1);
+        item.setItemDiscount(1599);
+        item.setItemColorBar("6970465730023");
+        itemList.add(item);
+        efastOrder.setItemList(itemList);
+        efastOrderService.returnOrderFormEfast(efastOrder);
+    }
+
 
     /**
      * 获取客诉列表
@@ -216,6 +231,10 @@ public class AdminCustomerController {
         Admin admin = new Admin();
         admin.setAdminStatus(1);
         List<Admin> adminList = sysService.listSelectAdmin(admin);
+
+        //获取登录人id
+        Integer loginAdminId = AdminUtils.getLoginAdminId();
+        mv.addObject("loginAdminId",loginAdminId);
         mv.addObject("typeList", typeList);
         mv.addObject("complaintTypeList", complaintTypeList);
         mv.addObject("adminList", adminList);

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

@@ -60,8 +60,8 @@ public class AdminDetectController {
     @RequestMapping(value = "/to_add_detect")
     public ModelAndView toAddDetect(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("cm/inspection/add_detect");
-        //获取所有产品
-        List<Product> productList = productService.listProduce();
+        Product product = new Product();
+        List<Product> productList = productService.listProductAndColorAndfittings(product);
         mv.addObject("productList",productList);
         /*//获取所有配件
         List<FittingsInfo> listFittings = fittingsInfoService.listFittings();
@@ -156,10 +156,13 @@ public class AdminDetectController {
             msg.setReturnCode(500);
             return msg;
         }
-        Product  product =  productService.getProduce(String.valueOf(detectInfo.getProductId()));
-        detectInfo.setDetectProductNumber(product.getProductNumber());
-
+        if(detectInfo.getProductId() != null){
+            detectInfo.setProductColorId(Integer.valueOf(request.getParameter("colorId"+detectInfo.getProductId())));
+            detectInfo.setMachineNo(request.getParameter("maintenanceEquipmentNumber"+detectInfo.getProductId()));
 
+        }
+        Product product = productService.getProduce(String.valueOf(detectInfo.getProductId()));
+        detectInfo.setDetectProductNumber(product.getProductNumber());
         String detectDate = request.getParameter("detect_date");
         if(detectDate == null){
             msg.setResultCode(500);

+ 187 - 4
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintMaintenanceController.java

@@ -1,14 +1,18 @@
 package com.iamberry.rst.controllers.cm;
 
 import com.iamberry.rst.core.cm.*;
+import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.pts.PtsMachine;
+import com.iamberry.rst.core.pts.PtsSalesCompany;
 import com.iamberry.rst.faces.cm.ComplaintMaintenanceInfoService;
 import com.iamberry.rst.faces.cm.ComplaintQuestionInfoService;
 import com.iamberry.rst.faces.cm.ComplaintSmallClassInfoService;
 import com.iamberry.rst.faces.cm.ComplaintTypeInfoService;
+import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.faces.pts.MachineService;
+import com.iamberry.rst.faces.pts.PtsSalesCompanyService;
 import com.iamberry.rst.service.pts.mapper.MachineMapper;
 import com.iamberry.rst.utils.StitchAttrUtil;
 import com.iamberry.wechat.tools.ResponseJson;
@@ -21,6 +25,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -35,6 +42,10 @@ public class ComplaintMaintenanceController {
     private ComplaintMaintenanceInfoService complaintMaintenanceInfoService;
     @Autowired
     private MachineService machineService;
+    @Autowired
+    private ProductService productService;
+    @Autowired
+    private PtsSalesCompanyService ptsSalesCompanyService;
 
 
     /**
@@ -50,8 +61,7 @@ public class ComplaintMaintenanceController {
                                          @RequestParam(value = "pageSize", defaultValue = "5", required = false) int pageSize,
                                          ComplaintMaintenanceInfo complaintMaintenanceInfo) {
 
-        ModelAndView mv = new ModelAndView("cm/signclosed/signclosed_list");
-        StringBuilder url = new StringBuilder("/admin/signclosed/select_signclosed_list?pageSize=" + pageSize);
+        ModelAndView mv = new ModelAndView("cm/maintenance/maintenance_list");
         // 封装请求数据
         PageRequest<ComplaintMaintenanceInfo> pageRequest = new PageRequest<>(complaintMaintenanceInfo, pageNO, pageSize, pageTotal == null);
         PagedResult<ComplaintMaintenanceInfo> result = complaintMaintenanceInfoService.listMaintenance(pageRequest);
@@ -74,13 +84,25 @@ public class ComplaintMaintenanceController {
     @ResponseBody
     @RequiresPermissions("maintenance:update:maintenance")
     @RequestMapping(value = "/update_maintenance")
-    public ResponseJson updateMaintenance(HttpServletRequest request,ComplaintMaintenanceInfo maintenanceInfo){
+    public ResponseJson updateMaintenance(HttpServletRequest request,ComplaintMaintenanceInfo maintenanceInfo)throws Exception{
         ResponseJson msg = new ResponseJson();
         if(maintenanceInfo == null){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
         }
+        String maintenanceContentDate = request.getParameter("maintenanceContent_Date");
+        if(maintenanceContentDate != null){
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            maintenanceInfo.setMaintenanceContentDate(format.parse(maintenanceContentDate));
+        }
+        if(maintenanceInfo.getProductId() != null){
+            maintenanceInfo.setProductColorId(Integer.valueOf(request.getParameter("colorId"+maintenanceInfo.getProductId())));
+            maintenanceInfo.setMaintenanceEquipmentNumber(request.getParameter("maintenanceEquipmentNumber"+maintenanceInfo.getProductId()));
+
+        }
+        Product product = productService.getProduce(String.valueOf(maintenanceInfo.getProductId()));
+        maintenanceInfo.setMaintenanceProductNumber(product.getProductNumber());
         Integer num = complaintMaintenanceInfoService.updateMaintenanceById(maintenanceInfo);
         if (num < 1) {
             msg.setResultCode(500);
@@ -91,6 +113,44 @@ public class ComplaintMaintenanceController {
         }
         return msg;
     }
+
+
+    /**
+     * 跳转到修改维修记录页面
+     *
+     * @return
+     */
+    @RequiresPermissions("maintenance:update:maintenance")
+    @RequestMapping(value = "/to_update_maintenance")
+    public ModelAndView toUpdateMaintenance(HttpServletRequest request,Integer maintenanceId) {
+        ModelAndView mv = new ModelAndView("cm/maintenance/update_maintenance");
+        //获取所有产品及其颜色,配件
+        Product product = new Product();
+        List<Product> productList = productService.listProductAndColorAndfittings(product);
+
+        ComplaintMaintenanceInfo complaintMaintenanceInfo = complaintMaintenanceInfoService.getMaintenanceByid(maintenanceId);
+        mv.addObject("productList",productList);
+        mv.addObject("maintenanceInfo",complaintMaintenanceInfo);
+        return mv;
+    }
+
+    /**
+     * 跳转到增加维修记录页面
+     *
+     * @return
+     */
+    @RequiresPermissions("maintenance:add:maintenance")
+    @RequestMapping(value = "/to_add_maintenance")
+    public ModelAndView toAddMaintenance(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("cm/maintenance/add_maintenance");
+        //获取所有产品及其颜色,配件
+        Product product = new Product();
+        List<Product> productList = productService.listProductAndColorAndfittings(product);
+        mv.addObject("productList",productList);
+        return mv;
+    }
+
+
     /**
      * 增加维修记录
      *
@@ -99,13 +159,25 @@ public class ComplaintMaintenanceController {
     @ResponseBody
     @RequiresPermissions("maintenance:add:maintenance")
     @RequestMapping(value = "/add_maintenance")
-    public ResponseJson addMaintenance(HttpServletRequest request,ComplaintMaintenanceInfo maintenanceInfo){
+    public ResponseJson addMaintenance(HttpServletRequest request,ComplaintMaintenanceInfo maintenanceInfo) throws Exception {
         ResponseJson msg = new ResponseJson();
         if(maintenanceInfo == null){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
         }
+        String maintenanceContentDate = request.getParameter("maintenanceContent_Date");
+        if(maintenanceContentDate != null){
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            maintenanceInfo.setMaintenanceContentDate(format.parse(maintenanceContentDate));
+        }
+        if(maintenanceInfo.getProductId() != null){
+            maintenanceInfo.setProductColorId(Integer.valueOf(request.getParameter("colorId"+maintenanceInfo.getProductId())));
+            maintenanceInfo.setMaintenanceEquipmentNumber(request.getParameter("maintenanceEquipmentNumber"+maintenanceInfo.getProductId()));
+
+        }
+        Product product = productService.getProduce(String.valueOf(maintenanceInfo.getProductId()));
+        maintenanceInfo.setMaintenanceProductNumber(product.getProductNumber());
         Integer num = complaintMaintenanceInfoService.insert(maintenanceInfo);
         if (num < 1) {
             msg.setResultCode(500);
@@ -143,4 +215,115 @@ public class ComplaintMaintenanceController {
         }
         return msg;
     }
+
+    /**
+     * 跳转到完善机器编号页面
+     *
+     * @return
+     */
+    @RequiresPermissions("maintenance:update:maintenance")
+    @RequestMapping(value = "/to_perfecting_machine")
+    public ModelAndView toPerfectingMachine(HttpServletRequest request,Integer maintenanceId) {
+        ModelAndView mv = new ModelAndView("cm/maintenance/perfecting_machine");
+        PtsSalesCompany ptsSalesCompany = new PtsSalesCompany();
+        List<PtsSalesCompany> listSalesCompany = ptsSalesCompanyService.listPtsSalesCompany(ptsSalesCompany);
+        mv.addObject("listSalesCompany",listSalesCompany);
+        ComplaintMaintenanceInfo complaintMaintenanceInfo = complaintMaintenanceInfoService.getMaintenanceByid(maintenanceId);
+        mv.addObject("maintenanceInfo",complaintMaintenanceInfo);
+        return mv;
+    }
+
+    /**
+     * 完善机器编号(出库录入)
+     */
+    @ResponseBody
+    @RequiresPermissions("maintenance:update:maintenance")
+    @RequestMapping("/perfecting_machine")
+    public ResponseJson perfectingMachine(HttpServletRequest request, ComplaintMaintenanceInfo complaintMaintenanceInfo)throws Exception {
+        ResponseJson rj = new ResponseJson(500, "ERROR", 500);
+        if(complaintMaintenanceInfo == null){
+            return rj;
+        }
+        PtsMachine ptsMachine = machineService.getMachineByBarCode(complaintMaintenanceInfo.getMaintenanceEquipmentNumber());
+        if(ptsMachine == null){
+            return rj;
+        }
+        if(ptsMachine.getMachineSalesState() == 2){//如果未出库,则将该机器编号录入到这条维修任务
+            String machineSalesCompanyId = request.getParameter("machineSalesCompanyId"); //销售公司
+            String machineSales_date = request.getParameter("machineSales_date");//销售时间
+            if(machineSalesCompanyId == null || machineSalesCompanyId.equals("")|| machineSales_date == null || machineSales_date.equals("")){
+                return rj;
+            }
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            Date machineSalesDate = format.parse(machineSales_date);
+            //将机器出库
+            PtsMachine machine = new PtsMachine();
+            machine.setMachineBarcode(complaintMaintenanceInfo.getMaintenanceEquipmentNumber());
+            machine.setMachineSalesDate(machineSalesDate);
+            machine.setMachineSalesCompanyId(Integer.valueOf(machineSalesCompanyId));
+            machine.setMachineSalesState(1); //设置状态为已售出
+            int flag = machineService.updateMachineSalesInfo(machine);
+            if(flag < 1){
+                rj.setResultCode(500);
+                rj.setResultMsg("ERROR");
+                rj.setReturnCode(500);
+                return rj;
+            }else{
+                rj.setResultCode(200);
+                rj.setResultMsg("SUCCESS");
+                rj.setReturnCode(200);
+            }
+        }
+        int msg = complaintMaintenanceInfoService.updateMaintenanceById(complaintMaintenanceInfo);
+        if(msg < 1){
+            rj.setResultCode(500);
+            rj.setResultMsg("ERROR");
+            rj.setReturnCode(500);
+        }else{
+            rj.setResultCode(200);
+            rj.setResultMsg("SUCCESS");
+            rj.setReturnCode(200);
+        }
+        return rj;
+    }
+
+    /**
+     * 跳转到完成返修页面
+     *
+     * @return
+     */
+    @RequiresPermissions("maintenance:update:maintenance")
+    @RequestMapping(value = "/to_complete_reorder")
+    public ModelAndView toCompleteReorder(HttpServletRequest request,Integer maintenanceId) {
+        ModelAndView mv = new ModelAndView("cm/maintenance/complete_reorder");
+        ComplaintMaintenanceInfo complaintMaintenanceInfo = complaintMaintenanceInfoService.getMaintenanceByid(maintenanceId);
+        mv.addObject("maintenanceInfo",complaintMaintenanceInfo);
+        return mv;
+    }
+
+    /**
+     * 完成返修
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("maintenance:update:maintenance")
+    @RequestMapping(value = "/complete_reorder")
+    public ResponseJson completeReorder(HttpServletRequest request,ComplaintMaintenanceInfo maintenanceInfo)throws Exception{
+        ResponseJson msg = new ResponseJson();
+        if(maintenanceInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        Integer num = complaintMaintenanceInfoService.updateMaintenanceById(maintenanceInfo);
+        if (num < 1) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
 }

+ 22 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintQuestionInfoController.java

@@ -143,8 +143,30 @@ public class ComplaintQuestionInfoController {
         } else {
             msg.setResultCode(200);
             msg.setReturnCode(200);
+            msg.addResponseKeyValue("complaintQuestionInfo",complaintQuestionInfo);
         }
         return msg;
     }
 
+    private Integer backOutQuestionId = 5;
+    /**
+     * 查询退回短信客诉问题
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/get_back_out_question")
+    public ResponseJson getBackOutQuestion(HttpServletRequest request){
+        ResponseJson msg = new ResponseJson();
+        ComplaintQuestionInfo complaintQuestionInfo = complaintQuestionInfoService.getQuestionById(backOutQuestionId);
+        if (complaintQuestionInfo  == null) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+            msg.addResponseKeyValue("complaintQuestionInfo",complaintQuestionInfo);
+        }
+        return msg;
+    }
 }

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

@@ -92,7 +92,7 @@ public class MQTask implements InitializingBean {
 	 * 批量同步百胜订单信息
 	 * @throws Exception
 	 */
-	//@Scheduled(cron = "0 0 */1 * * ?")//每小时执行一次
+	@Scheduled(cron = "0 0 */1 * * ?")//每小时执行一次
 	//@Scheduled(cron = "*/10 * * * * ?")
 	public void syncEfastOrderList() throws Exception {
 		int pageNo = 1;
@@ -130,8 +130,8 @@ public class MQTask implements InitializingBean {
 	 * 同步百胜订单状态等信息
 	 * @throws Exception
 	 */
-	//@Scheduled(cron = "0 0 */1 * * ?")//每小时执行一次
-	@Scheduled(cron = "*/10 * * * * ?")
+	@Scheduled(cron = "0 0 */1 * * ?")//每小时执行一次
+	//@Scheduled(cron = "*/10 * * * * ?")
 	public void syncEfastOrderStatus() throws Exception {
 		int pageNo = 1;
 		int pageSize = 20;

+ 149 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_detail.ftl

@@ -231,7 +231,8 @@
                     var customerCommon = data.returnMsg.customerCommon;
                     var salesOrder = data.returnMsg.salesOrder;
                     if (customer.customerIsSolve != 1 && customer.customerIsSolve != 2) {
-                        resultshow(customer.customerIsSolve, customerCommon.relationBackStatus,customerCommon.relationSendStatus);
+                        resultshow(customer.customerIsSolve, customerCommon.relationBackStatus,customerCommon.relationSendStatus,
+                                customerCommon.maintenanceIsRepair,customerCommon.detectState);
                     }
 
                     $('#adminName').html(customer.adminName);
@@ -355,7 +356,7 @@
      * backStatus:寄回状态
      * sendStatus:寄送状态
      */
-    function resultshow(customerIsSolve, backStatus, sendStatus) {
+    function resultshow(customerIsSolve, backStatus, sendStatus, maintenanceIsRepair, detectState) {
         var statusHtml = '<li id="div_li"><span class="arrow"></span><div id="div_number" class="number">status_index</div><div id="div_txt">status_html</div></li>';
         var result = [];
         var resultHtml = '';
@@ -368,7 +369,7 @@
             case 6:result = isSolve.backGoods;break;
             case 7:result = isSolve.noReasonBack;break;
         }
-        for(var i=0;i< result.length;i++){
+        for(var i = 0;i < result.length;i++){
             var html = statusHtml.replace("status_index",i+1);
             html = html.replace("div_li","li-"+(i+1));
             html = html.replace("div_number","number-"+(i+1));
@@ -377,6 +378,151 @@
             resultHtml += html;
         }
         $(".time-line-list").html(resultHtml);
+        $('#number-1').attr('class','red');
+        $('#txt-1').attr('class','txt-red');
+        if (customerIsSolve == 3) {
+            switch (backStatus) {
+                case 1:
+                    $('#number-2').attr('class','red');
+                    $('#txt-2').attr('class','txt-red');
+                    break;
+                case 2:
+                    $('#number-2').attr('class','red');
+                    $('#number-3').attr('class','red');
+                    $('#txt-2').attr('class','txt-red');
+                    $('#txt-3').attr('class','txt-red');
+                    break;
+                case 3:
+                    $('#number-2').attr('class','red');
+                    $('#number-3').attr('class','red');
+                    $('#number-4').attr('class','red');
+                    $('#txt-2').attr('class','txt-red');
+                    $('#txt-3').attr('class','txt-red');
+                    $('#txt-4').attr('class','txt-red');
+                    break;
+            }
+            switch (sendStatus) {
+                case 1:
+                    $('#number-5').attr('class','red');
+                    $('#txt-5').attr('class','txt-red');
+                    break;
+                case 2:
+                    $('#number-5').attr('class','red');
+                    $('#number-6').attr('class','red');
+                    $('#txt-5').attr('class','txt-red');
+                    $('#txt-6').attr('class','txt-red');
+                    break;
+                case 3:
+                    $('#number-5').attr('class','red');
+                    $('#number-6').attr('class','red');
+                    $('#number-7').attr('class','red');
+                    $('#txt-5').attr('class','txt-red');
+                    $('#txt-6').attr('class','txt-red');
+                    $('#txt-7').attr('class','txt-red');
+                    break;
+            }
+        } else if (customerIsSolve == 4) {
+            switch (backStatus) {
+                case 1:
+                    $('#number-2').attr('class','red');
+                    $('#txt-2').attr('class','txt-red');
+                    break;
+                case 2:
+                    $('#number-2').attr('class','red');
+                    $('#number-3').attr('class','red');
+                    $('#txt-2').attr('class','txt-red');
+                    $('#txt-3').attr('class','txt-red');
+                    break;
+                case 3:
+                    $('#number-2').attr('class','red');
+                    $('#number-3').attr('class','red');
+                    $('#number-4').attr('class','red');
+                    $('#txt-2').attr('class','txt-red');
+                    $('#txt-3').attr('class','txt-red');
+                    $('#txt-4').attr('class','txt-red');
+                    break;
+            }
+            switch (sendStatus) {
+                case 1:
+                    $('#number-7').attr('class','red');
+                    $('#txt-7').attr('class','txt-red');
+                    break;
+                case 2:
+                    $('#number-7').attr('class','red');
+                    $('#number-8').attr('class','red');
+                    $('#txt-7').attr('class','txt-red');
+                    $('#txt-8').attr('class','txt-red');
+                    break;
+                case 3:
+                    $('#number-7').attr('class','red');
+                    $('#number-8').attr('class','red');
+                    $('#number-9').attr('class','red');
+                    $('#txt-7').attr('class','txt-red');
+                    $('#txt-8').attr('class','txt-red');
+                    $('#txt-9').attr('class','txt-red');
+                    break;
+            }
+            if (detectState == 2 || detectState == 3 || detectState == 4) {
+                $('#number-5').attr('class','red');
+                $('#txt-5').attr('class','txt-red');
+            }
+            if (maintenanceIsRepair != null && maintenanceIsRepair != '') {
+                $('#number-6').attr('class','red');
+                $('#txt-6').attr('class','txt-red');
+            }
+        } else if (customerIsSolve == 5) {
+            $('#number-2').attr('class','red');
+            $('#txt-2').attr('class','txt-red');
+            switch (sendStatus) {
+                case 1:
+                    $('#number-3').attr('class','red');
+                    $('#txt-3').attr('class','txt-red');
+                    break;
+                case 2:
+                    $('#number-3').attr('class','red');
+                    $('#number-4').attr('class','red');
+                    $('#number-5').attr('class','red');
+                    $('#txt-3').attr('class','txt-red');
+                    $('#txt-4').attr('class','txt-red');
+                    $('#txt-5').attr('class','txt-red');
+                    break;
+                case 3:
+                    $('#number-3').attr('class','red');
+                    $('#number-4').attr('class','red');
+                    $('#number-5').attr('class','red');
+                    $('#number-6').attr('class','red');
+                    $('#txt-3').attr('class','txt-red');
+                    $('#txt-4').attr('class','txt-red');
+                    $('#txt-5').attr('class','txt-red');
+                    $('#txt-6').attr('class','txt-red');
+                    break;
+            }
+        } else if (customerIsSolve == 6 || customerIsSolve == 7) {
+            switch (backStatus) {
+                case 1:
+                    $('#number-2').attr('class', 'red');
+                    $('#txt-2').attr('class', 'txt-red');
+                    break;
+                case 2:
+                    $('#number-2').attr('class', 'red');
+                    $('#number-3').attr('class', 'red');
+                    $('#txt-2').attr('class', 'txt-red');
+                    $('#txt-3').attr('class', 'txt-red');
+                    break;
+                case 3:
+                    $('#number-2').attr('class', 'red');
+                    $('#number-3').attr('class', 'red');
+                    $('#number-4').attr('class', 'red');
+                    $('#txt-2').attr('class', 'txt-red');
+                    $('#txt-3').attr('class', 'txt-red');
+                    $('#txt-4').attr('class', 'txt-red');
+                    break;
+            }
+            if (detectState == 2 || detectState == 3 || detectState == 4) {
+                $('#number-5').attr('class', 'red');
+                $('#txt-5').attr('class', 'txt-red');
+            }
+        }
     }
 
 </script>

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

@@ -66,7 +66,7 @@
                         <select class="my-select" name="visitAdminId" id="visitAdminId" style="height: 36px;width: 200px;margin: 0px;padding: 6px 10px 6px 15px;">
                         <#if adminList?? &&  (adminList?size > 0) >
                             <#list adminList as admin>
-                                <option value ="${admin.adminId!}" >${admin.adminName!}</option>
+                                <option value ="${admin.adminId!}" <#if loginAdminId??><#if admin.adminId == loginAdminId >selected="selected"</#if></#if> >${admin.adminName!}</option>
                             </#list>
                         </#if>
                         </select>
@@ -75,7 +75,7 @@
                 </div>
                 <div style="margin-left: 10px;">
                     <label>
-                        您将为 自己 指定一个回访任务。<br/>
+                        您将为 <label id="visit-admin" style="color: red;">自己</label> 指定一个回访任务。<br/>
                         提示原则:<br/>
                         1、上午的回访 系统将在16日晚上22点、17日早晨9:30提醒您;<br/>
                         2、中午的回访 系统将在本日12点提醒您;<br/>
@@ -824,17 +824,17 @@
         </div>
         <!-- 补发处理end -->
         <form action="${path}/admin/customer/select_customer_list" method="post">
-            <button type="button" style="cursor:pointer; float: left;" class="my-btn-search" onclick="toAddCustomer();">新建客诉</button>
-            <input type="text" class="my-input"  style="width:100px;margin-right: 0px;" value="${customerId!}" placeholder="客户姓名" id="customerName" name="customerName">
-            <input type="text" class="my-input"  style="width:100px;margin-right: 0px;" value="${customerId!}" placeholder="客户电话号码" id="customerTel" name="customerTel">
-            <input type="text" class="my-input"  style="width:100px;margin-right: 0px;" value="${customerId!}" placeholder="请输入问题描述" id="describeTitle" name="describeTitle">
+            <button type="button" style="cursor:pointer; float: left;height: 35px;" class="my-btn-search" onclick="toAddCustomer();">新建客诉</button>
+            <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${customerId!}" placeholder="请输入姓名" id="customerName" name="customerName">
+            <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${customerId!}" placeholder="请输入电话号码" id="customerTel" name="customerTel">
+            <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${customerId!}" placeholder="请输入问题描述" id="describeTitle" name="describeTitle">
             <select class="my-select" name="customerSource" id="customerSource" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
                 <option value="">来源</option>
                 <option value="1" <#if customerInfo.customerSourceType??><#if customerInfo.customerSourceType == "1" >selected="selected"</#if></#if>>400电话</option>
                 <option value="2" <#if customerInfo.customerSourceType??><#if customerInfo.customerSourceType == "2" >selected="selected"</#if></#if>>微信公众号</option>
                 <option value="3" <#if customerInfo.customerSourceType??><#if customerInfo.customerSourceType == "3" >selected="selected"</#if></#if>>其他</option>
             </select>
-            <select class="my-select" name="typeId" id="typeId" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
+            <select class="my-select" name="typeId" id="typeId" style="height: 36px;width: 120px;margin: 0px;">
                 <option value ="">客诉产品</option>
                 <#if typeList?? &&  (typeList?size > 0) >
                     <#list typeList as type>
@@ -842,7 +842,7 @@
                     </#list>
                 </#if>
             </select>
-            <select class="my-select" name="complaintId" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
+            <select class="my-select" name="complaintId" style="height: 36px;width: 120px;margin: 0px;">
                 <option value ="">客诉类型</option>
                 <#if complaintTypeList?? &&  (complaintTypeList?size > 0) >
                     <#list complaintTypeList as complaint>
@@ -850,12 +850,12 @@
                     </#list>
                 </#if>
             </select>
-            <select class="my-select" name="customerIsVisit" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
+            <select class="my-select" name="customerIsVisit" style="height: 36px;width: 120px;margin: 0px;>
                 <option value ="">是否需要回访</option>
                 <option value ="1" <#if customerInfo.customerIsVisit??><#if customerInfo.customerIsVisit == "1" >selected="selected"</#if></#if>>不需要回访</option>
                 <option value ="2" <#if customerInfo.customerIsVisit??><#if customerInfo.customerIsVisit == "2" >selected="selected"</#if></#if>>需要回访</option>
             </select>
-            <select class="my-select" name="adminId" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
+            <select class="my-select" name="adminId" style="height: 36px;width: 120px;margin: 0px;">
                 <option value ="">跟进客服</option>
                 <#if adminList?? &&  (adminList?size > 0) >
                     <#list adminList as admin>
@@ -863,7 +863,7 @@
                     </#list>
                 </#if>
             </select>
-            <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+            <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 35px;" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
         </form>
     </div>
 
@@ -874,7 +874,7 @@
         <tr class="text-c">
             <th width="50">跟进客服</th>
             <th width="60">姓名</th>
-            <th width="100">电话</th>
+            <th width="70">电话</th>
             <th width="80">来源入口</th>
             <th width="80">客诉产品</th>
             <th width="80">客诉类型</th>
@@ -882,12 +882,12 @@
             <th width="100">问题简述</th>
             <th width="80">销售</th>
             <th width="80">购买日期</th>
-            <th width="80">区域</th>
-            <th width="80">TDS</th>
+            <th width="60">区域</th>
+            <th width="60">TDS</th>
             <th width="80">处理结果</th>
             <th width="80">需要回访</th>
             <th width="80">客诉时间</th>
-            <th width="80">操作</th>
+            <th width="100">操作</th>
         </tr>
         </thead>
         <tbody>
@@ -896,7 +896,11 @@
                         <tr class="text-c">
                             <td>${customer.adminName!''}</td>
                             <td>${customer.customerName!''}</td>
-                            <td>${customer.customerTel!''}</td>
+                            <#if (customer.customerTel)?? && customer.customerTel?length gt 7>
+                                <td>${customer.customerTel?substring(0,3)}***${customer.customerTel?substring(customer.customerTel?length-4,customer.customerTel?length)}</td>
+                            <#else>
+                                <td>${customer.customerTel!''}</td>
+                            </#if>
                             <td>
                                 <#if customer.customerSourceType == 1>
                                     400电话
@@ -912,15 +916,15 @@
                             <td>
                                 ${customer.describeTitle!'暂无'}
                                     <#if customer.describeTitle??>
-                                        <a style="text-decoration:none" href="javascript:void(0);" title="查看详情" onclick="getDescribeInfo(${customer.customerId!''})">
-                                            <i class="Hui-iconfont">查看详情</i>
+                                        <a style="" href="javascript:void(0);" title="查看详情" onclick="getDescribeInfo(${customer.customerId!''})">
+                                            查看详情
                                         </a>&nbsp;
                                     </#if>
                             </td>
-                            <td>${customer.companyName!''}-${customer.storeName!''}</td>
-                            <td>${(customer.salesTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
+                            <td>${customer.companyName!''}<br/>${customer.storeName!''}</td>
+                            <td>${(customer.salesTime?string("yyyy-MM-dd"))!''}</td>
                             <td>${customer.customerArea!''}</td>
-                            <td>进${customer.customerInTDS!'0'}出${customer.customerOutTDS!'0'}</td>
+                            <td>进${customer.customerInTDS!'0'}<br/>出${customer.customerOutTDS!'0'}</td>
                             <td id="txt_customerIsSolve">
                                 <#if customer.customerIsSolve == 1>
                                     已解决
@@ -1025,41 +1029,36 @@
                                     不需要回访
                                 <#elseif customer.customerIsVisit == "2">
                                     <#if customer.visitStatus == 1>
-                                        待回访
+                                        待回访<font style="color:red;">(${(customer.visitDate?string("yyyy-MM-dd"))!''}完成)</font>
                                     <#elseif customer.visitStatus == 2>
-                                        已回访
+                                        已回访<br/>
                                         <a style="text-decoration:none" href="javascript:void(0);" title="回访内容" onclick="getVisitInfo(${customer.customerId!''})">
                                             <i class="Hui-iconfont">回访内容</i>
                                         </a>&nbsp;
                                     </#if>
                                 </#if>
                             </td>
-                            <td>${(customer.customerCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
+                            <td>${(customer.customerCreateTime?string("yyyy-MM-dd"))!''}</td>
                             <td>
                                 <#if customer.customerIsSolve == 2>
                                     <a style="text-decoration:none" href="javascript:void(0);" title="已解决" onclick="updateCustomerIsSolve(${customer.customerId!''})">
                                         <i class="Hui-iconfont">已解决</i>
-                                    </a>&nbsp;
+                                    </a><br/>
                                 </#if>
                                 <a style="text-decoration:none" href="javascript:void(0);" title="详情" onclick="admin_details_customer(${customer.customerId!''})">
                                     <i class="Hui-iconfont">详情</i>
-                                </a>&nbsp;
+                                </a><br/>
                                 <#if customer.customerIsVisit == "2">
                                     <#if customer.visitStatus == 1 && customer.customerIsVisit == "2">
                                         <a style="text-decoration:none" href="javascript:void(0);" title="已完成回访" onclick="showVisitFinish(${customer.customerId!''})">
-                                            <i class="Hui-iconfont">
-                                                已完成回访
-                                            </i>
-                                        </a>&nbsp;
+                                            <i class="Hui-iconfont">已完成回访</i>
+                                        </a><br/>
                                     </#if>
                                 </#if>
-                                <#--<a style="text-decoration:none" href="javascript:void(0);" title="修改客诉信息" onclick="admin_update_customer(${customer.customerId!''})">
-                                    <i class="Hui-iconfont">修改客诉信息</i>
-                                </a>&nbsp;-->
                                 <#if customer.customerIsVisit == "1">
                                     <a style="text-decoration:none" href="javascript:void(0)" title="需要回访" onclick="showVisit(${customer.customerId!''})">
                                         <i class="Hui-iconfont">需要回访</i>
-                                    </a>
+                                    </a><br/>
                                 </#if>
                             </td>
                         </tr>
@@ -1080,6 +1079,7 @@
     var uname = /^[\u4e00-\u9fa5a-zA-Z]{1,12}$/; //中文英文
     var money = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;//金额
     var flag = true;
+    var loginAdminId = ${loginAdminId!''};
 
     /**
      * 跳转到添加customer页面
@@ -1176,6 +1176,16 @@
         }
     }
 
+    $('#visitAdminId').change(function() {
+        var name = $('#visitAdminId option:selected').html();
+        var adminId = $('#visitAdminId option:selected').val();
+        if (adminId == loginAdminId) {
+            $('#visit-admin').html('自己');
+        } else {
+            $('#visit-admin').html(name);
+        }
+    })
+
     /**
      * 添加回访完成信息
      */

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

@@ -23,6 +23,7 @@
         .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
         input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
         input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .huanhang{ float:left}
     </style>
     <meta name="keywords" content="${path}">
     <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
@@ -31,19 +32,26 @@
 <article class="page-container">
     <form class="form form-horizontal" id="form-admin-add">
         <div class="input-box">
-            <span class="input-dic" style="margin-top: 0">检测产品&nbsp;&nbsp;</span>
-            <label for="radio-1">
-                <select name="productId" style="width:100px" class="select">
-                <#if (productList ?size > 0)>
-                    <#list productList as list>
-                        <option value ="${list.productId}">${list.productName}</option>
-                    </#list>
-                <#else >
-                    <option value ="">暂无产品,请先添加产品</option>
-                </#if>
-                </select>
-                <input class="input-text" type="text" id="machineNo" name="machineNo" style="width: 50%;" placeholder="机器编号" />
-            </label>
+            <label class="form-label col-2 col-sm-2 huanhang">检测产品:</label>
+            <div class="formControls col-9 col-sm-9 text-c huanhang">
+
+            <#if (productList?size > 0)>
+                <#list productList as product>
+                    <input type="radio" id="radio-${product.productId!''}" name="productId" value="${product.productId!''}" <#if product_index == 0>checked</#if>/>${product.productName!''}
+                    <select name="colorId${product.productId!''}" id="colorId${product.productId!''}" style="width:60px" class="select">
+                        <#if (product.colorList?size > 0)>
+                            <#list product.colorList as colorList>
+                                <option value ="${colorList.colorId!''}">${colorList.colorName!''}</option>
+                            </#list>
+                        <#else>
+                            <option value ="">暂无颜色</option>
+                        </#if>
+                    </select>
+                    <input class="input-text" type="text" id="maintenanceEquipmentNumber${product.productId!''}" name="maintenanceEquipmentNumber${product.productId!''}" style="width: 20%;" placeholder="机器编号" /><br>
+                </#list>
+            </#if>
+
+            </div>
         </div>
 
         <#--<div class="input-box">

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

@@ -25,7 +25,7 @@
 <div class="page-container">
     <div class="text-c">
         <form name="form1" action="${path}/admin/detect/select_detect_list" method="post">
-            <button type="button" style="cursor:pointer;float: left;" class="my-btn-search" onclick="add_detect('添加品质检测','${path}/admin/detect/to_add_detect','570','450');">新建品检</button>
+            <button type="button" style="cursor:pointer;float: left;" class="my-btn-search" onclick="add_detect('添加品质检测','${path}/admin/detect/to_add_detect','670','450');">新建品检</button>
             <input class="my-input" style="width: 70px;" type="text" name="questionTitle" value="${questionTitle!}" placeholder="客诉问题"/>
             <input class="my-input" style="width: 70px;" type="text" name="detectPhenomenon" value="${detectPhenomenon!}" placeholder="工厂检测现象"/>
             <input class="my-input" style="width: 70px;" type="text" name="detectFailureCause" value="${detectFailureCause!}" placeholder="故障原因"/>

+ 160 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/add_maintenance.ftl

@@ -0,0 +1,160 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>添加维修记录</title>
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .huanhang{ float:left}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="input-box">
+            <label class="form-label col-2 col-sm-2 huanhang">维修产品:</label>
+            <div class="formControls col-10 col-sm-10 text-c huanhang">
+
+            <#if (productList?size > 0)>
+                <#list productList as product>
+                    <input type="radio" id="radio-${product.productId!''}" name="productId" value="${product.productId!''}" <#if product_index == 0>checked</#if>/>${product.productName!''}
+                    <select name="colorId${product.productId!''}" id="colorId${product.productId!''}" style="width:60px" class="select">
+                        <#if (product.colorList?size > 0)>
+                            <#list product.colorList as colorList>
+                                <option value ="${colorList.colorId!''}">${colorList.colorName!''}</option>
+                            </#list>
+                        <#else>
+                            <option value ="">暂无颜色</option>
+                        </#if>
+                    </select>
+                    <input class="input-text" type="text" id="maintenanceEquipmentNumber${product.productId!''}" name="maintenanceEquipmentNumber${product.productId!''}" style="width: 20%;" placeholder="机器编号" /><br>
+                </#list>
+            </#if>
+
+            </div>
+        </div>
+
+    <#--<div class="input-box">
+        <span class="input-dic" style="margin-top: 0">&nbsp;</span>
+
+        <label for="radio-2" style="margin-left: 50px;">
+            <input type="radio" id="radio-2" name="detectProductType" value="2"/>配件
+            <select name="productId2" class="select" style="width:100px">
+            <#if (listFittings ?size > 0)>
+                <#list listFittings as list>
+                    <option value ="${list.fittingsId}">${list.fittingsName}</option>
+                </#list>
+            <#else >
+                <option value ="">暂无配件,请先添加配件</option>
+            </#if>
+            </select>
+        </label>
+    </div>-->
+
+        <div class="input-box"><span class="input-dic spanhidth">维修日期</span><input class="my-input-date" type="text" style="width: 76%;"  name="maintenanceContent_Date" id="maintenanceContentDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/> </div>
+
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">维修结果</span>
+            <label for="radio-3">
+                <input type="radio" id="radio-3" name="maintenanceState" value="1" checked/>正在维修
+            </label>
+            <label for="radio-4" style="margin-left: 50px;">
+                <input type="radio" id="radio-4" name="maintenanceState" value="2"/>已完成
+
+            </label>
+        </div>
+
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">是否可返修</span>
+            <label for="radio-5">
+                <input type="radio" id="radio-5" name="maintenanceIsRepair" value="1" checked/>不可返修
+            </label>
+            <label for="radio-6" style="margin-left: 50px;">
+                <input type="radio" id="radio-6" name="maintenanceIsRepair" value="2"/>可返修
+            </label>
+        </div>
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">是否可入库</span>
+            <label for="radio-7">
+                <input type="radio" id="radio-7" name="maintenanceIsWarehousing" value="2" checked/>已入库
+            </label>
+            <label for="radio-8" style="margin-left: 50px;">
+                <input type="radio" id="radio-8" name="maintenanceIsWarehousing" value="1"/>未入库
+            </label>
+            <label for="radio-9" style="margin-left: 50px;">
+                <input type="radio" id="radio-9" name="maintenanceIsWarehousing" value="3"/>无法入库
+            </label>
+        </div>
+
+        <div class="input-box">
+            <span class="input-dic spanhidth">备注</span>
+            <textarea rows="3" cols="20" name="maintenanceDesc" id="maintenanceDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
+        </div>
+        <div>
+            <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+
+    function  add() {
+        var maintenanceContentDate = $("#maintenanceContentDate").val();
+        if( maintenanceContentDate == null || maintenanceContentDate == "" ){
+            layer.msg('请选择检测日期',{icon: 5,time:1000});
+            return;
+        }
+
+        var maintenanceDesc = $("#maintenanceDesc").val();
+        if( !maintenanceDesc == null){
+            if( maintenanceDesc.length > 150 ){
+                layer.msg('备注长度不得大于150个字符',{icon: 5,time:1000});
+                return;
+            }
+        }
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/maintenance/add_maintenance",
+            data:$('#form-admin-add').serialize(),// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    layer.msg('添加成功',{icon: 1,time:1000},function () {
+                        window.parent.location.reload();
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index)
+                    });
+                } else {
+                    layer.msg('添加失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('添加错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 146 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/complete_reorder.ftl

@@ -0,0 +1,146 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>完成返修</title>
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .huanhang{ float:left}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="input-box"   style="text-align:center;">
+            <span class="input-dic spanhidth" style=" margin-top: 10px;">机器编码</span>
+            <input class="my-input" style="width: 80%;" value="${maintenanceInfo.maintenanceEquipmentNumber!''}" type="text" id="maintenanceEquipmentNumber" name="maintenanceEquipmentNumber" placeholder="请输入机器编码"/>
+        </div>
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">维修结果</span>
+            <label for="radio-3">
+                <input type="radio" id="radio-3" name="maintenanceState" value="1"  <#if maintenanceInfo.maintenanceState == 1>checked</#if>/>正在维修
+            </label>
+            <label for="radio-4" style="margin-left: 50px;">
+                <input type="radio" id="radio-4" name="maintenanceState" value="2"  <#if maintenanceInfo.maintenanceState == 2>checked</#if>/>已完成
+
+            </label>
+        </div>
+
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">是否可返修</span>
+            <label for="radio-5">
+                <input type="radio" id="radio-5" name="maintenanceIsRepair" value="1" <#if maintenanceInfo.maintenanceIsRepair == 1>checked</#if>/>不可返修
+            </label>
+            <label for="radio-6" style="margin-left: 50px;">
+                <input type="radio" id="radio-6" name="maintenanceIsRepair" value="2" <#if maintenanceInfo.maintenanceIsRepair == 2>checked</#if> />可返修
+            </label>
+        </div>
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">是否可入库</span>
+            <label for="radio-7">
+                <input type="radio" id="radio-7" name="maintenanceIsWarehousing" value="2" <#if maintenanceInfo.maintenanceIsWarehousing == 2>checked</#if>/>已入库
+            </label>
+            <label for="radio-8" style="margin-left: 50px;">
+                <input type="radio" id="radio-8" name="maintenanceIsWarehousing" value="1" <#if maintenanceInfo.maintenanceIsWarehousing == 1>checked</#if> />未入库
+            </label>
+            <label for="radio-9" style="margin-left: 50px;">
+                <input type="radio" id="radio-9" name="maintenanceIsWarehousing" value="3" <#if maintenanceInfo.maintenanceIsWarehousing == 3>checked</#if> />无法入库
+            </label>
+        </div>
+
+        <div class="input-box">
+            <textarea rows="3" cols="20" name="maintenanceAnalysis" id="maintenanceAnalysis" class="my-textarea" placeholder="请详细描述维修记录">${maintenanceInfo.maintenanceAnalysis!''}</textarea>
+        </div>
+        <div  style="text-align:center; width:100%;height:100%;margin:0px; " >
+            <input type="hidden" value="${maintenanceInfo.maintenanceId!''}" name="maintenanceId" id="maintenanceId">
+            <button type="button" class="my-btn-submit" onclick="add();">提交</button>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+    function  add() {
+        var maintenanceEquipmentNumber = $("#maintenanceEquipmentNumber").val();
+        if( maintenanceEquipmentNumber != null){
+            if( maintenanceEquipmentNumber.length > 20 ){
+                layer.msg('机器编号长度不得大于20个字符',{icon: 5,time:1000});
+                return;
+            }
+            var msg = true;
+            $.ajax({
+                cache: true,
+                type: "POST",
+                url: "${path}/admin/maintenance/select_outbound",
+                data:{"machineNum":maintenanceEquipmentNumber},// 你的formid
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 500) {
+
+                            msg = false;
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg('修改错误',{icon: 5,time:1000});
+                }
+            });
+        }
+        if(!msg){
+            layer.msg('该机器编号不存在,请先到机器列表添加翻新机,',{icon: 5,time:1000});
+            return;
+        }
+        var maintenanceAnalysis = $("#maintenanceAnalysis").val();
+        if( maintenanceAnalysis == null || maintenanceAnalysis == "" ){
+            layer.msg('请填写维修记录',{icon: 5,time:1000});
+            return;
+        }
+        if( maintenanceAnalysis.length > 300 ){
+            layer.msg('维修记录长度不得大于150个字符',{icon: 5,time:1000});
+            return;
+        }
+
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/maintenance/complete_reorder",
+            data:$('#form-admin-add').serialize(),// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    layer.msg('提交成功',{icon: 1,time:1000},function () {
+                        window.parent.location.reload();
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index)
+                    });
+                } else {
+                    layer.msg('提交失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('提交错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 186 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/maintenance_list.ftl

@@ -0,0 +1,186 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="UTF-8">
+    <title></title>
+<#include "/base/list_base.ftl">
+    <style>
+        *{padding: 0;margin: 0;}
+        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 25px;margin-right: 5px;}
+        /*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
+        .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
+        .barcodeImg{margin:10px 0px}
+        .table-bg thead th{background-color: #e2f6ff;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
+    </style>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> RST管理
+    <span class="c-gray en">&gt;</span> 维修列表
+    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="page-container">
+    <div class="text-c">
+        <form name="form1" action="${path}/admin/maintenance/select_maintenance_list" method="post">
+            <button type="button" style="cursor:pointer;float: left;" class="my-btn-search" onclick="add_maintenance('添加维修记录','${path}/admin/maintenance/to_add_maintenance','670','450');">新建维修工单</button>
+            <input class="my-input" style="width: 70px;" type="text" name="customerIdDescribe" value="${customerIdDescribe!}" placeholder="客诉描述"/>
+            <select class="my-select" name="maintenanceResults" style="height: 30px;width: 150px">
+                <option value ="">QC检测结果</option>
+                <option value ="1" <#if maintenanceResults??><#if maintenanceResults == 1>selected="selected"</#if></#if>>通过</option>
+                <option value ="2" <#if maintenanceResults??><#if maintenanceResults == 2>selected="selected"</#if></#if>>不通过</option>
+            </select>
+            <select class="my-select" name="maintenanceIsRepair" style="height: 30px;width: 150px">
+                <option value ="">是否可返修</option>
+                <option value ="1" <#if maintenanceIsRepair??><#if maintenanceIsRepair == 1>selected="selected"</#if></#if>>未评估</option>
+                <option value ="2" <#if maintenanceIsRepair??><#if maintenanceIsRepair == 2>selected="selected"</#if></#if>>可返修</option>
+                <option value ="3" <#if maintenanceIsRepair??><#if maintenanceIsRepair == 3>selected="selected"</#if></#if>>不可返修</option>
+            </select>
+            <button style="cursor:pointer;" type="submit" class="my-btn-search">搜索</button>
+        </form>
+    </div>
+    <div class="mt-20">
+        <table class="table table-border table-bordered table-bg table-hover table-sort">
+            <thead>
+            <tr class="text-c">
+                <th width="150">设备编号</th>
+                <th width="150">产品类型</th>
+                <th width="90">产品型号</th>
+                <th width="100">状态</th>
+                <th width="100">QC检测结果</th>
+                <th width="100">客诉描述</th>
+                <th width="130">是否可返修</th>
+                <th width="100">是否入库</th>
+                <th width="150">备注</th>
+                <th width="150">返修日期</th>
+                <th width="50">操作</th>
+            </tr>
+            </thead>
+            <tbody id="listid">
+            <#if (page.dataList?size > 0)>
+                <#list page.dataList as maintenanceInfo>
+                <tr>
+                    <td class="text-c" width="100">
+                    <#if !maintenanceInfo.maintenanceEquipmentNumber??>
+                        暂无配件
+                    </#if>
+                    <#if maintenanceInfo.maintenanceEquipmentNumber == ''>
+                        暂无配件
+                    </#if>
+                    <#if maintenanceInfo.maintenanceEquipmentNumber !=''>
+                        ${maintenanceInfo.maintenanceEquipmentNumber!''}(共维修${maintenanceInfo.equipmentNumber!''}次)
+                    </#if>
+
+                    </td>
+                    <td class="text-c" width="160">
+                        <#if maintenanceInfo.productType??>
+                            <#if maintenanceInfo.productType == 1>
+                                净水机
+                            <#else>
+                                配件
+                            </#if>
+                        </#if>
+                    </td>
+                    <td class="text-c" width="100">${maintenanceInfo.maintenanceProductNumber!}</td>
+                    <td class="text-c" width="100">
+                        <#if maintenanceInfo.maintenanceState == 1>
+                            待维修更换
+                        </#if>
+                        <#if maintenanceInfo.maintenanceState == 2>
+                            已完成
+                        </#if>
+                    </td>
+                    <td class="text-c" width="100">
+                    <#if maintenanceInfo.maintenanceResults??>
+                        <#if maintenanceInfo.maintenanceResults == 1>
+                            通过
+                        </#if>
+                        <#if maintenanceInfo.maintenanceResults == 2>
+                            不通过
+                        </#if>
+                    </#if>
+                    </td>
+                    <td class="text-c" width="100">
+                        ${maintenanceInfo.customerIdDescribe!}
+                    </td>
+                    <td class="text-c" width="100">
+                        <#if maintenanceInfo.maintenanceIsRepair == 1>
+                            未评估
+                        </#if>
+                        <#if maintenanceInfo.maintenanceIsRepair == 2>
+                            可返修
+                        </#if>
+                        <#if maintenanceInfo.maintenanceIsRepair == 3>
+                            不可返修
+                        </#if>
+                    </td>
+                    <td class="text-c" width="100">
+                        <#if maintenanceInfo.maintenanceIsWarehousing == 1>
+                            待入库
+                        </#if>
+                        <#if maintenanceInfo.maintenanceIsWarehousing == 2>
+                            已入库
+                        </#if>
+                        <#if maintenanceInfo.maintenanceIsWarehousing == 3>
+                            无法入库
+                        </#if>
+
+                    </td>
+                    <td class="text-c" width="100">${maintenanceInfo.maintenanceDesc!}</td>
+                    <td class="text-c" width="100">${(maintenanceInfo.maintenanceContentDate?string("yyyy-MM-dd"))!''}</td>
+                    <!-- 遍历操作 -->
+                    <td class="td-manage text-c">
+                        <a style="text-decoration:none" href="javascript:;" title="修改维修信息"
+                           onclick="add_maintenance('修改维修信息','${path}/admin/maintenance/to_update_maintenance?maintenanceId=${maintenanceInfo.maintenanceId!''}','570','450');">
+                            <i class="Hui-iconfont">&#xe60c;</i>
+                        </a>
+                        <a style="text-decoration:none" href="javascript:;" title="完善机器编号"
+                           onclick="add_maintenance('完善机器编号','${path}/admin/maintenance/to_perfecting_machine?maintenanceId=${maintenanceInfo.maintenanceId!''}','470','350');">
+                            <i class="Hui-iconfont">&#xe692;</i>
+                        </a>
+                        <a style="text-decoration:none" href="javascript:;" title="完成返修"
+                           onclick="add_maintenance('完成返修','${path}/admin/maintenance/to_complete_reorder?maintenanceId=${maintenanceInfo.maintenanceId!''}','570','450');">
+                            <i class="Hui-iconfont">&#xe676;</i>
+                        </a>
+                        <#--<#if signclosed.signclosedState == 2>
+                            <a style="text-decoration:none" href="javascript:;" title="签收"
+                               onclick="update_info('${path}/admin/signclosed/to_complete_signclosed?signclosedId=${signclosed.signclosedId!''}');">
+                                <i class="Hui-iconfont">&#xe6df;</i>
+                            </a>
+                        </#if>
+                        <a style="text-decoration:none" href="javascript:;" title="修改备注"
+                           onclick="add_remark('修改备注','${path}/admin/signclosed/to_update_remark?signclosedId=${signclosed.signclosedId!''}','570','450');">
+                            <i class="Hui-iconfont">&#xe676;</i>
+                        </a>
+
+                        <#if signclosed.signclosedIsInto == 2>
+                            <a style="text-decoration:none" href="javascript:;" title="转入品检"
+                               onclick="into_complaint('${signclosed.signclosedId!''}');">
+                                <i class="Hui-iconfont">&#xe644;</i>
+                            </a>
+                        </#if>
+-->
+                    </td>
+                </tr>
+                </#list>
+            <#else >
+            <tr><td class="td-manage text-c" colspan = "11">暂时没有维修信息</td></tr>
+            </#if>
+            </tbody>
+        </table>
+    </div>
+</div>
+<div style="padding-top: 10px;"></div>
+<#include "/base/page_util.ftl">
+
+<script type="text/javascript">
+    /*添加*/
+    function add_maintenance(title,url,w,h){
+        layer_show(title,url,w,h);
+    }
+</script>
+</body>
+</html>

+ 136 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/perfecting_machine.ftl

@@ -0,0 +1,136 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>完善机器编号</title>
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(/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(/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .buttoncolor{background-color: #A0A0A0;}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="input-box"   style="text-align:center;">
+            <span class="input-dic spanhidth" style=" margin-top: 10px;">机器编码</span>
+            <input class="my-input" style="width: 62%;" value="${maintenanceInfo.maintenanceEquipmentNumber!''}" type="text" id="maintenanceEquipmentNumber" name="maintenanceEquipmentNumber" placeholder="请输入机器编码"/>
+            <button type="button" class="my-btn-submit" style="width: 16%; margin-top: -2px;" onclick="selectMaintenance();">搜索</button>
+        </div>
+        <div style="text-align:center;">
+            <div id="promptingId"></div>
+            <div id="companyDiv" style="display:none;">
+                <span class="input-dic spanhidth">销售公司</span>
+                <select class="my-select" name="machineSalesCompanyId" style="width: 82%;">
+                    <#if (listSalesCompany?size > 0)>
+                        <#list listSalesCompany as salesCompany >
+                            <option value ="${salesCompany.salesCompanyId!''}">${salesCompany.salesCompanyName!''}</option>
+                        </#list>
+                    </#if>
+                </select>
+                <div class="input-box"><span class="input-dic spanhidth">维修日期</span><input class="my-input-date" value="${(maintenanceInfo.maintenanceContentDate)?string("yyyy-MM-dd")!''}" type="text" style="width: 338px;"  name="machineSales_date" id="machineSalesDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择出库日期" readonly="readonly"/> </div>
+            </div>
+        </div>
+        <div style="text-align:center;">
+            <input type="hidden" value="${maintenanceInfo.maintenanceId!''}" name="maintenanceId" id="maintenanceId">
+           <button type="button" id="maintenanceSubmit" class="my-btn-submit buttoncolor" onclick="add();" disabled>提交</button>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+
+    function  selectMaintenance() {
+        var maintenanceEquipmentNumber = $("#maintenanceEquipmentNumber").val();
+        if( maintenanceEquipmentNumber != null){
+            if( maintenanceEquipmentNumber.length > 40 ){
+                layer.msg('机器编号长度不得大于20个字符',{icon: 5,time:1000});
+                return;
+            }
+        }
+
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/maintenance/select_outbound",
+            data:{"machineNum":maintenanceEquipmentNumber},// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    if(data.returnMsg.ptsMachine.machineSalesState == 2){
+                        $("#promptingId").html('未搜索到出库记录!<br>机器暂无出库(允许提交,将机器出库修改订单对应数据)!');
+                        $("#maintenanceSubmit").removeAttr("disabled");//将按钮可用
+                        $("#maintenanceSubmit").removeClass("buttoncolor");
+                        $("#companyDiv").show();
+                    }else{
+                        $("#promptingId").html("搜索到出库信息:【"+data.returnMsg.ptsMachine.machineSalesCompanyName+"】"+data.returnMsg.ptsMachine.machineSalesDate+" 出库");
+                        $("#maintenanceSubmit").removeAttr("disabled");//将按钮可用
+                        $("#maintenanceSubmit").removeClass("buttoncolor");
+                        $("#companyDiv").hide();
+                    }
+                } else {
+                    $("#promptingId").html('未搜索到机器记录,请先到机器列表添加翻新机!');
+                    $("#maintenanceSubmit").attr("disabled");
+                    $("#maintenanceSubmit").addClass("buttoncolor");
+                    $("#companyDiv").hide();
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('修改错误',{icon: 5,time:1000});
+            }
+        });
+    }
+    function  add() {
+        var maintenanceEquipmentNumber = $("#maintenanceEquipmentNumber").val();
+        if( maintenanceEquipmentNumber != null){
+            if( maintenanceEquipmentNumber.length > 40 ){
+                layer.msg('机器编号长度不得大于20个字符',{icon: 5,time:1000});
+                return;
+            }
+        }
+
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/maintenance/perfecting_machine",
+            data:$('#form-admin-add').serialize(),// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    layer.msg('提交成功',{icon: 1,time:1000},function () {
+                        window.parent.location.reload();
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index)
+                    });
+                } else {
+                    layer.msg('提交失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('提交错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 161 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/update_maintenance.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">
+    <title>修改维修记录 - H-ui.filter v2.4</title>
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .huanhang{ float:left}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="input-box">
+            <label class="form-label col-2 col-sm-2 huanhang">维修产品:</label>
+            <div class="formControls col-10 col-sm-10 text-c huanhang">
+
+            <#if (productList?size > 0)>
+                <#list productList as product>
+                    <input type="radio" id="radio-${product.productId!''}" name="productId" value="${product.productId!''}" <#if product.productId == maintenanceInfo.productId>checked</#if>/>${product.productName!''}
+                    <select name="colorId${product.productId!''}" id="colorId${product.productId!''}" style="width:60px" class="select">
+                        <#if (product.colorList?size > 0)>
+                            <#list product.colorList as colorList>
+                                <option value ="${colorList.colorId!''}">${colorList.colorName!''}</option>
+                            </#list>
+                        <#else>
+                            <option value ="">暂无颜色</option>
+                        </#if>
+                    </select>
+                    <input class="input-text" type="text" id="maintenanceEquipmentNumber${product.productId!''}" name="maintenanceEquipmentNumber${product.productId!''}" style="width: 20%;" placeholder="机器编号" /><br>
+                </#list>
+            </#if>
+
+            </div>
+        </div>
+
+    <#--<div class="input-box">
+        <span class="input-dic" style="margin-top: 0">&nbsp;</span>
+
+        <label for="radio-2" style="margin-left: 50px;">
+            <input type="radio" id="radio-2" name="detectProductType" value="2"/>配件
+            <select name="productId2" class="select" style="width:100px">
+            <#if (listFittings ?size > 0)>
+                <#list listFittings as list>
+                    <option value ="${list.fittingsId}">${list.fittingsName}</option>
+                </#list>
+            <#else >
+                <option value ="">暂无配件,请先添加配件</option>
+            </#if>
+            </select>
+        </label>
+    </div>-->
+
+        <div class="input-box"><span class="input-dic spanhidth">维修日期</span><input class="my-input-date" value="${(maintenanceInfo.maintenanceContentDate)?string("yyyy-MM-dd")!''}" type="text" style="width: 76%;"  name="maintenanceContent_Date" id="maintenanceContentDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择维修日期" readonly="readonly"/> </div>
+
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">维修结果</span>
+            <label for="radio-3">
+                <input type="radio" id="radio-3" name="maintenanceState" value="1"  <#if maintenanceInfo.maintenanceState == 1>checked</#if>/>正在维修
+            </label>
+            <label for="radio-4" style="margin-left: 50px;">
+                <input type="radio" id="radio-4" name="maintenanceState" value="2"  <#if maintenanceInfo.maintenanceState == 2>checked</#if>/>已完成
+
+            </label>
+        </div>
+
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">是否可返修</span>
+            <label for="radio-5">
+                <input type="radio" id="radio-5" name="maintenanceIsRepair" value="1" <#if maintenanceInfo.maintenanceIsRepair == 1>checked</#if>/>不可返修
+            </label>
+            <label for="radio-6" style="margin-left: 50px;">
+                <input type="radio" id="radio-6" name="maintenanceIsRepair" value="2" <#if maintenanceInfo.maintenanceIsRepair == 2>checked</#if> />可返修
+            </label>
+        </div>
+        <div class="input-box">
+            <span class="input-dic" style="margin-top: 0">是否可入库</span>
+            <label for="radio-7">
+                <input type="radio" id="radio-7" name="maintenanceIsWarehousing" value="2" <#if maintenanceInfo.maintenanceIsWarehousing == 2>checked</#if>/>已入库
+            </label>
+            <label for="radio-8" style="margin-left: 50px;">
+                <input type="radio" id="radio-8" name="maintenanceIsWarehousing" value="1" <#if maintenanceInfo.maintenanceIsWarehousing == 1>checked</#if> />未入库
+            </label>
+            <label for="radio-9" style="margin-left: 50px;">
+                <input type="radio" id="radio-9" name="maintenanceIsWarehousing" value="3" <#if maintenanceInfo.maintenanceIsWarehousing == 3>checked</#if> />无法入库
+            </label>
+        </div>
+
+        <div class="input-box">
+            <span class="input-dic spanhidth">备注</span>
+            <textarea rows="3" cols="20" name="maintenanceDesc" id="maintenanceDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!">${maintenanceInfo.maintenanceDesc!''}</textarea>
+        </div>
+        <div>
+            <input type="hidden" value="${maintenanceInfo.maintenanceId!''}" name="maintenanceId" id="maintenanceId">
+            <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+
+    function  add() {
+        var maintenanceContentDate = $("#maintenanceContentDate").val();
+        if( maintenanceContentDate == null || maintenanceContentDate == "" ){
+            layer.msg('请选择检测日期',{icon: 5,time:1000});
+            return;
+        }
+
+        var maintenanceDesc = $("#maintenanceDesc").val();
+        if( !maintenanceDesc == null){
+            if( maintenanceDesc.length > 150 ){
+                layer.msg('备注长度不得大于150个字符',{icon: 5,time:1000});
+                return;
+            }
+        }
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/maintenance/update_maintenance",
+            data:$('#form-admin-add').serialize(),// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    layer.msg('修改成功',{icon: 1,time:1000},function () {
+                        window.parent.location.reload();
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index)
+                    });
+                } else {
+                    layer.msg('修改失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('添加错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>