jinpengyong
2023-10-27 b98b5196f073725fca743f8ad5be57d1f0b8cbd7
chore:补充提交
1 files modified
13 ■■■■■ changed files
screen-api/src/main/java/com/moral/api/controller/CruiserController.java 13 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/controller/CruiserController.java
@@ -14,6 +14,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
@@ -243,6 +244,7 @@
     * @return
     */
    @PostMapping("dailyDustlds")
    @Transactional
    public ResultMessage  dailyDustlds(@RequestBody Map<String,Object> params, HttpServletResponse response) throws IOException {
//        Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
@@ -254,9 +256,9 @@
        if (ObjectUtils.isEmpty(map)){
            return ResultMessage.fail(ResponseCodeEnum.TARGET_IS_NULL.getCode(), ResponseCodeEnum.TARGET_IS_NULL.getMsg());
        }
        test(map,response);
//        test(map,response);
//        return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(),ResponseCodeEnum.SUCCESS.getMsg(),map);
        return ResultMessage.ok();
        return ResultMessage.ok(map);
    }
@@ -355,13 +357,14 @@
                map.put("table3", new MiniTableRenderData(rsList3));
            }
            map.put("table1", new MiniTableRenderData(header1, rsList1));
            map.put("data",params.get("data"));
            String data = params.get("data").toString();
            map.put("data",data);
            map.put("time",params.get("time").toString());
            map.put("date1",params.get("date1").toString());
            map.put("date2",params.get("date2").toString());
//            map.put("data",params.get("data").toString());
            compile.render(map);
//            compile.writeToFile("G:\\home\\mon1\\" + "尘负荷监测报告"+params.get("time").toString()+".docx");
//        FileOutputStream out = new FileOutputStream("尘负荷监测报告" + params.get("time").toString() + ".docx");
//            response.addHeader("Access-Contro1-Allow-Origin", "*");
            compile.write(response.getOutputStream());
            compile.close();
        } catch (IOException e) {