精华内容
下载资源
问答
  • 员工管理系统、 开发工具:Android Studio 数据库: sqlite 数据库 部分源码 manifest.xml配置文件 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=...

    员工管理系统、

    开发工具:Android Studio
    数据库: sqlite
    源码:https://gitee.com/van_is_dead/company
    在这里插入图片描述

    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    数据库
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    在这里插入图片描述
    部分源码
    manifest.xml配置文件

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.company">
    
        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
            <activity android:name=".SearchActivity"></activity>
            <activity android:name=".GuanliActivity" />
            <activity android:name=".GloginActivity" />
            <activity android:name=".RegisterActivity" />
            <activity android:name=".IntroductionActivity" />
            <activity android:name=".NewsActivity" />
            <activity android:name=".FirstActivity" />
    
            <activity android:name=".LoginActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    
    </manifest>
    

    员工界面

    package com.example.company;
    
    import androidx.appcompat.app.AppCompatActivity;
    
    import android.content.Intent;
    import android.content.SharedPreferences;
    import android.database.Cursor;
    import android.database.SQLException;
    import android.database.sqlite.SQLiteDatabase;
    import android.database.sqlite.SQLiteOpenHelper;
    import android.os.Bundle;
    import android.text.format.Time;
    import android.util.Log;
    import android.view.View;
    import android.widget.AdapterView;
    import android.widget.Button;
    import android.widget.ListView;
    import android.widget.SimpleCursorAdapter;
    import android.widget.TextView;
    import android.widget.Toast;
    
    
    public class FirstActivity extends AppCompatActivity {
    
        private Cursor cursor;
        @Override
        public void onDestroy(){
            super.onDestroy();
            cursor.close();
        }
    
    
    
        //定义共享优先数据及基础字段  用于签到功能实现
        private String MY_RMBCost ="MY_RMBCost";
    
        private String TodayTime ="TodayTime";
    
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_first);
    
            //--------------------------------------------------------------登录
            Button btnlongin = findViewById(R.id.login);
            btnlongin.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent = new Intent(FirstActivity.this,LoginActivity.class);
                    startActivity(intent);
                }
            });
    
            //-------------------------------------------------------------签到
            final Button bt_qiandao = (Button)findViewById(R.id.bt_qiandao);
            final TextView tv_time = (TextView)findViewById(R.id.tv_qiandaotime);
    
            SharedPreferences my_rmb_data = getSharedPreferences(MY_RMBCost, 0);//读取共享数据
    
            Time t = new Time();
            t.setToNow();
            int lastmonth = t.month + 1 ;
            final String str =  t.year + "年" + lastmonth + "月" + t.monthDay + "日";
    
    
            final String nowtime =my_rmb_data.getString(TodayTime, "").toString();
    
            if(nowtime.equals(str)==true)
            {
                tv_time.setText("日期:"+ nowtime +"已签到!");
                bt_qiandao.setBackgroundResource(R.drawable.yqd);
                bt_qiandao.setText("✔签到");
            }
            else
            {
                tv_time.setText("日期:"+ str);
                bt_qiandao.setBackgroundResource(R.drawable.qd);
            }
    
            //签到功能
            bt_qiandao.setOnClickListener(new View.OnClickListener() {
    
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    SharedPreferences my_rmb_data = getSharedPreferences(MY_RMBCost, 0);
                    if(my_rmb_data.getString(TodayTime, "").toString().equals(str)==true)
                    {
                        Toast.makeText(FirstActivity.this , "今日已签到!", Toast.LENGTH_SHORT).show();
                    }
                    else
                    {
                        my_rmb_data.edit()
                                .putString(TodayTime, str)
                                .commit();
                        tv_time.setText("日期:"+ str +"已签到!");
                        bt_qiandao.setBackgroundResource(R.drawable.yqd);
                        bt_qiandao.setText("✔签到");
                        Toast.makeText( FirstActivity.this , "签到成功!", Toast.LENGTH_SHORT).show();
                    }
                }
            });
            //-------------------------------------每日资讯
            //ArrayAdapter<News> listAdapter= new ArrayAdapter<>(this,android.R.layout.simple_list_item_1,News.news);
    
    
            ListView listnews = findViewById(R.id.list_news);
            //listnews.setAdapter(listAdapter);
    
            //设置游标适配器
            SQLiteOpenHelper starbuzzDatabaseHelper=new CompanyDatabaseHelper(this);
            //获得数据库引用
            try {
                SQLiteDatabase db =starbuzzDatabaseHelper.getReadableDatabase();
                cursor = db.query("NEWS",
                        new String[]{"_id","TITLE"},
                        null,null,null,null,null);
                SimpleCursorAdapter listAdapter = new SimpleCursorAdapter(this,
                        android.R.layout.simple_list_item_1,
                        cursor,
                        new String[]{"TITLE"},
                        new int[]{android.R.id.text1},
                        0);
                listnews.setAdapter(listAdapter);
    
            }catch (SQLException e){
                Log.e("sqlite",e.getMessage());
                Toast toast=Toast.makeText(this,"Database unavaiable",Toast.LENGTH_SHORT);
                toast.show();
            }
            //指定监听器 相应选项单击
            AdapterView.OnItemClickListener itemClickListener=new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    
                    Intent intent = new Intent(FirstActivity.this,NewsActivity.class);
                    intent.putExtra(NewsActivity.EXTRA_DRINKID,(int)id);
                    startActivity(intent);
    
                }
            };
            listnews.setOnItemClickListener(itemClickListener);
            //-------------------------------------------------公司简介
            Button btnintroduction = findViewById(R.id.introduction);
            btnintroduction.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent = new Intent(FirstActivity.this,IntroductionActivity.class);
                    startActivity(intent);
                }
            });
    
        }
    }
    
    

    登录注册

    package com.example.company;
    
    import androidx.appcompat.app.AppCompatActivity;
    
    import android.content.Intent;
    import android.os.Bundle;
    import android.text.TextUtils;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.LinearLayout;
    import android.widget.RelativeLayout;
    import android.widget.TextView;
    import android.widget.Toast;
    
    import java.util.ArrayList;
    
    public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
    
    //    @Override
    //    protected void onCreate(Bundle savedInstanceState) {
    //        super.onCreate(savedInstanceState);
    //        setContentView(R.layout.activity_login);
    //
    //        Button mbtnlogin = findViewById(R.id.btn_login);
    //        mbtnlogin.setOnClickListener(new View.OnClickListener() {
    //            @Override
    //            public void onClick(View v) {
    //
    //                Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
    //                Intent intent = new Intent(LoginActivity.this,FirstActivity.class);
    //                startActivity(intent);
    //            }
    //        });
    //
    //        Button btnback = findViewById(R.id.btn_back);
    //        btnback.setOnClickListener(new View.OnClickListener() {
    //            @Override
    //            public void onClick(View v) {
    //                Intent intent = new Intent(LoginActivity.this,FirstActivity.class);
    //                startActivity(intent);
    //            }
    //        });
    //    }
        private CompanyDatabaseHelper mDBOpenHelper;
    
        private EditText mEtLoginactivityUsername;
        private EditText mEtLoginactivityPassword;
        private Button mBtLonginactivittRegister;
        private Button mBtLoginactivityLogin;
        private Button mBtLoginactivityGl;
        private String rname;
        private String rpassword;
    
    
        /**
         * 创建 Activity 时先来重写 onCreate() 方法
         * 保存实例状态
         * super.onCreate(savedInstanceState);
         * 设置视图内容的配置文件
         * setContentView(R.layout.activity_login);
         * 上面这行代码真正实现了把视图层 View 也就是 layout 的内容放到 Activity 中进行显示
         * 初始化视图中的控件对象 initView()
         * 实例化 DBOpenHelper,待会进行登录验证的时候要用来进行数据查询
         * mDBOpenHelper = new DBOpenHelper(this);
         */
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_login);
    
            initView();
            rpassword();
    
            mDBOpenHelper = new CompanyDatabaseHelper(this);
        }
    
       //记住密码
        private void rpassword(){
            if(rname!=null && rpassword!=null)
            {
                mEtLoginactivityUsername.setText(rname);
                mEtLoginactivityPassword.setText(rpassword);
            }
        }
        /**
         * onCreae()中大的布局已经摆放好了,接下来就该把layout里的东西
         * 声明、实例化对象然后有行为的赋予其行为
         * 这样就可以把视图层View也就是layout 与 控制层 Java 结合起来了
         */
        private void initView() {
            // 初始化控件
            mBtLoginactivityLogin = findViewById(R.id.bt_loginactivity_login);
            mBtLoginactivityGl = findViewById(R.id.bt_loginactivityGl);
           mBtLonginactivittRegister = findViewById(R.id.bt_loginactivity_register);
            mEtLoginactivityUsername = findViewById(R.id.et_loginactivity_username);
            mEtLoginactivityPassword = findViewById(R.id.et_loginactivity_password);
    
    
    
    
            // 设置点击事件监听器
            mBtLoginactivityLogin.setOnClickListener(this);
            mBtLonginactivittRegister.setOnClickListener(this);
            mBtLoginactivityGl.setOnClickListener(this);
        }
    
        public void onClick(View view) {
            switch (view.getId()) {
                // 跳转到注册界面
                case R.id.bt_loginactivity_register:
                    startActivity(new Intent(this, RegisterActivity.class));
                    finish();
                    break;
                case R.id.bt_loginactivityGl:
                    startActivity(new Intent(this,GloginActivity.class));
                    finish();
                    break;
                    /**
                 * 登录验证:
                 *
                 * 从EditText的对象上获取文本编辑框输入的数据,并把左右两边的空格去掉
                 *  String name = mEtLoginactivityUsername.getText().toString().trim();
                 *  String password = mEtLoginactivityPassword.getText().toString().trim();
                 *  进行匹配验证,先判断一下用户名密码是否为空,
                 *  if (!TextUtils.isEmpty(name) && !TextUtils.isEmpty(password))
                 *  再进而for循环判断是否与数据库中的数据相匹配
                 *  if (name.equals(user.getName()) && password.equals(user.getPassword()))
                 *  一旦匹配,立即将match = true;break;
                 *  否则 一直匹配到结束 match = false;
                 *
                 *  登录成功之后,进行页面跳转:
                 *
                 *  Intent intent = new Intent(this, MainActivity.class);
                 *  startActivity(intent);
                 *  finish();//销毁此Activity
                 */
                case R.id.bt_loginactivity_login:
                    String name = mEtLoginactivityUsername.getText().toString().trim();
                    String password = mEtLoginactivityPassword.getText().toString().trim();
                     rname = name;
                     rpassword = password;
    
                    if (!TextUtils.isEmpty(name) && !TextUtils.isEmpty(password)) {
                        ArrayList<User> data = mDBOpenHelper.getAllData();
                        boolean match = false;
                        for (int i = 0; i < data.size(); i++) {
                            User user = data.get(i);
                            if (name.equals(user.getName()) && password.equals(user.getPassword())) {
                                match = true;
                                break;
                            } else {
                                match = false;
                            }
                        }
                        if (match) {
    
                            Toast.makeText(this, "登录成功", Toast.LENGTH_SHORT).show();
                            Intent intent = new Intent(this, FirstActivity.class);
                            startActivity(intent);
                            finish();//销毁此Activity
                        } else {
                            Toast.makeText(this, "用户名或密码不正确,请重新输入", Toast.LENGTH_SHORT).show();
                        }
                    } else {
                        Toast.makeText(this, "请输入你的用户名或密码", Toast.LENGTH_SHORT).show();
                    }
                    break;
            }
        }
    }
    package com.example.company;
    
    import android.content.Intent;
    import android.os.Bundle;
    import android.text.TextUtils;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    
    import android.widget.Toast;
    
    import androidx.appcompat.app.AppCompatActivity;
    /**
    
     */
    /**
     * 此类 implements View.OnClickListener 之后,
     * 就可以把onClick事件写到onCreate()方法之外
     * 这样,onCreate()方法中的代码就不会显得很冗余
     */
    public class RegisterActivity extends AppCompatActivity implements View.OnClickListener {
    
    
        private CompanyDatabaseHelper mDBOpenHelper;
        private Button mBtRegisteractivityRegister;
    
        private EditText mEtRegisteractivityUsername;
        private EditText mEtRegisteractivityPassword1;
        private EditText mEtRegisteractivityPassword2;
        private Button mBtRegisteractivityBack;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_register);
    
            initView();
    
            mDBOpenHelper = new CompanyDatabaseHelper(this);
    
    
        }
    
        private void initView(){
            mBtRegisteractivityRegister = findViewById(R.id.bt_registeractivity_register);
    
            mBtRegisteractivityBack = findViewById(R.id.bt_registeractivity_back);
    
            mEtRegisteractivityUsername = findViewById(R.id.et_registeractivity_username);
            mEtRegisteractivityPassword1 = findViewById(R.id.et_registeractivity_password1);
            mEtRegisteractivityPassword2 = findViewById(R.id.et_registeractivity_password2);
    
    
    
            /**
             * 注册页面能点击的就三个地方
             * top处返回箭头、刷新验证码图片、注册按钮
             */
            mBtRegisteractivityBack.setOnClickListener(this);
    
            mBtRegisteractivityRegister.setOnClickListener(this);
        }
    
        public void onClick(View view) {
            switch (view.getId()) {
                case R.id.bt_registeractivity_back: //返回登录页面
                    Intent intent1 = new Intent(this, LoginActivity.class);
                    startActivity(intent1);
                    finish();
                    break;
    
                case R.id.bt_registeractivity_register:    //注册按钮
                    //获取用户输入的用户名、密码、验证码
                    String username = mEtRegisteractivityUsername.getText().toString().trim();
                    String password1 = mEtRegisteractivityPassword1.getText().toString().trim();
                    String password2 = mEtRegisteractivityPassword2.getText().toString().trim();
    
                    //注册验证
                    if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(password1) && !TextUtils.isEmpty(password2) ) {
                        if (password1.equals(password2)) {
                            //将用户名和密码加入到数据库中
                            mDBOpenHelper.login_add(username, password1);
                            Intent intent2 = new Intent(this, FirstActivity.class);
                            startActivity(intent2);
                            finish();
                            Toast.makeText(this,  "验证通过,注册成功", Toast.LENGTH_SHORT).show();
                        } else {
                            Toast.makeText(this, "密码不一致,注册失败", Toast.LENGTH_SHORT).show();
                        }
                    }else {
                        Toast.makeText(this, "未完善信息,注册失败", Toast.LENGTH_SHORT).show();
                    }
                    break;
            }
        }
    }
    
    
    

    管理员

    package com.example.company;
    
    import androidx.appcompat.app.AppCompatActivity;
    
    import android.app.AlertDialog;
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.database.Cursor;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.Toast;
    
    public class GuanliActivity extends AppCompatActivity implements View.OnClickListener {
    
        private Cursor cursor;
    
        private CompanyDatabaseHelper mDBOpenHelper;
        private Button mbtadd;
        private Button mbtdelete;
        private  Button mbtupdate;
        private Button mbtsearch;
        private Button mbtback;
    
        private EditText medtname;
        private EditText medtsex;
        private EditText medttel;
        private EditText medtposition;
        private EditText medttime;
    
    
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_guanli);
            initView();
    
            mDBOpenHelper = new CompanyDatabaseHelper(this);
        }
    
        private void initView(){
            mbtadd = findViewById(R.id.bt_add);
            mbtdelete = findViewById(R.id.bt_delete);
            mbtupdate = findViewById(R.id.bt_update);
            mbtsearch = findViewById(R.id.bt_search);
            mbtback = findViewById(R.id.bt_guanliback);
    
            medtname = findViewById(R.id.edt_name);
            medtsex = findViewById(R.id.edt_sex);
            medttel = findViewById(R.id.edt_tel);
            medtposition = findViewById(R.id.edt_position);
            medttime = findViewById(R.id.edt_time);
    
            mbtadd.setOnClickListener(this);
            mbtdelete.setOnClickListener(this);
            mbtupdate.setOnClickListener(this);
            mbtsearch.setOnClickListener(this);
            mbtback.setOnClickListener(this);
        }
    
        public void onClick(View view){
            switch (view.getId()){
                case R.id.bt_add:
    //                int mid =Integer.parseInt (medtid.getText().toString());
                    String name = medtname.getText().toString().trim();
                    String sex = medtsex.getText().toString().trim();
                    String tel = medttel.getText().toString().trim();
                    String position = medtposition.getText().toString().trim();
                    String time = medttime.getText().toString().trim();
                    mDBOpenHelper.yuangong_add(name,sex,tel,position,time);
                    Toast.makeText(this,  "添加成功", Toast.LENGTH_SHORT).show();
                    medtname.setText("");
                    medtsex.setText("");
                    medttel.setText("");
                    medtposition.setText("");
                    medttime.setText("");
                    break;
                case R.id.bt_delete:
                    AlertDialog alertDialog = new AlertDialog.Builder(this)
                            .setTitle("删除员工信息")
                            .setMessage("是否删除")
                            .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                                @Override
                                public void onClick(DialogInterface dialogInterface, int i) {
                                    String name = medtname.getText().toString().trim();
                                    String position = medtposition.getText().toString().trim();
                                    mDBOpenHelper.yuangong_delete(name);
                                    medtname.setText("");
                                    medtsex.setText("");
                                    medttel.setText("");
                                    medtposition.setText("");
                                    medttime.setText("");
    
                                }
                            })
                            .setNegativeButton("取消", new DialogInterface.OnClickListener() {
                                @Override
                                public void onClick(DialogInterface dialogInterface, int i) {
                                    return;
                                }
                            }).create();
                    alertDialog.show();
                    break;
                case R.id.bt_update:
                    String uname = medtname.getText().toString().trim();
                    String utel = medttel.getText().toString().trim();
                    String uposition = medtposition.getText().toString().trim();
                    mDBOpenHelper.yuangong_updata(uname,uposition,utel);
                    Toast.makeText(this,"更新成功",Toast.LENGTH_SHORT).show();
                    medtname.setText("");
                    medtsex.setText("");
                    medttel.setText("");
                    medtposition.setText("");
                    medttime.setText("");
                    break;
                case R.id.bt_search:
                    startActivity(new Intent(GuanliActivity.this, SearchActivity.class));
                    finish();//销毁此Activity
    
                    break;
    
                case R.id.bt_guanliback:
                    startActivity(new Intent(GuanliActivity.this, GloginActivity.class));
                    finish();//销毁此Activity
                    break;
            }
    
        }
    }
    
    

    数据库

    package com.example.company;
    
    import android.content.ContentValues;
    import android.content.Context;
    import android.database.Cursor;
    import android.database.sqlite.SQLiteDatabase;
    import android.database.sqlite.SQLiteOpenHelper;
    import android.util.Log;
    
    import java.util.ArrayList;
    
    public class CompanyDatabaseHelper extends SQLiteOpenHelper {
        private static final String DB_NAME="company.db";
        private static final int DB_VER=1;
        private SQLiteDatabase db;
    
        public CompanyDatabaseHelper(Context context){
            super(context,DB_NAME,null,DB_VER);
            db = getReadableDatabase();
        }
        @Override
        public void onCreate(SQLiteDatabase db) {
            //建每日讯息表
            db.execSQL("CREATE TABLE NEWS(_id INTEGER PRIMARY KEY AUTOINCREMENT," +
                    "TITLE TEXT," +
                    "IMAGE_RESOURCE_ID INTEGER," +
                    "CONTENT TEXT);");
            //建立登录表
            db.execSQL("CREATE TABLE  USER( _id INTEGER PRIMARY KEY AUTOINCREMENT," +
                    "name TEXT," +
                    "password TEXT);");
            //建立管理员登录表
            db.execSQL("CREATE TABLE  GUSER( _id INTEGER PRIMARY KEY AUTOINCREMENT," +
                    "gname TEXT," +
                    "password TEXT);");
            db.execSQL("INSERT INTO guser (gname,password) VALUES('zzz','123')");
            //建立用户信息表
            db.execSQL("CREATE TABLE  YUANGONG( _id INTEGER PRIMARY KEY AUTOINCREMENT," +
                    "name TEXT," +
                    "sex TEXT,"+
                    "tel TEXT,"+
                    "position TEXT,"+
                    "TIME DATE);");
    
            //插入每日讯息
            insertNews(db,"通知1",R.drawable.news01,"aaaaaaaaaaaaaaaaaaaaaaaa");
            insertNews(db,"通知2",R.drawable.news02,"bbbbbbbbbbbbbbbbbbbbbbbbbb");
        }
        private static void insertNews(SQLiteDatabase db,String title,int resourceId,String content){
            ContentValues newsValues = new ContentValues();
            newsValues.put("TITLE",title);
            newsValues.put("IMAGE_RESOURCE_ID",resourceId);
            newsValues.put("CONTENT",content);
    
            long result = db.insert("NEWS",null,newsValues);
            //日志插入结果
            Log.d("sqlite","insert"+title+"_id"+result);
        }
    //登录表的相关操作
        public void login_add(String name,String password){
            db.execSQL("INSERT INTO user (name,password) VALUES(?,?)",new Object[]{name,password});
        }
        public void login_delete(String name,String password){
            db.execSQL("DELETE FROM user WHERE name = AND password ="+name+password);
        }
        public void login_updata(String password){
            db.execSQL("UPDATE user SET password = ?",new Object[]{password});
        }
    
        //管理员登录表的操作
        public void glogin_add(String name,String password){
            db.execSQL("INSERT INTO user (name,password) VALUES(?,?)",new Object[]{name,password});
        }
        public void glogin_delete(String name,String password){
            db.execSQL("DELETE FROM user WHERE name = AND password ="+name+password);
        }
        public void glogin_updata(String password){
            db.execSQL("UPDATE user SET password = ?",new Object[]{password});
        }
    
        public ArrayList<User> getAllData2(){
    
            ArrayList<User> list = new ArrayList<User>();
            Cursor cursor = db.query("guser",null,null,null,null,null,"gname DESC");
            while(cursor.moveToNext()){
                String gname = cursor.getString(cursor.getColumnIndex("gname"));
                String password = cursor.getString(cursor.getColumnIndex("password"));
                list.add(new User(gname,password));
            }
            cursor.close();
            return list;
        }
    
        public ArrayList<User> getAllData(){
    
            ArrayList<User> list = new ArrayList<User>();
            Cursor cursor = db.query("user",null,null,null,null,null,"name DESC");
            while(cursor.moveToNext()){
                String name = cursor.getString(cursor.getColumnIndex("name"));
                String password = cursor.getString(cursor.getColumnIndex("password"));
                list.add(new User(name,password));
            }
            cursor.close();
            return list;
        }
    
        //员工表的相关操作
        public void yuangong_add(String name,String sex,String tel,String position,String time){
            db.execSQL("INSERT INTO yuangong (name,sex,tel,position,time) VALUES(?,?,?,?,?)",new Object[]{name,sex,tel,position,time});
        }
        public void yuangong_delete(String name){
            db.execSQL("DELETE FROM yuangong WHERE name = ? ", new Object[]{name});
        }
        public void yuangong_updata(String name,String tel,String position){
    
            db.execSQL("update yuangong set tel=?,position=? where name=?", new Object[]{tel,position,name});
        }
        @Override
        public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
    
        }
    
    }
    
    
    展开全文
  • 基于安卓的企业员工管理系统 基于安卓的企业员工管理系统mysql数据库创建语句 基于安卓的企业员工管理系统oracle数据库创建语句 基于安卓的企业员工管理系统sqlserver数据库创建语句 基于安卓的企业员工管理系统...

    基于安卓的企业员工管理系统

    基于安卓的企业员工管理系统mysql数据库创建语句
    基于安卓的企业员工管理系统oracle数据库创建语句
    基于安卓的企业员工管理系统sqlserver数据库创建语句
    基于安卓的企业员工管理系统spring+springMVC+hibernate框架对象(javaBean,pojo)设计
    基于安卓的企业员工管理系统spring+springMVC+mybatis框架对象(javaBean,pojo)设计
    高质量编程视频:shangyepingtai.xin

    基于安卓的企业员工管理系统mysql数据库版本源码:

    超级管理员表创建语句如下:
    create table t_admin(
    id int primary key auto_increment comment ‘主键’,
    username varchar(100) comment ‘超级管理员账号’,
    password varchar(100) comment ‘超级管理员密码’
    ) comment ‘超级管理员’;
    insert into t_admin(username,password) values(‘admin’,‘123456’);
    SQLCopy
    部门表创建语句如下:
    create table t_bumen(
    id int primary key auto_increment comment ‘主键’,
    bumenName varchar(100) comment ‘部门名称’
    ) comment ‘部门’;
    SQLCopy
    建议表创建语句如下:
    create table t_contact(
    id int primary key auto_increment comment ‘主键’,
    customerId int comment ‘用户’,
    phone varchar(100) comment ‘联系方式’,
    content varchar(100) comment ‘内容’,
    insertDate datetime comment ‘日期’
    ) comment ‘建议’;
    SQLCopy
    客户表创建语句如下:
    create table t_customer(
    id int primary key auto_increment comment ‘主键’,
    username varchar(100) comment ‘账号’,
    password varchar(100) comment ‘密码’,
    name varchar(100) comment ‘姓名’,
    sex varchar(100) comment ‘性别’,
    address varchar(100) comment ‘地址’,
    mobile varchar(100) comment ‘手机’,
    zhiweiId int comment ‘’,
    bumenId int comment ‘’,
    bmld varchar(100) comment ‘是否部门领导’
    ) comment ‘客户’;
    SQLCopy
    公告表创建语句如下:
    create table t_gonggao(
    id int primary key auto_increment comment ‘主键’,
    title varchar(100) comment ‘标题’,
    content varchar(100) comment ‘详细内容’,
    pic varchar(100) comment ‘图片’,
    insertDate datetime comment ‘公告日期’
    ) comment ‘公告’;
    SQLCopy
    工作安排表创建语句如下:
    create table t_gzap(
    id int primary key auto_increment comment ‘主键’,
    customerId int comment ‘用户’,
    title varchar(100) comment ‘标题’,
    content varchar(100) comment ‘详细内容’,
    showDate datetime comment ‘操作日期’
    ) comment ‘工作安排’;
    SQLCopy
    奖励惩罚表创建语句如下:
    create table t_jlcf(
    id int primary key auto_increment comment ‘主键’,
    customerId int comment ‘用户’,
    title varchar(100) comment ‘说明’,
    content varchar(100) comment ‘详细内容’,
    types varchar(100) comment ‘奖励惩罚’,
    insertDate datetime comment ‘日期’
    ) comment ‘奖励惩罚’;
    SQLCopy
    信息交流表创建语句如下:
    create table t_message(
    id int primary key auto_increment comment ‘主键’,
    customerId int comment ‘用户’,
    messageContent varchar(100) comment ‘内容’,
    types int comment ‘’,
    insertDate datetime comment ‘时间’
    ) comment ‘信息交流’;
    SQLCopy
    订单表创建语句如下:
    create table t_order(
    id int primary key auto_increment comment ‘主键’,
    customerId int comment ‘用户’,
    productDetail varchar(100) comment ‘订单详细’,
    allPrice varchar(100) comment ‘订单总价格’,
    status varchar(100) comment ‘状态’,
    orderNum varchar(100) comment ‘’,
    pl varchar(100) comment ‘’,
    insertDate datetime comment ‘’
    ) comment ‘订单’;
    SQLCopy
    签到表创建语句如下:
    create table t_qiandao(
    id int primary key auto_increment comment ‘主键’,
    customerId int comment ‘用户’,
    insertDate datetime comment ‘日期’
    ) comment ‘签到’;
    SQLCopy
    请假表创建语句如下:
    create table t_qingjia(
    id int primary key auto_increment comment ‘主键’,
    customerId int comment ‘用户’,
    title varchar(100) comment ‘请假简要’,
    showDate datetime comment ‘请假日期’,
    content varchar(100) comment ‘说明’,
    status varchar(100) comment ‘状态’,
    insertDate datetime comment ‘日期’
    ) comment ‘请假’;
    SQLCopy
    事务表创建语句如下:
    create table t_sw(
    id int primary key auto_increment comment ‘主键’,
    customerId int comment ‘用户’,
    title varchar(100) comment ‘工作标题’,
    content varchar(100) comment ‘工作内容’,
    status varchar(100) comment ‘状态’,
    pj varchar(100) comment ‘评价’
    ) comment ‘事务’;
    SQLCopy
    普通员工表创建语句如下:
    create table t_user(
    id int primary key auto_increment comment ‘主键’,
    username varchar(100) comment ‘账号’,
    password varchar(100) comment ‘密码’,
    name varchar(100) comment ‘姓名’,
    gh varchar(100) comment ‘工号’,
    mobile varchar(100) comment ‘手机’
    ) comment ‘普通员工’;
    SQLCopy
    预估时间安排表创建语句如下:
    create table t_ygsj(
    id int primary key auto_increment comment ‘主键’,
    customerId int comment ‘用户’,
    title varchar(100) comment ‘安排内容’,
    showDate datetime comment ‘预估时间’,
    status varchar(100) comment ‘状态’
    ) comment ‘预估时间安排’;
    SQLCopy
    职位表创建语句如下:
    create table t_zhiwei(
    id int primary key auto_increment comment ‘主键’,
    zhiweiName varchar(100) comment ‘职位名称’
    ) comment ‘职位’;
    SQLCopy

    基于安卓的企业员工管理系统oracle数据库版本源码:

    超级管理员表创建语句如下:
    create table t_admin(
    id integer,
    username varchar(100),
    password varchar(100)
    );
    insert into t_admin(id,username,password) values(1,‘admin’,‘123456’);
    –超级管理员字段加注释
    comment on column t_admin.id is ‘主键’;
    comment on column t_admin.username is ‘超级管理员账号’;
    comment on column t_admin.password is ‘超级管理员密码’;
    –超级管理员表加注释
    comment on table t_admin is ‘超级管理员’;
    SQLCopy
    部门表创建语句如下:
    create table t_bumen(
    id integer,
    bumenName varchar(100)
    );
    –部门字段加注释
    comment on column t_bumen.id is ‘主键’;
    comment on column t_bumen.bumenName is ‘部门名称’;
    –部门表加注释
    comment on table t_bumen is ‘部门’;
    SQLCopy
    建议表创建语句如下:
    create table t_contact(
    id integer,
    customerId int,
    phone varchar(100),
    content varchar(100),
    insertDate datetime
    );
    –建议字段加注释
    comment on column t_contact.id is ‘主键’;
    comment on column t_contact.customerId is ‘用户’;
    comment on column t_contact.phone is ‘联系方式’;
    comment on column t_contact.content is ‘内容’;
    comment on column t_contact.insertDate is ‘日期’;
    –建议表加注释
    comment on table t_contact is ‘建议’;
    SQLCopy
    客户表创建语句如下:
    create table t_customer(
    id integer,
    username varchar(100),
    password varchar(100),
    name varchar(100),
    sex varchar(100),
    address varchar(100),
    mobile varchar(100),
    zhiweiId int,
    bumenId int,
    bmld varchar(100)
    );
    –客户字段加注释
    comment on column t_customer.id is ‘主键’;
    comment on column t_customer.username is ‘账号’;
    comment on column t_customer.password is ‘密码’;
    comment on column t_customer.name is ‘姓名’;
    comment on column t_customer.sex is ‘性别’;
    comment on column t_customer.address is ‘地址’;
    comment on column t_customer.mobile is ‘手机’;
    comment on column t_customer.zhiweiId is ‘’;
    comment on column t_customer.bumenId is ‘’;
    comment on column t_customer.bmld is ‘是否部门领导’;
    –客户表加注释
    comment on table t_customer is ‘客户’;
    SQLCopy
    公告表创建语句如下:
    create table t_gonggao(
    id integer,
    title varchar(100),
    content varchar(100),
    pic varchar(100),
    insertDate datetime
    );
    –公告字段加注释
    comment on column t_gonggao.id is ‘主键’;
    comment on column t_gonggao.title is ‘标题’;
    comment on column t_gonggao.content is ‘详细内容’;
    comment on column t_gonggao.pic is ‘图片’;
    comment on column t_gonggao.insertDate is ‘公告日期’;
    –公告表加注释
    comment on table t_gonggao is ‘公告’;
    SQLCopy
    工作安排表创建语句如下:
    create table t_gzap(
    id integer,
    customerId int,
    title varchar(100),
    content varchar(100),
    showDate datetime
    );
    –工作安排字段加注释
    comment on column t_gzap.id is ‘主键’;
    comment on column t_gzap.customerId is ‘用户’;
    comment on column t_gzap.title is ‘标题’;
    comment on column t_gzap.content is ‘详细内容’;
    comment on column t_gzap.showDate is ‘操作日期’;
    –工作安排表加注释
    comment on table t_gzap is ‘工作安排’;
    SQLCopy
    奖励惩罚表创建语句如下:
    create table t_jlcf(
    id integer,
    customerId int,
    title varchar(100),
    content varchar(100),
    types varchar(100),
    insertDate datetime
    );
    –奖励惩罚字段加注释
    comment on column t_jlcf.id is ‘主键’;
    comment on column t_jlcf.customerId is ‘用户’;
    comment on column t_jlcf.title is ‘说明’;
    comment on column t_jlcf.content is ‘详细内容’;
    comment on column t_jlcf.types is ‘奖励惩罚’;
    comment on column t_jlcf.insertDate is ‘日期’;
    –奖励惩罚表加注释
    comment on table t_jlcf is ‘奖励惩罚’;
    SQLCopy
    信息交流表创建语句如下:
    create table t_message(
    id integer,
    customerId int,
    messageContent varchar(100),
    types int,
    insertDate datetime
    );
    –信息交流字段加注释
    comment on column t_message.id is ‘主键’;
    comment on column t_message.customerId is ‘用户’;
    comment on column t_message.messageContent is ‘内容’;
    comment on column t_message.types is ‘’;
    comment on column t_message.insertDate is ‘时间’;
    –信息交流表加注释
    comment on table t_message is ‘信息交流’;
    SQLCopy
    订单表创建语句如下:
    create table t_order(
    id integer,
    customerId int,
    productDetail varchar(100),
    allPrice varchar(100),
    status varchar(100),
    orderNum varchar(100),
    pl varchar(100),
    insertDate datetime
    );
    –订单字段加注释
    comment on column t_order.id is ‘主键’;
    comment on column t_order.customerId is ‘用户’;
    comment on column t_order.productDetail is ‘订单详细’;
    comment on column t_order.allPrice is ‘订单总价格’;
    comment on column t_order.status is ‘状态’;
    comment on column t_order.orderNum is ‘’;
    comment on column t_order.pl is ‘’;
    comment on column t_order.insertDate is ‘’;
    –订单表加注释
    comment on table t_order is ‘订单’;
    SQLCopy
    签到表创建语句如下:
    create table t_qiandao(
    id integer,
    customerId int,
    insertDate datetime
    );
    –签到字段加注释
    comment on column t_qiandao.id is ‘主键’;
    comment on column t_qiandao.customerId is ‘用户’;
    comment on column t_qiandao.insertDate is ‘日期’;
    –签到表加注释
    comment on table t_qiandao is ‘签到’;
    SQLCopy
    请假表创建语句如下:
    create table t_qingjia(
    id integer,
    customerId int,
    title varchar(100),
    showDate datetime,
    content varchar(100),
    status varchar(100),
    insertDate datetime
    );
    –请假字段加注释
    comment on column t_qingjia.id is ‘主键’;
    comment on column t_qingjia.customerId is ‘用户’;
    comment on column t_qingjia.title is ‘请假简要’;
    comment on column t_qingjia.showDate is ‘请假日期’;
    comment on column t_qingjia.content is ‘说明’;
    comment on column t_qingjia.status is ‘状态’;
    comment on column t_qingjia.insertDate is ‘日期’;
    –请假表加注释
    comment on table t_qingjia is ‘请假’;
    SQLCopy
    事务表创建语句如下:
    create table t_sw(
    id integer,
    customerId int,
    title varchar(100),
    content varchar(100),
    status varchar(100),
    pj varchar(100)
    );
    –事务字段加注释
    comment on column t_sw.id is ‘主键’;
    comment on column t_sw.customerId is ‘用户’;
    comment on column t_sw.title is ‘工作标题’;
    comment on column t_sw.content is ‘工作内容’;
    comment on column t_sw.status is ‘状态’;
    comment on column t_sw.pj is ‘评价’;
    –事务表加注释
    comment on table t_sw is ‘事务’;
    SQLCopy
    普通员工表创建语句如下:
    create table t_user(
    id integer,
    username varchar(100),
    password varchar(100),
    name varchar(100),
    gh varchar(100),
    mobile varchar(100)
    );
    –普通员工字段加注释
    comment on column t_user.id is ‘主键’;
    comment on column t_user.username is ‘账号’;
    comment on column t_user.password is ‘密码’;
    comment on column t_user.name is ‘姓名’;
    comment on column t_user.gh is ‘工号’;
    comment on column t_user.mobile is ‘手机’;
    –普通员工表加注释
    comment on table t_user is ‘普通员工’;
    SQLCopy
    预估时间安排表创建语句如下:
    create table t_ygsj(
    id integer,
    customerId int,
    title varchar(100),
    showDate datetime,
    status varchar(100)
    );
    –预估时间安排字段加注释
    comment on column t_ygsj.id is ‘主键’;
    comment on column t_ygsj.customerId is ‘用户’;
    comment on column t_ygsj.title is ‘安排内容’;
    comment on column t_ygsj.showDate is ‘预估时间’;
    comment on column t_ygsj.status is ‘状态’;
    –预估时间安排表加注释
    comment on table t_ygsj is ‘预估时间安排’;
    SQLCopy
    职位表创建语句如下:
    create table t_zhiwei(
    id integer,
    zhiweiName varchar(100)
    );
    –职位字段加注释
    comment on column t_zhiwei.id is ‘主键’;
    comment on column t_zhiwei.zhiweiName is ‘职位名称’;
    –职位表加注释
    comment on table t_zhiwei is ‘职位’;
    SQLCopy
    oracle特有,对应序列如下:
    create sequence s_t_bumen;
    create sequence s_t_contact;
    create sequence s_t_customer;
    create sequence s_t_gonggao;
    create sequence s_t_gzap;
    create sequence s_t_jlcf;
    create sequence s_t_message;
    create sequence s_t_order;
    create sequence s_t_qiandao;
    create sequence s_t_qingjia;
    create sequence s_t_sw;
    create sequence s_t_user;
    create sequence s_t_ygsj;
    create sequence s_t_zhiwei;
    SQLCopy

    基于安卓的企业员工管理系统sqlserver数据库版本源码:

    超级管理员表创建语句如下:
    –超级管理员
    create table t_admin(
    id int identity(1,1) primary key not null,–主键
    username varchar(100),–超级管理员账号
    password varchar(100)–超级管理员密码
    );
    insert into t_admin(username,password) values(‘admin’,‘123456’);
    SQLCopy
    部门表创建语句如下:
    –部门表注释
    create table t_bumen(
    id int identity(1,1) primary key not null,–主键
    bumenName varchar(100)–部门名称
    );
    SQLCopy
    建议表创建语句如下:
    –建议表注释
    create table t_contact(
    id int identity(1,1) primary key not null,–主键
    customerId int,–用户
    phone varchar(100),–联系方式
    content varchar(100),–内容
    insertDate datetime–日期
    );
    SQLCopy
    客户表创建语句如下:
    –客户表注释
    create table t_customer(
    id int identity(1,1) primary key not null,–主键
    username varchar(100),–账号
    password varchar(100),–密码
    name varchar(100),–姓名
    sex varchar(100),–性别
    address varchar(100),–地址
    mobile varchar(100),–手机
    zhiweiId int,–
    bumenId int,–
    bmld varchar(100)–是否部门领导
    );
    SQLCopy
    公告表创建语句如下:
    –公告表注释
    create table t_gonggao(
    id int identity(1,1) primary key not null,–主键
    title varchar(100),–标题
    content varchar(100),–详细内容
    pic varchar(100),–图片
    insertDate datetime–公告日期
    );
    SQLCopy
    工作安排表创建语句如下:
    –工作安排表注释
    create table t_gzap(
    id int identity(1,1) primary key not null,–主键
    customerId int,–用户
    title varchar(100),–标题
    content varchar(100),–详细内容
    showDate datetime–操作日期
    );
    SQLCopy
    奖励惩罚表创建语句如下:
    –奖励惩罚表注释
    create table t_jlcf(
    id int identity(1,1) primary key not null,–主键
    customerId int,–用户
    title varchar(100),–说明
    content varchar(100),–详细内容
    types varchar(100),–奖励惩罚
    insertDate datetime–日期
    );
    SQLCopy
    信息交流表创建语句如下:
    –信息交流表注释
    create table t_message(
    id int identity(1,1) primary key not null,–主键
    customerId int,–用户
    messageContent varchar(100),–内容
    types int,–
    insertDate datetime–时间
    );
    SQLCopy
    订单表创建语句如下:
    –订单表注释
    create table t_order(
    id int identity(1,1) primary key not null,–主键
    customerId int,–用户
    productDetail varchar(100),–订单详细
    allPrice varchar(100),–订单总价格
    status varchar(100),–状态
    orderNum varchar(100),–
    pl varchar(100),–
    insertDate datetime–
    );
    SQLCopy
    签到表创建语句如下:
    –签到表注释
    create table t_qiandao(
    id int identity(1,1) primary key not null,–主键
    customerId int,–用户
    insertDate datetime–日期
    );
    SQLCopy
    请假表创建语句如下:
    –请假表注释
    create table t_qingjia(
    id int identity(1,1) primary key not null,–主键
    customerId int,–用户
    title varchar(100),–请假简要
    showDate datetime,–请假日期
    content varchar(100),–说明
    status varchar(100),–状态
    insertDate datetime–日期
    );
    SQLCopy
    事务表创建语句如下:
    –事务表注释
    create table t_sw(
    id int identity(1,1) primary key not null,–主键
    customerId int,–用户
    title varchar(100),–工作标题
    content varchar(100),–工作内容
    status varchar(100),–状态
    pj varchar(100)–评价
    );
    SQLCopy
    普通员工表创建语句如下:
    –普通员工表注释
    create table t_user(
    id int identity(1,1) primary key not null,–主键
    username varchar(100),–账号
    password varchar(100),–密码
    name varchar(100),–姓名
    gh varchar(100),–工号
    mobile varchar(100)–手机
    );
    SQLCopy
    预估时间安排表创建语句如下:
    –预估时间安排表注释
    create table t_ygsj(
    id int identity(1,1) primary key not null,–主键
    customerId int,–用户
    title varchar(100),–安排内容
    showDate datetime,–预估时间
    status varchar(100)–状态
    );
    SQLCopy
    职位表创建语句如下:
    –职位表注释
    create table t_zhiwei(
    id int identity(1,1) primary key not null,–主键
    zhiweiName varchar(100)–职位名称
    );
    SQLCopy

    基于安卓的企业员工管理系统spring+springMVC+hibernate框架对象(javaBean,pojo)设计:

    部门javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //部门
    @Table(name = “t_bumen”)
    public class Bumen {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //部门名称
    private String bumenName;
    public String getBumenName() {return bumenName;}
    public void setBumenName(String bumenName) {this.bumenName = bumenName;}
    }
    JavaCopy
    建议javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //建议
    @Table(name = “t_contact”)
    public class Contact {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //联系方式
    private String phone;
    //内容
    private String content;
    //日期
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getPhone() {return phone;}
    public void setPhone(String phone) {this.phone = phone;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    客户javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //客户
    @Table(name = “t_customer”)
    public class Customer {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //账号
    private String username;
    //密码
    private String password;
    //姓名
    private String name;
    //性别
    private String sex;
    //地址
    private String address;
    //手机
    private String mobile;
    //
    private Integer zhiweiId;
    //
    private Integer bumenId;
    //是否部门领导
    private String bmld;
    public String getUsername() {return username;}
    public void setUsername(String username) {this.username = username;}
    public String getPassword() {return password;}
    public void setPassword(String password) {this.password = password;}
    public String getName() {return name;}
    public void setName(String name) {this.name = name;}
    public String getSex() {return sex;}
    public void setSex(String sex) {this.sex = sex;}
    public String getAddress() {return address;}
    public void setAddress(String address) {this.address = address;}
    public String getMobile() {return mobile;}
    public void setMobile(String mobile) {this.mobile = mobile;}
    public Integer getZhiweiId() {return zhiweiId;}
    public void setZhiweiId(Integer zhiweiId) {this.zhiweiId = zhiweiId;}
    public Integer getBumenId() {return bumenId;}
    public void setBumenId(Integer bumenId) {this.bumenId = bumenId;}
    public String getBmld() {return bmld;}
    public void setBmld(String bmld) {this.bmld = bmld;}
    }
    JavaCopy
    公告javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //公告
    @Table(name = “t_gonggao”)
    public class Gonggao {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //标题
    private String title;
    //详细内容
    private String content;
    //图片
    private String pic;
    //公告日期
    private Date insertDate;
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public String getPic() {return pic;}
    public void setPic(String pic) {this.pic = pic;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    工作安排javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //工作安排
    @Table(name = “t_gzap”)
    public class Gzap {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //标题
    private String title;
    //详细内容
    private String content;
    //操作日期
    private Date showDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public Date getShowDate() {return showDate;}
    public void setShowDate(Date showDate) {this.showDate = showDate;}
    }
    JavaCopy
    奖励惩罚javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //奖励惩罚
    @Table(name = “t_jlcf”)
    public class Jlcf {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //说明
    private String title;
    //详细内容
    private String content;
    //奖励惩罚
    private String types;
    //日期
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public String getTypes() {return types;}
    public void setTypes(String types) {this.types = types;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    信息交流javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //信息交流
    @Table(name = “t_message”)
    public class Message {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //内容
    private String messageContent;
    //
    private Integer types;
    //时间
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getMessageContent() {return messageContent;}
    public void setMessageContent(String messageContent) {this.messageContent = messageContent;}
    public Integer getTypes() {return types;}
    public void setTypes(Integer types) {this.types = types;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    订单javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //订单
    @Table(name = “t_order”)
    public class Order {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //订单详细
    private String productDetail;
    //订单总价格
    private String allPrice;
    //状态
    private String status;
    //
    private String orderNum;
    //
    private String pl;
    //
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getProductDetail() {return productDetail;}
    public void setProductDetail(String productDetail) {this.productDetail = productDetail;}
    public String getAllPrice() {return allPrice;}
    public void setAllPrice(String allPrice) {this.allPrice = allPrice;}
    public String getStatus() {return status;}
    public void setStatus(String status) {this.status = status;}
    public String getOrderNum() {return orderNum;}
    public void setOrderNum(String orderNum) {this.orderNum = orderNum;}
    public String getPl() {return pl;}
    public void setPl(String pl) {this.pl = pl;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    签到javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //签到
    @Table(name = “t_qiandao”)
    public class Qiandao {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //日期
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    请假javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //请假
    @Table(name = “t_qingjia”)
    public class Qingjia {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //请假简要
    private String title;
    //请假日期
    private Date showDate;
    //说明
    private String content;
    //状态
    private String status;
    //日期
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public Date getShowDate() {return showDate;}
    public void setShowDate(Date showDate) {this.showDate = showDate;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public String getStatus() {return status;}
    public void setStatus(String status) {this.status = status;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    事务javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //事务
    @Table(name = “t_sw”)
    public class Sw {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //工作标题
    private String title;
    //工作内容
    private String content;
    //状态
    private String status;
    //评价
    private String pj;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public String getStatus() {return status;}
    public void setStatus(String status) {this.status = status;}
    public String getPj() {return pj;}
    public void setPj(String pj) {this.pj = pj;}
    }
    JavaCopy
    普通员工javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //普通员工
    @Table(name = “t_user”)
    public class User {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //账号
    private String username;
    //密码
    private String password;
    //姓名
    private String name;
    //工号
    private String gh;
    //手机
    private String mobile;
    public String getUsername() {return username;}
    public void setUsername(String username) {this.username = username;}
    public String getPassword() {return password;}
    public void setPassword(String password) {this.password = password;}
    public String getName() {return name;}
    public void setName(String name) {this.name = name;}
    public String getGh() {return gh;}
    public void setGh(String gh) {this.gh = gh;}
    public String getMobile() {return mobile;}
    public void setMobile(String mobile) {this.mobile = mobile;}
    }
    JavaCopy
    预估时间安排javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //预估时间安排
    @Table(name = “t_ygsj”)
    public class Ygsj {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //安排内容
    private String title;
    //预估时间
    private Date showDate;
    //状态
    private String status;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public Date getShowDate() {return showDate;}
    public void setShowDate(Date showDate) {this.showDate = showDate;}
    public String getStatus() {return status;}
    public void setStatus(String status) {this.status = status;}
    }
    JavaCopy
    职位javaBean创建语句如下:
    package project.model;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import java.util.Date;
    @Entity

    //职位
    @Table(name = “t_zhiwei”)
    public class Zhiwei {
    //主键
    @Id
    @Column(name = “id”)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //职位名称
    private String zhiweiName;
    public String getZhiweiName() {return zhiweiName;}
    public void setZhiweiName(String zhiweiName) {this.zhiweiName = zhiweiName;}
    }
    JavaCopy

    基于安卓的企业员工管理系统spring+springMVC+mybatis框架对象(javaBean,pojo)设计:

    部门javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //部门
    public class Bumen extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //部门名称
    private String bumenName;
    public String getBumenName() {return bumenName;}
    public void setBumenName(String bumenName) {this.bumenName = bumenName;}
    }
    JavaCopy
    建议javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //建议
    public class Contact extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //联系方式
    private String phone;
    //内容
    private String content;
    //日期
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getPhone() {return phone;}
    public void setPhone(String phone) {this.phone = phone;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    客户javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //客户
    public class Customer extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //账号
    private String username;
    //密码
    private String password;
    //姓名
    private String name;
    //性别
    private String sex;
    //地址
    private String address;
    //手机
    private String mobile;
    //
    private Integer zhiweiId;
    //
    private Integer bumenId;
    //是否部门领导
    private String bmld;
    public String getUsername() {return username;}
    public void setUsername(String username) {this.username = username;}
    public String getPassword() {return password;}
    public void setPassword(String password) {this.password = password;}
    public String getName() {return name;}
    public void setName(String name) {this.name = name;}
    public String getSex() {return sex;}
    public void setSex(String sex) {this.sex = sex;}
    public String getAddress() {return address;}
    public void setAddress(String address) {this.address = address;}
    public String getMobile() {return mobile;}
    public void setMobile(String mobile) {this.mobile = mobile;}
    public Integer getZhiweiId() {return zhiweiId;}
    public void setZhiweiId(Integer zhiweiId) {this.zhiweiId = zhiweiId;}
    public Integer getBumenId() {return bumenId;}
    public void setBumenId(Integer bumenId) {this.bumenId = bumenId;}
    public String getBmld() {return bmld;}
    public void setBmld(String bmld) {this.bmld = bmld;}
    }
    JavaCopy
    公告javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //公告
    public class Gonggao extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //标题
    private String title;
    //详细内容
    private String content;
    //图片
    private String pic;
    //公告日期
    private Date insertDate;
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public String getPic() {return pic;}
    public void setPic(String pic) {this.pic = pic;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    工作安排javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //工作安排
    public class Gzap extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //标题
    private String title;
    //详细内容
    private String content;
    //操作日期
    private Date showDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public Date getShowDate() {return showDate;}
    public void setShowDate(Date showDate) {this.showDate = showDate;}
    }
    JavaCopy
    奖励惩罚javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //奖励惩罚
    public class Jlcf extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //说明
    private String title;
    //详细内容
    private String content;
    //奖励惩罚
    private String types;
    //日期
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public String getTypes() {return types;}
    public void setTypes(String types) {this.types = types;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    信息交流javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //信息交流
    public class Message extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //内容
    private String messageContent;
    //
    private Integer types;
    //时间
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getMessageContent() {return messageContent;}
    public void setMessageContent(String messageContent) {this.messageContent = messageContent;}
    public Integer getTypes() {return types;}
    public void setTypes(Integer types) {this.types = types;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    订单javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //订单
    public class Order extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //订单详细
    private String productDetail;
    //订单总价格
    private String allPrice;
    //状态
    private String status;
    //
    private String orderNum;
    //
    private String pl;
    //
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getProductDetail() {return productDetail;}
    public void setProductDetail(String productDetail) {this.productDetail = productDetail;}
    public String getAllPrice() {return allPrice;}
    public void setAllPrice(String allPrice) {this.allPrice = allPrice;}
    public String getStatus() {return status;}
    public void setStatus(String status) {this.status = status;}
    public String getOrderNum() {return orderNum;}
    public void setOrderNum(String orderNum) {this.orderNum = orderNum;}
    public String getPl() {return pl;}
    public void setPl(String pl) {this.pl = pl;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    签到javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //签到
    public class Qiandao extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //日期
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    请假javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //请假
    public class Qingjia extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //请假简要
    private String title;
    //请假日期
    private Date showDate;
    //说明
    private String content;
    //状态
    private String status;
    //日期
    private Date insertDate;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public Date getShowDate() {return showDate;}
    public void setShowDate(Date showDate) {this.showDate = showDate;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public String getStatus() {return status;}
    public void setStatus(String status) {this.status = status;}
    public Date getInsertDate() {return insertDate;}
    public void setInsertDate(Date insertDate) {this.insertDate = insertDate;}
    }
    JavaCopy
    事务javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //事务
    public class Sw extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //工作标题
    private String title;
    //工作内容
    private String content;
    //状态
    private String status;
    //评价
    private String pj;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public String getContent() {return content;}
    public void setContent(String content) {this.content = content;}
    public String getStatus() {return status;}
    public void setStatus(String status) {this.status = status;}
    public String getPj() {return pj;}
    public void setPj(String pj) {this.pj = pj;}
    }
    JavaCopy
    普通员工javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //普通员工
    public class User extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //账号
    private String username;
    //密码
    private String password;
    //姓名
    private String name;
    //工号
    private String gh;
    //手机
    private String mobile;
    public String getUsername() {return username;}
    public void setUsername(String username) {this.username = username;}
    public String getPassword() {return password;}
    public void setPassword(String password) {this.password = password;}
    public String getName() {return name;}
    public void setName(String name) {this.name = name;}
    public String getGh() {return gh;}
    public void setGh(String gh) {this.gh = gh;}
    public String getMobile() {return mobile;}
    public void setMobile(String mobile) {this.mobile = mobile;}
    }
    JavaCopy
    预估时间安排javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //预估时间安排
    public class Ygsj extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //用户
    private Integer customerId;
    //安排内容
    private String title;
    //预估时间
    private Date showDate;
    //状态
    private String status;
    public Integer getCustomerId() {return customerId;}
    public void setCustomerId(Integer customerId) {this.customerId = customerId;}
    public String getTitle() {return title;}
    public void setTitle(String title) {this.title = title;}
    public Date getShowDate() {return showDate;}
    public void setShowDate(Date showDate) {this.showDate = showDate;}
    public String getStatus() {return status;}
    public void setStatus(String status) {this.status = status;}
    }
    JavaCopy
    职位javaBean创建语句如下:
    package project.model;
    import org.springframework.format.annotation.DateTimeFormat;
    import java.util.Date;

    //职位
    public class Zhiwei extends BaseBean{
    //主键
    private Integer id;
    public Integer getId() {return id;}
    public void setId(Integer id) {this.id = id;}
    //职位名称
    private String zhiweiName;
    public String getZhiweiName() {return zhiweiName;}
    public void setZhiweiName(String zhiweiName) {this.zhiweiName = zhiweiName;}
    }
    JavaCopy

    展开全文
  • 现在的客户端不仅仅是浏览器,有可能是安卓或者苹果,当客户端向服务器发送请求的时候,服务器处理完请求,要将页面的数据交给客户端,如果客户端是安卓或者苹果的话,那样解析服务器传来的数据可能就比较麻烦。...

    返回JSON数据

    当客户端向服务器发送请求的时候,服务器处理完请求,要将页面的数据交给客户端时,如果客户端是安卓或者苹果的话,那样解析服务器传来的数据可能就比较麻烦。所以这里采用一个较为常用的解决方案,那就是让服务器将有效的数据以JSON的形式返回给客户端,这样就可以实现客户端的无关性。

    执行流程

    1. 登录成功之后,直接进入list界面,在list页面直接发送ajax请求,进行员工分页数据的查询
    2. 服务器将查出的数据,以json字符串的形式返回给浏览器
    3. 浏览器收到json字符串之后,可以使用js对json进行解析,使用js通过dom增删改改变页面。

    web目录

    在这里插入图片描述

    前端

    list.js

    var totalRecord;
    var httpPath;
    var pageNum;
    
    $(function () {
        //页面加载完成之后,直接发送ajax请求,要到分页数据
        httpPath = $("contextPathData").attr("contextPathValue");
    
        to_page(1);
    
    })
    
    //跳转页面
    function to_page(pn) {
        $.ajax({
            url: httpPath + "/emps",
            data: "pn=" + pn,
            type: "GET",
            success: function (result) {
                //console.log(result)
                build_emps_table(result);
                build_page_info(result);
                build_page_nav(result);
                $("#check_all").prop("checked", false)
                $(".check_item").prop("checked", false);
            }
        });
    }
    
    /**
     * 解析并显示员工数据
     * @param result
     */
    function build_emps_table(result) {
        //清空table
        $("#emps_table tbody").empty();
    
        var emps = result.ext.pageInfo.list;
        $.each(emps, function (index, item) {
            var empIdTd = $("<td></td>").append(item.empId);
            var empNameTd = $("<td></td>").append(item.empName);
            var genderTd = $("<td></td>").append(item.gender == "M" ? "男" : "女");
            var emailTd = $("<td></td>").append(item.email);
            var deptNameTd = $("<td></td>").append(item.department.deptName);
    
            var editBtn = $("<button></button>").addClass("btn btn-primary btn-sm edit_btn")
                .append($("<span></span>").addClass("glyphicon glyphicon-pencil").attr("aria-hidden", true))
                .append("&nbsp;编辑");
    
            //为编辑按钮添加一个自定义属性,表示当前的员工id
            editBtn.attr("edit-id", item.empId);
    
    
            var deleteBtn = $("<button></button>").addClass("btn btn-danger btn-sm delete_btn")
                .append($("<span></span>").addClass("glyphicon glyphicon-trash").attr("aria-hidden", true))
                .append("&nbsp;删除");
    
            //为删除按钮添加一个自定义属性,表示当前的员工id
            deleteBtn.attr("delete-id", item.empId);
    
            var btnTd = $("<td></td>").append(editBtn).append("&nbsp;").append(deleteBtn);
            //append方法执行完成以后还是返回原来的元素
            $("<tr></tr>").append(empIdTd).append(empNameTd).append(genderTd)
                .append(emailTd).append(deptNameTd).append(btnTd).appendTo("#emps_table tbody");
        })
    }
    
    /**
     * 解析并显示分页信息
     * @param result
     */
    function build_page_info(result) {
        $("#page_info_area").empty();
        $("#page_info_area").append(" 当前为第" + result.ext.pageInfo.pageNum + "页," +
            "共" + result.ext.pageInfo.pages + "页,共" + result.ext.pageInfo.total + "条记录")
        totalRecord = result.ext.pageInfo.total;
        pageNum = result.ext.pageInfo.pageNum;
    }
    
    /**
     * 解析并显示分页条
     * @param result
     */
    function build_page_nav(result) {
        $("#page_nav_area").empty();
    
        var ul = $("<ul></ul>").addClass("pagination");
    
        //如果有前一页
        if (result.ext.pageInfo.hasPreviousPage) {
            //添加首页和前一页的提示
            var firstPageLi = $("<li></li>").append($("<a></a>").append("首页").attr("href", "#"));
            var prePageLi = $("<li></li>").append($("<a></a>").append("&laquo;").attr("href", "#"));
            ul.append(firstPageLi).append(prePageLi);
    
            firstPageLi.click(function () {
                to_page(1);
            })
            prePageLi.click(function () {
                to_page(result.ext.pageInfo.pageNum - 1);
            })
        }
    
        //如果有下一页
        if (result.ext.pageInfo.hasNextPage) {
            var nextPageLi = $("<li></li>").append($("<a></a>").append("&raquo;").attr("href", "#"));
            var lastPageLi = $("<li></li>").append($("<a></a>").append("末页").attr("href", "#"));
            //添加首页和前一页的提示
            ul.append(nextPageLi).append(lastPageLi);
    
            nextPageLi.click(function () {
                to_page(result.ext.pageInfo.pageNum + 1);
            })
    
            lastPageLi.click(function () {
                to_page(result.ext.pageInfo.pages);
            })
        }
    
        //遍历添加页码
        $.each(result.ext.pageInfo.navigatepageNums, function (index, item) {
            var numLi = $("<li></li>").append($("<a></a>").append(item).attr("href", "#"));
            //设置当前页码的选中状态
            if (result.ext.pageInfo.pageNum == item) {
                numLi.addClass("active");
            }
    
            numLi.click(function () {
                to_page(item);
            })
    
            ul.append(numLi);
        })
    
        ul.append(nextPageLi).append(lastPageLi);
    
        var navEle = $("<nav></nav>").append(ul);
        navEle.appendTo("#page_nav_area")
    }
    

    list.jsp

    重写list.jsp

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%--
      Created by IntelliJ IDEA.
      User: New
      Date: 2020/6/1
      Time: 23:41
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>员工展示</title>
        <%@include file="common/head.jsp" %>
        <script type="text/javascript" src="${HTTP_PATH}/static/script/list.js"></script>
    </head>
    
    <contextPathData contextPathValue="${HTTP_PATH}"></contextPathData>
    
    <body>
    <div class="container">
    
        <%--清除浮动--%>
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div class="page-header">
                    <h1>员工列表</h1>
                </div>
            </div>
    
            <div class="row">
                <div class="col-md-4 column">
                    <form action="" method="" class="form-inline">
                        <input type="text" placeholder="请输入要查询的员工名称" class="form-control" name="empName">
                        <button class="btn btn-primary">
                            <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                            查询
                        </button>
                    </form>
                </div>
    
    
                <div class="col-md-4 column">
                </div>
    
                <div class="col-md-4 column" align="right">
                    <button class="btn btn-primary" id="emp_add_modal_btn">
                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                        新增
                    </button>
                    <button class="btn btn-danger" id="emp_delete_all_btn">
                        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                        删除
                    </button>
                </div>
            </div>
    
        </div>
    
        <div class="row">
            <div class="col-md-12">
                <table class="table table-striped" id="emps_table">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>员工名称</th>
                        <th>性别</th>
                        <th>邮箱</th>
                        <th>部门</th>
                        <th>操作</th>
                    </tr>
                    </thead>
    
                    <tbody>
                    <tr>
    
                    </tr>
    
                    </tbody>
                </table>
            </div>
        </div>
    
        <%--显示分页信息--%>
        <div class="row">
            <%--显示文字信息--%>
            <div class="col-md-6" id="page_info_area">
            </div>
    
            <%--分页条信息--%>
            <div class="col-md-6" id="page_nav_area">
    
            </div>
        </div>
    </div>
    </body>
    </html>
    
    

    后端

    pom.xml

    		<!--jackson插件返回json字符串的支持-->
    		<dependency>
    			<groupId>com.fasterxml.jackson.core</groupId>
    			<artifactId>jackson-databind</artifactId>
    			<version>2.9.8</version>
    		</dependency>
    

    Msg.java

    统一处理返回的信息以及数据

    package com.indi.pojo;
    
    /**
     * 通用返回信息的类
     */
    @Getter
    @Setter
    public class Msg {
        //状态码 100-成功 200-失败
        private int code;
        //提示信息
        private String msg;
        //用户要返回给浏览器的数据
        private Map<String,Object> ext = new HashMap<String, Object>();
    
        public static Msg success(){
            Msg result = new Msg();
            result.setCode(100);
            result.setMsg("处理成功!");
            return result;
        }
    
        public static Msg fail(){
            Msg result = new Msg();
            result.setCode(200);
            result.setMsg("处理失败!");
            return result;
        }
    
        public Msg add(String key, Object value){
            this.getExt().put(key,value);
            return this;
        }
    }
    
    

    UserController.java

    直接返回到list界面,由list界面发送数据请求

    package com.indi.controller;
    
    @Controller
    public class UserController {
        @RequestMapping("/goLogin")
        public String goLogin(HttpSession session, String username, String password, Model model) {
            User user = userService.getUserByUsernameAndPassword(username, password);
            if (user == null) {
                model.addAttribute("msg","用户名或密码错误");
                return "login";
            } else {
                session.setAttribute("user", user);
                return "list";
            }
        }
    }
    

    EmployeeController.java

    package com.indi.controller;
    
    @Controller
    public class EmployeeController {
    	//这里将以前的方法废弃
    
        /**
         * 使用ResponseBody需要导入jackson的jar包
         * 使用ResponseBody自动将对象转为JSON字符串,以实现多种客户端的通用
         *
         * @param pn
         * @return
         */
        @RequestMapping("/emps")
        @ResponseBody
        public Msg getEmpsWithJson(@RequestParam(value = "pn", defaultValue = "1") Integer pn) {
            //调用分页插件的分页方法,传入页码,以及每页显示的条数
            PageHelper.startPage(pn, 5);
            List<Employee> emps = employeeService.getAll();
            PageInfo page = new PageInfo(emps, 5);
            return Msg.success().add("pageInfo", page);
        }
    }
    

    员工新增

    前端

    list.jsp

    <body>
    	<!-- 员工添加的模态框 -->
    	<div class="modal fade" id="empAddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    	    <div class="modal-dialog" role="document">
    	        <div class="modal-content">
    	            <div class="modal-header">
    	                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
    	                </button>
    	                <h4 class="modal-title" id="myModalLabel">员工添加</h4>
    	            </div>
    	            <div class="modal-body">
    	                <form class="form-horizontal">
    	                    <div class="form-group">
    	                        <label for="empName_add_input" class="col-sm-2 control-label">用户名</label>
    	                        <div class="col-sm-10">
    	                            <input type="text" name="empName" class="form-control" id="empName_add_input"
    	                                   placeholder="用户名">
    	                            <span class="help-block"></span>
    	                        </div>
    	                    </div>
    	                    <div class="form-group">
    	                        <label for="email_add_input" class="col-sm-2 control-label">邮箱</label>
    	                        <div class="col-sm-10">
    	                            <input type="email" name="email" class="form-control" id="email_add_input"
    	                                   placeholder="email@qq.com">
    	                            <span class="help-block"></span>
    	                        </div>
    	                    </div>
    	                    <div class="form-group">
    	                        <label for="email_add_input" class="col-sm-2 control-label">性别</label>
    	                        <div class="col-sm-10">
    	                            <label class="radio-inline">
    	                                <input type="radio" name="gender" id="gender1_add_input" value="M" checked="checked"></label>
    	                            <label class="radio-inline">
    	                                <input type="radio" name="gender" id="gender2_add_input" value="F"></label>
    	                        </div>
    	                    </div>
    	
    	                    <div class="form-group">
    	                        <label for="email_add_input" class="col-sm-2 control-label">部门</label>
    	                        <div class="col-sm-4">
    	                            <select class="form-control" name="dId" id="dept_add_select"></select>
    	                        </div>
    	                    </div>
    	                </form>
    	            </div>
    	            <div class="modal-footer">
    	                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
    	                <button type="button" class="btn btn-primary" id="emp_save_btn">保存</button>
    	            </div>
    	        </div>
    	    </div>
    	</div>
    	
    	<!--...之前的代码...-->
    </body>
    

    list.js

    在原来基础上添加新的代码

    $(function () {
    
    	//之前的代码
    	
        //点击新增按钮的事件
        $("#emp_add_modal_btn").click(function () {
            getDepts("#empAddModal select");
    
            reset_form("#empAddModal form");
    
            //显示模态框
            $("#empAddModal").modal({
                backdrop: "static"
            });
        })
    
    	//模态框保存按钮
        $("#emp_save_btn").click(function () {
            //1、校验用户名
            var empName = $("#empName_add_input");
            var regName = /^[a-zA-Z0-9_-]{6,16}|(^[\u2E80-\u9FFF]{2,5})$/;
    
            if (!regName.test(empName.val())) {
                //alert("用户名可以是2-5位中文,或者6-13位英文和数字的组合");
                show_validata_msg(empName, "error", "用户名必须是2-5位中文,或者6-13位英文和数字的组合");
                return false;
            } else {
                show_validata_msg(empName, "success", "用户名可用");
            }
    
            //2、校验邮箱
            var email = $("#email_add_input");
    
            var regEmail = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/;
    
            if (!regEmail.test(email.val())) {
                show_validata_msg(email, "error", "邮箱格式不正确");
                return false;
            } else {
                //3、请求保存数据
                $.ajax({
                    url: httpPath + "/emp",
                    type: "POST",
                    data: $("#empAddModal form").serialize(),
                    success: function (result) {
                        //alert(result.msg);
                        if (result.code == 100) {
                            //成功
                            //1、关闭模态框
                            $("#empAddModal").modal('hide');
                            //2、发送ajax请求,来到最后一页,显示刚才保存的数据
                            to_page(totalRecord + 1);
                        } else {
                            // console.log(result);
                            if (undefined != result.ext.errorMap.email) {
                                show_validata_msg(email, "error", result.ext.errorMap.email);
                            } else {
                                show_validata_msg(email, "success", "邮箱可用");
                            }
    
                            if (undefined != result.ext.errorMap.empName) {
                                show_validata_msg(empName, "error", result.ext.errorMap.empName);
                            } else {
                                show_validata_msg(empName, "success", "用户名可用");
                            }
                        }
    
                    }
                })
            }
        })
    
        //新增模态框的用户名校验
        $("#empName_add_input").blur(function () {
            setTimeout(function () {
                var empName = $("#empName_add_input");
                var regName = /^[a-zA-Z0-9_-]{6,16}|(^[\u2E80-\u9FFF]{2,5})$/
                if (!regName.test(empName.val())) {
                    show_validata_msg(empName, "error", "用户名必须是2-5位中文,或者6-13位英文和数字的组合");
                } else {
                    show_validata_msg(empName, "success", "用户名可用");
                }
            },300);
        })
    
        //邮箱校验
        $("#email_add_input").blur(function () {
            setTimeout(function () {
                var email = $("#email_add_input");
    
                var regEmail = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/;
                if (!regEmail.test(email.val())) {
                    //alert("邮箱格式不正确")
                    show_validata_msg(email, "error", "邮箱格式不正确");
                } else {
                    $.ajax({
                        url: httpPath + "/checkEmail",
                        data: "email=" + email.val(),
                        type: "POST",
                        success: function (result) {
                            if (result.code == 100) {
                                show_validata_msg(email, "success", "邮箱可用");
                            } else {
                                show_validata_msg(email, "error", result.ext.va_msg);
                            }
                        }
                    })
                }
            },300)
        })
    })
    
    //之前的代码
    
    /**
     * 查出所有部门信息系并显示在下拉列表中
     */
    function getDepts(ele) {
        $(ele).empty();
        $.ajax({
            url: httpPath + "/depts",
            type: "GET",
            success: function (result) {
                // console.log(result);
                $.each(result.ext.depts, function () {
                    var optionEle = $("<option></option>").append(this.deptName).attr("value", this.deptId);
                    optionEle.appendTo(ele);
                })
            }
        })
    }
    
    //设置输入框的校验提示
    function show_validata_msg(ele, status, msg) {
        ele.parent().removeClass("has-success has-error");
        ele.next("span").text("");
        if ("success" == status) {
            ele.parent().addClass("has-success");
            ele.next("span").text(msg);
        } else if ("error" == status) {
            ele.parent().addClass("has-error");
            ele.next("span").text(msg);
        }
    }
    
    /**
     * 清除模态框样式及内容
     * @param ele
     */
    function reset_form(ele) {
        $(ele)[0].reset();
        $(ele).find("*").removeClass("has-error has-success");
        $(ele).find(".help-block").text("");
    }
    

    后端

    pom.xml

    在后端添加JSR303数据校验

    		<!--JSR303数据校验支持-->
    		<dependency>
    			<groupId>org.hibernate</groupId>
    			<artifactId>hibernate-validator</artifactId>
    			<version>5.4.1.Final</version>
    		</dependency>
    

    DepartmentService.java

    package com.indi.service;
    
    @Service
    public class DepartmentService {
    
        @Autowired
        private DepartmentMapper departmentMapper;
    
        public List<Department> getDepts(){
            List<Department> departments = departmentMapper.selectByExample(null);
            return departments;
        }
    }
    
    

    DepartmentController.java

    package com.indi.controller;
    
    import java.util.List;
    
    /**
     * 处理和部门有关的请求
     */
    @Controller
    public class DepartmentController {
    
        @Autowired
        private DepartmentService departmentService;
    
        /**
         * 查询所有的部门信息
         * @return
         */
        @RequestMapping("/depts")
        @ResponseBody
        public Msg getDepts(){
            List<Department> depts = departmentService.getDepts();
            return Msg.success().add("depts",depts);
        }
    }
    

    Employee.java

    为这两个字段添加后端校验

    package com.indi.pojo;
    
    @Data
    @NoArgsConstructor
    public class Employee {
    
        @Pattern(regexp = "^[a-zA-Z0-9_-]{6,16}|(^[\\u2E80-\\u9FFF]{2,5})$",message = "用户名必须是2-5位中文,或者6-13位英文和数字的组合")
        private String empName;
    
        @Pattern(regexp = "^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$",message = "邮箱格式不正确")
        private String email;
    }
    

    EmployeeService.java

    package com.indi.service;
    
    @Service
    public class EmployeeService {
    
    	//之前的代码
    	
        public void saveEmp(Employee employee) {
            employeeMapper.insertSelective(employee);
        }
    
        /**
         * 检查邮箱是否重复
         * @param email
         * @return true代表当前email可用,false代表不可用
         */
        public boolean checkEmail(String email) {
            EmployeeExample example = new EmployeeExample();
            Criteria criteria = example.createCriteria();
            criteria.andEmailEqualTo(email);
            long count = employeeMapper.countByExample(example);
            return count == 0;
        }
    }
    
    

    EmployeeController.java

    package com.indi.controller;
    
    @Controller
    public class EmployeeController {
    	//之前的代码
    
        /**
         *  新增员工
         *
         * @return
         */
        @RequestMapping(value = "/emp", method = RequestMethod.POST)
        @ResponseBody
        public Msg saveEmp(@Valid Employee employee, BindingResult result) {
            Map<String, Object> errorMap = new HashMap<>();
    
            //校验数据格式是否正确
            if (result.hasErrors()) {
                //校验失败,应该返回失败,在模态框中显示校验失败的错误信息
                List<FieldError> errors = result.getFieldErrors();
                for (FieldError error : errors) {
                    System.out.println("错误的字段名:" + error.getField());
                    System.out.println("错误信息:" + error.getDefaultMessage());
                    errorMap.put(error.getField(), error.getDefaultMessage());
                }
                //如果错误集合中不包含邮箱,则证明邮箱格式没问题,此时需要检查邮箱是否重复,
                //否则会与数据格式都正确的提示发生冲突,导致显示异常
                if (!errors.contains("email")) {
                    //检查邮箱是否重复
                    boolean res = employeeService.checkEmail(employee.getEmail());
                    if (!res) {
                        errorMap.put("email", "该邮箱已使用");
                    }
                }
                return Msg.fail().add("errorMap", errorMap);
            } else {
                //如果数据格式都正确,则需要检查邮箱是否重复
                boolean res = employeeService.checkEmail(employee.getEmail());
                if (res) {
                    employeeService.saveEmp(employee);
                    return Msg.success();
                } else {
                    errorMap.put("email", "该邮箱已使用");
                    return Msg.fail().add("errorMap", errorMap);
                }
            }
        }
    
        /**
         * 检查邮箱是否可用
         *
         * @param email
         * @return
         */
        @RequestMapping("/checkEmail")
        @ResponseBody
        public Msg checkEmail(@RequestParam("email") String email) {
            //先判断邮箱是否合法
            String regx = "^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$";
            if (!email.matches(regx)) {
                return Msg.fail().add("va_msg", "邮箱格式不正确");
            }
    
            //数据库邮箱重复校验
            boolean res = employeeService.checkEmail(email);
            if (res) {
                return Msg.success();
            } else {
                return Msg.fail().add("va_msg", "该邮箱已使用");
            }
        }	
    }
    

    员工修改

    前端

    list.js

    $(function () {
    	//更新模态框的用户名校验
        $("#empName_update_input").blur(function () {
            //设置延时解决click与blur冲突的问题
            setTimeout(function () {
                var empName = $("#empName_update_input");
                var regName = /^[a-zA-Z0-9_-]{6,16}|(^[\u2E80-\u9FFF]{2,5})$/
                if (!regName.test(empName.val())) {
                    show_validata_msg(empName, "error", "用户名必须是2-5位中文,或者6-13位英文和数字的组合");
                } else {
                    show_validata_msg(empName, "success", "用户名可用");
                }
            }, 300)
        })
    
        //更新按钮的点击事件
        $("#emp_update_btn").click(function () {
            //1、校验用户名
            var empName = $("#empName_update_input");
            var regName = /^[a-zA-Z0-9_-]{6,16}|(^[\u2E80-\u9FFF]{2,5})$/;
    
            if (!regName.test(empName.val())) {
                //alert("用户名可以是2-5位中文,或者6-13位英文和数字的组合");
                show_validata_msg(empName, "error", "用户名必须是2-5位中文,或者6-13位英文和数字的组合");
                return false;
            } else {
                show_validata_msg(empName, "success", "用户名可用");
                $.ajax({
                    url: httpPath + "/updateEmp/" + $(this).attr("edit-id"),
                    type: "PUT",
                    data: $("#empUpdateModal form").serialize(),
                    success: function (result) {
                        // console.log(result);
                        if (result.code == 100) {
                            //成功
                            //1、关闭模态框
                            show_validata_msg(empName, "success", "用户名可用");
                            $("#empUpdateModal").modal('hide');
                            to_page(pageNum);
                        } else {
                            show_validata_msg(empName, "error", result.ext.va_msg);
                            return false;
                        }
                    }
                })
            }
        })
    
    	//为列表项中的修改添加点击事件
        $(document).on("click", ".edit_btn", function () {
            reset_form("#empUpdateModal form");
            // alert("edit");
            //1、查出部门信息,显示部门列表
            getDepts("#empUpdateModal select");
    
            //2、查出员工信息,显示员工信息
            getEmp($(this).attr("edit-id"));
    
            //3、把员工id传给模态框的更新按钮
            $("#emp_update_btn").attr("edit-id", $(this).attr("edit-id"));
    
            $("#empUpdateModal").modal({
                backdrop: "static"
            });
        })
    })
    
    /**
     * 根据id查询出用户信息并赋值
     * @param id
     */
    function getEmp(id) {
        $.ajax({
            url: httpPath + "/emp/" + id,
            type: "GET",
            success: function (result) {
                //console.log(result);
                var empData = result.ext.emp;
                $("#empName_update_input").val(empData.empName);
                $("#email_update_static").text(empData.email);
                $("#empUpdateModal input[name=gender]").val([empData.gender]);
                $("#empUpdateModal select").val([empData.dId]);
            }
        })
    }
    

    list.jsp

    <body>
    	<!-- 员工修改的模态框 -->
    	<div class="modal fade" id="empUpdateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    	    <div class="modal-dialog" role="document">
    	        <div class="modal-content">
    	            <div class="modal-header">
    	                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
    	                </button>
    	                <h4 class="modal-title">员工修改</h4>
    	            </div>
    	            <div class="modal-body">
    	                <form class="form-horizontal">
    	                    <div class="form-group">
    	                        <label for="empName_add_input" class="col-sm-2 control-label">用户名</label>
    	                        <div class="col-sm-10">
    	                            <input type="text" name="empName" class="form-control" id="empName_update_input"
    	                                   placeholder="用户名">
    	                            <span class="help-block"></span>
    	                        </div>
    	                    </div>
    	                    <div class="form-group">
    	                        <label for="email_add_input" class="col-sm-2 control-label">邮箱</label>
    	                        <div class="col-sm-10">
    	                            <p class="form-control-select" id="email_update_static"></p>
    	                        </div>
    	                    </div>
    	                    <div class="form-group">
    	                        <label for="email_add_input" class="col-sm-2 control-label">性别</label>
    	                        <div class="col-sm-10">
    	                            <label class="radio-inline">
    	                                <input type="radio" name="gender" id="gender1_update_input" value="M" checked="checked"></label>
    	                            <label class="radio-inline">
    	                                <input type="radio" name="gender" id="gender2_update_input" value="F"></label>
    	                        </div>
    	                    </div>
    	
    	                    <div class="form-group">
    	                        <label for="email_add_input" class="col-sm-2 control-label">部门</label>
    	                        <div class="col-sm-4">
    	                            <select class="form-control" name="dId" id="dept_update_select"></select>
    	                        </div>
    	                    </div>
    	                </form>
    	            </div>
    	            <div class="modal-footer">
    	                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
    	                <button type="button" class="btn btn-primary" id="emp_update_btn">更新</button>
    	            </div>
    	        </div>
    	    </div>
    	</div>
    </body>
    

    后端

    web.xml

    	<!-- 添加FormContentFilter过滤器以支持PUT请求--->
    	<filter>
    		<filter-name>FormContentFilter</filter-name>
    		<filter-class>org.springframework.web.filter.FormContentFilter</filter-class>
    	</filter>
    	<filter-mapping>
    		<filter-name>FormContentFilter</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    

    EmployeeService.java

    package com.indi.service;
    
    @Service
    public class EmployeeService {
    
    	//之前的代码
    	
        /**
         * 根据员工id查询员工信息
         * @param id
         * @return
         */
        public Employee getEmp(Integer id){
            Employee employee = employeeMapper.selectByPrimaryKeyWithDept(id);
            return employee;
        }
    
        /**
         * 员工更新
         * @param employee
         */
        public void updateEmp(Employee employee) {
            employeeMapper.updateByPrimaryKeySelective(employee);
        }
    }
    
    

    EmployeeController.java

    package com.indi.controller;
    
    @Controller
    public class EmployeeController {
    	//之前的代码
    
        /**
         * 根据id查询员工
         *
         * @param id
         * @return
         */
        @RequestMapping(value = "/emp/{id}", method = RequestMethod.GET)
        @ResponseBody
        public Msg getEmp(@PathVariable("id") Integer id) {
            Employee emp = employeeService.getEmp(id);
            return Msg.success().add("emp", emp);
        }
    
        /**
         * 更新员工
         *
         * @param employee
         * @return
         */
        @ResponseBody
        @RequestMapping(value = "/updateEmp/{empId}", method = RequestMethod.PUT)
        public Msg updateEmp(Employee employee) {
            String regx = "^[a-zA-Z0-9_-]{6,16}|(^[\\u2E80-\\u9FFF]{2,5})$";
            if (!employee.getEmpName().matches(regx)) {
                return Msg.fail().add("va_msg", "用户名必须是2-5位中文,或者6-13位英文和数字的组合");
            } else {
                employeeService.updateEmp(employee);
                return Msg.success();
            }
        }
    }
    

    员工删除

    前端

    list.js

    $(function () {
        //为列表项中的删除添加点击事件
        $(document).on("click", ".delete_btn", function () {
            //1、弹出是否确认删除对话框
            var empName = $(this).parents("tr").find("td:eq(2)").text();
            var empId = $(this).attr("delete-id");
            if (confirm("确认删除【" + empName + "】吗?")) {
                //确认
                $.ajax({
                    url: httpPath + "/deleteEmp/" + empId,
                    type: "DELETE",
                    success: function (result) {
                        //alert(result.msg)
                        to_page(pageNum);
                    }
                })
            }
        })
    })
    

    后端

    EmployeeService.java

    package com.indi.service;
    
    @Service
    public class EmployeeService {
    
    	//之前的代码
    	
        /**
         * 员工删除
         * @param id
         */
        public void deleteEmp(Integer id) {
            employeeMapper.deleteByPrimaryKey(id);
        }
    }
    
    

    EmployeeController.java

    package com.indi.controller;
    
    @Controller
    public class EmployeeController {
    	//之前的代码
    
        @ResponseBody
        @RequestMapping(value = "/deleteEmp/{id}", method = RequestMethod.DELETE)
        public Msg deleteEmpById(@PathVariable("id")Integer id) {
            employeeService.deleteEmp(id);
            return Msg.success();
        }
    }
    
    展开全文
  • 云上铺会员管理系统

    2017-07-15 09:06:16
    云上铺会员管理系统,是一款基于“互联网+”的店铺会员营销管理平台。是由云铺软件精心打造的云会员管理系统,所有使用者用户均采用全程自助的方式使用或者购买软件。分为免费版/高级版,不同类型的店铺的需求可以...
  • 蜂巢云会员管理系统

    2016-05-16 17:42:32
    蜂巢云会员管理系统包括WEB版、苹果手机APP、安卓版。“蜂巢云店铺”经过十年沉淀积累之后有诸多亮点,提供了会员管理、移动支付、收银记账、会员储值、会员等级、会员积分、会员折扣、员工提成管理、会员营销、微信...
  • 同时,通过云端智能分析数据,位智慧后勤提供一套后勤报修管理系统。1​​.2研究意义随着高校信息化的快速发展,智慧本项目基于手机应用程序设计与开发的在线一体化后勤报修管理系统,旨在提供方便,高效,全面的...
  • ASP今客CRM客户关系管理系统 完美版 v13.5 ◆ 家庭版系统将无法安装!!! ◆ 一般情况下直接运行“一键自动安装”即可完成安装部署。 ◆ 如果自动安装失败,您可以看视频手动安装(视频地址:...
  • 一款手持盘点安卓程序,可以安装至安卓系统的手持RF内用于盘点。 登录账户:admin/123 减少门店工作人员工的工作量,让门店库存、销售、盘点的更加的智能化、信息条码化。该解决方案以PDA智能终端为载体,将销售...
  • | 双鱼林苹果手机ios员工管理系统.rar 15.69 MB | 双鱼林文件和文件夹日期时间批量修改小软件(有使用演示).rar 3.23 MB | 销售管理系统(vb+access实现).rar 317.96 KB |- QQ343449035 (0 folders, 44 files, 116.93 ...
  • 达到员工告知效果,并将考勤数据存入数据库,系统集成有员工信息入录、刷卡信息实时监控、员工管理、网页及安卓端员工个人信息及考勤信息查询、系统安全等。 考勤系统对一个公司的员工管理是必不可少的,而无线考勤...

    此为博主本人的一个系统性课程设计

    摘要

    考勤系统+,是传统考勤系统的升级版,采用了无线技术进行考勤信息的实时传送,系统可对考勤信息进行准确分析得出考勤结果并实时反馈给对应考勤机,达到员工告知效果,并将考勤数据存入数据库,系统集成有员工信息入录、刷卡信息实时监控、员工管理、网页及安卓端员工个人信息及考勤信息查询、系统安全等。

    考勤系统对一个公司的员工管理是必不可少的,而无线考勤系统,为公司考勤提供了更多高效的运作方式,减少了公司的线材花费及维护,并集成了管理员模块及员工模块,是一种绿色与智能的体现。

    关键词考勤系统;无线;可扩展;安全

    概述

    2.1  课题描述

    考勤系统是企业必不可少的管理利器,考勤是为维护企业的正常工作秩序,提高办事效率,严肃企业纪律,使员工自觉遵守工作时间和劳动纪律。

    2.2  系统目标

             对员工的考勤和考核是企业人力资源管理中的一项重要内容,传统的考勤主要是人工签到考勤和考勤机考勤, 人工考勤比较费时费人工,而且还麻烦,准确率又不高;而传统的考勤机对考勤数据处理一般是采用RS-232或RS-485串口布线传输数据给主机的控制台进行数据保存或本地存储考勤数据,第一种数据处理方式:其一,它们都是有传输距离限制的,其二,如果考勤机较主机控制台距离远的话或者公司考勤机较多的话,将会带来大量的布线,为后期的维护工作带来诸多不便之处;而第二种数据处理方式:对后期的人工数据处理依赖很大,且容易造成数据丢失。

            考勤系统+,是传统考勤机的升级版,采用了无线技术进行考勤信息的实时传送,系统可对考勤信息进行准确分析得出考勤结果并实时反馈给对应考勤机,达到员工告知效果,并将考勤数据存入数据库,系统集成有员工信息入录、刷卡信息实时监控、员工管理、网页及安卓端员工个人信息及考勤信息查询、系统安全等。

    系统将会带来更加高效的公司员工考勤管理。

    2.3  环境

    a)  操作系统

          Windows10家庭版 64位

    b)  使用软件:

           总控制台开发:eclipse

          安卓开发:Android Studio2.0

          网页开发:Adobe Dreamweaver CC 2017

           数据库:Microsoft SQL Server 2016

           WiFi开发:ESP8266IDE

           CC2530模块开发:IAR Embedded Workbench

           文档编写:Microsoft Word 2016

    c)   开发语言:

            Java

            PHP

            html5

    系统需求分析

    相比于传统的考勤系统,本考勤系统+,最为突出的是实现了无线实时传输的功能,只要考勤机与主机在同一网络环境下,不管是局域网还是互联网,其都可以实现实时而可靠 的数据交互。

           考勤系统对一个公司的员工管理是必不可少的,而无线考勤系统,为公司考勤提供了更多高效的运作方式,减少了公司的线材花费及维护,并集成了管理员模块及员工

    图3.1  系统总体设计图

    3.1  系统功能

    1) 员工信息入录:员工入职时管理员将员工个人信息保存进入公司数据库网络;

    2) 员工信息管理:管理员可通过控制台对所有员工信息进行查看及管理;

    3) 实时监测平台:管理员可通过实时监控平台对员工的刷卡情况进行实时监控;

    4) 无线刷卡机:无线刷卡机带有蜂鸣器及显示屏等,可将员工的刷卡信息通过无线的方式发送给公司控制台;

    5) 公司网页端:员工可通过自己的工号和姓名登入公司网站,进行个人信息的查询及本月的的刷卡记录查询;

    6) 公司安卓端:员工可下载公司APP,通过自己的工号和姓名登入,进行个人信息的查询及本月的的刷卡记录查询。

    3.2  系统特点

    1)  无线技术:通过WiFi组网,进行数据的无线传输;

    2)  图片保存:图片通过PHP表单提交文件方式,将员工头像图片保存在web服务器,而不是将图片以二进制方式保存在数据库,以减少数据库的并发危险;

    3)  系统安全:管理员通过实时监测平台,可了解每个无线刷卡机的工作状态,也可以监测到每个刷卡机的实时刷卡情况,如果发现有异常卡一直占用考勤机机,管理员可通过控制台暂停考勤机的使用,此时刷卡机将不能进行刷卡,并且蜂鸣器会一直处于报警状态。管理员也可以恢复刷卡机的工作;

    4)  准确性:员工刷卡之后,刷卡信息会实时的传送到控制台,控制台会对信息进行快速分析并返回给刷卡机,刷卡机会将返回的信息显示在屏幕上,以达到准确的告知;

    5)  方便性:员工可通过公司管网及公司手机客户端多渠道获取到本月考勤信息,出现问题可及时反馈;

    6)  可扩展性:读取卡号使用的是物联网单片机CC2530,该单片机功耗低,性能稳定,为未来的系统扩展提供了无限可能。

    详细设计

    4.1 员工信息录入

    选择好对应的串口,点击获取卡号后P将会通过串口向CC2530模块发送相应的指令,CC2530模块接收到PC串口发来的指令后将会进行读卡操作,读卡成功将会通过串口发送卡号给PC机,否则将会发送相应的错误信息给PC。信息入录不可存在未输入项,图片信息将通过PHP提交给web服务器保存信息,其他信息将通过JDBC自接保存入数据库。IC卡号和工号不可重复使用。

     图4.1 员工信息入录页

     

    图 4.2  员工信息入录设计图

    4.2  员工信息管理

    管理员可在此页总览员工所有信息,并可一键删除上月的考勤数据,输入工号删除员工,带有刷新按钮,可检测新增加员工。

    图4.3  员工信息管理页

     

     图4.4  员工信息管理页

    4.3 员工考勤信息查询

    员工可通过公司管网及公司手机客户端多渠道获取到本月考勤信息,在网页或手机端输入工号和姓名,系统将通过PHP的post提交请求,web服务器将会返回相应数据。

     图4.5 员工考勤信息查询

    4.4 实时监测平台

    CC2530一直处于寻卡状态,当RC522感应区出现IC卡时,读卡成功后蜂鸣器将会滴一声,CC2530将会把卡号发送给ESP8266,ESP8266随即将卡号发送给PC实时监测平台,平台会将卡号与数据库信息进行比对,并将比对结果信息显示在监测平台对应位置,将比对结果返回给ESP8266,ESP8266将返回结果显示在OLED显示屏模块上。

    管理员可观察刷卡信息页,了解每一台考勤机的状态即对应的刷卡信息,出现异常可通过关闭按钮使考勤机处于报警状态,也可再次按下解除考勤机的报警状态。

    图4.6  实时监测平台页

     

    图4.7  实时监测平台设计图

    系统测试

    5.1 系统总览

    图5.1  PC控制台总览图
     图5.2  可复制的无线考勤机

     

    图5.3  信息录入模块图

    5.2 系统主要功能测试

    准备工作,打开数据库服务器,打开web服务器,使整个系统处于同一网路下

     图5.4  web服务器
    图5.5  员工信息入录
    图5.6  数据库信息变化
    图5.7 员工管理页数据变化
    图5.8 刷卡实时监测台
    图5.9 非公司卡刷卡后显示   

     

     图5.10 公司卡刷卡后显示工号

     

     图5.11 公司网页端查询信息登入页
    图5.12  公司网页端查询结果展示页

                                                           

    手机登入界面

        

    手机信息展示页

                                                  

    课程设计总结或结论 

    考勤系统+是传统考勤系统的升级版,本考勤系统已经实现了大体的逻辑,但也存在小许的不足之处,界面的美观,系统功能的扩展都是接下来应该花时间与心思去完成的。


    现在处于物联网时代的我们,视乎可以有更多的可能,本系统使用的刷卡机只能短距离实现 IC 卡识别,我想接下来可以将距离慢慢拉远,使用高频识别,加入人脸识别等AI 技术,使考勤系统更具科技感,更有实用性。


    成稿信息

    时间:2018年5月

    阶段:大二下学期

    背景:射频识别应用系统课设

    名称:考勤系统+

    视频演示:https://www.bilibili.com/video/av59856209

    展开全文
  • 考勤系统+(小项目)

    2019-05-13 15:15:00
    时间:2018年5月 阶段:大二下学期 ...达到员工告知效果,并将考勤数据存入数据库,系统集成有员工信息入录、刷卡信息实时监控、员工管理、网页及安卓端员工个人信息及考勤信息查询、系统安全等。 考勤系统对...
  • 本项目是一个基于安卓的公司电脑维修管理系统项目源码包括安卓客户端源码、javaweb服务端源码、mysql数据库文件。可以实现员工对电脑故障的报告,管理员也就是网络维护员可以在手机客户端收到其他员工对电脑问题的...
  • 劳动力管理 v4.4.0

    2019-03-16 22:44:08
     劳动力管理App一款好用的手机管理工具,劳动力管理App是亚太地区领先的移动端劳动力管理工具,劳动力管理App帮助企业员工自主管理时间、考勤打卡、查看工时与薪资;帮助管理层智能排班、审批...
  • 软件标签:学生订餐,管理系统 软件简介(必填): 管理员账号 admin 密码 a25175 运行环境:IIS+ASP.NET4.6+SQL2008 开发软件:VS2015 兼容浏览器:IE8+ FireFox, Safari, Chrome and more. 特色重点说明: a.WEB...
  • 系统管理员进行权限分配及设置后,员工按权限进行操作,同时系统采用先进的BPM流程管理,可以帮助企业实现业务的整合及让工程业务运行更加顺畅。系统采用先进的前台技术,界面设计简洁,员工操作简便。 用户还...
  • 进销存系统能完全对接掌柜星/掌柜日记小程序商城软件,上下游数据互通、同步财务管理、同步库存管理、支持多门店、多员工同步管理,手机、平板、电脑多终端数据实时同步,安卓/苹果/Windors系统都支持,线上线下数据...
  • 管理员可通过安卓APP / WEB查看管理员工位置信息。系统发布到服务器: : 经测试,本系统稳定可靠,稍作完善,即可供小型企业使用。 ###系统设计 ARM单片机通过UART与RFID读卡器和Wi-Fi模块连接 电脑通过Wi-Fi接收...
  • 优考试对手机和平板(iPhone, 安卓)等进行了专门的优化,在这些移动设备上表现完美。使用优考试,你的学员(员工)可以无优答卷, 在教室里,在公交车上,在家里,一切有网络的地方都可以 从题库中随机添加试题到...
  • 优考试对手机和平板(iPhone, 安卓)等进行了专门的优化,在这些移动设备上表现完美。使用优考试,你的学员(员工)可以无优答卷, 在教室里,在公交车上,在家里,一切有网络的地方都可以 从题库中随机添加试题到...
  • 今天以tower为例 给大家说说web+APP混合项目测试如何实现 ...Tower是一款团队协作工具, 帮助企业进行项目管理和个人任务管理,提高企业员工间的协作和项目管理效率。 3 web与app数据同步功能测试 根据项目...
  • 光合物管 v1.5.0

    2019-03-16 21:54:02
     光合物管app是光合加物业服务平台推出的一款为物业一线员工管理者打造的全新物业管理移动工作站,光合物管app可以更好的帮助基层物业员工开展日常工作,光合物管app协助管理层有效进行重要节点的...
  • C#基础01

    2019-09-08 02:20:50
    ASP.net基础详情 1:Momo就是跨平台的一种.net,借助其Momo可以让其.net网站跑到Lumin和安卓机上面...3:互联网开发【网站】和管理系统【ERP,企业内部处理员工信息】的开发都可以用ASP.net来开发。 4:有关于网上...
  • 多个员工,共享商品、库存信息,且支持权限管理; 支持多个仓库管理。 智慧商贸进销存专业版 v4.0.0 更新日志 1、新增清除本地数据库缓存功能,数据实时更新; 2、新增单据列表中导出指定项功能,单据字段自主...
  • 手机控制电脑

    2012-05-27 18:32:54
    家长监控孩子,企业管理员监控员工,监控服务器 使用帮助 安卓系统 手机客户端下载 sj.51hehe.cn 其他手机操作:登录支持www浏览器,登录地址sj.51hehe.cn/sj 在此界面可以注册用户 注册完用户登录,然后选择在线的...
  • 挂式云消费机 挂式云消费机是自主研发一种简易化、智能化的新型消费机,具有完善的系统功能,灵活的...设备具有串口接口,可以与收银机、电子秤、电脑等Windows、安卓系统上的位机进行交互,实现收银支付一体化
  • 包含:企业文化、员工管理、人才培养等公司内训 兴趣培养 包含:美术、音乐、瑜伽、健身等兴趣类教育 学历培训 包含:成人自考、学历提升、考研等成人教育 万岳网校源码参数 品牌:thinkphp 语言:php 数据库:...

空空如也

空空如也

1 2
收藏数 33
精华内容 13
关键字:

安卓员工管理系统