|
@@ -15,6 +15,7 @@ import com.mixsmart.utils.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import lombok.SneakyThrows;
|
|
|
import org.springblade.common.utils.BaseUtils;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
@@ -28,6 +29,7 @@ import org.springblade.core.tool.utils.StringPool;
|
|
|
import org.springblade.manager.dto.*;
|
|
|
import org.springblade.manager.entity.*;
|
|
|
import org.springblade.manager.enums.ExecuteType;
|
|
|
+import org.springblade.manager.formula.ITurnPointCalculator;
|
|
|
import org.springblade.manager.formula.KeyMapper;
|
|
|
import org.springblade.manager.formula.impl.CompositeDataAccess;
|
|
|
import org.springblade.manager.formula.impl.StartupTimeListener;
|
|
@@ -42,6 +44,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
import java.io.FileNotFoundException;
|
|
|
+import java.net.InetAddress;
|
|
|
+import java.net.UnknownHostException;
|
|
|
import java.time.Instant;
|
|
|
import java.time.ZoneId;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
@@ -439,13 +443,16 @@ public class FormulaController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/log")
|
|
|
- public R<Object> log(Long pkeyId) {
|
|
|
+ public R<Object> log(Long pkeyId) throws UnknownHostException {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
Instant startupTime = StartupTimeListener.getStartupTime();
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
|
|
result.put("版本信息", "Application started at:" + formatter.format(startupTime));
|
|
|
+ result.put("公式版本", "Formula version:" + ITurnPointCalculator.VERSION);
|
|
|
+ result.put("serve", System.getProperty("os.name"));
|
|
|
if (Func.isNotEmpty(pkeyId)) {
|
|
|
- result.put("执行情况", this.jdbcTemplate.queryForList("select * from m_formula_log where id=" + pkeyId));
|
|
|
+ String sql="select * from m_formula_log where id=?";
|
|
|
+ result.put("执行情况", this.jdbcTemplate.queryForList(sql,pkeyId));
|
|
|
}
|
|
|
return R.data(result);
|
|
|
}
|
|
@@ -770,10 +777,13 @@ public class FormulaController {
|
|
|
return formula;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**initTableName 缺失刷入*/
|
|
|
@GetMapping("/table-name")
|
|
|
- public R<Object> lack() {
|
|
|
- List<Map<String,Object>> listMap=this.jdbcTemplate.queryForList("select p_key_id pkeyId,node_name nodeName from m_wbs_tree_contract where project_id=1630011899725201410 and table_type>0 and is_deleted=0 and init_table_name is null ");
|
|
|
+ public R<Object> lack(Long projectId) {
|
|
|
+ if(!StringUtils.isNumber(projectId)){
|
|
|
+ return R.fail("错误项目id格式");
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> listMap=this.jdbcTemplate.queryForList("select p_key_id pkeyId,node_name nodeName from m_wbs_tree_contract where project_id="+projectId+" and table_type>0 and is_deleted=0 and init_table_name is null ");
|
|
|
Map<Long,String> idMap= listMap.stream().collect(Collectors.toMap(m->Long.parseLong(m.get("pkeyId").toString()),m->m.get("nodeName").toString()));
|
|
|
List<Map<String,Object>> tn = this.jdbcTemplate.queryForList("select tab_ch_name ch,tab_en_name en from m_table_info where tab_ch_name in("+idMap.values().stream().distinct().map(Object::toString).collect(Collectors.joining("','","'","'"))+")");
|
|
|
Map<String,String> tbMap= tn.stream().collect(Collectors.toMap(m->m.get("ch").toString(),m->m.get("en").toString()));
|
|
@@ -811,5 +821,17 @@ public class FormulaController {
|
|
|
return R.fail("失败");
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/ref")
|
|
|
+ public R<Object> ref() {
|
|
|
+ /*专门用刷数据的*/
|
|
|
+ Long contractId=1630017379264610305L;
|
|
|
+ String sql ="select p_key_id pkeyId ,id,old_id originId,full_name fullName,node_name nodeName from m_wbs_tree_contract where contract_id=? and node_type=6 AND is_deleted=0 and is_type_private_pid is null";
|
|
|
+ List<Map<String,Object>> listMaps=this.jdbcTemplate.queryForList(sql,contractId);
|
|
|
+ if(listMaps.size()>0){
|
|
|
+
|
|
|
+ }
|
|
|
+ return R.success("成功");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|