项目目录修改

This commit is contained in:
myh 2023-06-07 19:43:45 +08:00
parent b0e70dc3eb
commit a3275155bf
27 changed files with 74 additions and 17 deletions

View File

@ -0,0 +1,18 @@
import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
import java.util.Arrays;
import java.util.Scanner;
public class test {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
String s = "";
while (!reader.hasNext("end")){
s = reader.nextLine();
}
String[] sn = s.split("\\s+");
for (String item:sn) {
System.out.println(item);
}
System.out.println(Arrays.toString(sn));
}
}

View File

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

29
pom.xml
View File

@ -1,13 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>JavaElm</artifactId>
<artifactId>Elm</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>JavaEle</name>
<name>Elm</name>
<url>https://maven.apache.org</url>
<properties>
@ -37,6 +38,7 @@
<artifactId>mssql-jdbc</artifactId>
<version>12.2.0.jre11</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
@ -44,4 +46,23 @@
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<directory>JDBC/target</directory>
<sourceDirectory>JDBC/src/main/java</sourceDirectory>
<testSourceDirectory>JDBC/src/test/java</testSourceDirectory>
<outputDirectory>JDBC/target/classes</outputDirectory>
<testOutputDirectory>JDBC/target/test-classes</testOutputDirectory>
<resources>
<resource>
<directory>JDBC/src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>JDBC/src/test/resources</directory>
</testResource>
</testResources>
</build>
</project>