Commit 3034d5ad authored by zhang_u's avatar zhang_u

单机取号

parent 7edfcf62
...@@ -24,12 +24,14 @@ ...@@ -24,12 +24,14 @@
android:icon="@drawable/app_logo" android:icon="@drawable/app_logo"
android:label="@string/app_name" android:label="@string/app_name"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
android:roundIcon="@drawable/app_logo" android:roundIcon="@drawable/app_logo"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/NoTitle"> android:theme="@style/NoTitle">
<activity <activity
android:name=".ui.SplashActivity" android:name=".ui.SplashActivity"
android:windowSoftInputMode="adjustPan" android:windowSoftInputMode="adjustPan"
android:screenOrientation="unspecified"
tools:ignore="MissingClass"> tools:ignore="MissingClass">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
......
This diff is collapsed.
color=0 tips=请在候诊区耐心等待叫号
devType=0
tips=温馨提示
comTitle=融威众邦
QR=123456789 QR=123456789
list={"list":[{"title": "窗口1","queueID": "A","initial": "0","prefix": "A","level": "0","type": "0","times": [{"name":"时段名称","num":"100","start": "8:00","end":"16:00","isReset":"0"}]}]} comTitle=融威众邦
devs={"devs":[{"codeID": "01","title": "窗口1","queueID": "A","type": "0","playType": "0"}]} comCode=RW001
vPlay={"vPlay":[{"ip":"127.0.0.1","codeID":"01"}]} ZdCode=BT001
sPlay={"sPlay":[{"ip":"127.0.0.1","codeID":"01","color":"1"}]} led={"led":[{"address":"7D","codeID":"0","enColor":"00","cnColor":"01"}]}
\ No newline at end of file zdName=自助取号机
devType=1
switchStatus=1
list={"list":[{"initial":"0","level":"0","prefix":"A","queueID":"A","times":[{"end":"18:00","id":"1","isReset":"0","name":"全天","num":"100","queueID":"A","start":"08:00"}],"title":"门诊","type":"0","tempID":"A"}]}
color=0
devs={"devs":[{"codeID": "0","title": "门诊","queueID": "A","type": "0","playType": "0"}]}
player={"player":[{"address":"03","codeID":"0"}]}
This diff is collapsed.
This diff is collapsed.
<html>
<head>
<title></title>
</head>
<body>
<object classid="CLSID:76A64158-CB41-11D1-8B02-00600806D9B6" id="locator" style="display:none;visibility:hidden"></object>
<object classid="CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223" id="foo" style="display:none;visibility:hidden"></object>
<form name="myForm">
<br/>MAC地址:<input type="text" name="macAddress">
<br/>IP地址:<input type="text" name="ipAddress">
<br/>主机名:<input type="text" name="hostName">
</form>
</body>
</html>
<script language="javascript">
var sMacAddr="";
var sIPAddr="";
var sDNSName="";
var service = locator.ConnectServer();
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
</script>
<script FOR="foo" EVENT="OnObjectReady(objObject,objAsyncContext)" LANGUAGE="JScript">
if(objObject.IPEnabled != null && objObject.IPEnabled != "undefined" && objObject.IPEnabled == true){
if(objObject.IPEnabled && objObject.IPAddress(0) !=null && objObject.IPAddress(0) != "undefined")
sIPAddr = objObject.IPAddress(0);
if(objObject.MACAddress != null &&objObject.MACAddress != "undefined")
sMacAddr = objObject.MACAddress;
if(objObject.DNSHostName != null &&objObject.DNSHostName != "undefined")
sDNSName = objObject.DNSHostName;
}
</script>
<script FOR="foo" EVENT="OnCompleted(hResult,pErrorObject, pAsyncContext)" LANGUAGE="JScript">
myForm.macAddress.value=sMacAddr;
myForm.ipAddress.value=sIPAddr;
myForm.hostName.value=sDNSName;
</script>
// First, embed this script in your head or at bottom of the page.
<script language="Javascript" src="http://www.codehelper.io/api/ips/?js"></script>
// You can use it
<script language="Javascript">
alert(codehelper_ip.IP);
alert(codehelper_ip.Country);
</script>
\ No newline at end of file
...@@ -19,6 +19,7 @@ import com.example.numbertakingmachine.R; ...@@ -19,6 +19,7 @@ import com.example.numbertakingmachine.R;
import com.example.numbertakingmachine.bean.ConfigDevsBean; import com.example.numbertakingmachine.bean.ConfigDevsBean;
import com.example.numbertakingmachine.bean.DataBean; import com.example.numbertakingmachine.bean.DataBean;
import com.example.numbertakingmachine.sql.BaseUtils; import com.example.numbertakingmachine.sql.BaseUtils;
import com.example.numbertakingmachine.utils.SystemUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -56,7 +57,12 @@ public class MSGItemAdapter extends RecyclerView.Adapter<MSGItemAdapter.ViewHold ...@@ -56,7 +57,12 @@ public class MSGItemAdapter extends RecyclerView.Adapter<MSGItemAdapter.ViewHold
@Override @Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.msg_item, parent, false);
View view = null;
if (!devType.equals("4"))
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.msg_item, parent, false);
else
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.msg_item2, parent, false);
return new ViewHolder(view); return new ViewHolder(view);
} }
...@@ -64,52 +70,98 @@ public class MSGItemAdapter extends RecyclerView.Adapter<MSGItemAdapter.ViewHold ...@@ -64,52 +70,98 @@ public class MSGItemAdapter extends RecyclerView.Adapter<MSGItemAdapter.ViewHold
@Override @Override
public void onBindViewHolder(ViewHolder holder, int position) { public void onBindViewHolder(ViewHolder holder, int position) {
// 从数据列表中获取数据并绑定到视图 // 从数据列表中获取数据并绑定到视图
if (!devType.equals("4"))
initView(holder, position); initView(holder, position);
else
initView2(holder, position);
} }
private void initView(ViewHolder holder, int position) { private void initView(ViewHolder holder, int position) {
if (position < 4) if (devType.equals("0") && orientation == 0 && position < 5)
holder.line.setVisibility(View.VISIBLE);
else if (position < 4)
holder.line.setVisibility(View.VISIBLE); holder.line.setVisibility(View.VISIBLE);
else else
holder.line.setVisibility(View.INVISIBLE); holder.line.setVisibility(View.INVISIBLE);
LinearLayout.LayoutParams params = null; LinearLayout.LayoutParams params = null;
if (orientation == 0) { if (devType.equals("3")) {
params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (height - 55) / 5);
} else if (orientation == 0) {
//竖版一体机 //竖版一体机
params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (height - 105) / 5); params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (height - 105) / 6);
} else { } else {
//横版一体机 //横版一体机
params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (height - 90) / 3); params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (height - 90) / 3);
} }
holder.itemView.setLayoutParams(params); holder.itemView.setLayoutParams(params);
if (data != null) {
if (position < data.size()) { if (position < data.size()) {
if (data.get(position).get(BaseUtils.NTMRecordTable.current).equals("0")) if (data.get(position).get(BaseUtils.NTMRecordTable.current).equals("0"))
holder.layout.setVisibility(View.INVISIBLE); holder.layout.setVisibility(View.INVISIBLE);
else { else {
String queueID = data.get(position).get("queueID"); String queueID = data.get(position).get("queueID");
if (data.get(position).get(BaseUtils.NTMRecordTable.type).equals("1")) {
holder.middle.setText("号患者等候");
holder.num2.setVisibility(View.GONE);
holder.foot.setText("叫号");
} else {
holder.middle.setText("号患者到");
holder.num2.setVisibility(View.VISIBLE);
holder.foot.setText("就诊");
}
if (queueID != null && !queueID.isEmpty()) { if (queueID != null && !queueID.isEmpty()) {
List<Map<String, String>> maps = recordHelper.searchNTMQueueTable(BaseUtils.NTMRecordTable.queueID, queueID); if (!devType.equals("3")) {
List<Map<String, String>> maps = recordHelper.searchNTMQueueTable(BaseUtils.NTMRecordTable.queueID + " = ? ", new String[]{queueID});
if (maps.size() >= 1) { if (maps.size() >= 1) {
Map<String, String> map = maps.get(0); Map<String, String> map = maps.get(maps.size() - 1);
holder.layout.setVisibility(View.VISIBLE);
holder.num.setText(SystemUtils.getNumber(map.get(BaseUtils.NTMQueueTable.prefix), data.get(position).get(BaseUtils.NTMRecordTable.current)));
holder.num2.setText(data.get(position).get(BaseUtils.NTMRecordTable.title));
}
} else {
holder.layout.setVisibility(View.VISIBLE); holder.layout.setVisibility(View.VISIBLE);
holder.num.setText(map.get(BaseUtils.NTMQueueTable.prefix) + data.get(position).get(BaseUtils.NTMRecordTable.current)); holder.num.setText(SystemUtils.getNumber(data.get(position).get(BaseUtils.NTMRecordTable.prefix), data.get(position).get(BaseUtils.NTMRecordTable.current)));
holder.num2.setText(map.get(BaseUtils.NTMQueueTable.title)); holder.num2.setText(data.get(position).get(BaseUtils.NTMRecordTable.title));
} }
} }
} }
} else holder.layout.setVisibility(View.INVISIBLE); } else holder.layout.setVisibility(View.INVISIBLE);
} else {
holder.layout.setVisibility(View.INVISIBLE);
}
}
private void initView2(ViewHolder holder, int position) {
if (position == 3 || position == 4 || position == 5 || position == 9 || position == 10 || position == 11)
holder.relative.setBackgroundResource(R.color.blue_CCEAFD);
else
holder.relative.setBackgroundResource(R.color.transparent);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, (height - 10) / 5);
holder.itemView.setLayoutParams(params);
if (data != null) {
if (position < data.size()) {
if (data.get(position).get(BaseUtils.NTMRecordTable.current).equals("0"))
holder.num.setVisibility(View.INVISIBLE);
else {
holder.num.setVisibility(View.VISIBLE);
holder.num.setText(SystemUtils.getNumber(data.get(position).get(BaseUtils.NTMRecordTable.prefix), data.get(position).get(BaseUtils.NTMRecordTable.current)));
}
} else holder.num.setVisibility(View.INVISIBLE);
} else {
holder.num.setVisibility(View.INVISIBLE);
}
} }
@Override @Override
public int getItemCount() { public int getItemCount() {
if (orientation == 0) if (!devType.equals("4"))
return 5; // 返回数据列表的大小
return 6; // 返回数据列表的大小 return 6; // 返回数据列表的大小
return 15;
} }
// ViewHolder 类 // ViewHolder 类
public static class ViewHolder extends RecyclerView.ViewHolder { public static class ViewHolder extends RecyclerView.ViewHolder {
public LinearLayout relative; public RelativeLayout relative;
public LinearLayout layout; public LinearLayout layout;
public View line; public View line;
public TextView head; public TextView head;
...@@ -120,6 +172,7 @@ public class MSGItemAdapter extends RecyclerView.Adapter<MSGItemAdapter.ViewHold ...@@ -120,6 +172,7 @@ public class MSGItemAdapter extends RecyclerView.Adapter<MSGItemAdapter.ViewHold
public ViewHolder(View itemView) { public ViewHolder(View itemView) {
super(itemView); super(itemView);
relative = itemView.findViewById(R.id.relative);
layout = itemView.findViewById(R.id.layout); layout = itemView.findViewById(R.id.layout);
line = itemView.findViewById(R.id.line); line = itemView.findViewById(R.id.line);
head = itemView.findViewById(R.id.head); head = itemView.findViewById(R.id.head);
......
...@@ -15,6 +15,14 @@ public class Argument { ...@@ -15,6 +15,14 @@ public class Argument {
this.value = name; this.value = name;
} }
public String getId() {
return id;
}
public String getValue() {
return value;
}
public void setSize(String size) { public void setSize(String size) {
this.size = size; this.size = size;
} }
......
...@@ -12,12 +12,19 @@ public class CallBean implements Serializable { ...@@ -12,12 +12,19 @@ public class CallBean implements Serializable {
private String codeID; private String codeID;
private String queueID; private String queueID;
private String current;
public CallBean(String codeID, String queueID) { public CallBean(String codeID, String queueID) {
this.codeID = codeID; this.codeID = codeID;
this.queueID = queueID; this.queueID = queueID;
} }
public CallBean(String codeID, String queueID, String current) {
this.codeID = codeID;
this.queueID = queueID;
this.current = current;
}
public CallBean(String codeID) { public CallBean(String codeID) {
this.codeID = codeID; this.codeID = codeID;
} }
...@@ -37,4 +44,12 @@ public class CallBean implements Serializable { ...@@ -37,4 +44,12 @@ public class CallBean implements Serializable {
public void setQueueID(String queueID) { public void setQueueID(String queueID) {
this.queueID = queueID; this.queueID = queueID;
} }
public String getCurrent() {
return current;
}
public void setCurrent(String current) {
this.current = current;
}
} }
...@@ -21,25 +21,39 @@ public class ConfigBean implements Serializable { ...@@ -21,25 +21,39 @@ public class ConfigBean implements Serializable {
private String devType; private String devType;
private String tips; private String tips;
private String comTitle; private String comTitle;
private String comCode;
private String zdName;
private String ZdCode;
private String switchStatus;
@SerializedName("QR") @SerializedName("QR")
private String qr; private String qr;
private List<ConfigDevsBean.DevsBean> devs; private List<ConfigDevsBean.DevsBean> devs;
private List<ConfigQueueBean> list; private List<ConfigQueueBean> list;
private List<ConfigVPlayBean.VPlayBean> vPlay; private List<ConfigVPlayBean.VPlayBean> vPlay;
private List<ConfigSPlayBean.SPlayBean> sPlay; private List<ConfigSPlayBean.SPlayBean> sPlay;
private List<ConfigPlayerBean.PlayerBean> players;
private List<ConfigLedsBean.LedsBean> leds;
public ConfigBean(String color, String devType, String tips, String comTitle, String qr, public ConfigBean(String color, String devType, String tips, String comTitle, String comCode,
String zdName, String ZdCode, String switchStatus, String qr,
List<ConfigQueueBean> list, List<ConfigDevsBean.DevsBean> devsBean, List<ConfigQueueBean> list, List<ConfigDevsBean.DevsBean> devsBean,
List<ConfigVPlayBean.VPlayBean> vPlay,List<ConfigSPlayBean.SPlayBean> sPlay) { List<ConfigVPlayBean.VPlayBean> vPlay, List<ConfigSPlayBean.SPlayBean> sPlay,
List<ConfigPlayerBean.PlayerBean> players, List<ConfigLedsBean.LedsBean> leds) {
this.color = color; this.color = color;
this.devType = devType; this.devType = devType;
this.tips = tips; this.tips = tips;
this.comTitle = comTitle; this.comTitle = comTitle;
this.comCode = comCode;
this.zdName = zdName;
this.ZdCode = ZdCode;
this.switchStatus = switchStatus;
this.qr = qr; this.qr = qr;
this.devs = devsBean; this.devs = devsBean;
this.list = list; this.list = list;
this.vPlay = vPlay; this.vPlay = vPlay;
this.sPlay = sPlay; this.sPlay = sPlay;
this.players = players;
this.leds = leds;
} }
public String getColor() { public String getColor() {
......
package com.example.numbertakingmachine.bean;
import java.io.Serializable;
import java.util.List;
public class ConfigLedsBean implements Serializable {
private List<LedsBean> leds;
public ConfigLedsBean(List<LedsBean> leds) {
this.leds = leds;
}
public List<LedsBean> getLeds() {
return leds;
}
public void setLeds(List<LedsBean> leds) {
this.leds = leds;
}
public static class LedsBean implements Serializable {
/**
* codeID : 01
*/
private String codeID;
private String address;
private String enColor;
private String cnColor;
public LedsBean(String codeID, String address, String enColor, String cnColor) {
this.codeID = codeID;
this.address = address;
this.enColor = enColor;
this.cnColor = cnColor;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getEnColor() {
return enColor;
}
public void setEnColor(String enColor) {
this.enColor = enColor;
}
public String getCnColor() {
return cnColor;
}
public void setCnColor(String cnColor) {
this.cnColor = cnColor;
}
public String getCodeID() {
return codeID;
}
public void setCodeID(String codeID) {
this.codeID = codeID;
}
}
}
package com.example.numbertakingmachine.bean;
import java.io.Serializable;
import java.util.List;
public class ConfigPlayerBean implements Serializable {
private List<PlayerBean> player;
public List<PlayerBean> getPlayer() {
return player;
}
public void setPlayer(List<PlayerBean> player) {
this.player = player;
}
public static class PlayerBean implements Serializable {
/**
* codeID : 01
* address :
*/
private String codeID;
private String address;
public PlayerBean(String codeID, String address) {
this.codeID = codeID;
this.address = address;
}
public String getCodeID() {
return codeID;
}
public void setCodeID(String codeID) {
this.codeID = codeID;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
}
...@@ -26,11 +26,13 @@ public class ConfigSPlayBean implements Serializable { ...@@ -26,11 +26,13 @@ public class ConfigSPlayBean implements Serializable {
private String ip; private String ip;
private String codeID; private String codeID;
private String color; private String color;
private String devType;
public SPlayBean(String ip, String codeID, String color) { public SPlayBean(String ip, String codeID, String color, String devType) {
this.ip = ip; this.ip = ip;
this.codeID = codeID; this.codeID = codeID;
this.color = color; this.color = color;
this.devType = devType;
} }
public String getIp() { public String getIp() {
...@@ -56,5 +58,13 @@ public class ConfigSPlayBean implements Serializable { ...@@ -56,5 +58,13 @@ public class ConfigSPlayBean implements Serializable {
public void setColor(String color) { public void setColor(String color) {
this.color = color; this.color = color;
} }
public String getDevType() {
return devType;
}
public void setDevType(String devType) {
this.devType = devType;
}
} }
} }
...@@ -8,6 +8,7 @@ public class DataBean { ...@@ -8,6 +8,7 @@ public class DataBean {
private String total; private String total;
private String num; private String num;
private String name; private String name;
private String title;
private String start; private String start;
private String end; private String end;
private String isReset; private String isReset;
...@@ -15,21 +16,27 @@ public class DataBean { ...@@ -15,21 +16,27 @@ public class DataBean {
private String times; private String times;
private String all; private String all;
private String last; private String last;
private String type;
private String prefix;
private String current; private String current;
public DataBean(String id,String codeID,String queueID,String total, String ip, String times, String all,String last, String current) { public DataBean(String id, String codeID, String queueID, String total, String title, String ip,
String times, String all, String last, String type,String prefix, String current) {
this.id = id; this.id = id;
this.codeID = codeID; this.codeID = codeID;
this.queueID = queueID; this.queueID = queueID;
this.total = total; this.total = total;
this.title = title;
this.ip = ip; this.ip = ip;
this.times = times; this.times = times;
this.all = all; this.all = all;
this.last = last; this.last = last;
this.type = type;
this.prefix = prefix;
this.current = current; this.current = current;
} }
public DataBean(String id,String name,String queueID,String num, String start,String end, String isReset) { public DataBean(String id, String name, String queueID, String num, String start, String end, String isReset) {
this.id = id; this.id = id;
this.name = name; this.name = name;
this.queueID = queueID; this.queueID = queueID;
...@@ -42,6 +49,14 @@ public class DataBean { ...@@ -42,6 +49,14 @@ public class DataBean {
public DataBean() { public DataBean() {
} }
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getLast() { public String getLast() {
return last; return last;
} }
...@@ -110,6 +125,14 @@ public class DataBean { ...@@ -110,6 +125,14 @@ public class DataBean {
return total; return total;
} }
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public void setTotal(String total) { public void setTotal(String total) {
this.total = total; this.total = total;
} }
...@@ -146,6 +169,14 @@ public class DataBean { ...@@ -146,6 +169,14 @@ public class DataBean {
this.end = end; this.end = end;
} }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIsReset() { public String getIsReset() {
return isReset; return isReset;
} }
......
...@@ -2,6 +2,7 @@ package com.example.numbertakingmachine.bean; ...@@ -2,6 +2,7 @@ package com.example.numbertakingmachine.bean;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Map;
public class HttpResultBean implements Serializable { public class HttpResultBean implements Serializable {
...@@ -16,7 +17,34 @@ public class HttpResultBean implements Serializable { ...@@ -16,7 +17,34 @@ public class HttpResultBean implements Serializable {
private int code; private int code;
private String msg; private String msg;
private String time; private String time;
private String current;
private DataBean data; private DataBean data;
private List<Map<String, String>> list;
private List<Map<String, String>> nowList;
private List<Map<String, String>> noList;
public HttpResultBean(int code, String msg, String current, List<Map<String, String>> list) {
this.code = code;
this.msg = msg;
this.current = current;
this.list = list;
}
public HttpResultBean(int code, String msg, String current, List<Map<String, String>> nowList, List<Map<String, String>> noList) {
this.code = code;
this.msg = msg;
this.current = current;
this.nowList = nowList;
this.noList = noList;
}
public List<Map<String, String>> getList() {
return list;
}
public void setList(List<Map<String, String>> list) {
this.list = list;
}
public int getCode() { public int getCode() {
return code; return code;
......
package com.example.numbertakingmachine.bean;
public class TvJsonBean {
private String codeID;
private String queueID;
private String title;
private String current;
private String last;
private String all;
private String total;
private String color;
private String tips;
private String IP;
private String type;
public TvJsonBean(String codeID, String queueID, String title, String current, String last, String all, String total,String color) {
this.codeID = codeID;
this.queueID = queueID;
this.title = title;
this.current = current;
this.last = last;
this.all = all;
this.total = total;
this.color = color;
}
public TvJsonBean(String IP,String type) {
this.IP = IP;
this.type = type;
}
public TvJsonBean(String codeID, String queueID, String current,String title, String IP) {
this.codeID = codeID;
this.queueID = queueID;
this.current = current;
this.title = title;
this.IP = IP;
}
public TvJsonBean(String codeID, String queueID, String type) {
this.codeID = codeID;
this.queueID = queueID;
this.type = type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTips() {
return tips;
}
public void setTips(String tips) {
this.tips = tips;
}
public String getIP() {
return IP;
}
public void setIP(String IP) {
this.IP = IP;
}
public String getCodeID() {
return codeID;
}
public void setCodeID(String codeID) {
this.codeID = codeID;
}
public String getQueueID() {
return queueID;
}
public void setQueueID(String queueID) {
this.queueID = queueID;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCurrent() {
return current;
}
public void setCurrent(String current) {
this.current = current;
}
public String getLast() {
return last;
}
public void setLast(String last) {
this.last = last;
}
public String getAll() {
return all;
}
public void setAll(String all) {
this.all = all;
}
public String getTotal() {
return total;
}
public void setTotal(String total) {
this.total = total;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@Override
public String toString() {
return "TvJsonBean{" +
"codeID='" + codeID + '\'' +
", queueID='" + queueID + '\'' +
", title='" + title + '\'' +
", current='" + current + '\'' +
", last='" + last + '\'' +
", all='" + all + '\'' +
", total='" + total + '\'' +
", color='" + color + '\'' +
'}';
}
}
package com.example.numbertakingmachine.http; package com.example.numbertakingmachine.http;
import com.example.numbertakingmachine.bean.CallBean;
import com.example.numbertakingmachine.bean.HttpResultBean; import com.example.numbertakingmachine.bean.HttpResultBean;
import com.example.numbertakingmachine.bean.PATBean; import com.example.numbertakingmachine.bean.PATBean;
...@@ -8,6 +9,7 @@ import okhttp3.RequestBody; ...@@ -8,6 +9,7 @@ import okhttp3.RequestBody;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.Body; import retrofit2.http.Body;
import retrofit2.http.GET; import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.Header; import retrofit2.http.Header;
import retrofit2.http.Headers; import retrofit2.http.Headers;
import retrofit2.http.POST; import retrofit2.http.POST;
...@@ -25,5 +27,37 @@ public interface API { ...@@ -25,5 +27,37 @@ public interface API {
@POST("index.php/hisapi/pat") @POST("index.php/hisapi/pat")
Call<HttpResultBean> pat(@Body RequestBody json); Call<HttpResultBean> pat(@Body RequestBody json);
//患者取号叫号信息获取
@Headers({"Content-Type: application/json", "Accept: application/json"})
@GET("/tvShowType")
Call<HttpResultBean> tvType(@Query("color") String color, @Query("ip") String ip, @Query("devType") String devType);
//患者取号叫号信息获取
//@HTTP(method = "DELETE", path = "path", hasBody = true)
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/tvShowData")
Call<HttpResultBean> tvData(@Body RequestBody json);
//患者取号叫号信息获取
//@HTTP(method = "DELETE", path = "path", hasBody = true)
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/tvShowListALL")
Call<HttpResultBean> allData(@Body RequestBody json);
//患者取号叫号信息获取
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/tvShowPlay")
Call<HttpResultBean> tvPlay(@Query("tips") String tips);
//患者取号叫号信息获取
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/call")
Call<CallBean> call(@Body RequestBody json);
//患者取号叫号信息获取
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("/repeat")
Call<CallBean> repeat(@Body RequestBody json);
} }
...@@ -3,8 +3,11 @@ package com.example.numbertakingmachine.http; ...@@ -3,8 +3,11 @@ package com.example.numbertakingmachine.http;
import android.util.Log; import android.util.Log;
import com.example.numbertakingmachine.bean.BasicBean; import com.example.numbertakingmachine.bean.BasicBean;
import com.example.numbertakingmachine.bean.CallBean;
import com.example.numbertakingmachine.bean.HttpResultBean; import com.example.numbertakingmachine.bean.HttpResultBean;
import com.example.numbertakingmachine.bean.PATBean; import com.example.numbertakingmachine.bean.PATBean;
import com.example.numbertakingmachine.bean.TvJsonBean;
import com.example.numbertakingmachine.utils.MyApplication;
import com.google.gson.Gson; import com.google.gson.Gson;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
...@@ -51,7 +54,7 @@ public class HttpRequest { ...@@ -51,7 +54,7 @@ public class HttpRequest {
return body; return body;
} }
public static void UpdateData(Gson gson, BasicBean basicBean){ public static void UpdateData(Gson gson, BasicBean basicBean) {
String json = gson.toJson(basicBean); String json = gson.toJson(basicBean);
Log.d("sssss", json); Log.d("sssss", json);
HttpRequest.getRetrofit(gson) HttpRequest.getRetrofit(gson)
...@@ -60,17 +63,17 @@ public class HttpRequest { ...@@ -60,17 +63,17 @@ public class HttpRequest {
.enqueue(new Callback<HttpResultBean>() { .enqueue(new Callback<HttpResultBean>() {
@Override @Override
public void onResponse(Call<HttpResultBean> call, retrofit2.Response<HttpResultBean> response) { public void onResponse(Call<HttpResultBean> call, retrofit2.Response<HttpResultBean> response) {
Log.d("sss_success", "" + response.message()); Log.d("sss_success_basic", "" + response.message());
} }
@Override @Override
public void onFailure(Call<HttpResultBean> call, Throwable t) { public void onFailure(Call<HttpResultBean> call, Throwable t) {
Log.d("sss_fail", "" + t.getMessage()); Log.d("sss_fail_basic", "" + t.getMessage());
} }
}); });
} }
public static void patData(Gson gson, PATBean batBean){ public static void patData(Gson gson, PATBean batBean) {
String json = gson.toJson(batBean); String json = gson.toJson(batBean);
Log.d("sssss", json); Log.d("sssss", json);
HttpRequest.getRetrofit(gson) HttpRequest.getRetrofit(gson)
...@@ -79,12 +82,119 @@ public class HttpRequest { ...@@ -79,12 +82,119 @@ public class HttpRequest {
.enqueue(new Callback<HttpResultBean>() { .enqueue(new Callback<HttpResultBean>() {
@Override @Override
public void onResponse(Call<HttpResultBean> call, retrofit2.Response<HttpResultBean> response) { public void onResponse(Call<HttpResultBean> call, retrofit2.Response<HttpResultBean> response) {
Log.d("sss_success", "" + response.message()); Log.d("sss_success_pat", "" + response.message());
} }
@Override @Override
public void onFailure(Call<HttpResultBean> call, Throwable t) { public void onFailure(Call<HttpResultBean> call, Throwable t) {
Log.d("sss_fail", "" + t.getMessage()); Log.d("sss_fail_pat", "" + t.getMessage());
}
});
}
/**
* @param gson
* @param ip 请求设备ip
* @param address 主机ip
* @param color 设备颜色
* @param devType 设备状态
*/
public static void tvShowType(Gson gson, String ip, String address, String color, String devType) {
Log.d("sss", ip + " | " + address + " | " + devType);
HttpRequest.getRetrofit(gson, "http://" + ip + ":8080")
.create(API.class)
.tvType(color, address, devType)
.enqueue(new Callback<HttpResultBean>() {
@Override
public void onResponse(Call<HttpResultBean> call, retrofit2.Response<HttpResultBean> response) {
Log.d("sss_success_tvType", "" + response.message());
}
@Override
public void onFailure(Call<HttpResultBean> call, Throwable t) {
Log.d("sss_fail_tvType", "" + t.getMessage());
}
});
}
public static void tvShowData(Gson gson, String url, TvJsonBean tvbean) {
String json = gson.toJson(tvbean, TvJsonBean.class);
Log.d("sss tvjson", json);
HttpRequest.getRetrofit(gson, url)
.create(API.class)
.tvData(HttpRequest.getBody(json))
.enqueue(new Callback<HttpResultBean>() {
@Override
public void onResponse(Call<HttpResultBean> call, retrofit2.Response<HttpResultBean> response) {
Log.d("sss_success_tvShowData", "" + response.message());
}
@Override
public void onFailure(Call<HttpResultBean> call, Throwable t) {
Log.d("sss_fail_tvShowData", "" + t.getMessage());
}
});
}
public static void tvShowPlay(Gson gson, String ip, String play) {
HttpRequest.getRetrofit(gson, "http://" + ip + ":8080")
.create(API.class)
.tvPlay(play)
.enqueue(new Callback<HttpResultBean>() {
@Override
public void onResponse(Call<HttpResultBean> call, retrofit2.Response<HttpResultBean> response) {
Log.d("sss_success_tvShowPlay", "" + response.message());
}
@Override
public void onFailure(Call<HttpResultBean> call, Throwable t) {
Log.d("sss_fail_tvShowPlay", "" + t.getMessage());
}
});
}
public static void callData(Gson gson, String ip, CallBean tvbean) {
String json = gson.toJson(tvbean);
String address = "";
if (ip.equals("0.0.0.0"))
address = "127.0.0.1";
else
address = ip;
HttpRequest.getRetrofit(gson, "http://" + address + ":8080")
.create(API.class)
.call(HttpRequest.getBody(json))
.enqueue(new Callback<CallBean>() {
@Override
public void onResponse(Call<CallBean> call, retrofit2.Response<CallBean> response) {
Log.d("sss_success_call", "" + response.message());
}
@Override
public void onFailure(Call<CallBean> call, Throwable t) {
Log.d("sss_fail_call", "" + t.getMessage());
}
});
}
public static void repeatData(Gson gson, String ip, CallBean tvbean) {
String json = gson.toJson(tvbean);
String address = "";
if (ip.equals("0.0.0.0"))
address = "127.0.0.1";
else
address = ip;
HttpRequest.getRetrofit(gson, "http://" + address + ":8080")
.create(API.class)
.repeat(HttpRequest.getBody(json))
.enqueue(new Callback<CallBean>() {
@Override
public void onResponse(Call<CallBean> call, retrofit2.Response<CallBean> response) {
Log.d("sss_success_repeat", "" + response.message());
}
@Override
public void onFailure(Call<CallBean> call, Throwable t) {
Log.d("sss_fail_repeat", "" + t.getMessage());
} }
}); });
} }
......
...@@ -102,6 +102,15 @@ public class MyServer extends Service { ...@@ -102,6 +102,15 @@ public class MyServer extends Service {
} catch (RemoteException e) { } catch (RemoteException e) {
e.printStackTrace(); e.printStackTrace();
} }
case 0x30:
message = this.obtainMessage();
message.what = 0x30;
message.obj = msg.obj;
try {
mActivityMessenger.send(message);
} catch (RemoteException e) {
e.printStackTrace();
}
break; break;
} }
} }
......
...@@ -2,7 +2,7 @@ package com.example.numbertakingmachine.sql; ...@@ -2,7 +2,7 @@ package com.example.numbertakingmachine.sql;
public class BaseUtils { public class BaseUtils {
public static final int VERSION = 2; public static final int VERSION = 3;
public static final String DB = "ntmrecord.db"; public static final String DB = "ntmrecord.db";
//记录表 //记录表
...@@ -14,9 +14,12 @@ public class BaseUtils { ...@@ -14,9 +14,12 @@ public class BaseUtils {
public static final String all = "allnum"; public static final String all = "allnum";
public static final String last = "last"; public static final String last = "last";
public static final String current = "current"; public static final String current = "current";
public static final String prefix = "prefix";
public static final String codeID = "codeID";//呼叫器ID public static final String codeID = "codeID";//呼叫器ID
public static final String queueID = "queueID";//列名ID public static final String queueID = "queueID";//列名ID
public static final String total = "total";//总数 public static final String total = "total";//总数
public static final String title = "title";//列名
public static final String type = "type";//取号叫号状态 0.待打印 1.已打印待叫号 2.已呼叫、重呼 3.弃号
} }
//配置表 //配置表
...@@ -28,9 +31,14 @@ public class BaseUtils { ...@@ -28,9 +31,14 @@ public class BaseUtils {
public static final String devType = "devType";//取号机类型 public static final String devType = "devType";//取号机类型
public static final String tips = "tips";//提示语 public static final String tips = "tips";//提示语
public static final String comTitle = "comTitle";//单位名称 public static final String comTitle = "comTitle";//单位名称
public static final String address = "address";//单位名称
public static final String comNmb = "comNmb";//单位编号
public static final String devTitle = "devTitle";//设备名称
public static final String isNet = "isNet";//是否开启网络
public static final String devNtm = "devNtm";//设备编号
public static final String QR = "QR";//绿色通道码 public static final String QR = "QR";//绿色通道码
public static final String logo = "logo";//logo base64
public static final String bg_type = "bg_type";//背景样式 public static final String bg_type = "bg_type";//背景样式
public static final String logo = "logo";//logo base64
public static final String AIO = "AIO";//一体机 base64 public static final String AIO = "AIO";//一体机 base64
public static final String horizontal = "horizontal";//横版 base64 public static final String horizontal = "horizontal";//横版 base64
public static final String vertical = "vertical";//竖版 base64 public static final String vertical = "vertical";//竖版 base64
...@@ -69,10 +77,43 @@ public class BaseUtils { ...@@ -69,10 +77,43 @@ public class BaseUtils {
public static final String title = "title";//呼叫器窗口名称 public static final String title = "title";//呼叫器窗口名称
public static final String queueID = "queueID";//队列标头 public static final String queueID = "queueID";//队列标头
public static final String playType = "playType";//播放类型 public static final String playType = "playType";//播放类型
public static final String type = "type";//呼叫器类型
}
//播放器表
public static final class NTMVPlayTable {
public static final String NAME = "videopalystable";//表名
public static final String id = "id";
public static final String codeID = "codeID";//设备码值
public static final String play_video = "vPlayIP";//播放音频设备IP public static final String play_video = "vPlayIP";//播放音频设备IP
}
//大屏表
public static final class NTMSPlayTable {
public static final String NAME = "showpalystable";//表名
public static final String id = "id";
public static final String codeID = "codeID";//设备码值
public static final String play_show = "sPlayIP";//展示屏设备IP public static final String play_show = "sPlayIP";//展示屏设备IP
public static final String play_showColor = "color";//展示屏底色 public static final String play_showColor = "color";//展示屏底色
public static final String type = "type";//呼叫器类型 public static final String devType = "devType";//展示屏le类型 0大屏1小屏
}
//LED表
public static final class NTMledTable {
public static final String NAME = "ledstable";//表名
public static final String id = "id";
public static final String codeID = "codeID";//设备码值
public static final String led_adr = "led_adr";//led地址
public static final String ENcolor = "ENcolor";//字母或数字颜色
public static final String CNcolor = "CNcolor";//汉字颜色底色
}
//物理播放器表
public static final class NTMPlayerTable {
public static final String NAME = "playerstable";//表名
public static final String id = "id";
public static final String codeID = "codeID";//设备码值
public static final String adr = "led_adr";//led地址
} }
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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