| | |
| | | Date preEndTime = preEndTimeCal.getTime(); |
| | | |
| | | //todo 当前费用为一次性费用 |
| | | Date maxEndTime = feeDto.getConfigEndTime(); |
| | | Date maxEndTime = feeDto.getDeadlineTime(); |
| | | if (maxEndTime == null) { |
| | | maxEndTime = feeDto.getConfigEndTime(); |
| | | } |
| | | if (FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) { |
| | | //先取 deadlineTime |
| | | if (feeDto.getDeadlineTime() != null) { |
| | |
| | | if (StringUtil.isNumber(feeDto.getMonthCycle())) { |
| | | oweMonth = Integer.parseInt(feeDto.getMonthCycle()); |
| | | } |
| | | |
| | | } else if (FeeDto.FEE_FLAG_CYCLE_ONCE.equals(feeDto.getFeeFlag())) { |
| | | if (feeDto.getDeadlineTime() != null) { |
| | | maxEndTime = feeDto.getDeadlineTime(); |
| | | } |
| | | } else { |
| | | Date billEndTime = DateUtil.getCurrentDate(); |
| | | //建账时间 |
| | | Date startDate = feeDto.getStartTime(); |
| | |
| | | ) { |
| | | targetEndDate = getTargetEndTime((round + 1) * paymentCycle, startDate);//目标结束时间 |
| | | } |
| | | |
| | | |
| | | //todo 费用项的结束时间<缴费的结束时间 费用快结束了 取费用项的结束时间 |
| | | if (maxEndTime.getTime() < targetEndDate.getTime()) { |
| | |
| | | //说明欠费 |
| | | if (endDate.getTime() < targetEndDate.getTime()) { |
| | | // 目标到期时间 - 到期时间 = 欠费月份 |
| | | oweMonth = DateUtil.dayCompare(endDate, targetEndDate); |
| | | } |
| | | |
| | | if (feeDto.getEndTime().getTime() > targetEndDate.getTime()) { |
| | | targetEndDate = feeDto.getEndTime(); |
| | | } |
| | | } else { // todo 周期性费用 |
| | | //当前时间 |
| | | Date billEndTime = DateUtil.getCurrentDate(); |
| | | //建账时间 |
| | | Date startDate = feeDto.getStartTime(); |
| | | //计费起始时间 |
| | | Date endDate = feeDto.getEndTime(); |
| | | //缴费周期 |
| | | long paymentCycle = Long.parseLong(feeDto.getPaymentCycle()); |
| | | // 当前时间 - 开始时间 = 月份 |
| | | double mulMonth = 0.0; |
| | | mulMonth = DateUtil.dayCompare(startDate, billEndTime); |
| | | |
| | | // 月份/ 周期 = 轮数(向上取整) |
| | | double round = 0.0; |
| | | if ("1200".equals(feeDto.getPaymentCd())) { // 1200预付费 |
| | | round = Math.floor(mulMonth / paymentCycle) + 1; |
| | | } else { //2100后付费 |
| | | round = Math.floor(mulMonth / paymentCycle); |
| | | } |
| | | // 轮数 * 周期 * 30 + 开始时间 = 目标 到期时间 |
| | | targetEndDate = getTargetEndTime(round * paymentCycle, startDate);//目标结束时间 |
| | | |
| | | //todo 如果 到了 预付期 产生下个周期的费用 |
| | | if (DateUtil.getFormatTimeStringB(targetEndDate).equals(DateUtil.getFormatTimeStringB(endDate)) |
| | | && DateUtil.getCurrentDate().getTime() > preEndTime.getTime() |
| | | ) { |
| | | targetEndDate = getTargetEndTime((round + 1) * paymentCycle, startDate);//目标结束时间 |
| | | } |
| | | |
| | | //费用项的结束时间<缴费的结束时间 费用快结束了 取费用项的结束时间 |
| | | if (maxEndTime.getTime() < targetEndDate.getTime()) { |
| | | targetEndDate = maxEndTime; |
| | | } |
| | | //说明欠费 |
| | | if (endDate.getTime() < targetEndDate.getTime()) { |
| | | // 目标到期时间 - 到期时间 = 欠费月份 |
| | | oweMonth = DateUtil.dayCompare(endDate, targetEndDate); |
| | | oweMonth = DateUtil.dayCompare(endDate, targetEndDate, true); |
| | | } |
| | | |
| | | if (feeDto.getEndTime().getTime() > targetEndDate.getTime()) { |
| | |
| | | /** |
| | | * 修正递增 开始时间 |
| | | * 如果设置的 递增开始时间和建账时间不是同一天 强制修正下 |
| | | * |
| | | * @param rateStartTime |
| | | * @param startTime |
| | | * @return |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public static double dayCompare(Date fromDate, Date toDate){ |
| | | return dayCompare(fromDate,toDate,false); |
| | | } |
| | | |
| | | /** |
| | | * 计算 fromDate 2023-01-12 toDate 2023-09-15 |
| | |
| | | * @param toDate |
| | | * @return |
| | | */ |
| | | public static double dayCompare(Date fromDate, Date toDate) { |
| | | public static double dayCompare(Date fromDate, Date toDate,boolean plusOneSec) { |
| | | |
| | | if(plusOneSec){ |
| | | Calendar toD = Calendar.getInstance(); |
| | | toD.setTime(toDate); |
| | | toD.add(Calendar.SECOND,1); |
| | | toDate = toD.getTime(); |
| | | } |
| | | |
| | | |
| | | //todo 需要计算三端时间 相加即可 |
| | |
| | | cell0.setCellValue("费用名称: 请填写系统中费用类型,如物业费,押金等 ;\n计费起始时间: " + |
| | | "计费起始时间,格式为YYYY-MM-DD;\n计费结束时间,格式为YYYY-MM-DD;\n" + |
| | | "建账时间: 建账时间,格式为YYYY-MM-DD; \n 类型:表明是合同 房屋 还是车辆 房屋 1001 车辆 2002 合同 3003" + |
| | | "\n注意:所有单元格式为文本,计费结束时间只有一次性费用和间接性费用时需要填写"); |
| | | "\n注意:所有单元格式为文本"); |
| | | CellStyle cs = workbook.createCellStyle(); |
| | | cs.setWrapText(true); //关键 |
| | | cell0.setCellStyle(cs); |
| | |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.po.importFee.ImportFeePo; |
| | | import com.java110.po.importFee.ImportFeeDetailPo; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.utils.util.*; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import com.java110.core.log.LoggerFactory; |
| | |
| | | |
| | | List<ImportRoomFee> tmpImportRoomFees = importRoomFees.toJavaList(ImportRoomFee.class); |
| | | |
| | | if (tmpImportRoomFees == null || tmpImportRoomFees.size() < 1) { |
| | | if (ListUtil.isNull(tmpImportRoomFees)) { |
| | | throw new IllegalArgumentException("未包含导入费用"); |
| | | } |
| | | |
| | |
| | | feeConfigDto.setCommunityId(communityId); |
| | | List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); |
| | | // 根据费用大类 判断是否有存在 费用导入收入项 |
| | | if (feeConfigDtos == null || feeConfigDtos.size() < 1) { |
| | | |
| | | if (ListUtil.isNull(feeConfigDtos)) { |
| | | throw new IllegalArgumentException("费用项不存在"); |
| | | //生成导入费 |
| | | //feeConfigDto.setConfigId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_configId)); |
| | | //saveFeeConfig(feeConfigDto); |
| | | } else { |
| | | feeConfigDto.setConfigId(feeConfigDtos.get(0).getConfigId()); |
| | | } |
| | | feeConfigDto.setConfigId(feeConfigDtos.get(0).getConfigId()); |
| | | |
| | | for (ImportRoomFee tmpImportRoomFee : tmpImportRoomFees) { |
| | | tmpImportRoomFee.setCommunityId(communityId); |
| | |
| | | List<ImportFeeDetailPo> importFeeDetailPos = new ArrayList<>(); |
| | | PayFeePo payFeePo = null; |
| | | ImportFeeDetailPo importFeeDetailPo = null; |
| | | String endTime = ""; |
| | | for (ImportRoomFee importRoomFee : tmpImportRoomFees) { |
| | | if (StringUtil.isEmpty(importRoomFee.getRoomId()) || importRoomFee.getRoomId().startsWith("-") || |
| | | StringUtil.isEmpty(importRoomFee.getFloorNum()) || importRoomFee.getFloorNum().startsWith("-") || |
| | |
| | | errorCount++; |
| | | continue; |
| | | } |
| | | endTime = importRoomFee.getEndTime(); |
| | | if(!endTime.contains(":")){ |
| | | endTime += " 23:59:59"; |
| | | } |
| | | |
| | | successCount++; |
| | | payFeePo = new PayFeePo(); |
| | | payFeePo.setFeeId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_feeId, true)); |
| | |
| | | feeAttrPo.setCommunityId(communityId); |
| | | feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId, true)); |
| | | feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME); |
| | | feeAttrPo.setValue(importRoomFee.getEndTime()); |
| | | feeAttrPo.setValue(endTime); |
| | | feeAttrPo.setFeeId(payFeePo.getFeeId()); |
| | | feeAttrPos.add(feeAttrPo); |
| | | |
| | |
| | | List<ImportFeeDetailPo> importFeeDetailPos = new ArrayList<>(); |
| | | PayFeePo payFeePo = null; |
| | | ImportFeeDetailPo importFeeDetailPo = null; |
| | | String endTime = ""; |
| | | for (ImportRoomFee importCarFee : tmpImportCarFees) { |
| | | if (StringUtil.isEmpty(importCarFee.getCarId()) || importCarFee.getCarId().startsWith("-") || |
| | | StringUtil.isEmpty(importCarFee.getCarNum()) || importCarFee.getCarNum().startsWith("-") |
| | | ) { |
| | | errorCount++; |
| | | continue; |
| | | } |
| | | endTime = importCarFee.getEndTime(); |
| | | if(!endTime.contains(":")){ |
| | | endTime += " 23:59:59"; |
| | | } |
| | | successCount++; |
| | | payFeePo = new PayFeePo(); |
| | |
| | | feeAttrPo.setCommunityId(communityId); |
| | | feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); |
| | | feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME); |
| | | feeAttrPo.setValue(importCarFee.getEndTime()); |
| | | feeAttrPo.setValue(endTime); |
| | | feeAttrPo.setFeeId(payFeePo.getFeeId()); |
| | | feeAttrPos.add(feeAttrPo); |
| | | |
| | |
| | | |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | |
| | | if (feeDtos == null || feeDtos.size() < 1) { |
| | | if (ListUtil.isNull(feeDtos)) { |
| | | return ResultVo.success(); |
| | | } |
| | | String cycel = null; |
| | |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "未查到房屋信息,查询多条数据"); |
| | | } |
| | | roomDto = roomDtos.get(0); |
| | | feeDto.setPayerObjName(roomDto.getFloorNum() + "栋" + roomDto.getUnitNum() + "单元" + roomDto.getRoomNum() + "室"); |
| | | feeDto.setPayerObjName(roomDto.getFloorNum() + "-" + roomDto.getUnitNum() + "-" + roomDto.getRoomNum() ); |
| | | feeDto.setBuiltUpArea(roomDto.getBuiltUpArea()); |
| | | |
| | | } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//车位相关 |
| | |
| | | parkingSpaceDto.setCommunityId(feeDto.getCommunityId()); |
| | | parkingSpaceDto.setPsId(ownerCarDtos.get(0).getPsId()); |
| | | List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto); |
| | | if (parkingSpaceDtos == null || parkingSpaceDtos.size() < 1) { //数据有问题 |
| | | if (ListUtil.isNull(parkingSpaceDtos)) { //数据有问题 |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "未查到停车位信息,查询多条数据"); |
| | | } |
| | | ownerCarDto = ownerCarDtos.get(0); |
| | |
| | | int count = feeInnerServiceSMOImpl.queryFeesCount(feeDto); |
| | | if (count > 0) { |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);//查询费用项目 |
| | | computeFeePrice(feeDtos);//计算费用 |
| | | //todo 计算费用 |
| | | computeFeePrice(feeDtos); |
| | | List<ApiFeeDataVo> apiFeeDataVos = BeanConvertUtil.covertBeanList(feeDtos, ApiFeeDataVo.class); |
| | | for (ApiFeeDataVo apiFeeDataVo : apiFeeDataVos) { |
| | | //获取付费对象类型 |
| | |
| | | floorDto.setFloorNum(floorNum); |
| | | floorDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<FloorDto> floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto); |
| | | if (floorDtos == null || floorDtos.size() < 1) { |
| | | if (ListUtil.isNull(floorDtos)) { |
| | | return; |
| | | } |
| | | for (FloorDto floor : floorDtos) { |
| | |
| | | } |
| | | |
| | | private void computeFeePrice(List<FeeDto> feeDtos) { |
| | | if (feeDtos == null || feeDtos.isEmpty()) { |
| | | if (ListUtil.isNull(feeDtos)) { |
| | | return; |
| | | } |
| | | String val = CommunitySettingFactory.getValue(feeDtos.get(0).getCommunityId(), TOTAL_FEE_PRICE); |
| | |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.text.ParseException; |
| | |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区ID"); |
| | | Assert.hasKeyAndValue(reqJson, "configId", "未包含收费项目"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "开始时间不存在"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "结束时间不存在"); |
| | | |
| | | String endTime = reqJson.getString("endTime"); |
| | | if (!endTime.contains(":")) { |
| | | endTime += " 23:59:59"; |
| | | reqJson.put("endTime", endTime); |
| | | } |
| | | |
| | | FeeConfigDto feeConfigDto = new FeeConfigDto(); |
| | | feeConfigDto.setCommunityId(reqJson.getString("communityId")); |
| | |
| | | } |
| | | |
| | | JSONArray roomIds = reqJson.getJSONArray("roomIds"); |
| | | if (roomIds == null || roomIds.isEmpty()) { |
| | | if (ListUtil.isNull(roomIds)) { |
| | | throw new IllegalArgumentException("未包含房屋"); |
| | | } |
| | | //todo 不是周期性费用 endTime 必须存在 |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(feeConfigDtos.get(0).getFeeFlag())) { |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "结束时间不存在"); |
| | | Date endTime = null; |
| | | Date configEndTime = null; |
| | | endTime = DateUtil.getDateFromStringB(reqJson.getString("endTime")); |
| | | configEndTime = DateUtil.getDateFromStringA(feeConfigDtos.get(0).getEndTime()); |
| | | if (endTime.getTime() > configEndTime.getTime()) { |
| | | throw new IllegalArgumentException("结束时间不能超过费用项时间"); |
| | | } |
| | | } |
| | | |
| | | //todo 动态费用 |
| | |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | |
| | | //todo 生成批次 |
| | | generatorBatch(reqJson); |
| | | |
| | | |
| | | //todo 交给databus 异步方式处理,同步方式处理很容易超时 |
| | | dataBusInnerServiceSMOImpl.databusData(new DatabusDataDto(DatabusDataDto.BUSINESS_TYPE_ROOM_CREATE_PAY_FEE, reqJson)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 生成批次号 |
| | | * |
| | | * @param reqJson |
| | | */ |
| | | private void generatorBatch(JSONObject reqJson) { |
| | | PayFeeBatchPo payFeeBatchPo = new PayFeeBatchPo(); |
| | | payFeeBatchPo.setBatchId(GenerateCodeFactory.getGeneratorId("12")); |
| | | payFeeBatchPo.setCommunityId(reqJson.getString("communityId")); |
| | |
| | | } |
| | | |
| | | reqJson.put("batchId", payFeeBatchPo.getBatchId()); |
| | | |
| | | |
| | | //todo 交给databus 异步方式处理,同步方式处理很容易超时 |
| | | dataBusInnerServiceSMOImpl.databusData(new DatabusDataDto(DatabusDataDto.BUSINESS_TYPE_ROOM_CREATE_PAY_FEE, reqJson)); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.po.payFee.PayFeeBatchPo; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.utils.util.*; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | // super.validatePageInfo(pd); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区ID"); |
| | | Assert.hasKeyAndValue(reqJson, "configId", "未包含收费项目"); |
| | | //Assert.hasKeyAndValue(reqJson, "startTime", "未包含收费其实时间"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "未包含收费其实时间"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "未包含计费结束时间"); |
| | | |
| | | String endTime = reqJson.getString("endTime"); |
| | | if (!endTime.contains(":")) { |
| | | endTime += " 23:59:59"; |
| | | reqJson.put("endTime", endTime); |
| | | } |
| | | //Assert.hasKeyAndValue(reqJson, "billType", "未包含出账类型"); |
| | | //Assert.hasKeyAndValue(reqJson, "storeId", "未包含商户ID"); |
| | | } |
| | |
| | | for (int roomIndex = 0; roomIndex < contractDtos.size(); roomIndex++) { |
| | | curFailRoomCount++; |
| | | feePos.add(BeanConvertUtil.covertBean(feeBMOImpl.addContractFee(contractDtos.get(roomIndex), reqJson, context), PayFeePo.class)); |
| | | if (!StringUtil.isEmpty(contractDtos.get(roomIndex).getObjId())) { |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(reqJson.getString("feeFlag"))) { |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME, |
| | | reqJson.containsKey("endTime") ? reqJson.getString("endTime") : reqJson.getString("configEndTime"))); |
| | | } |
| | | reqJson.getString("endTime"))); |
| | | if (!StringUtil.isEmpty(contractDtos.get(roomIndex).getObjId())) { |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_ID, contractDtos.get(roomIndex).getObjId())); |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_LINK, contractDtos.get(roomIndex).getbLink())); |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_NAME, contractDtos.get(roomIndex).getPartyB())); |
| | | } |
| | | |
| | | //付费对象名称 |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_PAY_OBJECT_NAME, |
| | | contractDtos.get(roomIndex).getContractName())); |
| | |
| | | } |
| | | } |
| | | } |
| | | if (feePos != null && feePos.size() > 0) { |
| | | if (!ListUtil.isNull(feePos)) { |
| | | saveFlag = saveFeeAndAttrs(feePos, feeAttrsPos); |
| | | if (saveFlag < 1) { |
| | | failRooms += curFailRoomCount; |
| | |
| | | Assert.hasKeyAndValue(reqJson, "locationObjId", "未包含收费对象"); |
| | | Assert.hasKeyAndValue(reqJson, "configId", "未包含收费项目"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "未包含商户ID"); |
| | | //Assert.hasKeyAndValue(reqJson, "startTime", "未包含费用起始时间"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "未包含费用起始时间"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "未包含费用结束时间"); |
| | | |
| | | String endTime = reqJson.getString("endTime"); |
| | | if (!endTime.contains(":")) { |
| | | endTime += " 23:59:59"; |
| | | reqJson.put("endTime", endTime); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | reqJson.put("feeFlag", feeConfigDtos.get(0).getFeeFlag()); |
| | | reqJson.put("configEndTime", feeConfigDtos.get(0).getEndTime()); |
| | | |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(feeConfigDtos.get(0).getFeeFlag()) && reqJson.containsKey("endTime")) { |
| | | Date endTime = null; |
| | | Date configEndTime = null; |
| | | try { |
| | | endTime = DateUtil.getDateFromString(reqJson.getString("endTime"), DateUtil.DATE_FORMATE_STRING_B); |
| | | configEndTime = DateUtil.getDateFromString(feeConfigDtos.get(0).getEndTime(), DateUtil.DATE_FORMATE_STRING_A); |
| | | if (endTime.getTime() > configEndTime.getTime()) { |
| | | throw new IllegalArgumentException("结束时间不能超过费用项时间"); |
| | | } |
| | | } catch (ParseException e) { |
| | | throw new IllegalArgumentException("结束时间错误" + reqJson.getString("endTime")); |
| | | } |
| | | } |
| | | //生成批次 |
| | | generatorBatch(reqJson); |
| | | //判断收费范围 |
| | |
| | | for (int ownerCarIndex = 0; ownerCarIndex < ownerCarDtos.size(); ownerCarIndex++) { |
| | | curFailRoomCount++; |
| | | feePos.add(BeanConvertUtil.covertBean(feeBMOImpl.addFee(ownerCarDtos.get(ownerCarIndex), reqJson, context), PayFeePo.class)); |
| | | if (!StringUtil.isEmpty(ownerCarDtos.get(ownerCarIndex).getOwnerId())) { |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(reqJson.getString("feeFlag"))) { |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME, |
| | | reqJson.containsKey("endTime") ? reqJson.getString("endTime") : reqJson.getString("configEndTime"))); |
| | | } |
| | | reqJson.getString("endTime"))); |
| | | if (!StringUtil.isEmpty(ownerCarDtos.get(ownerCarIndex).getOwnerId())) { |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_ID, ownerCarDtos.get(ownerCarIndex).getOwnerId())); |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_LINK, ownerCarDtos.get(ownerCarIndex).getLink())); |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_NAME, ownerCarDtos.get(ownerCarIndex).getOwnerName())); |
| | |
| | | Assert.hasKeyAndValue(reqJson, "locationObjId", "未包含收费对象"); |
| | | Assert.hasKeyAndValue(reqJson, "configId", "未包含收费项目"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "未包含商户ID"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "未包含计费起始时间"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "未包含计费结束时间"); |
| | | |
| | | String endTime = reqJson.getString("endTime"); |
| | | if (!endTime.contains(":")) { |
| | | endTime += " 23:59:59"; |
| | | reqJson.put("endTime", endTime); |
| | | } |
| | | |
| | | FeeConfigDto feeConfigDto = new FeeConfigDto(); |
| | | feeConfigDto.setCommunityId(reqJson.getString("communityId")); |
| | |
| | | reqJson.put("feeTypeCd", feeConfigDtos.get(0).getFeeTypeCd()); |
| | | reqJson.put("feeFlag", feeConfigDtos.get(0).getFeeFlag()); |
| | | reqJson.put("configEndTime", feeConfigDtos.get(0).getEndTime()); |
| | | |
| | | |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(feeConfigDtos.get(0).getFeeFlag()) && reqJson.containsKey("endTime")) { |
| | | Date endTime = null; |
| | | Date configEndTime = null; |
| | | |
| | | endTime = DateUtil.getDateFromStringB(reqJson.getString("endTime")); |
| | | configEndTime = DateUtil.getDateFromStringA(feeConfigDtos.get(0).getEndTime()); |
| | | if (endTime.getTime() > configEndTime.getTime()) { |
| | | throw new IllegalArgumentException("结束时间不能超过费用项时间"); |
| | | } |
| | | } |
| | | |
| | | if (FeeConfigDto.COMPUTING_FORMULA_RANT_RATE.equals(feeConfigDtos.get(0).getComputingFormula())) { |
| | | Assert.hasKeyAndValue(reqJson, "rateCycle", "未包含递增周期"); |
| | |
| | | return; |
| | | } |
| | | |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, |
| | | context, |
| | | FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME, |
| | | reqJson.getString("endTime"))); |
| | | |
| | | if (!StringUtil.isEmpty(roomDto.getOwnerId())) { |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(reqJson.getString("feeFlag"))) { |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME, reqJson.containsKey("endTime") ? reqJson.getString("endTime") : reqJson.getString("configEndTime"))); |
| | | } |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_ID, roomDto.getOwnerId())); |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_LINK, roomDto.getLink())); |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_NAME, roomDto.getOwnerName())); |
| | |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含开始时间"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含结束时间"); |
| | | |
| | | String endTime = reqJson.getString("endTime"); |
| | | if (!endTime.contains(":")) { |
| | | endTime += " 23:59:59"; |
| | | reqJson.put("endTime", endTime); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | JSONObject data = JSONObject.parseObject(assetImportLogDetailDto.getContent()); |
| | | ImportCustomCreateFeeDto importExportMeterWaterDto = BeanConvertUtil.covertBean(data, ImportCustomCreateFeeDto.class); |
| | | |
| | | //todo 处理结束时间 |
| | | if (!importExportMeterWaterDto.getEndTime().contains(":")) { |
| | | importExportMeterWaterDto.setEndTime(importExportMeterWaterDto.getEndTime() + " 23:59:59"); |
| | | } |
| | | |
| | | String communityId = importExportMeterWaterDto.getCommunityId(); |
| | | String batchId = importExportMeterWaterDto.getBatchId(); |
| | | |
| | |
| | | cell0.setCellValue("费用名称: 请填写系统中费用类型,如物业费,押金等 ;\n计费起始时间: " + |
| | | "计费起始时间,格式为YYYY-MM-DD;\n计费结束时间,格式为YYYY-MM-DD;\n" + |
| | | "建账时间: 建账时间,格式为YYYY-MM-DD; \n 类型:表明是合同 房屋 还是车辆 房屋 1001 车辆 2002 合同 3003" + |
| | | "\n注意:所有单元格式为文本,计费结束时间只有一次性费用和间接性费用时需要填写"); |
| | | "\n注意:所有单元格式为文本"); |
| | | CellStyle cs = workbook.createCellStyle(); |
| | | cs.setWrapText(true); //关键 |
| | | cell0.setCellStyle(cs); |
| | |
| | | tmpImportRoomFees = new ArrayList<>(); |
| | | } |
| | | } |
| | | if (tmpImportRoomFees != null && tmpImportRoomFees.size() > 0) { |
| | | |
| | | if (!ListUtil.isNull(tmpImportRoomFees)) { |
| | | createRoomFee(pd, tmpImportRoomFees, data, paramOut); |
| | | } |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "成功:" + paramOut.getString("successCount") + ",失败:" + paramOut.getString("errorCount")); |