Browse Source

更新modelAndView为空判断方法

hejq 7 years ago
parent
commit
42d84efdf2

+ 2 - 4
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ReleaseProductByBatchController.java

@@ -380,14 +380,13 @@ public class ReleaseProductByBatchController {
     public ModelAndView exportOrderses(String batch, HttpServletRequest request, @RequestParam(defaultValue = "false") Boolean isAjax, String currency, Integer isPerson) {
         HttpSession session = request.getSession();
         ModelAndView modelAndView = AjaxUtil.checkIsAjax(session, isAjax);
-        if (null != modelAndView) {
+        if (!modelAndView.isEmpty()) {
             return modelAndView;
         }
         Object loading = session.getAttribute("load-error-ing");
         if (loading == null || !Boolean.valueOf(loading.toString())) {
             session.setAttribute("load-error-ing", true);
         }
-        modelAndView = new ModelAndView();
         modelAndView.addObject("data", releaseProductByBatchService.findFailureReleaseProductByBatch(batch));
         String url ="";
         if (null != isPerson && isPerson.intValue() == IntegerConstant.YES_SHORT.intValue()) {
@@ -437,14 +436,13 @@ public class ReleaseProductByBatchController {
     public ModelAndView exportFailureData(String batch, HttpServletRequest request, @RequestParam(defaultValue = "false") Boolean isAjax) throws UnsupportedEncodingException {
         HttpSession session = request.getSession();
         ModelAndView modelAndView = AjaxUtil.checkIsAjax(session, isAjax);
-        if (null != modelAndView) {
+        if (!modelAndView.isEmpty()) {
             return modelAndView;
         }
         Object loading = session.getAttribute("load-error-ing");
         if (loading == null || !Boolean.valueOf(loading.toString())) {
             session.setAttribute("load-error-ing", true);
         }
-        modelAndView = new ModelAndView();
 		modelAndView.addObject("data", releaseProductByBatchService.findFailureReleaseProductByBatch(batch));
         String url = "classpath:jxls-tpl/trade/products-error";
         modelAndView.setView(new JxlsExcelView(url, "修改失败产品-优软商城"));

+ 1 - 2
src/main/java/com/uas/platform/b2c/trade/order/controller/PurchaseProductController.java

@@ -103,14 +103,13 @@ public class PurchaseProductController {
     public ModelAndView exportReleaseByBatchError(String batch, HttpServletRequest request, @RequestParam(defaultValue = "false") Boolean isAjax) {
         HttpSession session = request.getSession();
         ModelAndView modelAndView = AjaxUtil.checkIsAjax(session, isAjax);
-        if (null != modelAndView) {
+        if (!modelAndView.isEmpty()) {
             return modelAndView;
         }
         Object loading = session.getAttribute("load-error-ing");
         if (loading == null || !Boolean.valueOf(loading.toString())) {
             session.setAttribute("load-error-ing", true);
         }
-        modelAndView = new ModelAndView();
         modelAndView.addObject("data", releaseProductByBatchService.findFailureReleaseProductByBatch(batch));
         String url = "classpath:jxls-tpl/trade/releaseByBatchError-person";
         modelAndView.setView(new JxlsExcelView(url, "导出失败的个人物料-优软商城"));

+ 1 - 2
src/main/java/com/uas/platform/b2c/trade/order/support/AjaxUtil.java

@@ -35,8 +35,7 @@ public class AjaxUtil {
             }
             view.setAttributesMap(attributes);
             modelAndView.setView(view);
-            return modelAndView;
         }
-        return null;
+        return modelAndView;
     }
 }