|
@@ -614,19 +614,35 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
// resultTabs.forEach(tab->tab.setFileName(info.getName()));
|
|
|
// }
|
|
|
|
|
|
-
|
|
|
-// if (Optional.ofNullable(wbsTreeContract.getIsUseSort()).orElse(0) == 0) {
|
|
|
-// //表单排序
|
|
|
-// if (resultTabs.size() > 0) {
|
|
|
-// List<AppWbsTreeContractVO> resultTabsToCopy = this.sortTabs(resultTabs, "__"); //复制表排序
|
|
|
-// return this.sortTabs(resultTabsToCopy, "_PL_"); //频率表排序
|
|
|
-// }
|
|
|
-// }
|
|
|
- // 使用自定义 Comparator 进行排序
|
|
|
+ // 使用自定义 Comparator 进行排序
|
|
|
resultTabs.sort(new WbsTreeContractComparator());
|
|
|
+ sortTabsByIsTypePrivatePid(resultTabs);
|
|
|
+ if (Optional.ofNullable(wbsTreeContract.getIsUseSort()).orElse(0) == 0) {
|
|
|
+ //表单排序
|
|
|
+ if (resultTabs.size() > 0) {
|
|
|
+ List<AppWbsTreeContractVO> resultTabsToCopy = this.sortTabs(resultTabs, "__"); //复制表排序
|
|
|
+ return this.sortTabs(resultTabsToCopy, "_PL_"); //频率表排序
|
|
|
+ }
|
|
|
+ }
|
|
|
return resultTabs;
|
|
|
}
|
|
|
|
|
|
+ private void sortTabsByIsTypePrivatePid(List<AppWbsTreeContractVO> resultTabs) {
|
|
|
+ if(!resultTabs.isEmpty()){
|
|
|
+ for (AppWbsTreeContractVO resultTab : resultTabs) {
|
|
|
+ if(resultTab.getIsTypePrivatePid()!=null){
|
|
|
+ String sql="select IFNULL(sort,1000) from m_wbs_tree_private where p_key_id="+resultTab.getIsTypePrivatePid()+" and is_deleted=0";
|
|
|
+ Integer sort = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
+ if(sort!=null&&sort!=1000&&!Objects.equals(sort, resultTab.getSort())){
|
|
|
+ resultTab.setSort(sort);
|
|
|
+ String sql1="update m_wbs_tree_contract set sort="+sort+" where p_key_id="+resultTab.getPKeyId();
|
|
|
+ jdbcTemplate.update(sql1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static class WbsTreeContractComparator implements Comparator<AppWbsTreeContractVO> {
|
|
|
|