Browse Source

打印机页面修改

liujiankang 7 years ago
parent
commit
69842c294f

+ 18 - 1
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintDetectInfo.java

@@ -43,7 +43,8 @@ public class ComplaintDetectInfo implements Serializable {
     private String questionTitle;//问题标题
     private Integer detectIsMaintenance;//是否需要维修 1 需要 2不需要
     private String productName;//产品名称
-
+    private Integer productTypeId;//产品类型id
+    private String productTypeName;//产品类型名称
 
     public Integer getDetectId() {
         return detectId;
@@ -236,4 +237,20 @@ public class ComplaintDetectInfo implements Serializable {
     public void setProductColorId(Integer productColorId) {
         this.productColorId = productColorId;
     }
+
+    public Integer getProductTypeId() {
+        return productTypeId;
+    }
+
+    public void setProductTypeId(Integer productTypeId) {
+        this.productTypeId = productTypeId;
+    }
+
+    public String getProductTypeName() {
+        return productTypeName;
+    }
+
+    public void setProductTypeName(String productTypeName) {
+        this.productTypeName = productTypeName;
+    }
 }

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

@@ -61,11 +61,12 @@
       cd.detect_date detectDate,
       cd.product_color_id productColorId,
       qd.describe_title questionTitle,
-      pi.product_name productName,
+      pt.type_name productTypeName,
       cd.maintenance_results maintenanceResults
     from tb_rst_complaint_detect cd
         LEFT JOIN tb_rst_product_info pi ON cd.product_id = pi.product_id
         LEFT JOIN tb_rst_question_describe qd on cd.customer_id = qd.customer_id
+        LEFT JOIN tb_rst_product_type pt on pi.product_type = pt.type_id
     <where>
       <if test="detectProductNumber != null and detectProductNumber != ''" >
        AND cd.detect_product_number = #{detectProductNumber,jdbcType=VARCHAR}
@@ -100,6 +101,9 @@
       <if test="detectIsMaintenance != null and detectIsMaintenance != ''" >
         AND cd.detect_is_maintenance = #{detectIsMaintenance,jdbcType=BIT}
       </if>
+      <if test="productTypeId != null" >
+        AND pt.type_id = #{productTypeId,jdbcType=INTEGER}
+      </if>
     </where>
   </select>
   <insert id="insert" parameterType="ComplaintDetectInfo" >

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

@@ -3,6 +3,7 @@ package com.iamberry.rst.controllers.cm;
 import com.iamberry.rst.core.cm.*;
 import com.iamberry.rst.core.order.Order;
 import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.order.ProductType;
 import com.iamberry.rst.core.order.RentType;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
@@ -114,9 +115,9 @@ public class AdminDetectController {
             url.append("&detectFailureClassification=").append(detectInfo.getDetectFailureClassification());
             mv.addObject("detectFailureClassification",detectInfo.getDetectFailureClassification());
         }
-        if (detectInfo.getDetectProductType() != null && detectInfo.getDetectProductType() != -1) {
-            url.append("&detectProductType=").append(detectInfo.getDetectProductType());
-            mv.addObject("detectProductType",detectInfo.getDetectProductType());
+        if (detectInfo.getProductTypeId() != null && detectInfo.getProductTypeId() != -1) {
+            url.append("&productTypeId=").append(detectInfo.getProductTypeId());
+            mv.addObject("productTypeId",detectInfo.getProductTypeId());
         }
 
         // 封装请求数据
@@ -130,7 +131,10 @@ public class AdminDetectController {
             total = pageTotal;
             result.setPages(total);
         }
-
+        //获取所有产品类型
+        ProductType productType = new ProductType();
+        List<ProductType> productTypeList = productService.listProductType(productType);
+        mv.addObject("productTypeList",productTypeList);
         url.append("&pageTotal=").append(total).append("&pageNO=");
         mv.addObject("page", result);
         mv.addObject("url", url.toString());

+ 6 - 2
watero-rst-web/src/main/java/com/iamberry/rst/utils/test.java

@@ -5,6 +5,7 @@ import com.auth0.jwt.internal.org.apache.commons.codec.binary.Base64;
 import com.auth0.jwt.internal.org.apache.commons.codec.binary.StringUtils;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
+import org.apache.kafka.clients.consumer.ConsumerRecord;
 
 
 import java.io.File;
@@ -32,13 +33,16 @@ public class test {
 
 
     public static void main(String[] args) throws Exception {
-        /*ConsumerRecord<String, String> record = new ConsumerRecord<String, String>("4", 1, 1, "data", "{\"data\":\"7uiBfrOFcdy/EDWxcT6SlS1SvUzaqGDqdPa6XsnYNTrplpwdmjgJAo741xY0kRC8hmZ8/vfzF9f8C5g7pKI8TvzaeeNu675pH3s5SP/5/ba4eJOW8Qqwm/1H4nNX+1Ed/CTueaJe3E/BNsFxe7rF+nV1vzOwuvXM6YHC6yYNIi4t16eWO4Fyopbz12I60Pf8CTCNBf4XIxuHSB/BGVZpATEykU1vILnX89GzoJlV+10=\"}");
+        ConsumerRecord<String, String> record = new ConsumerRecord<String, String>("4", 1, 1, "data", "{\"data\":\"7uiBfrOFcdy/EDWxcT6SlSH10bmyKW4BoILZ7f4LQygzN9scB2To4W3gRf0nzI+kHOKWzrv5DHEfJNt9/QrlfTk6VcHGwiPGycwiPvDkoTe4eJOW8Qqwm/1H4nNX+1Ed/CTueaJe3E/BNsFxe7rF+qYIHqZnL4b2n9Padc5ySenpG7G0a5xepWP0KZYDN4KeCTCNBf4XIxuHSB/BGVZpATEykU1vILnX89GzoJlV+10=\"}");
         String appKey = "5kkyurvvtt58bbuxueee";//填APP KEY
         String secretKey = "rhj6na6u3y6uhy6qrbb3944mg5uqqpbb";//APP SECRET
         String data = decrypt(JSONObject.fromObject(record.value()).getString("data"),
                 secretKey.substring(8, 24));//解析后的真正数据
 
         JSONObject jasonObject = JSONObject.fromObject(data);
+
+        System.out.println(jasonObject);
+
         if(jasonObject.has("dps")){
             JSONArray dps = jasonObject.getJSONArray("dps");
             boolean flog = false;
@@ -60,6 +64,6 @@ public class test {
 
                 flog = false;
             }
-        }*/
+        }
     }
 }

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

@@ -40,10 +40,13 @@
                 <option value ="3" <#if detectState??><#if detectState == 3>selected="selected"</#if></#if>>检查通过</option>
                 <option value ="4" <#if detectState??><#if detectState == 4>selected="selected"</#if></#if>>检查未通过</option>
             </select>
-            <select class="my-select" name="detectProductType" style="height: 30px;width: 150px">
+            <select class="my-select" name="productTypeId" style="height: 30px;width: 150px">
                 <option value ="">选择产品类型</option>
-                <option value ="1" <#if detectProductType??><#if detectProductType == 1>selected="selected"</#if></#if>>净水机</option>
-                <option value ="2" <#if detectProductType??><#if detectProductType == 2>selected="selected"</#if></#if>>冲奶机</option>
+                <#if (productTypeList?size > 0)>
+                    <#list productTypeList as typeList>
+                        <option value ="${typeList.typeId!}" <#if productTypeId??><#if productTypeId == typeList.typeId>selected="selected"</#if></#if>>${typeList.typeName!}</option>
+                    </#list>
+                </#if>
             </select>
             <button style="cursor:pointer;" type="submit" class="my-btn-search">搜索</button>
         </form>
@@ -72,7 +75,7 @@
             <#if (page.dataList?size > 0)>
                 <#list page.dataList as detect>
                 <tr>
-                    <td class="text-c" width="100">${detect.productName!}</td>
+                    <td class="text-c" width="100">${detect.productTypeName!}</td>
                     <td class="text-c" width="100">${detect.detectProductNumber!}</td>
                     <td class="text-c" width="100">
                         <#if detect.detectState == 1>