文章分类默认值问题处理
This commit is contained in:
parent
829472c6a3
commit
26c67c72fa
@ -111,32 +111,33 @@ public class CartPriceRender implements CartRenderStep {
|
||||
for (CartSkuVO cartSkuVO : cartSkuVOS) {
|
||||
if (Boolean.TRUE.equals(cartSkuVO.getChecked())) {
|
||||
PriceDetailDTO priceDetailDTO = cartSkuVO.getPriceDetailDTO();
|
||||
//流水金额(入账 出帐金额) = goodsPrice + freight - discountPrice - couponPrice
|
||||
//流水金额(入账 出帐金额) = goodsPrice + freight - (discountPrice + couponPrice)
|
||||
double flowPrice = CurrencyUtil.sub(
|
||||
CurrencyUtil.add(priceDetailDTO.getGoodsPrice(), priceDetailDTO.getFreightPrice()),
|
||||
CurrencyUtil.add(priceDetailDTO.getDiscountPrice(),
|
||||
priceDetailDTO.getCouponPrice() != null ? priceDetailDTO.getCouponPrice() : 0));
|
||||
priceDetailDTO.setFlowPrice(flowPrice);
|
||||
|
||||
//如果是普通订单最终结算金额 = flowPrice - platFormCommission - distributionCommission
|
||||
//砍价、积分订单按照商品的结算价进行结算
|
||||
if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.CART)
|
||||
|| tradeDTO.getCartTypeEnum().equals(CartTypeEnum.BUY_NOW)
|
||||
|| tradeDTO.getCartTypeEnum().equals(CartTypeEnum.VIRTUAL)) {
|
||||
|
||||
double billPrice = CurrencyUtil.sub(CurrencyUtil.sub(flowPrice, priceDetailDTO.getPlatFormCommission()), priceDetailDTO.getDistributionCommission());
|
||||
priceDetailDTO.setBillPrice(billPrice);
|
||||
} else if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.POINTS)) {
|
||||
//如果积分订单 计算金额
|
||||
if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.POINTS)) {
|
||||
PointsGoodsVO pointsGoodsVO = pointsGoodsService.getPointsGoodsVOByMongo(cartSkuVO.getGoodsSku().getId());
|
||||
priceDetailDTO.setBillPrice(pointsGoodsVO.getSettlementPrice());
|
||||
priceDetailDTO.setSettlementPrice(pointsGoodsVO.getSettlementPrice());
|
||||
} else if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.KANJIA)) {
|
||||
}
|
||||
//如果砍价订单 计算金额
|
||||
else if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.KANJIA)) {
|
||||
KanjiaActivityGoodsDTO kanjiaActivityGoodsDTO = kanjiaActivityGoodsService.getKanJiaGoodsBySku(cartSkuVO.getGoodsSku().getId());
|
||||
priceDetailDTO.setBillPrice(kanjiaActivityGoodsDTO.getSettlementPrice());
|
||||
priceDetailDTO.setSettlementPrice(kanjiaActivityGoodsDTO.getSettlementPrice());
|
||||
}
|
||||
//填写结算价格
|
||||
|
||||
//兜底普通计算
|
||||
else {
|
||||
//如果是普通订单最终结算金额 = flowPrice - platFormCommission - distributionCommission
|
||||
double billPrice = CurrencyUtil.sub(
|
||||
CurrencyUtil.sub(
|
||||
flowPrice, priceDetailDTO.getPlatFormCommission()), priceDetailDTO.getDistributionCommission());
|
||||
priceDetailDTO.setBillPrice(billPrice);
|
||||
}
|
||||
|
||||
//平台佣金
|
||||
String categoryId = cartSkuVO.getGoodsSku().getCategoryPath().substring(
|
||||
|
@ -135,7 +135,7 @@ public class StoreFlow {
|
||||
|
||||
@CreatedDate
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间", hidden = true)
|
||||
private Date createTime;
|
||||
|
@ -51,4 +51,17 @@ public class ArticleCategory extends BaseEntity {
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
public Integer getSort() {
|
||||
if (sort == null) {
|
||||
return 0;
|
||||
}
|
||||
return sort;
|
||||
}
|
||||
|
||||
public Integer getLevel() {
|
||||
if (level == null) {
|
||||
return 1;
|
||||
}
|
||||
return level;
|
||||
}
|
||||
}
|
@ -34,7 +34,6 @@ public class ArticleCategoryVO extends ArticleCategory {
|
||||
children.sort(new Comparator<ArticleCategoryVO>() {
|
||||
@Override
|
||||
public int compare(ArticleCategoryVO o1, ArticleCategoryVO o2) {
|
||||
System.out.println(o1.getArticleCategoryName()+":"+o2.getArticleCategoryName());
|
||||
return o1.getSort().compareTo(o2.getSort());
|
||||
}
|
||||
});
|
||||
|
@ -39,7 +39,7 @@ public class ArticleCategoryManagerController {
|
||||
try {
|
||||
return ResultUtil.data(this.articleCategoryService.allChildren());
|
||||
} catch (Exception e) {
|
||||
log.error("查询分类列表错误",e);
|
||||
log.error("查询分类列表错误", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -57,6 +57,9 @@ public class ArticleCategoryManagerController {
|
||||
if (articleCategory.getLevel() == null) {
|
||||
articleCategory.setLevel(0);
|
||||
}
|
||||
if (articleCategory.getSort() == null) {
|
||||
articleCategory.setSort(0);
|
||||
}
|
||||
|
||||
return ResultUtil.data(articleCategoryService.saveArticleCategory(articleCategory));
|
||||
}
|
||||
@ -65,6 +68,14 @@ public class ArticleCategoryManagerController {
|
||||
@ApiImplicitParam(name = "id", value = "文章分类ID", required = true, dataType = "String", paramType = "path")
|
||||
@PutMapping("/update/{id}")
|
||||
public ResultMessage<ArticleCategory> update(@Valid ArticleCategory articleCategory, @PathVariable("id") String id) {
|
||||
|
||||
if (articleCategory.getLevel() == null) {
|
||||
articleCategory.setLevel(0);
|
||||
}
|
||||
if (articleCategory.getSort() == null) {
|
||||
articleCategory.setSort(0);
|
||||
}
|
||||
|
||||
articleCategory.setId(id);
|
||||
return ResultUtil.data(articleCategoryService.updateArticleCategory(articleCategory));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user