| | |
| | | if (feeDtos == null || feeDtos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "查询费用信息失败,未查到数据或查到多条数据"); |
| | | } |
| | | if (!businessFeeDetail.containsKey("state")) { |
| | | if (!businessFeeDetail.containsKey("state") || StringUtil.isEmpty(businessFeeDetail.getString("state"))) { |
| | | businessFeeDetail.put("state", "1400"); |
| | | } |
| | | feeDto = feeDtos.get(0); |
| | |
| | | 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(); |
| | |
| | | if (feeDtos == null || feeDtos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "查询费用信息失败,未查到数据或查到多条数据"); |
| | | } |
| | | if (!businessFeeDetail.containsKey("state")) { |
| | | if (!businessFeeDetail.containsKey("state") || StringUtil.isEmpty(businessFeeDetail.getString("state"))) { |
| | | businessFeeDetail.put("state", "1400"); |
| | | } |
| | | 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)); |
| | |
| | | if (FeeDto.FEE_FLAG_ONCE.equals(feeInfo.getFeeFlag())) { //缴费结束 |
| | | feeMap.put("state", FeeDto.STATE_FINISH); |
| | | } |
| | | Date maxEndTime = feeInfo.getConfigEndTime(); |
| | | if(!FeeDto.FEE_FLAG_CYCLE.equals(feeInfo.getFeeFlag())){ |
| | | maxEndTime = feeInfo.getDeadlineTime(); |
| | | } |
| | | try { |
| | | Date endTime = DateUtil.getDateFromString(paramInJson.getString("endTime"), DateUtil.DATE_FORMATE_STRING_A); |
| | | Date configEndTime = feeInfo.getConfigEndTime(); |
| | | if (endTime.getTime() >= configEndTime.getTime()) { |
| | | if (endTime.getTime() >= maxEndTime.getTime()) { |
| | | feeMap.put("state", FeeDto.STATE_FINISH); |
| | | } |
| | | } catch (ParseException e) { |
| | |
| | | |
| | | 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)); |
| | |
| | | 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")); |
| | |
| | | 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("feeTypeCd", paramInJson.getString("feeTypeCd")); |
| | | businessUnit.put("incomeObjId", paramInJson.getString("storeId")); |
| | | businessUnit.put("amount", "-1.00"); |
| | | if (paramInJson.containsKey("amount") && !StringUtil.isEmpty(paramInJson.getString("amount"))) { |
| | | businessUnit.put("amount", paramInJson.getString("amount")); |
| | | } |
| | | businessUnit.put("startTime", time); |
| | | businessUnit.put("endTime", time); |
| | | businessUnit.put("communityId", paramInJson.getString("communityId")); |
| | |
| | | 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")); |