|
@@ -12,10 +12,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.jfireel.expression.Expression;
|
|
|
import com.mixsmart.utils.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.apache.poi.ss.usermodel.*;
|
|
|
import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
|
import org.jsoup.nodes.Element;
|
|
|
import org.jsoup.select.Elements;
|
|
|
+import org.springblade.common.utils.BaseUtils;
|
|
|
+import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.tool.api.R;
|
|
@@ -114,33 +117,33 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
public IFormulaService init() {
|
|
|
/*基础数据*/
|
|
|
baseData();
|
|
|
- /*依赖加载*/
|
|
|
- checkingMissingList();
|
|
|
- /*实测值参数*/
|
|
|
- textInfo();
|
|
|
- /*公式参数*/
|
|
|
- option();
|
|
|
- /*评定表*/
|
|
|
- assessmentForm();
|
|
|
+ if(ExecuteType.INSPECTION.equals(tec.getExecuteType())) {
|
|
|
+ /*依赖加载*/
|
|
|
+ checkingMissingList();
|
|
|
+ /*实测值参数*/
|
|
|
+ textInfo();
|
|
|
+ /*公式参数*/
|
|
|
+ option();
|
|
|
+ /*评定表*/
|
|
|
+ assessmentForm();
|
|
|
+ }
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
public void option(){
|
|
|
- FormulaOption formulaOption = this.formulaOptionService.getOne(Wrappers.<FormulaOption>lambdaQuery().eq(FormulaOption::getParentId,tec.getCurrentNode().getRelateId()).eq(FormulaOption::getContractId,tec.getContractId()));
|
|
|
- if(formulaOption!=null){
|
|
|
- tec.constantMap.put(FMOT,JSON.parseObject(formulaOption.getVal(),LinkedHashMap.class));
|
|
|
- }
|
|
|
+ FormulaOption formulaOption = this.formulaOptionService.getOne(Wrappers.<FormulaOption>lambdaQuery().eq(FormulaOption::getParentId, tec.getCurrentNode().getRelateId()).eq(FormulaOption::getContractId, tec.getContractId()));
|
|
|
+ if (formulaOption != null) {
|
|
|
+ tec.constantMap.put(FMOT, JSON.parseObject(formulaOption.getVal(), LinkedHashMap.class));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void textInfo(){
|
|
|
- if(ExecuteType.INSPECTION.equals(tec.getExecuteType())){
|
|
|
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 " +
|
|
|
"where a.p_key_id in("+this.tec.getTableAll().stream().map(NodeTable::getPKeyId).map(Func::toStr).collect(Collectors.joining(","))+") and b.type=8 ");
|
|
|
if(Func.isNotEmpty(textInfoMap)){
|
|
|
Map<String,List<Map<String,Object>>> tmap = textInfoMap.stream().collect(Collectors.groupingBy(m->m.get("code").toString()));
|
|
|
tec.constantMap.put(TEXT_INFO_MAP,tmap);
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public void baseData(){
|
|
@@ -148,26 +151,27 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
CurrentNode one=this.tec.getCurrentNode();
|
|
|
tec.formDataList=list;
|
|
|
keyWord(tec.constantMap);
|
|
|
- ContractInfo info =this.contractInfoService.getById(tec.getContractId());
|
|
|
- ProjectInfo pji=this.projectInfoService.getById(info.getPId());
|
|
|
- tec.setProjectId(pji.getId());
|
|
|
+ /* ContractInfo info =this.contractInfoService.getById(tec.getContractId());
|
|
|
+ ProjectInfo pji=this.projectInfoService.getById(tec.getProjectId());*/
|
|
|
/*wbs节点链*/
|
|
|
- List<WbsTreeContract> nodes = wpService.chain(tec.getContractId(),one.getId(),one.getPkId(),null);
|
|
|
- if(Func.isEmpty(nodes)){
|
|
|
- nodes=wpService.chain(tec.getContractId(),one.getRelateId(),one.getPkId(),null);
|
|
|
- }
|
|
|
- if(Func.isEmpty(nodes)){
|
|
|
- this.tec.getLog().append("【WBS信息缺失】");
|
|
|
+ if(ExecuteType.INSPECTION.equals(tec.getExecuteType())) {
|
|
|
+ List<WbsTreeContract> nodes = wpService.chain(tec.getContractId(), one.getId(), one.getPkId(), null);
|
|
|
+ if (Func.isEmpty(nodes)) {
|
|
|
+ nodes = wpService.chain(tec.getContractId(), one.getRelateId(), one.getPkId(), null);
|
|
|
+ }
|
|
|
+ if (Func.isEmpty(nodes)) {
|
|
|
+ this.tec.getLog().append("【WBS信息缺失】");
|
|
|
+ }
|
|
|
+ tec.constantMap.put(CHAIN,nodes.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList()));
|
|
|
+ /*节点参数*/
|
|
|
+ tec.constantMap.put(WP,getWpMap(one));
|
|
|
+ /*表格名称*/
|
|
|
+ List<AppWbsTreeContractVO> tableList =wbsTreeContractService.searchNodeAllTable(one.getPkId().toString(), "1", tec.getContractId().toString(),tec.getProjectId().toString());
|
|
|
+ tec.constantMap.put(TABLE_LIST,tableList);
|
|
|
+ /*通过判断元素名称来确定,加入汇总公式延后执行*/
|
|
|
+ /*tec.constantMap.put("tableNames",tableList.stream().filter(e->StringUtils.isEquals(e.getIsBussShow(),1)).map(WbsTreeContract::getNodeName).collect(Collectors.toList()));*/
|
|
|
+ tec.constantMap.put("tableNames",tableList.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList()));
|
|
|
}
|
|
|
- tec.constantMap.put(CHAIN,nodes.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList()));
|
|
|
- /*节点参数*/
|
|
|
- tec.constantMap.put(WP,getWpMap(one));
|
|
|
- /*表格名称*/
|
|
|
- List<AppWbsTreeContractVO> tableList =wbsTreeContractService.searchNodeAllTable(one.getPkId().toString(), "1", tec.getContractId().toString(),info.getPId());
|
|
|
- tec.constantMap.put(TABLE_LIST,tableList);
|
|
|
- /*通过判断元素名称来确定,加入汇总公式延后执行*/
|
|
|
- /*tec.constantMap.put("tableNames",tableList.stream().filter(e->StringUtils.isEquals(e.getIsBussShow(),1)).map(WbsTreeContract::getNodeName).collect(Collectors.toList()));*/
|
|
|
- tec.constantMap.put("tableNames",tableList.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList()));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -231,6 +235,9 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
/**评定表处理*/
|
|
|
public void assessmentForm(){
|
|
|
+ if(!ExecuteType.INSPECTION.equals(tec.getExecuteType())){
|
|
|
+ return;
|
|
|
+ }
|
|
|
try {
|
|
|
if (tec.getTableAll().stream().anyMatch(e -> StringUtils.isEquals(e.getTableType(), 5))) {
|
|
|
/*评定节点*/
|
|
@@ -647,18 +654,22 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
@Override
|
|
|
public IFormulaService calculate() {
|
|
|
- /*天气*/
|
|
|
- weather();
|
|
|
+ if(ExecuteType.INSPECTION.equals(tec.getExecuteType())) {
|
|
|
+ /*天气*/
|
|
|
+ weather();
|
|
|
+ }
|
|
|
/*通用计算*/
|
|
|
generalCalc();
|
|
|
- /*汇总信息处理*/
|
|
|
- summaryCalc();
|
|
|
- /*附表的处理*/
|
|
|
- forSubTb();
|
|
|
+ if(ExecuteType.INSPECTION.equals(tec.getExecuteType())) {
|
|
|
+ /*汇总信息处理*/
|
|
|
+ summaryCalc();
|
|
|
+ /*附表的处理*/
|
|
|
+ forSubTb();
|
|
|
+ }
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /*天气信息获取*/
|
|
|
private void weather(){
|
|
|
List<String> dateList=new ArrayList<>();
|
|
|
tec.formDataList.forEach(e->{
|
|
@@ -676,7 +687,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
});
|
|
|
if(dateList.size()>0){
|
|
|
- List<Map<String,Object>> listMap= this.jdbcTemplate.queryForList(" select DATE(b.create_time) ds,b.weather from m_project_contract_area a join u_weather_info b on a.id=contract_area_id where a.contract_id=1530020611913850882 and DATE(b.create_time) in('"+ String.join(",", dateList) +"')");
|
|
|
+ List<Map<String,Object>> listMap= this.jdbcTemplate.queryForList(" select DATE(b.create_time) ds,b.weather from m_project_contract_area a join u_weather_info b on a.id=contract_area_id where a.contract_id="+tec.getContractId()+" and DATE(b.create_time) in('"+ String.join(",", dateList) +"')");
|
|
|
Map<String,String> map= new HashMap<>();
|
|
|
listMap.forEach(m->{
|
|
|
map.put(Func.toStr(m.get("ds")),Func.toStr(m.get("weather")));
|
|
@@ -1519,6 +1530,7 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
Map<String,List<Map<String,Object>>> textInfoMap= (Map<String, List<Map<String, Object>>>) tec.constantMap.getOrDefault(TEXT_INFO_MAP,new HashMap<>());
|
|
|
List<Map<String,Object>> tableColKeyVal= textInfoMap.get(codeList.get(0));
|
|
|
if(Func.isNotEmpty(tableColKeyVal)){
|
|
|
+ /*TODO 允许多次右键插入之后,就无法满足计算要求*/
|
|
|
Optional<RangeInfo> op=tableColKeyVal.stream().map(map-> BeanUtil.toBean(JSON.parseObject(map.get("val").toString()),RangeInfo.class)).findFirst();
|
|
|
if(op.isPresent()){
|
|
|
RangeInfo d = op.get();
|
|
@@ -1527,15 +1539,72 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
}
|
|
|
}else{
|
|
|
FormData dataFd=tec.formDataMap.get(codeList.get(0));
|
|
|
- FormData designFd=tec.formDataMap.get(codeList.get(1));
|
|
|
+ String designStr=codeList.get(1);
|
|
|
+ FormData designFd=tec.formDataMap.get(designStr);
|
|
|
+ String devStr=StringUtils.isEmpty(formula.getDev())?formula.getDev():fd.getEAllowDeviation();
|
|
|
+ if(StringUtils.isEmpty(devStr)){
|
|
|
+ /*数据库找不到的情况就读取Excel*/
|
|
|
+ if(tec.wkbMap.isEmpty()){
|
|
|
+ /*初始化*/
|
|
|
+ List<String> tableNames4Excel= tec.getFormDataList().stream().filter(FormData::executable).filter(e->e.info().contains("quantity")).map(FormData::getTableName).distinct().collect(Collectors.toList());
|
|
|
+ if(!tableNames4Excel.isEmpty()){
|
|
|
+ List<String> ids =tec.getTableAll().stream().filter(e->tableNames4Excel.contains(e.getInitTableName())).map(NodeTable::getPKeyId).map(String::valueOf).collect(Collectors.toList());
|
|
|
+ List<Map<String,Object>> listMaps= this.jdbcTemplate.queryForList("select a.p_key_id pkeyId,a.init_table_name tableName,b.file_url url from m_wbs_tree_contract a join m_excel_tab b on a.excel_id=b.id where a.p_key_id in("+String.join(",",ids)+")");
|
|
|
+ listMaps.forEach(mp->{
|
|
|
+ try {
|
|
|
+ Workbook wb = WorkbookFactory.create(Objects.requireNonNull(CommonUtil.getOSSInputStream(StringUtils.handleNull(mp.get("url")))));
|
|
|
+ tec.wkbMap.put(mp.get("pkeyId").toString(),wb);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Optional<NodeTable> nodeTableOp =tec.getTableAll().stream().filter(e->e.getInitTableName().equals(fd.getTableName())).findFirst();
|
|
|
+ if(nodeTableOp.isPresent()){
|
|
|
+ Workbook wb = tec.wkbMap.get(nodeTableOp.get().getPKeyId().toString());
|
|
|
+ if(wb!=null){
|
|
|
+ Cell deCell=null;
|
|
|
+ Sheet sheet = wb.getSheetAt(0);
|
|
|
+ outerLoop: for(int y=3;y<35;y++){
|
|
|
+ for(int x=0;x<35;x++){
|
|
|
+ Row row = sheet.getRow(y);
|
|
|
+ Cell cell= row.getCell(x);
|
|
|
+ String sv=StringUtils.handleNull(FormulaUtils.getValue(cell)).replaceAll("[^\u4e00-\u9fa5]+","");
|
|
|
+ if(sv.contains("规定")&&sv.contains("偏差")){
|
|
|
+ deCell=cell;
|
|
|
+ break outerLoop;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(deCell!=null) {
|
|
|
+ int min = 0;
|
|
|
+ Optional<Integer> op = fd.getCoordsList().stream().map(Coords::getY).distinct().min(Comparator.comparingInt(e -> e));
|
|
|
+ if (op.isPresent()) {
|
|
|
+ min = op.get();
|
|
|
+ }
|
|
|
+ Row row = sheet.getRow(min);
|
|
|
+ Cell cell = row.getCell(deCell.getColumnIndex());
|
|
|
+ devStr = FormulaUtils.getValue(cell).toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(CustomFunction.containsZH(devStr)||StringUtils.isEmpty(devStr)||StringUtils.handleNull(devStr).contains("/")){
|
|
|
+ devStr="±100000";
|
|
|
+ }
|
|
|
+ /*设计值可以是数值类型,或空(等效0)*/
|
|
|
if(dataFd!=null&&designFd!=null){
|
|
|
if(dataFd.getValues().stream().map(ElementData::getValue).anyMatch(StringUtils::isNotEmpty)&&(designFd.getValues().size()>1||designFd.getValues().stream().map(ElementData::getValue).anyMatch(StringUtils::isEmpty))){
|
|
|
/*多少个设计值暂时默认全部合格,满足绝大部分结果*/
|
|
|
data=dataFd.getValues().stream().map(ElementData::getValue).filter(StringUtils::isNotEmpty).count();
|
|
|
}else{
|
|
|
- List<Object> result = CustomFunction.b445check(dataFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),designFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),formula.getDev(),1 );
|
|
|
+ List<Object> result = CustomFunction.b445check(dataFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),designFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),devStr,1 );
|
|
|
data=result.get(1);
|
|
|
}
|
|
|
+ }else if(dataFd!=null&& BaseUtils.isNumber(designStr)){
|
|
|
+ List<Object> result = CustomFunction.b445check(dataFd.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()),0,devStr,1 );
|
|
|
+ data=result.get(1);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1664,7 +1733,7 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
return new HashMap<>();
|
|
|
}
|
|
|
|
|
|
- public R getBussDataInfo(Long pkeyId,int type) {
|
|
|
+ public R getBussDataInfo(Long pkeyId, int type) {
|
|
|
|
|
|
Map<String, Object> reData = new HashMap<>();
|
|
|
|
|
@@ -1682,7 +1751,7 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
String tabName = wbsTreeContract.getInitTableName();
|
|
|
String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
|
|
|
List<Map<String, Object>> tabList = jdbcTemplate.queryForList(isExitSql);
|
|
|
- if (tabList == null || tabList.size() <= 0) {
|
|
|
+ if (tabList.size() <= 0) {
|
|
|
return R.fail("无实体表对应");
|
|
|
}
|
|
|
|
|
@@ -1692,96 +1761,99 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
// 匹配关联
|
|
|
try {
|
|
|
File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
- String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
- Document doc = Jsoup.parse(htmlString);
|
|
|
-
|
|
|
- // 解析
|
|
|
- // 模糊匹配
|
|
|
- Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
|
|
|
- Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
|
|
|
- Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
|
|
|
- sgtitle.addAll(sgtitle1);
|
|
|
-
|
|
|
- Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
|
|
|
- Elements htdtitle1 = doc.select("el-input[placeholder~=合同名称.*]");
|
|
|
- htdtitle.addAll(htdtitle1);
|
|
|
-
|
|
|
- Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
|
|
|
-
|
|
|
- Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
|
|
|
- Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
|
|
|
- bhtitle.addAll(bhtitle1);
|
|
|
-
|
|
|
-
|
|
|
- Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
-
|
|
|
-
|
|
|
- // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
-
|
|
|
- /**
|
|
|
- * 承包单位 承包单位、施工单位:引用施工单位名称 ,
|
|
|
- * 监理单位:引用监理单位名称
|
|
|
- * 合同段、所属建设项目(合同段):引用合同段编号
|
|
|
- *
|
|
|
- * 施工单位:施工单位 和 安装单位
|
|
|
- *
|
|
|
- */
|
|
|
- ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
|
|
|
- // 施工单位名称
|
|
|
- if (dwtitle.size() >= 1) {
|
|
|
- int y = Integer.parseInt(dwtitle.attr("trindex"));
|
|
|
- if (y <= 10) {
|
|
|
- reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
- }
|
|
|
+ if (file1.exists()) {
|
|
|
+
|
|
|
+ String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
+
|
|
|
+ // 解析
|
|
|
+ // 模糊匹配
|
|
|
+ Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
|
|
|
+ Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
|
|
|
+ Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
|
|
|
+ sgtitle.addAll(sgtitle1);
|
|
|
+
|
|
|
+ Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
|
|
|
+ Elements htdtitle1 = doc.select("el-input[placeholder~=合同名称.*]");
|
|
|
+ htdtitle.addAll(htdtitle1);
|
|
|
+
|
|
|
+ Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
|
|
|
+
|
|
|
+ Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
|
|
|
+ Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
|
|
|
+ bhtitle.addAll(bhtitle1);
|
|
|
+
|
|
|
+
|
|
|
+ Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
+
|
|
|
+
|
|
|
+ // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承包单位 承包单位、施工单位:引用施工单位名称 ,
|
|
|
+ * 监理单位:引用监理单位名称
|
|
|
+ * 合同段、所属建设项目(合同段):引用合同段编号
|
|
|
+ *
|
|
|
+ * 施工单位:施工单位 和 安装单位
|
|
|
+ *
|
|
|
+ */
|
|
|
+ ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
|
|
|
+ // 施工单位名称
|
|
|
+ if (dwtitle.size() >= 1) {
|
|
|
+ int y = Integer.parseInt(dwtitle.attr("trindex"));
|
|
|
+ if (y <= 10) {
|
|
|
+ reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- if (sgtitle.size() >= 1) {
|
|
|
- int y = Integer.parseInt(sgtitle.attr("trindex"));
|
|
|
- if (y <= 10) {
|
|
|
- reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
}
|
|
|
- }
|
|
|
+ if (sgtitle.size() >= 1) {
|
|
|
+ int y = Integer.parseInt(sgtitle.attr("trindex"));
|
|
|
+ if (y <= 10) {
|
|
|
+ reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- // 合同段名称
|
|
|
- if (htdtitle.size() >= 1) {
|
|
|
- for (Element element : htdtitle) {
|
|
|
- int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trindex <= 8) {
|
|
|
- reData.put(element.attr("keyName"), contractInfo.getContractNumber());
|
|
|
+ // 合同段名称
|
|
|
+ if (htdtitle.size() >= 1) {
|
|
|
+ for (Element element : htdtitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 8) {
|
|
|
+ reData.put(element.attr("keyName"), contractInfo.getContractNumber());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- // 监理单位名称
|
|
|
- if (jltitle.size() >= 1) {
|
|
|
+ // 监理单位名称
|
|
|
+ if (jltitle.size() >= 1) {
|
|
|
|
|
|
- for (Element element : jltitle) {
|
|
|
- int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trindex <= 10) {
|
|
|
- reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
+ for (Element element : jltitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 10) {
|
|
|
+ reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- //获取父节点划分编号
|
|
|
- WbsTreeContract node = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
|
|
|
- .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
|
|
|
- // 编号
|
|
|
- if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
|
|
|
- for (Element element : bhtitle) {
|
|
|
- int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trindex <= 10) {
|
|
|
- reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
|
|
|
+ //获取父节点划分编号
|
|
|
+ WbsTreeContract node = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
+ .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
|
|
|
+ .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
|
|
|
+ // 编号
|
|
|
+ if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
|
|
|
+ for (Element element : bhtitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 10) {
|
|
|
+ reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- // 项目名称
|
|
|
- if (xmtitle.size() >= 1) {
|
|
|
- for (Element element : xmtitle) {
|
|
|
- int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trindex <= 6) {
|
|
|
- ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
|
|
|
- reData.put(element.attr("keyName"), projectInfo.getProjectName());
|
|
|
+ // 项目名称
|
|
|
+ if (xmtitle.size() >= 1) {
|
|
|
+ for (Element element : xmtitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 6) {
|
|
|
+ ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
|
|
|
+ reData.put(element.attr("keyName"), projectInfo.getProjectName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1789,13 +1861,13 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- if (dataIn != null && dataIn.size() >= 1) {
|
|
|
+ if (dataIn.size() >= 1) {
|
|
|
Map<String, Object> mysqlData = dataIn.get(0);
|
|
|
for (String key : mysqlData.keySet()) {
|
|
|
String tabVal = mysqlData.get(key) + "";
|
|
|
// 时间段处理
|
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(tabVal) && tabVal.indexOf("null") < 0) {
|
|
|
- if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
|
|
|
+ if (tabVal.contains("T") && tabVal.contains(".000Z]")) {
|
|
|
String[] tabData = tabVal.split("_\\^_");
|
|
|
|
|
|
if (reData.containsKey("pickerKey")) {
|
|
@@ -1814,9 +1886,9 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(tabData[0])) {
|
|
|
reData.put(key + "__" + tabData[1], sql);
|
|
|
}
|
|
|
- } else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
|
|
|
+ } else if (tabVal.contains("T") && tabVal.contains(".000Z")) { //时间
|
|
|
// 时间和字符串合作
|
|
|
- if (tabVal.indexOf("☆") >= 0) {
|
|
|
+ if (tabVal.contains("☆")) {
|
|
|
String[] mysql = tabVal.split("☆");
|
|
|
for (String data : mysql) {
|
|
|
String[] tabData = data.split("_\\^_");
|
|
@@ -1830,7 +1902,7 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
}
|
|
|
}
|
|
|
- } else if (tabVal.indexOf("☆") >= 0) {
|
|
|
+ } else if (tabVal.contains("☆")) {
|
|
|
String[] mysql = tabVal.split("☆");
|
|
|
for (String data : mysql) {
|
|
|
String[] tabData = data.split("_\\^_");
|
|
@@ -1838,10 +1910,16 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
}
|
|
|
}
|
|
|
- } else if (tabVal.indexOf("_^_") >= 0) {
|
|
|
+ } else if (tabVal.contains("_^_")) {
|
|
|
String[] tabData = tabVal.split("_\\^_");
|
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(tabData[0])) {
|
|
|
- reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
+ if (tabVal.contains("[") && tabVal.contains("年")) {
|
|
|
+ String[] strings = org.apache.commons.lang.StringUtils.strip(tabData[0], "[]").split(",");
|
|
|
+
|
|
|
+ reData.put(key + "__" + tabData[1], strings);
|
|
|
+ } else {
|
|
|
+ reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
reData.put(key, tabVal);
|
|
@@ -1866,7 +1944,7 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
}
|
|
|
|
|
|
// 移除Id 和 p_key_id
|
|
|
- if(type==0){
|
|
|
+ if (type == 0) {
|
|
|
reData.remove("id");
|
|
|
reData.remove("p_key_id");
|
|
|
reData.remove("classify");
|
|
@@ -1874,8 +1952,8 @@ public List<ElementData> setScale(Integer scale,List<ElementData> data){
|
|
|
reData.remove("pkeyId");
|
|
|
reData.remove("projectId");
|
|
|
}
|
|
|
- if(type==1){
|
|
|
- reData.put("pkeyId",reData.get("p_key_id"));
|
|
|
+ if (type == 1) {
|
|
|
+ reData.put("pkeyId", reData.get("p_key_id"));
|
|
|
}
|
|
|
reData.put("tabGroupId", wbsTreeContract.getTabGroupId());
|
|
|
return R.data(reData);
|