bugfix merge remote了以后出现了玄学问题,服了

This commit is contained in:
twinkle255 2023-06-25 12:01:53 +08:00
parent 131e44eac3
commit 52c3c4fd50

View File

@ -30,38 +30,20 @@ public class IndentItemView {
int flag = 0; int flag = 0;
while (!reader.hasNext("end")) { while (!reader.hasNext("end")) {
IndentItem IItem = new IndentItem(); IndentItem IItem = new IndentItem();
String s;
String[] sn;
while (!reader.hasNext("end")) {
s = reader.nextLine();
sn = s.split("\\s+");
//菜名 //菜名
IItem.setName(sn[0]); IItem.setName(reader.next());
//初始价格 //初始价格
IItem.setInitialPrice(Float.valueOf(sn[1])); IItem.setInitialPrice(reader.nextFloat());
//折扣 //折扣
if (sn[3] != null) { if (reader.hasNextFloat()) {
IItem.setDiscount(Float.valueOf(sn[2])); IItem.setDiscount(reader.nextFloat());
} else { } else {
IItem.setDiscount(-1F); IItem.setDiscount(-1F);
} }
//描述 //描述
if (sn[3] != null) { if (!reader.hasNext("end") && !Objects.equals(reader.nextLine(), " ")) {
IItem.setDescription(sn[3]); IItem.setDescription(reader.nextLine());
} }
}
// IItem.setName(reader.next());
// IItem.setInitialPrice(reader.nextFloat());
// if (reader.hasNextFloat()) {
// IItem.setDiscount(reader.nextFloat());
// } else {
// IItem.setDiscount(-1F);
// }
// if (!reader.hasNext("end") && !Objects.equals(reader.nextLine(), " ")) {
// IItem.setDescription(reader.nextLine());
// }
//菜单ID //菜单ID
indentDAO indent = new indentDAO(); indentDAO indent = new indentDAO();
IItem.setIndentID(indent.searchID(indentID)); IItem.setIndentID(indent.searchID(indentID));