Ejemplo n.º 1
0
 private ContractBuyStatusInfo parseStatusInfo(ResultItem statusItem) {
   ContractBuyStatusInfo statusInfo = new ContractBuyStatusInfo();
   statusInfo.id = statusItem.getString("id");
   statusInfo.contractId = statusItem.getString("oid");
   statusInfo.oprId = statusItem.getString("operator");
   statusInfo.oprDatetime = statusItem.getString("operationtime");
   statusInfo.lifeCycle = ContractLifeCycle.convert(statusItem.getInt("orderstatus|val"));
   statusInfo.oprType = ContractOprType.convert(statusItem.getInt("type|val"));
   statusInfo.remarks = statusItem.getString("remark");
   return statusInfo;
 }
Ejemplo n.º 2
0
  @Override
  protected void parseData(GetContractModelResult result, ResultItem item) {
    ResultItem modelItem = (ResultItem) item.get("DATA|bean");
    ContractModelInfo info = new ContractModelInfo();
    if (modelItem != null) {
      info.contractId = modelItem.getString("id");
      info.contractType = ContractType.convert(modelItem.getInt("status|val"));
      info.lifeCycle = ContractLifeCycle.convert(modelItem.getInt("lifecycle|val"));
      info.statusType = ContractStatusType.convert(modelItem.getInt("otype|val"));
      info.productName = modelItem.getString("productName");
      info.amount = modelItem.getString("totalamount");
      info.buyType = BuyType.convert(modelItem.getInt("saleType|val"));
      info.buyCompanyId = modelItem.getString("buyerid");
      info.buyCompanyName = modelItem.getString("buyerName");
      info.sellCompanyId = modelItem.getString("sellerid");
      info.sellCompanyName = modelItem.getString("sellerName");
      info.createTime = modelItem.getString("creatime");
      info.expireTime = modelItem.getString("limittime");

      // 解析买家状态
      ResultItem buyerStatusItem = (ResultItem) modelItem.get("buyerStatus");
      if (buyerStatusItem != null) {
        ContractBuyStatusInfo buyStatus = parseStatusInfo(buyerStatusItem);
        info.buyerStatus = buyStatus;
      }

      // 解析卖家状态
      ResultItem sellerStatusItem = (ResultItem) modelItem.get("sellerStatus");
      if (sellerStatusItem != null) {
        ContractBuyStatusInfo sellerStatus = parseStatusInfo(sellerStatusItem);
        info.sellerStatus = sellerStatus;
      }
    }
    info.content = item.getString("DATA|template");
    result.data = info;
  }