| | |
| | | private Long addGoodsEntity(MallActivity mallActivity,BigDecimal discountSize,MallGoods mallGoodsItem){ |
| | | mallGoodsItem.setIsNormal(GoodsTypeEnum.HUO_DONG.getValue()); |
| | | mallGoodsItem.setGoodsName(mallActivity.getName()+"-"+(StrUtil.isEmpty(mallGoodsItem.getGoodsName()) ? "":mallGoodsItem.getGoodsName())); |
| | | mallGoodsItem.setGoodsNo(mallGoodsItem.getGoodsNo()+"-"+mallActivity.getCode()); |
| | | mallGoodsItem.setGoodsNo("HD"+mallActivity.getId()+"-"+mallGoodsItem.getGoodsNo()); |
| | | mallGoodsItem.setActivityId(mallActivity.getId()); |
| | | BigDecimal presentPrice = new BigDecimal(mallGoodsItem.getPresentPrice()).multiply(discountSize).setScale(2, RoundingMode.DOWN); |
| | | mallGoodsItem.setPresentPrice(presentPrice.toString()); |
| | |
| | | .eq(MallGoods::getActivityId, id) |
| | | ); |
| | | if(CollUtil.isNotEmpty(mallGoods)){ |
| | | mallGoodsMapper.update(null, |
| | | MallGoods goods = new MallGoods(); |
| | | goods.setIsSale(MallGoods.ISSALE_STATUS_DISABLED); |
| | | mallGoodsMapper.update(goods, |
| | | new LambdaQueryWrapper<MallGoods>() |
| | | .eq(MallGoods::getIsSale, MallGoods.ISSALE_STATUS_DISABLED) |
| | | .eq(MallGoods::getIsSale, MallGoods.ISSALE_STATUS_ENABLE) |
| | | .eq(MallGoods::getActivityId, id) |
| | | ); |
| | | } |