|
@@ -876,7 +876,19 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
public void summaryCalc(){
|
|
|
if(this.summary.size()>0){
|
|
|
/**/
|
|
|
- this.constantMap.put(CHECK_ITEMS,this.checkItems.stream().filter(fdTmp->fdTmp.getValues().stream().map(ElementData::getValue).anyMatch(e->StringUtils.isNotEmpty(e)&&StringUtils.isNotEquals("/",e))).map(FormData::getEName).map(FormulaUtils::parseItemName).distinct().collect(Collectors.joining(",")));
|
|
|
+ List<String> result=this.checkItems.stream().filter(fdTmp->fdTmp.getValues().stream().map(ElementData::getValue).anyMatch(e->StringUtils.isNotEmpty(e)&&StringUtils.isNotEquals("/",e))).map(FormData::getEName).map(FormulaUtils::parseItemName).distinct().collect(Collectors.toList());
|
|
|
+ Optional<FormData> opk= this.summary.stream().filter(FormData::executable).filter(f->StringUtils.isEquals(f.getFormula().getNumber(),CHECK_ITEMS)).findAny();
|
|
|
+ List<String> history=null;
|
|
|
+ if(opk.isPresent()&&!opk.get().empty()){
|
|
|
+ /*假如已经存在内容,则需要筛选出手填部分*/
|
|
|
+ history= Arrays.asList(opk.get().getValues().get(0).stringValue().replaceAll("[\\s\\n]+","").split("[,、,]"));
|
|
|
+ }
|
|
|
+ if(history!=null&&history.size()>0){
|
|
|
+ List<String> itemAll=this.checkItems.stream().map(FormData::getEName).map(FormulaUtils::parseItemName).distinct().collect(Collectors.toList());
|
|
|
+ List<String> customize=history.stream().filter(s->!itemAll.contains(s)).collect(Collectors.toList());
|
|
|
+ result.addAll(customize);
|
|
|
+ }
|
|
|
+ this.constantMap.put(CHECK_ITEMS,result);
|
|
|
this.constantMap.put("CKD",this.checkDate.stream().flatMap(k->k.getValues().stream()).map(ElementData::stringValue).filter(StringUtils::isNotEmpty).reduce((a, b) -> Comparator.<DateTime>reverseOrder().compare(new DateTime(a), new DateTime(b)) <= 0 ? a : b).orElse(null));
|
|
|
this.summary.forEach(e->{
|
|
|
/*处理脚本*/
|
|
@@ -896,6 +908,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
/**分项汇总数据*/
|
|
|
public void doForDataBlock(){
|
|
|
try {
|