|
|
|
@ -401,7 +401,7 @@ public class WjOrderServiceImpl implements IWjOrderService {
|
|
|
|
|
WjCollection wjCollectionData = new WjCollection(); |
|
|
|
|
wjCollectionData.setId(CollectionId); |
|
|
|
|
//判断剩余数量修改状态
|
|
|
|
|
Integer num = wjCollection.getNumberRemaining() - wjInformations.size(); |
|
|
|
|
Integer num = wjCollection.getNumberRemaining() - 1; |
|
|
|
|
if (num <= wjCollection.getIssueNumber() * 0.2) { |
|
|
|
|
wjCollectionData.setState(5); |
|
|
|
|
} |
|
|
|
@ -414,21 +414,21 @@ public class WjOrderServiceImpl implements IWjOrderService {
|
|
|
|
|
wjOrder1.setCompletionTime(new Date()); |
|
|
|
|
wjOrderMapper.updateWjOrder(wjOrder1); |
|
|
|
|
//发放成功,修改收益
|
|
|
|
|
Long Income = wjCollection.getPrice() * wjInformations.size(); |
|
|
|
|
Double Income = wjOrder.getActualAmountPaid(); |
|
|
|
|
WjArtist wjArtist = wjArtistMapper.selectWjArtistById(wjCollection.getArtistId()); |
|
|
|
|
WjArtist wjArtistData = new WjArtist(); |
|
|
|
|
wjArtistData.setId(wjCollection.getArtistId()); |
|
|
|
|
Long ratio = (long) wjArtist.getProportion(); |
|
|
|
|
Long plateau = (Income * ratio); |
|
|
|
|
Long artist = Income * 100 - plateau; |
|
|
|
|
Integer ratio = wjArtist.getProportion(); |
|
|
|
|
Double plateau = (Income * ratio); |
|
|
|
|
Double artist = Income * 100 - plateau; |
|
|
|
|
WjIncomeStatement wjIncomeStatementData = new WjIncomeStatement(); |
|
|
|
|
String tagId = UUID.randomUUID().toString().replace("-", ""); |
|
|
|
|
wjIncomeStatementData.setId(tagId); |
|
|
|
|
wjIncomeStatementData.setArtistId(wjCollection.getArtistId()); |
|
|
|
|
wjIncomeStatementData.setOrderId(wjOrder.getId()); |
|
|
|
|
wjIncomeStatementData.setEarningsAmount((double) wjCollection.getPrice() / 100); |
|
|
|
|
wjIncomeStatementData.setMerchantsEarnings((double) artist / 100); |
|
|
|
|
wjIncomeStatementData.setEarnings((double) plateau / 100); |
|
|
|
|
wjIncomeStatementData.setEarningsAmount( wjOrder.getActualAmountPaid() / 100); |
|
|
|
|
wjIncomeStatementData.setMerchantsEarnings(artist / 10000); |
|
|
|
|
wjIncomeStatementData.setEarnings(plateau / 10000); |
|
|
|
|
incomeStatementMapper.insertWjIncomeStatement(wjIncomeStatementData); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|