cr 1 týždeň pred
rodič
commit
082e6d869c

+ 9 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/FlushQueryNameDTO.java

@@ -14,5 +14,13 @@ public class FlushQueryNameDTO {
     private Integer type;
 
     @ApiModelProperty(value = "题名内容 type=2{资料查询ID:修改后文件题名},type=1{资料查询ID:空字符串}")
-    private Map<Long,String> map;
+    private List<MapValue> list;
+
+    @Data
+    public static class MapValue{
+    	@ApiModelProperty(value = "资料查询ID")
+    	private Long id;
+    	@ApiModelProperty(value = "修改后文件题名")
+    	private String nodeName;
+    }
 }

+ 6 - 4
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -203,10 +203,12 @@ public class InformationWriteQueryController extends BladeController {
     @ApiModelProperty(value = "刷新文件题名")
     @ApiOperationSupport(order = 28)
     public R<Boolean> flushQueryName(@RequestBody FlushQueryNameDTO dto){
-        if(dto.getMap().size()<=0){
+        if(dto.getList().size()<=0){
             throw new ServiceException("请选择要刷新的文件");
         }
-        List<Long> idList=new ArrayList<>(dto.getMap().keySet());
+        List<Long> idList = dto.getList().stream().map(FlushQueryNameDTO.MapValue::getId).collect(Collectors.toList());
+        Map<Long, String> nodeNameMap = dto.getList().stream()
+                .collect(Collectors.toMap(FlushQueryNameDTO.MapValue::getId, FlushQueryNameDTO.MapValue::getNodeName));
         List<InformationQuery> queryList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery()
             .select(InformationQuery::getId, InformationQuery::getName,InformationQuery::getProjectId,InformationQuery::getClassify,InformationQuery::getStatus,InformationQuery::getWbsId).in(InformationQuery::getId, idList));
         String sgSuffix="";
@@ -225,7 +227,7 @@ public class InformationWriteQueryController extends BladeController {
                 if(dto.getType()==1){
                     result=wbsParamClient.createFileTitle(contract);
                 }else {
-                    result=dto.getMap().get(query.getId());
+                    result=nodeNameMap.get(query.getId());
                 }
                 if(contract!=null&&contract.getMajorDataType()!=null&&contract.getMajorDataType()==4){
                     if(query.getClassify()!=null&&query.getClassify()==1&&StringUtils.isNotEmpty(sgSuffix)){
@@ -262,7 +264,7 @@ public class InformationWriteQueryController extends BladeController {
             ancestorsPId = ancestorsPId.substring(2);
         }
         ancestorsPId=ancestorsPId+","+contract.getPKeyId();
-        String sql="select node_name,node_type from m_wbs_tree_contract where p_key_id in ("+ancestorsPId+") and is_deleted=0";
+        String sql="select  REPLACE(REPLACE(node_name, CHAR(10), ''), CHAR(13), '') as node_name,node_type from m_wbs_tree_contract where p_key_id in ("+ancestorsPId+") and is_deleted=0";
         List<WbsTreeContract> nodeNames = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
         param = param.trim().replaceAll("(?i:c)", "");
         List<String> list = Arrays.asList(param.split("[^.\\d]"));