项目目录修改
This commit is contained in:
parent
b0e70dc3eb
commit
a3275155bf
18
JDBC/src/main/java/test.java
Normal file
18
JDBC/src/main/java/test.java
Normal 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));
|
||||
}
|
||||
}
|
@ -30,20 +30,38 @@ public class IndentItemView {
|
||||
int flag = 0;
|
||||
while (!reader.hasNext("end")) {
|
||||
IndentItem IItem = new IndentItem();
|
||||
//菜名
|
||||
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());
|
||||
String s;
|
||||
String[] sn;
|
||||
while (!reader.hasNext("end")) {
|
||||
s = reader.nextLine();
|
||||
sn = s.split("\\s+");
|
||||
//菜名
|
||||
IItem.setName(sn[0]);
|
||||
//初始价格
|
||||
IItem.setInitialPrice(Float.valueOf(sn[1]));
|
||||
//折扣
|
||||
if (sn[3] != null) {
|
||||
IItem.setDiscount(Float.valueOf(sn[2]));
|
||||
} else {
|
||||
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
|
||||
indentDAO indent = new indentDAO();
|
||||
IItem.setIndentID(indent.searchID(indentID));
|
29
pom.xml
29
pom.xml
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user