保存进度!
This commit is contained in:
14
code/后端/desktop_archievement_backend/.vscode/launch.json
vendored
Normal file
14
code/后端/desktop_archievement_backend/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
// 使用 IntelliSense 了解相关属性。
|
||||
// 悬停以查看现有属性的描述。
|
||||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Current File",
|
||||
"request": "launch",
|
||||
"mainClass": "${file}"
|
||||
}
|
||||
]
|
||||
}
|
@@ -18,10 +18,11 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- https://mvnrepository.com/artifact/junit/junit -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>4.13.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -29,7 +30,12 @@
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
@@ -103,16 +109,16 @@
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@@ -14,13 +14,23 @@ import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.CallableStatement;
|
||||
|
||||
import java.util.Vector;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class DepartmentArchievement
|
||||
{
|
||||
public DepartmentArchievement()
|
||||
|
||||
// 以后要改
|
||||
private static String jdbcURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
|
||||
private static String userName = "desktop_archievement_admin";
|
||||
private static String password = "Cpic123456";
|
||||
|
||||
/**
|
||||
* 默认的构造函数,提供给json使用。
|
||||
*/
|
||||
public DepartmentArchievement()
|
||||
{
|
||||
this.totalArchievement = 0;
|
||||
this.mensualArchievementList = new Vector<>();
|
||||
@@ -28,14 +38,48 @@ public class DepartmentArchievement
|
||||
this.attachingRate = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 构造函数,提供所有成员对象的值。
|
||||
* @param totalArchievement
|
||||
* @param mensualArchievementList
|
||||
* @param insuranceRenewalRate
|
||||
* @param attachingRate
|
||||
*/
|
||||
public DepartmentArchievement( int totalArchievement, Vector<Integer> mensualArchievementList,
|
||||
String insuranceRenewalRate, String attachingRate)
|
||||
{
|
||||
this.totalArchievement = totalArchievement;
|
||||
this.mensualArchievementList = mensualArchievementList;
|
||||
this.insuranceRenewalRate = insuranceRenewalRate;
|
||||
this.attachingRate = attachingRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 静态方法,用于根据部门代码,查询部门业绩,生成一个 DepartmentArchievement 对象。
|
||||
* @param departmentCode 部门代码
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
public static DepartmentArchievement queryDepartmentArchievement( String departmentCode )
|
||||
throws SQLException, ClassNotFoundException
|
||||
{
|
||||
DepartmentArchievement archievement = new DepartmentArchievement();
|
||||
|
||||
String sql = """
|
||||
|
||||
|
||||
""";
|
||||
String sql = "{call telsale_archievement_pkg.department_archievement(?,?,?)}";
|
||||
|
||||
Class.forName( "oracle.jdbc.driver.OracleDriver" );
|
||||
Connection connection = DriverManager.getConnection( jdbcURL, userName, password );
|
||||
java.sql.CallableStatement statement = connection.prepareCall( sql );
|
||||
|
||||
statement.setString( 1, departmentCode );
|
||||
statement.registerOutParameter( 2, java.sql.Types.VARCHAR );
|
||||
statement.registerOutParameter( 3, java.sql.Types.VARCHAR );
|
||||
|
||||
statement.execute();
|
||||
|
||||
String attach_rate = statement.getString(2);
|
||||
String renewal_rate = statement.getString( 3 );
|
||||
|
||||
return archievement;
|
||||
}
|
||||
@@ -93,4 +137,4 @@ public class DepartmentArchievement
|
||||
|
||||
@JsonProperty( "attaching_rate" )
|
||||
private String attachingRate; // 车非渗透率
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user