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

📄 actionent_customer_enterprise.java.svn-base

📁 公司CRM部分原代码,采用的是java技术.
💻 SVN-BASE
📖 第 1 页 / 共 4 页
字号:
		cEnEnt_Customer_Enterprise.setLinkmanTel(tel.toString());
		return cEnEnt_Customer_Enterprise;
	}
	public String latent(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		HttpSession session = request.getSession(false);
		UserInfo userInfor = (UserInfo) session.getAttribute("UserInfo_Object");
		String idstr = userInfor.getId();
		String flag = "";
		String chStationCode;
		EnEnt_Customer_Enterprise aEnEnt_Customer_Enterprise[];

		flag = checkFlag(idstr);
		if (flag.equals("isAdmin")) {

			aEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise[]) (DAOBase
					.findAll(new DbAccess(), EnEnt_Customer_Enterprise.class
							.getName()));
			
			aEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise [])(DAOBase.findByCondition(new DbAccess(),
					EnEnt_Customer_Enterprise.class.getName(), " chIsAudited like '%0%' ", ""));//rownum < 120

			  logger.info("查询时使用的帐号:"+idstr);

		} else if (flag.equals("isStation")) {

			EnAuditor cEnAuditor = (EnAuditor) DAOBase.findByPK(new DbAccess(),
					EnAuditor.class.getName(), idstr);
			chStationCode = cEnAuditor.getChDeptCode();
			
		
			EnDepartment aEnDepartment [] =null;
			String where = "chparentdept = '" + chStationCode +"'"+" and chIsAudited like '%0%' ";
			aEnDepartment = (EnDepartment []) DAOBase.findByCondition(new DbAccess(), EnDepartment.class.getName(), where, "");	
			StringBuffer sb = new StringBuffer("chStationCode= '");
			sb.append(chStationCode);
			sb.append(" '");
			for(int i=0;i<aEnDepartment.length;i++) {
				sb.append(" or ");
				sb.append(" chAreacode = '");
				sb.append(aEnDepartment[i].getChDeptCode());
				
				sb.append("'");
			}
			
			String where1 = sb.toString();
			String order = "id desc";
			logger.info("查询时使用的帐号:"+idstr);
			//System.out.println("where1 -------"+where1);
			aEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise[]) (DAOBase
					.findByCondition(new DbAccess(),
							EnEnt_Customer_Enterprise.class.getName(), where1,
							order));

		} else {
			String where = "chCommitCode = '" + userInfor.getId() + "'"+" and chIsAudited like '%0%' ";
			// System.out.println("+------------>"+userInfor.);
			logger.info("查询时使用的帐号:"+userInfor.getId());
			String order = "id desc";
			aEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise[]) (DAOBase
					.findByCondition(new DbAccess(),
							EnEnt_Customer_Enterprise.class.getName(), where,
							 order));
		}
		
//		for(int i=0; i<aEnEnt_Customer_Enterprise.length;i++) {
//			aEnEnt_Customer_Enterprise[i] = GDPE.customer.enterprise.ActionEnt_Customer_Enterprise.viewInfo(aEnEnt_Customer_Enterprise[i]);
//	    } //这里可以查出联系人里面的资料
		request.setAttribute("aEnEnt_Customer_Enterprise",
				aEnEnt_Customer_Enterprise);
		request.setAttribute("chooseType", "checkbox");
		return this.getTargetPage("summary");

	}
	
	public String viewEnter(HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		//HttpSession session = request.getSession(false);
		User user = (User)UserInfo.getInstance(request);
		String idstr = user.getId();
		
		DAODisplay dd = new DAODisplay();
		Vector vt = dd.queryEnterCount();
		request.setAttribute("vt",vt);
		
		return this.getTargetPage("viewEnter");
	}
	public String viewEnterDay(HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		//HttpSession session = request.getSession(false);
		User user = (User)UserInfo.getInstance(request);
		String idstr = user.getId();
		
		DAODisplayDay dd = new DAODisplayDay();
		Vector vt = dd.queryEnterCount();
		request.setAttribute("vt",vt);
		
		return this.getTargetPage("viewEnterDay");
	}
	public String viewEnterAuditorDay(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());
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd",
				Locale.SIMPLIFIED_CHINESE);
		String timestamp = sdf.format(now);
		
		String name = new String (request.getParameter("name").getBytes("iso-8859-1"),"GBK");
	    String where1 = " Ent_Customer_Enterprise.chCommitUserName like '%" +name+"%'"+"and chIsAudited like '%1%'";
	    String where = where1+" and Ent_Customer_Enterprise.dtcommittime between TO_DATE('" + timestamp.trim() + "','yyyy-MM-dd')"+" and TO_DATE('" + timestamp.trim() + "','yyyy-MM-dd')";
	    
		EnEnt_Customer_Enterprise aEnEnt_Customer_Enterprise[];
		String order = "id desc";
		aEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise[]) (DAOBase
					.findByCondition(new DbAccess(),
							EnEnt_Customer_Enterprise.class.getName(), where,
							 order));
		request.setAttribute("aEnEnt_Customer_Enterprise",
				aEnEnt_Customer_Enterprise);
		request.setAttribute("chooseType", "checkbox");
		return this.getTargetPage("summary");

	}
	public String viewEnterAuditor(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("name").getBytes("iso-8859-1"),"GBK");
	    String where1 = " Ent_Customer_Enterprise.chCommitUserName like '%" +name+"%'"+"and chIsAudited like '%1%'";
	    String where = where1+" and Ent_Customer_Enterprise.dtcommittime between TO_DATE('" + timestamp2.trim() + "','yyyy-MM-dd')"+" and TO_DATE('" + timestamp.trim() + "','yyyy-MM-dd')";
	    
		EnEnt_Customer_Enterprise aEnEnt_Customer_Enterprise[];
		String order = "id desc";
		aEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise[]) (DAOBase
					.findByCondition(new DbAccess(),
							EnEnt_Customer_Enterprise.class.getName(), where,
							 order));
		request.setAttribute("aEnEnt_Customer_Enterprise",
				aEnEnt_Customer_Enterprise);
		request.setAttribute("chooseType", "checkbox");
		return this.getTargetPage("summary");

	}
	 /*
	import java.awt.List;
    import java.net.MalformedURLException;
    import java.util.Date;
    import java.util.Properties;
    import javax.activation.DataHandler;
    import javax.activation.FileDataSource;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    import org.dom4j.DocumentException;
   
     * Created on 2005-4-14 21:27:16
     * 
     */
    /**
     * @author 
     *  
    
    public class MailSender {
     String host;
     String userName;
     String password;
     String from;
     String to;
     String subject;
     String body;
     String fileName;
     // 用于保存发送附件的文件名列表
     List arrFileName = new List();
     public MailSender(String to, String subject, String body)
       throws MalformedURLException, DocumentException {
      //初始化发件人、收件人、主题等
      OperaXML OX = new OperaXML();
      this.from = OX.getNodeValue("config.xml", "config/Host1/From");
      this.host = OX.getNodeValue("config.xml", "config/Host1/SmtpHost");
      this.userName = OX.getNodeValue("config.xml", "config/Host1/UserName");
      this.password = OX.getNodeValue("config.xml", "config/Host1/Password");
      this.to = to;
      this.subject =subject;
      this.body = body;
     }
     // 用于收集附件名
     public void attachFile(String fileName) {
      this.arrFileName.add(fileName);
     }
     // 开始发送
     public boolean startSend() {
      //创建Properties对象
      Properties props = System.getProperties();
      //创建信件服务器
      props.put("mail.smtp.host", this.host);
      props.put("mail.smtp.auth", "true"); //通过验证
      //得到默认的对话对象
      Session session = Session.getDefaultInstance(props, null);
      try {
       //创建一个消息,并初始化该消息的各项元素
       MimeMessage msg = new MimeMessage(session);
       msg.setFrom(new InternetAddress(this.from));
       if (this.to.trim().length() > 0) {
        String[] arr = this.to.split(",");
        //int ReceiverCount=1;
        int receiverCount = arr.length;
        if (receiverCount > 0) {
         InternetAddress[] address = new InternetAddress[receiverCount];
         for (int i = 0; i < receiverCount; i++) {
          address[i] = new InternetAddress(arr[i]);
         }
         msg.addRecipients(Message.RecipientType.TO, address);
        } else {
         System.out
           .println("None receiver! The program will be exit!");
         System.exit(0);
        }
       } else {
        System.out.println("None receiver! The program will be exit!");
        System.exit(0);
       }
       msg.setSubject(subject);
       //后面的BodyPart将加入到此处创建的Multipart中
       Multipart mp = new MimeMultipart();      
       //获取附件
       int FileCount = this.arrFileName.getItemCount();
       if (FileCount > 0) {
        for (int i = 0; i < FileCount; i++) {
         MimeBodyPart mbp = new MimeBodyPart();     
         //选择出附件名
         fileName = arrFileName.getItem(i).toString();
         //得到数据源
         FileDataSource fds = new FileDataSource(fileName);
         //得到附件本身并至入BodyPart
         mbp.setDataHandler(new DataHandler(fds));
         //得到文件名同样至入BodyPart
         mbp.setFileName(fds.getName());
         mp.addBodyPart(mbp);
        }
        MimeBodyPart mbp = new MimeBodyPart();
        mbp.setText(this.body);
        mp.addBodyPart(mbp);
        //移走集合中的所有元素
        arrFileName.removeAll();
        //Multipart加入到信件
        msg.setContent(mp);
       } else {
        //设置邮件正文
        msg.setText(this.body);
       }
       //设置信件头的发送日期
       msg.setSentDate(new Date());
       msg.saveChanges();
       //发送信件
       Transport transport = session.getTransport("smtp");
       transport.connect(this.host, this.userName, this.password);
       transport.sendMessage(msg, msg
         .getRecipients(Message.RecipientType.TO));
       transport.close();
      } catch (MessagingException mex) {
       mex.printStackTrace();
       Exception ex = null;
       if ((ex = mex.getNextException()) != null) {
        ex.printStackTrace();
       }
       return false;
      }
      return true;
     }
     public static void main(String[] args) {
      try {
       MailSender sendmail = new MailSender("邮箱地址1,邮箱地址2",
         "邮件主题", "邮件内容");
       
    sendmail.attachFile("E:\\eclipse\\workspace\\MailSender\\MailSender.rar");//附件地址
       //sendmail.attachFile("附件2地址");....................
       sendmail.startSend();
       System.out.println("OK");
      } catch (Exception e) {
       e.printStackTrace();
      }
     }
    }
	 */	
}

⌨️ 快捷键说明

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