Просмотр исходного кода

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

wangxiaoming 7 лет назад
Родитель
Сommit
ca0c981940

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

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

@@ -88,6 +88,7 @@ public class Repair implements Serializable {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
     private Date salesPayTime;                  //支付时间
+    private String salesDealCode;               //交易号
     private List<ClosedFitting> closedFittings = new ArrayList<ClosedFitting>();//寄回配件集合
 
     private List<ClosedProdcue> closedProdcues = new ArrayList<ClosedProdcue>();//机会产品集合
@@ -443,4 +444,12 @@ public class Repair implements Serializable {
     public void setRepairUpdateTime(Date repairUpdateTime) {
         this.repairUpdateTime = repairUpdateTime;
     }
+
+    public String getSalesDealCode() {
+        return salesDealCode;
+    }
+
+    public void setSalesDealCode(String salesDealCode) {
+        this.salesDealCode = salesDealCode;
+    }
 }

+ 9 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/RepairService.java

@@ -2,6 +2,8 @@ package com.iamberry.rst.faces.cm;
 
 import com.iamberry.rst.core.cm.Repair;
 
+import java.util.List;
+
 /**
  * 维修Service
  * Created by liuzhiwei on 2017/11/8.
@@ -14,4 +16,11 @@ public interface RepairService {
      * @return
      */
     Integer updateRepairInfo(Repair repair);
+
+    /**
+     * 查询售后维修需要同步订单的数据集合
+     * @param repair
+     * @return
+     */
+    List<Repair> listSynchronizingRepair(Repair repair);
 }

+ 7 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/RepairServiceImpl.java

@@ -6,6 +6,8 @@ import com.iamberry.rst.service.cm.mapper.RepairMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 维修Service
  * Created by liuzhiwei on 2017/11/8.
@@ -20,4 +22,9 @@ public class RepairServiceImpl implements RepairService {
     public Integer updateRepairInfo(Repair repair) {
         return repairMapper.updateRepairInfo(repair);
     }
+
+    @Override
+    public List<Repair> listSynchronizingRepair(Repair repair) {
+        return repairMapper.listSynchronizingRepair(repair);
+    }
 }

+ 6 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/RepairMapper.java

@@ -35,4 +35,10 @@ public interface RepairMapper {
      * @return
      */
     Integer updateRepairInfo(Repair repair);
+    /**
+     * 查询售后维修需要同步订单的数据集合
+     * @param repair
+     * @return
+     */
+    List<Repair> listSynchronizingRepair(Repair repair);
 }

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

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

@@ -61,6 +61,9 @@
       <if test="customerId != null and customerId != ''">
         and customer_id = #{customerId}
       </if>
+      <if test="repairSendStatus != null and repairSendStatus != ''">
+        and repair_send_status = #{repairSendStatus}
+      </if>
     </where>
   </select>
 
@@ -244,4 +247,26 @@
       repair_update_time = #{repairUpdateTime,jdbcType=TIMESTAMP}
     where repair_id = #{repairId,jdbcType=INTEGER}
   </update>
+
+
+  <!-- 查询售后维修需要同步订单的数据集合 -->
+  <select id="listSynchronizingRepair" resultType="Repair" parameterType="Repair">
+    select
+    r.*,
+    o.sales_pay_time salesDealCode
+    from
+    tb_rst_repair r
+    LEFT JOIN tb_rst_sales_order_info o ON r.repair_back_efast_order_id = o.sales_orderId
+    <where>
+      <if test="repairState != null">
+        repair_state = #{repairState}
+      </if>
+      <if test="customerId != null and customerId != ''">
+        and customer_id = #{customerId}
+      </if>
+      <if test="repairSendStatus != null and repairSendStatus != ''">
+        and repair_send_status = #{repairSendStatus}
+      </if>
+    </where>
+  </select>
 </mapper>

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

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

@@ -1,13 +1,16 @@
 package com.iamberry.rst.controllers.mq;
 
 import com.iamberry.rst.controllers.sys.SysController;
+import com.iamberry.rst.core.cm.Repair;
 import com.iamberry.rst.core.cm.SalesOrder;
 import com.iamberry.rst.core.cm.SalesOrderItem;
 import com.iamberry.rst.core.cm.StoreInfo;
+import com.iamberry.rst.core.order.EfastOrder;
 import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.sms.OrderMessage;
 import com.iamberry.rst.core.sms.SmsMessage;
 import com.iamberry.rst.core.sys.Relu;
+import com.iamberry.rst.faces.cm.RepairService;
 import com.iamberry.rst.faces.cm.SalesOrderService;
 import com.iamberry.rst.faces.cm.StoreInfoService;
 import com.iamberry.rst.faces.order.EfastOrderService;
@@ -54,6 +57,8 @@ public class MQTask implements InitializingBean {
 	private SalesOrderService salesOrderService;
 	@Autowired
 	private SysService sysService;
+	@Autowired
+	private RepairService repairService;
 
 	private Object lock = new Object();
 	private Object lock1 = new Object();
@@ -215,4 +220,28 @@ public class MQTask implements InitializingBean {
 			} while (returnFlag);    //百胜返回条目数如果等于设置的分页条目数,则继续查询下一页*/
 		}
 	}
+
+	/**客诉系统  自动追踪发货信息**/
+	@Scheduled(cron = "0 0/1 * * * ?")//每三分钟执行一次
+	public void synchronousDelivery()throws Exception{
+		/*同步维修订单*/
+		Repair repair = new Repair();
+		repair.setRepairSendStatus(1);
+		List<Repair> listRepair = repairService.listSynchronizingRepair(repair);
+		if(listRepair.size() > 0){
+			for(Repair re:listRepair){
+				if(re.getSalesDealCode() != null){
+					EfastOrder efastOrder = efastOrderService.getOrderInfoFromEfast(re.getSalesDealCode());
+					/*if (efastOrder.getOrderStatus() == 1){//1代表已发货  发货状态: 0(未发货)1(已发货,即已扫描出库)3(备货中)
+
+					}*/
+				}
+
+			}
+		}
+
+		/*同步换货订单*/
+
+		/*同步补发订单*/
+	}
 }

+ 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/EDWxcT6SlRwlTPRyTI7CHDtsa5VIbLtWgLCKxE4lMCo+4Njm/FyBhmZ8/vfzF9f8C5g7pKI8TvzaeeNu675pH3s5SP/5/bYUmZ5zICom6p41UxsMJ/+7uLSD3+B3uUc+buxwCELiRMiwsrdhUb4OObWd0tguFZdYQZrXGORTbQkUJIb7fctLuzR6OEBTmiC2H1/xEerFLua2LT4neI4VaHNC1MVW818=\"}");
+        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 () {