瀏覽代碼

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

# Conflicts:
#	watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminSalesOrderController.java
liujiankang 5 年之前
父節點
當前提交
0220ccc416

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectInfo.java

@@ -119,6 +119,7 @@ public class ComplaintDetectInfo implements Serializable {
     private Date scrapCompletionTime;//报废完成时间
 
     private Integer state;//查询各状态条数
+    private Integer detectIsWhetherLess;//是否少件 1是 2否
 
 
     public Integer getDetectId() {
@@ -736,4 +737,12 @@ public class ComplaintDetectInfo implements Serializable {
     public void setState(Integer state) {
         this.state = state;
     }
+
+    public Integer getDetectIsWhetherLess() {
+        return detectIsWhetherLess;
+    }
+
+    public void setDetectIsWhetherLess(Integer detectIsWhetherLess) {
+        this.detectIsWhetherLess = detectIsWhetherLess;
+    }
 }

+ 15 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -927,6 +927,21 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         if(so.getSalesDeliver() == 2){
             returnInventory(id,so.getSalesWarehouseId());
         }
+        //判断是否绑定维修信息,并解除绑定
+        if(so != null){
+            //查询封装售后维修编号
+            List<ComplaintDetectInfo> listDetect  = complaintDetectInfoMapper.listComplaintDetectBySalesId(so.getSalesOrderId());
+            if(listDetect != null && listDetect.size() > 0){
+                for (ComplaintDetectInfo info: listDetect){
+                    ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+                    detectInfo.setDetectId(info.getDetectId());
+                    detectInfo.setDetectPlaceorder(1);
+                    detectInfo.setSalesOrderId("");
+                    complaintDetectInfoMapper.updateDetectById(detectInfo);
+                }
+            }
+        }
+
         // 检查客诉是否使用订单,如果有使用订单,无法删除
         salesOrderMapper.delOrderItem(id);
         salesOrderMapper.delSalesOrder(id);

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

@@ -59,7 +59,8 @@
       cd.scrap_completion_time scrapCompletionTime,
       qd.describe_content describeContent,
       qd.describe_handle_desc describeHandleDesc,
-      sa.admin_name adminName
+      sa.admin_name adminName,
+      cd.detect_is_whetherLess detectIsWhetherLess
     from tb_rst_complaint_detect cd
     LEFT JOIN tb_rst_cm_question_describe qd on cd.customer_id = qd.customer_id
     LEFT JOIN tb_rst_product_info pi ON cd.product_id = pi.product_id
@@ -168,7 +169,8 @@
     cd.scrap_completion_time scrapCompletionTime,
     qd.describe_content describeContent,
     qd.describe_handle_desc describeHandleDesc,
-    sa.admin_name adminName
+    sa.admin_name adminName,
+    cd.detect_is_whetherLess detectIsWhetherLess
     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
@@ -301,7 +303,7 @@
         and cd.detect_state = 22
       </if>
       <if test="state != null and state == 4">
-        and cd.detect_state in(33,37)
+        and cd.detect_state in(33,37)  and detect_placeorder = 1
       </if>
       <if test="state != null and state == 5">
         and cd.detect_state = 20
@@ -312,6 +314,9 @@
       <if test="maintenanceResults != null and maintenanceResults != ''">
         and cd.maintenance_results = #{maintenanceResults}
       </if>
+      <if test="detectIsWhetherLess != null and detectIsWhetherLess != ''">
+        and cd.detect_is_whetherLess  = #{detectIsWhetherLess}
+      </if>
     </where>
       GROUP BY cd.detect_id
       ORDER BY cd.detect_create_time DESC
@@ -407,7 +412,7 @@
       <if test="detectPlaceorder != null and detectPlaceorder != ''" >
         detect_placeorder = #{detectPlaceorder,jdbcType=INTEGER},
       </if>
-      <if test="salesOrderId != null and salesOrderId != ''" >
+      <if test="salesOrderId != null" >
         sales_orderId = #{salesOrderId,jdbcType=INTEGER},
       </if>
       <if test="detectCompletionTime != null and detectCompletionTime != ''" >
@@ -420,7 +425,10 @@
         renovation_completion_time = #{renovationCompletionTime},
       </if>
       <if test="scrapCompletionTime != null and scrapCompletionTime != ''" >
-        scrap_completion_time = #{scrapCompletionTime}
+        scrap_completion_time = #{scrapCompletionTime},
+      </if>
+      <if test="detectIsWhetherLess != null and detectIsWhetherLess != ''">
+        detect_is_whetherLess  = #{detectIsWhetherLess}
       </if>
     </set>
     where
@@ -459,7 +467,8 @@
     detect_is_refurbishing,
     maintenance_results,
     detect_number,
-    maintenance_cut_time
+    maintenance_cut_time,
+    detect_is_whetherLess
     )
     values
       (
@@ -492,7 +501,8 @@
       #{detectIsRefurbishing},
       #{maintenanceResults},
       #{detectNumber},
-      #{maintenanceCutTime}
+      #{maintenanceCutTime},
+      #{detectIsWhetherLess}
       )
   </insert>
 
@@ -737,7 +747,7 @@
         LEFT JOIN tb_rst_address_district ad on ad.district_id = cs.signclosed_addr_area
         WHERE
             cd.customer_id = #{customerId}
-        AND detect_state in (32,36,37) AND maintenance_results = 1 AND detect_placeorder = 1
+        AND detect_state in (32,33,36,37)  AND detect_placeorder = 1
   </select>
 
 

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_list.ftl

@@ -252,7 +252,7 @@
                                 <#if customer.beRefurbished??><#if customer.beRefurbished gt 0 >待翻新:<span class="c-red">${customer.beRefurbished}</span><br></#if></#if>
                                 <#if customer.beScrapped??><#if customer.beScrapped gt 0 >待报废:<span class="c-red">${customer.beScrapped}</span><br></#if></#if>
                                 <#if customer.beContact??><#if customer.beContact gt 0 >待联系:<span class="c-red">${customer.beContact}</span></#if></#if>
-                                <#--<#if customer.completeMaintenanceNum??><#if customer.completeMaintenanceNum gt 0 >维修完成:<span class="c-success">${customer.completeMaintenanceNum}</span></#if></#if>-->
+                                <#if customer.completeMaintenanceNum??><#if customer.completeMaintenanceNum gt 0 >维修完成:<span class="c-success">${customer.completeMaintenanceNum}</span></#if></#if>
                                 <#if customer.beenScrappedNum??><#if customer.beenScrappedNum gt 0 >已报废:<span class="c-success">${customer.beenScrappedNum}</span></#if></#if>
                                 <#if customer.beenRenovatedNum??><#if customer.beenRenovatedNum gt 0 >已翻新:<span class="c-success">${customer.beenRenovatedNum}</span></#if></#if>
                             </td>