mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 23:57:12 +08:00
bugfix
This commit is contained in:
@@ -25,6 +25,10 @@ import com.google.common.base.CaseFormat;
|
||||
import io.vavr.collection.Stream;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||
import jakarta.persistence.criteria.CriteriaQuery;
|
||||
import jakarta.persistence.criteria.Predicate;
|
||||
import jakarta.persistence.criteria.Root;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -39,6 +43,7 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -202,7 +207,7 @@ where 更新时间>='%s' and 更新时间<='%s'
|
||||
@SneakyThrows
|
||||
public List<Map> reSync(ReSyncRequest requst) {
|
||||
|
||||
if (requst.getFlowNumbers() == null){
|
||||
if (requst.getFlowNumbers() == null) {
|
||||
requst.setFlowNumbers(new ArrayList<>());
|
||||
}
|
||||
|
||||
@@ -223,7 +228,6 @@ where 更新时间>='%s' and 更新时间<='%s'
|
||||
requst.setEnd(LocalDateTime.now());
|
||||
}
|
||||
|
||||
|
||||
List<WeightDeviceEntity> devices =
|
||||
em.createQuery(
|
||||
" from WeightDeviceEntity d where d.organizationId = :organizationId",
|
||||
@@ -267,9 +271,7 @@ where 更新时间>='%s' and 更新时间<='%s'
|
||||
resp,
|
||||
"req",
|
||||
req);
|
||||
log.info(
|
||||
"reSync result: {}",
|
||||
jacksonObjectMapper.writeValueAsString(resultData));
|
||||
log.info("reSync result: {}", jacksonObjectMapper.writeValueAsString(resultData));
|
||||
result.add(resultData);
|
||||
} else {
|
||||
|
||||
@@ -339,7 +341,21 @@ where 更新时间>='%s' and 更新时间<='%s'
|
||||
public Page<WeightDeviceDataDto> list(CommonQuery query) {
|
||||
Page<WeightDeviceDataEntity> page =
|
||||
repository.findAll(
|
||||
query.specification(conversionService),
|
||||
query.specification(conversionService)
|
||||
.and(
|
||||
new Specification() {
|
||||
@Override
|
||||
public Predicate toPredicate(
|
||||
Root root,
|
||||
CriteriaQuery query,
|
||||
CriteriaBuilder criteriaBuilder) {
|
||||
|
||||
return criteriaBuilder.or(
|
||||
criteriaBuilder.isNull(root.get("invalid")),
|
||||
criteriaBuilder.isFalse(
|
||||
root.get("invalid")));
|
||||
}
|
||||
}),
|
||||
PageRequest.of(
|
||||
query.getPageNo(),
|
||||
query.getPageSize(),
|
||||
|
||||
Reference in New Issue
Block a user