|
|
@@ -235,14 +235,17 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
}
|
|
|
if (null != overdue) {
|
|
|
// 已超过截止日期
|
|
|
- if (overdue.equals(Constant.YES)) {
|
|
|
+ if (overdue.equals((int)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);
|
|
|
+ } else if (overdue.equals((int)Constant.NO)) {
|
|
|
+ info.expression(PredicateUtils.gte("endDate", new Date(System.currentTimeMillis()), false));
|
|
|
}
|
|
|
}
|
|
|
return inquiryItemDao.findAll(new Specification<PurcInquiryItemInfo>() {
|
|
|
+ @Override
|
|
|
public Predicate toPredicate(Root<PurcInquiryItemInfo> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
|
|
query.where(info.getPredicates(root, query, builder));
|
|
|
return null;
|
|
|
@@ -621,6 +624,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
LogicalExpression logicalExpression = PredicateUtils.and(simpleExpressions);
|
|
|
info.expression(logicalExpression);
|
|
|
return purcInquiryDao.findAll(new Specification<PurcInquiry>() {
|
|
|
+ @Override
|
|
|
public Predicate toPredicate(Root<PurcInquiry> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
|
|
query.where(info.getPredicates(root, query, builder));
|
|
|
return null;
|
|
|
@@ -666,7 +670,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public Page<PurcInquiryItemInfo> findQuotationsByPage(final PageInfo pageInfo, final SearchFilter filter, Long enUU, Long userUU) {
|
|
|
+ public Page<PurcInquiryItemInfo> findQuotationsByPage(final PageInfo pageInfo, final SearchFilter filter, Long enUU, Long userUU, Short overdue) {
|
|
|
if (enUU == null && userUU == null) {
|
|
|
throw new IllegalAccessError("非法访问");
|
|
|
}
|
|
|
@@ -696,8 +700,17 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
if (filter.getEndDate() != null) {
|
|
|
pageInfo.expression(PredicateUtils.lte("date", new Date(filter.getEndDate()), false));
|
|
|
}
|
|
|
+ if (null != overdue) {
|
|
|
+ // 已超过截止日期
|
|
|
+ if (overdue.equals(Constant.YES)) {
|
|
|
+ pageInfo.expression(PredicateUtils.lt("endDate", new Date(System.currentTimeMillis()), false));
|
|
|
+ } else if (overdue.equals(Constant.NO)) {
|
|
|
+ pageInfo.expression(PredicateUtils.gte("endDate", new Date(System.currentTimeMillis()), false));
|
|
|
+ }
|
|
|
+ }
|
|
|
pageInfo.expression(PredicateUtils.gt("offerAmount", Constant.NO, false));
|
|
|
Page<PurcInquiryItemInfo> items = inquiryItemDao.findAll(new Specification<PurcInquiryItemInfo>() {
|
|
|
+ @Override
|
|
|
public Predicate toPredicate(Root<PurcInquiryItemInfo> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
|
|
query.where(pageInfo.getPredicates(root, query, builder));
|
|
|
return null;
|
|
|
@@ -813,7 +826,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 发送消息推送
|
|
|
+ * 发送消息推送 (定时任务使用)
|
|
|
*
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -848,16 +861,18 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
model.setSmsType(SMS_TYPE);
|
|
|
model.setSmTemplate(SMS_TEMP_ID);
|
|
|
models.add(model);
|
|
|
- log.info("此次" + company + "公司新增" + remind.getCounts() + "张公共询价(发送信息前)");
|
|
|
+ log.info("此次" + company + "公司新增" + remind.getCounts() + "张公共询价(发送信息前),接收人UU:" + model.getReceiverUu());
|
|
|
}
|
|
|
if (models.size() >= 500) {
|
|
|
String res = HttpUtil.doPost(PS_MESSAGE_URL + "/messages", FlexJsonUtils.toJsonDeep(models));
|
|
|
+ log.info("消息中心生成消息接口返回日志" + res);
|
|
|
log.info("发送消息" + models.size());
|
|
|
models = new ArrayList<>();
|
|
|
}
|
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(models)) {
|
|
|
String res = HttpUtil.doPost(PS_MESSAGE_URL + "/messages", FlexJsonUtils.toJsonDeep(models));
|
|
|
+ log.info("消息中心生成消息接口返回日志" + res);
|
|
|
log.info("发送消息" + models.size());
|
|
|
}
|
|
|
log.info("发送消息全部完成");
|