111
k94314517
2025-02-19 18cf2f252338e52fb531cd2ca1cc49e39bf6efe0
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)