content
2. Query student file information
3. Add student profile information
4. Update student profile information
5. Delete student profile information
1. Other system implementation
1. System introduction
1. Development environment
Development tools: IDEA2018.2
JDK version: jdk1.8
2. Technical selection
Java language development, using ArrayList to store information.
3. System function
1. Implement system login
2. Realize the addition, deletion, modification and checking of student file information
4. Get resources
1. CSDN download
2. System display
1. Log in to the system
2. Query student file information
3. Add student profile information
4. Update student profile information
5. Delete student profile information
3. Part of the code
BusinessService
package service;
import common.Constant;
import common.Response;
import entity.Archive;
import java.util.ArrayList;
import java.util.List;
public class BusinessService {
private static List<Archive> businessList = new ArrayList<>();
static {
businessList.add(new Archive("1","张三档案","1层","2021-06-01","秘密"));
businessList.add(new Archive("2","李四档案","2层","2021-06-01","秘密"));
businessList.add(new Archive("3","王五档案","3层","2021-06-01","秘密"));
}
// 查询
public Response query(String name){
if(name == null || "".equals(name)){
return new Response("error","编号为空。");
}
for(Archive archive : businessList){
if(name.equals(archive.getArchId())){
return new Response("success","查询成功。", archive);
}
}
return new Response("error","未查询到此"+ Constant.MAIN_CLASS +",请重新输入:");
}
// 增加
public Response add(Archive archive){
for(Archive s : businessList){
if(s.getArchId().equals(archive.getArchId())){
return new Response("error","该"+ Constant.MAIN_CLASS+"已存在。");
}
}
businessList.add(archive);
return new Response("success", Constant.MAIN_CLASS+"添加成功。", archive);
}
// 编辑
public Response checkProp(Archive archive, String prop, String value){
if(prop == null || "".equals(prop)){
return new Response("error","属性为空。");
}
String[] props = {"stuId","stuName","stuSex","stuAge","stuWeight"};
switch(prop){
case "archId" :
archive.setArchId(value);
break;
case "archName" :
archive.setArchName(value);
break;
case "archPosition" :
archive.setArchPosition(value);
break;
case "archTime" :
archive.setArchTime(value);
break;
case "archLevel" :
archive.setArchLevel(value);
break;
default:
return new Response("error","该属性不存在。");
}
return new Response("success","编辑成功。");
}
// 删除
public Response delete(String name){
if(name == null || "".equals(name)){
return new Response("error", Constant.MAIN_CLASS+"编号为空。");
}
for(Archive archive: businessList){
if(archive.getArchId().equals(name)){
businessList.remove(archive);
return new Response("success", Constant.MAIN_CLASS+"删除成功。");
}
}
return new Response("error", Constant.MAIN_CLASS+"不存在。");
}
}
LoginService
package service;
import common.Account;
import common.Response;
import entity.User;
import java.util.ArrayList;
import java.util.List;
public class LoginService {
private static List<User> userList = new ArrayList();
static{
userList.add(new User(Account.ADMIN.getUsername(), Account.ADMIN.getPassword()));
userList.add(new User(Account.USER1.getUsername(), Account.USER1.getPassword()));
userList.add(new User(Account.USER2.getUsername(), Account.USER2.getPassword()));
userList.add(new User(Account.USER3.getUsername(), Account.USER3.getPassword()));
}
public Response login(String username, String password){
if(username == null || "".equals(username)){
return new Response("error","用户名为空,请输入用户名。");
}
if(password == null || "".equals(password)){
return new Response("error","密码为空,请输入密码。");
}
for (User user : userList){
if(username.equals(user.getUsername()) && password.equals(user.getPassword())){
return new Response("success","登陆成功!");
}
}
return new Response("error","用户名或密码输入错误,请检查并重新输入。");
}
}
4. Other
1. Other system implementation
IDEA+Java console realizes hospital management system
IDEA+Java console implements pet management system
IDEA+Java console implements teaching material management system
IDEA+Java console implements commodity management system
IDEA+Java console realizes goods sales management system
IDEA+Java console implements student information management system
IDEA+Java console implements student file management system
IDEA+Java console implements park ticket management system
2. Get the source code
Click the link below to get the source code.
3. Run the project
Import the project directly and open the Main runner.
4. Remarks
If there is any infringement, please contact me to delete it.
5. Support Bloggers
If you think this article is helpful to you, please like, follow and favorite. wish you a happy life! If you want to get other resources, you can follow the WeChat public account on the left to get it!