| | |
| | | Calendar endCalender = Calendar.getInstance(); |
| | | endCalender.setTime(endTime); |
| | | BigDecimal receivedAmount = new BigDecimal(Double.parseDouble(paramInJson.getString("receivedAmount"))); |
| | | cycles = receivedAmount.divide(feePrice, 2, BigDecimal.ROUND_HALF_EVEN); |
| | | cycles = receivedAmount.divide(feePrice, 4, BigDecimal.ROUND_HALF_EVEN); |
| | | endCalender = getTargetEndTime(endCalender, cycles.doubleValue()); |
| | | targetEndTime = endCalender.getTime(); |
| | | paramInJson.put("tmpCycles", cycles.doubleValue()); |
| | |
| | | cycles = cycles - Math.floor(cycles); |
| | | } |
| | | //int hours = new Double(cycles * DateUtil.getCurrentMonthDay() * 24).intValue(); |
| | | int hours = new Double(cycles * 30 * 24).intValue(); |
| | | int futureDay = endCalender.getActualMaximum(Calendar.DAY_OF_MONTH); |
| | | int hours = new Double(cycles * futureDay * 24).intValue(); |
| | | endCalender.add(Calendar.HOUR, hours); |
| | | |
| | | return endCalender; |
| | |
| | | endCalender.setTime(endTime); |
| | | int hours = 0; |
| | | if ("-101".equals(paramInJson.getString("cycles"))) { |
| | | hours = new Double(Double.parseDouble(paramInJson.getString("tmpCycles")) * DateUtil.getCurrentMonthDay() * 24).intValue(); |
| | | endCalender.add(Calendar.HOUR, hours); |
| | | // hours = new Double(Double.parseDouble(paramInJson.getString("tmpCycles")) * DateUtil.getCurrentMonthDay() * 24).intValue(); |
| | | // endCalender.add(Calendar.HOUR, hours); |
| | | |
| | | endCalender = getTargetEndTime(endCalender, Double.parseDouble(paramInJson.getString("tmpCycles"))); |
| | | } else { |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | } |
| | |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessFeeDetail = new JSONObject(); |
| | | businessFeeDetail.putAll(paramInJson); |
| | | businessFeeDetail.put("detailId", "-1"); |
| | | businessFeeDetail.put("detailId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId)); |
| | | businessFeeDetail.put("primeRate", "1.00"); |
| | | |
| | | if (!businessFeeDetail.containsKey("state")) { |
| | |
| | | endCalender.setTime(endTime); |
| | | int hours = 0; |
| | | if ("-101".equals(paramInJson.getString("cycles"))) { |
| | | hours = new Double(Double.parseDouble(paramInJson.getString("tmpCycles")) * DateUtil.getCurrentMonthDay() * 24).intValue(); |
| | | endCalender.add(Calendar.HOUR, hours); |
| | | // hours = new Double(Double.parseDouble(paramInJson.getString("tmpCycles")) * DateUtil.getCurrentMonthDay() * 24).intValue(); |
| | | // endCalender.add(Calendar.HOUR, hours); |
| | | endCalender = getTargetEndTime(endCalender, Double.parseDouble(paramInJson.getString("tmpCycles"))); |
| | | } else { |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | if (FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { |
| | |
| | | BigDecimal receivableAmount = feePrice; |
| | | BigDecimal cycles = new BigDecimal(Double.parseDouble(paramInJson.getString("cycles"))); |
| | | double tmpReceivableAmount = cycles.multiply(receivableAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | |
| | | double discountPrice = paramInJson.getDouble("discountPrice"); |
| | | businessFeeDetail.put("receivableAmount", tmpReceivableAmount); |
| | | businessFeeDetail.put("receivedAmount", |
| | | new BigDecimal(tmpReceivableAmount).subtract(new BigDecimal(discountPrice)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(PayFeeDetailPo.class.getSimpleName(), businessFeeDetail); |
| | | paramInJson.put("receivableAmount", tmpReceivableAmount); |
| | | paramInJson.put("receivedAmount", businessFeeDetail.getString("receivedAmount")); |
| | | paramInJson.put("detailId", businessFeeDetail.getString("detailId")); |
| | | return business; |
| | | } |
| | | |