MrShi
18 小时以前 297734ace4c05848b28a792fa89f38bee67be3c1
server/dmmall_service/src/main/java/com/doumee/service/business/impl/CouponServiceImpl.java
@@ -76,10 +76,19 @@
                || coupon.getType()==null
                ||coupon.getLimitPrice()==null
                ||coupon.getPrice()==null
                ||coupon.getUseType() ==null
                ||coupon.getNum()==null
                ||(coupon.getUseType() ==0 &&(
                    coupon.getStartDate()==null
                    ||coupon.getEndDate()==null
                  ))
                ||(coupon.getUseType() ==1 &&(
                    coupon.getValidDays()==null
                    || coupon.getValidDays()<=0
                  ))
              /*  ||coupon.getIntegral()==null*/
                ||coupon.getStartDate()==null
                ||coupon.getEndDate()==null
//                ||coupon.getStartDate()==null
//                ||coupon.getEndDate()==null
//                ||coupon.getValidDays()==null
        ){
@@ -96,6 +105,12 @@
            if(Objects.isNull(shop)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "关联的店铺不存在!");
            }
        }
        if(coupon.getUseType() ==0){
            coupon.setValidDays(null);
        }else{
            coupon.setStartDate(null);
            coupon.setEndDate(null);
        }
        coupon.setApplyIds("");
        if(Constants.equalsInteger(coupon.getApplyType(),Constants.TWO) && coupon.getApplyIdList()!=null){
@@ -139,7 +154,7 @@
        isCreateParamValid(coupon);
        Coupon query= couponMapper.selectById(coupon.getId());
        initCouponStatus(query);
     /*   if(!Constants.equalsInteger(query.getCouponStatus(),Constants.ZERO)){
       /* if(!Constants.equalsInteger(query.getCouponStatus(),Constants.ZERO)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "活动已开始/已结束状态,不支持编辑操作");
        }*/
        coupon.setEditor(user.getId());