Browse Source

# 风险点列表导出接口

zhongwei
haungxing 10 months ago
parent
commit
2b3a75a842
  1. 4
      hzims-biz-common/src/main/java/com/hnac/hzims/common/support/utils/Condition.java
  2. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IDangerSourceService.java

4
hzims-biz-common/src/main/java/com/hnac/hzims/common/support/utils/Condition.java

@ -32,7 +32,8 @@ public class Condition extends org.springblade.core.mp.support.Condition {
QueryWrapper<T> queryWrapper = getQueryWrapper(query,clazz); QueryWrapper<T> queryWrapper = getQueryWrapper(query,clazz);
List<Field> fields = getFieldList(query); List<Field> fields = getFieldList(query);
// 填充排序字段 // 填充排序字段
orderFields.forEach((fieldName,order) -> { orderFields.forEach((fieldNames,order) -> {
Func.toStrList(",",fieldNames).stream().forEach(fieldName -> {
Optional<Field> existField = fields.stream().filter(field -> camel2under(fieldName).equals(camel2under(field.getName()))).findAny(); Optional<Field> existField = fields.stream().filter(field -> camel2under(fieldName).equals(camel2under(field.getName()))).findAny();
if(existField.isPresent()) { if(existField.isPresent()) {
if(Order.ASC.equals(order)) { if(Order.ASC.equals(order)) {
@ -43,6 +44,7 @@ public class Condition extends org.springblade.core.mp.support.Condition {
} }
} }
}); });
});
return queryWrapper.lambda(); return queryWrapper.lambda();
} }

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/service/IDangerSourceService.java

@ -60,7 +60,7 @@ public interface IDangerSourceService extends BaseService<DangerSourceEntity> {
default LambdaQueryWrapper<DangerSourceEntity> getQueryWrapper(Object req) { default LambdaQueryWrapper<DangerSourceEntity> getQueryWrapper(Object req) {
Map<String, Order> param = new HashMap<>(); Map<String, Order> param = new HashMap<>();
param.put("create_time",Order.DESC); param.put("create_time,update_time",Order.DESC);
return Condition.getQueryWrapper(req,DangerSourceEntity.class,param); return Condition.getQueryWrapper(req,DangerSourceEntity.class,param);
} }
} }

Loading…
Cancel
Save