lyhzzz 2 年之前
父節點
當前提交
9e767d3ab0

+ 1 - 1
src/main/java/com/fdkankan/sale/common/FilePath.java

@@ -3,6 +3,6 @@ package com.fdkankan.sale.common;
 public class FilePath {
 
     public static String common = "common";
-    public static String file_path = "/home/backend/4dkankan_v4/sale/file/";
+    public static String file_path = "G:/home/backend/4dkankan_v4/sale/file/";
     public static String oss_file_path = "sale/file/%s/%s";
 }

+ 3 - 3
src/main/java/com/fdkankan/sale/common/RepairStatusEnum.java

@@ -8,10 +8,10 @@ import java.util.stream.Collectors;
 
 public enum  RepairStatusEnum {
 
-    TO_BE_RECEIVED(0, "待接单"),
-    TO_BE_CHECK(10, "待检测"),
+    TO_BE_RECEIVED(0, "待{userName}客服接单"),
+    TO_BE_CHECK(10, "待维修检测"),
     TO_BE_QUOTED(20, "待报价"),
-    TO_BE_CONFIRMED(30, "待确认"),
+    TO_BE_CONFIRMED(30, "待确认报价"),
     TO_BE_CANCELED(40, "已取消"),
     TO_BE_PREPARED(50, "待备料"),
     TO_BE_REPAIRED(60, "维修中"),

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

@@ -46,4 +46,6 @@ public interface IRepairService extends IService<Repair> {
     void updateWarrantyType(String repairId, Integer warrantyType);
 
     void updateCancelStatus(String repairId, Integer status);
+
+    void updateRepairInvoiceStatus(String repairId, Integer InvoiceStatus);
 }

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

@@ -137,6 +137,7 @@ public class RepairCustomerService {
         repairInvoice = new RepairInvoice();
         BeanUtils.copyProperties(param,repairInvoice);
         repairInvoiceService.save(repairInvoice);
+        repairService.updateRepairInvoiceStatus(repair.getRepairId(),1);
 
     }
 

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

@@ -276,6 +276,7 @@ public class RepairInfoService {
 
     public Integer getHaveButton(RepairDetailVo detailVo, Integer status, SysUser user) {
         switch (status){
+            case 0: return  1;
             case 10 :
             case 20 :
             case 30 :

+ 8 - 0
src/main/java/com/fdkankan/sale/service/impl/RepairServiceImpl.java

@@ -173,4 +173,12 @@ public class RepairServiceImpl extends ServiceImpl<IRepairMapper, Repair> implem
         wrapper.set(Repair::getCancelStatus,status);
         this.update(wrapper);
     }
+
+    @Override
+    public void updateRepairInvoiceStatus(String repairId, Integer InvoiceStatus) {
+        LambdaUpdateWrapper<Repair> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(Repair::getRepairId,repairId);
+        wrapper.set(Repair::getInvoiceStatus,InvoiceStatus);
+        this.update(wrapper);
+    }
 }

+ 7 - 19
src/main/java/com/fdkankan/sale/util/MyExcelUtil.java

@@ -5,6 +5,7 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.read.metadata.ReadSheet;
 import com.alibaba.excel.write.handler.SheetWriteHandler;
+import com.alibaba.excel.write.metadata.fill.FillWrapper;
 import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.sale.common.CacheUtil;
 import com.fdkankan.sale.common.FilePath;
@@ -55,7 +56,7 @@ public class MyExcelUtil {
         //获取文件路径
         String templateName = null;
         if(type == 0){
-            templateName = "orderTemplate.xlsx";
+            templateName = "orderTemplate1.xlsx";
         }
         if(type == 1){
             templateName = "repairTemplate.xlsx";
@@ -77,24 +78,11 @@ public class MyExcelUtil {
         String localFilePath = FilePath.file_path + FilePath.common + "/" + fileName;
         File localFile = new File(localFilePath);
         ExcelWriter excelWriter = null;
-        if(type == 0 ){
-            List<CellRangeAddress> list = new ArrayList<>();
-            //new CellRangeAddress(开始行,结束行,开始列,结束列)
-            list.add(new CellRangeAddress(10, 12, 2, 3));
-            list.add(new CellRangeAddress(10, 12, 4, 5));
-            list.add(new CellRangeAddress(10, 12, 6, 7));
-            excelWriter = EasyExcel.write(localFile)
-                    .withTemplate(templateFileName)
-                    //调用合并策略
-                    .registerWriteHandler(new MyHandler(0, list))
-                    .build();
-        }
-        if(type == 1){
-            excelWriter = EasyExcel.write(localFile)
-                    .withTemplate(templateFileName)
-                    //调用合并策略
-                    .build();
-        }
+
+        excelWriter = EasyExcel.write(localFile)
+                .withTemplate(templateFileName)
+                //调用合并策略
+                .build();
         WriteSheet writeSheet = EasyExcel.writerSheet().build();
         // 这里注意 入参用了forceNewRow 代表在写入list的时候不管list下面有没有空行 都会创建一行,然后下面的数据往后移动。默认 是false,会直接使用下一行,如果没有则创建。
         // forceNewRow 如果设置了true,有个缺点 就是他会把所有的数据都放到内存了,所以慎用

+ 2 - 0
src/main/java/com/fdkankan/sale/util/pdf/MyHandler.java

@@ -3,6 +3,7 @@ package com.fdkankan.sale.util.pdf;
 
 import com.alibaba.excel.metadata.Head;
 import com.alibaba.excel.write.merge.AbstractMergeStrategy;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.RegionUtil;
@@ -11,6 +12,7 @@ import java.util.List;
 /**
  * 合并单元格处理类
  */
+@Slf4j
 public class MyHandler extends AbstractMergeStrategy {
 
     /**