qin 1 éve
szülő
commit
2b14d7d3fb

+ 12 - 12
src/main/java/com/poteviohealth/cgp/statistics/controller/OrderController.java

@@ -56,23 +56,23 @@ public class OrderController extends BaseWebController {
     public void orderServiceExport(HttpServletResponse resp, @RequestBody OrderServiceWebInDTO orderServiceWebInDTO){
         String key ="orderServiceExport";
            String error =  this.checkExcelExport(key);
-        if ("".equals(error)) {
+        try {
+            if ("".equals(error)) {
             orgConstrainService.fillOrgParams(orderServiceWebInDTO);
-            try {
                 List<OrderExcelDTO> list = orderService.orderExcel(orderServiceWebInDTO);
                 ExcelUtils.easyDownload("classpath:excel/order_service.xlsx", Maps.newHashMap(), list,  "", resp);
-            }catch (Exception e){
-                e.printStackTrace();
-                throw new BusinessException(e.getMessage());
-            }finally {
-                if(cacheService.exists(key)){
-                    if(cacheService.get(key).equals(TokenContext.cureWebUser().getUserId().toString())){
-                        cacheService.del(key);
-                    }
+            }else{
+                throw new BusinessException(error);
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            throw new BusinessException(e.getMessage());
+        }finally {
+            if(cacheService.exists(key)){
+                if(cacheService.get(key).equals(TokenContext.cureWebUser().getUserId().toString())){
+                    cacheService.del(key);
                 }
             }
-        }else{
-            throw new BusinessException(error);
         }
     }