| | |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.po.feeReceipt.FeeReceiptPo; |
| | | import com.java110.po.feeReceiptDetail.FeeReceiptDetailPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.*; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | |
| | | 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) { |
| | |
| | | |
| | | JSONObject businessFeeDetail = new JSONObject(); |
| | | businessFeeDetail.putAll(paramInJson); |
| | | businessFeeDetail.put("detailId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId)); |
| | | businessFeeDetail.put("detailId", paramInJson.getString("detailId")); |
| | | businessFeeDetail.put("primeRate", paramInJson.getString("primeRate")); |
| | | if (!businessFeeDetail.containsKey("state")) { |
| | | businessFeeDetail.put("state", "1400"); |
| | |
| | | Calendar endCalender = Calendar.getInstance(); |
| | | endCalender.setTime(endTime); |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | if (FeeDto.FEE_FLAG_ONCE.equals(feeInfo.getFeeFlag())) { |
| | | if (feeInfo.getDeadlineTime() != null) { |
| | | endCalender.setTime(feeInfo.getDeadlineTime()); |
| | | } else if (!StringUtil.isEmpty(feeInfo.getCurDegrees())) { |
| | | endCalender.setTime(feeInfo.getCurReadingTime()); |
| | | } else if (feeInfo.getImportFeeEndTime() == null) { |
| | | endCalender.setTime(feeInfo.getConfigEndTime()); |
| | | } else { |
| | | endCalender.setTime(feeInfo.getImportFeeEndTime()); |
| | | } |
| | | //businessFee.put("state",FeeDto.STATE_FINISH); |
| | | feeInfo.setState(FeeDto.STATE_FINISH); |
| | | } |
| | | 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")); |
| | |
| | | paramInJson.put("carFeeEndTime", feeInfo.getEndTime()); |
| | | paramInJson.put("carPayerObjType", feeInfo.getPayerObjType()); |
| | | paramInJson.put("carPayerObjId", feeInfo.getPayerObjId()); |
| | | |
| | | // 周期性收费、缴费后,到期日期在费用项终止日期后,则设置缴费状态结束,设置结束日期为费用项终止日期 |
| | | if (FeeFlagTypeConstant.CYCLE.equals(feeInfo.getFeeFlag())) { |
| | | //这里 容错五天时间 |
| | | Date configEndTime = feeInfo.getConfigEndTime(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(configEndTime); |
| | | calendar.add(Calendar.DAY_OF_MONTH, -5); |
| | | configEndTime = calendar.getTime(); |
| | | if (feeInfo.getEndTime().after(configEndTime)) { |
| | | businessFee.put("state", FeeStateConstant.END); |
| | | businessFee.put("endTime", feeInfo.getConfigEndTime()); |
| | | } |
| | | } |
| | | return paramInJson; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 添加物业费用 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param context 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject addFee(OwnerCarDto ownerCarDto, JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | public JSONObject addFee(OwnerCarDto ownerCarDto, JSONObject paramInJson, ICmdDataFlowContext context) { |
| | | String time = DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A); |
| | | if (paramInJson.containsKey("startTime")) { |
| | | time = paramInJson.getString("startTime"); |
| | | } |
| | | 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); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.put("feeId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_feeId)); |
| | | businessUnit.put("configId", paramInJson.getString("configId")); |
| | |
| | | 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); |
| | | businessUnit.put("userId", context.getReqHeaders().get(CommonConstant.HTTP_USER_ID)); |
| | | paramInJson.put("feeId", businessUnit.getString("feeId")); |
| | | return business; |
| | | return businessUnit; |
| | | } |
| | | |
| | | @Override |
| | |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject addRoomFee(RoomDto roomDto, JSONObject paramInJson, ICmdDataFlowContext dataFlowContext) { |
| | | public JSONObject addRoomFee(RoomDto roomDto, JSONObject paramInJson, ICmdDataFlowContext dataFlowContext) { |
| | | String time = DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A); |
| | | if (paramInJson.containsKey("feeEndDate")) { |
| | | time = paramInJson.getString("feeEndDate"); |
| | |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public JSONObject addContractFee(ContractDto contractDto, JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | public JSONObject addContractFee(ContractDto contractDto, JSONObject paramInJson, ICmdDataFlowContext dataFlowContext) { |
| | | 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"); |
| | | } |
| | | 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); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.put("feeId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_feeId)); |
| | | businessUnit.put("configId", paramInJson.getString("configId")); |
| | | 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("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); |
| | | businessUnit.put("userId", paramInJson.getString("userId")); |
| | | paramInJson.put("feeId", businessUnit.getString("feeId")); |
| | | return business; |
| | | return businessUnit; |
| | | } |
| | | |
| | | /** |