liangpeile 1 éve
szülő
commit
485d0c2062

+ 7 - 2
crmeb-service/src/main/java/com/zbkj/service/service/impl/OrderDetailServiceImpl.java

@@ -63,17 +63,19 @@ public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailDao, OrderDet
      */
     @Override
     public PageInfo<OrderDetail> getReplyList(Integer userId, Boolean isReply, PageParamRequest pageRequest) {
-        User user = userService.getInfo();
+        User user = userService.getById(58);
         Integer isEnterpriseUser = user.getIsEnterpriseUser();
         Integer enterpriseId=0;
         if (3==isEnterpriseUser){
             LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(UserBypassAccount::getUserId,user.getId());
+            queryWrapper.eq(UserBypassAccount::getIsDelete,0);
+
             UserBypassAccount one = userBypassAccountService.getOne(queryWrapper);
             enterpriseId = one.getEnterpriseId();
         }
         Page<OrderDetail> page = PageHelper.startPage(pageRequest.getPage(), pageRequest.getLimit());
-        List<OrderDetail> orderDetailList = dao.findReplyList(userId, isReply ? 1 : 0,isEnterpriseUser,enterpriseId);
+        List<OrderDetail> orderDetailList = dao.findReplyList(58, isReply ? 1 : 0,isEnterpriseUser,enterpriseId);
         return CommonPage.copyPageInfo(page, orderDetailList);
     }
 
@@ -103,6 +105,8 @@ public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailDao, OrderDet
         if (3==isEnterpriseUser){
             LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(UserBypassAccount::getUserId,user.getId());
+            queryWrapper.eq(UserBypassAccount::getIsDelete,0);
+
             UserBypassAccount one = userBypassAccountService.getOne(queryWrapper);
             enterpriseId = one.getEnterpriseId();
         }
@@ -160,6 +164,7 @@ public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailDao, OrderDet
         if (3==isEnterpriseUser){
             LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(UserBypassAccount::getUserId,user.getId());
+            queryWrapper.eq(UserBypassAccount::getIsDelete,0);
             UserBypassAccount one = userBypassAccountService.getOne(queryWrapper);
             enterpriseId = one.getEnterpriseId();
         }

+ 31 - 11
crmeb-service/src/main/java/com/zbkj/service/service/impl/OrderServiceImpl.java

@@ -107,6 +107,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
     private MerchantSmsTimingService merchantSmsTimingService;
     @Autowired
     private MerchantSmsTemplateService merchantSmsTemplateService;
+    @Autowired
+    private UserBypassAccountService userBypassAccountService;
 
     /**
      * 根据订单编号获取订单
@@ -166,7 +168,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
         Page<Order> page = PageHelper.startPage(pageRequest.getPage(), pageRequest.getLimit());
         LambdaQueryWrapper<Order> lqw = Wrappers.lambdaQuery();
         User userInfo = userService.getInfo();
-
         if (null != userInfo.getIsAllOrders() && 1 == userInfo.getIsAllOrders()) {
             List<Integer> parents = userService.getParentId(userId);
             if (null != parents && parents.size() > 0) {
@@ -193,12 +194,20 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
         lqw.in(Order::getType, OrderConstants.ORDER_TYPE_NORMAL, OrderConstants.ORDER_TYPE_SECKILL);
         lqw.eq(Order::getIsDel, false);
         Integer isEnterpriseUser = userInfo.getIsEnterpriseUser();
-        if (null != isEnterpriseUser){
+        if (null != isEnterpriseUser) {
             lqw.eq(Order::getIsEnterpriseUser, isEnterpriseUser);
-        }else{
+        } else {
             lqw.eq(Order::getIsEnterpriseUser, 999);
         }
-
+        Integer enterpriseId = 0;
+        if (3 == isEnterpriseUser) {
+            LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(UserBypassAccount::getUserId, userInfo.getId());
+            queryWrapper.eq(UserBypassAccount::getIsDelete, 0);
+            UserBypassAccount one = userBypassAccountService.getOne(queryWrapper);
+            enterpriseId = one.getEnterpriseId();
+            lqw.eq(Order::getEnterpriseId, enterpriseId);
+        }
         lqw.orderByDesc(Order::getId);
         List<Order> orderList = dao.selectList(lqw);
         return CommonPage.copyPageInfo(page, orderList);
@@ -240,7 +249,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
         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.in(Order::getIsEnterpriseUser, 2,3);
+        lqw.in(Order::getIsEnterpriseUser, 2, 3);
         lqw.orderByDesc(Order::getId);
         List<Order> orderList = dao.selectList(lqw);
         return CommonPage.copyPageInfo(page, orderList);
@@ -944,21 +953,32 @@ public class OrderServiceImpl extends ServiceImpl<OrderDao, Order> implements Or
      */
     @Override
     public Integer getCountByStatusAndUid(Integer status, Integer userId) {
-        User user = userService.getInfo();
+        User user = userService.getById(58);
+        userId=58;
 
         if (status < 0) {
             return 0;
         }
         LambdaQueryWrapper<Order> lqw = Wrappers.lambdaQuery();
         lqw.eq(Order::getUid, userId);
-        if (2 == user.getIsEnterpriseUser() ) {
-            lqw.in(Order::getIsEnterpriseUser, 2,3);
-        } else if (3 == user.getIsEnterpriseUser()){
+        if (2 == user.getIsEnterpriseUser()) {
+            lqw.in(Order::getIsEnterpriseUser, 2, 3);
+        } else if (3 == user.getIsEnterpriseUser()) {
             lqw.eq(Order::getIsEnterpriseUser, 3);
-        }
-        else {
+        } else {
             lqw.eq(Order::getIsEnterpriseUser, 1);
         }
+        Integer integer = dao.selectCount(lqw);
+
+        Integer enterpriseId = 0;
+        if (3 == user.getIsEnterpriseUser()) {
+            LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(UserBypassAccount::getUserId, user.getId());
+            UserBypassAccount one = userBypassAccountService.getOne(queryWrapper);
+            enterpriseId = one.getEnterpriseId();
+            lqw.eq(Order::getEnterpriseId, enterpriseId);
+        }
+        Integer integer1 = dao.selectCount(lqw);
         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)) {

+ 10 - 3
crmeb-service/src/main/resources/mapper/order/OrderDetailMapper.xml

@@ -10,7 +10,9 @@
         and od.is_reply = #{isReply}
         and od.uid = #{userId}
         and o.is_enterprise_user = #{isEnterpriseUser}
-        and o.enterprise_id = #{enterpriseId}
+        <if test="enterpriseId != null and enterpriseId !=''">
+            and o.enterprise_id = #{enterpriseId}
+        </if>
         order by od.id desc
     </select>
 
@@ -23,7 +25,9 @@
         and o.is_user_del = 0 and o.level = 1
         and o.refund_status &lt; 3
         and o.is_enterprise_user=#{isEnterpriseUser}
-        and o.enterprise_id=#{isEnterpriseUser}
+        <if test="enterpriseId != null and enterpriseId !=''">
+            and o.enterprise_id = #{enterpriseId}
+        </if>
         and (od.apply_refund_num + od.refund_num) &lt; od.pay_num
         <if test="orderNo != '' and orderNo != null ">
             and od.order_no = #{orderNo}
@@ -52,7 +56,10 @@
         and od.uid = #{userId}
         and o.is_enterprise_user = #{isEnterpriseUser}
         and (o.is_integral != 1 or o.is_integral is null)
-        and o.enterprise_id = #{enterpriseId}
+        <if test="enterpriseId != null and enterpriseId !=''">
+            and o.enterprise_id = #{enterpriseId}
+        </if>
+
         and o.is_del=0
     </select>
 </mapper>