Commit 41ebcfe7 by 袁弋博

init project

0 parents
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>com.gelvshi</groupId>
<artifactId>taoxiao</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>taoxiao-api</module>
<module>taoxiao-server</module>
<module>taoxiao-consumer</module>
</modules>
<!-- 第一步:添加Springboot的parent -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<!-- 设置项目中所需要使用的jar包的版本及一些属性 -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.7</java.version>
<commons-lang.version>2.6</commons-lang.version>
<mybatis.version>1.3.1</mybatis.version>
<mysql-connector-java.version>5.1.44</mysql-connector-java.version>
<fastjson.version>1.2.38</fastjson.version>
<druid.version>1.1.3</druid.version>
<dubbo.version>2.5.7</dubbo.version>
<zkclient.version>0.10</zkclient.version>
<lombok.version>1.16.18</lombok.version>
<httpclient.version>4.5.3</httpclient.version>
<spring-boot.version>1.5.8.RELEASE</spring-boot.version>
<spring-boot-starter-redis.version>1.4.7.RELEASE</spring-boot-starter-redis.version>
<pagehelper-spring-boot-starter.version>1.2.3</pagehelper-spring-boot-starter.version>
<com.alibaba.druid.version>1.1.5</com.alibaba.druid.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Springboot依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<!-- Springboot-web依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<!-- Springboot-mybatis依赖 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.version}</version>
</dependency>
<!-- 添加mysql支持 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
</dependency>
<!-- 添加redis支持 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>${spring-boot-starter-redis.version}</version>
</dependency>
<!-- 数据库连接池druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.29</version>
</dependency>
<!-- 使用lombok实现JavaBean的get、set、toString、hashCode、equals等方法的自动生成 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- Dubbo依赖 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
</dependency>
<!-- zookeeper的客户端依赖 -->
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<version>0.9</version>
</dependency>
<!-- fastJson支持 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- httpclient支持 -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<!-- commons-lang支持 -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<!-- 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>
<!--poi excel操作-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>taoxiao</artifactId>
<groupId>com.gelvshi</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>taoxiao-api</artifactId>
<dependencies>
<!--http支持 用于向页面传输数据,发送请求什么的-->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<!--常用工具类的支持-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.5.3</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.37</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.13.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.10-FINAL</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.gelvshi.domain;
import java.math.BigDecimal;
public class Development {
private Long id;
//就业率
private BigDecimal roe;
//对口率
private BigDecimal cr;
//工资
private BigDecimal salary;
//稳定率
private BigDecimal stability;
//创业率
private BigDecimal entrepreneurial;
//升学率
private BigDecimal enrolment;
//学校ID
private Long school_id;
public Long getSchool_id() {
return school_id;
}
public void setSchool_id(Long school_id) {
this.school_id = school_id;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public BigDecimal getRoe() {
return roe;
}
public void setRoe(BigDecimal roe) {
this.roe = roe;
}
public BigDecimal getCr() {
return cr;
}
public void setCr(BigDecimal cr) {
this.cr = cr;
}
public BigDecimal getSalary() {
return salary;
}
public void setSalary(BigDecimal salary) {
this.salary = salary;
}
public BigDecimal getStability() {
return stability;
}
public void setStability(BigDecimal stability) {
this.stability = stability;
}
public BigDecimal getEntrepreneurial() {
return entrepreneurial;
}
public void setEntrepreneurial(BigDecimal entrepreneurial) {
this.entrepreneurial = entrepreneurial;
}
public BigDecimal getEnrolment() {
return enrolment;
}
public void setEnrolment(BigDecimal enrolment) {
this.enrolment = enrolment;
}
}
package com.gelvshi.domain;
public class School {
private Long id;
private String logo;
private String abbretion;
private String teachers;
private String hornor;
private String details;
private String majors;
private String pros;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public String getAbbretion() {
return abbretion;
}
public void setAbbretion(String abbretion) {
this.abbretion = abbretion;
}
public String getTeachers() {
return teachers;
}
public void setTeachers(String teachers) {
this.teachers = teachers;
}
public String getHornor() {
return hornor;
}
public void setHornor(String hornor) {
this.hornor = hornor;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
public String getMajors() {
return majors;
}
public void setMajors(String majors) {
this.majors = majors;
}
public String getPros() {
return pros;
}
public void setPros(String pros) {
this.pros = pros;
}
}
package com.gelvshi.utils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.List;
public class ExcelUtils {
//处理excel表格的工具类
public static List<Object[]> readXls(File upload) throws Exception{
FileInputStream is = new FileInputStream(upload);
Workbook wb = new XSSFWorkbook(is);
Sheet sheet = wb.getSheetAt(0);
//创建工作簿对应的表头
List<Object[]> strList = new ArrayList<>();
//看这张表总共有多少行
int lastRowNum = sheet.getLastRowNum();
try{
for (int i = 0;i<=lastRowNum;i++){
//读取到某一行
Row row = sheet.getRow(i);
//看总共有多少列
short lastCellnum = row.getLastCellNum();
//从第0个索引开始
Object[] rowData = new Object[lastCellnum];
for (int j = 0;j<lastCellnum;j++){
//拿到行其中的格子
Cell cell = row.getCell(j);
if(cell.getCellType()== HSSFCell.CELL_TYPE_STRING){
rowData[j] = cell.getStringCellValue();
}else if(cell.getCellType()== HSSFCell.CELL_TYPE_NUMERIC){
rowData[j] = cell.getNumericCellValue();
}
}
strList.add(rowData);
}
//读取数据
return strList;
}catch (Exception e){
e.printStackTrace();
return null;
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>taoxiao</artifactId>
<groupId>com.gelvshi</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>taoxiao-consumer</artifactId>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>taoxiao</artifactId>
<groupId>com.gelvshi</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>taoxiao-server</artifactId>
</project>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!