|
@@ -1201,20 +1201,22 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
for(NodeTable mt:mainTableList) {
|
|
for(NodeTable mt:mainTableList) {
|
|
tec.getKeyMappers().stream().filter(e -> e.getPkId().equals(mt.getPKeyId())).map(KeyMapper::getCode).forEach(e -> {
|
|
tec.getKeyMappers().stream().filter(e -> e.getPkId().equals(mt.getPKeyId())).map(KeyMapper::getCode).forEach(e -> {
|
|
FormData target = tec.formDataMap.get(e);
|
|
FormData target = tec.formDataMap.get(e);
|
|
- int capacity = target.getCoordsList().size();
|
|
|
|
- List<ElementData> eds = target.getValues();
|
|
|
|
- if (eds.size() > capacity) {
|
|
|
|
- if (capacity > 1) {
|
|
|
|
- /*元素每页单元格数量大于1则重新视为业务数据,重新计算增页*/
|
|
|
|
- target.setAddPages((eds.size() / capacity) - 1);
|
|
|
|
- } else {
|
|
|
|
- /*表头表尾元素只留首页的内容*/
|
|
|
|
- target.setValues(eds.stream().limit(capacity).collect(Collectors.toList()));
|
|
|
|
|
|
+ if(target!=null) {
|
|
|
|
+ int capacity = target.getCoordsList().size();
|
|
|
|
+ List<ElementData> eds = target.getValues();
|
|
|
|
+ if (eds.size() > capacity) {
|
|
|
|
+ if (capacity > 1) {
|
|
|
|
+ /*元素每页单元格数量大于1则重新视为业务数据,重新计算增页*/
|
|
|
|
+ target.setAddPages((eds.size() / capacity) - 1);
|
|
|
|
+ } else {
|
|
|
|
+ /*表头表尾元素只留首页的内容*/
|
|
|
|
+ target.setValues(eds.stream().limit(capacity).collect(Collectors.toList()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (target.getAddPages() > 0) {
|
|
|
|
+ /*筛选元素长度超1页的元素*/
|
|
|
|
+ inspectionList.add(target);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if(target.getAddPages()>0){
|
|
|
|
- /*筛选元素长度超1页的元素*/
|
|
|
|
- inspectionList.add(target);
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -1271,13 +1273,19 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
/*引入附表*/
|
|
/*引入附表*/
|
|
private void linkSub( List<NodeTable> subTabList ,TableElementConverter tec){
|
|
private void linkSub( List<NodeTable> subTabList ,TableElementConverter tec){
|
|
boolean pd=tec.getTableAll().stream().anyMatch(e->e.getTableType().equals(5));
|
|
boolean pd=tec.getTableAll().stream().anyMatch(e->e.getTableType().equals(5));
|
|
- WbsTreePrivate sub = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().and(e->e.eq(WbsTreePrivate::getNodeName, pd?"质量检验评定表(附表)":"质量检验表(附表)").or().eq(WbsTreePrivate::getFullName, pd?"质量检验评定表(附表)":"质量检验表(附表)")).eq(WbsTreePrivate::getProjectId, tec.getProjectId()).eq(WbsTreePrivate::getIsLinkTable,2));
|
|
|
|
|
|
+ /*是否养护工程项目*/
|
|
|
|
+ boolean yh=tec.getProjectId().equals(1706913020435161089L);
|
|
|
|
+ String[] pdfb=new String[]{"质量检验评定表(附表)"};
|
|
|
|
+ if(yh){
|
|
|
|
+ pdfb[0]= "质量检验评定表(附表)-养护";
|
|
|
|
+ }
|
|
|
|
+ WbsTreePrivate sub = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().and(e->e.eq(WbsTreePrivate::getNodeName, pd? pdfb[0] :"质量检验表(附表)").or().eq(WbsTreePrivate::getFullName, pd?pdfb[0]:"质量检验表(附表)")).eq(WbsTreePrivate::getProjectId, tec.getProjectId()).eq(WbsTreePrivate::getIsLinkTable,2));
|
|
if (sub == null) {
|
|
if (sub == null) {
|
|
tec.getLog().put(FormulaLog.SUB_TAB,"该项目没有挂有附表信息");
|
|
tec.getLog().put(FormulaLog.SUB_TAB,"该项目没有挂有附表信息");
|
|
} else {
|
|
} else {
|
|
this.addWbsTreeContractInfo(tec.getCurrentNode().getPkId().toString(), sub.getPKeyId().toString(), tec.getContractId());
|
|
this.addWbsTreeContractInfo(tec.getCurrentNode().getPkId().toString(), sub.getPKeyId().toString(), tec.getContractId());
|
|
NodeTable one = tec.getTableAll().get(0);
|
|
NodeTable one = tec.getTableAll().get(0);
|
|
- WbsTreeContract wtc = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getParentId, one.getParentId()).eq(WbsTreeContract::getContractId,tec.getContractId()).eq(WbsTreeContract::getWbsId, one.getWbsId()).and(e->e.eq(WbsTreeContract::getNodeName, pd?"质量检验评定表(附表)":"质量检验表(附表)").or().eq(WbsTreeContract::getFullName, pd?"质量检验评定表(附表)":"质量检验表(附表)")));
|
|
|
|
|
|
+ WbsTreeContract wtc = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getParentId, one.getParentId()).eq(WbsTreeContract::getContractId,tec.getContractId()).eq(WbsTreeContract::getWbsId, one.getWbsId()).and(e->e.eq(WbsTreeContract::getNodeName, pd?pdfb[0]:"质量检验表(附表)").or().eq(WbsTreeContract::getFullName, pd?pdfb[0]:"质量检验表(附表)")));
|
|
if (wtc != null) {
|
|
if (wtc != null) {
|
|
/*附表的顺序在检验单或者评定表之后,默认最后*/
|
|
/*附表的顺序在检验单或者评定表之后,默认最后*/
|
|
int sort=tec.getTableAll().stream().filter(e ->e.getTableType().equals(1) || e.getTableType().equals(5)).map(NodeTable::getSort).max(Integer::compareTo).orElse(1000);
|
|
int sort=tec.getTableAll().stream().filter(e ->e.getTableType().equals(1) || e.getTableType().equals(5)).map(NodeTable::getSort).max(Integer::compareTo).orElse(1000);
|