Explorar o código

【BUG】#239、#240

zhaomn %!s(int64=3) %!d(string=hai) anos
pai
achega
604dae668e

+ 8 - 1
railway-business/src/main/java/com/railway/business/catenary/service/impl/BusJcbGlkgServiceImpl.java

@@ -16,7 +16,9 @@ import com.railway.business.push.service.IBusPushMsgService;
 import com.railway.common.utils.StringUtils;
 import com.railway.common.utils.poi.EasyExcelUtil;
 import java.time.LocalDateTime;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -217,7 +219,12 @@ public class BusJcbGlkgServiceImpl extends BusJcabServiceImpl implements IBusJcb
     list = list.stream().map(this::formatOne).collect(Collectors.toList());
     String fileName = "隔离开关检测记录.xls";
     String templateFileName = templatePath + "/excel/隔离开关检测记录.xls";
-    return new EasyExcelUtil().writeExcel(list, templateFileName, fileName);
+    Map<String, Object> params = new HashMap<>(0);
+    if(!list.isEmpty()) {
+      params.put("confirmUser",list.get(0).getConfirmUser());
+      params.put("checkUser",list.get(0).getCheckUser());
+    }
+    return new EasyExcelUtil().writeExcel(params, list, templateFileName, fileName);
   }
 
   private BusJcbGlkg formatOne(BusJcbGlkg busJcbGlkg) {

+ 8 - 1
railway-business/src/main/java/com/railway/business/catenary/service/impl/BusJcebLbjghjlServiceImpl.java

@@ -9,7 +9,9 @@ import com.railway.business.catenary.service.IBusJcebLbjghjlService;
 import com.railway.business.push.service.IBusPushMsgService;
 import com.railway.common.utils.StringUtils;
 import com.railway.common.utils.poi.EasyExcelUtil;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -131,7 +133,12 @@ public class BusJcebLbjghjlServiceImpl extends BusJcebServiceImpl<BusJcebLbjghjl
     List<BusJcebLbjghjl> list = busJcebLbjghjlMapper.getJcebList(query);
     String fileName = "零部件更换记录.xls";
     String templateFileName = templatePath + "/excel/零部件更换记录.xls";
-    return new EasyExcelUtil().writeExcel(list, templateFileName, fileName);
+    Map<String, Object> params = new HashMap<>(0);
+    if(!list.isEmpty()) {
+      params.put("confirmUser",list.get(0).getConfirmUser());
+      params.put("operator",list.get(0).getOperator());
+    }
+    return new EasyExcelUtil().writeExcel(params, list, templateFileName, fileName);
   }
 
 }

+ 8 - 1
railway-business/src/main/java/com/railway/business/catenary/service/impl/BusJcebQmjcjlServiceImpl.java

@@ -9,7 +9,9 @@ import com.railway.business.catenary.service.IBusJcebQmjcjlService;
 import com.railway.business.push.service.IBusPushMsgService;
 import com.railway.common.utils.StringUtils;
 import com.railway.common.utils.poi.EasyExcelUtil;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -131,6 +133,11 @@ public class BusJcebQmjcjlServiceImpl extends BusJcebServiceImpl<BusJcebQmjcjl>
     List<BusJcebQmjcjl> list = busJcebQmjcjlMapper.getJcebList(query);
     String fileName = "全面检查记录.xls";
     String templateFileName = templatePath + "/excel/全面检查记录.xls";
-    return new EasyExcelUtil().writeExcel(list, templateFileName, fileName);
+    Map<String, Object> params = new HashMap<>(0);
+    if(!list.isEmpty()) {
+      params.put("confirmUser",list.get(0).getConfirmUser());
+      params.put("operator",list.get(0).getOperator());
+    }
+    return new EasyExcelUtil().writeExcel(params, list, templateFileName, fileName);
   }
 }

+ 8 - 1
railway-business/src/main/java/com/railway/business/catenary/service/impl/BusJcebXsjcjlServiceImpl.java

@@ -10,7 +10,9 @@ import com.railway.business.push.service.IBusPushMsgService;
 import com.railway.common.utils.SecurityUtils;
 import com.railway.common.utils.StringUtils;
 import com.railway.common.utils.poi.EasyExcelUtil;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -145,7 +147,12 @@ public class BusJcebXsjcjlServiceImpl extends BusJcebServiceImpl<BusJcebXsjcjl>
     List<BusJcebXsjcjl> list = busJcebXsjcjlMapper.getJcebList(query);
     String fileName = "巡检记录.xls";
     String templateFileName = templatePath + "/excel/巡检记录.xls";
-    return new EasyExcelUtil().writeExcel(list, templateFileName, fileName);
+    Map<String, Object> params = new HashMap<>(0);
+    if(!list.isEmpty()) {
+      params.put("confirmUser",list.get(0).getConfirmUser());
+      params.put("operator",list.get(0).getOperator());
+    }
+    return new EasyExcelUtil().writeExcel(params, list, templateFileName, fileName);
   }
 
 }