|
|
@@ -75,19 +75,25 @@ public class OrderController extends BaseWebController {
|
|
|
public void orderDishesExport(HttpServletResponse resp, @RequestBody DishesOrderWebInDTO dto){
|
|
|
String key ="orderDishesExport";
|
|
|
String error = this.checkExcelExport(key);
|
|
|
- if ("".equals(error)) {
|
|
|
- orgConstrainService.fillOrgParams(dto);
|
|
|
- List<DishesOrderWebOutDTO> list = orderService.orderDishes(dto);
|
|
|
- ExcelUtils.easyDownload("classpath:excel/order_dishes.xlsx", Maps.newHashMap(), list, "", resp);
|
|
|
+ try{
|
|
|
+ if ("".equals(error)) {
|
|
|
+ orgConstrainService.fillOrgParams(dto);
|
|
|
+ List<DishesOrderWebOutDTO> list = orderService.orderDishes(dto);
|
|
|
+ ExcelUtils.easyDownload("classpath:excel/order_dishes.xlsx", Maps.newHashMap(), list, "", resp);
|
|
|
+ }else{
|
|
|
+ throw new BusinessException(error);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }finally {
|
|
|
if(cacheService.exists(key)){
|
|
|
if(cacheService.get(key).equals(TokenContext.cureWebUser().getUserId().toString())){
|
|
|
cacheService.del(key);
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
- throw new BusinessException(error);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@DistributedLock(fairLock =true)
|