|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import com.mixsmart.utils.CustomFunction;
|
|
|
+import com.mixsmart.utils.FormulaUtils;
|
|
|
import com.mixsmart.utils.ListUtils;
|
|
|
import com.mixsmart.utils.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -25,6 +26,7 @@ import org.springblade.manager.entity.*;
|
|
|
import org.springblade.manager.formula.KeyMapper;
|
|
|
import org.springblade.manager.service.*;
|
|
|
import org.springblade.manager.service.impl.FormulaServiceImpl;
|
|
|
+import org.springblade.manager.vo.AppWbsTreeContractVO;
|
|
|
import org.springblade.manager.wrapper.FormulaWrapper;
|
|
|
import org.springframework.dao.EmptyResultDataAccessException;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
@@ -53,7 +55,6 @@ public class FormulaController {
|
|
|
private final IContractInfoService contractInfoService;
|
|
|
private final ITextdictInfoService textdictInfoService;
|
|
|
private final IFormulaOptionService formulaOptionService;
|
|
|
-
|
|
|
// 合同段服务-
|
|
|
private final IWbsTreeContractService wbsTreeContractService;
|
|
|
/**
|
|
@@ -427,5 +428,48 @@ public class FormulaController {
|
|
|
|
|
|
|
|
|
|
|
|
+ @GetMapping("/tracing")
|
|
|
+ @ApiOperationSupport(order = 10)
|
|
|
+ public R<Object> tracing(Long pkeyId){
|
|
|
+ WbsTreeContract one= this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId,pkeyId));
|
|
|
+ if(one!=null){
|
|
|
+ List<String> list = new ArrayList<>();
|
|
|
+ list.add(Func.isNotBlank(one.getFullName())?one.getFullName():one.getNodeName());
|
|
|
+ int max=20;
|
|
|
+ int loop=0;
|
|
|
+ String parentId= one.getParentId().toString();
|
|
|
+ while (loop<max&&StringUtils.isNotEquals(0,parentId)){
|
|
|
+ WbsTreeContract next= this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getContractId,one.getContractId()).eq(WbsTreeContract::getId,parentId));
|
|
|
+ parentId=next.getParentId().toString();
|
|
|
+ list.add(Func.isNotBlank(next.getFullName())?next.getFullName():next.getNodeName());
|
|
|
+ loop++;
|
|
|
+ }
|
|
|
+ Collections.reverse(list);
|
|
|
+ final String[] indent = {""};
|
|
|
+ String result = list.stream()
|
|
|
+ .map(item -> {
|
|
|
+ String line = indent[0] + item;
|
|
|
+ indent[0] += " ";
|
|
|
+ return line;
|
|
|
+ })
|
|
|
+ .collect(Collectors.joining("\n"));
|
|
|
+ System.out.println(result);
|
|
|
+ return R.data(result);
|
|
|
+ }
|
|
|
+ return R.fail("无数据");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/item-matching")
|
|
|
+ @ApiOperationSupport(order = 10)
|
|
|
+ public R<Object> matching(String tableName ,String search){
|
|
|
+ String sql="select a.tab_ch_name tb,b.e_name en,b.id,b.e_key ek from m_table_info a join m_wbs_form_element b on b.f_id=a.id where b.is_deleted=0 and a.tab_en_name=? and b.e_name like ?";
|
|
|
+ List<Map<String,Object>> result = this.jdbcTemplate.queryForList(sql, tableName,"%"+search+"%");
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("解析前", result.stream().map(e-> StringUtils.handleNull(e.get("en"))).collect(Collectors.toList()));
|
|
|
+ map.put("解析后", result.stream().map(e-> FormulaUtils.parseItemName(StringUtils.handleNull(e.get("en")))).collect(Collectors.toList()));
|
|
|
+ return R.data(map);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|