搜索修改

parent 6140340a
...@@ -29,11 +29,24 @@ public enum ConditionEnum { ...@@ -29,11 +29,24 @@ public enum ConditionEnum {
} }
public static ConditionEnum getByName(String name) { public static ConditionEnum getByName(String name) {
if (name == null || name.trim().isEmpty()) {
return null;
}
String trimmedName = name.trim();
// 处理常见的不等于条件的不同拼写方式
if (trimmedName.equalsIgnoreCase("notequal") || trimmedName.equalsIgnoreCase("notEqual")) {
return NoEqual;
}
// 遍历所有枚举值,使用equalsIgnoreCase比较
for (ConditionEnum status : ConditionEnum.values()) { for (ConditionEnum status : ConditionEnum.values()) {
if (status.getName().equalsIgnoreCase(name)) { if (status.getName().equalsIgnoreCase(trimmedName)) {
return status; return status;
} }
} }
return null; return null;
} }
......
...@@ -1886,7 +1886,7 @@ public class ChromosomeDataService { ...@@ -1886,7 +1886,7 @@ public class ChromosomeDataService {
row.put("count", count != null ? count : 0L); row.put("count", count != null ? count : 0L);
result.add(row); result.add(row);
} }
// 根据count倒序排序 // 根据count倒序排序,如果count相同,则按照分组键的字典序排序
result.sort((o1, o2) -> { result.sort((o1, o2) -> {
if (o1 instanceof Map && o2 instanceof Map) { if (o1 instanceof Map && o2 instanceof Map) {
Map<?, ?> m1 = (Map<?, ?>) o1; Map<?, ?> m1 = (Map<?, ?>) o1;
...@@ -1894,7 +1894,27 @@ public class ChromosomeDataService { ...@@ -1894,7 +1894,27 @@ public class ChromosomeDataService {
Object count1 = m1.get("count"); Object count1 = m1.get("count");
Object count2 = m2.get("count"); Object count2 = m2.get("count");
if (count1 instanceof Number && count2 instanceof Number) { if (count1 instanceof Number && count2 instanceof Number) {
return ((Number) count2).longValue() - ((Number) count1).longValue() > 0 ? 1 : -1; long c1 = ((Number) count1).longValue();
long c2 = ((Number) count2).longValue();
if (c1 != c2) {
return c2 - c1 > 0 ? 1 : -1;
} else {
// count相同,按照分组键的字典序排序
for (String fieldName : fieldNames) {
Object v1 = m1.get(fieldName);
Object v2 = m2.get(fieldName);
if (v1 != null && v2 != null) {
int compareResult = v1.toString().compareTo(v2.toString());
if (compareResult != 0) {
return compareResult;
}
} else if (v1 != null) {
return 1;
} else if (v2 != null) {
return -1;
}
}
}
} }
} }
return 0; return 0;
......
...@@ -333,11 +333,13 @@ public class LanuchServiceImpl implements LanuchService { ...@@ -333,11 +333,13 @@ public class LanuchServiceImpl implements LanuchService {
if (operationStartTime != null) { if (operationStartTime != null) {
omr.setShortageTime(operationStartTime); omr.setShortageTime(operationStartTime);
} }
if (omr.getQuantity() >0) {
orderMaterials.add(omr); orderMaterials.add(omr);
} }
} }
} }
} }
}
// 先删除表中所有数据 // 先删除表中所有数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment