| | |
| | | mallProductBuyMapper.updateById(mallProductBuy); |
| | | } |
| | | |
| | | @Override |
| | | public void fcmOrderBuyCancelMsg(Long buyRecordId) { |
| | | MallProductBuyRecord mallProductBuyRecord = mallProductBuyRecordMapper.selectById(buyRecordId); |
| | | if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != mallProductBuyRecord.getState()){ |
| | | return; |
| | | } |
| | | Long sellRecordId = mallProductBuyRecord.getSellRecordId(); |
| | | //更新买单子表的数据 |
| | | mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_FAIL.getValue()); |
| | | mallProductBuyRecordMapper.updateById(mallProductBuyRecord); |
| | | //更新买单主表 |
| | | MallProductBuy mallProductBuy = mallProductBuyMapper.selectById(mallProductBuyRecord.getBuyId()); |
| | | mallProductBuy.setNftAva(mallProductBuy.getNftAva().add(mallProductBuyRecord.getPickNftCnt())); |
| | | mallProductBuyMapper.updateById(mallProductBuy); |
| | | //更新卖单子表的数据 |
| | | MallProductSellRecord mallProductSellRecord = mallProductSellRecordMapper.selectById(sellRecordId); |
| | | mallProductSellRecord.setState(ProductEnum.PRODUCT_MATE_STATE_FAIL.getValue()); |
| | | mallProductSellRecordMapper.updateById(mallProductSellRecord); |
| | | //更新卖单主表 |
| | | Long sellId = mallProductSellRecord.getSellId(); |
| | | MallProductSell mallProductSell = mallProductSellMapper.selectById(sellId); |
| | | mallProductSell.setNftCntAva(mallProductSell.getNftCntAva().add(mallProductSellRecord.getNftCnt())); |
| | | mallProductSellMapper.updateById(mallProductSell); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | BigDecimal divide = new BigDecimal(12000).divide(new BigDecimal(10000), 0, BigDecimal.ROUND_DOWN); |
| | | System.out.println(divide); |