Forráskód Böngészése

(主账号)转变成企业用户后之前的订单统计的角标还是会统计。
(子账号)绑定企业用户后,之前自己订单会带入企业订单当中,包括待评价的订单

liangpeile 1 éve
szülő
commit
7c98ecbd44

+ 3 - 0
crmeb-common/src/main/java/com/zbkj/common/model/order/Order.java

@@ -150,4 +150,7 @@ public class Order implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 
+    @ApiModelProperty(value = "是否是企业用户订单 1是普通用户订单,2是企业用户订单")
+    private Integer isEnterpriseUser;
+
 }

+ 7 - 0
crmeb-front/src/main/java/com/zbkj/front/service/impl/FrontOrderServiceImpl.java

@@ -375,6 +375,13 @@ public class FrontOrderServiceImpl implements FrontOrderService {
         order.setIsRemit(2);
         order.setCancelStatus(OrderConstants.ORDER_CANCEL_STATUS_NORMAL);
         order.setLevel(OrderConstants.ORDER_LEVEL_PLATFORM);
+        if (2==user.getIsEnterpriseUser()){
+            order.setIsEnterpriseUser(2);
+        }else if(3==user.getIsEnterpriseUser()){
+            order.setIsEnterpriseUser(2);
+        }else{
+            order.setIsEnterpriseUser(1);
+        }
         order.setType(orderInfoVo.getType());// 默认普通订单
 
         // 商户订单

+ 14 - 2
crmeb-service/src/main/java/com/zbkj/service/service/impl/OrderServiceImpl.java

@@ -192,6 +192,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
         lqw.eq(Order::getIsMerchantDel, false);
         lqw.in(Order::getType, OrderConstants.ORDER_TYPE_NORMAL, OrderConstants.ORDER_TYPE_SECKILL);
         lqw.eq(Order::getIsDel, false);
+        lqw.eq(Order::getIsEnterpriseUser, 1);
         lqw.orderByDesc(Order::getId);
         List<Order> orderList = dao.selectList(lqw);
         return CommonPage.copyPageInfo(page, orderList);
@@ -205,6 +206,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
         lqw.and(i -> i.ne(Order::getIsIntegral, 1).or().isNull(Order::getIsIntegral));
         lqw.and(i -> i.eq(Order::getQyId, id).or().isNull(Order::getQyId));
         lqw.in(Order::getUid, ids);
+
         if (0 != isRemit) {
             lqw.eq(Order::getIsRemit, isRemit);
             lqw.eq(Order::getPayType, "信用额度");
@@ -223,16 +225,19 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
         lqw.lt(Order::getRefundStatus, OrderConstants.ORDER_REFUND_STATUS_REFUND);
         lqw.eq(Order::getIsUserDel, false);
         lqw.eq(Order::getIsMerchantDel, false);
+
         lqw.in(Order::getType, OrderConstants.ORDER_TYPE_NORMAL, OrderConstants.ORDER_TYPE_SECKILL);
         lqw.eq(Order::getIsDel, false);
+
         HashMap<String, String> info = systemConfigService.info(19);
         String orderExpireTime = info.get("orderExpireTime");
-        String orderExpireTime1="-"+orderExpireTime;
+        String orderExpireTime1 = "-" + orderExpireTime;
         Calendar c = Calendar.getInstance();
         c.add(Calendar.DAY_OF_MONTH, Integer.parseInt(orderExpireTime1));
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String mDateTime = formatter.format(c.getTime());
-        lqw.apply(StringUtils.isNotBlank(mDateTime),"DATE(create_time) >= STR_TO_DATE('"+mDateTime+"','%Y-%m-%d')");
+        lqw.apply(StringUtils.isNotBlank(mDateTime), "DATE(create_time) >= STR_TO_DATE('" + mDateTime + "','%Y-%m-%d')");
+        lqw.eq(Order::getIsEnterpriseUser, 2);
         lqw.orderByDesc(Order::getId);
         List<Order> orderList = dao.selectList(lqw);
         return CommonPage.copyPageInfo(page, orderList);
@@ -936,11 +941,18 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
      */
     @Override
     public Integer getCountByStatusAndUid(Integer status, Integer userId) {
+        User user = userService.getInfo();
+
         if (status < 0) {
             return 0;
         }
         LambdaQueryWrapper<Order> lqw = Wrappers.lambdaQuery();
         lqw.eq(Order::getUid, userId);
+        if (2 == user.getIsEnterpriseUser() || 3 == user.getIsEnterpriseUser()) {
+            lqw.eq(Order::getIsEnterpriseUser, 2);
+        } else {
+            lqw.eq(Order::getIsEnterpriseUser, 1);
+        }
         lqw.eq(Order::getIsDel, false);
         lqw.and(i -> i.ne(Order::getIsIntegral, 1).or().isNull(Order::getIsIntegral));
         if (OrderConstants.ORDER_STATUS_WAIT_SHIPPING.equals(status)) {