@@ -1,8 +1,6 @@ | |||
package com.tuoheng.admin.service.impl; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.alibaba.fastjson.JSONArray; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
@@ -163,20 +161,20 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio | |||
Map<String,Integer> resultMap=new HashMap<>(); | |||
for (QuestionCountVO questionCountVo : questionCountVoList) { | |||
setInfo(resultMap, questionCountVo,QuestionStatusEnum.CONFIRM.getCode(),QuestionStatusEnum.CONFIRM.name().toLowerCase()); | |||
setInfo(resultMap, questionCountVo,QuestionStatusEnum.NOTREVIEWED.getCode(),QuestionStatusEnum.NOTREVIEWED.name().toLowerCase()); | |||
setInfo(resultMap, questionCountVo,QuestionStatusEnum.NEGLECT.getCode(),QuestionStatusEnum.NEGLECT.name().toLowerCase()); | |||
} | |||
if(!resultMap.containsKey(QuestionStatusEnum.CONFIRM.name().toLowerCase())){ | |||
resultMap.put(QuestionStatusEnum.CONFIRM.name().toLowerCase(),0); | |||
} | |||
if(!resultMap.containsKey(QuestionStatusEnum.NOTREVIEWED.name().toLowerCase())){ | |||
resultMap.put(QuestionStatusEnum.NOTREVIEWED.name().toLowerCase(),0); | |||
if(!resultMap.containsKey(QuestionStatusEnum.NEGLECT.name().toLowerCase())){ | |||
resultMap.put(QuestionStatusEnum.NEGLECT.name().toLowerCase(),0); | |||
} | |||
return JsonResult.success(resultMap); | |||
} | |||
private static Map<String, Integer> setInfo(Map<String, Integer> resultMap, QuestionCountVO questionCountVo, Integer code, String name) { | |||
private static void setInfo(Map<String, Integer> resultMap, QuestionCountVO questionCountVo, Integer code, String name) { | |||
if(questionCountVo.getStatus().equals(code)){ | |||
if(resultMap.containsKey(name)){ | |||
Integer current = resultMap.get(name); | |||
@@ -186,7 +184,6 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio | |||
resultMap.put(name, questionCountVo.getQuantity()); | |||
} | |||
} | |||
return resultMap; | |||
} | |||
@Override |
@@ -278,7 +278,18 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp | |||
str = "巡查里程"; | |||
font.setStyle(Font.NORMAL); | |||
} else { | |||
str = reportInfoVO.getMission().getMileage(); | |||
if(StringUtils.isNotEmpty(reportInfoVO.getMission().getMileage())){ | |||
try{ | |||
int temp = Integer.parseInt(reportInfoVO.getMission().getMileage()) / 1000; | |||
str = temp+"公里"; | |||
}catch (Exception e){ | |||
log.info("转换里程出错:{}",e.getMessage()); | |||
str=""; | |||
} | |||
}else{ | |||
str = ""; | |||
} | |||
} | |||
Paragraph p = new Paragraph(str, font); | |||
cell.add(p); | |||
@@ -380,8 +391,8 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp | |||
} else if (i == 2) { | |||
str = "林场问题图斑"; | |||
} else if (i == 3) { | |||
if(questionCount.containsKey("LC001")){ | |||
str = questionCount.get("LC001").toString().trim(); | |||
if(questionCount.containsKey("002000")){ | |||
str = questionCount.get("002000").toString().trim(); | |||
font.setStyle(Font.NORMAL); | |||
}else{ | |||
str = "0"; | |||
@@ -390,8 +401,8 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp | |||
} else if (i == 4) { | |||
str = "病死树"; | |||
} else if (i == 5) { | |||
if(questionCount.containsKey("LC002")){ | |||
str = questionCount.get("LC002").toString().trim(); | |||
if(questionCount.containsKey("002001")){ | |||
str = questionCount.get("002001").toString().trim(); | |||
font.setStyle(Font.NORMAL); | |||
}else{ | |||
str = "0"; | |||
@@ -400,8 +411,8 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp | |||
} else if (i == 6) { | |||
str = "人员活动"; | |||
} else if (i == 7) { | |||
if(questionCount.containsKey("LC003")){ | |||
str = questionCount.get("LC003").toString().trim(); | |||
if(questionCount.containsKey("002003")){ | |||
str = questionCount.get("002003").toString().trim(); | |||
font.setStyle(Font.NORMAL); | |||
}else{ | |||
str = "0"; | |||
@@ -410,8 +421,8 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp | |||
} else if (i == 8) { | |||
str = "火灾隐患"; | |||
} else{ | |||
if(questionCount.containsKey("LC004")){ | |||
str = questionCount.get("LC004").toString().trim(); | |||
if(questionCount.containsKey("002004")){ | |||
str = questionCount.get("002004").toString().trim(); | |||
font.setStyle(Font.NORMAL); | |||
}else{ | |||
str = "0"; |