源码获取:博客首页 "资源" 里下载!
Springboot项目CRM客户关系管理系统:
系统实现了CRM客户关系系统的基本功能,主要有看板(当月参与的业务机会、当月转化情况、将要结束的业务机会等)、业务机会(初步接触中、需求分析中、协商方案中、商业谈判中的业务机会)、客户管理、联系人管理、个人日报管理、查看团队日报、主数据管理(组织架构管理)、系统管理(用户管理、角色管理、菜单管理)。
登录控制层:
-
- public class LoginFrm extends javax.swing.JFrame {
-
- /**
- * 皮肤
- */
- static {
- try {
- // LookAndFeel lf = new SubstanceAutumnLookAndFeel();
- // LookAndFeel lf = new SubstanceChallengerDeepLookAndFeel();
- // LookAndFeel lf = new Plastic3DLookAndFeel();
- // LookAndFeel lf = new PlasticLookAndFeel();
- LookAndFeel lf = new PlasticXPLookAndFeel();
-
- UIManager.setLookAndFeel(lf);
- } catch (UnsupportedLookAndFeelException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * 版本序列号
- */
- private static final long serialVersionUID = -2989784724450522952L;
- // 验证码的String类型
- private String imageCode;
-
- private User user;
-
- /** Creates new form LoginFrm */
- public LoginFrm(User user) {
- this.user = user;
- initComponents();
- this.setLocationRelativeTo(null);
- fillImageCode();
- if (user != null) {
- this.jtf_username.setText(this.user.getusername());
- this.jpw_password.setText(this.user.getpassword());
- }
- }
-
- public void setUser(User user) {
- this.user = user;
- }
-
- /**
- * 填充验证码图片
- */
- private void fillImageCode() {
- // this.jl_checkImage.setIcon(new ImageIcon("images/check.jpeg"));
- // this.repaint();
- // jl_checkImage.setIcon(new ImageIcon(ImageIO.read(new
- // File("images/check.jpeg"))));
- ImageCodeUtil imageCodeUtil = ImageCodeUtil.getImageCodeUtil();
- jl_checkImage.setIcon(new ImageIcon(imageCodeUtil.getBufferedImage()));
- imageCode =imageCodeUtil.sRand;
- }
-
- // GEN-BEGIN:initComponents
- //
- private void initComponents() {
-
- jLabel1 = new javax.swing.JLabel();
- jLabel2 = new javax.swing.JLabel();
- jLabel3 = new javax.swing.JLabel();
- jtf_username = new javax.swing.JTextField();
- jpw_password = new javax.swing.JPasswordField();
- jLabel4 = new javax.swing.JLabel();
- jtf_check = new javax.swing.JTextField();
- jl_checkImage = new javax.swing.JLabel();
- jb_login = new javax.swing.JButton();
- jb_cancle = new javax.swing.JButton();
-
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- setTitle("\u7528\u6237\u767b\u5f55");
-
- jLabel1.setFont(new java.awt.Font("宋体", 0, 24));
- jLabel1.setText("\u5ba2\u6237\u5173\u7cfb\u7ba1\u7406\u7cfb\u7edf");
-
- jLabel2.setText("\u7528\u6237\u540d\uff1a");
-
- jLabel3.setText("\u5bc6 \u7801\uff1a");
-
- jLabel4.setText("\u9a8c\u8bc1\u7801\uff1a");
-
- jb_login.setText("\u767b\u5f55");
- jb_login.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jb_loginActionPerformed(evt);
- }
- });
-
- jb_cancle.setText("\u53d6\u6d88");
- jb_cancle.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jb_cancleActionPerformed(evt);
- }
- });
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
- getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(layout
- .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- layout.createSequentialGroup()
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- layout.createSequentialGroup()
- .addGap(108,
- 108,
- 108)
- .addComponent(
- jLabel1))
- .addGroup(
- layout.createSequentialGroup()
- .addGap(78, 78,
- 78)
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING,
- false)
- .addGroup(
- layout.createSequentialGroup()
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(
- jLabel2)
- .addComponent(
- jLabel3)
- .addComponent(
- jLabel4))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.TRAILING,
- false)
- .addGroup(
- javax.swing.GroupLayout.Alignment.LEADING,
- layout.createSequentialGroup()
- .addComponent(
- jtf_check,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 71,
- javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(
- jl_checkImage))
- .addComponent(
- jpw_password,
- javax.swing.GroupLayout.Alignment.LEADING,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 157,
- Short.MAX_VALUE)
- .addComponent(
- jtf_username,
- javax.swing.GroupLayout.Alignment.LEADING)))
- .addGroup(
- layout.createSequentialGroup()
- .addComponent(
- jb_login)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE)
- .addComponent(
- jb_cancle)))))
- .addContainerGap(79, Short.MAX_VALUE)));
- layout.setVerticalGroup(layout
- .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- layout.createSequentialGroup()
- .addGap(34, 34, 34)
- .addComponent(jLabel1)
- .addGap(53, 53, 53)
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel2)
- .addComponent(
- jtf_username,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(18, 18, 18)
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel3)
- .addComponent(
- jpw_password,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(28, 28, 28)
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel4)
- .addComponent(
- jtf_check,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jl_checkImage))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED,
- 38, Short.MAX_VALUE)
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jb_login)
- .addComponent(jb_cancle))
- .addContainerGap()));
-
- pack();
- }//
- // GEN-END:initComponents
-
- private void jb_cancleActionPerformed(java.awt.event.ActionEvent evt) {
- int i = JOptionPane.showConfirmDialog(this, "确定退出系统?", "确认信息",
- JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
- if (i == 0) {
- this.dispose();
- }
- }
-
- private void jb_loginActionPerformed(java.awt.event.ActionEvent evt) {
- String userName = this.jtf_username.getText();
- String password = new String(this.jpw_password.getPassword());
- String checkCode = this.jtf_check.getText();
- if (StringUtil.isEmpty(userName)) {
- JOptionPane.showMessageDialog(this, "用户名不能为空!");
- return;
- }
- if (StringUtil.isEmpty(password)) {
- JOptionPane.showMessageDialog(this, "密码不能为空");
- return;
- }
- if (!checkCode.equals(imageCode)) {
- JOptionPane.showMessageDialog(this, "验证码错误");
- // this.fillImageCode();
- // this.jl_checkImage.updateUI();
- // this.pack();
- return;
- }
- User user = new User(userName, password);
- UserEbi userEbi = UserEbiFactory.getUserEbi();
- User currentUser = userEbi.login(user);
- if (currentUser == null) {
- JOptionPane.showMessageDialog(this, "用户名或密码错误!");
- return;
- }
- // System.out.println("登录成功");
- this.dispose();
- new MainFrm(currentUser).setVisible(true);
- }
-
- /**
- * @param args
- * the command line arguments
-
原文:https://blog.csdn.net/yuyecsdn/article/details/122212759