|
|
@@ -4,6 +4,7 @@ import com.alibaba.dubbo.common.json.JSON;
|
|
|
import com.alibaba.dubbo.common.json.ParseException;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
|
import com.uas.api.b2c_erp.buyer.model.B2cOrder;
|
|
|
import com.uas.api.exception.B2CException;
|
|
|
import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
|
|
|
@@ -1445,6 +1446,11 @@ public class OrderServiceImpl implements OrderService {
|
|
|
return orderDao.findByStatus(status);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Order> findByAfterStatus(Integer status) {
|
|
|
+ return orderDao.findByAfterStatus(status);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Order> findOnes() {
|
|
|
Long uu = SystemSession.getUser().getUserUU();
|
|
|
@@ -1765,7 +1771,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ModelMap findOrdersByInternal(final PageInfo pageInfo, String keyword, String status, Integer available, boolean isProof, Date startDate, Date endDate, String exType) {
|
|
|
+ public ModelMap findOrdersByInternal(final PageInfo pageInfo, String keyword, String status, Integer available, boolean isProof, Date startDate, Date endDate, String exType, Boolean isRate) {
|
|
|
ModelMap modelMap = new ModelMap();
|
|
|
final Long userUU = SystemSession.getUser().getUserUU();
|
|
|
final Long enUU = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
|
|
|
@@ -1852,6 +1858,9 @@ public class OrderServiceImpl implements OrderService {
|
|
|
pageInfo.filter("status", Short.parseShort(status));
|
|
|
}
|
|
|
}
|
|
|
+ if (null != isRate && isRate == true) {
|
|
|
+ pageInfo.expression(PredicateUtils.isNull("rateStatus"));
|
|
|
+ }
|
|
|
Page<Order> pageOrders = orderDao.findAll(new Specification<Order>() {
|
|
|
@Override
|
|
|
public Predicate toPredicate(Root<Order> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
|
|
@@ -2437,29 +2446,56 @@ public class OrderServiceImpl implements OrderService {
|
|
|
totalCount = 0;
|
|
|
// 各种异常类型的订单总数
|
|
|
int normal = 0, notify = 0, apply = 0, returnCount = 0, exchange = 0, refund = 0;
|
|
|
- for (String statusStr : statusArr) {
|
|
|
- if (enUU != null) {
|
|
|
- int count = orderDao.getCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
- totalCount += count;
|
|
|
-
|
|
|
- normal += orderDao.getNormalCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
- notify += orderDao.getNotifyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
- apply += orderDao.getApplyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
- returnCount += orderDao.getReturnCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
- exchange += orderDao.getExchangeCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
- refund += orderDao.getRefundCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
- } else {
|
|
|
- int count = orderDao.getCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
- totalCount += count;
|
|
|
-
|
|
|
- normal += orderDao.getNormalCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
- notify += orderDao.getNotifyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
- apply += orderDao.getApplyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
- returnCount += orderDao.getReturnCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
- exchange += orderDao.getExchangeCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
- refund += orderDao.getRefundCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ if (orderStatus.equals(OrderStatus.TOBECOMMENT)){ //如果是评论的话,特殊处理
|
|
|
+ for (String statusStr : statusArr) {
|
|
|
+ if (enUU != null) {
|
|
|
+ int count = orderDao.getCountByBuyeruuAndStatusAndRate(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ totalCount += count;
|
|
|
+
|
|
|
+ normal += orderDao.getNormalCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ notify += orderDao.getNotifyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ apply += orderDao.getApplyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ returnCount += orderDao.getReturnCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ exchange += orderDao.getExchangeCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ refund += orderDao.getRefundCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ } else {
|
|
|
+ int count = orderDao.getCountByBuyeruuAndStatusAndDissociativeAndRate(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ totalCount += count;
|
|
|
+
|
|
|
+ normal += orderDao.getNormalCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ notify += orderDao.getNotifyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ apply += orderDao.getApplyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ returnCount += orderDao.getReturnCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ exchange += orderDao.getExchangeCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ refund += orderDao.getRefundCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ for (String statusStr : statusArr) {
|
|
|
+ if (enUU != null) {
|
|
|
+ int count = orderDao.getCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ totalCount += count;
|
|
|
+
|
|
|
+ normal += orderDao.getNormalCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ notify += orderDao.getNotifyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ apply += orderDao.getApplyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ returnCount += orderDao.getReturnCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ exchange += orderDao.getExchangeCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ refund += orderDao.getRefundCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
|
|
|
+ } else {
|
|
|
+ int count = orderDao.getCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ totalCount += count;
|
|
|
+
|
|
|
+ normal += orderDao.getNormalCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ notify += orderDao.getNotifyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ apply += orderDao.getApplyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ returnCount += orderDao.getReturnCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ exchange += orderDao.getExchangeCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ refund += orderDao.getRefundCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
map.put(orderStatus.status(), totalCount);
|
|
|
|
|
|
if (!"unavailable".equals(orderStatus.status()) && !"success".equals(orderStatus.status())) {
|