|
@@ -611,10 +611,13 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
// if(info!=null){
|
|
// if(info!=null){
|
|
// resultTabs.forEach(tab->tab.setFileName(info.getName()));
|
|
// resultTabs.forEach(tab->tab.setFileName(info.getName()));
|
|
// }
|
|
// }
|
|
|
|
+
|
|
if (Optional.ofNullable(wbsTreeContract.getIsUseSort()).orElse(0) == 0) {
|
|
if (Optional.ofNullable(wbsTreeContract.getIsUseSort()).orElse(0) == 0) {
|
|
//表单排序
|
|
//表单排序
|
|
if (resultTabs.size() > 0) {
|
|
if (resultTabs.size() > 0) {
|
|
sortTabsByIsTypePrivatePid(resultTabs);
|
|
sortTabsByIsTypePrivatePid(resultTabs);
|
|
|
|
+ // 使用自定义 Comparator 进行排序
|
|
|
|
+ resultTabs.sort(new WbsTreeContractComparator());
|
|
List<AppWbsTreeContractVO> resultTabsToCopy = this.sortTabs(resultTabs, "__"); //复制表排序
|
|
List<AppWbsTreeContractVO> resultTabsToCopy = this.sortTabs(resultTabs, "__"); //复制表排序
|
|
return this.sortTabs(resultTabsToCopy, "_PL_"); //频率表排序
|
|
return this.sortTabs(resultTabsToCopy, "_PL_"); //频率表排序
|
|
}
|
|
}
|
|
@@ -628,7 +631,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
if(!resultTabs.isEmpty()){
|
|
if(!resultTabs.isEmpty()){
|
|
StringBuilder ids=new StringBuilder("");
|
|
StringBuilder ids=new StringBuilder("");
|
|
List<Integer>sorts1=new ArrayList<>();
|
|
List<Integer>sorts1=new ArrayList<>();
|
|
- List<Integer>sorts2=new ArrayList<>();
|
|
|
|
for (AppWbsTreeContractVO resultTab : resultTabs) {
|
|
for (AppWbsTreeContractVO resultTab : resultTabs) {
|
|
if(resultTab.getExcelId()==null){
|
|
if(resultTab.getExcelId()==null){
|
|
continue;
|
|
continue;
|
|
@@ -636,7 +638,6 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
//拿到质量检验表附表的pkeyId,以及sort
|
|
//拿到质量检验表附表的pkeyId,以及sort
|
|
if(resultTab.getExcelId()==1777969831956520962L||resultTab.getExcelId()==1636534954773417986L||resultTab.getExcelId()==1626130998410768385L){
|
|
if(resultTab.getExcelId()==1777969831956520962L||resultTab.getExcelId()==1636534954773417986L||resultTab.getExcelId()==1626130998410768385L){
|
|
ids.append(resultTab.getPKeyId()+",");
|
|
ids.append(resultTab.getPKeyId()+",");
|
|
- sorts2.add(resultTab.getSort());
|
|
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
//检验附表以外的排序有问题的表单修改
|
|
//检验附表以外的排序有问题的表单修改
|
|
@@ -659,21 +660,19 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
sorts1.add(resultTab.getSort());
|
|
sorts1.add(resultTab.getSort());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(!sorts1.isEmpty()&&!sorts2.isEmpty()){
|
|
|
|
|
|
+ if(!sorts1.isEmpty()){
|
|
String idss = ids.substring(0, ids.length() - 1);
|
|
String idss = ids.substring(0, ids.length() - 1);
|
|
//tableType=1 的表单sort的最大值
|
|
//tableType=1 的表单sort的最大值
|
|
Integer maxSort = Collections.max(sorts1);
|
|
Integer maxSort = Collections.max(sorts1);
|
|
- //质量检验表附表 的sort的最小值
|
|
|
|
- Integer minSort = Collections.min(sorts2);
|
|
|
|
- if(maxSort>minSort){
|
|
|
|
resultTabs.forEach(r->{
|
|
resultTabs.forEach(r->{
|
|
if(idss.contains(r.getPKeyId()+"")){
|
|
if(idss.contains(r.getPKeyId()+"")){
|
|
- r.setSort(maxSort);
|
|
|
|
|
|
+ if(!Objects.equals(r.getSort(), maxSort)){
|
|
|
|
+ r.setSort(maxSort);
|
|
|
|
+ String sql2="update m_wbs_tree_contract set sort="+maxSort+" where p_key_id="+r.getPKeyId();
|
|
|
|
+ jdbcTemplate.update(sql2);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- String sql2="update m_wbs_tree_contract set sort="+maxSort+" where p_key_id in ("+idss+")";
|
|
|
|
- jdbcTemplate.update(sql2);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|