From b9eccd0d793412791f92b48cd466f8c8d3a23d0a Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期四, 18 九月 2025 14:42:32 +0800 Subject: [PATCH] 礼品卡标识取消后标识能置空 --- framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java index 2cda83b..2882af1 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java @@ -164,17 +164,24 @@ @ApiModelProperty(value = "棰勫敭缁撴潫鏃堕棿") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") + @TableField(updateStrategy = FieldStrategy.IGNORED) private Date preSaleEndDate; @ApiModelProperty(value = "棰勫敭寮�濮嬫椂闂�") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") + @TableField(updateStrategy = FieldStrategy.IGNORED) private Date preSaleBeginDate; @ApiModelProperty(value = "鎶芥垚姣斾緥") private BigDecimal commission; @ApiModelProperty(value = "鍟嗗搧鎺掑簭") private Integer goodsSort; + + @ApiModelProperty(value ="琛ㄧず铏氭嫙鍟嗗搧绫诲瀷 鐜版湁绫诲瀷锛欳OUPON浼樻儬鍔�") + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String virtualGoodsType; + public Goods() { } @@ -192,6 +199,13 @@ this.mobileIntro = goodsOperationDTO.getMobileIntro(); this.goodsVideo = goodsOperationDTO.getGoodsVideo(); this.price = goodsOperationDTO.getPrice(); + this.virtualGoodsType = goodsOperationDTO.getVirtualGoodsType(); + + //涓嶆槸棰勫敭鍟嗗搧棰勫敭鏃堕棿缃┖ + if (!GoodsSalesModeEnum.PRESALE.name().equals(goodsOperationDTO.getSalesModel())) { + goodsOperationDTO.setPreSaleBeginDate(null); + goodsOperationDTO.setPreSaleEndDate(null); + } this.preSaleEndDate = goodsOperationDTO.getPreSaleEndDate(); this.preSaleBeginDate = goodsOperationDTO.getPreSaleBeginDate(); this.commission = goodsOperationDTO.getCommission(); @@ -223,6 +237,12 @@ if (!sku.containsKey("quantity") || StringUtil.isEmpty(sku.get("quantity").toString()) || Convert.toInt(sku.get("quantity").toString()) < 0) { throw new ServiceException(ResultCode.GOODS_SKU_QUANTITY_ERROR); } + //娌℃湁浼樻儬鍗风殑鍟嗗搧闇�瑕佺Щ闄や紭鎯犲嵎淇℃伅 + Object couponId = sku.get("couponId"); + if (couponId == null || StringUtil.isEmpty(couponId.toString())) { + sku.remove("couponId"); + sku.remove("couponName"); + } sku.values().forEach(i -> { if (CharSequenceUtil.isBlank(i.toString())) { throw new ServiceException(ResultCode.MUST_HAVE_GOODS_SKU_VALUE); -- Gitblit v1.8.0