Commit 721fb555 authored by xinglei's avatar xinglei

*)修改代码(下载到浏览器)

parent f57d7759
......@@ -122,7 +122,7 @@ public class CheckServiceImpl implements ICheckService {
//deptMap = deptList.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr, DepartmentModel::getDepartmentName));
for (int i = 0; i < deptList.size(); i++) {
deptMap.put(String.valueOf(deptList.get(i).get("sequenceNbr")), String.valueOf(deptList.get(i).get("departmentName")));
deptMap.put(StringUtil.toString(deptList.get(i).get("sequenceNbr")), StringUtil.toString(deptList.get(i).get("departmentName")));
}
......@@ -167,11 +167,11 @@ public class CheckServiceImpl implements ICheckService {
planTask = planTaskDao.findById(requestParam.getPlanTaskId()).get();
// routeParam.put("routeId", planTask.getRouteId());
// routeParam.put("pointId", requestParam.getPointId());
check.setPlanTaskDetailId(Long.parseLong(String.valueOf(detail.get("planTaskDetailId"))));
check.setRouteId(Long.parseLong(String.valueOf(detail.get("routeId"))));
check.setPlanTaskDetailId(Long.parseLong(StringUtil.toString(detail.get("planTaskDetailId"))));
check.setRouteId(Long.parseLong(StringUtil.toString(detail.get("routeId"))));
check.setPlanTaskId(requestParam.getPlanTaskId());
check.setPlanId(planTask.getPlanId());
check.setDepId(String.valueOf(detail.get("depId")));
check.setDepId(StringUtil.toString(detail.get("depId")));
}
} else {
planTask = new PlanTask();
......@@ -1014,8 +1014,8 @@ public class CheckServiceImpl implements ICheckService {
//新安全
checkAnalysisVos.forEach(s -> {
listd.forEach(s1 -> {
if (s.getName().equals(String.valueOf(s1.get("sequenceNbr")))) {
s.setName(String.valueOf(s1.get("departmentName")));
if (s.getName().equals(StringUtil.toString(s1.get("sequenceNbr")))) {
s.setName(StringUtil.toString(s1.get("departmentName")));
}
});
});
......@@ -1042,20 +1042,20 @@ public class CheckServiceImpl implements ICheckService {
faildRate += Double.parseDouble(checkAnalysisVo.getFaildRate());
}
countVo.setName("合计");
countVo.setPlanTaskCount(String.valueOf(planTaskCount));
countVo.setCheckCount(String.valueOf(checkCount));
countVo.setOk(String.valueOf(ok));
countVo.setFaild(String.valueOf(faild));
countVo.setMissed(String.valueOf(missed));
countVo.setPlanTaskCount(StringUtil.toString(planTaskCount));
countVo.setCheckCount(StringUtil.toString(checkCount));
countVo.setOk(StringUtil.toString(ok));
countVo.setFaild(StringUtil.toString(faild));
countVo.setMissed(StringUtil.toString(missed));
if (size == 0) {
countVo.setScore("0");
countVo.setMissedRate("0");
countVo.setFaildRate("0");
} else {
countVo.setScore(String.valueOf(score / size));
countVo.setMissedRate(String.valueOf(missedRate / size));
countVo.setFaildRate(String.valueOf(faildRate / size));
countVo.setScore(StringUtil.toString(score / size));
countVo.setMissedRate(StringUtil.toString(missedRate / size));
countVo.setFaildRate(StringUtil.toString(faildRate / size));
}
checkAnalysisVos.add(countVo);
return checkAnalysisVos;
......@@ -1091,8 +1091,8 @@ public class CheckServiceImpl implements ICheckService {
//新安全
checkAnalysisVos.forEach(s -> {
listd.forEach(s1 -> {
if (!ObjectUtils.isEmpty(s.getName()) && s.getName().equals(String.valueOf(s1.get("sequenceNbr")))) {
s.setName(DeptEnum.getEnumCode(String.valueOf(s1.get("departmentName"))));
if (!ObjectUtils.isEmpty(s.getName()) && s.getName().equals(StringUtil.toString(s1.get("sequenceNbr")))) {
s.setName(DeptEnum.getEnumCode(StringUtil.toString(s1.get("departmentName"))));
}
});
});
......@@ -1248,8 +1248,7 @@ public class CheckServiceImpl implements ICheckService {
setRow(checkInfoList, sheet, contentStyle, alignLeftStyle);
}
//PoiUtil.export(wb, response);
PoiUtil.exportLocal(wb, "D:/upload", "机构客户信息表.xls");
PoiUtil.export(wb, response);
}
private Map<String, Object> getStateMap(String idState) {
......@@ -1405,8 +1404,8 @@ public class CheckServiceImpl implements ICheckService {
boolean flag2 = true;
for (int i = 0; i < checkInfoList.size(); i++) {
String pointName = String.valueOf(checkInfoList.get(i).get("pointName"));
String classifyName = String.valueOf(checkInfoList.get(i).get("classifyName"));
String pointName = StringUtil.toString(checkInfoList.get(i).get("pointName"));
String classifyName = StringUtil.toString(checkInfoList.get(i).get("classifyName"));
if (flag1) {
lastPointName = pointName;
flag1 = false;
......@@ -1451,14 +1450,14 @@ public class CheckServiceImpl implements ICheckService {
}
row = sheet.createRow(i + 3);
HSSFCell cell = row.createCell(0);
cell.setCellValue(String.valueOf(checkInfoList.get(i).get("pointName")));
cell.setCellValue(StringUtil.toString(checkInfoList.get(i).get("pointName")));
cell.setCellStyle(contentStyle);
HSSFCell cell1 = row.createCell(1);
cell1.setCellValue(String.valueOf(checkInfoList.get(i).get("classifyName")));
cell1.setCellValue(StringUtil.toString(checkInfoList.get(i).get("classifyName")));
cell1.setCellStyle(contentStyle);
HSSFCell cell2 = row.createCell(2);
cell2.setCellStyle(contentStyle);
cell2.setCellValue(String.valueOf(checkInfoList.get(i).get("inputItemName")));
cell2.setCellValue(StringUtil.toString(checkInfoList.get(i).get("inputItemName")));
for (int j = 0; j < sp.length; j++) {
Map<String, Object> checkInfoMap = checkInfoList.get(i);
HSSFCell cellA = row.createCell(3 + j);
......@@ -1477,9 +1476,9 @@ public class CheckServiceImpl implements ICheckService {
children.forEach(
y -> {
Map<String, Object> map = new HashMap<>();
String key = DeptEnum.getEnumCode(String.valueOf(y.get("departmentName")));
String key = DeptEnum.getEnumCode(StringUtil.toString(y.get("departmentName")));
map.put("key", key);
map.put("label", String.valueOf(y.get("departmentName")));
map.put("label", StringUtil.toString(y.get("departmentName")));
list.add(map);
}
);
......@@ -1511,7 +1510,7 @@ public class CheckServiceImpl implements ICheckService {
Collection<Map> children = x.getChildren();
children.forEach(
y -> {
String key = DeptEnum.getEnumCode(String.valueOf(y.get("departmentName")));
String key = DeptEnum.getEnumCode(StringUtil.toString(y.get("departmentName")));
List<CheckAnalysisVo> collect = checkAnalysisVos.stream().filter(z -> key.equals(z.getName()) && z.getCheckTime().equals(day)).collect(Collectors.toList());
String plantaskCount = getCount(collect, PLANTASK_COUNT);
String checkCount = getCount(collect, CHECK_COUNT);
......@@ -1564,7 +1563,7 @@ public class CheckServiceImpl implements ICheckService {
private void getTotal(Map<String, Object> totalMap, String type, String key, Long num) {
long total = 0;
if (!ObjectUtils.isEmpty(totalMap.get(type + key))) {
total = Long.valueOf(String.valueOf(totalMap.get(type + key)));
total = Long.valueOf(StringUtil.toString(totalMap.get(type + key)));
}
num += total;
totalMap.put(type + key, num.toString());
......
......@@ -55,8 +55,6 @@ public class StringUtil {
/**
* 判断是否数字表示
*
* @param src
* 源字符串
* @return 是否数字的标志
*/
......@@ -156,4 +154,8 @@ public class StringUtil {
return codes[0] + "*" + codes[1];
}
}
public static String toString(Object str){
return str + "";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment