|
@@ -44,6 +44,7 @@ import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springblade.system.cache.ParamCache;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -2816,10 +2817,37 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
FB01 fb01 = new FB01(processFds);
|
|
|
if(fb01.checked()) {
|
|
|
/*获取同一个treeCode前缀下的所有分项评定表*/
|
|
|
- List<WtcEva> wtcEvaList= this.getSqlList("select b.init_table_name,b.node_name,b.p_key_id pKeyId from " +
|
|
|
+ List<WtcEva> wtcEvaList= this.getSqlList("select b.init_table_name initTableName ,b.node_name nodeName,b.p_key_id pKeyId from " +
|
|
|
"(select id from m_wbs_tree_contract where tree_code like '"+treeCode.getLast()+"%' and contract_id ="+wtcEva.getContractId()+" and major_data_type=2 and is_deleted=0 and node_type=5 ORDER BY tree_code" +
|
|
|
")a join m_wbs_tree_contract b on a.id=b.parent_id where b.contract_id ="+wtcEva.getContractId()+" and b.is_deleted=0",WtcEva.class);
|
|
|
- fb01.source();
|
|
|
+ wtcEvaList.removeIf(e->e.getNodeName().contains("附表"));
|
|
|
+ List<Item01> abList= new ArrayList<>();
|
|
|
+ wtcEvaList.forEach(e->{
|
|
|
+ String sql="select b.* from m_table_info a join m_wbs_form_element b on a.id = b.f_id where a.tab_en_name='"+e.getInitTableName()+"' and a.is_deleted=0 and b.is_deleted=0";
|
|
|
+ List<WbsFormElement> elements=jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsFormElement.class));
|
|
|
+ if(Func.isNotEmpty(elements)){
|
|
|
+ String a="分项工程编号:";
|
|
|
+ String b="分项工程名称:";
|
|
|
+ elements.stream().filter(w -> FormulaUtils.getJaccardSimilarity(w.getEName(), a) > 0.3).max(Comparator.comparingDouble((WbsFormElement x) -> FormulaUtils.getJaccardSimilarity(x.getEName(), a))).ifPresent(r1->{
|
|
|
+ elements.stream().filter(w -> FormulaUtils.getJaccardSimilarity(w.getEName(), b) > 0.3).max(Comparator.comparingDouble((WbsFormElement x) -> FormulaUtils.getJaccardSimilarity(x.getEName(), b))).ifPresent(r2->{
|
|
|
+ List<Item01> tmp=jdbcTemplate.query("select "+r1.getEKey()+" number,"+r2.getEKey()+" name from " +e.getInitTableName()+" where p_key_id="+e.getPKeyId(), new BeanPropertyRowMapper<>(Item01.class));
|
|
|
+ if(Func.isNotEmpty(tmp)) {
|
|
|
+ abList.add(tmp.get(0));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ abList.forEach(e->{
|
|
|
+ if(StringUtils.isNotEmpty(e.getNumber())){
|
|
|
+ e.setNumber(e.getNumber().split("__")[0]);
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(e.getName())){
|
|
|
+ e.setName(e.getName().split("__")[0]);
|
|
|
+ }
|
|
|
+ e.setLevel("合格");
|
|
|
+ });
|
|
|
+ fb01.source(abList);
|
|
|
if (fb01.getDatas().size() > 0) {
|
|
|
Map<String, String> tableKeysCoordsMap = FormulaUtils.getElementCell(wtcEva.getHtmlUrl());
|
|
|
if (fb01.initFdCoords(tableKeysCoordsMap)) {
|