| | |
| | | int hours = 0; |
| | | Date targetEndTime = null; |
| | | BigDecimal cycles = null; |
| | | BigDecimal feePrice = new BigDecimal(computeFeeSMOImpl.getFeePrice(feeDto)); |
| | | Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); |
| | | BigDecimal feePrice = new BigDecimal(feePriceAll.get("feePrice").toString()); |
| | | if ("-101".equals(paramInJson.getString("cycles"))) { |
| | | Date endTime = feeDto.getEndTime(); |
| | | Calendar endCalender = Calendar.getInstance(); |
| | |
| | | feeDto = feeDtos.get(0); |
| | | businessFeeDetail.put("startTime", paramInJson.getString("startTime")); |
| | | BigDecimal cycles = null; |
| | | BigDecimal feePrice = new BigDecimal(computeFeeSMOImpl.getFeePrice(feeDto)); |
| | | Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); |
| | | BigDecimal feePrice = new BigDecimal(feePriceAll.get("feePrice").toString()); |
| | | Date endTime = feeDto.getEndTime(); |
| | | Calendar endCalender = Calendar.getInstance(); |
| | | endCalender.setTime(endTime); |
| | |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | } |
| | | feeInfo.setEndTime(endCalender.getTime()); |
| | | //判断 结束时间 是否大于 费用项 结束时间,这里 容错一下,如果 费用结束时间大于 费用项结束时间 30天 走报错 属于多缴费 |
| | | if (feeInfo.getEndTime().getTime() - feeInfo.getConfigEndTime().getTime() > 30 * 24 * 60 * 60 * 1000L) { |
| | | throw new IllegalArgumentException("缴费超过了 费用项结束时间"); |
| | | } |
| | | Map feeMap = BeanConvertUtil.beanCovertMap(feeInfo); |
| | | feeMap.put("startTime", DateUtil.getFormatTimeString(feeInfo.getStartTime(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | feeMap.put("endTime", DateUtil.getFormatTimeString(feeInfo.getEndTime(), DateUtil.DATE_FORMATE_STRING_A)); |
| | |
| | | |
| | | double feePrice = 0.0; |
| | | |
| | | feePrice = computeFeeSMOImpl.getFeePrice(feeDto); |
| | | Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); |
| | | |
| | | BigDecimal receivableAmount = new BigDecimal(feePrice); |
| | | BigDecimal receivableAmount = new BigDecimal(feePriceAll.get("feePrice").toString()); |
| | | 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"); |
| | |
| | | endCalender.setTime(endTime); |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | feeInfo.setEndTime(endCalender.getTime()); |
| | | //判断 结束时间 是否大于 费用项 结束时间,这里 容错一下,如果 费用结束时间大于 费用项结束时间 30天 走报错 属于多缴费 |
| | | if (feeInfo.getEndTime().getTime() - feeInfo.getConfigEndTime().getTime() > 30 * 24 * 60 * 60 * 1000L) { |
| | | throw new IllegalArgumentException("缴费超过了 费用项结束时间" + JSONObject.toJSONString(feeInfo) + "|||" + paramInJson.getString("cycles")); |
| | | } |
| | | Map feeMap = BeanConvertUtil.beanCovertMap(feeInfo); |
| | | feeMap.put("startTime", DateUtil.getFormatTimeString(feeInfo.getStartTime(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | feeMap.put("endTime", DateUtil.getFormatTimeString(feeInfo.getEndTime(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | businessFee.putAll(feeMap); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(PayFeePo.class.getSimpleName(), businessFee); |
| | | |
| | | //为停车费单独处理 |
| | | paramInJson.put("carFeeEndTime", feeInfo.getEndTime()); |
| | | paramInJson.put("carPayerObjType", feeInfo.getPayerObjType()); |
| | | paramInJson.put("carPayerObjId", feeInfo.getPayerObjId()); |
| | | return business; |
| | | } |
| | | |
| | | |
| | | public JSONObject modifyTempCarInout(JSONObject reqJson, DataFlowContext context) { |
| | | FeeDto feeDto = (FeeDto) reqJson.get("feeInfo"); |
| | |
| | | businessUnit.put("payerObjType", FeeDto.PAYER_OBJ_TYPE_CAR); |
| | | businessUnit.put("feeFlag", paramInJson.getString("feeFlag")); |
| | | businessUnit.put("state", "2008001"); |
| | | businessUnit.put("batchId", paramInJson.getString("batchId")); |
| | | businessUnit.put("userId", dataFlowContext.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID)); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(PayFeePo.class.getSimpleName(), businessUnit); |
| | | paramInJson.put("feeId", businessUnit.getString("feeId")); |
| | |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject addRoomFee(RoomDto roomDto, JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | public JSONObject addRoomFee(RoomDto roomDto, JSONObject paramInJson, DataFlowContext dataFlowContext) throws ParseException { |
| | | String time = DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A); |
| | | if (paramInJson.containsKey("feeEndDate")) { |
| | | time = paramInJson.getString("feeEndDate"); |
| | | } else if (paramInJson.containsKey("startTime")) { |
| | | time = paramInJson.getString("startTime"); |
| | | } |
| | | //获取费用标识 |
| | | String feeFlag = paramInJson.getString("feeFlag"); |
| | | //查询费用项 |
| | | FeeConfigDto feeConfigDto = new FeeConfigDto(); |
| | | feeConfigDto.setConfigId(paramInJson.getString("configId")); |
| | | List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); |
| | | Assert.listOnlyOne(feeConfigDtos, "查询费用项错误!"); |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1); |
| | |
| | | businessUnit.put("payerObjType", "3333"); |
| | | businessUnit.put("feeFlag", paramInJson.getString("feeFlag")); |
| | | businessUnit.put("state", "2008001"); |
| | | businessUnit.put("batchId", paramInJson.getString("batchId")); |
| | | businessUnit.put("userId", dataFlowContext.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID)); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(PayFeePo.class.getSimpleName(), businessUnit); |
| | | paramInJson.put("feeId", businessUnit.getString("feeId")); |
| | |
| | | businessUnit.put("payerObjType", FeeDto.PAYER_OBJ_TYPE_CONTRACT); |
| | | businessUnit.put("feeFlag", paramInJson.getString("feeFlag")); |
| | | businessUnit.put("state", "2008001"); |
| | | businessUnit.put("batchId", paramInJson.getString("batchId")); |
| | | businessUnit.put("userId", dataFlowContext.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID)); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(PayFeePo.class.getSimpleName(), businessUnit); |
| | | paramInJson.put("feeId", businessUnit.getString("feeId")); |