|
@@ -100,10 +100,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
private final InformationQueryClient informationQueryClient;
|
|
|
private final IWbsTreeContractService wbsTreeContractService;
|
|
|
private final IFormulaService formulaService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
-
|
|
|
@Autowired
|
|
|
private DataSourceTransactionManager transactionManager1;
|
|
|
private final IWbsParamService wbsParamService;
|
|
@@ -296,7 +294,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
Integer tr_1 = Integer.parseInt(ziduan[j + 1].split("__")[1].split("_")[0]);
|
|
|
Integer td_1 = Integer.parseInt(ziduan[j + 1].split("__")[1].split("_")[1]);
|
|
|
|
|
|
- if (tr > tr_1 && td == td_1) { //纵向排序
|
|
|
+ if (tr > tr_1 && td.equals(td_1)) { //纵向排序
|
|
|
temp = ziduan[j];
|
|
|
ziduan[j] = ziduan[j + 1];
|
|
|
ziduan[j + 1] = temp;
|
|
@@ -390,6 +388,29 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
+ public void formulaFillData2(JSONArray dataArray, ExecuteType type) {
|
|
|
+ try{
|
|
|
+ /*用来保存日志执行情况*/
|
|
|
+ StopWatch stopWatch = new StopWatch();
|
|
|
+ FormulaLog log = new FormulaLog();
|
|
|
+ stopWatch.start("公式处理");
|
|
|
+ /*公式*/
|
|
|
+ JSONObject tableInfo =dataArray.getJSONObject(0);
|
|
|
+ Long nodeId=tableInfo.getLong("nodeId");
|
|
|
+ List<TableInfo> tableInfoList = this.getTableInfoList(dataArray);
|
|
|
+ List<NodeTable> tableAll = createNodeTables(nodeId, tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), type);
|
|
|
+ Thread.sleep(200);
|
|
|
+ stopWatch.stop();
|
|
|
+ long totalTime = stopWatch.getTotalTimeMillis();
|
|
|
+ log.put(FormulaLog.PF, "公式执行消耗时间:" + (double)totalTime / 1000 + "秒");
|
|
|
+ StaticLog.info("公式执行用时:{}", totalTime);
|
|
|
+ updateFormulaLog(log.toJsonString(), nodeId);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private List<NodeTable> createNodeTables(Long nodeId, String contractId, String projectId, ExecuteType type) {
|
|
|
List<NodeTable> tableAll = new ArrayList<>();
|
|
|
if (type.equals(ExecuteType.INSPECTION)) {
|
|
@@ -423,11 +444,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
private void updateFormulaLog(String log, Long pKeyId) {
|
|
|
try {
|
|
|
- /* String[] sql = new String[]{
|
|
|
- "delete from m_formula_log where id =" + pKeyId,
|
|
|
- "INSERT INTO m_formula_log (id,content) VALUES (" + pKeyId + ", '" + log + "')"
|
|
|
- };
|
|
|
- this.jdbcTemplate.batchUpdate(sql);*/
|
|
|
String deleteSql = "DELETE FROM m_formula_log WHERE id = ?";
|
|
|
String insertSql = "INSERT INTO m_formula_log (id, content,update_time) VALUES (?, ?,?)";
|
|
|
jdbcTemplate.update(deleteSql, pKeyId);
|