chengf
2026-03-11 b88a288f4f787b509463678e3cd9ccfa3f37014b
service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java
@@ -90,7 +90,7 @@
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        if (reqJson.containsKey("roomNum") && !StringUtil.isEmpty(reqJson.getString("roomNum"))) {
            String[] roomNums = reqJson.getString("roomNum").split("-");
            if (roomNums == null || roomNums.length != 3) {
            if (roomNums.length != 3) {
                throw new IllegalArgumentException("房屋编号格式不对!");
            }
            RoomDto roomDto = new RoomDto();
@@ -115,7 +115,7 @@
            ownerRoomRelDto.setRoomId(reqJson.getString("payerObjId"));
            ownerRoomRelDto.setOwnerId(reqJson.getString("ownerId"));
            List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelV1InnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
            if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) {
            if (ListUtil.isNull(ownerRoomRelDtos)) {
                ApiFeeVo apiFeeVo = new ApiFeeVo();
                apiFeeVo.setTotal(0);
                apiFeeVo.setRecords((int) Math.ceil((double) 0 / (double) reqJson.getInteger("row")));
@@ -124,12 +124,28 @@
                cmdDataFlowContext.setResponseEntity(responseEntity);
            }
        }
        if(reqJson.containsKey("isContractFee")){
            feeDto.setContractFee(reqJson.getString("payerObjId"));
            feeDto.setPayerObjId(null);
        }
        if(reqJson.containsKey("contractId")){
            feeDto.setContractFee(reqJson.getString("contractId"));
        }
        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) {
                apiFeeDataVo.setStartTime(apiFeeDataVo.getStartTime() == null ? null : apiFeeDataVo.getStartTime().split(" ")[0]);
                apiFeeDataVo.setEndTime(apiFeeDataVo.getEndTime() == null ? null : apiFeeDataVo.getEndTime().split(" ")[0]);
                apiFeeDataVo.setMaxEndTime(apiFeeDataVo.getMaxEndTime() == null ? null : apiFeeDataVo.getMaxEndTime().split(" ")[0]);
                apiFeeDataVo.setDeadlineTime(apiFeeDataVo.getDeadlineTime() == null ? null : apiFeeDataVo.getDeadlineTime().split(" ")[0]);
                //计算monthCount
                //计算MaxEndTime和endTime之间的月数
                int monthCount = DateUtil.calculateMonths(apiFeeDataVo.getEndTime(), apiFeeDataVo.getMaxEndTime());
                apiFeeDataVo.setMonthCount(monthCount);
                //获取付费对象类型
                String payerObjType = apiFeeDataVo.getPayerObjType();
                if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(payerObjType)) {
@@ -183,7 +199,7 @@
        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) {
@@ -191,7 +207,7 @@
            unitDto.setFloorId(floor.getFloorId());
            unitDto.setUnitNum(unitNum);
            List<UnitDto> unitDtos = unitInnerServiceSMOImpl.queryUnits(unitDto);
            if (unitDtos == null || unitDtos.size() < 1) {
            if (ListUtil.isNull(unitDtos)) {
                continue;
            }
            for (UnitDto unit : unitDtos) {
@@ -217,7 +233,7 @@
    }
    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);
@@ -281,6 +297,9 @@
                Integer.parseInt(feeDto.getDecimalPlace())));
        BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
        curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth));
        if (curFeePrice.doubleValue() == -1) {
            curFeePrice = BigDecimal.valueOf(0);
        }
        feeDto.setAmountOwed(MoneyUtil.computePriceScale(curFeePrice.doubleValue(), feeDto.getScale(), Integer.parseInt(feeDto.getDecimalPlace())) + "");
        //动态费用
        if ("4004".equals(computingFormula)