Browse Source

测试列表

lyhzzz 2 years ago
parent
commit
773c271224

+ 5 - 0
README.md

@@ -3,3 +3,8 @@
 ###**v1.0.0** 
 ~~~~
 ~~~~
+todo:
+    1.取消维修支付检测费用
+    2.维修中添加备件,需再次报价,客户拒绝,按第一次报价流程走
+    3.客户支付,按确认过的报价单支付
+    

+ 1 - 1
src/main/java/com/fdkankan/sale/service/IRepairLogService.java

@@ -16,7 +16,7 @@ import java.util.List;
  */
 public interface IRepairLogService extends IService<RepairLog> {
 
-    void saveBySysUser(Long sysUserId, String repairId,Integer repairStatus,String remark);
+    RepairLog saveBySysUser(Long sysUserId, String repairId,Integer repairStatus,String remark);
 
     List<RepairLog> getByRepairIdAndStatus(String repairId, Integer status);
 

+ 1 - 1
src/main/java/com/fdkankan/sale/service/impl/PriceListServiceImpl.java

@@ -32,7 +32,7 @@ public class PriceListServiceImpl extends ServiceImpl<IPriceListMapper, PriceLis
     @Override
     public BigDecimal getAmountByRepairId(String repairId) {
         BigDecimal amount = BigDecimal.ZERO;
-        List<PriceList> byRepairId = this.getByRepairId(repairId);
+        List<PriceList> byRepairId = this.getByRepairIdAndStatus(repairId,1);
         for (PriceList priceList : byRepairId) {
             amount = amount.add(priceList.getPrice().multiply(new BigDecimal(priceList.getCount())));
         }

+ 11 - 8
src/main/java/com/fdkankan/sale/service/impl/RepairCustomerService.java

@@ -55,16 +55,19 @@ public class RepairCustomerService {
         if(repair.getStatus() != 3){
             throw new BusinessException(ResultCode.REPAIR_STATUS_NOT_EXITS);
         }
-        Integer repairStatus = 5;
-        String remark = "确认维修";
-        if(param.getConfirm() == 1 ){
-            repairStatus = 4;
-            remark = "取消维修";
-        }
-        if(repairStatus == 5){
+
+        if(param.getConfirm() == 0){
             priceListService.updateStatusByRepairId(repair.getRepairId());
+            repairLogService.saveBySysUser(null,repair.getRepairId(),5,"确认维修");
+        }
+        if(param.getConfirm() == 1) {
+            repairLogService.saveBySysUser(null,repair.getRepairId(),4,"取消维修");
+            //存在确认过的报价单,返回维修中
+            List<PriceList> priceLists = priceListService.getByRepairIdAndStatus(repair.getRepairId(),1);
+            if(priceLists !=null && priceLists.size() >0){
+                repairService.updateRepairStatus(repair.getRepairId(),7);
+            }
         }
-        repairLogService.saveBySysUser(null,repair.getRepairId(),repairStatus,remark);
     }
 
     public void comment(RepairParam param) {

+ 4 - 2
src/main/java/com/fdkankan/sale/service/impl/RepairLogServiceImpl.java

@@ -14,6 +14,8 @@ import com.fdkankan.sale.vo.response.RepairLogVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.swing.text.rtf.RTFEditorKit;
+
 /**
  * <p>
  *  服务实现类
@@ -33,7 +35,7 @@ public class RepairLogServiceImpl extends ServiceImpl<IRepairLogMapper, RepairLo
      *      *        9待支付(已完结),10待发货,11已发货,12已评价
      */
     @Override
-    public void saveBySysUser(Long sysUserId, String repairId,Integer repairStatus,String remark) {
+    public RepairLog saveBySysUser(Long sysUserId, String repairId,Integer repairStatus,String remark) {
         RepairLog repairLog = new RepairLog();
         repairLog.setRepairId(repairId);
         repairLog.setRepairStatus(repairStatus);
@@ -42,7 +44,7 @@ public class RepairLogServiceImpl extends ServiceImpl<IRepairLogMapper, RepairLo
         repairLog.setUpdateTime(null);
         this.save(repairLog);
         repairService.updateRepairStatus(repairId,repairStatus);
-
+        return repairLog;
     }
 
     @Override

+ 2 - 0
src/main/java/com/fdkankan/sale/service/impl/RepairPersonnelService.java

@@ -106,6 +106,8 @@ public class RepairPersonnelService {
         HashMap<Integer,Integer> partIdMap = new HashMap<>();
         registerParts.forEach(entity -> partIdMap.putIfAbsent(entity.getPartId(),entity.getId()));
 
+        repairLogService.saveBySysUser(userId,repair.getRepairId(),2,"维修登记");
+
         for (RepairRegisterPartVo partVo : param.getPartList()) {
             Part part = partService.getById(partVo.getPartId());
             if(part == null){

+ 5 - 0
src/main/java/com/fdkankan/sale/service/impl/RepairSaleService.java

@@ -1,4 +1,5 @@
 package com.fdkankan.sale.service.impl;
+import java.math.BigDecimal;
 import java.util.Date;
 
 import com.alibaba.fastjson.JSONObject;
@@ -60,6 +61,10 @@ public class RepairSaleService {
         List<Integer> repairStatus = StatusUtil.getSaleStatus(param.getStatusParam());
         param.setStatusList(repairStatus);
         Page<RepairerVo>  voPage = repairService.saleOrderList(param);
+        for (RepairerVo record : voPage.getRecords()) {
+            BigDecimal payAmount = priceListService.getAmountByRepairId(record.getRepairId());
+            record.setPayAmount(payAmount);
+        }
         return PageInfo.PageInfo(voPage);
 
     }

+ 1 - 0
src/main/java/com/fdkankan/sale/vo/request/WechatMobileParam.java

@@ -5,5 +5,6 @@ import lombok.Data;
 @Data
 public class WechatMobileParam {
     private String repairId;
+    private Integer payType;
     private String orderSn;
 }

+ 4 - 0
src/main/java/com/fdkankan/sale/vo/response/RepairerVo.java

@@ -3,6 +3,7 @@ package com.fdkankan.sale.vo.response;
 import com.fdkankan.sale.entity.Repair;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 @Data
@@ -24,5 +25,8 @@ public class RepairerVo extends Repair {
     private Long saleId;
     private Long repairManId;
 
+
+    private BigDecimal payAmount;
+
 }
 

+ 2 - 2
src/main/resources/mapper/sale/RepairMapper.xml

@@ -78,12 +78,12 @@
     </select>
 
     <select id="testOrderList" resultType="com.fdkankan.sale.vo.response.RepairerVo">
-        select  r.*,rr.check_result,o.create_time as orderReceivingTime, s.nick_name as testerName,c.customer_name,
+        select  r.*,rr.check_result,o.create_time as orderReceivingTime, s.nick_name as testerName,c.customer_name
         from t_repair r
         left join  t_order_receiving o on r.repair_id = o.repair_id
         left join  t_repair_register rr on r.repair_id = rr.repair_id
         left join  t_customer c on r.repair_id = c.repair_id
-        left join  sys_user s on o.test_id = s.id
+        left join  sys_user s on o.tester_id = s.id
         where r.rec_status = 'A' and r.status in
         <foreach item="status" collection="param.statusList" open="(" separator="," close=")">
             #{status}