Merge remote-tracking branch 'origin/master'

20230922-ljl-fixBug
qiushengjie 1 year ago
commit f1ceb49a79

@ -112,34 +112,34 @@ public class GetProductInfoByProductId extends SPIBaseService implements Extensi
product.put("ddCategoryList", "");
}
// 处理价格
// Double price = product.getDoubleValue("jd_price");
// JSONObject skuMap = product.getJSONObject("skuMap");
// Double consignPrice = 0D;
// for (String key : skuMap.keySet()) {
// JSONObject item = JSONObject.parseObject(skuMap.get(key).toString());
// Double cPrice = item.getDoubleValue("consignPrice");
// if (cPrice > consignPrice) {
// consignPrice = cPrice;
// }
// }
// if (Objects.isNull(consignPrice)) {
// consignPrice = 0D;
// }
// MoveShopSetting moveShopSetting = moveShopSettingService.getDetailByShopId(shopId);
// ModelMapper modelMapper = new ModelMapper();
// modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
// MoveShopSettingBO condition = modelMapper.map(moveShopSetting, MoveShopSettingBO.class);
// if (condition.getAliPriceType().equals(MoveConst.ALI_PRICE_TYPE_CONSIGN) && consignPrice > 0) {
// price = consignPrice;
// }
// double mPrice = moveService.processConditionPrice(condition, price);
// product.put("price", mPrice);
Double price = product.getDoubleValue("jd_price");
JSONObject skuMap = product.getJSONObject("skuMap");
Double consignPrice = 0D;
for (String key : skuMap.keySet()) {
JSONObject item = JSONObject.parseObject(skuMap.get(key).toString());
Double cPrice = item.getDoubleValue("consignPrice");
if (cPrice > consignPrice) {
consignPrice = cPrice;
}
}
if (Objects.isNull(consignPrice)) {
consignPrice = 0D;
}
MoveShopSetting moveShopSetting = moveShopSettingService.getDetailByShopId(shopId);
ModelMapper modelMapper = new ModelMapper();
modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
MoveShopSettingBO condition = modelMapper.map(moveShopSetting, MoveShopSettingBO.class);
if (condition.getAliPriceType().equals(MoveConst.ALI_PRICE_TYPE_CONSIGN) && consignPrice > 0) {
price = consignPrice;
}
double mPrice = moveService.processConditionPrice(condition, price);
product.put("price", mPrice);
productInfo.add(resObj.getJSONObject("productInfo"));
log.info(res);
} catch (Exception e) {
fetchFailIds.add(productIds.get(i));
e.printStackTrace();
log.error(e.getMessage());
log.error(e.toString());
}
}

Loading…
Cancel
Save