Browse Source

生产维修模块

liujiankang 7 years ago
parent
commit
c58a9fb754
18 changed files with 1283 additions and 94 deletions
  1. 9 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintDetectInfo.java
  2. 86 5
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintMaintenanceInfo.java
  3. 18 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintQuestionInfo.java
  4. 1 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintDetectInfoServiceImpl.java
  5. 9 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintDetectInfoMapper.xml
  6. 96 32
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintMaintenanceInfoMapper.xml
  7. 9 9
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml
  8. 27 23
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml
  9. 8 5
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java
  10. 187 4
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintMaintenanceController.java
  11. 22 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintQuestionInfoController.java
  12. 21 13
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/add_detect.ftl
  13. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl
  14. 160 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/add_maintenance.ftl
  15. 146 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/complete_reorder.ftl
  16. 186 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/maintenance_list.ftl
  17. 136 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/perfecting_machine.ftl
  18. 161 0
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/maintenance/update_maintenance.ftl

+ 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;
+    }
 }

+ 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);

+ 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>
 
@@ -163,6 +168,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>

+ 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>

+ 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;
+    }
 }

+ 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>