Пример #1
0
 @RequestMapping
 public @ResponseBody JsonResult findDesiredOperationByCustomer(HttpServletRequest request) {
   JsonResult result = new JsonResult();
   try {
     Page<DesiredOperation> page = SpringMVCUtils.getPage(request);
     String executionStatus = ServletRequestUtils.getStringParameter(request, "executionStatus");
     String cardNo = request.getParameter("cardNo");
     String userName = SpringSecurityUtils.getCurrentUserName();
     if (StringUtils.isBlank(userName)) {
       CustomerCardInfo customerCardInfo = customerCardInfoManager.getByCardNo(cardNo);
       SysUser user = customerCardInfo.getCustomer().getSysUser();
       userName = user.getUserName();
     }
     page = desiredOperationManager.findPageByCustomerParam(page, userName, executionStatus);
     List<DesiredOperation> requistionList = page.getResult();
     List<Map<String, Object>> mappedDesiredOperation =
         desiredOperationResult(requistionList, executionStatus);
     Page<Map<String, Object>> pageMap = page.getMappedPage();
     pageMap.setResult(mappedDesiredOperation);
     result.setTotalPage(page.getTotalPages());
     result.setTotalCount(page.getTotalCount());
     result.setPage(pageMap);
   } catch (PlatformException e) {
     e.printStackTrace();
     result.setSuccess(Boolean.FALSE);
     result.setMessage(e.getMessage());
   } catch (Exception e) {
     e.printStackTrace();
     result.setSuccess(Boolean.FALSE);
     result.setMessage(e.getMessage());
   }
   return result;
 }
Пример #2
0
 @RequestMapping
 public @ResponseBody JsonResult findDesiredOperationByUser(HttpServletRequest request) {
   JsonResult result = new JsonResult();
   try {
     Page<DesiredOperation> page = SpringMVCUtils.getPage(request);
     Map<String, String> paramMap = new HashMap<String, String>();
     String executionStatus = ServletRequestUtils.getStringParameter(request, "executionStatus");
     String resultStr = ServletRequestUtils.getStringParameter(request, "result");
     paramMap.put("result", resultStr);
     paramMap.put("executionStatus", executionStatus);
     String currentUserName = SpringSecurityUtils.getCurrentUserName();
     paramMap.put("currentUserName", currentUserName);
     page = desiredOperationManager.findPageByParam(page, paramMap);
     List<DesiredOperation> requistionList = page.getResult();
     List<Map<String, Object>> mappedDesiredOperation =
         desiredOperationResult(requistionList, executionStatus);
     Page<Map<String, Object>> pageMap = page.getMappedPage();
     pageMap.setResult(mappedDesiredOperation);
     result.setPage(pageMap);
   } catch (PlatformException e) {
     e.printStackTrace();
     result.setSuccess(Boolean.FALSE);
     result.setMessage(e.getMessage());
   } catch (Exception e) {
     e.printStackTrace();
     result.setSuccess(Boolean.FALSE);
     result.setMessage(e.getMessage());
   }
   return result;
 }
Пример #3
0
 @RequestMapping
 public @ResponseBody JsonResult cancel(HttpServletRequest request) {
   JsonResult result = new JsonResult();
   try {
     String id = ServletRequestUtils.getStringParameter(request, "id");
     desiredOperationManager.remove(Long.parseLong(id));
   } catch (PlatformException e) {
     e.printStackTrace();
     result.setSuccess(Boolean.FALSE);
     result.setMessage(e.getMessage());
   } catch (Exception e) {
     e.printStackTrace();
     result.setSuccess(Boolean.FALSE);
     result.setMessage(e.getMessage());
   }
   return result;
 }