import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
class PlanInformation {
private int id;
private String planid;
private String planname;
private String process;
private String nextprocess;
private String operator;
private String recipient;
private int plannumber;
private int innumber;
private int outnumber;
private int missnumber;
private int badnumber;
private int inspectednumber;
private int statement;
public PlanInformation (int id,String planid,String planname,String process,String nextprocess,
String operator,String recipient,int plannumber,int innumber,
int outnumber,int missnumber,int badnumber,int inspectednumber,int statement){
this.id = id;
this.planid = planid;
this.planname = planname;
this.process = process;
this.nextprocess = nextprocess;
this.operator = operator;
this.recipient = recipient;
this.plannumber = plannumber;
this.innumber = innumber;
this.outnumber = outnumber;
this.missnumber = missnumber;
this.badnumber = badnumber;
this.inspectednumber = inspectednumber;
this.statement = statement;
}
public int getid() {
return id;
}
public String getplanname() {
return planname;
}
public String getprocess() {
return process;
}
public String getplanid() {
return planid;
}
public String getnextpocess() {
return nextprocess;
}
public String getoperator() {
return operator;
}
public String getrecipient() {
return recipient;
}
public int getplannumber() {
return plannumber;
}
public int getinnumber() {
return innumber;
}
public int getoutnumber() {
return outnumber;
}
public int getmissnumber() {
return missnumber;
}
public int getbadnumber() {
return badnumber;
}
public int getinspectednumber() {
return inspectednumber;
}
public int getstatement() {
return statement;
}
public void setid(int id) {
this.id = id;
}
public void setplanid(String planid) {
this.planid = planid;
}
public void setplanname(String planname) {
this.planname = planname;
}
public void setprocess(String process) {
this.process = process;
}
public void setnextprocess(String nextprocess) {
this.nextprocess = nextprocess;
}
public void setoperator(String operator) {
this.operator = operator;
}
public void setrecipient(String recipient) {
this.recipient = recipient;
}
public void setplannumber(int plannumber) {
this.plannumber = plannumber;
}
public void setinnumber(int innumber) {
this.innumber = innumber;
}
public void setoutnumber(int outnumber) {
this.outnumber = outnumber;
}
public void setmissnumber(int missnumber) {
this.missnumber = missnumber;
}
public void setbadnumber(int badnumber) {
this.badnumber = badnumber;
}
public void setinspectednumber(int inspectednumber) {
this.inspectednumber = inspectednumber;
}
public void setstatement(int statement) {
this.statement = statement;
}
}
public class PlanManagement {
private static List
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
while (true) {
displayMainMenu();
int choice = scanner.nextInt();
scanner.nextLine();
switch (choice) {
case 1:
ProductPlan();
break;
case 2:
SubmitDaily();
break;
case 3:
ConfirmDaily();
break;
case 4:
StatisticalProgress();
break;
default:
System.out.println("该选项不存在,请重新输入");
}
}
}
private static void displayMainMenu() {
System.out.println("");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("");
System.out.println("1、生成计划");
System.out.println("2、提交日报");
System.out.println("3、确认日报");
System.out.println("4、统计进度");
System.out.println("**********************************************************");
System.out.println("请输入选项(1-4):");
}
private static PlanInformation findInformationByplanid(String planid) {
for (PlanInformation info : PlanInformationList) {
if (info.getplanid().equals(planid)) {
return info;
}
}
return null;
}
private static void ProductPlan() {
System.out.println("");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("");
System.out.print("产品批次:");
String planid = scanner.nextLine();
System.out.print("产品名称:");
String planname = scanner.nextLine();
System.out.print("计划数量:");
int plannumber = scanner.nextInt();
scanner.nextLine();
System.out.println("**********************************************************");
if (planid.isEmpty() || planname.isEmpty() || plannumber <= 0) {
System.out.println("录入错误");
return;
}
PlanInformation Information = new PlanInformation(0, planid, planname, "", "", "", "", plannumber, 0, 0, 0, 0, 0, 0);
PlanInformationList.add(Information);
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("***********************************************************");
System.out.println("产品批次:" + planid);
System.out.println("产品名称:" + planname);
System.out.println("计划数量:" + plannumber);
System.out.println("该产品入库操作已完成,是否提交(Y/N)");
System.out.println("**********************************************************");
String confirm = scanner.nextLine();
if (confirm.equalsIgnoreCase("Y")) {
System.out.println("商品信息已提交,返回主界面。");
} else {
PlanInformationList.remove(Information);
System.out.println("商品信息未提交,返回产品入库界面。");
}
}
private static void SubmitDaily() {
System.out.println("");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("");
System.out.println("请输入产品批次号:");
String planid = scanner.nextLine();
System.out.println("***********************************************************");
PlanInformation Information = findInformationByplanid(planid);
if (Information == null) {
System.out.println("库中没有该产品计划,返回到提交界面。");
return;
}
int statement = Information.getstatement();
if (statement == 0) {
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("***********************************************************");
System.out.println("1、产品批次:" + Information.getplanid());
System.out.println("2、产品名称:" + Information.getplanname());
System.out.println("3、计划数量:" + Information.getplannumber());
System.out.println("4、当前工序:" + Information.getprocess());
System.out.println("5、下一工序:" + Information.getnextpocess());
System.out.println("6、操作员:" + Information.getoperator());
System.out.println("7、接收员:" + Information.getrecipient());
System.out.println("8、上一道工序转入数量:" + Information.getinnumber());
System.out.println("9、转出总数:" + Information.getoutnumber());
System.out.println("10、丢失数量:" + Information.getmissnumber());
System.out.println("11、废品数量:" + Information.getbadnumber());
System.out.println("12、待检验数量:" + Information.getinspectednumber());
} else if (statement == 2) {
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("***********************************************************");
System.out.println("1、产品批次:" + Information.getplanid());
System.out.println("2、产品名称:" + Information.getplanname());
System.out.println("3、计划数量:" + Information.getplannumber());
System.out.println("4、当前工序:" + Information.getprocess());
System.out.println("5、下一工序:" + Information.getnextpocess());
System.out.println("6、操作员:" + Information.getoperator());
System.out.println("7、接收员:" + Information.getrecipient());
System.out.println("8、上一道工序转入数量:" + Information.getinnumber());
}
}
private static void ConfirmDaily() {
System.out.println("");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("");
System.out.println("请输入产品批次号:XXXXXXXX");
String planid = scanner.nextLine();
System.out.println("");
PlanInformation Information = findInformationByplanid(planid);
if (Information == null) {
System.out.println("库中没有该产品批次,返回到确认日报界面。");
return;
}
System.out.println("");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("");
System.out.println("1、产品批次:"+ Information.getplanid());
System.out.println("2、产品名称:"+ Information.getplanname());
System.out.println("3、计划数量:"+ Information.getplannumber());
System.out.println("4、当前工序:"+ Information.getprocess());
System.out.println("5、下一工序:"+ Information.getnextpocess());
System.out.println("6、操作员:"+ Information.getoperator());
System.out.println("7、接收员:"+ Information.getrecipient());
System.out.println("8、上一道工序转入数量:"+ Information.getinnumber());
System.out.println("9、转出总数:"+ Information.getoutnumber());
System.out.println("10、丢失数量:"+ Information.getmissnumber());
System.out.println("11、废品数量:"+ Information.getbadnumber());
System.out.println("12、待检验数量:"+ Information.getinspectednumber());
System.out.println("是否确认(Y/N)");
System.out.println("");
String confirm = scanner.nextLine();
if (confirm.equalsIgnoreCase("Y")) {
System.out.println("已确认。");
System.out.println("将批次状态statement设置成为2");
System.out.println("");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("");
System.out.println("1、产品批次:"+ Information.getplanid());
System.out.println("2、产品名称:"+ Information.getplanname());
System.out.println("3、计划数量:"+ Information.getplannumber());
System.out.println("4、当前工序:"+ Information.getprocess());
System.out.println("5、下一工序:"+ Information.getnextpocess());
System.out.println("6、操作员:"+ Information.getoperator());
System.out.println("7、接收员:"+ Information.getrecipient());
System.out.println("8、上一道工序转入数量:"+ Information.getinnumber());
System.out.println("***********************************************************");
} else {
System.out.println("已返回。");
return;
}
}
private static void StatisticalProgress() {
System.out.println("");
System.out.println(" 石家庄铁道大学无限23软件开发有限公司");
System.out.println(" Mes系统2023版");
System.out.println("");
System.out.println("抱歉未实现...");
System.out.println("***********************************************************");
}
}
有些功能未实现