jinpengyong
2022-11-08 2c8a80699b002e7a91eb885b884088e17c719245
修改高新区质量空气质量报告的地区名字
1 files modified
35 ■■■■■ changed files
screen-api/src/main/java/com/moral/api/service/impl/ExcelServiceImpl.java 35 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/ExcelServiceImpl.java
@@ -55,11 +55,12 @@
     */
    @Override
    public ExcelBO importTemplate(List<MultipartFile> files, Map<String, Object> params) throws IOException {
        Date date2 = new Date();
        String time = (String) params.get("time");
        String code = (String) params.get("code");
        String time1 = (String) params.get("date");
//        String time1 = (String) params.get("date");
        Date date = DateUtils.getDate(time, "yyyy-MM-dd");
        Date date1 = DateUtils.getDate(time1, "yyyy-MM-dd");
//        Date date1 = DateUtils.getDate(time1, "yyyy-MM-dd");
        ExcelBO excelBO = new ExcelBO();
        QueryWrapper<TbExcel> wrapper = new QueryWrapper<>();
        wrapper.eq("time",date).eq("code",code);
@@ -91,11 +92,11 @@
            excel1.setValue(s);
            excel1.setTime(date);
            excel1.setCode(code);
            excel1.setDate(date1);
            excel1.setDate(date2);
            excelMapper.insert(excel1);
            excelBO.setId(excel1.getId());
            excelBO.setTime(excel1.getTime());
            excelBO.setDate(excel1.getDate());
            excelBO.setDate(date2);
        }else {
            HashMap<String, Object> map = new HashMap<>();
@@ -124,7 +125,7 @@
            excelMapper.updateById(excel);
            excelBO.setId(excel.getId());
            excelBO.setTime(excel.getTime());
            excelBO.setDate(excel.getDate());
            excelBO.setDate(date2);
        }
        return excelBO;
    }
@@ -181,11 +182,19 @@
                Map map5 = JSON.parseObject(s, Map.class);
                Set set1s = map5.keySet();
                for (Object set1 : set1s) {
                    Object o1 = map5.get(set1);
                    String s1 = JSON.toJSONString(o1);
                    Map map6 = JSON.parseObject(s1, Map.class);
                    map6.put("place",set1);
                    list3.add(map6);
                    if (set1.equals("高新区")){
                        Object o1 = map5.get(set1);
                        String s1 = JSON.toJSONString(o1);
                        Map map6 = JSON.parseObject(s1, Map.class);
                        map6.put("place","国控站");
                        list3.add(map6);
                    }else {
                        Object o1 = map5.get(set1);
                        String s1 = JSON.toJSONString(o1);
                        Map map6 = JSON.parseObject(s1, Map.class);
                        map6.put("place",set1.toString().substring(3));
                        list3.add(map6);
                    }
                }
            }
            if (set.equals("c4")){
@@ -591,7 +600,11 @@
                objects[j] = value;
            }
            HashMap<String, Object> map = new HashMap<>();
            map.put("place", objects[0]);
            if (objects[0].toString().equals("高新区")){
                map.put("place", "国控站");
            }else {
                map.put("place",objects[0].toString().substring(3));
            }
            map.put("日期", objects[1]);
            map.put("SO2", objects[2]);
            map.put("SO2分指数", objects[3]);