Przeglądaj źródła

试验-排序功能调整

LHB 2 tygodni temu
rodzic
commit
7274281429

+ 3 - 11
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -146,17 +146,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getQueryStatus())) {
                 queryWrapper.lambda().eq(TrialSelfInspectionRecord::getDetectionResult, dto.getQueryStatus());
             }
-            if (dto.getSortType() != null) {
-                if (dto.getSortType().equals("1")) {
-                    queryWrapper.lambda().orderByAsc(TrialSelfInspectionRecord::getReportNo);
-                } else if (dto.getSortType().equals("2")) {
-                    queryWrapper.lambda().orderByDesc(TrialSelfInspectionRecord::getReportNo);
-                } else if (dto.getSortType().equals("3")) {
-                    queryWrapper.lambda().orderByAsc(Arrays.asList(TrialSelfInspectionRecord::getSpecificationModel, TrialSelfInspectionRecord::getReportNo));
-                } else if (dto.getSortType().equals("4")) {
-                    queryWrapper.lambda().orderByDesc(Arrays.asList(TrialSelfInspectionRecord::getSpecificationModel, TrialSelfInspectionRecord::getReportNo));
-                }
-            }
+            queryWrapper.lambda().orderByAsc(TrialSelfInspectionRecord::getSort);
 
             IPage<TrialSelfInspectionRecord> pages = this.page(page, queryWrapper.lambda().orderByDesc(true, TrialSelfInspectionRecord::getCreateTime));
             IPage<TrialSelfInspectionRecordVO> trialSelfInspectionRecordVOIPage = TrialSelfInspectionRecordWarpper.build().pageVO(pages);
@@ -2379,6 +2369,8 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
     public void updateSort(TrialSelfInspectionRecordPageDTO dto) {
         LambdaQueryWrapper<TrialSelfInspectionRecord> queryWrapper = Wrappers.<TrialSelfInspectionRecord>lambdaQuery()
                 .eq(TrialSelfInspectionRecord::getNodeId, dto.getNodeId())
+                .eq(TrialSelfInspectionRecord::getType, dto.getType())
+                .eq(TrialSelfInspectionRecord::getContractId, dto.getContractId())
                 .eq(TrialSelfInspectionRecord::getIsDeleted, 0);
         if (dto.getSortType() != null) {
             if (dto.getSortType().equals("1")) {