Package cputils

Examples of cputils.XmlUtils


    }
  }
 
  public static List<String> everyPosFFC(String type) {
    List<String> resList = new ArrayList<String>();
    XmlUtils utils = new XmlUtils();
    Map<Integer, Map<Integer, Integer>> posMap = new HashMap<Integer, Map<Integer, Integer>>();

//    Map<Integer, Integer> dataMap1 = new HashMap<Integer, Integer>();
//    Map<Integer, Integer> dataMap2 = new HashMap<Integer, Integer>();
//    Map<Integer, Integer> dataMap3 = new HashMap<Integer, Integer>();
//    Map<Integer, Integer> dataMap4 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> dataMap5 = new HashMap<Integer, Integer>();
    Map<Integer, Map<String, Integer>> posdxMap = new HashMap<Integer, Map<String, Integer>>();
    for (int i = 1; i <= 5; i++) {
      posdxMap.put(i, initDXMap());
    }

    Map<Integer, Integer> first5 = new HashMap<Integer, Integer>();
    for (int i = 0; i <= 9; i++) {
      first5.put(i, 0);
//      dataMap1.put(i, 0);
//      dataMap2.put(i, 0);
//      dataMap3.put(i, 0);
//      dataMap4.put(i, 0);
      dataMap5.put(i, 0);
    }

    List<DataItem> list = new ArrayList<DataItem>();
    try {
      org.dom4j.Document root = utils.getDocumentComm(Config.DATA_FILE_PATH + type +".xml");
      Element rootEl = root.getRootElement();
      Iterator<Element> it = rootEl.elementIterator();
      Element el;
      DataItem item1;
      while (it.hasNext()) {
View Full Code Here


    return resList;
  }
 
  public static List<String> everyPos(String type) {
    List<String> resList = new ArrayList<String>();
    XmlUtils utils = new XmlUtils();
    Map<Integer, Map<Integer, Integer>> posMap = new HashMap<Integer, Map<Integer, Integer>>();

    Map<Integer, Integer> dataMap1 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> dataMap2 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> dataMap3 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> dataMap4 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> dataMap5 = new HashMap<Integer, Integer>();
    Map<String, Integer> dxMap1 = initDXMap();
    Map<String, Integer> dxMap2 = initDXMap();
    Map<String, Integer> dxMap3 = initDXMap();
    Map<String, Integer> dxMap4 = initDXMap();
    Map<String, Integer> dxMap5 = initDXMap();
    Map<Integer, Map<String, Integer>> posdxMap = new HashMap<Integer, Map<String, Integer>>();
    for (int i = 1; i <= 5; i++) {
      posdxMap.put(i, initDXMap());
    }

    Map<Integer, Integer> first2 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> first3 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> first4 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> first5 = new HashMap<Integer, Integer>();
    for (int i = 0; i <= 9; i++) {
      first2.put(i, 0);
      first3.put(i, 0);
      first4.put(i, 0);
      first5.put(i, 0);
      dataMap1.put(i, 0);
      dataMap2.put(i, 0);
      dataMap3.put(i, 0);
      dataMap4.put(i, 0);
      dataMap5.put(i, 0);
    }

    List<DataItem> list = new ArrayList<DataItem>();
    try {
      org.dom4j.Document root = utils.getDocumentComm(Config.DATA_FILE_PATH + type +".xml");
      Element rootEl = root.getRootElement();
      Iterator<Element> it = rootEl.elementIterator();
      Element el;
      DataItem item1;
      while (it.hasNext()) {
View Full Code Here

    return everySSCPos("blssc");
  }
 
  public static List<String> everySSCPos(String type) {
    List<String> resList = new ArrayList<String>();
    XmlUtils utils = new XmlUtils();
    Map<Integer, Map<Integer, Integer>> posMap = new HashMap<Integer, Map<Integer, Integer>>();

    Map<Integer, Integer> dataMap1 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> dataMap2 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> dataMap3 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> dataMap4 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> dataMap5 = new HashMap<Integer, Integer>();
    Map<Integer, Map<String, Integer>> posdxMap = new HashMap<Integer, Map<String, Integer>>();
   
    Map<Integer, Map<Integer, Integer>> posNumMap = new HashMap<Integer, Map<Integer, Integer>>();
   
    //万、千、百、十、个
    Map<Integer, Integer> posNum0 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> posNum1 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> posNum2 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> posNum3 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> posNum4 = new HashMap<Integer, Integer>();
    //万、千、百、十、个  最大遗漏
    Map<Integer, Integer> posMaxNum0 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> posMaxNum1 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> posMaxNum2 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> posMaxNum3 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> posMaxNum4 = new HashMap<Integer, Integer>();
   
    //大小历史
    Map<Integer, String> dxHistory = new HashMap<Integer, String>();
    Map<Integer, Integer> temp = null;
    for (int i = 1; i <= 5; i++) {
      posdxMap.put(i, initDXMap());
      dxHistory.put(i, "");
     
      temp = new HashMap<Integer, Integer>();
      for (int j = 0; j <= 9; j++) {
        temp.put(j, 0);
      }
      posNumMap.put(i, temp);
    }

    Map<Integer, Integer> first2 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> first4 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> first5 = new HashMap<Integer, Integer>();
   
    Map<Integer, Integer> first3 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> mid3 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> last3 = new HashMap<Integer, Integer>();
   
    Map<Integer, Integer> row2 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> row3 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> row4 = new HashMap<Integer, Integer>();
    Map<Integer, Integer> row5 = new HashMap<Integer, Integer>();
    //最大遗漏
    Map<Integer, Integer> maxOmit = new HashMap<Integer, Integer>();
    //当前遗漏
    Map<Integer, Integer> currentOmit = new HashMap<Integer, Integer>();
   
    Map<Integer, String> omitHistory = new HashMap<Integer, String>();
   
    temp = new HashMap<Integer, Integer>();
    for (int i = 0; i <= 9; i++) {
      omitHistory.put(i, "");
      temp.put(i, 0);
    }
    first2.putAll(temp);
    mid3.putAll(temp);
    first3.putAll(temp);
    last3.putAll(temp);
    first4.putAll(temp);
    first5.putAll(temp);
    dataMap1.putAll(temp);
    dataMap2.putAll(temp);
    dataMap3.putAll(temp);
    dataMap4.putAll(temp);
    dataMap5.putAll(temp);
    row2.putAll(temp);
    row3.putAll(temp);
    row4.putAll(temp);
    row5.putAll(temp);
    maxOmit.putAll(temp);
    currentOmit.putAll(temp);
   
    posNum0.putAll(temp);
    posNum1.putAll(temp);
    posNum2.putAll(temp);
    posNum3.putAll(temp);
    posNum4.putAll(temp);
   
    posMaxNum0.putAll(temp);
    posMaxNum1.putAll(temp);
    posMaxNum2.putAll(temp);
    posMaxNum3.putAll(temp);
    posMaxNum4.putAll(temp);
   
   
    //万、千、百、十、个
//    int posNum1=0,posNum2=0,posNum3=0,posNum4=0,posNum5=0;
   

    List<DataItem> list = new ArrayList<DataItem>();
    String today = new SimpleDateFormat("yyyyMMdd").format(new Date());
    try {
      org.dom4j.Document root = utils.getDocumentComm(Config.DATA_FILE_PATH + type +".xml");
      Element rootEl = root.getRootElement();
      Iterator<Element> it = rootEl.elementIterator();
      Element el;
      DataItem item1;
      while (it.hasNext()) {
View Full Code Here

       
  }
 
  public static Map<String,String> every115Pos(String fileName,String day) {
    Map<String,String> resMap = new HashMap<String,String>();
    XmlUtils utils = new XmlUtils();

    Map<Integer, String> num = new HashMap<Integer, String>();
   
    //最大遗漏
    Map<Integer, Integer> maxOmit = new HashMap<Integer, Integer>();
//    Map<Integer, Integer> tempMaxOmit = new HashMap<Integer, Integer>();
    //当前遗漏
    Map<Integer, Integer> currentOmit = new HashMap<Integer, Integer>();
   
    Map<Integer, String> omitHistory = new HashMap<Integer, String>();
   
    for (int i = 1; i <= 11; i++) {
      num.put(i, "");
      maxOmit.put(i, 0);
      currentOmit.put(i, 0);
      omitHistory.put(i, "0");
    }

    List<DataItem> list = new ArrayList<DataItem>();
    try {
      org.dom4j.Document root = utils.getDocumentComm(Config.DATA_FILE_PATH + fileName +".xml");
      Element rootEl = root.getRootElement();
      Iterator<Element> it = rootEl.elementIterator();
      Element el;
      DataItem item1;
      while (it.hasNext()) {
View Full Code Here

    }else if (Config.prop.getProperty("cq115id").equals(id)) {
      type = "cq115";
    }
    int pageNo = 1;
    try {
      XmlUtils utils = new XmlUtils();
      Connection conn = ConnectionManager.getInstance().getConnection(url);
      conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","10");
      Document doc = conn.post();
      String res = doc.text();
      JSONObject obj = JSONObject.fromObject(res);
      int total = obj.getInt("total");
      int count = 0;
      boolean skipout = false;
      do {
        conn = ConnectionManager.getInstance().getConnection(url);
        conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","50");
        doc = conn.post();
        res = doc.text();
        JSONArray rows = JSONObject.fromObject(res).getJSONArray("rows");
        count = count + rows.size();
        for (Object object : rows) {
          JSONObject row = (JSONObject) object;
          if (row.getString("phase").indexOf(day) == -1) {
            skipout = true;
            continue;
          }
          DataItem item = new DataItem(row.getString("phase"), row.getString("code").replaceAll(",", " "), type);
         
          if (utils.addSSCItem(item)) {
            printMsg(id,row.getString("phase") +": "+row.getString("code")+ " insert...");
          }else {
            skipout = true;
            break;
          }
        }
        pageNo++;
      } while (count < total && !skipout);
      sortOpened(new XmlUtils(),type+".xml");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    String id = "100";
    int pageNo = 1;
    try {
      String today = new SimpleDateFormat("yyyyMMdd").format(new Date());
//      today = "20140917";
      XmlUtils utils = new XmlUtils();
      Connection conn = ConnectionManager.getInstance().getConnection(url);
      conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","10");
      Document doc = conn.post();
      String res = doc.text();
      JSONObject obj = JSONObject.fromObject(res);
      int total = obj.getInt("total");
      int count = 0;
      boolean skipout = false;
      do {
        conn = ConnectionManager.getInstance().getConnection(url);
        conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","50");
        doc = conn.post();
        res = doc.text();
        JSONArray rows = JSONObject.fromObject(res).getJSONArray("rows");
        count = count + rows.size();
        for (Object object : rows) {
          JSONObject row = (JSONObject) object;
          if (row.getString("phase").indexOf(today) == -1) {
            skipout = true;
            continue;
          }
          DataItem item = new DataItem();
          item = new DataItem(row.getString("phase"), row.getString("code").replaceAll(",", " "), "blssc");
          if (utils.addSSCItem(item)) {
            System.out.println(row.getString("phase") +": "+row.getString("code")+ " insert...");
          }else {
//            System.err.println(row.getString("phase")+" is inserted!");
            skipout = true;
            break;
          }
        }
        pageNo++;
      } while (count < total && !skipout);
      sortOpened(new XmlUtils(),"blssc.xml");
      System.out.println("**********END insert "+count+"**********");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      type = "cqssc";
    }
    int pageNo = 1;
    try {
      String today = new SimpleDateFormat("yyyyMMdd").format(new Date());
      XmlUtils utils = new XmlUtils();
      Connection conn = ConnectionManager.getInstance().getConnection(url);
      conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","10");
      Document doc = conn.post();
      String res = doc.text();
      JSONObject obj = JSONObject.fromObject(res);
      int total = obj.getInt("total");
      int count = 0;
      boolean skipout = false;
      do {
        conn = ConnectionManager.getInstance().getConnection(url);
        conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","50");
        doc = conn.post();
        res = doc.text();
        JSONArray rows = JSONObject.fromObject(res).getJSONArray("rows");
        count = count + rows.size();
        for (Object object : rows) {
          JSONObject row = (JSONObject) object;
          if (row.getString("phase").indexOf(today) == -1) {
            skipout = true;
            continue;
          }
          DataItem item = new DataItem(row.getString("phase"), row.getString("code").replaceAll(",", " "), type);
         
          if (utils.addSSCItem(item)) {
            printMsg(id, row.getString("phase") +": "+row.getString("code")+ " insert...");
            dataTipMsg += type + "  " + row.getString("phase") +": "+row.getString("code")+"\r\n";
          }else {
            skipout = true;
            break;
          }
        }
        pageNo++;
      } while (count < total && !skipout);
      sortOpened(new XmlUtils(),type+".xml");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  }
 
  public void dataFFC(String url) {
    int pageNo = 1;
    try {
      XmlUtils utils = new XmlUtils();
      Connection conn = ConnectionManager.getInstance().getConnection(url);
      conn.cookie("id", "103").data("id","103","page",""+pageNo,"rows","10");
      Document doc = conn.post();
      String res = doc.text();
      JSONObject obj = JSONObject.fromObject(res);
      int total = obj.getInt("total");
//      System.out.println(total);
      int count = 0;
      boolean skipout = false;
      String today = new SimpleDateFormat("yyyyMMdd").format(new Date());
      do {
        conn = ConnectionManager.getInstance().getConnection(url);
        conn.cookie("id", "103").data("id","103","page",""+pageNo,"rows","50");
        doc = conn.post();
        res = doc.text();
        JSONArray rows = JSONObject.fromObject(res).getJSONArray("rows");
        count = count + rows.size();
        for (Object object : rows) {
          JSONObject row = (JSONObject) object;
          if (row.getString("phase").indexOf(today) == -1) {
            skipout = true;
            continue;
          }
          DataItem item = new DataItem();
          item = new DataItem(row.getString("phase"), row.getString("code").replaceAll(",", " "), "ffc");
          if (utils.addSSCItem(item)) {
            System.out.println(row.getString("phase") + ": " + row.getString("code") + " insert...");
          }else {
            skipout = true;
            break;
          }
        }
        pageNo++;
      } while (count < total && !skipout);
      sortOpened(new XmlUtils(),"ffc.xml");
      System.out.println("**********END**********");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        item.addItem(b++, e.getKey(), e.getValue(), 2);
        //System.out.print(e.getKey()+" ");
      }
      //System.out.println(bMap);
      //System.out.println(aMap);
      XmlUtils utils = new XmlUtils();
      DataItem dataitem = utils.getDataItem(issueNo);
      if(dataitem == null){
        logger.error(issueNo+":kj is null...");
        return null;
      }
      String[] allArr = dataitem.getOpencode().split(" ");
View Full Code Here

    CPHMLCService lService = new CPHMLCService();
    Map<String, Map<Integer, Integer>> lcMap = lService.tjHM4Lecai(issueNo);
    System.out.println("LC");
    System.out.println(lcMap);
    System.out.println("------------------------");
    XmlUtils utils = new XmlUtils();
    Map<String, Map<Integer, Integer>> lMap = utils.stat(issueNo);
    System.out.println("KJ");
    System.out.println(lMap);
    System.out.println("-----------------add-------");
    Map<String, Map<Integer, Integer>> map = new HashMap<String, Map<Integer,Integer>>();
   
View Full Code Here

TOP

Related Classes of cputils.XmlUtils

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.