|
@@ -26,7 +26,6 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springblade.business.dto.CustomAddContractNodeDTO;
|
|
import org.springblade.business.dto.CustomAddContractNodeDTO;
|
|
import org.springblade.business.dto.ImportTreeDto;
|
|
import org.springblade.business.dto.ImportTreeDto;
|
|
-import org.springblade.business.dto.FlushQueryNameDTO;
|
|
|
|
import org.springblade.business.entity.*;
|
|
import org.springblade.business.entity.*;
|
|
import org.springblade.business.feign.MessageWarningClient;
|
|
import org.springblade.business.feign.MessageWarningClient;
|
|
import org.springblade.business.feign.OperationLogClient;
|
|
import org.springblade.business.feign.OperationLogClient;
|
|
@@ -194,11 +193,13 @@ public class InformationWriteQueryController extends BladeController {
|
|
@PostMapping("/flushQueryName")
|
|
@PostMapping("/flushQueryName")
|
|
@ApiModelProperty(value = "刷新文件题名")
|
|
@ApiModelProperty(value = "刷新文件题名")
|
|
@ApiOperationSupport(order = 28)
|
|
@ApiOperationSupport(order = 28)
|
|
- public R<Boolean> flushQueryName(@RequestBody FlushQueryNameDTO dto){
|
|
|
|
- if(dto.getMap().size()<=0){
|
|
|
|
|
|
+ public R<Boolean> flushQueryName(@RequestParam String ids){
|
|
|
|
+ if(ids==null){
|
|
throw new ServiceException("请选择要刷新的文件");
|
|
throw new ServiceException("请选择要刷新的文件");
|
|
}
|
|
}
|
|
- List<Long> idList=new ArrayList<>(dto.getMap().keySet());
|
|
|
|
|
|
+ List<Long> idList = Arrays.stream(ids.split(","))
|
|
|
|
+ .map(Long::valueOf)
|
|
|
|
+ .collect(Collectors.toList());
|
|
List<InformationQuery> queryList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery()
|
|
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));
|
|
.select(InformationQuery::getId, InformationQuery::getName,InformationQuery::getProjectId,InformationQuery::getClassify,InformationQuery::getStatus,InformationQuery::getWbsId).in(InformationQuery::getId, idList));
|
|
String sgSuffix="";
|
|
String sgSuffix="";
|
|
@@ -211,14 +212,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
jlSuffix=projectInfos.get(0).getJlSuffix()==null?"":projectInfos.get(0).getJlSuffix();
|
|
jlSuffix=projectInfos.get(0).getJlSuffix()==null?"":projectInfos.get(0).getJlSuffix();
|
|
}
|
|
}
|
|
for (InformationQuery query : queryList) {
|
|
for (InformationQuery query : queryList) {
|
|
- String result="";
|
|
|
|
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){
|
|
|
|
- result=wbsParamClient.createFileTitle(contract);
|
|
|
|
- }else {
|
|
|
|
- result=dto.getMap().get(query.getId());
|
|
|
|
- }
|
|
|
|
|
|
+ String result=wbsParamClient.createFileTitle(contract);
|
|
if(contract!=null&&contract.getMajorDataType()!=null&&contract.getMajorDataType()==4){
|
|
if(contract!=null&&contract.getMajorDataType()!=null&&contract.getMajorDataType()==4){
|
|
if(query.getClassify()!=null&&query.getClassify()==1&&StringUtils.isNotEmpty(sgSuffix)){
|
|
if(query.getClassify()!=null&&query.getClassify()==1&&StringUtils.isNotEmpty(sgSuffix)){
|
|
result=result+sgSuffix;
|
|
result=result+sgSuffix;
|
|
@@ -245,61 +241,6 @@ public class InformationWriteQueryController extends BladeController {
|
|
return R.status(this.informationQueryService.updateBatchById(queryList));
|
|
return R.status(this.informationQueryService.updateBatchById(queryList));
|
|
}
|
|
}
|
|
|
|
|
|
- private String createFileTitle(WbsTreeContract contract, String param) {
|
|
|
|
- if(contract==null){
|
|
|
|
- return "";
|
|
|
|
- }
|
|
|
|
- String ancestorsPId = contract.getAncestorsPId();
|
|
|
|
- if (ancestorsPId.startsWith("0,")) {
|
|
|
|
- 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";
|
|
|
|
- List<WbsTreeContract> nodeNames = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
|
- param = param.trim().replaceAll("(?i:c)", "");
|
|
|
|
- List<String> list = Arrays.asList(param.split("[^.\\d]"));
|
|
|
|
- List<Integer> index = list.stream().map(Integer::parseInt).collect(Collectors.toList());
|
|
|
|
- Map<Integer, String> map = nodeNames.stream()
|
|
|
|
- .collect(Collectors.toMap(
|
|
|
|
- WbsTreeContract::getNodeType,
|
|
|
|
- WbsTreeContract::getNodeName,
|
|
|
|
- (existing, replacement) -> replacement // 如果键重复,保留后者
|
|
|
|
- ));
|
|
|
|
- StringBuilder result = new StringBuilder("");
|
|
|
|
- for (Integer i : index) {
|
|
|
|
- if(i==0){
|
|
|
|
- if(map.containsKey(1)){
|
|
|
|
- result.append(map.get(1));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if(i==1){
|
|
|
|
- if(map.containsKey(18)){
|
|
|
|
- result.append(map.get(18));
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- if(map.containsKey(i)){
|
|
|
|
- result.append(map.get(i));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return result.toString();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @GetMapping("/previewNodeName")
|
|
|
|
- @ApiOperation(value = "预览节点名称")
|
|
|
|
- @ApiImplicitParams(value = {
|
|
|
|
- @ApiImplicitParam(name = "wbsId", value = "资料查询wbsId", required = true),
|
|
|
|
- @ApiImplicitParam(name = "param", value = "题名规则", required = true)
|
|
|
|
- })
|
|
|
|
- public R<String> previewNodeName(@RequestParam String wbsId,@RequestParam String param){
|
|
|
|
- String sql="select p_key_id,ancestors_p_id from m_wbs_tree_contract where p_key_id="+wbsId+" and is_deleted=0";
|
|
|
|
- WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
|
- if(contract!=null){
|
|
|
|
- return R.data(createFileTitle(contract,param));
|
|
|
|
- }
|
|
|
|
- return R.success("暂无数据");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 初始化合同段导图树
|
|
* 初始化合同段导图树
|
|
*/
|
|
*/
|