/** * Discription:[我的请款信息] * * @return 显示我发起的请款列表 * @author:[创建者中文名字] * @update:[日期YYYY-MM-DD] [更改人姓名][变更描述] */ public String myRequest() { Map<String, Object> resultMap = new HashMap<String, Object>(); PrintWriter out = null; try { out = super.getPrintWriter(); if (cashAdvanceInfo == null || cashAdvanceInfo.getCashUserId() == null || cashAdvanceInfo.getCashUserName() == null || "".equals(cashAdvanceInfo.getCashUserId()) || "".equals(cashAdvanceInfo.getCashUserName())) { resultMap.put("success", false); resultMap.put("msg", "当前用户信息为空,请检查!"); } else { List list = this.cashAdvanceService.getMyRequestCash(cashAdvanceInfo, start, limit); Long size = this.cashAdvanceService.getMyRequestCashSize(cashAdvanceInfo); resultMap.put("success", true); resultMap.put("cashList", list); resultMap.put("totalCount", size); } } catch (Exception e) { LOG.error(e.getMessage()); resultMap.put("success", false); resultMap.put("msg", "系统错误,错误代码:" + e.getMessage()); } finally { if (out != null) { out.print(getJsonString(resultMap)); out.flush(); out.close(); } } return null; }
/** * Discription:[获取待办请款任务] * * @return * @author 大牙-小白 * @update 2012-9-8 大牙-小白 [变更描述] */ public String todoTask() { Map<String, Object> resultMap = new HashMap<String, Object>(); // 定义TransactionDefinition并设置好事务的隔离级别和传播方式。 DefaultTransactionDefinition definition = new DefaultTransactionDefinition(); // 代价最大、可靠性最高的隔离级别,所有的事务都是按顺序一个接一个地执行 definition.setIsolationLevel(TransactionDefinition.ISOLATION_SERIALIZABLE); // 开始事务 TransactionStatus status = transactionManager.getTransaction(definition); PrintWriter out = null; try { out = super.getPrintWriter(); if (cashAdvanceInfo == null || cashAdvanceInfo.getCashUserId() == null || cashAdvanceInfo.getCashUserName() == null || "".equals(cashAdvanceInfo.getCashUserId()) || "".equals(cashAdvanceInfo.getCashUserName())) { resultMap.put("success", false); resultMap.put("msg", "当前用户信息为空,请检查!"); } else { resultMap = this.cashAdvanceService.getTodoRequestCash( this.springJTM.getUserTransaction(), roleService, jbpmService, cashAdvanceInfo, start, limit); resultMap.put("success", true); } } catch (Exception e) { LOG.error(e.getMessage()); status.setRollbackOnly(); resultMap.put("success", false); resultMap.put("msg", "系统错误,错误代码:" + e.getMessage()); } finally { if (status.isRollbackOnly()) { this.transactionManager.rollback(status); } else { this.transactionManager.commit(status); } // try { // jbpmService.disconnectJbpmServer(); // } catch (Exception e) { // e.printStackTrace(); // } if (out != null) { out.print(getJsonString(resultMap)); out.flush(); out.close(); } } return null; }