예제 #1
0
 /**
  * @param request
  * @return
  */
 @RequestMapping
 public @ResponseBody JsonResult index(HttpServletRequest request) {
   JsonResult result = new JsonResult();
   try {
     Page<LocalTransaction> page = SpringMVCUtils.getPage(request);
     page.addOrder("beginTime", "desc");
     List<PropertyFilter> filters = SpringMVCUtils.getParameters(request);
     filters.add(new PropertyFilter("ALIAS_superTransactionL_NULLI_id", "0"));
     filters.add(new PropertyFilter("ALIAS_taskI_NOTNULLL_id", "0"));
     page = localTransactionManager.findPage(page, filters);
     // page =
     // localTransactionManager.findPage(page,ServletRequestUtils.getStringParameter(request,
     // "search_LIKES_mobileNo"),
     // ServletRequestUtils.getLongParameter(request,
     // "search_EQL_id",-1));
     List<LocalTransaction> requistionList = page.getResult();
     List<Map<String, Object>> mappedLocalTransactions = localTransactionResult(requistionList);
     Page<Map<String, Object>> pageMap = page.getMappedPage();
     pageMap.setResult(mappedLocalTransactions);
     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 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;
 }
예제 #3
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;
 }
예제 #4
0
 @RequestMapping
 public @ResponseBody JsonResult execute(HttpServletRequest request) {
   JsonResult result = new JsonResult();
   try {
     String ids = ServletRequestUtils.getStringParameter(request, "ids");
     localTransactionManager.changeStatus(ids, "1");
   } 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;
 }
예제 #5
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;
 }