|
|
@@ -17,14 +17,11 @@ import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.Status;
|
|
|
import com.uas.platform.core.persistence.criteria.PredicateUtils;
|
|
|
-import com.uas.search.b2b.model.PageParams;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.ui.ModelMap;
|
|
|
-import org.springframework.util.StringUtils;
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
@@ -110,29 +107,17 @@ public class MakeAcceptServiceImpl implements MakeAcceptService {
|
|
|
@Override
|
|
|
public Page<MakeAccept> findAllByPageInfo(final PageInfo pageInfo, final String keyword, final Long fromDate,
|
|
|
final Long endDate) {
|
|
|
-
|
|
|
- if (StringUtils.hasText(keyword)) {
|
|
|
- List<Object> lists = new ArrayList<>();
|
|
|
- PageParams pageParams = new PageParams();
|
|
|
- ModelMap map = new ModelMap();
|
|
|
- map.put("ma_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- pageParams.setFilters(map);
|
|
|
- for (MakeAccept list : searchService.searchMakeAcceptIds(keyword, pageParams).getContent()) {
|
|
|
- lists.add(list.getId());
|
|
|
- }
|
|
|
- pageInfo.expression(PredicateUtils.in("id", lists, false));
|
|
|
- }
|
|
|
- if (fromDate != null)
|
|
|
+ if (fromDate != null) {
|
|
|
pageInfo.expression(PredicateUtils.gte("date", new Date(fromDate), false));
|
|
|
- if (endDate != null)
|
|
|
+ }
|
|
|
+ if (endDate != null) {
|
|
|
pageInfo.expression(PredicateUtils.lte("date", new Date(endDate), false));
|
|
|
-
|
|
|
- Page<MakeAccept> pageOrders = makeAcceptDao.findAll(new Specification<MakeAccept>() {
|
|
|
+ }
|
|
|
+ return makeAcceptDao.findAll(new Specification<MakeAccept>() {
|
|
|
public Predicate toPredicate(Root<MakeAccept> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
|
|
return query.where(pageInfo.getPredicates(root, query, builder)).getRestriction();
|
|
|
}
|
|
|
}, pageInfo);
|
|
|
- return pageOrders;
|
|
|
}
|
|
|
|
|
|
@Override
|