Commit 48d81970 authored by 童得柱's avatar 童得柱

fix资产加商品coin

parent e922f0de
...@@ -70,4 +70,7 @@ public class UserAsset implements Serializable { ...@@ -70,4 +70,7 @@ public class UserAsset implements Serializable {
@ApiModelProperty(value = "溯源hash") @ApiModelProperty(value = "溯源hash")
@TableField(exist = false) @TableField(exist = false)
private String hash; private String hash;
@ApiModelProperty(value = "商品coin")
private String goodsCoin;
} }
...@@ -72,6 +72,9 @@ public class UserAssetRecord implements Serializable { ...@@ -72,6 +72,9 @@ public class UserAssetRecord implements Serializable {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String note; private String note;
@ApiModelProperty(value = "商品coin")
private String goodsCoin;
public void init(String uid, String coin, Integer type, BigDecimal amount, Integer status, String otherSide, String hash, String note) { public void init(String uid, String coin, Integer type, BigDecimal amount, Integer status, String otherSide, String hash, String note) {
setFlowId(UUIdUtil.getUUID()); setFlowId(UUIdUtil.getUUID());
setUid(uid); setUid(uid);
......
...@@ -35,5 +35,6 @@ public class AssetTranDTO { ...@@ -35,5 +35,6 @@ public class AssetTranDTO {
public AssetTranDTO() { public AssetTranDTO() {
} }
@ApiModelProperty(value = "商品coin")
private String goodsCoin;
} }
...@@ -97,10 +97,10 @@ public class UserAssetServiceImpl extends ServiceImpl<UserAssetMapper, UserAsset ...@@ -97,10 +97,10 @@ public class UserAssetServiceImpl extends ServiceImpl<UserAssetMapper, UserAsset
BigDecimal amount = i.getAmount(); BigDecimal amount = i.getAmount();
i.setAmount(amount.setScale(2, BigDecimal.ROUND_DOWN)); i.setAmount(amount.setScale(2, BigDecimal.ROUND_DOWN));
i.setFrozen(i.getFrozen().setScale(2, BigDecimal.ROUND_DOWN)); i.setFrozen(i.getFrozen().setScale(2, BigDecimal.ROUND_DOWN));
if (StringUtil.isNullOrEmpty(i.getCoin())) { if (StringUtil.isNullOrEmpty(i.getGoodsCoin())) {
continue; continue;
} }
SkuVo skuVo = skuService.querySkuByCoin(i.getCoin()); SkuVo skuVo = skuService.querySkuByCoin(i.getGoodsCoin());
if (skuVo != null) { if (skuVo != null) {
BigDecimal totalPrice = amount.multiply(skuVo.getOriginalPrice()).setScale(2, BigDecimal.ROUND_DOWN); BigDecimal totalPrice = amount.multiply(skuVo.getOriginalPrice()).setScale(2, BigDecimal.ROUND_DOWN);
i.setTotalPrice(totalPrice); i.setTotalPrice(totalPrice);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment