浏览代码

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

huangtf 2 年之前
父节点
当前提交
ef10c42976

+ 2 - 2
blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/LargeFileEndpoint.java

@@ -207,7 +207,7 @@ public class LargeFileEndpoint {
 		// 获取文件路径
 		/**Windows文件路径要加在哪个盘**/
 //		String filePath = "D:/www/wwwroot/Users/hongchuangyanfa/Desktop/Desktop/ceshi";
-		String filePath ="D:" +ParamCache.getValue(CommonConstant.SYS_LOCAL_URL)+"largeFile/";
+		String filePath =ParamCache.getValue(CommonConstant.SYS_LOCAL_URL)+"largeFile/";
 		// 创建文件夹
 //		getAbsoluteFile(filePath, fileName);
 //		new File(filePath, fileName);
@@ -350,7 +350,7 @@ public class LargeFileEndpoint {
 	 * 构建上传完整目录
 	 */
 	private String buildUploadDir() {
-		String fullDir ="D:" +ParamCache.getValue(CommonConstant.SYS_LOCAL_URL)+"largeFile/";
+		String fullDir =ParamCache.getValue(CommonConstant.SYS_LOCAL_URL)+"largeFile/";
 		File dir = new File(fullDir);
 		if (!dir.exists()) {
 			dir.mkdirs();

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/FormulaMileage.java

@@ -14,7 +14,10 @@ import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.formula.FormulaStrategy;
 import org.springblade.manager.formula.KeyMapper;
 import org.springblade.manager.formula.Mileage;
+import org.springframework.context.annotation.Scope;
+import org.springframework.context.annotation.ScopedProxyMode;
 import org.springframework.stereotype.Component;
+import org.springframework.web.context.WebApplicationContext;
 
 import java.util.*;
 import java.util.regex.Pattern;
@@ -27,6 +30,7 @@ import java.util.stream.Collectors;
  */
 @Component
 @Data
+@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
 public class FormulaMileage implements FormulaStrategy {
     private FormData cur;
     private final MileageClient mileageClient;

+ 5 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/FormulaTurnPoint.java

@@ -10,7 +10,11 @@ import org.springblade.manager.dto.ElementData;
 import org.springblade.manager.dto.FormData;
 import org.springblade.manager.entity.Formula;
 import org.springblade.manager.formula.*;
+import org.springframework.context.annotation.Scope;
+import org.springframework.context.annotation.ScopedProxyMode;
 import org.springframework.stereotype.Component;
+import org.springframework.web.context.WebApplicationContext;
+
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
@@ -24,6 +28,7 @@ import static org.springblade.manager.formula.TurnPoint.*;
  */
 @Component
 @Data
+@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
 public class FormulaTurnPoint implements FormulaStrategy {
     public static final String TURN_REG = "(?<=T\\(com.mixsmart.utils.CustomFunction\\).TURNPOINT\\()([^)]+)(?=))";
     private FormData cur;

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

@@ -154,18 +154,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         this.constantMap.put(TABLE_LIST,tableList);
         /*通过判断元素名称来确定,加入汇总公式延后执行*/
         this.constantMap.put("tableNames",tableList.stream().filter(e->StringUtils.isEquals(e.getIsBussShow(),1)).map(WbsTreeContract::getNodeName).collect(Collectors.toList()));
-        /*检查是否有跨节点数据*/
-        /*获取type=1的检验单或者type=4的监表*/
-//        List<Map<String,Object>>  inspectionElementMaps = new ArrayList<>();
-//        Optional<AppWbsTreeContractVO> wop=tableList.stream().filter(e->e.getNodeName().contains("检验单")).findAny();
-//        if(wop.isPresent()){
-//            /*检验单或者监表的*/
-//            inspectionElementMaps=  this.jdbcTemplate.queryForList(" select c.e_name name ,b.tab_en_name tableName,c.e_key ekey from m_wbs_tree_contract a join m_table_info b on a.init_table_name=b.tab_en_name join m_wbs_form_element c on c.f_id= b.id where a.p_key_id=" + wop.get().getPKeyId());
-//        }
+
         List<String> missingList = new ArrayList<>();
-//        List<Map<String, Object>> finalInspectionElementMaps = inspectionElementMaps;
-//        List<String> cki =new ArrayList<>();
-//        AtomicReference<String> ckd= new AtomicReference<>("");
         this.formDataList.forEach(fd->{
             if(fd.executable()){
                 relyParse(fd.getFormula());
@@ -178,32 +168,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                         }
                     });
                 }
-//                if(StringUtils.isEquals("CKI",f.getNumber())){
-//                    finalInspectionElementMaps.forEach(m->{
-//                        String name = StringUtils.handleNull(m.get("name"));
-//                        if(name.contains("实测值")&&name.contains("偏差值")){
-//                            String ekey = StringUtils.handleNull(m.get("tableName"))+":"+StringUtils.handleNull(m.get("ekey"));
-//                            cki.add(ekey);
-//                            if(this.formDataMap.values().stream().map(FormData::getCode).noneMatch(k->StringUtils.isEquals(k,ekey))){
-//                                missingList.add(ekey);
-//                            }
-//                        }
-//                    });
-//                    f.setFormula("CKI");
-//                }else  if(StringUtils.isEquals("CKD",f.getNumber())){
-//                    finalInspectionElementMaps.forEach(m->{
-//                        String name = StringUtils.handleNull(m.get("name"));
-//                        if(name.contains("检验日期")){
-//                            String ekey = StringUtils.handleNull(m.get("tableName"))+":"+StringUtils.handleNull(m.get("ekey"));
-//                            ckd.set(ekey);
-//                            if(!this.formDataMap.containsKey(ekey)&&this.formDataMap.values().stream().map(FormData::getCode).noneMatch(k->StringUtils.isEquals(k,ekey))){
-//                                missingList.add(ekey);
-//                            }
-//                        }
-//                    });
-//                    f.setFormula("CKD");
-//                }
-
             }
         });
 
@@ -211,26 +175,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         if(Func.isNotEmpty(missingList)){
             this.tec.getLog().append("【没有能加载的跨节点数据:").append(missingList.stream().map(e->e.replaceAll("'","")).collect(Collectors.joining(","))).append("】");
         }
-//        if(Func.isNotEmpty(cki)){
-//           /*检验内容*/
-//            List<String> sb = new ArrayList<>();
-//            for(String s:cki){
-//                FormData fdTmp=this.formDataMap.get(s);
-//                if(fdTmp!=null&&fdTmp.getValues().stream().map(ElementData::getValue).anyMatch(e->StringUtils.isNotEmpty(e)&&StringUtils.isNotEquals("/",e))){
-//                   sb.add(FormulaUtils.parseItemName(fdTmp.getEName()));
-//                }
-//            }
-//            if(sb.size()>0){
-//                this.constantMap.put(CHECK_ITEMS,sb.stream().distinct().filter(StringUtils::isNotEmpty).collect(Collectors.joining(",")));
-//            }
-//        }
-//        if(Func.isNotBlank(ckd.get())){
-//            /*检验时间*/
-//            FormData fdTmp =   this.formDataMap.get(ckd.get());
-//            if(fdTmp!=null){
-//                this.constantMap.put("CKD",fdTmp.getValues().stream().map(ElementData::stringValue).collect(Collectors.joining(",")));
-//            }
-//        }
+
 
         /*实测值参数*/
         List<Map<String,Object>>  textInfoMap= this.jdbcTemplate.queryForList("SELECT b.tab_id pkId,b.col_name val ,CONCAT(a.init_table_name,':',b.col_key)code from m_wbs_tree_contract a inner join m_textdict_info b on a.p_key_id=b.tab_id   " +