Commit aab993bc authored by libin's avatar libin
Browse files

20180809

parent 470d7d65
This diff is collapsed.
......@@ -2,17 +2,19 @@ from src.common import mysql_client
from src.datalib import test_data
from src.module import deal_db_data
# 在“座位管理”中绑定工位
insert_stationelement = '''INSERT INTO `stationelement`(centerx,centery,cycleValue,floorAreaId,groupStationId,stationId,stationx,stationy,stationSvgId,type)
VALUES('0','0','0',%s,77,(SELECT id FROM `mobilestation` WHERE domainId=%s AND stationNum='S012'),'0','0',0,1)'''%(test_data.PRE_AREA_ID,test_data.COMPANY_ID)
print(insert_stationelement)
deal_db_data.execute_sql(insert_stationelement)
update_mobilestation = "UPDATE `mobilestation` SET stationState=0,userId=0 WHERE domainId=%s AND stationNum='S012';"%(test_data.COMPANY_ID)
print(update_mobilestation)
deal_db_data.execute_sql(update_mobilestation)
#预定工位
booking_station = '''INSERT INTO `reservation`(createTime,delayRemind,domainId,endTime,flag,occUserId,occUserName,realStartTime,reservationStatus,reservationType,signRemind,source,startTime,stationNum,userId,userName,stationId)
VALUES((SELECT CURDATE()),0,{di},(SELECT DATE_SUB(CURDATE(),INTERVAL -1 DAY)),1,{ui},'{un}',(SELECT CURDATE()),1,1,0,0,(SELECT CURDATE()) ,'S012',{ui},'{un}',(SELECT id FROM `mobilestation` WHERE domainId={di} AND stationNum='S012' ));
'''.format(di = test_data.COMPANY_ID, ui = test_data.PRE_USER_ID, un = test_data.PRE_USER_NAME)
print(booking_station)
deal_db_data.execute_sql(booking_station)
\ No newline at end of file
from socket import *
serverSocket = socket(AF_INET, SOCK_STREAM)
serverSocket.bind(("", 8080))
serverSocket.listen(5)
print("----------开始----------")
while True:
clientSocket, clientInfo = serverSocket.accept()
print(clientInfo)
clientSocket.send("CRSTSE0A0500PTTC0D0A\n".encode())
print("----已发送")
recvData = clientSocket.recv(1024)
if recvData:
print("接收到数据:",recvData.decode())
clientSocket.close()
\ No newline at end of file
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