Explorar el Código

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

# Conflicts:
#	watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintDetectInfoServiceImpl.java
liujiankang hace 5 años
padre
commit
930e212921

+ 28 - 7
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintDetectInfoServiceImpl.java

@@ -237,7 +237,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
             throw new RuntimeException("修改QC检测状态");
         }
 
-        if(record.getMaintenanceResults() == 1){ //maintenanceResults
+        /*if(record.getMaintenanceResults() == 1){ //maintenanceResults
             //判断是否为维修
             ComplaintDetectInfo cdi = complaintDetectInfoMapper.getDetectById(record.getDetectId());
             if(cdi.getProcTypeId() == 3){    //3: 维修
@@ -274,7 +274,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                 inventoryInfo2.setInventoryRecentRecord("退货/换货,从售后不良品仓转入正常销售良品仓(维修ID:"+record.getDetectNumber()+")");
                 inventoryService.addInventory(inventoryInfo2);
             }
-        }
+        }*/
         return flag;
     }
     @Transactional
@@ -308,7 +308,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                         if(record.getIsMaintenance() == 1){
                             record.setDetectState(38);//机器故障,待用户确认
                         }else if(record.getIsMaintenance() == 2){
-                            record.setDetectState(37);//机器无故障,原机退回
+                            record.setDetectState(37);//机器无故障,待用户确认
                         }
                     }else if(procMethod.getProcMethodIsCharge() == 1){//付费
                         record.setDetectState(30);//待用户确认
@@ -368,7 +368,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
             }
             if(complaintDetectInfo.getDetectSource() == 2){//手动添加需要给业务员发送短信
                 //发送短信通知维修检测人员
-                if(record.getDetectState() == 30 || record.getDetectState() == 34|| record.getDetectState() == 38){
+                if(record.getDetectState() == 30 || record.getDetectState() == 34|| record.getDetectState() == 38 || record.getDetectState() == 37){
                     if(complaintDetectInfo.getDetectTel() != null && !complaintDetectInfo.getDetectTel().equals("")){
                         String text = MessageFormat.format(SmsConfig.NOTIFY_SALESMAN, complaintDetectInfo.getDetectName()+complaintDetectInfo.getDetectTel(), ResultInfo.DETECT_MSG+complaintDetectInfo.getDetectId());
                         Admin admin = new Admin();
@@ -471,6 +471,26 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                 detectInfo.setDetectState(35);
                 detectInfo.setCompleteCutTime(date.getTime());
                 break;
+            case 37:
+                if(detectInfo.getDetectProcessingResults() == 1){//付费维修
+                    detectInfo.setDetectState(31);//同意付费维修
+                    detectInfo.setCompleteCutTime(date.getTime());
+                }
+                if(detectInfo.getDetectProcessingResults() == 2){//免费维修
+                    detectInfo.setDetectState(35);//同意免费维修
+                    detectInfo.setCompleteCutTime(date.getTime());
+                }
+                if(detectInfo.getDetectProcessingResults() == 3 || detectInfo.getDetectProcessingResults() == 4){//退货、换货
+                    if(detect.getDetectRenovation() == 1){
+                        detectInfo.setDetectState(20);//待翻新
+                    }else{
+                        detectInfo.setDetectState(22);//待报废
+                    }
+                }
+                if(detectInfo.getDetectProcessingResults() == 5){//原机退回
+                    detectInfo.setDetectState(37);//原机退回
+                }
+                break;
             case 38:
                 if(detectInfo.getDetectProcessingResults() == 1){//付费维修
                     detectInfo.setDetectState(31);//同意付费维修
@@ -545,7 +565,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
     @Override
     public boolean salesmanConfirm(ComplaintDetectInfo detectInfo) {
         ComplaintDetectInfo detect = complaintDetectInfoMapper.getDetectById(detectInfo.getDetectId());
-        if(detect.getDetectState() != 30 && detect.getDetectState() != 34 && detect.getDetectState() != 38){
+        if(detect.getDetectState() != 30 && detect.getDetectState() != 34 && detect.getDetectState() != 38 && detect.getDetectState() != 37){
             return false;
         }
         //计算待维修完成时间
@@ -572,7 +592,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                     detectInfo.setDetectState(35);//同意付费维修
                     detectInfo.setCompleteCutTime(date.getTime());
                 }
-                if(detectInfo.getDetectProcessingResults() == 3 || detect.getDetectProcessingResults() == 4){//退货、换货
+                if(detectInfo.getDetectProcessingResults() == 3 || detectInfo.getDetectProcessingResults() == 4){//退货、换货
                     if(detect.getDetectRenovation() == 1){
                         detectInfo.setDetectState(20);//待翻新
                     }else{
@@ -589,7 +609,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                 log.setDetectId(detectInfo.getDetectId());
                 log.setRecordAdminId(detect.getSalesmanAdminId());
                 log.setRecordDesc(detect.getDetectCustomerDesc());
-                log.setRecordProcessingResults(detect.getDetectProcessingResults());
+                log.setRecordProcessingResults(detectInfo.getDetectProcessingResults());
                 complaintDetectInfoMapper.addTreatmentRecordLog(log);
                 //发送确认短信
                 String results = "";
@@ -616,6 +636,7 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                 return true;
             }
         }catch (Exception e){
+            e.printStackTrace();
             throw new RuntimeException("确认处理失败");
         }
         return false;

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

@@ -182,7 +182,8 @@
     cpms.proc_method_name methodName,
     cpts.proc_type_name typeName,
     cd.company_id companyId,
-    si.store_name signclosedStoreName
+    si.store_name signclosedStoreName,
+    cd.detect_is_download detectIsDownload
     from tb_rst_complaint_detect cd
     LEFT JOIN tb_rst_product_info pi ON cd.product_id = pi.product_id
     LEFT JOIN tb_rst_cm_question_describe qd on cd.customer_id = qd.customer_id

+ 10 - 6
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java

@@ -812,7 +812,6 @@ public class AdminDetectController {
     public void salesOrderExcel(HttpServletRequest request,HttpServletResponse res
             , ComplaintDetectInfo detectInfo) throws Exception{
         //根据id查询订单数据
-        detectInfo.setDetectIsDownload(1);
         List<ComplaintDetectInfo> detectList = complaintDetectInfoService.listComplaintDetect(detectInfo);
         /*if (detectList == null || detectList.size() == 0) {
             return;
@@ -949,11 +948,7 @@ public class AdminDetectController {
             row.createCell(23).setCellValue(detectFloatType);
             row.createCell(24).setCellValue(detect.getDetectVersionNumber()==null?"":detect.getDetectVersionNumber());
 
-            //修改为已打印
-            ComplaintDetectInfo info = new ComplaintDetectInfo();
-            info.setDetectId(detect.getDetectId());
-            info.setDetectIsDownload(2);
-            complaintDetectInfoService.perfectDetect(info);
+
 
         }
         //下载导出订单Excel
@@ -1140,6 +1135,15 @@ public class AdminDetectController {
             }else{
                 row.createCell(15).setCellValue(sdf.format(detect.getDetectPrintTime()));
             }
+
+            if(detect.getDetectIsDownload() == 1){
+                //修改为已打印
+                ComplaintDetectInfo info = new ComplaintDetectInfo();
+                info.setDetectId(detect.getDetectId());
+                info.setDetectIsDownload(2);
+                complaintDetectInfoService.perfectDetect(info);
+            }
+
         }
         //下载导出订单Excel
         downloadOrderExcel(res,wb);

+ 10 - 7
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_relation.ftl

@@ -969,7 +969,7 @@
                                             维修完成
                                         </#if>
                                         <#if detect.detectState == 37>
-                                            机器无故障,原机退回
+                                            机器无故障,待用户确认
                                         </#if>
                                         <#if detect.detectState == 38>
                                             机器故障,待用户确认
@@ -989,13 +989,16 @@
                                     </td>
                                     <td class="text-c" width="100">${detect.productName!'暂无产品'}(${detect.colorName!'暂无颜色'})</td>
                                     <td class="text-c" width="100">
-                                        <#if detect.isMaintenance == 1>
+                                        <#if detect.isMaintenance??>
+                                           <#if detect.isMaintenance == 1>
-                                        <#elseif detect.isMaintenance == 2>
+                                           <#elseif detect.isMaintenance == 2>
-                                        <#else>
+                                           <#else>
                                             机器待检测
+                                           </#if>
                                         </#if>
+
                                     </td>
                                     <td class="text-c" width="100">
                                         <#if detect.detectRenovation??>
@@ -1022,7 +1025,7 @@
                                     <!-- 遍历操作 -->
                                     <td class="td-manage text-c" width="100">
                                         <a onclick="getDetectInfo('${detect.detectId}');">查看详情</a><br>
-                                        <#if detect.detectState == 30 || detect.detectState == 34 || detect.detectState == 38>
+                                        <#if detect.detectState == 30 || detect.detectState == 34 || detect.detectState == 38 || detect.detectState == 37>
                                             <a onclick="to_updateDetectInfo('${(detect.detectId)!}','${(detect.detectState)!}');">维修处理</a>
                                         </#if>
                                     </td>
@@ -2901,7 +2904,7 @@
             $("#updateDetect_2").show();
             $("#updateDetect_3").hide();
         }
-        if(detectState === "38"){
+        if(detectState === "38" || detectState === "37"){
             $("#updateDetect_1").show();
             $("#updateDetect_2").hide();
             $("#updateDetect_3").show();
@@ -2993,7 +2996,7 @@
             detectProcessingResults = $('input[name="detectProcessingResults_2"]:checked').val();//处理结果
             procMethodId = null;
         }
-        if(detectState === "38"){
+        if(detectState === "38" || detectState === "37"){
             detectProcessingResults = $('input[name="detectProcessingResults_1"]:checked').val();//处理结果
             /*if(detectProcessingResults === "5"){
                 procMethodId = null;

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

@@ -283,10 +283,12 @@
             <tr>
                 <th width="10">是否可翻新:</th>
                 <td width="10" style="font-weight: normal;">
-                <#if detectinfo.detectRenovation == 1>
-                    可翻新
-                <#elseif detectinfo.detectRenovation == 2>
-                    不可翻新
+                <#if detectinfo.detectRenovation??>
+                    <#if detectinfo.detectRenovation == 1>
+                        可翻新
+                    <#elseif detectinfo.detectRenovation == 2>
+                        不可翻新
+                    </#if>
                 </#if>
                     </span></td>
                 <td width="10"></td>

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

@@ -226,7 +226,7 @@
                             <span class="c-success">维修完成</span>
                         </#if>
                         <#if detect.detectState == 37>
-                            机器无故障,原机退回
+                            机器无故障,待客服确认
                         </#if>
                         <#if detect.detectState == 38>
                             机器故障,待用户确认
@@ -600,6 +600,10 @@
                     if(detectInfo.questionTitle != null && detectInfo.questionTitle != ""){
                         $("#questionTitleTd").html(detectInfo.questionTitle);
                     }
+
+                    if(detectInfo.questionName != null && detectInfo.questionName != ""){
+                        $("#questionTitleTd").html(detectInfo.questionName);
+                    }
                     if(data.returnMsg.date != null && data.returnMsg.date != ""){
                         $("#date").html(data.returnMsg.date);
                     }

+ 11 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/download_detection.ftl

@@ -38,6 +38,15 @@
                 </div>
             </div>
         </div>
+        <div class="row cl">
+            <div class="formControls col-12 col-sm-12">
+                <strong style="margin-left: 60px;">是否已下载</strong>
+                <select id="detectIsDownload" name="detectIsDownload" class="my-select" style="width: 270px;margin-left: 16px;">
+                         <option value="1" >未下载</option>
+                         <option value="2" >已下载</option>
+                </select>
+            </div>
+        </div>
         <#--<div style="text-align:center;">
             <span>如果转入生产,则生产部门同事可查看!</span>
         </div>-->
@@ -53,8 +62,10 @@
     function  download() {
         var startTime = $("#startTime").val();
         var endTime = $("#endTime").val();
+        var detectIsDownload = $("#detectIsDownload").val();
         window.location="${path}/admin/detect/download_detection?"
                 +"startTime="+startTime
+                +"&detectIsDownload="+detectIsDownload
                 +"&endTime="+endTime;
         /*var index = parent.layer.getFrameIndex(window.name);
         parent.layer.close(index)*/