Browse Source

签收模块修改

liujiankang 7 years ago
parent
commit
eabd6673e0

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

@@ -38,6 +38,7 @@ public class ComplaintSignclosedInfo implements Serializable {
     private Date signclosedCreateTime;//创建时间
     private Date signclosedUpdateTime;//修改时间
 
+    private String customerIdDescribe;//客诉标题
     private List<AwaitingSignclosedProductInfo> awaitingSignclosedProductInfoList = new ArrayList<AwaitingSignclosedProductInfo>();	//待签收实体类
     private List<SignclosedProductInfo> signclosedProductInfoList = new ArrayList<SignclosedProductInfo>();	//签收实体类
     private String provincesName;//寄件地址(省)
@@ -257,4 +258,12 @@ public class ComplaintSignclosedInfo implements Serializable {
     public void setCityName(String cityName) {
         this.cityName = cityName;
     }
+
+    public String getCustomerIdDescribe() {
+        return customerIdDescribe;
+    }
+
+    public void setCustomerIdDescribe(String customerIdDescribe) {
+        this.customerIdDescribe = customerIdDescribe;
+    }
 }

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

@@ -60,11 +60,12 @@
       cd.detect_is_maintenance detectIsMaintenance,
       cd.detect_date detectDate,
       cd.product_color_id productColorId,
-      ci.customer_question_title questionTitle,
+      qd.describe_title questionTitle,
       pi.product_name productName,
       cd.maintenance_results maintenanceResults
-    from tb_rst_complaint_detect cd LEFT JOIN tb_rst_customer_info ci ON cd.customer_id = ci.customer_id
+    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
     <where>
       <if test="detectProductNumber != null and detectProductNumber != ''" >
        AND cd.detect_product_number = #{detectProductNumber,jdbcType=VARCHAR}
@@ -94,7 +95,7 @@
         AND cd.detect_revolution_produced = #{detectRevolutionProduced,jdbcType=BIT}
       </if>
       <if test="questionTitle != null and questionTitle != ''" >
-        AND ci.customer_question_title like CONCAT('%',#{questionTitle},'%')
+        AND qd.describe_title like CONCAT('%',#{questionTitle},'%')
       </if>
       <if test="detectIsMaintenance != null and detectIsMaintenance != ''" >
         AND cd.detect_is_maintenance = #{detectIsMaintenance,jdbcType=BIT}

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

@@ -134,11 +134,13 @@
     cs.signclosed_create_time,
     cs.signclosed_update_time,
     ap.province provincesName,
-    ac.city cityName
+    ac.city cityName,
+    qd.describe_title customerIdDescribe
     FROM
     tb_rst_complaint_signclosed cs
     LEFT JOIN tb_rst_address_province ap ON cs.signclosed_addr_provinces = ap.province_id
     LEFT JOIN tb_rst_address_city ac ON cs.signclosed_addr_city = ac.city_id
+    LEFT JOIN tb_rst_question_describe qd on cs.signclosed_customer_id = qd.customer_id
     <where>
       <if test="signclosedSendName != null and signclosedSendName != ''" >
         cs.signclosed_send_name = #{signclosedSendName}

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

@@ -86,6 +86,10 @@ public class AdminDetectController {
         StringBuilder url = new StringBuilder("/admin/detect/select_detect_list?pageSize=" + pageSize);
 
         // 请求参数
+        if (StringUtils.isNotEmpty(detectInfo.getQuestionTitle())) {
+            url.append("&questionTitle=").append(detectInfo.getQuestionTitle());
+            mv.addObject("questionTitle",detectInfo.getQuestionTitle());
+        }
         if (StringUtils.isNotEmpty(detectInfo.getDetectPhenomenon())) {
             url.append("&detectPhenomenon=").append(detectInfo.getDetectPhenomenon());
             mv.addObject("detectPhenomenon",detectInfo.getDetectPhenomenon());

+ 28 - 45
watero-rst-web/src/main/java/com/iamberry/rst/utils/test.java

@@ -1,55 +1,38 @@
 package com.iamberry.rst.utils;
+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.JSONObject;
+import org.apache.kafka.clients.consumer.ConsumerRecord;
+
+
 import java.io.File;
 import java.io.FileInputStream;
+import java.security.Key;
 
-import javax.print.Doc;
-import javax.print.DocFlavor;
-import javax.print.DocPrintJob;
-import javax.print.PrintService;
-import javax.print.PrintServiceLookup;
-import javax.print.ServiceUI;
-import javax.print.SimpleDoc;
-import javax.print.attribute.DocAttributeSet;
-import javax.print.attribute.HashDocAttributeSet;
-import javax.print.attribute.HashPrintRequestAttributeSet;
-import javax.swing.JFileChooser;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
 
 
 public class test {
+    private static final String AES = "AES";
+
+    public static String decrypt(String encryptedData, String secretKey) throws Exception {
+        Key key = new SecretKeySpec(secretKey.getBytes(), AES);
+        Cipher c = Cipher.getInstance(AES);
+        c.init(2, key);
+        byte[] decodedValue = Base64.decodeBase64(encryptedData);
+        byte[] decValue = c.doFinal(decodedValue);
+        String decryptedValue = StringUtils.newStringUtf8(decValue);
+        return decryptedValue;
+    }
+
 
-            public static void main(String[] args) {
-                //获取系统所有打印机
-                PrintService[] services = PrintServiceLookup.lookupPrintServices(null,null);
-        for (int i = 0;i<=services.length;i++){
-            System.out.println(services[i].getName());
-        }
-        JFileChooser fileChooser = new JFileChooser(); //创建打印作业
-        int state = fileChooser.showOpenDialog(null);
-        if(state == fileChooser.APPROVE_OPTION){
-            File file = new File("D:/123.jpg"); //获取选择的文件
-            //构建打印请求属性集
-            HashPrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
-            //设置打印格式,因为未确定类型,所以选择autosense
-            DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
-            //查找所有的可用的打印服务
-            PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras);
-            //定位默认的打印服务
-            PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();
-            //显示打印对话框
-            PrintService service = ServiceUI.printDialog(null, 200, 200, printService,
-                    defaultService, flavor, pras);
-
-            if(service != null){
-                try {
-                    DocPrintJob job = service.createPrintJob(); //创建打印作业
-                    FileInputStream fis = new FileInputStream(file); //构造待打印的文件流
-                    DocAttributeSet das = new HashDocAttributeSet();
-                    Doc doc = new SimpleDoc(fis, flavor, das);
-                    job.print(doc, pras);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        }
+    public static void main(String[] args) throws Exception {
+        ConsumerRecord<String, String> record = new ConsumerRecord<String, String>("4", 1, 1, "data", "{\"data\":\"7uiBfrOFcdy/EDWxcT6SlZT7AORkrnWt533GP2oqstJT1zxbCQqLcNSyaITdfYZmhmZ8/vfzF9f8C5g7pKI8TvzaeeNu675pH3s5SP/5/bbL/U3eNahyWWQsMG1IhNtU66l6wd5Dwk5OTnoZmtRAliyN4Z9QwWjLU8DB11VW+EUGiD/1RodRhug3+ZLYgebFeJ/qT+1lbw86aX6QZNppgqByHL04wHsuQcOr6BVt1n0=\"}");
+        String appKey = "5kkyurvvtt58bbuxueee";//填APP KEY
+        String secretKey = "rhj6na6u3y6uhy6qrbb3944mg5uqqpbb";//APP SECRET
+        String data = decrypt(JSONObject.fromObject(record.value()).getString("data"),
+                secretKey.substring(8, 24));//解析后的真正数据
+System.out.println(data);
     }
 }

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

@@ -94,8 +94,9 @@
                     <td class="text-c" width="100">${detect.detectResults!}</td>
                     <td class="text-c" width="100">${detect.detectPoint!}</td>
                     <td class="text-c" width="100">${detect.detectAnalysis!}</td>
-                    <td class="text-c" width="100">${detect.customerId!}</td>
+                    <td class="text-c" width="100">${detect.questionTitle!}<br><#if detect.questionTitle??><#if detect.questionTitle != ""><a href="#" onclick="getDescribeInfo(${detect.customerId!});" style="color : #4149FF;">查看详情</a></#if></#if></td>
                     <td class="text-c" width="100">
+                    <#if detect.detectIsMaintenance??>
                         <#if detect.detectIsMaintenance == 2>
                             不需要转入
                         <#else >
@@ -106,6 +107,7 @@
                                 已转入
                             </#if>
                         </#if>
+                    </#if>
                     </td>
                     <td class="text-c" width="100">${detect.detectDesc!}</td>
                     <td class="text-c" width="100">${(detect.detectDate?string("yyyy-MM-dd"))!''}</td>
@@ -115,12 +117,14 @@
                            onclick="add_remark('修改备注','${path}/admin/detect/to_add_remark?detectId=${detect.detectId!''}','570','450');">
                             <i class="Hui-iconfont">&#xe6df;</i>
                         </a>
-                        <#if detect.detectIsMaintenance == 2>
-                            <a style="text-decoration:none" href="javascript:;" title="需要转入生产"
-                               onclick="update_info('需要转入生产','${path}/admin/detect/to_produced_info?detectId=${detect.detectId!''}&state=1','570','450');">
-                                <i class="Hui-iconfont">&#xe644;</i>
-                            </a>
-                        <#else >
+                       <#if detect.detectIsMaintenance??>
+                            <#if detect.detectIsMaintenance == 2>
+                                <a style="text-decoration:none" href="javascript:;" title="需要转入生产"
+                                   onclick="update_info('需要转入生产','${path}/admin/detect/to_produced_info?detectId=${detect.detectId!''}&state=1','570','450');">
+                                    <i class="Hui-iconfont">&#xe644;</i>
+                                </a>
+                            <#else >
+                        </#if>
                             <#if detect.detectRevolutionProduced == 1>
                                 <a style="text-decoration:none" href="javascript:;" title="转入生产"
                                    onclick="update_info('转入生产','${path}/admin/detect/to_detect_complete?detectId=${detect.detectId!''}&state=2','570','450');">
@@ -170,7 +174,12 @@
     function update_info(title,url,w,h){
         layer_show(title,url,w,h);
     }
-
+    /**
+     * 进入查询问题描述信息页面
+     */
+    function getDescribeInfo(customerId) {
+        layer_show("问题描述","${path}/admin/customer/_question_describe?customerId="+customerId,"800","500");
+    }
 </script>
 </body>
 </html>

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

@@ -104,7 +104,9 @@
                     </#if>
                     </td>
                     <td class="text-c" width="100">
-                        ${maintenanceInfo.customerIdDescribe!}
+                    ${maintenanceInfo.customerIdDescribe!}<br>
+                    <#if maintenanceInfo.customerIdDescribe??><#if maintenanceInfo.customerIdDescribe != ""><a href="#" onclick="getDescribeInfo(${maintenanceInfo.maintenanceCustomerId!});" style="color : #4149FF;">查看详情</a></#if></#if>
+
                     </td>
                     <td class="text-c" width="100">
                         <#if maintenanceInfo.maintenanceIsRepair == 1>
@@ -169,6 +171,12 @@
     function add_maintenance(title,url,w,h){
         layer_show(title,url,w,h);
     }
+    /**
+     * 进入查询问题描述信息页面
+     */
+    function getDescribeInfo(customerId) {
+        layer_show("问题描述","${path}/admin/customer/_question_describe?customerId="+customerId,"800","500");
+    }
 </script>
 </body>
 </html>

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

@@ -169,7 +169,7 @@
                             不缺少
                         </#if>
                     </td>
-                    <td class="text-c" width="100">售后原因暂无</td>
+                    <td class="text-c" width="100">${signclosed.customerIdDescribe!}<br><#if signclosed.customerIdDescribe??><#if signclosed.customerIdDescribe != ""><a href="#" onclick="getDescribeInfo(${signclosed.signclosedCustomerId!});"style="color : #4149FF;">查看详情</a></#if></#if></td>
                     <td class="text-c" width="100">${signclosed.signclosedCustomerDesc!}</td>
                     <td class="text-c" width="100">${(signclosed.signclosedDate?string("yyyy-MM-dd"))!''}</td>
                     <td class="text-c" width="100">
@@ -243,6 +243,12 @@
     function update_info(url){
         window.location.href = url;
     }
+    /**
+     * 进入查询问题描述信息页面
+     */
+    function getDescribeInfo(customerId) {
+        layer_show("问题描述","${path}/admin/customer/_question_describe?customerId="+customerId,"800","500");
+    }
     /*转入品检*/
     function into_complaint(signclosedId){
         layer.alert('确定转入到品检部门吗?', function () {