| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.utils.AppContants; |
| | | import cc.mrbird.febs.mall.conversion.MallGoodsConversion; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | |
| | | return new FebsResponse().fail().message("商品编号不能重复"); |
| | | } |
| | | Integer carriageType = addMallGoodsDto.getCarriageType(); |
| | | if(1 == carriageType){ |
| | | if(ObjectUtil.isEmpty(addMallGoodsDto.getCarriageAmount()) |
| | | || BigDecimal.ZERO.compareTo(addMallGoodsDto.getCarriageAmount()) > 0){ |
| | | return new FebsResponse().fail().message("固定邮费不能小于零"); |
| | | } |
| | | }else{ |
| | | Long carriageRuleId = addMallGoodsDto.getCarriageRuleId(); |
| | | MallCarriageRule mallCarriageRule = mallCarriageRuleMapper.selectById(carriageRuleId); |
| | | if(ObjectUtil.isEmpty(mallCarriageRule)){ |
| | | return new FebsResponse().fail().message("邮费模板不能为空"); |
| | | if (addMallGoodsDto.getGoodsType() == 1) { |
| | | if (1 == carriageType) { |
| | | if (ObjectUtil.isEmpty(addMallGoodsDto.getCarriageAmount()) |
| | | || BigDecimal.ZERO.compareTo(addMallGoodsDto.getCarriageAmount()) > 0) { |
| | | return new FebsResponse().fail().message("固定邮费不能小于零"); |
| | | } |
| | | } else { |
| | | Long carriageRuleId = addMallGoodsDto.getCarriageRuleId(); |
| | | MallCarriageRule mallCarriageRule = mallCarriageRuleMapper.selectById(carriageRuleId); |
| | | if (ObjectUtil.isEmpty(mallCarriageRule)) { |
| | | return new FebsResponse().fail().message("邮费模板不能为空"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | mallGoodsCoupon.setName(name); |
| | | mallGoodsCoupon.setExpireDay(couponRuleAddDto.getExpireDay()); |
| | | mallGoodsCoupon.setCostAmount(couponRuleAddDto.getCostAmount()); |
| | | mallGoodsCoupon.setType(couponRuleAddDto.getType()); |
| | | mallGoodsCoupon.setRealAmount(couponRuleAddDto.getRealAmount()); |
| | | mallGoodsCouponMapper.insert(mallGoodsCoupon); |
| | | |
| | |
| | | mallGoodsCoupon.setName(adminMallGoodsCouponVo.getName()); |
| | | mallGoodsCoupon.setExpireDay(adminMallGoodsCouponVo.getExpireDay()); |
| | | mallGoodsCoupon.setCostAmount(adminMallGoodsCouponVo.getCostAmount()); |
| | | mallGoodsCoupon.setType(adminMallGoodsCouponVo.getType()); |
| | | mallGoodsCoupon.setRealAmount(adminMallGoodsCouponVo.getRealAmount()); |
| | | mallGoodsCouponMapper.updateById(mallGoodsCoupon); |
| | | |