| | |
| | | |
| | | BigDecimal total = BigDecimal.ZERO; |
| | | for (JhyOrderItems item : items) { |
| | | item.setPrice(item.getPrice().multiply(BigDecimal.valueOf(50))); |
| | | item.setPrice(item.getPrice().multiply(BigDecimal.valueOf(Constants.PRICE_SCORE_EXCHANGE))); |
| | | total = total.add(StrUtil.isNotBlank(item.getScore()) ? new BigDecimal(item.getScore()) : BigDecimal.ZERO); |
| | | } |
| | | |
| | |
| | | orderItems.setItemType(item.getId()); |
| | | orderItems.setTitle(environmentalInfo.getTitle()); |
| | | orderItems.setPrice(new BigDecimal(environmentalInfo.getPrice())); |
| | | BigDecimal total = orderItems.getPrice().multiply(BigDecimal.valueOf(50)).multiply(weight); |
| | | BigDecimal total = orderItems.getPrice().multiply(BigDecimal.valueOf(Constants.PRICE_SCORE_EXCHANGE)).multiply(weight); |
| | | orderItems.setScore(total.setScale(0, BigDecimal.ROUND_DOWN).toString()); |
| | | orderItems.setWeight(weight); |
| | | jhyOrderItemsMapper.insert(orderItems); |