|
@@ -462,7 +462,18 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
List<ItemBlock> itemBlockList = g.getList();
|
|
|
int originSize = itemBlockList.size();
|
|
|
- List<Long> ids = getNodeType46(tec).stream().map(CurrentNode::getPkId).collect(Collectors.toList());
|
|
|
+ List<CurrentNode> nodeType46 = getNodeType46(tec);
|
|
|
+ List<Long> ids = nodeType46.stream().map(CurrentNode::getPkId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ Map<Long, Integer> sortMap = nodeType46.stream().collect(Collectors.toMap(CurrentNode::getPkId, CurrentNode::getSort));
|
|
|
+ itemBlockList.sort((obj1, obj2) -> {
|
|
|
+ int sort1 = sortMap.getOrDefault(obj1.getPkeyId(), Integer.MAX_VALUE);
|
|
|
+ int sort2 = sortMap.getOrDefault(obj2.getPkeyId(), Integer.MAX_VALUE);
|
|
|
+ // 比较排序值
|
|
|
+ return Integer.compare(sort1, sort2);
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
/*清除那些已经不存在的工序*/
|
|
|
itemBlockList.removeIf(ik -> !ids.contains(ik.getPkeyId()));
|
|
|
if (itemBlockList.size() > 0) {
|
|
@@ -631,7 +642,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
|
|
|
public void descendantType46(Object id, List<Map<String, Object>> listMaps) {
|
|
|
- String sql = "select p_Key_id pkId,id,node_type nodeType,table_type tableType from m_wbs_tree_contract where parent_id =? and is_deleted=0";
|
|
|
+ String sql = "select p_Key_id pkId,id,node_type nodeType,table_type tableType,sort from m_wbs_tree_contract where parent_id =? and is_deleted=0";
|
|
|
List<Map<String, Object>> tmp = this.jdbcTemplate.queryForList(sql, id);
|
|
|
if (tmp.size() > 0) {
|
|
|
for (Map<String, Object> map : tmp) {
|