diff --git a/download/.classpath b/download/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..a3508c6223eb94d8419fb693a55aa287b1d770f2 --- /dev/null +++ b/download/.classpath @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/download/.project b/download/.project new file mode 100644 index 0000000000000000000000000000000000000000..2ddf0b4170ec616c836a5dc77dfe8dc0f3740581 --- /dev/null +++ b/download/.project @@ -0,0 +1,23 @@ + + + download + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/download/.settings/org.eclipse.jdt.core.prefs b/download/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..0e49574ea05138a7c70e1f77194d64f1f8715d54 --- /dev/null +++ b/download/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/download/.settings/org.eclipse.m2e.core.prefs b/download/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..f897a7f1cb2389f85fe6381425d29f0a9866fb65 --- /dev/null +++ b/download/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/download/pom.xml b/download/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..bf4518acd3170cc76467ef7ec4d82abb869de694 --- /dev/null +++ b/download/pom.xml @@ -0,0 +1,109 @@ + + + 4.0.0 + + download + download + 1.0-SNAPSHOT + + + + + + + org.mybatis + mybatis + 3.3.0 + + + + mysql + mysql-connector-java + 5.1.29 + + + + junit + junit + 4.12 + + + log4j + log4j + 1.2.17 + + + + org.apache.commons + commons-lang3 + 3.5 + + + org.apache.poi + poi-scratchpad + 3.11-beta2 + + + org.apache.poi + poi-ooxml + 3.11-beta2 + + + org.apache.poi + poi-ooxml-schemas + 3.11-beta2 + + + org.apache.poi + poi-excelant + 3.11-beta2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + src/main/resources + + **/*.* + + + + + + \ No newline at end of file diff --git a/download/src/main/java/com/sict/excel/bo/AnalysisGraphicBO.java b/download/src/main/java/com/sict/excel/bo/AnalysisGraphicBO.java new file mode 100644 index 0000000000000000000000000000000000000000..c565e8337b697d86122d4325612c88e766282b45 --- /dev/null +++ b/download/src/main/java/com/sict/excel/bo/AnalysisGraphicBO.java @@ -0,0 +1,32 @@ +package com.sict.excel.bo; + +public class AnalysisGraphicBO { + + + private String item; + private Integer number; + private String remark; + public String getItem() { + return item; + } + public void setItem(String item) { + this.item = item; + } + public Integer getNumber() { + return number; + } + public void setNumber(Integer number) { + this.number = number; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + + @Override + public String toString() { + return "AnalysisGraphic [item=" + item + ", number=" + number + ", remark=" + remark + "]"; + } +} diff --git a/download/src/main/java/com/sict/excel/dto/AnalysisGraphicDTO.java b/download/src/main/java/com/sict/excel/dto/AnalysisGraphicDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..a4420573df4f03550b14e90bca807179b6854936 --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/AnalysisGraphicDTO.java @@ -0,0 +1,41 @@ +package com.sict.excel.dto; + +public class AnalysisGraphicDTO { + + private Integer applyGastricCancerScreeningHosp; + private Integer passApplyHosp; + private Integer platAccountApplyHosp; + private Integer openAccountHosp; + + public Integer getApplyGastricCancerScreeningHosp() { + return null; + } + public void setApplyGastricCancerScreeningHosp(Integer applyGastricCancerScreeningHosp) { + this.applyGastricCancerScreeningHosp = applyGastricCancerScreeningHosp; + } + public Integer getPassApplyHosp() { + return passApplyHosp; + } + public void setPassApplyHosp(Integer passApplyHosp) { + this.passApplyHosp = passApplyHosp; + } + public Integer getPlatAccountApplyHosp() { + return null; + } + public void setPlatAccountApplyHosp(Integer platAccountApplyHosp) { + this.platAccountApplyHosp = platAccountApplyHosp; + } + public Integer getOpenAccountHosp() { + return openAccountHosp; + } + public void setOpenAccountHosp(Integer openAccountHosp) { + this.openAccountHosp = openAccountHosp; + } + @Override + public String toString() { + return "AnalysisGraphicDTO [applyGastricCancerScreeningHosp=" + applyGastricCancerScreeningHosp + + ", passApplyHosp=" + passApplyHosp + ", platAccountApplyHosp=" + platAccountApplyHosp + + ", openAccountHosp=" + openAccountHosp + "]"; + } + +} diff --git a/download/src/main/java/com/sict/excel/dto/AnalysisProvinceDTO.java b/download/src/main/java/com/sict/excel/dto/AnalysisProvinceDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..879a7a027b8c996505259cec0d9b9aac10627c5f --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/AnalysisProvinceDTO.java @@ -0,0 +1,69 @@ +package com.sict.excel.dto; + +public class AnalysisProvinceDTO { + + private String province; + private String applyHosp; + private String openAccountHosp; + private String applyAccountHosp; + private String passApplyHosp; + private String platAccountApplyHosp; + private String provinceScreeningTotal; + private String earlyCancer; + public String getProvince() { + return province; + } + public void setProvince(String province) { + this.province = province; + } + public String getApplyHosp() { + return null; + } + public void setApplyHosp(String applyHosp) { + this.applyHosp = applyHosp; + } + public String getOpenAccountHosp() { + return openAccountHosp; + } + public void setOpenAccountHosp(String openAccountHosp) { + this.openAccountHosp = openAccountHosp; + } + public String getApplyAccountHosp() { + return null; + } + public void setApplyAccountHosp(String applyAccountHosp) { + this.applyAccountHosp = applyAccountHosp; + } + public String getPassApplyHosp() { + return passApplyHosp; + } + public void setPassApplyHosp(String passApplyHosp) { + this.passApplyHosp = passApplyHosp; + } + public String getPlatAccountApplyHosp() { + return null; + } + public void setPlatAccountApplyHosp(String platAccountApplyHosp) { + this.platAccountApplyHosp = platAccountApplyHosp; + } + public String getProvinceScreeningTotal() { + return provinceScreeningTotal; + } + public void setProvinceScreeningTotal(String provinceScreeningTotal) { + this.provinceScreeningTotal = provinceScreeningTotal; + } + public String getEarlyCancer() { + return earlyCancer; + } + public void setEarlyCancer(String earlyCancer) { + this.earlyCancer = earlyCancer; + } + @Override + public String toString() { + return "AnalysisProvinceDTO [province=" + province + ", applyHosp=" + applyHosp + ", openAccountHosp=" + + openAccountHosp + ", applyAccountHosp=" + applyAccountHosp + ", passApplyHosp=" + passApplyHosp + + ", platAccountApplyHosp=" + platAccountApplyHosp + ", provinceScreeningTotal=" + + provinceScreeningTotal + ", earlyCancer=" + earlyCancer + "]"; + } + +} diff --git a/download/src/main/java/com/sict/excel/dto/DiagnosisDTO.java b/download/src/main/java/com/sict/excel/dto/DiagnosisDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..888bbedde110f42d52459241878005a6bfec9d8e --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/DiagnosisDTO.java @@ -0,0 +1,107 @@ +package com.sict.excel.dto; + +public class DiagnosisDTO { + + private Integer higeLevel; + private Integer highEsophageal; + private Integer highStomach; + private Integer lowLevel; + private Integer lowEsophageal; + private Integer lowStomach; + private Integer earlyGastricCancer; + private Integer advancedGastricCancer; + private Integer earlyEsophagealCancer; + private Integer advancedEsophagealCancer; + private Integer atrophicGastritis; + private Integer gastricUlcer; + private Integer gastricPolyps; + public Integer getHigeLevel() { + return higeLevel; + } + public void setHigeLevel(Integer higeLevel) { + this.higeLevel = higeLevel; + } + public Integer getHighEsophageal() { + return highEsophageal; + } + public void setHighEsophageal(Integer highEsophageal) { + this.highEsophageal = highEsophageal; + } + public Integer getHighStomach() { + return highStomach; + } + public void setHighStomach(Integer highStomach) { + this.highStomach = highStomach; + } + public Integer getLowLevel() { + return lowLevel; + } + public void setLowLevel(Integer lowLevel) { + this.lowLevel = lowLevel; + } + public Integer getLowEsophageal() { + return lowEsophageal; + } + public void setLowEsophageal(Integer lowEsophageal) { + this.lowEsophageal = lowEsophageal; + } + public Integer getLowStomach() { + return lowStomach; + } + public void setLowStomach(Integer lowStomach) { + this.lowStomach = lowStomach; + } + public Integer getEarlyGastricCancer() { + return earlyGastricCancer; + } + public void setEarlyGastricCancer(Integer earlyGastricCancer) { + this.earlyGastricCancer = earlyGastricCancer; + } + public Integer getAdvancedGastricCancer() { + return advancedGastricCancer; + } + public void setAdvancedGastricCancer(Integer advancedGastricCancer) { + this.advancedGastricCancer = advancedGastricCancer; + } + public Integer getEarlyEsophagealCancer() { + return earlyEsophagealCancer; + } + public void setEarlyEsophagealCancer(Integer earlyEsophagealCancer) { + this.earlyEsophagealCancer = earlyEsophagealCancer; + } + public Integer getAdvancedEsophagealCancer() { + return advancedEsophagealCancer; + } + public void setAdvancedEsophagealCancer(Integer advancedEsophagealCancer) { + this.advancedEsophagealCancer = advancedEsophagealCancer; + } + public Integer getAtrophicGastritis() { + return atrophicGastritis; + } + public void setAtrophicGastritis(Integer atrophicGastritis) { + this.atrophicGastritis = atrophicGastritis; + } + public Integer getGastricUlcer() { + return gastricUlcer; + } + public void setGastricUlcer(Integer gastricUlcer) { + this.gastricUlcer = gastricUlcer; + } + public Integer getGastricPolyps() { + return gastricPolyps; + } + public void setGastricPolyps(Integer gastricPolyps) { + this.gastricPolyps = gastricPolyps; + } + @Override + public String toString() { + return "DiagnosisDTO [higeLevel=" + higeLevel + ", highEsophageal=" + highEsophageal + ", highStomach=" + + highStomach + ", lowLevel=" + lowLevel + ", lowEsophageal=" + lowEsophageal + ", lowStomach=" + + lowStomach + ", earlyGastricCancer=" + earlyGastricCancer + ", advancedGastricCancer=" + + advancedGastricCancer + ", earlyEsophagealCancer=" + earlyEsophagealCancer + + ", advancedEsophagealCancer=" + advancedEsophagealCancer + ", atrophicGastritis=" + atrophicGastritis + + ", gastricUlcer=" + gastricUlcer + ", gastricPolyps=" + gastricPolyps + "]"; + } + + +} diff --git a/download/src/main/java/com/sict/excel/dto/EarlyCancerHospitalDTO.java b/download/src/main/java/com/sict/excel/dto/EarlyCancerHospitalDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..3ffe592c0115e26cf236506188a18c5335d3837b --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/EarlyCancerHospitalDTO.java @@ -0,0 +1,103 @@ +package com.sict.excel.dto; + +public class EarlyCancerHospitalDTO { + private Integer id; + private String hospname; + private String province; + private Integer total; + private Integer highEsophagealNeoplasia; + private Integer earlyEsophagealCancer; + private Integer advancedEsophagealCancer; + private Integer highGastricNeoplasia; + private Integer earlyGastricCancer; + private Integer advancedGastricCancer; + + public Integer getId() { + return id; + } + public void setId(Integer id) { + this.id = id; + } + public String getHospname() { + return hospname; + } + public void setHospname(String hospname) { + this.hospname = hospname; + } + public String getProvince() { + return province; + } + public void setProvince(String province) { + this.province = province; + } + public Integer getTotal() { + return total; + } + public void setTotal(Integer total) { + this.total = total; + } + public Integer getHighEsophagealNeoplasia() { + if (highEsophagealNeoplasia==0) { + return null; + } + return highEsophagealNeoplasia; + } + public void setHighEsophagealNeoplasia(Integer highEsophagealNeoplasia) { + this.highEsophagealNeoplasia = highEsophagealNeoplasia; + } + public Integer getEarlyEsophagealCancer() { + if (earlyEsophagealCancer==0) { + return null; + } + return earlyEsophagealCancer; + } + public void setEarlyEsophagealCancer(Integer earlyEsophagealCancer) { + this.earlyEsophagealCancer = earlyEsophagealCancer; + } + public Integer getAdvancedEsophagealCancer() { + if (advancedEsophagealCancer==0) { + return null; + } + return advancedEsophagealCancer; + } + public void setAdvancedEsophagealCancer(Integer advancedEsophagealCancer) { + this.advancedEsophagealCancer = advancedEsophagealCancer; + } + public Integer getHighGastricNeoplasia() { + if (highGastricNeoplasia==0) { + return null; + } + return highGastricNeoplasia; + } + public void setHighGastricNeoplasia(Integer highGastricNeoplasia) { + this.highGastricNeoplasia = highGastricNeoplasia; + } + public Integer getEarlyGastricCancer() { + if (earlyGastricCancer==0) { + return null; + } + return earlyGastricCancer; + } + public void setEarlyGastricCancer(Integer earlyGastricCancer) { + this.earlyGastricCancer = earlyGastricCancer; + } + public Integer getAdvancedGastricCancer() { + if (advancedGastricCancer==0) { + return null; + } + return advancedGastricCancer; + } + public void setAdvancedGastricCancer(Integer advancedGastricCancer) { + this.advancedGastricCancer = advancedGastricCancer; + } + @Override + public String toString() { + return "EarlyCancerHospital [id=" + id + ", hospname=" + hospname + ", province=" + province + ", total=" + + total + ", highEsophagealNeoplasia=" + highEsophagealNeoplasia + ", earlyEsophagealCancer=" + + earlyEsophagealCancer + ", advancedEsophagealCancer=" + advancedEsophagealCancer + + ", highGastricNeoplasia=" + highGastricNeoplasia + ", earlyGastricCancer=" + earlyGastricCancer + + ", advancedGastricCancer=" + advancedGastricCancer + "]"; + } + + +} diff --git a/download/src/main/java/com/sict/excel/dto/EarlyCancerRankDTO.java b/download/src/main/java/com/sict/excel/dto/EarlyCancerRankDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..4086d150e6ed1a8589063797765775c5825b1993 --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/EarlyCancerRankDTO.java @@ -0,0 +1,24 @@ +package com.sict.excel.dto; + +public class EarlyCancerRankDTO { + + private String province; + private Integer ECamount; + public String getProvince() { + return province; + } + public void setProvince(String province) { + this.province = province; + } + public Integer getECamount() { + return ECamount; + } + public void setECamount(Integer eCamount) { + ECamount = eCamount; + } + @Override + public String toString() { + return "EarlyCancerRankDTO [province=" + province + ", ECamount=" + ECamount + "]"; + } + +} diff --git a/download/src/main/java/com/sict/excel/dto/GastroscopeTestDTO.java b/download/src/main/java/com/sict/excel/dto/GastroscopeTestDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..429ce3f34750f4101d621ffc9c61cf2bcec6fbd0 --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/GastroscopeTestDTO.java @@ -0,0 +1,27 @@ +package com.sict.excel.dto; + +public class GastroscopeTestDTO { + + private Integer actualGastroscope; + private Integer planGastroscope; + + public Integer getActualGastroscope() { + return actualGastroscope; + } + public void setActualGastroscope(Integer actualGastroscope) { + this.actualGastroscope = actualGastroscope; + } + + public Integer getPlanGastroscope() { + return planGastroscope; + } + public void setPlanGastroscope(Integer planGastroscope) { + this.planGastroscope = planGastroscope; + } + @Override + public String toString() { + return "GastroscopeTestDTO [actualGastroscope=" + actualGastroscope + ", planGastroscopel=" + planGastroscope + + "]"; + } + +} diff --git a/download/src/main/java/com/sict/excel/dto/HpPositiveDTO.java b/download/src/main/java/com/sict/excel/dto/HpPositiveDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..be8d8fcbcdeedcb1f9fb7ee958f54681edb576f6 --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/HpPositiveDTO.java @@ -0,0 +1,20 @@ +package com.sict.excel.dto; + +public class HpPositiveDTO { + + private Integer HpPositive; + + public Integer getHpPositive() { + return HpPositive; + } + + public void setHpPositive(Integer hpPositive) { + HpPositive = hpPositive; + } + + @Override + public String toString() { + return "HpPositiveDTO [HpPositive=" + HpPositive + "]"; + } + +} diff --git a/download/src/main/java/com/sict/excel/dto/RiskDTO.java b/download/src/main/java/com/sict/excel/dto/RiskDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..4b72d060fbac40e415acab15a411362bb0099ba5 --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/RiskDTO.java @@ -0,0 +1,26 @@ +package com.sict.excel.dto; + +public class RiskDTO { + + private String grade; + private Integer total; + public String getGrade() { + return grade; + } + public void setGrade(String grade) { + this.grade = grade; + } + public Integer getTotal() { + return total; + } + public void setTotal(Integer total) { + this.total = total; + } + @Override + public String toString() { + return "RiskDTO [grade=" + grade + ", total=" + total + "]"; + } + + + +} diff --git a/download/src/main/java/com/sict/excel/dto/ScreeningRankDTO.java b/download/src/main/java/com/sict/excel/dto/ScreeningRankDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..4d4b489ae60a544a3a4f6b00393afa694df17ba0 --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/ScreeningRankDTO.java @@ -0,0 +1,34 @@ +package com.sict.excel.dto; + +public class ScreeningRankDTO { + + + private Integer id; + private String hospname; + private Integer actualserum; + + + public Integer getId() { + return id; + } + public void setId(Integer id) { + this.id = id; + } + public String getHospname() { + return hospname; + } + public void setHospname(String hospname) { + this.hospname = hospname; + } + public Integer getActualserum() { + return actualserum; + } + public void setActualserum(Integer actualserum) { + this.actualserum = actualserum; + } + @Override + public String toString() { + return "ScreeningRankDTO [id=" + id + ", hospname=" + hospname + ", actualserum=" + + actualserum + "]"; + } +} diff --git a/download/src/main/java/com/sict/excel/dto/ScreeningRankProvinceDTO.java b/download/src/main/java/com/sict/excel/dto/ScreeningRankProvinceDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..b1c0aa57c49fce3c73a202c003d64a3bf04f4cad --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/ScreeningRankProvinceDTO.java @@ -0,0 +1,44 @@ +package com.sict.excel.dto; + +public class ScreeningRankProvinceDTO { + + private Integer id; + private String hospname; + private String province; + private Integer actualserum; + + + public Integer getId() { + return id; + } + public void setId(Integer id) { + this.id = id; + } + public String getHospname() { + return hospname; + } + public void setHospname(String hospname) { + this.hospname = hospname; + } + public String getProvince() { + return province; + } + public void setProvince(String province) { + this.province = province; + } + public Integer getActualserum() { + return actualserum; + } + public void setActualserum(Integer actualserum) { + this.actualserum = actualserum; + } + @Override + public String toString() { + return "ScreeningRankDTO [id=" + id + ", hospname=" + hospname + ", province=" + province + ", actualserum=" + + actualserum + "]"; + } + + + + +} diff --git a/download/src/main/java/com/sict/excel/dto/SerumStatisticsDTO.java b/download/src/main/java/com/sict/excel/dto/SerumStatisticsDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..30dd6d19ff671f70097e86b793c05b00b55245ee --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/SerumStatisticsDTO.java @@ -0,0 +1,29 @@ +package com.sict.excel.dto; + +public class SerumStatisticsDTO { + + /** + * 省份血检总人次 + */ + private Integer serumTestTotal; + /** + * 省份HP抗体(IGG)检测阳性总人次 + */ + private Integer iggPositive; + public Integer getSerumTestTotal() { + return serumTestTotal; + } + public void setSerumTestTotal(Integer serumTestTotal) { + this.serumTestTotal = serumTestTotal; + } + public Integer getIggPositive() { + return iggPositive; + } + public void setIggPositive(Integer iggPositive) { + this.iggPositive = iggPositive; + } + @Override + public String toString() { + return "SerumStatisticsDTO [serumTestTotal=" + serumTestTotal + ", iggPositive=" + iggPositive + "]"; + } +} diff --git a/download/src/main/java/com/sict/excel/dto/Student.java b/download/src/main/java/com/sict/excel/dto/Student.java new file mode 100644 index 0000000000000000000000000000000000000000..bf4501261b34619f33b79ff69bd1a802eab65bc9 --- /dev/null +++ b/download/src/main/java/com/sict/excel/dto/Student.java @@ -0,0 +1,43 @@ +package com.sict.excel.dto; + + +/** + * 例子JavaBean + * @author liuyazhuang + * + */ +public class Student { + private int id; + private String name; + private String sex; + + public Student(int id, String name, String sex) { + this.id = id; + this.name = name; + this.sex = sex; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } +} \ No newline at end of file diff --git a/download/src/main/java/com/sict/excel/mapper/DownloadMapper.java b/download/src/main/java/com/sict/excel/mapper/DownloadMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..0b0b88596699932975f2caf9395269f5238ac9bd --- /dev/null +++ b/download/src/main/java/com/sict/excel/mapper/DownloadMapper.java @@ -0,0 +1,86 @@ +package com.sict.excel.mapper; + +import java.util.List; + +import com.sict.excel.dto.AnalysisGraphicDTO; +import com.sict.excel.dto.AnalysisProvinceDTO; +import com.sict.excel.dto.DiagnosisDTO; +import com.sict.excel.dto.EarlyCancerHospitalDTO; +import com.sict.excel.dto.EarlyCancerRankDTO; +import com.sict.excel.dto.GastroscopeTestDTO; +import com.sict.excel.dto.HpPositiveDTO; +import com.sict.excel.dto.RiskDTO; +import com.sict.excel.dto.ScreeningRankDTO; +import com.sict.excel.dto.ScreeningRankProvinceDTO; +import com.sict.excel.dto.SerumStatisticsDTO; + + +public interface DownloadMapper{ + + /** + * 筛查监控-血清学检查 + * @return + */ + SerumStatisticsDTO getSerumStatistics(); + + /*** + * 筛查排名-按血检人数排名 + * @return + */ + List getScreeningRankProvinceDTOs(); + + /** + * 省份早癌排名 + * @return + */ + List getEarlyCancerRankDTOs(); + + /** + * 运营分析-医院早癌 胃癌数 + */ + List geteaCancerHospitals(); + + /** + * 运营分析-省份数据 + * @return + */ + List getAnalysisProvinceDTOs(); + + /*** + * 社区筛查排名-血检人数/体检筛查排名-血检人数/门诊筛查排名-血检人数 + * @return + */ + List getScreeningRankDTOs(); + + + /** + * 运营分析-图例数据 + * @return + */ + AnalysisGraphicDTO getAnalysisGraphicDTOs(); + + /** + * 筛查监控-胃镜检查 + * @return + */ + GastroscopeTestDTO getGastroscopeTestDTOs(); + + /** + * Hp抗体阳性人数 + * @return + */ + HpPositiveDTO getHpPositiveDTO(); + + /*** + * 诊断结果 + * @return + */ + DiagnosisDTO getDiagnosisDTO(); + + /** + * 风险等级 + * @return + */ + List getRiskDTOs(); + +} diff --git a/download/src/main/java/com/sict/excel/myExcel.java b/download/src/main/java/com/sict/excel/myExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..caee6437100356413790b77c7656a0a64adc6ffb --- /dev/null +++ b/download/src/main/java/com/sict/excel/myExcel.java @@ -0,0 +1,76 @@ +package com.sict.excel; + +import java.io.FileOutputStream; +import java.io.IOException; + +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import com.sict.excel.test.AnalysisGraphicExcel; +import com.sict.excel.test.AnalysisHospitalEarlyCancerExcel; +import com.sict.excel.test.AnalysisProvinceExcel; +import com.sict.excel.test.Diagnosis; +import com.sict.excel.test.GastroscopeTest; +import com.sict.excel.test.ProvinceEarlyCancerRankExcel; +import com.sict.excel.test.ScreeningRankGecaExcel; +import com.sict.excel.test.ScreeningRankProvinceExcel; +import com.sict.excel.test.ScreeningRankQgExcel; +import com.sict.excel.test.ScreeningRankShchyyExcel; +import com.sict.excel.test.SerumTest; + +public class myExcel { + + public static void main(String[] args) throws Exception { + HSSFWorkbook workbook = new HSSFWorkbook(); + //筛查监控-血清学检查 + SerumTest serumTest = new SerumTest(); + HSSFSheet sheet1 = serumTest.getsheet1(workbook); + workbook.setSheetName(0, "筛查监控-血清学检查"); + //筛查监控-胃镜检查 + GastroscopeTest gastroscopeTest = new GastroscopeTest(); + HSSFSheet sheet2 = gastroscopeTest.getSheet2(workbook); + workbook.setSheetName(1, "筛查监控-胃镜检查"); + //筛查监控-诊断结果 + Diagnosis diagnosis = new Diagnosis(); + HSSFSheet sheet3 = diagnosis.getSheet3(workbook); + workbook.setSheetName(2, "筛查监控-诊断结果"); + //运营分析-图例数据 + AnalysisGraphicExcel analysisGraphicExcel = new AnalysisGraphicExcel(); + HSSFSheet sheet4 = analysisGraphicExcel.getsheet4(workbook); + workbook.setSheetName(3, "运营分析-图例数据"); + //运营分析-省份数据 + AnalysisProvinceExcel analysisProvinceExcel = new AnalysisProvinceExcel(); + HSSFSheet sheet5 = analysisProvinceExcel.getSheet5(workbook); + workbook.setSheetName(4, "运营分析-省份数据"); + //运营分析-医院早癌 胃癌数 + AnalysisHospitalEarlyCancerExcel analysisHospitalEarlyCancerExcel = new AnalysisHospitalEarlyCancerExcel(); + HSSFSheet sheet6 = analysisHospitalEarlyCancerExcel.getsheet6(workbook); + workbook.setSheetName(5, "运营分析-医院早癌 胃癌数"); + //省份早癌排名 + ProvinceEarlyCancerRankExcel provinceEarlyCancerRankExcel = new ProvinceEarlyCancerRankExcel(); + HSSFSheet sheet7 = provinceEarlyCancerRankExcel.getSheet7(workbook); + workbook.setSheetName(6, "省份早癌排名"); + //筛查排名-按血检人数排名 + ScreeningRankProvinceExcel screeningRankProvinceExcel = new ScreeningRankProvinceExcel(); + HSSFSheet sheet8 = screeningRankProvinceExcel.getSheet8(workbook); + workbook.setSheetName(7, "筛查排名-按血检人数排名"); + //社区筛查排名-血检人数 + ScreeningRankShchyyExcel screeningRankShchyyExcel = new ScreeningRankShchyyExcel(); + HSSFSheet sheet9 = screeningRankShchyyExcel.getSheet9(workbook); + workbook.setSheetName(8, "社区筛查排名-血检人数"); + //体检筛查排名-血检人数 + ScreeningRankGecaExcel screeningRankGecaExcel = new ScreeningRankGecaExcel(); + HSSFWorkbook getsheet10 = screeningRankGecaExcel.getsheet10(workbook); + workbook.setSheetName(9, "体检筛查排名-血检人数"); + //门诊筛查排名-血检人数 + ScreeningRankQgExcel screeningRankQgExcel = new ScreeningRankQgExcel(); + HSSFSheet sheet11 = screeningRankQgExcel.getSheet11(workbook); + workbook.setSheetName(10, "门诊筛查排名-血检人数"); + + + FileOutputStream outputStream = new FileOutputStream("E:/2019/excel/GICC+map+data.xls"); + workbook.write(outputStream); + outputStream.close(); + } + +} diff --git a/download/src/main/java/com/sict/excel/test/AnalysisGraphicExcel.java b/download/src/main/java/com/sict/excel/test/AnalysisGraphicExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..a0f034f4858d36418f98c4b14010e9e9c9dfdfe9 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/AnalysisGraphicExcel.java @@ -0,0 +1,69 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import com.sict.excel.bo.AnalysisGraphicBO; +import com.sict.excel.dto.AnalysisGraphicDTO; +import com.sict.excel.dto.EarlyCancerHospitalDTO; +import com.sict.excel.dto.ScreeningRankProvinceDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.ExportExcelUtil; +import com.sict.excel.utils.SqlSessionUtil; + +public class AnalysisGraphicExcel { + + public static HSSFSheet getsheet4(HSSFWorkbook workbook) throws IOException { + + SqlSession sqlSession = SqlSessionUtil.getSession(); + + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + + ExportExcelUtil util = new ExportExcelUtil(); + + String[] columnNames = {"收集项","数值","备注"}; + + AnalysisGraphicDTO graphicDTO = mapper.getAnalysisGraphicDTOs(); + + List list = new ArrayList(); + + AnalysisGraphicBO analysisGraphicBO = new AnalysisGraphicBO(); + analysisGraphicBO.setItem("申请胃癌筛查的医院总数"); + analysisGraphicBO.setNumber(graphicDTO.getApplyGastricCancerScreeningHosp()); + list.add(analysisGraphicBO); + + AnalysisGraphicBO analysisGraphicBO2 = new AnalysisGraphicBO(); + analysisGraphicBO2.setItem("通过申请医院数 "); + analysisGraphicBO2.setNumber(graphicDTO.getPassApplyHosp()); + list.add(analysisGraphicBO2); + + AnalysisGraphicBO analysisGraphicBO3 = new AnalysisGraphicBO(); + analysisGraphicBO3.setItem("平台账号申请医院数"); + analysisGraphicBO3.setNumber(graphicDTO.getPlatAccountApplyHosp()); + list.add(analysisGraphicBO3); + + AnalysisGraphicBO analysisGraphicBO4 = new AnalysisGraphicBO(); + analysisGraphicBO4.setItem("账号已开通的医院数"); + analysisGraphicBO4.setNumber(graphicDTO.getOpenAccountHosp()); + list.add(analysisGraphicBO4); + + + // String path = "E:/2019/excel/" + "运营分析-图例数据.xls"; + + HSSFSheet sheet = util.exportExcel(workbook,"运营分析-图例数据", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007); + sqlSession.commit(); + + sqlSession.close(); + + return sheet; + + + } + +} diff --git a/download/src/main/java/com/sict/excel/test/AnalysisHospitalEarlyCancerExcel.java b/download/src/main/java/com/sict/excel/test/AnalysisHospitalEarlyCancerExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..d8bd082acdf336ac739724ed8fefc025cb2f7393 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/AnalysisHospitalEarlyCancerExcel.java @@ -0,0 +1,42 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; + +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hslf.model.Sheet; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import com.sict.excel.dto.EarlyCancerHospitalDTO; +import com.sict.excel.dto.ScreeningRankProvinceDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.ExportExcelUtil; +import com.sict.excel.utils.SqlSessionUtil; + +public class AnalysisHospitalEarlyCancerExcel { + + public static HSSFSheet getsheet6(HSSFWorkbook workbook) throws IOException { + +SqlSession sqlSession = SqlSessionUtil.getSession(); + + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + + ExportExcelUtil util = new ExportExcelUtil(); + + String[] columnNames = {"排名","医院名称","省份","合计","高级别食管粘膜上皮内瘤变","早期食管癌","进展期食管癌","高级别胃粘膜上皮内瘤病变","早期胃癌","进展期胃癌"}; + + List list = mapper.geteaCancerHospitals(); + + // String path = "E:/2019/excel/" + "运营分析-医院早癌 胃癌数.xls"; + HSSFSheet sheet = util.exportExcel(workbook,"运营分析-医院早癌 胃癌数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007); + sqlSession.commit(); + + sqlSession.close(); + + + return sheet; + } + +} diff --git a/download/src/main/java/com/sict/excel/test/AnalysisProvinceExcel.java b/download/src/main/java/com/sict/excel/test/AnalysisProvinceExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..727f74a62f28dd9ddb501a077955bdf8680819b1 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/AnalysisProvinceExcel.java @@ -0,0 +1,41 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; + +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import com.sict.excel.dto.AnalysisProvinceDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.ExportExcelUtil; +import com.sict.excel.utils.SqlSessionUtil; + +public class AnalysisProvinceExcel { + + public static HSSFSheet getSheet5(HSSFWorkbook workbook) throws IOException { + + SqlSession sqlSession = SqlSessionUtil.getSession(); + + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + + ExportExcelUtil util = new ExportExcelUtil(); + + String[] columnNames = {"省份","申请医院总数 ","开通账号医院总数","申请账号中的医院总数","通过申请医院数","平台账号申请医院数","筛查人数","早癌数"}; + + List list = mapper.getAnalysisProvinceDTOs(); + + //String path = "E:/2019/excel/" + "运营分析-省份数据.xls"; + HSSFSheet sheet = util.exportExcel(workbook,"运营分析-省份数据", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007); + sqlSession.commit(); + + sqlSession.close(); + + return sheet; + + + } + +} diff --git a/download/src/main/java/com/sict/excel/test/Diagnosis.java b/download/src/main/java/com/sict/excel/test/Diagnosis.java new file mode 100644 index 0000000000000000000000000000000000000000..d70640624b277b9183dcd01088739073f69012e3 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/Diagnosis.java @@ -0,0 +1,163 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; + +import org.apache.ibatis.session.SqlSession; +import org.apache.log4j.DailyRollingFileAppender; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.util.RegionUtil; + +import com.sict.excel.dto.DiagnosisDTO; +import com.sict.excel.dto.RiskDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.SqlSessionUtil; + +public class Diagnosis { + + public static HSSFSheet getSheet3(HSSFWorkbook workbook) throws IOException { + HSSFSheet sheet = workbook.createSheet("筛查监控-诊断结果"); + sheet.setDefaultColumnWidth(15); + // 设置这些样式 + HSSFCellStyle style = workbook.createCellStyle(); + style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中 + style.setAlignment(HSSFCellStyle.ALIGN_CENTER); + // 背景色 + // 设置边框 + style.setBorderBottom(HSSFCellStyle.BORDER_THIN); + style.setBorderLeft(HSSFCellStyle.BORDER_THIN); + style.setBorderRight(HSSFCellStyle.BORDER_THIN); + style.setBorderTop(HSSFCellStyle.BORDER_THIN); + + style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + style.setFillBackgroundColor(IndexedColors.PALE_BLUE.getIndex()); + // 生成一个字体 + HSSFFont font = workbook.createFont(); + font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); + font.setFontName("宋体"); + style.setFont(font); + + HSSFRow row = sheet.createRow(0); + // 合并行 + HSSFCell cell = row.createCell(0); + cell.setCellValue("收集项"); + cell.setCellStyle(style); + CellRangeAddress region = new CellRangeAddress(0, 0, 0, 1); + sheet.addMergedRegion(region); + RegionUtil.setBorderBottom(1, region, sheet, workbook); // 下边框 + RegionUtil.setBorderLeft(1, region, sheet, workbook); // 左边框 + RegionUtil.setBorderRight(1, region, sheet, workbook); // 有边框 + RegionUtil.setBorderTop(1, region, sheet, workbook); // 上边框 + + // 数量 + HSSFCell cell12 = row.createCell(2); + cell12.setCellStyle(style); + cell12.setCellValue("数量"); + + HSSFCellStyle style2 = workbook.createCellStyle(); + style2.setAlignment(HSSFCellStyle.ALIGN_CENTER); + // 背景色 + // 设置边框 + style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); + style2.setBorderLeft(HSSFCellStyle.BORDER_THIN); + style2.setBorderRight(HSSFCellStyle.BORDER_THIN); + style2.setBorderTop(HSSFCellStyle.BORDER_THIN); + // 生成一个字体 + HSSFFont font2 = workbook.createFont(); + font.setFontHeightInPoints((short) 11); + font.setColor(IndexedColors.AUTOMATIC.getIndex()); + font.setFontName("宋体"); + style2.setFont(font2);// 把字体 应用到当前样式 + + HSSFRow row4 ; + HSSFCell cell41,cell42,cell43,cell44; + + SqlSession sqlSession = SqlSessionUtil.getSession(); + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + DiagnosisDTO diagnosis = mapper.getDiagnosisDTO(); + + + String[] str1 = {"诊断结果","","","","其他","",""}; + String[] str2 = {"高级别上皮内瘤变","低级别上皮内瘤变","早期胃癌","早期食管癌","萎缩性胃炎","胃溃疡","胃息肉"}; + Integer[] number = {diagnosis.getHigeLevel(),diagnosis.getLowLevel(),diagnosis.getEarlyGastricCancer(),diagnosis.getEarlyEsophagealCancer(),diagnosis.getAtrophicGastritis(),diagnosis.getGastricUlcer(),diagnosis.getGastricPolyps()}; + String[] str3 = {"食管"+diagnosis.getHighEsophageal()+"+胃"+diagnosis.getHighStomach(),"食管"+diagnosis.getLowEsophageal()+"+胃"+diagnosis.getLowStomach(),"进展期胃癌"+diagnosis.getAdvancedGastricCancer(),"进展期食管癌"+diagnosis.getAdvancedEsophagealCancer(),"","",""}; + for (int i = 1; i < 8; i++) { + row4 = sheet.createRow(i); + + cell41 = row4.createCell(0); + cell41.setCellStyle(style2); + cell41.setCellValue(str1[i-1]); + + cell42 = row4.createCell(1); + cell42.setCellStyle(style2); + cell42.setCellValue(str2[i-1]); + + cell43 = row4.createCell(2); + cell43.setCellStyle(style2); + cell43.setCellValue(number[i-1]); + + cell44 = row4.createCell(3); + cell44.setCellValue(str3[i-1]); + + } + CellRangeAddress region2 = new CellRangeAddress(1, 4, 0, 0); + sheet.addMergedRegion(region2); + RegionUtil.setBorderBottom(1, region2, sheet, workbook); // 下边框 + RegionUtil.setBorderLeft(1, region2, sheet, workbook); // 左边框 + RegionUtil.setBorderRight(1, region2, sheet, workbook); // 有边框 + RegionUtil.setBorderTop(1, region2, sheet, workbook); // 上边框 + CellRangeAddress region3 = new CellRangeAddress(5, 7, 0, 0); + sheet.addMergedRegion(region3); + RegionUtil.setBorderBottom(1, region3, sheet, workbook); // 下边框 + RegionUtil.setBorderLeft(1, region3, sheet, workbook); // 左边框 + RegionUtil.setBorderRight(1, region3, sheet, workbook); // 有边框 + RegionUtil.setBorderTop(1, region3, sheet, workbook); // 上边框 + + HSSFRow row5 ; + HSSFCell cell51,cell52,cell53; + + List riskDTOs = mapper.getRiskDTOs(); + String[] str4 = {"","高危","中危","低危","总数"}; + Integer highInteger=riskDTOs.get(0).getTotal(); + Integer lowString = riskDTOs.get(1).getTotal(); + Integer mediuString = riskDTOs.get(2).getTotal(); + Integer totalInteger = highInteger.intValue()+lowString.intValue()+mediuString.intValue(); + double highdouble = Double.parseDouble(highInteger.toString()); + double mediumdouble = Double.parseDouble(mediuString.toString()); + double lowdouble = Double.parseDouble(lowString.toString()); + double totaldouble = Double.parseDouble(totalInteger.toString()); + String[] str5 = {"总数",highInteger.toString(),mediuString.toString(),lowString.toString(),totalInteger+""}; + String[] str6 = {"比例",String.format("%.1f", highdouble/totaldouble*100)+"%",String.format("%.1f", mediumdouble/totaldouble*100)+"%",String.format("%.1f", lowdouble/totaldouble*100)+"%","100%"}; + for (int i = 11; i < 16; i++) { + + row5 = sheet.createRow(i); + + cell51 = row5.createCell(0); + cell51.setCellValue(str4[i-11]); + + cell52 = row5.createCell(1); + cell52.setCellValue(str5[i-11]); + + HSSFCellStyle style3 = workbook.createCellStyle(); + HSSFFont font3 = workbook.createFont(); + font3.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); + font3.setFontName("宋体"); + style3.setFont(font); + cell53 = row5.createCell(2); + cell53.setCellValue(str6[i-11]); + cell53.setCellStyle(style3); + } + + return sheet; + } + +} diff --git a/download/src/main/java/com/sict/excel/test/GastroscopeTest.java b/download/src/main/java/com/sict/excel/test/GastroscopeTest.java new file mode 100644 index 0000000000000000000000000000000000000000..c6fa003221d11786b66d1a1859286f2ddc47cedc --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/GastroscopeTest.java @@ -0,0 +1,96 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; + +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.IndexedColors; + +import com.sict.excel.dto.GastroscopeTestDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.SqlSessionUtil; + +public class GastroscopeTest { + + public static HSSFSheet getSheet2(HSSFWorkbook workbook) throws IOException { + + SqlSession sqlSession = SqlSessionUtil.getSession(); + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + GastroscopeTestDTO gastroscopeTestDTO = mapper.getGastroscopeTestDTOs(); + HSSFSheet sheet = workbook.createSheet("筛查监控-胃镜检查"); + sheet.setDefaultColumnWidth(15); + + HSSFRow row = sheet.createRow(0); + HSSFCellStyle style = workbook.createCellStyle(); + // 设置这些样式 + style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中 + // 背景色 + style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + style.setFillBackgroundColor(IndexedColors.PALE_BLUE.getIndex()); + // 设置边框 + style.setBorderBottom(HSSFCellStyle.BORDER_THIN); + style.setBorderLeft(HSSFCellStyle.BORDER_THIN); + style.setBorderRight(HSSFCellStyle.BORDER_THIN); + style.setBorderTop(HSSFCellStyle.BORDER_THIN); + // 生成一个字体 + HSSFFont font = workbook.createFont(); + font.setFontHeightInPoints((short) 11); + font.setColor(IndexedColors.AUTOMATIC.getIndex()); + font.setFontName("宋体"); + style.setFont(font);// 把字体 应用到当前样式 + + HSSFCell cell = row.createCell(0); + cell.setCellValue("收集项"); + cell.setCellStyle(style); + HSSFCell cell2 = row.createCell(1); + cell2.setCellValue("数量"); + cell2.setCellStyle(style); + + HSSFCellStyle style2 = workbook.createCellStyle(); + // 设置这些样式 + style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中 + // 背景色 + style2.setFillForegroundColor(IndexedColors.WHITE.getIndex()); + style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + style2.setFillBackgroundColor(IndexedColors.WHITE.getIndex()); + // 设置边框 + style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); + style2.setBorderLeft(HSSFCellStyle.BORDER_THIN); + style2.setBorderRight(HSSFCellStyle.BORDER_THIN); + style2.setBorderTop(HSSFCellStyle.BORDER_THIN); + style2.setFont(font);// 把字体 应用到当前样式 + HSSFRow row2 = sheet.createRow(1);// 第2行 + HSSFCell cell3 = row2.createCell(0); + cell3.setCellStyle(style2); + cell3.setCellValue("实际精查人数"); + HSSFCell cell4 = row2.createCell(1); + cell4.setCellStyle(style2); + cell4.setCellValue(gastroscopeTestDTO.getActualGastroscope()+""); + HSSFCell cell7 = row2.createCell(2); + double actual = Double.parseDouble(gastroscopeTestDTO.getActualGastroscope().toString()); + double plan = Double.parseDouble(gastroscopeTestDTO.getPlanGastroscope().toString()); + cell7.setCellValue(String.format("%.2f", actual/plan*100)+"%"); + + HSSFRow row3 = sheet.createRow(2);// 第三行 + HSSFCell cell5 = row3.createCell(0); + cell5.setCellStyle(style2); + cell5.setCellValue("应精查人数"); + HSSFCell cell6 = row3.createCell(1); + cell6.setCellStyle(style2); + cell6.setCellValue(gastroscopeTestDTO.getPlanGastroscope()+""); + + + //FileOutputStream outputStream = new FileOutputStream("E:/2019/excel/筛查监控-胃镜检查.xls"); + sqlSession.commit(); + sqlSession.close(); + return sheet; + } + +} diff --git a/download/src/main/java/com/sict/excel/test/ProvinceEarlyCancerRankExcel.java b/download/src/main/java/com/sict/excel/test/ProvinceEarlyCancerRankExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..4900632d293bb715e7b94be047fca602c3e14be7 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/ProvinceEarlyCancerRankExcel.java @@ -0,0 +1,32 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import com.sict.excel.dto.EarlyCancerRankDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.ExportExcelUtil; +import com.sict.excel.utils.SqlSessionUtil; + +public class ProvinceEarlyCancerRankExcel { + + public static HSSFSheet getSheet7(HSSFWorkbook workbook) throws IOException { + SqlSession sqlSession = SqlSessionUtil.getSession(); + + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + ExportExcelUtil util = new ExportExcelUtil(); + String[] columnNames = {"省份","早癌数"}; + List list = mapper.getEarlyCancerRankDTOs(); + //String path = "E:/2019/excel/" + "省份早癌排名.xls"; + HSSFSheet sheet = util.exportExcel(workbook,"省份早癌排名", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007); + sqlSession.commit(); + + sqlSession.close(); + return sheet; + } + +} diff --git a/download/src/main/java/com/sict/excel/test/ScreeningRankGecaExcel.java b/download/src/main/java/com/sict/excel/test/ScreeningRankGecaExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..9d5e4daa91857c2ffcdeb005cb8e62db99de3839 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/ScreeningRankGecaExcel.java @@ -0,0 +1,33 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import com.sict.excel.dto.EarlyCancerRankDTO; +import com.sict.excel.dto.ScreeningRankDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.ExportExcelUtil; +import com.sict.excel.utils.SqlSessionUtil; + +public class ScreeningRankGecaExcel { + + public static HSSFWorkbook getsheet10(HSSFWorkbook workbook) throws IOException { + SqlSession sqlSession = SqlSessionUtil.getGecaSession(); + + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + ExportExcelUtil util = new ExportExcelUtil(); + String[] columnNames = {"排名","医联体名称","血检人数"}; + List list = mapper.getScreeningRankDTOs(); + String path = "E:/2019/excel/" + "体检筛查排名-血检人数.xls"; + HSSFSheet sheet = util.exportExcel(workbook,"体检筛查排名-血检人数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007); + sqlSession.commit(); + + sqlSession.close(); + return workbook; + } + +} diff --git a/download/src/main/java/com/sict/excel/test/ScreeningRankProvinceExcel.java b/download/src/main/java/com/sict/excel/test/ScreeningRankProvinceExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..72a3049bc9e50f123dd635b423e2704bc5377013 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/ScreeningRankProvinceExcel.java @@ -0,0 +1,39 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; + +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import com.sict.excel.dto.ScreeningRankProvinceDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.ExportExcelUtil; +import com.sict.excel.utils.SqlSessionUtil; + +public class ScreeningRankProvinceExcel { + + public static HSSFSheet getSheet8(HSSFWorkbook workbook) throws IOException { + + SqlSession sqlSession = SqlSessionUtil.getSession(); + + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + + ExportExcelUtil util = new ExportExcelUtil(); + + String[] columnNames = {"排名","医院名称","省份","血检人数"}; + + List list = mapper.getScreeningRankProvinceDTOs(); + + //String path = "E:/2019/excel/" + "筛查排名-按血检人数排名.xls"; + HSSFSheet sheet = util.exportExcel(workbook, "筛查排名-按血检人数排名", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007); + sqlSession.commit(); + + sqlSession.close(); + return sheet; + + } + +} diff --git a/download/src/main/java/com/sict/excel/test/ScreeningRankQgExcel.java b/download/src/main/java/com/sict/excel/test/ScreeningRankQgExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..e21e1bf1f6dd86c454a44cf4c8692544cbd5feaa --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/ScreeningRankQgExcel.java @@ -0,0 +1,33 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import com.sict.excel.dto.EarlyCancerRankDTO; +import com.sict.excel.dto.ScreeningRankDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.ExportExcelUtil; +import com.sict.excel.utils.SqlSessionUtil; + +public class ScreeningRankQgExcel { + + public static HSSFSheet getSheet11(HSSFWorkbook workbook) throws IOException { + SqlSession sqlSession = SqlSessionUtil.getQgSession(); + + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + ExportExcelUtil util = new ExportExcelUtil(); + String[] columnNames = {"排名","医联体名称","血检人数"}; + List list = mapper.getScreeningRankDTOs(); + String path = "E:/2019/excel/" + "门诊筛查排名-血检人数.xls"; + HSSFSheet sheet = util.exportExcel(workbook,"门诊筛查排名-血检人", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007); + sqlSession.commit(); + + sqlSession.close(); + return sheet; + } + +} diff --git a/download/src/main/java/com/sict/excel/test/ScreeningRankShchyyExcel.java b/download/src/main/java/com/sict/excel/test/ScreeningRankShchyyExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..4ce266933963da2e0a0f704cff26fd62366c5fc7 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/ScreeningRankShchyyExcel.java @@ -0,0 +1,32 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; + +import com.sict.excel.dto.EarlyCancerRankDTO; +import com.sict.excel.dto.ScreeningRankDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.ExportExcelUtil; +import com.sict.excel.utils.SqlSessionUtil; + +public class ScreeningRankShchyyExcel { + + public static HSSFSheet getSheet9(HSSFWorkbook workbook) throws IOException { + SqlSession sqlSession = SqlSessionUtil.getShchyySession(); + + DownloadMapper mapper = sqlSession.getMapper(DownloadMapper.class); + ExportExcelUtil util = new ExportExcelUtil(); + String[] columnNames = {"排名","医联体名称","血检人数"}; + List list = mapper.getScreeningRankDTOs(); + String path = "E:/2019/excel/" + "社区筛查排名-血检人数.xls"; + HSSFSheet sheet = util.exportExcel(workbook,"社区筛查排名-血检人数", columnNames, list, ExportExcelUtil.EXCEl_FILE_2007); + sqlSession.commit(); + sqlSession.close(); + return sheet; + } + +} diff --git a/download/src/main/java/com/sict/excel/test/SerumTest.java b/download/src/main/java/com/sict/excel/test/SerumTest.java new file mode 100644 index 0000000000000000000000000000000000000000..beb76d8d288530ff3e84efd6cfe23138efab8974 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/SerumTest.java @@ -0,0 +1,172 @@ +package com.sict.excel.test; + +import java.io.FileOutputStream; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.SqlSession; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.IndexedColors; + +import com.sict.excel.dto.HpPositiveDTO; +import com.sict.excel.dto.ScreeningRankDTO; +import com.sict.excel.dto.ScreeningRankProvinceDTO; +import com.sict.excel.dto.SerumStatisticsDTO; +import com.sict.excel.mapper.DownloadMapper; +import com.sict.excel.utils.ExportExcelUtil; +import com.sict.excel.utils.SqlSessionUtil; + +public class SerumTest { + public static HSSFSheet getsheet1(HSSFWorkbook workbook) throws Exception { + + SqlSession sqlSession = SqlSessionUtil.getSession();// 血检总人数 + SqlSession shchyy = SqlSessionUtil.getShchyySession();// 社区血检人数 + SqlSession geca = SqlSessionUtil.getGecaSession();// 体检 + SqlSession qg = SqlSessionUtil.getQgSession();// 门诊 + DownloadMapper sqlSessionmapper = sqlSession.getMapper(DownloadMapper.class); + DownloadMapper shchyyMapper = shchyy.getMapper(DownloadMapper.class); + DownloadMapper gecaMapper = geca.getMapper(DownloadMapper.class); + DownloadMapper qgMapper = qg.getMapper(DownloadMapper.class); + SerumStatisticsDTO serumall = sqlSessionmapper.getSerumStatistics(); + List listshchyy = shchyyMapper.getScreeningRankDTOs(); + List listgeca = gecaMapper.getScreeningRankDTOs(); + List listqg = qgMapper.getScreeningRankDTOs(); + Integer serumInteger = serumall.getSerumTestTotal(); + Integer shchyyinInteger = 0; + Integer gecaintInteger = 0; + Integer qgInteger = 0; + Integer hpInteger = serumall.getIggPositive(); + for (ScreeningRankDTO screeningRankDTO : listshchyy) { + shchyyinInteger += screeningRankDTO.getActualserum(); + } + for (ScreeningRankDTO screeningRankDTO : listgeca) { + gecaintInteger += screeningRankDTO.getActualserum(); + } + for (ScreeningRankDTO screeningRankDTO : listqg) { + qgInteger += screeningRankDTO.getActualserum(); + } + HSSFSheet sheet = workbook.createSheet("筛查监控-血清学检查"); + sheet.setDefaultColumnWidth(15); + + HSSFRow row = sheet.createRow(0); + HSSFCellStyle style = workbook.createCellStyle(); + // 设置这些样式 + style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中 + // 背景色 + style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + style.setFillBackgroundColor(IndexedColors.PALE_BLUE.getIndex()); + // 设置边框 + style.setBorderBottom(HSSFCellStyle.BORDER_THIN); + style.setBorderLeft(HSSFCellStyle.BORDER_THIN); + style.setBorderRight(HSSFCellStyle.BORDER_THIN); + style.setBorderTop(HSSFCellStyle.BORDER_THIN); + // 生成一个字体 + HSSFFont font = workbook.createFont(); + font.setFontHeightInPoints((short) 11); + font.setColor(IndexedColors.AUTOMATIC.getIndex()); + font.setFontName("宋体"); + style.setFont(font);// 把字体 应用到当前样式 + + HSSFCell cell = row.createCell(0); + cell.setCellValue("收集项"); + cell.setCellStyle(style); + HSSFCell cell2 = row.createCell(1); + cell2.setCellValue("数量"); + cell2.setCellStyle(style); + + HSSFCellStyle style2 = workbook.createCellStyle(); + // 设置这些样式 + style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直居中 + // 背景色 + style2.setFillForegroundColor(IndexedColors.WHITE.getIndex()); + style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + style2.setFillBackgroundColor(IndexedColors.WHITE.getIndex()); + // 设置边框 + style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); + style2.setBorderLeft(HSSFCellStyle.BORDER_THIN); + style2.setBorderRight(HSSFCellStyle.BORDER_THIN); + style2.setBorderTop(HSSFCellStyle.BORDER_THIN); + style2.setFont(font);// 把字体 应用到当前样式 + HSSFRow row2 = sheet.createRow(1);// 第2行 + HSSFCell cell3 = row2.createCell(0); + cell3.setCellStyle(style2); + cell3.setCellValue("血检总人数"); + HSSFCell cell4 = row2.createCell(1); + cell4.setCellStyle(style2); + cell4.setCellValue(serumInteger + ""); + + HSSFRow row3 = sheet.createRow(2);// 第三行 + HSSFCell cell5 = row3.createCell(0); + cell5.setCellStyle(style2); + cell5.setCellValue("Hp抗体阳性人数 "); + HSSFCell cell6 = row3.createCell(1); + cell6.setCellStyle(style2); + cell6.setCellValue(hpInteger + ""); + + HSSFCell cell7 = row3.createCell(2); + double all = Double.parseDouble(serumInteger.toString()); + double hp2 = Double.parseDouble(hpInteger.toString()); + cell7.setCellValue(String.format("%.2f", hp2 / all * 100) + "%"); + + + HSSFCellStyle style3 = workbook.createCellStyle(); + HSSFRow row8 = sheet.createRow(7);//7行 + HSSFCell cell71 = row8.createCell(0); + cell71.setCellValue("社区血检人数"); + style3.setFont(font); + cell71.setCellStyle(style3); + HSSFCell cell72 = row8.createCell(1); + cell72.setCellStyle(style3); + cell72.setCellValue(shchyyinInteger+""); + + HSSFRow row9 = sheet.createRow(8);//8行 + HSSFCell cell91 = row9.createCell(0); + cell91.setCellValue("门诊血检人数"); + style3.setFont(font); + cell91.setCellStyle(style3); + HSSFCell cell92 = row9.createCell(1); + cell92.setCellStyle(style3); + cell92.setCellValue(qgInteger+""); + + HSSFRow row10 = sheet.createRow(9);//9行 + HSSFCell cell101 = row10.createCell(0); + cell101.setCellValue("体检血检人数"); + style3.setFont(font); + cell101.setCellStyle(style3); + HSSFCell cell102 = row10.createCell(1); + cell102.setCellStyle(style3); + cell102.setCellValue(gecaintInteger+""); + + HSSFRow row11= sheet.createRow(10);//10行 + HSSFCell cell111 = row11.createCell(0); + cell111.setCellValue("合计"); + style3.setFont(font); + cell111.setCellStyle(style3); + HSSFCell cell112 = row11.createCell(1); + cell112.setCellStyle(style3); + cell112.setCellValue(String.valueOf(shchyyinInteger.intValue()+gecaintInteger.intValue()+qgInteger.intValue())); + + + FileOutputStream outputStream = new FileOutputStream("E:/2019/excel/筛查监控-血清学检查.xls"); + + sqlSession.commit(); + shchyy.commit(); + geca.commit(); + qg.commit(); + qg.close(); + geca.close(); + qg.close(); + sqlSession.close(); + return sheet; + + } +} diff --git a/download/src/main/java/com/sict/excel/test/TestExportExcel.java b/download/src/main/java/com/sict/excel/test/TestExportExcel.java new file mode 100644 index 0000000000000000000000000000000000000000..77f87c661c00f031315b560532f54063cf64b132 --- /dev/null +++ b/download/src/main/java/com/sict/excel/test/TestExportExcel.java @@ -0,0 +1,39 @@ +package com.sict.excel.test; + + +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import com.sict.excel.dto.Student; +import com.sict.excel.utils.ExportExcelUtil; +/** + * 测试文件导出 + * @author liuyazhuang + * + */ +public class TestExportExcel { + + public static void main(String[] args) throws Exception{ + ExportExcelUtil util = new ExportExcelUtil(); + // 准备数据 + List list = new ArrayList(); + for (int i = 0; i < 10; i++) { + list.add(new Student(i,"张三asdf"+i,"男")); + } + + String[] columnNames = { "ID", "姓名", "性别" }; +// Date date = new Date(); +// System.out.println(date.getYear()+"/"+date.getMonth()+"/"+date.getDay()+"/"+date.getHours()+"/"+date.getMinutes()+"/"+date.getSeconds()); + Calendar calendar = Calendar.getInstance(); + Date date = new Date(); + calendar.setTime(date); + calendar.getTime();//2019-08-13 + //System.out.println(calendar.get(Calendar.YEAR)+"/"+calendar.get(Calendar.MONTH)+"/"+calendar.get(Calendar.DATE)+"/"+calendar.get(Calendar.HOUR)+"/"+calendar.get(Calendar.MINUTE)+"/"+calendar.get(Calendar.SECOND)); + String path = "E:/2019/excel/"+date.getTime()+"学生表.xls"; + // util.exportExcel("用户导出", columnNames, list, new FileOutputStream(path), ExportExcelUtil.EXCEL_FILE_2003); + System.out.println("已导出excel表"); + } +} \ No newline at end of file diff --git a/download/src/main/java/com/sict/excel/utils/Excel.java b/download/src/main/java/com/sict/excel/utils/Excel.java new file mode 100644 index 0000000000000000000000000000000000000000..4ecaec66f1760e47ea66c8c1e84683d02d0cdcc1 --- /dev/null +++ b/download/src/main/java/com/sict/excel/utils/Excel.java @@ -0,0 +1,291 @@ +package com.sict.excel.utils; + +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; + +import java.io.*; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +public class Excel { + + private HSSFWorkbook workbook; + private HSSFSheet sheet; + private String bDate; + private int year; + + /** + * 创建行元素 + * @param style 样式 + * @param height 行高 + * @param value 行显示的内容 + * @param row1 起始行 + * @param row2 结束行 + * @param col1 起始列 + * @param col2 结束列 + */ + private void createRow(HSSFCellStyle style, int height, String value, int row1, int row2, int col1, int col2){ + + sheet.addMergedRegion(new CellRangeAddress(row1, row2, col1, col2)); //设置从第row1行合并到第row2行,第col1列合并到col2列 + HSSFRow rows = sheet.createRow(row1); //设置第几行 + rows.setHeight((short) height); //设置行高 + HSSFCell cell = rows.createCell(col1); //设置内容开始的列 + cell.setCellStyle(style); //设置样式 + cell.setCellValue(value); //设置该行的值 + } + + /** + * 创建样式 + * @param fontSize 字体大小 + * @param align 水平位置 左右居中2 居右3 默认居左 垂直均为居中 + * @param bold 是否加粗 + * @return + */ + private HSSFCellStyle getStyle(int fontSize,int align,boolean bold,boolean border){ + HSSFFont font = workbook.createFont(); + font.setFontName("宋体"); + font.setFontHeightInPoints((short) fontSize);// 字体大小 + if (bold){ + font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); + } + HSSFCellStyle style = workbook.createCellStyle(); + style.setFont(font); //设置字体 + style.setAlignment((short) align); // 左右居中2 居右3 默认居左 + style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 上下居中1 + if (border){ + style.setBorderRight((short) 2); + style.setBorderLeft((short) 2); + style.setBorderBottom((short) 2); + style.setBorderTop((short) 2); + style.setLocked(true); + } + return style; + } + + /** + * 根据数据集生成Excel,并返回Excel文件流 + * @param data 数据集 + * @param sheetName Excel中sheet单元名称 + * @param headNames 列表头名称数组 + * @param colKeys 列key,数据集根据该key进行按顺序取值 + * @return + * @throws IOException + */ + public InputStream getExcelFile(List data, String sheetName, String[] headNames, + String[] colKeys, int colWidths[],String bDate) throws IOException { + this.bDate = bDate; + workbook = new HSSFWorkbook(); + sheet = workbook.createSheet(sheetName); + // 创建表头 startRow代表表体开始的行 + int startRow = createHeadCell( headNames, colWidths); + + // 创建表体数据 + HSSFCellStyle cellStyle = getStyle(14,2,false,true); // 建立新的cell样式 + setCellData(data, cellStyle, startRow, colKeys); + + //创建表尾 + createTailCell(data.size()+4,headNames.length); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + workbook.write(baos); + byte[] ba = baos.toByteArray(); + ByteArrayInputStream bais = new ByteArrayInputStream(ba); + return bais; + } + + /** + * 创建表头 + * + * @param headNames + * @param colWidths + */ + private int createHeadCell( String[] headNames, int colWidths[]) { + // 表头标题 + HSSFCellStyle titleStyle = getStyle(22,2,true,false);//样式 + createRow(titleStyle,0x549,"XX科技收入对账单",0,0,0,headNames.length-1); + //第二行 + HSSFCellStyle unitStyle = getStyle(12,1,true,false); + createRow(unitStyle,0x190,"单位: XX科技有限公司",1,1,0,headNames.length-1); + + //第三行左边部分 + year = Integer.parseInt(bDate.substring(0,4)); + String month = bDate.substring(4,6); + int m = Integer.parseInt(month)-1; + Calendar cal = Calendar.getInstance(); + cal.set(Calendar.YEAR,year); + cal.set(Calendar.MONTH,m);//从0开始 0代表一月 11代表12月 + int maxDate = cal.getActualMaximum(Calendar.DATE); + + sheet.addMergedRegion(new CellRangeAddress(2, 2, 0, 1)); + HSSFRow row = sheet.createRow(2); + row.setHeight((short) 0x190); + HSSFCell cell = row.createCell(0); + cell.setCellStyle(getStyle(12,1,true,false)); + cell.setCellValue("时间:"+year+"年"+month+"月"+"01日至"+year+"年"+month+"月"+maxDate+"日"); + + //第三行右边部分 + Date date = new Date(); + SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd日"); + sheet.addMergedRegion(new CellRangeAddress(2, 2, 3, 5)); + HSSFCell cell2 = row.createCell(3); + cell2.setCellStyle(getStyle(12,3,true,false)); + cell2.setCellValue("制表时间: "+sdf.format(date)); + + //第四行表头 + boolean b = (headNames != null && headNames.length > 0); + if (b) { + HSSFRow row2 = sheet.createRow(3); + row2.setHeight((short) 0x289); + HSSFCell fcell = null; + + HSSFCellStyle cellStyle = getStyle(15,2,true,true); // 建立新的cell样式 + + for (int i = 0; i < headNames.length; i++) { + fcell = row2.createCell(i); + + fcell.setCellStyle(cellStyle); + fcell.setCellValue(headNames[i]); + if (colWidths != null && i < colWidths.length) { + sheet.setColumnWidth(i, 32 * colWidths[i]); + } + } + } + return b ? 4 : 3; //从哪一行开始渲染表体 + } + + /** + * 创建表体数据 + * @param data 表体数据 + * @param cellStyle 样式 + * @param startRow 开始行 + * @param colKeys 值对应map的key + */ + private void setCellData(List data, HSSFCellStyle cellStyle, int startRow, + String[] colKeys) { + // 创建数据 + HSSFRow row = null; + HSSFCell cell = null; + int i = startRow; + + if (data != null && data.size() > 0) { + DecimalFormat df = new DecimalFormat("#0.00"); + for (Map rowData : data) { + row = sheet.createRow(i); + row.setHeight((short) 0x279); + int j = 0; + for (String key : colKeys) { + Object colValue = rowData.get(key); + if (key.equalsIgnoreCase("CITYNAME")){ + colValue = colValue+"XX科技有限公司"; + }else if (key.equalsIgnoreCase("ORDERSUM")||key.equalsIgnoreCase("TRANSFEE")||key.equalsIgnoreCase("ORDREALSUM")){ + colValue = df.format(colValue); + } + cell = row.createCell(j); + cell.setCellStyle(cellStyle); + if (colValue != null) { + cell.setCellType(HSSFCell.CELL_TYPE_STRING); + cell.setCellValue(colValue.toString()); + } + j++; + } + i++; + } + } + } + + /** + * 创建表尾 + * @param size + * @param length + */ + private void createTailCell(int size, int length) { + HSSFCellStyle remarkStyle1 = getStyle(11,1,false,false); + createRow(remarkStyle1,0x190,"经核对,确认以上数据真实无误。",size,size,0,length-2); + + HSSFCellStyle remarkStyle2 = getStyle(10,1,false,false); + createRow(remarkStyle2,0x160,"(联系人:XXX;联系电话:13xxxxxxxx;邮箱:123456789@qq.com)",size+1,size+1,0,length-2); + + HSSFRow row3 = sheet.createRow(size+2); + row3.setHeight((short) 0x379); + + sheet.addMergedRegion(new CellRangeAddress(size+3, size+3, 0, 1)); + HSSFRow row4 = sheet.createRow(size+3); + row4.setHeight((short) 0x190); + HSSFCell cell4 = row4.createCell(0); + cell4.setCellStyle(getStyle(11,1,false,false)); + cell4.setCellValue("单位核对人:"); + + sheet.addMergedRegion(new CellRangeAddress(size+3, size+3, 2, 4)); + HSSFCell cell15 = row4.createCell(2); + cell15.setCellStyle(getStyle(11,1,false,false)); + cell15.setCellValue("单位制表人:"); + + HSSFCellStyle dateStyle = getStyle(10,3,false,false); + createRow(dateStyle,0x150,"公司公章 ",size+8,size+8,0,length-2); + + createRow(dateStyle,0x150,year+"年 月 日",size+9,size+9,0,length-2); + + } + + + // 测试 + public static void main(String[] args) throws IOException { + Excel excel = new Excel(); + List data = new ArrayList(); + + LinkedHashMap e = new LinkedHashMap(); + + e.put("CITYNAME", "北京"); + e.put("ORDERCOUNT", "65"); + e.put("ORDERSUM", 930.38); + e.put("TRANSFEE", 2.28); + e.put("ORDREALSUM", 928.10); + e.put("REMARK", "通过1"); + data.add(e); + + e = new LinkedHashMap(); + e.put("CITYNAME", "上海"); + e.put("ORDERCOUNT", "50"); + e.put("ORDERSUM", 850.34); + e.put("TRANSFEE", 2.08); + e.put("ORDREALSUM", 848.26); + e.put("REMARK", "通过2"); + data.add(e); + + e = new LinkedHashMap(); + e.put("CITYNAME", "苏州"); + e.put("ORDERCOUNT", "10"); + e.put("ORDERSUM", 112.20); + e.put("TRANSFEE", 2.20); + e.put("ORDREALSUM", 55.00); + e.put("REMARK", "通过3"); + data.add(e); + + e = new LinkedHashMap(); + e.put("CITYNAME", "南京"); + e.put("ORDERCOUNT", "26"); + e.put("ORDERSUM", 210.12); + e.put("TRANSFEE", 0.51); + e.put("ORDREALSUM", 2409.61); + e.put("REMARK", "通过4"); + data.add(e); + + String[] headNames = { "单位名称", "收入笔数", "收入金额", "手续费(2.45‰)", "实际金额","备注" }; + String[] keys = { "CITYNAME", "ORDERCOUNT", "ORDERSUM","TRANSFEE","ORDREALSUM","REMARK"}; + int colWidths[] = { 300, 200, 200, 200, 200,300 }; + + String bDate = "201708"; + InputStream input = (excel.getExcelFile(data, "单位", headNames, keys, colWidths,bDate)); + + File f = new File("E:/2019/excel/excel.xls"); + if (f.exists()) + f.delete(); + f.createNewFile(); + FileOutputStream out = new FileOutputStream(f); + HSSFWorkbook book = new HSSFWorkbook(input); + book.write(out); + out.flush(); + out.close(); + } + +} diff --git a/download/src/main/java/com/sict/excel/utils/ExportExcelUtil.java b/download/src/main/java/com/sict/excel/utils/ExportExcelUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..2d32b50e3fd7e279b45dc1098be9b075e09881b7 --- /dev/null +++ b/download/src/main/java/com/sict/excel/utils/ExportExcelUtil.java @@ -0,0 +1,238 @@ +package com.sict.excel.utils; + +import java.io.IOException; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.text.SimpleDateFormat; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRichTextString; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFCellStyle; +import org.apache.poi.xssf.usermodel.XSSFColor; +import org.apache.poi.xssf.usermodel.XSSFFont; +import org.apache.poi.xssf.usermodel.XSSFRichTextString; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +/** + * 导出Excel + * + * @author liuyazhuang + * + * @param + */ +public class ExportExcelUtil { + + // 2007 版本以上 最大支持1048576行 + public final static String EXCEl_FILE_2007 = "2007"; + // 2003 版本 最大支持65536 行 + public final static String EXCEL_FILE_2003 = "2003"; + + /** + *

+ * 导出无头部标题行Excel
+ * 时间格式默认:yyyy-MM-dd hh:mm:ss
+ *

+ * + * @param title 表格标题 + * @param dataset 数据集合 + * @param out 输出流 + * @param version 2003 或者 2007,不传时默认生成2003版本 + */ + public HSSFSheet exportExcel(HSSFWorkbook workbook,String title, Collection dataset, String version) { + + return exportExcel2007(workbook,title, null, dataset, "yyyy-MM-dd HH:mm:ss"); + + } + + /** + *

+ * 导出带有头部标题行的Excel
+ * 时间格式默认:yyyy-MM-dd hh:mm:ss
+ *

+ * + * @param title 表格标题 + * @param headers 头部标题集合 + * @param dataset 数据集合 + * @param out 输出流 + * @param version 2003 或者 2007,不传时默认生成2003版本 + */ + public HSSFSheet exportExcel(HSSFWorkbook workbook,String title, String[] headers, Collection dataset, String version) { + + return exportExcel2007(workbook,title, headers, dataset, "yyyy-MM-dd HH:mm:ss"); + + } + + /** + *

+ * 通用Excel导出方法,利用反射机制遍历对象的所有字段,将数据写入Excel文件中
+ * 此版本生成2007以上版本的文件 (文件后缀:xlsx) + *

+ * + * @param title 表格标题名 + * @param headers 表格头部标题集合 + * @param dataset 需要显示的数据集合,集合中一定要放置符合JavaBean风格的类的对象。此方法支持的 + * JavaBean属性的数据类型有基本数据类型及String,Date + * @param out 与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中 + * @param pattern 如果有时间数据,设定输出格式。默认为"yyyy-MM-dd hh:mm:ss" + */ + @SuppressWarnings({ "unchecked", "rawtypes" }) + public HSSFSheet exportExcel2007(HSSFWorkbook workbook,String title, String[] headers, Collection dataset, + String pattern) { + // 声明一个工作薄 + //HSSFWorkbook workbook = new HSSFWorkbook(); + // 生成一个表格 + HSSFSheet sheet = workbook.createSheet(title); + // 设置表格默认列宽度为15个字节 + sheet.setDefaultColumnWidth(20); + // 生成一个样式 + HSSFCellStyle style = workbook.createCellStyle(); + // 设置这些样式 + // 背景色 + style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + style.setFillBackgroundColor(IndexedColors.PALE_BLUE.getIndex()); + style.setBorderBottom(XSSFCellStyle.BORDER_THIN); + style.setBorderLeft(XSSFCellStyle.BORDER_THIN); + style.setBorderRight(XSSFCellStyle.BORDER_THIN); + style.setBorderTop(XSSFCellStyle.BORDER_THIN); + style.setAlignment(XSSFCellStyle.ALIGN_LEFT); + // 生成一个字体 + HSSFFont font = workbook.createFont(); + // font.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD); + font.setFontName("宋体"); + font.setColor(IndexedColors.AUTOMATIC.getIndex()); + font.setFontHeightInPoints((short) 11); + // 把字体应用到当前的样式 + style.setFont(font); + // 生成并设置另一个样式 + HSSFCellStyle style2 = workbook.createCellStyle(); + style2.setFillForegroundColor(IndexedColors.WHITE.getIndex()); + style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + style2.setFillBackgroundColor(IndexedColors.WHITE.getIndex()); + style2.setBorderBottom(XSSFCellStyle.BORDER_THIN); + style2.setBorderLeft(XSSFCellStyle.BORDER_THIN); + style2.setBorderRight(XSSFCellStyle.BORDER_THIN); + style2.setBorderTop(XSSFCellStyle.BORDER_THIN); + style2.setAlignment(XSSFCellStyle.ALIGN_LEFT); + style2.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER); + // 生成另一个字体 + HSSFFont font2 = workbook.createFont(); + font2.setFontName("宋体"); + // font2.setBoldweight(XSSFFont.BOLDWEIGHT_NORMAL); + // 把字体应用到当前的样式 + style2.setFont(font2); + + // 产生表格标题行 + HSSFRow row = sheet.createRow(0); + HSSFCell cellHeader; + for (int i = 0; i < headers.length; i++) { + cellHeader = row.createCell(i); + cellHeader.setCellStyle(style); + cellHeader.setCellValue(new HSSFRichTextString(headers[i])); + } + + // 遍历集合数据,产生数据行 + Iterator it = dataset.iterator(); + int index = 0; + T t; + Field[] fields; + Field field; + HSSFRichTextString richString; + Pattern p = Pattern.compile("^//d+(//.//d+)?$"); + Matcher matcher; + String fieldName; + String getMethodName; + HSSFCell cell; + Class tCls; + Method getMethod; + Object value; + String textValue; + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + while (it.hasNext()) { + index++; + row = sheet.createRow(index); + t = (T) it.next(); + // 利用反射,根据JavaBean属性的先后顺序,动态调用getXxx()方法得到属性值 + fields = t.getClass().getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + cell = row.createCell(i); + cell.setCellStyle(style2); + field = fields[i]; + fieldName = field.getName(); + getMethodName = "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); + try { + tCls = t.getClass(); + getMethod = tCls.getMethod(getMethodName, new Class[] {}); + value = getMethod.invoke(t, new Object[] {}); + // 判断值的类型后进行强制类型转换 + textValue = null; + if (value instanceof Integer) { + cell.setCellValue((Integer) value); + } else if (value instanceof Float) { + textValue = String.valueOf((Float) value); + cell.setCellValue(textValue); + } else if (value instanceof Double) { + textValue = String.valueOf((Double) value); + cell.setCellValue(textValue); + } else if (value instanceof Long) { + cell.setCellValue((Long) value); + } + if (value instanceof Boolean) { + textValue = "是"; + if (!(Boolean) value) { + textValue = "否"; + } + } else if (value instanceof Date) { + textValue = sdf.format((Date) value); + } else { + // 其它数据类型都当作字符串简单处理 + if (value != null) { + textValue = value.toString(); + } + } + if (textValue != null) { + matcher = p.matcher(textValue); + if (matcher.matches()) { + // 是数字当作double处理 + cell.setCellValue(Double.parseDouble(textValue)); + } else { + richString = new HSSFRichTextString(textValue); + cell.setCellValue(richString); + } + } + } catch (SecurityException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } finally { + // 清理资源 + } + } + } + return sheet; + } +} \ No newline at end of file diff --git a/download/src/main/java/com/sict/excel/utils/SqlSessionUtil.java b/download/src/main/java/com/sict/excel/utils/SqlSessionUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..01377b3d88bfeab7c57d8598d33bd8e70557aa14 --- /dev/null +++ b/download/src/main/java/com/sict/excel/utils/SqlSessionUtil.java @@ -0,0 +1,68 @@ +package com.sict.excel.utils; + +import java.io.IOException; +import java.io.InputStream; + +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.session.SqlSessionFactoryBuilder; + +public class SqlSessionUtil { + + // 获取mybatis全局配置文件 + private static String resource = "mybatis-config.xml"; + + public static SqlSession getSession() throws IOException { + + InputStream inputStream = Resources.getResourceAsStream(resource); + // 读取配置文件的配置信息,利用SqlSessionFactoryBuilder创建sqlSessionFactory + SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); + // 利用sqlSessionFactory打开与数据库的会话 + SqlSession sqlSession = sqlSessionFactory.openSession(); + + return sqlSession; + + } + + private static String resource2 = "mybatis-geca.xml"; + public static SqlSession getGecaSession() throws IOException { + + InputStream inputStream = Resources.getResourceAsStream(resource2); + // 读取配置文件的配置信息,利用SqlSessionFactoryBuilder创建sqlSessionFactory + SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); + // 利用sqlSessionFactory打开与数据库的会话 + SqlSession sqlSession = sqlSessionFactory.openSession(); + + return sqlSession; + + } + + + private static String resource3 = "mybatis-qg.xml"; + public static SqlSession getQgSession() throws IOException { + + InputStream inputStream = Resources.getResourceAsStream(resource3); + // 读取配置文件的配置信息,利用SqlSessionFactoryBuilder创建sqlSessionFactory + SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); + // 利用sqlSessionFactory打开与数据库的会话 + SqlSession sqlSession = sqlSessionFactory.openSession(); + + return sqlSession; + + } + + + private static String resource4 = "mybatis-shchyy.xml"; + public static SqlSession getShchyySession() throws IOException { + + InputStream inputStream = Resources.getResourceAsStream(resource4); + // 读取配置文件的配置信息,利用SqlSessionFactoryBuilder创建sqlSessionFactory + SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); + // 利用sqlSessionFactory打开与数据库的会话 + SqlSession sqlSession = sqlSessionFactory.openSession(); + + return sqlSession; + + } +} diff --git a/download/src/main/resources/log4j.properties b/download/src/main/resources/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..a9080829460a43d154534843a2f5080173ed89cc --- /dev/null +++ b/download/src/main/resources/log4j.properties @@ -0,0 +1,5 @@ +log4j.rootLogger=DEBUG,A1 +log4j.logger.org.apache=DEBUG +log4j.appender.A1=org.apache.log4j.ConsoleAppender +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%t] [%c]-[%p] %m%n diff --git a/download/src/main/resources/mapper/DownloadMapper.xml b/download/src/main/resources/mapper/DownloadMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..74119246371016ac96ddbddcd9a20ed5c74be3bd --- /dev/null +++ b/download/src/main/resources/mapper/DownloadMapper.xml @@ -0,0 +1,774 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/download/src/main/resources/mybatis-config.xml b/download/src/main/resources/mybatis-config.xml new file mode 100644 index 0000000000000000000000000000000000000000..ee71585d232ba67d3d1cb934d745f824921f018e --- /dev/null +++ b/download/src/main/resources/mybatis-config.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/download/src/main/resources/mybatis-geca.xml b/download/src/main/resources/mybatis-geca.xml new file mode 100644 index 0000000000000000000000000000000000000000..38e11311cf207175606560be18293959a451f8f0 --- /dev/null +++ b/download/src/main/resources/mybatis-geca.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/download/src/main/resources/mybatis-qg.xml b/download/src/main/resources/mybatis-qg.xml new file mode 100644 index 0000000000000000000000000000000000000000..8aadd127a6a3633947ce2d9b827dd93900402f93 --- /dev/null +++ b/download/src/main/resources/mybatis-qg.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/download/src/main/resources/mybatis-shchyy.xml b/download/src/main/resources/mybatis-shchyy.xml new file mode 100644 index 0000000000000000000000000000000000000000..99a386aade19f254411c2f4ba5ef9435f412ee26 --- /dev/null +++ b/download/src/main/resources/mybatis-shchyy.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/download/target/classes/META-INF/MANIFEST.MF b/download/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000000000000000000000000000000000000..476fb6ae6b49db54dc38925d68780453a0eaba41 --- /dev/null +++ b/download/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Built-By: Cathie +Build-Jdk: 1.8.0_181 +Created-By: Maven Integration for Eclipse + diff --git a/download/target/classes/META-INF/maven/download/download/pom.properties b/download/target/classes/META-INF/maven/download/download/pom.properties new file mode 100644 index 0000000000000000000000000000000000000000..0f9389c03d7a1fe70b0838f200e404c4e50e03ec --- /dev/null +++ b/download/target/classes/META-INF/maven/download/download/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Fri Nov 22 09:15:51 CST 2019 +version=1.0-SNAPSHOT +groupId=download +m2e.projectName=download +m2e.projectLocation=E\:\\BIGDATA\\HadoopSpace\\download +artifactId=download diff --git a/download/target/classes/META-INF/maven/download/download/pom.xml b/download/target/classes/META-INF/maven/download/download/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..bf4518acd3170cc76467ef7ec4d82abb869de694 --- /dev/null +++ b/download/target/classes/META-INF/maven/download/download/pom.xml @@ -0,0 +1,109 @@ + + + 4.0.0 + + download + download + 1.0-SNAPSHOT + + + + + + + org.mybatis + mybatis + 3.3.0 + + + + mysql + mysql-connector-java + 5.1.29 + + + + junit + junit + 4.12 + + + log4j + log4j + 1.2.17 + + + + org.apache.commons + commons-lang3 + 3.5 + + + org.apache.poi + poi-scratchpad + 3.11-beta2 + + + org.apache.poi + poi-ooxml + 3.11-beta2 + + + org.apache.poi + poi-ooxml-schemas + 3.11-beta2 + + + org.apache.poi + poi-excelant + 3.11-beta2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + src/main/resources + + **/*.* + + + + + + \ No newline at end of file diff --git a/download/target/classes/com/sict/excel/bo/AnalysisGraphicBO.class b/download/target/classes/com/sict/excel/bo/AnalysisGraphicBO.class new file mode 100644 index 0000000000000000000000000000000000000000..26ca72a873b534efbdb1d34a05198258077b8b2a Binary files /dev/null and b/download/target/classes/com/sict/excel/bo/AnalysisGraphicBO.class differ diff --git a/download/target/classes/com/sict/excel/dto/AnalysisGraphicDTO.class b/download/target/classes/com/sict/excel/dto/AnalysisGraphicDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..c5208a1a333be4b00086a54d0ec61f52501029c0 Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/AnalysisGraphicDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/AnalysisProvinceDTO.class b/download/target/classes/com/sict/excel/dto/AnalysisProvinceDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..0f8575530fec15563a3f2a9840f84c6a5c1bc58c Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/AnalysisProvinceDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/DiagnosisDTO.class b/download/target/classes/com/sict/excel/dto/DiagnosisDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..8bbbb0249a05d0f9fa07f10d2e3d67c889025287 Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/DiagnosisDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/EarlyCancerHospitalDTO.class b/download/target/classes/com/sict/excel/dto/EarlyCancerHospitalDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..5b6c502638b28f7a036fc534d2bdaf5c085ade06 Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/EarlyCancerHospitalDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/EarlyCancerRankDTO.class b/download/target/classes/com/sict/excel/dto/EarlyCancerRankDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..a414428c31cdadaea4ee984ef756967049ea221b Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/EarlyCancerRankDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/GastroscopeTestDTO.class b/download/target/classes/com/sict/excel/dto/GastroscopeTestDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..e8b2f5d1c423fafc5a78ce520d03ee0bccbd9164 Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/GastroscopeTestDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/HpPositiveDTO.class b/download/target/classes/com/sict/excel/dto/HpPositiveDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..154f7de52d0d154bf977a04c65521a36ccd4ba9a Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/HpPositiveDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/RiskDTO.class b/download/target/classes/com/sict/excel/dto/RiskDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..e1ebe6a5892c852b36ea61365d017200cc892a21 Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/RiskDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/ScreeningRankDTO.class b/download/target/classes/com/sict/excel/dto/ScreeningRankDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..493bfb94b41d55db9093c693b9a04d65d67d07b5 Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/ScreeningRankDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/ScreeningRankProvinceDTO.class b/download/target/classes/com/sict/excel/dto/ScreeningRankProvinceDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..e647ed414584cc4c4c804f9617b85e109e8245c7 Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/ScreeningRankProvinceDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/SerumStatisticsDTO.class b/download/target/classes/com/sict/excel/dto/SerumStatisticsDTO.class new file mode 100644 index 0000000000000000000000000000000000000000..76f5b4eaad63d3e94f5f3d6b62c710c84286655a Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/SerumStatisticsDTO.class differ diff --git a/download/target/classes/com/sict/excel/dto/Student.class b/download/target/classes/com/sict/excel/dto/Student.class new file mode 100644 index 0000000000000000000000000000000000000000..cf6a154f45aa8046789a8a813e81f2087998f6b8 Binary files /dev/null and b/download/target/classes/com/sict/excel/dto/Student.class differ diff --git a/download/target/classes/com/sict/excel/mapper/DownloadMapper.class b/download/target/classes/com/sict/excel/mapper/DownloadMapper.class new file mode 100644 index 0000000000000000000000000000000000000000..cb62de49c2efc4fd9a399986e9faffffbf94bbc6 Binary files /dev/null and b/download/target/classes/com/sict/excel/mapper/DownloadMapper.class differ diff --git a/download/target/classes/com/sict/excel/myExcel.class b/download/target/classes/com/sict/excel/myExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..a3cb874b6157992c3b56c9f7f33a7ae306c2b6a0 Binary files /dev/null and b/download/target/classes/com/sict/excel/myExcel.class differ diff --git a/download/target/classes/com/sict/excel/test/AnalysisGraphicExcel.class b/download/target/classes/com/sict/excel/test/AnalysisGraphicExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..50fcb9e54f0bf24825da65541616016709d69b19 Binary files /dev/null and b/download/target/classes/com/sict/excel/test/AnalysisGraphicExcel.class differ diff --git a/download/target/classes/com/sict/excel/test/AnalysisHospitalEarlyCancerExcel.class b/download/target/classes/com/sict/excel/test/AnalysisHospitalEarlyCancerExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..646d533e20cf095971b5b77680993b82f991d3b9 Binary files /dev/null and b/download/target/classes/com/sict/excel/test/AnalysisHospitalEarlyCancerExcel.class differ diff --git a/download/target/classes/com/sict/excel/test/AnalysisProvinceExcel.class b/download/target/classes/com/sict/excel/test/AnalysisProvinceExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..eccd126089fca4475788f85d9a88177d5b23de1a Binary files /dev/null and b/download/target/classes/com/sict/excel/test/AnalysisProvinceExcel.class differ diff --git a/download/target/classes/com/sict/excel/test/Diagnosis.class b/download/target/classes/com/sict/excel/test/Diagnosis.class new file mode 100644 index 0000000000000000000000000000000000000000..0ff17d4982b763d581042f1ac14bc15cdb041ee9 Binary files /dev/null and b/download/target/classes/com/sict/excel/test/Diagnosis.class differ diff --git a/download/target/classes/com/sict/excel/test/GastroscopeTest.class b/download/target/classes/com/sict/excel/test/GastroscopeTest.class new file mode 100644 index 0000000000000000000000000000000000000000..28921d675624e6cae374fd5816b310edb5fbe2a9 Binary files /dev/null and b/download/target/classes/com/sict/excel/test/GastroscopeTest.class differ diff --git a/download/target/classes/com/sict/excel/test/ProvinceEarlyCancerRankExcel.class b/download/target/classes/com/sict/excel/test/ProvinceEarlyCancerRankExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..5b4c61c417a9a8276d32163962ac2b1e294d4882 Binary files /dev/null and b/download/target/classes/com/sict/excel/test/ProvinceEarlyCancerRankExcel.class differ diff --git a/download/target/classes/com/sict/excel/test/ScreeningRankGecaExcel.class b/download/target/classes/com/sict/excel/test/ScreeningRankGecaExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..ef438ee145edb636ff1075d140d559b63e1f46ef Binary files /dev/null and b/download/target/classes/com/sict/excel/test/ScreeningRankGecaExcel.class differ diff --git a/download/target/classes/com/sict/excel/test/ScreeningRankProvinceExcel.class b/download/target/classes/com/sict/excel/test/ScreeningRankProvinceExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..ae103d5b24272371344cde1d61c1b2943baa229a Binary files /dev/null and b/download/target/classes/com/sict/excel/test/ScreeningRankProvinceExcel.class differ diff --git a/download/target/classes/com/sict/excel/test/ScreeningRankQgExcel.class b/download/target/classes/com/sict/excel/test/ScreeningRankQgExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..c1a1b5701ce9196bc05a8432cb8352cbbbe682ee Binary files /dev/null and b/download/target/classes/com/sict/excel/test/ScreeningRankQgExcel.class differ diff --git a/download/target/classes/com/sict/excel/test/ScreeningRankShchyyExcel.class b/download/target/classes/com/sict/excel/test/ScreeningRankShchyyExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..12b15aa77dde467c188d97b825b07293c7471ad3 Binary files /dev/null and b/download/target/classes/com/sict/excel/test/ScreeningRankShchyyExcel.class differ diff --git a/download/target/classes/com/sict/excel/test/SerumTest.class b/download/target/classes/com/sict/excel/test/SerumTest.class new file mode 100644 index 0000000000000000000000000000000000000000..effb422d82673cc722d9cad4dc04c637278d1a22 Binary files /dev/null and b/download/target/classes/com/sict/excel/test/SerumTest.class differ diff --git a/download/target/classes/com/sict/excel/test/TestExportExcel.class b/download/target/classes/com/sict/excel/test/TestExportExcel.class new file mode 100644 index 0000000000000000000000000000000000000000..c640846f6e0d00e2fcc7b5ae2511842af797e3a7 Binary files /dev/null and b/download/target/classes/com/sict/excel/test/TestExportExcel.class differ diff --git a/download/target/classes/com/sict/excel/utils/Excel.class b/download/target/classes/com/sict/excel/utils/Excel.class new file mode 100644 index 0000000000000000000000000000000000000000..46b513fd6791f312e188a0f337594b4f264e6153 Binary files /dev/null and b/download/target/classes/com/sict/excel/utils/Excel.class differ diff --git a/download/target/classes/com/sict/excel/utils/ExportExcelUtil.class b/download/target/classes/com/sict/excel/utils/ExportExcelUtil.class new file mode 100644 index 0000000000000000000000000000000000000000..6f9709994130fd9adae754bcc15c3e94ea20f77d Binary files /dev/null and b/download/target/classes/com/sict/excel/utils/ExportExcelUtil.class differ diff --git a/download/target/classes/com/sict/excel/utils/SqlSessionUtil.class b/download/target/classes/com/sict/excel/utils/SqlSessionUtil.class new file mode 100644 index 0000000000000000000000000000000000000000..0da2505c6d2c53e632cfee36970497c37c1bd01d Binary files /dev/null and b/download/target/classes/com/sict/excel/utils/SqlSessionUtil.class differ diff --git a/download/target/classes/log4j.properties b/download/target/classes/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..a9080829460a43d154534843a2f5080173ed89cc --- /dev/null +++ b/download/target/classes/log4j.properties @@ -0,0 +1,5 @@ +log4j.rootLogger=DEBUG,A1 +log4j.logger.org.apache=DEBUG +log4j.appender.A1=org.apache.log4j.ConsoleAppender +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%t] [%c]-[%p] %m%n diff --git a/download/target/classes/mapper/DownloadMapper.xml b/download/target/classes/mapper/DownloadMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..74119246371016ac96ddbddcd9a20ed5c74be3bd --- /dev/null +++ b/download/target/classes/mapper/DownloadMapper.xml @@ -0,0 +1,774 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/download/target/classes/mybatis-config.xml b/download/target/classes/mybatis-config.xml new file mode 100644 index 0000000000000000000000000000000000000000..ee71585d232ba67d3d1cb934d745f824921f018e --- /dev/null +++ b/download/target/classes/mybatis-config.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/download/target/classes/mybatis-geca.xml b/download/target/classes/mybatis-geca.xml new file mode 100644 index 0000000000000000000000000000000000000000..38e11311cf207175606560be18293959a451f8f0 --- /dev/null +++ b/download/target/classes/mybatis-geca.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/download/target/classes/mybatis-qg.xml b/download/target/classes/mybatis-qg.xml new file mode 100644 index 0000000000000000000000000000000000000000..8aadd127a6a3633947ce2d9b827dd93900402f93 --- /dev/null +++ b/download/target/classes/mybatis-qg.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/download/target/classes/mybatis-shchyy.xml b/download/target/classes/mybatis-shchyy.xml new file mode 100644 index 0000000000000000000000000000000000000000..99a386aade19f254411c2f4ba5ef9435f412ee26 --- /dev/null +++ b/download/target/classes/mybatis-shchyy.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file