|
@@ -64,12 +64,12 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
|
private String syncWzDataUrl;
|
|
|
|
|
|
@Override
|
|
|
- public int wordExport(Map<String, Object> map, HttpServletResponse response) {
|
|
|
+ public void wordExport(Map<String, Object> map, HttpServletResponse response) {
|
|
|
Object periodObj = map.get("period");
|
|
|
Object yearObj = map.get("year");
|
|
|
Object paramsObj = map.get("params");
|
|
|
if(ObjectUtil.isEmpty(periodObj)){
|
|
|
- return 0;
|
|
|
+ throw new CustomException("缺少周期参数");
|
|
|
}
|
|
|
if(!ObjectUtil.isEmpty(paramsObj)){
|
|
|
String params = (String) map.get("params");
|
|
@@ -82,7 +82,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
|
map.put("period","第"+period+"期");
|
|
|
List<ZhcxPersistentManageDo> list = zhcxPersistentManageDao.listData(map);
|
|
|
if(list.size() == 0){
|
|
|
- return 1;
|
|
|
+ throw new CustomException("当前周期暂无数据");
|
|
|
}
|
|
|
if(list.size() > 0){
|
|
|
list.forEach(ev ->{
|
|
@@ -168,7 +168,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
|
} catch (Exception e) {
|
|
|
log.info("顽症导出word失败:"+e);
|
|
|
}
|
|
|
- }else if (k.contains("油漆“零破坏”专项报告")){
|
|
|
+ }else if (k.contains("油漆“零破坏”专项")){
|
|
|
FormDataVO formDataVo = new FormDataVO();
|
|
|
formDataVo.setMainDataList(mainDataList);
|
|
|
|
|
@@ -334,11 +334,10 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + "报告");
|
|
|
doc[0].save(response.getOutputStream(), com.aspose.words.SaveOptions.createSaveOptions(com.aspose.words.SaveFormat.DOCX));
|
|
|
} catch (Exception e) {
|
|
|
- log.info("顽症导出word失败:"+e);
|
|
|
- return 1;
|
|
|
+ log.error("顽症导出word失败:"+e);
|
|
|
+ throw new CustomException("导出失败");
|
|
|
}
|
|
|
}
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
@Override
|