From 1147614053efae0314a36c15293a6a5ed4e6d737 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 21 二月 2025 11:28:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1
---
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