From 18cf2f252338e52fb531cd2ca1cc49e39bf6efe0 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 19 二月 2025 18:50:50 +0800
Subject: [PATCH] 111

---
 server/services/src/main/java/com/doumee/service/business/impl/DiscountServiceImpl.java |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/server/services/src/main/java/com/doumee/service/business/impl/DiscountServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/DiscountServiceImpl.java
index 7c88851..6e6895b 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/DiscountServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/DiscountServiceImpl.java
@@ -73,7 +73,7 @@
                 || StringUtils.isBlank(discount.getName())
                 || Objects.isNull(discount.getType())
                 || Objects.isNull(discount.getLimitType())
-                || (Constants.equalsInteger(discount.getLimitTime(),Constants.ONE) && Objects.isNull(discount.getLimitTime()))
+                || (Constants.equalsInteger(discount.getLimitTime(),Constants.ONE) && (Objects.isNull(discount.getLimitTime()) || discount.getLimitTime() > 1440))
                 || Objects.isNull(discount.getPrice()) || discount.getPrice().compareTo(BigDecimal.ZERO) <= Constants.ZERO
                 || Objects.isNull(discount.getChannel())
                 || Objects.isNull(discount.getStartDate())
@@ -85,17 +85,14 @@
                 || (Objects.isNull(discount.getUseHoliday()) || Objects.isNull(discount.getUseWorkday()) )
                 || (Objects.isNull(discount.getIsbike()) || Objects.isNull(discount.getIselecbike()) )
         ){
-            throw new BusinessException(ResponseStatus.SERVER_ERROR);
+            throw new BusinessException(ResponseStatus.BAD_REQUEST);
         }
         if(discount.getStartDate().getTime()>discount.getEndDate().getTime()){
             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"閿�鍞椂娈典俊鎭敊璇�");
         }
         //鍥哄畾鏃ユ湡鐢熸晥
         if(Constants.equalsInteger(discount.getUseType(),Constants.ZERO) &&
-                ( discount.getUseStartDate().getTime()>discount.getUseEndDate().getTime() ||
-                        discount.getUseStartDate().getTime() < discount.getStartDate().getTime() ||
-                        discount.getUseEndDate().getTime() > discount.getEndDate().getTime()
-                ) ){
+                ( discount.getUseStartDate().getTime()>discount.getUseEndDate().getTime()) ){
             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"浣跨敤鏃舵淇℃伅閿欒");
         }
 
@@ -165,6 +162,7 @@
     @Override
     public Discount findById(String id) {
         Discount discount = discountJoinMapper.selectOne(new MPJLambdaWrapper<Discount>()
+                        .selectAll(Discount.class)
                 .select(" (select count(1) from goodsorder g where g.obj_type = 0 and g.obj_id = t.id and g.pay_status = 1 ) ",Discount::getSaleNum)
                 .leftJoin(SystemUser.class,SystemUser::getId,Discount::getCreator)
                 .eq(Discount::getId,id)

--
Gitblit v1.9.3