cjl
2023-09-28 e94e5dbbfc544c558a09fb388e7f4d4341fe8ec4
screen-api/src/main/java/com/moral/api/controller/ExcelController.java
@@ -19,6 +19,7 @@
import com.moral.api.pojo.bo.ExcelBO;
import com.moral.api.pojo.vo.excel.ExcelVo;
import com.moral.api.pojo.vo.excel.HnExcelVo;
import com.moral.api.pojo.vo.excel.SyExcelVo;
import com.moral.api.service.ExcelService;
import com.moral.api.service.HnExcelService;
@@ -129,4 +130,40 @@
        return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),syExcelVo);
    }
    /**
     * 浑南区质量报告导出
     * @param id
     * @return
     */
    @GetMapping("/hnExcelExport")
    public ResultMessage hnExcelExport(Integer id) throws ParseException {
        if (id==null){
            return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
        }
        HnExcelVo hnExcelVo = hnExcelService.hnExport(id);
        if (hnExcelVo==null){
            return ResultMessage.fail(ResponseCodeEnum.TARGET_IS_NULL.getCode(), ResponseCodeEnum.TARGET_IS_NULL.getMsg());
        }
        return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),hnExcelVo);
    }
    /**
     * 天数据补充
     * @param request
     * @return
     * @throws IOException
     */
    @PostMapping("rexcelImport")
    public ResultMessage rexcelImport(HttpServletRequest request) throws IOException {
        List<MultipartFile> files = ((MultipartHttpServletRequest) request).getFiles("files");
        excelService.rexcelImport(files);
        return ResultMessage.ok(1);
    }
}