⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 actionent_plan_following.java

📁 公司CRM部分原代码,采用的是java技术.
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
    request.setAttribute("doType","modify");
    return this.getTargetPage("detail");
  }
//  public String wanshangQuery(HttpServletRequest request, HttpServletResponse response) throws Exception
//  {
//    String id = request.getParameter("id");
//    EnEnt_Plan_Following cEnEnt_Plan_Following = (EnEnt_Plan_Following)DAOBase.findByPK(new DbAccess(),EnEnt_Plan_Following.class.getName(),id);
//   
//
//    	if (!cEnEnt_Plan_Following.getDtTrackingDate().equals("")) {
//    		String year = cEnEnt_Plan_Following.getDtTrackingDate()
//    				.substring(0, 4);
//    		String month = cEnEnt_Plan_Following.getDtTrackingDate()
//    				.substring(5, 7);
//    		String day = cEnEnt_Plan_Following.getDtTrackingDate()
//    				.substring(8, 10);
//    		cEnEnt_Plan_Following.setDtTrackingDate(year + month + day);
//    	}
//    	if (!cEnEnt_Plan_Following.getDtPlanTrackingDate().equals("")) {
//    		String year = cEnEnt_Plan_Following.getDtPlanTrackingDate()
//    				.substring(0, 4);
//    		String month = cEnEnt_Plan_Following.getDtPlanTrackingDate()
//    				.substring(5, 7);
//    		String day = cEnEnt_Plan_Following.getDtPlanTrackingDate()
//    				.substring(8, 10);
//    		cEnEnt_Plan_Following.setDtPlanTrackingDate(year + month + day);
//    	}
//    request.setAttribute("cEnEnt_Plan_Following",cEnEnt_Plan_Following);
//    request.setAttribute("fid", id);
//    request.setAttribute("doType","wanshang");
//    return this.getTargetPage("detail");
//  }
//  public String wanshang(HttpServletRequest request, HttpServletResponse response) throws Exception
//  {
//    EnEnt_Plan_Following cEnEnt_Plan_Following = (EnEnt_Plan_Following)request.getAttribute("cEnEnt_Plan_Following");
//    java.sql.Date  now = new java.sql.Date(System.currentTimeMillis());
//    System.out.println("-----1---"+now);
//    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd",
//			Locale.SIMPLIFIED_CHINESE);
//	String timestamp = sdf.format(now);
//	  System.out.println("----2----"+cEnEnt_Plan_Following.getDtPlanTrackingDate());
//	  
//   //cEnEnt_Plan_Following.setDtTrackingDate(cEnEnt_Plan_Following.getDtPlanTrackingDate());
//	  cEnEnt_Plan_Following.setDtTrackingDate(timestamp);
//     // cEnEnt_Plan_Following.setDtTrackingDate(timestamp);
//    System.out.println("----3----"+timestamp);
//    DbAccess db = new DbAccess();
//    try
//    {
//      db.beginTransaction();
//      DAOBase.update(db,cEnEnt_Plan_Following);
//      db.commit();
//    }
//    catch(Exception ex)
//    {
//      db.rollback();
//      throw ex;
//    }
//    levin.iMessage msg = levin.iMessage.getNewInstance("客户维护",
//        "记录成功.",
//        "openDown(\"GDPE.follow.plan.ActionEnt_Plan_Following.do?doType=summary\");");
//    msg.save(request);
//    request.setAttribute("fid", request.getParameter("fid"));
//    return this.getTargetPage("Message");
//  }
  public String  modify(HttpServletRequest request, HttpServletResponse response) throws Exception
  {
    EnEnt_Plan_Following cEnEnt_Plan_Following = (EnEnt_Plan_Following)request.getAttribute("cEnEnt_Plan_Following");
    //cEnEnt_Plan_Following.setDtTrackingDate("");
   //cEnEnt_Plan_Following.setDtTrackingDate(cEnEnt_Plan_Following.getDtPlanTrackingDate());
    
    java.sql.Date  now = new java.sql.Date(System.currentTimeMillis());
      SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd",
			Locale.SIMPLIFIED_CHINESE);
	  String timestamp = sdf.format(now);
      cEnEnt_Plan_Following.setDtTrackingDate(cEnEnt_Plan_Following.getDtPlanTrackingDate());
	  cEnEnt_Plan_Following.setDtTrackingDate(timestamp);
	  //System.out.println("----3----"+timestamp);
	  int enid = cEnEnt_Plan_Following.getIFollowId();
	  EnEnt_Record_Following  eEnEnt_Record_Following = (EnEnt_Record_Following) (DAOBase.findByPK(new DbAccess(), EnEnt_Record_Following.class
				.getName(),enid+""));
				
	  eEnEnt_Record_Following.setChFollowResult(cEnEnt_Plan_Following.getChFollowResult());
	  
	  
	  if (!eEnEnt_Record_Following.getDtTrackingDate().equals("")) {
			if (eEnEnt_Record_Following.getDtTrackingDate().startsWith("1900")) {
				eEnEnt_Record_Following.setDtTrackingDate("");
			} else {
				String year = eEnEnt_Record_Following.getDtTrackingDate()
						.substring(0, 4);
				String month = eEnEnt_Record_Following.getDtTrackingDate()
						.substring(5, 7);
				String day = eEnEnt_Record_Following.getDtTrackingDate()
						.substring(8, 10);
				eEnEnt_Record_Following.setDtTrackingDate(year+ month+ day);
			}
	   }
	   if (!eEnEnt_Record_Following.getDtPlanTrackingDate().equals("")) {
			if (eEnEnt_Record_Following.getDtPlanTrackingDate().startsWith("1900")) {
				eEnEnt_Record_Following.setDtPlanTrackingDate("");
			} else {
				String year = eEnEnt_Record_Following.getDtPlanTrackingDate()
						.substring(0, 4);
				String month =eEnEnt_Record_Following.getDtPlanTrackingDate()
						.substring(5, 7);
				String day = eEnEnt_Record_Following.getDtPlanTrackingDate()
						.substring(8, 10);
				eEnEnt_Record_Following.setDtPlanTrackingDate(year+ month+ day);
			}
	   }
	  
    DbAccess db = new DbAccess();
    try
    {
      db.beginTransaction();
      DAOBase.update(db,cEnEnt_Plan_Following);
      db.commit();
      db.beginTransaction();
      DAOBase.update(db,eEnEnt_Record_Following);
      db.commit();
    }
    catch(Exception ex)
    {
      db.rollback();
      throw ex;
    }
    levin.iMessage msg = levin.iMessage.getNewInstance("客户维护",
        "成功记录.",
        "openDown(\"GDPE.follow.plan.ActionEnt_Plan_Following.do?doType=summary\");");
    msg.save(request);
    request.setAttribute("fid", request.getParameter("fid"));
    return this.getTargetPage("Message");
  }
  public String view(HttpServletRequest request, HttpServletResponse response) throws Exception
  {
    String id = request.getParameter("id");
    EnEnt_Plan_Following cEnEnt_Plan_Following = (EnEnt_Plan_Following)DAOBase.findByPK(new DbAccess(),EnEnt_Plan_Following.class.getName(),id);
    request.setAttribute("cEnEnt_Plan_Following",cEnEnt_Plan_Following);
    request.setAttribute("doType","view");
    return this.getTargetPage("detail");
  }

  public static EnEnt_Plan_Following viewInfo(
		  EnEnt_Plan_Following cEnEnt_Plan_Following)
			throws Exception {
		int enid = cEnEnt_Plan_Following.getIFollowId();
		//String where = " Ent_Record_Following.ID = '" + enid + "'";
        //if(enid !=0) 
        	
        EnEnt_Record_Following cEnEnt_Record_Following = (EnEnt_Record_Following) (DAOBase.findByPK(new DbAccess(), EnEnt_Record_Following.class.getName(), enid+""));

        cEnEnt_Plan_Following.setChEnterpriseName(cEnEnt_Record_Following.getChEnterpriseName());
        //cEnEnt_Plan_Following.setChFollowResult(cEnEnt_Record_Following.getChFollowResult());
        cEnEnt_Plan_Following.setChLinkMan(cEnEnt_Record_Following.getChCustomerName());
        return cEnEnt_Plan_Following;
	}
     
  public String delete(HttpServletRequest request, HttpServletResponse response) throws Exception
  {
    String id = request.getParameter("id");
    DbAccess db = new DbAccess();
    try
    {
    	db.beginTransaction();
    	StringTokenizer st = new StringTokenizer(id, ",");
		while (st.hasMoreElements()) {
			String index = (String) st.nextElement();
			DAOBase.delete(db,EnEnt_Plan_Following.class.getName(),index);
		}
     // DAOBase.delete(db,EnEnt_Record_Following.class.getName(),id);
      db.commit();
    }
    catch(Exception ex)
    {
      db.rollback();
      throw ex;
    }
    levin.iMessage msg = levin.iMessage.getNewInstance("客户维护",
        "删除成功.",
        "openTop(\"GDPE.follow.ActionEnt_Record_Following.do?doType=summary\");");
    msg.save(request);
    return this.getTargetPage("Message");
  }
  
  public String checkFlag(String chAuditorcode) throws Exception {
		String flag = "";

		EnAuditorRole[] cEnAuditorRole = (EnAuditorRole[]) DAOBase
				.findByCondition(new DbAccess(), EnAuditorRole.class.getName(),
						"chAuditorCode='" + chAuditorcode + "'", "");
		
		for (int i = 0; i < cEnAuditorRole.length; i++) {
			String src = cEnAuditorRole[i].getChRoleCode();
			if (src.equals("0000")//系统管理员
					||src.equals("0004")||src.equals("0006")//客户服务
					) {//发展部主管
				flag = "isAdmin";
				break;
			} else if (cEnAuditorRole[i].getChRoleCode().equals("0002")) {//登陆站长
				flag = "isStation";
			}
		}
		return flag;
	}
  public String viewStation(HttpServletRequest request, HttpServletResponse response)throws Exception {
	    
		java.util.Calendar test = Calendar.getInstance(java.util.Locale.CHINA);
	    java.sql.Date  now = new java.sql.Date(System.currentTimeMillis());
	    test.setTime(now);
	    now.getTime();
	    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd",
				Locale.SIMPLIFIED_CHINESE);
		String timestamp = sdf.format(now);
	    test.add(Calendar.DAY_OF_WEEK, -7);
	    java.sql.Date testDate2 = new java.sql.Date(test.getTimeInMillis());
	    String timestamp2 = sdf.format(testDate2);

		String name = new String (request.getParameter("station").getBytes("iso-8859-1"),"GBK");
	    
		String where = " Ent_Plan_Following.chStation like '%" +name.trim()+"%'"+" and Ent_Plan_Following.dtTrackingDate between TO_DATE('" + timestamp2.trim() + "','yyyy-MM-dd')"+" and TO_DATE('" + timestamp.trim() + "','yyyy-MM-dd')";
	    String order = "id desc";
	    EnEnt_Plan_Following[] aEnEnt_Plan_Following = (EnEnt_Plan_Following[]) (DAOBase
			.findByCondition(new DbAccess(), EnEnt_Plan_Following.class
					.getName(), where, order));
	    //System.out.println("--name--"+name);
	    for (int i = 0; i < aEnEnt_Plan_Following.length; i++) {
		if (!aEnEnt_Plan_Following[i].getDtTrackingDate().equals("")) {
			String year = aEnEnt_Plan_Following[i].getDtTrackingDate().substring(0, 4);
			String month = aEnEnt_Plan_Following[i].getDtTrackingDate().substring(5, 7);
			String day = aEnEnt_Plan_Following[i].getDtTrackingDate().substring(8, 10);
			aEnEnt_Plan_Following[i].setDtTrackingDate(year + month + day);
		}
		if (!aEnEnt_Plan_Following[i].getDtPlanTrackingDate().equals("")) {
    		String year = aEnEnt_Plan_Following[i].getDtPlanTrackingDate()
    				.substring(0, 4);
    		String month = aEnEnt_Plan_Following[i].getDtPlanTrackingDate()
    				.substring(5, 7);
    		String day = aEnEnt_Plan_Following[i].getDtPlanTrackingDate()
    				.substring(8, 10);
    		aEnEnt_Plan_Following[i].setDtPlanTrackingDate(year + month + day);
    	}
	   }
	    if(aEnEnt_Plan_Following!=null) {
	    	//System.out.println("ttttt");
	        for(int i=0; i<aEnEnt_Plan_Following.length;i++) {
	        	aEnEnt_Plan_Following[i] = GDPE.follow.plan.ActionEnt_Plan_Following.viewInfo(aEnEnt_Plan_Following[i]);
	        }
	    }
	   request.setAttribute("aEnEnt_Plan_Following", aEnEnt_Plan_Following);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -