Package main

Source Code of main.TJUtil

/**
* (C) Copyright 2012 ZWW
*/
package main;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import org.dom4j.DocumentException;

import cputils.CPHMACService;
import cputils.CPHMLCService;
import cputils.CPHMTBService;
import cputils.CPHMWYService;
import cputils.XmlUtils;

/**
* @author ZWW
* @date 2014-3-22 下午3:54:33
* @version V1.0
*/
public class TJUtil {

  /**
   * @param args
   * @throws IOException
   * @throws DocumentException
   */
  public static void main(String[] args) throws IOException, DocumentException {
    String issueNo = "2014043";
    CPHMTBService tService = new CPHMTBService();
    Map<String, Map<Integer, Integer>> tMap = tService.tjHM4Taobao(issueNo);
    System.out.println("TB");
    System.out.println(tMap);
    System.out.println("------------------------");
    CPHMWYService wService = new CPHMWYService();
    Map<String, Map<Integer, Integer>> wMap = wService.stat(issueNo);
    System.out.println("WY");
    System.out.println(wMap);
    System.out.println("------------------------");
    CPHMACService aService = new CPHMACService();
    Map<String, Map<Integer, Integer>> aMap = aService.tjHM4Aicai(issueNo);
    System.out.println("AC");
    System.out.println(aMap);
    System.out.println("------------------------");
    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>>();
   
    Map<Integer, Integer> b1Map = new HashMap<Integer, Integer>();
    Map<Integer, Integer> a1Map = new HashMap<Integer, Integer>();
   
    Map<Integer, Integer> b2Map = lMap.get("b");
    Map<Integer, Integer> a2Map = lMap.get("a");
    for (Entry<Integer, Integer> e : b2Map.entrySet()) {
      b1Map.put(e.getKey(), e.getValue()
          +tMap.get("b").get(e.getKey())
          +wMap.get("b").get(e.getKey())
          +aMap.get("b").get(e.getKey())
          +lcMap.get("b").get(e.getKey()));
    }
    for (Entry<Integer, Integer> e : a2Map.entrySet()) {
      a1Map.put(e.getKey(), e.getValue()
          +tMap.get("a").get(e.getKey())
          +wMap.get("a").get(e.getKey())
          +aMap.get("a").get(e.getKey())
          +lcMap.get("a").get(e.getKey()));
    }
    map.put("b", b1Map);
    map.put("a", a1Map);
    System.out.println(XmlUtils.makeSortedMap(map, true));
  }

}
TOP

Related Classes of main.TJUtil

TOP
Copyright © 2018 www.massapi.com. 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.