Commit c7157f8d by wangweidong

土工平台修改

parent d0cfbd30
......@@ -230,7 +230,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
List<SoilExperimentVO> voList = soilExperimentService.listVOByIds(ids);
boolean teShu = "界限含水率 (碟式液限仪多点法)试验记录表".equals(template.getName());
if (CollectionUtils.isEmpty(voList)){
logger.error("----------------------1");
......@@ -390,25 +390,6 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
int insertCount = voList.size()-templateSampleNum;
List<Integer> integerList = new ArrayList<>();
logger.error("---------------------11");
for (SoilOriginalTemplateConfig config:configList) {
Integer a = config.getMergeBegin();
Integer b = config.getMergeEnd();
if (null == a || b == null){
continue;
}
for (int i = a; i <= b ; i++) {
integerList.add(i) ;
}
}
logger.error("----------------------12");
for (int m = 0 ; m<insertCount ;m++) {
for (int i = 0; i < sampleMergerNum; i++) {
sheetOne.shiftRows(insertRow, sheetOne.getLastRowNum(), 1,true,false);
......@@ -421,10 +402,6 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
}
logger.error("----------------------14");
int sn = 1;
for (SoilExperimentVO vo:voList) {
XSSFRow xssfRow = sheetOne.getRow(beginRow);
......@@ -516,20 +493,54 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
continue;
}
int step= config.getMergeRowNum();
if (step==1 && config.getMergeEnd() ==config.getMergeBegin()){
if (step==1 && config.getMergeEnd() == config.getMergeBegin()){
continue;
}
if (null != config.getColumnPlace() && null != config.getMergeRowNum()){
Integer sampleBgMum = template.getSampleBeginRow()+templateSampleNum*sampleMergerNum;
Integer sampleEnMum = template.getSampleBeginRow()+voList.size()*sampleMergerNum-1;
if (!teShu){
Integer sampleBgMum = template.getSampleBeginRow()+templateSampleNum*sampleMergerNum;
Integer sampleEnMum = template.getSampleBeginRow()+voList.size()*sampleMergerNum-1;
while (sampleBgMum<=sampleEnMum) {
sheetOne.addMergedRegion(new CellRangeAddress(sampleBgMum,sampleBgMum+step-1,config.getMergeBegin(),config.getMergeEnd()));
sampleBgMum=sampleBgMum+step;
}
}else{
if (config.getColumnPlace() !=10 &&config.getColumnPlace() !=12 ){
Integer sampleBgMum = template.getSampleBeginRow()+templateSampleNum*sampleMergerNum;
Integer sampleEnMum = template.getSampleBeginRow()+voList.size()*sampleMergerNum-1;
while (sampleBgMum<=sampleEnMum) {
sheetOne.addMergedRegion(new CellRangeAddress(sampleBgMum,sampleBgMum+step-1,config.getMergeBegin(),config.getMergeEnd()));
sampleBgMum=sampleBgMum+step;
}
}else{
Integer sampleBgMum = template.getSampleBeginRow()+templateSampleNum*sampleMergerNum;
Integer sampleEnMum = template.getSampleBeginRow()+voList.size()*sampleMergerNum-1;
int indexJishu=0;
while (sampleBgMum<=sampleEnMum) {
if (indexJishu%2==0){
sheetOne.addMergedRegion(new CellRangeAddress(sampleBgMum,sampleBgMum+3-1,config.getMergeBegin(),config.getMergeEnd()));
sampleBgMum=sampleBgMum+3;
}else{
sheetOne.addMergedRegion(new CellRangeAddress(sampleBgMum,sampleBgMum+2-1,config.getMergeBegin(),config.getMergeEnd()));
sampleBgMum=sampleBgMum+2;
}
indexJishu++;
}
}
while (sampleBgMum<=sampleEnMum) {
sheetOne.addMergedRegion(new CellRangeAddress(sampleBgMum,sampleBgMum+step-1,config.getMergeBegin(),config.getMergeEnd()));
sampleBgMum=sampleBgMum+step;
}
}
}
logger.error("----------------------15");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment