|
@@ -234,16 +234,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
String sql="select * from m_wbs_tree_contract where p_key_id="+query.getWbsId()+" and is_deleted=0";
|
|
String sql="select * from m_wbs_tree_contract where p_key_id="+query.getWbsId()+" and is_deleted=0";
|
|
WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
if(dto.getType()==1){
|
|
if(dto.getType()==1){
|
|
- R<List<String>> nameRuleList = wbsParamClient.getNameRuleByPkeyId(contract.getPKeyId(), Long.valueOf(contract.getProjectId()));
|
|
|
|
- String nameRule = "";
|
|
|
|
- if (nameRuleList != null && nameRuleList.getData() != null && !nameRuleList.getData().isEmpty()) {
|
|
|
|
- nameRule = String.join("-", nameRuleList.getData());
|
|
|
|
- }
|
|
|
|
- if(projectInfos.get(0)!=null&&projectInfos.get(0).getTemplateType()==2){
|
|
|
|
- result = nodeBaseInfoServiceClient.getNameRuleByRule(nameRule, contract.getPKeyId()+"");
|
|
|
|
- }else {
|
|
|
|
- result=wbsParamClient.createFileTitle(contract);
|
|
|
|
- }
|
|
|
|
|
|
+ result=wbsParamClient.createFileTitle(contract);
|
|
}else {
|
|
}else {
|
|
result=nodeNameMap.get(query.getId());
|
|
result=nodeNameMap.get(query.getId());
|
|
//同时修改工程划分节点命名规则
|
|
//同时修改工程划分节点命名规则
|
|
@@ -256,12 +247,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
result="";
|
|
result="";
|
|
}
|
|
}
|
|
if(query.getClassify()!=null&&query.getClassify()==1&&StringUtils.isNotEmpty(sgSuffix)){
|
|
if(query.getClassify()!=null&&query.getClassify()==1&&StringUtils.isNotEmpty(sgSuffix)){
|
|
- result=result+sgSuffix;
|
|
|
|
|
|
+ if(!result.contains(sgSuffix)){
|
|
|
|
+ result=result+sgSuffix;
|
|
|
|
+ }
|
|
if(!query.getName().equals(result)){
|
|
if(!query.getName().equals(result)){
|
|
query.setName(result);
|
|
query.setName(result);
|
|
}
|
|
}
|
|
}else if(query.getClassify()!=null&&query.getClassify()==2&&StringUtils.isNotEmpty(jlSuffix)){
|
|
}else if(query.getClassify()!=null&&query.getClassify()==2&&StringUtils.isNotEmpty(jlSuffix)){
|
|
- result=result+jlSuffix;
|
|
|
|
|
|
+ if(!result.contains(jlSuffix)){
|
|
|
|
+ result=result+jlSuffix;
|
|
|
|
+ }
|
|
if(!query.getName().equals(result)){
|
|
if(!query.getName().equals(result)){
|
|
query.setName(result);
|
|
query.setName(result);
|
|
}
|
|
}
|
|
@@ -408,17 +403,37 @@ public class InformationWriteQueryController extends BladeController {
|
|
})
|
|
})
|
|
public R<List<PreviewNodeNameVO1>> previewNodeName(@RequestBody List<PreviewNodeNameDTO1>dtos){
|
|
public R<List<PreviewNodeNameVO1>> previewNodeName(@RequestBody List<PreviewNodeNameDTO1>dtos){
|
|
List<PreviewNodeNameVO1> list = new ArrayList<>();
|
|
List<PreviewNodeNameVO1> list = new ArrayList<>();
|
|
|
|
+ String sql1="Select sg_suffix,jl_suffix,template_type from m_project_info where id="+dtos.get(0).getProjectId()+" and is_deleted=0";
|
|
|
|
+ List<ProjectInfo> projectInfos = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(ProjectInfo.class));
|
|
|
|
+ String sgSuffix="";
|
|
|
|
+ String jlSuffix="";
|
|
|
|
+ if(projectInfos.size()>0){
|
|
|
|
+ sgSuffix=projectInfos.get(0).getSgSuffix()==null?"":projectInfos.get(0).getSgSuffix();
|
|
|
|
+ jlSuffix=projectInfos.get(0).getJlSuffix()==null?"":projectInfos.get(0).getJlSuffix();
|
|
|
|
+ }
|
|
for (PreviewNodeNameDTO1 dto1 : dtos) {
|
|
for (PreviewNodeNameDTO1 dto1 : dtos) {
|
|
if(StringUtils.isEmpty(dto1.getNameRule())){
|
|
if(StringUtils.isEmpty(dto1.getNameRule())){
|
|
throw new ServiceException("请输入题名规则");
|
|
throw new ServiceException("请输入题名规则");
|
|
}
|
|
}
|
|
- String result=nodeBaseInfoServiceClient.getNameRuleByRule(dto1.getNameRule(),dto1.getWbsId());
|
|
|
|
-// String sql="select p_key_id,ancestors_p_id from m_wbs_tree_contract where p_key_id="+dto1.getWbsId()+" and is_deleted=0";
|
|
|
|
-// WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
|
-// String result="";
|
|
|
|
-// if(contract!=null){
|
|
|
|
-// result= createFileTitle(contract, dto1.getNameRule());
|
|
|
|
-// }
|
|
|
|
|
|
+// String result=nodeBaseInfoServiceClient.getNameRuleByRule(dto1.getNameRule(),dto1.getWbsId());
|
|
|
|
+ String sql="select p_key_id,ancestors_p_id,major_data_type,table_owner from m_wbs_tree_contract where p_key_id="+dto1.getWbsId()+" and is_deleted=0";
|
|
|
|
+ WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
|
+ String sql2="select IFNULL(classify,0) from u_information_query where id="+dto1.getId();
|
|
|
|
+ Integer classify = jdbcTemplate.queryForObject(sql2, Integer.class);
|
|
|
|
+ String result="";
|
|
|
|
+ if(contract!=null){
|
|
|
|
+ result= createFileTitle(contract, dto1.getNameRule());
|
|
|
|
+ if(contract!=null&&contract.getMajorDataType()!=null&&contract.getMajorDataType()==4){
|
|
|
|
+ if(result==null){
|
|
|
|
+ result="";
|
|
|
|
+ }
|
|
|
|
+ if(classify==1&&StringUtils.isNotEmpty(sgSuffix)){
|
|
|
|
+ result=result+sgSuffix;
|
|
|
|
+ }else if(classify==2&&StringUtils.isNotEmpty(jlSuffix)){
|
|
|
|
+ result=result+jlSuffix;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
list.add(new PreviewNodeNameVO1(dto1.getWbsId(),result.toString()));
|
|
list.add(new PreviewNodeNameVO1(dto1.getWbsId(),result.toString()));
|
|
}
|
|
}
|
|
return R.data(list);
|
|
return R.data(list);
|
|
@@ -430,11 +445,34 @@ public class InformationWriteQueryController extends BladeController {
|
|
List<PreviewNodeNameVO>list=new ArrayList<>();
|
|
List<PreviewNodeNameVO>list=new ArrayList<>();
|
|
for (PreviewNodeNameDTO dto : dtos) {
|
|
for (PreviewNodeNameDTO dto : dtos) {
|
|
List<String> nameRules = getNameRuleByPkeyId(dto.getWbsId(), dto.getProjectId());
|
|
List<String> nameRules = getNameRuleByPkeyId(dto.getWbsId(), dto.getProjectId());
|
|
- String sql="select p_key_id,ancestors_p_id from m_wbs_tree_contract where p_key_id="+dto.getWbsId()+" and is_deleted=0";
|
|
|
|
|
|
+ String sql="select p_key_id,ancestors_p_id,major_data_type from m_wbs_tree_contract where p_key_id="+dto.getWbsId()+" and is_deleted=0";
|
|
WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
|
+ String sql2="select IFNULL(classify,0) from u_information_query where id="+dto.getId();
|
|
|
|
+ Integer classify = jdbcTemplate.queryForObject(sql2, Integer.class);
|
|
String result="";
|
|
String result="";
|
|
if(nameRules!=null){
|
|
if(nameRules!=null){
|
|
- result = nodeBaseInfoServiceClient.getNameRuleByRule(String.join("-", nameRules), contract.getPKeyId() + "");
|
|
|
|
|
|
+ result= createFileTitle(contract, String.join("-", nameRules));
|
|
|
|
+ //result = nodeBaseInfoServiceClient.getNameRuleByRule(String.join("-", nameRules), contract.getPKeyId() + "");
|
|
|
|
+ if(contract!=null){
|
|
|
|
+ String sql1="Select sg_suffix,jl_suffix,template_type from m_project_info where id="+dtos.get(0).getProjectId()+" and is_deleted=0";
|
|
|
|
+ List<ProjectInfo> projectInfos = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(ProjectInfo.class));
|
|
|
|
+ String sgSuffix="";
|
|
|
|
+ String jlSuffix="";
|
|
|
|
+ if(projectInfos.size()>0){
|
|
|
|
+ sgSuffix=projectInfos.get(0).getSgSuffix()==null?"":projectInfos.get(0).getSgSuffix();
|
|
|
|
+ jlSuffix=projectInfos.get(0).getJlSuffix()==null?"":projectInfos.get(0).getJlSuffix();
|
|
|
|
+ }
|
|
|
|
+ if(contract!=null&&contract.getMajorDataType()!=null&&contract.getMajorDataType()==4){
|
|
|
|
+ if(result==null){
|
|
|
|
+ result="";
|
|
|
|
+ }
|
|
|
|
+ if(classify==1&&StringUtils.isNotEmpty(sgSuffix)){
|
|
|
|
+ result=result+sgSuffix;
|
|
|
|
+ }else if(classify==2&&StringUtils.isNotEmpty(jlSuffix)){
|
|
|
|
+ result=result+jlSuffix;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
list.add(new PreviewNodeNameVO(dto.getWbsId(),result,nameRules));
|
|
list.add(new PreviewNodeNameVO(dto.getWbsId(),result,nameRules));
|
|
}
|
|
}
|
|
@@ -1252,6 +1290,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
oldHtml.setId(SnowFlakeUtil.getId());
|
|
oldHtml.setId(SnowFlakeUtil.getId());
|
|
oldHtml.setCreateUser(getUser().getUserId());
|
|
oldHtml.setCreateUser(getUser().getUserId());
|
|
String htmlUrl = wbsTreeContract.getHtmlUrl();
|
|
String htmlUrl = wbsTreeContract.getHtmlUrl();
|
|
|
|
+ if (htmlUrl == null || htmlUrl.isEmpty()|| "null".equals(htmlUrl)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
// 获取或下载文件
|
|
// 获取或下载文件
|
|
Path sourcePath = FileUtils.getOrDownloadFile(htmlUrl);
|
|
Path sourcePath = FileUtils.getOrDownloadFile(htmlUrl);
|
|
// 生成副本路径
|
|
// 生成副本路径
|
|
@@ -2749,7 +2790,7 @@ private String reviseCols(Map<String, String> p2, String cols, Long pkeyId, Stri
|
|
if (!map1.isEmpty()) {
|
|
if (!map1.isEmpty()) {
|
|
int i = target.indexOf("key_201");
|
|
int i = target.indexOf("key_201");
|
|
if (i >= 0) {
|
|
if (i >= 0) {
|
|
- target.set(i, DataStructureFormatUtils.buildDataObject(map1));
|
|
|
|
|
|
+ target.set(i, " '" + DataStructureFormatUtils.buildDataObject(map1) + "' ");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -4118,11 +4159,11 @@ public R<Boolean> saveContractTreeNode(@RequestBody AddContractTreeNodeVO vo) {
|
|
WbsTreeContract newData = new WbsTreeContract();
|
|
WbsTreeContract newData = new WbsTreeContract();
|
|
BeanUtils.copyProperties(half, newData);
|
|
BeanUtils.copyProperties(half, newData);
|
|
|
|
|
|
- //重塑pKeyId、id和parentId
|
|
|
|
- newData.setPKeyId(OldPKeyIdToNewPKeyIdMap.get(half.getPKeyId()));
|
|
|
|
- if (new Integer("1").equals(half.getType())) {
|
|
|
|
|
|
+ //重塑pKeyId、id和parentId
|
|
|
|
+ newData.setPKeyId(OldPKeyIdToNewPKeyIdMap.get(half.getPKeyId()));
|
|
|
|
+ if (new Integer("1").equals(half.getType())) {
|
|
newData.setId(OldIdToNewIdMap.containsKey(half.getId()) ? OldIdToNewIdMap.get(half.getId()) : SnowFlakeUtil.getId());
|
|
newData.setId(OldIdToNewIdMap.containsKey(half.getId()) ? OldIdToNewIdMap.get(half.getId()) : SnowFlakeUtil.getId());
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
//设置父级id
|
|
//设置父级id
|
|
boolean var = true;
|
|
boolean var = true;
|
|
@@ -4418,6 +4459,9 @@ public void updateTextDictInfos(List<WbsTreeContract> nowTabs, List<Long> oldTab
|
|
nowTab.setExcelId(tab.getExcelId());
|
|
nowTab.setExcelId(tab.getExcelId());
|
|
nowTab.setIsTypePrivatePid(tab.getPKeyId());
|
|
nowTab.setIsTypePrivatePid(tab.getPKeyId());
|
|
nowTab.setInitTableName(tab.getInitTableName());
|
|
nowTab.setInitTableName(tab.getInitTableName());
|
|
|
|
+ if(nowTab.getHtmlUrl()==null||nowTab.getHtmlUrl().equals("null")){
|
|
|
|
+ nowTab.setHtmlUrl("");
|
|
|
|
+ }
|
|
String updateSql = "update m_wbs_tree_contract set html_url = '" + nowTab.getHtmlUrl() + "',excel_id = " + nowTab.getExcelId() + ",init_table_name = '" + nowTab.getInitTableName() + "',is_type_private_pid = " + nowTab.getIsTypePrivatePid() + " where p_key_id = " + nowTab.getPKeyId();
|
|
String updateSql = "update m_wbs_tree_contract set html_url = '" + nowTab.getHtmlUrl() + "',excel_id = " + nowTab.getExcelId() + ",init_table_name = '" + nowTab.getInitTableName() + "',is_type_private_pid = " + nowTab.getIsTypePrivatePid() + " where p_key_id = " + nowTab.getPKeyId();
|
|
resultSQL.add(updateSql);
|
|
resultSQL.add(updateSql);
|
|
}
|
|
}
|