| | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.lang.Assert; |
| | | import cn.hutool.json.JSONUtil; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.modules.goods.entity.dos.Goods; |
| | | import cn.lili.modules.goods.entity.dos.GoodsSku; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | Map<String, Object> specMap = new LinkedHashMap<>(); |
| | | |
| | | // 原始规格项 |
| | | String[] ignoreOriginKeys = {"id", "sn", "cost", "price", "quantity", "weight", "alertQuantity"}; |
| | | String[] ignoreOriginKeys = {"id", "sn", "cost", "price", "quantity", "weight", "alertQuantity","couponId","couponName"}; |
| | | //获取规格信息 |
| | | for (Map.Entry<String, Object> spec : skuInfo.entrySet()) { |
| | | //保存新增规格信息 |
| | |
| | | |
| | | |
| | | //规格信息 |
| | | goodsSku.setCouponId(Convert.toStr(skuInfo.get("couponId"),"")); |
| | | if(StringUtils.isNotBlank(Convert.toStr(skuInfo.get("couponId")))){ |
| | | goodsSku.setCouponId(Convert.toStr(skuInfo.get("couponId"),"")); |
| | | } |
| | | |
| | | goodsSku.setCouponName(Convert.toStr(skuInfo.get("couponName"),"")); |
| | | goodsSku.setId(Convert.toStr(skuInfo.get("id"), "")); |
| | | goodsSku.setSn(Convert.toStr(skuInfo.get("sn"))); |