Commit 74770c61 authored by suichenguang's avatar suichenguang

导入导出

parent bfd8e399
......@@ -23,6 +23,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
......@@ -37,6 +42,29 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.10</version>
</dependency>
</dependencies>
<build>
......
package com.yxproject.start.api;
import com.yxproject.start.entity.PersonPostAbnormalEntity;
import com.yxproject.start.entity.RedoRegistrationEntity;
import com.yxproject.start.entity.TemporaryCertificateEntity;
import com.yxproject.start.utils.ExportExcel;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("exportExcel")
public class ExportExcelApi {
/**
* 导出临时证信息
*/
@RequestMapping("ExportTemporaryCertificate")
public boolean ExportTemporaryCertificate(){
PersonPostAbnormalEntity temporaryCertificate = new PersonPostAbnormalEntity();
ExportExcel obj = new ExportExcel();
obj.exportTemporaryCertificateExcel((List<TemporaryCertificateEntity>) temporaryCertificate);
return true;
}
/**
* 导出重做证件信息
*/
@RequestMapping("ExportRedoRegistration")
public boolean ExportRedoRegistration(){
RedoRegistrationEntity redoRegistration = new RedoRegistrationEntity();
ExportExcel obj = new ExportExcel();
obj.exportRedoRegistrationExcel((List<RedoRegistrationEntity>) redoRegistration);
return true;
}
}
package com.yxproject.start.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("person")
public class PersonalDetailsApi {
}
package com.yxproject.start.api;
import com.yxproject.start.entity.*;
import com.yxproject.start.utils.ReadExcel;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.sql.Time;
import java.util.List;
import java.io.File;
/**
*
* 导入Excel文件
*
*/
@RestController
@RequestMapping("ReadExcel")
public class ReadExcelApi {
/**
* 导入个人制证进度状态表
*/
@RequestMapping("ReadPPS")
public boolean ReadPersonalProgressStatus() throws Exception{
ReadExcel obj = new ReadExcel();
PersonalProgressStatusEntity personalProgressStatus = new PersonalProgressStatusEntity();
File file = new File("E:/北京制证项目/personal_progress_status.xls");
List excelList = obj.readExcel(file);
for (int i = 0; i < excelList.size(); i++) {
List list = (List) excelList.get(i);
personalProgressStatus.setUploadNo((String) list.get(0));
personalProgressStatus.setProgressStatus((Long) list.get(1));
personalProgressStatus.setNote((String) list.get(2));
personalProgressStatus.setImportDate((String) list.get(3));
personalProgressStatus.setCreateTaskDate((Time) list.get(4));
personalProgressStatus.setDataCheckDate((Time) list.get(5));
personalProgressStatus.setFilmPrintDate((Time) list.get(6));
personalProgressStatus.setPositionDate((Time) list.get(7));
personalProgressStatus.setSortDate((Time) list.get(8));
personalProgressStatus.setQualityTestDate((Time) list.get(9));
personalProgressStatus.setOutStorageDate((Time) list.get(10));
personalProgressStatus.setHandOutDate((Time) list.get(11));
personalProgressStatus.setSignInDate((Time) list.get(12));
// for (int j=0;j<list.size();j++){
// System.out.println();
// }
}
return true;
}
/**
* 导入个人邮寄异常信息
*/
@RequestMapping("ReadPPA")
public boolean ReadPersonPostAbnormal()throws Exception{
ReadExcel obj = new ReadExcel();
PersonPostAbnormalEntity personPostAbnormal = new PersonPostAbnormalEntity();
File file = new File("E:/北京制证项目/person_post_abnormal.xls");
List excelList = obj.readExcel(file);
for (int i = 0; i < excelList.size(); i++){
List list = (List) excelList.get(i);
personPostAbnormal.setBackWaybillNumber((String) list.get(0));
personPostAbnormal.setOrderNumber((String) list.get(1));
personPostAbnormal.setCreateDate((Time) list.get(2));
personPostAbnormal.setOpenid((String) list.get(3));
personPostAbnormal.setWcPlayOrderNumber((String) list.get(4));
personPostAbnormal.setPlayState((String) list.get(5));
personPostAbnormal.setOrderState((String) list.get(6));
personPostAbnormal.setApplicantName((String) list.get(7));
personPostAbnormal.setSenderName((String) list.get(8));
personPostAbnormal.setSenderPhone((String) list.get(9));
personPostAbnormal.setSenderAddress((String) list.get(10));
personPostAbnormal.setRecipientName((String) list.get(11));
personPostAbnormal.setRecipientPhone((String) list.get(12));
personPostAbnormal.setRecipientAddress((String) list.get(13));
personPostAbnormal.setOrderBlankNumber((String) list.get(14));
personPostAbnormal.setGetToProvince((String) list.get(15));
personPostAbnormal.setGetToCity((String) list.get(16));
personPostAbnormal.setGetToCounty((String) list.get(17));
personPostAbnormal.setBusinessType((String) list.get(18));
personPostAbnormal.setLatticeMouthInformation((String) list.get(19));
personPostAbnormal.setNatureOfTheInternal((String) list.get(20));
personPostAbnormal.setNatureOfTheInformation((String) list.get(21));
personPostAbnormal.setFirstWhite((String) list.get(22));
personPostAbnormal.setErrCode((String) list.get(23));
}
return true;
}
/**
* 导入身份证详单
*/
@RequestMapping("ReadCDL")
public boolean ReadCardDetailList()throws Exception{
ReadExcel obj = new ReadExcel();
CardDetailedListEntity cardDetailedList = new CardDetailedListEntity();
File file = new File("E:/北京制证项目/Card_Detail_List.xls");
List excelList = obj.readExcel(file);
for (int i=0;i<excelList.size();i++){
List list = (List) excelList.get(i);
cardDetailedList.setPolistListId((String) list.get(0));
cardDetailedList.setUploadNo((String) list.get(1));
cardDetailedList.setNote((String) list.get(2));
cardDetailedList.setFileName((String) list.get(3));
cardDetailedList.setPoliceCode((String) list.get(4));
}
return true;
}
/**
* 导入个人信息表
*/
@RequestMapping("ReadPersonPost")
public boolean ReadPersomPost()throws Exception{
ReadExcel obj = new ReadExcel();
PersonPostEntity personPost = new PersonPostEntity();
File file = new File("E:/北京制证项目/Person_Post.xls");
List excelList = obj.readExcel(file);
for (int i=0;i<excelList.size();i++){
List list = (List) excelList.get(i);
personPost.setBackWaybillNumber((String) list.get(0));
personPost.setOrderNumber((String) list.get(1));
personPost.setCreateDate((Time) list.get(2));
personPost.setOpenid((String) list.get(3));
personPost.setWcPlayOrderNumber((String) list.get(4));
personPost.setPlayState((String) list.get(5));
personPost.setOrderState((String) list.get(6));
personPost.setApplicantName((String) list.get(7));
personPost.setSenderName((String) list.get(8));
personPost.setSenderPhone((String) list.get(9));
personPost.setSenderAddress((String) list.get(10));
personPost.setRecipientName((String) list.get(11));
personPost.setRecipientPhone((String) list.get(12));
personPost.setRecipientAddress((String) list.get(13));
personPost.setOrderBlankNumber((String) list.get(14));
personPost.setGetToProvince((String) list.get(15));
personPost.setGetToCity((String) list.get(16));
personPost.setGetToCounty((String) list.get(17));
personPost.setBusinessType((String) list.get(18));
personPost.setLatticeMouthInformation((String) list.get(19));
personPost.setNatureOfTheInternal((String) list.get(20));
personPost.setLatticeMouthInformation((String) list.get(21));
personPost.setFirstWhite((String) list.get(22));
}
return true;
}
/**
* 导入临时证信息
*/
@RequestMapping("ReadTemporaryCertificate")
public boolean ReadTemporaryCertificate()throws Exception{
ReadExcel obj = new ReadExcel();
TemporaryCertificateEntity temporaryCertificate = new TemporaryCertificateEntity();
File file = new File("E:/北京制证项目/Temporary_Certificate.xls");
List excelList = obj.readExcel(file);
for (int i=0;i<excelList.size();i++) {
List list = (List) excelList.get(i);
temporaryCertificate.setName((String) list.get(0));
temporaryCertificate.setCardId((String) list.get(1));
temporaryCertificate.setPhone((String) list.get(2));
temporaryCertificate.setLastDurationOfStatus((String) list.get(3));
temporaryCertificate.setReceiptDate((String) list.get(4));
temporaryCertificate.setDateOfHandOverToTreat((String) list.get(5));
temporaryCertificate.setBackWorkshopDate((String) list.get(6));
temporaryCertificate.setDeliverToParty((String) list.get(7));
temporaryCertificate.setNote((String) list.get(8));
}
return true;
}
/**
* 导入重做证件信息
*/
@RequestMapping("ReadRedoRegistration")
public boolean ReadRedoRegistration()throws Exception{
ReadExcel obj = new ReadExcel();
RedoRegistrationEntity redoRegistration = new RedoRegistrationEntity();
File file = new File("E:/北京制证项目/Read_Redo_Registration.xls");
List excelList = obj.readExcel(file);
for (int i=0;i<excelList.size();i++) {
List list = (List) excelList.get(i);
redoRegistration.setRedoRegistrationId((String) list.get(0));
redoRegistration.setSubmitDate((String) list.get(1));
redoRegistration.setCountyCode((String) list.get(2));
redoRegistration.setPoliceCode((String) list.get(3));
redoRegistration.setName((String) list.get(4));
redoRegistration.setCardId((String) list.get(5));
redoRegistration.setRedoReason((String) list.get(6));
redoRegistration.setCallDate((String) list.get(7));
redoRegistration.setBackDate((String) list.get(8));
redoRegistration.setNote((String) list.get(9));
}
return true;
}
}
......@@ -10,16 +10,16 @@ public class PersonalProgressStatusEntity {
private String uploadNo;
private Long progressStatus;
private String note;
private Time importDate;
private Time column1;
private Time column2;
private Time column3;
private Time column4;
private Time column5;
private Time column6;
private Time column7;
private Time column8;
private Time column9;
private String importDate;
private Time createTaskDate;
private Time dataCheckDate;
private Time filmPrintDate;
private Time positionDate;
private Time sortDate;
private Time qualityTestDate;
private Time outStorageDate;
private Time handOutDate;
private Time signInDate;
@Id
@Column(name = "UPLOAD_NO")
......@@ -53,102 +53,102 @@ public class PersonalProgressStatusEntity {
@Basic
@Column(name = "IMPORT_DATE")
public Time getImportDate() {
public String getImportDate() {
return importDate;
}
public void setImportDate(Time importDate) {
public void setImportDate(String importDate) {
this.importDate = importDate;
}
@Basic
@Column(name = "COLUMN1")
public Time getColumn1() {
return column1;
@Column(name = "CREATE_TASK_DATE")
public Time getCreateTaskDate() {
return createTaskDate;
}
public void setColumn1(Time column1) {
this.column1 = column1;
public void setCreateTaskDate(Time createTaskDate) {
this.createTaskDate = createTaskDate;
}
@Basic
@Column(name = "COLUMN2")
public Time getColumn2() {
return column2;
@Column(name = "DATA_CHECK_DATE")
public Time getDataCheckDate() {
return dataCheckDate;
}
public void setColumn2(Time column2) {
this.column2 = column2;
public void setDataCheckDate(Time dataCheckDate) {
this.dataCheckDate = dataCheckDate;
}
@Basic
@Column(name = "COLUMN3")
public Time getColumn3() {
return column3;
@Column(name = "FILM_PRINT_DATE")
public Time getFilmPrintDate() {
return filmPrintDate;
}
public void setColumn3(Time column3) {
this.column3 = column3;
public void setFilmPrintDate(Time filmPrintDate) {
this.filmPrintDate = filmPrintDate;
}
@Basic
@Column(name = "COLUMN4")
public Time getColumn4() {
return column4;
@Column(name = "POSITION_DATE")
public Time getPositionDate() {
return positionDate;
}
public void setColumn4(Time column4) {
this.column4 = column4;
public void setPositionDate(Time positionDate) {
this.positionDate = positionDate;
}
@Basic
@Column(name = "COLUMN5")
public Time getColumn5() {
return column5;
@Column(name = "SORT_DATE")
public Time getSortDate() {
return sortDate;
}
public void setColumn5(Time column5) {
this.column5 = column5;
public void setSortDate(Time sortDate) {
this.sortDate = sortDate;
}
@Basic
@Column(name = "COLUMN6")
public Time getColumn6() {
return column6;
@Column(name = "QUALITY_TEST_DATE")
public Time getQualityTestDate() {
return qualityTestDate;
}
public void setColumn6(Time column6) {
this.column6 = column6;
public void setQualityTestDate(Time qualityTestDate) {
this.qualityTestDate = qualityTestDate;
}
@Basic
@Column(name = "COLUMN7")
public Time getColumn7() {
return column7;
@Column(name = "OUT_STORAGE_DATE")
public Time getOutStorageDate() {
return outStorageDate;
}
public void setColumn7(Time column7) {
this.column7 = column7;
public void setOutStorageDate(Time outStorageDate) {
this.outStorageDate = outStorageDate;
}
@Basic
@Column(name = "COLUMN8")
public Time getColumn8() {
return column8;
@Column(name = "HAND_OUT_DATE")
public Time getHandOutDate() {
return handOutDate;
}
public void setColumn8(Time column8) {
this.column8 = column8;
public void setHandOutDate(Time handOutDate) {
this.handOutDate = handOutDate;
}
@Basic
@Column(name = "COLUMN9")
public Time getColumn9() {
return column9;
@Column(name = "SIGN_IN_DATE")
public Time getSignInDate() {
return signInDate;
}
public void setColumn9(Time column9) {
this.column9 = column9;
public void setSignInDate(Time signInDate) {
this.signInDate = signInDate;
}
@Override
......@@ -160,19 +160,19 @@ public class PersonalProgressStatusEntity {
Objects.equals(progressStatus, that.progressStatus) &&
Objects.equals(note, that.note) &&
Objects.equals(importDate, that.importDate) &&
Objects.equals(column1, that.column1) &&
Objects.equals(column2, that.column2) &&
Objects.equals(column3, that.column3) &&
Objects.equals(column4, that.column4) &&
Objects.equals(column5, that.column5) &&
Objects.equals(column6, that.column6) &&
Objects.equals(column7, that.column7) &&
Objects.equals(column8, that.column8) &&
Objects.equals(column9, that.column9);
Objects.equals(createTaskDate, that.createTaskDate) &&
Objects.equals(dataCheckDate, that.dataCheckDate) &&
Objects.equals(filmPrintDate, that.filmPrintDate) &&
Objects.equals(positionDate, that.positionDate) &&
Objects.equals(sortDate, that.sortDate) &&
Objects.equals(qualityTestDate, that.qualityTestDate) &&
Objects.equals(outStorageDate, that.outStorageDate) &&
Objects.equals(handOutDate, that.handOutDate) &&
Objects.equals(signInDate, that.signInDate);
}
@Override
public int hashCode() {
return Objects.hash(uploadNo, progressStatus, note, importDate, column1, column2, column3, column4, column5, column6, column7, column8, column9);
return Objects.hash(uploadNo, progressStatus, note, importDate, createTaskDate, dataCheckDate, filmPrintDate, positionDate, sortDate, qualityTestDate, outStorageDate, handOutDate, signInDate);
}
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.CardDetailedListEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import java.util.List;
@Mapper
public interface CardDetailedListMapper {
@Update("update CARD_DETAILED_LIST set CARD_DETAILED_LIST_ID = #{cardDetailedListId},POLIST_LIST_ID = #{polistListId},UPLOAD_NO =#{uploadNo},NOTE =#{note},FILE_NAME =#{fileName},POLICE_CODE =#{policeCode}")
public void updateCardDetailedList(List<CardDetailedListEntity> cardDetailedList);
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.PersonPostAbnormalEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import java.util.List;
@Mapper
public interface PersonPostAbnormalMapper {
@Update("update PERSON_POST_ABNORMAL set WAYBILL_NUMBER=#{waybillNumber},BACK_WAYBILL_NUMBER=#{backWaybillNumber},ORDER_NUMBER=#{orderNumber},CREATE_DATE=#{createDate},OPENID=#{openid},WC_PLAY_ORDER_NUMBER=#{wcPlayOrderNumber},PLAY_STATE=#{playState},ORDER_STATE=#{orderState},,APPLICANT_NAME=#{applicantName},SENDER_NAME=#{senderName},SENDER_PHONE=#{senderPhone},SENDER_ADDRESS=#{senderAddress},RECIPIENT_NAME=#{recipientName},RECIPIENT_PHONE=#{recipientPhone},RECIPIENT_ADDRESS=#{recipientAddress},ORDER_BLANK_NUMBER=#{orderBlankNumber},GET_TO_PROVINCE=#{getToProvince},GET_TO_CITY=#{getToCity},GET_TO_COUNTY=#{getToCounty},BUSINESS_TYPE=#{businessType},LATTICE_MOUTH_INFORMATION=#{latticeMouthInformation},NATURE_OF_THE_INTERNAL=#{natureOfTheInternal},NATURE_OF_THE_INFORMATION=#{natureOfTheInformation},FIRST_WHITE=#{firstWhite},ERR_CODE=#{errCode}")
public void updatePersonPostAbnormal(List<PersonPostAbnormalEntity> personPostAbnormal);
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.CardDetailedListEntity;
import com.yxproject.start.entity.PersonPostEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import java.util.List;
@Mapper
public interface PersonPostMapper {
@Update("update PERSON_POST set WAYBILL_NUMBER=#{waybillNumber},BACK_WAYBILL_NUMBER=#{backWaybillNumber},ORDER_NUMBER=#{orderNumber},CREATE_DATE=#{createDate},OPENID=#{openid},WC_PLAY_ORDER_NUMBER=#{wcPlayOrderNumber},PLAY_STATE=#{playState},ORDER_STATE=#{orderState},APPLICANT_NAME=#{applicantName},SENDER_NAME=#{senderName},SENDER_PHONE=#{senderPhone},SENDER_ADDRESS=#{senderAddress},RECIPIENT_NAME=#{recipientName},RECIPIENT_PHONE=#{recipientPhone},RECIPIENT_ADDRESS=#{recipientAddress},ORDER_BLANK_NUMBER=#{orderBlankNumber},GET_TO_PROVINCE=#{getToProvince},GET_TO_CITY=#{getToCity},GET_TO_COUNTY=,#{getToCounty},BUSINESS_TYPE=#{businessType},LATTICE_MOUTH_INFORMATION=#{latticeMouthInformation},NATURE_OF_THE_INTERNAL=#{natureOfTheInternal},NATURE_OF_THE_INFORMATION=#{natureOfTheInformation},FIRST_WHITE=#{firstWhite}")
public void updatePersonPost(List<PersonPostEntity> personPost);
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.PersonalProgressStatusEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import java.util.List;
@Mapper
public interface PersonalProgressStatusMapper {
@Update("update PERSONAL_PROGRESS_STATUS set UPLOAD_NO =#{uploadNo},PROGRESS_STATUS=#{progressStatus},NOTE=#{note},IMPORT_DATE=#{importDate},CREATE_TASK_DATE=#{create_Task_Date},DATA_CHECK_DATE=#{data_Check_Date},FILM_PRINT_DATE=#{film_Print_Date},POSITION_DATE=#{position_Date},SORT_DATE=#{sort_Date},QUALITY_TEST_DATE=#{quality_Test_Date},OUT_STORAGE_DATE=#{out_Storage_Date},HAND_OUT_DATE=#{hand_Out_Date},SIGN_IN_DATE=#{sign_In_Date}")
public void updatePersonalProgressStatus(List<PersonalProgressStatusEntity> personalProgressStatus);
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.RedoRegistrationEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
@Mapper
public interface RedoRegistrationMapper {
@Update("update REDO_REGISTRATION set REDO_REGISTRATION_ID=#{redoRegistrationId},SUBMIT_DATE=#{submitDate},COUNTY_CODE=#{countyCode},POLICE_CODE=#{countyCode},POLICE_CODE=#{policeCode},NAME=#{name},CARD_ID=#{cardId},REDO_REASON=#{redoReason},CALL_DATE=#{callDate},BACK_DATE=#{backDate},NOTE=#{note}")
public void updateRedoRegistration(List<RedoRegistrationEntity> redoRegistration);
@Select("select * from REDO_REGISTRATION ")
public List<RedoRegistrationEntity> selectRedoRegistration();
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.TemporaryCertificateEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
@Mapper
public interface TemporaryCertificateMapper {
@Update("update TEMPORARY_CERTIFICATE set TEMPORARY_CERTIFICATE_ID=#{temporaryCertificateId},NAME=#{name},CARD_ID=#{cardId},PHONE=#{phone},LAST_DURATION_OF_STATUS=#{lastDurationOfStatus},RECEIPT_DATE=#{receiptDate},DATE_OF_HAND_OVER_TO_TREAT=#{dateOfHandOverToTreat},BACK_WORKSHOP_DATE=#{backWorkshopDate},DELIVER_TO_PARTY=#{deliverToParty},NOTE=#{note}")
public void updateTemporaryCertificate(List<TemporaryCertificateEntity> TemporaryCertificate);
@Select("select * from TEMPORARY_CERTIFICATE ")
public List<TemporaryCertificateEntity> selectTemporaryCertificate();
}
package com.yxproject.start.service;
import com.yxproject.start.entity.CardDetailedListEntity;
import java.util.List;
/**
* 导入身份证详单
*/
public interface CardDetailedListService {
public boolean updateCardDetailedList(List<CardDetailedListEntity> cardDetailedListEntities);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.PersonPostAbnormalEntity;
import java.util.List;
/**
* 导入个人邮寄异常信息
*/
public interface PersonPostAbnormalService {
public boolean updatePersonPostAbnormal(List<PersonPostAbnormalEntity> personPostAbnormalEntities);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.PersonPostEntity;
import java.util.List;
/**
* 导入个人信息表
*/
public interface PersonPostService {
public boolean updatePersonPost(List<PersonPostEntity> personPostEntities);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.PersonalProgressStatusEntity;
import java.util.List;
/**
* 导入个人制证进度状态表
*/
public interface PersonalProgressStatusService {
public boolean updatePersonalProgressStatus(List<PersonalProgressStatusEntity> personalProgressStatusEntities);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.CardDetailedListEntity;
import com.yxproject.start.entity.RedoRegistrationEntity;
import java.util.List;
public interface RedoRegistrationService {
/**
* 导入重做证件信息
*/
public boolean updateRedoRegistration(List<RedoRegistrationEntity> redoRegistrationEntities);
/**
* 导出重做证件信息
*/
public List<RedoRegistrationEntity> selectRedoRegistration();
}
package com.yxproject.start.service;
import com.yxproject.start.entity.RedoRegistrationEntity;
import com.yxproject.start.entity.TemporaryCertificateEntity;
import java.util.List;
public interface TemporaryCertificateService {
/**
* 导入临时证信息
*/
public boolean updateTemporaryCertificate(List<TemporaryCertificateEntity> temporaryCertificateEntities);
/**
* 导出临时证信息
*/
public List<TemporaryCertificateEntity> selectTemporaryCertificate();
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.CardDetailedListEntity;
import com.yxproject.start.mapper.CardDetailedListMapper;
import com.yxproject.start.service.CardDetailedListService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class CardDetialedListServiceImpl implements CardDetailedListService {
@Autowired
private CardDetailedListMapper cardDetailedListMapper;
@Override
public boolean updateCardDetailedList(List<CardDetailedListEntity> cardDetailedListEntities) {
cardDetailedListMapper.updateCardDetailedList(cardDetailedListEntities);
return true;
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.PersonPostAbnormalEntity;
import com.yxproject.start.mapper.PersonPostAbnormalMapper;
import com.yxproject.start.service.PersonPostAbnormalService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class PersonPostAbnormalServiceImpl implements PersonPostAbnormalService {
@Autowired
private PersonPostAbnormalMapper personPostAbnormalMapper;
@Override
public boolean updatePersonPostAbnormal(List<PersonPostAbnormalEntity> personPostAbnormalEntities) {
personPostAbnormalMapper.updatePersonPostAbnormal(personPostAbnormalEntities);
return true;
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.PersonPostEntity;
import com.yxproject.start.mapper.PersonPostMapper;
import com.yxproject.start.service.PersonPostService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class PersonPostServiceImpl implements PersonPostService {
@Autowired
private PersonPostMapper personPostMapper;
@Override
public boolean updatePersonPost(List<PersonPostEntity> personPostEntities) {
personPostMapper.updatePersonPost(personPostEntities);
return true;
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.PersonalProgressStatusEntity;
import com.yxproject.start.mapper.PersonalProgressStatusMapper;
import com.yxproject.start.service.PersonalProgressStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class PersonalProgressStatusServiceImpl implements PersonalProgressStatusService {
@Autowired
private PersonalProgressStatusMapper personalProgressStatusMapper;
@Override
public boolean updatePersonalProgressStatus(List<PersonalProgressStatusEntity> personalProgressStatusEntities) {
personalProgressStatusMapper.updatePersonalProgressStatus(personalProgressStatusEntities);
return true;
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.RedoRegistrationEntity;
import com.yxproject.start.mapper.RedoRegistrationMapper;
import com.yxproject.start.service.RedoRegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class RedoRegistrationServiceImpl implements RedoRegistrationService {
@Autowired
private RedoRegistrationMapper redoRegistrationMapper;
@Override
public boolean updateRedoRegistration(List<RedoRegistrationEntity> redoRegistrationEntities) {
redoRegistrationMapper.updateRedoRegistration(redoRegistrationEntities);
return false;
}
@Override
public List<RedoRegistrationEntity> selectRedoRegistration() {
List<RedoRegistrationEntity> list = redoRegistrationMapper.selectRedoRegistration();
return list;
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.TemporaryCertificateEntity;
import com.yxproject.start.mapper.TemporaryCertificateMapper;
import com.yxproject.start.service.TemporaryCertificateService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class TemporaryCertificateServiceImpl implements TemporaryCertificateService {
@Autowired
private TemporaryCertificateMapper temporaryCertificateMapper;
@Override
public boolean updateTemporaryCertificate(List<TemporaryCertificateEntity> temporaryCertificateEntities) {
temporaryCertificateMapper.updateTemporaryCertificate(temporaryCertificateEntities);
return true;
}
@Override
public List<TemporaryCertificateEntity> selectTemporaryCertificate() {
List<TemporaryCertificateEntity> list = temporaryCertificateMapper.selectTemporaryCertificate();
return list;
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package com.yxproject.start.utils;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import java.io.InputStream;
public class MybatisUtils {
public static SqlSessionFactory getFactory(){
String resource="conf.xml";
//加载mybatis 的配置文件(它也加载关联的映射文件)
InputStream is=MybatisUtils.class.getClassLoader().getResourceAsStream(resource);
//构建sqlSession 的工厂
SqlSessionFactory factory=new SqlSessionFactoryBuilder().build(is);
return factory;
}
}
package com.yxproject.start.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
/**
* Created by zhangyusheng on 2019/1/30 14:39
*/
public class ReadExcel {
public static void main(String[] args) {
ReadExcel obj = new ReadExcel();
// 此处为我创建Excel路径:E:/zhanhj/studysrc/jxl下
File file = new File("E:/北京制证项目/personal_progress_status.xls");
List excelList = obj.readExcel(file);
System.out.println("list中的数据打印出来");
for (int i = 0; i < excelList.size(); i++) {
System.out.println("第"+i+"行:"+excelList.get(i));
List list = (List) excelList.get(i);
for (int j = 0; j < list.size(); j++) {
// System.out.print(list.get(j));
}
}
}
// 去读Excel的方法readExcel,该方法的入口参数为一个File对象
public List readExcel(File file) {
try {
// 创建输入流,读取Excel
InputStream is = new FileInputStream(file.getAbsolutePath());
// jxl提供的Workbook类
Workbook wb = Workbook.getWorkbook(is);
// Excel的页签数量
int sheet_size = wb.getNumberOfSheets();
for (int index = 0; index < sheet_size; index++) {
List<List> outerList=new ArrayList<List>();
// 每个页签创建一个Sheet对象
Sheet sheet = wb.getSheet(index);
// sheet.getRows()返回该页的总行数
for (int i = 0; i < sheet.getRows(); i++) {
List innerList=new ArrayList();
// sheet.getColumns()返回该页的总列数
for (int j = 0; j < sheet.getColumns(); j++) {
String cellinfo = sheet.getCell(j, i).getContents();
if(cellinfo.isEmpty()){
continue;
}
innerList.add(cellinfo);
}
outerList.add(i, innerList);
}
return outerList;
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (BiffException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
......@@ -4,9 +4,9 @@ server:
spring:
datasource:
driver-class-name: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@192.168.10.234:1521:ACCU
username: preprocess
password: preprocess
url: jdbc:oracle:thin:@192.168.10.234:1521:PRODU
username: post
password: post
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment