|
|
@@ -57,6 +57,7 @@ import com.uas.sso.util.FlexJsonUtil;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -923,10 +924,10 @@ public class InvoiceServiceImpl implements InvoiceService {
|
|
|
Invoice inFpu = new Invoice(purchase);
|
|
|
|
|
|
//保存适用配送规则和自提点信息
|
|
|
- if (purchase.getJsonRule() != null){
|
|
|
+ if (purchase.getJsonRule() != null) {
|
|
|
inFpu.setJsonRule(purchase.getJsonRule());
|
|
|
}
|
|
|
- if (purchase.getJsonTakeSelf() != null){
|
|
|
+ if (purchase.getJsonTakeSelf() != null) {
|
|
|
inFpu.setJsonTakeSelf(purchase.getJsonTakeSelf());
|
|
|
}
|
|
|
// 生成出货单号
|
|
|
@@ -1225,7 +1226,7 @@ public class InvoiceServiceImpl implements InvoiceService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<Invoice> getEnterpriseInboundInvoice(PageParams pageParams, String keyword) {
|
|
|
+ public Page<Invoice> getEnterpriseInboundInvoice(PageParams pageParams, String keyword, Long fromDate, Long toDate) {
|
|
|
final PageInfo info = new PageInfo(pageParams);
|
|
|
User user = SystemSession.getUser();
|
|
|
Enterprise enterprise = user.getEnterprise();
|
|
|
@@ -1235,6 +1236,9 @@ public class InvoiceServiceImpl implements InvoiceService {
|
|
|
} else {
|
|
|
info.filter("buyerenuu", user.getEnterprise().getUu());
|
|
|
}
|
|
|
+ if (StringUtilB2C.isEmpty(info.getSort())) {
|
|
|
+ info.sorting("createtime", Sort.Direction.DESC);
|
|
|
+ }
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotEmpty(keyword)) {
|
|
|
CriterionExpression[] expressions = new CriterionExpression[2];
|
|
|
expressions[0] = PredicateUtils.like("invoiceid", keyword, true);
|
|
|
@@ -1243,6 +1247,13 @@ public class InvoiceServiceImpl implements InvoiceService {
|
|
|
LogicalExpression logicalExpression = PredicateUtils.or(expressions);
|
|
|
info.expression(logicalExpression);
|
|
|
}
|
|
|
+ if (fromDate != null && toDate != null) {
|
|
|
+ CriterionExpression[] expressions = new CriterionExpression[2];
|
|
|
+ expressions[0] = PredicateUtils.gte("createtime", new Date(fromDate), false);
|
|
|
+ expressions[1] = PredicateUtils.lte("createtime", new Date(toDate), false);
|
|
|
+ LogicalExpression logicalExpression = PredicateUtils.and(expressions);
|
|
|
+ info.expression(logicalExpression);
|
|
|
+ }
|
|
|
info.filter("status", com.uas.platform.b2c.core.constant.Status.INBOUND.value());
|
|
|
return invoiceDao.findAll(new Specification<Invoice>() {
|
|
|
@Override
|