您好,欢迎光临本网站![请登录][注册会员]  
文件名称: mpxj-0.0.25, 可以解析.mpp(ms project)文件
  所属分类: Java
  开发工具:
  文件大小: 2mb
  下载次数: 0
  上传时间: 2010-01-31
  提 供 者: wk11*****
 详细说明: 自己写的示例 仅供参考: public static void main(String[] args) { File file; file = new File("e:\\客户管理项目计划V1.0.mpp"); LinkedHashMap infoMap = new LinkedHashMap(); Map userSbMap = new HashMap(); List resourceList = new ArrayList(); String a = readMpp(file, infoMap, userSbMap, resourceList); } public static String readMpp(File file, LinkedHashMap infoMap, Map userSbMap, List resourceList) { MPPFile mpp; String result = ""; try { mpp = new MPPFile(file); LinkedList allList = mpp.get AllTasks(); allList.remove(0); for (int i = 0; i < allList.size(); i++) { Task t = (Task) allList.get(i); Map taskMap = new HashMap(); String flag = t.getUniqueID().toString(); taskMap.put("唯一标识号", t.getUniqueID().toString()); taskMap.put("标识号", t.getID().toString()); taskMap.put("任务名称", t.getName()); taskMap.put("大纲级别", t.getOutlineLevel().toString()); //处理开始时间 Date planStartDate = t.getStart(); String planStart = "-1"; if (planStartDate != null) { planStart = new Long(planStartDate.getTime()).toString(); } //处理完成时间 Date planStopDate = t.getFinish(); String planFinish = "-1"; if (planStopDate != null) { planFinish = new Long(planStopDate.getTime()).toString(); } //处理实际开始时间 Date actStartDate = t.getActualStart(); String actStart = "-1"; if (actStartDate != null) { actStart = new Long(actStartDate.getTime()).toString(); } //处理实际结束日期 Date actStopDate = t.getActualFinish(); String actFinish = "-1"; if (actStopDate != null) { actFinish = new Long(actStopDate.getTime()).toString(); } //处理里程碑 Boolean markedB = t.getMilestone(); String y_or_n = "否"; if (markedB != null) { boolean marked = markedB.booleanValue(); if (marked) { y_or_n = "是"; } } //处理资源 List userList = new ArrayList(); LinkedList resources = t.getResourceAssignments(); if (resources.size() > 0) { for (int j = 0; j < resources.size(); j++) { ResourceAssignment resourceA = (ResourceAssignment)resources.get(j); Resource resource = resourceA.getResource(); String resourceName = resource.getName(); String resourceUnit = String.valueOf(resourceA.getUnitsValue()); Map userMap = new HashMap(); userMap.put("quota", resourceUnit); userMap.put("userName", resourceName); if (userSbMap.get(resourceName) == null) { StringBuffer sb = new StringBuffer(); sb.append(""); userSbMap.put(resourceName, sb); userMap.put("login", sb); } else { userMap.put("login", userSbMap.get(resourceName)); } userList.add(userMap); if (!resourceList.contains(resourceName)) { resourceList.add(resourceName); } } } //处理前置任务 List pred = t.getPredecessors(); if (pred != null && pred.size() > 0) { List pred_tasksList = new ArrayList(); for (int x = 0; x < pred.size(); x++) { Relation r = (Relation) pred.get(x); String rId = String.valueOf(r.getTaskUniqueIDValue()); pred_tasksList.add(rId); } taskMap.put("前置任务", pred_tasksList); } else { taskMap.put("前置任务", new ArrayList()); } taskMap.put("资源", userList); taskMap.put("开始时间", planStart); taskMap.put("完成时间", planFinish); taskMap.put("工期", t.getDuration().toString().replaceAll("d", "")); taskMap.put("里程碑", y_or_n); taskMap.put("完成百分比", t.getPercentageComplete().toString()); taskMap.put("实际开始时间", actStart); taskMap.put("实际完成时间", actFinish); taskMap.put("任务描述", t.getText1()); infoMap.put(flag, taskMap); } } catch (MPXException e) { result = "您选择的文件格式有误或文件不是Project2003格式,请检查。"; e.printStackTrace(); } return result; } ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: mpxj project
 输入关键字,在本站1000多万海量源码库中尽情搜索: