Prechádzať zdrojové kódy

Merge branch 'master' of http://47.110.251.215:3000/java_org/bladex

huangtf 2 rokov pred
rodič
commit
607e8938dc

+ 5 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -31,15 +31,17 @@ import org.springblade.manager.mapper.FormulaMapper;
 import org.springblade.manager.service.*;
 import org.springblade.manager.vo.AppWbsTreeContractVO;
 import org.springblade.manager.vo.CurrentNode;
+import org.springframework.context.annotation.Scope;
+import org.springframework.context.annotation.ScopedProxyMode;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
+import org.springframework.web.context.WebApplicationContext;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -53,6 +55,7 @@ import java.util.stream.Stream;
 
 @Service
 @RequiredArgsConstructor
+@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
 public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula> implements IFormulaService {
 
     private final IWbsParamService wpService;
@@ -759,7 +762,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         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(",")));
-            this.constantMap.put("CKD",this.checkDate.stream().flatMap(k->k.getValues().stream()).map(ElementData::stringValue).map(DateTime::new).reduce((a, b) -> Comparator.<DateTime>reverseOrder().compare(a, b) <= 0 ? a : b).orElse(null));
+            this.constantMap.put("CKD",this.checkDate.stream().flatMap(k->k.getValues().stream()).map(ElementData::stringValue).reduce((a, b) -> Comparator.<DateTime>reverseOrder().compare(new DateTime(a), new DateTime(b)) <= 0 ? a : b).orElse(null));
             this.summary.forEach(e->{
                 /*处理脚本*/
                 e.getFormula().setFormula(e.getFormula().getNumber());