| | |
| | | BigDecimal getPrice= BigDecimal.valueOf(orderDetail.getPrice()); |
| | | BigDecimal getQuantity= BigDecimal.valueOf(orderDetail.getQuantity()); |
| | | BigDecimal getComputeGrossArea= BigDecimal.valueOf(orderDetail.getComputeGrossArea()); |
| | | BigDecimal getComputeArea= BigDecimal.valueOf(orderDetail.getComputeArea()); |
| | | BigDecimal getWidth= BigDecimal.valueOf(orderDetail.getWidth()); |
| | | BigDecimal getHeight= BigDecimal.valueOf(orderDetail.getHeight()); |
| | | if (calculateType == 3) { |
| | | orderDetail.setGrossAmount(getPrice.multiply(getQuantity).setScale(2, RoundingMode.HALF_UP).doubleValue()); |
| | | }else if (calculateType == 4) { |
| | | if(Objects.equals(orderDetail.getArea(), orderDetail.getComputeArea())&&Objects.equals(orderDetail.getGrossArea(), orderDetail.getComputeGrossArea())){ |
| | | orderDetail.setGrossAmount(getWidth.multiply(getHeight).multiply(getQuantity).multiply(getPrice). |
| | | divide(BigDecimal.valueOf(1000000), 2, RoundingMode.HALF_UP).doubleValue()); |
| | | }else{ |
| | | orderDetail.setGrossAmount(getPrice.multiply(getComputeGrossArea).setScale(2, RoundingMode.HALF_UP).doubleValue()); |
| | | } |
| | | }else if (calculateType == 1){ |
| | | orderDetail.setGrossAmount(getPrice.multiply(getComputeArea).multiply(getQuantity).setScale(2, RoundingMode.HALF_UP).doubleValue()); |
| | | } else { |
| | | orderDetail.setGrossAmount(getPrice.multiply(getComputeGrossArea).setScale(2, RoundingMode.HALF_UP).doubleValue()); |
| | | } |