/**
  * Query next batch of claim data and return
  *
  * @return AppDataContainer
  */
 public AppDataContainer nextDataPackage() throws Exception {
   AppDataContainer ret = new AppDataBaseContainer();
   List poList =
       dao.list(" from tdInWarrantyClaim t where  t.interfaceStatus='N' ", DATA_PACKAGE_SIZE);
   Iterator it = poList.iterator();
   int i = 0;
   while (it.hasNext()) {
     i++;
     InWarrantyClaimInfo info = new InWarrantyClaimInfo();
     tdInWarrantyClaim iw = (tdInWarrantyClaim) it.next();
     info.setClaimId(iw.getClaimId().toString());
     info.setWarrantyType(iw.getWarrantyType());
     info.setWarrantyCat(iw.getWarrantyCat());
     info.setAscCode(iw.getAscCode() == null ? "" : iw.getAscCode().toString());
     info.setCreatBy(iw.getCreateBy() == null ? "" : iw.getCreateBy().toString());
     info.setCreatDate(
         iw.getCreatDate() == null
             ? ""
             : CommonUtil.formatDate(iw.getCreatDate(), CommonUtil.dateFormat1).toString());
     info.setRegion(iw.getRegion());
     info.setPartFee(iw.getPartFee() == null ? "" : iw.getPartFee().toString());
     info.setLabourFee(iw.getLabourFee() == null ? "" : iw.getLabourFee().toString());
     info.setServiceTax(iw.getServiceTax() == null ? "" : iw.getServiceTax().toString());
     info.setOtherAmount(iw.getOtherAmount() == null ? "" : iw.getOtherAmount().toString());
     info.setOtherTax(iw.getOtherTax() == null ? "" : iw.getOtherTax().toString());
     info.setIsFan(iw.getIsFan());
     info.setServiceType(iw.getServiceType());
     info.setIsCountermeasure(iw.getIsCountermeasure());
     info.setTsdRate(iw.getTsdRate() == null ? "" : iw.getTsdRate().toString());
     info.setMarkupAmount(iw.getMarkupAmount() == null ? "" : iw.getMarkupAmount().toString());
     // wubin at 20110630 增加6D,4D,partTax
     info.setD6_code(iw.getD6_code() == null ? "" : iw.getD6_code().toString());
     info.setD4_code(iw.getD4_code() == null ? "" : iw.getD4_code().toString());
     /*        	 info.setD6_code(iw.getD6_code()==null?"":iw.getD6_code());
     info.setProduct_cat(iw.getProduct_cat()==null?"":iw.getProduct_cat());*/
     info.setRowNum(i);
     ret.addInfo(info);
     processedRecord = processedRecord + 1;
   }
   return ret;
 }
  /** Modify sending status after data sent, add sent batchNo */
  public void updateStatus(AppDataContainer dataContainer, String identifyId) throws Exception {

    TreeMap treeMap = dataContainer.getDataMap();
    Iterator it = treeMap.entrySet().iterator();
    Entry entry = null;
    while (it.hasNext()) {
      entry = (Entry) it.next();
      InWarrantyClaimInfo info = (InWarrantyClaimInfo) entry.getValue();
      String hbSql = " from tdInWarrantyClaim t where t.claimId = " + info.getClaimId();
      tdInWarrantyClaim inWarrantyClaim = (tdInWarrantyClaim) dao.uniqueResult(hbSql);
      inWarrantyClaim.setInterfaceStatus("Y"); // Y=已发送
      inWarrantyClaim.setBatchNo(identifyId); // batchNo发送批次号
      // TODO 更新数据状态(数据库操作)
      dao.update(inWarrantyClaim);
    }
  }