| | |
| | | import com.java110.core.smo.IComputeFeeSMO; |
| | | import com.java110.dto.RoomDto; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.contract.ContractDto; |
| | | import com.java110.dto.contractRoom.ContractRoomDto; |
| | | import com.java110.dto.fee.*; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | |
| | | import com.java110.intf.community.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.intf.store.IContractInnerServiceSMO; |
| | | import com.java110.intf.store.IContractRoomInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private IContractRoomInnerServiceSMO contractRoomInnerServiceSMOImpl; |
| | | |
| | | @Autowired(required = false) |
| | | private IContractInnerServiceSMO contractInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public Date getFeeEndTime() { |
| | |
| | | computeFeePriceByRoom(feeDto, roomDto); |
| | | } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//车位相关 |
| | | computeFeePriceByParkingSpace(feeDto); |
| | | }else if(FeeDto.PAYER_OBJ_TYPE_CONTRACT.equals(feeDto.getPayerObjType())) { //房屋相关 |
| | | } else if (FeeDto.PAYER_OBJ_TYPE_CONTRACT.equals(feeDto.getPayerObjType())) { //房屋相关 |
| | | computeFeePriceByContract(feeDto, roomDto); |
| | | } |
| | | } |
| | |
| | | feeDto.setDeadlineTime(targetEndDate); |
| | | |
| | | //动态费用 |
| | | if ("4004".equals(computingFormula) && !FeeDto.STATE_FINISH.equals(feeDto.getState())) { |
| | | if ("4004".equals(computingFormula) |
| | | && FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) |
| | | && !FeeDto.STATE_FINISH.equals(feeDto.getState())) { |
| | | feeDto.setAmountOwed(feeDto.getFeePrice() + ""); |
| | | //feeDto.setDeadlineTime(DateUtil.getCurrentDate()); 欠费日期不对先注释 |
| | | } |
| | |
| | | feeDto.setDeadlineTime(targetEndDate); |
| | | |
| | | //动态费用 |
| | | if ("4004".equals(computingFormula) && !FeeDto.STATE_FINISH.equals(feeDto.getState())) { |
| | | if ("4004".equals(computingFormula) |
| | | && FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) |
| | | && !FeeDto.STATE_FINISH.equals(feeDto.getState())) { |
| | | feeDto.setAmountOwed(feeDto.getFeePrice() + ""); |
| | | //feeDto.setDeadlineTime(DateUtil.getCurrentDate()); 欠费日期不对先注释 |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据房屋来算单价 |
| | | * |
| | |
| | | feeDto.setDeadlineTime(targetEndDate); |
| | | |
| | | //动态费用 |
| | | if ("4004".equals(computingFormula) && !FeeDto.STATE_FINISH.equals(feeDto.getState())) { |
| | | if ("4004".equals(computingFormula) |
| | | && FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) |
| | | && !FeeDto.STATE_FINISH.equals(feeDto.getState())) { |
| | | feeDto.setAmountOwed(feeDto.getFeePrice() + ""); |
| | | //feeDto.setDeadlineTime(DateUtil.getCurrentDate()); 欠费日期不对先注释 |
| | | } |
| | |
| | | } else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feeReceiptDetailPo.setArea(roomDtos.get(0).getBuiltUpArea()); |
| | | feeReceiptDetailPo.setSquarePrice(feeDto.getComputingFormulaText()); |
| | | }else if ("9009".equals(computingFormula)) { |
| | | if (StringUtil.isEmpty(feeDto.getCurDegrees())) { |
| | | } else { |
| | | BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees())); |
| | | BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees())); |
| | | BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | feeReceiptDetailPo.setArea(sub.doubleValue() + ""); |
| | | feeReceiptDetailPo.setSquarePrice(feeDto.getMwPrice() + "/" + feeDto.getAdditionalAmount()); |
| | | } |
| | | } else { |
| | | } |
| | | } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//车位相关 |
| | |
| | | } |
| | | feeReceiptDetailPo.setArea(parkingSpaceDtos.get(0).getArea()); |
| | | feeReceiptDetailPo.setSquarePrice(feeDto.getComputingFormulaText()); |
| | | } else { |
| | | } else if ("9009".equals(computingFormula)) { |
| | | if (StringUtil.isEmpty(feeDto.getCurDegrees())) { |
| | | } else { |
| | | BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees())); |
| | | BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees())); |
| | | BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | feeReceiptDetailPo.setArea(sub.doubleValue() + ""); |
| | | feeReceiptDetailPo.setSquarePrice(feeDto.getMwPrice() + "/" + feeDto.getAdditionalAmount()); |
| | | } |
| | | }else { |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | roomDto = roomDtos.get(0); |
| | | if (RoomDto.ROOM_TYPE_ROOM.equals(roomDto.getRoomType())) { |
| | | objName = roomDto.getFloorNum() + "栋" + roomDto.getUnitNum() + "单元" + roomDto.getRoomNum() + "室"; |
| | | objName = roomDto.getFloorNum() + "-" + roomDto.getUnitNum() + "-" + roomDto.getRoomNum(); |
| | | } else { |
| | | objName = roomDto.getFloorNum() + "栋" + roomDto.getRoomNum() + "室"; |
| | | objName = roomDto.getFloorNum() + "-" + roomDto.getRoomNum(); |
| | | } |
| | | } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//车位相关 |
| | | |
| | |
| | | return objName; |
| | | } |
| | | objName = objName + "(" + parkingSpaceDtos.get(0).getAreaNum() + "停车场" + parkingSpaceDtos.get(0).getNum() + "车位)"; |
| | | } else if (FeeDto.PAYER_OBJ_TYPE_CONTRACT.equals(feeDto.getPayerObjType())) { |
| | | ContractDto contractDto = new ContractDto(); |
| | | contractDto.setContractId(feeDto.getPayerObjId()); |
| | | contractDto.setCommunityId(feeDto.getCommunityId()); |
| | | List<ContractDto> contractDtos = contractInnerServiceSMOImpl.queryContracts(contractDto); |
| | | if (contractDtos == null || contractDtos.size() < 1) { //数据有问题 |
| | | return objName; |
| | | } |
| | | objName = contractDtos.get(0).getContractCode(); |
| | | |
| | | } |
| | | return objName; |
| | | } |
| | |
| | | Assert.listOnlyOne(ownerCarDtos, "车辆不存在"); |
| | | ownerDto = new OwnerDto(); |
| | | ownerDto.setOwnerId(ownerCarDtos.get(0).getOwnerId()); |
| | | ownerDto.setCommunityId(feeDto.getCommunityId()); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto); |
| | | Assert.listOnlyOne(ownerDtos, "业主不存在"); |
| | | return ownerDtos.get(0); |
| | | } |
| | | |
| | | if (FeeDto.PAYER_OBJ_TYPE_CONTRACT.equals(feeDto.getPayerObjType())) { |
| | | ContractDto contractDto = new ContractDto(); |
| | | contractDto.setContractId(feeDto.getPayerObjId()); |
| | | contractDto.setCommunityId(feeDto.getCommunityId()); |
| | | List<ContractDto> contractDtos = contractInnerServiceSMOImpl.queryContracts(contractDto); |
| | | |
| | | Assert.listOnlyOne(contractDtos, "合同不存在"); |
| | | ownerDto = new OwnerDto(); |
| | | ownerDto.setOwnerId(contractDtos.get(0).getObjId()); |
| | | ownerDto.setCommunityId(feeDto.getCommunityId()); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto); |
| | | Assert.listOnlyOne(ownerDtos, "业主不存在"); |
| | |
| | | continue; |
| | | } |
| | | if (tmpRoomDto.getRoomId().equals(feeDto.getPayerObjId())) { |
| | | objName = tmpRoomDto.getFloorNum() + "栋" + tmpRoomDto.getUnitNum() + "单元" + tmpRoomDto.getRoomNum() + "室"; |
| | | objName = tmpRoomDto.getFloorNum() + "-" + tmpRoomDto.getUnitNum() + "-" + tmpRoomDto.getRoomNum(); |
| | | feeDto.setPayerObjName(objName); |
| | | } |
| | | } |
| | |
| | | feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount())); |
| | | } else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feePrice = computeRoomCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class), BeanConvertUtil.covertBean(reportRoomDto, RoomDto.class)); |
| | | }else if ("9009".equals(computingFormula)) { |
| | | if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) { |
| | | //throw new IllegalArgumentException("抄表数据异常"); |
| | | } else { |
| | | BigDecimal curDegree = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getCurDegrees())); |
| | | BigDecimal preDegree = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getPreDegrees())); |
| | | BigDecimal squarePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getMwPrice())); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount())); |
| | | BigDecimal sub = curDegree.subtract(preDegree); |
| | | feePrice = sub.multiply(squarePrice) |
| | | .add(additionalAmount) |
| | | .setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | |
| | | feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount())); |
| | | } else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feePrice = computeCarCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class), BeanConvertUtil.covertBean(reportCarDto, OwnerCarDto.class)); |
| | | }else if ("9009".equals(computingFormula)) { |
| | | if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) { |
| | | throw new IllegalArgumentException("抄表数据异常"); |
| | | } else { |
| | | BigDecimal curDegree = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getCurDegrees())); |
| | | BigDecimal preDegree = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getPreDegrees())); |
| | | BigDecimal squarePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getMwPrice())); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount())); |
| | | BigDecimal sub = curDegree.subtract(preDegree); |
| | | feePrice = sub.multiply(squarePrice) |
| | | .add(additionalAmount) |
| | | .setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | |
| | | feePrice = computeRoomCustomizeFormula(feeDto, roomDto); |
| | | } else if ("8008".equals(computingFormula)) { //手动动态费用 |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | } else if ("9009".equals(computingFormula)) { //(本期度数-上期度数)*动态单价+附加费 |
| | | if (StringUtil.isEmpty(feeDto.getCurDegrees())) { |
| | | //throw new IllegalArgumentException("抄表数据异常"); |
| | | } else { |
| | | BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees())); |
| | | BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees())); |
| | | BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getMwPrice())); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | BigDecimal sub = curDegree.subtract(preDegree); |
| | | feePrice = sub.multiply(squarePrice) |
| | | .add(additionalAmount) |
| | | .setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | } else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feePrice = computeCarCustomizeFormula(feeDto, ownerCarDtos.get(0)); |
| | | } else if ("9009".equals(computingFormula)) { //(本期度数-上期度数)*动态单价+附加费 |
| | | if (StringUtil.isEmpty(feeDto.getCurDegrees())) { |
| | | //throw new IllegalArgumentException("抄表数据异常"); |
| | | } else { |
| | | BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees())); |
| | | BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees())); |
| | | BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getMwPrice())); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | BigDecimal sub = curDegree.subtract(preDegree); |
| | | feePrice = sub.multiply(squarePrice) |
| | | .add(additionalAmount) |
| | | .setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | |
| | | } else if ("2002".equals(computingFormula)) { // 固定费用 |
| | | //feePrice = Double.parseDouble(feeDto.getAdditionalAmount()); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | BigDecimal roomDount = new BigDecimal(contractRoomDtos.size()); |
| | | additionalAmount = additionalAmount.multiply(roomDount); |
| | | // BigDecimal roomDount = new BigDecimal(contractRoomDtos.size()); |
| | | // additionalAmount = additionalAmount.multiply(roomDount); |
| | | feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN); |
| | | } else if ("4004".equals(computingFormula)) { //动态费用 |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | |
| | | feePrice = computeContractCustomizeFormula(feeDto, contractRoomDtos); |
| | | } else if ("8008".equals(computingFormula)) { //手动动态费用 |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | } else if ("9009".equals(computingFormula)) { //(本期度数-上期度数)*动态单价+附加费 |
| | | if (StringUtil.isEmpty(feeDto.getCurDegrees())) { |
| | | //throw new IllegalArgumentException("抄表数据异常"); |
| | | } else { |
| | | BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees())); |
| | | BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees())); |
| | | BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getMwPrice())); |
| | | BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); |
| | | BigDecimal sub = curDegree.subtract(preDegree); |
| | | feePrice = sub.multiply(squarePrice) |
| | | .add(additionalAmount) |
| | | .setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |