|
@@ -46,7 +46,9 @@ static bool isRoomPatrol = false;
|
|
|
static bool isNursing = false;
|
|
|
static int positionItId = 0;
|
|
|
static int roomCheckItId = 0;
|
|
|
+static int authItId = 0;
|
|
|
static int chooseId = 0;
|
|
|
+static bool isChoose = false;
|
|
|
|
|
|
|
|
|
static void getClerkList() {
|
|
@@ -75,6 +77,18 @@ std::string getClerkPassNo() {
|
|
|
return clerk["pass_no"].asCString();
|
|
|
}
|
|
|
|
|
|
+void setClerk(std::string clerk_name, std::string pass_no, int _authItid) {
|
|
|
+ isChoose = true;
|
|
|
+ clerk["clerk_name"] = clerk_name;
|
|
|
+ clerk["pass_no"] = pass_no;
|
|
|
+
|
|
|
+ authItId = _authItid;
|
|
|
+}
|
|
|
+
|
|
|
+void setAuthItId(int id) {
|
|
|
+ authItId = id;
|
|
|
+}
|
|
|
+
|
|
|
void setPosistionItId(int id) {
|
|
|
positionItId = id;
|
|
|
}
|
|
@@ -84,8 +98,13 @@ void setRoomCheckItId(int id) {
|
|
|
}
|
|
|
|
|
|
void setPositionButton(bool setPosition) {
|
|
|
+ isPosition = setPosition;
|
|
|
+
|
|
|
+ if (mActivityPtr == NULL) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (setPosition) {
|
|
|
- isPosition = setPosition;
|
|
|
mPositionPainterPtr->setBackgroundPic("medicalCare/ding-y.png");
|
|
|
|
|
|
mPositionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "medicalCare/yellow_199x281.png");
|
|
@@ -96,7 +115,6 @@ void setPositionButton(bool setPosition) {
|
|
|
mPositionButtonPtr->setTouchable(false);
|
|
|
}
|
|
|
else {
|
|
|
- isPosition = setPosition;
|
|
|
mPositionPainterPtr->setBackgroundPic("medicalCare/ding.png");
|
|
|
|
|
|
mPositionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "medicalCare/white_199x281.png");
|
|
@@ -145,8 +163,13 @@ void setPosition(bool setPosition) {
|
|
|
|
|
|
|
|
|
void setRoomPatrolButton(bool setRoomPatrol) {
|
|
|
+ isRoomPatrol = setRoomPatrol;
|
|
|
+
|
|
|
+ if (mActivityPtr == NULL) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (setRoomPatrol) {
|
|
|
- isRoomPatrol = setRoomPatrol;
|
|
|
mRoomPatrolPainterPtr->setBackgroundPic("medicalCare/xun-y.png");
|
|
|
|
|
|
mRoomPatrolButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "medicalCare/green_199x281.png");
|
|
@@ -157,7 +180,6 @@ void setRoomPatrolButton(bool setRoomPatrol) {
|
|
|
mRoomPatrolButtonPtr->setTouchable(false);
|
|
|
}
|
|
|
else {
|
|
|
- isRoomPatrol = setRoomPatrol;
|
|
|
mRoomPatrolPainterPtr->setBackgroundPic("medicalCare/xun.png");
|
|
|
|
|
|
mRoomPatrolButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "medicalCare/white_199x281.png");
|
|
@@ -227,8 +249,13 @@ void setNursingEnd() {
|
|
|
}
|
|
|
|
|
|
void setNursingButton(bool setNursing) {
|
|
|
+ isNursing = setNursing;
|
|
|
+
|
|
|
+ if (mActivityPtr == NULL) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (setNursing) {
|
|
|
- isNursing = setNursing;
|
|
|
mNursingPainterPtr->setBackgroundPic("medicalCare/hu-y.png");
|
|
|
|
|
|
mNursingButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "medicalCare/pink_199x281.png");
|
|
@@ -237,7 +264,6 @@ void setNursingButton(bool setNursing) {
|
|
|
mNursingTextViewPtr->setTextColor(0xFFFFFFFF);
|
|
|
}
|
|
|
else {
|
|
|
- isNursing = setNursing;
|
|
|
mNursingPainterPtr->setBackgroundPic("medicalCare/hu.png");
|
|
|
|
|
|
mNursingButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "medicalCare/white_199x281.png");
|
|
@@ -285,16 +311,33 @@ void setNursing(bool setNursing) {
|
|
|
|
|
|
|
|
|
void logoutMedicalCare() {
|
|
|
+ isChoose = false;
|
|
|
setPosition(false);
|
|
|
setRoomPatrol(false);
|
|
|
setNursing(false);
|
|
|
|
|
|
clerk.clear();
|
|
|
- mPasswordEditTextPtr->setText("");
|
|
|
|
|
|
- mMedicalCareWindowPtr->hideWnd();
|
|
|
- mChooseClerkWindowPtr->hideWnd();
|
|
|
- mLoginWindowPtr->showWnd();
|
|
|
+ if (mActivityPtr != NULL) {
|
|
|
+ mPasswordEditTextPtr->setText("");
|
|
|
+
|
|
|
+ mMedicalCareWindowPtr->hideWnd();
|
|
|
+ mChooseClerkWindowPtr->hideWnd();
|
|
|
+ mLoginWindowPtr->showWnd();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (authItId != 0) {
|
|
|
+ // 发送tcp, tcp_type = AUTH, tcp_action = LOGOUT
|
|
|
+ TcpModel tcpModel;
|
|
|
+ tcpModel.tid = base::format("t%d",TimeHelper::getCurrentTime());
|
|
|
+ tcpModel.type = TcpType::AUTH;
|
|
|
+ tcpModel.action = AuthAction::LOGOUT;
|
|
|
+ tcpModel.from_id = StoragePreferences::getInt(STORE_DEVICE_ID,0);
|
|
|
+ tcpModel.to_id = 0;
|
|
|
+ tcpModel.data = to_string(authItId);
|
|
|
+
|
|
|
+ sendTcpModel(tcpModel);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -346,7 +389,7 @@ static void onUI_intent(const Intent *intentPtr) {
|
|
|
* 当界面显示时触发
|
|
|
*/
|
|
|
static void onUI_show() {
|
|
|
- if (clerk.size() > 0) {
|
|
|
+ if (isChoose) {
|
|
|
mClerkNameTextViewPtr->setText(clerk["clerk_name"].asString() + " " + clerk["role_name"].asString());
|
|
|
|
|
|
mLoginWindowPtr->hideWnd();
|
|
@@ -550,10 +593,32 @@ static void onListItemClick_ClerkListView(ZKListView *pListView, int index, int
|
|
|
|
|
|
static bool onButtonClick_EnteringButton(ZKButton *pButton) {
|
|
|
LOGD(" ButtonClick EnteringButton !!!\n");
|
|
|
+ isChoose = true;
|
|
|
+
|
|
|
mClerkNameTextViewPtr->setText(clerk["clerk_name"].asString() + " " + clerk["role_name"].asString());
|
|
|
|
|
|
mChooseClerkWindowPtr->hideWnd();
|
|
|
mMedicalCareWindowPtr->showWnd();
|
|
|
+
|
|
|
+ Json::Value json;
|
|
|
+ json["passNo"] = clerk["pass_no"].asCString();
|
|
|
+ json["operationData"] = "";
|
|
|
+
|
|
|
+ // 发送tcp, tcp_type = AUTH, tcp_action = LOGIN
|
|
|
+ TcpModel tcpModel;
|
|
|
+ tcpModel.tid = base::format("t%d",TimeHelper::getCurrentTime());
|
|
|
+ tcpModel.type = TcpType::AUTH;
|
|
|
+ tcpModel.action = AuthAction::LOGIN;
|
|
|
+ tcpModel.from_id = StoragePreferences::getInt(STORE_DEVICE_ID,0);
|
|
|
+ tcpModel.to_id = 0;
|
|
|
+ tcpModel.json = json;
|
|
|
+
|
|
|
+ sendTcpModel(tcpModel);
|
|
|
+
|
|
|
+ if (StoragePreferences::getInt(STORE_AUTO_POSITION, 0)) {
|
|
|
+ setPosition(true);
|
|
|
+ }
|
|
|
+
|
|
|
return false;
|
|
|
}
|
|
|
|