Procházet zdrojové kódy

导出excel基础代码上传,分段绝缘器已完成,避雷器、关节、绝缘子待完善

wuhonghao před 4 roky
rodič
revize
182851c741

+ 3 - 0
railway-admin/src/main/java/com/railway/web/controller/business/catenary/BusJcbFdfxjyqController.java

@@ -196,7 +196,10 @@ public class BusJcbFdfxjyqController extends BaseController {
         Map<String, Object> params = new HashMap<>();
         if(!list.isEmpty()) {
             params.put("stationName", list.get(0).getStationName());
+            params.put("createBy",list.get(0).getCreateBy());
+            params.put("confirmUser",list.get(0).getConfirmUser());
         }
+
         String fileName = "分段绝缘器检测记录.xls";
         String templateFileName = "excel/template/分段绝缘器检测记录.xls";
         String localFilePath = new EasyExcelUtil().getExcel(params, list, templateFileName, fileName);

+ 21 - 1
railway-admin/src/main/java/com/railway/web/controller/business/catenary/BusJcebGjsfxController.java

@@ -1,13 +1,19 @@
 package com.railway.web.controller.business.catenary;
 
+import com.railway.business.catenary.domain.BusJcbBlq;
 import com.railway.business.catenary.domain.BusJcebGjsfx;
 import com.railway.business.catenary.service.IBusJcebGjsfxService;
 import com.railway.common.core.controller.BaseController;
 import com.railway.common.core.domain.AjaxResult;
 import com.railway.common.core.page.TableDataInfo;
+import com.railway.common.utils.poi.EasyExcelUtil;
+import com.railway.system.service.ISysFileService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import javax.validation.Valid;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.DeleteMapping;
@@ -29,9 +35,11 @@ import org.springframework.web.bind.annotation.RestController;
 public class BusJcebGjsfxController extends BaseController {
 
     private final IBusJcebGjsfxService busJcebGjsfxService;
+    private final ISysFileService sysFileService;
 
-    public BusJcebGjsfxController(IBusJcebGjsfxService busJcebGjsfxService) {
+    public BusJcebGjsfxController(IBusJcebGjsfxService busJcebGjsfxService,ISysFileService sysFileService) {
         this.busJcebGjsfxService = busJcebGjsfxService;
+        this.sysFileService = sysFileService;
     }
 
     @ApiOperation(value = "新增")
@@ -88,4 +96,16 @@ public class BusJcebGjsfxController extends BaseController {
         return toAjax(busJcebGjsfxService.confirm(busJcebGjsfx));
     }
 
+    @ApiOperation(value = "导出excel")
+    @GetMapping(value = "exportExcel")
+    public AjaxResult exportExcel(BusJcebGjsfx busJcebGjsfx) {
+        List<BusJcebGjsfx> list = busJcebGjsfxService.getList(busJcebGjsfx);
+        Map<String, Object> params = new HashMap<>();
+
+        String fileName = "关节式分相检测记录.xls";
+        String templateFileName = "excel/template/关节式分相检测记录.xls";
+        String localFilePath = new EasyExcelUtil().getExcel(params, list, templateFileName, fileName);
+        return sysFileService.uploadFile(localFilePath);
+    }
+
 }

+ 21 - 1
railway-admin/src/main/java/com/railway/web/controller/business/catenary/BusJcebJyzqsjlController.java

@@ -1,13 +1,19 @@
 package com.railway.web.controller.business.catenary;
 
+import com.railway.business.catenary.domain.BusJcebGjsfx;
 import com.railway.business.catenary.domain.BusJcebJyzqsjl;
 import com.railway.business.catenary.service.IBusJcebJyzqsjlService;
 import com.railway.common.core.controller.BaseController;
 import com.railway.common.core.domain.AjaxResult;
 import com.railway.common.core.page.TableDataInfo;
+import com.railway.common.utils.poi.EasyExcelUtil;
+import com.railway.system.service.ISysFileService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import javax.validation.Valid;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.DeleteMapping;
@@ -29,9 +35,11 @@ import org.springframework.web.bind.annotation.RestController;
 public class BusJcebJyzqsjlController extends BaseController {
 
     private final IBusJcebJyzqsjlService busJcebJyzqsjlService;
+    private final ISysFileService sysFileService;
 
-    public BusJcebJyzqsjlController(IBusJcebJyzqsjlService busJcebJyzqsjlService) {
+    public BusJcebJyzqsjlController(IBusJcebJyzqsjlService busJcebJyzqsjlService,ISysFileService sysFileService) {
         this.busJcebJyzqsjlService = busJcebJyzqsjlService;
+        this.sysFileService = sysFileService;
     }
 
     @ApiOperation(value = "新增")
@@ -87,4 +95,16 @@ public class BusJcebJyzqsjlController extends BaseController {
         return toAjax(busJcebJyzqsjlService.confirm(busJcebJyzqsjl));
     }
 
+    @ApiOperation(value = "导出excel")
+    @GetMapping(value = "exportExcel")
+    public AjaxResult exportExcel(BusJcebJyzqsjl busJcebJyzqsjl) {
+        List<BusJcebJyzqsjl> list = busJcebJyzqsjlService.getList(busJcebJyzqsjl);
+        Map<String, Object> params = new HashMap<>();
+
+        String fileName = "绝缘子清扫记录.xls";
+        String templateFileName = "excel/template/绝缘子清扫记录.xls";
+        String localFilePath = new EasyExcelUtil().getExcel(params, list, templateFileName, fileName);
+        return sysFileService.uploadFile(localFilePath);
+    }
+
 }

+ 32 - 0
railway-business/src/main/java/com/railway/business/catenary/domain/BusJcbFdfxjyq.java

@@ -140,4 +140,36 @@ public class BusJcbFdfxjyq extends BusJcab{
     @Length(max = 255, message = "【设备状态(故障描述)】长度必须介于 {min} 和 {max} 之间")
     private String sbztDesc;
 
+    public BigDecimal getDxlzxpy(){
+        return pointB.add(pointG).divide(new BigDecimal("2")).setScale(2,BigDecimal.ROUND_HALF_UP);
+    }
+
+    public String getJybjzt(){
+        if("1".equals(jybjFdjyqzjyzt)&&"1".equals(jybjClsjyzzt)){
+            return "合格";
+        }else{
+            return "不合格";
+        }
+    }
+
+    public String getJtgdph(){
+        if("1".equals(lbjztJcxjt)){
+            return "是";
+        }else{
+            return "否";
+        }
+    }
+
+    public String getGlbjzt(){
+        if("1".equals(lbjztLs)&& "1".equals(lbjztXdx)&& "1".equals(lbjztPhzj)&& "1".equals(lbjztXhj)&& "1".equals(sdgjcztSddg)){
+            return "合格";
+        }else{
+            return "不合格";
+        }
+    }
+
+    public String getXb(){
+        return "检测";
+    }
+
 }

binární
railway-business/src/main/resources/excel/template/关节式分相检测记录.xls


binární
railway-business/src/main/resources/excel/template/分段绝缘器检测记录.xls


binární
railway-business/src/main/resources/excel/template/绝缘子清扫记录.xls


binární
railway-business/src/main/resources/excel/template/避雷器检测记录.xls