|
@@ -2777,6 +2777,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
@Override
|
|
|
public R<Object> evaluate(Long pkeyId) {
|
|
|
if (StringUtils.isNumber(pkeyId)) {
|
|
|
+ /*节点信息*/
|
|
|
WtcEva wtcEva = this.getSqlOne(
|
|
|
"select b.tree_code treeCode ,a.contract_id contractId,a.init_table_name initTableName,a.html_url htmlUrl ,a.node_name nodeName ,a.parent_id parentId " +
|
|
|
"from m_wbs_tree_contract a join m_wbs_tree_contract b on (a.parent_id=b.id and a.contract_id=b.contract_id) where a.p_key_id ="
|
|
@@ -2786,7 +2787,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
wtcEva.setPKeyId(pkeyId);
|
|
|
List<FormData> processFds = this.createFormDataByTableName(wtcEva.getInitTableName());
|
|
|
LinkedList<String> treeCode = new LinkedList<>(FormulaUtils.treeCodeSplit(wtcEva.getTreeCode()));
|
|
|
- if(wtcEva.getInitTableName().equals("m_20231027094746_1717719707244560384")) {
|
|
|
+ if(FB02.TABLE_NAME.equals(wtcEva.getInitTableName())) {
|
|
|
FB02 fb02 = new FB02(processFds);
|
|
|
if (fb02.checked()) {
|
|
|
/*swId是分项评定的父节点Id*/
|
|
@@ -2813,7 +2814,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else if(wtcEva.getInitTableName().equals("m_20231027094738_1717719671702028288")){
|
|
|
+ }else if(FB01.TABLE_NAME.equals(wtcEva.getInitTableName())){
|
|
|
FB01 fb01 = new FB01(processFds);
|
|
|
if(fb01.checked()) {
|
|
|
/*获取同一个treeCode前缀下的所有分项评定表*/
|
|
@@ -2860,44 +2861,95 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else if(wtcEva.getInitTableName().equals("m_20231027100459_1717724038211567616")){
|
|
|
+ }else if(DW01.TABLE_NAME.equals(wtcEva.getInitTableName())){
|
|
|
/*单位评定表一*/
|
|
|
- FB01 fb01 = new FB01(processFds);
|
|
|
- if (fb01.checked()){
|
|
|
+ DW01 dw01 = new DW01(processFds);
|
|
|
+ if (dw01.checked()){
|
|
|
List<FormData> fbFds = this.createFormDataByTableName("m_20231027094738_1717719671702028288");
|
|
|
- FB01 fb01a = new FB01(fbFds);
|
|
|
- String keys = Stream.of(fb01a.getNumber(),fb01a.getName(),fb01a.getLevel()).map(FormData::getKey).map(StringUtils::handleNull).collect(Collectors.joining(",c.","c.",""));
|
|
|
+ FormData fbName = null,fbNumber = null,fbLevel = null;
|
|
|
+ for(FormData e:fbFds){
|
|
|
+ if(e.getEName().startsWith("分部工程名称")){
|
|
|
+ fbName=e;
|
|
|
+ }else if(e.getEName().startsWith("分部工程编号")){
|
|
|
+ fbNumber=e;
|
|
|
+ }else if(e.getEName().startsWith("质量等级")){
|
|
|
+ fbLevel=e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!(fbName!=null&&fbNumber!=null&&fbLevel!=null)){
|
|
|
+ return R.fail("未能匹配分部评定节点");
|
|
|
+ }
|
|
|
+ String keys = Stream.of(fbName,fbNumber,fbLevel).map(FormData::getKey).map(StringUtils::handleNull).collect(Collectors.joining(",c.","c.",""));
|
|
|
List<Map<String,Object>> mapList = jdbcTemplate.queryForList("select "+keys+" from (select id,tree_code 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=3 ORDER BY tree_code)a join m_wbs_tree_contract b on a.id=b.parent_id" +
|
|
|
" join m_20231027094738_1717719671702028288 c on b.p_key_id=c.p_key_id where b.contract_id ="+wtcEva.getContractId()+" and b.is_deleted=0 and b.init_table_name='m_20231027094738_1717719671702028288'" +
|
|
|
"ORDER BY a.tree_code");
|
|
|
if(mapList.size()>0){
|
|
|
List<Item01> abList= new ArrayList<>();
|
|
|
- mapList.forEach(map->{
|
|
|
+ for (Map<String,Object> map:mapList){
|
|
|
Item01 item = new Item01();
|
|
|
- item.setName(fb01a.getName().getKey());
|
|
|
- item.setNumber(fb01a.getNumber().getKey());
|
|
|
- item.setLevel(fb01a.getLevel().getKey());
|
|
|
+ item.setName(StringUtils.handleNull(map.get(fbName.getKey())).split("_\\^_")[0]);
|
|
|
+ item.setNumber(StringUtils.handleNull(map.get(fbNumber.getKey())).split("_\\^_")[0]);
|
|
|
+ item.setLevel(StringUtils.handleNull(map.get(fbLevel.getKey())).split("_\\^_")[0]);
|
|
|
abList.add(item);
|
|
|
- });
|
|
|
- fb01.source(abList);
|
|
|
- if (fb01.getDatas().size() > 0) {
|
|
|
+ }
|
|
|
+ dw01.source(abList);
|
|
|
+ if (dw01.getDatas().size() > 0) {
|
|
|
Map<String, String> tableKeysCoordsMap = FormulaUtils.getElementCell(wtcEva.getHtmlUrl());
|
|
|
- if (fb01.initFdCoords(tableKeysCoordsMap)) {
|
|
|
+ if (dw01.initFdCoords(tableKeysCoordsMap)) {
|
|
|
/*根据数据长度,增减页数*/
|
|
|
- List<WbsTreeContract> wtcList = this.adjustPageSize(fb01.getPageNum(), wtcEva, processFds);
|
|
|
- if (fb01.flush(wtcList)) {
|
|
|
- this.jdbcTemplate.batchUpdate(fb01.getSql(), fb01.getParams());
|
|
|
+ List<WbsTreeContract> wtcList = this.adjustPageSize(dw01.getPageNum(), wtcEva, processFds);
|
|
|
+ if (dw01.flush(wtcList)) {
|
|
|
+ this.jdbcTemplate.batchUpdate(dw01.getSql(), dw01.getParams());
|
|
|
return R.success("成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else if(wtcEva.getInitTableName().equals("m_20231027100505_1717724063251562496")){
|
|
|
+ }else if(DW02.TABLE_NAME.equals(wtcEva.getInitTableName())){
|
|
|
/*单位评定表二*/
|
|
|
- FB02 fb02 = new FB02(processFds);
|
|
|
- if (fb02.checked()){
|
|
|
-
|
|
|
+ /*单位评定表一*/
|
|
|
+ DW02 dw02 = new DW02(processFds);
|
|
|
+ if (dw02.checked()){
|
|
|
+ List<FormData> fbFds = this.createFormDataByTableName(FB02.TABLE_NAME);
|
|
|
+ FormData fbName = null,passRate = null,weight = null,fbLevel=null;
|
|
|
+ for(FormData e:fbFds){
|
|
|
+ if(e.getEName().startsWith("分部工程名称")){
|
|
|
+ fbName=e;
|
|
|
+ }else if(e.getEName().startsWith("分部工程实测得分计算")){
|
|
|
+ passRate=e;
|
|
|
+ }else if(e.getEName().startsWith("质量等级")){
|
|
|
+ fbLevel=e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!(fbName!=null&&passRate!=null&&fbLevel!=null)){
|
|
|
+ return R.fail("未能匹配分部评定节点");
|
|
|
+ }
|
|
|
+ String keys = Stream.of(fbName,passRate,fbLevel).map(FormData::getKey).map(StringUtils::handleNull).collect(Collectors.joining(",c.","c.",""));
|
|
|
+ List<Map<String,Object>> mapList = jdbcTemplate.queryForList("select "+keys+" from (select id,tree_code 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=3 ORDER BY tree_code)a join m_wbs_tree_contract b on a.id=b.parent_id" +
|
|
|
+ " join "+FB02.TABLE_NAME+" c on b.p_key_id=c.p_key_id where b.contract_id ="+wtcEva.getContractId()+" and b.is_deleted=0 and b.init_table_name='"+FB02.TABLE_NAME+"'" +
|
|
|
+ "ORDER BY a.tree_code");
|
|
|
+ if(mapList.size()>0){
|
|
|
+ List<Item02> abList= new ArrayList<>();
|
|
|
+ for (Map<String,Object> map:mapList){
|
|
|
+ Item02 item = new Item02();
|
|
|
+ item.setName(StringUtils.handleNull(map.get(fbName.getKey())).split("_\\^_")[0]);
|
|
|
+ item.setPassRate(BaseUtils.obj2DoubleZero(StringUtils.handleNull(map.get(passRate.getKey())).split("_\\^_")[0]));
|
|
|
+ item.setLevel(StringUtils.handleNull(map.get(fbLevel.getKey())).split("_\\^_")[0]);
|
|
|
+ }
|
|
|
+ dw02.source(abList);
|
|
|
+ if (dw02.getDatas().size() > 0) {
|
|
|
+ Map<String, String> tableKeysCoordsMap = FormulaUtils.getElementCell(wtcEva.getHtmlUrl());
|
|
|
+ if (dw02.initFdCoords(tableKeysCoordsMap)) {
|
|
|
+ /*根据数据长度,增减页数*/
|
|
|
+ List<WbsTreeContract> wtcList = this.adjustPageSize(dw02.getPageNum(), wtcEva, processFds);
|
|
|
+ if (dw02.flush(wtcList)) {
|
|
|
+ this.jdbcTemplate.batchUpdate(dw02.getSql(), dw02.getParams());
|
|
|
+ return R.success("成功");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|