guomengjiao 7 meses atrás
pai
commit
7fc9b8e275

+ 23 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shop/rights/SaleRightsOrderController.java

@@ -51,6 +51,17 @@ public class SaleRightsOrderController extends BaseController {
     private final ISaleRightsOrderService iSaleRightsOrderService;
     private final IRightsMqService rightsMqService;
 
+    /**
+     * 平台分页查询维权单列表
+     */
+    @FilePathSplicing(type = FilePathSplicingType.RESPONSE)
+    @ApiOperation("平台分页查询维权单列表")
+    @SaCheckPermission("rights:saleRightsOrder:list")
+    @GetMapping("/platform-page")
+    public TableDataInfo<SaleRightsOrderVo> platformPage(@Validated(QueryGroup.class) SaleRightsOrderBo bo, PageQuery pageQuery) {
+        return iSaleRightsOrderService.queryPageList(bo, pageQuery);
+    }
+
     /**
      * 分页查询维权单列表
      */
@@ -84,6 +95,18 @@ public class SaleRightsOrderController extends BaseController {
         return R.ok(saleRightsOrderVo);
     }
 
+    /**
+     * 平台导出维权单列表
+     */
+    @ApiOperation("平台导出维权单列表")
+    @SaCheckPermission("rights:saleRightsOrder:export")
+    @Log(title = "维权单", businessType = BusinessType.EXPORT)
+    @PostMapping("/platform-export")
+    public void platformExport(@Validated SaleRightsOrderBo bo, HttpServletResponse response) {
+        List<SaleRightsOrderExportVo> list = iSaleRightsOrderService.queryListForExport(bo);
+        ExcelUtil.exportExcel(list, "维权单", SaleRightsOrderExportVo.class, response);
+    }
+
     /**
      * 导出维权单列表
      */

+ 11 - 9
ruoyi-admin/src/main/java/com/ruoyi/web/controller/subsidy/SubsidyQueueController.java

@@ -285,17 +285,19 @@ public class SubsidyQueueController extends BaseController {
                 failureMsg.append("<br/>").append(failureNum).append("、订单编号:").append(bo.getOrderNo()).append(" 导入失败:").append("已完成");
             }
         }
-
-        List<SubsidyQueueImportBo> errorList = iSubsidyQueueService.importData(businessId,validList);
-        if(CollectionUtil.isNotEmpty(errorList))
-        {
-            for (SubsidyQueueImportBo bo : errorList) {
-                failureNum++;
-                failureMsg.append("<br/>").append(failureNum).append("、订单编号:").append(bo.getOrderNo()).append(" 导入失败:").append("订单已存在");
+        if (CollectionUtil.isNotEmpty(validList)) {
+            List<SubsidyQueueImportBo> errorList = iSubsidyQueueService.importData(businessId, validList);
+            if (CollectionUtil.isNotEmpty(errorList)) {
+                for (SubsidyQueueImportBo bo : errorList) {
+                    failureNum++;
+                    failureMsg.append("<br/>").append(failureNum).append("、订单编号:").append(bo.getOrderNo()).append(" 导入失败:").append("订单已存在");
+                }
             }
+            failureNum = errorList.size() + failureNum;
+        } else {
+            failureNum = list.size();
+            failureMsg.append("<br/>").append("导入数据为空");
         }
-
-        failureNum = errorList.size() + failureNum;
         successNum = list.size() - failureNum;
         if (failureNum > 0) {
             failureMsg.insert(0, "数据导入成功共 " + successNum + " 条! 导入失败共 " + failureNum + " 条!数据格式不正确,错误如下:");

+ 3 - 0
ruoyi-api/src/main/java/com/ruoyi/api/controller/shop/ApiProductController.java

@@ -118,6 +118,9 @@ public class ApiProductController extends AbstractApiController {
         if (ObjectUtil.isNull(productVo)) {
             throw new ServiceException(ProductExceptionEnum.Product_IS_NOT_EXISTS);
         }
+        if (!productVo.getShelvedStatus()) {
+            throw new ServiceException(ProductExceptionEnum.Product_IS_NOT_SHELVED);
+        }
         productVo.loadSupplier();
         productVo.loadContent();
         productVo.loadProductSkuSetList();

+ 1 - 1
ruoyi-api/src/main/java/com/ruoyi/api/controller/user/ApiUserShoppingCartController.java

@@ -65,7 +65,7 @@ public class ApiUserShoppingCartController extends AbstractApiController {
         UserShoppingCartBo bo = new UserShoppingCartBo();
         bo.setBusinessId(businessId);
         bo.setUserId(getUserId(true));
-        return R.ok(iUserShoppingCartService.queryList(bo));
+        return R.ok(iUserShoppingCartService.businessList(bo));
     }
 
 

+ 3 - 6
ruoyi-shop/src/main/java/com/ruoyi/shop/coupon/service/impl/CouponServiceImpl.java

@@ -119,14 +119,11 @@ public class CouponServiceImpl implements ICouponService {
         lqw.eq(bo.getTrait() != null, Coupon::getTrait, bo.getTrait());
         lqw.eq(bo.getStatus() != null, Coupon::getStatus, bo.getStatus());
 
-        if(bo.getCanReceiveStartTime() != null &&  bo.getCanReceiveEndTime() != null)
+        if(bo.getCanReceiveStartTime() != null && bo.getCanReceiveEndTime() != null)
         {
-            bo.setCanReceiveStartTime(DateUtil.beginOfDay(bo.getCanReceiveStartTime()));
-            bo.setCanReceiveEndTime(DateUtil.endOfDay(bo.getCanReceiveEndTime()));
             lqw.and(lqw1 ->
-                lqw1.ge(Coupon::getStartTime, bo.getCanReceiveStartTime()).le(Coupon::getEndTime, bo.getCanReceiveEndTime())
-                .or(lqw2 -> lqw2.le(Coupon::getStartTime, bo.getCanReceiveStartTime()).ge(Coupon::getEndTime, bo.getCanReceiveStartTime()))
-                .or(lqw3 -> lqw3.le(Coupon::getStartTime, bo.getCanReceiveEndTime()).ge(Coupon::getEndTime, bo.getCanReceiveEndTime()))
+                lqw1.le(Coupon::getStartTime, bo.getCanReceiveEndTime())  // 优惠券开始时间 <= 搜索结束时间
+                    .ge(Coupon::getEndTime, bo.getCanReceiveStartTime())   // 优惠券结束时间 >= 搜索开始时间
             );
         }
         lqw.orderByAsc(Coupon::getStatus).orderByDesc(Coupon::getStartTime);

+ 2 - 1
ruoyi-shop/src/main/java/com/ruoyi/shop/product/exception/ProductExceptionEnum.java

@@ -14,7 +14,8 @@ public enum ProductExceptionEnum implements IIntegerEnum {
 
     PRODUCT_NOT_AUDIT_PASS(200002, "商品还未通过审核"),
     PRODUCT_SINGLE_SKU_ERROR(200003, "单规格无需选择商品SKU"),
-    PRODUCT_MULTI_SKU_ERROR(200004, "多规格请选择商品SKU");
+    PRODUCT_MULTI_SKU_ERROR(200004, "多规格请选择商品SKU"),
+    Product_IS_NOT_SHELVED(200005, "商品未上架");
 
     private Integer code;
 

+ 2 - 0
ruoyi-shop/src/main/java/com/ruoyi/shop/usershoppingcart/service/IUserShoppingCartService.java

@@ -94,4 +94,6 @@ public interface IUserShoppingCartService {
      * @param userShoppingCardId
      */
     void deleteWithValidById(Long userShoppingCardId);
+
+    List<UserShoppingCartVo> businessList(UserShoppingCartBo bo);
 }

+ 11 - 4
ruoyi-shop/src/main/java/com/ruoyi/shop/usershoppingcart/service/impl/UserShoppingCartServiceImpl.java

@@ -29,10 +29,7 @@ import com.ruoyi.shop.usershoppingcart.service.IUserShoppingCartService;
 import com.ruoyi.shop.usershoppingcart.exception.UserShoppingCartExceptionEnum;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Collection;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -87,6 +84,7 @@ public class UserShoppingCartServiceImpl implements IUserShoppingCartService {
         lqw.eq(bo.getNum() != null, UserShoppingCart::getNum, bo.getNum());
         lqw.like(StringUtils.isNotBlank(bo.getSkuSetName()), UserShoppingCart::getSkuSetName, bo.getSkuSetName());
         lqw.eq(StringUtils.isNotBlank(bo.getSkuHashCode()), UserShoppingCart::getSkuHashCode, bo.getSkuHashCode());
+        lqw.eq(bo.getEffectiveStatus() != null, UserShoppingCart::getEffectiveStatus, bo.getEffectiveStatus());
         return lqw;
     }
 
@@ -303,4 +301,13 @@ public class UserShoppingCartServiceImpl implements IUserShoppingCartService {
         this.baseMapper.deleteById(userShoppingCardId);
     }
 
+    @Override
+    public List<UserShoppingCartVo> businessList(UserShoppingCartBo bo) {
+        List<UserShoppingCartVo> userShoppingCartVos = this.baseMapper.selectCustomVoList(bo);
+        //筛选有效
+        return userShoppingCartVos.stream().filter(
+            e -> CartEffectiveStatus.NORMAL.equals(e.getEffectiveStatus())
+                && e.getStock() > 0 && e.getSkuValid()).collect(Collectors.toList());
+    }
+
 }

+ 3 - 0
ruoyi-shop/src/main/resources/mapper/usershoppingcart/UserShoppingCartMapper.xml

@@ -38,6 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                               tpsss.product_id = tusc.product_id and
                               tpsss.sku_hash_code = tusc.sku_hash_code
         where tusc.user_id = #{bo.userId}
+        <if test="bo.businessId != null">
+            and tusc.business_id = #{bo.businessId}
+        </if>
         order by tusc.create_time desc
     </select>
 </mapper>