|
|
@@ -1735,6 +1735,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
|
|
|
/*检查发现有p_key_id缺失的情况,导致表单数据丢失,所以强制覆盖*/
|
|
|
dataMap2.put("p_key_id", tableInfo.getPkeyId());
|
|
|
+ dataMap2=isPartition(wbsTreeContract,tabName,dataMap2);
|
|
|
sqlInfo = buildMTableInsertSql(tabName, dataMap2, SnowFlakeUtil.getId(), null, null).toString();
|
|
|
//统计保存的字段
|
|
|
|
|
|
@@ -1854,6 +1855,61 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return R.data(tableInfoList2);
|
|
|
// return R.success(fileName1);
|
|
|
}
|
|
|
+ public LinkedHashMap<String ,String> isPartition(WbsTreeContract wbsTreeContract,String tabName,LinkedHashMap<String, String> dataMap2){
|
|
|
+ //判断是否需要移除编号 当工序 子分项 分项的划分编码有一个不为null就移除编号
|
|
|
+ String sqlContractInfo="select * from m_contract_info where id="+wbsTreeContract.getContractId();
|
|
|
+ ContractInfo contractInfo=jdbcTemplate.queryForObject(sqlContractInfo,new BeanPropertyRowMapper<>(ContractInfo.class));
|
|
|
+ if (contractInfo != null && contractInfo.getIsReferenceNumber() == 2) {
|
|
|
+ Boolean b = isPartition1(wbsTreeContract);
|
|
|
+ if(b){
|
|
|
+ String sqlElement = "select e.* from m_wbs_form_element e left join m_table_info t on e.f_id=t.id where t.tab_en_name='" + tabName+"'";
|
|
|
+ List<WbsFormElement> elements = jdbcTemplate.query(sqlElement, new BeanPropertyRowMapper<>(WbsFormElement.class));
|
|
|
+ if (!elements.isEmpty()) {
|
|
|
+ Map<String, String> bh=new HashMap<>();
|
|
|
+ bh.put("编号","编号");
|
|
|
+ bh.put("编号:","编号");
|
|
|
+ bh.put("编号:","编号");
|
|
|
+ bh.put("工程编号","编号");
|
|
|
+ bh.put("分项工程编号","编号");
|
|
|
+ bh.put("单元工程编码","编号");
|
|
|
+ bh.put("编 号","编号");
|
|
|
+ bh.put("分项工程编号:","编号");
|
|
|
+ bh.put("分项工程编号:","编号");
|
|
|
+ for (WbsFormElement element : elements) {
|
|
|
+ if(bh.containsKey(element.getEName())){
|
|
|
+ dataMap2.remove(element.getEKey());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return dataMap2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return dataMap2;
|
|
|
+ }
|
|
|
+ public Boolean isPartition1(WbsTreeContract wbsTreeContract){
|
|
|
+ if(StringUtils.isNotEmpty(wbsTreeContract.getAncestorsPId())){
|
|
|
+ List<WbsTreeContract> list = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda().in(WbsTreeContract::getPKeyId, Func.toLongList(",", wbsTreeContract.getAncestorsPId())).in(WbsTreeContract::getNodeType, Arrays.asList(4,5,6)));
|
|
|
+ if(!list.isEmpty()){
|
|
|
+ // 获取第一个节点类型为6的元素
|
|
|
+ WbsTreeContract result1 = list.stream().filter(item -> item.getNodeType() == 6).findFirst().orElse(null);
|
|
|
+ if(result1!=null&&StringUtils.isNotEmpty(result1.getPartitionCode())){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ // 获取第一个节点类型为5的元素
|
|
|
+ WbsTreeContract result2 = list.stream().filter(item -> item.getNodeType() == 5).findFirst().orElse(null);
|
|
|
+ if(result2!=null&&StringUtils.isNotEmpty(result2.getPartitionCode())){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ WbsTreeContract result3 = list.stream().filter(item -> item.getNodeType() == 4).findFirst().orElse(null);
|
|
|
+ if(result3!=null&&StringUtils.isNotEmpty(result3.getPartitionCode())){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
public String reason(String log) {
|
|
|
/*保存的时候错误提示例如:字段过短提示 yangyj*/
|
|
|
StringBuilder sb = new StringBuilder();
|