Commit fc983665 authored by wlx@33.cn's avatar wlx@33.cn

修正退款

parent c2fa5543
......@@ -36,7 +36,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
......@@ -112,7 +111,6 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
//判断商品是否为NFT
GoodsSpuVO goodsSpu = spuMapper.readByCoin(merchantId, coin);
goodsSpu.initTokenId();
boolean isSalesNFTCopy = goodsSpu.getNftSalesType().equals(Spu.NFT_SALES_TYPE_COPY);
boolean commodityPassAuto = goodsSpu.getCommodityPass().equals(Spu.COMMODITY_PASS_AUTO);
/**
......@@ -123,7 +121,7 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
* NFT商品为“使用权销售时”,根据订单购买的编号重置为未使用
*/
List<Integer> serialNoList = JSON.parseArray(serialNo, int.class);
if (updateSkuSerialNo){
if (updateSkuSerialNo) {
updateSkuSerialNo(serialNoList, merchantId, coin, isSalesNFTCopy);
}
//根据开关判断是否走链,默认不走链
......@@ -131,12 +129,12 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
/**
* NFT商品为“使用权销售”,tokenId+编号,循环转账操作
*/
if (isSalesNFTCopy){
if (isSalesNFTCopy) {
serialNoList.forEach(index -> {
Long tokenId = Long.valueOf(index);
payInChain(tableType, tableId, fromAddr, toAddr, coin, 1, tokenId, commodityPassAuto, isSalesNFTCopy);
});
}else{
} else {
payInChain(tableType, tableId, fromAddr, toAddr, coin, number, goodsSpu.getTokenId(), commodityPassAuto, isSalesNFTCopy);
}
}
......@@ -234,7 +232,7 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
}
private void payInChain(int tableType, String tableId, String fromAddr, String toAddr, String coin, int number,
Long tokenId, boolean commodityPassAuto, boolean isSalesNFTCopy){
Long tokenId, boolean commodityPassAuto, boolean isSalesNFTCopy) {
TranDto tranDto = new TranDto();
tranDto.setFromAddr(fromAddr);
tranDto.setToAddr(toAddr);
......@@ -243,6 +241,7 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
tranDto.setAmount(new BigDecimal(number));
tranDto.setTableId(tableId);
tranDto.setTableType(tableType);
tranDto.setTokenId(tokenId);
String hash;
/**
* 一幕所有的nft都是内部nft
......
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