价格相关修改

20230922-ljl-fixBug
cxxxxxxx详 1 year ago
parent 7999ece378
commit cfdf2b40da

@ -112,28 +112,28 @@ 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) {

@ -1,13 +1,13 @@
#本地端口
#server.port=9090
server.port=9090
#开发库
#spring.datasource.url=jdbc:mysql://rm-2ze492h01b2j0i718mo.mysql.rds.aliyuncs.com:3306/dd_light_ds_dev2?characterEncoding=utf-8&useSSL=false
#spring.redis.database=10
spring.datasource.url=jdbc:mysql://rm-2ze492h01b2j0i718mo.mysql.rds.aliyuncs.com:3306/dd_light_ds_dev2?characterEncoding=utf-8&useSSL=false
spring.redis.database=10
#测试库
spring.datasource.url=jdbc:mysql://rm-2ze492h01b2j0i718mo.mysql.rds.aliyuncs.com:3306/dd_light_ds_dev?characterEncoding=utf-8&useSSL=false
spring.redis.database=0
#spring.datasource.url=jdbc:mysql://rm-2ze492h01b2j0i718mo.mysql.rds.aliyuncs.com:3306/dd_light_ds_dev?characterEncoding=utf-8&useSSL=false
#spring.redis.database=0
#=================测试环境
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

Loading…
Cancel
Save