Beispiel #1
0
def get_month_bill_status():
    """
    获取当前年的有无费用
    :return:
    """
    args = request.args
    house_info_id = args.get("house_code")
    current_time = time.localtime()
    current_year = current_time.tm_year
    current_mon = current_time.tm_mon
    monthList = [str(current_year) + "%02d" % mon + "0" for mon in range(1, 13)]

    fees = HouseFee.get_year_fees(house_info_id=house_info_id)
    for fee in fees:
        index = fee.month - 1
        monthList[index] = str(current_year) + "%02d" % fee.month + "1"

    ret = {
        "retCode": "0000",
        "retMst": "",
        "monthList": monthList,
        "currentMon": str(current_year) + "%02d" % current_mon,
    }

    return jsonify(ret)