|
|
@@ -61,10 +61,11 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
* @param info 分页新
|
|
|
* @param filter 过滤条件
|
|
|
* @param state 过滤状态
|
|
|
+ * @param overdue 是否过期 1、已过期;0、未过期
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public Page<PurcInquiryItemInfo> findTodoByPageInfo(final PageInfo info, SearchFilter filter, String state) {
|
|
|
+ public Page<PurcInquiryItemInfo> findTodoByPageInfo(final PageInfo info, SearchFilter filter, String state, Integer overdue) {
|
|
|
if (null != filter) {
|
|
|
if (StringUtils.hasText(filter.getKeyword())) {
|
|
|
SimpleExpression cmpCode = new SimpleExpression("cmpCode", filter.getKeyword(), CriterionExpression.Operator.LIKE);
|
|
|
@@ -104,6 +105,15 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
info.expression(logicalExpression);
|
|
|
}
|
|
|
}
|
|
|
+ if (null != overdue) {
|
|
|
+ // 已超过截止日期
|
|
|
+ if (overdue.equals(Constant.YES)) {
|
|
|
+ SimpleExpression date = new SimpleExpression("endDate", new Date(System.currentTimeMillis()), CriterionExpression.Operator.LT);
|
|
|
+ SimpleExpression[] simpleExpressions = new SimpleExpression[]{date};
|
|
|
+ LogicalExpression logicalExpression = PredicateUtils.and(simpleExpressions);
|
|
|
+ info.expression(logicalExpression);
|
|
|
+ }
|
|
|
+ }
|
|
|
return inquiryItemDao.findAll(new Specification<PurcInquiryItemInfo>() {
|
|
|
public Predicate toPredicate(Root<PurcInquiryItemInfo> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
|
|
query.where(info.getPredicates(root, query, builder));
|
|
|
@@ -128,16 +138,16 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
List<PurcInquiryItem> items = new ArrayList<PurcInquiryItem>();
|
|
|
for (PurcInquiryItem item : currentInquiry.getInquiryItems()) {
|
|
|
item.setInquiry(inquiry);
|
|
|
+ item.setOfferAmount(0);
|
|
|
if (null == item.getDate()) {
|
|
|
item.setDate(new Date(System.currentTimeMillis()));
|
|
|
}
|
|
|
// 这里设置物料信息的冗余字段
|
|
|
- if (null!= item.getProduct()) {
|
|
|
+ if (null != item.getProduct()) {
|
|
|
item.setProdTitle(item.getProduct().getTitle());
|
|
|
item.setProdCode(item.getProduct().getCode());
|
|
|
item.setSpec(item.getProduct().getSpec());
|
|
|
item.setInbrand(item.getProduct().getBrand());
|
|
|
- item.setOfferAmount(0);
|
|
|
}
|
|
|
items.add(item);
|
|
|
}
|