Example #1
0
 def modifiApartmentRentPrice(self, rentPrice):
     url = 'isz_house/ApartmentController/confirmApatmentRentPricing.action'
     data = {
         'apartment_id': self.apartment_id,
         'rent_price': str(rentPrice)
     }
     myRequest(url, data)
Example #2
0
 def receiptAndAudit(self):
     """
     出租合同实收及实收的审核
     :return: 完成所有实收和审核
     """
     url = 'isz_finance/ApartmentContractReceiptsController/saveOrUpdateNewReceipts.action'
     receivables = self.receivables()
     i = 0
     consoleLog("共有%s条应收待实收" % len(receivables))
     for receivable in receivables:
         i = i + 1
         data = {
             'alipay_card': '0011',  # 支付宝账号
             'company': self.sign_body,  # 收款公司
             'contract_id': self.apartment_contract_id,
             'operation_total': receivable.receivable_money,  # 转账总金额
             'receipts_date': datetimes.today(),  # 收款日期
             'receipts_type': 'ALIPAY',  # 收款方式:支付宝转账
             'receipts_money': receivable.receivable_money,  # 收款金额
             'receivable_id': receivable.receivable_id  # 应收ID
         }
         # 实收
         result = myRequest(url, data)
         if result:
             # 审核
             consoleLog("实收第%s条完成" % i)
             myRequest(
                 url=
                 'isz_finance/ApartmentContractReceiptsController/endReceivable.action',
                 data={'receivable_id': receivable.receivable_id})
             consoleLog("审核第%s条完成" % i)
         else:
             break
Example #3
0
def test():
    """名称描述"""
    searchSQl = "select verify_id from isz_erp_finance.house_charge_account_verify where account_identify='UNKNOW' and deleted=0"
    result = Mysql().getAll(searchSQl)
    url = "http://rsm.ishangzu.com/isz_balanceofaccount/HouseChargeAccountController/account/officialAddress/{}"
    for index, item in enumerate(result):
        try:
            newUrl = url.format(item)
            myRequest(newUrl, method='put')
            consoleLog("{}:verify_id:{}已调浦发接口查询".format(index + 1, item))
            time.sleep(1)
        except Exception as e:
            consoleLog(e.message)
Example #4
0
 def end(self):
     """提交终止结算"""
     if not HouseContractEndInfo(self.house_contract_id).house_contract_end_info:
         self.audit('fushen')
         url = "http://erp.ishangzu.com/isz_housecontract/houseContractEndController/saveHouseContractEnd"
         end_contract_num = 'End-%s' % self.house_contract_num
         endBase = self.__getEndBase()
         endBase['end_contract_num'] = end_contract_num
         endBase['end_date'] = '%s 00:00:00' % time.strftime('%Y-%m-%d')
         endBase['contractImgList'] = [{
             "src": "http://img.ishangzu.com/erp/2018/4/19/17/ceed711b-aa91-4516-90be-71ea08eaafd3.png",
             "url": "http://img.ishangzu.com/erp/2018/4/19/17/ceed711b-aa91-4516-90be-71ea08eaafd3.png",
             "type": "",
             "img_id": "FF80808162D81DCB0162DD4C8B3500DD"
         }]
         endBase['pay_bank'] = self.account_bank
         endBase['pay_bank_no'] = self.account_num
         endBase['pay_object'] = self.pay_object
         endBase['payable_date'] = '%s 00:00:00' % time.strftime('%Y-%m-%d')
         endBase['receivable_date'] = '%s 00:00:00' % time.strftime('%Y-%m-%d')
         endBase['pay_name'] = self.account_name
         endBase['pay_type'] = 'OWNER'
         endBase['end_type'] = 'OWNER_DEFAULT'  # CORPORATE_DEFAULT
         result = myRequest(url, endBase)
         if result:
             consoleLog('委托合同 "%s" 已提交终止结算' % self.house_contract_num)
     else:
         consoleLog('委托合同 "%s",已经终止' % self.house_contract_num)
     return HouseContractEnd(self.house_contract_id)
Example #5
0
def creatResidential(cityCode=None, residentialName=None):
    url = 'isz_house/ResidentialController/saveResidential.action'
    residentialName = residentialName if residentialName else u"XX苏州测试楼盘"  # + '-' + time.strftime('%m%d-%H%M%S')
    sql = "SELECT sd.parent_id FROM sys_department sd INNER JOIN sys_user sur ON sur.dep_id = sd.dep_id INNER JOIN sys_position spt ON spt.position_id = sur.position_id " \
          "WHERE sd.dep_district = 320500 AND sd.is_active='Y' AND sd.dep_id <> '00000000000000000000000000000000' AND (spt.position_name LIKE '资产管家%' OR spt.position_name LIKE '综合管家%') AND sd.dep_name NOT LIKE '%培训%'" \
          "ORDER BY RAND() LIMIT 1"
    dutyDepID = sqlbase.serach(sql)[0]
    data = {
        "residential_name": residentialName,
        "residential_jianpin": "auto",
        "city_code": city_code if not cityCode else cityCode,
        "area_code": area_code,
        "taBusinessCircleString": taBusinessCircleString,
        "address": "autoTest",
        "gd_lng": "120.138631",
        "gd_lat": "30.186537",
        "property_type": "ordinary",
        "taDepartString": dutyDepID,
        "byname": "auto"
    }
    result = myRequest(url, data)
    if result:
        sql = "SELECT residential_id from residential where residential_name = '%s' and deleted=0" % residentialName.encode(
            'utf-8')
        residentialID = sqlbase.serach(sql)[0]
        residential = {
            'residentialName': residentialName,
            'residentialID': residentialID,
            'dutyDepID': dutyDepID
        }
        consoleLog(u'楼盘‘%s’创建成功' % residentialName)
        return residential
Example #6
0
        def auditBase(page, auditAction):
            url = 'http://erp.ishangzu.com/isz_housecontract/houseContractController/saveOrUpdateHouseContractDetailByPart'
            url_audit = 'http://erp.ishangzu.com/isz_housecontract/houseContractController/houseContractAudit'
            page_Data = {
                'auditForm': {
                    'audit_status': auditStatus_Par[auditAction],
                    'content': '同意!'
                },
                'action_type': 'AUDIT',
                step_Par[page]: contractInfo[step_Par[page]],
                'save_part': page,
                'contract_id': self.house_contract_id
            }
            data_FIVE = {
                "audit_status": auditStatus_Par[auditAction],
                "content": "合同内容、资料、备件无误,正常审核通过。同意!",
                "contract_id": self.house_contract_id,
                "is_normal_approved": "0"

            }
            page_Data = data_FIVE if page == 'FIVE' else page_Data
            url = url_audit if page == 'FIVE' else url
            method = 'put' if page == 'FIVE' else 'post'
            result = myRequest(url, page_Data, method=method)
            if result:
                # consoleLog(u'HOUSE CONTRACT STEP *%s* %s SUCCESS' % (page, auditAction))
                return
            else:
                consoleLog(u'HOUSE CONTRACT STEP *%s* %s FAIL!!!' % (page, auditAction))
                quit()
Example #7
0
def creatFloor(count=5):
    url = 'isz_house/ResidentialBuildingController/saveResidentialBuildingFloor.action'
    unit = creatUnit()
    floors = []
    for i in range(count):
        residential = {}
        for key in unit.keys():
            residential[key] = unit[key]
        floorName = i + 1
        data = {
            "property_name":
            residential['residentialName'] + residential['buildingName'] +
            residential['unitName'],
            "floor_name":
            floorName,
            "unit_id":
            residential['unitID'],
            "building_id":
            residential['buildingID']
        }
        result = myRequest(url, data)
        if result:
            sql = "SELECT floor_id from residential_building_floor where building_id = '%s' and unit_id = '%s' order by CONVERT(floor_name,SIGNED)" % (
                residential['buildingID'], residential['unitID'])
            floorID = sqlbase.serach(sql, oneCount=False)[i]
            residential['floorID'] = floorID
            residential['floorName'] = floorName
            floors.append(residential)
    consoleLog(u'楼层全部创建成功')
    return floors
Example #8
0
def get_residentail_ratio(residential_id, rent_type):
    """获取楼盘房源标准价系数
    :param rent_type: 房源类型
    :param residential_id 楼盘id
    :return [{"apartment_id": 123,"ratio":1.023}]"""
    url = 'http://erp.ishangzu.com/isz_house/ResidentialStandardPriceController/selectModifyPriceApartmentList'
    data = {
        "residential_id": residential_id,
        "new_price": "4400",
        "rent_type": rent_type
    }
    apartmentList = myRequest(url, data)
    if not apartmentList:
        consoleLog('试算接口异常', 'e')
        return
    apartmentList = apartmentList.get('obj')
    coefficientResults = []
    for apartment in apartmentList:
        coefficientResult = {'apartment_id': apartment.get('apartment_id')}
        coefficientList = apartment.get('coefficientList')
        ratio = 1
        for coefficient in coefficientList:
            ratio = ratio * coefficient.get('detail').get('ratio_value')
        coefficientResult['ratio'] = '%.3f' % ratio
        coefficientResults.append(coefficientResult)
    return coefficientResults
Example #9
0
 def selectShareHouseDetail(self):
     url = '/isz_house/ApartmentController/selectShareHouseDetail.action'
     data = {
         "apartment_id": self.apartment_id
     }
     result = myRequest(url, data)
     if result:
         return result['obj']
Example #10
0
 def gethouseContractList(entrust_type, hosueInfo):
     """出租合同房屋信息"""
     url = 'isz_contract/ApartmentContractController/getHouseContractByHouseId.action'
     if entrust_type == 'ENTIRE':
         del hosueInfo['room_id']
     result = myRequest(url, hosueInfo)
     if result:
         data = delNull(result['obj'])
         return data
Example #11
0
 def cancel(self):
     url = 'http://rsm.ishangzu.com/isz_repair/RepairsController/order/%s/cancel' % self.order_id
     data = {
         'order_id': self.order_id,
         'reason': 'cancel by test',
         'update_time': '{}{}'.format(time.strftime('%Y-%m-%d %H:%M:%S'),
                                      '.0')
     }
     if myRequest(url, data, method='put'):
         consoleLog(u'订单:%s 已取消' % self.order_no)
Example #12
0
def addHouse():
    url = 'isz_house/HouseController/saveHouseDevelop.action'
    houses = creatHouseNum()
    houseIds = []
    for house in houses:
        residential = {}
        for key in house.keys():
            residential[key] = house[key]
        # personInfo = sqlbase.serach("select user_id,dep_id from sys_user where user_phone = '18815286582'")
        personInfo = userInfo
        data = {
            "residential_name_search": residential['residentialID'],
            "building_name_search": residential['buildingID'],
            "unit_search": residential['unitID'],
            "house_no_search": residential['houseNumID'],
            "residential_name": residential['residentialName'],
            "building_name": residential['buildingName'],
            "unit": residential['unitName'],
            "floor": residential['floorName'],
            "house_no": residential['houseNumName'],
            "residential_address": residential_address,
            "city_code": city_code,
            "area_code": area_code,
            "business_circle_id": "4",
            "contact": "test",
            "did": personInfo['did'],
            "uid": personInfo['uid'],
            "house_status": "WAITING_RENT",
            "category": "NOLIMIT",
            "source": "INTRODUCE",
            "rental_price": "2500.00",
            "rooms": "3",
            "livings": "1",
            "kitchens": "1",
            "bathrooms": "2",
            "balconys": "2",
            "build_area": "120",
            "orientation": "NORTH",
            "residential_id": residential['residentialID'],
            "building_id": residential['buildingID'],
            "unit_id": residential['unitID'],
            "floor_id": residential['floorID'],
            "house_no_id": residential['houseNumID'],
            "business_circle_name": business_circle_name,
            "contact_tel": "18815286582"
        }
        result = myRequest(url, data)
        if result:
            sql = "select house_develop_id from house_develop where house_no_id = '%s'" % residential[
                'houseNumID']
            houseDevelogID = sqlbase.serach(sql)[0]
            residential['houseDevelogID'] = houseDevelogID
            houseIds.append(residential)
    consoleLog(u'审核房源全部新增成功')
    return houseIds
Example #13
0
 def createReceivables(apartmentContractRentInfoList):
     """生成实收"""
     url = '/isz_contract/ApartmentContractController/createApartmentContractReceivable.action'
     result = myRequest(url, apartmentContractRentInfoList)
     if result:
         data = delNull(result['obj'])
         index = 0
         for x in data:
             x['edit'] = False
             x['rowIndex'] = index
             index += 1
         return data
Example #14
0
 def placeOrder(self):
     url = 'http://rsm.ishangzu.com/isz_repair/RepairsController/order/operation/FF8080816349F0F2016349FA50C10052'
     data = {
         "cooperation_type": "Y",  # 是否合作
         "supplier_id": "8A2152435BAF8739015BB39E767C007E",  # 供应商ID
         "order_status": "STAYDISTRIBUTION",  # 当前订单状态
         "remark": u'WFL下单',
         "order_id": self.order_id,
         "update_time": time.strftime('%Y-%m-%d %H:%M:%S')
     }
     if myRequest(url, data):
         consoleLog(u'维修订单:%s已下单,供应商为')
Example #15
0
 def createApartmentContractReceivable():
     """生成出租应收"""
     url = 'isz_contract/ApartmentContractController/createApartmentContractReceivable.action'
     requestPayload = data['apartmentContractRentInfoList']
     result = myRequest(url, requestPayload)
     if result:
         data['receivables'] = delNull(result['obj'])
         index = 0
         for x in data['receivables']:
             x['edit'] = False
             x['rowIndex'] = index
             index += 1
Example #16
0
 def searchApartmentContractDetail():
     """获取出租合同基础信息"""
     url = 'isz_contract/ApartmentContractController/searchApartmentContractDetail.action'
     requestPayload = {
         "apartment_id": self.apartment_id,
         "contract_type": "NEWSIGN"
     }
     result = myRequest(url, requestPayload)
     if result:
         content = delNull(result['obj']['apartmentContract'])
         for x, y in content.items():
             data[x] = y
Example #17
0
 def __cheackOnlineHouse(self):
     url = "/isz_house/onlineHouseController/checkOnlineHouseNew.action"
     data = {
         "apartment_id": self.apartment_id,
         "rent_type": self.rent_type
     }
     result = myRequest(url, data)
     if result['obj']['flag']:
         consoleLog(u'房源上架信息校验通过')
         return
     else:
         consoleLog(u'房源上架信息未完善')
Example #18
0
 def audit(activityId):
     """审核
     :param activityId 审核步骤ID
     """
     url = "http://erp.ishangzu.com/isz_contract/endAgreementControl/houseContractEndAudit.action"
     data = {
         "achieveid": self.end_id,
         "activityId": activityId,
         "content": "同意"
     }
     if myRequest(url, data):
         return True
Example #19
0
 def __saveHouseImage(self):
     houseImgList = self.selectApartmentDetail()['houseImgList']
     houseImgListNew = []
     if houseImgList:
         i = 0
         for houseImg in houseImgList:
             i = i + 1
             houseImgNew = {
                 "audit_status": houseImg['audit_status'],
                 "building_id": houseImg['building_id'],
                 "create_dep": houseImg['create_dep'],
                 "create_time": houseImg['create_time'],
                 "create_uid": houseImg['create_uid'],
                 "create_user": houseImg['create_user'],
                 "deleted": 0,
                 "house_id": houseImg['house_id'],
                 "house_img_id": houseImg['house_img_id'],
                 "img_id": houseImg['img_id'],
                 "img_type": houseImg['img_type'],
                 "residential_id": houseImg['residential_id'],
                 "sort": i,
                 "src": houseImg['src']
             }
             houseImgListNew.append(houseImgNew)
     else:
         for j in range(3):
             houseImgNew = {
                 "audit_status": "NO_AUDIT",
                 "building_id": self.building_id,
                 "create_dep": userInfo['dep_name'],
                 "create_time": time.strftime('%Y-%m-%d %H:%M:%S'),
                 "create_uid": userInfo['uid'],
                 "create_user": userInfo['user_name'],
                 "deleted": 0,
                 "house_id": self.house_id,
                 "house_img_id": houseImgList['house_img_id'],
                 "img_id": houseImgList['img_id'],
                 "img_type": "INDOOR_IMGS",
                 "residential_id": self.residential_id,
                 "sort": j + 1,
                 "src": houseImgList['src']
             }
             houseImgListNew.append(houseImgNew)
     url = "/isz_house/ApartmentController/saveHouseImage.action"
     data = {
         "houseImgList": houseImgList,
         "update_time": time.strftime('%Y-%m-%d %H:%M:%S'),
         "apartment_id": self.apartment_id
     }
     result = myRequest(url, data)
     if result:
         return
Example #20
0
 def audit(activityId):
     url = 'isz_contract/ApartmentContractController/apartmentContractAudit.action'
     data = {
         "achieveid": self.apartment_contract_id,
         "activityId": activityId,
         "content": "同意"
     }
     if myRequest(url, data):
         if activityId == '25':
             consoleLog('出租合同已初审')
             time.sleep(1)
         elif activityId == '22':
             consoleLog('出租合同已复审')
Example #21
0
 def endReceivable(receivable_id):
     """出租实收审核"""
     url = "/isz_finance/ApartmentContractReceiptsController/endReceivable.action"
     data = {"receivable_id": receivable_id}
     receivable = Receivable(receivable_id)
     contract_num = ApartmentContractInfo(
         receivable.contract_id).apartment_contract_num
     result = myRequest(url, data)
     if result and 'AUDITED' == receivable.end_status_now:
         consoleLog(u'出租合同 %s 实收 %s 审核完成' % (contract_num, receivable_id))
         time.sleep(1)
     else:
         consoleLog(u'出租合同 %s 实收 %s 审核失败' % (contract_num, receivable_id))
Example #22
0
 def createApartmentContract(data):
     """生成出租合同"""
     url = 'isz_contract/ApartmentContractController/saveOrUpdateApartmentContract.action'
     result = myRequest(url, data)
     if result:
         consoleLog('承租合同 %s 已创建完成' % data['contract_num'])
         apartmentContractInfo = {
             'contractID':
             sqlbase.serach(
                 "select contract_id from apartment_contract where contract_num = '%s'"
                 % data['contract_num'])[0],
             'contractNum':
             data['contract_num']
         }
         return apartmentContractInfo['contractID']
Example #23
0
def creatHouseNum(count=4):
    url = 'isz_house/ResidentialBuildingController/saveResidentialBuildingHouseNo.action'
    floors = creatFloor()
    houses = []
    for floor in floors:
        for i in range(count):
            residential = {}
            for key in floor.keys():
                residential[key] = floor[key]
            houseNumName = '%s0%s' % (residential['floorName'], i + 1)
            data = {
                "property_name":
                residential['residentialName'] + residential['buildingName'] +
                residential['unitName'] + str(residential['floorName']) + u'层',
                "rooms":
                "3",
                "livings":
                "1",
                "bathrooms":
                "2",
                "kitchens":
                "1",
                "balconys":
                "2",
                "build_area":
                "120.00",
                "orientation":
                "NORTH",
                "house_no":
                houseNumName,
                "unit_id":
                residential['unitID'],
                "building_id":
                residential['buildingID'],
                "floor_id":
                residential['floorID']
            }
            result = myRequest(url, data)
            if result:
                sql = "SELECT house_no_id from residential_building_house_no where building_id = '%s' and unit_id = '%s' and floor_id = '%s' order by CONVERT(house_no,SIGNED)" % \
                      (residential['buildingID'], residential['unitID'], residential['floorID'])
                houseNumID = sqlbase.serach(sql, oneCount=False)[i]
                residential['houseNumID'] = houseNumID
                residential['houseNumName'] = houseNumName
                houses.append(residential)
    consoleLog(u'房号全部新增成功')
    return houses
Example #24
0
 def receipt(self, receivable_id):
     """实收"""
     url = 'isz_finance/ApartmentContractReceiptsController/saveOrUpdateNewReceipts.action'
     receivables = self.receivables()
     for receivable in receivables:
         data = {
             'alipay_card': '0011',  # 支付宝账号
             'company': self.sign_body,  # 收款公司
             'contract_id': self.apartment_contract_id,
             'operation_total': receivable.receivable_money,  # 转账总金额
             'receipts_date': datetimes.today(),  # 收款日期
             'receipts_type': 'ALIPAY',  # 收款方式:支付宝转账
             'receipts_money': receivable.receivable_money,  # 收款金额
             'receivable_id': receivable.receivable_id  # 应收ID
         }
         # 实收
         result = myRequest(url, data)
Example #25
0
 def getServiceAgencyProperty():
     """"""
     url = 'isz_contract/ApartmentContractController/getServiceAgencyProperty.action'
     requestPayload = {
         "houseContractId": self.house_contract_id,  # data['houseContractList'][0]['contract_id'],
         "firstMoney": str(real_due_rent_price),
         "rent_start_date": rent_start_date,
         "rent_end_date": rent_end_date,
         "contract_type": "NEWSIGN",
         "sign_date": sign_date,
         "house_id": self.house_id,
         "customer_id": customerInfo['customer_id']
     }
     # if self.rent_type == 'ENTIRE':
     #     del requestPayload['room_id']
     result = myRequest(url, requestPayload)
     if result:
         data['month_server_fee'] = str(result['obj']['month_server_fee'])
Example #26
0
 def houseOnline(self):
     self.__cheackOnlineHouse()
     self.__saveHouseImage()
     url = "/isz_house/onlineHouseController/saveOnlineHouseInfoNew.action"
     data = {
         "door_model_describing": u'测试描述:测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述',
         "position_description": u'测试描述:测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述',
         "agent_description": u'测试描述:测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述',
         "apartment_id": self.apartment_id,
         "house_id": self.house_id,
         "rent_type": self.rent_type,
         "house_description": u'测试描述:测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述',
         "plot_describing": u'测试描述:测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述',
         "manager_description": u'测试描述:测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述测试描述'
     }
     result = myRequest(url, data)
     if result:
         consoleLog(u'房源上架申请完成')
         return
Example #27
0
        def audit(afterStatus):
            """审核
            :param afterStatus 审核操作后的状态
            """

            url = '/isz_contract/ContractEndController/auditApartmrntContractEnd'
            data = {
                "endBasicInfo": {
                    "audit_status": afterStatus,
                    "content": "同意!",
                    "contract_id": self.apartment_contract_id,
                    "end_contract_num": endInfo.end_contract_num,
                    "end_date": endInfo.end_date,
                    "update_time": time.strftime('%Y-%m-%d %H:%M:%S.0'),
                    "end_id": endInfo.end_id,
                    "end_type": endInfo.end_type,
                    "ins_result": "",
                    "payment_type": endInfo.contract_end_type
                },
                "liquidatedOrTurnFee": {
                    "discount_liquidated_receivable":
                    endInfo.liquidated_receivable,
                    "liquidated_receivable": endInfo.liquidated_receivable,
                    "discountImgList": [],
                    "discount_img_id": None
                },
                "receiverInfo": {
                    "bank": endInfo.bank,
                    "contractEndPayerAgintType": "PAYER",
                    "pay_object": endInfo.pay_object,
                    "receipt_bank_location": endInfo.payer_bank_location,
                    "receipt_bank_no": endInfo.payer_bank_no,
                    "receipt_name": endInfo.payer
                }
            }
            if myRequest(url, data):
                if AUDIT_STATUS.APARTMETN_CONTRACT_END.AUDITED == afterStatus:
                    consoleLog('出租终止已初审')
                    time.sleep(1)
                elif AUDIT_STATUS.APARTMETN_CONTRACT_END.APPROVED == afterStatus:
                    consoleLog('出租终止已复审')
Example #28
0
def creatBuilding():
    url = 'isz_house/ResidentialBuildingController/saveResidentialBuildingNew.action'
    residential = creatResidential()
    buildingName = u'1幢'
    data = {
        "property_name": residential['residentialName'],
        "building_name": buildingName,
        "no_building": u"无",
        "housing_type": "ordinary",
        "residential_id": residential['residentialID'],
        "have_elevator": "Y"
    }
    result = myRequest(url, data)
    if result:
        sql = "SELECT building_id from residential_building where residential_id = '%s'" % residential[
            'residentialID']
        buildingID = sqlbase.serach(sql)[0]
        residential['buildingID'] = buildingID
        residential['buildingName'] = buildingName
        consoleLog(u'栋座‘%s’创建成功' % buildingName)
        return residential
Example #29
0
def creatUnit():
    url = 'isz_house/ResidentialBuildingController/saveResidentialBuildingUnit.action'
    # residential = creatBuilding()
    # 楼盘下栋座新增单元
    residentialInfo = sqlbase.serach(
        "select r.residential_name,r.residential_id,rb.building_name,rb.building_id,rd.did from residential r inner join residential_building rb "
        "on r.residential_id=rb.residential_id inner join residential_department rd on r.residential_id=rd.residential_id "
        "where r.residential_id='FF80808163F7FB92016420236FA2000F'and building_id='FF80808163F7FB95016420306DB103EB'"
    )
    residential = {
        'residentialName': residentialInfo[0],
        'residentialID': residentialInfo[1],
        'buildingName': residentialInfo[2],
        'buildingID': residentialInfo[3],
        'dutyDepID': residentialInfo[4],
    }
    unitName = u'1单元'
    data = {
        "property_name":
        residential['residentialName'] + residential['buildingName'],
        "unit_name":
        unitName,
        "no_unit":
        u"无",
        "building_id":
        residential['buildingID']
    }
    result = myRequest(url, data)
    if result:
        sql = "SELECT unit_id from residential_building_unit where building_id = '%s' order by create_time desc limit 1" % \
              residential['buildingID']
        unitID = sqlbase.serach(sql)[0]
        residential['unitID'] = unitID
        residential['unitName'] = unitName
        consoleLog(u'单元‘%s’创建成功' % unitName)
        return residential
Example #30
0
 def auditPayable(self):
     """审核应付"""
     consoleLog(u'开始审核委托合同应付')
     url = 'http://erp.ishangzu.com/isz_finance/HouseContractPayableController/updatePayableAuditStatusById'
     # payableIds = sqlbase.serach(
     #     "select payable_id from house_contract_payable where contract_id='%s' and audit_status = 'NOTAUDIT' and deleted = 0 "
     #     "and money_type = 'RENT' " % self.house_contract_id, oneCount=False, research=True, nullLog=False)
     payables = self.payables()
     if len(payables) > 0:
         payableIds = []
         for payable in payables:
             payableIds.append(payable.payable_id)
         data = {
             "audit_status": "AUDITED",
             "payableIds": payableIds
         }
         result = myRequest(url, data, method='put')
         if not result:
             consoleLog('委托合同"%s"应付审核失败!' % self.house_contract_num)
             quit()
         else:
             consoleLog('委托合同"%s"应付审核通过' % self.house_contract_num)
     else:
         consoleLog('委托合同"%s"没有待审核应付' % self.house_contract_num)