Commit f091aaac authored by libin's avatar libin
Browse files

sql都加上domianId

parent 5ef364c7
......@@ -100,8 +100,8 @@ class DeleteDepartment(unittest.TestCase):
def test_delete_department_003(self):
insert_sql = '''INSERT INTO `userinfo`
(attendanceCard,domainId,email,employeeId,employeeName,orgId,PASSWORD,roleId,userFrom,userStatus)
VALUES('111',%s,'wafer@qq.com','002','CYQ',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',%s,2,0);''' \
%(test_data.COMPANY_ID,test_data.COMMON_USER_ROLE_ID)
VALUES('111',%s,'wafer@qq.com','002','CYQ',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId=%s),'wafer123',%s,2,0);''' \
%(test_data.COMPANY_ID,test_data.COMPANY_ID,test_data.COMMON_USER_ROLE_ID)
deal_db_data.execute_sql(insert_sql)
goto.goto_department(self.browser)
select_sql = '''SELECT COUNT(*) FROM `organization` WHERE domainId = %s AND orgStatus=0 AND orgName != '企业通讯录';'''%(test_data.COMPANY_ID)
......@@ -112,7 +112,7 @@ class DeleteDepartment(unittest.TestCase):
self.browser.assert_elem_is_selected(xtpz_bmgl.LAST_LINE_CHECKBOX, 1)
self.browser.assert_attribute_msg(xtpz_bmgl.LOT_SIZING_DELETE_BTN, test_data.ATTRIBUTE_CLASS, test_data.ATTRIBUTE_CLASS_TEXT_AVAILABLE)
select_sql = '''SELECT u.`userStatus` FROM `userinfo` u
WHERE u.`orgId`=(SELECT id FROM `organization` WHERE orgName='designer department') ;'''
WHERE u.`orgId`=(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId=%s) ;'''%(test_data.COMPANY_ID)
deal_db_data.assert_select_result(select_sql, 0)
self.browser.click_element(xtpz_bmgl.LOT_SIZING_DELETE_BTN)
self.browser.assert_mark_msg(xtpz_bmgl.DELETE_CONFIRM_BOX_TITLE, test_data.DELETE_CONFIRM_BOX_TITLE_TEXT)
......@@ -140,8 +140,8 @@ class DeleteDepartment(unittest.TestCase):
'''
def test_delete_department_004(self):
insert_sql = '''INSERT INTO `mobilestation` (domainId,floorAreaId,floorAreaNum,floorId,floorNum,officeBuildingId,officeBuildingName,orgId,parkName,stationNum,stationState,stationType,userId,parkId)
VALUES(%s,%s,'%s',%s,'%s',%s,'%s',(SELECT id FROM `organization` WHERE orgName='designer department'),"%s",'951',3,1,%s,%s);''' \
%(test_data.COMPANY_ID, test_data.PRE_AREA_ID, test_data.PRE_AREA_NAME, test_data.PRE_FLOOR_ID, test_data.PRE_FLOOR_NAME, test_data.PRE_BUILD_ID, test_data.PRE_BUILD_NAME, test_data.PRE_PARK_NAME, test_data.PRE_USER_ID, test_data.PRE_PARK_ID)
VALUES(%s,%s,'%s',%s,'%s',%s,'%s',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId=%s),"%s",'951',3,1,%s,%s);''' \
%(test_data.COMPANY_ID, test_data.PRE_AREA_ID, test_data.PRE_AREA_NAME, test_data.PRE_FLOOR_ID, test_data.PRE_FLOOR_NAME, test_data.PRE_BUILD_ID, test_data.PRE_BUILD_NAME, test_data.COMPANY_ID,test_data.PRE_PARK_NAME, test_data.PRE_USER_ID, test_data.PRE_PARK_ID)
deal_db_data.execute_sql(insert_sql)
goto.goto_department(self.browser)
select_sql = '''SELECT COUNT(*) FROM `organization` WHERE domainId = %s AND orgStatus=0 AND orgName != '企业通讯录';'''%(test_data.COMPANY_ID)
......@@ -167,15 +167,15 @@ class DeleteDepartment(unittest.TestCase):
def test_delete_department_005(self):
insert_sql = '''INSERT INTO `userinfo`
(attendanceCard,domainId,email,employeeId,employeeName,orgId,PASSWORD,roleId,userFrom,userStatus)
VALUES('111',%s,'wafer@qq.com','002','CYQ',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',%s,2,0);''' \
%(test_data.COMPANY_ID,test_data.COMMON_USER_ROLE_ID)
VALUES('111',%s,'wafer@qq.com','002','CYQ',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId=%s),'wafer123',%s,2,0);''' \
%(test_data.COMPANY_ID,test_data.COMPANY_ID,test_data.COMMON_USER_ROLE_ID)
deal_db_data.execute_sql(insert_sql)
goto.goto_department(self.browser)
select_sql = '''SELECT COUNT(*) FROM `organization` WHERE domainId = %s AND orgStatus=0 AND orgName != '企业通讯录';'''%(test_data.COMPANY_ID)
deal_db_data.assert_select_result(select_sql, 13)
# self.browser.assert_mark_msg(xtpz_bmgl.SEARCH_RESULT_TEXT, test_data.SEARCH_RESULT_TEXT_13)
select_sql = '''SELECT u.`userStatus` FROM `userinfo` u
WHERE u.`orgId`=(SELECT id FROM `organization` WHERE orgName='designer department') ;'''
WHERE u.`orgId`=(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId=%s) ;'''%(test_data.COMPANY_ID)
deal_db_data.assert_select_result(select_sql, 0)
self.browser.assert_all_checkbox_selected(0)
self.browser.click_element(xtpz_bmgl.LOT_SIZING_CHECKBOX)
......@@ -202,8 +202,8 @@ class DeleteDepartment(unittest.TestCase):
'''
def test_delete_department_006(self):
insert_sql = '''INSERT INTO `mobilestation` (domainId,floorAreaId,floorAreaNum,floorId,floorNum,officeBuildingId,officeBuildingName,orgId,parkName,stationNum,stationState,stationType,userId,parkId)
VALUES(%s,%s,'%s',%s,'%s',%s,'%s',(SELECT id FROM `organization` WHERE orgName='designer department'),'%s','951',3,1,%s,%s);''' \
%(test_data.COMPANY_ID, test_data.PRE_AREA_ID, test_data.PRE_AREA_NAME, test_data.PRE_FLOOR_ID,test_data.PRE_FLOOR_NAME, test_data.PRE_BUILD_ID, test_data.PRE_BUILD_NAME, test_data.PRE_PARK_NAME, test_data.PRE_USER_ID, test_data.PRE_PARK_ID)
VALUES(%s,%s,'%s',%s,'%s',%s,'%s',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId=%s),'%s','951',3,1,%s,%s);''' \
%(test_data.COMPANY_ID, test_data.PRE_AREA_ID, test_data.PRE_AREA_NAME, test_data.PRE_FLOOR_ID,test_data.PRE_FLOOR_NAME, test_data.PRE_BUILD_ID, test_data.PRE_BUILD_NAME, test_data.COMPANY_ID, test_data.PRE_PARK_NAME, test_data.PRE_USER_ID, test_data.PRE_PARK_ID)
deal_db_data.execute_sql(insert_sql)
goto.goto_department(self.browser)
select_sql = '''SELECT COUNT(*) FROM `organization` WHERE domainId = %s AND orgStatus=0 AND orgName != '企业通讯录';'''%(test_data.COMPANY_ID)
......
......@@ -34,9 +34,9 @@ class SearchUser(unittest.TestCase):
('324',{di},'324@qq.com','005','Doug@',{oi},'wafer123',{ri},2,0),
('325',{di},'325@qq.com','006','Tom',{oi},'wafer123',{ri},2,0),
('326',{di},'326@qq.com','007','Zoe',{oi},'wafer123',{ri},2,0),
('327',{di},'327@qq.com','008','胡歌',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',{ri},2,0),
('328',{di},'328@qq.com','009','Marry01',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',{ri},2,0),
('329',{di},'329@qq.com','010','cyq01',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',{ri},2,0),
('327',{di},'327@qq.com','008','胡歌',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId={di}),'wafer123',{ri},2,0),
('328',{di},'328@qq.com','009','Marry01',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId={di}),'wafer123',{ri},2,0),
('329',{di},'329@qq.com','010','cyq01',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId={di}),'wafer123',{ri},2,0),
('330',{di},'330@qq.com','011','Mike',{oi},'wafer123',{ri},2,0),
('331',{di},'331@qq.com','012','clair!@#',{oi},'wafer123',{ri},2,0),
('332',{di},'332@qq.com','013','胡歌001',{oi},'wafer123',{ri},2,0); '''.format(di = test_data.COMPANY_ID, oi = test_data.PRE_DEPARTMENT_ID, ri=test_data.COMMON_USER_ROLE_ID)
......
......@@ -33,9 +33,9 @@ class DeleteUser(unittest.TestCase):
('324',{di},'324@qq.com','005','Doug@',{oi},'wafer123',{ri},2,0),
('325',{di},'325@qq.com','006','Tom',{oi},'wafer123',{ri},2,0),
('326',{di},'326@qq.com','007','Zoe',{oi},'wafer123',{ri},2,0),
('327',{di},'327@qq.com','008','胡歌',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',{ri},2,0),
('328',{di},'328@qq.com','009','Marry01',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',{ri},2,0),
('329',{di},'329@qq.com','010','cyq01',(SELECT id FROM `organization` WHERE orgName='designer department'),'wafer123',{ri},2,0),
('327',{di},'327@qq.com','008','胡歌',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId={di}),'wafer123',{ri},2,0),
('328',{di},'328@qq.com','009','Marry01',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId={di}),'wafer123',{ri},2,0),
('329',{di},'329@qq.com','010','cyq01',(SELECT id FROM `organization` WHERE orgName='designer department' AND domainId={di}),'wafer123',{ri},2,0),
('330',{di},'330@qq.com','011','Mike',{oi},'wafer123',{ri},2,0),
('331',{di},'331@qq.com','012','clair!@#',{oi},'wafer123',{ri},2,0),
('332',{di},'332@qq.com','013','胡歌001',{oi},'wafer123',{ri},2,0); '''.format(di=test_data.COMPANY_ID, oi=test_data.PRE_DEPARTMENT_ID, ri=test_data.COMMON_USER_ROLE_ID)
......
......@@ -44,8 +44,8 @@ class EditStation(unittest.TestCase):
deal_db_data.execute_sql(insert_user)
#插入工位数据
insert_station = '''INSERT INTO `mobilestation`(domainId,floorAreaId,floorAreaNum,floorId,floorNum,officeBuildingId,officeBuildingName,orgId,parkName,qrCodeDir,qrCodeUrl,stationNum,stationState,stationType,userIds,userNames,parkId)
VALUES({di},{ai},'{an}',{fi},'{fn}',{bi},'{bn}',{oi},"{pn}",'/ReserveStation/pub/encoderImg/135/135_109_99_Pre_Floor_3_Pre_Part_A_PM001_2450.png','http://vchat.virsical.cn/wx/qrcode?domainId=135&stationId=2450','PM002',3,1,'','',{pi}),
({di},{ai},'{an}',{fi},'{fn}',{bi},'{bn}',{oi},"{pn}",'/ReserveStation/pub/encoderImg/135/135_109_99_Pre_Floor_3_Pre_Part_A_PF002_2451.png','http://vchat.virsical.cn/wx/qrcode?domainId=135&stationId=2451','PF002',3,2,'{ui}','{un}',{pi});
VALUES({di},{ai},'{an}',{fi},'{fn}',{bi},'{bn}',{oi},"{pn}",'','','PM002',3,1,'','',{pi}),
({di},{ai},'{an}',{fi},'{fn}',{bi},'{bn}',{oi},"{pn}",'','','PF002',3,2,'{ui}','{un}',{pi});
'''.format(di = test_data.COMPANY_ID, ai = test_data.PRE_AREA_ID, an = test_data.PRE_AREA_NAME, fi = test_data.PRE_FLOOR_ID, fn = test_data.PRE_FLOOR_NAME, bi = test_data.PRE_BUILD_ID, bn = test_data.PRE_BUILD_NAME, oi = test_data.PRE_DEPARTMENT_ID, pn = test_data.PRE_PARK_NAME, pi = test_data.PRE_PARK_ID, ui = test_data.PRE_USER_ID, un = test_data.PRE_USER_NAME)
deal_db_data.execute_sql(insert_station)
login_swp.login01(self.browser, test_data.COMPANYADMIN_NAME, test_data.COMPANYADMIN_PW) #登录
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment