|
|
@@ -89,6 +89,7 @@ import org.springframework.http.MediaType;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -1053,20 +1054,28 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
|
|
|
private void setTableTips(WbsTreeContract tableNode, Element tableHtml) {
|
|
|
- if (tableNode == null || tableHtml == null || tableNode.getDateIsComplete() == null || tableNode.getDateIsComplete() == 1) {
|
|
|
+ if (tableNode == null || tableHtml == null) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+ AtomicInteger status = new AtomicInteger(1);
|
|
|
String tableName = tableNode.getInitTableName();
|
|
|
List<Map<String, Object>> valueMapList = jdbcTemplate.queryForList("select * from " + tableName + " where p_key_id = " + tableNode.getPKeyId());
|
|
|
if (CollectionUtil.isEmpty(valueMapList) || CollectionUtil.isEmpty(valueMapList.get(0))) {
|
|
|
return;
|
|
|
}
|
|
|
+ Map<String, Object> map = valueMapList.get(0);
|
|
|
+ DataStructureFormatUtils.parseDataByKey( map);
|
|
|
List<WbsFormElement> wbsFormElementList = jdbcTemplate.query("select * from m_wbs_form_element where f_id = ( select id from m_table_info where tab_en_name in ( '" + tableName + "' ) and is_deleted = 0) and is_deleted = 0 and (required = 1 or node_ignore is not null)",
|
|
|
new BeanPropertyRowMapper<>(WbsFormElement.class));
|
|
|
if (CollectionUtil.isEmpty(wbsFormElementList)) {
|
|
|
Elements elements = tableHtml.select("el-date-picker");
|
|
|
elements.forEach(element -> {
|
|
|
+ String keyname = element.attr("keyname");
|
|
|
+ String key = keyname.split("__")[0];
|
|
|
+ if ( map.get(key)!= null && map.get(key).toString().contains("_^_")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ status.set(2);
|
|
|
Elements parents = element.parents();
|
|
|
parents.forEach(parent -> {
|
|
|
if (parent.tagName().equals("td")) {
|
|
|
@@ -1077,8 +1086,7 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- String keyname = element.attr("keyname");
|
|
|
- element.before("<hc-tooltip :tipsStatus=\"" + true + "\" text=\"缺少日期\" keyname=\""+keyname +"\" @leftClick=\"changeTipsStatus\" typeKey=\"" + keyname.split("__")[0] + "\"/>");
|
|
|
+ element.before("<hc-tooltip :tipsStatus=\"" + true + "\" text=\"缺少日期\" keyname=\""+keyname +"\" @leftClick=\"changeTipsStatus\" typeKey=\"" + key + "\"/>");
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
@@ -1087,6 +1095,10 @@ public class ExcelTabController extends BladeController {
|
|
|
elements.forEach(element -> {
|
|
|
String keyname = element.attr("keyname");
|
|
|
String key = keyname.split("__")[0];
|
|
|
+ if (map.get(key) != null && map.get(key).toString().contains("_^_")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ status.set(2);
|
|
|
boolean flag = true;
|
|
|
if (!keyMap.containsKey(key)) {
|
|
|
WbsFormElement wbsFormElement = keyMap.get(key);
|
|
|
@@ -1106,14 +1118,17 @@ public class ExcelTabController extends BladeController {
|
|
|
});
|
|
|
element.before("<hc-tooltip :tipsStatus=\"" + flag + "\" text=\"缺少日期\" keyname=\""+keyname +"\" @leftClick=\"changeTipsStatus\" typeKey=\"" + key + "\"/>");
|
|
|
});
|
|
|
- Map<String, Object> map = valueMapList.get(0);
|
|
|
- DataStructureFormatUtils.parseDataByKey( map);
|
|
|
|
|
|
for (WbsFormElement wbsFormElement : wbsFormElementList) {
|
|
|
Object obj = map.get(wbsFormElement.getEKey());
|
|
|
if (obj != null && obj.toString().contains("_^_")) {
|
|
|
continue;
|
|
|
}
|
|
|
+ if (status.get() == 2) {
|
|
|
+ status.set(4);
|
|
|
+ } else if (status.get() == 1) {
|
|
|
+ status.set(3);
|
|
|
+ }
|
|
|
// 查找html中标签属性 keyname中包含 wbsFormElement.getEKey()的标签
|
|
|
Elements keyNames = tableHtml.getElementsByAttributeValueContaining("keyname", wbsFormElement.getEKey());
|
|
|
if (!keyNames.isEmpty()) {
|
|
|
@@ -1137,7 +1152,15 @@ public class ExcelTabController extends BladeController {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ updateCheckData(tableNode,status.get());
|
|
|
+ }
|
|
|
+ @Async
|
|
|
+ public void updateCheckData(WbsTreeContract tableNode, Integer status) {
|
|
|
+ if (status > 1) {
|
|
|
+ wbsTreeContractService.update(Wrappers.<WbsTreeContract>lambdaUpdate().set(WbsTreeContract::getDateIsComplete, status).eq(WbsTreeContract::getPKeyId, tableNode.getPKeyId()));
|
|
|
+ WbsTreeContract parentNode = wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, tableNode.getPId()));
|
|
|
+ wbsTreeContractService.checkNodeAllDate(parentNode);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|