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; IItem.setName(reader.next());
while (!reader.hasNext("end")) { //初始价格
s = reader.nextLine(); IItem.setInitialPrice(reader.nextFloat());
sn = s.split("\\s+"); //折扣
//菜名 if (reader.hasNextFloat()) {
IItem.setName(sn[0]); IItem.setDiscount(reader.nextFloat());
//初始价格 } else {
IItem.setInitialPrice(Float.valueOf(sn[1])); IItem.setDiscount(-1F);
//折扣 }
if (sn[3] != null) { //描述
IItem.setDiscount(Float.valueOf(sn[2])); if (!reader.hasNext("end") && !Objects.equals(reader.nextLine(), " ")) {
} else { IItem.setDescription(reader.nextLine());
IItem.setDiscount(-1F);
}
//描述
if (sn[3] != null) {
IItem.setDescription(sn[3]);
}
} }
// 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));