/** * 从上游单据制单时获得数据 * * @return * @throws BizException */ @Action("getFromPreDatas") public String getFromPreDatas() throws BizException { // 调用服务返回结果 List<T> list = getBillService() .getFromPreDatas(bizTypeID, functionCode, getOnlineUser().getUser(), simpleDataVOs); // 返回制单成功的第一条记录的id if (list == null || list.size() < 1) { setJsonString("{success : true,msg : '无数据!'}"); return SUCCESS; } StringBuffer sf_json = new StringBuffer("{success:true,msg:'加载成功!',totalCounts:") .append(list.size()) .append(",result:["); for (int i = 0; i < list.size(); i++) { T tbill = list.get(i); if (i != 0) { sf_json.append(","); } sf_json.append(FastJsonUtils.billToJson(tbill, BizServiceHelper.getItemClasses(tbill), null)); } sf_json.append("]}"); setJsonString(sf_json.toString()); return SUCCESS; }
/** * 加载数据 * * @author slx * @date 2011-12-26 * @return * @throws BizException */ @Action(value = "load") public String load() throws BizException { if (bill == null) bill = getBillService().find_full(id); // FastJsonUtils.billToJson(bill, BizServiceHelper.getItemClasses(bill), null); this.setJsonString( "{'success':true,'result':" + FastJsonUtils.billToJson(bill, BizServiceHelper.getItemClasses(bill), null) + "}"); return SUCCESS; }